@tearleads/client-sdk 0.1.67 → 0.1.69

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.
Files changed (52) hide show
  1. package/data/containers/shared/principalPolicies.js +8 -12
  2. package/data/containers/shared/principalPolicies.js.map +1 -1
  3. package/data/persistence/principalHistory/principalHistoryStagePersistence.d.ts +2 -0
  4. package/data/persistence/principalHistory/principalHistoryStagePersistence.js +4 -0
  5. package/data/persistence/principalHistory/principalHistoryStagePersistence.js.map +1 -1
  6. package/internal/validators/operation/attachments.d.ts +48 -8
  7. package/internal/validators/operation/auth.d.ts +456 -76
  8. package/internal/validators/operation/containerMutations.d.ts +264 -44
  9. package/internal/validators/operation/documentMutations.d.ts +72 -12
  10. package/internal/validators/operation/documentSync.d.ts +24 -4
  11. package/internal/validators/operation/organizations.d.ts +528 -88
  12. package/internal/validators/operation/principals.d.ts +96 -16
  13. package/internal/validators/request/blob.d.ts +48 -8
  14. package/internal/validators/request/container.d.ts +96 -16
  15. package/internal/validators/request/container.js +5 -2
  16. package/internal/validators/request/container.js.map +1 -1
  17. package/internal/validators/request/containerMetadata.d.ts +96 -16
  18. package/internal/validators/request/document.d.ts +60 -10
  19. package/internal/validators/request/documentSyncSchema.d.ts +24 -4
  20. package/internal/validators/request/documentSyncSchema.js +2 -1
  21. package/internal/validators/request/documentSyncSchema.js.map +1 -1
  22. package/internal/validators/request/index.d.ts +1 -0
  23. package/internal/validators/request/index.js +1 -0
  24. package/internal/validators/request/index.js.map +1 -1
  25. package/internal/validators/request/organization.d.ts +96 -16
  26. package/internal/validators/request/organizationProvisioning.d.ts +1456 -246
  27. package/internal/validators/request/principal.d.ts +120 -20
  28. package/internal/validators/request/principalPolicyRef.d.ts +42 -0
  29. package/internal/validators/request/principalPolicyRef.js +19 -0
  30. package/internal/validators/request/principalPolicyRef.js.map +1 -0
  31. package/internal/validators/request/registration.d.ts +456 -76
  32. package/internal/validators/util/containerLimits.d.ts +8 -0
  33. package/internal/validators/util/containerLimits.js +8 -0
  34. package/internal/validators/util/containerLimits.js.map +1 -1
  35. package/package.json +1 -1
  36. package/workflows/container-contents/storedContainerState.js +5 -1
  37. package/workflows/container-contents/storedContainerState.js.map +1 -1
  38. package/workflows/containers/child/mutationRequestCore.js +2 -2
  39. package/workflows/containers/child/mutationRequestCore.js.map +1 -1
  40. package/workflows/containers/child/recitePlan.js +2 -2
  41. package/workflows/containers/child/recitePlan.js.map +1 -1
  42. package/workflows/containers/root/create.js +17 -28
  43. package/workflows/containers/root/create.js.map +1 -1
  44. package/workflows/containers/root/initialGroupPolicy.js +0 -23
  45. package/workflows/containers/root/initialGroupPolicy.js.map +1 -1
  46. package/workflows/documents/syncFailures/syncPolicyRepair.js +2 -8
  47. package/workflows/documents/syncFailures/syncPolicyRepair.js.map +1 -1
  48. package/workflows/principals/recoveryOperation/supersededStageResume.js +21 -0
  49. package/workflows/principals/recoveryOperation/supersededStageResume.js.map +1 -0
  50. package/workflows/principals/runtimePolicyRecovery.js +12 -9
  51. package/workflows/principals/runtimePolicyRecovery.js.map +1 -1
  52. package/workflows/registration/provisioningBootstrapBuilders.d.ts +12 -2
@@ -8,7 +8,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
8
8
  keyring: Record<string, unknown> | null;
9
9
  manifest: Record<string, unknown>;
10
10
  predecessorBridge: Record<string, unknown> | null;
11
- principalPolicies: Record<string, unknown>[];
11
+ principalPolicyRefs: {
12
+ principalType: "group" | "organization";
13
+ principalId: string;
14
+ version: number;
15
+ stateHash: string;
16
+ }[];
12
17
  wraps: Record<string, unknown>[];
