@tearleads/client-sdk 0.1.243 → 0.1.246

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/client/organizations/principalMutations.d.ts +5 -0
  2. package/data/containers/shared/mutationAcknowledgement.d.ts +1 -1
  3. package/data/containers/shared/mutationAcknowledgement.js +3 -8
  4. package/data/containers/shared/mutationAcknowledgement.js.map +1 -1
  5. package/data/documents/shared/sync/mutationAcknowledgement.js +11 -2
  6. package/data/documents/shared/sync/mutationAcknowledgement.js.map +1 -1
  7. package/data/keyingProjectionVerification/checkpoints/heldBundleRecovery.d.ts +26 -0
  8. package/data/keyingProjectionVerification/checkpoints/heldBundleRecovery.js +46 -0
  9. package/data/keyingProjectionVerification/checkpoints/heldBundleRecovery.js.map +1 -0
  10. package/data/keyingProjectionVerification/container/containerDestinationVerification.d.ts +7 -4
  11. package/data/keyingProjectionVerification/container/containerDestinationVerification.js +5 -1
  12. package/data/keyingProjectionVerification/container/containerDestinationVerification.js.map +1 -1
  13. package/data/keyingProjectionVerification/container/containerProjectionVerification.js +9 -2
  14. package/data/keyingProjectionVerification/container/containerProjectionVerification.js.map +1 -1
  15. package/data/keyingProjectionVerification/document/documentContainerProjections.js +2 -1
  16. package/data/keyingProjectionVerification/document/documentContainerProjections.js.map +1 -1
  17. package/data/keyingProjectionVerification/document/documentProjectionVerification.js +9 -2
  18. package/data/keyingProjectionVerification/document/documentProjectionVerification.js.map +1 -1
  19. package/data/keyingProjectionVerification/index.d.ts +1 -0
  20. package/data/keyingProjectionVerification/index.js +1 -0
  21. package/data/keyingProjectionVerification/index.js.map +1 -1
  22. package/data/persistence/container-contents/containerContentsPersistence.js +2 -0
  23. package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
  24. package/data/persistence/container-contents/containerContentsPersistenceTypes.d.ts +2 -1
  25. package/data/persistence/container-contents/containerContentsPersistenceTypes.js.map +1 -1
  26. package/data/persistence/container-contents/containerMetadataRevalidations.d.ts +22 -0
  27. package/data/persistence/container-contents/containerMetadataRevalidations.js +52 -0
  28. package/data/persistence/container-contents/containerMetadataRevalidations.js.map +1 -0
  29. package/data/persistence/keyingCheckpoints/keyingCheckpointRepository.js +16 -4
  30. package/data/persistence/keyingCheckpoints/keyingCheckpointRepository.js.map +1 -1
  31. package/data/persistence/keyingCheckpoints/locallyAcknowledgedCheckpointPersistence.d.ts +13 -0
  32. package/data/persistence/keyingCheckpoints/locallyAcknowledgedCheckpointPersistence.js +11 -0
  33. package/data/persistence/keyingCheckpoints/locallyAcknowledgedCheckpointPersistence.js.map +1 -1
  34. package/data/persistence/verifiedCitations/authoredBundleCitation.d.ts +20 -0
  35. package/data/persistence/verifiedCitations/authoredBundleCitation.js +32 -0
  36. package/data/persistence/verifiedCitations/authoredBundleCitation.js.map +1 -0
  37. package/data/persistence/verifiedManifestBundlePersistence.d.ts +10 -0
  38. package/data/persistence/verifiedManifestBundlePersistence.js +95 -9
  39. package/data/persistence/verifiedManifestBundlePersistence.js.map +1 -1
  40. package/data/sqlite/schema/containerSchema.d.ts +173 -0
  41. package/data/sqlite/schema/containerSchema.js +18 -0
  42. package/data/sqlite/schema/containerSchema.js.map +1 -1
  43. package/data/sqlite/schema/index.d.ts +84 -1
  44. package/data/sqlite/schema/index.js +1 -1
  45. package/data/sqlite/schema/index.js.map +1 -1
  46. package/internal/api-client/ApiClient.d.ts +56 -8
  47. package/internal/api-client/client/apiClientContext.d.ts +1 -0
  48. package/internal/api-client/client/containerMutations.d.ts +11 -0
  49. package/internal/api-client/client/containerReads.d.ts +1 -0
  50. package/internal/api-client/client/documents.d.ts +5 -0
  51. package/internal/api-client/client/organizations.d.ts +20 -0
  52. package/internal/api-client/client/principalPolicies.d.ts +9 -0
  53. package/internal/api-client/client/session.d.ts +10 -0
  54. package/internal/api-client/principalPolicyRequests.d.ts +7 -0
  55. package/internal/api-client/writerProjectionCitations.d.ts +3 -0
  56. package/internal/api-client/writerProjectionCitations.js +12 -0
  57. package/internal/api-client/writerProjectionCitations.js.map +1 -1
  58. package/internal/crypto/index.d.ts +1 -1
  59. package/internal/crypto/index.js +1 -1
  60. package/internal/crypto/index.js.map +1 -1
  61. package/internal/crypto/keying/accessManifestVerificationTypes.d.ts +8 -2
  62. package/internal/crypto/keying/accessManifestVerificationTypes.js.map +1 -1
  63. package/internal/crypto/keying/canonicalJsonGuard.d.ts +13 -0
  64. package/internal/crypto/keying/canonicalJsonGuard.js +23 -0
  65. package/internal/crypto/keying/canonicalJsonGuard.js.map +1 -1
  66. package/internal/crypto/keying/containerAccess.js +1 -1
  67. package/internal/crypto/keying/containerAccess.js.map +1 -1
  68. package/internal/crypto/keying/documentAccess.js +1 -1
  69. package/internal/crypto/keying/documentAccess.js.map +1 -1
  70. package/internal/crypto/keying/index.d.ts +1 -1
  71. package/internal/crypto/keying/index.js +1 -1
  72. package/internal/crypto/keying/index.js.map +1 -1
  73. package/internal/crypto/keying/keyingHashDomains.d.ts +1 -1
  74. package/internal/crypto/keying/keyingHashDomains.js.map +1 -1
  75. package/internal/crypto/organizationReplacement.js +5 -6
  76. package/internal/crypto/organizationReplacement.js.map +1 -1
  77. package/internal/loro/document.d.ts +5 -0
  78. package/internal/loro/document.js +17 -0
  79. package/internal/loro/document.js.map +1 -1
  80. package/internal/loro/index.d.ts +1 -1
  81. package/internal/loro/index.js +1 -1
  82. package/internal/loro/index.js.map +1 -1
  83. package/internal/validators/operation/attachments.d.ts +0 -12
  84. package/internal/validators/operation/auth.d.ts +40 -76
  85. package/internal/validators/operation/containerMutations.d.ts +45 -49
  86. package/internal/validators/operation/containerMutations.js +1 -1
  87. package/internal/validators/operation/containerMutations.js.map +1 -1
  88. package/internal/validators/operation/containerReads.d.ts +2 -0
  89. package/internal/validators/operation/documentMutations.d.ts +12 -24
  90. package/internal/validators/operation/documentSync.d.ts +0 -4
  91. package/internal/validators/operation/organizations.d.ts +48 -88
  92. package/internal/validators/operation/principals.d.ts +16 -16
  93. package/internal/validators/request/blob.d.ts +0 -12
  94. package/internal/validators/request/container.d.ts +0 -16
  95. package/internal/validators/request/container.js +0 -2
  96. package/internal/validators/request/container.js.map +1 -1
  97. package/internal/validators/request/containerMetadata.d.ts +0 -20
  98. package/internal/validators/request/document.d.ts +0 -22
  99. package/internal/validators/request/document.js +0 -1
  100. package/internal/validators/request/document.js.map +1 -1
  101. package/internal/validators/request/documentSyncSchema.d.ts +0 -4
  102. package/internal/validators/request/documentSyncSchema.js +0 -1
  103. package/internal/validators/request/documentSyncSchema.js.map +1 -1
  104. package/internal/validators/request/organization.d.ts +0 -16
  105. package/internal/validators/request/organizationProvisioning.d.ts +0 -242
  106. package/internal/validators/request/principal.d.ts +0 -20
  107. package/internal/validators/request/registration.d.ts +0 -76
  108. package/internal/validators/response/areas/containers.d.ts +1 -1
  109. package/internal/validators/response/areas/containers.js +1 -1
  110. package/internal/validators/response/areas/containers.js.map +1 -1
  111. package/internal/validators/response/container.d.ts +24 -0
  112. package/internal/validators/response/container.js +4 -0
  113. package/internal/validators/response/container.js.map +1 -1
  114. package/internal/validators/response/containerMetadata.d.ts +8 -0
  115. package/internal/validators/response/containerParentLanes.d.ts +2 -0
  116. package/internal/validators/response/documentMutation.d.ts +8 -0
  117. package/internal/validators/response/documentMutation.js +2 -1
  118. package/internal/validators/response/documentMutation.js.map +1 -1
  119. package/internal/validators/response/organization.d.ts +8 -0
  120. package/internal/validators/response/organizationProvisioning.d.ts +113 -0
  121. package/internal/validators/response/organizationProvisioning.js +2 -1
  122. package/internal/validators/response/organizationProvisioning.js.map +1 -1
  123. package/internal/validators/response/principal.d.ts +16 -0
  124. package/internal/validators/response/registration.d.ts +40 -0
  125. package/internal/validators/response/writerProjectionWire.d.ts +25 -0
  126. package/internal/validators/response/writerProjectionWire.js +109 -3
  127. package/internal/validators/response/writerProjectionWire.js.map +1 -1
  128. package/package.json +1 -1
  129. package/stores/container-contents/containerContentsStore.js +2 -0
  130. package/stores/container-contents/containerContentsStore.js.map +1 -1
  131. package/stores/container-contents/hydration/startupHydration.js +6 -2
  132. package/stores/container-contents/hydration/startupHydration.js.map +1 -1
  133. package/stores/container-contents/state.js +5 -1
  134. package/stores/container-contents/state.js.map +1 -1
  135. package/stores/container-contents/syncAgent/metadataRevalidation.js +79 -0
  136. package/stores/container-contents/syncAgent/metadataRevalidation.js.map +1 -0
  137. package/stores/container-contents/syncAgent/syncAgentTypes.d.ts +6 -0
  138. package/stores/container-contents/syncAgent/syncAgentTypes.js.map +1 -1
  139. package/stores/container-contents/syncAgent/syncLaneIteration.js +110 -23
  140. package/stores/container-contents/syncAgent/syncLaneIteration.js.map +1 -1
  141. package/stores/documents/documentStore/rotation/index.js +3 -1
  142. package/stores/documents/documentStore/rotation/index.js.map +1 -1
  143. package/stores/documents/documentStore/sync/syncAttachments.js +4 -1
  144. package/stores/documents/documentStore/sync/syncAttachments.js.map +1 -1
  145. package/stores/documents/documentStore/sync/syncDetachedAttachments.js +3 -1
  146. package/stores/documents/documentStore/sync/syncDetachedAttachments.js.map +1 -1
  147. package/stores/documents/documentStore/sync/syncRequest.js +3 -1
  148. package/stores/documents/documentStore/sync/syncRequest.js.map +1 -1
  149. package/workflows/container-contents/container-state/create/createAdoption.js +11 -3
  150. package/workflows/container-contents/container-state/create/createAdoption.js.map +1 -1
  151. package/workflows/container-contents/container-state/create/createWithMetadata.js +2 -2
  152. package/workflows/container-contents/container-state/create/createWithMetadata.js.map +1 -1
  153. package/workflows/container-contents/container-state/move/acceptedMoveSettlement.js +3 -0
  154. package/workflows/container-contents/container-state/move/acceptedMoveSettlement.js.map +1 -1
  155. package/workflows/container-contents/container-state/projectionCache.js +3 -0
  156. package/workflows/container-contents/container-state/projectionCache.js.map +1 -1
  157. package/workflows/container-contents/container-state/remote.js +3 -0
  158. package/workflows/container-contents/container-state/remote.js.map +1 -1
  159. package/workflows/container-contents/containerPersistence.d.ts +1 -0
  160. package/workflows/container-contents/containerPersistence.js.map +1 -1
  161. package/workflows/container-contents/metadata/index.js +9 -3
  162. package/workflows/container-contents/metadata/index.js.map +1 -1
  163. package/workflows/container-contents/metadata/metadataSyncFollowup.js +9 -0
  164. package/workflows/container-contents/metadata/metadataSyncFollowup.js.map +1 -1
  165. package/workflows/container-contents/metadata/metadataTypes.d.ts +2 -0
  166. package/workflows/container-contents/metadata/metadataTypes.js.map +1 -1
  167. package/workflows/container-contents/remoteHydration/index.js +9 -0
  168. package/workflows/container-contents/remoteHydration/index.js.map +1 -1
  169. package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerState.js +31 -0
  170. package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerState.js.map +1 -1
  171. package/workflows/container-contents/remoteHydration/types.d.ts +9 -1
  172. package/workflows/container-contents/remoteHydration/types.js.map +1 -1
  173. package/workflows/containers/child/mutationRequestCore.js +1 -1
  174. package/workflows/containers/child/mutationRequestCore.js.map +1 -1
  175. package/workflows/containers/child/recite.js +4 -2
  176. package/workflows/containers/child/recite.js.map +1 -1
  177. package/workflows/containers/child/recitePlan.js +0 -1
  178. package/workflows/containers/child/recitePlan.js.map +1 -1
  179. package/workflows/containers/root/create.js +0 -1
  180. package/workflows/containers/root/create.js.map +1 -1
  181. package/workflows/documents/create/createAdoption.js +11 -2
  182. package/workflows/documents/create/createAdoption.js.map +1 -1
  183. package/workflows/documents/create/createResponse.js +1 -0
  184. package/workflows/documents/create/createResponse.js.map +1 -1
  185. package/workflows/documents/linkSet/index.js +0 -1
  186. package/workflows/documents/linkSet/index.js.map +1 -1
  187. package/workflows/documents/linkSet/linkSetRemote.js +1 -0
  188. package/workflows/documents/linkSet/linkSetRemote.js.map +1 -1
  189. package/workflows/documents/sync/syncAttemptPlanning.js +8 -2
  190. package/workflows/documents/sync/syncAttemptPlanning.js.map +1 -1
  191. package/workflows/documents/syncRekeys/syncAutomaticContainerRekeys.js +3 -2
  192. package/workflows/documents/syncRekeys/syncAutomaticContainerRekeys.js.map +1 -1
  193. package/workflows/documents/syncRekeys/syncContainerRekeyProjection.js +3 -2
  194. package/workflows/documents/syncRekeys/syncContainerRekeyProjection.js.map +1 -1
  195. package/workflows/organizations/principalPolicy/principalPolicyReceiptArtifacts.js +17 -10
  196. package/workflows/organizations/principalPolicy/principalPolicyReceiptArtifacts.js.map +1 -1
  197. package/workflows/registration/organizationCreation/organizationCreationIntent.d.ts +10 -0
  198. package/workflows/registration/provisioningAcknowledgement.js +16 -11
  199. package/workflows/registration/provisioningAcknowledgement.js.map +1 -1
  200. package/workflows/registration/provisioningBootstrapBuilders.d.ts +0 -2
