@tearleads/client-sdk 0.1.41 → 0.1.43

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 (235) hide show
  1. package/client/Tearleads.js +3 -0
  2. package/client/Tearleads.js.map +1 -1
  3. package/data/blobs/transferPool.js +35 -8
  4. package/data/blobs/transferPool.js.map +1 -1
  5. package/data/containers/shared/projection.js +12 -0
  6. package/data/containers/shared/projection.js.map +1 -1
  7. package/data/documents/blob/shared/types.d.ts +2 -3
  8. package/data/documents/blob/shared/types.js.map +1 -1
  9. package/data/documents/shared/events.js +0 -1
  10. package/data/documents/shared/events.js.map +1 -1
  11. package/data/keyingProjectionVerification/accessManifestCheckpointEnforcement.js +2 -0
  12. package/data/keyingProjectionVerification/accessManifestCheckpointEnforcement.js.map +1 -1
  13. package/data/keyingProjectionVerification/checkpointContext.d.ts +12 -0
  14. package/data/keyingProjectionVerification/checkpointContext.js +16 -0
  15. package/data/keyingProjectionVerification/checkpointContext.js.map +1 -1
  16. package/data/keyingProjectionVerification/containerDestinationVerification.js +3 -1
  17. package/data/keyingProjectionVerification/containerDestinationVerification.js.map +1 -1
  18. package/data/keyingProjectionVerification/containerProjectionVerification.js +12 -6
  19. package/data/keyingProjectionVerification/containerProjectionVerification.js.map +1 -1
  20. package/data/keyingProjectionVerification/documentProjectionVerification.js +10 -4
  21. package/data/keyingProjectionVerification/documentProjectionVerification.js.map +1 -1
  22. package/data/persistence/container-contents/containerContentsPersistence.js +6 -22
  23. package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
  24. package/data/persistence/container-contents/containerMetadataMutationPersistence.js +5 -15
  25. package/data/persistence/container-contents/containerMetadataMutationPersistence.js.map +1 -1
  26. package/data/persistence/container-contents/containerPendingUpdatePersistence.js +6 -15
  27. package/data/persistence/container-contents/containerPendingUpdatePersistence.js.map +1 -1
  28. package/data/persistence/container-contents/containerRecoveryPersistence.js +3 -4
  29. package/data/persistence/container-contents/containerRecoveryPersistence.js.map +1 -1
  30. package/data/persistence/container-contents/containerRemovalWork.js +3 -5
  31. package/data/persistence/container-contents/containerRemovalWork.js.map +1 -1
  32. package/data/persistence/container-contents/dormantContainerMetadata.js +1 -5
  33. package/data/persistence/container-contents/dormantContainerMetadata.js.map +1 -1
  34. package/data/persistence/documents/documentsPersistence.js +4 -9
  35. package/data/persistence/documents/documentsPersistence.js.map +1 -1
  36. package/data/persistence/documents/internal/discardDocument.js +1 -2
  37. package/data/persistence/documents/internal/discardDocument.js.map +1 -1
  38. package/data/persistence/documents/internal/documentDeletionPersistence.js +1 -2
  39. package/data/persistence/documents/internal/documentDeletionPersistence.js.map +1 -1
  40. package/data/persistence/documents/internal/documentMutationPersistence.js +17 -25
  41. package/data/persistence/documents/internal/documentMutationPersistence.js.map +1 -1
  42. package/data/persistence/documents/internal/orphanSideRows.js +2 -14
  43. package/data/persistence/documents/internal/orphanSideRows.js.map +1 -1
  44. package/data/persistence/documents/internal/syncQueuePersistence.js +3 -3
  45. package/data/persistence/documents/internal/syncQueuePersistence.js.map +1 -1
  46. package/data/persistence/keyingCheckpointAdvancePersistence.js +27 -8
  47. package/data/persistence/keyingCheckpointAdvancePersistence.js.map +1 -1
  48. package/data/persistence/verifiedManifestBundlePersistence.d.ts +45 -0
  49. package/data/persistence/verifiedManifestBundlePersistence.js +282 -0
  50. package/data/persistence/verifiedManifestBundlePersistence.js.map +1 -0
  51. package/data/sqlite/documentHistoryPersistence.d.ts +9 -3
  52. package/data/sqlite/documentHistoryPersistence.js +31 -8
  53. package/data/sqlite/documentHistoryPersistence.js.map +1 -1
  54. package/data/sqlite/documentPendingUpdatePersistence.d.ts +58 -11
  55. package/data/sqlite/documentPendingUpdatePersistence.js +137 -63
  56. package/data/sqlite/documentPendingUpdatePersistence.js.map +1 -1
  57. package/data/sqlite/documentPersistence.d.ts +1 -1
  58. package/data/sqlite/documentPersistence.js +1 -1
  59. package/data/sqlite/documentPersistence.js.map +1 -1
  60. package/data/sqlite/documentPersistenceTypes.d.ts +2 -2
  61. package/data/sqlite/documentPersistenceTypes.js.map +1 -1
  62. package/data/sqlite/documentRecordPersistence.js +5 -4
  63. package/data/sqlite/documentRecordPersistence.js.map +1 -1
  64. package/data/sqlite/schema.d.ts +350 -443
  65. package/data/sqlite/schema.js +49 -47
  66. package/data/sqlite/schema.js.map +1 -1
  67. package/data/sqlite/verifiedManifestBundleSchema.d.ts +174 -0
  68. package/data/sqlite/verifiedManifestBundleSchema.js +36 -0
  69. package/data/sqlite/verifiedManifestBundleSchema.js.map +1 -0
  70. package/internal/api-client/ApiClient.d.ts +17 -19
  71. package/internal/api-client/ApiClient.js +10 -11
  72. package/internal/api-client/ApiClient.js.map +1 -1
  73. package/internal/api-client/binaryRequestOperationTransport.d.ts +18 -0
  74. package/internal/api-client/index.d.ts +2 -1
  75. package/internal/api-client/index.js +1 -1
  76. package/internal/api-client/index.js.map +1 -1
  77. package/internal/api-client/operationTransportFactory.d.ts +6 -0
  78. package/internal/api-client/principalHistoryRequest.js +8 -2
  79. package/internal/api-client/principalHistoryRequest.js.map +1 -1
  80. package/internal/api-client/principalHistoryRequestContext.js +15 -5
  81. package/internal/api-client/principalHistoryRequestContext.js.map +1 -1
  82. package/internal/api-client/routes/blobs/get.d.ts +7 -0
  83. package/internal/api-client/routes/blobs/get.js.map +1 -1
  84. package/internal/api-client/routes/blobs/multipart.js +1 -11
  85. package/internal/api-client/routes/blobs/multipart.js.map +1 -1
  86. package/internal/api-client/routes/blobs/multipartUpload.d.ts +14 -0
  87. package/internal/api-client/routes/blobs/multipartUpload.js +94 -43
  88. package/internal/api-client/routes/blobs/multipartUpload.js.map +1 -1
  89. package/internal/api-client/routes/writerProjections.js +6 -3
  90. package/internal/api-client/routes/writerProjections.js.map +1 -1
  91. package/internal/api-client/verifiedManifestCitations.d.ts +23 -0
  92. package/internal/api-client/verifiedManifestCitations.js +60 -0
  93. package/internal/api-client/verifiedManifestCitations.js.map +1 -0
  94. package/internal/api-client/writerProjectionRequests.js +75 -14
  95. package/internal/api-client/writerProjectionRequests.js.map +1 -1
  96. package/internal/crypto/index.d.ts +0 -1
  97. package/internal/crypto/index.js +0 -1
  98. package/internal/crypto/index.js.map +1 -1
  99. package/internal/validators/knownManifestsRefinements.js +5 -0
  100. package/internal/validators/knownManifestsRefinements.js.map +1 -0
  101. package/internal/validators/operation/attachments.d.ts +80 -160
  102. package/internal/validators/operation/auth.d.ts +760 -1664
  103. package/internal/validators/operation/blobDownloads.js +1 -1
  104. package/internal/validators/operation/blobDownloads.js.map +1 -1
  105. package/internal/validators/operation/containerMutations.d.ts +416 -856
  106. package/internal/validators/operation/documentMutations.d.ts +120 -264
  107. package/internal/validators/operation/documentSync.d.ts +40 -80
  108. package/internal/validators/operation/index.d.ts +1 -1
  109. package/internal/validators/operation/index.js +1 -1
  110. package/internal/validators/operation/index.js.map +1 -1
  111. package/internal/validators/operation/multipartBlobs.d.ts +70 -190
  112. package/internal/validators/operation/multipartBlobs.js +2 -24
  113. package/internal/validators/operation/multipartBlobs.js.map +1 -1
  114. package/internal/validators/operation/multipartPartUploads.d.ts +5 -5
  115. package/internal/validators/operation/multipartPartUploads.js +6 -20
  116. package/internal/validators/operation/multipartPartUploads.js.map +1 -1
  117. package/internal/validators/operation/organizations.d.ts +882 -1906
  118. package/internal/validators/operation/principals.d.ts +120 -240
  119. package/internal/validators/operation/registry.d.ts +1 -2
  120. package/internal/validators/operation/registry.js +1 -2
  121. package/internal/validators/operation/registry.js.map +1 -1
  122. package/internal/validators/operation/writerProjections.d.ts +85 -319
  123. package/internal/validators/operation/writerProjections.js +11 -11
  124. package/internal/validators/operation/writerProjections.js.map +1 -1
  125. package/internal/validators/request/blob.d.ts +100 -201
  126. package/internal/validators/request/blob.js +6 -13
  127. package/internal/validators/request/blob.js.map +1 -1
  128. package/internal/validators/request/container.d.ts +136 -272
  129. package/internal/validators/request/container.js +16 -10
  130. package/internal/validators/request/container.js.map +1 -1
  131. package/internal/validators/request/containerManifestRef.d.ts +54 -0
  132. package/internal/validators/request/containerManifestRef.js +28 -0
  133. package/internal/validators/request/containerManifestRef.js.map +1 -0
  134. package/internal/validators/request/containerMetadata.d.ts +160 -368
  135. package/internal/validators/request/document.d.ts +100 -245
  136. package/internal/validators/request/document.js +1 -2
  137. package/internal/validators/request/document.js.map +1 -1
  138. package/internal/validators/request/documentSyncSchema.d.ts +42 -109
  139. package/internal/validators/request/documentSyncSchema.js +8 -25
  140. package/internal/validators/request/documentSyncSchema.js.map +1 -1
  141. package/internal/validators/request/index.d.ts +1 -1
  142. package/internal/validators/request/index.js +1 -1
  143. package/internal/validators/request/index.js.map +1 -1
  144. package/internal/validators/request/organization.d.ts +160 -320
  145. package/internal/validators/request/organizationProvisioning.d.ts +2424 -5312
  146. package/internal/validators/request/principal.d.ts +160 -320
  147. package/internal/validators/request/registration.d.ts +760 -1664
  148. package/internal/validators/response/blob.d.ts +48 -27
  149. package/internal/validators/response/blob.js +3 -10
  150. package/internal/validators/response/blob.js.map +1 -1
  151. package/internal/validators/response/container.d.ts +429 -20
  152. package/internal/validators/response/container.js +40 -5
  153. package/internal/validators/response/container.js.map +1 -1
  154. package/internal/validators/response/documentMutation.d.ts +440 -20
  155. package/internal/validators/response/documentMutation.js +33 -3
  156. package/internal/validators/response/documentMutation.js.map +1 -1
  157. package/internal/validators/response/index.d.ts +4 -3
  158. package/internal/validators/response/index.js +4 -3
  159. package/internal/validators/response/index.js.map +1 -1
  160. package/internal/validators/response/manifestBundleReferences.js +79 -0
  161. package/internal/validators/response/manifestBundleReferences.js.map +1 -0
  162. package/internal/validators/response/writerProjectionWire.d.ts +19 -0
  163. package/internal/validators/response/writerProjectionWire.js +132 -0
  164. package/internal/validators/response/writerProjectionWire.js.map +1 -0
  165. package/internal/validators/schema.js +20 -0
  166. package/internal/validators/schema.js.map +1 -1
  167. package/internal/validators/util/blob.d.ts +7 -0
  168. package/internal/validators/util/blob.js +7 -0
  169. package/internal/validators/util/blob.js.map +1 -1
  170. package/internal/validators/util/blobTransferSchemas.d.ts +41 -0
  171. package/internal/validators/util/blobTransferSchemas.js +39 -0
  172. package/internal/validators/util/blobTransferSchemas.js.map +1 -0
  173. package/internal/validators/util/containerLimits.d.ts +7 -0
  174. package/internal/validators/util/containerLimits.js +7 -0
  175. package/internal/validators/util/containerLimits.js.map +1 -1
  176. package/internal/validators/util/index.d.ts +3 -2
  177. package/internal/validators/util/index.js +3 -2
  178. package/internal/validators/util/index.js.map +1 -1
  179. package/internal/validators/util/knownManifestWire.d.ts +11 -0
  180. package/internal/validators/util/knownManifestWire.js +28 -0
  181. package/internal/validators/util/knownManifestWire.js.map +1 -0
  182. package/internal/validators/writerProjectionRefinements.js +5 -0
  183. package/internal/validators/writerProjectionRefinements.js.map +1 -1
  184. package/package.json +1 -1
  185. package/workflows/blobs/multipartFirstParts.js +82 -0
  186. package/workflows/blobs/multipartFirstParts.js.map +1 -0
  187. package/workflows/blobs/multipartStageResolution.js +83 -0
  188. package/workflows/blobs/multipartStageResolution.js.map +1 -0
  189. package/workflows/blobs/multipartUpload.js +45 -89
  190. package/workflows/blobs/multipartUpload.js.map +1 -1
  191. package/workflows/container-contents/documentPriming.js +2 -1
  192. package/workflows/container-contents/documentPriming.js.map +1 -1
  193. package/workflows/container-contents/documentQueries/sql.js +4 -4
  194. package/workflows/container-contents/documentQueries/sql.js.map +1 -1
  195. package/workflows/container-contents/pendingWrites/deferredTails.js +6 -3
  196. package/workflows/container-contents/pendingWrites/deferredTails.js.map +1 -1
  197. package/workflows/container-contents/pendingWrites/sources.js +2 -1
  198. package/workflows/container-contents/pendingWrites/sources.js.map +1 -1
  199. package/workflows/container-contents/pendingWrites.js +2 -1
  200. package/workflows/container-contents/pendingWrites.js.map +1 -1
  201. package/workflows/containers/child/create.js +3 -3
  202. package/workflows/containers/child/create.js.map +1 -1
  203. package/workflows/containers/child/move.js +2 -2
  204. package/workflows/containers/child/move.js.map +1 -1
  205. package/workflows/containers/child/mutationRequestCore.js +5 -4
  206. package/workflows/containers/child/mutationRequestCore.js.map +1 -1
  207. package/workflows/containers/child/recitePlan.js +3 -2
  208. package/workflows/containers/child/recitePlan.js.map +1 -1
  209. package/workflows/containers/child/sharePlanCore.js +2 -2
  210. package/workflows/containers/child/sharePlanCore.js.map +1 -1
  211. package/workflows/containers/root/create.js +2 -2
  212. package/workflows/containers/root/create.js.map +1 -1
  213. package/workflows/registration/provisioningBootstrapBuilders.d.ts +20 -51
  214. package/workflows/sync/remoteReset.js +11 -9
  215. package/workflows/sync/remoteReset.js.map +1 -1
  216. package/workflows/sync/remoteResetPlans.js +6 -3
  217. package/workflows/sync/remoteResetPlans.js.map +1 -1
  218. package/internal/api-client/projectionHistoryTransport.js +0 -107
  219. package/internal/api-client/projectionHistoryTransport.js.map +0 -1
  220. package/internal/api-client/verifiedProjectionHistory.d.ts +0 -4
  221. package/internal/api-client/verifiedProjectionHistory.js +0 -12
  222. package/internal/api-client/verifiedProjectionHistory.js.map +0 -1
  223. package/internal/crypto/projectionHistory.d.ts +0 -14
  224. package/internal/crypto/projectionHistory.js +0 -90
  225. package/internal/crypto/projectionHistory.js.map +0 -1
  226. package/internal/crypto/projectionHistorySlots.d.ts +0 -13
  227. package/internal/crypto/projectionHistorySlots.js +0 -81
  228. package/internal/crypto/projectionHistorySlots.js.map +0 -1
  229. package/internal/validators/operation/blobTransferSchemas.js +0 -11
  230. package/internal/validators/operation/blobTransferSchemas.js.map +0 -1
  231. package/internal/validators/projectionHistoryRefinements.js +0 -5
  232. package/internal/validators/projectionHistoryRefinements.js.map +0 -1
  233. package/internal/validators/util/projectionHistoryWire.d.ts +0 -23
  234. package/internal/validators/util/projectionHistoryWire.js +0 -33
  235. package/internal/validators/util/projectionHistoryWire.js.map +0 -1
