@tearleads/client-sdk 0.1.68 → 0.1.71

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 (123) hide show
  1. package/data/containers/shared/principalPolicies.js +8 -12
  2. package/data/containers/shared/principalPolicies.js.map +1 -1
  3. package/internal/api-client/ApiClient.d.ts +73 -3
  4. package/internal/api-client/apiRequestMetrics.d.ts +18 -4
  5. package/internal/api-client/apiRequestMetrics.js +55 -5
  6. package/internal/api-client/apiRequestMetrics.js.map +1 -1
  7. package/internal/api-client/durationSampleWindow.d.ts +26 -0
  8. package/internal/api-client/durationSampleWindow.js +42 -0
  9. package/internal/api-client/durationSampleWindow.js.map +1 -0
  10. package/internal/api-client/measureApiRequest.js +9 -4
  11. package/internal/api-client/measureApiRequest.js.map +1 -1
  12. package/internal/api-client/serverTiming.d.ts +12 -0
  13. package/internal/api-client/serverTiming.js +49 -0
  14. package/internal/api-client/serverTiming.js.map +1 -0
  15. package/internal/validators/documentCreateSeedRefinements.js +9 -0
  16. package/internal/validators/documentCreateSeedRefinements.js.map +1 -0
  17. package/internal/validators/operation/attachments.d.ts +48 -8
  18. package/internal/validators/operation/auth.d.ts +576 -76
  19. package/internal/validators/operation/containerMutations.d.ts +619 -44
  20. package/internal/validators/operation/containerMutations.js +7 -1
  21. package/internal/validators/operation/containerMutations.js.map +1 -1
  22. package/internal/validators/operation/documentMutations.d.ts +428 -12
  23. package/internal/validators/operation/documentMutations.js +6 -1
  24. package/internal/validators/operation/documentMutations.js.map +1 -1
  25. package/internal/validators/operation/documentSync.d.ts +33 -13
  26. package/internal/validators/operation/organizations.d.ts +648 -88
  27. package/internal/validators/operation/principals.d.ts +96 -16
  28. package/internal/validators/request/blob.d.ts +48 -8
  29. package/internal/validators/request/container.d.ts +96 -16
  30. package/internal/validators/request/container.js +5 -2
  31. package/internal/validators/request/container.js.map +1 -1
  32. package/internal/validators/request/containerMetadata.d.ts +409 -16
  33. package/internal/validators/request/containerMetadata.js +20 -3
  34. package/internal/validators/request/containerMetadata.js.map +1 -1
  35. package/internal/validators/request/document.d.ts +631 -10
  36. package/internal/validators/request/document.js +19 -1
  37. package/internal/validators/request/document.js.map +1 -1
  38. package/internal/validators/request/documentCreateSeed.js +35 -0
  39. package/internal/validators/request/documentCreateSeed.js.map +1 -0
  40. package/internal/validators/request/documentSyncSchema.d.ts +24 -4
  41. package/internal/validators/request/documentSyncSchema.js +2 -1
  42. package/internal/validators/request/documentSyncSchema.js.map +1 -1
  43. package/internal/validators/request/index.d.ts +1 -0
  44. package/internal/validators/request/index.js +1 -0
  45. package/internal/validators/request/index.js.map +1 -1
  46. package/internal/validators/request/organization.d.ts +96 -16
  47. package/internal/validators/request/organizationProvisioning.d.ts +1456 -246
  48. package/internal/validators/request/organizationProvisioning.js +9 -22
  49. package/internal/validators/request/organizationProvisioning.js.map +1 -1
  50. package/internal/validators/request/principal.d.ts +120 -20
  51. package/internal/validators/request/principalPolicyRef.d.ts +42 -0
  52. package/internal/validators/request/principalPolicyRef.js +19 -0
  53. package/internal/validators/request/principalPolicyRef.js.map +1 -0
  54. package/internal/validators/request/registration.d.ts +456 -76
  55. package/internal/validators/response/containerMetadata.d.ts +20 -0
  56. package/internal/validators/response/documentMutation.d.ts +43 -0
  57. package/internal/validators/response/documentMutation.js +12 -1
  58. package/internal/validators/response/documentMutation.js.map +1 -1
  59. package/internal/validators/response/documentSyncSchema.d.ts +13 -9
  60. package/internal/validators/response/documentSyncSchema.js +23 -18
  61. package/internal/validators/response/documentSyncSchema.js.map +1 -1
  62. package/internal/validators/response/index.d.ts +1 -1
  63. package/internal/validators/response/index.js.map +1 -1
  64. package/internal/validators/response/organizationProvisioning.d.ts +350 -0
  65. package/internal/validators/response/registration.d.ts +120 -0
  66. package/internal/validators/util/containerLimits.d.ts +8 -0
  67. package/internal/validators/util/containerLimits.js +8 -0
  68. package/internal/validators/util/containerLimits.js.map +1 -1
  69. package/package.json +1 -1
  70. package/stores/container-contents/containerState/containerStatePersistence.js +2 -0
  71. package/stores/container-contents/containerState/containerStatePersistence.js.map +1 -1
  72. package/stores/container-contents/remoteEvents/remoteEventSync.js +1 -1
  73. package/stores/container-contents/remoteEvents/remoteEventSync.js.map +1 -1
  74. package/stores/container-contents/state.js +2 -0
  75. package/stores/container-contents/state.js.map +1 -1
  76. package/stores/container-contents/syncAgent/syncAgentTypes.d.ts +5 -0
  77. package/stores/container-contents/syncAgent/syncAgentTypes.js.map +1 -1
  78. package/stores/documents/documentStore/sync/createdDocumentPersistence.js +71 -0
  79. package/stores/documents/documentStore/sync/createdDocumentPersistence.js.map +1 -0
  80. package/stores/documents/documentStore/sync/index.js +13 -2
  81. package/stores/documents/documentStore/sync/index.js.map +1 -1
  82. package/stores/documents/documentStore/sync/syncRemoteSignals.js +21 -3
  83. package/stores/documents/documentStore/sync/syncRemoteSignals.js.map +1 -1
  84. package/stores/documents/documentStore/sync/syncSeededCreate.js +50 -0
  85. package/stores/documents/documentStore/sync/syncSeededCreate.js.map +1 -0
  86. package/stores/documents/documentStore/sync/syncShared.js +16 -8
  87. package/stores/documents/documentStore/sync/syncShared.js.map +1 -1
  88. package/workflows/container-contents/container-state/create/createIntentSeed.js +60 -0
  89. package/workflows/container-contents/container-state/create/createIntentSeed.js.map +1 -0
  90. package/workflows/container-contents/container-state/create/createIntentSync.js +18 -19
  91. package/workflows/container-contents/container-state/create/createIntentSync.js.map +1 -1
  92. package/workflows/container-contents/container-state/create/createWithMetadata.js +43 -6
  93. package/workflows/container-contents/container-state/create/createWithMetadata.js.map +1 -1
  94. package/workflows/container-contents/container-state/create/createWithMetadataPlan.js +5 -1
  95. package/workflows/container-contents/container-state/create/createWithMetadataPlan.js.map +1 -1
  96. package/workflows/container-contents/container-state/remote.js +15 -0
  97. package/workflows/container-contents/container-state/remote.js.map +1 -1
  98. package/workflows/container-contents/container-state/types.js.map +1 -1
  99. package/workflows/container-contents/metadata/metadataEvents.d.ts +7 -1
  100. package/workflows/container-contents/metadata/metadataEvents.js +8 -2
  101. package/workflows/container-contents/metadata/metadataEvents.js.map +1 -1
  102. package/workflows/container-contents/remoteHydration/types.d.ts +3 -0
  103. package/workflows/container-contents/remoteHydration/types.js.map +1 -1
  104. package/workflows/containers/child/mutationRequestCore.js +2 -2
  105. package/workflows/containers/child/mutationRequestCore.js.map +1 -1
  106. package/workflows/containers/child/recitePlan.js +2 -2
  107. package/workflows/containers/child/recitePlan.js.map +1 -1
  108. package/workflows/containers/root/create.js +17 -28
  109. package/workflows/containers/root/create.js.map +1 -1
  110. package/workflows/containers/root/initialGroupPolicy.js +0 -23
  111. package/workflows/containers/root/initialGroupPolicy.js.map +1 -1
  112. package/workflows/documents/create/index.d.ts +7 -0
  113. package/workflows/documents/create/index.js +40 -2
  114. package/workflows/documents/create/index.js.map +1 -1
  115. package/workflows/documents/index.d.ts +1 -0
  116. package/workflows/documents/index.js +1 -0
  117. package/workflows/documents/index.js.map +1 -1
  118. package/workflows/documents/sync/initialSync.d.ts +39 -0
  119. package/workflows/documents/sync/initialSync.js +39 -6
  120. package/workflows/documents/sync/initialSync.js.map +1 -1
  121. package/workflows/documents/syncFailures/syncPolicyRepair.js +2 -8
  122. package/workflows/documents/syncFailures/syncPolicyRepair.js.map +1 -1
  123. package/workflows/registration/provisioningBootstrapBuilders.d.ts +12 -2