@@ -31,7 +31,7 @@ export const createContainerOperation = defineJsonOperation({
31
31
  failureStatuses: containerMutationFailureStatuses,
32
32
  id: "containers.create",
33
33
  summary: "Create a container",
34
- description: "Creates a container from a signed `container.create` event, its derived access manifest, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.",
34
+ description: "Creates a container from a signed `container.create` event, the hash of the access manifest it derives, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.",
35
35
  method: "POST",
36
36
  params: EmptyContainerMutationPathParamsSchema,
37
37
  path: "/containers",
@@ -1 +1 @@
1
- {"version":3,"file":"containerMutations.js","sourceRoot":"","sources":["containerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,kDAAkD,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EACL,gDAAgD,EAChD,8BAA8B,EAC9B,4BAA4B,EAC5B,8BAA8B,EAC9B,4CAA4C,EAC5C,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YA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AiC;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;IACrE,EAAE,EAAE,iBAAiB;IACrB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,uRAAuR;IACzR,IAAI,EAAE,gCAAgC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;IAC1D,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE;QAChB,GAAG,iCAAiC;QACpC,GAAG,EAAE,oCAAoC;KAC1C;IACD,eAAe,EAAE,gCAAgC;IACjD,EAAE,EAAE,mBAAmB;IACvB,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EACT,uTAAuT;IACzT,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,iCAAiC;IACzC,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC3E,SAAS,EAAE,EAAE,GAAG,EAAE,6BAA6B,EAAE;CAClD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAC9E,MAAM,CAAC,MAAM,oCAAoC,GAAG,2BAA2B,CAAC;AAChF,MAAM,CAAC,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAC9E,MAAM,CAAC,MAAM,oCAAoC,GAAG,2BAA2B,CAAC;AAChF,MAAM,CAAC,MAAM,qDAAqD,GAChE,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,sDAAsD,GACjE,6CAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { containerCreateMetadataSeedRefinement } from \"../documentCreateSeedRefinements\";\nimport { documentSyncRequestRuntimeRefinements } from \"../documentSyncRefinements\";\nimport { organizationProvisioningContainerKeyringRefinement } from \"../organizationProvisioningRefinements\";\nimport {\n ContainerCreateWithMetadataDocumentRequestSchema,\n ContainerMutationRequestSchema,\n ContainerReciteRequestSchema,\n ContainerRotationRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n isContainerMutationRequest,\n isContainerRotationRequest,\n} from \"../request\";\nimport {\n ContainerCreateWithMetadataDocumentResponseSchema,\n ContainerDeleteResponseSchema,\n ContainerMutationFailureResponseSchema,\n ContainerMutationResponseSchema,\n ContainerNotFoundErrorResponseSchema,\n ContainerReciteResponseSchema,\n ContainerRotationResponseSchema,\n ErrorResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n isContainerDeleteResponse,\n isContainerMutationResponse,\n isContainerRotationResponse,\n PaymentRequiredErrorResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport { defineJsonOperation } from \"./definition\";\n\nconst EmptyContainerMutationPathParamsSchema = z.strictObject({});\n\nexport const ContainerMutationPathParamsSchema = z.strictObject({\n containerId: z.string(),\n});\n\nexport type ContainerMutationPathParams = z.infer<\n typeof ContainerMutationPathParamsSchema\n>;\n\nconst containerMutationFailureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 402: PaymentRequiredErrorResponseSchema,\n 403: ErrorResponseSchema,\n 404: ErrorResponseSchema,\n 409: ContainerMutationFailureResponseSchema,\n 500: ErrorResponseSchema,\n} as const;\n\nconst containerMutationFailureStatuses = [\n 400, 401, 402, 403, 404, 409, 500,\n] as const;\n\nconst containerMutationRuntimeRefinements = [\n organizationProvisioningContainerKeyringRefinement,\n] as const;\n\nexport const createContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.create\",\n summary: \"Create a container\",\n description:\n \"Creates a container from a signed `container.create` event, its derived access manifest, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers\",\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n});\n\nexport const createContainerWithMetadataDocumentOperation = defineJsonOperation(\n {\n auth: \"session\",\n body: ContainerCreateWithMetadataDocumentRequestSchema,\n failureResponses: {\n ...containerMutationFailureResponses,\n 503: ErrorResponseSchema,\n },\n failureStatuses: [...containerMutationFailureStatuses, 503],\n id: \"containers.withMetadataDocument.create\",\n summary: \"Create a container with its metadata document\",\n description:\n \"Creates a container and its encrypted metadata document in one transaction, optionally seeding the document's first update. Authorization and conflicts are those of `POST /containers` and `POST /documents`; a 409 `document_manifest_already_exists` may have rolled the new container back, so clients treat it as terminal unless they verify both artifacts.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers/with-metadata-document\",\n responses: { 200: ContainerCreateWithMetadataDocumentResponseSchema },\n runtimeRefinements: [\n ...containerMutationRuntimeRefinements,\n containerCreateMetadataSeedRefinement,\n ...documentSyncRequestRuntimeRefinements,\n ],\n },\n);\n\nfunction defineContainerMutationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\n/**\n * Rekey, revoke, and move mint a new key epoch, so they alone may carry the\n * descendant rekeys that must commit with them.\n */\nfunction defineContainerRotationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerRotationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerRotationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\nexport const shareContainerOperation = defineContainerMutationOperation({\n id: \"containers.share\",\n summary: \"Share a container\",\n description:\n \"Adds or changes a user or group grant on a container through a signed `container.grant` event, wrapping the current container KEK to the new recipients. Requires admin access through the container's path. Cited heads must be current: a stale container head returns 409 `container_mutation_state_stale`, and a stale principal policy returns 409 `principal_policy_stale` with the current heads.\",\n path: \"/containers/{containerId}/share\",\n});\n\nexport const reciteContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerReciteRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.recite\",\n summary: \"Re-cite a held container's current ancestor path\",\n description:\n \"Advances a container's access manifest so it cites its ancestors' current heads, without changing grants, keys, or parent. Clients call it after changing an ancestor so descendants they already hold stop citing superseded heads. Requires admin access; after 512 epochs the container no longer accepts re-citations.\",\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}/recite\",\n responses: { 200: ContainerReciteResponseSchema },\n});\n\nexport const revokeContainerOperation = defineContainerRotationOperation({\n id: \"containers.revoke\",\n summary: \"Revoke a container grant\",\n description:\n \"Removes a grant from a container through a signed `container.revoke` event and rotates the container KEK so the removed principal cannot read later content. The request carries the new KEK epoch, its predecessor bridge, and the re-sealed container KEK keyring. Requires admin access; stale cited heads return 409.\",\n path: \"/containers/{containerId}/revoke\",\n});\n\nexport const rekeyContainerOperation = defineContainerRotationOperation({\n id: \"containers.rekey\",\n summary: \"Rekey a container\",\n description:\n \"Rotates a container's KEK to a new epoch without changing grants, carrying the predecessor bridge and the re-sealed container KEK keyring. Requires write access. Stale cited heads return 409, and epochs above 65536 are refused.\",\n path: \"/containers/{containerId}/rekey\",\n});\n\nexport const moveContainerOperation = defineContainerRotationOperation({\n id: \"containers.move\",\n summary: \"Move a container\",\n description:\n \"Moves a container under a new parent through a signed `container.move` event and rotates its container KEK. Requires admin access at the source and write access at the destination; root and system containers cannot move. Moving into Trash is an ordinary move and can be undone.\",\n path: \"/containers/{containerId}/move\",\n});\n\nexport const deleteContainerOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses: {\n ...containerMutationFailureResponses,\n 404: ContainerNotFoundErrorResponseSchema,\n },\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.delete\",\n summary: \"Delete a container\",\n description:\n \"Deletes an empty folder: a container with no child containers and no linked user documents, along with its own metadata document. Requires admin access; root and system containers cannot be deleted. Peers learn of the deletion from a sync tombstone, and an unknown container returns 404 `container_not_found`.\",\n method: \"DELETE\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}\",\n query: z.strictObject({ requiredAncestorId: z.string().min(1).optional() }),\n responses: { 200: ContainerDeleteResponseSchema },\n});\n\nexport const isContainerMutationOperationRequest = isContainerMutationRequest;\nexport const isContainerMutationOperationResponse = isContainerMutationResponse;\nexport const isContainerRotationOperationRequest = isContainerRotationRequest;\nexport const isContainerRotationOperationResponse = isContainerRotationResponse;\nexport const isCreateContainerWithMetadataDocumentOperationRequest =\n isContainerCreateWithMetadataDocumentRequest;\nexport const isCreateContainerWithMetadataDocumentOperationResponse =\n isContainerCreateWithMetadataDocumentResponse;\nexport const isDeleteContainerOperationResponse = isContainerDeleteResponse;\n"]}
1
+ {"version":3,"file":"containerMutations.js","sourceRoot":"","sources":["containerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,kCAAkC,CAA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AAqD,GAChE,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,sDAAsD,GACjE,6CAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { containerCreateMetadataSeedRefinement } from \"../documentCreateSeedRefinements\";\nimport { documentSyncRequestRuntimeRefinements } from \"../documentSyncRefinements\";\nimport { organizationProvisioningContainerKeyringRefinement } from \"../organizationProvisioningRefinements\";\nimport {\n ContainerCreateWithMetadataDocumentRequestSchema,\n ContainerMutationRequestSchema,\n ContainerReciteRequestSchema,\n ContainerRotationRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n isContainerMutationRequest,\n isContainerRotationRequest,\n} from \"../request\";\nimport {\n ContainerCreateWithMetadataDocumentResponseSchema,\n ContainerDeleteResponseSchema,\n ContainerMutationFailureResponseSchema,\n ContainerMutationResponseSchema,\n ContainerNotFoundErrorResponseSchema,\n ContainerReciteResponseSchema,\n ContainerRotationResponseSchema,\n ErrorResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n isContainerDeleteResponse,\n isContainerMutationResponse,\n isContainerRotationResponse,\n PaymentRequiredErrorResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport { defineJsonOperation } from \"./definition\";\n\nconst EmptyContainerMutationPathParamsSchema = z.strictObject({});\n\nexport const ContainerMutationPathParamsSchema = z.strictObject({\n containerId: z.string(),\n});\n\nexport type ContainerMutationPathParams = z.infer<\n typeof ContainerMutationPathParamsSchema\n>;\n\nconst containerMutationFailureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 402: PaymentRequiredErrorResponseSchema,\n 403: ErrorResponseSchema,\n 404: ErrorResponseSchema,\n 409: ContainerMutationFailureResponseSchema,\n 500: ErrorResponseSchema,\n} as const;\n\nconst containerMutationFailureStatuses = [\n 400, 401, 402, 403, 404, 409, 500,\n] as const;\n\nconst containerMutationRuntimeRefinements = [\n organizationProvisioningContainerKeyringRefinement,\n] as const;\n\nexport const createContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.create\",\n summary: \"Create a container\",\n description:\n \"Creates a container from a signed `container.create` event, the hash of the access manifest it derives, and the container KEK wrapped to its recipients. Requires write access to the parent container, or admin access for a system container. A retry of a create that already committed returns 409 `container_manifest_already_exists`, which lets the client adopt it; a stale parent returns 409 `container_mutation_state_stale`.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers\",\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n});\n\nexport const createContainerWithMetadataDocumentOperation = defineJsonOperation(\n {\n auth: \"session\",\n body: ContainerCreateWithMetadataDocumentRequestSchema,\n failureResponses: {\n ...containerMutationFailureResponses,\n 503: ErrorResponseSchema,\n },\n failureStatuses: [...containerMutationFailureStatuses, 503],\n id: \"containers.withMetadataDocument.create\",\n summary: \"Create a container with its metadata document\",\n description:\n \"Creates a container and its encrypted metadata document in one transaction, optionally seeding the document's first update. Authorization and conflicts are those of `POST /containers` and `POST /documents`; a 409 `document_manifest_already_exists` may have rolled the new container back, so clients treat it as terminal unless they verify both artifacts.\",\n method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers/with-metadata-document\",\n responses: { 200: ContainerCreateWithMetadataDocumentResponseSchema },\n runtimeRefinements: [\n ...containerMutationRuntimeRefinements,\n containerCreateMetadataSeedRefinement,\n ...documentSyncRequestRuntimeRefinements,\n ],\n },\n);\n\nfunction defineContainerMutationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerMutationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\n/**\n * Rekey, revoke, and move mint a new key epoch, so they alone may carry the\n * descendant rekeys that must commit with them.\n */\nfunction defineContainerRotationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: {\n readonly id: Id;\n readonly path: Path;\n readonly summary: string;\n readonly description: string;\n}) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerRotationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\n summary: input.summary,\n description: input.description,\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: input.path,\n responses: { 200: ContainerRotationResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n });\n}\n\nexport const shareContainerOperation = defineContainerMutationOperation({\n id: \"containers.share\",\n summary: \"Share a container\",\n description:\n \"Adds or changes a user or group grant on a container through a signed `container.grant` event, wrapping the current container KEK to the new recipients. Requires admin access through the container's path. Cited heads must be current: a stale container head returns 409 `container_mutation_state_stale`, and a stale principal policy returns 409 `principal_policy_stale` with the current heads.\",\n path: \"/containers/{containerId}/share\",\n});\n\nexport const reciteContainerOperation = defineJsonOperation({\n auth: \"session\",\n body: ContainerReciteRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.recite\",\n summary: \"Re-cite a held container's current ancestor path\",\n description:\n \"Advances a container's access manifest so it cites its ancestors' current heads, without changing grants, keys, or parent. Clients call it after changing an ancestor so descendants they already hold stop citing superseded heads. Requires admin access; after 512 epochs the container no longer accepts re-citations.\",\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}/recite\",\n responses: { 200: ContainerReciteResponseSchema },\n});\n\nexport const revokeContainerOperation = defineContainerRotationOperation({\n id: \"containers.revoke\",\n summary: \"Revoke a container grant\",\n description:\n \"Removes a grant from a container through a signed `container.revoke` event and rotates the container KEK so the removed principal cannot read later content. The request carries the new KEK epoch, its predecessor bridge, and the re-sealed container KEK keyring. Requires admin access; stale cited heads return 409.\",\n path: \"/containers/{containerId}/revoke\",\n});\n\nexport const rekeyContainerOperation = defineContainerRotationOperation({\n id: \"containers.rekey\",\n summary: \"Rekey a container\",\n description:\n \"Rotates a container's KEK to a new epoch without changing grants, carrying the predecessor bridge and the re-sealed container KEK keyring. Requires write access. Stale cited heads return 409, and epochs above 65536 are refused.\",\n path: \"/containers/{containerId}/rekey\",\n});\n\nexport const moveContainerOperation = defineContainerRotationOperation({\n id: \"containers.move\",\n summary: \"Move a container\",\n description:\n \"Moves a container under a new parent through a signed `container.move` event and rotates its container KEK. Requires admin access at the source and write access at the destination; root and system containers cannot move. Moving into Trash is an ordinary move and can be undone.\",\n path: \"/containers/{containerId}/move\",\n});\n\nexport const deleteContainerOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses: {\n ...containerMutationFailureResponses,\n 404: ContainerNotFoundErrorResponseSchema,\n },\n failureStatuses: containerMutationFailureStatuses,\n id: \"containers.delete\",\n summary: \"Delete a container\",\n description:\n \"Deletes an empty folder: a container with no child containers and no linked user documents, along with its own metadata document. Requires admin access; root and system containers cannot be deleted. Peers learn of the deletion from a sync tombstone, and an unknown container returns 404 `container_not_found`.\",\n method: \"DELETE\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}\",\n query: z.strictObject({ requiredAncestorId: z.string().min(1).optional() }),\n responses: { 200: ContainerDeleteResponseSchema },\n});\n\nexport const isContainerMutationOperationRequest = isContainerMutationRequest;\nexport const isContainerMutationOperationResponse = isContainerMutationResponse;\nexport const isContainerRotationOperationRequest = isContainerRotationRequest;\nexport const isContainerRotationOperationResponse = isContainerRotationResponse;\nexport const isCreateContainerWithMetadataDocumentOperationRequest =\n isContainerCreateWithMetadataDocumentRequest;\nexport const isCreateContainerWithMetadataDocumentOperationResponse =\n isContainerCreateWithMetadataDocumentResponse;\nexport const isDeleteContainerOperationResponse = isContainerDeleteResponse;\n"]}
@@ -525,6 +525,7 @@ export declare const listContainerParentLanesOperation: Omit<{
525
525
  stateHash: string;
526
526
  version: number;
527
527
  }[];
528
+ metadataVersionVector: string;
528
529
  organizationId: string;
529
530
  parentId: string | null;
530
531
  updatedAt: string;
@@ -562,6 +563,7 @@ export declare const listContainerParentLanesOperation: Omit<{
562
563
  stateHash: string;
563
564
  version: number;
564
565
  }[];
566
+ metadataVersionVector: string;
565
567
  organizationId: string;
566
568
  parentId: string | null;
567
569
  updatedAt: string;
@@ -56,7 +56,6 @@ export declare const createDocumentOperation: Omit<{
56
56
  expectedManifestHash: string;
57
57
  keyEpoch: Record<string, unknown>;
58
58
  keyring: Record<string, unknown> | null;
59
- manifest: Record<string, unknown>;
60
59
  predecessorBridge: Record<string, unknown> | null;
61
60
  principalPolicyRefs: {
62
61
  principalType: "group" | "organization";
@@ -120,7 +119,6 @@ export declare const createDocumentOperation: Omit<{
120
119
  expectedManifestHash: string;
121
120
  keyEpoch: Record<string, unknown>;
122
121
  keyring: Record<string, unknown> | null;
123
- manifest: Record<string, unknown>;
124
122
  predecessorBridge: Record<string, unknown> | null;
125
123
  principalPolicyRefs: {
126
124
  principalType: "group" | "organization";
@@ -205,7 +203,6 @@ export declare const createDocumentOperation: Omit<{
205
203
  expectedManifestHash: string;
206
204
  keyEpoch: Record<string, unknown>;
207
205
  keyring: Record<string, unknown> | null;
208
- manifest: Record<string, unknown>;
209
206
  predecessorBridge: Record<string, unknown> | null;
210
207
  principalPolicyRefs: {
211
208
  principalType: "group" | "organization";
@@ -269,7 +266,6 @@ export declare const createDocumentOperation: Omit<{
269
266
  expectedManifestHash: string;
270
267
  keyEpoch: Record<string, unknown>;
271
268
  keyring: Record<string, unknown> | null;
272
- manifest: Record<string, unknown>;
273
269
  predecessorBridge: Record<string, unknown> | null;
274
270
  principalPolicyRefs: {
275
271
  principalType: "group" | "organization";
@@ -354,7 +350,6 @@ export declare const createDocumentOperation: Omit<{
354
350
  expectedManifestHash: string;
355
351
  keyEpoch: Record<string, unknown>;
356
352
  keyring: Record<string, unknown> | null;
357
- manifest: Record<string, unknown>;
358
353
  predecessorBridge: Record<string, unknown> | null;
359
354
  principalPolicyRefs: {
360
355
  principalType: "group" | "organization";
@@ -418,7 +413,6 @@ export declare const createDocumentOperation: Omit<{
418
413
  expectedManifestHash: string;
419
414
  keyEpoch: Record<string, unknown>;
420
415
  keyring: Record<string, unknown> | null;
421
- manifest: Record<string, unknown>;
422
416
  predecessorBridge: Record<string, unknown> | null;
423
417
  principalPolicyRefs: {
424
418
  principalType: "group" | "organization";
@@ -503,7 +497,6 @@ export declare const createDocumentOperation: Omit<{
503
497
  expectedManifestHash: string;
504
498
  keyEpoch: Record<string, unknown>;
505
499
  keyring: Record<string, unknown> | null;
506
- manifest: Record<string, unknown>;
507
500
  predecessorBridge: Record<string, unknown> | null;
508
501
  principalPolicyRefs: {
509
502
  principalType: "group" | "organization";
@@ -567,7 +560,6 @@ export declare const createDocumentOperation: Omit<{
567
560
  expectedManifestHash: string;
568
561
  keyEpoch: Record<string, unknown>;
569
562
  keyring: Record<string, unknown> | null;
570
- manifest: Record<string, unknown>;
571
563
  predecessorBridge: Record<string, unknown> | null;
572
564
  principalPolicyRefs: {
573
565
  principalType: "group" | "organization";
@@ -694,6 +686,7 @@ export declare const createDocumentOperation: Omit<{
694
686
  readonly responses: {
695
687
  readonly 200: z.ZodType<{
696
688
  createdAt: string;
689
+ bundleDigest: string;
697
690
  contentKeyEpoch: number;
698
691
  eventHash: string;
699
692
  id: string;
@@ -706,6 +699,7 @@ export declare const createDocumentOperation: Omit<{
706
699
  } | undefined;
707
700
  }, {
708
701
  createdAt: string;
702
+ bundleDigest: string;
709
703
  contentKeyEpoch: number;
710
704
  eventHash: string;
711
705
  id: string;
@@ -718,6 +712,7 @@ export declare const createDocumentOperation: Omit<{
718
712
  } | undefined;
719
713
  }, z.core.$ZodTypeInternals<{
720
714
  createdAt: string;
715
+ bundleDigest: string;
721
716
  contentKeyEpoch: number;
722
717
  eventHash: string;
723
718
  id: string;
@@ -730,6 +725,7 @@ export declare const createDocumentOperation: Omit<{
730
725
  } | undefined;
731
726
  }, {
732
727
  createdAt: string;
728
+ bundleDigest: string;
733
729
  contentKeyEpoch: number;
734
730
  eventHash: string;
735
731
  id: string;
@@ -874,7 +870,6 @@ export declare const linkDocumentOperation: Omit<{
874
870
  };
875
871
  event: Record<string, unknown>;
876
872
  expectedManifestHash: string;
877
- manifest: Record<string, unknown>;
878
873
  targetContainerPathRefs: {
879
874
  containerId: string;
880
875
  manifestHash: string;
@@ -885,7 +880,6 @@ export declare const linkDocumentOperation: Omit<{
885
880
  expectedManifestHash: string;
886
881
  keyEpoch: Record<string, unknown>;
887
882
  keyring: Record<string, unknown> | null;
888
- manifest: Record<string, unknown>;
889
883
  predecessorBridge: Record<string, unknown> | null;
890
884
  principalPolicyRefs: {
891
885
  principalType: "group" | "organization";
@@ -953,7 +947,6 @@ export declare const linkDocumentOperation: Omit<{
953
947
  };
954
948
  event: Record<string, unknown>;
955
949
  expectedManifestHash: string;
956
- manifest: Record<string, unknown>;
957
950
  targetContainerPathRefs: {
958
951
  containerId: string;
959
952
  manifestHash: string;
@@ -964,7 +957,6 @@ export declare const linkDocumentOperation: Omit<{
964
957
  expectedManifestHash: string;
965
958
  keyEpoch: Record<string, unknown>;
966
959
  keyring: Record<string, unknown> | null;
967
- manifest: Record<string, unknown>;
968
960
  predecessorBridge: Record<string, unknown> | null;
969
961
  principalPolicyRefs: {
970
962
  principalType: "group" | "organization";
@@ -1032,7 +1024,6 @@ export declare const linkDocumentOperation: Omit<{
1032
1024
  };
1033
1025
  event: Record<string, unknown>;
1034
1026
  expectedManifestHash: string;
1035
- manifest: Record<string, unknown>;
1036
1027
  targetContainerPathRefs: {
1037
1028
  containerId: string;
1038
1029
  manifestHash: string;
@@ -1043,7 +1034,6 @@ export declare const linkDocumentOperation: Omit<{
1043
1034
  expectedManifestHash: string;
1044
1035
  keyEpoch: Record<string, unknown>;
1045
1036
  keyring: Record<string, unknown> | null;
1046
- manifest: Record<string, unknown>;
1047
1037
  predecessorBridge: Record<string, unknown> | null;
1048
1038
  principalPolicyRefs: {
1049
1039
  principalType: "group" | "organization";
@@ -1111,7 +1101,6 @@ export declare const linkDocumentOperation: Omit<{
1111
1101
  };
1112
1102
  event: Record<string, unknown>;
1113
1103
  expectedManifestHash: string;
1114
- manifest: Record<string, unknown>;
1115
1104
  targetContainerPathRefs: {
1116
1105
  containerId: string;
1117
1106
  manifestHash: string;
@@ -1122,7 +1111,6 @@ export declare const linkDocumentOperation: Omit<{
1122
1111
  expectedManifestHash: string;
1123
1112
  keyEpoch: Record<string, unknown>;
1124
1113
  keyring: Record<string, unknown> | null;
1125
- manifest: Record<string, unknown>;
1126
1114
  predecessorBridge: Record<string, unknown> | null;
1127
1115
  principalPolicyRefs: {
1128
1116
  principalType: "group" | "organization";
@@ -1257,24 +1245,28 @@ export declare const linkDocumentOperation: Omit<{
1257
1245
  readonly path: "/documents/{documentId}/link";
1258
1246
  readonly responses: {
1259
1247
  readonly 200: z.ZodType<{
1248
+ bundleDigest: string;
1260
1249
  contentKeyEpoch: number;
1261
1250
  eventHash: string;
1262
1251
  id: string;
1263
1252
  manifestHash: string;
1264
1253
  targetHash: string;
1265
1254
  }, {
1255
+ bundleDigest: string;
1266
1256
  contentKeyEpoch: number;
1267
1257
  eventHash: string;
1268
1258
  id: string;
1269
1259
  manifestHash: string;
1270
1260
  targetHash: string;
1271
1261
  }, z.core.$ZodTypeInternals<{
1262
+ bundleDigest: string;
1272
1263
  contentKeyEpoch: number;
1273
1264
  eventHash: string;
1274
1265
  id: string;
1275
1266
  manifestHash: string;
1276
1267
  targetHash: string;
1277
1268
  }, {
1269
+ bundleDigest: string;
1278
1270
  contentKeyEpoch: number;
1279
1271
  eventHash: string;
1280
1272
  id: string;
@@ -1393,7 +1385,6 @@ export declare const unlinkDocumentOperation: Omit<{
1393
1385
  };
1394
1386
  event: Record<string, unknown>;
1395
1387
  expectedManifestHash: string;
1396
- manifest: Record<string, unknown>;
1397
1388
  targetContainerPathRefs: {
1398
1389
  containerId: string;
1399
1390
  manifestHash: string;
@@ -1404,7 +1395,6 @@ export declare const unlinkDocumentOperation: Omit<{
1404
1395
  expectedManifestHash: string;
1405
1396
  keyEpoch: Record<string, unknown>;
1406
1397
  keyring: Record<string, unknown> | null;
1407
- manifest: Record<string, unknown>;
1408
1398
  predecessorBridge: Record<string, unknown> | null;
1409
1399
  principalPolicyRefs: {
1410
1400
  principalType: "group" | "organization";
@@ -1472,7 +1462,6 @@ export declare const unlinkDocumentOperation: Omit<{
1472
1462
  };
1473
1463
  event: Record<string, unknown>;
1474
1464
  expectedManifestHash: string;
1475
- manifest: Record<string, unknown>;
1476
1465
  targetContainerPathRefs: {
1477
1466
  containerId: string;
1478
1467
  manifestHash: string;
@@ -1483,7 +1472,6 @@ export declare const unlinkDocumentOperation: Omit<{
1483
1472
  expectedManifestHash: string;
1484
1473
  keyEpoch: Record<string, unknown>;
1485
1474
  keyring: Record<string, unknown> | null;
1486
- manifest: Record<string, unknown>;
1487
1475
  predecessorBridge: Record<string, unknown> | null;
1488
1476
  principalPolicyRefs: {
1489
1477
  principalType: "group" | "organization";
@@ -1551,7 +1539,6 @@ export declare const unlinkDocumentOperation: Omit<{
1551
1539
  };
1552
1540
  event: Record<string, unknown>;
1553
1541
  expectedManifestHash: string;
1554
- manifest: Record<string, unknown>;
1555
1542
  targetContainerPathRefs: {
1556
1543
  containerId: string;
1557
1544
  manifestHash: string;
@@ -1562,7 +1549,6 @@ export declare const unlinkDocumentOperation: Omit<{
1562
1549
  expectedManifestHash: string;
1563
1550
  keyEpoch: Record<string, unknown>;
1564
1551
  keyring: Record<string, unknown> | null;
1565
- manifest: Record<string, unknown>;
1566
1552
  predecessorBridge: Record<string, unknown> | null;
1567
1553
  principalPolicyRefs: {
1568
1554
  principalType: "group" | "organization";
@@ -1630,7 +1616,6 @@ export declare const unlinkDocumentOperation: Omit<{
1630
1616
  };
1631
1617
  event: Record<string, unknown>;
1632
1618
  expectedManifestHash: string;
1633
- manifest: Record<string, unknown>;
1634
1619
  targetContainerPathRefs: {
1635
1620
  containerId: string;
1636
1621
  manifestHash: string;
@@ -1641,7 +1626,6 @@ export declare const unlinkDocumentOperation: Omit<{
1641
1626
  expectedManifestHash: string;
1642
1627
  keyEpoch: Record<string, unknown>;
1643
1628
  keyring: Record<string, unknown> | null;
1644
- manifest: Record<string, unknown>;
1645
1629
  predecessorBridge: Record<string, unknown> | null;
1646
1630
  principalPolicyRefs: {
1647
1631
  principalType: "group" | "organization";
@@ -1776,24 +1760,28 @@ export declare const unlinkDocumentOperation: Omit<{
1776
1760
  readonly path: "/documents/{documentId}/unlink";
1777
1761
  readonly responses: {
1778
1762
  readonly 200: z.ZodType<{
1763
+ bundleDigest: string;
1779
1764
  contentKeyEpoch: number;
1780
1765
  eventHash: string;
1781
1766
  id: string;
1782
1767
  manifestHash: string;
1783
1768
  targetHash: string;
1784
1769
  }, {
1770
+ bundleDigest: string;
1785
1771
  contentKeyEpoch: number;
1786
1772
  eventHash: string;
1787
1773
  id: string;
1788
1774
  manifestHash: string;
1789
1775
  targetHash: string;
1790
1776
  }, z.core.$ZodTypeInternals<{
1777
+ bundleDigest: string;
1791
1778
  contentKeyEpoch: number;
1792
1779
  eventHash: string;
1793
1780
  id: string;
1794
1781
  manifestHash: string;
1795
1782
  targetHash: string;
1796
1783
  }, {
1784
+ bundleDigest: string;
1797
1785
  contentKeyEpoch: number;
1798
1786
  eventHash: string;
1799
1787
  id: string;
@@ -35,7 +35,6 @@ export declare const documentSyncOperation: Omit<{
35
35
  expectedManifestHash: string;
36
36
  keyEpoch: Record<string, unknown>;
37
37
  keyring: Record<string, unknown> | null;
38
- manifest: Record<string, unknown>;
39
38
  predecessorBridge: Record<string, unknown> | null;
40
39
  principalPolicyRefs: {
41
40
  principalType: "group" | "organization";
@@ -115,7 +114,6 @@ export declare const documentSyncOperation: Omit<{
115
114
  expectedManifestHash: string;
116
115
  keyEpoch: Record<string, unknown>;
117
116
  keyring: Record<string, unknown> | null;
118
- manifest: Record<string, unknown>;
119
117
  predecessorBridge: Record<string, unknown> | null;
120
118
  principalPolicyRefs: {
121
119
  principalType: "group" | "organization";
@@ -195,7 +193,6 @@ export declare const documentSyncOperation: Omit<{
195
193
  expectedManifestHash: string;
196
194
  keyEpoch: Record<string, unknown>;
197
195
  keyring: Record<string, unknown> | null;
198
- manifest: Record<string, unknown>;
199
196
  predecessorBridge: Record<string, unknown> | null;
200
197
  principalPolicyRefs: {
201
198
  principalType: "group" | "organization";
@@ -275,7 +272,6 @@ export declare const documentSyncOperation: Omit<{
275
272
  expectedManifestHash: string;
276
273
  keyEpoch: Record<string, unknown>;
277
274
  keyring: Record<string, unknown> | null;
278
- manifest: Record<string, unknown>;
279
275
  predecessorBridge: Record<string, unknown> | null;
280
276
  principalPolicyRefs: {
281
277
  principalType: "group" | "organization";