feat!: affine cloud support (#3813)

Co-authored-by: Hongtao Lye <codert.sn@gmail.com>
Co-authored-by: liuyi <forehalo@gmail.com>
Co-authored-by: LongYinan <lynweklm@gmail.com>
Co-authored-by: X1a0t <405028157@qq.com>
Co-authored-by: JimmFly <yangjinfei001@gmail.com>
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
Co-authored-by: xiaodong zuo <53252747+zuoxiaodong0815@users.noreply.github.com>
Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
Co-authored-by: Qi <474021214@qq.com>
Co-authored-by: danielchim <kahungchim@gmail.com>
This commit is contained in:
Alex Yang
2023-08-29 05:07:05 -05:00
committed by GitHub
parent d0145c6f38
commit 2f6c4e3696
414 changed files with 19469 additions and 7591 deletions
+7 -29
View File
@@ -1,44 +1,24 @@
/* auto-generated by NAPI-RS */
/* eslint-disable */
export class Doc {
get guid(): string;
}
export class Storage {
/** Create a storage instance and establish connection to persist store. */
static connect(
database: string,
debugOnlyAutoMigrate?: boolean | undefined | null
): Promise<Storage>;
/** Get a workspace by id */
getWorkspace(workspaceId: string): Promise<Workspace | null>;
/** Create a new workspace with a init update. */
createWorkspace(workspaceId: string, init: Buffer): Promise<Workspace>;
/** Delete a workspace. */
deleteWorkspace(workspaceId: string): Promise<void>;
/** Sync doc updates. */
sync(workspaceId: string, guid: string, update: Buffer): Promise<void>;
/** Sync doc update with doc guid encoded. */
syncWithGuid(workspaceId: string, update: Buffer): Promise<void>;
/** Load doc as update buffer. */
load(guid: string): Promise<Buffer | null>;
/** List all blobs in a workspace. */
listBlobs(workspaceId?: string | undefined | null): Promise<Array<string>>;
/** Fetch a workspace blob. */
blob(workspaceId: string, name: string): Promise<Blob | null>;
getBlob(workspaceId: string, name: string): Promise<Blob | null>;
/** Upload a blob into workspace storage. */
uploadBlob(workspaceId: string, blob: Buffer): Promise<string>;
/** Delete a blob from workspace storage. */
deleteBlob(workspaceId: string, hash: string): Promise<boolean>;
/** Workspace size taken by blobs. */
blobsSize(workspaceId: string): Promise<number>;
}
export class Workspace {
get doc(): Doc;
isEmpty(): boolean;
get id(): string;
get clientId(): string;
search(query: string): Array<SearchResult>;
}
export interface Blob {
contentType: string;
lastModified: string;
@@ -46,7 +26,5 @@ export interface Blob {
data: Buffer;
}
export interface SearchResult {
blockId: string;
score: number;
}
/** Merge updates in form like `Y.applyUpdate(doc, update)` way and return the result binary. */
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer;