@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,9 +1,11 @@
1
1
  import { z } from "zod";
2
+ import { registerJsonSchemaRuntimeRefinements } from "../jsonSchema.js";
2
3
  import { arraySchema, loosePlainObject, nonEmptyArraySchema, nonEmptyStringSchema, } from "../schema.js";
3
4
  import { AccessEventBundleWireResponseSchema, AccessManifestBundleWireResponseSchema, } from "../util/index.js";
4
- import { ProjectionHistoryPrefixesSchema } from "../util/projectionHistoryWire.js";
5
- import { ContainerKeyingPathResponseSchema } from "./container.js";
5
+ import { writerProjectionManifestBundlesRefinement } from "../writerProjectionRefinements.js";
6
+ import { ContainerKeyingPathResponseSchema, ContainerKeyingPathWireResponseSchema, } from "./container.js";
6
7
  import { DocumentContentKeyBundleResponseSchema, DocumentKekTargetsResponseSchema, DocumentSyncResponseSchema, } from "./documentSyncSchema.js";
8
+ import { containerKeyingPathReferences, ManifestBundlesSchema, ManifestHashReferenceSchema, OmittedManifestBundlesSchema, refineManifestBundleReferences, } from "./manifestBundleReferences.js";
7
9
  import { ProjectionPolicyEvidenceResponseSchema } from "./projectionPolicyEvidence.js";
8
10
  export { DocumentContentKeyBundleResponseSchema, DocumentContentKeyTargetEnvelopeResponseSchema, DocumentKekTargetsResponseSchema, DocumentSyncPullPageResponseSchema, DocumentSyncResponseSchema, DocumentSyncUpdateResponseSchema, } from "./documentSyncSchema.js";
