import { Observable } from 'rxjs' ; import { map } from 'rxjs/operators' ; import { ODataApi } from '../../api' ; import { $METADATA } from '../../constants' ; import { PathSegmentNames } from '../../types' ; import { ODataPathSegments } from '../path' ; import { ODataResource } from '../resource' ; import { ODataMetadata } from '../responses' ; import { ODataOptions } from './options' ; export class ODataMetadataResource extends ODataResource < any > { constructor ( api , segments ? ) { super ( api , { segments } ) ; } static factory ( api ) { let segments = new ODataPathSegments ( ) ; segments . add ( PathSegmentNames . metadata , $METADATA ) ; return new ODataMetadataResource ( api , segments ) ; } protected override get ( options ? ) { return super . get ( { responseType : 'text' , ... options } ) . pipe ( map ( ( body ) => new ODataMetadata ( body ) ) ) ; } fetch ( options ? ) { return this . get ( options ) ; } }