@tearleads/client-sdk 0.1.69 → 0.1.72
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.
- package/data/shared/userTiming.js +42 -0
- package/data/shared/userTiming.js.map +1 -0
- package/data/sqlite/sqlExec.js +27 -3
- package/data/sqlite/sqlExec.js.map +1 -1
- package/data/sync/coordinatorLaneRun.js +29 -6
- package/data/sync/coordinatorLaneRun.js.map +1 -1
- package/data/sync/coordinatorState.d.ts +3 -1
- package/data/sync/coordinatorState.js +1 -0
- package/data/sync/coordinatorState.js.map +1 -1
- package/data/sync/syncTelemetry.d.ts +15 -0
- package/data/sync/syncTelemetry.js +10 -0
- package/data/sync/syncTelemetry.js.map +1 -1
- package/data/sync/uploadLane.js +20 -3
- package/data/sync/uploadLane.js.map +1 -1
- package/internal/api-client/ApiClient.d.ts +73 -3
- package/internal/api-client/apiRequestMetrics.d.ts +18 -4
- package/internal/api-client/apiRequestMetrics.js +55 -5
- package/internal/api-client/apiRequestMetrics.js.map +1 -1
- package/internal/api-client/durationSampleWindow.d.ts +26 -0
- package/internal/api-client/durationSampleWindow.js +42 -0
- package/internal/api-client/durationSampleWindow.js.map +1 -0
- package/internal/api-client/measureApiRequest.js +9 -4
- package/internal/api-client/measureApiRequest.js.map +1 -1
- package/internal/api-client/serverTiming.d.ts +12 -0
- package/internal/api-client/serverTiming.js +49 -0
- package/internal/api-client/serverTiming.js.map +1 -0
- package/internal/validators/documentCreateSeedRefinements.js +9 -0
- package/internal/validators/documentCreateSeedRefinements.js.map +1 -0
- package/internal/validators/operation/auth.d.ts +120 -0
- package/internal/validators/operation/containerMutations.d.ts +355 -0
- package/internal/validators/operation/containerMutations.js +7 -1
- package/internal/validators/operation/containerMutations.js.map +1 -1
- package/internal/validators/operation/documentMutations.d.ts +356 -0
- package/internal/validators/operation/documentMutations.js +6 -1
- package/internal/validators/operation/documentMutations.js.map +1 -1
- package/internal/validators/operation/documentSync.d.ts +9 -9
- package/internal/validators/operation/organizations.d.ts +120 -0
- package/internal/validators/request/containerMetadata.d.ts +313 -0
- package/internal/validators/request/containerMetadata.js +20 -3
- package/internal/validators/request/containerMetadata.js.map +1 -1
- package/internal/validators/request/document.d.ts +571 -0
- package/internal/validators/request/document.js +19 -1
- package/internal/validators/request/document.js.map +1 -1
- package/internal/validators/request/documentCreateSeed.js +35 -0
- package/internal/validators/request/documentCreateSeed.js.map +1 -0
- package/internal/validators/request/organizationProvisioning.js +9 -22
- package/internal/validators/request/organizationProvisioning.js.map +1 -1
- package/internal/validators/response/containerMetadata.d.ts +20 -0
- package/internal/validators/response/documentMutation.d.ts +43 -0
- package/internal/validators/response/documentMutation.js +12 -1
- package/internal/validators/response/documentMutation.js.map +1 -1
- package/internal/validators/response/documentSyncSchema.d.ts +13 -9
- package/internal/validators/response/documentSyncSchema.js +23 -18
- package/internal/validators/response/documentSyncSchema.js.map +1 -1
- package/internal/validators/response/index.d.ts +1 -1
- package/internal/validators/response/index.js.map +1 -1
- package/internal/validators/response/organizationProvisioning.d.ts +350 -0
- package/internal/validators/response/registration.d.ts +120 -0
- package/package.json +1 -1
- package/stores/container-contents/containerState/containerStatePersistence.js +2 -0
- package/stores/container-contents/containerState/containerStatePersistence.js.map +1 -1
- package/stores/container-contents/remoteEvents/remoteEventSync.js +1 -1
- package/stores/container-contents/remoteEvents/remoteEventSync.js.map +1 -1
- package/stores/container-contents/state.js +2 -0
- package/stores/container-contents/state.js.map +1 -1
- package/stores/container-contents/syncAgent/syncAgentTypes.d.ts +5 -0
- package/stores/container-contents/syncAgent/syncAgentTypes.js.map +1 -1
- package/stores/documents/documentStore/sync/createdDocumentPersistence.js +71 -0
- package/stores/documents/documentStore/sync/createdDocumentPersistence.js.map +1 -0
- package/stores/documents/documentStore/sync/index.js +13 -2
- package/stores/documents/documentStore/sync/index.js.map +1 -1
- package/stores/documents/documentStore/sync/syncRemoteSignals.js +21 -3
- package/stores/documents/documentStore/sync/syncRemoteSignals.js.map +1 -1
- package/stores/documents/documentStore/sync/syncSeededCreate.js +50 -0
- package/stores/documents/documentStore/sync/syncSeededCreate.js.map +1 -0
- package/stores/documents/documentStore/sync/syncShared.js +16 -8
- package/stores/documents/documentStore/sync/syncShared.js.map +1 -1
- package/workflows/container-contents/container-state/create/createIntentSeed.js +60 -0
- package/workflows/container-contents/container-state/create/createIntentSeed.js.map +1 -0
- package/workflows/container-contents/container-state/create/createIntentSync.js +18 -19
- package/workflows/container-contents/container-state/create/createIntentSync.js.map +1 -1
- package/workflows/container-contents/container-state/create/createWithMetadata.js +43 -6
- package/workflows/container-contents/container-state/create/createWithMetadata.js.map +1 -1
- package/workflows/container-contents/container-state/create/createWithMetadataPlan.js +5 -1
- package/workflows/container-contents/container-state/create/createWithMetadataPlan.js.map +1 -1
- package/workflows/container-contents/container-state/remote.js +15 -0
- package/workflows/container-contents/container-state/remote.js.map +1 -1
- package/workflows/container-contents/container-state/types.js.map +1 -1
- package/workflows/container-contents/metadata/metadataEvents.d.ts +7 -1
- package/workflows/container-contents/metadata/metadataEvents.js +8 -2
- package/workflows/container-contents/metadata/metadataEvents.js.map +1 -1
- package/workflows/container-contents/remoteHydration/types.d.ts +3 -0
- package/workflows/container-contents/remoteHydration/types.js.map +1 -1
- package/workflows/documents/create/index.d.ts +7 -0
- package/workflows/documents/create/index.js +40 -2
- package/workflows/documents/create/index.js.map +1 -1
- package/workflows/documents/index.d.ts +1 -0
- package/workflows/documents/index.js +1 -0
- package/workflows/documents/index.js.map +1 -1
- package/workflows/documents/sync/initialSync.d.ts +39 -0
- package/workflows/documents/sync/initialSync.js +39 -6
- package/workflows/documents/sync/initialSync.js.map +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { containerCreateMetadataSeedRefinement } from "../documentCreateSeedRefinements.js";
|
|
3
|
+
import { documentSyncRequestRuntimeRefinements } from "../documentSyncRefinements.js";
|
|
2
4
|
import { organizationProvisioningContainerKeyringRefinement } from "../organizationProvisioningRefinements.js";
|
|
3
5
|
import { ContainerCreateWithMetadataDocumentRequestSchema, ContainerMutationRequestSchema, ContainerReciteRequestSchema, ContainerRotationRequestSchema, isContainerCreateWithMetadataDocumentRequest, isContainerMutationRequest, isContainerRotationRequest, } from "../request/index.js";
|
|
4
6
|
import { ContainerCreateWithMetadataDocumentResponseSchema, ContainerDeleteResponseSchema, ContainerMutationFailureResponseSchema, ContainerMutationResponseSchema, ContainerNotFoundErrorResponseSchema, ContainerReciteResponseSchema, ContainerRotationResponseSchema, ErrorResponseSchema, isContainerCreateWithMetadataDocumentResponse, isContainerDeleteResponse, isContainerMutationResponse, isContainerRotationResponse, PaymentRequiredErrorResponseSchema, SessionFailureResponseSchema, } from "../response/index.js";
|
|
@@ -47,7 +49,11 @@ export const createContainerWithMetadataDocumentOperation = defineJsonOperation(
|
|
|
47
49
|
params: EmptyContainerMutationPathParamsSchema,
|
|
48
50
|
path: "/containers/with-metadata-document",
|
|
49
51
|
responses: { 200: ContainerCreateWithMetadataDocumentResponseSchema },
|
|
50
|
-
runtimeRefinements:
|
|
52
|
+
runtimeRefinements: [
|
|
53
|
+
...containerMutationRuntimeRefinements,
|
|
54
|
+
containerCreateMetadataSeedRefinement,
|
|
55
|
+
...documentSyncRequestRuntimeRefinements,
|
|
56
|
+
],
|
|
51
57
|
});
|
|
52
58
|
function defineContainerMutationOperation(input) {
|
|
53
59
|
return defineJsonOperation({
|
|
@@ -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,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,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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 { 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 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 method: \"POST\",\n params: EmptyContainerMutationPathParamsSchema,\n path: \"/containers/with-metadata-document\",\n responses: { 200: ContainerCreateWithMetadataDocumentResponseSchema },\n runtimeRefinements: containerMutationRuntimeRefinements,\n },\n);\n\nfunction defineContainerMutationOperation<\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: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\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: { readonly id: Id; readonly path: Path }) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerRotationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\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 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 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 path: \"/containers/{containerId}/revoke\",\n});\n\nexport const rekeyContainerOperation = defineContainerRotationOperation({\n id: \"containers.rekey\",\n path: \"/containers/{containerId}/rekey\",\n});\n\nexport const moveContainerOperation = defineContainerRotationOperation({\n id: \"containers.move\",\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 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,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,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,sCAAsC,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAElE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC9D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAMH,MAAM,iCAAiC,GAAG;IACxC,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,kCAAkC;IACvC,GAAG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edRefinements\";\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 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 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: { readonly id: Id; readonly path: Path }) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerMutationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\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: { readonly id: Id; readonly path: Path }) {\n return defineJsonOperation({\n auth: \"session\",\n body: ContainerRotationRequestSchema,\n failureResponses: containerMutationFailureResponses,\n failureStatuses: containerMutationFailureStatuses,\n id: input.id,\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 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 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 path: \"/containers/{containerId}/revoke\",\n});\n\nexport const rekeyContainerOperation = defineContainerRotationOperation({\n id: \"containers.rekey\",\n path: \"/containers/{containerId}/rekey\",\n});\n\nexport const moveContainerOperation = defineContainerRotationOperation({\n id: \"containers.move\",\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 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"]}
|
|
@@ -29,6 +29,83 @@ export declare const createDocumentOperation: Omit<{
|
|
|
29
29
|
event: Record<string, unknown>;
|
|
30
30
|
expectedManifestHash: string;
|
|
31
31
|
manifest: Record<string, unknown>;
|
|
32
|
+
initialSync?: {
|
|
33
|
+
contentKeyEpoch: number;
|
|
34
|
+
expectedLinkSetManifestHash: string;
|
|
35
|
+
expectedTargetHash: string;
|
|
36
|
+
localVersionVector: string | null;
|
|
37
|
+
outgoingUpdates: {
|
|
38
|
+
encryptedData: string;
|
|
39
|
+
id: string;
|
|
40
|
+
partialEndVersionVector: string;
|
|
41
|
+
partialStartVersionVector: string;
|
|
42
|
+
plaintextHash: string;
|
|
43
|
+
writeHeader: Record<string, unknown>;
|
|
44
|
+
checkpointKind?: "rotate_baseline" | undefined;
|
|
45
|
+
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
46
|
+
sourceVersionVector?: string | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
supportsPullPagination: true;
|
|
49
|
+
authorizingContainerPathRefs?: {
|
|
50
|
+
containerId: string;
|
|
51
|
+
manifestHash: string;
|
|
52
|
+
}[][] | undefined;
|
|
53
|
+
containerRekeys?: {
|
|
54
|
+
body: unknown;
|
|
55
|
+
event: Record<string, unknown>;
|
|
56
|
+
expectedManifestHash: string;
|
|
57
|
+
keyEpoch: Record<string, unknown>;
|
|
58
|
+
keyring: Record<string, unknown> | null;
|
|
59
|
+
manifest: Record<string, unknown>;
|
|
60
|
+
predecessorBridge: Record<string, unknown> | null;
|
|
61
|
+
principalPolicyRefs: {
|
|
62
|
+
principalType: "group" | "organization";
|
|
63
|
+
principalId: string;
|
|
64
|
+
version: number;
|
|
65
|
+
stateHash: string;
|
|
66
|
+
}[];
|
|
67
|
+
wraps: Record<string, unknown>[];
|
|
68
|
+
containerManifestHistoryRefs?: {
|
|
69
|
+
containerId: string;
|
|
70
|
+
manifestHash: string;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
destinationParentContainerPathRefs?: {
|
|
73
|
+
containerId: string;
|
|
74
|
+
manifestHash: string;
|
|
75
|
+
}[] | undefined;
|
|
76
|
+
parentContainerPathRefs?: {
|
|
77
|
+
containerId: string;
|
|
78
|
+
manifestHash: string;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
parentKekState?: Record<string, unknown> | null | undefined;
|
|
81
|
+
previousContainerPathRefs?: {
|
|
82
|
+
containerId: string;
|
|
83
|
+
manifestHash: string;
|
|
84
|
+
}[] | undefined;
|
|
85
|
+
previousManifestRef?: {
|
|
86
|
+
containerId: string;
|
|
87
|
+
manifestHash: string;
|
|
88
|
+
} | null | undefined;
|
|
89
|
+
userRecipientKeys?: Record<string, unknown>[] | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
contentKeyBundle?: {
|
|
92
|
+
contentKeyEpoch: number;
|
|
93
|
+
linkSetManifestHash: string;
|
|
94
|
+
targetHash: string;
|
|
95
|
+
targets: {
|
|
96
|
+
containerId: string;
|
|
97
|
+
containerKeyEpoch: number;
|
|
98
|
+
containerKeyEpochId: string;
|
|
99
|
+
containerManifestHash: string;
|
|
100
|
+
wrappedKey: string;
|
|
101
|
+
wrappingMetadata: Record<string, unknown>;
|
|
102
|
+
}[];
|
|
103
|
+
} | undefined;
|
|
104
|
+
historyMode?: "raw" | undefined;
|
|
105
|
+
inlineRekeyCommitId?: string | undefined;
|
|
106
|
+
minLsn?: string | undefined;
|
|
107
|
+
pullCursor?: string | undefined;
|
|
108
|
+
} | undefined;
|
|
32
109
|
authorizingContainerPathRefs?: {
|
|
33
110
|
containerId: string;
|
|
34
111
|
manifestHash: string;
|
|
@@ -93,6 +170,83 @@ export declare const createDocumentOperation: Omit<{
|
|
|
93
170
|
event: Record<string, unknown>;
|
|
94
171
|
expectedManifestHash: string;
|
|
95
172
|
manifest: Record<string, unknown>;
|
|
173
|
+
initialSync?: {
|
|
174
|
+
contentKeyEpoch: number;
|
|
175
|
+
expectedLinkSetManifestHash: string;
|
|
176
|
+
expectedTargetHash: string;
|
|
177
|
+
localVersionVector: string | null;
|
|
178
|
+
outgoingUpdates: {
|
|
179
|
+
encryptedData: string;
|
|
180
|
+
id: string;
|
|
181
|
+
partialEndVersionVector: string;
|
|
182
|
+
partialStartVersionVector: string;
|
|
183
|
+
plaintextHash: string;
|
|
184
|
+
writeHeader: Record<string, unknown>;
|
|
185
|
+
checkpointKind?: "rotate_baseline" | undefined;
|
|
186
|
+
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
187
|
+
sourceVersionVector?: string | undefined;
|
|
188
|
+
}[];
|
|
189
|
+
supportsPullPagination: true;
|
|
190
|
+
authorizingContainerPathRefs?: {
|
|
191
|
+
containerId: string;
|
|
192
|
+
manifestHash: string;
|
|
193
|
+
}[][] | undefined;
|
|
194
|
+
containerRekeys?: {
|
|
195
|
+
body: unknown;
|
|
196
|
+
event: Record<string, unknown>;
|
|
197
|
+
expectedManifestHash: string;
|
|
198
|
+
keyEpoch: Record<string, unknown>;
|
|
199
|
+
keyring: Record<string, unknown> | null;
|
|
200
|
+
manifest: Record<string, unknown>;
|
|
201
|
+
predecessorBridge: Record<string, unknown> | null;
|
|
202
|
+
principalPolicyRefs: {
|
|
203
|
+
principalType: "group" | "organization";
|
|
204
|
+
principalId: string;
|
|
205
|
+
version: number;
|
|
206
|
+
stateHash: string;
|
|
207
|
+
}[];
|
|
208
|
+
wraps: Record<string, unknown>[];
|
|
209
|
+
containerManifestHistoryRefs?: {
|
|
210
|
+
containerId: string;
|
|
211
|
+
manifestHash: string;
|
|
212
|
+
}[] | undefined;
|
|
213
|
+
destinationParentContainerPathRefs?: {
|
|
214
|
+
containerId: string;
|
|
215
|
+
manifestHash: string;
|
|
216
|
+
}[] | undefined;
|
|
217
|
+
parentContainerPathRefs?: {
|
|
218
|
+
containerId: string;
|
|
219
|
+
manifestHash: string;
|
|
220
|
+
}[] | undefined;
|
|
221
|
+
parentKekState?: Record<string, unknown> | null | undefined;
|
|
222
|
+
previousContainerPathRefs?: {
|
|
223
|
+
containerId: string;
|
|
224
|
+
manifestHash: string;
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
previousManifestRef?: {
|
|
227
|
+
containerId: string;
|
|
228
|
+
manifestHash: string;
|
|
229
|
+
} | null | undefined;
|
|
230
|
+
userRecipientKeys?: Record<string, unknown>[] | undefined;
|
|
231
|
+
}[] | undefined;
|
|
232
|
+
contentKeyBundle?: {
|
|
233
|
+
contentKeyEpoch: number;
|
|
234
|
+
linkSetManifestHash: string;
|
|
235
|
+
targetHash: string;
|
|
236
|
+
targets: {
|
|
237
|
+
containerId: string;
|
|
238
|
+
containerKeyEpoch: number;
|
|
239
|
+
containerKeyEpochId: string;
|
|
240
|
+
containerManifestHash: string;
|
|
241
|
+
wrappedKey: string;
|
|
242
|
+
wrappingMetadata: Record<string, unknown>;
|
|
243
|
+
}[];
|
|
244
|
+
} | undefined;
|
|
245
|
+
historyMode?: "raw" | undefined;
|
|
246
|
+
inlineRekeyCommitId?: string | undefined;
|
|
247
|
+
minLsn?: string | undefined;
|
|
248
|
+
pullCursor?: string | undefined;
|
|
249
|
+
} | undefined;
|
|
96
250
|
authorizingContainerPathRefs?: {
|
|
97
251
|
containerId: string;
|
|
98
252
|
manifestHash: string;
|
|
@@ -157,6 +311,83 @@ export declare const createDocumentOperation: Omit<{
|
|
|
157
311
|
event: Record<string, unknown>;
|
|
158
312
|
expectedManifestHash: string;
|
|
159
313
|
manifest: Record<string, unknown>;
|
|
314
|
+
initialSync?: {
|
|
315
|
+
contentKeyEpoch: number;
|
|
316
|
+
expectedLinkSetManifestHash: string;
|
|
317
|
+
expectedTargetHash: string;
|
|
318
|
+
localVersionVector: string | null;
|
|
319
|
+
outgoingUpdates: {
|
|
320
|
+
encryptedData: string;
|
|
321
|
+
id: string;
|
|
322
|
+
partialEndVersionVector: string;
|
|
323
|
+
partialStartVersionVector: string;
|
|
324
|
+
plaintextHash: string;
|
|
325
|
+
writeHeader: Record<string, unknown>;
|
|
326
|
+
checkpointKind?: "rotate_baseline" | undefined;
|
|
327
|
+
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
328
|
+
sourceVersionVector?: string | undefined;
|
|
329
|
+
}[];
|
|
330
|
+
supportsPullPagination: true;
|
|
331
|
+
authorizingContainerPathRefs?: {
|
|
332
|
+
containerId: string;
|
|
333
|
+
manifestHash: string;
|
|
334
|
+
}[][] | undefined;
|
|
335
|
+
containerRekeys?: {
|
|
336
|
+
body: unknown;
|
|
337
|
+
event: Record<string, unknown>;
|
|
338
|
+
expectedManifestHash: string;
|
|
339
|
+
keyEpoch: Record<string, unknown>;
|
|
340
|
+
keyring: Record<string, unknown> | null;
|
|
341
|
+
manifest: Record<string, unknown>;
|
|
342
|
+
predecessorBridge: Record<string, unknown> | null;
|
|
343
|
+
principalPolicyRefs: {
|
|
344
|
+
principalType: "group" | "organization";
|
|
345
|
+
principalId: string;
|
|
346
|
+
version: number;
|
|
347
|
+
stateHash: string;
|
|
348
|
+
}[];
|
|
349
|
+
wraps: Record<string, unknown>[];
|
|
350
|
+
containerManifestHistoryRefs?: {
|
|
351
|
+
containerId: string;
|
|
352
|
+
manifestHash: string;
|
|
353
|
+
}[] | undefined;
|
|
354
|
+
destinationParentContainerPathRefs?: {
|
|
355
|
+
containerId: string;
|
|
356
|
+
manifestHash: string;
|
|
357
|
+
}[] | undefined;
|
|
358
|
+
parentContainerPathRefs?: {
|
|
359
|
+
containerId: string;
|
|
360
|
+
manifestHash: string;
|
|
361
|
+
}[] | undefined;
|
|
362
|
+
parentKekState?: Record<string, unknown> | null | undefined;
|
|
363
|
+
previousContainerPathRefs?: {
|
|
364
|
+
containerId: string;
|
|
365
|
+
manifestHash: string;
|
|
366
|
+
}[] | undefined;
|
|
367
|
+
previousManifestRef?: {
|
|
368
|
+
containerId: string;
|
|
369
|
+
manifestHash: string;
|
|
370
|
+
} | null | undefined;
|
|
371
|
+
userRecipientKeys?: Record<string, unknown>[] | undefined;
|
|
372
|
+
}[] | undefined;
|
|
373
|
+
contentKeyBundle?: {
|
|
374
|
+
contentKeyEpoch: number;
|
|
375
|
+
linkSetManifestHash: string;
|
|
376
|
+
targetHash: string;
|
|
377
|
+
targets: {
|
|
378
|
+
containerId: string;
|
|
379
|
+
containerKeyEpoch: number;
|
|
380
|
+
containerKeyEpochId: string;
|
|
381
|
+
containerManifestHash: string;
|
|
382
|
+
wrappedKey: string;
|
|
383
|
+
wrappingMetadata: Record<string, unknown>;
|
|
384
|
+
}[];
|
|
385
|
+
} | undefined;
|
|
386
|
+
historyMode?: "raw" | undefined;
|
|
387
|
+
inlineRekeyCommitId?: string | undefined;
|
|
388
|
+
minLsn?: string | undefined;
|
|
389
|
+
pullCursor?: string | undefined;
|
|
390
|
+
} | undefined;
|
|
160
391
|
authorizingContainerPathRefs?: {
|
|
161
392
|
containerId: string;
|
|
162
393
|
manifestHash: string;
|
|
@@ -221,6 +452,83 @@ export declare const createDocumentOperation: Omit<{
|
|
|
221
452
|
event: Record<string, unknown>;
|
|
222
453
|
expectedManifestHash: string;
|
|
223
454
|
manifest: Record<string, unknown>;
|
|
455
|
+
initialSync?: {
|
|
456
|
+
contentKeyEpoch: number;
|
|
457
|
+
expectedLinkSetManifestHash: string;
|
|
458
|
+
expectedTargetHash: string;
|
|
459
|
+
localVersionVector: string | null;
|
|
460
|
+
outgoingUpdates: {
|
|
461
|
+
encryptedData: string;
|
|
462
|
+
id: string;
|
|
463
|
+
partialEndVersionVector: string;
|
|
464
|
+
partialStartVersionVector: string;
|
|
465
|
+
plaintextHash: string;
|
|
466
|
+
writeHeader: Record<string, unknown>;
|
|
467
|
+
checkpointKind?: "rotate_baseline" | undefined;
|
|
468
|
+
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
469
|
+
sourceVersionVector?: string | undefined;
|
|
470
|
+
}[];
|
|
471
|
+
supportsPullPagination: true;
|
|
472
|
+
authorizingContainerPathRefs?: {
|
|
473
|
+
containerId: string;
|
|
474
|
+
manifestHash: string;
|
|
475
|
+
}[][] | undefined;
|
|
476
|
+
containerRekeys?: {
|
|
477
|
+
body: unknown;
|
|
478
|
+
event: Record<string, unknown>;
|
|
479
|
+
expectedManifestHash: string;
|
|
480
|
+
keyEpoch: Record<string, unknown>;
|
|
481
|
+
keyring: Record<string, unknown> | null;
|
|
482
|
+
manifest: Record<string, unknown>;
|
|
483
|
+
predecessorBridge: Record<string, unknown> | null;
|
|
484
|
+
principalPolicyRefs: {
|
|
485
|
+
principalType: "group" | "organization";
|
|
486
|
+
principalId: string;
|
|
487
|
+
version: number;
|
|
488
|
+
stateHash: string;
|
|
489
|
+
}[];
|
|
490
|
+
wraps: Record<string, unknown>[];
|
|
491
|
+
containerManifestHistoryRefs?: {
|
|
492
|
+
containerId: string;
|
|
493
|
+
manifestHash: string;
|
|
494
|
+
}[] | undefined;
|
|
495
|
+
destinationParentContainerPathRefs?: {
|
|
496
|
+
containerId: string;
|
|
497
|
+
manifestHash: string;
|
|
498
|
+
}[] | undefined;
|
|
499
|
+
parentContainerPathRefs?: {
|
|
500
|
+
containerId: string;
|
|
501
|
+
manifestHash: string;
|
|
502
|
+
}[] | undefined;
|
|
503
|
+
parentKekState?: Record<string, unknown> | null | undefined;
|
|
504
|
+
previousContainerPathRefs?: {
|
|
505
|
+
containerId: string;
|
|
506
|
+
manifestHash: string;
|
|
507
|
+
}[] | undefined;
|
|
508
|
+
previousManifestRef?: {
|
|
509
|
+
containerId: string;
|
|
510
|
+
manifestHash: string;
|
|
511
|
+
} | null | undefined;
|
|
512
|
+
userRecipientKeys?: Record<string, unknown>[] | undefined;
|
|
513
|
+
}[] | undefined;
|
|
514
|
+
contentKeyBundle?: {
|
|
515
|
+
contentKeyEpoch: number;
|
|
516
|
+
linkSetManifestHash: string;
|
|
517
|
+
targetHash: string;
|
|
518
|
+
targets: {
|
|
519
|
+
containerId: string;
|
|
520
|
+
containerKeyEpoch: number;
|
|
521
|
+
containerKeyEpochId: string;
|
|
522
|
+
containerManifestHash: string;
|
|
523
|
+
wrappedKey: string;
|
|
524
|
+
wrappingMetadata: Record<string, unknown>;
|
|
525
|
+
}[];
|
|
526
|
+
} | undefined;
|
|
527
|
+
historyMode?: "raw" | undefined;
|
|
528
|
+
inlineRekeyCommitId?: string | undefined;
|
|
529
|
+
minLsn?: string | undefined;
|
|
530
|
+
pullCursor?: string | undefined;
|
|
531
|
+
} | undefined;
|
|
224
532
|
authorizingContainerPathRefs?: {
|
|
225
533
|
containerId: string;
|
|
226
534
|
manifestHash: string;
|
|
@@ -385,6 +693,11 @@ export declare const createDocumentOperation: Omit<{
|
|
|
385
693
|
targets: Record<string, unknown>[];
|
|
386
694
|
};
|
|
387
695
|
id: string;
|
|
696
|
+
initialSync?: {
|
|
697
|
+
commitLsn: string | null;
|
|
698
|
+
commitLsnMode: "tracked" | "untracked";
|
|
699
|
+
acceptedOutgoingUpdateIds: string[];
|
|
700
|
+
} | undefined;
|
|
388
701
|
}, {
|
|
389
702
|
accessManifest: {
|
|
390
703
|
event: {
|
|
@@ -420,6 +733,11 @@ export declare const createDocumentOperation: Omit<{
|
|
|
420
733
|
targets: Record<string, unknown>[];
|
|
421
734
|
};
|
|
422
735
|
id: string;
|
|
736
|
+
initialSync?: {
|
|
737
|
+
commitLsn: string | null;
|
|
738
|
+
commitLsnMode: "tracked" | "untracked";
|
|
739
|
+
acceptedOutgoingUpdateIds: string[];
|
|
740
|
+
} | undefined;
|
|
423
741
|
}, z.core.$ZodTypeInternals<{
|
|
424
742
|
accessManifest: {
|
|
425
743
|
event: {
|
|
@@ -455,6 +773,11 @@ export declare const createDocumentOperation: Omit<{
|
|
|
455
773
|
targets: Record<string, unknown>[];
|
|
456
774
|
};
|
|
457
775
|
id: string;
|
|
776
|
+
initialSync?: {
|
|
777
|
+
commitLsn: string | null;
|
|
778
|
+
commitLsnMode: "tracked" | "untracked";
|
|
779
|
+
acceptedOutgoingUpdateIds: string[];
|
|
780
|
+
} | undefined;
|
|
458
781
|
}, {
|
|
459
782
|
accessManifest: {
|
|
460
783
|
event: {
|
|
@@ -490,8 +813,41 @@ export declare const createDocumentOperation: Omit<{
|
|
|
490
813
|
targets: Record<string, unknown>[];
|
|
491
814
|
};
|
|
492
815
|
id: string;
|
|
816
|
+
initialSync?: {
|
|
817
|
+
commitLsn: string | null;
|
|
818
|
+
commitLsnMode: "tracked" | "untracked";
|
|
819
|
+
acceptedOutgoingUpdateIds: string[];
|
|
820
|
+
} | undefined;
|
|
493
821
|
}>>;
|
|
494
822
|
};
|
|
823
|
+
readonly runtimeRefinements: readonly [{
|
|
824
|
+
readonly description: "a document create seed must contain exactly one outgoing update and no container rekeys, and serialize within the document sync request limit";
|
|
825
|
+
readonly id: "request.document-create-seed";
|
|
826
|
+
}, {
|
|
827
|
+
readonly description: "inlineRekeyCommitId must be present exactly when containerRekeys is non-empty";
|
|
828
|
+
readonly id: "request.inline-rekey-commit-marker";
|
|
829
|
+
}, {
|
|
830
|
+
readonly description: "authorizingContainerPathRefs is required when outgoingUpdates is non-empty";
|
|
831
|
+
readonly id: "request.authorizing-paths-for-writes";
|
|
832
|
+
}, {
|
|
833
|
+
readonly description: "containerRekeys may be non-empty only when outgoingUpdates is non-empty";
|
|
834
|
+
readonly id: "request.container-rekeys-require-write";
|
|
835
|
+
}, {
|
|
836
|
+
readonly description: "outgoing update ids must be unique within the request";
|
|
837
|
+
readonly id: "request.unique-outgoing-update-ids";
|
|
838
|
+
}, {
|
|
839
|
+
readonly description: "a request carrying pullCursor must not contain outgoing updates, container rekeys, a content-key bundle, or authorizing paths";
|
|
840
|
+
readonly id: "request.pull-continuation-read-only";
|
|
841
|
+
}, {
|
|
842
|
+
readonly description: "historyMode \"raw\" must not be combined with outgoing updates, container rekeys, a content-key bundle, or authorizing paths";
|
|
843
|
+
readonly id: "request.raw-history-read-only";
|
|
844
|
+
}, {
|
|
845
|
+
readonly description: "historyMode \"raw\" requires localVersionVector to be null so the complete retained history is requested";
|
|
846
|
+
readonly id: "request.raw-history-null-frontier";
|
|
847
|
+
}, {
|
|
848
|
+
readonly description: "checkpointKind, checkpointPayloadKind, and sourceVersionVector must be absent together or form a rotation baseline";
|
|
849
|
+
readonly id: "request.rotation-checkpoint-fields";
|
|
850
|
+
}];
|
|
495
851
|
}, "failureResponses" | "failureStatuses"> & {
|
|
496
852
|
readonly failureResponses: {
|
|
497
853
|
readonly 400: z.ZodType<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { documentCreateSeedRefinement } from "../documentCreateSeedRefinements.js";
|
|
3
|
+
import { documentLinkSetPathRefinement, documentSyncRequestRotationRefinement, documentSyncRequestRuntimeRefinements, } from "../documentSyncRefinements.js";
|
|
3
4
|
import { registerJsonSchemaFragment } from "../jsonSchema.js";
|
|
4
5
|
import { DocumentCreateRequestSchema, DocumentLinkSetMutationRequestSchema, DocumentPurgeRequestSchema, isDocumentCreateRequest, isDocumentLinkSetMutationRequest, isDocumentPurgeRequest, } from "../request/index.js";
|
|
5
6
|
import { DocumentCreateResponseSchema, DocumentLinkSetMutationResponseSchema, DocumentMutationFailureResponseSchema, DocumentPurgeProofResponseSchema, DocumentPurgeResponseSchema, ErrorResponseSchema, isDocumentCreateResponse, isDocumentLinkSetMutationResponse, isDocumentPurgeProofResponse, isDocumentPurgeResponse, PaymentRequiredErrorResponseSchema, SessionFailureResponseSchema, } from "../response/index.js";
|
|
@@ -35,6 +36,10 @@ export const createDocumentOperation = defineJsonOperation({
|
|
|
35
36
|
params: EmptyDocumentMutationPathParamsSchema,
|
|
36
37
|
path: "/documents",
|
|
37
38
|
responses: { 200: DocumentCreateResponseSchema },
|
|
39
|
+
runtimeRefinements: [
|
|
40
|
+
documentCreateSeedRefinement,
|
|
41
|
+
...documentSyncRequestRuntimeRefinements,
|
|
42
|
+
],
|
|
38
43
|
});
|
|
39
44
|
function defineDocumentLinkSetMutationOperation(input) {
|
|
40
45
|
return defineJsonOperation({
|
|
@@ -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,CA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T,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"]}
|
|
@@ -425,9 +425,6 @@ export declare const documentSyncOperation: Omit<{
|
|
|
425
425
|
};
|
|
426
426
|
readonly responses: {
|
|
427
427
|
readonly 200: z.ZodType<{
|
|
428
|
-
acceptedOutgoingUpdateIds: string[];
|
|
429
|
-
commitLsn: string | null;
|
|
430
|
-
commitLsnMode: "tracked" | "untracked";
|
|
431
428
|
contentKeyBundle: {
|
|
432
429
|
contentKeyEpoch: number;
|
|
433
430
|
documentId: string;
|
|
@@ -490,10 +487,10 @@ export declare const documentSyncOperation: Omit<{
|
|
|
490
487
|
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
491
488
|
sourceVersionVector?: string | undefined;
|
|
492
489
|
}[];
|
|
493
|
-
}, {
|
|
494
|
-
acceptedOutgoingUpdateIds: string[];
|
|
495
490
|
commitLsn: string | null;
|
|
496
491
|
commitLsnMode: "tracked" | "untracked";
|
|
492
|
+
acceptedOutgoingUpdateIds: string[];
|
|
493
|
+
}, {
|
|
497
494
|
contentKeyBundle: {
|
|
498
495
|
contentKeyEpoch: number;
|
|
499
496
|
documentId: string;
|
|
@@ -556,10 +553,10 @@ export declare const documentSyncOperation: Omit<{
|
|
|
556
553
|
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
557
554
|
sourceVersionVector?: string | undefined;
|
|
558
555
|
}[];
|
|
559
|
-
}, z.core.$ZodTypeInternals<{
|
|
560
|
-
acceptedOutgoingUpdateIds: string[];
|
|
561
556
|
commitLsn: string | null;
|
|
562
557
|
commitLsnMode: "tracked" | "untracked";
|
|
558
|
+
acceptedOutgoingUpdateIds: string[];
|
|
559
|
+
}, z.core.$ZodTypeInternals<{
|
|
563
560
|
contentKeyBundle: {
|
|
564
561
|
contentKeyEpoch: number;
|
|
565
562
|
documentId: string;
|
|
@@ -622,10 +619,10 @@ export declare const documentSyncOperation: Omit<{
|
|
|
622
619
|
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
623
620
|
sourceVersionVector?: string | undefined;
|
|
624
621
|
}[];
|
|
625
|
-
}, {
|
|
626
|
-
acceptedOutgoingUpdateIds: string[];
|
|
627
622
|
commitLsn: string | null;
|
|
628
623
|
commitLsnMode: "tracked" | "untracked";
|
|
624
|
+
acceptedOutgoingUpdateIds: string[];
|
|
625
|
+
}, {
|
|
629
626
|
contentKeyBundle: {
|
|
630
627
|
contentKeyEpoch: number;
|
|
631
628
|
documentId: string;
|
|
@@ -688,6 +685,9 @@ export declare const documentSyncOperation: Omit<{
|
|
|
688
685
|
checkpointPayloadKind?: "full_history_snapshot" | undefined;
|
|
689
686
|
sourceVersionVector?: string | undefined;
|
|
690
687
|
}[];
|
|
688
|
+
commitLsn: string | null;
|
|
689
|
+
commitLsnMode: "tracked" | "untracked";
|
|
690
|
+
acceptedOutgoingUpdateIds: string[];
|
|
691
691
|
}>>;
|
|
692
692
|
};
|
|
693
693
|
readonly runtimeRefinements: readonly [{
|