9
11
  export const DocumentCreateResponseSchema = loosePlainObject({
@@ -36,7 +38,6 @@ export const DocumentPurgeResponseSchema = loosePlainObject({
36
38
  reclaimedBlobStorageKeys: arraySchema(z.string()),
37
39
  });
38
40
  export const DocumentWriterProjectionResponseSchema = loosePlainObject({
39
- historyPrefixes: ProjectionHistoryPrefixesSchema.optional(),
40
41
  policyEvidence: ProjectionPolicyEvidenceResponseSchema,
41
42
  authorizingContainerPaths: nonEmptyArraySchema(ContainerKeyingPathResponseSchema),
42
43
  contentKeyBundle: DocumentContentKeyBundleResponseSchema,
@@ -49,6 +50,32 @@ export const DocumentWriterProjectionResponseSchema = loosePlainObject({
49
50
  documentManifestContainerPaths: arraySchema(arraySchema(AccessManifestBundleWireResponseSchema)),
50
51
  documentManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),
51
52
  });
53
+ function documentWriterProjectionReferences(projection) {
54
+ const listed = (value) => Array.isArray(value) ? value : [];
55
+ return [
56
+ projection.documentManifest,
57
+ ...listed(projection.documentManifestHistory),
58
+ ...listed(projection.documentContainerManifestHistory),
59
+ ...listed(projection.documentManifestContainerPaths).flatMap(listed),
60
+ ...listed(projection.authorizingContainerPaths).flatMap(containerKeyingPathReferences),
61
+ ];
62
+ }
63
+ /** The served shape; see ContainerWriterProjectionWireResponseSchema. */
64
+ export const DocumentWriterProjectionWireResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject({
65
+ bundles: ManifestBundlesSchema,
66
+ omittedBundles: OmittedManifestBundlesSchema,
67
+ policyEvidence: ProjectionPolicyEvidenceResponseSchema,
68
+ authorizingContainerPaths: nonEmptyArraySchema(ContainerKeyingPathWireResponseSchema),
69
+ contentKeyBundle: DocumentContentKeyBundleResponseSchema,
70
+ /** Present only when the stored content-key bundle targets stale KEKs. */
71
+ contentKeyBundleStale: z.literal(true).optional(),
72
+ documentContainerManifestHistory: arraySchema(ManifestHashReferenceSchema),
73
+ documentId: z.string(),
74
+ documentKekTargets: DocumentKekTargetsResponseSchema,
75
+ documentManifest: ManifestHashReferenceSchema,
76
+ documentManifestContainerPaths: arraySchema(arraySchema(ManifestHashReferenceSchema)),
77
+ documentManifestHistory: arraySchema(ManifestHashReferenceSchema),
78
+ }).superRefine((projection, context) => refineManifestBundleReferences(projection, documentWriterProjectionReferences(projection), context)), [writerProjectionManifestBundlesRefinement]);
52
79
  /**
53
80
  * Derives the KEK-target summary that corresponds to a content-key bundle,
54
81
  * preserving the bundle's served target order. Both the API (for stale-bundle
@@ -96,4 +123,7 @@ export function isDocumentSyncResponse(value) {
96
123
  export function isDocumentWriterProjectionResponse(value) {
97
124
  return DocumentWriterProjectionResponseSchema.safeParse(value).success;
98
125
  }
126
+ export function isDocumentWriterProjectionWireResponse(value) {
127
+ return DocumentWriterProjectionWireResponseSchema.safeParse(value).success;
128
+ }
99
129
  //# sourceMappingURL=documentMutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentMutation.js","sourceRoot":"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AO,0BAA0B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAc;IAEd,OAAO,sCAAsC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACzE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyArraySchema,\n nonEmptyStringSchema,\n} from \"../schema\";\nimport {\n AccessEventBundleWireResponseSchema,\n AccessManifestBundleWireResponseSchema,\n} from \"../util\";\nimport { ProjectionHistoryPrefixesSchema } from \"../util/projectionHistoryWire\";\nimport { ContainerKeyingPathResponseSchema } from \"./container\";\nimport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n} from \"./documentSyncSchema\";\nimport { ProjectionPolicyEvidenceResponseSchema } from \"./projectionPolicyEvidence\";\n\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n} from \"./documentSyncSchema\";\n\nexport const DocumentCreateResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n createdAt: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentCreateResponse = z.infer<\n typeof DocumentCreateResponseSchema\n>;\n\nexport const DocumentLinkSetMutationResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentLinkSetMutationResponse = z.infer<\n typeof DocumentLinkSetMutationResponseSchema\n>;\n\nconst documentPurgeProofShape = {\n authorizingContainerPath: nonEmptyArraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: nonEmptyStringSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestPredecessors: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n purgeEvent: AccessEventBundleWireResponseSchema,\n purgedAt: nonEmptyStringSchema,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n} as const;\n\nexport const DocumentPurgeProofResponseSchema = loosePlainObject(\n documentPurgeProofShape,\n);\n\nexport type DocumentPurgeProofResponse = z.infer<\n typeof DocumentPurgeProofResponseSchema\n>;\n\nexport const DocumentPurgeResponseSchema = loosePlainObject({\n ...documentPurgeProofShape,\n reclaimedBlobStorageKeys: arraySchema(z.string()),\n});\n\nexport type DocumentPurgeResponse = z.infer<typeof DocumentPurgeResponseSchema>;\n\nexport const DocumentWriterProjectionResponseSchema = loosePlainObject({\n historyPrefixes: ProjectionHistoryPrefixesSchema.optional(),\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n authorizingContainerPaths: nonEmptyArraySchema(\n ContainerKeyingPathResponseSchema,\n ),\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n /** Present only when the stored content-key bundle targets stale KEKs. */\n contentKeyBundleStale: z.literal(true).optional(),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),\n});\n\nexport type DocumentWriterProjectionResponse = z.infer<\n typeof DocumentWriterProjectionResponseSchema\n>;\n\n/**\n * Derives the KEK-target summary that corresponds to a content-key bundle,\n * preserving the bundle's served target order. Both the API (for stale-bundle\n * read-only sync responses) and clients (for plans built against a stale\n * bundle) must derive this identically so response/plan state comparisons\n * hold byte-for-byte.\n */\nexport function documentKekTargetsFromContentKeyBundle(\n bundle: DocumentContentKeyBundleResponse,\n): DocumentKekTargetsResponse {\n const targets = bundle.targets.map((target) => ({\n containerId: target.containerId,\n containerManifestHash: target.containerManifestHash,\n containerKeyEpochId: target.containerKeyEpochId,\n containerKeyEpoch: target.containerKeyEpoch,\n }));\n\n return {\n documentId: bundle.documentId,\n documentKeyTargetHash: bundle.targetHash,\n linkSetManifestHash: bundle.linkSetManifestHash,\n linkedContainerKeyEpochIds: targets.map(\n (target) => target.containerKeyEpochId,\n ),\n linkedContainerManifestHashes: targets.map(\n (target) => target.containerManifestHash,\n ),\n targets,\n };\n}\n\nexport function isDocumentKekTargetsResponse(\n value: unknown,\n): value is DocumentKekTargetsResponse {\n return DocumentKekTargetsResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentContentKeyBundleResponse(\n value: unknown,\n): value is DocumentContentKeyBundleResponse {\n return DocumentContentKeyBundleResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentCreateResponse(\n value: unknown,\n): value is DocumentCreateResponse {\n return DocumentCreateResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentLinkSetMutationResponse(\n value: unknown,\n): value is DocumentLinkSetMutationResponse {\n return DocumentLinkSetMutationResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeResponse(\n value: unknown,\n): value is DocumentPurgeResponse {\n return DocumentPurgeResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeProofResponse(\n value: unknown,\n): value is DocumentPurgeProofResponse {\n return DocumentPurgeProofResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentSyncResponse(\n value: unknown,\n): value is DocumentSyncResponse {\n return DocumentSyncResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentWriterProjectionResponse(\n value: unknown,\n): value is DocumentWriterProjectionResponse {\n return DocumentWriterProjectionResponseSchema.safeParse(value).success;\n}\n"]}
1
+ {"version":3,"file":"documentMutation.js","sourceRoot":"","sources":["documentMutation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mCAAmC,EACnC,sCAAsC,GACvC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,yCAAyC,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,sCAAsC,EAEtC,gCAAgC,EAEhC,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC3B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sCAAsC,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EAEL,sCAAsC,EAEtC,8CAA8C,EAE9C,gCAAgC,EAEhC,kCAAkC,EAElC,0BAA0B,EAE1B,gCAAgC,GACjC,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;IAC3D,cAAc,EAAE,sCAAsC;IACtD,gBAAgB,EAAE,sCAAsC;IACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,kBAAkB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,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,KAAc;IAEd,OAAO,qCAAqC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAAc;IAEd,OAAO,2BAA2B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,KAAc;IAEd,OAAO,gCAAgC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,0BAA0B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAc;IAEd,OAAO,sCAAsC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,sCAAsC,CACpD,KAAc;IAEd,OAAO,0CAA0C,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC7E,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { registerJsonSchemaRuntimeRefinements } from \"../jsonSchema\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyArraySchema,\n nonEmptyStringSchema,\n} from \"../schema\";\nimport {\n AccessEventBundleWireResponseSchema,\n AccessManifestBundleWireResponseSchema,\n} from \"../util\";\nimport { writerProjectionManifestBundlesRefinement } from \"../writerProjectionRefinements\";\nimport {\n ContainerKeyingPathResponseSchema,\n ContainerKeyingPathWireResponseSchema,\n} from \"./container\";\nimport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n} from \"./documentSyncSchema\";\nimport {\n containerKeyingPathReferences,\n ManifestBundlesSchema,\n ManifestHashReferenceSchema,\n OmittedManifestBundlesSchema,\n refineManifestBundleReferences,\n} from \"./manifestBundleReferences\";\nimport { ProjectionPolicyEvidenceResponseSchema } from \"./projectionPolicyEvidence\";\n\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n} from \"./documentSyncSchema\";\n\nexport const DocumentCreateResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n createdAt: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentCreateResponse = z.infer<\n typeof DocumentCreateResponseSchema\n>;\n\nexport const DocumentLinkSetMutationResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentLinkSetMutationResponse = z.infer<\n typeof DocumentLinkSetMutationResponseSchema\n>;\n\nconst documentPurgeProofShape = {\n authorizingContainerPath: nonEmptyArraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: nonEmptyStringSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestPredecessors: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n purgeEvent: AccessEventBundleWireResponseSchema,\n purgedAt: nonEmptyStringSchema,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n} as const;\n\nexport const DocumentPurgeProofResponseSchema = loosePlainObject(\n documentPurgeProofShape,\n);\n\nexport type DocumentPurgeProofResponse = z.infer<\n typeof DocumentPurgeProofResponseSchema\n>;\n\nexport const DocumentPurgeResponseSchema = loosePlainObject({\n ...documentPurgeProofShape,\n reclaimedBlobStorageKeys: arraySchema(z.string()),\n});\n\nexport type DocumentPurgeResponse = z.infer<typeof DocumentPurgeResponseSchema>;\n\nexport const DocumentWriterProjectionResponseSchema = loosePlainObject({\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n authorizingContainerPaths: nonEmptyArraySchema(\n ContainerKeyingPathResponseSchema,\n ),\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n /** Present only when the stored content-key bundle targets stale KEKs. */\n contentKeyBundleStale: z.literal(true).optional(),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),\n});\n\nexport type DocumentWriterProjectionResponse = z.infer<\n typeof DocumentWriterProjectionResponseSchema\n>;\n\nfunction documentWriterProjectionReferences(projection: {\n readonly authorizingContainerPaths: unknown;\n readonly documentContainerManifestHistory: unknown;\n readonly documentManifest: unknown;\n readonly documentManifestContainerPaths: unknown;\n readonly documentManifestHistory: unknown;\n}): unknown[] {\n const listed = (value: unknown): unknown[] =>\n Array.isArray(value) ? value : [];\n return [\n projection.documentManifest,\n ...listed(projection.documentManifestHistory),\n ...listed(projection.documentContainerManifestHistory),\n ...listed(projection.documentManifestContainerPaths).flatMap(listed),\n ...listed(projection.authorizingContainerPaths).flatMap(\n containerKeyingPathReferences,\n ),\n ];\n}\n\n/** The served shape; see ContainerWriterProjectionWireResponseSchema. */\nexport const DocumentWriterProjectionWireResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n bundles: ManifestBundlesSchema,\n omittedBundles: OmittedManifestBundlesSchema,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n authorizingContainerPaths: nonEmptyArraySchema(\n ContainerKeyingPathWireResponseSchema,\n ),\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n /** Present only when the stored content-key bundle targets stale KEKs. */\n contentKeyBundleStale: z.literal(true).optional(),\n documentContainerManifestHistory: arraySchema(\n ManifestHashReferenceSchema,\n ),\n documentId: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n documentManifest: ManifestHashReferenceSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(ManifestHashReferenceSchema),\n ),\n documentManifestHistory: arraySchema(ManifestHashReferenceSchema),\n }).superRefine((projection, context) =>\n refineManifestBundleReferences(\n projection,\n documentWriterProjectionReferences(projection),\n context,\n ),\n ),\n [writerProjectionManifestBundlesRefinement],\n );\n\nexport type DocumentWriterProjectionWireResponse = z.infer<\n typeof DocumentWriterProjectionWireResponseSchema\n>;\n\n/**\n * Derives the KEK-target summary that corresponds to a content-key bundle,\n * preserving the bundle's served target order. Both the API (for stale-bundle\n * read-only sync responses) and clients (for plans built against a stale\n * bundle) must derive this identically so response/plan state comparisons\n * hold byte-for-byte.\n */\nexport function documentKekTargetsFromContentKeyBundle(\n bundle: DocumentContentKeyBundleResponse,\n): DocumentKekTargetsResponse {\n const targets = bundle.targets.map((target) => ({\n containerId: target.containerId,\n containerManifestHash: target.containerManifestHash,\n containerKeyEpochId: target.containerKeyEpochId,\n containerKeyEpoch: target.containerKeyEpoch,\n }));\n\n return {\n documentId: bundle.documentId,\n documentKeyTargetHash: bundle.targetHash,\n linkSetManifestHash: bundle.linkSetManifestHash,\n linkedContainerKeyEpochIds: targets.map(\n (target) => target.containerKeyEpochId,\n ),\n linkedContainerManifestHashes: targets.map(\n (target) => target.containerManifestHash,\n ),\n targets,\n };\n}\n\nexport function isDocumentKekTargetsResponse(\n value: unknown,\n): value is DocumentKekTargetsResponse {\n return DocumentKekTargetsResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentContentKeyBundleResponse(\n value: unknown,\n): value is DocumentContentKeyBundleResponse {\n return DocumentContentKeyBundleResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentCreateResponse(\n value: unknown,\n): value is DocumentCreateResponse {\n return DocumentCreateResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentLinkSetMutationResponse(\n value: unknown,\n): value is DocumentLinkSetMutationResponse {\n return DocumentLinkSetMutationResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeResponse(\n value: unknown,\n): value is DocumentPurgeResponse {\n return DocumentPurgeResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeProofResponse(\n value: unknown,\n): value is DocumentPurgeProofResponse {\n return DocumentPurgeProofResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentSyncResponse(\n value: unknown,\n): value is DocumentSyncResponse {\n return DocumentSyncResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentWriterProjectionResponse(\n value: unknown,\n): value is DocumentWriterProjectionResponse {\n return DocumentWriterProjectionResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentWriterProjectionWireResponse(\n value: unknown,\n): value is DocumentWriterProjectionWireResponse {\n return DocumentWriterProjectionWireResponseSchema.safeParse(value).success;\n}\n"]}
@@ -2,16 +2,16 @@ export { type AccessManifestBundleWireResponse, isAccessManifestBundleWireRespon
2
2
  export { type EffectiveAccessLevel, EffectiveAccessLevelSchema, isEffectiveAccessLevel, } from "./accessLevel.js";
3
3
  export { type ChallengeErrorResponse, ChallengeErrorResponseSchema, type ChallengeResponse, ChallengeResponseSchema, type DestroySessionResponse, DestroySessionResponseSchema, isChallengeErrorResponse, isChallengeResponse, isDestroySessionResponse, isListSessionsResponse, isSessionRefreshRequiredFailure, isUserIdentityResponse, isUserSessionResponse, isVerifyResponse, isWebSocketTicketResponse, type ListSessionsResponse, ListSessionsResponseSchema, SESSION_ERROR_CODES, type SessionErrorCode, SessionErrorCodeSchema, type SessionFailureResponse, SessionFailureResponseSchema, type UserIdentityResponse, UserIdentityResponseSchema, type UserSessionResponse, UserSessionResponseSchema, type VerifyFailureResponse, VerifyFailureResponseSchema, type VerifyResponse, type VerifySuccessResponse, VerifySuccessResponseSchema, type WebSocketTicketResponse, WebSocketTicketResponseSchema, } from "./auth/index.js";
4
4
  export { isRevenueCatWebhookResponse, isStripeWebhookResponse, type RevenueCatWebhookResponse, RevenueCatWebhookResponseSchema, type StripeWebhookResponse, StripeWebhookResponseSchema, } from "./billingWebhooks.js";
5
- export { type BlobAttachmentBindResponse, BlobAttachmentBindResponseSchema, type BlobAttachmentDetachResponse, BlobAttachmentDetachResponseSchema, type BlobAttachmentSummary, BlobAttachmentSummarySchema, type BlobContentKeyBundleResponse, BlobContentKeyBundleResponseSchema, type BlobContentKeyTargetEnvelopeResponse, BlobContentKeyTargetEnvelopeResponseSchema, type BlobKekTargetsResponse, BlobKekTargetsResponseSchema, type CompleteMultipartBlobStageResponse, CompleteMultipartBlobStageResponseSchema, type InitiateMultipartBlobStageResponse, InitiateMultipartBlobStageResponseSchema, isBlobAttachmentBindResponse, isBlobAttachmentDetachResponse, isCompleteMultipartBlobStageResponse, isInitiateMultipartBlobStageResponse, isListDocumentAttachmentsResponse, isMultipartBlobStageStatusResponse, isUploadMultipartBlobPartResponse, type ListDocumentAttachmentsResponse, ListDocumentAttachmentsResponseSchema, type MultipartBlobStagePart, MultipartBlobStagePartSchema, type MultipartBlobStageStatusResponse, MultipartBlobStageStatusResponseSchema, type UploadMultipartBlobPartResponse, UploadMultipartBlobPartResponseSchema, } from "./blob.js";
5
+ export { type BlobAttachmentBindResponse, BlobAttachmentBindResponseSchema, type BlobAttachmentDetachResponse, BlobAttachmentDetachResponseSchema, type BlobAttachmentSummary, BlobAttachmentSummarySchema, type BlobContentKeyBundleResponse, BlobContentKeyBundleResponseSchema, type BlobContentKeyTargetEnvelopeResponse, BlobContentKeyTargetEnvelopeResponseSchema, type BlobKekTargetsResponse, BlobKekTargetsResponseSchema, type InitiateMultipartBlobStageResponse, InitiateMultipartBlobStageResponseSchema, isBlobAttachmentBindResponse, isBlobAttachmentDetachResponse, isInitiateMultipartBlobStageResponse, isListDocumentAttachmentsResponse, isMultipartBlobStageStatusResponse, isUploadMultipartBlobPartResponse, type ListDocumentAttachmentsResponse, ListDocumentAttachmentsResponseSchema, type MultipartBlobStagePart, MultipartBlobStagePartSchema, type MultipartBlobStageStatusResponse, MultipartBlobStageStatusResponseSchema, type UploadMultipartBlobPartResponse, UploadMultipartBlobPartResponseSchema, } from "./blob.js";
6
6
  export { BLOB_MUTATION_ERROR_CODES, type BlobMutationErrorCode, type BlobMutationFailureResponse, BlobMutationFailureResponseSchema, } from "./blobMutationError.js";
7
- export { CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE, type ContainerDeleteResponse, ContainerDeleteResponseSchema, type ContainerKekKeyringWireResponse, type ContainerKekLogEpochResponse, ContainerKekLogEpochResponseSchema, type ContainerKekLogResponse, ContainerKekLogResponseSchema, type ContainerKekResponse, type ContainerKeyingPathResponse, ContainerKeyingPathResponseSchema, type ContainerMutationResponse, ContainerMutationResponseSchema, type ContainerReciteResponse, ContainerReciteResponseSchema, type ContainerRotationResponse, ContainerRotationResponseSchema, type ContainerSummary, ContainerSummaryResponseSchema, type ContainerSyncTombstone, ContainerSyncTombstoneResponseSchema, ContainerWriterProjectionErrorResponseSchema, type ContainerWriterProjectionResponse, ContainerWriterProjectionResponseSchema, isContainerDeleteResponse, isContainerKekLogResponse, isContainerMutationResponse, isContainerReciteResponse, isContainerRotationResponse, isContainerWriterProjectionResponse, isListContainersResponse, type ListContainersResponse, ListContainersResponseSchema, } from "./container.js";
7
+ export { CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE, type ContainerDeleteResponse, ContainerDeleteResponseSchema, type ContainerKekKeyringWireResponse, type ContainerKekLogEpochResponse, ContainerKekLogEpochResponseSchema, type ContainerKekLogResponse, ContainerKekLogResponseSchema, type ContainerKekResponse, type ContainerKeyingPathResponse, ContainerKeyingPathResponseSchema, type ContainerMutationResponse, ContainerMutationResponseSchema, type ContainerReciteResponse, ContainerReciteResponseSchema, type ContainerRotationResponse, ContainerRotationResponseSchema, type ContainerSummary, ContainerSummaryResponseSchema, type ContainerSyncTombstone, ContainerSyncTombstoneResponseSchema, ContainerWriterProjectionErrorResponseSchema, type ContainerWriterProjectionResponse, ContainerWriterProjectionResponseSchema, type ContainerWriterProjectionWireResponse, ContainerWriterProjectionWireResponseSchema, isContainerDeleteResponse, isContainerKekLogResponse, isContainerMutationResponse, isContainerReciteResponse, isContainerRotationResponse, isContainerWriterProjectionResponse, isContainerWriterProjectionWireResponse, isListContainersResponse, type ListContainersResponse, ListContainersResponseSchema, } from "./container.js";
8
8
  export { type ContainerCreateWithMetadataDocumentResponse, ContainerCreateWithMetadataDocumentResponseSchema, isContainerCreateWithMetadataDocumentResponse, } from "./containerMetadata.js";
9
9
  export { CONTAINER_MUTATION_ERROR_CODES, ContainerMutationBehaviorErrorCodeSchema, type ContainerMutationErrorCode, ContainerMutationErrorCodeSchema, type ContainerMutationFailureResponse, ContainerMutationFailureResponseSchema, } from "./containerMutationError.js";
10
10
  export { CONTAINER_NOT_FOUND_ERROR_CODE, type ContainerNotFoundErrorResponse, ContainerNotFoundErrorResponseSchema, } from "./containerNotFoundError.js";
11
11
  export { isListContainerParentLanesResponse, type ListContainerParentLanesResponse, ListContainerParentLanesResponseSchema, } from "./containerParentLanes.js";
12
12
  export { CONTAINER_UNAVAILABLE_ERROR_CODE, type ContainerUnavailableErrorCode, } from "./containerUnavailableError.js";
13
13
  export { type ContainerDocumentSummary, ContainerDocumentSummaryResponseSchema, type ContainerDocumentSyncTombstone, ContainerDocumentSyncTombstoneResponseSchema, type DocumentEditAttributionRangeResponse, DocumentEditAttributionRangeResponseSchema, type DocumentEditAttributionResponse, DocumentEditAttributionResponseSchema, type DocumentEditAttributionSegmentResponse, DocumentEditAttributionSegmentResponseSchema, isDocumentEditAttributionResponse, isListContainerDocumentsResponse, isListDocumentEditAttributionRangesResponse, type ListContainerDocumentsResponse, ListContainerDocumentsResponseSchema, type ListDocumentEditAttributionRangesResponse, ListDocumentEditAttributionRangesResponseSchema, } from "./document.js";
14
- export { type DocumentContentKeyBundleResponse, DocumentContentKeyBundleResponseSchema, type DocumentContentKeyTargetEnvelopeResponse, DocumentContentKeyTargetEnvelopeResponseSchema, type DocumentCreateResponse, DocumentCreateResponseSchema, type DocumentKekTargetsResponse, DocumentKekTargetsResponseSchema, type DocumentLinkSetMutationResponse, DocumentLinkSetMutationResponseSchema, type DocumentPurgeProofResponse, DocumentPurgeProofResponseSchema, type DocumentPurgeResponse, DocumentPurgeResponseSchema, type DocumentSyncPullPageResponse, DocumentSyncPullPageResponseSchema, type DocumentSyncResponse, DocumentSyncResponseSchema, type DocumentSyncUpdateResponse, DocumentSyncUpdateResponseSchema, type DocumentWriterProjectionResponse, DocumentWriterProjectionResponseSchema, documentKekTargetsFromContentKeyBundle, isDocumentContentKeyBundleResponse, isDocumentCreateResponse, isDocumentKekTargetsResponse, isDocumentLinkSetMutationResponse, isDocumentPurgeProofResponse, isDocumentPurgeResponse, isDocumentSyncResponse, isDocumentWriterProjectionResponse, } from "./documentMutation.js";
14
+ export { type DocumentContentKeyBundleResponse, DocumentContentKeyBundleResponseSchema, type DocumentContentKeyTargetEnvelopeResponse, DocumentContentKeyTargetEnvelopeResponseSchema, type DocumentCreateResponse, DocumentCreateResponseSchema, type DocumentKekTargetsResponse, DocumentKekTargetsResponseSchema, type DocumentLinkSetMutationResponse, DocumentLinkSetMutationResponseSchema, type DocumentPurgeProofResponse, DocumentPurgeProofResponseSchema, type DocumentPurgeResponse, DocumentPurgeResponseSchema, type DocumentSyncPullPageResponse, DocumentSyncPullPageResponseSchema, type DocumentSyncResponse, DocumentSyncResponseSchema, type DocumentSyncUpdateResponse, DocumentSyncUpdateResponseSchema, type DocumentWriterProjectionResponse, DocumentWriterProjectionResponseSchema, type DocumentWriterProjectionWireResponse, DocumentWriterProjectionWireResponseSchema, documentKekTargetsFromContentKeyBundle, isDocumentContentKeyBundleResponse, isDocumentCreateResponse, isDocumentKekTargetsResponse, isDocumentLinkSetMutationResponse, isDocumentPurgeProofResponse, isDocumentPurgeResponse, isDocumentSyncResponse, isDocumentWriterProjectionResponse, isDocumentWriterProjectionWireResponse, } from "./documentMutation.js";
15
15
  export { DOCUMENT_MUTATION_ERROR_CODES, DocumentMutationBehaviorErrorCodeSchema, type DocumentMutationErrorCode, DocumentMutationErrorCodeSchema, type DocumentMutationFailureResponse, DocumentMutationFailureResponseSchema, } from "./documentMutationError.js";
16
16
  export { DOCUMENT_NOT_FOUND_ERROR_CODE, DOCUMENT_PROJECTION_ERROR_CODES, DOCUMENT_SYNC_ERROR_CODES, type DocumentNotFoundErrorCode, type DocumentNotFoundErrorResponse, DocumentNotFoundErrorResponseSchema, type DocumentProjectionErrorCode, DocumentProjectionErrorCodeSchema, type DocumentSyncErrorCode, DocumentSyncErrorCodeSchema, type DocumentSyncErrorResponse, DocumentSyncErrorResponseSchema, type DocumentSyncStateStaleErrorResponse, DocumentSyncStateStaleErrorResponseSchema, type DocumentWriterProjectionErrorResponse, DocumentWriterProjectionErrorResponseSchema, isDocumentSyncErrorCode, isDocumentSyncErrorResponse, isDocumentSyncStateStaleErrorResponse, } from "./documentSyncError.js";
17
17
  export { type ErrorResponse, ErrorResponseSchema, isErrorResponse, } from "./error.js";
@@ -38,3 +38,4 @@ export { isRootIdentitiesResponse, isRootIdentityDetailResponse, isRootIdentityO
38
38
  export { type RootDataUsageReportResponse, RootDataUsageReportResponseSchema, type RootOrganizationDetailResponse, RootOrganizationDetailResponseSchema, type RootOrganizationIdentitiesResponse, RootOrganizationIdentitiesResponseSchema, type RootOrganizationIdentityResponse, RootOrganizationIdentityResponseSchema, type RootOrganizationSummaryResponse, RootOrganizationSummaryResponseSchema, type RootOrganizationsResponse, RootOrganizationsResponseSchema, } from "./rootOrganizations.js";
39
39
  export { isStripeCancelResponse, isStripeCheckoutIntentResponse, isStripeCheckoutOptionsResponse, isStripeCheckoutSessionResponse, isStripePortalResponse, type StripeCancelResponse, StripeCancelResponseSchema, type StripeCheckoutIntentResponse, StripeCheckoutIntentResponseSchema, type StripeCheckoutOptionsResponse, StripeCheckoutOptionsResponseSchema, type StripeCheckoutSessionResponse, StripeCheckoutSessionResponseSchema, type StripePortalResponse, StripePortalResponseSchema, type StripeSyncOptionResponse, StripeSyncOptionResponseSchema, } from "./stripeCheckout.js";
40
40
  export { isSyncWatermark, type SyncWatermark, SyncWatermarkSchema, } from "./syncWatermark.js";
41
+ export { decodeContainerWriterProjection, decodeDocumentWriterProjection, encodeContainerWriterProjection, encodeDocumentWriterProjection, } from "./writerProjectionWire.js";
@@ -2,16 +2,16 @@ export { isAccessManifestBundleWireResponse, } from "../util/index.js";
2
2
  export { EffectiveAccessLevelSchema, isEffectiveAccessLevel, } from "./accessLevel.js";
3
3
  export { ChallengeErrorResponseSchema, ChallengeResponseSchema, DestroySessionResponseSchema, isChallengeErrorResponse, isChallengeResponse, isDestroySessionResponse, isListSessionsResponse, isSessionRefreshRequiredFailure, isUserIdentityResponse, isUserSessionResponse, isVerifyResponse, isWebSocketTicketResponse, ListSessionsResponseSchema, SESSION_ERROR_CODES, SessionErrorCodeSchema, SessionFailureResponseSchema, UserIdentityResponseSchema, UserSessionResponseSchema, VerifyFailureResponseSchema, VerifySuccessResponseSchema, WebSocketTicketResponseSchema, } from "./auth/index.js";
4
4
  export { isRevenueCatWebhookResponse, isStripeWebhookResponse, RevenueCatWebhookResponseSchema, StripeWebhookResponseSchema, } from "./billingWebhooks.js";
5
- export { BlobAttachmentBindResponseSchema, BlobAttachmentDetachResponseSchema, BlobAttachmentSummarySchema, BlobContentKeyBundleResponseSchema, BlobContentKeyTargetEnvelopeResponseSchema, BlobKekTargetsResponseSchema, CompleteMultipartBlobStageResponseSchema, InitiateMultipartBlobStageResponseSchema, isBlobAttachmentBindResponse, isBlobAttachmentDetachResponse, isCompleteMultipartBlobStageResponse, isInitiateMultipartBlobStageResponse, isListDocumentAttachmentsResponse, isMultipartBlobStageStatusResponse, isUploadMultipartBlobPartResponse, ListDocumentAttachmentsResponseSchema, MultipartBlobStagePartSchema, MultipartBlobStageStatusResponseSchema, UploadMultipartBlobPartResponseSchema, } from "./blob.js";
5
+ export { BlobAttachmentBindResponseSchema, BlobAttachmentDetachResponseSchema, BlobAttachmentSummarySchema, BlobContentKeyBundleResponseSchema, BlobContentKeyTargetEnvelopeResponseSchema, BlobKekTargetsResponseSchema, InitiateMultipartBlobStageResponseSchema, isBlobAttachmentBindResponse, isBlobAttachmentDetachResponse, isInitiateMultipartBlobStageResponse, isListDocumentAttachmentsResponse, isMultipartBlobStageStatusResponse, isUploadMultipartBlobPartResponse, ListDocumentAttachmentsResponseSchema, MultipartBlobStagePartSchema, MultipartBlobStageStatusResponseSchema, UploadMultipartBlobPartResponseSchema, } from "./blob.js";
6
6
  export { BLOB_MUTATION_ERROR_CODES, BlobMutationFailureResponseSchema, } from "./blobMutationError.js";
7
- export { CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE, ContainerDeleteResponseSchema, ContainerKekLogEpochResponseSchema, ContainerKekLogResponseSchema, ContainerKeyingPathResponseSchema, ContainerMutationResponseSchema, ContainerReciteResponseSchema, ContainerRotationResponseSchema, ContainerSummaryResponseSchema, ContainerSyncTombstoneResponseSchema, ContainerWriterProjectionErrorResponseSchema, ContainerWriterProjectionResponseSchema, isContainerDeleteResponse, isContainerKekLogResponse, isContainerMutationResponse, isContainerReciteResponse, isContainerRotationResponse, isContainerWriterProjectionResponse, isListContainersResponse, ListContainersResponseSchema, } from "./container.js";
7
+ export { CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE, ContainerDeleteResponseSchema, ContainerKekLogEpochResponseSchema, ContainerKekLogResponseSchema, ContainerKeyingPathResponseSchema, ContainerMutationResponseSchema, ContainerReciteResponseSchema, ContainerRotationResponseSchema, ContainerSummaryResponseSchema, ContainerSyncTombstoneResponseSchema, ContainerWriterProjectionErrorResponseSchema, ContainerWriterProjectionResponseSchema, ContainerWriterProjectionWireResponseSchema, isContainerDeleteResponse, isContainerKekLogResponse, isContainerMutationResponse, isContainerReciteResponse, isContainerRotationResponse, isContainerWriterProjectionResponse, isContainerWriterProjectionWireResponse, isListContainersResponse, ListContainersResponseSchema, } from "./container.js";
8
8
  export { ContainerCreateWithMetadataDocumentResponseSchema, isContainerCreateWithMetadataDocumentResponse, } from "./containerMetadata.js";
9
9
  export { CONTAINER_MUTATION_ERROR_CODES, ContainerMutationBehaviorErrorCodeSchema, ContainerMutationErrorCodeSchema, ContainerMutationFailureResponseSchema, } from "./containerMutationError.js";
10
10
  export { CONTAINER_NOT_FOUND_ERROR_CODE, ContainerNotFoundErrorResponseSchema, } from "./containerNotFoundError.js";
11
11
  export { isListContainerParentLanesResponse, ListContainerParentLanesResponseSchema, } from "./containerParentLanes.js";
12
12
  export { CONTAINER_UNAVAILABLE_ERROR_CODE, } from "./containerUnavailableError.js";
13
13
  export { ContainerDocumentSummaryResponseSchema, ContainerDocumentSyncTombstoneResponseSchema, DocumentEditAttributionRangeResponseSchema, DocumentEditAttributionResponseSchema, DocumentEditAttributionSegmentResponseSchema, isDocumentEditAttributionResponse, isListContainerDocumentsResponse, isListDocumentEditAttributionRangesResponse, ListContainerDocumentsResponseSchema, ListDocumentEditAttributionRangesResponseSchema, } from "./document.js";
14
- export { DocumentContentKeyBundleResponseSchema, DocumentContentKeyTargetEnvelopeResponseSchema, DocumentCreateResponseSchema, DocumentKekTargetsResponseSchema, DocumentLinkSetMutationResponseSchema, DocumentPurgeProofResponseSchema, DocumentPurgeResponseSchema, DocumentSyncPullPageResponseSchema, DocumentSyncResponseSchema, DocumentSyncUpdateResponseSchema, DocumentWriterProjectionResponseSchema, documentKekTargetsFromContentKeyBundle, isDocumentContentKeyBundleResponse, isDocumentCreateResponse, isDocumentKekTargetsResponse, isDocumentLinkSetMutationResponse, isDocumentPurgeProofResponse, isDocumentPurgeResponse, isDocumentSyncResponse, isDocumentWriterProjectionResponse, } from "./documentMutation.js";
14
+ export { DocumentContentKeyBundleResponseSchema, DocumentContentKeyTargetEnvelopeResponseSchema, DocumentCreateResponseSchema, DocumentKekTargetsResponseSchema, DocumentLinkSetMutationResponseSchema, DocumentPurgeProofResponseSchema, DocumentPurgeResponseSchema, DocumentSyncPullPageResponseSchema, DocumentSyncResponseSchema, DocumentSyncUpdateResponseSchema, DocumentWriterProjectionResponseSchema, DocumentWriterProjectionWireResponseSchema, documentKekTargetsFromContentKeyBundle, isDocumentContentKeyBundleResponse, isDocumentCreateResponse, isDocumentKekTargetsResponse, isDocumentLinkSetMutationResponse, isDocumentPurgeProofResponse, isDocumentPurgeResponse, isDocumentSyncResponse, isDocumentWriterProjectionResponse, isDocumentWriterProjectionWireResponse, } from "./documentMutation.js";
15
15
  export { DOCUMENT_MUTATION_ERROR_CODES, DocumentMutationBehaviorErrorCodeSchema, DocumentMutationErrorCodeSchema, DocumentMutationFailureResponseSchema, } from "./documentMutationError.js";
16
16
  export { DOCUMENT_NOT_FOUND_ERROR_CODE, DOCUMENT_PROJECTION_ERROR_CODES, DOCUMENT_SYNC_ERROR_CODES, DocumentNotFoundErrorResponseSchema, DocumentProjectionErrorCodeSchema, DocumentSyncErrorCodeSchema, DocumentSyncErrorResponseSchema, DocumentSyncStateStaleErrorResponseSchema, DocumentWriterProjectionErrorResponseSchema, isDocumentSyncErrorCode, isDocumentSyncErrorResponse, isDocumentSyncStateStaleErrorResponse, } from "./documentSyncError.js";
17
17
  export { ErrorResponseSchema, isErrorResponse, } from "./error.js";
@@ -38,4 +38,5 @@ export { isRootIdentitiesResponse, isRootIdentityDetailResponse, isRootIdentityO
38
38
  export { RootDataUsageReportResponseSchema, RootOrganizationDetailResponseSchema, RootOrganizationIdentitiesResponseSchema, RootOrganizationIdentityResponseSchema, RootOrganizationSummaryResponseSchema, RootOrganizationsResponseSchema, } from "./rootOrganizations.js";
39
39
  export { isStripeCancelResponse, isStripeCheckoutIntentResponse, isStripeCheckoutOptionsResponse, isStripeCheckoutSessionResponse, isStripePortalResponse, StripeCancelResponseSchema, StripeCheckoutIntentResponseSchema, StripeCheckoutOptionsResponseSchema, StripeCheckoutSessionResponseSchema, StripePortalResponseSchema, StripeSyncOptionResponseSchema, } from "./stripeCheckout.js";
40
40
  export { isSyncWatermark, SyncWatermarkSchema, } from "./syncWatermark.js";
41
+ export { decodeContainerWriterProjection, decodeDocumentWriterProjection, encodeContainerWriterProjection, encodeDocumentWriterProjection, } from "./writerProjectionWire.js";
41
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kCAAkC,GACnC,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,4BAA4B,EAE5B,uBAAuB,EAEvB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EAEzB,0BAA0B,EAC1B,mBAAmB,EAEnB,sBAAsB,EAEtB,4BAA4B,EAE5B,0BAA0B,EAE1B,yBAAyB,EAEzB,2BAA2B,EAG3B,2BAA2B,EAE3B,6BAA6B,GAC9B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EAEvB,+BAA+B,EAE/B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,gCAAgC,EAEhC,kCAAkC,EAElC,2BAA2B,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AiB,CAAC","sourcesContent":["export {\n type AccessManifestBundleWireResponse,\n isAccessManifestBundleWireResponse,\n} from \"../util\";\nexport {\n type EffectiveAccessLevel,\n EffectiveAccessLevelSchema,\n isEffectiveAccessLevel,\n} from \"./accessLevel\";\nexport {\n type ChallengeErrorResponse,\n ChallengeErrorResponseSchema,\n type ChallengeResponse,\n ChallengeResponseSchema,\n type DestroySessionResponse,\n DestroySessionResponseSchema,\n isChallengeErrorResponse,\n isChallengeResponse,\n isDestroySessionResponse,\n isListSessionsResponse,\n isSessionRefreshRequiredFailure,\n isUserIdentityResponse,\n isUserSessionResponse,\n isVerifyResponse,\n isWebSocketTicketResponse,\n type ListSessionsResponse,\n ListSessionsResponseSchema,\n SESSION_ERROR_CODES,\n type SessionErrorCode,\n SessionErrorCodeSchema,\n type SessionFailureResponse,\n SessionFailureResponseSchema,\n type UserIdentityResponse,\n UserIdentityResponseSchema,\n type UserSessionResponse,\n UserSessionResponseSchema,\n type VerifyFailureResponse,\n VerifyFailureResponseSchema,\n type VerifyResponse,\n type VerifySuccessResponse,\n VerifySuccessResponseSchema,\n type WebSocketTicketResponse,\n WebSocketTicketResponseSchema,\n} from \"./auth\";\nexport {\n isRevenueCatWebhookResponse,\n isStripeWebhookResponse,\n type RevenueCatWebhookResponse,\n RevenueCatWebhookResponseSchema,\n type StripeWebhookResponse,\n StripeWebhookResponseSchema,\n} from \"./billingWebhooks\";\nexport {\n type BlobAttachmentBindResponse,\n BlobAttachmentBindResponseSchema,\n type BlobAttachmentDetachResponse,\n BlobAttachmentDetachResponseSchema,\n type BlobAttachmentSummary,\n BlobAttachmentSummarySchema,\n type BlobContentKeyBundleResponse,\n BlobContentKeyBundleResponseSchema,\n type BlobContentKeyTargetEnvelopeResponse,\n BlobContentKeyTargetEnvelopeResponseSchema,\n type BlobKekTargetsResponse,\n BlobKekTargetsResponseSchema,\n type CompleteMultipartBlobStageResponse,\n CompleteMultipartBlobStageResponseSchema,\n type InitiateMultipartBlobStageResponse,\n InitiateMultipartBlobStageResponseSchema,\n isBlobAttachmentBindResponse,\n isBlobAttachmentDetachResponse,\n isCompleteMultipartBlobStageResponse,\n isInitiateMultipartBlobStageResponse,\n isListDocumentAttachmentsResponse,\n isMultipartBlobStageStatusResponse,\n isUploadMultipartBlobPartResponse,\n type ListDocumentAttachmentsResponse,\n ListDocumentAttachmentsResponseSchema,\n type MultipartBlobStagePart,\n MultipartBlobStagePartSchema,\n type MultipartBlobStageStatusResponse,\n MultipartBlobStageStatusResponseSchema,\n type UploadMultipartBlobPartResponse,\n UploadMultipartBlobPartResponseSchema,\n} from \"./blob\";\nexport {\n BLOB_MUTATION_ERROR_CODES,\n type BlobMutationErrorCode,\n type BlobMutationFailureResponse,\n BlobMutationFailureResponseSchema,\n} from \"./blobMutationError\";\nexport {\n CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE,\n type ContainerDeleteResponse,\n ContainerDeleteResponseSchema,\n type ContainerKekKeyringWireResponse,\n type ContainerKekLogEpochResponse,\n ContainerKekLogEpochResponseSchema,\n type ContainerKekLogResponse,\n ContainerKekLogResponseSchema,\n type ContainerKekResponse,\n type ContainerKeyingPathResponse,\n ContainerKeyingPathResponseSchema,\n type ContainerMutationResponse,\n ContainerMutationResponseSchema,\n type ContainerReciteResponse,\n ContainerReciteResponseSchema,\n type ContainerRotationResponse,\n ContainerRotationResponseSchema,\n type ContainerSummary,\n ContainerSummaryResponseSchema,\n type ContainerSyncTombstone,\n ContainerSyncTombstoneResponseSchema,\n ContainerWriterProjectionErrorResponseSchema,\n type ContainerWriterProjectionResponse,\n ContainerWriterProjectionResponseSchema,\n isContainerDeleteResponse,\n isContainerKekLogResponse,\n isContainerMutationResponse,\n isContainerReciteResponse,\n isContainerRotationResponse,\n isContainerWriterProjectionResponse,\n isListContainersResponse,\n type ListContainersResponse,\n ListContainersResponseSchema,\n} from \"./container\";\nexport {\n type ContainerCreateWithMetadataDocumentResponse,\n ContainerCreateWithMetadataDocumentResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n} from \"./containerMetadata\";\nexport {\n CONTAINER_MUTATION_ERROR_CODES,\n ContainerMutationBehaviorErrorCodeSchema,\n type ContainerMutationErrorCode,\n ContainerMutationErrorCodeSchema,\n type ContainerMutationFailureResponse,\n ContainerMutationFailureResponseSchema,\n} from \"./containerMutationError\";\nexport {\n CONTAINER_NOT_FOUND_ERROR_CODE,\n type ContainerNotFoundErrorResponse,\n ContainerNotFoundErrorResponseSchema,\n} from \"./containerNotFoundError\";\nexport {\n isListContainerParentLanesResponse,\n type ListContainerParentLanesResponse,\n ListContainerParentLanesResponseSchema,\n} from \"./containerParentLanes\";\nexport {\n CONTAINER_UNAVAILABLE_ERROR_CODE,\n type ContainerUnavailableErrorCode,\n} from \"./containerUnavailableError\";\nexport {\n type ContainerDocumentSummary,\n ContainerDocumentSummaryResponseSchema,\n type ContainerDocumentSyncTombstone,\n ContainerDocumentSyncTombstoneResponseSchema,\n type DocumentEditAttributionRangeResponse,\n DocumentEditAttributionRangeResponseSchema,\n type DocumentEditAttributionResponse,\n DocumentEditAttributionResponseSchema,\n type DocumentEditAttributionSegmentResponse,\n DocumentEditAttributionSegmentResponseSchema,\n isDocumentEditAttributionResponse,\n isListContainerDocumentsResponse,\n isListDocumentEditAttributionRangesResponse,\n type ListContainerDocumentsResponse,\n ListContainerDocumentsResponseSchema,\n type ListDocumentEditAttributionRangesResponse,\n ListDocumentEditAttributionRangesResponseSchema,\n} from \"./document\";\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentCreateResponse,\n DocumentCreateResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentLinkSetMutationResponse,\n DocumentLinkSetMutationResponseSchema,\n type DocumentPurgeProofResponse,\n DocumentPurgeProofResponseSchema,\n type DocumentPurgeResponse,\n DocumentPurgeResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n type DocumentWriterProjectionResponse,\n DocumentWriterProjectionResponseSchema,\n documentKekTargetsFromContentKeyBundle,\n isDocumentContentKeyBundleResponse,\n isDocumentCreateResponse,\n isDocumentKekTargetsResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n isDocumentSyncResponse,\n isDocumentWriterProjectionResponse,\n} from \"./documentMutation\";\nexport {\n DOCUMENT_MUTATION_ERROR_CODES,\n DocumentMutationBehaviorErrorCodeSchema,\n type DocumentMutationErrorCode,\n DocumentMutationErrorCodeSchema,\n type DocumentMutationFailureResponse,\n DocumentMutationFailureResponseSchema,\n} from \"./documentMutationError\";\nexport {\n DOCUMENT_NOT_FOUND_ERROR_CODE,\n DOCUMENT_PROJECTION_ERROR_CODES,\n DOCUMENT_SYNC_ERROR_CODES,\n type DocumentNotFoundErrorCode,\n type DocumentNotFoundErrorResponse,\n DocumentNotFoundErrorResponseSchema,\n type DocumentProjectionErrorCode,\n DocumentProjectionErrorCodeSchema,\n type DocumentSyncErrorCode,\n DocumentSyncErrorCodeSchema,\n type DocumentSyncErrorResponse,\n DocumentSyncErrorResponseSchema,\n type DocumentSyncStateStaleErrorResponse,\n DocumentSyncStateStaleErrorResponseSchema,\n type DocumentWriterProjectionErrorResponse,\n DocumentWriterProjectionErrorResponseSchema,\n isDocumentSyncErrorCode,\n isDocumentSyncErrorResponse,\n isDocumentSyncStateStaleErrorResponse,\n} from \"./documentSyncError\";\nexport {\n type ErrorResponse,\n ErrorResponseSchema,\n isErrorResponse,\n} from \"./error\";\nexport {\n type HealthResponse,\n HealthResponseSchema,\n isHealthResponse,\n} from \"./health\";\nexport {\n MULTIPART_BLOB_STAGE_ERROR_CODES,\n type MultipartBlobStageConflictErrorResponse,\n MultipartBlobStageConflictErrorResponseSchema,\n type MultipartBlobStageErrorCode,\n type MultipartBlobStageExpiredErrorResponse,\n MultipartBlobStageExpiredErrorResponseSchema,\n type MultipartBlobStageNotFoundErrorResponse,\n MultipartBlobStageNotFoundErrorResponseSchema,\n} from \"./multipartBlobStageError\";\nexport {\n type CreateOrganizationGroupResponse,\n CreateOrganizationGroupResponseSchema,\n type DeleteOrganizationGroupResponse,\n DeleteOrganizationGroupResponseSchema,\n isCreateOrganizationGroupResponse,\n isDeleteOrganizationGroupResponse,\n isListOrganizationGroupsResponse,\n isOrganizationContainerGrantResponse,\n isOrganizationContainerGrantSubjectType,\n isOrganizationContainerGrantsResponse,\n isOrganizationDirectoryResponse,\n isOrganizationDirectoryUserResponse,\n isOrganizationGroupContainerAccessLevel,\n isOrganizationGroupContainerResponse,\n isOrganizationGroupContainersResponse,\n isOrganizationGroupCurrentStateResponse,\n isOrganizationGroupMemberResponse,\n isOrganizationGroupMembersResponse,\n isOrganizationGroupSummaryResponse,\n isOrganizationProfileResponse,\n isOrganizationUserDetailGrantsResponse,\n isOrganizationUserDetailResponse,\n type ListOrganizationGroupsResponse,\n ListOrganizationGroupsResponseSchema,\n type OrganizationContainerGrantResponse,\n OrganizationContainerGrantResponseSchema,\n type OrganizationContainerGrantSubjectType,\n type OrganizationContainerGrantsResponse,\n OrganizationContainerGrantsResponseSchema,\n type OrganizationDirectoryResponse,\n OrganizationDirectoryResponseSchema,\n type OrganizationDirectoryUserResponse,\n OrganizationDirectoryUserResponseSchema,\n type OrganizationGroupContainerAccessLevel,\n type OrganizationGroupContainerResponse,\n OrganizationGroupContainerResponseSchema,\n type OrganizationGroupContainersResponse,\n OrganizationGroupContainersResponseSchema,\n type OrganizationGroupCurrentStateResponse,\n OrganizationGroupCurrentStateResponseSchema,\n type OrganizationGroupMemberResponse,\n OrganizationGroupMemberResponseSchema,\n type OrganizationGroupMembersResponse,\n OrganizationGroupMembersResponseSchema,\n type OrganizationGroupSummaryResponse,\n OrganizationGroupSummaryResponseSchema,\n type OrganizationProfileResponse,\n OrganizationProfileResponseSchema,\n type OrganizationRole,\n type OrganizationRosterStatus,\n type OrganizationUserDetailGrantsResponse,\n OrganizationUserDetailGrantsResponseSchema,\n type OrganizationUserDetailResponse,\n OrganizationUserDetailResponseSchema,\n} from \"./organization\";\nexport {\n type BillingErrorResponse,\n BillingErrorResponseSchema,\n isOrganizationBillingProvider,\n isOrganizationBillingResponse,\n isOrganizationBillingStatus,\n isPaymentRequiredErrorResponse,\n type OrganizationBillingProvider,\n OrganizationBillingProviderSchema,\n type OrganizationBillingResponse,\n OrganizationBillingResponseSchema,\n type OrganizationBillingStatus,\n OrganizationBillingStatusSchema,\n type OrganizationBillingSubscriptionSource,\n OrganizationBillingSubscriptionSourceSchema,\n type PaymentRequiredErrorResponse,\n PaymentRequiredErrorResponseSchema,\n} from \"./organizationBilling\";\nexport {\n isOrganizationBillingHistoryResponse,\n type OrganizationBillingHistoryCategory,\n OrganizationBillingHistoryCategorySchema,\n type OrganizationBillingHistoryEntry,\n OrganizationBillingHistoryEntrySchema,\n type OrganizationBillingHistoryEnvironment,\n OrganizationBillingHistoryEnvironmentSchema,\n type OrganizationBillingHistoryOutcome,\n OrganizationBillingHistoryOutcomeSchema,\n type OrganizationBillingHistoryProvider,\n OrganizationBillingHistoryProviderSchema,\n type OrganizationBillingHistoryResponse,\n OrganizationBillingHistoryResponseSchema,\n} from \"./organizationBillingHistory\";\nexport {\n isOrganizationBillingManagementUrlResponse,\n type OrganizationBillingManagementUrlResponse,\n OrganizationBillingManagementUrlResponseSchema,\n} from \"./organizationBillingManagementUrl\";\nexport {\n isOrganizationDataUsageResponse,\n ORGANIZATION_DOCUMENT_USAGE_CATEGORIES,\n type OrganizationBlobDataUsageResponse,\n type OrganizationDataUsageResponse,\n OrganizationDataUsageResponseSchema,\n type OrganizationDocumentDataUsageResponse,\n type OrganizationDocumentUsageCategory,\n type OrganizationDocumentUsageCategoryBreakdown,\n} from \"./organizationDataUsage\";\nexport {\n isOrganizationNativePurchaseEligibilityResponse,\n type OrganizationNativePurchaseEligibilityResponse,\n OrganizationNativePurchaseEligibilityResponseSchema,\n type OrganizationNativePurchaseIneligibilityReason,\n OrganizationNativePurchaseIneligibilityReasonSchema,\n} from \"./organizationNativePurchaseEligibility\";\nexport {\n type OrganizationPolicyHistoryResponse,\n OrganizationPolicyHistoryResponseSchema,\n PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE,\n} from \"./organizationPolicyHistory\";\nexport {\n ORGANIZATION_PRESENTATION_ERROR_CODES,\n type OrganizationPresentationErrorCode,\n OrganizationPresentationErrorCodeSchema,\n type OrganizationPresentationFailureResponse,\n OrganizationPresentationFailureResponseSchema,\n} from \"./organizationPresentationError\";\nexport {\n type CreateOrganizationResponse,\n CreateOrganizationResponseSchema,\n isCreateOrganizationResponse,\n isOrganizationProvisioningResponse,\n type OrganizationProvisioningResponse,\n OrganizationProvisioningResponseSchema,\n} from \"./organizationProvisioning\";\nexport {\n isOrganizationReadModelResponse,\n type OrganizationReadModelDeltaResponse,\n type OrganizationReadModelDirectoryResponse,\n type OrganizationReadModelGrantsResponse,\n type OrganizationReadModelGroupMemberResponse,\n type OrganizationReadModelGroupMembershipResponse,\n type OrganizationReadModelGroupMembershipsResponse,\n type OrganizationReadModelOrganizationPolicyResponse,\n type OrganizationReadModelResponse,\n OrganizationReadModelResponseSchema,\n type OrganizationReadModelSnapshotResponse,\n} from \"./organizationReadModel\";\nexport {\n ORGANIZATION_READ_MODEL_ERROR_CODES,\n type OrganizationReadModelErrorCode,\n OrganizationReadModelErrorCodeSchema,\n type OrganizationReadModelFailureResponse,\n OrganizationReadModelFailureResponseSchema,\n} from \"./organizationReadModelError\";\nexport {\n CommitOrganizationGroupPolicyConflictResponseSchema,\n type CommitOrganizationGroupPolicyResponse,\n CommitOrganizationGroupPolicyResponseSchema,\n type CurrentPrincipalMemberEnvelopesResponse,\n CurrentPrincipalMemberEnvelopesResponseSchema,\n isCommitOrganizationGroupPolicyResponse,\n isCurrentPrincipalMemberEnvelopesResponse,\n isPrincipalPolicyBundleResponse,\n isPrincipalPolicyMutationResponse,\n isPrincipalPolicyStaleErrorResponse,\n isPrincipalPolicyStateChainEntryResponse,\n isPrincipalStatePayloadResponse,\n isPrincipalStateResponse,\n type PrincipalContainerGrantResponse,\n PrincipalContainerGrantResponseSchema,\n type PrincipalMemberEnvelopeResponse,\n PrincipalMemberEnvelopeResponseSchema,\n type PrincipalPolicyBundleResponse,\n PrincipalPolicyBundleResponseSchema,\n type PrincipalPolicyErrorResponse,\n PrincipalPolicyErrorResponseSchema,\n type PrincipalPolicyMutationResponse,\n PrincipalPolicyMutationResponseSchema,\n type PrincipalPolicySnapshotResponse,\n PrincipalPolicySnapshotResponseSchema,\n type PrincipalPolicyStaleErrorResponse,\n PrincipalPolicyStaleErrorResponseSchema,\n type PrincipalPolicyStateChainEntryResponse,\n PrincipalPolicyStateChainEntryResponseSchema,\n type PrincipalProjectionMemberResponse,\n PrincipalProjectionMemberResponseSchema,\n type PrincipalStateExternalAuthorityResponse,\n PrincipalStateExternalAuthorityResponseSchema,\n type PrincipalStatePayloadResponse,\n PrincipalStatePayloadResponseSchema,\n type PrincipalStateResponse,\n PrincipalStateResponseSchema,\n} from \"./principal\";\nexport {\n isPrincipalPolicyPageResponse,\n type PrincipalPolicyPageResponse,\n PrincipalPolicyPageResponseSchema,\n} from \"./principalPolicyPage\";\nexport {\n isPrincipalPolicySnapshotPageResponse,\n type PrincipalPolicyHistorySourceResponse,\n PrincipalPolicyHistorySourceResponseSchema,\n type PrincipalPolicySnapshotPageResponse,\n PrincipalPolicySnapshotPageResponseSchema,\n} from \"./principalPolicySnapshotPage\";\nexport {\n isReferencedPrincipalStateResponse,\n type ReferencedPrincipalStateResponse,\n ReferencedPrincipalStateResponseSchema,\n} from \"./principalReference\";\nexport {\n type ProjectionPolicyEvidenceResponse,\n ProjectionPolicyEvidenceResponseSchema,\n} from \"./projectionPolicyEvidence\";\nexport {\n isRegistrationResponse,\n type RegistrationResponse,\n RegistrationResponseSchema,\n} from \"./registration\";\nexport {\n isRootIdentitiesResponse,\n isRootIdentityDetailResponse,\n isRootIdentityOrganizationsResponse,\n type RootIdentitiesResponse,\n RootIdentitiesResponseSchema,\n type RootIdentityDetailResponse,\n RootIdentityDetailResponseSchema,\n type RootIdentityOrganizationBillingResponse,\n RootIdentityOrganizationBillingResponseSchema,\n type RootIdentityOrganizationResponse,\n RootIdentityOrganizationResponseSchema,\n type RootIdentityOrganizationsResponse,\n RootIdentityOrganizationsResponseSchema,\n type RootIdentitySessionResponse,\n RootIdentitySessionResponseSchema,\n type RootIdentitySummaryResponse,\n RootIdentitySummaryResponseSchema,\n} from \"./root\";\nexport {\n type RootDataUsageReportResponse,\n RootDataUsageReportResponseSchema,\n type RootOrganizationDetailResponse,\n RootOrganizationDetailResponseSchema,\n type RootOrganizationIdentitiesResponse,\n RootOrganizationIdentitiesResponseSchema,\n type RootOrganizationIdentityResponse,\n RootOrganizationIdentityResponseSchema,\n type RootOrganizationSummaryResponse,\n RootOrganizationSummaryResponseSchema,\n type RootOrganizationsResponse,\n RootOrganizationsResponseSchema,\n} from \"./rootOrganizations\";\nexport {\n isStripeCancelResponse,\n isStripeCheckoutIntentResponse,\n isStripeCheckoutOptionsResponse,\n isStripeCheckoutSessionResponse,\n isStripePortalResponse,\n type StripeCancelResponse,\n StripeCancelResponseSchema,\n type StripeCheckoutIntentResponse,\n StripeCheckoutIntentResponseSchema,\n type StripeCheckoutOptionsResponse,\n StripeCheckoutOptionsResponseSchema,\n type StripeCheckoutSessionResponse,\n StripeCheckoutSessionResponseSchema,\n type StripePortalResponse,\n StripePortalResponseSchema,\n type StripeSyncOptionResponse,\n StripeSyncOptionResponseSchema,\n} from \"./stripeCheckout\";\nexport {\n isSyncWatermark,\n type SyncWatermark,\n SyncWatermarkSchema,\n} from \"./syncWatermark\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,E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C;AACpC,OAAO,EACL,sBAAsB,EAEtB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,mCAAmC,EAEnC,4BAA4B,EAE5B,gCAAgC,EAEhC,6CAA6C,EAE7C,sCAAsC,EAEtC,uCAAuC,EAEvC,iCAAiC,EAEjC,iCAAiC,GAClC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,iCAAiC,EAEjC,oCAAoC,EAEpC,wCAAwC,EAExC,sCAAsC,EAEtC,qCAAqC,EAErC,+BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,sBAAsB,EAEtB,0BAA0B,EAE1B,kCAAkC,EAElC,mCAAmC,EAEnC,mCAAmC,EAEnC,0BAA0B,EAE1B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EAEf,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC","sourcesContent":["export {\n type AccessManifestBundleWireResponse,\n isAccessManifestBundleWireResponse,\n} from \"../util\";\nexport {\n type EffectiveAccessLevel,\n EffectiveAccessLevelSchema,\n isEffectiveAccessLevel,\n} from \"./accessLevel\";\nexport {\n type ChallengeErrorResponse,\n ChallengeErrorResponseSchema,\n type ChallengeResponse,\n ChallengeResponseSchema,\n type DestroySessionResponse,\n DestroySessionResponseSchema,\n isChallengeErrorResponse,\n isChallengeResponse,\n isDestroySessionResponse,\n isListSessionsResponse,\n isSessionRefreshRequiredFailure,\n isUserIdentityResponse,\n isUserSessionResponse,\n isVerifyResponse,\n isWebSocketTicketResponse,\n type ListSessionsResponse,\n ListSessionsResponseSchema,\n SESSION_ERROR_CODES,\n type SessionErrorCode,\n SessionErrorCodeSchema,\n type SessionFailureResponse,\n SessionFailureResponseSchema,\n type UserIdentityResponse,\n UserIdentityResponseSchema,\n type UserSessionResponse,\n UserSessionResponseSchema,\n type VerifyFailureResponse,\n VerifyFailureResponseSchema,\n type VerifyResponse,\n type VerifySuccessResponse,\n VerifySuccessResponseSchema,\n type WebSocketTicketResponse,\n WebSocketTicketResponseSchema,\n} from \"./auth\";\nexport {\n isRevenueCatWebhookResponse,\n isStripeWebhookResponse,\n type RevenueCatWebhookResponse,\n RevenueCatWebhookResponseSchema,\n type StripeWebhookResponse,\n StripeWebhookResponseSchema,\n} from \"./billingWebhooks\";\nexport {\n type BlobAttachmentBindResponse,\n BlobAttachmentBindResponseSchema,\n type BlobAttachmentDetachResponse,\n BlobAttachmentDetachResponseSchema,\n type BlobAttachmentSummary,\n BlobAttachmentSummarySchema,\n type BlobContentKeyBundleResponse,\n BlobContentKeyBundleResponseSchema,\n type BlobContentKeyTargetEnvelopeResponse,\n BlobContentKeyTargetEnvelopeResponseSchema,\n type BlobKekTargetsResponse,\n BlobKekTargetsResponseSchema,\n type InitiateMultipartBlobStageResponse,\n InitiateMultipartBlobStageResponseSchema,\n isBlobAttachmentBindResponse,\n isBlobAttachmentDetachResponse,\n isInitiateMultipartBlobStageResponse,\n isListDocumentAttachmentsResponse,\n isMultipartBlobStageStatusResponse,\n isUploadMultipartBlobPartResponse,\n type ListDocumentAttachmentsResponse,\n ListDocumentAttachmentsResponseSchema,\n type MultipartBlobStagePart,\n MultipartBlobStagePartSchema,\n type MultipartBlobStageStatusResponse,\n MultipartBlobStageStatusResponseSchema,\n type UploadMultipartBlobPartResponse,\n UploadMultipartBlobPartResponseSchema,\n} from \"./blob\";\nexport {\n BLOB_MUTATION_ERROR_CODES,\n type BlobMutationErrorCode,\n type BlobMutationFailureResponse,\n BlobMutationFailureResponseSchema,\n} from \"./blobMutationError\";\nexport {\n CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE,\n type ContainerDeleteResponse,\n ContainerDeleteResponseSchema,\n type ContainerKekKeyringWireResponse,\n type ContainerKekLogEpochResponse,\n ContainerKekLogEpochResponseSchema,\n type ContainerKekLogResponse,\n ContainerKekLogResponseSchema,\n type ContainerKekResponse,\n type ContainerKeyingPathResponse,\n ContainerKeyingPathResponseSchema,\n type ContainerMutationResponse,\n ContainerMutationResponseSchema,\n type ContainerReciteResponse,\n ContainerReciteResponseSchema,\n type ContainerRotationResponse,\n ContainerRotationResponseSchema,\n type ContainerSummary,\n ContainerSummaryResponseSchema,\n type ContainerSyncTombstone,\n ContainerSyncTombstoneResponseSchema,\n ContainerWriterProjectionErrorResponseSchema,\n type ContainerWriterProjectionResponse,\n ContainerWriterProjectionResponseSchema,\n type ContainerWriterProjectionWireResponse,\n ContainerWriterProjectionWireResponseSchema,\n isContainerDeleteResponse,\n isContainerKekLogResponse,\n isContainerMutationResponse,\n isContainerReciteResponse,\n isContainerRotationResponse,\n isContainerWriterProjectionResponse,\n isContainerWriterProjectionWireResponse,\n isListContainersResponse,\n type ListContainersResponse,\n ListContainersResponseSchema,\n} from \"./container\";\nexport {\n type ContainerCreateWithMetadataDocumentResponse,\n ContainerCreateWithMetadataDocumentResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n} from \"./containerMetadata\";\nexport {\n CONTAINER_MUTATION_ERROR_CODES,\n ContainerMutationBehaviorErrorCodeSchema,\n type ContainerMutationErrorCode,\n ContainerMutationErrorCodeSchema,\n type ContainerMutationFailureResponse,\n ContainerMutationFailureResponseSchema,\n} from \"./containerMutationError\";\nexport {\n CONTAINER_NOT_FOUND_ERROR_CODE,\n type ContainerNotFoundErrorResponse,\n ContainerNotFoundErrorResponseSchema,\n} from \"./containerNotFoundError\";\nexport {\n isListContainerParentLanesResponse,\n type ListContainerParentLanesResponse,\n ListContainerParentLanesResponseSchema,\n} from \"./containerParentLanes\";\nexport {\n CONTAINER_UNAVAILABLE_ERROR_CODE,\n type ContainerUnavailableErrorCode,\n} from \"./containerUnavailableError\";\nexport {\n type ContainerDocumentSummary,\n ContainerDocumentSummaryResponseSchema,\n type ContainerDocumentSyncTombstone,\n ContainerDocumentSyncTombstoneResponseSchema,\n type DocumentEditAttributionRangeResponse,\n DocumentEditAttributionRangeResponseSchema,\n type DocumentEditAttributionResponse,\n DocumentEditAttributionResponseSchema,\n type DocumentEditAttributionSegmentResponse,\n DocumentEditAttributionSegmentResponseSchema,\n isDocumentEditAttributionResponse,\n isListContainerDocumentsResponse,\n isListDocumentEditAttributionRangesResponse,\n type ListContainerDocumentsResponse,\n ListContainerDocumentsResponseSchema,\n type ListDocumentEditAttributionRangesResponse,\n ListDocumentEditAttributionRangesResponseSchema,\n} from \"./document\";\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentCreateResponse,\n DocumentCreateResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentLinkSetMutationResponse,\n DocumentLinkSetMutationResponseSchema,\n type DocumentPurgeProofResponse,\n DocumentPurgeProofResponseSchema,\n type DocumentPurgeResponse,\n DocumentPurgeResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n type DocumentWriterProjectionResponse,\n DocumentWriterProjectionResponseSchema,\n type DocumentWriterProjectionWireResponse,\n DocumentWriterProjectionWireResponseSchema,\n documentKekTargetsFromContentKeyBundle,\n isDocumentContentKeyBundleResponse,\n isDocumentCreateResponse,\n isDocumentKekTargetsResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n isDocumentSyncResponse,\n isDocumentWriterProjectionResponse,\n isDocumentWriterProjectionWireResponse,\n} from \"./documentMutation\";\nexport {\n DOCUMENT_MUTATION_ERROR_CODES,\n DocumentMutationBehaviorErrorCodeSchema,\n type DocumentMutationErrorCode,\n DocumentMutationErrorCodeSchema,\n type DocumentMutationFailureResponse,\n DocumentMutationFailureResponseSchema,\n} from \"./documentMutationError\";\nexport {\n DOCUMENT_NOT_FOUND_ERROR_CODE,\n DOCUMENT_PROJECTION_ERROR_CODES,\n DOCUMENT_SYNC_ERROR_CODES,\n type DocumentNotFoundErrorCode,\n type DocumentNotFoundErrorResponse,\n DocumentNotFoundErrorResponseSchema,\n type DocumentProjectionErrorCode,\n DocumentProjectionErrorCodeSchema,\n type DocumentSyncErrorCode,\n DocumentSyncErrorCodeSchema,\n type DocumentSyncErrorResponse,\n DocumentSyncErrorResponseSchema,\n type DocumentSyncStateStaleErrorResponse,\n DocumentSyncStateStaleErrorResponseSchema,\n type DocumentWriterProjectionErrorResponse,\n DocumentWriterProjectionErrorResponseSchema,\n isDocumentSyncErrorCode,\n isDocumentSyncErrorResponse,\n isDocumentSyncStateStaleErrorResponse,\n} from \"./documentSyncError\";\nexport {\n type ErrorResponse,\n ErrorResponseSchema,\n isErrorResponse,\n} from \"./error\";\nexport {\n type HealthResponse,\n HealthResponseSchema,\n isHealthResponse,\n} from \"./health\";\nexport {\n MULTIPART_BLOB_STAGE_ERROR_CODES,\n type MultipartBlobStageConflictErrorResponse,\n MultipartBlobStageConflictErrorResponseSchema,\n type MultipartBlobStageErrorCode,\n type MultipartBlobStageExpiredErrorResponse,\n MultipartBlobStageExpiredErrorResponseSchema,\n type MultipartBlobStageNotFoundErrorResponse,\n MultipartBlobStageNotFoundErrorResponseSchema,\n} from \"./multipartBlobStageError\";\nexport {\n type CreateOrganizationGroupResponse,\n CreateOrganizationGroupResponseSchema,\n type DeleteOrganizationGroupResponse,\n DeleteOrganizationGroupResponseSchema,\n isCreateOrganizationGroupResponse,\n isDeleteOrganizationGroupResponse,\n isListOrganizationGroupsResponse,\n isOrganizationContainerGrantResponse,\n isOrganizationContainerGrantSubjectType,\n isOrganizationContainerGrantsResponse,\n isOrganizationDirectoryResponse,\n isOrganizationDirectoryUserResponse,\n isOrganizationGroupContainerAccessLevel,\n isOrganizationGroupContainerResponse,\n isOrganizationGroupContainersResponse,\n isOrganizationGroupCurrentStateResponse,\n isOrganizationGroupMemberResponse,\n isOrganizationGroupMembersResponse,\n isOrganizationGroupSummaryResponse,\n isOrganizationProfileResponse,\n isOrganizationUserDetailGrantsResponse,\n isOrganizationUserDetailResponse,\n type ListOrganizationGroupsResponse,\n ListOrganizationGroupsResponseSchema,\n type OrganizationContainerGrantResponse,\n OrganizationContainerGrantResponseSchema,\n type OrganizationContainerGrantSubjectType,\n type OrganizationContainerGrantsResponse,\n OrganizationContainerGrantsResponseSchema,\n type OrganizationDirectoryResponse,\n OrganizationDirectoryResponseSchema,\n type OrganizationDirectoryUserResponse,\n OrganizationDirectoryUserResponseSchema,\n type OrganizationGroupContainerAccessLevel,\n type OrganizationGroupContainerResponse,\n OrganizationGroupContainerResponseSchema,\n type OrganizationGroupContainersResponse,\n OrganizationGroupContainersResponseSchema,\n type OrganizationGroupCurrentStateResponse,\n OrganizationGroupCurrentStateResponseSchema,\n type OrganizationGroupMemberResponse,\n OrganizationGroupMemberResponseSchema,\n type OrganizationGroupMembersResponse,\n OrganizationGroupMembersResponseSchema,\n type OrganizationGroupSummaryResponse,\n OrganizationGroupSummaryResponseSchema,\n type OrganizationProfileResponse,\n OrganizationProfileResponseSchema,\n type OrganizationRole,\n type OrganizationRosterStatus,\n type OrganizationUserDetailGrantsResponse,\n OrganizationUserDetailGrantsResponseSchema,\n type OrganizationUserDetailResponse,\n OrganizationUserDetailResponseSchema,\n} from \"./organization\";\nexport {\n type BillingErrorResponse,\n BillingErrorResponseSchema,\n isOrganizationBillingProvider,\n isOrganizationBillingResponse,\n isOrganizationBillingStatus,\n isPaymentRequiredErrorResponse,\n type OrganizationBillingProvider,\n OrganizationBillingProviderSchema,\n type OrganizationBillingResponse,\n OrganizationBillingResponseSchema,\n type OrganizationBillingStatus,\n OrganizationBillingStatusSchema,\n type OrganizationBillingSubscriptionSource,\n OrganizationBillingSubscriptionSourceSchema,\n type PaymentRequiredErrorResponse,\n PaymentRequiredErrorResponseSchema,\n} from \"./organizationBilling\";\nexport {\n isOrganizationBillingHistoryResponse,\n type OrganizationBillingHistoryCategory,\n OrganizationBillingHistoryCategorySchema,\n type OrganizationBillingHistoryEntry,\n OrganizationBillingHistoryEntrySchema,\n type OrganizationBillingHistoryEnvironment,\n OrganizationBillingHistoryEnvironmentSchema,\n type OrganizationBillingHistoryOutcome,\n OrganizationBillingHistoryOutcomeSchema,\n type OrganizationBillingHistoryProvider,\n OrganizationBillingHistoryProviderSchema,\n type OrganizationBillingHistoryResponse,\n OrganizationBillingHistoryResponseSchema,\n} from \"./organizationBillingHistory\";\nexport {\n isOrganizationBillingManagementUrlResponse,\n type OrganizationBillingManagementUrlResponse,\n OrganizationBillingManagementUrlResponseSchema,\n} from \"./organizationBillingManagementUrl\";\nexport {\n isOrganizationDataUsageResponse,\n ORGANIZATION_DOCUMENT_USAGE_CATEGORIES,\n type OrganizationBlobDataUsageResponse,\n type OrganizationDataUsageResponse,\n OrganizationDataUsageResponseSchema,\n type OrganizationDocumentDataUsageResponse,\n type OrganizationDocumentUsageCategory,\n type OrganizationDocumentUsageCategoryBreakdown,\n} from \"./organizationDataUsage\";\nexport {\n isOrganizationNativePurchaseEligibilityResponse,\n type OrganizationNativePurchaseEligibilityResponse,\n OrganizationNativePurchaseEligibilityResponseSchema,\n type OrganizationNativePurchaseIneligibilityReason,\n OrganizationNativePurchaseIneligibilityReasonSchema,\n} from \"./organizationNativePurchaseEligibility\";\nexport {\n type OrganizationPolicyHistoryResponse,\n OrganizationPolicyHistoryResponseSchema,\n PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE,\n} from \"./organizationPolicyHistory\";\nexport {\n ORGANIZATION_PRESENTATION_ERROR_CODES,\n type OrganizationPresentationErrorCode,\n OrganizationPresentationErrorCodeSchema,\n type OrganizationPresentationFailureResponse,\n OrganizationPresentationFailureResponseSchema,\n} from \"./organizationPresentationError\";\nexport {\n type CreateOrganizationResponse,\n CreateOrganizationResponseSchema,\n isCreateOrganizationResponse,\n isOrganizationProvisioningResponse,\n type OrganizationProvisioningResponse,\n OrganizationProvisioningResponseSchema,\n} from \"./organizationProvisioning\";\nexport {\n isOrganizationReadModelResponse,\n type OrganizationReadModelDeltaResponse,\n type OrganizationReadModelDirectoryResponse,\n type OrganizationReadModelGrantsResponse,\n type OrganizationReadModelGroupMemberResponse,\n type OrganizationReadModelGroupMembershipResponse,\n type OrganizationReadModelGroupMembershipsResponse,\n type OrganizationReadModelOrganizationPolicyResponse,\n type OrganizationReadModelResponse,\n OrganizationReadModelResponseSchema,\n type OrganizationReadModelSnapshotResponse,\n} from \"./organizationReadModel\";\nexport {\n ORGANIZATION_READ_MODEL_ERROR_CODES,\n type OrganizationReadModelErrorCode,\n OrganizationReadModelErrorCodeSchema,\n type OrganizationReadModelFailureResponse,\n OrganizationReadModelFailureResponseSchema,\n} from \"./organizationReadModelError\";\nexport {\n CommitOrganizationGroupPolicyConflictResponseSchema,\n type CommitOrganizationGroupPolicyResponse,\n CommitOrganizationGroupPolicyResponseSchema,\n type CurrentPrincipalMemberEnvelopesResponse,\n CurrentPrincipalMemberEnvelopesResponseSchema,\n isCommitOrganizationGroupPolicyResponse,\n isCurrentPrincipalMemberEnvelopesResponse,\n isPrincipalPolicyBundleResponse,\n isPrincipalPolicyMutationResponse,\n isPrincipalPolicyStaleErrorResponse,\n isPrincipalPolicyStateChainEntryResponse,\n isPrincipalStatePayloadResponse,\n isPrincipalStateResponse,\n type PrincipalContainerGrantResponse,\n PrincipalContainerGrantResponseSchema,\n type PrincipalMemberEnvelopeResponse,\n PrincipalMemberEnvelopeResponseSchema,\n type PrincipalPolicyBundleResponse,\n PrincipalPolicyBundleResponseSchema,\n type PrincipalPolicyErrorResponse,\n PrincipalPolicyErrorResponseSchema,\n type PrincipalPolicyMutationResponse,\n PrincipalPolicyMutationResponseSchema,\n type PrincipalPolicySnapshotResponse,\n PrincipalPolicySnapshotResponseSchema,\n type PrincipalPolicyStaleErrorResponse,\n PrincipalPolicyStaleErrorResponseSchema,\n type PrincipalPolicyStateChainEntryResponse,\n PrincipalPolicyStateChainEntryResponseSchema,\n type PrincipalProjectionMemberResponse,\n PrincipalProjectionMemberResponseSchema,\n type PrincipalStateExternalAuthorityResponse,\n PrincipalStateExternalAuthorityResponseSchema,\n type PrincipalStatePayloadResponse,\n PrincipalStatePayloadResponseSchema,\n type PrincipalStateResponse,\n PrincipalStateResponseSchema,\n} from \"./principal\";\nexport {\n isPrincipalPolicyPageResponse,\n type PrincipalPolicyPageResponse,\n PrincipalPolicyPageResponseSchema,\n} from \"./principalPolicyPage\";\nexport {\n isPrincipalPolicySnapshotPageResponse,\n type PrincipalPolicyHistorySourceResponse,\n PrincipalPolicyHistorySourceResponseSchema,\n type PrincipalPolicySnapshotPageResponse,\n PrincipalPolicySnapshotPageResponseSchema,\n} from \"./principalPolicySnapshotPage\";\nexport {\n isReferencedPrincipalStateResponse,\n type ReferencedPrincipalStateResponse,\n ReferencedPrincipalStateResponseSchema,\n} from \"./principalReference\";\nexport {\n type ProjectionPolicyEvidenceResponse,\n ProjectionPolicyEvidenceResponseSchema,\n} from \"./projectionPolicyEvidence\";\nexport {\n isRegistrationResponse,\n type RegistrationResponse,\n RegistrationResponseSchema,\n} from \"./registration\";\nexport {\n isRootIdentitiesResponse,\n isRootIdentityDetailResponse,\n isRootIdentityOrganizationsResponse,\n type RootIdentitiesResponse,\n RootIdentitiesResponseSchema,\n type RootIdentityDetailResponse,\n RootIdentityDetailResponseSchema,\n type RootIdentityOrganizationBillingResponse,\n RootIdentityOrganizationBillingResponseSchema,\n type RootIdentityOrganizationResponse,\n RootIdentityOrganizationResponseSchema,\n type RootIdentityOrganizationsResponse,\n RootIdentityOrganizationsResponseSchema,\n type RootIdentitySessionResponse,\n RootIdentitySessionResponseSchema,\n type RootIdentitySummaryResponse,\n RootIdentitySummaryResponseSchema,\n} from \"./root\";\nexport {\n type RootDataUsageReportResponse,\n RootDataUsageReportResponseSchema,\n type RootOrganizationDetailResponse,\n RootOrganizationDetailResponseSchema,\n type RootOrganizationIdentitiesResponse,\n RootOrganizationIdentitiesResponseSchema,\n type RootOrganizationIdentityResponse,\n RootOrganizationIdentityResponseSchema,\n type RootOrganizationSummaryResponse,\n RootOrganizationSummaryResponseSchema,\n type RootOrganizationsResponse,\n RootOrganizationsResponseSchema,\n} from \"./rootOrganizations\";\nexport {\n isStripeCancelResponse,\n isStripeCheckoutIntentResponse,\n isStripeCheckoutOptionsResponse,\n isStripeCheckoutSessionResponse,\n isStripePortalResponse,\n type StripeCancelResponse,\n StripeCancelResponseSchema,\n type StripeCheckoutIntentResponse,\n StripeCheckoutIntentResponseSchema,\n type StripeCheckoutOptionsResponse,\n StripeCheckoutOptionsResponseSchema,\n type StripeCheckoutSessionResponse,\n StripeCheckoutSessionResponseSchema,\n type StripePortalResponse,\n StripePortalResponseSchema,\n type StripeSyncOptionResponse,\n StripeSyncOptionResponseSchema,\n} from \"./stripeCheckout\";\nexport {\n isSyncWatermark,\n type SyncWatermark,\n SyncWatermarkSchema,\n} from \"./syncWatermark\";\nexport {\n decodeContainerWriterProjection,\n decodeDocumentWriterProjection,\n encodeContainerWriterProjection,\n encodeDocumentWriterProjection,\n} from \"./writerProjectionWire\";\n"]}
@@ -0,0 +1,79 @@
1
+ import { isPlainObject } from "../isPlainObject.js";
2
+ import { arraySchema, nonEmptyStringSchema, plainRecordSchema, } from "../schema.js";
3
+ import { AccessManifestBundleWireResponseSchema } from "../util/index.js";
4
+ /**
5
+ * A writer projection names each access manifest by hash. The bundle for a
6
+ * hash travels once, in `bundles`, however many lists cite it, or not at all
7
+ * when the request cited it as already held (`omittedBundles`).
8
+ */
9
+ export const ManifestHashReferenceSchema = nonEmptyStringSchema;
10
+ export const ManifestBundlesSchema = plainRecordSchema(AccessManifestBundleWireResponseSchema);
11
+ export const OmittedManifestBundlesSchema = arraySchema(ManifestHashReferenceSchema);
12
+ function listed(value) {
13
+ return Array.isArray(value) ? value : [];
14
+ }
15
+ /** Hashes cited by one container keying path: its path and every KEK history. */
16
+ export function containerKeyingPathReferences(path) {
17
+ if (!isPlainObject(path)) {
18
+ return [];
19
+ }
20
+ const { containerKeks, path: manifests } = path;
21
+ return [
22
+ ...listed(manifests),
23
+ ...listed(containerKeks).flatMap((kek) => {
24
+ if (!isPlainObject(kek)) {
25
+ return [];
26
+ }
27
+ const { containerManifestHistory } = kek;
28
+ return listed(containerManifestHistory);
29
+ }),
30
+ ];
31
+ }
32
+ function firstBundleInconsistency(bundles, omitted, cited) {
33
+ const omittedHashes = new Set(omitted);
34
+ if (omittedHashes.size !== omitted.length) {
35
+ return "omittedBundles repeats a manifest hash";
36
+ }
37
+ for (const hash of omitted) {
38
+ if (typeof hash !== "string" || !cited.has(hash)) {
39
+ return `omitted bundle ${String(hash)} is not cited`;
40
+ }
41
+ if (Object.hasOwn(bundles, hash)) {
42
+ return `omitted bundle ${hash} is also served`;
43
+ }
44
+ }
45
+ for (const hash of cited) {
46
+ if (!Object.hasOwn(bundles, hash) && !omittedHashes.has(hash)) {
47
+ return `manifest ${hash} is cited without a bundle`;
48
+ }
49
+ }
50
+ for (const [hash, bundle] of Object.entries(bundles)) {
51
+ if (!isPlainObject(bundle) ||
52
+ Reflect.get(bundle, "manifestHash") !== hash) {
53
+ return `bundle key ${hash} does not match its manifestHash`;
54
+ }
55
+ if (!cited.has(hash)) {
56
+ return `bundle ${hash} is not cited`;
57
+ }
58
+ }
59
+ return null;
60
+ }
61
+ /**
62
+ * Fails closed on the first inconsistency: a cited hash neither served nor
63
+ * declared omitted, a bundle stored under a key other than its own
64
+ * manifestHash, a served or omitted bundle no list cites, or a hash both
65
+ * served and omitted. Whether an omission was requested is the client's
66
+ * check. Refinements may run after field errors, so inputs are unknown.
67
+ */
68
+ export function refineManifestBundleReferences(projection, references, context) {
69
+ const { bundles, omittedBundles } = projection;
70
+ if (!isPlainObject(bundles) || !Array.isArray(omittedBundles)) {
71
+ return;
72
+ }
73
+ const cited = new Set(references.filter((hash) => typeof hash === "string"));
74
+ const message = firstBundleInconsistency(bundles, omittedBundles, cited);
75
+ if (message !== null) {
76
+ context.addIssue({ code: "custom", message, path: ["bundles"] });
77
+ }
78
+ }
79
+ //# sourceMappingURL=manifestBundleReferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestBundleReferences.js","sourceRoot":"","sources":["manifestBundleReferences.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sCAAsC,EAAE,MAAM,SAAS,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AAEhE,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CACpD,sCAAsC,CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,WAAW,CACrD,2BAA2B,CAC5B,CAAC;AAEF,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,6BAA6B,CAAC,IAAa;IACzD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAChD,OAAO;QACL,GAAG,MAAM,CAAC,SAAS,CAAC;QACpB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACvC,IAAI,CAAC,aAAa,CAAC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;YACD,OAAO,cAAc,IAAI,kCAAkC,CAAC;QAC9D,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,OAAO,UAAU,IAAI,eAAe,CAAC;QACvC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,UAA2E,EAC3E,UAA8B,EAC9B,OAAwB;IAExB,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;IAC/C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QAC9D,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CACtE,CAAC;IACF,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;IACzE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;AACH,CAAC","sourcesContent":["import type { z } from \"zod\";\nimport { isPlainObject } from \"../isPlainObject\";\nimport {\n arraySchema,\n nonEmptyStringSchema,\n plainRecordSchema,\n} from \"../schema\";\nimport { AccessManifestBundleWireResponseSchema } from \"../util\";\n\n/**\n * A writer projection names each access manifest by hash. The bundle for a\n * hash travels once, in `bundles`, however many lists cite it, or not at all\n * when the request cited it as already held (`omittedBundles`).\n */\nexport const ManifestHashReferenceSchema = nonEmptyStringSchema;\n\nexport const ManifestBundlesSchema = plainRecordSchema(\n AccessManifestBundleWireResponseSchema,\n);\n\nexport const OmittedManifestBundlesSchema = arraySchema(\n ManifestHashReferenceSchema,\n);\n\nfunction listed(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [];\n}\n\n/** Hashes cited by one container keying path: its path and every KEK history. */\nexport function containerKeyingPathReferences(path: unknown): unknown[] {\n if (!isPlainObject(path)) {\n return [];\n }\n const { containerKeks, path: manifests } = path;\n return [\n ...listed(manifests),\n ...listed(containerKeks).flatMap((kek) => {\n if (!isPlainObject(kek)) {\n return [];\n }\n const { containerManifestHistory } = kek;\n return listed(containerManifestHistory);\n }),\n ];\n}\n\nfunction firstBundleInconsistency(\n bundles: Record<string, unknown>,\n omitted: readonly unknown[],\n cited: ReadonlySet<string>,\n): string | null {\n const omittedHashes = new Set<unknown>(omitted);\n if (omittedHashes.size !== omitted.length) {\n return \"omittedBundles repeats a manifest hash\";\n }\n for (const hash of omitted) {\n if (typeof hash !== \"string\" || !cited.has(hash)) {\n return `omitted bundle ${String(hash)} is not cited`;\n }\n if (Object.hasOwn(bundles, hash)) {\n return `omitted bundle ${hash} is also served`;\n }\n }\n for (const hash of cited) {\n if (!Object.hasOwn(bundles, hash) && !omittedHashes.has(hash)) {\n return `manifest ${hash} is cited without a bundle`;\n }\n }\n for (const [hash, bundle] of Object.entries(bundles)) {\n if (\n !isPlainObject(bundle) ||\n Reflect.get(bundle, \"manifestHash\") !== hash\n ) {\n return `bundle key ${hash} does not match its manifestHash`;\n }\n if (!cited.has(hash)) {\n return `bundle ${hash} is not cited`;\n }\n }\n return null;\n}\n\n/**\n * Fails closed on the first inconsistency: a cited hash neither served nor\n * declared omitted, a bundle stored under a key other than its own\n * manifestHash, a served or omitted bundle no list cites, or a hash both\n * served and omitted. Whether an omission was requested is the client's\n * check. Refinements may run after field errors, so inputs are unknown.\n */\nexport function refineManifestBundleReferences(\n projection: { readonly bundles: unknown; readonly omittedBundles: unknown },\n references: readonly unknown[],\n context: z.RefinementCtx,\n): void {\n const { bundles, omittedBundles } = projection;\n if (!isPlainObject(bundles) || !Array.isArray(omittedBundles)) {\n return;\n }\n const cited = new Set(\n references.filter((hash): hash is string => typeof hash === \"string\"),\n );\n const message = firstBundleInconsistency(bundles, omittedBundles, cited);\n if (message !== null) {\n context.addIssue({ code: \"custom\", message, path: [\"bundles\"] });\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import type { AccessManifestBundleWireResponse } from "../util/index.js";
2
+ import { type ContainerWriterProjectionResponse, type ContainerWriterProjectionWireResponse } from "./container.js";
3
+ import { type DocumentWriterProjectionResponse, type DocumentWriterProjectionWireResponse } from "./documentMutation.js";
4
+ type Bundle = AccessManifestBundleWireResponse;
5
+ /**
6
+ * Call only after authorization and stored-evidence verification. `known`
7
+ * holds the request's hints; only hashes this projection cites are omitted.
8
+ */
9
+ export declare function encodeContainerWriterProjection(projection: ContainerWriterProjectionResponse, known?: ReadonlySet<string>): ContainerWriterProjectionWireResponse;
10
+ /** See {@link encodeContainerWriterProjection}. */
11
+ export declare function encodeDocumentWriterProjection(projection: DocumentWriterProjectionResponse, known?: ReadonlySet<string>): DocumentWriterProjectionWireResponse;
12
+ /**
13
+ * Null for any wire inconsistency or an omission `held` cannot fill; the
14
+ * caller treats either as a shape failure.
15
+ */
16
+ export declare function decodeContainerWriterProjection(value: unknown, held?: ReadonlyMap<string, Bundle>): ContainerWriterProjectionResponse | null;
17
+ /** See {@link decodeContainerWriterProjection}. */
18
+ export declare function decodeDocumentWriterProjection(value: unknown, held?: ReadonlyMap<string, Bundle>): DocumentWriterProjectionResponse | null;
19
+ export {};
@@ -0,0 +1,132 @@
1
+ import { ContainerWriterProjectionWireResponseSchema, } from "./container.js";
2
+ import { DocumentWriterProjectionWireResponseSchema, } from "./documentMutation.js";
3
+ /**
4
+ * Collects each distinct manifest once. Every slot a server fills for one
5
+ * hash comes from the same stored row, and the client verifies the bundle it
6
+ * receives wherever that hash is cited, so the first occurrence stands. A
7
+ * hash the request declared known is cited but not served.
8
+ */
9
+ function bundleCitations(known) {
10
+ const byHash = new Map();
11
+ const omitted = new Set();
12
+ return {
13
+ cite(bundle) {
14
+ const hash = bundle.manifestHash;
15
+ if (known.has(hash))
16
+ omitted.add(hash);
17
+ else if (!byHash.has(hash))
18
+ byHash.set(hash, bundle);
19
+ return hash;
20
+ },
21
+ // fromEntries defines own data properties, even for a "__proto__" key.
22
+ bundles: () => Object.fromEntries(byHash),
23
+ omitted: () => [...omitted],
24
+ };
25
+ }
26
+ function encodeKeyingPath(path, cite) {
27
+ return {
28
+ ...path,
29
+ path: path.path.map(cite),
30
+ containerKeks: path.containerKeks.map((kek) => ({
31
+ ...kek,
32
+ containerManifestHistory: kek.containerManifestHistory.map(cite),
33
+ })),
34
+ };
35
+ }
36
+ /**
37
+ * Call only after authorization and stored-evidence verification. `known`
38
+ * holds the request's hints; only hashes this projection cites are omitted.
39
+ */
40
+ export function encodeContainerWriterProjection(projection, known = new Set()) {
41
+ const citations = bundleCitations(known);
42
+ const encoded = encodeKeyingPath(projection, citations.cite);
43
+ return {
44
+ ...projection,
45
+ ...encoded,
46
+ bundles: citations.bundles(),
47
+ omittedBundles: citations.omitted(),
48
+ };
49
+ }
50
+ /** See {@link encodeContainerWriterProjection}. */
51
+ export function encodeDocumentWriterProjection(projection, known = new Set()) {
52
+ const { cite, bundles, omitted } = bundleCitations(known);
53
+ const authorizingContainerPaths = projection.authorizingContainerPaths.map((path) => encodeKeyingPath(path, cite));
54
+ return {
55
+ ...projection,
56
+ authorizingContainerPaths,
57
+ documentContainerManifestHistory: projection.documentContainerManifestHistory.map(cite),
58
+ documentManifest: cite(projection.documentManifest),
59
+ documentManifestContainerPaths: projection.documentManifestContainerPaths.map((path) => path.map(cite)),
60
+ documentManifestHistory: projection.documentManifestHistory.map(cite),
61
+ bundles: bundles(),
62
+ omittedBundles: omitted(),
63
+ };
64
+ }
65
+ /**
66
+ * Served bundles plus the exact held bytes for each omitted hash. An omission
67
+ * the caller cannot fill from `held` (which carries only what its request
68
+ * cited) makes the response unusable. Each cited position receives its own
69
+ * copy, as when every slot carried its own JSON.
70
+ */
71
+ function bundleResolver(bundles, omittedBundles, held) {
72
+ const byHash = new Map(Object.entries(bundles));
73
+ for (const hash of omittedBundles) {
74
+ const bundle = held.get(hash);
75
+ if (bundle?.manifestHash !== hash)
76
+ return null;
77
+ byHash.set(hash, bundle);
78
+ }
79
+ return (hash) => {
80
+ const bundle = byHash.get(hash);
81
+ if (!bundle) {
82
+ throw new Error(`manifest ${hash} is cited without a bundle`);
83
+ }
84
+ return structuredClone(bundle);
85
+ };
86
+ }
87
+ function decodeKeyingPath(path, resolve) {
88
+ return {
89
+ ...path,
90
+ path: path.path.map(resolve),
91
+ containerKeks: path.containerKeks.map((kek) => ({
92
+ ...kek,
93
+ containerManifestHistory: kek.containerManifestHistory.map(resolve),
94
+ })),
95
+ };
96
+ }
97
+ /**
98
+ * Null for any wire inconsistency or an omission `held` cannot fill; the
99
+ * caller treats either as a shape failure.
100
+ */
101
+ export function decodeContainerWriterProjection(value, held = new Map()) {
102
+ const parsed = ContainerWriterProjectionWireResponseSchema.safeParse(value);
103
+ if (!parsed.success) {
104
+ return null;
105
+ }
106
+ const { bundles, omittedBundles, ...projection } = parsed.data;
107
+ const resolve = bundleResolver(bundles, omittedBundles, held);
108
+ return resolve
109
+ ? { ...projection, ...decodeKeyingPath(projection, resolve) }
110
+ : null;
111
+ }
112
+ /** See {@link decodeContainerWriterProjection}. */
113
+ export function decodeDocumentWriterProjection(value, held = new Map()) {
114
+ const parsed = DocumentWriterProjectionWireResponseSchema.safeParse(value);
115
+ if (!parsed.success) {
116
+ return null;
117
+ }
118
+ const { bundles, omittedBundles, ...projection } = parsed.data;
119
+ const resolve = bundleResolver(bundles, omittedBundles, held);
120
+ if (!resolve) {
121
+ return null;
122
+ }
123
+ return {
124
+ ...projection,
125
+ authorizingContainerPaths: projection.authorizingContainerPaths.map((path) => decodeKeyingPath(path, resolve)),
126
+ documentContainerManifestHistory: projection.documentContainerManifestHistory.map(resolve),
127
+ documentManifest: resolve(projection.documentManifest),
128
+ documentManifestContainerPaths: projection.documentManifestContainerPaths.map((path) => path.map(resolve)),
129
+ documentManifestHistory: projection.documentManifestHistory.map(resolve),
130
+ };
131
+ }
132
+ //# sourceMappingURL=writerProjectionWire.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writerProjectionWire.js","sourceRoot":"","sources":["writerProjectionWire.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,2CAA2C,GAC5C,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,0CAA0C,GAC3C,MAAM,oBAAoB,CAAC;AAI5B;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAA0B;IACjD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,OAAO;QACL,IAAI,CAAC,MAAc;YACjB,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC;YACjC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;iBAClC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,uEAAuE;QACvE,OAAO,EAAE,GAA2B,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QACjE,OAAO,EAAE,GAAa,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CACvB,IAAiC,EACjC,IAAgC;IAEhC,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QACzB,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;Y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AA8B,EAC5B,UAAU,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACrD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAClB;QACH,uBAAuB,EAAE,UAAU,CAAC,uBAAuB,CAAC,GAAG,CAAC,OAAO,CAAC;KACzE,CAAC;AACJ,CAAC","sourcesContent":["import type { AccessManifestBundleWireResponse } from \"../util\";\nimport {\n type ContainerKeyingPathResponse,\n type ContainerKeyingPathWireResponse,\n type ContainerWriterProjectionResponse,\n type ContainerWriterProjectionWireResponse,\n ContainerWriterProjectionWireResponseSchema,\n} from \"./container\";\nimport {\n type DocumentWriterProjectionResponse,\n type DocumentWriterProjectionWireResponse,\n DocumentWriterProjectionWireResponseSchema,\n} from \"./documentMutation\";\n\ntype Bundle = AccessManifestBundleWireResponse;\n\n/**\n * Collects each distinct manifest once. Every slot a server fills for one\n * hash comes from the same stored row, and the client verifies the bundle it\n * receives wherever that hash is cited, so the first occurrence stands. A\n * hash the request declared known is cited but not served.\n */\nfunction bundleCitations(known: ReadonlySet<string>) {\n const byHash = new Map<string, Bundle>();\n const omitted = new Set<string>();\n return {\n cite(bundle: Bundle): string {\n const hash = bundle.manifestHash;\n if (known.has(hash)) omitted.add(hash);\n else if (!byHash.has(hash)) byHash.set(hash, bundle);\n return hash;\n },\n // fromEntries defines own data properties, even for a \"__proto__\" key.\n bundles: (): Record<string, Bundle> => Object.fromEntries(byHash),\n omitted: (): string[] => [...omitted],\n };\n}\n\nfunction encodeKeyingPath(\n path: ContainerKeyingPathResponse,\n cite: (bundle: Bundle) => string,\n): ContainerKeyingPathWireResponse {\n return {\n ...path,\n path: path.path.map(cite),\n containerKeks: path.containerKeks.map((kek) => ({\n ...kek,\n containerManifestHistory: kek.containerManifestHistory.map(cite),\n })),\n };\n}\n\n/**\n * Call only after authorization and stored-evidence verification. `known`\n * holds the request's hints; only hashes this projection cites are omitted.\n */\nexport function encodeContainerWriterProjection(\n projection: ContainerWriterProjectionResponse,\n known: ReadonlySet<string> = new Set(),\n): ContainerWriterProjectionWireResponse {\n const citations = bundleCitations(known);\n const encoded = encodeKeyingPath(projection, citations.cite);\n return {\n ...projection,\n ...encoded,\n bundles: citations.bundles(),\n omittedBundles: citations.omitted(),\n };\n}\n\n/** See {@link encodeContainerWriterProjection}. */\nexport function encodeDocumentWriterProjection(\n projection: DocumentWriterProjectionResponse,\n known: ReadonlySet<string> = new Set(),\n): DocumentWriterProjectionWireResponse {\n const { cite, bundles, omitted } = bundleCitations(known);\n const authorizingContainerPaths = projection.authorizingContainerPaths.map(\n (path) => encodeKeyingPath(path, cite),\n );\n return {\n ...projection,\n authorizingContainerPaths,\n documentContainerManifestHistory:\n projection.documentContainerManifestHistory.map(cite),\n documentManifest: cite(projection.documentManifest),\n documentManifestContainerPaths:\n projection.documentManifestContainerPaths.map((path) => path.map(cite)),\n documentManifestHistory: projection.documentManifestHistory.map(cite),\n bundles: bundles(),\n omittedBundles: omitted(),\n };\n}\n\n/**\n * Served bundles plus the exact held bytes for each omitted hash. An omission\n * the caller cannot fill from `held` (which carries only what its request\n * cited) makes the response unusable. Each cited position receives its own\n * copy, as when every slot carried its own JSON.\n */\nfunction bundleResolver(\n bundles: Record<string, Bundle>,\n omittedBundles: readonly string[],\n held: ReadonlyMap<string, Bundle>,\n): ((hash: string) => Bundle) | null {\n const byHash = new Map(Object.entries(bundles));\n for (const hash of omittedBundles) {\n const bundle = held.get(hash);\n if (bundle?.manifestHash !== hash) return null;\n byHash.set(hash, bundle);\n }\n return (hash: string): Bundle => {\n const bundle = byHash.get(hash);\n if (!bundle) {\n throw new Error(`manifest ${hash} is cited without a bundle`);\n }\n return structuredClone(bundle);\n };\n}\n\nfunction decodeKeyingPath(\n path: ContainerKeyingPathWireResponse,\n resolve: (hash: string) => Bundle,\n): ContainerKeyingPathResponse {\n return {\n ...path,\n path: path.path.map(resolve),\n containerKeks: path.containerKeks.map((kek) => ({\n ...kek,\n containerManifestHistory: kek.containerManifestHistory.map(resolve),\n })),\n };\n}\n\n/**\n * Null for any wire inconsistency or an omission `held` cannot fill; the\n * caller treats either as a shape failure.\n */\nexport function decodeContainerWriterProjection(\n value: unknown,\n held: ReadonlyMap<string, Bundle> = new Map(),\n): ContainerWriterProjectionResponse | null {\n const parsed = ContainerWriterProjectionWireResponseSchema.safeParse(value);\n if (!parsed.success) {\n return null;\n }\n const { bundles, omittedBundles, ...projection } = parsed.data;\n const resolve = bundleResolver(bundles, omittedBundles, held);\n return resolve\n ? { ...projection, ...decodeKeyingPath(projection, resolve) }\n : null;\n}\n\n/** See {@link decodeContainerWriterProjection}. */\nexport function decodeDocumentWriterProjection(\n value: unknown,\n held: ReadonlyMap<string, Bundle> = new Map(),\n): DocumentWriterProjectionResponse | null {\n const parsed = DocumentWriterProjectionWireResponseSchema.safeParse(value);\n if (!parsed.success) {\n return null;\n }\n const { bundles, omittedBundles, ...projection } = parsed.data;\n const resolve = bundleResolver(bundles, omittedBundles, held);\n if (!resolve) {\n return null;\n }\n return {\n ...projection,\n authorizingContainerPaths: projection.authorizingContainerPaths.map(\n (path) => decodeKeyingPath(path, resolve),\n ),\n documentContainerManifestHistory:\n projection.documentContainerManifestHistory.map(resolve),\n documentManifest: resolve(projection.documentManifest),\n documentManifestContainerPaths:\n projection.documentManifestContainerPaths.map((path) =>\n path.map(resolve),\n ),\n documentManifestHistory: projection.documentManifestHistory.map(resolve),\n };\n}\n"]}