@claudian-collab/protocol 1.0.0 → 2.0.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/README.md +8 -8
- package/dist/CollabAuthorityTransfer.d.ts +296 -0
- package/dist/CollabAuthorityTransfer.js +877 -0
- package/dist/CollabCloudBinding.d.ts +43 -3
- package/dist/CollabCloudBinding.js +151 -10
- package/dist/CollabCloudProjectEvent.d.ts +12 -1
- package/dist/CollabCloudProjectEvent.js +21 -0
- package/dist/CollabConstants.d.ts +1 -1
- package/dist/CollabConstants.js +1 -1
- package/dist/CollabControlOperationCodecs.d.ts +17 -0
- package/dist/CollabControlOperationCodecs.js +44 -0
- package/dist/CollabError.d.ts +1 -1
- package/dist/CollabError.js +16 -0
- package/dist/CollabProjectCheckpoint.d.ts +275 -0
- package/dist/CollabProjectCheckpoint.js +1336 -0
- package/dist/CollabProjectRetirement.d.ts +44 -0
- package/dist/CollabProjectRetirement.js +127 -0
- package/dist/CollabProtocol.d.ts +3 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +49 -2
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { type CollabAuthorityRelinquishmentProof, type CollabAuthorityTransferDirection, type CollabAuthorityTransferStatus } from './CollabAuthorityTransfer';
|
|
2
|
+
import { type CollabCloudProjectEvent } from './CollabCloudProjectEvent';
|
|
3
|
+
import { COLLAB_PROTOCOL_VERSION } from './CollabConstants';
|
|
4
|
+
import { type CollabControlOperation } from './CollabControlOperationCodecs';
|
|
5
|
+
import type { CollabGitOid, CollabIsoTimestamp, CollabMemberId, CollabProjectId } from './types';
|
|
6
|
+
export declare const COLLAB_PROJECT_CHECKPOINT_MANIFEST_SCHEMA_VERSION: 1;
|
|
7
|
+
export declare const COLLAB_PROJECT_COORDINATION_FORMAT_VERSION: 1;
|
|
8
|
+
export declare const COLLAB_PROTECTED_CLAIM_ENVELOPE_VERSION: 1;
|
|
9
|
+
export declare const COLLAB_PROTECTED_CLAIM_ENVELOPE_LIMITS: Readonly<{
|
|
10
|
+
readonly maxCiphertextBytes: 4096;
|
|
11
|
+
readonly nonceBytes: 24;
|
|
12
|
+
readonly tagBytes: 16;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const COLLAB_CHECKPOINT_PROFILES: readonly ["authority-transfer", "backup", "export"];
|
|
15
|
+
export declare const COLLAB_PROJECT_CHECKPOINT_ARTIFACTS: readonly ["checkpoint.json", "coordination.ndjson", "repository.bundle"];
|
|
16
|
+
export declare const COLLAB_CHECKPOINT_ARTIFACT_LIMITS: Readonly<{
|
|
17
|
+
readonly maxCoordinationBytes: number;
|
|
18
|
+
readonly maxManifestBytes: number;
|
|
19
|
+
readonly maxRepositoryBundleBytes: number;
|
|
20
|
+
readonly maxStagingBytes: number;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const COLLAB_CHECKPOINT_PORTABLE_RECORD_KINDS: readonly ["project", "member", "request", "request-comment", "ticket", "ticket-comment", "ticket-relation", "ticket-mention"];
|
|
23
|
+
export declare const COLLAB_CHECKPOINT_BACKUP_RECORD_KINDS: readonly ["project", "member", "request", "request-comment", "ticket", "ticket-comment", "ticket-relation", "ticket-mention", "cloud-event", "cloud-event-cursor", "idempotency-result", "principal-binding", "repository-placement", "lifecycle-state", "terminal-responder", "protected-claim-envelope", "tombstone", "schema-catalog", "server-compatibility", "authority-volume-pair"];
|
|
24
|
+
export type CollabCheckpointProfile = typeof COLLAB_CHECKPOINT_PROFILES[number];
|
|
25
|
+
export type CollabCheckpointAuthorityKind = 'cloud' | 'lan';
|
|
26
|
+
export type CollabCheckpointObjectFormat = 'sha1' | 'sha256';
|
|
27
|
+
export type CollabCheckpointPortableRecordKind = typeof COLLAB_CHECKPOINT_PORTABLE_RECORD_KINDS[number];
|
|
28
|
+
export type CollabCheckpointBackupRecordKind = typeof COLLAB_CHECKPOINT_BACKUP_RECORD_KINDS[number];
|
|
29
|
+
export interface CollabCheckpointAuthority {
|
|
30
|
+
readonly generation: number;
|
|
31
|
+
readonly kind: CollabCheckpointAuthorityKind;
|
|
32
|
+
}
|
|
33
|
+
export interface CollabCheckpointArtifactFact {
|
|
34
|
+
readonly byteCount: number;
|
|
35
|
+
readonly name: 'coordination.ndjson' | 'repository.bundle';
|
|
36
|
+
readonly sha256: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CollabCheckpointGitRef {
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly oid: CollabGitOid;
|
|
41
|
+
}
|
|
42
|
+
export interface CollabProjectCheckpointManifest {
|
|
43
|
+
readonly artifacts: readonly CollabCheckpointArtifactFact[];
|
|
44
|
+
readonly coordinationFormatVersion: typeof COLLAB_PROJECT_COORDINATION_FORMAT_VERSION;
|
|
45
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
46
|
+
readonly expectedMainOid: CollabGitOid;
|
|
47
|
+
readonly gitObjectFormat: CollabCheckpointObjectFormat;
|
|
48
|
+
readonly manifestSchemaVersion: typeof COLLAB_PROJECT_CHECKPOINT_MANIFEST_SCHEMA_VERSION;
|
|
49
|
+
readonly manifestSha256: string;
|
|
50
|
+
readonly operationId: string;
|
|
51
|
+
readonly profile: CollabCheckpointProfile;
|
|
52
|
+
readonly projectId: CollabProjectId;
|
|
53
|
+
readonly protocolVersion: typeof COLLAB_PROTOCOL_VERSION;
|
|
54
|
+
readonly refs: readonly CollabCheckpointGitRef[];
|
|
55
|
+
readonly sourceAuthority: CollabCheckpointAuthority;
|
|
56
|
+
readonly targetAuthority: CollabCheckpointAuthority | null;
|
|
57
|
+
}
|
|
58
|
+
interface CollabCheckpointRecordBase<Kind extends string, Value> {
|
|
59
|
+
readonly kind: Kind;
|
|
60
|
+
readonly recordId: string;
|
|
61
|
+
readonly revision: number;
|
|
62
|
+
readonly value: Value;
|
|
63
|
+
}
|
|
64
|
+
export type CollabCheckpointProjectRecord = CollabCheckpointRecordBase<'project', {
|
|
65
|
+
readonly activatedAt: CollabIsoTimestamp;
|
|
66
|
+
readonly authorityGeneration: number;
|
|
67
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
68
|
+
readonly expectedMainOid: CollabGitOid;
|
|
69
|
+
readonly managerSetGeneration: number;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
readonly projectId: CollabProjectId;
|
|
72
|
+
}>;
|
|
73
|
+
export type CollabCheckpointMemberRecord = CollabCheckpointRecordBase<'member', {
|
|
74
|
+
readonly activatedAt: CollabIsoTimestamp | null;
|
|
75
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
76
|
+
readonly displayName: string;
|
|
77
|
+
readonly memberId: CollabMemberId;
|
|
78
|
+
readonly personalRef: string;
|
|
79
|
+
readonly projectId: CollabProjectId;
|
|
80
|
+
readonly role: 'manager' | 'member';
|
|
81
|
+
readonly status: 'active' | 'left' | 'revoked';
|
|
82
|
+
readonly revokedAt: CollabIsoTimestamp | null;
|
|
83
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
84
|
+
}>;
|
|
85
|
+
export type CollabCheckpointRequestRecord = CollabCheckpointRecordBase<'request', {
|
|
86
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
87
|
+
readonly description: string;
|
|
88
|
+
readonly firstBaseOid: CollabGitOid;
|
|
89
|
+
readonly latestHeadOid: CollabGitOid;
|
|
90
|
+
readonly memberId: CollabMemberId;
|
|
91
|
+
readonly mergedOid: CollabGitOid | null;
|
|
92
|
+
readonly projectId: CollabProjectId;
|
|
93
|
+
readonly requestId: string;
|
|
94
|
+
readonly status: 'discarded' | 'merged' | 'open';
|
|
95
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
96
|
+
}>;
|
|
97
|
+
export type CollabCheckpointRequestCommentRecord = CollabCheckpointRecordBase<'request-comment', {
|
|
98
|
+
readonly authorMemberId: CollabMemberId;
|
|
99
|
+
readonly body: string;
|
|
100
|
+
readonly commentId: string;
|
|
101
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
102
|
+
readonly projectId: CollabProjectId;
|
|
103
|
+
readonly requestId: string;
|
|
104
|
+
}>;
|
|
105
|
+
export type CollabCheckpointTicketRecord = CollabCheckpointRecordBase<'ticket', {
|
|
106
|
+
readonly authorMemberId: CollabMemberId;
|
|
107
|
+
readonly body: string;
|
|
108
|
+
readonly closedAt: CollabIsoTimestamp | null;
|
|
109
|
+
readonly closedByMemberId: CollabMemberId | null;
|
|
110
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
111
|
+
readonly number: number;
|
|
112
|
+
readonly projectId: CollabProjectId;
|
|
113
|
+
readonly status: 'closed' | 'open';
|
|
114
|
+
readonly ticketId: string;
|
|
115
|
+
readonly title: string;
|
|
116
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
117
|
+
}>;
|
|
118
|
+
export type CollabCheckpointTicketCommentRecord = CollabCheckpointRecordBase<'ticket-comment', {
|
|
119
|
+
readonly authorMemberId: CollabMemberId;
|
|
120
|
+
readonly body: string;
|
|
121
|
+
readonly commentId: string;
|
|
122
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
123
|
+
readonly projectId: CollabProjectId;
|
|
124
|
+
readonly ticketId: string;
|
|
125
|
+
}>;
|
|
126
|
+
export type CollabCheckpointTicketRelationRecord = CollabCheckpointRecordBase<'ticket-relation', {
|
|
127
|
+
readonly acceptedAt: CollabIsoTimestamp | null;
|
|
128
|
+
readonly acceptedMergeOid: CollabGitOid | null;
|
|
129
|
+
readonly commitOid: CollabGitOid;
|
|
130
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
131
|
+
readonly createdByMemberId: CollabMemberId;
|
|
132
|
+
readonly kind: 'references' | 'resolves';
|
|
133
|
+
readonly projectId: CollabProjectId;
|
|
134
|
+
readonly relationId: string;
|
|
135
|
+
readonly requestId: string;
|
|
136
|
+
readonly state: 'accepted' | 'pending';
|
|
137
|
+
readonly ticketId: string;
|
|
138
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
139
|
+
}>;
|
|
140
|
+
export type CollabCheckpointTicketMentionRecord = CollabCheckpointRecordBase<'ticket-mention', {
|
|
141
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
142
|
+
readonly mentionedMemberId: CollabMemberId;
|
|
143
|
+
readonly projectId: CollabProjectId;
|
|
144
|
+
readonly sourceId: string;
|
|
145
|
+
readonly sourceKind: 'comment' | 'description';
|
|
146
|
+
readonly ticketId: string;
|
|
147
|
+
}>;
|
|
148
|
+
export type CollabCheckpointCloudEventRecord = CollabCheckpointRecordBase<'cloud-event', {
|
|
149
|
+
readonly event: CollabCloudProjectEvent;
|
|
150
|
+
}>;
|
|
151
|
+
export type CollabCheckpointCloudEventCursorRecord = CollabCheckpointRecordBase<'cloud-event-cursor', {
|
|
152
|
+
readonly currentSequence: number;
|
|
153
|
+
readonly projectId: CollabProjectId;
|
|
154
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
155
|
+
}>;
|
|
156
|
+
export type CollabCheckpointIdempotencyResultRecord = CollabCheckpointRecordBase<'idempotency-result', {
|
|
157
|
+
readonly createdAt: CollabIsoTimestamp;
|
|
158
|
+
readonly idempotencyKey: string;
|
|
159
|
+
readonly memberId: CollabMemberId;
|
|
160
|
+
readonly operation: CollabControlOperation;
|
|
161
|
+
readonly projectId: CollabProjectId;
|
|
162
|
+
readonly requestFingerprint: string;
|
|
163
|
+
readonly responseJson: string;
|
|
164
|
+
}>;
|
|
165
|
+
export type CollabCheckpointPrincipalBindingRecord = CollabCheckpointRecordBase<'principal-binding', {
|
|
166
|
+
readonly boundAt: CollabIsoTimestamp;
|
|
167
|
+
readonly memberId: CollabMemberId;
|
|
168
|
+
readonly principalId: string;
|
|
169
|
+
readonly projectId: CollabProjectId;
|
|
170
|
+
}>;
|
|
171
|
+
export type CollabCheckpointRepositoryPlacementRecord = CollabCheckpointRecordBase<'repository-placement', {
|
|
172
|
+
readonly nodeId: string;
|
|
173
|
+
readonly placementGeneration: number;
|
|
174
|
+
readonly projectId: CollabProjectId;
|
|
175
|
+
readonly repositoryIdentity: string;
|
|
176
|
+
}>;
|
|
177
|
+
type CollabCheckpointAuthorityTransferLifecycleState = {
|
|
178
|
+
readonly batchRevision: number | null;
|
|
179
|
+
readonly batchSha256: string | null;
|
|
180
|
+
readonly checkpointSha256: string | null;
|
|
181
|
+
readonly direction: CollabAuthorityTransferDirection;
|
|
182
|
+
readonly operationId: string;
|
|
183
|
+
readonly operationKind: 'authority-transfer';
|
|
184
|
+
readonly phase: CollabAuthorityTransferStatus['phase'];
|
|
185
|
+
readonly projectId: CollabProjectId;
|
|
186
|
+
readonly relinquishmentProof: CollabAuthorityRelinquishmentProof | null;
|
|
187
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
188
|
+
};
|
|
189
|
+
type CollabCheckpointInternalLifecycleState = {
|
|
190
|
+
readonly batchRevision: null;
|
|
191
|
+
readonly batchSha256: null;
|
|
192
|
+
readonly direction: null;
|
|
193
|
+
readonly operationId: string;
|
|
194
|
+
readonly phase: string;
|
|
195
|
+
readonly projectId: CollabProjectId;
|
|
196
|
+
readonly relinquishmentProof: null;
|
|
197
|
+
readonly updatedAt: CollabIsoTimestamp;
|
|
198
|
+
} & ({
|
|
199
|
+
readonly checkpointSha256: string | null;
|
|
200
|
+
readonly operationKind: 'backup';
|
|
201
|
+
} | {
|
|
202
|
+
readonly checkpointSha256: null;
|
|
203
|
+
readonly operationKind: 'delete' | 'retire';
|
|
204
|
+
});
|
|
205
|
+
export type CollabCheckpointLifecycleStateRecord = CollabCheckpointRecordBase<'lifecycle-state', CollabCheckpointAuthorityTransferLifecycleState | CollabCheckpointInternalLifecycleState>;
|
|
206
|
+
export interface CollabCheckpointTerminalAcknowledgement {
|
|
207
|
+
readonly acknowledgedAt: CollabIsoTimestamp;
|
|
208
|
+
readonly memberId: CollabMemberId;
|
|
209
|
+
readonly principalId: string;
|
|
210
|
+
}
|
|
211
|
+
export type CollabCheckpointTerminalResponderRecord = CollabCheckpointRecordBase<'terminal-responder', {
|
|
212
|
+
readonly acknowledgements: readonly CollabCheckpointTerminalAcknowledgement[];
|
|
213
|
+
readonly eligibleMemberIds: readonly CollabMemberId[];
|
|
214
|
+
readonly expiresAt: CollabIsoTimestamp;
|
|
215
|
+
readonly operation: 'getProjectAuthorityTransfer' | 'retireProject';
|
|
216
|
+
readonly operationId: string;
|
|
217
|
+
readonly projectId: CollabProjectId;
|
|
218
|
+
readonly responseJson: string;
|
|
219
|
+
}>;
|
|
220
|
+
export interface CollabProtectedClaimAssociatedData {
|
|
221
|
+
readonly authorityGeneration: number;
|
|
222
|
+
readonly checkpointSha256: string;
|
|
223
|
+
readonly claimSha256: string;
|
|
224
|
+
readonly envelopeVersion: typeof COLLAB_PROTECTED_CLAIM_ENVELOPE_VERSION;
|
|
225
|
+
readonly environmentIdentity: string;
|
|
226
|
+
readonly memberId: CollabMemberId;
|
|
227
|
+
readonly projectId: CollabProjectId;
|
|
228
|
+
readonly transferId: string;
|
|
229
|
+
}
|
|
230
|
+
export type CollabCheckpointProtectedClaimEnvelopeRecord = CollabCheckpointRecordBase<'protected-claim-envelope', {
|
|
231
|
+
readonly associatedData: CollabProtectedClaimAssociatedData;
|
|
232
|
+
readonly associatedDataSha256: string;
|
|
233
|
+
readonly ciphertext: string;
|
|
234
|
+
readonly encryptionAlgorithm: 'xchacha20-poly1305';
|
|
235
|
+
readonly expiresAt: CollabIsoTimestamp;
|
|
236
|
+
readonly keyId: string;
|
|
237
|
+
readonly keyVersion: number;
|
|
238
|
+
readonly memberId: CollabMemberId;
|
|
239
|
+
readonly nonce: string;
|
|
240
|
+
readonly receiptKeyId: string;
|
|
241
|
+
readonly tag: string;
|
|
242
|
+
readonly transferId: string;
|
|
243
|
+
}>;
|
|
244
|
+
export type CollabCheckpointTombstoneRecord = CollabCheckpointRecordBase<'tombstone', {
|
|
245
|
+
readonly authorityGeneration: number;
|
|
246
|
+
readonly projectId: CollabProjectId;
|
|
247
|
+
readonly retiredAt: CollabIsoTimestamp;
|
|
248
|
+
readonly terminalExpiresAt: CollabIsoTimestamp;
|
|
249
|
+
}>;
|
|
250
|
+
export type CollabCheckpointSchemaCatalogRecord = CollabCheckpointRecordBase<'schema-catalog', {
|
|
251
|
+
readonly coordinationSchemaVersion: number;
|
|
252
|
+
readonly projectId: CollabProjectId;
|
|
253
|
+
readonly repositoryFormatVersion: number;
|
|
254
|
+
}>;
|
|
255
|
+
export type CollabCheckpointServerCompatibilityRecord = CollabCheckpointRecordBase<'server-compatibility', {
|
|
256
|
+
readonly maximumBuild: string;
|
|
257
|
+
readonly minimumBuild: string;
|
|
258
|
+
readonly projectId: CollabProjectId;
|
|
259
|
+
}>;
|
|
260
|
+
export type CollabCheckpointAuthorityVolumePairRecord = CollabCheckpointRecordBase<'authority-volume-pair', {
|
|
261
|
+
readonly authorityId: string;
|
|
262
|
+
readonly authorityVolumeIdentity: string;
|
|
263
|
+
readonly projectId: CollabProjectId;
|
|
264
|
+
readonly restoreEpoch: number;
|
|
265
|
+
}>;
|
|
266
|
+
export type CollabCheckpointPortableRecord = CollabCheckpointProjectRecord | CollabCheckpointMemberRecord | CollabCheckpointRequestRecord | CollabCheckpointRequestCommentRecord | CollabCheckpointTicketRecord | CollabCheckpointTicketCommentRecord | CollabCheckpointTicketRelationRecord | CollabCheckpointTicketMentionRecord;
|
|
267
|
+
export type CollabCheckpointBackupRecord = CollabCheckpointPortableRecord | CollabCheckpointCloudEventRecord | CollabCheckpointCloudEventCursorRecord | CollabCheckpointIdempotencyResultRecord | CollabCheckpointPrincipalBindingRecord | CollabCheckpointRepositoryPlacementRecord | CollabCheckpointLifecycleStateRecord | CollabCheckpointTerminalResponderRecord | CollabCheckpointProtectedClaimEnvelopeRecord | CollabCheckpointTombstoneRecord | CollabCheckpointSchemaCatalogRecord | CollabCheckpointServerCompatibilityRecord | CollabCheckpointAuthorityVolumePairRecord;
|
|
268
|
+
export declare function decodeCollabProjectCheckpointManifest(value: unknown): CollabProjectCheckpointManifest;
|
|
269
|
+
export declare function encodeCollabProjectCheckpointManifestCanonicalJson(manifest: CollabProjectCheckpointManifest): string;
|
|
270
|
+
export declare function encodeCollabProjectCheckpointManifestDigestInput(manifest: CollabProjectCheckpointManifest): string;
|
|
271
|
+
export declare function encodeCollabProtectedClaimAssociatedData(associatedData: CollabProtectedClaimAssociatedData): string;
|
|
272
|
+
export declare function decodeCollabProjectCheckpointCoordinationNdjson(value: string, profile: CollabCheckpointProfile): readonly CollabCheckpointBackupRecord[];
|
|
273
|
+
export declare function encodeCollabProjectCheckpointCoordinationNdjson(records: readonly CollabCheckpointBackupRecord[], profile: CollabCheckpointProfile): string;
|
|
274
|
+
export declare function validateCollabProjectCheckpointConsistency(manifest: CollabProjectCheckpointManifest, records: readonly CollabCheckpointBackupRecord[]): readonly CollabCheckpointBackupRecord[];
|
|
275
|
+
export {};
|