.
This commit is contained in:
parent
6a8c7635f1
commit
d715d94b6d
26 changed files with 1006 additions and 452 deletions
|
|
@ -81,7 +81,12 @@ export class ApiClient {
|
|||
): Promise<ArrayBuffer> {
|
||||
const response = await fetch(
|
||||
`${this.baseUrl}/documents/${documentId}/versions/${vaultUpdateId}/content`,
|
||||
{ headers: this.headers() }
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${this.token}`,
|
||||
"device-id": "history-ui"
|
||||
}
|
||||
}
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type CreateDocumentVersion = { relative_path: string, content: Array<number>, };
|
||||
export type CreateDocumentVersion = { relative_path: string, last_seen_vault_update_id: number, content: Array<number>, };
|
||||
|
|
|
|||
|
|
@ -4,9 +4,5 @@ import type { DocumentUpdateMetadata } from "./DocumentUpdateMetadata";
|
|||
|
||||
/**
|
||||
* Response to a create/update document request.
|
||||
*
|
||||
* Neither variant contains `relative_path`: the client tracks the document's
|
||||
* on-disk path locally and the server is the authority on document identity
|
||||
* (`document_id`), not on its path.
|
||||
*/
|
||||
export type DocumentUpdateResponse = { "type": "FastForwardUpdate" } & DocumentUpdateMetadata | { "type": "MergingUpdate" } & DocumentUpdateMergedContent;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CursorSpan } from "./CursorSpan";
|
||||
|
||||
export type DocumentWithCursors = { vault_update_id: number | null, document_id: string, relative_path: string, cursors: Array<CursorSpan>, };
|
||||
export type DocumentWithCursors = { vaultUpdateId: number | null, documentId: string, relativePath: string, cursors: Array<CursorSpan>, };
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
/**
|
||||
* A rename notification. Emitted whenever a write commits a document at
|
||||
* a path that differs from what the origin client sent and/or from the
|
||||
* document's previous stored path. Unlike [`WebSocketVaultUpdate`] this
|
||||
* event is delivered to all subscribers *including the origin device*,
|
||||
* because the create/update HTTP response no longer carries the path and
|
||||
* the origin needs this event to learn the server-canonical path
|
||||
* (e.g. when the server deduped or rejected a rename).
|
||||
*/
|
||||
export type WebSocketVaultPathChange = { vaultUpdateId: number, documentId: string, relativePath: string, };
|
||||
export type WebSocketVaultPathChange = { vaultUpdateId: number, documentId: string, relativePath: string, updatedDate: string, userId: string, deviceId: string, };
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutContent";
|
||||
|
||||
export type { DocumentVersion } from "./DocumentVersion";
|
||||
export type { DocumentVersionWithoutContent } from "./DocumentVersionWithoutContent";
|
||||
export type { FetchLatestDocumentsResponse } from "./FetchLatestDocumentsResponse";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue