@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
@@ -5,9 +5,9 @@ import { registerJsonSchemaRuntimeRefinements } from "../jsonSchema.js";
5
5
  import { organizationProvisioningContainerKeyringRefinement } from "../organizationProvisioningRefinements.js";
6
6
  import { arraySchema, loosePlainObject, nonEmptyArraySchema, nonEmptyStringSchema, nonNegativeIntegerSchema, plainObjectSchema, positiveIntegerSchema, } from "../schema.js";
7
7
  import { AccessManifestBundleWireResponseSchema, CONTAINER_KEK_LOG_PAGE_LIMIT, CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT, ContainerKekKeyringWireRecordSchema, } from "../util/index.js";
8
- import { ProjectionHistoryPrefixesSchema } from "../util/projectionHistoryWire.js";
9
- import { containerWriterProjectionPathKekCountRefinement } from "../writerProjectionRefinements.js";
8
+ import { containerWriterProjectionPathKekCountRefinement, writerProjectionManifestBundlesRefinement, } from "../writerProjectionRefinements.js";
10
9
  import { EffectiveAccessLevelSchema } from "./accessLevel.js";
10
+ import { containerKeyingPathReferences, ManifestBundlesSchema, ManifestHashReferenceSchema, OmittedManifestBundlesSchema, refineManifestBundleReferences, } from "./manifestBundleReferences.js";
11
11
  import { ReferencedPrincipalStateResponseSchema, ReferencedPrincipalStateResponseShape, } from "./principalReference.js";
12
12
  import { ProjectionPolicyEvidenceResponseSchema } from "./projectionPolicyEvidence.js";
13
13
  import { SyncWatermarkSchema } from "./syncWatermark.js";
@@ -35,7 +35,7 @@ const containerKekResponseShape = {
35
35
  recipientTargets: nonEmptyArraySchema(plainObjectSchema),
36
36
  wraps: nonEmptyArraySchema(plainObjectSchema),
37
37
  };
38
- const ContainerKekResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject(containerKekResponseShape).superRefine((value, context) => {
38
+ function refineContainerKekKeyring(value, context) {
39
39
  if ((value.keyring === null) !== (value.containerKeyEpoch === 1)) {
40
40
  context.addIssue({
41
41
  code: "custom",
@@ -43,7 +43,13 @@ const ContainerKekResponseSchema = registerJsonSchemaRuntimeRefinements(loosePla
43
43
  path: ["keyring"],
44
44
  });
45
45
  }
46
- }), [organizationProvisioningContainerKeyringRefinement]);
46
+ }
47
+ const ContainerKekResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject(containerKekResponseShape).superRefine(refineContainerKekKeyring), [organizationProvisioningContainerKeyringRefinement]);
48
+ /** On the writer-projection wire, KEK history cites manifests by hash. */
49
+ const ContainerKekWireResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject({
50
+ ...containerKekResponseShape,
51
+ containerManifestHistory: arraySchema(ManifestHashReferenceSchema),
52
+ }).superRefine(refineContainerKekKeyring), [organizationProvisioningContainerKeyringRefinement]);
47
53
  /**
48
54
  * The append-only rotation log for one container: every epoch with its
49
55
  * write-once bridge and sealed keyring. This is the rebuild/repair read
@@ -141,11 +147,37 @@ function refineContainerKeyingPath(projection, context) {
141
147
  });
142
148
  }
143
149
  export const ContainerKeyingPathResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject(containerKeyingPathShape).superRefine(refineContainerKeyingPath), [containerWriterProjectionPathKekCountRefinement]);
150
+ /**
151
+ * The decoded projection a client verifies: every manifest position holds
152
+ * its bundle. `decodeContainerWriterProjection` builds it from the wire.
153
+ */
144
154
  export const ContainerWriterProjectionResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject({
145
155
  ...containerKeyingPathShape,
146
156
  policyEvidence: ProjectionPolicyEvidenceResponseSchema,
147
- historyPrefixes: ProjectionHistoryPrefixesSchema.optional(),
148
157
  }).superRefine(refineContainerKeyingPath), [containerWriterProjectionPathKekCountRefinement]);
158
+ const containerKeyingPathWireShape = {
159
+ containerId: z.string(),
160
+ containerKeks: arraySchema(ContainerKekWireResponseSchema),
161
+ organizationId: z.string(),
162
+ path: nonEmptyArraySchema(ManifestHashReferenceSchema),
163
+ };
164
+ export const ContainerKeyingPathWireResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject(containerKeyingPathWireShape).superRefine(refineContainerKeyingPath), [containerWriterProjectionPathKekCountRefinement]);
165
+ /**
166
+ * The served shape: manifest positions cite `bundles` by hash, except hashes
167
+ * the request declared already held, which `omittedBundles` lists instead.
168
+ */
169
+ export const ContainerWriterProjectionWireResponseSchema = registerJsonSchemaRuntimeRefinements(loosePlainObject({
170
+ bundles: ManifestBundlesSchema,
171
+ omittedBundles: OmittedManifestBundlesSchema,
172
+ ...containerKeyingPathWireShape,
173
+ policyEvidence: ProjectionPolicyEvidenceResponseSchema,
174
+ }).superRefine((projection, context) => {
175
+ refineContainerKeyingPath(projection, context);
176
+ refineManifestBundleReferences(projection, containerKeyingPathReferences(projection), context);
177
+ }), [
178
+ containerWriterProjectionPathKekCountRefinement,
179
+ writerProjectionManifestBundlesRefinement,
180
+ ]);
149
181
  export const ContainerSummaryResponseSchema = loosePlainObject({
150
182
  createdAt: z.string(),
151
183
  depth: nonNegativeIntegerSchema,
@@ -185,4 +217,7 @@ export function isContainerDeleteResponse(value) {
185
217
  export function isContainerWriterProjectionResponse(value) {
186
218
  return ContainerWriterProjectionResponseSchema.safeParse(value).success;
187
219
  }
220
+ export function isContainerWriterProjectionWireResponse(value) {
221
+ return ContainerWriterProjectionWireResponseSchema.safeParse(value).success;
222
+ }
188
223
  //# sourceMappingURL=container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"container.js","sourceRoot":"","sources":["container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,kDAAkD,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC5B,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,+CAA+C,EAAE,MAAM,gCAAgC,CA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4B,GAAG,gBAAgB,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,KAAK,EAAE,WAAW,CAAC,8BAA8B,CAAC;IAClD,aAAa,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,WAAW,CAAC,oCAAoC,CAAC;CAC9D,CAAC,CAAC;AAMH,MAAM,UAAU,wBAAwB,CACtC,KAAc;IAEd,OAAO,4BAA4B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,KAAc;IAEd,OAAO,+BAA+B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,6BAA6B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,mCAAmC,CACjD,KAAc;IAEd,OAAO,uCAAuC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC1E,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { containerKekLogSingleKeyringRefinement } from \"../containerReadRefinements\";\nimport { ContainerSystemSlotSchema } from \"../containerSystemSlot\";\nimport { registerJsonSchemaRuntimeRefinements } from \"../jsonSchema\";\nimport { organizationProvisioningContainerKeyringRefinement } from \"../organizationProvisioningRefinements\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyArraySchema,\n nonEmptyStringSchema,\n nonNegativeIntegerSchema,\n plainObjectSchema,\n positiveIntegerSchema,\n} from \"../schema\";\nimport {\n AccessManifestBundleWireResponseSchema,\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT,\n ContainerKekKeyringWireRecordSchema,\n} from \"../util\";\nimport { ProjectionHistoryPrefixesSchema } from \"../util/projectionHistoryWire\";\nimport { containerWriterProjectionPathKekCountRefinement } from \"../writerProjectionRefinements\";\nimport { EffectiveAccessLevelSchema } from \"./accessLevel\";\nimport {\n ReferencedPrincipalStateResponseSchema,\n ReferencedPrincipalStateResponseShape,\n} from \"./principalReference\";\nimport { ProjectionPolicyEvidenceResponseSchema } from \"./projectionPolicyEvidence\";\nimport { SyncWatermarkSchema } from \"./syncWatermark\";\n\nconst ContainerGrantPrincipalStateResponseSchema = loosePlainObject({\n ...ReferencedPrincipalStateResponseShape,\n principalType: z.literal(\"group\"),\n});\n\n/**\n * The container's sealed predecessor key history. Opening it under the\n * current KEK yields every retained historical KEK in one decrypt; the\n * bridge log behind it is served only by the rebuild read path.\n */\nconst ContainerKekKeyringWireResponseSchema =\n ContainerKekKeyringWireRecordSchema;\n\nexport type ContainerKekKeyringWireResponse = z.infer<\n typeof ContainerKekKeyringWireResponseSchema\n>;\n\nconst containerKekResponseShape = {\n accessManifestHash: nonEmptyStringSchema,\n containerId: z.string(),\n containerKeyEpoch: positiveIntegerSchema,\n containerKeyEpochId: nonEmptyStringSchema,\n containerManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),\n keyEpoch: plainObjectSchema,\n keyEpochHash: nonEmptyStringSchema,\n keyring: ContainerKekKeyringWireResponseSchema.nullable(),\n keyTargetHash: nonEmptyStringSchema,\n parentContainerKeyEpochId: z.string().nullable(),\n recipientTargets: nonEmptyArraySchema(plainObjectSchema),\n wraps: nonEmptyArraySchema(plainObjectSchema),\n};\n\nconst ContainerKekResponseSchema = registerJsonSchemaRuntimeRefinements(\n loosePlainObject(containerKekResponseShape).superRefine((value, context) => {\n if ((value.keyring === null) !== (value.containerKeyEpoch === 1)) {\n context.addIssue({\n code: \"custom\",\n message: \"container keyring must be null exactly at epoch 1\",\n path: [\"keyring\"],\n });\n }\n }),\n [organizationProvisioningContainerKeyringRefinement],\n);\n\nexport type ContainerKekResponse = z.infer<typeof ContainerKekResponseSchema>;\n\n/**\n * The append-only rotation log for one container: every epoch with its\n * write-once bridge and sealed keyring. This is the rebuild/repair read\n * path — hot reads use the projection keyring instead.\n */\nexport const ContainerKekLogEpochResponseSchema = loosePlainObject({\n accessManifestHash: nonEmptyStringSchema,\n bridge: plainObjectSchema.nullable(),\n containerKeyEpoch: positiveIntegerSchema,\n containerKeyEpochId: nonEmptyStringSchema,\n keyring: ContainerKekKeyringWireResponseSchema.nullable(),\n parentContainerKeyEpochId: z.string().nullable(),\n /**\n * Retained recipient envelopes are the recovery backstop when a bridge is\n * severed. The server and response guard apply this bound per epoch.\n */\n wraps: arraySchema(plainObjectSchema, CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT),\n});\n\nexport type ContainerKekLogEpochResponse = z.infer<\n typeof ContainerKekLogEpochResponseSchema\n>;\n\nexport const ContainerKekLogResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n containerId: nonEmptyStringSchema,\n epochs: arraySchema(\n ContainerKekLogEpochResponseSchema,\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n ),\n /** True when epochs above this page's last remain unserved. */\n hasMore: z.boolean(),\n }).superRefine(({ epochs }, context) => {\n if (epochs.filter((epoch) => epoch.keyring !== null).length > 1) {\n context.addIssue({\n code: \"custom\",\n message: \"container KEK log pages contain at most one keyring\",\n path: [\"epochs\"],\n });\n }\n }),\n [containerKekLogSingleKeyringRefinement],\n );\n\nexport type ContainerKekLogResponse = z.infer<\n typeof ContainerKekLogResponseSchema\n>;\n\nexport function isContainerKekLogResponse(\n value: unknown,\n): value is ContainerKekLogResponse {\n return ContainerKekLogResponseSchema.safeParse(value).success;\n}\n\nconst ContainerManifestMutationResponseShape = {\n accessManifest: AccessManifestBundleWireResponseSchema,\n containerId: z.string(),\n createdAt: z.string(),\n manifestHead: loosePlainObject({\n epoch: z.number(),\n manifestHash: z.string(),\n }),\n organizationId: z.string(),\n parentId: z.string().nullable(),\n referencedPrincipalHeads: arraySchema(\n ContainerGrantPrincipalStateResponseSchema,\n ),\n systemSlot: ContainerSystemSlotSchema.nullable().optional(),\n updatedAt: z.string(),\n};\n\n// Preserve the canonical generated field order while sharing the signed-head shape.\nconst { accessManifest, containerId, ...containerMutationResponseFields } =\n ContainerManifestMutationResponseShape;\n\nconst containerMutationResponseShape = {\n accessManifest,\n containerId,\n containerKek: ContainerKekResponseSchema,\n ...containerMutationResponseFields,\n};\n\nexport const ContainerMutationResponseSchema = loosePlainObject(\n containerMutationResponseShape,\n);\n\nexport type ContainerMutationResponse = z.infer<\n typeof ContainerMutationResponseSchema\n>;\n\n/** A rotation's acknowledgement, plus one per carried rekey in request order. */\nexport const ContainerRotationResponseSchema = loosePlainObject({\n ...containerMutationResponseShape,\n containerRekeys: arraySchema(ContainerMutationResponseSchema).optional(),\n});\n\nexport type ContainerRotationResponse = z.infer<\n typeof ContainerRotationResponseSchema\n>;\n\nexport function isContainerRotationResponse(\n value: unknown,\n): value is ContainerRotationResponse {\n return ContainerRotationResponseSchema.safeParse(value).success;\n}\n\nexport const ContainerReciteResponseSchema = loosePlainObject(\n ContainerManifestMutationResponseShape,\n);\nexport type ContainerReciteResponse = z.infer<\n typeof ContainerReciteResponseSchema\n>;\n\nexport function isContainerReciteResponse(\n value: unknown,\n): value is ContainerReciteResponse {\n return ContainerReciteResponseSchema.safeParse(value).success;\n}\n\nexport const ContainerDeleteResponseSchema = loosePlainObject({\n containerId: z.string(),\n deletedAt: z.string(),\n});\n\nexport type ContainerDeleteResponse = z.infer<\n typeof ContainerDeleteResponseSchema\n>;\n\nexport const CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE =\n \"container_projection_state_invalid\";\nexport const ContainerWriterProjectionErrorResponseSchema = loosePlainObject({\n code: z.literal(CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE),\n error: z.string(),\n});\n\nconst containerKeyingPathShape = {\n containerId: z.string(),\n containerKeks: arraySchema(ContainerKekResponseSchema),\n organizationId: z.string(),\n path: nonEmptyArraySchema(AccessManifestBundleWireResponseSchema),\n};\nfunction refineContainerKeyingPath(\n projection: { containerKeks: unknown[]; path: unknown[] },\n context: z.RefinementCtx,\n) {\n // loosePlainObject can continue refinements after reporting malformed fields.\n if (\n Array.isArray(projection.containerKeks) &&\n Array.isArray(projection.path) &&\n projection.containerKeks.length !== projection.path.length\n )\n context.addIssue({\n code: \"custom\",\n message: \"container KEK count must match the manifest path length\",\n path: [\"containerKeks\"],\n });\n}\nexport const ContainerKeyingPathResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject(containerKeyingPathShape).superRefine(\n refineContainerKeyingPath,\n ),\n [containerWriterProjectionPathKekCountRefinement],\n );\nexport type ContainerKeyingPathResponse = z.infer<\n typeof ContainerKeyingPathResponseSchema\n>;\nexport const ContainerWriterProjectionResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n ...containerKeyingPathShape,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n historyPrefixes: ProjectionHistoryPrefixesSchema.optional(),\n }).superRefine(refineContainerKeyingPath),\n [containerWriterProjectionPathKekCountRefinement],\n );\n\nexport type ContainerWriterProjectionResponse = z.infer<\n typeof ContainerWriterProjectionResponseSchema\n>;\n\nexport const ContainerSummaryResponseSchema = loosePlainObject({\n createdAt: z.string(),\n depth: nonNegativeIntegerSchema,\n effectiveAccessLevel: EffectiveAccessLevelSchema,\n id: z.string(),\n metadataAccessEpoch: z.number(),\n metadataAccessStateHash: nonEmptyStringSchema,\n metadataDocumentId: z.string(),\n metadataReferencedPrincipals: arraySchema(\n ReferencedPrincipalStateResponseSchema,\n ),\n organizationId: z.string(),\n parentId: z.string().nullable(),\n systemSlot: ContainerSystemSlotSchema.nullable().optional(),\n updatedAt: z.string(),\n});\n\nexport type ContainerSummary = z.infer<typeof ContainerSummaryResponseSchema>;\n\nexport const ContainerSyncTombstoneResponseSchema = loosePlainObject({\n containerId: z.string(),\n depth: nonNegativeIntegerSchema,\n parentId: z.string().nullable(),\n reason: z.literal([\"access_revoked\", \"deleted\"]),\n updatedAt: z.string(),\n});\n\nexport type ContainerSyncTombstone = z.infer<\n typeof ContainerSyncTombstoneResponseSchema\n>;\n\nexport const ListContainersResponseSchema = loosePlainObject({\n hasMore: z.boolean(),\n items: arraySchema(ContainerSummaryResponseSchema),\n nextWatermark: SyncWatermarkSchema.nullable(),\n tombstones: arraySchema(ContainerSyncTombstoneResponseSchema),\n});\n\nexport type ListContainersResponse = z.infer<\n typeof ListContainersResponseSchema\n>;\n\nexport function isListContainersResponse(\n value: unknown,\n): value is ListContainersResponse {\n return ListContainersResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerMutationResponse(\n value: unknown,\n): value is ContainerMutationResponse {\n return ContainerMutationResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerDeleteResponse(\n value: unknown,\n): value is ContainerDeleteResponse {\n return ContainerDeleteResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerWriterProjectionResponse(\n value: unknown,\n): value is ContainerWriterProjectionResponse {\n return ContainerWriterProjectionResponseSchema.safeParse(value).success;\n}\n"]}
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,kDAAkD,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC5B,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,+CAA+C,EAC/C,yCAAyC,GAC1C,MAAM,gCAAgC,CAAC;AACxC,OAA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A8B,CAAC;IAClD,aAAa,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,WAAW,CAAC,oCAAoC,CAAC;CAC9D,CAAC,CAAC;AAMH,MAAM,UAAU,wBAAwB,CACtC,KAAc;IAEd,OAAO,4BAA4B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,KAAc;IAEd,OAAO,+BAA+B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,6BAA6B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,mCAAmC,CACjD,KAAc;IAEd,OAAO,uCAAuC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,KAAc;IAEd,OAAO,2CAA2C,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC9E,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { containerKekLogSingleKeyringRefinement } from \"../containerReadRefinements\";\nimport { ContainerSystemSlotSchema } from \"../containerSystemSlot\";\nimport { registerJsonSchemaRuntimeRefinements } from \"../jsonSchema\";\nimport { organizationProvisioningContainerKeyringRefinement } from \"../organizationProvisioningRefinements\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyArraySchema,\n nonEmptyStringSchema,\n nonNegativeIntegerSchema,\n plainObjectSchema,\n positiveIntegerSchema,\n} from \"../schema\";\nimport {\n AccessManifestBundleWireResponseSchema,\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT,\n ContainerKekKeyringWireRecordSchema,\n} from \"../util\";\nimport {\n containerWriterProjectionPathKekCountRefinement,\n writerProjectionManifestBundlesRefinement,\n} from \"../writerProjectionRefinements\";\nimport { EffectiveAccessLevelSchema } from \"./accessLevel\";\nimport {\n containerKeyingPathReferences,\n ManifestBundlesSchema,\n ManifestHashReferenceSchema,\n OmittedManifestBundlesSchema,\n refineManifestBundleReferences,\n} from \"./manifestBundleReferences\";\nimport {\n ReferencedPrincipalStateResponseSchema,\n ReferencedPrincipalStateResponseShape,\n} from \"./principalReference\";\nimport { ProjectionPolicyEvidenceResponseSchema } from \"./projectionPolicyEvidence\";\nimport { SyncWatermarkSchema } from \"./syncWatermark\";\n\nconst ContainerGrantPrincipalStateResponseSchema = loosePlainObject({\n ...ReferencedPrincipalStateResponseShape,\n principalType: z.literal(\"group\"),\n});\n\n/**\n * The container's sealed predecessor key history. Opening it under the\n * current KEK yields every retained historical KEK in one decrypt; the\n * bridge log behind it is served only by the rebuild read path.\n */\nconst ContainerKekKeyringWireResponseSchema =\n ContainerKekKeyringWireRecordSchema;\n\nexport type ContainerKekKeyringWireResponse = z.infer<\n typeof ContainerKekKeyringWireResponseSchema\n>;\n\nconst containerKekResponseShape = {\n accessManifestHash: nonEmptyStringSchema,\n containerId: z.string(),\n containerKeyEpoch: positiveIntegerSchema,\n containerKeyEpochId: nonEmptyStringSchema,\n containerManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),\n keyEpoch: plainObjectSchema,\n keyEpochHash: nonEmptyStringSchema,\n keyring: ContainerKekKeyringWireResponseSchema.nullable(),\n keyTargetHash: nonEmptyStringSchema,\n parentContainerKeyEpochId: z.string().nullable(),\n recipientTargets: nonEmptyArraySchema(plainObjectSchema),\n wraps: nonEmptyArraySchema(plainObjectSchema),\n};\n\nfunction refineContainerKekKeyring(\n value: { readonly containerKeyEpoch: number; readonly keyring: unknown },\n context: z.RefinementCtx,\n) {\n if ((value.keyring === null) !== (value.containerKeyEpoch === 1)) {\n context.addIssue({\n code: \"custom\",\n message: \"container keyring must be null exactly at epoch 1\",\n path: [\"keyring\"],\n });\n }\n}\n\nconst ContainerKekResponseSchema = registerJsonSchemaRuntimeRefinements(\n loosePlainObject(containerKekResponseShape).superRefine(\n refineContainerKekKeyring,\n ),\n [organizationProvisioningContainerKeyringRefinement],\n);\n\n/** On the writer-projection wire, KEK history cites manifests by hash. */\nconst ContainerKekWireResponseSchema = registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n ...containerKekResponseShape,\n containerManifestHistory: arraySchema(ManifestHashReferenceSchema),\n }).superRefine(refineContainerKekKeyring),\n [organizationProvisioningContainerKeyringRefinement],\n);\n\nexport type ContainerKekResponse = z.infer<typeof ContainerKekResponseSchema>;\n\n/**\n * The append-only rotation log for one container: every epoch with its\n * write-once bridge and sealed keyring. This is the rebuild/repair read\n * path — hot reads use the projection keyring instead.\n */\nexport const ContainerKekLogEpochResponseSchema = loosePlainObject({\n accessManifestHash: nonEmptyStringSchema,\n bridge: plainObjectSchema.nullable(),\n containerKeyEpoch: positiveIntegerSchema,\n containerKeyEpochId: nonEmptyStringSchema,\n keyring: ContainerKekKeyringWireResponseSchema.nullable(),\n parentContainerKeyEpochId: z.string().nullable(),\n /**\n * Retained recipient envelopes are the recovery backstop when a bridge is\n * severed. The server and response guard apply this bound per epoch.\n */\n wraps: arraySchema(plainObjectSchema, CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT),\n});\n\nexport type ContainerKekLogEpochResponse = z.infer<\n typeof ContainerKekLogEpochResponseSchema\n>;\n\nexport const ContainerKekLogResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n containerId: nonEmptyStringSchema,\n epochs: arraySchema(\n ContainerKekLogEpochResponseSchema,\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n ),\n /** True when epochs above this page's last remain unserved. */\n hasMore: z.boolean(),\n }).superRefine(({ epochs }, context) => {\n if (epochs.filter((epoch) => epoch.keyring !== null).length > 1) {\n context.addIssue({\n code: \"custom\",\n message: \"container KEK log pages contain at most one keyring\",\n path: [\"epochs\"],\n });\n }\n }),\n [containerKekLogSingleKeyringRefinement],\n );\n\nexport type ContainerKekLogResponse = z.infer<\n typeof ContainerKekLogResponseSchema\n>;\n\nexport function isContainerKekLogResponse(\n value: unknown,\n): value is ContainerKekLogResponse {\n return ContainerKekLogResponseSchema.safeParse(value).success;\n}\n\nconst ContainerManifestMutationResponseShape = {\n accessManifest: AccessManifestBundleWireResponseSchema,\n containerId: z.string(),\n createdAt: z.string(),\n manifestHead: loosePlainObject({\n epoch: z.number(),\n manifestHash: z.string(),\n }),\n organizationId: z.string(),\n parentId: z.string().nullable(),\n referencedPrincipalHeads: arraySchema(\n ContainerGrantPrincipalStateResponseSchema,\n ),\n systemSlot: ContainerSystemSlotSchema.nullable().optional(),\n updatedAt: z.string(),\n};\n\n// Preserve the canonical generated field order while sharing the signed-head shape.\nconst { accessManifest, containerId, ...containerMutationResponseFields } =\n ContainerManifestMutationResponseShape;\n\nconst containerMutationResponseShape = {\n accessManifest,\n containerId,\n containerKek: ContainerKekResponseSchema,\n ...containerMutationResponseFields,\n};\n\nexport const ContainerMutationResponseSchema = loosePlainObject(\n containerMutationResponseShape,\n);\n\nexport type ContainerMutationResponse = z.infer<\n typeof ContainerMutationResponseSchema\n>;\n\n/** A rotation's acknowledgement, plus one per carried rekey in request order. */\nexport const ContainerRotationResponseSchema = loosePlainObject({\n ...containerMutationResponseShape,\n containerRekeys: arraySchema(ContainerMutationResponseSchema).optional(),\n});\n\nexport type ContainerRotationResponse = z.infer<\n typeof ContainerRotationResponseSchema\n>;\n\nexport function isContainerRotationResponse(\n value: unknown,\n): value is ContainerRotationResponse {\n return ContainerRotationResponseSchema.safeParse(value).success;\n}\n\nexport const ContainerReciteResponseSchema = loosePlainObject(\n ContainerManifestMutationResponseShape,\n);\nexport type ContainerReciteResponse = z.infer<\n typeof ContainerReciteResponseSchema\n>;\n\nexport function isContainerReciteResponse(\n value: unknown,\n): value is ContainerReciteResponse {\n return ContainerReciteResponseSchema.safeParse(value).success;\n}\n\nexport const ContainerDeleteResponseSchema = loosePlainObject({\n containerId: z.string(),\n deletedAt: z.string(),\n});\n\nexport type ContainerDeleteResponse = z.infer<\n typeof ContainerDeleteResponseSchema\n>;\n\nexport const CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE =\n \"container_projection_state_invalid\";\nexport const ContainerWriterProjectionErrorResponseSchema = loosePlainObject({\n code: z.literal(CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE),\n error: z.string(),\n});\n\nconst containerKeyingPathShape = {\n containerId: z.string(),\n containerKeks: arraySchema(ContainerKekResponseSchema),\n organizationId: z.string(),\n path: nonEmptyArraySchema(AccessManifestBundleWireResponseSchema),\n};\nfunction refineContainerKeyingPath(\n projection: { containerKeks: unknown[]; path: unknown[] },\n context: z.RefinementCtx,\n) {\n // loosePlainObject can continue refinements after reporting malformed fields.\n if (\n Array.isArray(projection.containerKeks) &&\n Array.isArray(projection.path) &&\n projection.containerKeks.length !== projection.path.length\n )\n context.addIssue({\n code: \"custom\",\n message: \"container KEK count must match the manifest path length\",\n path: [\"containerKeks\"],\n });\n}\nexport const ContainerKeyingPathResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject(containerKeyingPathShape).superRefine(\n refineContainerKeyingPath,\n ),\n [containerWriterProjectionPathKekCountRefinement],\n );\nexport type ContainerKeyingPathResponse = z.infer<\n typeof ContainerKeyingPathResponseSchema\n>;\n/**\n * The decoded projection a client verifies: every manifest position holds\n * its bundle. `decodeContainerWriterProjection` builds it from the wire.\n */\nexport const ContainerWriterProjectionResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n ...containerKeyingPathShape,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n }).superRefine(refineContainerKeyingPath),\n [containerWriterProjectionPathKekCountRefinement],\n );\n\nexport type ContainerWriterProjectionResponse = z.infer<\n typeof ContainerWriterProjectionResponseSchema\n>;\n\nconst containerKeyingPathWireShape = {\n containerId: z.string(),\n containerKeks: arraySchema(ContainerKekWireResponseSchema),\n organizationId: z.string(),\n path: nonEmptyArraySchema(ManifestHashReferenceSchema),\n};\nexport const ContainerKeyingPathWireResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject(containerKeyingPathWireShape).superRefine(\n refineContainerKeyingPath,\n ),\n [containerWriterProjectionPathKekCountRefinement],\n );\nexport type ContainerKeyingPathWireResponse = z.infer<\n typeof ContainerKeyingPathWireResponseSchema\n>;\n\n/**\n * The served shape: manifest positions cite `bundles` by hash, except hashes\n * the request declared already held, which `omittedBundles` lists instead.\n */\nexport const ContainerWriterProjectionWireResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n loosePlainObject({\n bundles: ManifestBundlesSchema,\n omittedBundles: OmittedManifestBundlesSchema,\n ...containerKeyingPathWireShape,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n }).superRefine((projection, context) => {\n refineContainerKeyingPath(projection, context);\n refineManifestBundleReferences(\n projection,\n containerKeyingPathReferences(projection),\n context,\n );\n }),\n [\n containerWriterProjectionPathKekCountRefinement,\n writerProjectionManifestBundlesRefinement,\n ],\n );\n\nexport type ContainerWriterProjectionWireResponse = z.infer<\n typeof ContainerWriterProjectionWireResponseSchema\n>;\n\nexport const ContainerSummaryResponseSchema = loosePlainObject({\n createdAt: z.string(),\n depth: nonNegativeIntegerSchema,\n effectiveAccessLevel: EffectiveAccessLevelSchema,\n id: z.string(),\n metadataAccessEpoch: z.number(),\n metadataAccessStateHash: nonEmptyStringSchema,\n metadataDocumentId: z.string(),\n metadataReferencedPrincipals: arraySchema(\n ReferencedPrincipalStateResponseSchema,\n ),\n organizationId: z.string(),\n parentId: z.string().nullable(),\n systemSlot: ContainerSystemSlotSchema.nullable().optional(),\n updatedAt: z.string(),\n});\n\nexport type ContainerSummary = z.infer<typeof ContainerSummaryResponseSchema>;\n\nexport const ContainerSyncTombstoneResponseSchema = loosePlainObject({\n containerId: z.string(),\n depth: nonNegativeIntegerSchema,\n parentId: z.string().nullable(),\n reason: z.literal([\"access_revoked\", \"deleted\"]),\n updatedAt: z.string(),\n});\n\nexport type ContainerSyncTombstone = z.infer<\n typeof ContainerSyncTombstoneResponseSchema\n>;\n\nexport const ListContainersResponseSchema = loosePlainObject({\n hasMore: z.boolean(),\n items: arraySchema(ContainerSummaryResponseSchema),\n nextWatermark: SyncWatermarkSchema.nullable(),\n tombstones: arraySchema(ContainerSyncTombstoneResponseSchema),\n});\n\nexport type ListContainersResponse = z.infer<\n typeof ListContainersResponseSchema\n>;\n\nexport function isListContainersResponse(\n value: unknown,\n): value is ListContainersResponse {\n return ListContainersResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerMutationResponse(\n value: unknown,\n): value is ContainerMutationResponse {\n return ContainerMutationResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerDeleteResponse(\n value: unknown,\n): value is ContainerDeleteResponse {\n return ContainerDeleteResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerWriterProjectionResponse(\n value: unknown,\n): value is ContainerWriterProjectionResponse {\n return ContainerWriterProjectionResponseSchema.safeParse(value).success;\n}\n\nexport function isContainerWriterProjectionWireResponse(\n value: unknown,\n): value is ContainerWriterProjectionWireResponse {\n return ContainerWriterProjectionWireResponseSchema.safeParse(value).success;\n}\n"]}
@@ -1248,11 +1248,6 @@ export declare const DocumentWriterProjectionResponseSchema: z.ZodType<{
1248
1248
  manifestHash: string;
1249
1249
  state: Record<string, unknown>;
1250
1250
  }[];
1251
- historyPrefixes?: {
1252
- key: string;
1253
- count: number;
1254
- digest: string;
1255
- }[] | undefined;
1256
1251
  contentKeyBundleStale?: true | undefined;
1257
1252
  }, {
1258
1253
  policyEvidence: {
@@ -1405,11 +1400,6 @@ export declare const DocumentWriterProjectionResponseSchema: z.ZodType<{
1405
1400
  manifestHash: string;
1406
1401
  state: Record<string, unknown>;
1407
1402
  }[];
1408
- historyPrefixes?: {
1409
- key: string;
1410
- count: number;
1411
- digest: string;
1412
- }[] | undefined;
1413
1403
  contentKeyBundleStale?: true | undefined;
1414
1404
  }, z.core.$ZodTypeInternals<{
1415
1405
  policyEvidence: {
@@ -1562,11 +1552,6 @@ export declare const DocumentWriterProjectionResponseSchema: z.ZodType<{
1562
1552
  manifestHash: string;
1563
1553
  state: Record<string, unknown>;
1564
1554
  }[];
1565
- historyPrefixes?: {
1566
- key: string;
1567
- count: number;
1568
- digest: string;
1569
- }[] | undefined;
1570
1555
  contentKeyBundleStale?: true | undefined;
1571
1556
  }, {
1572
1557
  policyEvidence: {
@@ -1719,14 +1704,448 @@ export declare const DocumentWriterProjectionResponseSchema: z.ZodType<{
1719
1704
  manifestHash: string;
1720
1705
  state: Record<string, unknown>;
1721
1706
  }[];
1722
- historyPrefixes?: {
1723
- key: string;
1724
- count: number;
1725
- digest: string;
1726
- }[] | undefined;
1727
1707
  contentKeyBundleStale?: true | undefined;
1728
1708
  }>>;
1729
1709
  export type DocumentWriterProjectionResponse = z.infer<typeof DocumentWriterProjectionResponseSchema>;
1710
+ /** The served shape; see ContainerWriterProjectionWireResponseSchema. */
1711
+ export declare const DocumentWriterProjectionWireResponseSchema: z.ZodType<{
1712
+ bundles: Record<string, {
1713
+ event: {
1714
+ body: unknown;
1715
+ event: Record<string, unknown>;
1716
+ eventHash: string;
1717
+ };
1718
+ manifest: Record<string, unknown>;
1719
+ manifestHash: string;
1720
+ state: Record<string, unknown>;
1721
+ }>;
1722
+ omittedBundles: string[];
1723
+ policyEvidence: {
1724
+ organization: {
1725
+ head: {
1726
+ keyEpoch: number;
1727
+ keyFingerprint: string;
1728
+ principalId: string;
1729
+ principalType: "group" | "organization";
1730
+ stateHash: string;
1731
+ version: number;
1732
+ };
1733
+ grant: string;
1734
+ } | null;
1735
+ organizationPayloads: {
1736
+ reference: {
1737
+ keyEpoch: number;
1738
+ keyFingerprint: string;
1739
+ principalId: string;
1740
+ principalType: "group" | "organization";
1741
+ stateHash: string;
1742
+ version: number;
1743
+ };
1744
+ payload: {
1745
+ cipherSuite: "aes-256-gcm";
1746
+ ciphertext: string;
1747
+ ciphertextHash: string;
1748
+ createdAt: string;
1749
+ principalId: string;
1750
+ principalType: "group" | "organization";
1751
+ stateHash: string;
1752
+ };
1753
+ }[];
1754
+ groups: {
1755
+ head: {
1756
+ keyEpoch: number;
1757
+ keyFingerprint: string;
1758
+ principalId: string;
1759
+ principalType: "group" | "organization";
1760
+ stateHash: string;
1761
+ version: number;
1762
+ };
1763
+ grant: string;
1764
+ }[];
1765
+ };
1766
+ authorizingContainerPaths: {
1767
+ containerId: string;
1768
+ containerKeks: {
1769
+ containerManifestHistory: string[];
1770
+ accessManifestHash: string;
1771
+ containerId: string;
1772
+ containerKeyEpoch: number;
1773
+ containerKeyEpochId: string;
1774
+ keyEpoch: Record<string, unknown>;
1775
+ keyEpochHash: string;
1776
+ keyring: {
1777
+ containerId: string;
1778
+ containerKeyEpochId: string;
1779
+ iv: string;
1780
+ sealed: string;
1781
+ sealingSuite: string;
1782
+ version: number;
1783
+ } | null;
1784
+ keyTargetHash: string;
1785
+ parentContainerKeyEpochId: string | null;
1786
+ recipientTargets: Record<string, unknown>[];
1787
+ wraps: Record<string, unknown>[];
1788
+ }[];
1789
+ organizationId: string;
1790
+ path: string[];
1791
+ }[];
1792
+ contentKeyBundle: {
1793
+ contentKeyEpoch: number;
1794
+ documentId: string;
1795
+ linkSetManifestHash: string;
1796
+ targetHash: string;
1797
+ targets: {
1798
+ containerId: string;
1799
+ containerKeyEpoch: number;
1800
+ containerKeyEpochId: string;
1801
+ containerManifestHash: string;
1802
+ wrappedKey: string;
1803
+ wrappingMetadata: Record<string, unknown>;
1804
+ }[];
1805
+ };
1806
+ documentContainerManifestHistory: string[];
1807
+ documentId: string;
1808
+ documentKekTargets: {
1809
+ documentId: string;
1810
+ documentKeyTargetHash: string;
1811
+ linkedContainerKeyEpochIds: string[];
1812
+ linkedContainerManifestHashes: string[];
1813
+ linkSetManifestHash: string;
1814
+ targets: Record<string, unknown>[];
1815
+ };
1816
+ documentManifest: string;
1817
+ documentManifestContainerPaths: string[][];
1818
+ documentManifestHistory: string[];
1819
+ contentKeyBundleStale?: true | undefined;
1820
+ }, {
1821
+ bundles: Record<string, {
1822
+ event: {
1823
+ body: unknown;
1824
+ event: Record<string, unknown>;
1825
+ eventHash: string;
1826
+ };
1827
+ manifest: Record<string, unknown>;
1828
+ manifestHash: string;
1829
+ state: Record<string, unknown>;
1830
+ }>;
1831
+ omittedBundles: string[];
1832
+ policyEvidence: {
1833
+ organization: {
1834
+ head: {
1835
+ keyEpoch: number;
1836
+ keyFingerprint: string;
1837
+ principalId: string;
1838
+ principalType: "group" | "organization";
1839
+ stateHash: string;
1840
+ version: number;
1841
+ };
1842
+ grant: string;
1843
+ } | null;
1844
+ organizationPayloads: {
1845
+ reference: {
1846
+ keyEpoch: number;
1847
+ keyFingerprint: string;
1848
+ principalId: string;
1849
+ principalType: "group" | "organization";
1850
+ stateHash: string;
1851
+ version: number;
1852
+ };
1853
+ payload: {
1854
+ cipherSuite: "aes-256-gcm";
1855
+ ciphertext: string;
1856
+ ciphertextHash: string;
1857
+ createdAt: string;
1858
+ principalId: string;
1859
+ principalType: "group" | "organization";
1860
+ stateHash: string;
1861
+ };
1862
+ }[];
1863
+ groups: {
1864
+ head: {
1865
+ keyEpoch: number;
1866
+ keyFingerprint: string;
1867
+ principalId: string;
1868
+ principalType: "group" | "organization";
1869
+ stateHash: string;
1870
+ version: number;
1871
+ };
1872
+ grant: string;
1873
+ }[];
1874
+ };
1875
+ authorizingContainerPaths: {
1876
+ containerId: string;
1877
+ containerKeks: {
1878
+ containerManifestHistory: string[];
1879
+ accessManifestHash: string;
1880
+ containerId: string;
1881
+ containerKeyEpoch: number;
1882
+ containerKeyEpochId: string;
1883
+ keyEpoch: Record<string, unknown>;
1884
+ keyEpochHash: string;
1885
+ keyring: {
1886
+ containerId: string;
1887
+ containerKeyEpochId: string;
1888
+ iv: string;
1889
+ sealed: string;
1890
+ sealingSuite: string;
1891
+ version: number;
1892
+ } | null;
1893
+ keyTargetHash: string;
1894
+ parentContainerKeyEpochId: string | null;
1895
+ recipientTargets: Record<string, unknown>[];
1896
+ wraps: Record<string, unknown>[];
1897
+ }[];
1898
+ organizationId: string;
1899
+ path: string[];
1900
+ }[];
1901
+ contentKeyBundle: {
1902
+ contentKeyEpoch: number;
1903
+ documentId: string;
1904
+ linkSetManifestHash: string;
1905
+ targetHash: string;
1906
+ targets: {
1907
+ containerId: string;
1908
+ containerKeyEpoch: number;
1909
+ containerKeyEpochId: string;
1910
+ containerManifestHash: string;
1911
+ wrappedKey: string;
1912
+ wrappingMetadata: Record<string, unknown>;
1913
+ }[];
1914
+ };
1915
+ documentContainerManifestHistory: string[];
1916
+ documentId: string;
1917
+ documentKekTargets: {
1918
+ documentId: string;
1919
+ documentKeyTargetHash: string;
1920
+ linkedContainerKeyEpochIds: string[];
1921
+ linkedContainerManifestHashes: string[];
1922
+ linkSetManifestHash: string;
1923
+ targets: Record<string, unknown>[];
1924
+ };
1925
+ documentManifest: string;
1926
+ documentManifestContainerPaths: string[][];
1927
+ documentManifestHistory: string[];
1928
+ contentKeyBundleStale?: true | undefined;
1929
+ }, z.core.$ZodTypeInternals<{
1930
+ bundles: Record<string, {
1931
+ event: {
1932
+ body: unknown;
1933
+ event: Record<string, unknown>;
1934
+ eventHash: string;
1935
+ };
1936
+ manifest: Record<string, unknown>;
1937
+ manifestHash: string;
1938
+ state: Record<string, unknown>;
1939
+ }>;
1940
+ omittedBundles: string[];
1941
+ policyEvidence: {
1942
+ organization: {
1943
+ head: {
1944
+ keyEpoch: number;
1945
+ keyFingerprint: string;
1946
+ principalId: string;
1947
+ principalType: "group" | "organization";
1948
+ stateHash: string;
1949
+ version: number;
1950
+ };
1951
+ grant: string;
1952
+ } | null;
1953
+ organizationPayloads: {
1954
+ reference: {
1955
+ keyEpoch: number;
1956
+ keyFingerprint: string;
1957
+ principalId: string;
1958
+ principalType: "group" | "organization";
1959
+ stateHash: string;
1960
+ version: number;
1961
+ };
1962
+ payload: {
1963
+ cipherSuite: "aes-256-gcm";
1964
+ ciphertext: string;
1965
+ ciphertextHash: string;
1966
+ createdAt: string;
1967
+ principalId: string;
1968
+ principalType: "group" | "organization";
1969
+ stateHash: string;
1970
+ };
1971
+ }[];
1972
+ groups: {
1973
+ head: {
1974
+ keyEpoch: number;
1975
+ keyFingerprint: string;
1976
+ principalId: string;
1977
+ principalType: "group" | "organization";
1978
+ stateHash: string;
1979
+ version: number;
1980
+ };
1981
+ grant: string;
1982
+ }[];
1983
+ };
1984
+ authorizingContainerPaths: {
1985
+ containerId: string;
1986
+ containerKeks: {
1987
+ containerManifestHistory: string[];
1988
+ accessManifestHash: string;
1989
+ containerId: string;
1990
+ containerKeyEpoch: number;
1991
+ containerKeyEpochId: string;
1992
+ keyEpoch: Record<string, unknown>;
1993
+ keyEpochHash: string;
1994
+ keyring: {
1995
+ containerId: string;
1996
+ containerKeyEpochId: string;
1997
+ iv: string;
1998
+ sealed: string;
1999
+ sealingSuite: string;
2000
+ version: number;
2001
+ } | null;
2002
+ keyTargetHash: string;
2003
+ parentContainerKeyEpochId: string | null;
2004
+ recipientTargets: Record<string, unknown>[];
2005
+ wraps: Record<string, unknown>[];
2006
+ }[];
2007
+ organizationId: string;
2008
+ path: string[];
2009
+ }[];
2010
+ contentKeyBundle: {
2011
+ contentKeyEpoch: number;
2012
+ documentId: string;
2013
+ linkSetManifestHash: string;
2014
+ targetHash: string;
2015
+ targets: {
2016
+ containerId: string;
2017
+ containerKeyEpoch: number;
2018
+ containerKeyEpochId: string;
2019
+ containerManifestHash: string;
2020
+ wrappedKey: string;
2021
+ wrappingMetadata: Record<string, unknown>;
2022
+ }[];
2023
+ };
2024
+ documentContainerManifestHistory: string[];
2025
+ documentId: string;
2026
+ documentKekTargets: {
2027
+ documentId: string;
2028
+ documentKeyTargetHash: string;
2029
+ linkedContainerKeyEpochIds: string[];
2030
+ linkedContainerManifestHashes: string[];
2031
+ linkSetManifestHash: string;
2032
+ targets: Record<string, unknown>[];
2033
+ };
2034
+ documentManifest: string;
2035
+ documentManifestContainerPaths: string[][];
2036
+ documentManifestHistory: string[];
2037
+ contentKeyBundleStale?: true | undefined;
2038
+ }, {
2039
+ bundles: Record<string, {
2040
+ event: {
2041
+ body: unknown;
2042
+ event: Record<string, unknown>;
2043
+ eventHash: string;
2044
+ };
2045
+ manifest: Record<string, unknown>;
2046
+ manifestHash: string;
2047
+ state: Record<string, unknown>;
2048
+ }>;
2049
+ omittedBundles: string[];
2050
+ policyEvidence: {
2051
+ organization: {
2052
+ head: {
2053
+ keyEpoch: number;
2054
+ keyFingerprint: string;
2055
+ principalId: string;
2056
+ principalType: "group" | "organization";
2057
+ stateHash: string;
2058
+ version: number;
2059
+ };
2060
+ grant: string;
2061
+ } | null;
2062
+ organizationPayloads: {
2063
+ reference: {
2064
+ keyEpoch: number;
2065
+ keyFingerprint: string;
2066
+ principalId: string;
2067
+ principalType: "group" | "organization";
2068
+ stateHash: string;
2069
+ version: number;
2070
+ };
2071
+ payload: {
2072
+ cipherSuite: "aes-256-gcm";
2073
+ ciphertext: string;
2074
+ ciphertextHash: string;
2075
+ createdAt: string;
2076
+ principalId: string;
2077
+ principalType: "group" | "organization";
2078
+ stateHash: string;
2079
+ };
2080
+ }[];
2081
+ groups: {
2082
+ head: {
2083
+ keyEpoch: number;
2084
+ keyFingerprint: string;
2085
+ principalId: string;
2086
+ principalType: "group" | "organization";
2087
+ stateHash: string;
2088
+ version: number;
2089
+ };
2090
+ grant: string;
2091
+ }[];
2092
+ };
2093
+ authorizingContainerPaths: {
2094
+ containerId: string;
2095
+ containerKeks: {
2096
+ containerManifestHistory: string[];
2097
+ accessManifestHash: string;
2098
+ containerId: string;
2099
+ containerKeyEpoch: number;
2100
+ containerKeyEpochId: string;
2101
+ keyEpoch: Record<string, unknown>;
2102
+ keyEpochHash: string;
2103
+ keyring: {
2104
+ containerId: string;
2105
+ containerKeyEpochId: string;
2106
+ iv: string;
2107
+ sealed: string;
2108
+ sealingSuite: string;
2109
+ version: number;
2110
+ } | null;
2111
+ keyTargetHash: string;
2112
+ parentContainerKeyEpochId: string | null;
2113
+ recipientTargets: Record<string, unknown>[];
2114
+ wraps: Record<string, unknown>[];
2115
+ }[];
2116
+ organizationId: string;
2117
+ path: string[];
2118
+ }[];
2119
+ contentKeyBundle: {
2120
+ contentKeyEpoch: number;
2121
+ documentId: string;
2122
+ linkSetManifestHash: string;
2123
+ targetHash: string;
2124
+ targets: {
2125
+ containerId: string;
2126
+ containerKeyEpoch: number;
2127
+ containerKeyEpochId: string;
2128
+ containerManifestHash: string;
2129
+ wrappedKey: string;
2130
+ wrappingMetadata: Record<string, unknown>;
2131
+ }[];
2132
+ };
2133
+ documentContainerManifestHistory: string[];
2134
+ documentId: string;
2135
+ documentKekTargets: {
2136
+ documentId: string;
2137
+ documentKeyTargetHash: string;
2138
+ linkedContainerKeyEpochIds: string[];
2139
+ linkedContainerManifestHashes: string[];
2140
+ linkSetManifestHash: string;
2141
+ targets: Record<string, unknown>[];
2142
+ };
2143
+ documentManifest: string;
2144
+ documentManifestContainerPaths: string[][];
2145
+ documentManifestHistory: string[];
2146
+ contentKeyBundleStale?: true | undefined;
2147
+ }>>;
2148
+ export type DocumentWriterProjectionWireResponse = z.infer<typeof DocumentWriterProjectionWireResponseSchema>;
1730
2149
  /**
1731
2150
  * Derives the KEK-target summary that corresponds to a content-key bundle,
1732
2151
  * preserving the bundle's served target order. Both the API (for stale-bundle
@@ -1743,3 +2162,4 @@ export declare function isDocumentPurgeResponse(value: unknown): value is Docume
1743
2162
  export declare function isDocumentPurgeProofResponse(value: unknown): value is DocumentPurgeProofResponse;
1744
2163
  export declare function isDocumentSyncResponse(value: unknown): value is DocumentSyncResponse;
1745
2164
  export declare function isDocumentWriterProjectionResponse(value: unknown): value is DocumentWriterProjectionResponse;
2165
+ export declare function isDocumentWriterProjectionWireResponse(value: unknown): value is DocumentWriterProjectionWireResponse;