@@ -1,33 +1,6 @@
1
1
  import { z } from "zod";
2
- /**
3
- * A reference to a container access manifest the server already stores, in lieu
4
- * of re-embedding the full signed manifest bundle. The server resolves the full
5
- * manifest from its own store by `manifestHash` and pins it to the container's
6
- * current head, so the reference carries the same authority as the full bundle
7
- * without the multi-KB signature. `containerId` is advisory: the server keys the
8
- * head lookup off the resolved bundle's own containerId and rejects a mismatch.
9
- */
10
- export declare const ContainerManifestRefSchema: z.ZodType<{
11
- containerId: string;
12
- manifestHash: string;
13
- }, {
14
- containerId: string;
15
- manifestHash: string;
16
- }, z.core.$ZodTypeInternals<{
17
- containerId: string;
18
- manifestHash: string;
19
- }, {
20
- containerId: string;
21
- manifestHash: string;
22
- }>>;
23
- export type ContainerManifestRef = z.infer<typeof ContainerManifestRefSchema>;
24
- export declare const ContainerManifestPathSchema: z.ZodCustom<{
25
- containerId: string;
26
- manifestHash: string;
27
- }[], {
28
- containerId: string;
29
- manifestHash: string;
30
- }[]>;
2
+ import { ContainerManifestPathSchema, type ContainerManifestRef, ContainerManifestRefSchema } from "./containerManifestRef.js";
3
+ export { ContainerManifestPathSchema, type ContainerManifestRef, ContainerManifestRefSchema, };
31
4
  export declare const ContainerManifestRefArrayArraySchema: z.ZodCustom<{
32
5
  containerId: string;
33
6
  manifestHash: string;
@@ -188,36 +161,26 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
188
161
  predecessorBridge: Record<string, unknown> | null;
189
162
  principalPolicies: Record<string, unknown>[];
190
163
  wraps: Record<string, unknown>[];
191
- containerManifestHistory?: {
192
- event: Record<string, unknown>;
193
- manifest: Record<string, unknown>;
164
+ containerManifestHistoryRefs?: {
165
+ containerId: string;
194
166
  manifestHash: string;
195
- state: Record<string, unknown>;
196
167
  }[] | undefined;
197
- destinationParentContainerPath?: {
198
- event: Record<string, unknown>;
199
- manifest: Record<string, unknown>;
168
+ destinationParentContainerPathRefs?: {
169
+ containerId: string;
200
170
  manifestHash: string;
201
- state: Record<string, unknown>;
202
171
  }[] | undefined;
203
- parentContainerPath?: {
204
- event: Record<string, unknown>;
205
- manifest: Record<string, unknown>;
172
+ parentContainerPathRefs?: {
173
+ containerId: string;
206
174
  manifestHash: string;
207
- state: Record<string, unknown>;
208
175
  }[] | undefined;
209
176
  parentKekState?: Record<string, unknown> | null | undefined;
210
- previousContainerPath?: {
211
- event: Record<string, unknown>;
212
- manifest: Record<string, unknown>;
177
+ previousContainerPathRefs?: {
178
+ containerId: string;
213
179
  manifestHash: string;
214
- state: Record<string, unknown>;
215
180
  }[] | undefined;
216
- previousManifest?: {
217
- event: Record<string, unknown>;
218
- manifest: Record<string, unknown>;
181
+ previousManifestRef?: {
182
+ containerId: string;
219
183
  manifestHash: string;
220
- state: Record<string, unknown>;
221
184
  } | null | undefined;
222
185
  userRecipientKeys?: Record<string, unknown>[] | undefined;
223
186
  }[] | undefined;
@@ -269,36 +232,26 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
269
232
  predecessorBridge: Record<string, unknown> | null;
270
233
  principalPolicies: Record<string, unknown>[];
271
234
  wraps: Record<string, unknown>[];
272
- containerManifestHistory?: {
273
- event: Record<string, unknown>;
274
- manifest: Record<string, unknown>;
235
+ containerManifestHistoryRefs?: {
236
+ containerId: string;
275
237
  manifestHash: string;
276
- state: Record<string, unknown>;
277
238
  }[] | undefined;
278
- destinationParentContainerPath?: {
279
- event: Record<string, unknown>;
280
- manifest: Record<string, unknown>;
239
+ destinationParentContainerPathRefs?: {
240
+ containerId: string;
281
241
  manifestHash: string;
282
- state: Record<string, unknown>;
283
242
  }[] | undefined;
284
- parentContainerPath?: {
285
- event: Record<string, unknown>;
286
- manifest: Record<string, unknown>;
243
+ parentContainerPathRefs?: {
244
+ containerId: string;
287
245
  manifestHash: string;
288
- state: Record<string, unknown>;
289
246
  }[] | undefined;
290
247
  parentKekState?: Record<string, unknown> | null | undefined;
291
- previousContainerPath?: {
292
- event: Record<string, unknown>;
293
- manifest: Record<string, unknown>;
248
+ previousContainerPathRefs?: {
249
+ containerId: string;
294
250
  manifestHash: string;
295
- state: Record<string, unknown>;
296
251
  }[] | undefined;
297
- previousManifest?: {
298
- event: Record<string, unknown>;
299
- manifest: Record<string, unknown>;
252
+ previousManifestRef?: {
253
+ containerId: string;
300
254
  manifestHash: string;
301
- state: Record<string, unknown>;
302
255
  } | null | undefined;
303
256
  userRecipientKeys?: Record<string, unknown>[] | undefined;
304
257
  }[] | undefined;
@@ -350,36 +303,26 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
350
303
  predecessorBridge: Record<string, unknown> | null;
351
304
  principalPolicies: Record<string, unknown>[];
352
305
  wraps: Record<string, unknown>[];
353
- containerManifestHistory?: {
354
- event: Record<string, unknown>;
355
- manifest: Record<string, unknown>;
306
+ containerManifestHistoryRefs?: {
307
+ containerId: string;
356
308
  manifestHash: string;
357
- state: Record<string, unknown>;
358
309
  }[] | undefined;
359
- destinationParentContainerPath?: {
360
- event: Record<string, unknown>;
361
- manifest: Record<string, unknown>;
310
+ destinationParentContainerPathRefs?: {
311
+ containerId: string;
362
312
  manifestHash: string;
363
- state: Record<string, unknown>;
364
313
  }[] | undefined;
365
- parentContainerPath?: {
366
- event: Record<string, unknown>;
367
- manifest: Record<string, unknown>;
314
+ parentContainerPathRefs?: {
315
+ containerId: string;
368
316
  manifestHash: string;
369
- state: Record<string, unknown>;
370
317
  }[] | undefined;
371
318
  parentKekState?: Record<string, unknown> | null | undefined;
372
- previousContainerPath?: {
373
- event: Record<string, unknown>;
374
- manifest: Record<string, unknown>;
319
+ previousContainerPathRefs?: {
320
+ containerId: string;
375
321
  manifestHash: string;
376
- state: Record<string, unknown>;
377
322
  }[] | undefined;
378
- previousManifest?: {
379
- event: Record<string, unknown>;
380
- manifest: Record<string, unknown>;
323
+ previousManifestRef?: {
324
+ containerId: string;
381
325
  manifestHash: string;
382
- state: Record<string, unknown>;
383
326
  } | null | undefined;
384
327
  userRecipientKeys?: Record<string, unknown>[] | undefined;
385
328
  }[] | undefined;
@@ -431,36 +374,26 @@ export declare const DocumentSyncRequestSchema: z.ZodType<{
431
374
  predecessorBridge: Record<string, unknown> | null;
432
375
  principalPolicies: Record<string, unknown>[];
433
376
  wraps: Record<string, unknown>[];
434
- containerManifestHistory?: {
435
- event: Record<string, unknown>;
436
- manifest: Record<string, unknown>;
377
+ containerManifestHistoryRefs?: {
378
+ containerId: string;
437
379
  manifestHash: string;
438
- state: Record<string, unknown>;
439
380
  }[] | undefined;
440
- destinationParentContainerPath?: {
441
- event: Record<string, unknown>;
442
- manifest: Record<string, unknown>;
381
+ destinationParentContainerPathRefs?: {
382
+ containerId: string;
443
383
  manifestHash: string;
444
- state: Record<string, unknown>;
445
384
  }[] | undefined;
446
- parentContainerPath?: {
447
- event: Record<string, unknown>;
448
- manifest: Record<string, unknown>;
385
+ parentContainerPathRefs?: {
386
+ containerId: string;
449
387
  manifestHash: string;
450
- state: Record<string, unknown>;
451
388
  }[] | undefined;
452
389
  parentKekState?: Record<string, unknown> | null | undefined;
453
- previousContainerPath?: {
454
- event: Record<string, unknown>;
455
- manifest: Record<string, unknown>;
390
+ previousContainerPathRefs?: {
391
+ containerId: string;
456
392
  manifestHash: string;
457
- state: Record<string, unknown>;
458
393
  }[] | undefined;
459
- previousManifest?: {
460
- event: Record<string, unknown>;
461
- manifest: Record<string, unknown>;
394
+ previousManifestRef?: {
395
+ containerId: string;
462
396
  manifestHash: string;
463
- state: Record<string, unknown>;
464
397
  } | null | undefined;
465
398
  userRecipientKeys?: Record<string, unknown>[] | undefined;
466
399
  }[] | undefined;
@@ -4,28 +4,15 @@ import { documentSyncRequestEnvelopeRefinements, documentSyncRequestPullRefineme
4
4
  import { classifyDocumentSyncRequestMode } from "../documentSyncRequestMode.js";
5
5
  import { isPlainObject } from "../isPlainObject.js";
6
6
  import { registerJsonSchemaFragment, registerJsonSchemaRuntimeRefinements, registerJsonSchemaView, } from "../jsonSchema.js";
7
- import { arraySchema, boundedNonEmptyArraySchema, boundedNonEmptyStringSchema, boundedStringSchema, loosePlainObject, nonEmptyStringSchema, plainObjectSchema, positiveIntegerSchema, requiredUnknownSchema, sha256HexStringSchema, } from "../schema.js";
8
- import { AccessManifestBundleWireSchema } from "../util/accessManifestBundle.js";
7
+ import { arraySchema, boundedNonEmptyStringSchema, boundedStringSchema, loosePlainObject, nonEmptyStringSchema, plainObjectSchema, positiveIntegerSchema, requiredUnknownSchema, sha256HexStringSchema, } from "../schema.js";
9
8
  import { MAX_INLINE_CONTAINER_REKEYS } from "../util/containerKekKeyringWire.js";
10
- import { MAX_CONTAINER_PATH_LENGTH } from "../util/containerLimits.js";
11
9
  import { MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS, MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS, MAX_DOCUMENT_SYNC_OUTGOING_UPDATES, MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH, MAX_DOCUMENT_SYNC_REQUEST_BYTES, } from "../util/documentSyncLimits.js";
12
10
  import { isUuidV4String, UUID_V4_PATTERN } from "../util/uuid.js";
13
11
  import { isWalLsnString, WAL_LSN_PATTERN } from "../util/walLsn.js";
14
12
  import { ContainerMutationRequestSchema, } from "./container.js";
13
+ import { ContainerManifestPathSchema, ContainerManifestRefListSchema, ContainerManifestRefSchema, OptionalContainerManifestPathSchema, } from "./containerManifestRef.js";
15
14
  import { ContentKeyWrappedKeySchema, contentKeyWrappingMetadataSchema, } from "./contentKeyEnvelopeSchema.js";
16
- /**
17
- * A reference to a container access manifest the server already stores, in lieu
18
- * of re-embedding the full signed manifest bundle. The server resolves the full
19
- * manifest from its own store by `manifestHash` and pins it to the container's
20
- * current head, so the reference carries the same authority as the full bundle
21
- * without the multi-KB signature. `containerId` is advisory: the server keys the
22
- * head lookup off the resolved bundle's own containerId and rejects a mismatch.
23
- */
24
- export const ContainerManifestRefSchema = loosePlainObject({
25
- containerId: nonEmptyStringSchema,
26
- manifestHash: nonEmptyStringSchema,
27
- });
28
- export const ContainerManifestPathSchema = boundedNonEmptyArraySchema(ContainerManifestRefSchema, MAX_CONTAINER_PATH_LENGTH);
15
+ export { ContainerManifestPathSchema, ContainerManifestRefSchema, };
29
16
  export const ContainerManifestRefArrayArraySchema = arraySchema(ContainerManifestPathSchema, MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS);
30
17
  export const DocumentContentKeyTargetEnvelopeSchema = loosePlainObject({
31
18
  containerId: nonEmptyStringSchema,
@@ -80,22 +67,18 @@ const DocumentSyncOutgoingUpdateSchema = createDocumentOutgoingUpdateSchema(boun
80
67
  // schema used by newer operations.
81
68
  const DocumentSyncContainerMutationRequestSchema = registerJsonSchemaView(z.custom((value) => ContainerMutationRequestSchema.safeParse(value).success), z.looseObject({
82
69
  body: requiredUnknownSchema,
83
- containerManifestHistory: z
84
- .array(AccessManifestBundleWireSchema)
85
- .optional(),
86
- destinationParentContainerPath: z
87
- .array(AccessManifestBundleWireSchema)
88
- .optional(),
70
+ containerManifestHistoryRefs: ContainerManifestRefListSchema.optional(),
71
+ destinationParentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
89
72
  event: plainObjectSchema,
90
73
  expectedManifestHash: nonEmptyStringSchema,
91
74
  keyEpoch: plainObjectSchema,
92
75
  keyring: plainObjectSchema.nullable(),
93
76
  manifest: plainObjectSchema,
94
- parentContainerPath: z.array(AccessManifestBundleWireSchema).optional(),
77
+ parentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
95
78
  parentKekState: plainObjectSchema.nullable().optional(),
96
79
  predecessorBridge: plainObjectSchema.nullable(),
97
- previousContainerPath: z.array(AccessManifestBundleWireSchema).optional(),
98
- previousManifest: AccessManifestBundleWireSchema.nullable().optional(),
80
+ previousContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
81
+ previousManifestRef: ContainerManifestRefSchema.nullable().optional(),
99
82
  principalPolicies: z.array(plainObjectSchema),
100
83
  userRecipientKeys: z.array(plainObjectSchema).optional(),
101
84
  wraps: z.array(plainObjectSchema),
@@ -1 +1 @@
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/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A6C;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 boundedNonEmptyArraySchema,\n boundedNonEmptyStringSchema,\n boundedStringSchema,\n loosePlainObject,\n nonEmptyStringSchema,\n plainObjectSchema,\n positiveIntegerSchema,\n requiredUnknownSchema,\n sha256HexStringSchema,\n} from \"../schema\";\nimport { AccessManifestBundleWireSchema } from \"../util/accessManifestBundle\";\nimport { MAX_INLINE_CONTAINER_REKEYS } from \"../util/containerKekKeyringWire\";\nimport { MAX_CONTAINER_PATH_LENGTH } from \"../util/containerLimits\";\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 ContentKeyWrappedKeySchema,\n contentKeyWrappingMetadataSchema,\n} from \"./contentKeyEnvelopeSchema\";\n\n/**\n * A reference to a container access manifest the server already stores, in lieu\n * of re-embedding the full signed manifest bundle. The server resolves the full\n * manifest from its own store by `manifestHash` and pins it to the container's\n * current head, so the reference carries the same authority as the full bundle\n * without the multi-KB signature. `containerId` is advisory: the server keys the\n * head lookup off the resolved bundle's own containerId and rejects a mismatch.\n */\nexport const ContainerManifestRefSchema = loosePlainObject({\n containerId: nonEmptyStringSchema,\n manifestHash: nonEmptyStringSchema,\n});\n\nexport type ContainerManifestRef = z.infer<typeof ContainerManifestRefSchema>;\n\nexport const ContainerManifestPathSchema = boundedNonEmptyArraySchema(\n ContainerManifestRefSchema,\n MAX_CONTAINER_PATH_LENGTH,\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 containerManifestHistory: z\n .array(AccessManifestBundleWireSchema)\n .optional(),\n destinationParentContainerPath: z\n .array(AccessManifestBundleWireSchema)\n .optional(),\n event: plainObjectSchema,\n expectedManifestHash: nonEmptyStringSchema,\n keyEpoch: plainObjectSchema,\n keyring: plainObjectSchema.nullable(),\n manifest: plainObjectSchema,\n parentContainerPath: z.array(AccessManifestBundleWireSchema).optional(),\n parentKekState: plainObjectSchema.nullable().optional(),\n predecessorBridge: plainObjectSchema.nullable(),\n previousContainerPath: z.array(AccessManifestBundleWireSchema).optional(),\n previousManifest: AccessManifestBundleWireSchema.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,KA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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,6 +1,6 @@
1
1
  export type { AccessManifestBundleWire } from "../util/accessManifestBundle.js";
2
2
  export { type ChallengeRequest, ChallengeRequestSchema, isChallengeRequest, isVerifyRequest, type VerifyRequest, VerifyRequestSchema, } from "./auth/index.js";
3
- export { type BlobAttachmentBindRequest, BlobAttachmentBindRequestSchema, type BlobAttachmentDetachRequest, BlobAttachmentDetachRequestSchema, type BlobContentKeyBundleRequest, BlobContentKeyBundleRequestSchema, type BlobContentKeyTargetEnvelopeRequest, BlobContentKeyTargetEnvelopeRequestSchema, type BlobStagedBlobRequest, BlobStagedBlobRequestSchema, type CompleteMultipartBlobStageRequest, CompleteMultipartBlobStageRequestSchema, type InitiateMultipartBlobStageRequest, InitiateMultipartBlobStageRequestSchema, isBlobAttachmentBindRequest, isBlobAttachmentDetachRequest, isCompleteMultipartBlobStageRequest, isInitiateMultipartBlobStageRequest, type MultipartBlobPartCommitRequest, MultipartBlobPartCommitRequestSchema, } from "./blob.js";
3
+ export { type BlobAttachmentBindRequest, BlobAttachmentBindRequestSchema, type BlobAttachmentDetachRequest, BlobAttachmentDetachRequestSchema, type BlobContentKeyBundleRequest, BlobContentKeyBundleRequestSchema, type BlobContentKeyTargetEnvelopeRequest, BlobContentKeyTargetEnvelopeRequestSchema, type BlobStagedBlobRequest, BlobStagedBlobRequestSchema, type InitiateMultipartBlobStageRequest, InitiateMultipartBlobStageRequestSchema, isBlobAttachmentBindRequest, isBlobAttachmentDetachRequest, isInitiateMultipartBlobStageRequest, } from "./blob.js";
4
4
  export { type ContainerMutationRequest, ContainerMutationRequestSchema, type ContainerReciteRequest, ContainerReciteRequestSchema, type ContainerRotationRequest, ContainerRotationRequestSchema, isContainerMutationRequest, isContainerReciteRequest, isContainerRotationRequest, } from "./container.js";
5
5
  export { type ContainerCreateWithMetadataDocumentRequest, ContainerCreateWithMetadataDocumentRequestSchema, isContainerCreateWithMetadataDocumentRequest, } from "./containerMetadata.js";
6
6
  export { isListContainerParentLanesRequest, type ListContainerParentLanesRequest, ListContainerParentLanesRequestSchema, } from "./containerParentLanes.js";
@@ -1,5 +1,5 @@
1
1
  export { ChallengeRequestSchema, isChallengeRequest, isVerifyRequest, VerifyRequestSchema, } from "./auth/index.js";
2
- export { BlobAttachmentBindRequestSchema, BlobAttachmentDetachRequestSchema, BlobContentKeyBundleRequestSchema, BlobContentKeyTargetEnvelopeRequestSchema, BlobStagedBlobRequestSchema, CompleteMultipartBlobStageRequestSchema, InitiateMultipartBlobStageRequestSchema, isBlobAttachmentBindRequest, isBlobAttachmentDetachRequest, isCompleteMultipartBlobStageRequest, isInitiateMultipartBlobStageRequest, MultipartBlobPartCommitRequestSchema, } from "./blob.js";
2
+ export { BlobAttachmentBindRequestSchema, BlobAttachmentDetachRequestSchema, BlobContentKeyBundleRequestSchema, BlobContentKeyTargetEnvelopeRequestSchema, BlobStagedBlobRequestSchema, InitiateMultipartBlobStageRequestSchema, isBlobAttachmentBindRequest, isBlobAttachmentDetachRequest, isInitiateMultipartBlobStageRequest, } from "./blob.js";
3
3
  export { ContainerMutationRequestSchema, ContainerReciteRequestSchema, ContainerRotationRequestSchema, isContainerMutationRequest, isContainerReciteRequest, isContainerRotationRequest, } from "./container.js";
4
4
  export { ContainerCreateWithMetadataDocumentRequestSchema, isContainerCreateWithMetadataDocumentRequest, } from "./containerMetadata.js";
5
5
  export { isListContainerParentLanesRequest, ListContainerParentLanesRequestSchema, } from "./containerParentLanes.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,EAEvC,uCAAuC,EACvC,2BAA2B,EAC3B,6BAA6B,EAC7B,mCAAmC,EACnC,mCAAmC,EAEnC,oCAAoC,GACrC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,8BAA8B,EAE9B,4BAA4B,EAE5B,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,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 CompleteMultipartBlobStageRequest,\n CompleteMultipartBlobStageRequestSchema,\n type InitiateMultipartBlobStageRequest,\n InitiateMultipartBlobStageRequestSchema,\n isBlobAttachmentBindRequest,\n isBlobAttachmentDetachRequest,\n isCompleteMultipartBlobStageRequest,\n isInitiateMultipartBlobStageRequest,\n type MultipartBlobPartCommitRequest,\n MultipartBlobPartCommitRequestSchema,\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 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,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 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"]}