@oystehr/sdk
Version:
Oystehr SDK
33 lines (32 loc) • 1.19 kB
TypeScript
import { SDKResource } from '../../client/client';
import { Z3GetPresignedUrlParams, Z3GetPresignedUrlResponse } from '../types';
/**
* Uploads a file to the bucket and key. Files should be Blobs.
*
* @param params upload file params
*/
export declare function uploadFile(this: SDKResource, { bucketName, 'objectPath+': key, file, }: {
bucketName: string;
'objectPath+': string;
file: Blob;
}): Promise<void>;
/**
* Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.
*
* @param params download file params
*/
export declare function downloadFile(this: SDKResource, { bucketName, 'objectPath+': key, }: {
bucketName: string;
'objectPath+': string;
}): Promise<ArrayBuffer>;
/**
* This helper performs a `getPresignedUrl` request for Z3 URLs of the forms
* `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`
* instead of the standard SDK `Z3GetPresignedUrlParams`.
*
* @param params url and action
*/
export declare function getPresignedUrlForZ3Url(this: SDKResource, params: {
url: string;
action: Z3GetPresignedUrlParams['action'];
}): Promise<Z3GetPresignedUrlResponse>;