Update TS bindings

This commit is contained in:
Andras Schmelczer 2026-09-19 15:19:48 +01:00
commit 19502cb967
23 changed files with 81 additions and 85 deletions

2
.cargo/config.toml Normal file
View file

@ -0,0 +1,2 @@
[env]
TS_RS_EXPORT_DIR = { value = "frontend/sync-client/src/services/types", relative = true }

1
.gitignore vendored
View file

@ -10,7 +10,6 @@ frontend/*/dist
# Rust build folders # Rust build folders
sync-server/target sync-server/target
sync-server/artifacts sync-server/artifacts
sync-server/bindings/*.ts
# build folders # build folders
sync-server/db.sqlite3* sync-server/db.sqlite3*

View file

@ -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[];
}

View file

@ -1,6 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // 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"; import type { ClientCursors } from "./ClientCursors";
export interface CursorPositionFromServer { export interface CursorPositionFromServer { clients: ClientCursors[] }
clients: ClientCursors[];
}

View file

@ -1,6 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CursorSpan { export interface CursorSpan { start: number; end: number }
start: number;
end: number;
}

View file

@ -6,5 +6,5 @@ import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutCont
* Response to an update document request. * Response to an update document request.
*/ */
export type DocumentUpdateResponse = export type DocumentUpdateResponse =
| ({ type: "FastForwardUpdate" } & DocumentVersionWithoutContent) | ({ type: "Accepted" } & DocumentVersionWithoutContent)
| ({ type: "MergingUpdate" } & DocumentVersion); | ({ type: "StaleBase" } & DocumentVersion);

View file

@ -1,12 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface DocumentVersion { export interface DocumentVersion {
contentBase64: string;
vaultUpdateId: number; vaultUpdateId: number;
documentId: string; documentId: string;
relativePath: string;
updatedDate: string; updatedDate: string;
contentBase64: string;
isDeleted: boolean;
userId: string; userId: string;
deviceId: string; deviceId: string;
contentSize: number;
} }

View file

@ -3,9 +3,7 @@
export interface DocumentVersionWithoutContent { export interface DocumentVersionWithoutContent {
vaultUpdateId: number; vaultUpdateId: number;
documentId: string; documentId: string;
relativePath: string;
updatedDate: string; updatedDate: string;
isDeleted: boolean;
userId: string; userId: string;
deviceId: string; deviceId: string;
contentSize: number; contentSize: number;

View 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[] }

View 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 }
);

View file

@ -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;
}

View 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> }

View file

@ -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);

View 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)[] };

View 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;
}

View 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>;
}

View file

@ -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[];
}

View file

@ -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)[];
}

View 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 };

Some files were not shown because too many files have changed in this diff Show more