Update TS bindings
This commit is contained in:
parent
98da806253
commit
19502cb967
23 changed files with 81 additions and 85 deletions
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[env]
|
||||||
|
TS_RS_EXPORT_DIR = { value = "frontend/sync-client/src/services/types", relative = true }
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -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*
|
||||||
|
|
|
||||||
|
|
@ -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.
|
// 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[];
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
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 {
|
export interface PingResponse {
|
||||||
/**
|
/**
|
||||||
* Semantic version of the server.
|
* Semantic version of the server.
|
||||||
*/
|
*/
|
||||||
serverVersion: string;
|
serverVersion: string;
|
||||||
/**
|
/**
|
||||||
* Whether the client is authenticated based on the sent Authorization
|
* Whether the client is authenticated based on the sent Authorization
|
||||||
* header.
|
* header.
|
||||||
*/
|
*/
|
||||||
isAuthenticated: boolean;
|
isAuthenticated: boolean;
|
||||||
/**
|
/**
|
||||||
* List of file extensions that are allowed to be merged.
|
* List of file extensions that are allowed to be merged.
|
||||||
*/
|
*/
|
||||||
mergeableFileExtensions: string[];
|
mergeableFileExtensions: string[];
|
||||||
/**
|
/**
|
||||||
* API version ensuring backwards & forwards compatibility between the client
|
* API version ensuring backwards & forwards compatibility between the client
|
||||||
* and server.
|
* and server.
|
||||||
*/
|
*/
|
||||||
supportedApiVersion: number;
|
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 };
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue