@tearleads/client-sdk 0.1.244 → 0.1.246

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 (101) hide show
  1. package/data/persistence/container-contents/containerContentsPersistence.js +2 -0
  2. package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
  3. package/data/persistence/container-contents/containerContentsPersistenceTypes.d.ts +2 -1
  4. package/data/persistence/container-contents/containerContentsPersistenceTypes.js.map +1 -1
  5. package/data/persistence/container-contents/containerMetadataRevalidations.d.ts +22 -0
  6. package/data/persistence/container-contents/containerMetadataRevalidations.js +52 -0
  7. package/data/persistence/container-contents/containerMetadataRevalidations.js.map +1 -0
  8. package/data/sqlite/schema/containerSchema.d.ts +173 -0
  9. package/data/sqlite/schema/containerSchema.js +18 -0
  10. package/data/sqlite/schema/containerSchema.js.map +1 -1
  11. package/data/sqlite/schema/index.d.ts +84 -1
  12. package/data/sqlite/schema/index.js +1 -1
  13. package/data/sqlite/schema/index.js.map +1 -1
  14. package/internal/api-client/ApiClient.d.ts +1 -8
  15. package/internal/api-client/client/apiClientContext.d.ts +1 -0
  16. package/internal/api-client/client/containerReads.d.ts +1 -0
  17. package/internal/crypto/keying/accessManifestVerificationTypes.d.ts +8 -2
  18. package/internal/crypto/keying/accessManifestVerificationTypes.js.map +1 -1
  19. package/internal/crypto/keying/containerAccess.js +1 -1
  20. package/internal/crypto/keying/containerAccess.js.map +1 -1
  21. package/internal/crypto/keying/documentAccess.js +1 -1
  22. package/internal/crypto/keying/documentAccess.js.map +1 -1
  23. package/internal/crypto/organizationReplacement.js +5 -6
  24. package/internal/crypto/organizationReplacement.js.map +1 -1
  25. package/internal/loro/document.d.ts +5 -0
  26. package/internal/loro/document.js +17 -0
  27. package/internal/loro/document.js.map +1 -1
  28. package/internal/loro/index.d.ts +1 -1
  29. package/internal/loro/index.js +1 -1
  30. package/internal/loro/index.js.map +1 -1
  31. package/internal/validators/operation/attachments.d.ts +0 -12
  32. package/internal/validators/operation/auth.d.ts +0 -76
  33. package/internal/validators/operation/containerMutations.d.ts +1 -49
  34. package/internal/validators/operation/containerMutations.js +1 -1
  35. package/internal/validators/operation/containerMutations.js.map +1 -1
  36. package/internal/validators/operation/containerReads.d.ts +2 -0
  37. package/internal/validators/operation/documentMutations.d.ts +0 -24
  38. package/internal/validators/operation/documentSync.d.ts +0 -4
  39. package/internal/validators/operation/organizations.d.ts +0 -88
  40. package/internal/validators/operation/principals.d.ts +0 -16
  41. package/internal/validators/request/blob.d.ts +0 -12
  42. package/internal/validators/request/container.d.ts +0 -16
  43. package/internal/validators/request/container.js +0 -2
  44. package/internal/validators/request/container.js.map +1 -1
  45. package/internal/validators/request/containerMetadata.d.ts +0 -20
  46. package/internal/validators/request/document.d.ts +0 -22
  47. package/internal/validators/request/document.js +0 -1
  48. package/internal/validators/request/document.js.map +1 -1
  49. package/internal/validators/request/documentSyncSchema.d.ts +0 -4
  50. package/internal/validators/request/documentSyncSchema.js +0 -1
  51. package/internal/validators/request/documentSyncSchema.js.map +1 -1
  52. package/internal/validators/request/organization.d.ts +0 -16
  53. package/internal/validators/request/organizationProvisioning.d.ts +0 -242
  54. package/internal/validators/request/principal.d.ts +0 -20
  55. package/internal/validators/request/registration.d.ts +0 -76
  56. package/internal/validators/response/container.d.ts +8 -0
  57. package/internal/validators/response/container.js +1 -0
  58. package/internal/validators/response/container.js.map +1 -1
  59. package/internal/validators/response/containerParentLanes.d.ts +2 -0
  60. package/package.json +1 -1
  61. package/stores/container-contents/containerContentsStore.js +2 -0
  62. package/stores/container-contents/containerContentsStore.js.map +1 -1
  63. package/stores/container-contents/hydration/startupHydration.js +6 -2
  64. package/stores/container-contents/hydration/startupHydration.js.map +1 -1
  65. package/stores/container-contents/state.js +5 -1
  66. package/stores/container-contents/state.js.map +1 -1
  67. package/stores/container-contents/syncAgent/metadataRevalidation.js +79 -0
  68. package/stores/container-contents/syncAgent/metadataRevalidation.js.map +1 -0
  69. package/stores/container-contents/syncAgent/syncAgentTypes.d.ts +6 -0
  70. package/stores/container-contents/syncAgent/syncAgentTypes.js.map +1 -1
  71. package/stores/container-contents/syncAgent/syncLaneIteration.js +110 -23
  72. package/stores/container-contents/syncAgent/syncLaneIteration.js.map +1 -1
  73. package/workflows/container-contents/container-state/move/acceptedMoveSettlement.js +3 -0
  74. package/workflows/container-contents/container-state/move/acceptedMoveSettlement.js.map +1 -1
  75. package/workflows/container-contents/container-state/remote.js +3 -0
  76. package/workflows/container-contents/container-state/remote.js.map +1 -1
  77. package/workflows/container-contents/containerPersistence.d.ts +1 -0
  78. package/workflows/container-contents/containerPersistence.js.map +1 -1
  79. package/workflows/container-contents/metadata/index.js +4 -1
  80. package/workflows/container-contents/metadata/index.js.map +1 -1
  81. package/workflows/container-contents/metadata/metadataSyncFollowup.js +9 -0
  82. package/workflows/container-contents/metadata/metadataSyncFollowup.js.map +1 -1
  83. package/workflows/container-contents/metadata/metadataTypes.d.ts +2 -0
  84. package/workflows/container-contents/metadata/metadataTypes.js.map +1 -1
  85. package/workflows/container-contents/remoteHydration/index.js +9 -0
  86. package/workflows/container-contents/remoteHydration/index.js.map +1 -1
  87. package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerState.js +31 -0
  88. package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerState.js.map +1 -1
  89. package/workflows/container-contents/remoteHydration/types.d.ts +9 -1
  90. package/workflows/container-contents/remoteHydration/types.js.map +1 -1
  91. package/workflows/containers/child/mutationRequestCore.js +1 -1
  92. package/workflows/containers/child/mutationRequestCore.js.map +1 -1
  93. package/workflows/containers/child/recitePlan.js +0 -1
  94. package/workflows/containers/child/recitePlan.js.map +1 -1
  95. package/workflows/containers/root/create.js +0 -1
  96. package/workflows/containers/root/create.js.map +1 -1
  97. package/workflows/documents/linkSet/index.js +0 -1
  98. package/workflows/documents/linkSet/index.js.map +1 -1
  99. package/workflows/organizations/principalPolicy/principalPolicyReceiptArtifacts.js +17 -10
  100. package/workflows/organizations/principalPolicy/principalPolicyReceiptArtifacts.js.map +1 -1
  101. package/workflows/registration/provisioningBootstrapBuilders.d.ts +0 -2
