@tearleads/client-sdk 0.1.247 → 0.1.249

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 (151) hide show
  1. package/Tearleads.js +4 -2
  2. package/Tearleads.js.map +1 -1
  3. package/client/organizations/index.js +5 -3
  4. package/client/organizations/index.js.map +1 -1
  5. package/client/organizations/organizationGroupPresentation.d.ts +1 -1
  6. package/client/organizations/organizationGroupPresentation.js.map +1 -1
  7. package/client/organizations/organizationLeaveRequestVerifier.js +21 -0
  8. package/client/organizations/organizationLeaveRequestVerifier.js.map +1 -0
  9. package/client/organizations/{organizationReadModels.d.ts → organizationReadModelCoordinator.d.ts} +18 -16
  10. package/client/organizations/organizationReadModelCoordinator.js +2 -0
  11. package/client/organizations/organizationReadModelCoordinator.js.map +1 -0
  12. package/client/organizations/organizationReadModelPresentation.js +51 -0
  13. package/client/organizations/organizationReadModelPresentation.js.map +1 -0
  14. package/client/organizations/organizationReadModelScopes.js +37 -0
  15. package/client/organizations/organizationReadModelScopes.js.map +1 -0
  16. package/client/organizations/organizationReadModels.js +131 -88
  17. package/client/organizations/organizationReadModels.js.map +1 -1
  18. package/client/organizations/organizationsTypes.d.ts +13 -5
  19. package/client/organizations/organizationsTypes.js.map +1 -1
  20. package/client/organizations/principalMutations.d.ts +18 -2
  21. package/client/organizations/principalMutations.js +29 -15
  22. package/client/organizations/principalMutations.js.map +1 -1
  23. package/client/runtime/principalMutationApi.d.ts +2 -0
  24. package/client/runtime/principalMutationApi.js +2 -0
  25. package/client/runtime/principalMutationApi.js.map +1 -1
  26. package/client/runtime/principalMutationDispatch.js +47 -10
  27. package/client/runtime/principalMutationDispatch.js.map +1 -1
  28. package/client/runtime/workflowRuntime.js +5 -4
  29. package/client/runtime/workflowRuntime.js.map +1 -1
  30. package/data/containers/shared/mutationRequestOptions.d.ts +2 -0
  31. package/data/containers/shared/mutationRequestOptions.js.map +1 -1
  32. package/data/containers/shared/types.d.ts +12 -2
  33. package/data/containers/shared/types.js.map +1 -1
  34. package/data/persistence/organizations/organizationReadModelRepository.js +20 -2
  35. package/data/persistence/organizations/organizationReadModelRepository.js.map +1 -1
  36. package/data/persistence/principalPolicy/heldOrganizationDirectories.js +53 -0
  37. package/data/persistence/principalPolicy/heldOrganizationDirectories.js.map +1 -0
  38. package/data/persistence/verifiedManifestBundlePersistence.d.ts +8 -3
  39. package/data/persistence/verifiedManifestBundlePersistence.js +34 -15
  40. package/data/persistence/verifiedManifestBundlePersistence.js.map +1 -1
  41. package/internal/api-client/ApiClient.d.ts +4 -1
  42. package/internal/api-client/client/containerMutations.d.ts +2 -2
  43. package/internal/api-client/client/containerMutations.js +2 -1
  44. package/internal/api-client/client/containerMutations.js.map +1 -1
  45. package/internal/api-client/client/principalPolicies.d.ts +3 -0
  46. package/internal/api-client/heldDirectoryCitations.d.ts +19 -0
  47. package/internal/api-client/heldDirectoryCitations.js +37 -0
  48. package/internal/api-client/heldDirectoryCitations.js.map +1 -0
  49. package/internal/api-client/index.d.ts +1 -1
  50. package/internal/api-client/index.js.map +1 -1
  51. package/internal/api-client/principalPolicyRequests.d.ts +2 -0
  52. package/internal/api-client/principalPolicyRequests.js +6 -4
  53. package/internal/api-client/principalPolicyRequests.js.map +1 -1
  54. package/internal/api-client/routes/containers/mutations.js +3 -3
  55. package/internal/api-client/routes/containers/mutations.js.map +1 -1
  56. package/internal/api-client/routes/organizations/createGroup.js +3 -5
  57. package/internal/api-client/routes/organizations/createGroup.js.map +1 -1
  58. package/internal/api-client/routes/principals/policy.js +2 -5
  59. package/internal/api-client/routes/principals/policy.js.map +1 -1
  60. package/internal/api-client/types.d.ts +6 -0
  61. package/internal/api-client/types.js.map +1 -1
  62. package/internal/api-client/verifiedManifestCitations.d.ts +16 -6
  63. package/internal/api-client/verifiedManifestCitations.js +32 -13
  64. package/internal/api-client/verifiedManifestCitations.js.map +1 -1
  65. package/internal/api-client/writerProjectionRequests.js +5 -3
  66. package/internal/api-client/writerProjectionRequests.js.map +1 -1
  67. package/internal/validators/knownManifestsRefinements.js +1 -1
  68. package/internal/validators/knownManifestsRefinements.js.map +1 -1
  69. package/internal/validators/operation/containerMutations.d.ts +20 -3
  70. package/internal/validators/operation/containerMutations.js +18 -20
  71. package/internal/validators/operation/containerMutations.js.map +1 -1
  72. package/internal/validators/operation/index.d.ts +1 -1
  73. package/internal/validators/operation/index.js +1 -1
  74. package/internal/validators/operation/index.js.map +1 -1
  75. package/internal/validators/operation/organizations.d.ts +17 -1
  76. package/internal/validators/operation/organizations.js +4 -2
  77. package/internal/validators/operation/organizations.js.map +1 -1
  78. package/internal/validators/operation/principals.d.ts +17 -1
  79. package/internal/validators/operation/principals.js +5 -2
  80. package/internal/validators/operation/principals.js.map +1 -1
  81. package/internal/validators/operation/writerProjections.d.ts +11 -11
  82. package/internal/validators/operation/writerProjections.js +1 -1
  83. package/internal/validators/operation/writerProjections.js.map +1 -1
  84. package/internal/validators/request/index.d.ts +1 -1
  85. package/internal/validators/request/index.js +1 -1
  86. package/internal/validators/request/index.js.map +1 -1
  87. package/internal/validators/request/organization.d.ts +15 -0
  88. package/internal/validators/request/organization.js +8 -0
  89. package/internal/validators/request/organization.js.map +1 -1
  90. package/internal/validators/response/areas/organizations.d.ts +3 -2
  91. package/internal/validators/response/areas/organizations.js +3 -2
  92. package/internal/validators/response/areas/organizations.js.map +1 -1
  93. package/internal/validators/response/areas/principals.d.ts +3 -2
  94. package/internal/validators/response/areas/principals.js +2 -2
  95. package/internal/validators/response/areas/principals.js.map +1 -1
  96. package/internal/validators/response/committedReadModel.d.ts +697 -0
  97. package/internal/validators/response/committedReadModel.js +52 -0
  98. package/internal/validators/response/committedReadModel.js.map +1 -0
  99. package/internal/validators/response/container.d.ts +56 -4
  100. package/internal/validators/response/container.js +5 -5
  101. package/internal/validators/response/container.js.map +1 -1
  102. package/internal/validators/response/documentMutation.d.ts +4 -4
  103. package/internal/validators/response/documentMutation.js +2 -2
  104. package/internal/validators/response/documentMutation.js.map +1 -1
  105. package/internal/validators/response/organization.d.ts +0 -191
  106. package/internal/validators/response/organization.js +0 -7
  107. package/internal/validators/response/organization.js.map +1 -1
  108. package/internal/validators/response/organizationReadModel.d.ts +167 -0
  109. package/internal/validators/response/organizationReadModel.js +5 -0
  110. package/internal/validators/response/organizationReadModel.js.map +1 -1
  111. package/internal/validators/response/policyEvidenceWire.d.ts +17 -0
  112. package/internal/validators/response/policyEvidenceWire.js +36 -0
  113. package/internal/validators/response/policyEvidenceWire.js.map +1 -0
  114. package/internal/validators/response/principal.d.ts +0 -403
  115. package/internal/validators/response/principal.js +0 -8
  116. package/internal/validators/response/principal.js.map +1 -1
  117. package/internal/validators/response/projectionPolicyEvidence.d.ts +175 -0
  118. package/internal/validators/response/projectionPolicyEvidence.js +13 -0
  119. package/internal/validators/response/projectionPolicyEvidence.js.map +1 -1
  120. package/internal/validators/response/writerProjectionWire.d.ts +11 -7
  121. package/internal/validators/response/writerProjectionWire.js +19 -10
  122. package/internal/validators/response/writerProjectionWire.js.map +1 -1
  123. package/internal/validators/util/index.d.ts +1 -1
  124. package/internal/validators/util/index.js +1 -1
  125. package/internal/validators/util/index.js.map +1 -1
  126. package/internal/validators/util/knownManifestWire.d.ts +9 -3
  127. package/internal/validators/util/knownManifestWire.js +24 -8
  128. package/internal/validators/util/knownManifestWire.js.map +1 -1
  129. package/package.json +1 -1
  130. package/workflows/container-contents/container-state/organizationHost.d.ts +9 -0
  131. package/workflows/container-contents/container-state/organizationHost.js.map +1 -1
  132. package/workflows/container-contents/container-state/remote.js +6 -0
  133. package/workflows/container-contents/container-state/remote.js.map +1 -1
  134. package/workflows/containers/child/share/index.d.ts +4 -2
  135. package/workflows/containers/child/share/index.js +37 -20
  136. package/workflows/containers/child/share/index.js.map +1 -1
  137. package/workflows/organizations/containerContentsHost.js +20 -1
  138. package/workflows/organizations/containerContentsHost.js.map +1 -1
  139. package/workflows/organizations/groupPolicy/commitCurrentGroupPolicyMutation.js +5 -1
  140. package/workflows/organizations/groupPolicy/commitCurrentGroupPolicyMutation.js.map +1 -1
  141. package/workflows/organizations/groups/createCurrentOrganizationGroup.js +8 -1
  142. package/workflows/organizations/groups/createCurrentOrganizationGroup.js.map +1 -1
  143. package/workflows/organizations/index.d.ts +1 -0
  144. package/workflows/organizations/index.js +1 -0
  145. package/workflows/organizations/index.js.map +1 -1
  146. package/workflows/organizations/readModel/committedReadModel.d.ts +66 -0
  147. package/workflows/organizations/readModel/committedReadModel.js +150 -0
  148. package/workflows/organizations/readModel/committedReadModel.js.map +1 -0
  149. package/workflows/organizations/readModel/readModelProjection.d.ts +15 -2
  150. package/workflows/organizations/readModel/readModelProjection.js +26 -4
  151. package/workflows/organizations/readModel/readModelProjection.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"verifiedManifestCitations.js","sourceRoot":"","sources":["verifiedManifestCitations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAEL,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wCAAwC,EACxC,iBAAiB,EACjB,yBAAyB,GAE1B,MAAM,4BAA4B,CAAC;AAEpC,mFAAmF;AACnF,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAyCjD,SAAS,WAAW;IAClB,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CACtB,OAA+C,EAC/C,MAA+B;IAE/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,MAAM,GAAG,CAAC,IAA6B,EAAE,EAAE;YAC/C,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,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,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC;QAAC,MAAM,CAAC;YACP,4DAA4D;QAC9D,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9E,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC;YACvC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAAwC,EACxC,MAA8B,EAC9B,MAAgC;IAEhC,IAAI,CAAC,MAAM;QAAE,OAAO,WAAW,EAAE,CAAC;IAClC,OAAO,eAAe,CACpB,KAAK,IAAI,EAAE,CAAC,oBAAoB,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAC3D,MAAM,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { computeContainerKekLevelDigest } from \"@tearleads/crypto\";\nimport {\n type ContainerKekWireLevel,\n isContainerKekWireLevel,\n} from \"@tearleads/validators/response\";\nimport {\n isServedAccessManifestBundleWireResponse,\n isSha256HexString,\n KNOWN_MANIFEST_HINT_LIMIT,\n type ServedAccessManifestBundleWireResponse,\n} from \"@tearleads/validators/util\";\n\n/** Citation only saves bytes: a source slower than this sends the read uncited. */\nexport const MANIFEST_CITATION_DEADLINE_MS = 250;\n\n/**\n * Where a listing placed a container the device has not stored yet. Only\n * which held bytes a read cites depends on it, never what the read accepts.\n */\nexport interface WriterProjectionListing {\n readonly organizationId: string;\n readonly parentId: string | null;\n}\n\nexport interface WriterProjectionTarget {\n readonly kind: \"container\" | \"document\";\n readonly id: string;\n readonly listing?: WriterProjectionListing | undefined;\n}\n\n/** A held access-manifest bundle or a held container KEK level. */\nexport type HeldProjectionCitation =\n | ServedAccessManifestBundleWireResponse\n | ContainerKekWireLevel;\n\n/**\n * Verified access-manifest bundles and container KEK levels a device durably\n * holds that a writer projection of `target` may cite, most useful first.\n * This is never trust input: the exact cited bytes only fill the response's\n * omitted positions, and the caller verifies the rebuilt projection exactly\n * as a full one.\n */\nexport interface VerifiedManifestCitations {\n cite(\n target: WriterProjectionTarget,\n ): Promise<readonly HeldProjectionCitation[]>;\n}\n\n/** The exact bytes one request cites: bundles by hash, levels by digest. */\nexport interface HeldProjectionCitations {\n readonly bundles: Map<string, ServedAccessManifestBundleWireResponse>;\n readonly kekLevels: Map<string, ContainerKekWireLevel>;\n}\n\nfunction noCitations(): HeldProjectionCitations {\n return { bundles: new Map(), kekLevels: new Map() };\n}\n\n/**\n * The prepared citations, or none once the deadline passes, the caller\n * aborts, or the source or preparation throws or rejects. A late answer is\n * discarded: it can never reach a request that was already sent.\n */\nfunction boundedCitation(\n prepare: () => Promise<HeldProjectionCitations>,\n signal: AbortSignal | undefined,\n): Promise<HeldProjectionCitations> {\n return new Promise((resolve) => {\n let settled = false;\n const finish = (held: HeldProjectionCitations) => {\n if (settled) return;\n settled = true;\n clearTimeout(timer);\n signal?.removeEventListener(\"abort\", abandon);\n resolve(held);\n };\n const abandon = () => finish(noCitations());\n const timer = setTimeout(abandon, MANIFEST_CITATION_DEADLINE_MS);\n if (signal?.aborted) return abandon();\n signal?.addEventListener(\"abort\", abandon, { once: true });\n try {\n prepare().then(finish, abandon);\n } catch {\n abandon();\n }\n });\n}\n\n/**\n * Copies the source's answer and keys each KEK level by the digest\n * recomputed from its own bytes, never by a digest the source names.\n */\nasync function prepareHeldCitations(\n entries: readonly unknown[],\n): Promise<HeldProjectionCitations> {\n const held = noCitations();\n const levels: ContainerKekWireLevel[] = [];\n for (const entry of entries) {\n if (held.bundles.size + levels.length >= KNOWN_MANIFEST_HINT_LIMIT) break;\n try {\n if (isContainerKekWireLevel(entry)) levels.push(structuredClone(entry));\n else if (\n isServedAccessManifestBundleWireResponse(entry) &&\n isSha256HexString(entry.manifestHash) &&\n !held.bundles.has(entry.manifestHash)\n )\n held.bundles.set(entry.manifestHash, structuredClone(entry));\n } catch {\n // An uncloneable entry is skipped; its bytes simply travel.\n }\n }\n const digests = await Promise.all(levels.map(computeContainerKekLevelDigest));\n levels.forEach((level, index) => {\n const digest = digests[index];\n if (digest && !held.kekLevels.has(digest))\n held.kekLevels.set(digest, level);\n });\n return held;\n}\n\n/**\n * The bytes one request cites, copied so a later eviction or mutation of the\n * source cannot change what fills its omissions. Citing only saves bytes, so\n * it never blocks or fails a read: a slow, failing, or abandoned source or\n * preparation yields no hints, within one deadline.\n */\nexport async function heldManifestCitations(\n source: VerifiedManifestCitations | null,\n target: WriterProjectionTarget,\n signal?: AbortSignal | undefined,\n): Promise<HeldProjectionCitations> {\n if (!source) return noCitations();\n return boundedCitation(\n async () => prepareHeldCitations(await source.cite(target)),\n signal,\n );\n}\n"]}
