@contrail/documents 2.5.0-alpha.ea3ab65 → 2.5.0-alpha.f9b81f6
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 +7 -13
- package/lib/types/document-transaction.d.ts +7 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,22 +5,16 @@ All notable changes to `@contrail/documents` are documented here.
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
6
|
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [2.5.0] - 2026-10-
|
|
8
|
+
## [2.5.0] - 2026-10-10
|
|
9
|
+
|
|
10
|
+
Also shipped on the 1.x line as 1.22.0.
|
|
9
11
|
|
|
10
12
|
### Added
|
|
11
13
|
|
|
12
|
-
- `
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`WriteTransactionRequest`, `DocumentTransactionPayload`, `DocumentTransactionMessage` and
|
|
17
|
-
`DocumentTransaction`, so a receiver can measure an edit's path from the sender's action to its own
|
|
18
|
-
screen and correct for both clocks.
|
|
19
|
-
- `traceId?: string` on `WriteTransactionResponse`, `DocumentTransactionPayload`,
|
|
20
|
-
`DocumentTransactionMessage` and `DocumentTransaction` — the server's append-span trace id, so the
|
|
21
|
-
sender and every receiver can be joined to the backend trace.
|
|
22
|
-
- `createdOn?: string` on `DocumentTransaction` (replay items), matching what the broadcast already
|
|
23
|
-
carries, so replayed transactions can report the same legs as live ones.
|
|
14
|
+
- `clientCreatedOn` on `WriteTransactionRequest`, `DocumentTransactionPayload`, and
|
|
15
|
+
`DocumentTransactionMessage`: when the writing client created the transaction (ISO 8601, client
|
|
16
|
+
clock). The server stores it with the transaction and passes it through in the broadcast, so a
|
|
17
|
+
receiver can measure how long the edit took to reach it.
|
|
24
18
|
|
|
25
19
|
## [2.4.0] - 2026-09-26
|
|
26
20
|
|
|
@@ -11,15 +11,9 @@ export type DocumentOperation = {
|
|
|
11
11
|
elementId: string;
|
|
12
12
|
};
|
|
13
13
|
export type DocumentElementPatch = Partial<Omit<DocumentElement, 'id' | 'documentId'>>;
|
|
14
|
-
|
|
15
|
-
export interface TransactionClientTraceFields {
|
|
16
|
-
initiatedAt?: number;
|
|
17
|
-
initiatedSource?: TransactionInitiatedSource;
|
|
18
|
-
initiatedClockOffsetMs?: number;
|
|
19
|
-
initiatedClockUncertaintyMs?: number;
|
|
20
|
-
}
|
|
21
|
-
interface WriteTransactionRequestBase extends TransactionClientTraceFields {
|
|
14
|
+
interface WriteTransactionRequestBase {
|
|
22
15
|
clientTransactionId?: string;
|
|
16
|
+
clientCreatedOn?: string;
|
|
23
17
|
}
|
|
24
18
|
export interface InlineWriteTransactionRequest extends WriteTransactionRequestBase {
|
|
25
19
|
operations: DocumentOperation[];
|
|
@@ -35,13 +29,10 @@ export interface WriteTransactionResponse {
|
|
|
35
29
|
createdOn: string;
|
|
36
30
|
createdById: string;
|
|
37
31
|
clientTransactionId?: string;
|
|
38
|
-
traceId?: string;
|
|
39
32
|
}
|
|
40
|
-
interface DocumentTransactionBase
|
|
33
|
+
interface DocumentTransactionBase {
|
|
41
34
|
sequenceNumber: number;
|
|
42
35
|
clientTransactionId?: string;
|
|
43
|
-
createdOn?: string;
|
|
44
|
-
traceId?: string;
|
|
45
36
|
}
|
|
46
37
|
export interface InlineDocumentTransaction extends DocumentTransactionBase {
|
|
47
38
|
operations: DocumentOperation[];
|
|
@@ -57,13 +48,13 @@ export interface GetDocumentTransactionsResponse {
|
|
|
57
48
|
hasMore: boolean;
|
|
58
49
|
lastReturnedSequenceNumber: number;
|
|
59
50
|
}
|
|
60
|
-
interface DocumentTransactionMessageBase
|
|
51
|
+
interface DocumentTransactionMessageBase {
|
|
61
52
|
type: 'DOCUMENT_TRANSACTION';
|
|
62
53
|
documentId: string;
|
|
63
54
|
sequenceNumber: number;
|
|
64
55
|
createdOn: string;
|
|
65
56
|
clientTransactionId?: string;
|
|
66
|
-
|
|
57
|
+
clientCreatedOn?: string;
|
|
67
58
|
}
|
|
68
59
|
export type DocumentTransactionMessage = (DocumentTransactionMessageBase & {
|
|
69
60
|
operations: DocumentOperation[];
|
|
@@ -79,8 +70,8 @@ export interface TransactionUploadTarget {
|
|
|
79
70
|
}
|
|
80
71
|
export type DocumentTransactionPayload = {
|
|
81
72
|
clientTransactionId?: string;
|
|
82
|
-
|
|
83
|
-
} &
|
|
73
|
+
clientCreatedOn?: string;
|
|
74
|
+
} & ({
|
|
84
75
|
operations: DocumentOperation[];
|
|
85
76
|
operationsS3Key?: never;
|
|
86
77
|
} | {
|