import { Observable } from 'rxjs' ; import { ODataApi } from '../../api' ; import { $VALUE } from '../../constants' ; import { PathSegmentNames } from '../../types' ; import { Http } from '../../utils' ; import { ODataPathSegments } from '../path' ; import { ODataQueryOptions } from '../query' ; import { ODataResource } from '../resource' ; import { ODataOptions } from './options' ; export class ODataMediaResource extends ODataResource < any > { static factory < V > ( api , { segments , query , } ) { segments . add ( PathSegmentNames . value , $VALUE ) ; return new ODataMediaResource ( api , { segments , query } ) ; } protected override get ( options ) { return super . get ( options ) ; } protected override put ( data , options = { } ) { return super . put ( data , options ) ; } fetch ( options ? ) ; fetch ( options ? ) ; fetch ( options ) { return this . get ( options ) ; } fetchArraybuffer ( options = { } ) { return this . fetch ( { responseType : 'arraybuffer' , ... options } ) ; } fetchBlob ( options = { } ) { return this . fetch ( { responseType : 'blob' , ... options } ) ; } upload ( data , options = { } ) { return this . put ( data , options ) ; } uploadArrayBuffer ( data , contentType , options = { } ) { options . headers = Http . mergeHttpHeaders ( options . headers || { } , { 'Content-Type' : contentType , } ) ; return this . upload ( data , options ) ; } uploadBlob ( data , options = { } ) { return this . upload ( data , options ) ; } }