@contrail/documents 1.6.0-alpha.0 → 1.6.0-alpha.validation.2

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,11 @@ 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
+ - `DocumentWriteMode` type and an optional `writeMode` field on the `Document` interface, used to gate the transactional write path.
14
+
10
15
  ## [1.5.6] - 2026-04-29
11
16
 
12
17
  ### Fixed
@@ -5,33 +5,16 @@ export type DocumentOperation = {
5
5
  } | {
6
6
  action: 'updateElement';
7
7
  elementId: string;
8
- changes: Partial<DocumentElement>;
8
+ changes: DocumentElementPatch;
9
9
  } | {
10
10
  action: 'deleteElement';
11
11
  elementId: string;
12
12
  };
13
- export interface DocumentTransactionMetadata {
14
- sequenceNumber: number;
15
- documentId: string;
16
- createdOn: string;
17
- createdById: string;
13
+ export type DocumentElementPatch = Partial<Omit<DocumentElement, 'id' | 'documentId'>>;
14
+ export interface WriteTransactionRequest {
18
15
  clientTransactionId?: string;
19
- }
20
- export type StoredPayload = {
21
16
  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;
17
+ }
35
18
  export interface WriteTransactionResponse {
36
19
  sequenceNumber: number;
37
20
  createdOn: string;
@@ -4,7 +4,7 @@ export interface ImportReferenceDetail {
4
4
  importedSlideReference?: string;
5
5
  importedFileReference?: string;
6
6
  }
7
- export type DocumentWriteMode = 'legacy' | 'transactional';
7
+ export type DocumentWriteMode = 'transactional';
8
8
  export interface Document {
9
9
  id?: string;
10
10
  name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.6.0-alpha.0",
3
+ "version": "1.6.0-alpha.validation.2",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",