Update TS bindings
This commit is contained in:
parent
98da806253
commit
19502cb967
20 changed files with 81 additions and 85 deletions
|
|
@ -1,13 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface CreateDocumentVersion {
|
||||
/**
|
||||
* The client can decide the document id (if it wishes to) in order
|
||||
* to help with syncing. If the client does not provide a document id,
|
||||
* the server will generate one. If the client provides a document id
|
||||
* it must not already exist in the database.
|
||||
*/
|
||||
document_id: string | null;
|
||||
relative_path: string;
|
||||
content: number[];
|
||||
}
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ClientCursors } from "./ClientCursors";
|
||||
|
||||
export interface CursorPositionFromServer {
|
||||
clients: ClientCursors[];
|
||||
}
|
||||
export interface CursorPositionFromServer { clients: ClientCursors[] }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface CursorSpan {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
export interface CursorSpan { start: number; end: number }
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutCont
|
|||
* Response to an update document request.
|
||||
*/
|
||||
export type DocumentUpdateResponse =
|
||||
| ({ type: "FastForwardUpdate" } & DocumentVersionWithoutContent)
|
||||
| ({ type: "MergingUpdate" } & DocumentVersion);
|
||||
| ({ type: "Accepted" } & DocumentVersionWithoutContent)
|
||||
| ({ type: "StaleBase" } & DocumentVersion);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface DocumentVersion {
|
||||
contentBase64: string;
|
||||
vaultUpdateId: number;
|
||||
documentId: string;
|
||||
relativePath: string;
|
||||
updatedDate: string;
|
||||
contentBase64: string;
|
||||
isDeleted: boolean;
|
||||
userId: string;
|
||||
deviceId: string;
|
||||
contentSize: number;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
export interface DocumentVersionWithoutContent {
|
||||
vaultUpdateId: number;
|
||||
documentId: string;
|
||||
relativePath: string;
|
||||
updatedDate: string;
|
||||
isDeleted: boolean;
|
||||
userId: string;
|
||||
deviceId: string;
|
||||
contentSize: number;
|
||||
|
|
|
|||
4
frontend/sync-client/src/services/types/EventBatch.ts
Normal file
4
frontend/sync-client/src/services/types/EventBatch.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { EventRecord } from "./EventRecord";
|
||||
|
||||
export interface EventBatch { headEventId: number; events: EventRecord[] }
|
||||
8
frontend/sync-client/src/services/types/EventRecord.ts
Normal file
8
frontend/sync-client/src/services/types/EventRecord.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutContent";
|
||||
import type { Manifest } from "./Manifest";
|
||||
|
||||
export type EventRecord = { eventId: number; requestId: string } & (
|
||||
| { type: "content"; document: DocumentVersionWithoutContent }
|
||||
| { type: "manifest"; manifest: Manifest }
|
||||
);
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutContent";
|
||||
|
||||
/**
|
||||
* Response to a fetch latest documents request.
|
||||
*/
|
||||
export interface FetchLatestDocumentsResponse {
|
||||
latestDocuments: DocumentVersionWithoutContent[];
|
||||
/**
|
||||
* The update ID of the latest document in the response.
|
||||
*/
|
||||
lastUpdateId: bigint;
|
||||
}
|
||||
3
frontend/sync-client/src/services/types/Manifest.ts
Normal file
3
frontend/sync-client/src/services/types/Manifest.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface Manifest { manifestId: number; entries: Record<string, string> }
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { Manifest } from "./Manifest";
|
||||
|
||||
export type ManifestUpdateResponse =
|
||||
| ({ type: "Accepted" } & Manifest)
|
||||
| ({ type: "StaleBase" } & Manifest);
|
||||
|
|
@ -5,21 +5,21 @@
|
|||
*/
|
||||
export interface PingResponse {
|
||||
/**
|
||||
* Semantic version of the server.
|
||||
*/
|
||||
* Semantic version of the server.
|
||||
*/
|
||||
serverVersion: string;
|
||||
/**
|
||||
* Whether the client is authenticated based on the sent Authorization
|
||||
* header.
|
||||
*/
|
||||
* Whether the client is authenticated based on the sent Authorization
|
||||
* header.
|
||||
*/
|
||||
isAuthenticated: boolean;
|
||||
/**
|
||||
* List of file extensions that are allowed to be merged.
|
||||
*/
|
||||
* List of file extensions that are allowed to be merged.
|
||||
*/
|
||||
mergeableFileExtensions: string[];
|
||||
/**
|
||||
* API version ensuring backwards & forwards compatibility between the client
|
||||
* and server.
|
||||
*/
|
||||
* API version ensuring backwards & forwards compatibility between the client
|
||||
* and server.
|
||||
*/
|
||||
supportedApiVersion: number;
|
||||
}
|
||||
|
|
|
|||
5
frontend/sync-client/src/services/types/PushContent.ts
Normal file
5
frontend/sync-client/src/services/types/PushContent.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type PushContent =
|
||||
| { type: "Snapshot"; value: string }
|
||||
| { type: "Diff"; value: (number | string)[] };
|
||||
8
frontend/sync-client/src/services/types/PushDocument.ts
Normal file
8
frontend/sync-client/src/services/types/PushDocument.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { PushContent } from "./PushContent";
|
||||
|
||||
export interface PushDocument {
|
||||
requestId: string;
|
||||
parentVersionId: number | null;
|
||||
content: PushContent;
|
||||
}
|
||||
7
frontend/sync-client/src/services/types/PushManifest.ts
Normal file
7
frontend/sync-client/src/services/types/PushManifest.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface PushManifest {
|
||||
requestId: string;
|
||||
parentManifestId: number;
|
||||
entries: Record<string, string>;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface UpdateDocumentVersion {
|
||||
parent_version_id: bigint;
|
||||
relative_path: string;
|
||||
content: number[];
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface UpdateTextDocumentVersion {
|
||||
parentVersionId: number;
|
||||
relativePath: string;
|
||||
content: (number | string)[];
|
||||
}
|
||||
7
frontend/sync-client/src/services/types/VaultEvent.ts
Normal file
7
frontend/sync-client/src/services/types/VaultEvent.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutContent";
|
||||
import type { Manifest } from "./Manifest";
|
||||
|
||||
export type VaultEvent =
|
||||
| { type: "content"; document: DocumentVersionWithoutContent }
|
||||
| { type: "manifest"; manifest: Manifest };
|
||||
9
frontend/sync-client/src/services/types/VaultSnapshot.ts
Normal file
9
frontend/sync-client/src/services/types/VaultSnapshot.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutContent";
|
||||
import type { Manifest } from "./Manifest";
|
||||
|
||||
export interface VaultSnapshot {
|
||||
headEventId: number;
|
||||
manifest: Manifest;
|
||||
documents: DocumentVersionWithoutContent[];
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CursorPositionFromServer } from "./CursorPositionFromServer";
|
||||
import type { WebSocketVaultUpdate } from "./WebSocketVaultUpdate";
|
||||
import type { EventBatch } from "./EventBatch";
|
||||
|
||||
export type WebSocketServerMessage =
|
||||
| ({ type: "vaultUpdate" } & WebSocketVaultUpdate)
|
||||
| ({ type: "vaultEvents" } & EventBatch)
|
||||
| ({ type: "cursorPositions" } & CursorPositionFromServer);
|
||||
|
|
|
|||
Loading…
Reference in a new issue