import type { AxiosInstance } from 'contentful-sdk-core' ; import { Stream } from 'stream' ; import * as raw from './raw' ; import { GetAppUploadParams , GetOrganizationParams } from '../../../common-types' ; import { RestEndpoint } from '../types' ; import { AppUploadProps } from '../../../entities/app-upload' ; import { getUploadHttpClient } from '../../../upload-http-client' ; const getBaseUrl = ( params ) => `/organizations/${ params . organizationId }/app_uploads` ; const getAppUploadUrl = ( params ) => `${ getBaseUrl ( params ) }/${ params . appUploadId }` ; export const get = ( http , params ) => { const httpUpload = getUploadHttpClient ( http ) ; return raw . get < AppUploadProps > ( httpUpload , getAppUploadUrl ( params ) ) ; } ; export const del = ( http , params ) => { const httpUpload = getUploadHttpClient ( http ) ; return raw . del < void > ( httpUpload , getAppUploadUrl ( params ) ) ; } ; export const create = ( http , params , payload ) => { const httpUpload = getUploadHttpClient ( http ) ; const { file } = payload ; return raw . post < AppUploadProps > ( httpUpload , getBaseUrl ( params ) , file , { headers : { 'Content-Type' : 'application/octet-stream' , } , } ) ; } ;