13
18
  containerManifestHistoryRefs?: {
14
19
  containerId: string;
@@ -40,7 +45,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
40
45
  keyring: Record<string, unknown> | null;
41
46
  manifest: Record<string, unknown>;
42
47
  predecessorBridge: Record<string, unknown> | null;
43
- principalPolicies: Record<string, unknown>[];
48
+ principalPolicyRefs: {
49
+ principalType: "group" | "organization";
50
+ principalId: string;
51
+ version: number;
52
+ stateHash: string;
53
+ }[];
44
54
  wraps: Record<string, unknown>[];
45
55
  containerManifestHistoryRefs?: {
46
56
  containerId: string;
@@ -72,7 +82,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
72
82
  keyring: Record<string, unknown> | null;
73
83
  manifest: Record<string, unknown>;
74
84
  predecessorBridge: Record<string, unknown> | null;
75
- principalPolicies: Record<string, unknown>[];
85
+ principalPolicyRefs: {
86
+ principalType: "group" | "organization";
87
+ principalId: string;
88
+ version: number;
89
+ stateHash: string;
90
+ }[];
76
91
  wraps: Record<string, unknown>[];
77
92
  containerManifestHistoryRefs?: {
78
93
  containerId: string;
@@ -104,7 +119,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
104
119
  keyring: Record<string, unknown> | null;
105
120
  manifest: Record<string, unknown>;
106
121
  predecessorBridge: Record<string, unknown> | null;
107
- principalPolicies: Record<string, unknown>[];
122
+ principalPolicyRefs: {
123
+ principalType: "group" | "organization";
124
+ principalId: string;
125
+ version: number;
126
+ stateHash: string;
127
+ }[];
108
128
  wraps: Record<string, unknown>[];
109
129
  containerManifestHistoryRefs?: {
110
130
  containerId: string;
@@ -159,7 +179,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
159
179
  keyring: Record<string, unknown> | null;
160
180
  manifest: Record<string, unknown>;
161
181
  predecessorBridge: Record<string, unknown> | null;
162
- principalPolicies: Record<string, unknown>[];
182
+ principalPolicyRefs: {
183
+ principalType: "group" | "organization";
184
+ principalId: string;
185
+ version: number;
186
+ stateHash: string;
187
+ }[];
163
188
  wraps: Record<string, unknown>[];
164
189
  containerManifestHistoryRefs?: {
165
190
  containerId: string;
@@ -218,7 +243,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
218
243
  keyring: Record<string, unknown> | null;
219
244
  manifest: Record<string, unknown>;
220
245
  predecessorBridge: Record<string, unknown> | null;
221
- principalPolicies: Record<string, unknown>[];
246
+ principalPolicyRefs: {
247
+ principalType: "group" | "organization";
248
+ principalId: string;
249
+ version: number;
250
+ stateHash: string;
251
+ }[];
222
252
  wraps: Record<string, unknown>[];
223
253
  containerManifestHistoryRefs?: {
224
254
  containerId: string;
@@ -277,7 +307,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
277
307
  keyring: Record<string, unknown> | null;
278
308
  manifest: Record<string, unknown>;
279
309
  predecessorBridge: Record<string, unknown> | null;
280
- principalPolicies: Record<string, unknown>[];
310
+ principalPolicyRefs: {
311
+ principalType: "group" | "organization";
312
+ principalId: string;
313
+ version: number;
314
+ stateHash: string;
315
+ }[];
281
316
  wraps: Record<string, unknown>[];
282
317
  containerManifestHistoryRefs?: {
283
318
  containerId: string;
@@ -336,7 +371,12 @@ export declare const containerCreateWithMetadataDocumentRequestShape: {
336
371
  keyring: Record<string, unknown> | null;
337
372
  manifest: Record<string, unknown>;
338
373
  predecessorBridge: Record<string, unknown> | null;
339
- principalPolicies: Record<string, unknown>[];
374
+ principalPolicyRefs: {
375
+ principalType: "group" | "organization";
376
+ principalId: string;
377
+ version: number;
378
+ stateHash: string;
379
+ }[];
340
380
  wraps: Record<string, unknown>[];
341
381
  containerManifestHistoryRefs?: {
342
382
  containerId: string;
@@ -377,7 +417,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
377
417
  keyring: Record<string, unknown> | null;
378
418
  manifest: Record<string, unknown>;
379
419
  predecessorBridge: Record<string, unknown> | null;
380
- principalPolicies: Record<string, unknown>[];
420
+ principalPolicyRefs: {
421
+ principalType: "group" | "organization";
422
+ principalId: string;
423
+ version: number;
424
+ stateHash: string;
425
+ }[];
381
426
  wraps: Record<string, unknown>[];
382
427
  containerManifestHistoryRefs?: {
383
428
  containerId: string;
@@ -432,7 +477,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
432
477
  keyring: Record<string, unknown> | null;
433
478
  manifest: Record<string, unknown>;
434
479
  predecessorBridge: Record<string, unknown> | null;
435
- principalPolicies: Record<string, unknown>[];
480
+ principalPolicyRefs: {
481
+ principalType: "group" | "organization";
482
+ principalId: string;
483
+ version: number;
484
+ stateHash: string;
485
+ }[];
436
486
  wraps: Record<string, unknown>[];
437
487
  containerManifestHistoryRefs?: {
438
488
  containerId: string;
@@ -472,7 +522,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
472
522
  keyring: Record<string, unknown> | null;
473
523
  manifest: Record<string, unknown>;
474
524
  predecessorBridge: Record<string, unknown> | null;
475
- principalPolicies: Record<string, unknown>[];
525
+ principalPolicyRefs: {
526
+ principalType: "group" | "organization";
527
+ principalId: string;
528
+ version: number;
529
+ stateHash: string;
530
+ }[];
476
531
  wraps: Record<string, unknown>[];
477
532
  containerManifestHistoryRefs?: {
478
533
  containerId: string;
@@ -527,7 +582,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
527
582
  keyring: Record<string, unknown> | null;
528
583
  manifest: Record<string, unknown>;
529
584
  predecessorBridge: Record<string, unknown> | null;
530
- principalPolicies: Record<string, unknown>[];
585
+ principalPolicyRefs: {
586
+ principalType: "group" | "organization";
587
+ principalId: string;
588
+ version: number;
589
+ stateHash: string;
590
+ }[];
531
591
  wraps: Record<string, unknown>[];
532
592
  containerManifestHistoryRefs?: {
533
593
  containerId: string;
@@ -567,7 +627,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
567
627
  keyring: Record<string, unknown> | null;
568
628
  manifest: Record<string, unknown>;
569
629
  predecessorBridge: Record<string, unknown> | null;
570
- principalPolicies: Record<string, unknown>[];
630
+ principalPolicyRefs: {
631
+ principalType: "group" | "organization";
632
+ principalId: string;
633
+ version: number;
634
+ stateHash: string;
635
+ }[];
571
636
  wraps: Record<string, unknown>[];
572
637
  containerManifestHistoryRefs?: {
573
638
  containerId: string;
@@ -622,7 +687,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
622
687
  keyring: Record<string, unknown> | null;
623
688
  manifest: Record<string, unknown>;
624
689
  predecessorBridge: Record<string, unknown> | null;
625
- principalPolicies: Record<string, unknown>[];
690
+ principalPolicyRefs: {
691
+ principalType: "group" | "organization";
692
+ principalId: string;
693
+ version: number;
694
+ stateHash: string;
695
+ }[];
626
696
  wraps: Record<string, unknown>[];
627
697
  containerManifestHistoryRefs?: {
628
698
  containerId: string;
@@ -662,7 +732,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
662
732
  keyring: Record<string, unknown> | null;
663
733
  manifest: Record<string, unknown>;
664
734
  predecessorBridge: Record<string, unknown> | null;
665
- principalPolicies: Record<string, unknown>[];
735
+ principalPolicyRefs: {
736
+ principalType: "group" | "organization";
737
+ principalId: string;
738
+ version: number;
739
+ stateHash: string;
740
+ }[];
666
741
  wraps: Record<string, unknown>[];
667
742
  containerManifestHistoryRefs?: {
668
743
  containerId: string;
@@ -717,7 +792,12 @@ export declare const ContainerCreateWithMetadataDocumentRequestSchema: z.ZodType
717
792
  keyring: Record<string, unknown> | null;
718
793
  manifest: Record<string, unknown>;
719
794
  predecessorBridge: Record<string, unknown> | null;
720
- principalPolicies: Record<string, unknown>[];
795
+ principalPolicyRefs: {
796
+ principalType: "group" | "organization";
797
+ principalId: string;
798
+ version: number;
799
+ stateHash: string;
800
+ }[];
721
801
  wraps: Record<string, unknown>[];
722
802
  containerManifestHistoryRefs?: {
723
803
  containerId: string;
@@ -18,7 +18,12 @@ export declare const documentCreateRequestShape: {
18
18
  keyring: Record<string, unknown> | null;
19
19
  manifest: Record<string, unknown>;
20
20
  predecessorBridge: Record<string, unknown> | null;
21
- principalPolicies: Record<string, unknown>[];
21
+ principalPolicyRefs: {
22
+ principalType: "group" | "organization";
23
+ principalId: string;
24
+ version: number;
25
+ stateHash: string;
26
+ }[];
22
27
  wraps: Record<string, unknown>[];
23
28
  containerManifestHistoryRefs?: {
24
29
  containerId: string;
@@ -50,7 +55,12 @@ export declare const documentCreateRequestShape: {
50
55
  keyring: Record<string, unknown> | null;
51
56
  manifest: Record<string, unknown>;
52
57
  predecessorBridge: Record<string, unknown> | null;
53
- principalPolicies: Record<string, unknown>[];
58
+ principalPolicyRefs: {
59
+ principalType: "group" | "organization";
60
+ principalId: string;
61
+ version: number;
62
+ stateHash: string;
63
+ }[];
54
64
  wraps: Record<string, unknown>[];
55
65
  containerManifestHistoryRefs?: {
56
66
  containerId: string;
@@ -165,7 +175,12 @@ export declare const DocumentCreateRequestSchema: z.ZodType<{
165
175
  keyring: Record<string, unknown> | null;
166
176
  manifest: Record<string, unknown>;
167
177
  predecessorBridge: Record<string, unknown> | null;
168
- principalPolicies: Record<string, unknown>[];
178
+ principalPolicyRefs: {
179
+ principalType: "group" | "organization";
180
+ principalId: string;
181
+ version: number;
182
+ stateHash: string;
183
+ }[];
169
184
  wraps: Record<string, unknown>[];
170
185
  containerManifestHistoryRefs?: {
171
186
  containerId: string;
@@ -224,7 +239,12 @@ export declare const DocumentCreateRequestSchema: z.ZodType<{
224
239
  keyring: Record<string, unknown> | null;
225
240
  manifest: Record<string, unknown>;
226
241
  predecessorBridge: Record<string, unknown> | null;
227
- principalPolicies: Record<string, unknown>[];
242
+ principalPolicyRefs: {
243
+ principalType: "group" | "organization";
244
+ principalId: string;
245
+ version: number;
246
+ stateHash: string;
247
+ }[];
228
248
  wraps: Record<string, unknown>[];
229
249
  containerManifestHistoryRefs?: {
230
250
  containerId: string;
@@ -283,7 +303,12 @@ export declare const DocumentCreateRequestSchema: z.ZodType<{
283
303
  keyring: Record<string, unknown> | null;
284
304
  manifest: Record<string, unknown>;
285
305
  predecessorBridge: Record<string, unknown> | null;
286
- principalPolicies: Record<string, unknown>[];
306
+ principalPolicyRefs: {
307
+ principalType: "group" | "organization";
308
+ principalId: string;
309
+ version: number;
310
+ stateHash: string;
311
+ }[];
287
312
  wraps: Record<string, unknown>[];
288
313
  containerManifestHistoryRefs?: {
289
314
  containerId: string;
@@ -342,7 +367,12 @@ export declare const DocumentCreateRequestSchema: z.ZodType<{
342
367
  keyring: Record<string, unknown> | null;
343
368
  manifest: Record<string, unknown>;
344
369
  predecessorBridge: Record<string, unknown> | null;
345
- principalPolicies: Record<string, unknown>[];
370
+ principalPolicyRefs: {
371
+ principalType: "group" | "organization";
372
+ principalId: string;
373
+ version: number;
374
+ stateHash: string;
375
+ }[];
346
376
  wraps: Record<string, unknown>[];
347
377
  containerManifestHistoryRefs?: {
348
378
  containerId: string;
@@ -407,7 +437,12 @@ export declare const DocumentLinkSetMutationRequestSchema: z.ZodType<{
407
437
  keyring: Record<string, unknown> | null;
408
438
  manifest: Record<string, unknown>;
409
439
  predecessorBridge: Record<string, unknown> | null;
410
- principalPolicies: Record<string, unknown>[];
440
+ principalPolicyRefs: {
441
+ principalType: "group" | "organization";
442
+ principalId: string;
443
+ version: number;
444
+ stateHash: string;
445
+ }[];
411
446
  wraps: Record<string, unknown>[];
412
447
  containerManifestHistoryRefs?: {
413
448
  containerId: string;
@@ -477,7 +512,12 @@ export declare const DocumentLinkSetMutationRequestSchema: z.ZodType<{
477
512
  keyring: Record<string, unknown> | null;
478
513
  manifest: Record<string, unknown>;
479
514
  predecessorBridge: Record<string, unknown> | null;
480
- principalPolicies: Record<string, unknown>[];
515
+ principalPolicyRefs: {
516
+ principalType: "group" | "organization";
517
+ principalId: string;
518
+ version: number;
519
+ stateHash: string;
520
+ }[];
481
521
  wraps: Record<string, unknown>[];
482
522
  containerManifestHistoryRefs?: {
483
523
  containerId: string;
@@ -547,7 +587,12 @@ export declare const DocumentLinkSetMutationRequestSchema: z.ZodType<{
547
587
  keyring: Record<string, unknown> | null;
548
588
  manifest: Record<string, unknown>;
549
589
  predecessorBridge: Record<string, unknown> | null;
550
- principalPolicies: Record<string, unknown>[];
590
+ principalPolicyRefs: {
591
+ principalType: "group" | "organization";
592
+ principalId: string;
593
+ version: number;
594
+ stateHash: string;
595
+ }[];
551
596
  wraps: Record<string, unknown>[];
552
597
  containerManifestHistoryRefs?: {
553
598
  containerId: string;
@@ -617,7 +662,12 @@ export declare const DocumentLinkSetMutationRequestSchema: z.ZodType<{
617
662
  keyring: Record<string, unknown> | null;
618
663
  manifest: Record<string, unknown>;
619
664
  predecessorBridge: Record<string, unknown> | null;
620
- principalPolicies: Record<string, unknown>[];
665
+ principalPolicyRefs: {
666
+ principalType: "group" | "organization";
667
+ principalId: string;
668
+ version: number;
669
+ stateHash: string;
670
+ }[];
621
671
  wraps: Record<string, unknown>[];
622
672
  containerManifestHistoryRefs?: {
623
673
  containerId: string;
@@ -159,7 +159,12 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
159
159
  keyring: Record<string, unknown> | null;
160
160
  manifest: Record<string, unknown>;
161
161
  predecessorBridge: Record<string, unknown> | null;
162
- principalPolicies: Record<string, unknown>[];
162
+ principalPolicyRefs: {
163
+ principalType: "group" | "organization";
164
+ principalId: string;
165
+ version: number;
166
+ stateHash: string;
167
+ }[];
163
168
  wraps: Record<string, unknown>[];
164
169
  containerManifestHistoryRefs?: {
165
170
  containerId: string;
@@ -230,7 +235,12 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
230
235
  keyring: Record<string, unknown> | null;
231
236
  manifest: Record<string, unknown>;
232
237
  predecessorBridge: Record<string, unknown> | null;
233
- principalPolicies: Record<string, unknown>[];
238
+ principalPolicyRefs: {
239
+ principalType: "group" | "organization";
240
+ principalId: string;
241
+ version: number;
242
+ stateHash: string;
243
+ }[];
234
244
  wraps: Record<string, unknown>[];
235
245
  containerManifestHistoryRefs?: {
236
246
  containerId: string;
@@ -301,7 +311,12 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
301
311
  keyring: Record<string, unknown> | null;
302
312
  manifest: Record<string, unknown>;
303
313
  predecessorBridge: Record<string, unknown> | null;
304
- principalPolicies: Record<string, unknown>[];
314
+ principalPolicyRefs: {
315
+ principalType: "group" | "organization";
316
+ principalId: string;
317
+ version: number;
318
+ stateHash: string;
319
+ }[];
305
320
  wraps: Record<string, unknown>[];
306
321
  containerManifestHistoryRefs?: {
307
322
  containerId: string;
@@ -372,7 +387,12 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
372
387
  keyring: Record<string, unknown> | null;
373
388
  manifest: Record<string, unknown>;
374
389
  predecessorBridge: Record<string, unknown> | null;
375
- principalPolicies: Record<string, unknown>[];
390
+ principalPolicyRefs: {
391
+ principalType: "group" | "organization";
392
+ principalId: string;
393
+ version: number;
394
+ stateHash: string;
395
+ }[];
376
396
  wraps: Record<string, unknown>[];
377
397
  containerManifestHistoryRefs?: {
378
398
  containerId: string;
@@ -12,6 +12,7 @@ import { isWalLsnString, WAL_LSN_PATTERN } from "../util/walLsn.js";
12
12
  import { ContainerMutationRequestSchema, } from "./container.js";
13
13
  import { ContainerManifestPathSchema, ContainerManifestRefListSchema, ContainerManifestRefSchema, OptionalContainerManifestPathSchema, } from "./containerManifestRef.js";
14
14
  import { ContentKeyWrappedKeySchema, contentKeyWrappingMetadataSchema, } from "./contentKeyEnvelopeSchema.js";
15
+ import { PrincipalPolicyRefListSchema } from "./principalPolicyRef.js";
15
16
  export { ContainerManifestPathSchema, ContainerManifestRefSchema, };
16
17
  export const ContainerManifestRefArrayArraySchema = arraySchema(ContainerManifestPathSchema, MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS);
17
18
  export const DocumentContentKeyTargetEnvelopeSchema = loosePlainObject({
@@ -79,7 +80,7 @@ const DocumentSyncContainerMutationRequestSchema = registerJsonSchemaView(z.cust
79
80
  predecessorBridge: plainObjectSchema.nullable(),
80
81
  previousContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
81
82
  previousManifestRef: ContainerManifestRefSchema.nullable().optional(),
82
- principalPolicies: z.array(plainObjectSchema),
83
+ principalPolicyRefs: PrincipalPolicyRefListSchema,
83
84
  userRecipientKeys: z.array(plainObjectSchema).optional(),
84
85
  wraps: z.array(plainObjectSchema),
85
86
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"documentSyncSchema.js","sourceRoot":"","sources":["documentSyncSchema.ts"],"names":[],"mappings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AAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAC9C,CAAC,IAAI,KAAK,OAAO,CAAC,eAAe,CAAC,MAAM,EACzC,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,oCAAoC;YAC7C,IAAI,EAAE,CAAC,iBAAiB,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,EACF;IACE,GAAG,sCAAsC;IACzC,GAAG,kCAAkC;CACtC,CACF,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n classifyDocumentSyncCheckpointFields,\n DOCUMENT_SYNC_CHECKPOINT_FIELD_SET_ISSUE_MESSAGE,\n DOCUMENT_SYNC_ROTATION_CHECKPOINT_KIND,\n DOCUMENT_SYNC_ROTATION_CHECKPOINT_PAYLOAD_KIND,\n} from \"../documentSyncCheckpoint\";\nimport {\n documentSyncRequestEnvelopeRefinements,\n documentSyncRequestPullRefinements,\n documentSyncRequestRotationRefinement,\n} from \"../documentSyncRefinements\";\nimport { classifyDocumentSyncRequestMode } from \"../documentSyncRequestMode\";\nimport { isPlainObject } from \"../isPlainObject\";\nimport {\n registerJsonSchemaFragment,\n registerJsonSchemaRuntimeRefinements,\n registerJsonSchemaView,\n} from \"../jsonSchema\";\nimport {\n arraySchema,\n boundedNonEmptyStringSchema,\n boundedStringSchema,\n loosePlainObject,\n nonEmptyStringSchema,\n plainObjectSchema,\n positiveIntegerSchema,\n requiredUnknownSchema,\n sha256HexStringSchema,\n} from \"../schema\";\nimport { MAX_INLINE_CONTAINER_REKEYS } from \"../util/containerKekKeyringWire\";\nimport {\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n} from \"../util/documentSyncLimits\";\nimport { isUuidV4String, UUID_V4_PATTERN } from \"../util/uuid\";\nimport { isWalLsnString, WAL_LSN_PATTERN } from \"../util/walLsn\";\nimport {\n type ContainerMutationRequest,\n ContainerMutationRequestSchema,\n} from \"./container\";\nimport {\n ContainerManifestPathSchema,\n type ContainerManifestRef,\n ContainerManifestRefListSchema,\n ContainerManifestRefSchema,\n OptionalContainerManifestPathSchema,\n} from \"./containerManifestRef\";\nimport {\n ContentKeyWrappedKeySchema,\n contentKeyWrappingMetadataSchema,\n} from \"./contentKeyEnvelopeSchema\";\n\nexport {\n ContainerManifestPathSchema,\n type ContainerManifestRef,\n ContainerManifestRefSchema,\n};\n\nexport const ContainerManifestRefArrayArraySchema = arraySchema(\n ContainerManifestPathSchema,\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n);\n\nexport const DocumentContentKeyTargetEnvelopeSchema = loosePlainObject({\n containerId: nonEmptyStringSchema,\n containerKeyEpoch: positiveIntegerSchema,\n containerKeyEpochId: nonEmptyStringSchema,\n containerManifestHash: nonEmptyStringSchema,\n wrappedKey: ContentKeyWrappedKeySchema,\n wrappingMetadata: contentKeyWrappingMetadataSchema(\"document\"),\n});\n\nexport type DocumentContentKeyTargetEnvelope = z.infer<\n typeof DocumentContentKeyTargetEnvelopeSchema\n>;\n\nexport const DocumentContentKeyBundleRequestSchema = loosePlainObject({\n contentKeyEpoch: positiveIntegerSchema,\n linkSetManifestHash: nonEmptyStringSchema,\n targetHash: nonEmptyStringSchema,\n targets: arraySchema(\n DocumentContentKeyTargetEnvelopeSchema,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n ),\n});\n\nexport type DocumentContentKeyBundleRequest = z.infer<\n typeof DocumentContentKeyBundleRequestSchema\n>;\n\nfunction createDocumentOutgoingUpdateSchema(\n encryptedDataSchema: z.ZodType<string>,\n versionVectorSchema: z.ZodType<string>,\n) {\n return registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n checkpointKind: z\n .literal(DOCUMENT_SYNC_ROTATION_CHECKPOINT_KIND)\n .optional(),\n checkpointPayloadKind: z\n .literal(DOCUMENT_SYNC_ROTATION_CHECKPOINT_PAYLOAD_KIND)\n .optional(),\n encryptedData: encryptedDataSchema,\n id: registerJsonSchemaFragment(z.string().refine(isUuidV4String), {\n pattern: UUID_V4_PATTERN.source,\n type: \"string\",\n }),\n partialEndVersionVector: versionVectorSchema,\n partialStartVersionVector: versionVectorSchema,\n plaintextHash: nonEmptyStringSchema,\n sourceVersionVector: versionVectorSchema.optional(),\n writeHeader: plainObjectSchema,\n }).superRefine((update, context) => {\n if (classifyDocumentSyncCheckpointFields(update) === \"invalid\") {\n context.addIssue({\n code: \"custom\",\n message: DOCUMENT_SYNC_CHECKPOINT_FIELD_SET_ISSUE_MESSAGE,\n });\n }\n }),\n [documentSyncRequestRotationRefinement],\n );\n}\n\n// Link-set rotations may carry a full-history baseline that is larger than a\n// single sync request. Their route has its own ingress policy, so keep the\n// shared update contract unbounded and apply the sync-specific ceiling only\n// where an update is embedded in DocumentSyncRequest.\nexport const DocumentOutgoingUpdateSchema = createDocumentOutgoingUpdateSchema(\n nonEmptyStringSchema,\n nonEmptyStringSchema,\n);\n\nconst DocumentSyncOutgoingUpdateSchema = createDocumentOutgoingUpdateSchema(\n boundedNonEmptyStringSchema(MAX_DOCUMENT_SYNC_REQUEST_BYTES),\n boundedNonEmptyStringSchema(MAX_DOCUMENT_SYNC_REQUEST_BYTES),\n);\n\nexport type DocumentOutgoingUpdate = z.infer<\n typeof DocumentOutgoingUpdateSchema\n>;\n\n// Document sync published container keyrings as opaque records before the\n// canonical container-mutation schema described their fields. Keep that one\n// existing OpenAPI view stable while runtime validation delegates to the shared\n// schema used by newer operations.\nconst DocumentSyncContainerMutationRequestSchema = registerJsonSchemaView(\n z.custom<ContainerMutationRequest>(\n (value) => ContainerMutationRequestSchema.safeParse(value).success,\n ),\n z.looseObject({\n body: requiredUnknownSchema,\n containerManifestHistoryRefs: ContainerManifestRefListSchema.optional(),\n destinationParentContainerPathRefs:\n OptionalContainerManifestPathSchema.optional(),\n event: plainObjectSchema,\n expectedManifestHash: nonEmptyStringSchema,\n keyEpoch: plainObjectSchema,\n keyring: plainObjectSchema.nullable(),\n manifest: plainObjectSchema,\n parentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),\n parentKekState: plainObjectSchema.nullable().optional(),\n predecessorBridge: plainObjectSchema.nullable(),\n previousContainerPathRefs: OptionalContainerManifestPathSchema.optional(),\n previousManifestRef: ContainerManifestRefSchema.nullable().optional(),\n principalPolicies: z.array(plainObjectSchema),\n userRecipientKeys: z.array(plainObjectSchema).optional(),\n wraps: z.array(plainObjectSchema),\n }),\n);\n\nconst WalLsnSchema = registerJsonSchemaFragment(\n z.string().refine(isWalLsnString),\n { pattern: WAL_LSN_PATTERN.source, type: \"string\" },\n);\n\nexport const DocumentSyncRequestSchema = registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n authorizingContainerPathRefs:\n ContainerManifestRefArrayArraySchema.optional(),\n // Each rotation carries a keyring sized by its epoch, so the batch is\n // bounded here as well as in the runtime guard.\n containerRekeys: arraySchema(\n DocumentSyncContainerMutationRequestSchema,\n MAX_INLINE_CONTAINER_REKEYS,\n ).optional(),\n contentKeyBundle: DocumentContentKeyBundleRequestSchema.optional(),\n contentKeyEpoch: positiveIntegerSchema,\n expectedLinkSetManifestHash: nonEmptyStringSchema,\n expectedTargetHash: nonEmptyStringSchema,\n historyMode: z\n .literal(\"raw\")\n .describe(\n \"Explicit read-only recovery mode that bypasses rotation-baseline redirection and returns retained missing history\",\n )\n .optional(),\n inlineRekeyCommitId: sha256HexStringSchema.optional(),\n localVersionVector: boundedStringSchema(\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n ).nullable(),\n minLsn: WalLsnSchema.optional(),\n outgoingUpdates: arraySchema(\n DocumentSyncOutgoingUpdateSchema,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n ),\n pullCursor: boundedNonEmptyStringSchema(\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n ).optional(),\n supportsPullPagination: z.literal(true),\n }).superRefine((request, context) => {\n if (!Array.isArray(request.outgoingUpdates)) {\n return;\n }\n // The field schemas have already recorded their cardinality errors. Do\n // not let the cross-field checks below rescan attacker-sized arrays after\n // those bounded schemas deliberately stopped before item validation.\n if (request.outgoingUpdates.length > MAX_DOCUMENT_SYNC_OUTGOING_UPDATES) {\n return;\n }\n if (\n Array.isArray(request.authorizingContainerPathRefs) &&\n request.authorizingContainerPathRefs.length >\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS\n ) {\n return;\n }\n\n const hasOutgoingUpdates = request.outgoingUpdates.length > 0;\n if (\n (request.containerRekeys?.length ?? 0) > 0 !==\n (request.inlineRekeyCommitId !== undefined)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"inline rekey commit id must accompany container rekeys\",\n path: [\"inlineRekeyCommitId\"],\n });\n }\n if (\n request.pullCursor !== undefined &&\n (hasOutgoingUpdates ||\n (request.containerRekeys?.length ?? 0) > 0 ||\n request.contentKeyBundle !== undefined ||\n request.authorizingContainerPathRefs !== undefined)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"continued pulls must be read-only\",\n path: [\"pullCursor\"],\n });\n }\n if (\n request.historyMode === \"raw\" &&\n (hasOutgoingUpdates ||\n (request.containerRekeys?.length ?? 0) > 0 ||\n request.contentKeyBundle !== undefined ||\n request.authorizingContainerPathRefs !== undefined)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"raw-history pulls must be read-only\",\n path: [\"historyMode\"],\n });\n }\n if (request.historyMode === \"raw\" && request.localVersionVector !== null) {\n context.addIssue({\n code: \"custom\",\n message: \"raw-history pulls must start from a null version vector\",\n path: [\"localVersionVector\"],\n });\n }\n const requestMode = classifyDocumentSyncRequestMode({\n authorizingContainerPathRefsPresent:\n request.authorizingContainerPathRefs !== undefined,\n hasContainerRekeys: (request.containerRekeys?.length ?? 0) > 0,\n hasOutgoingUpdates,\n });\n\n if (requestMode === \"invalid-authorizing-path-refs-absent\") {\n context.addIssue({\n code: \"custom\",\n message:\n \"authorizing container paths are required for outgoing updates\",\n path: [\"authorizingContainerPathRefs\"],\n });\n }\n\n if (requestMode === \"invalid-rekeys-without-write\") {\n context.addIssue({\n code: \"custom\",\n message: \"container rekeys require an outgoing update\",\n path: [\"containerRekeys\"],\n });\n }\n\n if (\n new Set(\n request.outgoingUpdates\n .filter(isPlainObject)\n .map((update) => Reflect.get(update, \"id\")),\n ).size !== request.outgoingUpdates.length\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"outgoing update ids must be unique\",\n path: [\"outgoingUpdates\"],\n });\n }\n }),\n [\n ...documentSyncRequestEnvelopeRefinements,\n ...documentSyncRequestPullRefinements,\n ],\n);\n\nexport type DocumentSyncRequest = z.infer<typeof DocumentSyncRequestSchema>;\n"]}
1
+ {"version":3,"file":"documentSyncSchema.js","sourceRoot":"","sources":["documentSyncSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,gDAAgD,EAChD,sCAAsC,EACtC,8CAA8C,GAC/C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sCAAsC,EACtC,kCAAkC,EAClC,qCAAqC,GACtC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,2BA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O,CAAC,4BAA4B,KAAK,SAAS;QACpD,kBAAkB,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QAC9D,kBAAkB;KACnB,CAAC,CAAC;IAEH,IAAI,WAAW,KAAK,sCAAsC,EAAE,CAAC;QAC3D,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EACL,+DAA+D;YACjE,IAAI,EAAE,CAAC,8BAA8B,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,WAAW,KAAK,8BAA8B,EAAE,CAAC;QACnD,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,6CAA6C;YACtD,IAAI,EAAE,CAAC,iBAAiB,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,IACE,IAAI,GAAG,CACL,OAAO,CAAC,eAAe;SACpB,MAAM,CAAC,aAAa,CAAC;SACrB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAC9C,CAAC,IAAI,KAAK,OAAO,CAAC,eAAe,CAAC,MAAM,EACzC,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,oCAAoC;YAC7C,IAAI,EAAE,CAAC,iBAAiB,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,EACF;IACE,GAAG,sCAAsC;IACzC,GAAG,kCAAkC;CACtC,CACF,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n classifyDocumentSyncCheckpointFields,\n DOCUMENT_SYNC_CHECKPOINT_FIELD_SET_ISSUE_MESSAGE,\n DOCUMENT_SYNC_ROTATION_CHECKPOINT_KIND,\n DOCUMENT_SYNC_ROTATION_CHECKPOINT_PAYLOAD_KIND,\n} from \"../documentSyncCheckpoint\";\nimport {\n documentSyncRequestEnvelopeRefinements,\n documentSyncRequestPullRefinements,\n documentSyncRequestRotationRefinement,\n} from \"../documentSyncRefinements\";\nimport { classifyDocumentSyncRequestMode } from \"../documentSyncRequestMode\";\nimport { isPlainObject } from \"../isPlainObject\";\nimport {\n registerJsonSchemaFragment,\n registerJsonSchemaRuntimeRefinements,\n registerJsonSchemaView,\n} from \"../jsonSchema\";\nimport {\n arraySchema,\n boundedNonEmptyStringSchema,\n boundedStringSchema,\n loosePlainObject,\n nonEmptyStringSchema,\n plainObjectSchema,\n positiveIntegerSchema,\n requiredUnknownSchema,\n sha256HexStringSchema,\n} from \"../schema\";\nimport { MAX_INLINE_CONTAINER_REKEYS } from \"../util/containerKekKeyringWire\";\nimport {\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n} from \"../util/documentSyncLimits\";\nimport { isUuidV4String, UUID_V4_PATTERN } from \"../util/uuid\";\nimport { isWalLsnString, WAL_LSN_PATTERN } from \"../util/walLsn\";\nimport {\n type ContainerMutationRequest,\n ContainerMutationRequestSchema,\n} from \"./container\";\nimport {\n ContainerManifestPathSchema,\n type ContainerManifestRef,\n ContainerManifestRefListSchema,\n ContainerManifestRefSchema,\n OptionalContainerManifestPathSchema,\n} from \"./containerManifestRef\";\nimport {\n ContentKeyWrappedKeySchema,\n contentKeyWrappingMetadataSchema,\n} from \"./contentKeyEnvelopeSchema\";\nimport { PrincipalPolicyRefListSchema } from \"./principalPolicyRef\";\n\nexport {\n ContainerManifestPathSchema,\n type ContainerManifestRef,\n ContainerManifestRefSchema,\n};\n\nexport const ContainerManifestRefArrayArraySchema = arraySchema(\n ContainerManifestPathSchema,\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n);\n\nexport const DocumentContentKeyTargetEnvelopeSchema = loosePlainObject({\n containerId: nonEmptyStringSchema,\n containerKeyEpoch: positiveIntegerSchema,\n containerKeyEpochId: nonEmptyStringSchema,\n containerManifestHash: nonEmptyStringSchema,\n wrappedKey: ContentKeyWrappedKeySchema,\n wrappingMetadata: contentKeyWrappingMetadataSchema(\"document\"),\n});\n\nexport type DocumentContentKeyTargetEnvelope = z.infer<\n typeof DocumentContentKeyTargetEnvelopeSchema\n>;\n\nexport const DocumentContentKeyBundleRequestSchema = loosePlainObject({\n contentKeyEpoch: positiveIntegerSchema,\n linkSetManifestHash: nonEmptyStringSchema,\n targetHash: nonEmptyStringSchema,\n targets: arraySchema(\n DocumentContentKeyTargetEnvelopeSchema,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n ),\n});\n\nexport type DocumentContentKeyBundleRequest = z.infer<\n typeof DocumentContentKeyBundleRequestSchema\n>;\n\nfunction createDocumentOutgoingUpdateSchema(\n encryptedDataSchema: z.ZodType<string>,\n versionVectorSchema: z.ZodType<string>,\n) {\n return registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n checkpointKind: z\n .literal(DOCUMENT_SYNC_ROTATION_CHECKPOINT_KIND)\n .optional(),\n checkpointPayloadKind: z\n .literal(DOCUMENT_SYNC_ROTATION_CHECKPOINT_PAYLOAD_KIND)\n .optional(),\n encryptedData: encryptedDataSchema,\n id: registerJsonSchemaFragment(z.string().refine(isUuidV4String), {\n pattern: UUID_V4_PATTERN.source,\n type: \"string\",\n }),\n partialEndVersionVector: versionVectorSchema,\n partialStartVersionVector: versionVectorSchema,\n plaintextHash: nonEmptyStringSchema,\n sourceVersionVector: versionVectorSchema.optional(),\n writeHeader: plainObjectSchema,\n }).superRefine((update, context) => {\n if (classifyDocumentSyncCheckpointFields(update) === \"invalid\") {\n context.addIssue({\n code: \"custom\",\n message: DOCUMENT_SYNC_CHECKPOINT_FIELD_SET_ISSUE_MESSAGE,\n });\n }\n }),\n [documentSyncRequestRotationRefinement],\n );\n}\n\n// Link-set rotations may carry a full-history baseline that is larger than a\n// single sync request. Their route has its own ingress policy, so keep the\n// shared update contract unbounded and apply the sync-specific ceiling only\n// where an update is embedded in DocumentSyncRequest.\nexport const DocumentOutgoingUpdateSchema = createDocumentOutgoingUpdateSchema(\n nonEmptyStringSchema,\n nonEmptyStringSchema,\n);\n\nconst DocumentSyncOutgoingUpdateSchema = createDocumentOutgoingUpdateSchema(\n boundedNonEmptyStringSchema(MAX_DOCUMENT_SYNC_REQUEST_BYTES),\n boundedNonEmptyStringSchema(MAX_DOCUMENT_SYNC_REQUEST_BYTES),\n);\n\nexport type DocumentOutgoingUpdate = z.infer<\n typeof DocumentOutgoingUpdateSchema\n>;\n\n// Document sync published container keyrings as opaque records before the\n// canonical container-mutation schema described their fields. Keep that one\n// existing OpenAPI view stable while runtime validation delegates to the shared\n// schema used by newer operations.\nconst DocumentSyncContainerMutationRequestSchema = registerJsonSchemaView(\n z.custom<ContainerMutationRequest>(\n (value) => ContainerMutationRequestSchema.safeParse(value).success,\n ),\n z.looseObject({\n body: requiredUnknownSchema,\n containerManifestHistoryRefs: ContainerManifestRefListSchema.optional(),\n destinationParentContainerPathRefs:\n OptionalContainerManifestPathSchema.optional(),\n event: plainObjectSchema,\n expectedManifestHash: nonEmptyStringSchema,\n keyEpoch: plainObjectSchema,\n keyring: plainObjectSchema.nullable(),\n manifest: plainObjectSchema,\n parentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),\n parentKekState: plainObjectSchema.nullable().optional(),\n predecessorBridge: plainObjectSchema.nullable(),\n previousContainerPathRefs: OptionalContainerManifestPathSchema.optional(),\n previousManifestRef: ContainerManifestRefSchema.nullable().optional(),\n principalPolicyRefs: PrincipalPolicyRefListSchema,\n userRecipientKeys: z.array(plainObjectSchema).optional(),\n wraps: z.array(plainObjectSchema),\n }),\n);\n\nconst WalLsnSchema = registerJsonSchemaFragment(\n z.string().refine(isWalLsnString),\n { pattern: WAL_LSN_PATTERN.source, type: \"string\" },\n);\n\nexport const DocumentSyncRequestSchema = registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n authorizingContainerPathRefs:\n ContainerManifestRefArrayArraySchema.optional(),\n // Each rotation carries a keyring sized by its epoch, so the batch is\n // bounded here as well as in the runtime guard.\n containerRekeys: arraySchema(\n DocumentSyncContainerMutationRequestSchema,\n MAX_INLINE_CONTAINER_REKEYS,\n ).optional(),\n contentKeyBundle: DocumentContentKeyBundleRequestSchema.optional(),\n contentKeyEpoch: positiveIntegerSchema,\n expectedLinkSetManifestHash: nonEmptyStringSchema,\n expectedTargetHash: nonEmptyStringSchema,\n historyMode: z\n .literal(\"raw\")\n .describe(\n \"Explicit read-only recovery mode that bypasses rotation-baseline redirection and returns retained missing history\",\n )\n .optional(),\n inlineRekeyCommitId: sha256HexStringSchema.optional(),\n localVersionVector: boundedStringSchema(\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n ).nullable(),\n minLsn: WalLsnSchema.optional(),\n outgoingUpdates: arraySchema(\n DocumentSyncOutgoingUpdateSchema,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n ),\n pullCursor: boundedNonEmptyStringSchema(\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n ).optional(),\n supportsPullPagination: z.literal(true),\n }).superRefine((request, context) => {\n if (!Array.isArray(request.outgoingUpdates)) {\n return;\n }\n // The field schemas have already recorded their cardinality errors. Do\n // not let the cross-field checks below rescan attacker-sized arrays after\n // those bounded schemas deliberately stopped before item validation.\n if (request.outgoingUpdates.length > MAX_DOCUMENT_SYNC_OUTGOING_UPDATES) {\n return;\n }\n if (\n Array.isArray(request.authorizingContainerPathRefs) &&\n request.authorizingContainerPathRefs.length >\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS\n ) {\n return;\n }\n\n const hasOutgoingUpdates = request.outgoingUpdates.length > 0;\n if (\n (request.containerRekeys?.length ?? 0) > 0 !==\n (request.inlineRekeyCommitId !== undefined)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"inline rekey commit id must accompany container rekeys\",\n path: [\"inlineRekeyCommitId\"],\n });\n }\n if (\n request.pullCursor !== undefined &&\n (hasOutgoingUpdates ||\n (request.containerRekeys?.length ?? 0) > 0 ||\n request.contentKeyBundle !== undefined ||\n request.authorizingContainerPathRefs !== undefined)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"continued pulls must be read-only\",\n path: [\"pullCursor\"],\n });\n }\n if (\n request.historyMode === \"raw\" &&\n (hasOutgoingUpdates ||\n (request.containerRekeys?.length ?? 0) > 0 ||\n request.contentKeyBundle !== undefined ||\n request.authorizingContainerPathRefs !== undefined)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"raw-history pulls must be read-only\",\n path: [\"historyMode\"],\n });\n }\n if (request.historyMode === \"raw\" && request.localVersionVector !== null) {\n context.addIssue({\n code: \"custom\",\n message: \"raw-history pulls must start from a null version vector\",\n path: [\"localVersionVector\"],\n });\n }\n const requestMode = classifyDocumentSyncRequestMode({\n authorizingContainerPathRefsPresent:\n request.authorizingContainerPathRefs !== undefined,\n hasContainerRekeys: (request.containerRekeys?.length ?? 0) > 0,\n hasOutgoingUpdates,\n });\n\n if (requestMode === \"invalid-authorizing-path-refs-absent\") {\n context.addIssue({\n code: \"custom\",\n message:\n \"authorizing container paths are required for outgoing updates\",\n path: [\"authorizingContainerPathRefs\"],\n });\n }\n\n if (requestMode === \"invalid-rekeys-without-write\") {\n context.addIssue({\n code: \"custom\",\n message: \"container rekeys require an outgoing update\",\n path: [\"containerRekeys\"],\n });\n }\n\n if (\n new Set(\n request.outgoingUpdates\n .filter(isPlainObject)\n .map((update) => Reflect.get(update, \"id\")),\n ).size !== request.outgoingUpdates.length\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"outgoing update ids must be unique\",\n path: [\"outgoingUpdates\"],\n });\n }\n }),\n [\n ...documentSyncRequestEnvelopeRefinements,\n ...documentSyncRequestPullRefinements,\n ],\n);\n\nexport type DocumentSyncRequest = z.infer<typeof DocumentSyncRequestSchema>;\n"]}
@@ -9,6 +9,7 @@ export { type ContainerManifestRef, ContainerManifestRefArrayArraySchema, Contai
9
9
  export { type CreateOrganizationGroupRequest, CreateOrganizationGroupRequestSchema, type CreateOrganizationGroupWithPolicyRequest, CreateOrganizationGroupWithPolicyRequestSchema, type DeleteOrganizationGroupRequest, DeleteOrganizationGroupRequestSchema, isCreateOrganizationGroupRequest, isCreateOrganizationGroupWithPolicyRequest, isDeleteOrganizationGroupRequest, isUpdateOrganizationProfileRequest, isUpdateOrganizationRosterEntryRequest, type OrganizationReadModelQuery, OrganizationReadModelQuerySchema, type UpdateOrganizationProfileRequest, UpdateOrganizationProfileRequestSchema, type UpdateOrganizationRosterEntryRequest, UpdateOrganizationRosterEntryRequestSchema, } from "./organization.js";
10
10
  export { type CreateOrganizationRequest, CreateOrganizationRequestSchema, isCreateOrganizationRequest, isOrganizationProvisioningRequest, isProvisionedDocumentRequest, isProvisionedSystemContainerRequest, type OrganizationProvisioningRequest, OrganizationProvisioningRequestSchema, type ProvisionedDocumentRequest, ProvisionedDocumentRequestSchema, type ProvisionedSystemContainerRequest, ProvisionedSystemContainerRequestSchema, } from "./organizationProvisioning.js";
11
11
  export { type CommitOrganizationGroupPolicyRequest, CommitOrganizationGroupPolicyRequestSchema, isCommitOrganizationGroupPolicyRequest, isOrganizationPrincipalPolicyRequest, isPutPrincipalPolicyRequest, type OrganizationPrincipalPolicyRequest, OrganizationPrincipalPolicyRequestSchema, type PrincipalContainerGrantRequest, PrincipalContainerGrantRequestSchema, type PrincipalMemberEnvelopeRequest, type PrincipalProjectionMemberRequest, type PrincipalStateEncryptedPayloadRequest, type PrincipalStateRequest, type PutPrincipalPolicyRequest, PutPrincipalPolicyRequestSchema, } from "./principal.js";
12
+ export { type PrincipalPolicyRef, PrincipalPolicyRefListSchema, PrincipalPolicyRefSchema, } from "./principalPolicyRef.js";
12
13
  export { isRegistrationRequest, type RegistrationRequest, RegistrationRequestSchema, } from "./registration.js";
13
14
  export { isRevenueCatTransferWebhookEvent, isRevenueCatWebhookRequest, type RevenueCatIncomingWebhookEvent, RevenueCatIncomingWebhookEventSchema, type RevenueCatSubscriberAttribute, RevenueCatSubscriberAttributeSchema, type RevenueCatTransferWebhookEvent, RevenueCatTransferWebhookEventSchema, type RevenueCatWebhookEvent, RevenueCatWebhookEventSchema, type RevenueCatWebhookRequest, RevenueCatWebhookRequestSchema, } from "./revenuecatWebhook.js";
14
15
  export { isStripeReturnUrlRequest, type StripeReturnUrlRequest, StripeReturnUrlRequestSchema, } from "./stripeCheckout.js";
@@ -8,6 +8,7 @@ export { ContainerManifestRefArrayArraySchema, ContainerManifestRefSchema, Docum
8
8
  export { CreateOrganizationGroupRequestSchema, CreateOrganizationGroupWithPolicyRequestSchema, DeleteOrganizationGroupRequestSchema, isCreateOrganizationGroupRequest, isCreateOrganizationGroupWithPolicyRequest, isDeleteOrganizationGroupRequest, isUpdateOrganizationProfileRequest, isUpdateOrganizationRosterEntryRequest, OrganizationReadModelQuerySchema, UpdateOrganizationProfileRequestSchema, UpdateOrganizationRosterEntryRequestSchema, } from "./organization.js";
9
9
  export { CreateOrganizationRequestSchema, isCreateOrganizationRequest, isOrganizationProvisioningRequest, isProvisionedDocumentRequest, isProvisionedSystemContainerRequest, OrganizationProvisioningRequestSchema, ProvisionedDocumentRequestSchema, ProvisionedSystemContainerRequestSchema, } from "./organizationProvisioning.js";
10
10
  export { CommitOrganizationGroupPolicyRequestSchema, isCommitOrganizationGroupPolicyRequest, isOrganizationPrincipalPolicyRequest, isPutPrincipalPolicyRequest, OrganizationPrincipalPolicyRequestSchema, PrincipalContainerGrantRequestSchema, PutPrincipalPolicyRequestSchema, } from "./principal.js";
11
+ export { PrincipalPolicyRefListSchema, PrincipalPolicyRefSchema, } from "./principalPolicyRef.js";
11
12
  export { isRegistrationRequest, RegistrationRequestSchema, } from "./registration.js";
12
13
  export { isRevenueCatTransferWebhookEvent, isRevenueCatWebhookRequest, RevenueCatIncomingWebhookEventSchema, RevenueCatSubscriberAttributeSchema, RevenueCatTransferWebhookEventSchema, RevenueCatWebhookEventSchema, RevenueCatWebhookRequestSchema, } from "./revenuecatWebhook.js";
13
14
  export { isStripeReturnUrlRequest, StripeReturnUrlRequestSchema, } from "./stripeCheckout.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EAEf,mBAAmB,GACpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,+BAA+B,EAE/B,iCAAiC,EAEjC,iCAAiC,EAEjC,yCAAyC,EAEzC,2BAA2B,EAE3B,uCAAuC,EACvC,2BAA2B,EAC3B,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,8BAA8B,EAE9B,4BAA4B,EAE5B,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0CAA0C,EAC1C,mCAAmC,EAEnC,uCAAuC,EACvC,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,gDAAgD,EAChD,4CAA4C,GAC7C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iCAAiC,EAEjC,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,oCAAoC,EACpC,0BAA0B,EAE1B,qCAAqC,EAErC,sCAAsC,EAEtC,2BAA2B,EAE3B,oCAAoC,EAEpC,4BAA4B,EAE5B,0BAA0B,EAE1B,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,oCAAoC,EAEpC,8CAA8C,EAE9C,oCAAoC,EACpC,gCAAgC,EAChC,0CAA0C,EAC1C,gCAAgC,EAChC,kCAAkC,EAClC,sCAAsC,EAEtC,gCAAgC,EAEhC,sCAAsC,EAEtC,0CAA0C,GAC3C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,+BAA+B,EAC/B,2BAA2B,EAC3B,iCAAiC,EACjC,4BAA4B,EAC5B,mCAAmC,EAEnC,qCAAqC,EAErC,gCAAgC,EAEhC,uCAAuC,GACxC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,0CAA0C,EAC1C,sCAAsC,EACtC,oCAAoC,EACpC,2BAA2B,EAE3B,wCAAwC,EAExC,oCAAoC,EAMpC,+BAA+B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EAErB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAE1B,oCAAoC,EAEpC,mCAAmC,EAEnC,oCAAoC,EAEpC,4BAA4B,EAE5B,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EAExB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EAEtB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC","sourcesContent":["export type { AccessManifestBundleWire } from \"../util/accessManifestBundle\";\nexport {\n type ChallengeRequest,\n ChallengeRequestSchema,\n isChallengeRequest,\n isVerifyRequest,\n type VerifyRequest,\n VerifyRequestSchema,\n} from \"./auth\";\nexport {\n type BlobAttachmentBindRequest,\n BlobAttachmentBindRequestSchema,\n type BlobAttachmentDetachRequest,\n BlobAttachmentDetachRequestSchema,\n type BlobContentKeyBundleRequest,\n BlobContentKeyBundleRequestSchema,\n type BlobContentKeyTargetEnvelopeRequest,\n BlobContentKeyTargetEnvelopeRequestSchema,\n type BlobStagedBlobRequest,\n BlobStagedBlobRequestSchema,\n type InitiateMultipartBlobStageRequest,\n InitiateMultipartBlobStageRequestSchema,\n isBlobAttachmentBindRequest,\n isBlobAttachmentDetachRequest,\n isInitiateMultipartBlobStageRequest,\n} from \"./blob\";\nexport {\n type ContainerMutationRequest,\n ContainerMutationRequestSchema,\n type ContainerReciteRequest,\n ContainerReciteRequestSchema,\n type ContainerRotationRequest,\n ContainerRotationRequestSchema,\n isContainerMutationRequest,\n isContainerReciteRequest,\n isContainerRotationRequest,\n} from \"./container\";\nexport {\n DEFAULT_CONTAINER_DOCUMENT_LANE_PAGE_LIMIT,\n isListContainerDocumentLanesRequest,\n type ListContainerDocumentLanesRequest,\n ListContainerDocumentLanesRequestSchema,\n MAX_CONTAINER_DOCUMENT_LANE_PAGE_TOTAL,\n MAX_CONTAINER_DOCUMENT_LANES,\n} from \"./containerDocumentLanes\";\nexport {\n type ContainerCreateWithMetadataDocumentRequest,\n ContainerCreateWithMetadataDocumentRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n} from \"./containerMetadata\";\nexport {\n isListContainerParentLanesRequest,\n type ListContainerParentLanesRequest,\n ListContainerParentLanesRequestSchema,\n} from \"./containerParentLanes\";\nexport {\n type ContainerManifestRef,\n ContainerManifestRefArrayArraySchema,\n ContainerManifestRefSchema,\n type DocumentContentKeyBundleRequest,\n DocumentContentKeyBundleRequestSchema,\n type DocumentContentKeyTargetEnvelope,\n DocumentContentKeyTargetEnvelopeSchema,\n type DocumentCreateRequest,\n DocumentCreateRequestSchema,\n type DocumentLinkSetMutationRequest,\n DocumentLinkSetMutationRequestSchema,\n type DocumentOutgoingUpdate,\n DocumentOutgoingUpdateSchema,\n type DocumentPurgeRequest,\n DocumentPurgeRequestSchema,\n type DocumentSyncRequest,\n DocumentSyncRequestSchema,\n isContainerManifestRefArrayArray,\n isDocumentContentKeyBundleRequest,\n isDocumentCreateRequest,\n isDocumentLinkSetMutationRequest,\n isDocumentPurgeRequest,\n isDocumentSyncRequest,\n} from \"./document\";\nexport {\n type CreateOrganizationGroupRequest,\n CreateOrganizationGroupRequestSchema,\n type CreateOrganizationGroupWithPolicyRequest,\n CreateOrganizationGroupWithPolicyRequestSchema,\n type DeleteOrganizationGroupRequest,\n DeleteOrganizationGroupRequestSchema,\n isCreateOrganizationGroupRequest,\n isCreateOrganizationGroupWithPolicyRequest,\n isDeleteOrganizationGroupRequest,\n isUpdateOrganizationProfileRequest,\n isUpdateOrganizationRosterEntryRequest,\n type OrganizationReadModelQuery,\n OrganizationReadModelQuerySchema,\n type UpdateOrganizationProfileRequest,\n UpdateOrganizationProfileRequestSchema,\n type UpdateOrganizationRosterEntryRequest,\n UpdateOrganizationRosterEntryRequestSchema,\n} from \"./organization\";\nexport {\n type CreateOrganizationRequest,\n CreateOrganizationRequestSchema,\n isCreateOrganizationRequest,\n isOrganizationProvisioningRequest,\n isProvisionedDocumentRequest,\n isProvisionedSystemContainerRequest,\n type OrganizationProvisioningRequest,\n OrganizationProvisioningRequestSchema,\n type ProvisionedDocumentRequest,\n ProvisionedDocumentRequestSchema,\n type ProvisionedSystemContainerRequest,\n ProvisionedSystemContainerRequestSchema,\n} from \"./organizationProvisioning\";\nexport {\n type CommitOrganizationGroupPolicyRequest,\n CommitOrganizationGroupPolicyRequestSchema,\n isCommitOrganizationGroupPolicyRequest,\n isOrganizationPrincipalPolicyRequest,\n isPutPrincipalPolicyRequest,\n type OrganizationPrincipalPolicyRequest,\n OrganizationPrincipalPolicyRequestSchema,\n type PrincipalContainerGrantRequest,\n PrincipalContainerGrantRequestSchema,\n type PrincipalMemberEnvelopeRequest,\n type PrincipalProjectionMemberRequest,\n type PrincipalStateEncryptedPayloadRequest,\n type PrincipalStateRequest,\n type PutPrincipalPolicyRequest,\n PutPrincipalPolicyRequestSchema,\n} from \"./principal\";\nexport {\n isRegistrationRequest,\n type RegistrationRequest,\n RegistrationRequestSchema,\n} from \"./registration\";\nexport {\n isRevenueCatTransferWebhookEvent,\n isRevenueCatWebhookRequest,\n type RevenueCatIncomingWebhookEvent,\n RevenueCatIncomingWebhookEventSchema,\n type RevenueCatSubscriberAttribute,\n RevenueCatSubscriberAttributeSchema,\n type RevenueCatTransferWebhookEvent,\n RevenueCatTransferWebhookEventSchema,\n type RevenueCatWebhookEvent,\n RevenueCatWebhookEventSchema,\n type RevenueCatWebhookRequest,\n RevenueCatWebhookRequestSchema,\n} from \"./revenuecatWebhook\";\nexport {\n isStripeReturnUrlRequest,\n type StripeReturnUrlRequest,\n StripeReturnUrlRequestSchema,\n} from \"./stripeCheckout\";\nexport {\n isStripeWebhookRequest,\n type StripeWebhookRequest,\n StripeWebhookRequestSchema,\n} from \"./stripeWebhook\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EAEf,mBAAmB,GACpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,+BAA+B,EAE/B,iCAAiC,EAEjC,iCAAiC,EAEjC,yCAAyC,EAEzC,2BAA2B,EAE3B,uCAAuC,EACvC,2BAA2B,EAC3B,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,8BAA8B,EAE9B,4BAA4B,EAE5B,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0CAA0C,EAC1C,mCAAmC,EAEnC,uCAAuC,EACvC,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,gDAAgD,EAChD,4CAA4C,GAC7C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iCAAiC,EAEjC,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,oCAAoC,EACpC,0BAA0B,EAE1B,qCAAqC,EAErC,sCAAsC,EAEtC,2BAA2B,EAE3B,oCAAoC,EAEpC,4BAA4B,EAE5B,0BAA0B,EAE1B,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,oCAAoC,EAEpC,8CAA8C,EAE9C,oCAAoC,EACpC,gCAAgC,EAChC,0CAA0C,EAC1C,gCAAgC,EAChC,kCAAkC,EAClC,sCAAsC,EAEtC,gCAAgC,EAEhC,sCAAsC,EAEtC,0CAA0C,GAC3C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,+BAA+B,EAC/B,2BAA2B,EAC3B,iCAAiC,EACjC,4BAA4B,EAC5B,mCAAmC,EAEnC,qCAAqC,EAErC,gCAAgC,EAEhC,uCAAuC,GACxC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,0CAA0C,EAC1C,sCAAsC,EACtC,oCAAoC,EACpC,2BAA2B,EAE3B,wCAAwC,EAExC,oCAAoC,EAMpC,+BAA+B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EAErB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAE1B,oCAAoC,EAEpC,mCAAmC,EAEnC,oCAAoC,EAEpC,4BAA4B,EAE5B,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EAExB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EAEtB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC","sourcesContent":["export type { AccessManifestBundleWire } from \"../util/accessManifestBundle\";\nexport {\n type ChallengeRequest,\n ChallengeRequestSchema,\n isChallengeRequest,\n isVerifyRequest,\n type VerifyRequest,\n VerifyRequestSchema,\n} from \"./auth\";\nexport {\n type BlobAttachmentBindRequest,\n BlobAttachmentBindRequestSchema,\n type BlobAttachmentDetachRequest,\n BlobAttachmentDetachRequestSchema,\n type BlobContentKeyBundleRequest,\n BlobContentKeyBundleRequestSchema,\n type BlobContentKeyTargetEnvelopeRequest,\n BlobContentKeyTargetEnvelopeRequestSchema,\n type BlobStagedBlobRequest,\n BlobStagedBlobRequestSchema,\n type InitiateMultipartBlobStageRequest,\n InitiateMultipartBlobStageRequestSchema,\n isBlobAttachmentBindRequest,\n isBlobAttachmentDetachRequest,\n isInitiateMultipartBlobStageRequest,\n} from \"./blob\";\nexport {\n type ContainerMutationRequest,\n ContainerMutationRequestSchema,\n type ContainerReciteRequest,\n ContainerReciteRequestSchema,\n type ContainerRotationRequest,\n ContainerRotationRequestSchema,\n isContainerMutationRequest,\n isContainerReciteRequest,\n isContainerRotationRequest,\n} from \"./container\";\nexport {\n DEFAULT_CONTAINER_DOCUMENT_LANE_PAGE_LIMIT,\n isListContainerDocumentLanesRequest,\n type ListContainerDocumentLanesRequest,\n ListContainerDocumentLanesRequestSchema,\n MAX_CONTAINER_DOCUMENT_LANE_PAGE_TOTAL,\n MAX_CONTAINER_DOCUMENT_LANES,\n} from \"./containerDocumentLanes\";\nexport {\n type ContainerCreateWithMetadataDocumentRequest,\n ContainerCreateWithMetadataDocumentRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n} from \"./containerMetadata\";\nexport {\n isListContainerParentLanesRequest,\n type ListContainerParentLanesRequest,\n ListContainerParentLanesRequestSchema,\n} from \"./containerParentLanes\";\nexport {\n type ContainerManifestRef,\n ContainerManifestRefArrayArraySchema,\n ContainerManifestRefSchema,\n type DocumentContentKeyBundleRequest,\n DocumentContentKeyBundleRequestSchema,\n type DocumentContentKeyTargetEnvelope,\n DocumentContentKeyTargetEnvelopeSchema,\n type DocumentCreateRequest,\n DocumentCreateRequestSchema,\n type DocumentLinkSetMutationRequest,\n DocumentLinkSetMutationRequestSchema,\n type DocumentOutgoingUpdate,\n DocumentOutgoingUpdateSchema,\n type DocumentPurgeRequest,\n DocumentPurgeRequestSchema,\n type DocumentSyncRequest,\n DocumentSyncRequestSchema,\n isContainerManifestRefArrayArray,\n isDocumentContentKeyBundleRequest,\n isDocumentCreateRequest,\n isDocumentLinkSetMutationRequest,\n isDocumentPurgeRequest,\n isDocumentSyncRequest,\n} from \"./document\";\nexport {\n type CreateOrganizationGroupRequest,\n CreateOrganizationGroupRequestSchema,\n type CreateOrganizationGroupWithPolicyRequest,\n CreateOrganizationGroupWithPolicyRequestSchema,\n type DeleteOrganizationGroupRequest,\n DeleteOrganizationGroupRequestSchema,\n isCreateOrganizationGroupRequest,\n isCreateOrganizationGroupWithPolicyRequest,\n isDeleteOrganizationGroupRequest,\n isUpdateOrganizationProfileRequest,\n isUpdateOrganizationRosterEntryRequest,\n type OrganizationReadModelQuery,\n OrganizationReadModelQuerySchema,\n type UpdateOrganizationProfileRequest,\n UpdateOrganizationProfileRequestSchema,\n type UpdateOrganizationRosterEntryRequest,\n UpdateOrganizationRosterEntryRequestSchema,\n} from \"./organization\";\nexport {\n type CreateOrganizationRequest,\n CreateOrganizationRequestSchema,\n isCreateOrganizationRequest,\n isOrganizationProvisioningRequest,\n isProvisionedDocumentRequest,\n isProvisionedSystemContainerRequest,\n type OrganizationProvisioningRequest,\n OrganizationProvisioningRequestSchema,\n type ProvisionedDocumentRequest,\n ProvisionedDocumentRequestSchema,\n type ProvisionedSystemContainerRequest,\n ProvisionedSystemContainerRequestSchema,\n} from \"./organizationProvisioning\";\nexport {\n type CommitOrganizationGroupPolicyRequest,\n CommitOrganizationGroupPolicyRequestSchema,\n isCommitOrganizationGroupPolicyRequest,\n isOrganizationPrincipalPolicyRequest,\n isPutPrincipalPolicyRequest,\n type OrganizationPrincipalPolicyRequest,\n OrganizationPrincipalPolicyRequestSchema,\n type PrincipalContainerGrantRequest,\n PrincipalContainerGrantRequestSchema,\n type PrincipalMemberEnvelopeRequest,\n type PrincipalProjectionMemberRequest,\n type PrincipalStateEncryptedPayloadRequest,\n type PrincipalStateRequest,\n type PutPrincipalPolicyRequest,\n PutPrincipalPolicyRequestSchema,\n} from \"./principal\";\nexport {\n type PrincipalPolicyRef,\n PrincipalPolicyRefListSchema,\n PrincipalPolicyRefSchema,\n} from \"./principalPolicyRef\";\nexport {\n isRegistrationRequest,\n type RegistrationRequest,\n RegistrationRequestSchema,\n} from \"./registration\";\nexport {\n isRevenueCatTransferWebhookEvent,\n isRevenueCatWebhookRequest,\n type RevenueCatIncomingWebhookEvent,\n RevenueCatIncomingWebhookEventSchema,\n type RevenueCatSubscriberAttribute,\n RevenueCatSubscriberAttributeSchema,\n type RevenueCatTransferWebhookEvent,\n RevenueCatTransferWebhookEventSchema,\n type RevenueCatWebhookEvent,\n RevenueCatWebhookEventSchema,\n type RevenueCatWebhookRequest,\n RevenueCatWebhookRequestSchema,\n} from \"./revenuecatWebhook\";\nexport {\n isStripeReturnUrlRequest,\n type StripeReturnUrlRequest,\n StripeReturnUrlRequestSchema,\n} from \"./stripeCheckout\";\nexport {\n isStripeWebhookRequest,\n type StripeWebhookRequest,\n StripeWebhookRequestSchema,\n} from \"./stripeWebhook\";\n"]}