@contrail/documents 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,8 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
12
|
- Document transaction contract types for the transactional write path: `DocumentOperation`, `DocumentElementPatch`, `WriteTransactionRequest`, and `WriteTransactionResponse`.
|
|
13
|
-
- `DocumentWriteMode`
|
|
13
|
+
- `DocumentWriteMode` (`'transactional' | 'legacy'`) and an optional `writeMode` field on the `Document` interface, used to gate the transactional write path. Both `undefined` and `'legacy'` mean the legacy path, so existing documents need no backfill; `'transactional'` opts a document in.
|
|
14
|
+
- `DocumentTransactionMessage` — the WebSocket broadcast shape for a committed transaction (carries `sequenceNumber`, `clientTransactionId`, and inline `operations` or an `operationsDownloadUrl`).
|
|
14
15
|
|
|
15
16
|
## [1.5.6] - 2026-04-29
|
|
16
17
|
|
|
@@ -21,3 +21,18 @@ export interface WriteTransactionResponse {
|
|
|
21
21
|
createdById: string;
|
|
22
22
|
clientTransactionId?: string;
|
|
23
23
|
}
|
|
24
|
+
interface DocumentTransactionMessageBase {
|
|
25
|
+
type: 'DOCUMENT_TRANSACTION';
|
|
26
|
+
documentId: string;
|
|
27
|
+
sequenceNumber: number;
|
|
28
|
+
createdOn: string;
|
|
29
|
+
clientTransactionId?: string;
|
|
30
|
+
}
|
|
31
|
+
export type DocumentTransactionMessage = (DocumentTransactionMessageBase & {
|
|
32
|
+
operations: DocumentOperation[];
|
|
33
|
+
operationsDownloadUrl?: never;
|
|
34
|
+
}) | (DocumentTransactionMessageBase & {
|
|
35
|
+
operationsDownloadUrl: string;
|
|
36
|
+
operations?: never;
|
|
37
|
+
});
|
|
38
|
+
export {};
|
package/lib/types/document.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ImportReferenceDetail {
|
|
|
4
4
|
importedSlideReference?: string;
|
|
5
5
|
importedFileReference?: string;
|
|
6
6
|
}
|
|
7
|
-
export type DocumentWriteMode = 'transactional';
|
|
7
|
+
export type DocumentWriteMode = 'transactional' | 'legacy';
|
|
8
8
|
export interface Document {
|
|
9
9
|
id?: string;
|
|
10
10
|
name?: string;
|