@contrail/documents 1.5.5 → 1.6.0-alpha.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
@@ -7,6 +7,12 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.5.6] - 2026-04-29
11
+
12
+ ### Fixed
13
+
14
+ - `DynamicTextUtil.getItemCount` now filters out component models missing both `item` and `color` to avoid errors when underlying models fail to fetch.
15
+
10
16
  ## [1.5.3] - 2026-04-22
11
17
 
12
18
  ### Added
@@ -0,0 +1,40 @@
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: Partial<DocumentElement>;
9
+ } | {
10
+ action: 'deleteElement';
11
+ elementId: string;
12
+ };
13
+ export interface DocumentTransactionMetadata {
14
+ sequenceNumber: number;
15
+ documentId: string;
16
+ createdOn: string;
17
+ createdById: string;
18
+ clientTransactionId?: string;
19
+ }
20
+ export type StoredPayload = {
21
+ operations: DocumentOperation[];
22
+ } | {
23
+ operationsS3Key: string;
24
+ };
25
+ export type ReadPayload = {
26
+ operations: DocumentOperation[];
27
+ } | {
28
+ operationsDownloadUrl: string;
29
+ };
30
+ export type DocumentTransactionRecord = DocumentTransactionMetadata & StoredPayload;
31
+ export type DocumentTransactionMessage = DocumentTransactionMetadata & ReadPayload;
32
+ export type WriteTransactionRequest = {
33
+ clientTransactionId?: string;
34
+ } & StoredPayload;
35
+ export interface WriteTransactionResponse {
36
+ sequenceNumber: number;
37
+ createdOn: string;
38
+ createdById: string;
39
+ clientTransactionId?: string;
40
+ }
@@ -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 = 'legacy' | '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);
@@ -105,12 +105,10 @@ class DynamicTextUtil {
105
105
  }
106
106
  else {
107
107
  if (entityType === 'assortmentItem') {
108
- componentModels = Array.from(new Map(componentModels
109
- .filter((model) => model.item && model.assortmentItem)
110
- .map((model) => { var _a, _b; return [((_a = model.item) === null || _a === void 0 ? void 0 : _a.id) + '_' + ((_b = model.assortmentItem) === null || _b === void 0 ? void 0 : _b.id), model]; })).values());
108
+ componentModels = Array.from(new Map(componentModels.map((model) => { var _a, _b; return [((_a = model.item) === null || _a === void 0 ? void 0 : _a.id) + '_' + ((_b = model.assortmentItem) === null || _b === void 0 ? void 0 : _b.id), model]; })).values());
111
109
  }
112
110
  else {
113
- componentModels = Array.from(new Map(componentModels.filter((model) => model[entityType]).map((model) => { var _a; return [(_a = model[entityType]) === null || _a === void 0 ? void 0 : _a.id, model]; })).values());
111
+ componentModels = Array.from(new Map(componentModels.map((model) => { var _a; return [(_a = model[entityType]) === null || _a === void 0 ? void 0 : _a.id, model]; })).values());
114
112
  }
115
113
  }
116
114
  componentModels.forEach((elementModel) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.5.5",
3
+ "version": "1.6.0-alpha.0",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",