1
+ {"version":3,"file":"verifiedManifestCitations.js","sourceRoot":"","sources":["verifiedManifestCitations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAEL,uBAAuB,GAExB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wCAAwC,EACxC,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,GAE1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAIlC,mFAAmF;AACnF,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAkDjD,SAAS,WAAW;IAClB,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAA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AG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC;YACvC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC5E,KAAK,MAAM,OAAO,IAAI,QAAQ;QAC5B,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC;YACrD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACrD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAAwC,EACxC,MAA8B,EAC9B,MAAgC;IAEhC,IAAI,CAAC,MAAM;QAAE,OAAO,WAAW,EAAE,CAAC;IAClC,OAAO,eAAe,CACpB,KAAK,IAAI,EAAE,CAAC,oBAAoB,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAC3D,MAAM,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { computeContainerKekLevelDigest } from \"@tearleads/crypto\";\nimport {\n type ContainerKekWireLevel,\n isContainerKekWireLevel,\n type PrincipalStatePayloadResponse,\n} from \"@tearleads/validators/response\";\nimport {\n isServedAccessManifestBundleWireResponse,\n isSha256HexString,\n KNOWN_DIRECTORY_HINT_LIMIT,\n KNOWN_MANIFEST_HINT_LIMIT,\n type ServedAccessManifestBundleWireResponse,\n} from \"@tearleads/validators/util\";\nimport {\n type HeldDirectoryCitation,\n isHeldDirectoryCitation,\n signedDirectoryPayload,\n} from \"./heldDirectoryCitations\";\n\nexport type { HeldDirectoryCitation } from \"./heldDirectoryCitations\";\n\n/** Citation only saves bytes: a source slower than this sends the read uncited. */\nexport const MANIFEST_CITATION_DEADLINE_MS = 250;\n\n/**\n * Where a listing placed a container the device has not stored yet. Only\n * which held bytes a read cites depends on it, never what the read accepts.\n */\nexport interface WriterProjectionListing {\n readonly organizationId: string;\n readonly parentId: string | null;\n}\n\nexport interface WriterProjectionTarget {\n readonly kind: \"container\" | \"document\";\n readonly id: string;\n readonly listing?: WriterProjectionListing | undefined;\n}\n\n/**\n * A held access-manifest bundle, a held container KEK level, or a held\n * organization directory payload with its signed state.\n */\nexport type HeldProjectionCitation =\n | ServedAccessManifestBundleWireResponse\n | ContainerKekWireLevel\n | HeldDirectoryCitation;\n\n/**\n * Verified access-manifest bundles, container KEK levels and organization\n * directory payloads a device durably holds that a writer projection of\n * `target` may cite, most useful first.\n * This is never trust input: the exact cited bytes only fill the response's\n * omitted positions, and the caller verifies the rebuilt projection exactly\n * as a full one.\n */\nexport interface VerifiedManifestCitations {\n cite(\n target: WriterProjectionTarget,\n ): Promise<readonly HeldProjectionCitation[]>;\n}\n\n/**\n * The exact bytes one request cites: bundles by hash, levels by digest,\n * directory payloads by their organization state's hash.\n */\nexport interface HeldProjectionCitations {\n readonly bundles: Map<string, ServedAccessManifestBundleWireResponse>;\n readonly kekLevels: Map<string, ContainerKekWireLevel>;\n readonly directories: Map<string, PrincipalStatePayloadResponse>;\n}\n\nfunction noCitations(): HeldProjectionCitations {\n return { bundles: new Map(), kekLevels: new Map(), directories: new Map() };\n}\n\n/**\n * The prepared citations, or none once the deadline passes, the caller\n * aborts, or the source or preparation throws or rejects. A late answer is\n * discarded: it can never reach a request that was already sent.\n */\nfunction boundedCitation(\n prepare: () => Promise<HeldProjectionCitations>,\n signal: AbortSignal | undefined,\n): Promise<HeldProjectionCitations> {\n return new Promise((resolve) => {\n let settled = false;\n const finish = (held: HeldProjectionCitations) => {\n if (settled) return;\n settled = true;\n clearTimeout(timer);\n signal?.removeEventListener(\"abort\", abandon);\n resolve(held);\n };\n const abandon = () => finish(noCitations());\n const timer = setTimeout(abandon, MANIFEST_CITATION_DEADLINE_MS);\n if (signal?.aborted) return abandon();\n signal?.addEventListener(\"abort\", abandon, { once: true });\n try {\n prepare().then(finish, abandon);\n } catch {\n abandon();\n }\n });\n}\n\n/** Copies of the source's entries, each kind within its own hint quota. */\nfunction copyHeldEntries(entries: readonly unknown[]) {\n const bundles = new Map<string, ServedAccessManifestBundleWireResponse>();\n const levels: ContainerKekWireLevel[] = [];\n const directories: HeldDirectoryCitation[] = [];\n const manifestQuotaLeft = () =>\n bundles.size + levels.length < KNOWN_MANIFEST_HINT_LIMIT;\n for (const entry of entries) {\n try {\n if (isHeldDirectoryCitation(entry)) {\n if (directories.length < KNOWN_DIRECTORY_HINT_LIMIT)\n directories.push(structuredClone(entry));\n } else if (!manifestQuotaLeft()) continue;\n else if (isContainerKekWireLevel(entry))\n levels.push(structuredClone(entry));\n else if (\n isServedAccessManifestBundleWireResponse(entry) &&\n isSha256HexString(entry.manifestHash) &&\n !bundles.has(entry.manifestHash)\n )\n bundles.set(entry.manifestHash, structuredClone(entry));\n } catch {\n // An uncloneable entry is skipped; its bytes simply travel.\n }\n }\n return { bundles, levels, directories };\n}\n\n/**\n * Copies the source's answer and keys each KEK level by the digest\n * recomputed from its own bytes, never by a digest the source names. A\n * directory payload is cited only when it hashes to the payload hash its own\n * signed organization state commits.\n */\nasync function prepareHeldCitations(\n entries: readonly unknown[],\n): Promise<HeldProjectionCitations> {\n const { bundles, levels, directories } = copyHeldEntries(entries);\n const held: HeldProjectionCitations = { ...noCitations(), bundles };\n const digests = await Promise.all(levels.map(computeContainerKekLevelDigest));\n levels.forEach((level, index) => {\n const digest = digests[index];\n if (digest && !held.kekLevels.has(digest))\n held.kekLevels.set(digest, level);\n });\n const payloads = await Promise.all(directories.map(signedDirectoryPayload));\n for (const payload of payloads)\n if (payload && !held.directories.has(payload.stateHash))\n held.directories.set(payload.stateHash, payload);\n return held;\n}\n\n/**\n * The bytes one request cites, copied so a later eviction or mutation of the\n * source cannot change what fills its omissions. Citing only saves bytes, so\n * it never blocks or fails a read: a slow, failing, or abandoned source or\n * preparation yields no hints, within one deadline.\n */\nexport async function heldManifestCitations(\n source: VerifiedManifestCitations | null,\n target: WriterProjectionTarget,\n signal?: AbortSignal | undefined,\n): Promise<HeldProjectionCitations> {\n if (!source) return noCitations();\n return boundedCitation(\n async () => prepareHeldCitations(await source.cite(target)),\n signal,\n );\n}\n"]}
@@ -7,6 +7,7 @@ import { heldManifestCitations, } from "./verifiedManifestCitations.js";
7
7
  const NO_CITATIONS = {
8
8
  bundles: new Map(),
9
9
  kekLevels: new Map(),
10
+ directories: new Map(),
10
11
  };
