@contrail/documents 1.5.6 → 1.6.0-alpha-fetch.1

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
@@ -7,6 +7,18 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Document transaction contract types for the transactional write path: `DocumentOperation`, `DocumentElementPatch`, `WriteTransactionRequest`, and `WriteTransactionResponse`.
13
+ - `DocumentTransaction` and `GetDocumentTransactionsResponse` types for reading committed transactions back (client catch-up and gap repair).
14
+ - `DocumentWriteMode` type and an optional `writeMode` field on the `Document` interface, used to gate the transactional write path.
15
+
16
+ ## [1.5.6] - 2026-04-29
17
+
18
+ ### Fixed
19
+
20
+ - `DynamicTextUtil.getItemCount` now filters out component models missing both `item` and `color` to avoid errors when underlying models fail to fetch.
21
+
10
22
  ## [1.5.3] - 2026-04-22
11
23
 
12
24
  ### Added
@@ -0,0 +1,33 @@
1
+ import { DocumentElement } from './document-element';
2
+ export type DocumentOperation = {
3
+ action: 'createElement';
4
+ element: DocumentElement;
5
+ } | {
6
+ action: 'updateElement';
7
+ elementId: string;
8
+ changes: DocumentElementPatch;
9
+ } | {
10
+ action: 'deleteElement';
11
+ elementId: string;
12
+ };
13
+ export type DocumentElementPatch = Partial<Omit<DocumentElement, 'id' | 'documentId'>>;
14
+ export interface WriteTransactionRequest {
15
+ clientTransactionId?: string;
16
+ operations: DocumentOperation[];
17
+ }
18
+ export interface WriteTransactionResponse {
19
+ sequenceNumber: number;
20
+ createdOn: string;
21
+ createdById: string;
22
+ clientTransactionId?: string;
23
+ }
24
+ export interface DocumentTransaction {
25
+ sequenceNumber: number;
26
+ clientTransactionId?: string;
27
+ operations: DocumentOperation[];
28
+ }
29
+ export interface GetDocumentTransactionsResponse {
30
+ transactions: DocumentTransaction[];
31
+ hasMore: boolean;
32
+ lastReturnedSequenceNumber: number;
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,6 +4,7 @@ export interface ImportReferenceDetail {
4
4
  importedSlideReference?: string;
5
5
  importedFileReference?: string;
6
6
  }
7
+ export type DocumentWriteMode = 'transactional';
7
8
  export interface Document {
8
9
  id?: string;
9
10
  name?: string;
@@ -22,4 +23,5 @@ export interface Document {
22
23
  };
23
24
  clipContent?: boolean;
24
25
  ownedByReference?: string;
26
+ writeMode?: DocumentWriteMode;
25
27
  }
@@ -6,4 +6,5 @@ export * from './document-element-holder';
6
6
  export * from './document-element';
7
7
  export * from './document-navigation-event';
8
8
  export * from './document';
9
+ export * from './document-transaction';
9
10
  export * from './element-transformation';
@@ -22,4 +22,5 @@ __exportStar(require("./document-element-holder"), exports);
22
22
  __exportStar(require("./document-element"), exports);
23
23
  __exportStar(require("./document-navigation-event"), exports);
24
24
  __exportStar(require("./document"), exports);
25
+ __exportStar(require("./document-transaction"), exports);
25
26
  __exportStar(require("./element-transformation"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.5.6",
3
+ "version": "1.6.0-alpha-fetch.1",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",