2023-10-17 09:15:55 +03:00
|
|
|
/* tslint:disable */
|
2023-06-29 04:45:45 +03:00
|
|
|
/* eslint-disable */
|
|
|
|
|
2023-10-17 09:15:55 +03:00
|
|
|
/* auto-generated by NAPI-RS */
|
|
|
|
|
2023-10-19 10:17:04 +03:00
|
|
|
export function verifyChallengeResponse(response: string, bits: number, resource: string): Promise<boolean>
|
|
|
|
export function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise<string>
|
2023-10-17 09:15:55 +03:00
|
|
|
export interface Blob {
|
2023-10-19 10:17:04 +03:00
|
|
|
contentType: string
|
|
|
|
lastModified: string
|
|
|
|
size: number
|
|
|
|
data: Buffer
|
2023-10-17 09:15:55 +03:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
|
|
|
|
* result binary.
|
|
|
|
*/
|
2023-10-19 10:17:04 +03:00
|
|
|
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer
|
2023-06-29 04:45:45 +03:00
|
|
|
export class Storage {
|
|
|
|
/** Create a storage instance and establish connection to persist store. */
|
2023-10-19 10:17:04 +03:00
|
|
|
static connect(database: string, debugOnlyAutoMigrate?: boolean | undefined | null): Promise<Storage>
|
2023-08-29 13:07:05 +03:00
|
|
|
/** List all blobs in a workspace. */
|
2023-10-19 10:17:04 +03:00
|
|
|
listBlobs(workspaceId?: string | undefined | null): Promise<Array<string>>
|
2023-06-29 04:45:45 +03:00
|
|
|
/** Fetch a workspace blob. */
|
2023-10-19 10:17:04 +03:00
|
|
|
getBlob(workspaceId: string, name: string): Promise<Blob | null>
|
2023-06-29 04:45:45 +03:00
|
|
|
/** Upload a blob into workspace storage. */
|
2023-10-19 10:17:04 +03:00
|
|
|
uploadBlob(workspaceId: string, blob: Buffer): Promise<string>
|
2023-08-29 13:07:05 +03:00
|
|
|
/** Delete a blob from workspace storage. */
|
2023-10-19 10:17:04 +03:00
|
|
|
deleteBlob(workspaceId: string, hash: string): Promise<boolean>
|
2023-06-29 04:45:45 +03:00
|
|
|
/** Workspace size taken by blobs. */
|
2023-10-19 10:17:04 +03:00
|
|
|
blobsSize(workspaces: Array<string>): Promise<number>
|
2023-06-29 04:45:45 +03:00
|
|
|
}
|