@@ -13,7 +13,6 @@ export declare const createContainerOperation: Omit<{
13
13
  expectedManifestHash: string;
14
14
  keyEpoch: Record<string, unknown>;
15
15
  keyring: Record<string, unknown> | null;
16
- manifest: Record<string, unknown>;
17
16
  predecessorBridge: Record<string, unknown> | null;
18
17
  principalPolicyRefs: {
19
18
  principalType: "group" | "organization";
@@ -54,7 +53,6 @@ export declare const createContainerOperation: Omit<{
54
53
  expectedManifestHash: string;
55
54
  keyEpoch: Record<string, unknown>;
56
55
  keyring: Record<string, unknown> | null;
57
- manifest: Record<string, unknown>;
58
56
  predecessorBridge: Record<string, unknown> | null;
59
57
  principalPolicyRefs: {
60
58
  principalType: "group" | "organization";
@@ -95,7 +93,6 @@ export declare const createContainerOperation: Omit<{
95
93
  expectedManifestHash: string;
96
94
  keyEpoch: Record<string, unknown>;
97
95
  keyring: Record<string, unknown> | null;
98
- manifest: Record<string, unknown>;
99
96
  predecessorBridge: Record<string, unknown> | null;
100
97
  principalPolicyRefs: {
101
98
  principalType: "group" | "organization";
@@ -136,7 +133,6 @@ export declare const createContainerOperation: Omit<{
136
133
  expectedManifestHash: string;
137
134
  keyEpoch: Record<string, unknown>;
138
135
  keyring: Record<string, unknown> | null;
139
- manifest: Record<string, unknown>;
140
136
  predecessorBridge: Record<string, unknown> | null;
141
137
  principalPolicyRefs: {
142
138
  principalType: "group" | "organization";
@@ -292,7 +288,7 @@ export declare const createContainerOperation: Omit<{
292
288
  readonly failureStatuses: readonly [400, 401, 402, 403, 404, 409, 500];
293
289
  readonly id: "containers.create";
294
290
  readonly summary: "Create a container";
295
- readonly description: "Creates a container from a signed `container.create` event, its derived access manifest, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.";
291
+ readonly description: "Creates a container from a signed `container.create` event, the hash of the access manifest it derives, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.";
296
292
  readonly method: "POST";
297
293
  readonly params: z.ZodObject<{}, z.core.$strict>;
298
294
  readonly path: "/containers";
@@ -518,7 +514,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
518
514
  expectedManifestHash: string;
519
515
  keyEpoch: Record<string, unknown>;
520
516
  keyring: Record<string, unknown> | null;
521
- manifest: Record<string, unknown>;
522
517
  predecessorBridge: Record<string, unknown> | null;
523
518
  principalPolicyRefs: {
524
519
  principalType: "group" | "organization";
@@ -582,7 +577,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
582
577
  expectedManifestHash: string;
583
578
  keyEpoch: Record<string, unknown>;
584
579
  keyring: Record<string, unknown> | null;
585
- manifest: Record<string, unknown>;
586
580
  predecessorBridge: Record<string, unknown> | null;
587
581
  principalPolicyRefs: {
588
582
  principalType: "group" | "organization";
@@ -650,7 +644,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
650
644
  expectedManifestHash: string;
651
645
  keyEpoch: Record<string, unknown>;
652
646
  keyring: Record<string, unknown> | null;
653
- manifest: Record<string, unknown>;
654
647
  predecessorBridge: Record<string, unknown> | null;
655
648
  principalPolicyRefs: {
656
649
  principalType: "group" | "organization";
@@ -712,7 +705,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
712
705
  expectedManifestHash: string;
713
706
  keyEpoch: Record<string, unknown>;
714
707
  keyring: Record<string, unknown> | null;
715
- manifest: Record<string, unknown>;
716
708
  predecessorBridge: Record<string, unknown> | null;
717
709
  principalPolicyRefs: {
718
710
  principalType: "group" | "organization";
@@ -776,7 +768,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
776
768
  expectedManifestHash: string;
777
769
  keyEpoch: Record<string, unknown>;
778
770
  keyring: Record<string, unknown> | null;
779
- manifest: Record<string, unknown>;
780
771
  predecessorBridge: Record<string, unknown> | null;
781
772
  principalPolicyRefs: {
782
773
  principalType: "group" | "organization";
@@ -844,7 +835,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
844
835
  expectedManifestHash: string;
845
836
  keyEpoch: Record<string, unknown>;
846
837
  keyring: Record<string, unknown> | null;
847
- manifest: Record<string, unknown>;
848
838
  predecessorBridge: Record<string, unknown> | null;
849
839
  principalPolicyRefs: {
850
840
  principalType: "group" | "organization";
@@ -906,7 +896,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
906
896
  expectedManifestHash: string;
907
897
  keyEpoch: Record<string, unknown>;
908
898
  keyring: Record<string, unknown> | null;
909
- manifest: Record<string, unknown>;
910
899
  predecessorBridge: Record<string, unknown> | null;
911
900
  principalPolicyRefs: {
912
901
  principalType: "group" | "organization";
@@ -970,7 +959,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
970
959
  expectedManifestHash: string;
971
960
  keyEpoch: Record<string, unknown>;
972
961
  keyring: Record<string, unknown> | null;
973
- manifest: Record<string, unknown>;
974
962
  predecessorBridge: Record<string, unknown> | null;
975
963
  principalPolicyRefs: {
976
964
  principalType: "group" | "organization";
@@ -1038,7 +1026,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
1038
1026
  expectedManifestHash: string;
1039
1027
  keyEpoch: Record<string, unknown>;
1040
1028
  keyring: Record<string, unknown> | null;
1041
- manifest: Record<string, unknown>;
1042
1029
  predecessorBridge: Record<string, unknown> | null;
1043
1030
  principalPolicyRefs: {
1044
1031
  principalType: "group" | "organization";
@@ -1100,7 +1087,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
1100
1087
  expectedManifestHash: string;
1101
1088
  keyEpoch: Record<string, unknown>;
1102
1089
  keyring: Record<string, unknown> | null;
1103
- manifest: Record<string, unknown>;
1104
1090
  predecessorBridge: Record<string, unknown> | null;
1105
1091
  principalPolicyRefs: {
1106
1092
  principalType: "group" | "organization";
@@ -1164,7 +1150,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
1164
1150
  expectedManifestHash: string;
1165
1151
  keyEpoch: Record<string, unknown>;
1166
1152
  keyring: Record<string, unknown> | null;
1167
- manifest: Record<string, unknown>;
1168
1153
  predecessorBridge: Record<string, unknown> | null;
1169
1154
  principalPolicyRefs: {
1170
1155
  principalType: "group" | "organization";
@@ -1232,7 +1217,6 @@ export declare const createContainerWithMetadataDocumentOperation: Omit<{
1232
1217
  expectedManifestHash: string;
1233
1218
  keyEpoch: Record<string, unknown>;
1234
1219
  keyring: Record<string, unknown> | null;
1235
- manifest: Record<string, unknown>;
1236
1220
  predecessorBridge: Record<string, unknown> | null;
1237
1221
  principalPolicyRefs: {
1238
1222
  principalType: "group" | "organization";
@@ -1742,7 +1726,6 @@ export declare const shareContainerOperation: Omit<{
1742
1726
  expectedManifestHash: string;
1743
1727
  keyEpoch: Record<string, unknown>;
1744
1728
  keyring: Record<string, unknown> | null;
1745
- manifest: Record<string, unknown>;
1746
1729
  predecessorBridge: Record<string, unknown> | null;
1747
1730
  principalPolicyRefs: {
1748
1731
  principalType: "group" | "organization";
@@ -1783,7 +1766,6 @@ export declare const shareContainerOperation: Omit<{
1783
1766
  expectedManifestHash: string;
1784
1767
  keyEpoch: Record<string, unknown>;
1785
1768
  keyring: Record<string, unknown> | null;
1786
- manifest: Record<string, unknown>;
1787
1769
  predecessorBridge: Record<string, unknown> | null;
1788
1770
  principalPolicyRefs: {
1789
1771
  principalType: "group" | "organization";
@@ -1824,7 +1806,6 @@ export declare const shareContainerOperation: Omit<{
1824
1806
  expectedManifestHash: string;
1825
1807
  keyEpoch: Record<string, unknown>;
1826
1808
  keyring: Record<string, unknown> | null;
1827
- manifest: Record<string, unknown>;
1828
1809
  predecessorBridge: Record<string, unknown> | null;
1829
1810
  principalPolicyRefs: {
1830
1811
  principalType: "group" | "organization";
@@ -1865,7 +1846,6 @@ export declare const shareContainerOperation: Omit<{
1865
1846
  expectedManifestHash: string;
1866
1847
  keyEpoch: Record<string, unknown>;
1867
1848
  keyring: Record<string, unknown> | null;
1868
- manifest: Record<string, unknown>;
1869
1849
  predecessorBridge: Record<string, unknown> | null;
1870
1850
  principalPolicyRefs: {
1871
1851
  principalType: "group" | "organization";
@@ -2246,7 +2226,6 @@ export declare const reciteContainerOperation: Omit<{
2246
2226
  body: unknown;
2247
2227
  event: Record<string, unknown>;
2248
2228
  expectedManifestHash: string;
2249
- manifest: Record<string, unknown>;
2250
2229
  previousContainerPathRefs: {
2251
2230
  containerId: string;
2252
2231
  manifestHash: string;
@@ -2265,7 +2244,6 @@ export declare const reciteContainerOperation: Omit<{
2265
2244
  body: unknown;
2266
2245
  event: Record<string, unknown>;
2267
2246
  expectedManifestHash: string;
2268
- manifest: Record<string, unknown>;
2269
2247
  previousContainerPathRefs: {
2270
2248
  containerId: string;
2271
2249
  manifestHash: string;
@@ -2284,7 +2262,6 @@ export declare const reciteContainerOperation: Omit<{
2284
2262
  body: unknown;
2285
2263
  event: Record<string, unknown>;
2286
2264
  expectedManifestHash: string;
2287
- manifest: Record<string, unknown>;
2288
2265
  previousContainerPathRefs: {
2289
2266
  containerId: string;
2290
2267
  manifestHash: string;
@@ -2303,7 +2280,6 @@ export declare const reciteContainerOperation: Omit<{
2303
2280
  body: unknown;
2304
2281
  event: Record<string, unknown>;
2305
2282
  expectedManifestHash: string;
2306
- manifest: Record<string, unknown>;
2307
2283
  previousContainerPathRefs: {
2308
2284
  containerId: string;
2309
2285
  manifestHash: string;
@@ -2630,7 +2606,6 @@ export declare const revokeContainerOperation: Omit<{
2630
2606
  expectedManifestHash: string;
2631
2607
  keyEpoch: Record<string, unknown>;
2632
2608
  keyring: Record<string, unknown> | null;
2633
- manifest: Record<string, unknown>;
2634
2609
  predecessorBridge: Record<string, unknown> | null;
2635
2610
  principalPolicyRefs: {
2636
2611
  principalType: "group" | "organization";
@@ -2645,7 +2620,6 @@ export declare const revokeContainerOperation: Omit<{
2645
2620
  expectedManifestHash: string;
2646
2621
  keyEpoch: Record<string, unknown>;
2647
2622
  keyring: Record<string, unknown> | null;
2648
- manifest: Record<string, unknown>;
2649
2623
  predecessorBridge: Record<string, unknown> | null;
2650
2624
  principalPolicyRefs: {
2651
2625
  principalType: "group" | "organization";
@@ -2713,7 +2687,6 @@ export declare const revokeContainerOperation: Omit<{
2713
2687
  expectedManifestHash: string;
2714
2688
  keyEpoch: Record<string, unknown>;
2715
2689
  keyring: Record<string, unknown> | null;
2716
- manifest: Record<string, unknown>;
2717
2690
  predecessorBridge: Record<string, unknown> | null;
2718
2691
  principalPolicyRefs: {
2719
2692
  principalType: "group" | "organization";
@@ -2728,7 +2701,6 @@ export declare const revokeContainerOperation: Omit<{
2728
2701
  expectedManifestHash: string;
2729
2702
  keyEpoch: Record<string, unknown>;
2730
2703
  keyring: Record<string, unknown> | null;
2731
- manifest: Record<string, unknown>;
2732
2704
  predecessorBridge: Record<string, unknown> | null;
2733
2705
  principalPolicyRefs: {
2734
2706
  principalType: "group" | "organization";
@@ -2796,7 +2768,6 @@ export declare const revokeContainerOperation: Omit<{
2796
2768
  expectedManifestHash: string;
2797
2769
  keyEpoch: Record<string, unknown>;
2798
2770
  keyring: Record<string, unknown> | null;
2799
- manifest: Record<string, unknown>;
2800
2771
  predecessorBridge: Record<string, unknown> | null;
2801
2772
  principalPolicyRefs: {
2802
2773
  principalType: "group" | "organization";
@@ -2811,7 +2782,6 @@ export declare const revokeContainerOperation: Omit<{
2811
2782
  expectedManifestHash: string;
2812
2783
  keyEpoch: Record<string, unknown>;
2813
2784
  keyring: Record<string, unknown> | null;
2814
- manifest: Record<string, unknown>;
2815
2785
  predecessorBridge: Record<string, unknown> | null;
2816
2786
  principalPolicyRefs: {
2817
2787
  principalType: "group" | "organization";
@@ -2879,7 +2849,6 @@ export declare const revokeContainerOperation: Omit<{
2879
2849
  expectedManifestHash: string;
2880
2850
  keyEpoch: Record<string, unknown>;
2881
2851
  keyring: Record<string, unknown> | null;
2882
- manifest: Record<string, unknown>;
2883
2852
  predecessorBridge: Record<string, unknown> | null;
2884
2853
  principalPolicyRefs: {
2885
2854
  principalType: "group" | "organization";
@@ -2894,7 +2863,6 @@ export declare const revokeContainerOperation: Omit<{
2894
2863
  expectedManifestHash: string;
2895
2864
  keyEpoch: Record<string, unknown>;
2896
2865
  keyring: Record<string, unknown> | null;
2897
- manifest: Record<string, unknown>;
2898
2866
  predecessorBridge: Record<string, unknown> | null;
2899
2867
  principalPolicyRefs: {
2900
2868
  principalType: "group" | "organization";
@@ -3392,7 +3360,6 @@ export declare const rekeyContainerOperation: Omit<{
3392
3360
  expectedManifestHash: string;
3393
3361
  keyEpoch: Record<string, unknown>;
3394
3362
  keyring: Record<string, unknown> | null;
3395
- manifest: Record<string, unknown>;
3396
3363
  predecessorBridge: Record<string, unknown> | null;
3397
3364
  principalPolicyRefs: {
3398
3365
  principalType: "group" | "organization";
@@ -3407,7 +3374,6 @@ export declare const rekeyContainerOperation: Omit<{
3407
3374
  expectedManifestHash: string;
3408
3375
  keyEpoch: Record<string, unknown>;
3409
3376
  keyring: Record<string, unknown> | null;
3410
- manifest: Record<string, unknown>;
3411
3377
  predecessorBridge: Record<string, unknown> | null;
3412
3378
  principalPolicyRefs: {
3413
3379
  principalType: "group" | "organization";
@@ -3475,7 +3441,6 @@ export declare const rekeyContainerOperation: Omit<{
3475
3441
  expectedManifestHash: string;
3476
3442
  keyEpoch: Record<string, unknown>;
3477
3443
  keyring: Record<string, unknown> | null;
3478
- manifest: Record<string, unknown>;
3479
3444
  predecessorBridge: Record<string, unknown> | null;
3480
3445
  principalPolicyRefs: {
3481
3446
  principalType: "group" | "organization";
@@ -3490,7 +3455,6 @@ export declare const rekeyContainerOperation: Omit<{
3490
3455
  expectedManifestHash: string;
3491
3456
  keyEpoch: Record<string, unknown>;
3492
3457
  keyring: Record<string, unknown> | null;
3493
- manifest: Record<string, unknown>;
3494
3458
  predecessorBridge: Record<string, unknown> | null;
3495
3459
  principalPolicyRefs: {
3496
3460
  principalType: "group" | "organization";
@@ -3558,7 +3522,6 @@ export declare const rekeyContainerOperation: Omit<{
3558
3522
  expectedManifestHash: string;
3559
3523
  keyEpoch: Record<string, unknown>;
3560
3524
  keyring: Record<string, unknown> | null;
3561
- manifest: Record<string, unknown>;
3562
3525
  predecessorBridge: Record<string, unknown> | null;
3563
3526
  principalPolicyRefs: {
3564
3527
  principalType: "group" | "organization";
@@ -3573,7 +3536,6 @@ export declare const rekeyContainerOperation: Omit<{
3573
3536
  expectedManifestHash: string;
3574
3537
  keyEpoch: Record<string, unknown>;
3575
3538
  keyring: Record<string, unknown> | null;
3576
- manifest: Record<string, unknown>;
3577
3539
  predecessorBridge: Record<string, unknown> | null;
3578
3540
  principalPolicyRefs: {
3579
3541
  principalType: "group" | "organization";
@@ -3641,7 +3603,6 @@ export declare const rekeyContainerOperation: Omit<{
3641
3603
  expectedManifestHash: string;
3642
3604
  keyEpoch: Record<string, unknown>;
3643
3605
  keyring: Record<string, unknown> | null;
3644
- manifest: Record<string, unknown>;
3645
3606
  predecessorBridge: Record<string, unknown> | null;
3646
3607
  principalPolicyRefs: {
3647
3608
  principalType: "group" | "organization";
@@ -3656,7 +3617,6 @@ export declare const rekeyContainerOperation: Omit<{
3656
3617
  expectedManifestHash: string;
3657
3618
  keyEpoch: Record<string, unknown>;
3658
3619
  keyring: Record<string, unknown> | null;
3659
- manifest: Record<string, unknown>;
3660
3620
  predecessorBridge: Record<string, unknown> | null;
3661
3621
  principalPolicyRefs: {
3662
3622
  principalType: "group" | "organization";
@@ -4154,7 +4114,6 @@ export declare const moveContainerOperation: Omit<{
4154
4114
  expectedManifestHash: string;
4155
4115
  keyEpoch: Record<string, unknown>;
4156
4116
  keyring: Record<string, unknown> | null;
4157
- manifest: Record<string, unknown>;
4158
4117
  predecessorBridge: Record<string, unknown> | null;
4159
4118
  principalPolicyRefs: {
4160
4119
  principalType: "group" | "organization";
@@ -4169,7 +4128,6 @@ export declare const moveContainerOperation: Omit<{
4169
4128
  expectedManifestHash: string;
4170
4129
  keyEpoch: Record<string, unknown>;
4171
4130
  keyring: Record<string, unknown> | null;
4172
- manifest: Record<string, unknown>;
4173
4131
  predecessorBridge: Record<string, unknown> | null;
4174
4132
  principalPolicyRefs: {
4175
4133
  principalType: "group" | "organization";
@@ -4237,7 +4195,6 @@ export declare const moveContainerOperation: Omit<{
4237
4195
  expectedManifestHash: string;
4238
4196
  keyEpoch: Record<string, unknown>;
4239
4197
  keyring: Record<string, unknown> | null;
4240
- manifest: Record<string, unknown>;
4241
4198
  predecessorBridge: Record<string, unknown> | null;
4242
4199
  principalPolicyRefs: {
4243
4200
  principalType: "group" | "organization";
@@ -4252,7 +4209,6 @@ export declare const moveContainerOperation: Omit<{
4252
4209
  expectedManifestHash: string;
4253
4210
  keyEpoch: Record<string, unknown>;
4254
4211
  keyring: Record<string, unknown> | null;
4255
- manifest: Record<string, unknown>;
4256
4212
  predecessorBridge: Record<string, unknown> | null;
4257
4213
  principalPolicyRefs: {
4258
4214
  principalType: "group" | "organization";
@@ -4320,7 +4276,6 @@ export declare const moveContainerOperation: Omit<{
4320
4276
  expectedManifestHash: string;
4321
4277
  keyEpoch: Record<string, unknown>;
4322
4278
  keyring: Record<string, unknown> | null;
4323
- manifest: Record<string, unknown>;
4324
4279
  predecessorBridge: Record<string, unknown> | null;
4325
4280
  principalPolicyRefs: {
4326
4281
  principalType: "group" | "organization";
@@ -4335,7 +4290,6 @@ export declare const moveContainerOperation: Omit<{
4335
4290
  expectedManifestHash: string;
4336
4291
  keyEpoch: Record<string, unknown>;
4337
4292
  keyring: Record<string, unknown> | null;
4338
- manifest: Record<string, unknown>;
4339
4293
  predecessorBridge: Record<string, unknown> | null;
4340
4294
  principalPolicyRefs: {
4341
4295
  principalType: "group" | "organization";
@@ -4403,7 +4357,6 @@ export declare const moveContainerOperation: Omit<{
4403
4357
  expectedManifestHash: string;
4404
4358
  keyEpoch: Record<string, unknown>;
4405
4359
  keyring: Record<string, unknown> | null;
4406
- manifest: Record<string, unknown>;
4407
4360
  predecessorBridge: Record<string, unknown> | null;
4408
4361
  principalPolicyRefs: {
4409
4362
  principalType: "group" | "organization";
@@ -4418,7 +4371,6 @@ export declare const moveContainerOperation: Omit<{
4418
4371
  expectedManifestHash: string;
4419
4372
  keyEpoch: Record<string, unknown>;
4420
4373
  keyring: Record<string, unknown> | null;
4421
- manifest: Record<string, unknown>;
4422
4374
  predecessorBridge: Record<string, unknown> | null;
4423
4375
  principalPolicyRefs: {
4424
4376
  principalType: "group" | "organization";
@@ -31,7 +31,7 @@ export const createContainerOperation = defineJsonOperation({
31
31
  failureStatuses: containerMutationFailureStatuses,
32
32
  id: "containers.create",
33
33
  summary: "Create a container",
34
- description: "Creates a container from a signed `container.create` event, its derived access manifest, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.",
34
+ description: "Creates a container from a signed `container.create` event, the hash of the access manifest it derives, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.",
35
35
  method: "POST",
36
36
  params: EmptyContainerMutationPathParamsSchema,
37
37
  path: "/containers",
@@ -1 +1 @@
1
- {"version":3,"file":"containerMutations.js","sourceRoot":"","sources":["containerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,kDAAkD,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EACL,gDAAgD,EAChD,8BAA8B,EAC9B,4BAA4B,EAC5B,8BAA8B,EAC9B,4CAA4C,EAC5C,0BAA0B,EAC1B,0BAA0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O,IAAI,EAAE,iCAAiC;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;IACrE,EAAE,EAAE,iBAAiB;IACrB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,uRAAuR;IACzR,IAAI,EAAE,gCAAgC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;IAC1D,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE;QAChB,GAAG,iCAAiC;QACpC,GAAG,EAAE,oCAAoC;KAC1C;IACD,eAAe,EAAE,gCAAgC;IACjD,EAAE,EAAE,mBAAmB;IACvB,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EACT,uTAAuT;IACzT,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,iCAAiC;IACzC,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC3E,SAAS,EAAE,EAAE,GAAG,EAAE,6BAA6B,EAAE;CAClD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAC9E,MAAM,CAAC,MAAM,oCAAoC,GAAG,2BAA2B,CAAC;AAChF,MAAM,CAAC,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAC9E,MAAM,CAAC,MAAM,oCAAoC,GAAG,2BAA2B,CAAC;AAChF,MAAM,CAAC,MAAM,qDAAqD,GAChE,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,sDAAsD,GACjE,6CAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { containerCreateMetadataSeedRefinement } from \"../documentCreateSeedRefinements\";\nimport { documentSyncRequestRuntimeRefinements } from \"../documentSyncRefinements\";\nimport { organizationProvisioningContainerKeyringRefinement } from \"../organizationProvisioningRefinements\";\nimport {\n ContainerCreateWithMetadataDocumentRequestSchema,\n ContainerMutationRequestSchema,\n ContainerReciteRequestSchema,\n ContainerRotationRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n isContainerMutationRequest,\n isContainerRotationRequest,\n} from \"../request\";\nimport {\n ContainerCreateWithMetadataDocumentResponseSchema,\n ContainerDeleteResponseSchema,\n ContainerMutationFailureResponseSchema,\n ContainerMutationResponseSchema,\n ContainerNotFoundErrorResponseSchema,\n ContainerReciteResponseSchema,\n ContainerRotationResponseSchema,\n ErrorResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n isContainerDeleteResponse,\n isContainerMutationResponse,\n isContainerRotationResponse,\n PaymentRequiredErrorResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport { defineJsonOperation } from \"./definition\";\n\nconst EmptyContainerMutationPathParamsSchema = z.strictObject({});\n\nexport const ContainerMutationPathParamsSchema = z.strictObject({\n containerId: z.string(),\n});\n\nexport type ContainerMutationPathParams = z.infer<\n typeof ContainerMutationPathParamsSchema\n>;\n\nconst containerMutationFailureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 402: PaymentRequiredErrorResponseSchema,\n 403: ErrorResponseSchema,\n 404: ErrorResponseSchema,\n 409: ContainerMutationFailureResponseSchema,\n 500: ErrorResponseSchema,\n} as const;\n\nconst containerMutationFailureStatuses = [\n 400, 401, 402, 403, 404, 409, 500,\n] as const;\n\nconst containerMutationRuntimeRefinements = [\n organizationProvisioningContainerKeyringRefinement,\n] as const;\n\nexport const createContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.create\",\n summary: \"Create a container\",\n description:\n \"Creates a container from a signed `container.create` event, its derived access manifest, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers\",\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n});\n\nexport const createContainerWithMetadataDocumentOperation = defineJsonOperation(\n {\n auth: \"session\",\n body: ContainerCreateWithMetadataDocumentRequestSchema,\n failureResponses: {\n ...containerMutationFailureResponses,\n 503: ErrorResponseSchema,\n },\n failureStatuses: [...containerMutationFailureStatuses, 503],\n id: \"containers.withMetadataDocument.create\",\n summary: \"Create a container with its metadata document\",\n description:\n \"Creates a container and its encrypted metadata document in one transaction, optionally seeding the document's first update. Authorization and conflicts are those of `POST /containers` and `POST /documents`; a 409 `document_manifest_already_exists` may have rolled the new container back, so clients treat it as terminal unless they verify both artifacts.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers/with-metadata-document\",\n responses: { 200: ContainerCreateWithMetadataDocumentResponseSchema },\n runtimeRefinements: [\n ...containerMutationRuntimeRefinements,\n containerCreateMetadataSeedRefinement,\n ...documentSyncRequestRuntimeRefinements,\n ],\n },\n);\n\nfunction defineContainerMutationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\n/**\n * Rekey, revoke, and move mint a new key epoch, so they alone may carry the\n * descendant rekeys that must commit with them.\n */\nfunction defineContainerRotationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerRotationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerRotationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\nexport const shareContainerOperation = defineContainerMutationOperation({\n id: \"containers.share\",\n summary: \"Share a container\",\n description:\n \"Adds or changes a user or group grant on a container through a signed `container.grant` event, wrapping the current container KEK to the new recipients. Requires admin access through the container's path. Cited heads must be current: a stale container head returns 409 `container_mutation_state_stale`, and a stale principal policy returns 409 `principal_policy_stale` with the current heads.\",\n path: \"/containers/{containerId}/share\",\n});\n\nexport const reciteContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerReciteRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.recite\",\n summary: \"Re-cite a held container's current ancestor path\",\n description:\n \"Advances a container's access manifest so it cites its ancestors' current heads, without changing grants, keys, or parent. Clients call it after changing an ancestor so descendants they already hold stop citing superseded heads. Requires admin access; after 512 epochs the container no longer accepts re-citations.\",\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}/recite\",\n responses: { 200: ContainerReciteResponseSchema },\n});\n\nexport const revokeContainerOperation = defineContainerRotationOperation({\n id: \"containers.revoke\",\n summary: \"Revoke a container grant\",\n description:\n \"Removes a grant from a container through a signed `container.revoke` event and rotates the container KEK so the removed principal cannot read later content. The request carries the new KEK epoch, its predecessor bridge, and the re-sealed container KEK keyring. Requires admin access; stale cited heads return 409.\",\n path: \"/containers/{containerId}/revoke\",\n});\n\nexport const rekeyContainerOperation = defineContainerRotationOperation({\n id: \"containers.rekey\",\n summary: \"Rekey a container\",\n description:\n \"Rotates a container's KEK to a new epoch without changing grants, carrying the predecessor bridge and the re-sealed container KEK keyring. Requires write access. Stale cited heads return 409, and epochs above 65536 are refused.\",\n path: \"/containers/{containerId}/rekey\",\n});\n\nexport const moveContainerOperation = defineContainerRotationOperation({\n id: \"containers.move\",\n summary: \"Move a container\",\n description:\n \"Moves a container under a new parent through a signed `container.move` event and rotates its container KEK. Requires admin access at the source and write access at the destination; root and system containers cannot move. Moving into Trash is an ordinary move and can be undone.\",\n path: \"/containers/{containerId}/move\",\n});\n\nexport const deleteContainerOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses: {\n ...containerMutationFailureResponses,\n 404: ContainerNotFoundErrorResponseSchema,\n },\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.delete\",\n summary: \"Delete a container\",\n description:\n \"Deletes an empty folder: a container with no child containers and no linked user documents, along with its own metadata document. Requires admin access; root and system containers cannot be deleted. Peers learn of the deletion from a sync tombstone, and an unknown container returns 404 `container_not_found`.\",\n method: \"DELETE\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}\",\n query: z.strictObject({ requiredAncestorId: z.string().min(1).optional() }),\n responses: { 200: ContainerDeleteResponseSchema },\n});\n\nexport const isContainerMutationOperationRequest = isContainerMutationRequest;\nexport const isContainerMutationOperationResponse = isContainerMutationResponse;\nexport const isContainerRotationOperationRequest = isContainerRotationRequest;\nexport const isContainerRotationOperationResponse = isContainerRotationResponse;\nexport const isCreateContainerWithMetadataDocumentOperationRequest =\n isContainerCreateWithMetadataDocumentRequest;\nexport const isCreateContainerWithMetadataDocumentOperationResponse =\n isContainerCreateWithMetadataDocumentResponse;\nexport const isDeleteContainerOperationResponse = isContainerDeleteResponse;\n"]}
1
+ {"version":3,"file":"containerMutations.js","sourceRoot":"","sources":["containerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,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AM,CAAC,MAAM,qDAAqD,GAChE,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,sDAAsD,GACjE,6CAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { containerCreateMetadataSeedRefinement } from \"../documentCreateSeedRefinements\";\nimport { documentSyncRequestRuntimeRefinements } from \"../documentSyncRefinements\";\nimport { organizationProvisioningContainerKeyringRefinement } from \"../organizationProvisioningRefinements\";\nimport {\n ContainerCreateWithMetadataDocumentRequestSchema,\n ContainerMutationRequestSchema,\n ContainerReciteRequestSchema,\n ContainerRotationRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n isContainerMutationRequest,\n isContainerRotationRequest,\n} from \"../request\";\nimport {\n ContainerCreateWithMetadataDocumentResponseSchema,\n ContainerDeleteResponseSchema,\n ContainerMutationFailureResponseSchema,\n ContainerMutationResponseSchema,\n ContainerNotFoundErrorResponseSchema,\n ContainerReciteResponseSchema,\n ContainerRotationResponseSchema,\n ErrorResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n isContainerDeleteResponse,\n isContainerMutationResponse,\n isContainerRotationResponse,\n PaymentRequiredErrorResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport { defineJsonOperation } from \"./definition\";\n\nconst EmptyContainerMutationPathParamsSchema = z.strictObject({});\n\nexport const ContainerMutationPathParamsSchema = z.strictObject({\n containerId: z.string(),\n});\n\nexport type ContainerMutationPathParams = z.infer<\n typeof ContainerMutationPathParamsSchema\n>;\n\nconst containerMutationFailureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 402: PaymentRequiredErrorResponseSchema,\n 403: ErrorResponseSchema,\n 404: ErrorResponseSchema,\n 409: ContainerMutationFailureResponseSchema,\n 500: ErrorResponseSchema,\n} as const;\n\nconst containerMutationFailureStatuses = [\n 400, 401, 402, 403, 404, 409, 500,\n] as const;\n\nconst containerMutationRuntimeRefinements = [\n organizationProvisioningContainerKeyringRefinement,\n] as const;\n\nexport const createContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.create\",\n summary: \"Create a container\",\n description:\n \"Creates a container from a signed `container.create` event, the hash of the access manifest it derives, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers\",\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n});\n\nexport const createContainerWithMetadataDocumentOperation = defineJsonOperation(\n {\n auth: \"session\",\n body: ContainerCreateWithMetadataDocumentRequestSchema,\n failureResponses: {\n ...containerMutationFailureResponses,\n 503: ErrorResponseSchema,\n },\n failureStatuses: [...containerMutationFailureStatuses, 503],\n id: \"containers.withMetadataDocument.create\",\n summary: \"Create a container with its metadata document\",\n description:\n \"Creates a container and its encrypted metadata document in one transaction, optionally seeding the document's first update. Authorization and conflicts are those of `POST /containers` and `POST /documents`; a 409 `document_manifest_already_exists` may have rolled the new container back, so clients treat it as terminal unless they verify both artifacts.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers/with-metadata-document\",\n responses: { 200: ContainerCreateWithMetadataDocumentResponseSchema },\n runtimeRefinements: [\n ...containerMutationRuntimeRefinements,\n containerCreateMetadataSeedRefinement,\n ...documentSyncRequestRuntimeRefinements,\n ],\n },\n);\n\nfunction defineContainerMutationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\n/**\n * Rekey, revoke, and move mint a new key epoch, so they alone may carry the\n * descendant rekeys that must commit with them.\n */\nfunction defineContainerRotationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerRotationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerRotationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\nexport const shareContainerOperation = defineContainerMutationOperation({\n id: \"containers.share\",\n summary: \"Share a container\",\n description:\n \"Adds or changes a user or group grant on a container through a signed `container.grant` event, wrapping the current container KEK to the new recipients. Requires admin access through the container's path. Cited heads must be current: a stale container head returns 409 `container_mutation_state_stale`, and a stale principal policy returns 409 `principal_policy_stale` with the current heads.\",\n path: \"/containers/{containerId}/share\",\n});\n\nexport const reciteContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerReciteRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.recite\",\n summary: \"Re-cite a held container's current ancestor path\",\n description:\n \"Advances a container's access manifest so it cites its ancestors' current heads, without changing grants, keys, or parent. Clients call it after changing an ancestor so descendants they already hold stop citing superseded heads. Requires admin access; after 512 epochs the container no longer accepts re-citations.\",\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}/recite\",\n responses: { 200: ContainerReciteResponseSchema },\n});\n\nexport const revokeContainerOperation = defineContainerRotationOperation({\n id: \"containers.revoke\",\n summary: \"Revoke a container grant\",\n description:\n \"Removes a grant from a container through a signed `container.revoke` event and rotates the container KEK so the removed principal cannot read later content. The request carries the new KEK epoch, its predecessor bridge, and the re-sealed container KEK keyring. Requires admin access; stale cited heads return 409.\",\n path: \"/containers/{containerId}/revoke\",\n});\n\nexport const rekeyContainerOperation = defineContainerRotationOperation({\n id: \"containers.rekey\",\n summary: \"Rekey a container\",\n description:\n \"Rotates a container's KEK to a new epoch without changing grants, carrying the predecessor bridge and the re-sealed container KEK keyring. Requires write access. Stale cited heads return 409, and epochs above 65536 are refused.\",\n path: \"/containers/{containerId}/rekey\",\n});\n\nexport const moveContainerOperation = defineContainerRotationOperation({\n id: \"containers.move\",\n summary: \"Move a container\",\n description:\n \"Moves a container under a new parent through a signed `container.move` event and rotates its container KEK. Requires admin access at the source and write access at the destination; root and system containers cannot move. Moving into Trash is an ordinary move and can be undone.\",\n path: \"/containers/{containerId}/move\",\n});\n\nexport const deleteContainerOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses: {\n ...containerMutationFailureResponses,\n 404: ContainerNotFoundErrorResponseSchema,\n },\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.delete\",\n summary: \"Delete a container\",\n description:\n \"Deletes an empty folder: a container with no child containers and no linked user documents, along with its own metadata document. Requires admin access; root and system containers cannot be deleted. Peers learn of the deletion from a sync tombstone, and an unknown container returns 404 `container_not_found`.\",\n method: \"DELETE\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}\",\n query: z.strictObject({ requiredAncestorId: z.string().min(1).optional() }),\n responses: { 200: ContainerDeleteResponseSchema },\n});\n\nexport const isContainerMutationOperationRequest = isContainerMutationRequest;\nexport const isContainerMutationOperationResponse = isContainerMutationResponse;\nexport const isContainerRotationOperationRequest = isContainerRotationRequest;\nexport const isContainerRotationOperationResponse = isContainerRotationResponse;\nexport const isCreateContainerWithMetadataDocumentOperationRequest =\n isContainerCreateWithMetadataDocumentRequest;\nexport const isCreateContainerWithMetadataDocumentOperationResponse =\n isContainerCreateWithMetadataDocumentResponse;\nexport const isDeleteContainerOperationResponse = isContainerDeleteResponse;\n"]}
@@ -525,6 +525,7 @@ export declare const listContainerParentLanesOperation: Omit<{
525
525
  stateHash: string;
526
526
  version: number;
527
527
  }[];
528
+ metadataVersionVector: string;
528
529
  organizationId: string;
529
530
  parentId: string | null;
530
531
  updatedAt: string;
@@ -562,6 +563,7 @@ export declare const listContainerParentLanesOperation: Omit<{
562
563
  stateHash: string;
563
564
  version: number;
564
565
  }[];
566
+ metadataVersionVector: string;
565
567
  organizationId: string;
566
568
  parentId: string | null;
567
569
  updatedAt: string;