@@ -1 +1 @@
1
- {"version":3,"file":"documentMutations.js","sourceRoot":"","sources":["documentMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,GACtC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,qCAAqC,EACrC,q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0BAA0B;IAChC,gBAAgB,EAAE,6BAA6B;IAC/C,eAAe,EAAE,+BAA+B;IAChD,EAAE,EAAE,iBAAiB;IACrB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,gCAAgC;IACxC,IAAI,EAAE,+BAA+B;IACrC,oBAAoB,EAAE,+BAA+B;IACrD,SAAS,EAAE;QACT,GAAG,EAAE,2BAA2B;QAChC,GAAG,EAAE,yCAAyC;KAC/C;IACD,kBAAkB,EAAE,CAAC,kCAAkC,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAAC;IAChE,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,6BAA6B;IAC/C,eAAe,EAAE,+BAA+B;IAChD,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,gCAAgC;IACxC,IAAI,EAAE,+BAA+B;IACrC,KAAK,EAAE,6BAA6B;IACpC,oBAAoB,EAAE,+BAA+B;IACrD,SAAS,EAAE;QACT,GAAG,EAAE,gCAAgC;QACrC,GAAG,EAAE,yCAAyC;KAC/C;IACD,kBAAkB,EAAE,CAAC,kCAAkC,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,uBAAuB,CAAC;AACxE,MAAM,CAAC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC;AAC1E,MAAM,CAAC,MAAM,yCAAyC,GACpD,gCAAgC,CAAC;AACnC,MAAM,CAAC,MAAM,0CAA0C,GACrD,iCAAiC,CAAC;AACpC,MAAM,CAAC,MAAM,+BAA+B,GAAG,sBAAsB,CAAC;AACtE,MAAM,CAAC,MAAM,gCAAgC,GAAG,uBAAuB,CAAC;AACxE,MAAM,CAAC,MAAM,wCAAwC,GACnD,4BAA4B,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n documentLinkSetPathRefinement,\n documentSyncRequestRotationRefinement,\n} from \"../documentSyncRefinements\";\nimport { registerJsonSchemaFragment } from \"../jsonSchema\";\nimport {\n DocumentCreateRequestSchema,\n DocumentLinkSetMutationRequestSchema,\n DocumentPurgeRequestSchema,\n isDocumentCreateRequest,\n isDocumentLinkSetMutationRequest,\n isDocumentPurgeRequest,\n} from \"../request\";\nimport {\n DocumentCreateResponseSchema,\n DocumentLinkSetMutationResponseSchema,\n DocumentMutationFailureResponseSchema,\n DocumentPurgeProofResponseSchema,\n DocumentPurgeResponseSchema,\n ErrorResponseSchema,\n isDocumentCreateResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n PaymentRequiredErrorResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport {\n PrincipalHistoryPreparationFailureResponseSchema,\n PrincipalHistoryPreparationResponseSchema,\n principalHistoryRollbackRefinement,\n} from \"../response/principalHistoryPreparation\";\nimport { defineJsonOperation } from \"./definition\";\nimport { DocumentSyncPathParamsSchema } from \"./documentSync\";\n\nconst EmptyDocumentMutationPathParamsSchema = z.strictObject({});\n\nexport const DocumentMutationPathParamsSchema = DocumentSyncPathParamsSchema;\n\nexport type DocumentMutationPathParams = z.infer<\n typeof DocumentMutationPathParamsSchema\n>;\n\nconst checkpointManifestHashQuerySchema = registerJsonSchemaFragment(\n z.string().min(1).max(6_500),\n { maxLength: 6_500, minLength: 1, type: \"string\" },\n);\n\nexport const DocumentPurgeProofQuerySchema = z.strictObject({\n documentCheckpointManifestHash: checkpointManifestHashQuerySchema.optional(),\n});\n\nexport type DocumentPurgeProofQuery = z.infer<\n typeof DocumentPurgeProofQuerySchema\n>;\n\nconst documentMutationFailureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 402: PaymentRequiredErrorResponseSchema,\n 403: ErrorResponseSchema,\n 404: DocumentMutationFailureResponseSchema,\n 409: DocumentMutationFailureResponseSchema,\n 500: ErrorResponseSchema,\n 503: ErrorResponseSchema,\n} as const;\n\nconst documentMutationFailureStatuses = [\n 400, 401, 402, 403, 404, 409, 500, 503,\n] as const;\n\nexport const createDocumentOperation = defineJsonOperation({\n auth: \"session\",\n body: DocumentCreateRequestSchema,\n failureResponses: documentMutationFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: \"documents.create\",\n method: \"POST\",\n params: EmptyDocumentMutationPathParamsSchema,\n path: \"/documents\",\n responses: { 200: DocumentCreateResponseSchema },\n});\n\nfunction defineDocumentLinkSetMutationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: { readonly id: Id; readonly path: Path }) {\n return defineJsonOperation({\n auth: \"session\",\n body: DocumentLinkSetMutationRequestSchema,\n failureResponses: documentMutationFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: input.id,\n method: \"POST\",\n params: DocumentMutationPathParamsSchema,\n path: input.path,\n responses: { 200: DocumentLinkSetMutationResponseSchema },\n runtimeRefinements: [\n documentLinkSetPathRefinement,\n documentSyncRequestRotationRefinement,\n ],\n });\n}\n\nexport const linkDocumentOperation = defineDocumentLinkSetMutationOperation({\n id: \"documents.link\",\n path: \"/documents/{documentId}/link\",\n});\n\nexport const unlinkDocumentOperation = defineDocumentLinkSetMutationOperation({\n id: \"documents.unlink\",\n path: \"/documents/{documentId}/unlink\",\n});\n\nconst documentPurgeFailureResponses = {\n ...documentMutationFailureResponses,\n 503: PrincipalHistoryPreparationFailureResponseSchema,\n} as const;\n\nconst preparationResponseDescriptions = {\n 202: \"The attempted operation rolled back. Retry the identical request to continue verification preparation.\",\n} as const;\n\nexport const purgeDocumentOperation = defineJsonOperation({\n auth: \"session\",\n body: DocumentPurgeRequestSchema,\n failureResponses: documentPurgeFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: \"documents.purge\",\n method: \"POST\",\n params: DocumentMutationPathParamsSchema,\n path: \"/documents/{documentId}/purge\",\n responseDescriptions: preparationResponseDescriptions,\n responses: {\n 200: DocumentPurgeResponseSchema,\n 202: PrincipalHistoryPreparationResponseSchema,\n },\n runtimeRefinements: [principalHistoryRollbackRefinement],\n});\n\nexport const getDocumentPurgeProofOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses: documentPurgeFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: \"documents.purgeProof\",\n method: \"GET\",\n params: DocumentMutationPathParamsSchema,\n path: \"/documents/{documentId}/purge\",\n query: DocumentPurgeProofQuerySchema,\n responseDescriptions: preparationResponseDescriptions,\n responses: {\n 200: DocumentPurgeProofResponseSchema,\n 202: PrincipalHistoryPreparationResponseSchema,\n },\n runtimeRefinements: [principalHistoryRollbackRefinement],\n});\n\nexport const isCreateDocumentOperationRequest = isDocumentCreateRequest;\nexport const isCreateDocumentOperationResponse = isDocumentCreateResponse;\nexport const isDocumentLinkSetMutationOperationRequest =\n isDocumentLinkSetMutationRequest;\nexport const isDocumentLinkSetMutationOperationResponse =\n isDocumentLinkSetMutationResponse;\nexport const isPurgeDocumentOperationRequest = isDocumentPurgeRequest;\nexport const isPurgeDocumentOperationResponse = isDocumentPurgeResponse;\nexport const isGetDocumentPurgeProofOperationResponse =\n isDocumentPurgeProofResponse;\n"]}
1
+ {"version":3,"file":"documentMutations.js","sourceRoot":"","sources":["documentMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,qCAAqC,GACtC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,qCAAqC,EACrC,qCAAqC,EACrC,gCAAgC,EAChC,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,iCAAiC,EAC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,EAAE,6BAA6B;IAC/C,eAAe,EAAE,+BAA+B;IAChD,EAAE,EAAE,iBAAiB;IACrB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,gCAAgC;IACxC,IAAI,EAAE,+BAA+B;IACrC,oBAAoB,EAAE,+BAA+B;IACrD,SAAS,EAAE;QACT,GAAG,EAAE,2BAA2B;QAChC,GAAG,EAAE,yCAAyC;KAC/C;IACD,kBAAkB,EAAE,CAAC,kCAAkC,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAAC;IAChE,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,6BAA6B;IAC/C,eAAe,EAAE,+BAA+B;IAChD,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,gCAAgC;IACxC,IAAI,EAAE,+BAA+B;IACrC,KAAK,EAAE,6BAA6B;IACpC,oBAAoB,EAAE,+BAA+B;IACrD,SAAS,EAAE;QACT,GAAG,EAAE,gCAAgC;QACrC,GAAG,EAAE,yCAAyC;KAC/C;IACD,kBAAkB,EAAE,CAAC,kCAAkC,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,uBAAuB,CAAC;AACxE,MAAM,CAAC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC;AAC1E,MAAM,CAAC,MAAM,yCAAyC,GACpD,gCAAgC,CAAC;AACnC,MAAM,CAAC,MAAM,0CAA0C,GACrD,iCAAiC,CAAC;AACpC,MAAM,CAAC,MAAM,+BAA+B,GAAG,sBAAsB,CAAC;AACtE,MAAM,CAAC,MAAM,gCAAgC,GAAG,uBAAuB,CAAC;AACxE,MAAM,CAAC,MAAM,wCAAwC,GACnD,4BAA4B,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { documentCreateSeedRefinement } from \"../documentCreateSeedRefinements\";\nimport {\n documentLinkSetPathRefinement,\n documentSyncRequestRotationRefinement,\n documentSyncRequestRuntimeRefinements,\n} from \"../documentSyncRefinements\";\nimport { registerJsonSchemaFragment } from \"../jsonSchema\";\nimport {\n DocumentCreateRequestSchema,\n DocumentLinkSetMutationRequestSchema,\n DocumentPurgeRequestSchema,\n isDocumentCreateRequest,\n isDocumentLinkSetMutationRequest,\n isDocumentPurgeRequest,\n} from \"../request\";\nimport {\n DocumentCreateResponseSchema,\n DocumentLinkSetMutationResponseSchema,\n DocumentMutationFailureResponseSchema,\n DocumentPurgeProofResponseSchema,\n DocumentPurgeResponseSchema,\n ErrorResponseSchema,\n isDocumentCreateResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n PaymentRequiredErrorResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport {\n PrincipalHistoryPreparationFailureResponseSchema,\n PrincipalHistoryPreparationResponseSchema,\n principalHistoryRollbackRefinement,\n} from \"../response/principalHistoryPreparation\";\nimport { defineJsonOperation } from \"./definition\";\nimport { DocumentSyncPathParamsSchema } from \"./documentSync\";\n\nconst EmptyDocumentMutationPathParamsSchema = z.strictObject({});\n\nexport const DocumentMutationPathParamsSchema = DocumentSyncPathParamsSchema;\n\nexport type DocumentMutationPathParams = z.infer<\n typeof DocumentMutationPathParamsSchema\n>;\n\nconst checkpointManifestHashQuerySchema = registerJsonSchemaFragment(\n z.string().min(1).max(6_500),\n { maxLength: 6_500, minLength: 1, type: \"string\" },\n);\n\nexport const DocumentPurgeProofQuerySchema = z.strictObject({\n documentCheckpointManifestHash: checkpointManifestHashQuerySchema.optional(),\n});\n\nexport type DocumentPurgeProofQuery = z.infer<\n typeof DocumentPurgeProofQuerySchema\n>;\n\nconst documentMutationFailureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 402: PaymentRequiredErrorResponseSchema,\n 403: ErrorResponseSchema,\n 404: DocumentMutationFailureResponseSchema,\n 409: DocumentMutationFailureResponseSchema,\n 500: ErrorResponseSchema,\n 503: ErrorResponseSchema,\n} as const;\n\nconst documentMutationFailureStatuses = [\n 400, 401, 402, 403, 404, 409, 500, 503,\n] as const;\n\nexport const createDocumentOperation = defineJsonOperation({\n auth: \"session\",\n body: DocumentCreateRequestSchema,\n failureResponses: documentMutationFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: \"documents.create\",\n method: \"POST\",\n params: EmptyDocumentMutationPathParamsSchema,\n path: \"/documents\",\n responses: { 200: DocumentCreateResponseSchema },\n runtimeRefinements: [\n documentCreateSeedRefinement,\n ...documentSyncRequestRuntimeRefinements,\n ],\n});\n\nfunction defineDocumentLinkSetMutationOperation<\n const Id extends string,\n const Path extends `/${string}`,\n>(input: { readonly id: Id; readonly path: Path }) {\n return defineJsonOperation({\n auth: \"session\",\n body: DocumentLinkSetMutationRequestSchema,\n failureResponses: documentMutationFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: input.id,\n method: \"POST\",\n params: DocumentMutationPathParamsSchema,\n path: input.path,\n responses: { 200: DocumentLinkSetMutationResponseSchema },\n runtimeRefinements: [\n documentLinkSetPathRefinement,\n documentSyncRequestRotationRefinement,\n ],\n });\n}\n\nexport const linkDocumentOperation = defineDocumentLinkSetMutationOperation({\n id: \"documents.link\",\n path: \"/documents/{documentId}/link\",\n});\n\nexport const unlinkDocumentOperation = defineDocumentLinkSetMutationOperation({\n id: \"documents.unlink\",\n path: \"/documents/{documentId}/unlink\",\n});\n\nconst documentPurgeFailureResponses = {\n ...documentMutationFailureResponses,\n 503: PrincipalHistoryPreparationFailureResponseSchema,\n} as const;\n\nconst preparationResponseDescriptions = {\n 202: \"The attempted operation rolled back. Retry the identical request to continue verification preparation.\",\n} as const;\n\nexport const purgeDocumentOperation = defineJsonOperation({\n auth: \"session\",\n body: DocumentPurgeRequestSchema,\n failureResponses: documentPurgeFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: \"documents.purge\",\n method: \"POST\",\n params: DocumentMutationPathParamsSchema,\n path: \"/documents/{documentId}/purge\",\n responseDescriptions: preparationResponseDescriptions,\n responses: {\n 200: DocumentPurgeResponseSchema,\n 202: PrincipalHistoryPreparationResponseSchema,\n },\n runtimeRefinements: [principalHistoryRollbackRefinement],\n});\n\nexport const getDocumentPurgeProofOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses: documentPurgeFailureResponses,\n failureStatuses: documentMutationFailureStatuses,\n id: \"documents.purgeProof\",\n method: \"GET\",\n params: DocumentMutationPathParamsSchema,\n path: \"/documents/{documentId}/purge\",\n query: DocumentPurgeProofQuerySchema,\n responseDescriptions: preparationResponseDescriptions,\n responses: {\n 200: DocumentPurgeProofResponseSchema,\n 202: PrincipalHistoryPreparationResponseSchema,\n },\n runtimeRefinements: [principalHistoryRollbackRefinement],\n});\n\nexport const isCreateDocumentOperationRequest = isDocumentCreateRequest;\nexport const isCreateDocumentOperationResponse = isDocumentCreateResponse;\nexport const isDocumentLinkSetMutationOperationRequest =\n isDocumentLinkSetMutationRequest;\nexport const isDocumentLinkSetMutationOperationResponse =\n isDocumentLinkSetMutationResponse;\nexport const isPurgeDocumentOperationRequest = isDocumentPurgeRequest;\nexport const isPurgeDocumentOperationResponse = isDocumentPurgeResponse;\nexport const isGetDocumentPurgeProofOperationResponse =\n isDocumentPurgeProofResponse;\n"]}
@@ -37,7 +37,12 @@ export declare const documentSyncOperation: Omit<{
37
37
  keyring: Record<string, unknown> | null;
38
38
  manifest: Record<string, unknown>;
39
39
  predecessorBridge: Record<string, unknown> | null;
40
- principalPolicies: Record<string, unknown>[];
40
+ principalPolicyRefs: {
41
+ principalType: "group" | "organization";
42
+ principalId: string;
43
+ version: number;
44
+ stateHash: string;
45
+ }[];
41
46
  wraps: Record<string, unknown>[];
42
47
  containerManifestHistoryRefs?: {
43
48
  containerId: string;
@@ -108,7 +113,12 @@ export declare const documentSyncOperation: Omit<{
108
113
  keyring: Record<string, unknown> | null;
109
114
  manifest: Record<string, unknown>;
110
115
  predecessorBridge: Record<string, unknown> | null;
111
- principalPolicies: Record<string, unknown>[];
116
+ principalPolicyRefs: {
117
+ principalType: "group" | "organization";
118
+ principalId: string;
119
+ version: number;
120
+ stateHash: string;
121
+ }[];
112
122
  wraps: Record<string, unknown>[];
113
123
  containerManifestHistoryRefs?: {
114
124
  containerId: string;
@@ -179,7 +189,12 @@ export declare const documentSyncOperation: Omit<{
179
189
  keyring: Record<string, unknown> | null;
180
190
  manifest: Record<string, unknown>;
181
191
  predecessorBridge: Record<string, unknown> | null;
182
- principalPolicies: Record<string, unknown>[];
192
+ principalPolicyRefs: {
193
+ principalType: "group" | "organization";
194
+ principalId: string;
195
+ version: number;
196
+ stateHash: string;
197
+ }[];
183
198
  wraps: Record<string, unknown>[];
184
199
  containerManifestHistoryRefs?: {
185
200
  containerId: string;
@@ -250,7 +265,12 @@ export declare const documentSyncOperation: Omit<{
250
265
  keyring: Record<string, unknown> | null;
251
266
  manifest: Record<string, unknown>;
252
267
  predecessorBridge: Record<string, unknown> | null;
253
- principalPolicies: Record<string, unknown>[];
268
+ principalPolicyRefs: {
269
+ principalType: "group" | "organization";
270
+ principalId: string;
271
+ version: number;
272
+ stateHash: string;
273
+ }[];
254
274
  wraps: Record<string, unknown>[];
255
275
  containerManifestHistoryRefs?: {
256
276
  containerId: string;
@@ -405,9 +425,6 @@ export declare const documentSyncOperation: Omit<{
405
425
  };
406
426
  readonly responses: {
407
427
  readonly 200: z.ZodType<{
408
- acceptedOutgoingUpdateIds: string[];
409
- commitLsn: string | null;
410
- commitLsnMode: "tracked" | "untracked";
411
428
  contentKeyBundle: {
412
429
  contentKeyEpoch: number;
413
430
  documentId: string;
@@ -470,10 +487,10 @@ export declare const documentSyncOperation: Omit<{
470
487
  checkpointPayloadKind?: "full_history_snapshot" | undefined;
471
488
  sourceVersionVector?: string | undefined;
472
489
  }[];
473
- }, {
474
- acceptedOutgoingUpdateIds: string[];
475
490
  commitLsn: string | null;
476
491
  commitLsnMode: "tracked" | "untracked";
492
+ acceptedOutgoingUpdateIds: string[];
493
+ }, {
477
494
  contentKeyBundle: {
478
495
  contentKeyEpoch: number;
479
496
  documentId: string;
@@ -536,10 +553,10 @@ export declare const documentSyncOperation: Omit<{
536
553
  checkpointPayloadKind?: "full_history_snapshot" | undefined;
537
554
  sourceVersionVector?: string | undefined;
538
555
  }[];
539
- }, z.core.$ZodTypeInternals<{
540
- acceptedOutgoingUpdateIds: string[];
541
556
  commitLsn: string | null;
542
557
  commitLsnMode: "tracked" | "untracked";
558
+ acceptedOutgoingUpdateIds: string[];
559
+ }, z.core.$ZodTypeInternals<{
543
560
  contentKeyBundle: {
544
561
  contentKeyEpoch: number;
545
562
  documentId: string;
@@ -602,10 +619,10 @@ export declare const documentSyncOperation: Omit<{
602
619
  checkpointPayloadKind?: "full_history_snapshot" | undefined;
603
620
  sourceVersionVector?: string | undefined;
604
621
  }[];
605
- }, {
606
- acceptedOutgoingUpdateIds: string[];
607
622
  commitLsn: string | null;
608
623
  commitLsnMode: "tracked" | "untracked";
624
+ acceptedOutgoingUpdateIds: string[];
625
+ }, {
609
626
  contentKeyBundle: {
610
627
  contentKeyEpoch: number;
611
628
  documentId: string;
@@ -668,6 +685,9 @@ export declare const documentSyncOperation: Omit<{
668
685
  checkpointPayloadKind?: "full_history_snapshot" | undefined;
669
686
  sourceVersionVector?: string | undefined;
670
687
  }[];
688
+ commitLsn: string | null;
689
+ commitLsnMode: "tracked" | "untracked";
690
+ acceptedOutgoingUpdateIds: string[];
671
691
  }>>;
672
692
  };
673
693
  readonly runtimeRefinements: readonly [{