11
12
  const PROJECTION_PATH = /^\/(?:containers|documents)\/([^/?#]+)\/writer-projection$/u;
12
13
  function projectionId(path) {
@@ -33,8 +34,8 @@ function readProjection(runtime, input, held, context) {
33
34
  path: input.path,
34
35
  validator: input.validator,
35
36
  decode: (value) => container
36
- ? decodeContainerWriterProjection(value, held.bundles, held.kekLevels)
37
- : decodeDocumentWriterProjection(value, held.bundles, held.kekLevels),
37
+ ? decodeContainerWriterProjection(value, held.bundles, held.kekLevels, held.directories)
38
+ : decodeDocumentWriterProjection(value, held.bundles, held.kekLevels, held.directories),
38
39
  method: "GET",
39
40
  context,
40
41
  operation: container
@@ -61,7 +62,7 @@ async function citedProjectionRead(runtime, citations, input, options) {
61
62
  const held = id === null || options.headers !== undefined
62
63
  ? NO_CITATIONS
63
64
  : await heldManifestCitations(citations, { kind: input.kind, id, listing: options.projectionListing }, options.signal);
64
- if (held.bundles.size + held.kekLevels.size === 0)
65
+ if (held.bundles.size + held.kekLevels.size + held.directories.size === 0)
65
66
  return readProjection(runtime, input, held, context);
66
67
  const hinted = await readProjection(runtime, input, held, context.derive({
67
68
  ...options,
@@ -69,6 +70,7 @@ async function citedProjectionRead(runtime, citations, input, options) {
69
70
  "x-known-manifests": formatKnownManifestHints({
70
71
  manifests: [...held.bundles.keys()],
71
72
  kekLevels: [...held.kekLevels.keys()],
73
+ directories: [...held.directories.keys()],
72
74
  }),
73
75
  },
74
76
  reportErrors: false,
@@ -1 +1 @@
1
- {"version":3,"file":"writerProjectionRequests.js","sourceRoot":"","sources":["writerProjectionRequests.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAOlF,OAAO,EAEL,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,YAAY,GAA4B;IAC5C,OAAO,EAAE,IAAI,GAAG,EAAE;IAClB,SAAS,EAAE,IAAI,GAAG,EAAE;CACrB,CAAC;AAEF,MAAM,eAAe,GACnB,6DAA6D,CAAC;AAEhE,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAC3B,WAAmB;IAEnB,IAAI,WAAW,KAAK,iCAAiC;QAAE,OAAO,WAAW,CAAC;IAC1E,IAAI,WAAW,KAAK,gCAAgC;QAAE,OAAO,UAAU,CAAC;IACxE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,cAAc,CACrB,OAA0B,EAC1B,KAI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EAAE,IAAI,EAAE,SAAS,EAAE,EACzB,OAAO,IAAI,EAAE,CACd,CAAC;QACJ,OAAO,OAAO,CAAC,aAAa,CAC1B,IAAI,EACJ,SAAS,EACT,MAAM,EACN,IAAI,EACJ,OAAO,EACP,SAAS,CACV,CAAC;IACJ,CAAC,CAAC;IACF,MAAM,OAAO,GAAuB,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QACpD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AACpC,CAAC","sourcesContent":["import {\n getContainerWriterProjectionOperation,\n getDocumentWriterProjectionOperation,\n} from \"@tearleads/validators/operation\";\nimport {\n decodeContainerWriterProjection,\n decodeDocumentWriterProjection,\n} from \"@tearleads/validators/response\";\nimport { formatKnownManifestHints } from \"@tearleads/validators/util\";\nimport type { ApiRequestRuntime } from \"./apiRequestRuntime\";\nimport { principalHistoryRequest } from \"./principalHistoryRequest\";\nimport { PrincipalHistoryRequestContext } from \"./principalHistoryRequestContext\";\nimport type {\n OperationRequestFn,\n OperationRequestResultFn,\n RequestResult,\n RequestResultOptions,\n} from \"./types\";\nimport {\n type HeldProjectionCitations,\n heldManifestCitations,\n type VerifiedManifestCitations,\n type WriterProjectionTarget,\n} from \"./verifiedManifestCitations\";\n\nconst NO_CITATIONS: HeldProjectionCitations = {\n bundles: new Map(),\n kekLevels: new Map(),\n};\n\nconst PROJECTION_PATH =\n /^\\/(?:containers|documents)\\/([^/?#]+)\\/writer-projection$/u;\n\nfunction projectionId(path: string): string | null {\n const encoded = PROJECTION_PATH.exec(path)?.[1];\n if (encoded === undefined) return null;\n try {\n return decodeURIComponent(encoded);\n } catch {\n return null;\n }\n}\n\nfunction writerProjectionKind(\n operationId: string,\n): WriterProjectionTarget[\"kind\"] | null {\n if (operationId === \"containers.writerProjection.get\") return \"container\";\n if (operationId === \"documents.writerProjection.get\") return \"document\";\n return null;\n}\n\nfunction readProjection<T>(\n runtime: ApiRequestRuntime,\n input: {\n readonly kind: WriterProjectionTarget[\"kind\"];\n readonly path: string;\n readonly validator: (value: unknown) => value is T;\n },\n held: HeldProjectionCitations,\n context: PrincipalHistoryRequestContext,\n): Promise<RequestResult<T>> {\n const container = input.kind === \"container\";\n return principalHistoryRequest(runtime, {\n path: input.path,\n validator: input.validator,\n decode: (value) =>\n container\n ? decodeContainerWriterProjection(value, held.bundles, held.kekLevels)\n : decodeDocumentWriterProjection(value, held.bundles, held.kekLevels),\n method: \"GET\",\n context,\n operation: container\n ? getContainerWriterProjectionOperation\n : getDocumentWriterProjectionOperation,\n });\n}\n\n/**\n * Preparation and body deadlines sit inside the projection read. The wire\n * cites each manifest bundle by hash and may cite a held KEK level by digest;\n * decoding resolves every citation, from the response or from the exact bytes\n * this request declared held, before any validator, cache, or verifier sees\n * the projection. A response this device\n * cannot rebuild fails closed into one complete, hint-free refetch.\n */\nasync function citedProjectionRead<T>(\n runtime: ApiRequestRuntime,\n citations: VerifiedManifestCitations | null,\n input: {\n readonly kind: WriterProjectionTarget[\"kind\"];\n readonly path: string;\n readonly validator: (value: unknown) => value is T;\n },\n options: RequestResultOptions,\n): Promise<RequestResult<T>> {\n // Bind the identity before citations load: an account switch while they\n // load, or before the refetch, must not carry one identity's hints or\n // answer into another's session. Each request rechecks this context.\n const context = new PrincipalHistoryRequestContext(\n runtime,\n \"GET\",\n input.path,\n options,\n );\n const id = projectionId(input.path);\n // Caller-specific headers make a request its own; it cites nothing. The\n // caller's abort also ends a citation wait.\n const held =\n id === null || options.headers !== undefined\n ? NO_CITATIONS\n : await heldManifestCitations(\n citations,\n { kind: input.kind, id, listing: options.projectionListing },\n options.signal,\n );\n if (held.bundles.size + held.kekLevels.size === 0)\n return readProjection(runtime, input, held, context);\n const hinted = await readProjection(\n runtime,\n input,\n held,\n context.derive({\n ...options,\n headers: {\n \"x-known-manifests\": formatKnownManifestHints({\n manifests: [...held.bundles.keys()],\n kekLevels: [...held.kekLevels.keys()],\n }),\n },\n reportErrors: false,\n }),\n );\n if (hinted.ok) return hinted;\n if (hinted.kind !== \"shape\") {\n if (options.reportErrors !== false) hinted.report();\n return hinted;\n }\n return readProjection(runtime, input, NO_CITATIONS, context.derive(options));\n}\n\nexport function writerProjectionRequests(\n runtime: ApiRequestRuntime,\n citations: () => VerifiedManifestCitations | null,\n): {\n request: OperationRequestFn;\n requestResult: OperationRequestResultFn;\n} {\n const requestResult: OperationRequestResultFn = (\n path,\n validator,\n method,\n body,\n options,\n operation,\n ) => {\n const kind = method === \"GET\" ? writerProjectionKind(operation.id) : null;\n if (kind)\n return citedProjectionRead(\n runtime,\n citations(),\n { kind, path, validator },\n options ?? {},\n );\n return runtime.requestResult(\n path,\n validator,\n method,\n body,\n options,\n operation,\n );\n };\n const request: OperationRequestFn = async (...args) => {\n const result = await requestResult(...args);\n return result.ok ? result.data : null;\n };\n return { request, requestResult };\n}\n"]}
1
+ {"version":3,"file":"writerProjectionRequests.js","sourceRoot":"","sources":["writerProjectionRequests.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAOlF,OAAO,EAEL,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,YAAY,GAA4B;IAC5C,OAAO,EAAE,IAAI,GAAG,EAAE;IAClB,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,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E,aAAa,EAAE,CAAC;AACpC,CAAC","sourcesContent":["import {\n getContainerWriterProjectionOperation,\n getDocumentWriterProjectionOperation,\n} from \"@tearleads/validators/operation\";\nimport {\n decodeContainerWriterProjection,\n decodeDocumentWriterProjection,\n} from \"@tearleads/validators/response\";\nimport { formatKnownManifestHints } from \"@tearleads/validators/util\";\nimport type { ApiRequestRuntime } from \"./apiRequestRuntime\";\nimport { principalHistoryRequest } from \"./principalHistoryRequest\";\nimport { PrincipalHistoryRequestContext } from \"./principalHistoryRequestContext\";\nimport type {\n OperationRequestFn,\n OperationRequestResultFn,\n RequestResult,\n RequestResultOptions,\n} from \"./types\";\nimport {\n type HeldProjectionCitations,\n heldManifestCitations,\n type VerifiedManifestCitations,\n type WriterProjectionTarget,\n} from \"./verifiedManifestCitations\";\n\nconst NO_CITATIONS: HeldProjectionCitations = {\n bundles: new Map(),\n kekLevels: new Map(),\n directories: new Map(),\n};\n\nconst PROJECTION_PATH =\n /^\\/(?:containers|documents)\\/([^/?#]+)\\/writer-projection$/u;\n\nfunction projectionId(path: string): string | null {\n const encoded = PROJECTION_PATH.exec(path)?.[1];\n if (encoded === undefined) return null;\n try {\n return decodeURIComponent(encoded);\n } catch {\n return null;\n }\n}\n\nfunction writerProjectionKind(\n operationId: string,\n): WriterProjectionTarget[\"kind\"] | null {\n if (operationId === \"containers.writerProjection.get\") return \"container\";\n if (operationId === \"documents.writerProjection.get\") return \"document\";\n return null;\n}\n\nfunction readProjection<T>(\n runtime: ApiRequestRuntime,\n input: {\n readonly kind: WriterProjectionTarget[\"kind\"];\n readonly path: string;\n readonly validator: (value: unknown) => value is T;\n },\n held: HeldProjectionCitations,\n context: PrincipalHistoryRequestContext,\n): Promise<RequestResult<T>> {\n const container = input.kind === \"container\";\n return principalHistoryRequest(runtime, {\n path: input.path,\n validator: input.validator,\n decode: (value) =>\n container\n ? decodeContainerWriterProjection(\n value,\n held.bundles,\n held.kekLevels,\n held.directories,\n )\n : decodeDocumentWriterProjection(\n value,\n held.bundles,\n held.kekLevels,\n held.directories,\n ),\n method: \"GET\",\n context,\n operation: container\n ? getContainerWriterProjectionOperation\n : getDocumentWriterProjectionOperation,\n });\n}\n\n/**\n * Preparation and body deadlines sit inside the projection read. The wire\n * cites each manifest bundle by hash and may cite a held KEK level by digest;\n * decoding resolves every citation, from the response or from the exact bytes\n * this request declared held, before any validator, cache, or verifier sees\n * the projection. A response this device\n * cannot rebuild fails closed into one complete, hint-free refetch.\n */\nasync function citedProjectionRead<T>(\n runtime: ApiRequestRuntime,\n citations: VerifiedManifestCitations | null,\n input: {\n readonly kind: WriterProjectionTarget[\"kind\"];\n readonly path: string;\n readonly validator: (value: unknown) => value is T;\n },\n options: RequestResultOptions,\n): Promise<RequestResult<T>> {\n // Bind the identity before citations load: an account switch while they\n // load, or before the refetch, must not carry one identity's hints or\n // answer into another's session. Each request rechecks this context.\n const context = new PrincipalHistoryRequestContext(\n runtime,\n \"GET\",\n input.path,\n options,\n );\n const id = projectionId(input.path);\n // Caller-specific headers make a request its own; it cites nothing. The\n // caller's abort also ends a citation wait.\n const held =\n id === null || options.headers !== undefined\n ? NO_CITATIONS\n : await heldManifestCitations(\n citations,\n { kind: input.kind, id, listing: options.projectionListing },\n options.signal,\n );\n if (held.bundles.size + held.kekLevels.size + held.directories.size === 0)\n return readProjection(runtime, input, held, context);\n const hinted = await readProjection(\n runtime,\n input,\n held,\n context.derive({\n ...options,\n headers: {\n \"x-known-manifests\": formatKnownManifestHints({\n manifests: [...held.bundles.keys()],\n kekLevels: [...held.kekLevels.keys()],\n directories: [...held.directories.keys()],\n }),\n },\n reportErrors: false,\n }),\n );\n if (hinted.ok) return hinted;\n if (hinted.kind !== \"shape\") {\n if (options.reportErrors !== false) hinted.report();\n return hinted;\n }\n return readProjection(runtime, input, NO_CITATIONS, context.derive(options));\n}\n\nexport function writerProjectionRequests(\n runtime: ApiRequestRuntime,\n citations: () => VerifiedManifestCitations | null,\n): {\n request: OperationRequestFn;\n requestResult: OperationRequestResultFn;\n} {\n const requestResult: OperationRequestResultFn = (\n path,\n validator,\n method,\n body,\n options,\n operation,\n ) => {\n const kind = method === \"GET\" ? writerProjectionKind(operation.id) : null;\n if (kind)\n return citedProjectionRead(\n runtime,\n citations(),\n { kind, path, validator },\n options ?? {},\n );\n return runtime.requestResult(\n path,\n validator,\n method,\n body,\n options,\n operation,\n );\n };\n const request: OperationRequestFn = async (...args) => {\n const result = await requestResult(...args);\n return result.ok ? result.data : null;\n };\n return { request, requestResult };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export const knownManifestsHeaderRefinement = {
2
2
  id: "request.known-manifest-hints",
3
- description: "x-known-manifests must list at most 48 unique typed digests, each m: or k: followed by a lowercase SHA-256 hex digest",
3
+ description: "x-known-manifests must list unique typed digests, at most 48 m: or k: and at most 8 d:, each followed by a lowercase SHA-256 hex digest",
4
4
  };
5
5
  //# sourceMappingURL=knownManifestsRefinements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"knownManifestsRefinements.js","sourceRoot":"","sources":["knownManifestsRefinements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,EAAE,EAAE,8BAA8B;IAClC,WAAW,EACT,uHAAuH;CACjH,CAAC","sourcesContent":["export const knownManifestsHeaderRefinement = {\n id: \"request.known-manifest-hints\",\n description:\n \"x-known-manifests must list at most 48 unique typed digests, each m: or k: followed by a lowercase SHA-256 hex digest\",\n} as const;\n"]}
1
+ {"version":3,"file":"knownManifestsRefinements.js","sourceRoot":"","sources":["knownManifestsRefinements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,EAAE,EAAE,8BAA8B;IAClC,WAAW,EACT,yIAAyI;CACnI,CAAC","sourcesContent":["export const knownManifestsHeaderRefinement = {\n id: \"request.known-manifest-hints\",\n description:\n \"x-known-manifests must list unique typed digests, at most 48 m: or k: and at most 8 d:, each followed by a lowercase SHA-256 hex digest\",\n} as const;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { isContainerCreateWithMetadataDocumentRequest, isContainerMutationRequest, isContainerRotationRequest } from "../request/index.js";
3
- import { ErrorResponseSchema, isContainerCreateWithMetadataDocumentResponse, isContainerDeleteResponse, isContainerMutationResponse, isContainerRotationResponse } from "../response/index.js";
3
+ import { ErrorResponseSchema, isContainerCreateWithMetadataDocumentResponse, isContainerDeleteResponse, isContainerMutationResponse, isContainerRotationResponse, isContainerShareResponse } from "../response/index.js";
4
4
  export declare const ContainerMutationPathParamsSchema: z.ZodObject<{
5
5
  containerId: z.ZodString;
6
6
  }, z.core.$strict>;
@@ -2000,13 +2000,22 @@ export declare const shareContainerOperation: Omit<{
2000
2000
  };
2001
2001
  readonly failureStatuses: readonly [400, 401, 402, 403, 404, 409, 500];
2002
2002
  readonly id: "containers.share";
2003
- readonly summary: string;
2004
- readonly description: string;
2003
+ readonly summary: "Share a container";
2004
+ readonly description: "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. When `readModelCursor` names the read-model head the share's grants stamp advanced from, the response carries the read-model delta a feed read from that cursor returns.";
2005
2005
  readonly method: "POST";
2006
2006
  readonly params: z.ZodObject<{
2007
2007
  containerId: z.ZodString;
2008
2008
  }, z.core.$strict>;
2009
2009
  readonly path: "/containers/{containerId}/share";
2010
+ readonly query: z.ZodType<{
2011
+ readModelCursor?: string | undefined;
2012
+ }, {
2013
+ readModelCursor?: string | undefined;
2014
+ }, z.core.$ZodTypeInternals<{
2015
+ readModelCursor?: string | undefined;
2016
+ }, {
2017
+ readModelCursor?: string | undefined;
2018
+ }>>;
2010
2019
  readonly responses: {
2011
2020
  readonly 200: z.ZodType<{
2012
2021
  containerKek: {
@@ -2028,6 +2037,7 @@ export declare const shareContainerOperation: Omit<{
2028
2037
  organizationId: string;
2029
2038
  parentId: string | null;
2030
2039
  updatedAt: string;
2040
+ readModel?: unknown;
2031
2041
  systemSlot?: string | null | undefined;
2032
2042
  }, {
2033
2043
  containerKek: {
@@ -2049,6 +2059,7 @@ export declare const shareContainerOperation: Omit<{
2049
2059
  organizationId: string;
2050
2060
  parentId: string | null;
2051
2061
  updatedAt: string;
2062
+ readModel?: unknown;
2052
2063
  systemSlot?: string | null | undefined;
2053
2064
  }, z.core.$ZodTypeInternals<{
2054
2065
  containerKek: {
@@ -2070,6 +2081,7 @@ export declare const shareContainerOperation: Omit<{
2070
2081
  organizationId: string;
2071
2082
  parentId: string | null;
2072
2083
  updatedAt: string;
2084
+ readModel?: unknown;
2073
2085
  systemSlot?: string | null | undefined;
2074
2086
  }, {
2075
2087
  containerKek: {
@@ -2091,12 +2103,16 @@ export declare const shareContainerOperation: Omit<{
2091
2103
  organizationId: string;
2092
2104
  parentId: string | null;
2093
2105
  updatedAt: string;
2106
+ readModel?: unknown;
2094
2107
  systemSlot?: string | null | undefined;
2095
2108
  }>>;
2096
2109
  };
2097
2110
  readonly runtimeRefinements: readonly [{
2098
2111
  readonly description: "a container response keyring is null exactly for container key epoch 1";
2099
2112
  readonly id: "response.organization-provisioning-container-keyring";
2113
+ }, {
2114
+ readonly description: "read-model lanes match the response organization; grants and memberships are unambiguous; snapshot lanes are complete and contain no deletions";
2115
+ readonly id: "response.organization-read-model-consistency";
2100
2116
  }];
2101
2117
  }, "failureResponses" | "failureStatuses"> & {
2102
2118
  readonly failureResponses: {
@@ -5120,6 +5136,7 @@ export declare const deleteContainerOperation: Omit<{
5120
5136
  };
5121
5137
  export declare const isContainerMutationOperationRequest: typeof isContainerMutationRequest;
5122
5138
  export declare const isContainerMutationOperationResponse: typeof isContainerMutationResponse;
5139
+ export declare const isShareContainerOperationResponse: typeof isContainerShareResponse;
5123
5140
  export declare const isContainerRotationOperationRequest: typeof isContainerRotationRequest;
5124
5141
  export declare const isContainerRotationOperationResponse: typeof isContainerRotationResponse;
5125
5142
  export declare const isCreateContainerWithMetadataDocumentOperationRequest: typeof isContainerCreateWithMetadataDocumentRequest;
@@ -2,8 +2,9 @@ import { z } from "zod";
2
2
  import { containerCreateMetadataSeedRefinement } from "../documentCreateSeedRefinements.js";
3
3
  import { documentSyncRequestRuntimeRefinements } from "../documentSyncRefinements.js";
4
4
  import { organizationProvisioningContainerKeyringRefinement } from "../organizationProvisioningRefinements.js";
5
- import { ContainerCreateWithMetadataDocumentRequestSchema, ContainerMutationRequestSchema, ContainerReciteRequestSchema, ContainerRotationRequestSchema, isContainerCreateWithMetadataDocumentRequest, isContainerMutationRequest, isContainerRotationRequest, } from "../request/index.js";
6
- import { ContainerCreateWithMetadataDocumentResponseSchema, ContainerDeleteResponseSchema, ContainerMutationFailureResponseSchema, ContainerMutationResponseSchema, ContainerNotFoundErrorResponseSchema, ContainerReciteResponseSchema, ContainerRotationResponseSchema, ErrorResponseSchema, isContainerCreateWithMetadataDocumentResponse, isContainerDeleteResponse, isContainerMutationResponse, isContainerRotationResponse, PaymentRequiredErrorResponseSchema, SessionFailureResponseSchema, } from "../response/index.js";
5
+ import { organizationReadModelResponseRuntimeRefinements } from "../organizationReadModelRefinements.js";
6
+ import { ContainerCreateWithMetadataDocumentRequestSchema, ContainerMutationRequestSchema, ContainerReciteRequestSchema, ContainerRotationRequestSchema, isContainerCreateWithMetadataDocumentRequest, isContainerMutationRequest, isContainerRotationRequest, OrganizationReadModelHeldCursorQuerySchema, } from "../request/index.js";
7
+ import { ContainerCreateWithMetadataDocumentResponseSchema, ContainerDeleteResponseSchema, ContainerMutationFailureResponseSchema, ContainerMutationResponseSchema, ContainerNotFoundErrorResponseSchema, ContainerReciteResponseSchema, ContainerRotationResponseSchema, ContainerShareResponseSchema, ErrorResponseSchema, isContainerCreateWithMetadataDocumentResponse, isContainerDeleteResponse, isContainerMutationResponse, isContainerRotationResponse, isContainerShareResponse, PaymentRequiredErrorResponseSchema, SessionFailureResponseSchema, } from "../response/index.js";
7
8
  import { defineJsonOperation } from "./definition.js";
8
9
  const EmptyContainerMutationPathParamsSchema = z.strictObject({});
9
10
  export const ContainerMutationPathParamsSchema = z.strictObject({
@@ -59,22 +60,6 @@ export const createContainerWithMetadataDocumentOperation = defineJsonOperation(
59
60
  ...documentSyncRequestRuntimeRefinements,
60
61
  ],
61
62
  });
62
- function defineContainerMutationOperation(input) {
63
- return defineJsonOperation({
64
- auth: "session",
65
- body: ContainerMutationRequestSchema,
66
- failureResponses: containerMutationFailureResponses,
67
- failureStatuses: containerMutationFailureStatuses,
68
- id: input.id,
69
- summary: input.summary,
70
- description: input.description,
71
- method: "POST",
72
- params: ContainerMutationPathParamsSchema,
73
- path: input.path,
74
- responses: { 200: ContainerMutationResponseSchema },
75
- runtimeRefinements: containerMutationRuntimeRefinements,
76
- });
77
- }
78
63
  /**
79
64
  * Rekey, revoke, and move mint a new key epoch, so they alone may carry the
80
65
  * descendant rekeys that must commit with them.
@@ -95,11 +80,23 @@ function defineContainerRotationOperation(input) {
95
80
  runtimeRefinements: containerMutationRuntimeRefinements,
96
81
  });
97
82
  }
98
- export const shareContainerOperation = defineContainerMutationOperation({
83
+ export const shareContainerOperation = defineJsonOperation({
84
+ auth: "session",
85
+ body: ContainerMutationRequestSchema,
86
+ failureResponses: containerMutationFailureResponses,
87
+ failureStatuses: containerMutationFailureStatuses,
99
88
  id: "containers.share",
100
89
  summary: "Share a container",
101
- description: "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.",
90
+ description: "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. When `readModelCursor` names the read-model head the share's grants stamp advanced from, the response carries the read-model delta a feed read from that cursor returns.",
91
+ method: "POST",
92
+ params: ContainerMutationPathParamsSchema,
102
93
  path: "/containers/{containerId}/share",
94
+ query: OrganizationReadModelHeldCursorQuerySchema,
95
+ responses: { 200: ContainerShareResponseSchema },
96
+ runtimeRefinements: [
97
+ ...containerMutationRuntimeRefinements,
98
+ ...organizationReadModelResponseRuntimeRefinements,
99
+ ],
103
100
  });
104
101
  export const reciteContainerOperation = defineJsonOperation({
105
102
  auth: "session",
@@ -150,6 +147,7 @@ export const deleteContainerOperation = defineJsonOperation({
150
147
  });
151
148
  export const isContainerMutationOperationRequest = isContainerMutationRequest;
152
149
  export const isContainerMutationOperationResponse = isContainerMutationResponse;
150
+ export const isShareContainerOperationResponse = isContainerShareResponse;
153
151
  export const isContainerRotationOperationRequest = isContainerRotationRequest;
154
152
  export const isContainerRotationOperationResponse = isContainerRotationResponse;
155
153
  export const isCreateContainerWithMetadataDocumentOperationRequest = isContainerCreateWithMetadataDocumentRequest;
@@ -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,YAAY,CAAC;AACpB,OAAO,EACL,iDAAiD,EACjD,6BAA6B,EAC7B,sCAAsC,EACtC,+BAA+B,EAC/B,oCAAoC,EACpC,6BAA6B,EAC7B,+BAA+B,EAC/B,mBAAmB,EACnB,6CAA6C,EAC7C,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,kCAAkC,EAClC,4BAA4B,GA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,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, 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"]}
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,EAAE,+CAA+C,EAAE,MAAM,qCAAqC,CAAC;AACtG,OAAO,EACL,gDAAgD,EAChD,8BAA8B,EAC9B,4BAA4B,EAC5B,8BAA8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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,iCAAiC,GAAG,wBAAwB,CAAC;AAC1E,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 { organizationReadModelResponseRuntimeRefinements } from \"../organizationReadModelRefinements\";\nimport {\n ContainerCreateWithMetadataDocumentRequestSchema,\n ContainerMutationRequestSchema,\n ContainerReciteRequestSchema,\n ContainerRotationRequestSchema,\n isContainerCreateWithMetadataDocumentRequest,\n isContainerMutationRequest,\n isContainerRotationRequest,\n OrganizationReadModelHeldCursorQuerySchema,\n} from \"../request\";\nimport {\n ContainerCreateWithMetadataDocumentResponseSchema,\n ContainerDeleteResponseSchema,\n ContainerMutationFailureResponseSchema,\n ContainerMutationResponseSchema,\n ContainerNotFoundErrorResponseSchema,\n ContainerReciteResponseSchema,\n ContainerRotationResponseSchema,\n ContainerShareResponseSchema,\n ErrorResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n isContainerDeleteResponse,\n isContainerMutationResponse,\n isContainerRotationResponse,\n isContainerShareResponse,\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\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 = defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\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. When `readModelCursor` names the read-model head the share's grants stamp advanced from, the response carries the read-model delta a feed read from that cursor returns.\",\n method: \"POST\",\n params: ContainerMutationPathParamsSchema,\n path: \"/containers/{containerId}/share\",\n query: OrganizationReadModelHeldCursorQuerySchema,\n responses: { 200: ContainerShareResponseSchema },\n runtimeRefinements: [\n ...containerMutationRuntimeRefinements,\n ...organizationReadModelResponseRuntimeRefinements,\n ],\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 isShareContainerOperationResponse = isContainerShareResponse;\nexport const isContainerRotationOperationRequest = isContainerRotationRequest;\nexport const isContainerRotationOperationResponse = isContainerRotationResponse;\nexport const isCreateContainerWithMetadataDocumentOperationRequest =\n isContainerCreateWithMetadataDocumentRequest;\nexport const isCreateContainerWithMetadataDocumentOperationResponse =\n isContainerCreateWithMetadataDocumentResponse;\nexport const isDeleteContainerOperationResponse = isContainerDeleteResponse;\n"]}
@@ -4,7 +4,7 @@ export { challengeOperation, destroySessionOperation, isChallengeOperationReques
4
4
  export { billingWebhookWireHeaderKeys, billingWebhookWireHeaderNames, isReceiveRevenueCatWebhookOperationRequest, isReceiveRevenueCatWebhookOperationResponse, isReceiveStripeWebhookOperationRequest, isReceiveStripeWebhookOperationResponse, type RevenueCatWebhookHeaders, RevenueCatWebhookHeadersSchema, receiveRevenueCatWebhookOperation, receiveStripeWebhookOperation, type StripeWebhookHeaders, StripeWebhookHeadersSchema, } from "./billingWebhooks.js";
5
5
  export { BinaryBodySchema, type BlobBytesPathParams, BlobBytesPathParamsSchema, type BlobBytesResponseHeaders, BlobBytesResponseHeadersSchema, blobWireHeaderKeys, blobWireHeaderNames, getBlobBytesOperation, isUploadMultipartBlobPartBytesOperationResponse, type MultipartBlobPartHeaders, MultipartBlobPartHeadersSchema, type MultipartBlobPartPathParams, MultipartBlobPartPathParamsSchema, uploadMultipartBlobPartBytesOperation, } from "./blobBytes.js";
6
6
  export { type BlobDownloadResponse, BlobDownloadResponseSchema, getBlobDownloadOperation, } from "./blobDownloads.js";
7
- export { type ContainerMutationPathParams, ContainerMutationPathParamsSchema, createContainerOperation, createContainerWithMetadataDocumentOperation, deleteContainerOperation, isContainerMutationOperationRequest, isContainerMutationOperationResponse, isContainerRotationOperationRequest, isContainerRotationOperationResponse, isCreateContainerWithMetadataDocumentOperationRequest, isCreateContainerWithMetadataDocumentOperationResponse, isDeleteContainerOperationResponse, moveContainerOperation, reciteContainerOperation, rekeyContainerOperation, revokeContainerOperation, shareContainerOperation, } from "./containerMutations.js";
7
+ export { type ContainerMutationPathParams, ContainerMutationPathParamsSchema, createContainerOperation, createContainerWithMetadataDocumentOperation, deleteContainerOperation, isContainerMutationOperationRequest, isContainerMutationOperationResponse, isContainerRotationOperationRequest, isContainerRotationOperationResponse, isCreateContainerWithMetadataDocumentOperationRequest, isCreateContainerWithMetadataDocumentOperationResponse, isDeleteContainerOperationResponse, isShareContainerOperationResponse, moveContainerOperation, reciteContainerOperation, rekeyContainerOperation, revokeContainerOperation, shareContainerOperation, } from "./containerMutations.js";
8
8
  export { type ContainerKekLogQuery, ContainerKekLogQuerySchema, type ContainerReadPathParams, ContainerReadPathParamsSchema, getContainerKekLogOperation, isGetContainerKekLogOperationResponse, isListContainerDocumentLanesOperationRequest, isListContainerDocumentLanesOperationResponse, isListContainerParentLanesOperationRequest, isListContainerParentLanesOperationResponse, listContainerDocumentLanesOperation, listContainerParentLanesOperation, } from "./containerReads.js";
9
9
  export { type ContainerReplacementAuthorizationsResponse, ContainerReplacementAuthorizationsResponseSchema, getContainerReplacementAuthorizationsOperation, } from "./containerReplacement.js";
10
10
  export { defineHttpOperation, defineJsonOperation, type HttpOperation, type HttpOperationMediaType, type HttpOperationMethod, type JsonOperation, type JsonOperationMethod, type OperationSchemaInput, type OperationSchemaOutput, operationRequestPath, operationRequestPathForInput, operationRequestPathWithQuery, operationRoutePath, type RuntimeRefinement, } from "./definition.js";
@@ -4,7 +4,7 @@ export { challengeOperation, destroySessionOperation, isChallengeOperationReques
4
4
  export { billingWebhookWireHeaderKeys, billingWebhookWireHeaderNames, isReceiveRevenueCatWebhookOperationRequest, isReceiveRevenueCatWebhookOperationResponse, isReceiveStripeWebhookOperationRequest, isReceiveStripeWebhookOperationResponse, RevenueCatWebhookHeadersSchema, receiveRevenueCatWebhookOperation, receiveStripeWebhookOperation, StripeWebhookHeadersSchema, } from "./billingWebhooks.js";
5
5
  export { BinaryBodySchema, BlobBytesPathParamsSchema, BlobBytesResponseHeadersSchema, blobWireHeaderKeys, blobWireHeaderNames, getBlobBytesOperation, isUploadMultipartBlobPartBytesOperationResponse, MultipartBlobPartHeadersSchema, MultipartBlobPartPathParamsSchema, uploadMultipartBlobPartBytesOperation, } from "./blobBytes.js";
6
6
  export { BlobDownloadResponseSchema, getBlobDownloadOperation, } from "./blobDownloads.js";
7
- export { ContainerMutationPathParamsSchema, createContainerOperation, createContainerWithMetadataDocumentOperation, deleteContainerOperation, isContainerMutationOperationRequest, isContainerMutationOperationResponse, isContainerRotationOperationRequest, isContainerRotationOperationResponse, isCreateContainerWithMetadataDocumentOperationRequest, isCreateContainerWithMetadataDocumentOperationResponse, isDeleteContainerOperationResponse, moveContainerOperation, reciteContainerOperation, rekeyContainerOperation, revokeContainerOperation, shareContainerOperation, } from "./containerMutations.js";
7
+ export { ContainerMutationPathParamsSchema, createContainerOperation, createContainerWithMetadataDocumentOperation, deleteContainerOperation, isContainerMutationOperationRequest, isContainerMutationOperationResponse, isContainerRotationOperationRequest, isContainerRotationOperationResponse, isCreateContainerWithMetadataDocumentOperationRequest, isCreateContainerWithMetadataDocumentOperationResponse, isDeleteContainerOperationResponse, isShareContainerOperationResponse, moveContainerOperation, reciteContainerOperation, rekeyContainerOperation, revokeContainerOperation, shareContainerOperation, } from "./containerMutations.js";
8
8
  export { ContainerKekLogQuerySchema, ContainerReadPathParamsSchema, getContainerKekLogOperation, isGetContainerKekLogOperationResponse, isListContainerDocumentLanesOperationRequest, isListContainerDocumentLanesOperationResponse, isListContainerParentLanesOperationRequest, isListContainerParentLanesOperationResponse, listContainerDocumentLanesOperation, listContainerParentLanesOperation, } from "./containerReads.js";
9
9
  export { ContainerReplacementAuthorizationsResponseSchema, getContainerReplacementAuthorizationsOperation, } from "./containerReplacement.js";
10
10
  export { defineHttpOperation, defineJsonOperation, operationRequestPath, operationRequestPathForInput, operationRequestPathWithQuery, operationRoutePath, } from "./definition.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAEL,qCAAqC,EAErC,8BAA8B,EAC9B,2BAA2B,EAE3B,mCAAmC,EACnC,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,sCAAsC,EACtC,uCAAuC,EACvC,0CAA0C,EAC1C,gCAAgC,GACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5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B,kCAAkC,EAElC,yBAAyB,EAEzB,4BAA4B,GAC7B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,4BAA4B,GAE7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,qCAAqC,EACrC,4BAA4B,EAC5B,gCAAgC,EAChC,uCAAuC,EACvC,8BAA8B,GAG/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6CAA6C,EAC7C,uCAAuC,GAGxC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mCAAmC,EACnC,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iCAAiC,EACjC,yBAAyB,EACzB,6BAA6B,EAC7B,oCAAoC,EACpC,2BAA2B,EAC3B,iCAAiC,EACjC,2CAA2C,EAC3C,kCAAkC,EAClC,mCAAmC,EACnC,sCAAsC,EACtC,uCAAuC,EACvC,6CAA6C,EAC7C,8CAA8C,EAC9C,oCAAoC,EACpC,qCAAqC,EACrC,2CAA2C,EAE3C,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,yCAAyC,EAEzC,wCAAwC,EACxC,qCAAqC,EACrC,oCAAoC,EACpC,+CAA+C,EAC/C,8CAA8C,GAC/C,MAAM,qBAAqB,CAAC","sourcesContent":["export { apiVersionHeaderName, parseApiVersion } from \"./apiVersion\";\nexport {\n type BlobAttachmentBindingPathParams,\n BlobAttachmentBindingPathParamsSchema,\n type BlobAttachmentPathParams,\n BlobAttachmentPathParamsSchema,\n bindBlobAttachmentOperation,\n type DocumentAttachmentsPathParams,\n DocumentAttachmentsPathParamsSchema,\n detachBlobAttachmentOperation,\n isBindBlobAttachmentOperationRequest,\n isBindBlobAttachmentOperationResponse,\n isDetachBlobAttachmentOperationRequest,\n isDetachBlobAttachmentOperationResponse,\n isListDocumentAttachmentsOperationResponse,\n listDocumentAttachmentsOperation,\n} from \"./attachments\";\nexport {\n challengeOperation,\n destroySessionOperation,\n isChallengeOperationRequest,\n isChallengeOperationResponse,\n isDestroySessionOperationResponse,\n isListSessionsOperationResponse,\n isLogoutOperationResponse,\n isRegistrationOperationRequest,\n isRegistrationOperationResponse,\n isUserIdentityOperationResponse,\n isVerifyOperationRequest,\n isVerifyOperationResponse,\n isWebSocketTicketOperationResponse,\n listSessionsOperation,\n logoutOperation,\n registerOperation,\n userIdentityOperation,\n verifyOperation,\n webSocketTicketOperation,\n} from \"./auth\";\nexport {\n billingWebhookWireHeaderKeys,\n billingWebhookWireHeaderNames,\n isReceiveRevenueCatWebhookOperationRequest,\n isReceiveRevenueCatWebhookOperationResponse,\n isReceiveStripeWebhookOperationRequest,\n isReceiveStripeWebhookOperationResponse,\n type RevenueCatWebhookHeaders,\n RevenueCatWebhookHeadersSchema,\n receiveRevenueCatWebhookOperation,\n receiveStripeWebhookOperation,\n type StripeWebhookHeaders,\n StripeWebhookHeadersSchema,\n} from \"./billingWebhooks\";\nexport {\n BinaryBodySchema,\n type BlobBytesPathParams,\n BlobBytesPathParamsSchema,\n type BlobBytesResponseHeaders,\n BlobBytesResponseHeadersSchema,\n blobWireHeaderKeys,\n blobWireHeaderNames,\n getBlobBytesOperation,\n isUploadMultipartBlobPartBytesOperationResponse,\n type MultipartBlobPartHeaders,\n MultipartBlobPartHeadersSchema,\n type MultipartBlobPartPathParams,\n MultipartBlobPartPathParamsSchema,\n uploadMultipartBlobPartBytesOperation,\n} from \"./blobBytes\";\nexport {\n type BlobDownloadResponse,\n BlobDownloadResponseSchema,\n getBlobDownloadOperation,\n} from \"./blobDownloads\";\nexport {\n type ContainerMutationPathParams,\n ContainerMutationPathParamsSchema,\n createContainerOperation,\n createContainerWithMetadataDocumentOperation,\n deleteContainerOperation,\n isContainerMutationOperationRequest,\n isContainerMutationOperationResponse,\n isContainerRotationOperationRequest,\n isContainerRotationOperationResponse,\n isCreateContainerWithMetadataDocumentOperationRequest,\n isCreateContainerWithMetadataDocumentOperationResponse,\n isDeleteContainerOperationResponse,\n moveContainerOperation,\n reciteContainerOperation,\n rekeyContainerOperation,\n revokeContainerOperation,\n shareContainerOperation,\n} from \"./containerMutations\";\nexport {\n type ContainerKekLogQuery,\n ContainerKekLogQuerySchema,\n type ContainerReadPathParams,\n ContainerReadPathParamsSchema,\n getContainerKekLogOperation,\n isGetContainerKekLogOperationResponse,\n isListContainerDocumentLanesOperationRequest,\n isListContainerDocumentLanesOperationResponse,\n isListContainerParentLanesOperationRequest,\n isListContainerParentLanesOperationResponse,\n listContainerDocumentLanesOperation,\n listContainerParentLanesOperation,\n} from \"./containerReads\";\nexport {\n type ContainerReplacementAuthorizationsResponse,\n ContainerReplacementAuthorizationsResponseSchema,\n getContainerReplacementAuthorizationsOperation,\n} from \"./containerReplacement\";\nexport {\n defineHttpOperation,\n defineJsonOperation,\n type HttpOperation,\n type HttpOperationMediaType,\n type HttpOperationMethod,\n type JsonOperation,\n type JsonOperationMethod,\n type OperationSchemaInput,\n type OperationSchemaOutput,\n operationRequestPath,\n operationRequestPathForInput,\n operationRequestPathWithQuery,\n operationRoutePath,\n type RuntimeRefinement,\n} from \"./definition\";\nexport {\n type DocumentAttributionPathParams,\n DocumentAttributionPathParamsSchema,\n type DocumentAttributionRangesQuery,\n DocumentAttributionRangesQuerySchema,\n type DocumentAttributionRequestHeaders,\n DocumentAttributionRequestHeadersSchema,\n documentAttributionWireHeaderKeys,\n documentAttributionWireHeaderNames,\n getDocumentAttributionOperation,\n isGetDocumentAttributionOperationResponse,\n isListDocumentAttributionRangesOperationResponse,\n listDocumentAttributionRangesOperation,\n} from \"./documentAttribution\";\nexport {\n createDocumentOperation,\n type DocumentMutationPathParams,\n DocumentMutationPathParamsSchema,\n type DocumentPurgeProofQuery,\n DocumentPurgeProofQuerySchema,\n getDocumentPurgeProofOperation,\n isCreateDocumentOperationRequest,\n isCreateDocumentOperationResponse,\n isDocumentLinkSetMutationOperationRequest,\n isDocumentLinkSetMutationOperationResponse,\n isGetDocumentPurgeProofOperationResponse,\n isPurgeDocumentOperationRequest,\n isPurgeDocumentOperationResponse,\n linkDocumentOperation,\n purgeDocumentOperation,\n unlinkDocumentOperation,\n} from \"./documentMutations\";\nexport {\n type DocumentSyncPathParams,\n DocumentSyncPathParamsSchema,\n documentSyncOperation,\n isDocumentSyncOperationRequest,\n isDocumentSyncOperationResponse,\n} from \"./documentSync\";\nexport {\n operationRequestHeaderNames,\n operationResponseHeaderNames,\n} from \"./headerNames\";\nexport {\n getHealthOperation,\n isGetHealthOperationResponse,\n} from \"./health\";\nexport {\n getMultipartBlobStageOperation,\n initiateMultipartBlobStageOperation,\n isGetMultipartBlobStageOperationResponse,\n isInitiateMultipartBlobStageOperationRequest,\n isInitiateMultipartBlobStageOperationResponse,\n type MultipartBlobStagePathParams,\n MultipartBlobStagePathParamsSchema,\n} from \"./multipartBlobs\";\nexport {\n authorizeMultipartBlobPartUploadOperation,\n type MultipartBlobPartUploadRequest,\n MultipartBlobPartUploadRequestSchema,\n type MultipartBlobPartUploadResponse,\n MultipartBlobPartUploadResponseSchema,\n} from \"./multipartPartUploads\";\nexport {\n claimNativeOrganizationSubscriptionOperation,\n getOrganizationBillingHistoryOperation,\n getOrganizationBillingManagementUrlOperation,\n getOrganizationBillingOperation,\n getOrganizationNativePurchaseEligibilityOperation,\n isClaimNativeOrganizationSubscriptionOperationResponse,\n isGetOrganizationBillingHistoryOperationResponse,\n isGetOrganizationBillingManagementUrlOperationResponse,\n isGetOrganizationBillingOperationResponse,\n isGetOrganizationNativePurchaseEligibilityOperationResponse,\n isStartOrganizationTrialOperationResponse,\n type OrganizationBillingNativeClaimPathParams,\n OrganizationBillingNativeClaimPathParamsSchema,\n type OrganizationBillingNativeEligibilityQuery,\n OrganizationBillingNativeEligibilityQuerySchema,\n type OrganizationBillingPathParams,\n OrganizationBillingPathParamsSchema,\n startOrganizationTrialOperation,\n} from \"./organizationBilling\";\nexport {\n isListOrganizationMembershipsOperationResponse,\n isRequestOrganizationLeaveOperationRequest,\n isUpdateOrganizationMembershipOperationRequest,\n isUpdateOrganizationMembershipOperationResponse,\n listOrganizationMembershipsOperation,\n type OrganizationMembershipPathParams,\n OrganizationMembershipPathParamsSchema,\n requestOrganizationLeaveOperation,\n updateOrganizationMembershipOperation,\n withdrawOrganizationLeaveRequestOperation,\n} from \"./organizationMemberships\";\nexport { getOrganizationPolicyHistoryOperation } from \"./organizationPolicyHistory\";\nexport {\n createOrganizationGroupOperation,\n createOrganizationOperation,\n deleteOrganizationGroupOperation,\n getOrganizationDataUsageOperation,\n getOrganizationReadModelOperation,\n isCreateOrganizationGroupOperationRequest,\n isCreateOrganizationGroupOperationResponse,\n isCreateOrganizationOperationRequest,\n isCreateOrganizationOperationResponse,\n isDeleteOrganizationGroupOperationResponse,\n isGetOrganizationDataUsageOperationResponse,\n isGetOrganizationReadModelOperationResponse,\n isListOrganizationGroupMembersOperationResponse,\n isUpdateOrganizationProfileOperationRequest,\n isUpdateOrganizationProfileOperationResponse,\n isUpdateOrganizationRosterEntryOperationRequest,\n isUpdateOrganizationRosterEntryOperationResponse,\n listOrganizationGroupMembersOperation,\n type OrganizationGroupPathParams,\n OrganizationGroupPathParamsSchema,\n type OrganizationPathParams,\n OrganizationPathParamsSchema,\n type OrganizationRosterPathParams,\n OrganizationRosterPathParamsSchema,\n updateOrganizationProfileOperation,\n updateOrganizationRosterEntryOperation,\n} from \"./organizations\";\nexport {\n listOrganizationPendingBlobDeletionsOperation,\n listRootPendingBlobDeletionsOperation,\n type PendingBlobDeletionsQuery,\n PendingBlobDeletionsQuerySchema,\n type RootPendingBlobDeletionsQuery,\n RootPendingBlobDeletionsQuerySchema,\n} from \"./pendingBlobDeletions\";\nexport {\n type PrincipalPolicyPageQuery,\n PrincipalPolicyPageQuerySchema,\n} from \"./principalPolicyPageQuery\";\nexport {\n commitOrganizationGroupPolicyOperation,\n getPrincipalMemberEnvelopesOperation,\n getPrincipalPolicyOperation,\n isCommitOrganizationGroupPolicyOperationRequest,\n isCommitOrganizationGroupPolicyOperationResponse,\n isGetPrincipalMemberEnvelopesOperationResponse,\n isGetPrincipalPolicyOperationResponse,\n isPutPrincipalPolicyOperationRequest,\n isPutPrincipalPolicyOperationResponse,\n type OrganizationGroupPolicyPathParams,\n OrganizationGroupPolicyPathParamsSchema,\n type PrincipalMemberEnvelopesQuery,\n PrincipalMemberEnvelopesQuerySchema,\n type PrincipalPolicyPathParams,\n PrincipalPolicyPathParamsSchema,\n putPrincipalPolicyOperation,\n} from \"./principals\";\nexport {\n getProjectionPolicyHistoryOperation,\n type ProjectionPolicyHistoryQuery,\n ProjectionPolicyHistoryQuerySchema,\n} from \"./projectionPolicyHistory\";\nexport { protocolOperations } from \"./registry\";\nexport {\n getRootIdentityOperation,\n isGetRootIdentityOperationResponse,\n isListRootIdentitiesOperationResponse,\n isListRootIdentityOrganizationsOperationResponse,\n listRootIdentitiesOperation,\n listRootIdentityOrganizationsOperation,\n MAX_ROOT_IDENTITY_PAGE_SIZE,\n MIN_ROOT_FINGERPRINT_PREFIX_LENGTH,\n type RootIdentitiesQuery,\n RootIdentitiesQuerySchema,\n type RootIdentityPathParams,\n RootIdentityPathParamsSchema,\n} from \"./root\";\nexport {\n listRootAuditEventsOperation,\n type RootAuditEventsQuery,\n} from \"./rootAudit\";\nexport { getRootOpsHealthReportOperation } from \"./rootOpsHealth\";\nexport {\n getRootOrganizationDataUsageOperation,\n getRootOrganizationOperation,\n listRootDataUsageReportOperation,\n listRootOrganizationIdentitiesOperation,\n listRootOrganizationsOperation,\n type RootOrganizationPageQuery,\n type RootOrganizationsQuery,\n} from \"./rootOrganizations\";\nexport {\n listRootOrganizationRevenuecatEventsOperation,\n listRootRevenuecatEventsReportOperation,\n type RootRevenuecatEventsQuery,\n type RootRevenuecatEventsReportQuery,\n} from \"./rootRevenuecat\";\nexport {\n liftRootIdentitySuspensionOperation,\n suspendRootIdentityOperation,\n} from \"./rootSuspension\";\nexport {\n cancelStripeSubscriptionOperation,\n changeStripePlanOperation,\n createStripeCheckoutOperation,\n createStripeCheckoutSessionOperation,\n createStripePortalOperation,\n getStripeCheckoutOptionsOperation,\n isCancelStripeSubscriptionOperationResponse,\n isChangeStripePlanOperationRequest,\n isChangeStripePlanOperationResponse,\n isCreateStripeCheckoutOperationRequest,\n isCreateStripeCheckoutOperationResponse,\n isCreateStripeCheckoutSessionOperationRequest,\n isCreateStripeCheckoutSessionOperationResponse,\n isCreateStripePortalOperationRequest,\n isCreateStripePortalOperationResponse,\n isGetStripeCheckoutOptionsOperationResponse,\n type StripeCheckoutPathParams,\n StripeCheckoutPathParamsSchema,\n} from \"./stripeCheckout\";\nexport {\n type ContainerWriterProjectionPathParams,\n ContainerWriterProjectionPathParamsSchema,\n type DocumentWriterProjectionPathParams,\n DocumentWriterProjectionPathParamsSchema,\n getContainerWriterProjectionOperation,\n getDocumentWriterProjectionOperation,\n isGetContainerWriterProjectionOperationResponse,\n isGetDocumentWriterProjectionOperationResponse,\n} from \"./writerProjections\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAEL,qCAAqC,EAErC,8BAA8B,EAC9B,2BAA2B,EAE3B,mCAAmC,EACnC,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,sCAAsC,EACtC,uCAAuC,EACvC,0CAA0C,EAC1C,gCAAgC,GACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,iCAAiC,EACjC,+BAA+B,EAC/B,yBAAyB,EACzB,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,yBAAyB,EACzB,kCAAkC,EAClC,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,GACzB,MAAM,QA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EAC5B,gCAAgC,EAChC,uCAAuC,EACvC,8BAA8B,GAG/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6CAA6C,EAC7C,uCAAuC,GAGxC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mCAAmC,EACnC,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iCAAiC,EACjC,yBAAyB,EACzB,6BAA6B,EAC7B,oCAAoC,EACpC,2BAA2B,EAC3B,iCAAiC,EACjC,2CAA2C,EAC3C,kCAAkC,EAClC,mCAAmC,EACnC,sCAAsC,EACtC,uCAAuC,EACvC,6CAA6C,EAC7C,8CAA8C,EAC9C,oCAAoC,EACpC,qCAAqC,EACrC,2CAA2C,EAE3C,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,yCAAyC,EAEzC,wCAAwC,EACxC,qCAAqC,EACrC,oCAAoC,EACpC,+CAA+C,EAC/C,8CAA8C,GAC/C,MAAM,qBAAqB,CAAC","sourcesContent":["export { apiVersionHeaderName, parseApiVersion } from \"./apiVersion\";\nexport {\n type BlobAttachmentBindingPathParams,\n BlobAttachmentBindingPathParamsSchema,\n type BlobAttachmentPathParams,\n BlobAttachmentPathParamsSchema,\n bindBlobAttachmentOperation,\n type DocumentAttachmentsPathParams,\n DocumentAttachmentsPathParamsSchema,\n detachBlobAttachmentOperation,\n isBindBlobAttachmentOperationRequest,\n isBindBlobAttachmentOperationResponse,\n isDetachBlobAttachmentOperationRequest,\n isDetachBlobAttachmentOperationResponse,\n isListDocumentAttachmentsOperationResponse,\n listDocumentAttachmentsOperation,\n} from \"./attachments\";\nexport {\n challengeOperation,\n destroySessionOperation,\n isChallengeOperationRequest,\n isChallengeOperationResponse,\n isDestroySessionOperationResponse,\n isListSessionsOperationResponse,\n isLogoutOperationResponse,\n isRegistrationOperationRequest,\n isRegistrationOperationResponse,\n isUserIdentityOperationResponse,\n isVerifyOperationRequest,\n isVerifyOperationResponse,\n isWebSocketTicketOperationResponse,\n listSessionsOperation,\n logoutOperation,\n registerOperation,\n userIdentityOperation,\n verifyOperation,\n webSocketTicketOperation,\n} from \"./auth\";\nexport {\n billingWebhookWireHeaderKeys,\n billingWebhookWireHeaderNames,\n isReceiveRevenueCatWebhookOperationRequest,\n isReceiveRevenueCatWebhookOperationResponse,\n isReceiveStripeWebhookOperationRequest,\n isReceiveStripeWebhookOperationResponse,\n type RevenueCatWebhookHeaders,\n RevenueCatWebhookHeadersSchema,\n receiveRevenueCatWebhookOperation,\n receiveStripeWebhookOperation,\n type StripeWebhookHeaders,\n StripeWebhookHeadersSchema,\n} from \"./billingWebhooks\";\nexport {\n BinaryBodySchema,\n type BlobBytesPathParams,\n BlobBytesPathParamsSchema,\n type BlobBytesResponseHeaders,\n BlobBytesResponseHeadersSchema,\n blobWireHeaderKeys,\n blobWireHeaderNames,\n getBlobBytesOperation,\n isUploadMultipartBlobPartBytesOperationResponse,\n type MultipartBlobPartHeaders,\n MultipartBlobPartHeadersSchema,\n type MultipartBlobPartPathParams,\n MultipartBlobPartPathParamsSchema,\n uploadMultipartBlobPartBytesOperation,\n} from \"./blobBytes\";\nexport {\n type BlobDownloadResponse,\n BlobDownloadResponseSchema,\n getBlobDownloadOperation,\n} from \"./blobDownloads\";\nexport {\n type ContainerMutationPathParams,\n ContainerMutationPathParamsSchema,\n createContainerOperation,\n createContainerWithMetadataDocumentOperation,\n deleteContainerOperation,\n isContainerMutationOperationRequest,\n isContainerMutationOperationResponse,\n isContainerRotationOperationRequest,\n isContainerRotationOperationResponse,\n isCreateContainerWithMetadataDocumentOperationRequest,\n isCreateContainerWithMetadataDocumentOperationResponse,\n isDeleteContainerOperationResponse,\n isShareContainerOperationResponse,\n moveContainerOperation,\n reciteContainerOperation,\n rekeyContainerOperation,\n revokeContainerOperation,\n shareContainerOperation,\n} from \"./containerMutations\";\nexport {\n type ContainerKekLogQuery,\n ContainerKekLogQuerySchema,\n type ContainerReadPathParams,\n ContainerReadPathParamsSchema,\n getContainerKekLogOperation,\n isGetContainerKekLogOperationResponse,\n isListContainerDocumentLanesOperationRequest,\n isListContainerDocumentLanesOperationResponse,\n isListContainerParentLanesOperationRequest,\n isListContainerParentLanesOperationResponse,\n listContainerDocumentLanesOperation,\n listContainerParentLanesOperation,\n} from \"./containerReads\";\nexport {\n type ContainerReplacementAuthorizationsResponse,\n ContainerReplacementAuthorizationsResponseSchema,\n getContainerReplacementAuthorizationsOperation,\n} from \"./containerReplacement\";\nexport {\n defineHttpOperation,\n defineJsonOperation,\n type HttpOperation,\n type HttpOperationMediaType,\n type HttpOperationMethod,\n type JsonOperation,\n type JsonOperationMethod,\n type OperationSchemaInput,\n type OperationSchemaOutput,\n operationRequestPath,\n operationRequestPathForInput,\n operationRequestPathWithQuery,\n operationRoutePath,\n type RuntimeRefinement,\n} from \"./definition\";\nexport {\n type DocumentAttributionPathParams,\n DocumentAttributionPathParamsSchema,\n type DocumentAttributionRangesQuery,\n DocumentAttributionRangesQuerySchema,\n type DocumentAttributionRequestHeaders,\n DocumentAttributionRequestHeadersSchema,\n documentAttributionWireHeaderKeys,\n documentAttributionWireHeaderNames,\n getDocumentAttributionOperation,\n isGetDocumentAttributionOperationResponse,\n isListDocumentAttributionRangesOperationResponse,\n listDocumentAttributionRangesOperation,\n} from \"./documentAttribution\";\nexport {\n createDocumentOperation,\n type DocumentMutationPathParams,\n DocumentMutationPathParamsSchema,\n type DocumentPurgeProofQuery,\n DocumentPurgeProofQuerySchema,\n getDocumentPurgeProofOperation,\n isCreateDocumentOperationRequest,\n isCreateDocumentOperationResponse,\n isDocumentLinkSetMutationOperationRequest,\n isDocumentLinkSetMutationOperationResponse,\n isGetDocumentPurgeProofOperationResponse,\n isPurgeDocumentOperationRequest,\n isPurgeDocumentOperationResponse,\n linkDocumentOperation,\n purgeDocumentOperation,\n unlinkDocumentOperation,\n} from \"./documentMutations\";\nexport {\n type DocumentSyncPathParams,\n DocumentSyncPathParamsSchema,\n documentSyncOperation,\n isDocumentSyncOperationRequest,\n isDocumentSyncOperationResponse,\n} from \"./documentSync\";\nexport {\n operationRequestHeaderNames,\n operationResponseHeaderNames,\n} from \"./headerNames\";\nexport {\n getHealthOperation,\n isGetHealthOperationResponse,\n} from \"./health\";\nexport {\n getMultipartBlobStageOperation,\n initiateMultipartBlobStageOperation,\n isGetMultipartBlobStageOperationResponse,\n isInitiateMultipartBlobStageOperationRequest,\n isInitiateMultipartBlobStageOperationResponse,\n type MultipartBlobStagePathParams,\n MultipartBlobStagePathParamsSchema,\n} from \"./multipartBlobs\";\nexport {\n authorizeMultipartBlobPartUploadOperation,\n type MultipartBlobPartUploadRequest,\n MultipartBlobPartUploadRequestSchema,\n type MultipartBlobPartUploadResponse,\n MultipartBlobPartUploadResponseSchema,\n} from \"./multipartPartUploads\";\nexport {\n claimNativeOrganizationSubscriptionOperation,\n getOrganizationBillingHistoryOperation,\n getOrganizationBillingManagementUrlOperation,\n getOrganizationBillingOperation,\n getOrganizationNativePurchaseEligibilityOperation,\n isClaimNativeOrganizationSubscriptionOperationResponse,\n isGetOrganizationBillingHistoryOperationResponse,\n isGetOrganizationBillingManagementUrlOperationResponse,\n isGetOrganizationBillingOperationResponse,\n isGetOrganizationNativePurchaseEligibilityOperationResponse,\n isStartOrganizationTrialOperationResponse,\n type OrganizationBillingNativeClaimPathParams,\n OrganizationBillingNativeClaimPathParamsSchema,\n type OrganizationBillingNativeEligibilityQuery,\n OrganizationBillingNativeEligibilityQuerySchema,\n type OrganizationBillingPathParams,\n OrganizationBillingPathParamsSchema,\n startOrganizationTrialOperation,\n} from \"./organizationBilling\";\nexport {\n isListOrganizationMembershipsOperationResponse,\n isRequestOrganizationLeaveOperationRequest,\n isUpdateOrganizationMembershipOperationRequest,\n isUpdateOrganizationMembershipOperationResponse,\n listOrganizationMembershipsOperation,\n type OrganizationMembershipPathParams,\n OrganizationMembershipPathParamsSchema,\n requestOrganizationLeaveOperation,\n updateOrganizationMembershipOperation,\n withdrawOrganizationLeaveRequestOperation,\n} from \"./organizationMemberships\";\nexport { getOrganizationPolicyHistoryOperation } from \"./organizationPolicyHistory\";\nexport {\n createOrganizationGroupOperation,\n createOrganizationOperation,\n deleteOrganizationGroupOperation,\n getOrganizationDataUsageOperation,\n getOrganizationReadModelOperation,\n isCreateOrganizationGroupOperationRequest,\n isCreateOrganizationGroupOperationResponse,\n isCreateOrganizationOperationRequest,\n isCreateOrganizationOperationResponse,\n isDeleteOrganizationGroupOperationResponse,\n isGetOrganizationDataUsageOperationResponse,\n isGetOrganizationReadModelOperationResponse,\n isListOrganizationGroupMembersOperationResponse,\n isUpdateOrganizationProfileOperationRequest,\n isUpdateOrganizationProfileOperationResponse,\n isUpdateOrganizationRosterEntryOperationRequest,\n isUpdateOrganizationRosterEntryOperationResponse,\n listOrganizationGroupMembersOperation,\n type OrganizationGroupPathParams,\n OrganizationGroupPathParamsSchema,\n type OrganizationPathParams,\n OrganizationPathParamsSchema,\n type OrganizationRosterPathParams,\n OrganizationRosterPathParamsSchema,\n updateOrganizationProfileOperation,\n updateOrganizationRosterEntryOperation,\n} from \"./organizations\";\nexport {\n listOrganizationPendingBlobDeletionsOperation,\n listRootPendingBlobDeletionsOperation,\n type PendingBlobDeletionsQuery,\n PendingBlobDeletionsQuerySchema,\n type RootPendingBlobDeletionsQuery,\n RootPendingBlobDeletionsQuerySchema,\n} from \"./pendingBlobDeletions\";\nexport {\n type PrincipalPolicyPageQuery,\n PrincipalPolicyPageQuerySchema,\n} from \"./principalPolicyPageQuery\";\nexport {\n commitOrganizationGroupPolicyOperation,\n getPrincipalMemberEnvelopesOperation,\n getPrincipalPolicyOperation,\n isCommitOrganizationGroupPolicyOperationRequest,\n isCommitOrganizationGroupPolicyOperationResponse,\n isGetPrincipalMemberEnvelopesOperationResponse,\n isGetPrincipalPolicyOperationResponse,\n isPutPrincipalPolicyOperationRequest,\n isPutPrincipalPolicyOperationResponse,\n type OrganizationGroupPolicyPathParams,\n OrganizationGroupPolicyPathParamsSchema,\n type PrincipalMemberEnvelopesQuery,\n PrincipalMemberEnvelopesQuerySchema,\n type PrincipalPolicyPathParams,\n PrincipalPolicyPathParamsSchema,\n putPrincipalPolicyOperation,\n} from \"./principals\";\nexport {\n getProjectionPolicyHistoryOperation,\n type ProjectionPolicyHistoryQuery,\n ProjectionPolicyHistoryQuerySchema,\n} from \"./projectionPolicyHistory\";\nexport { protocolOperations } from \"./registry\";\nexport {\n getRootIdentityOperation,\n isGetRootIdentityOperationResponse,\n isListRootIdentitiesOperationResponse,\n isListRootIdentityOrganizationsOperationResponse,\n listRootIdentitiesOperation,\n listRootIdentityOrganizationsOperation,\n MAX_ROOT_IDENTITY_PAGE_SIZE,\n MIN_ROOT_FINGERPRINT_PREFIX_LENGTH,\n type RootIdentitiesQuery,\n RootIdentitiesQuerySchema,\n type RootIdentityPathParams,\n RootIdentityPathParamsSchema,\n} from \"./root\";\nexport {\n listRootAuditEventsOperation,\n type RootAuditEventsQuery,\n} from \"./rootAudit\";\nexport { getRootOpsHealthReportOperation } from \"./rootOpsHealth\";\nexport {\n getRootOrganizationDataUsageOperation,\n getRootOrganizationOperation,\n listRootDataUsageReportOperation,\n listRootOrganizationIdentitiesOperation,\n listRootOrganizationsOperation,\n type RootOrganizationPageQuery,\n type RootOrganizationsQuery,\n} from \"./rootOrganizations\";\nexport {\n listRootOrganizationRevenuecatEventsOperation,\n listRootRevenuecatEventsReportOperation,\n type RootRevenuecatEventsQuery,\n type RootRevenuecatEventsReportQuery,\n} from \"./rootRevenuecat\";\nexport {\n liftRootIdentitySuspensionOperation,\n suspendRootIdentityOperation,\n} from \"./rootSuspension\";\nexport {\n cancelStripeSubscriptionOperation,\n changeStripePlanOperation,\n createStripeCheckoutOperation,\n createStripeCheckoutSessionOperation,\n createStripePortalOperation,\n getStripeCheckoutOptionsOperation,\n isCancelStripeSubscriptionOperationResponse,\n isChangeStripePlanOperationRequest,\n isChangeStripePlanOperationResponse,\n isCreateStripeCheckoutOperationRequest,\n isCreateStripeCheckoutOperationResponse,\n isCreateStripeCheckoutSessionOperationRequest,\n isCreateStripeCheckoutSessionOperationResponse,\n isCreateStripePortalOperationRequest,\n isCreateStripePortalOperationResponse,\n isGetStripeCheckoutOptionsOperationResponse,\n type StripeCheckoutPathParams,\n StripeCheckoutPathParamsSchema,\n} from \"./stripeCheckout\";\nexport {\n type ContainerWriterProjectionPathParams,\n ContainerWriterProjectionPathParamsSchema,\n type DocumentWriterProjectionPathParams,\n DocumentWriterProjectionPathParamsSchema,\n getContainerWriterProjectionOperation,\n getDocumentWriterProjectionOperation,\n isGetContainerWriterProjectionOperationResponse,\n isGetDocumentWriterProjectionOperationResponse,\n} from \"./writerProjections\";\n"]}
@@ -7797,12 +7797,21 @@ export declare const createOrganizationGroupOperation: Omit<{
7797
7797
  readonly failureStatuses: readonly [400, 401, 402, 403, 404, 409, 500, 503];
7798
7798
  readonly id: "organizations.groups.create";
7799
7799
  readonly summary: "Create an organization group and advance its signed directory";
7800
- readonly description: "Creates a group with its initial signed principal policy and, in the same transaction, the organization policy successor that adds it to the signed group directory. Only organization administrators may call it. A 202 asks for the identical request to be retried after preparation; a 503 with `committed: false` and code `principal_history_preparation_unavailable` proves nothing was written.";
7800
+ readonly description: "Creates a group with its initial signed principal policy and, in the same transaction, the organization policy successor that adds it to the signed group directory. Only organization administrators may call it. When `readModelCursor` names the read-model head the commit advanced from, the response carries the read-model delta a feed read from that cursor returns. A 202 asks for the identical request to be retried after preparation; a 503 with `committed: false` and code `principal_history_preparation_unavailable` proves nothing was written.";
7801
7801
  readonly method: "POST";
7802
7802
  readonly params: z.ZodObject<{
7803
7803
  organizationId: z.ZodCustom<string, string>;
7804
7804
  }, z.core.$strict>;
7805
7805
  readonly path: "/organizations/{organizationId}/groups";
7806
+ readonly query: z.ZodType<{
7807
+ readModelCursor?: string | undefined;
7808
+ }, {
7809
+ readModelCursor?: string | undefined;
7810
+ }, z.core.$ZodTypeInternals<{
7811
+ readModelCursor?: string | undefined;
7812
+ }, {
7813
+ readModelCursor?: string | undefined;
7814
+ }>>;
7806
7815
  readonly responseDescriptions: {
7807
7816
  readonly 202: "The attempted operation rolled back. Retry the identical request to continue verification preparation.";
7808
7817
  };
@@ -7859,6 +7868,7 @@ export declare const createOrganizationGroupOperation: Omit<{
7859
7868
  version: number;
7860
7869
  };
7861
7870
  };
7871
+ readModel?: unknown;
7862
7872
  }, {
7863
7873
  group: {
7864
7874
  createdAt: string;
@@ -7906,6 +7916,7 @@ export declare const createOrganizationGroupOperation: Omit<{
7906
7916
  version: number;
7907
7917
  };
7908
7918
  };
7919
+ readModel?: unknown;
7909
7920
  }, z.core.$ZodTypeInternals<{
7910
7921
  group: {
7911
7922
  createdAt: string;
@@ -7953,6 +7964,7 @@ export declare const createOrganizationGroupOperation: Omit<{
7953
7964
  version: number;
7954
7965
  };
7955
7966
  };
7967
+ readModel?: unknown;
7956
7968
  }, {
7957
7969
  group: {
7958
7970
  createdAt: string;
@@ -8000,6 +8012,7 @@ export declare const createOrganizationGroupOperation: Omit<{
8000
8012
  version: number;
8001
8013
  };
8002
8014
  };
8015
+ readModel?: unknown;
8003
8016
  }>>;
8004
8017
  };
8005
8018
  readonly runtimeRefinements: readonly [{
@@ -8008,6 +8021,9 @@ export declare const createOrganizationGroupOperation: Omit<{
8008
8021
  }, {
8009
8022
  readonly id: "response.principal-history-preparation-rollback";
8010
8023
  readonly description: "A 503 with code principal_history_preparation_unavailable requires committed:false; other 503 responses do not guarantee rollback.";
8024
+ }, {
8025
+ readonly description: "read-model lanes match the response organization; grants and memberships are unambiguous; snapshot lanes are complete and contain no deletions";
8026
+ readonly id: "response.organization-read-model-consistency";
8011
8027
  }];
8012
8028
  }, "failureResponses" | "failureStatuses"> & {
8013
8029
  readonly failureResponses: {
@@ -3,7 +3,7 @@ import { documentSyncRequestRuntimeRefinements } from "../documentSyncRefinement
3
3
  import { organizationDataUsageResponseRuntimeRefinements } from "../organizationDataUsageRefinements.js";
4
4
  import { organizationProvisioningContainerKeyringRefinement, organizationProvisioningRequestRuntimeRefinements, organizationProvisioningResponseRuntimeRefinements, } from "../organizationProvisioningRefinements.js";
5
5
  import { organizationReadModelResponseRuntimeRefinements } from "../organizationReadModelRefinements.js";
6
- import { CreateOrganizationGroupWithPolicyRequestSchema, CreateOrganizationRequestSchema, DeleteOrganizationGroupRequestSchema, isCreateOrganizationGroupWithPolicyRequest, isCreateOrganizationRequest, isUpdateOrganizationProfileRequest, isUpdateOrganizationRosterEntryRequest, OrganizationReadModelQuerySchema, UpdateOrganizationProfileRequestSchema, UpdateOrganizationRosterEntryRequestSchema, } from "../request/index.js";
6
+ import { CreateOrganizationGroupWithPolicyRequestSchema, CreateOrganizationRequestSchema, DeleteOrganizationGroupRequestSchema, isCreateOrganizationGroupWithPolicyRequest, isCreateOrganizationRequest, isUpdateOrganizationProfileRequest, isUpdateOrganizationRosterEntryRequest, OrganizationReadModelHeldCursorQuerySchema, OrganizationReadModelQuerySchema, UpdateOrganizationProfileRequestSchema, UpdateOrganizationRosterEntryRequestSchema, } from "../request/index.js";
7
7
  import { CreateOrganizationGroupResponseSchema, CreateOrganizationResponseSchema, DeleteOrganizationGroupResponseSchema, ErrorResponseSchema, isCreateOrganizationGroupResponse, isCreateOrganizationResponse, isDeleteOrganizationGroupResponse, isOrganizationDataUsageResponse, isOrganizationDirectoryUserResponse, isOrganizationGroupMembersResponse, isOrganizationProfileResponse, isOrganizationReadModelResponse, OrganizationDataUsageResponseSchema, OrganizationDirectoryUserResponseSchema, OrganizationGroupMembersResponseSchema, OrganizationPresentationFailureResponseSchema, OrganizationProfileResponseSchema, OrganizationReadModelFailureResponseSchema, OrganizationReadModelResponseSchema, PaymentRequiredErrorResponseSchema, SessionFailureResponseSchema, } from "../response/index.js";
8
8
  import { PrincipalHistoryPreparationFailureResponseSchema, PrincipalHistoryPreparationResponseSchema, principalHistoryRollbackRefinement, } from "../response/principalHistoryPreparation.js";
9
9
  import { uuidV4StringSchema } from "../schema.js";
@@ -111,10 +111,11 @@ export const createOrganizationGroupOperation = defineJsonOperation({
111
111
  failureStatuses: [400, 401, 402, 403, 404, 409, 500, 503],
112
112
  id: "organizations.groups.create",
113
113
  summary: "Create an organization group and advance its signed directory",
114
- description: "Creates a group with its initial signed principal policy and, in the same transaction, the organization policy successor that adds it to the signed group directory. Only organization administrators may call it. A 202 asks for the identical request to be retried after preparation; a 503 with `committed: false` and code `principal_history_preparation_unavailable` proves nothing was written.",
114
+ description: "Creates a group with its initial signed principal policy and, in the same transaction, the organization policy successor that adds it to the signed group directory. Only organization administrators may call it. When `readModelCursor` names the read-model head the commit advanced from, the response carries the read-model delta a feed read from that cursor returns. A 202 asks for the identical request to be retried after preparation; a 503 with `committed: false` and code `principal_history_preparation_unavailable` proves nothing was written.",
115
115
  method: "POST",
116
116
  params: OrganizationPathParamsSchema,
117
117
  path: "/organizations/{organizationId}/groups",
118
+ query: OrganizationReadModelHeldCursorQuerySchema,
118
119
  responseDescriptions: {
119
120
  202: "The attempted operation rolled back. Retry the identical request to continue verification preparation.",
120
121
  },
@@ -125,6 +126,7 @@ export const createOrganizationGroupOperation = defineJsonOperation({
125
126
  runtimeRefinements: [
126
127
  organizationProvisioningContainerKeyringRefinement,
127
128
  principalHistoryRollbackRefinement,
129
+ ...organizationReadModelResponseRuntimeRefinements,
128
130
  ],
129
131
  });
130
132
  export const deleteOrganizationGroupOperation = defineJsonOperation({