Files
speckle-server/packages/server/modules/blobstorage/domain/operations.ts
T
2024-09-12 14:24:28 +03:00

33 lines
928 B
TypeScript

import {
BlobStorageItem,
BlobStorageItemInput
} from '@/modules/blobstorage/domain/types'
import { MaybeNullOrUndefined, Nullable } from '@speckle/shared'
export type GetBlobs = (params: {
streamId?: MaybeNullOrUndefined<string>
blobIds: string[]
}) => Promise<BlobStorageItem[]>
export type UpsertBlob = (item: BlobStorageItemInput) => Promise<BlobStorageItem>
export type UpdateBlob = (params: {
id: string
item: Partial<BlobStorageItem>
streamId?: string
}) => Promise<BlobStorageItem>
export type DeleteBlob = (params: { id: string; streamId?: string }) => Promise<number>
export type GetBlobMetadata = (params: {
blobId: string
streamId: string
}) => Promise<BlobStorageItem>
export type GetBlobMetadataCollection = (params: {
streamId: string
query?: Nullable<string>
limit?: Nullable<number>
cursor?: Nullable<string>
}) => Promise<{ blobs: BlobStorageItem[]; cursor: Nullable<string> }>