@tearleads/client-sdk 0.1.19 → 0.1.20
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/client/organizations/index.js +2 -2
- package/client/organizations/index.js.map +1 -1
- package/client/organizations/organizationHistory.js +66 -0
- package/client/organizations/organizationHistory.js.map +1 -0
- package/client/organizations/organizationReadModels.d.ts +1 -1
- package/client/organizations/organizationReadModels.js +7 -27
- package/client/organizations/organizationReadModels.js.map +1 -1
- package/client/organizations/organizationsTypes.d.ts +1 -1
- package/client/organizations/organizationsTypes.js.map +1 -1
- package/data/containers/shared/types.d.ts +2 -2
- package/data/containers/shared/types.js.map +1 -1
- package/data/documents/shared/syncSubmitFailure.d.ts +2 -2
- package/data/documents/shared/syncSubmitFailure.js.map +1 -1
- package/data/keyingProjectionVerification/documentPurgeCheckpointCurrency.js +34 -8
- package/data/keyingProjectionVerification/documentPurgeCheckpointCurrency.js.map +1 -1
- package/data/keyingProjectionVerification/documentPurgeDocumentChainVerification.js.map +1 -1
- package/data/keyingProjectionVerification/documentPurgePolicyCheckpoints.js +17 -0
- package/data/keyingProjectionVerification/documentPurgePolicyCheckpoints.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurgePolicyCurrency.js +55 -0
- package/data/keyingProjectionVerification/documentPurgePolicyCurrency.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurgePrincipalEvidence.js +25 -13
- package/data/keyingProjectionVerification/documentPurgePrincipalEvidence.js.map +1 -1
- package/data/keyingProjectionVerification/documentPurgeProofVerification.d.ts +5 -3
- package/data/keyingProjectionVerification/documentPurgeProofVerification.js +52 -8
- package/data/keyingProjectionVerification/documentPurgeProofVerification.js.map +1 -1
- package/data/keyingProjectionVerification/projectionPolicyEvidence.js.map +1 -1
- package/data/keyingProjectionVerification/types.d.ts +4 -0
- package/data/keyingProjectionVerification/types.js.map +1 -1
- package/data/persistence/principalAuthorizationCheckpoints.js +1 -1
- package/data/persistence/principalAuthorizationCheckpoints.js.map +1 -1
- package/data/persistence/principalCurrentAcknowledgementPersistence.d.ts +1 -0
- package/data/persistence/principalCurrentAcknowledgementPersistence.js +58 -12
- package/data/persistence/principalCurrentAcknowledgementPersistence.js.map +1 -1
- package/data/persistence/principalHistoryEvidencePersistence.d.ts +2 -0
- package/data/persistence/principalHistoryEvidencePersistence.js +2 -0
- package/data/persistence/principalHistoryEvidencePersistence.js.map +1 -1
- package/data/persistence/principalHistoryIncompleteRetention.js +32 -0
- package/data/persistence/principalHistoryIncompleteRetention.js.map +1 -0
- package/data/persistence/principalHistoryNodeRetention.js +76 -0
- package/data/persistence/principalHistoryNodeRetention.js.map +1 -0
- package/data/persistence/principalHistoryPrefixPersistence.d.ts +1 -0
- package/data/persistence/principalHistoryPrefixPersistence.js +30 -1
- package/data/persistence/principalHistoryPrefixPersistence.js.map +1 -1
- package/data/persistence/principalHistoryRootOwnership.js +71 -0
- package/data/persistence/principalHistoryRootOwnership.js.map +1 -0
- package/data/persistence/principalHistoryStagePersistence.js +45 -0
- package/data/persistence/principalHistoryStagePersistence.js.map +1 -1
- package/data/persistence/principalHistoryStageRetention.js +44 -0
- package/data/persistence/principalHistoryStageRetention.js.map +1 -0
- package/data/persistence/principalHistoryUnpublishedRetention.js +71 -0
- package/data/persistence/principalHistoryUnpublishedRetention.js.map +1 -0
- package/data/persistence/principalKeyEnvelopeArchivePersistence.js +63 -0
- package/data/persistence/principalKeyEnvelopeArchivePersistence.js.map +1 -0
- package/data/persistence/principalKeyEnvelopeCandidates.js +10 -1
- package/data/persistence/principalKeyEnvelopeCandidates.js.map +1 -1
- package/data/sqlite/principalHistoryEvidenceSchema.js +2 -0
- package/data/sqlite/principalHistoryEvidenceSchema.js.map +1 -1
- package/data/sqlite/principalHistoryNodeRetentionSchema.js +30 -0
- package/data/sqlite/principalHistoryNodeRetentionSchema.js.map +1 -0
- package/data/sqlite/principalHistoryRetentionSchema.js +40 -0
- package/data/sqlite/principalHistoryRetentionSchema.js.map +1 -0
- package/data/sqlite/principalHistoryStageSchema.js +2 -0
- package/data/sqlite/principalHistoryStageSchema.js.map +1 -1
- package/data/sqlite/schema.d.ts +453 -0
- package/data/sqlite/schema.js +6 -0
- package/data/sqlite/schema.js.map +1 -1
- package/data/sqlite/sqliteCommitGuards.js +49 -0
- package/data/sqlite/sqliteCommitGuards.js.map +1 -0
- package/data/sqlite/sqlitePersistenceRuntime.js +14 -2
- package/data/sqlite/sqlitePersistenceRuntime.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js.map +1 -1
- package/internal/api-client/ApiClient.d.ts +60 -137
- package/internal/api-client/ApiClient.js +7 -5
- package/internal/api-client/ApiClient.js.map +1 -1
- package/internal/api-client/apiRequestRuntime.js +7 -7
- package/internal/api-client/apiRequestRuntime.js.map +1 -1
- package/internal/api-client/documentPurge.js +25 -0
- package/internal/api-client/documentPurge.js.map +1 -0
- package/internal/api-client/organizationPolicyHistory.d.ts +53 -0
- package/internal/api-client/organizationPolicyHistory.js +15 -0
- package/internal/api-client/organizationPolicyHistory.js.map +1 -0
- package/internal/api-client/requestInternals.js +4 -4
- package/internal/api-client/requestInternals.js.map +1 -1
- package/internal/api-client/types.d.ts +2 -2
- package/internal/api-client/types.js.map +1 -1
- package/internal/crypto/keying/principalPolicyHistory.js +4 -0
- package/internal/crypto/keying/principalPolicyHistory.js.map +1 -1
- package/internal/crypto/keying/principalPolicyHistoryTypes.d.ts +2 -0
- package/internal/crypto/keying/principalPolicyHistoryTypes.js.map +1 -1
- package/internal/validators/operation/containerMutations.d.ts +448 -6528
- package/internal/validators/operation/documentMutations.d.ts +323 -579
- package/internal/validators/operation/documentMutations.js +22 -4
- package/internal/validators/operation/documentMutations.js.map +1 -1
- package/internal/validators/operation/documentSync.d.ts +26 -406
- package/internal/validators/operation/organizationPolicyHistory.d.ts +188 -310
- package/internal/validators/operation/organizationPolicyHistory.js +17 -3
- package/internal/validators/operation/organizationPolicyHistory.js.map +1 -1
- package/internal/validators/response/containerMutationError.d.ts +28 -408
- package/internal/validators/response/documentMutation.d.ts +232 -544
- package/internal/validators/response/documentMutation.js +1 -2
- package/internal/validators/response/documentMutation.js.map +1 -1
- package/internal/validators/response/documentSyncError.d.ts +26 -406
- package/internal/validators/response/documentSyncError.js +4 -3
- package/internal/validators/response/documentSyncError.js.map +1 -1
- package/internal/validators/response/index.d.ts +1 -1
- package/internal/validators/response/index.js +1 -1
- package/internal/validators/response/index.js.map +1 -1
- package/internal/validators/response/organizationPolicyHistory.d.ts +127 -309
- package/internal/validators/response/organizationPolicyHistory.js +10 -4
- package/internal/validators/response/organizationPolicyHistory.js.map +1 -1
- package/internal/validators/response/principal.d.ts +28 -408
- package/internal/validators/response/principal.js +3 -1
- package/internal/validators/response/principal.js.map +1 -1
- package/internal/validators/util/index.d.ts +1 -1
- package/internal/validators/util/index.js +1 -1
- package/internal/validators/util/index.js.map +1 -1
- package/internal/validators/util/principalHistoryWire.d.ts +2 -0
- package/internal/validators/util/principalHistoryWire.js +2 -0
- package/internal/validators/util/principalHistoryWire.js.map +1 -1
- package/package.json +1 -1
- package/workflows/container-contents/container-state/createWithMetadata.js +19 -49
- package/workflows/container-contents/container-state/createWithMetadata.js.map +1 -1
- package/workflows/container-contents/container-state/groupGrantVerification.js +29 -0
- package/workflows/container-contents/container-state/groupGrantVerification.js.map +1 -1
- package/workflows/container-contents/container-state/groupShareEpoch.js +33 -0
- package/workflows/container-contents/container-state/groupShareEpoch.js.map +1 -0
- package/workflows/container-contents/container-state/remote.js +4 -1
- package/workflows/container-contents/container-state/remote.js.map +1 -1
- package/workflows/container-contents/container-state/share.js +2 -24
- package/workflows/container-contents/container-state/share.js.map +1 -1
- package/workflows/container-contents/documentTombstoneEvidence.js +23 -12
- package/workflows/container-contents/documentTombstoneEvidence.js.map +1 -1
- package/workflows/containers/child/create.js +1 -3
- package/workflows/containers/child/create.js.map +1 -1
- package/workflows/containers/child/createSubmission.d.ts +1 -3
- package/workflows/containers/child/createSubmission.js +13 -15
- package/workflows/containers/child/createSubmission.js.map +1 -1
- package/workflows/containers/child/currentShareGrantMutation.js +82 -0
- package/workflows/containers/child/currentShareGrantMutation.js.map +1 -0
- package/workflows/containers/child/currentSharePrincipalPolicy.js +83 -0
- package/workflows/containers/child/currentSharePrincipalPolicy.js.map +1 -0
- package/workflows/containers/child/mutationSubmit.js +1 -1
- package/workflows/containers/child/mutationSubmit.js.map +1 -1
- package/workflows/containers/child/runtimeCurrentGroupShare.js +82 -0
- package/workflows/containers/child/runtimeCurrentGroupShare.js.map +1 -0
- package/workflows/containers/child/share.js +1 -14
- package/workflows/containers/child/share.js.map +1 -1
- package/workflows/containers/child/shareProjection.js +15 -0
- package/workflows/containers/child/shareProjection.js.map +1 -0
- package/workflows/documents/purge.d.ts +3 -0
- package/workflows/documents/purge.js +13 -0
- package/workflows/documents/purge.js.map +1 -1
- package/workflows/documents/sync.js +2 -0
- package/workflows/documents/sync.js.map +1 -1
- package/workflows/documents/syncFailures.js +2 -2
- package/workflows/documents/syncFailures.js.map +1 -1
- package/workflows/documents/syncPolicyRepair.js +15 -13
- package/workflows/documents/syncPolicyRepair.js.map +1 -1
- package/workflows/organizations/initialPrincipalCurrentPublication.js +2 -0
- package/workflows/organizations/initialPrincipalCurrentPublication.js.map +1 -1
- package/workflows/organizations/loadPolicyHistoryDetails.js +31 -32
- package/workflows/organizations/loadPolicyHistoryDetails.js.map +1 -1
- package/workflows/organizations/organizationPolicyHistoryDetails.js +37 -15
- package/workflows/organizations/organizationPolicyHistoryDetails.js.map +1 -1
- package/workflows/organizations/organizationPolicyHistoryVerification.js +56 -69
- package/workflows/organizations/organizationPolicyHistoryVerification.js.map +1 -1
- package/workflows/organizations/policyHistoryCache.js +5 -2
- package/workflows/organizations/policyHistoryCache.js.map +1 -1
- package/workflows/organizations/policyHistoryTypes.d.ts +1 -0
- package/workflows/organizations/policyHistoryTypes.js.map +1 -1
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.js +4 -1
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.js.map +1 -1
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.d.ts +0 -1
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.js +1 -2
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.js.map +1 -1
- package/workflows/principals/policyRepair.js +38 -0
- package/workflows/principals/policyRepair.js.map +1 -0
- package/workflows/principals/policyRepairBudget.d.ts +2 -2
- package/workflows/principals/policyRepairBudget.js +3 -3
- package/workflows/principals/policyRepairBudget.js.map +1 -1
- package/workflows/principals/principalHistoryRecoveryPrefix.js +4 -0
- package/workflows/principals/principalHistoryRecoveryPrefix.js.map +1 -1
- package/workflows/principals/principalRecoveryLocalPreference.js +3 -2
- package/workflows/principals/principalRecoveryLocalPreference.js.map +1 -1
- package/workflows/principals/publicPrincipalHistoryPage.js +1 -0
- package/workflows/principals/publicPrincipalHistoryPage.js.map +1 -1
- package/workflows/principals/publicPrincipalHistoryProgress.js +1 -0
- package/workflows/principals/publicPrincipalHistoryProgress.js.map +1 -1
- package/workflows/principals/publicPrincipalHistoryTypes.d.ts +2 -0
- package/workflows/principals/publicPrincipalHistoryTypes.js.map +1 -1
- package/workflows/principals/publicProjectionPrincipal.js +1 -0
- package/workflows/principals/publicProjectionPrincipal.js.map +1 -1
- package/workflows/principals/recoverPrincipalHistoryPage.js +2 -1
- package/workflows/principals/recoverPrincipalHistoryPage.js.map +1 -1
- package/workflows/principals/recoverPrincipalPolicyHistory.js +1 -0
- package/workflows/principals/recoverPrincipalPolicyHistory.js.map +1 -1
- package/workflows/principals/recoverPublicPrincipalHistory.js +2 -0
- package/workflows/principals/recoverPublicPrincipalHistory.js.map +1 -1
- package/workflows/principals/runtimePolicyRecovery.js +2 -1
- package/workflows/principals/runtimePolicyRecovery.js.map +1 -1
- package/workflows/principals/selectPublicPrincipalHistory.js +21 -15
- package/workflows/principals/selectPublicPrincipalHistory.js.map +1 -1
- package/workflows/sync/remoteResetPrincipalScope.js +6 -0
- package/workflows/sync/remoteResetPrincipalScope.js.map +1 -1
- package/data/keyingProjectionVerification/principalPolicySnapshotVerification.js +0 -208
- package/data/keyingProjectionVerification/principalPolicySnapshotVerification.js.map +0 -1
- package/data/keyingProjectionVerification/snapshotVerificationCache.js +0 -39
- package/data/keyingProjectionVerification/snapshotVerificationCache.js.map +0 -1
- package/workflows/containers/child/policyRepair.js +0 -23
- package/workflows/containers/child/policyRepair.js.map +0 -1
|
@@ -4,7 +4,6 @@ import { AccessEventBundleWireResponseSchema, AccessManifestBundleWireResponseSc
|
|
|
4
4
|
import { ProjectionHistoryPrefixesSchema } from "../util/projectionHistoryWire.js";
|
|
5
5
|
import { ContainerKeyingPathResponseSchema } from "./container.js";
|
|
6
6
|
import { DocumentContentKeyBundleResponseSchema, DocumentKekTargetsResponseSchema, DocumentSyncResponseSchema, } from "./documentSyncSchema.js";
|
|
7
|
-
import { PrincipalPolicySnapshotResponseSchema } from "./principal.js";
|
|
8
7
|
import { ProjectionPolicyEvidenceResponseSchema } from "./projectionPolicyEvidence.js";
|
|
9
8
|
export { DocumentContentKeyBundleResponseSchema, DocumentContentKeyTargetEnvelopeResponseSchema, DocumentKekTargetsResponseSchema, DocumentSyncPullPageResponseSchema, DocumentSyncResponseSchema, DocumentSyncUpdateResponseSchema, } from "./documentSyncSchema.js";
|
|
10
9
|
export const DocumentCreateResponseSchema = loosePlainObject({
|
|
@@ -29,7 +28,7 @@ const documentPurgeProofShape = {
|
|
|
29
28
|
documentManifestPredecessors: arraySchema(AccessManifestBundleWireResponseSchema),
|
|
30
29
|
purgeEvent: AccessEventBundleWireResponseSchema,
|
|
31
30
|
purgedAt: nonEmptyStringSchema,
|
|
32
|
-
|
|
31
|
+
policyEvidence: ProjectionPolicyEvidenceResponseSchema,
|
|
33
32
|
};
|
|
34
33
|
export const DocumentPurgeProofResponseSchema = loosePlainObject(documentPurgeProofShape);
|
|
35
34
|
export const DocumentPurgeResponseSchema = loosePlainObject({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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,KAAK,CAAC,CAAC,OAAO,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,0BAA0B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAc;IAEd,OAAO,sCAAsC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACzE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyArraySchema,\n nonEmptyStringSchema,\n} from \"../schema\";\nimport {\n AccessEventBundleWireResponseSchema,\n AccessManifestBundleWireResponseSchema,\n} from \"../util\";\nimport { ProjectionHistoryPrefixesSchema } from \"../util/projectionHistoryWire\";\nimport { ContainerKeyingPathResponseSchema } from \"./container\";\nimport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n} from \"./documentSyncSchema\";\nimport { PrincipalPolicySnapshotResponseSchema } from \"./principal\";\nimport { ProjectionPolicyEvidenceResponseSchema } from \"./projectionPolicyEvidence\";\n\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n} from \"./documentSyncSchema\";\n\nexport const DocumentCreateResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n createdAt: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentCreateResponse = z.infer<\n typeof DocumentCreateResponseSchema\n>;\n\nexport const DocumentLinkSetMutationResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentLinkSetMutationResponse = z.infer<\n typeof DocumentLinkSetMutationResponseSchema\n>;\n\nconst documentPurgeProofShape = {\n authorizingContainerPath: nonEmptyArraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: nonEmptyStringSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestPredecessors: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n purgeEvent: AccessEventBundleWireResponseSchema,\n purgedAt: nonEmptyStringSchema,\n principalPolicySnapshots: arraySchema(PrincipalPolicySnapshotResponseSchema),\n} as const;\n\nexport const DocumentPurgeProofResponseSchema = loosePlainObject(\n documentPurgeProofShape,\n);\n\nexport type DocumentPurgeProofResponse = z.infer<\n typeof DocumentPurgeProofResponseSchema\n>;\n\nexport const DocumentPurgeResponseSchema = loosePlainObject({\n ...documentPurgeProofShape,\n reclaimedBlobStorageKeys: arraySchema(z.string()),\n});\n\nexport type DocumentPurgeResponse = z.infer<typeof DocumentPurgeResponseSchema>;\n\nexport const DocumentWriterProjectionResponseSchema = loosePlainObject({\n historyPrefixes: ProjectionHistoryPrefixesSchema.optional(),\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n authorizingContainerPaths: nonEmptyArraySchema(\n ContainerKeyingPathResponseSchema,\n ),\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n /** Present only when the stored content-key bundle targets stale KEKs. */\n contentKeyBundleStale: z.literal(true).optional(),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),\n});\n\nexport type DocumentWriterProjectionResponse = z.infer<\n typeof DocumentWriterProjectionResponseSchema\n>;\n\n/**\n * Derives the KEK-target summary that corresponds to a content-key bundle,\n * preserving the bundle's served target order. Both the API (for stale-bundle\n * read-only sync responses) and clients (for plans built against a stale\n * bundle) must derive this identically so response/plan state comparisons\n * hold byte-for-byte.\n */\nexport function documentKekTargetsFromContentKeyBundle(\n bundle: DocumentContentKeyBundleResponse,\n): DocumentKekTargetsResponse {\n const targets = bundle.targets.map((target) => ({\n containerId: target.containerId,\n containerManifestHash: target.containerManifestHash,\n containerKeyEpochId: target.containerKeyEpochId,\n containerKeyEpoch: target.containerKeyEpoch,\n }));\n\n return {\n documentId: bundle.documentId,\n documentKeyTargetHash: bundle.targetHash,\n linkSetManifestHash: bundle.linkSetManifestHash,\n linkedContainerKeyEpochIds: targets.map(\n (target) => target.containerKeyEpochId,\n ),\n linkedContainerManifestHashes: targets.map(\n (target) => target.containerManifestHash,\n ),\n targets,\n };\n}\n\nexport function isDocumentKekTargetsResponse(\n value: unknown,\n): value is DocumentKekTargetsResponse {\n return DocumentKekTargetsResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentContentKeyBundleResponse(\n value: unknown,\n): value is DocumentContentKeyBundleResponse {\n return DocumentContentKeyBundleResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentCreateResponse(\n value: unknown,\n): value is DocumentCreateResponse {\n return DocumentCreateResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentLinkSetMutationResponse(\n value: unknown,\n): value is DocumentLinkSetMutationResponse {\n return DocumentLinkSetMutationResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeResponse(\n value: unknown,\n): value is DocumentPurgeResponse {\n return DocumentPurgeResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeProofResponse(\n value: unknown,\n): value is DocumentPurgeProofResponse {\n return DocumentPurgeProofResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentSyncResponse(\n value: unknown,\n): value is DocumentSyncResponse {\n return DocumentSyncResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentWriterProjectionResponse(\n value: unknown,\n): value is DocumentWriterProjectionResponse {\n return DocumentWriterProjectionResponseSchema.safeParse(value).success;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"documentMutation.js","sourceRoot":"","sources":["documentMutation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mCAAmC,EACnC,sCAAsC,GACvC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAEL,sCAAsC,EAEtC,gCAAgC,EAEhC,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sCAAsC,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EAEL,sCAAsC,EAEtC,8CAA8C,EAE9C,gCAAgC,EAEhC,kCAAkC,EAElC,0BAA0B,EAE1B,gCAAgC,GACjC,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;IAC3D,cAAc,EAAE,sCAAsC;IACtD,gBAAgB,EAAE,sCAAsC;IACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,kBAAkB,EAAE,gCAAgC;IACpD,EAAE,EAAE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AAO,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,KAAc;IAEd,OAAO,qCAAqC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAAc;IAEd,OAAO,2BAA2B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,KAAc;IAEd,OAAO,gCAAgC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,0BAA0B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAc;IAEd,OAAO,sCAAsC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACzE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyArraySchema,\n nonEmptyStringSchema,\n} from \"../schema\";\nimport {\n AccessEventBundleWireResponseSchema,\n AccessManifestBundleWireResponseSchema,\n} from \"../util\";\nimport { ProjectionHistoryPrefixesSchema } from \"../util/projectionHistoryWire\";\nimport { ContainerKeyingPathResponseSchema } from \"./container\";\nimport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n} from \"./documentSyncSchema\";\nimport { ProjectionPolicyEvidenceResponseSchema } from \"./projectionPolicyEvidence\";\n\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n} from \"./documentSyncSchema\";\n\nexport const DocumentCreateResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n createdAt: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentCreateResponse = z.infer<\n typeof DocumentCreateResponseSchema\n>;\n\nexport const DocumentLinkSetMutationResponseSchema = loosePlainObject({\n accessManifest: AccessManifestBundleWireResponseSchema,\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n documentKekTargets: DocumentKekTargetsResponseSchema,\n id: z.string(),\n});\n\nexport type DocumentLinkSetMutationResponse = z.infer<\n typeof DocumentLinkSetMutationResponseSchema\n>;\n\nconst documentPurgeProofShape = {\n authorizingContainerPath: nonEmptyArraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: nonEmptyStringSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestPredecessors: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n purgeEvent: AccessEventBundleWireResponseSchema,\n purgedAt: nonEmptyStringSchema,\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n} as const;\n\nexport const DocumentPurgeProofResponseSchema = loosePlainObject(\n documentPurgeProofShape,\n);\n\nexport type DocumentPurgeProofResponse = z.infer<\n typeof DocumentPurgeProofResponseSchema\n>;\n\nexport const DocumentPurgeResponseSchema = loosePlainObject({\n ...documentPurgeProofShape,\n reclaimedBlobStorageKeys: arraySchema(z.string()),\n});\n\nexport type DocumentPurgeResponse = z.infer<typeof DocumentPurgeResponseSchema>;\n\nexport const DocumentWriterProjectionResponseSchema = loosePlainObject({\n historyPrefixes: ProjectionHistoryPrefixesSchema.optional(),\n policyEvidence: ProjectionPolicyEvidenceResponseSchema,\n authorizingContainerPaths: nonEmptyArraySchema(\n ContainerKeyingPathResponseSchema,\n ),\n contentKeyBundle: DocumentContentKeyBundleResponseSchema,\n /** Present only when the stored content-key bundle targets stale KEKs. */\n contentKeyBundleStale: z.literal(true).optional(),\n documentContainerManifestHistory: arraySchema(\n AccessManifestBundleWireResponseSchema,\n ),\n documentId: z.string(),\n documentKekTargets: DocumentKekTargetsResponseSchema,\n documentManifest: AccessManifestBundleWireResponseSchema,\n documentManifestContainerPaths: arraySchema(\n arraySchema(AccessManifestBundleWireResponseSchema),\n ),\n documentManifestHistory: arraySchema(AccessManifestBundleWireResponseSchema),\n});\n\nexport type DocumentWriterProjectionResponse = z.infer<\n typeof DocumentWriterProjectionResponseSchema\n>;\n\n/**\n * Derives the KEK-target summary that corresponds to a content-key bundle,\n * preserving the bundle's served target order. Both the API (for stale-bundle\n * read-only sync responses) and clients (for plans built against a stale\n * bundle) must derive this identically so response/plan state comparisons\n * hold byte-for-byte.\n */\nexport function documentKekTargetsFromContentKeyBundle(\n bundle: DocumentContentKeyBundleResponse,\n): DocumentKekTargetsResponse {\n const targets = bundle.targets.map((target) => ({\n containerId: target.containerId,\n containerManifestHash: target.containerManifestHash,\n containerKeyEpochId: target.containerKeyEpochId,\n containerKeyEpoch: target.containerKeyEpoch,\n }));\n\n return {\n documentId: bundle.documentId,\n documentKeyTargetHash: bundle.targetHash,\n linkSetManifestHash: bundle.linkSetManifestHash,\n linkedContainerKeyEpochIds: targets.map(\n (target) => target.containerKeyEpochId,\n ),\n linkedContainerManifestHashes: targets.map(\n (target) => target.containerManifestHash,\n ),\n targets,\n };\n}\n\nexport function isDocumentKekTargetsResponse(\n value: unknown,\n): value is DocumentKekTargetsResponse {\n return DocumentKekTargetsResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentContentKeyBundleResponse(\n value: unknown,\n): value is DocumentContentKeyBundleResponse {\n return DocumentContentKeyBundleResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentCreateResponse(\n value: unknown,\n): value is DocumentCreateResponse {\n return DocumentCreateResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentLinkSetMutationResponse(\n value: unknown,\n): value is DocumentLinkSetMutationResponse {\n return DocumentLinkSetMutationResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeResponse(\n value: unknown,\n): value is DocumentPurgeResponse {\n return DocumentPurgeResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentPurgeProofResponse(\n value: unknown,\n): value is DocumentPurgeProofResponse {\n return DocumentPurgeProofResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentSyncResponse(\n value: unknown,\n): value is DocumentSyncResponse {\n return DocumentSyncResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentWriterProjectionResponse(\n value: unknown,\n): value is DocumentWriterProjectionResponse {\n return DocumentWriterProjectionResponseSchema.safeParse(value).success;\n}\n"]}
|
|
@@ -12,419 +12,39 @@ export declare function isDocumentSyncErrorCode(value: unknown): value is Docume
|
|
|
12
12
|
export declare const DocumentSyncStateStaleErrorResponseSchema: z.ZodObject<{
|
|
13
13
|
code: z.ZodLiteral<"document_sync_state_stale">;
|
|
14
14
|
error: z.ZodString;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
role: "member" | "admin";
|
|
23
|
-
userId: string;
|
|
24
|
-
}[];
|
|
25
|
-
state: {
|
|
26
|
-
createdAt: string;
|
|
27
|
-
encapsulationPublicKey: string;
|
|
28
|
-
externalAuthority: {
|
|
29
|
-
keyEpoch: number;
|
|
30
|
-
keyFingerprint: string;
|
|
31
|
-
principalId: string;
|
|
32
|
-
principalType: "group";
|
|
33
|
-
stateHash: string;
|
|
34
|
-
version: number;
|
|
35
|
-
} | null;
|
|
36
|
-
grantCount: number;
|
|
37
|
-
grantRoot: string;
|
|
38
|
-
keyEpoch: number;
|
|
39
|
-
keyFingerprint: string;
|
|
40
|
-
memberCount: number;
|
|
41
|
-
memberEnvelopesRoot: string;
|
|
42
|
-
membershipMode: "projection";
|
|
43
|
-
membershipRoot: string;
|
|
44
|
-
payloadCiphertextHash: string;
|
|
45
|
-
prevStateHash: string | null;
|
|
46
|
-
principalId: string;
|
|
47
|
-
principalType: "group" | "organization";
|
|
48
|
-
projectionRoot: string;
|
|
49
|
-
signature: string;
|
|
50
|
-
signedAt: string;
|
|
51
|
-
signerUserId: string;
|
|
52
|
-
signerUserKeyFingerprint: string;
|
|
53
|
-
stateHash: string;
|
|
54
|
-
version: number;
|
|
55
|
-
};
|
|
56
|
-
}[];
|
|
57
|
-
currentGrants: {
|
|
58
|
-
accessLevel: "admin" | "read" | "write";
|
|
59
|
-
containerId: string;
|
|
60
|
-
}[];
|
|
61
|
-
currentMemberEnvelopes: {
|
|
62
|
-
envelopes: {
|
|
63
|
-
kemCipherText: string;
|
|
64
|
-
memberKeyFingerprint: string;
|
|
65
|
-
userId: string;
|
|
66
|
-
wrappedKey: string;
|
|
67
|
-
}[];
|
|
68
|
-
epoch: number;
|
|
69
|
-
principalId: string;
|
|
70
|
-
principalType: "group" | "organization";
|
|
71
|
-
stateHash: string;
|
|
72
|
-
};
|
|
73
|
-
currentPayload: {
|
|
74
|
-
cipherSuite: "aes-256-gcm";
|
|
75
|
-
ciphertext: string;
|
|
76
|
-
ciphertextHash: string;
|
|
77
|
-
createdAt: string;
|
|
78
|
-
principalId: string;
|
|
79
|
-
principalType: "group" | "organization";
|
|
80
|
-
stateHash: string;
|
|
81
|
-
};
|
|
82
|
-
currentProjection: {
|
|
83
|
-
role: "member" | "admin";
|
|
84
|
-
userId: string;
|
|
85
|
-
}[];
|
|
86
|
-
currentState: {
|
|
87
|
-
createdAt: string;
|
|
88
|
-
encapsulationPublicKey: string;
|
|
89
|
-
externalAuthority: {
|
|
90
|
-
keyEpoch: number;
|
|
91
|
-
keyFingerprint: string;
|
|
92
|
-
principalId: string;
|
|
93
|
-
principalType: "group";
|
|
94
|
-
stateHash: string;
|
|
95
|
-
version: number;
|
|
96
|
-
} | null;
|
|
97
|
-
grantCount: number;
|
|
98
|
-
grantRoot: string;
|
|
99
|
-
keyEpoch: number;
|
|
100
|
-
keyFingerprint: string;
|
|
101
|
-
memberCount: number;
|
|
102
|
-
memberEnvelopesRoot: string;
|
|
103
|
-
membershipMode: "projection";
|
|
104
|
-
membershipRoot: string;
|
|
105
|
-
payloadCiphertextHash: string;
|
|
106
|
-
prevStateHash: string | null;
|
|
107
|
-
principalId: string;
|
|
108
|
-
principalType: "group" | "organization";
|
|
109
|
-
projectionRoot: string;
|
|
110
|
-
signature: string;
|
|
111
|
-
signedAt: string;
|
|
112
|
-
signerUserId: string;
|
|
113
|
-
signerUserKeyFingerprint: string;
|
|
114
|
-
stateHash: string;
|
|
115
|
-
version: number;
|
|
116
|
-
};
|
|
15
|
+
principalHeads: z.ZodOptional<z.ZodCustom<{
|
|
16
|
+
keyEpoch: number;
|
|
17
|
+
keyFingerprint: string;
|
|
18
|
+
principalId: string;
|
|
19
|
+
principalType: "group" | "organization";
|
|
20
|
+
stateHash: string;
|
|
21
|
+
version: number;
|
|
117
22
|
}[], {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
role: "member" | "admin";
|
|
125
|
-
userId: string;
|
|
126
|
-
}[];
|
|
127
|
-
state: {
|
|
128
|
-
createdAt: string;
|
|
129
|
-
encapsulationPublicKey: string;
|
|
130
|
-
externalAuthority: {
|
|
131
|
-
keyEpoch: number;
|
|
132
|
-
keyFingerprint: string;
|
|
133
|
-
principalId: string;
|
|
134
|
-
principalType: "group";
|
|
135
|
-
stateHash: string;
|
|
136
|
-
version: number;
|
|
137
|
-
} | null;
|
|
138
|
-
grantCount: number;
|
|
139
|
-
grantRoot: string;
|
|
140
|
-
keyEpoch: number;
|
|
141
|
-
keyFingerprint: string;
|
|
142
|
-
memberCount: number;
|
|
143
|
-
memberEnvelopesRoot: string;
|
|
144
|
-
membershipMode: "projection";
|
|
145
|
-
membershipRoot: string;
|
|
146
|
-
payloadCiphertextHash: string;
|
|
147
|
-
prevStateHash: string | null;
|
|
148
|
-
principalId: string;
|
|
149
|
-
principalType: "group" | "organization";
|
|
150
|
-
projectionRoot: string;
|
|
151
|
-
signature: string;
|
|
152
|
-
signedAt: string;
|
|
153
|
-
signerUserId: string;
|
|
154
|
-
signerUserKeyFingerprint: string;
|
|
155
|
-
stateHash: string;
|
|
156
|
-
version: number;
|
|
157
|
-
};
|
|
158
|
-
}[];
|
|
159
|
-
currentGrants: {
|
|
160
|
-
accessLevel: "admin" | "read" | "write";
|
|
161
|
-
containerId: string;
|
|
162
|
-
}[];
|
|
163
|
-
currentMemberEnvelopes: {
|
|
164
|
-
envelopes: {
|
|
165
|
-
kemCipherText: string;
|
|
166
|
-
memberKeyFingerprint: string;
|
|
167
|
-
userId: string;
|
|
168
|
-
wrappedKey: string;
|
|
169
|
-
}[];
|
|
170
|
-
epoch: number;
|
|
171
|
-
principalId: string;
|
|
172
|
-
principalType: "group" | "organization";
|
|
173
|
-
stateHash: string;
|
|
174
|
-
};
|
|
175
|
-
currentPayload: {
|
|
176
|
-
cipherSuite: "aes-256-gcm";
|
|
177
|
-
ciphertext: string;
|
|
178
|
-
ciphertextHash: string;
|
|
179
|
-
createdAt: string;
|
|
180
|
-
principalId: string;
|
|
181
|
-
principalType: "group" | "organization";
|
|
182
|
-
stateHash: string;
|
|
183
|
-
};
|
|
184
|
-
currentProjection: {
|
|
185
|
-
role: "member" | "admin";
|
|
186
|
-
userId: string;
|
|
187
|
-
}[];
|
|
188
|
-
currentState: {
|
|
189
|
-
createdAt: string;
|
|
190
|
-
encapsulationPublicKey: string;
|
|
191
|
-
externalAuthority: {
|
|
192
|
-
keyEpoch: number;
|
|
193
|
-
keyFingerprint: string;
|
|
194
|
-
principalId: string;
|
|
195
|
-
principalType: "group";
|
|
196
|
-
stateHash: string;
|
|
197
|
-
version: number;
|
|
198
|
-
} | null;
|
|
199
|
-
grantCount: number;
|
|
200
|
-
grantRoot: string;
|
|
201
|
-
keyEpoch: number;
|
|
202
|
-
keyFingerprint: string;
|
|
203
|
-
memberCount: number;
|
|
204
|
-
memberEnvelopesRoot: string;
|
|
205
|
-
membershipMode: "projection";
|
|
206
|
-
membershipRoot: string;
|
|
207
|
-
payloadCiphertextHash: string;
|
|
208
|
-
prevStateHash: string | null;
|
|
209
|
-
principalId: string;
|
|
210
|
-
principalType: "group" | "organization";
|
|
211
|
-
projectionRoot: string;
|
|
212
|
-
signature: string;
|
|
213
|
-
signedAt: string;
|
|
214
|
-
signerUserId: string;
|
|
215
|
-
signerUserKeyFingerprint: string;
|
|
216
|
-
stateHash: string;
|
|
217
|
-
version: number;
|
|
218
|
-
};
|
|
23
|
+
keyEpoch: number;
|
|
24
|
+
keyFingerprint: string;
|
|
25
|
+
principalId: string;
|
|
26
|
+
principalType: "group" | "organization";
|
|
27
|
+
stateHash: string;
|
|
28
|
+
version: number;
|
|
219
29
|
}[]>>;
|
|
220
30
|
}, z.core.$loose>;
|
|
221
31
|
export declare const DocumentSyncErrorResponseSchema: z.ZodObject<{
|
|
222
32
|
code: z.ZodLiteral<"document_sync_checkpoint_coverage_conflict" | "document_sync_conflict" | "document_sync_descendant_rekeys_required" | "document_sync_state_stale" | "document_sync_update_id_conflict">;
|
|
223
33
|
error: z.ZodString;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
role: "member" | "admin";
|
|
232
|
-
userId: string;
|
|
233
|
-
}[];
|
|
234
|
-
state: {
|
|
235
|
-
createdAt: string;
|
|
236
|
-
encapsulationPublicKey: string;
|
|
237
|
-
externalAuthority: {
|
|
238
|
-
keyEpoch: number;
|
|
239
|
-
keyFingerprint: string;
|
|
240
|
-
principalId: string;
|
|
241
|
-
principalType: "group";
|
|
242
|
-
stateHash: string;
|
|
243
|
-
version: number;
|
|
244
|
-
} | null;
|
|
245
|
-
grantCount: number;
|
|
246
|
-
grantRoot: string;
|
|
247
|
-
keyEpoch: number;
|
|
248
|
-
keyFingerprint: string;
|
|
249
|
-
memberCount: number;
|
|
250
|
-
memberEnvelopesRoot: string;
|
|
251
|
-
membershipMode: "projection";
|
|
252
|
-
membershipRoot: string;
|
|
253
|
-
payloadCiphertextHash: string;
|
|
254
|
-
prevStateHash: string | null;
|
|
255
|
-
principalId: string;
|
|
256
|
-
principalType: "group" | "organization";
|
|
257
|
-
projectionRoot: string;
|
|
258
|
-
signature: string;
|
|
259
|
-
signedAt: string;
|
|
260
|
-
signerUserId: string;
|
|
261
|
-
signerUserKeyFingerprint: string;
|
|
262
|
-
stateHash: string;
|
|
263
|
-
version: number;
|
|
264
|
-
};
|
|
265
|
-
}[];
|
|
266
|
-
currentGrants: {
|
|
267
|
-
accessLevel: "admin" | "read" | "write";
|
|
268
|
-
containerId: string;
|
|
269
|
-
}[];
|
|
270
|
-
currentMemberEnvelopes: {
|
|
271
|
-
envelopes: {
|
|
272
|
-
kemCipherText: string;
|
|
273
|
-
memberKeyFingerprint: string;
|
|
274
|
-
userId: string;
|
|
275
|
-
wrappedKey: string;
|
|
276
|
-
}[];
|
|
277
|
-
epoch: number;
|
|
278
|
-
principalId: string;
|
|
279
|
-
principalType: "group" | "organization";
|
|
280
|
-
stateHash: string;
|
|
281
|
-
};
|
|
282
|
-
currentPayload: {
|
|
283
|
-
cipherSuite: "aes-256-gcm";
|
|
284
|
-
ciphertext: string;
|
|
285
|
-
ciphertextHash: string;
|
|
286
|
-
createdAt: string;
|
|
287
|
-
principalId: string;
|
|
288
|
-
principalType: "group" | "organization";
|
|
289
|
-
stateHash: string;
|
|
290
|
-
};
|
|
291
|
-
currentProjection: {
|
|
292
|
-
role: "member" | "admin";
|
|
293
|
-
userId: string;
|
|
294
|
-
}[];
|
|
295
|
-
currentState: {
|
|
296
|
-
createdAt: string;
|
|
297
|
-
encapsulationPublicKey: string;
|
|
298
|
-
externalAuthority: {
|
|
299
|
-
keyEpoch: number;
|
|
300
|
-
keyFingerprint: string;
|
|
301
|
-
principalId: string;
|
|
302
|
-
principalType: "group";
|
|
303
|
-
stateHash: string;
|
|
304
|
-
version: number;
|
|
305
|
-
} | null;
|
|
306
|
-
grantCount: number;
|
|
307
|
-
grantRoot: string;
|
|
308
|
-
keyEpoch: number;
|
|
309
|
-
keyFingerprint: string;
|
|
310
|
-
memberCount: number;
|
|
311
|
-
memberEnvelopesRoot: string;
|
|
312
|
-
membershipMode: "projection";
|
|
313
|
-
membershipRoot: string;
|
|
314
|
-
payloadCiphertextHash: string;
|
|
315
|
-
prevStateHash: string | null;
|
|
316
|
-
principalId: string;
|
|
317
|
-
principalType: "group" | "organization";
|
|
318
|
-
projectionRoot: string;
|
|
319
|
-
signature: string;
|
|
320
|
-
signedAt: string;
|
|
321
|
-
signerUserId: string;
|
|
322
|
-
signerUserKeyFingerprint: string;
|
|
323
|
-
stateHash: string;
|
|
324
|
-
version: number;
|
|
325
|
-
};
|
|
34
|
+
principalHeads: z.ZodOptional<z.ZodCustom<{
|
|
35
|
+
keyEpoch: number;
|
|
36
|
+
keyFingerprint: string;
|
|
37
|
+
principalId: string;
|
|
38
|
+
principalType: "group" | "organization";
|
|
39
|
+
stateHash: string;
|
|
40
|
+
version: number;
|
|
326
41
|
}[], {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
role: "member" | "admin";
|
|
334
|
-
userId: string;
|
|
335
|
-
}[];
|
|
336
|
-
state: {
|
|
337
|
-
createdAt: string;
|
|
338
|
-
encapsulationPublicKey: string;
|
|
339
|
-
externalAuthority: {
|
|
340
|
-
keyEpoch: number;
|
|
341
|
-
keyFingerprint: string;
|
|
342
|
-
principalId: string;
|
|
343
|
-
principalType: "group";
|
|
344
|
-
stateHash: string;
|
|
345
|
-
version: number;
|
|
346
|
-
} | null;
|
|
347
|
-
grantCount: number;
|
|
348
|
-
grantRoot: string;
|
|
349
|
-
keyEpoch: number;
|
|
350
|
-
keyFingerprint: string;
|
|
351
|
-
memberCount: number;
|
|
352
|
-
memberEnvelopesRoot: string;
|
|
353
|
-
membershipMode: "projection";
|
|
354
|
-
membershipRoot: string;
|
|
355
|
-
payloadCiphertextHash: string;
|
|
356
|
-
prevStateHash: string | null;
|
|
357
|
-
principalId: string;
|
|
358
|
-
principalType: "group" | "organization";
|
|
359
|
-
projectionRoot: string;
|
|
360
|
-
signature: string;
|
|
361
|
-
signedAt: string;
|
|
362
|
-
signerUserId: string;
|
|
363
|
-
signerUserKeyFingerprint: string;
|
|
364
|
-
stateHash: string;
|
|
365
|
-
version: number;
|
|
366
|
-
};
|
|
367
|
-
}[];
|
|
368
|
-
currentGrants: {
|
|
369
|
-
accessLevel: "admin" | "read" | "write";
|
|
370
|
-
containerId: string;
|
|
371
|
-
}[];
|
|
372
|
-
currentMemberEnvelopes: {
|
|
373
|
-
envelopes: {
|
|
374
|
-
kemCipherText: string;
|
|
375
|
-
memberKeyFingerprint: string;
|
|
376
|
-
userId: string;
|
|
377
|
-
wrappedKey: string;
|
|
378
|
-
}[];
|
|
379
|
-
epoch: number;
|
|
380
|
-
principalId: string;
|
|
381
|
-
principalType: "group" | "organization";
|
|
382
|
-
stateHash: string;
|
|
383
|
-
};
|
|
384
|
-
currentPayload: {
|
|
385
|
-
cipherSuite: "aes-256-gcm";
|
|
386
|
-
ciphertext: string;
|
|
387
|
-
ciphertextHash: string;
|
|
388
|
-
createdAt: string;
|
|
389
|
-
principalId: string;
|
|
390
|
-
principalType: "group" | "organization";
|
|
391
|
-
stateHash: string;
|
|
392
|
-
};
|
|
393
|
-
currentProjection: {
|
|
394
|
-
role: "member" | "admin";
|
|
395
|
-
userId: string;
|
|
396
|
-
}[];
|
|
397
|
-
currentState: {
|
|
398
|
-
createdAt: string;
|
|
399
|
-
encapsulationPublicKey: string;
|
|
400
|
-
externalAuthority: {
|
|
401
|
-
keyEpoch: number;
|
|
402
|
-
keyFingerprint: string;
|
|
403
|
-
principalId: string;
|
|
404
|
-
principalType: "group";
|
|
405
|
-
stateHash: string;
|
|
406
|
-
version: number;
|
|
407
|
-
} | null;
|
|
408
|
-
grantCount: number;
|
|
409
|
-
grantRoot: string;
|
|
410
|
-
keyEpoch: number;
|
|
411
|
-
keyFingerprint: string;
|
|
412
|
-
memberCount: number;
|
|
413
|
-
memberEnvelopesRoot: string;
|
|
414
|
-
membershipMode: "projection";
|
|
415
|
-
membershipRoot: string;
|
|
416
|
-
payloadCiphertextHash: string;
|
|
417
|
-
prevStateHash: string | null;
|
|
418
|
-
principalId: string;
|
|
419
|
-
principalType: "group" | "organization";
|
|
420
|
-
projectionRoot: string;
|
|
421
|
-
signature: string;
|
|
422
|
-
signedAt: string;
|
|
423
|
-
signerUserId: string;
|
|
424
|
-
signerUserKeyFingerprint: string;
|
|
425
|
-
stateHash: string;
|
|
426
|
-
version: number;
|
|
427
|
-
};
|
|
42
|
+
keyEpoch: number;
|
|
43
|
+
keyFingerprint: string;
|
|
44
|
+
principalId: string;
|
|
45
|
+
principalType: "group" | "organization";
|
|
46
|
+
stateHash: string;
|
|
47
|
+
version: number;
|
|
428
48
|
}[]>>;
|
|
429
49
|
}, z.core.$loose>;
|
|
430
50
|
export type DocumentSyncErrorResponse = z.infer<typeof DocumentSyncErrorResponseSchema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { arraySchema } from "../schema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT } from "../util/principalHistoryWire.js";
|
|
4
|
+
import { ReferencedPrincipalStateResponseSchema } from "./principalReference.js";
|
|
4
5
|
export const DOCUMENT_SYNC_ERROR_CODES = {
|
|
5
6
|
checkpointCoverageConflict: "document_sync_checkpoint_coverage_conflict",
|
|
6
7
|
conflict: "document_sync_conflict",
|
|
@@ -24,12 +25,12 @@ export function isDocumentSyncErrorCode(value) {
|
|
|
24
25
|
export const DocumentSyncStateStaleErrorResponseSchema = z.looseObject({
|
|
25
26
|
code: z.literal(DOCUMENT_SYNC_ERROR_CODES.stateStale),
|
|
26
27
|
error: z.string().min(1),
|
|
27
|
-
|
|
28
|
+
principalHeads: arraySchema(ReferencedPrincipalStateResponseSchema, PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT).optional(),
|
|
28
29
|
});
|
|
29
30
|
export const DocumentSyncErrorResponseSchema = z.looseObject({
|
|
30
31
|
code: DocumentSyncErrorCodeSchema,
|
|
31
32
|
error: z.string().min(1),
|
|
32
|
-
|
|
33
|
+
principalHeads: arraySchema(ReferencedPrincipalStateResponseSchema, PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT).optional(),
|
|
33
34
|
});
|
|
34
35
|
export function isDocumentSyncErrorResponse(value) {
|
|
35
36
|
return DocumentSyncErrorResponseSchema.safeParse(value).success;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentSyncError.js","sourceRoot":"","sources":["documentSyncError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"documentSyncError.js","sourceRoot":"","sources":["documentSyncError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,kCAAkC,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAE9E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,0BAA0B,EAA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AAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { arraySchema } from \"../schema\";\nimport { PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT } from \"../util/principalHistoryWire\";\nimport { ReferencedPrincipalStateResponseSchema } from \"./principalReference\";\n\nexport const DOCUMENT_SYNC_ERROR_CODES = {\n checkpointCoverageConflict: \"document_sync_checkpoint_coverage_conflict\",\n conflict: \"document_sync_conflict\",\n // An inline container rekey would strand a level above a directly granted\n // container. The write rolled back; the client repairs those containers\n // standalone, where each rekey carries its own descendants, then retries.\n descendantRekeysRequired: \"document_sync_descendant_rekeys_required\",\n stateStale: \"document_sync_state_stale\",\n updateIdConflict: \"document_sync_update_id_conflict\",\n} as const;\n\nexport const DocumentSyncErrorCodeSchema = z.literal([\n DOCUMENT_SYNC_ERROR_CODES.checkpointCoverageConflict,\n DOCUMENT_SYNC_ERROR_CODES.conflict,\n DOCUMENT_SYNC_ERROR_CODES.descendantRekeysRequired,\n DOCUMENT_SYNC_ERROR_CODES.stateStale,\n DOCUMENT_SYNC_ERROR_CODES.updateIdConflict,\n]);\n\nexport type DocumentSyncErrorCode = z.infer<typeof DocumentSyncErrorCodeSchema>;\n\nexport function isDocumentSyncErrorCode(\n value: unknown,\n): value is DocumentSyncErrorCode {\n return DocumentSyncErrorCodeSchema.safeParse(value).success;\n}\n\nexport const DocumentSyncStateStaleErrorResponseSchema = z.looseObject({\n code: z.literal(DOCUMENT_SYNC_ERROR_CODES.stateStale),\n error: z.string().min(1),\n principalHeads: arraySchema(\n ReferencedPrincipalStateResponseSchema,\n PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT,\n ).optional(),\n});\n\nexport const DocumentSyncErrorResponseSchema = z.looseObject({\n code: DocumentSyncErrorCodeSchema,\n error: z.string().min(1),\n principalHeads: arraySchema(\n ReferencedPrincipalStateResponseSchema,\n PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT,\n ).optional(),\n});\n\nexport type DocumentSyncErrorResponse = z.infer<\n typeof DocumentSyncErrorResponseSchema\n>;\n\nexport function isDocumentSyncErrorResponse(\n value: unknown,\n): value is DocumentSyncErrorResponse {\n return DocumentSyncErrorResponseSchema.safeParse(value).success;\n}\n\nexport function isDocumentSyncStateStaleErrorResponse(\n value: unknown,\n): value is DocumentSyncStateStaleErrorResponse {\n return DocumentSyncStateStaleErrorResponseSchema.safeParse(value).success;\n}\n\nexport type DocumentSyncStateStaleErrorResponse = z.infer<\n typeof DocumentSyncStateStaleErrorResponseSchema\n>;\n\n/**\n * Positive server-verified \"this document does not exist\" signal. Clients run a\n * destructive local teardown when the upstream document is deleted, so that\n * action must never key off a bare HTTP 404 — proxy/tunnel error pages,\n * deploy-skew route misses, and container-level lookups all produce 404s that\n * say nothing about the document. Only the routes' genuine document-existence\n * checks emit this code.\n */\nexport const DOCUMENT_NOT_FOUND_ERROR_CODE = \"document_not_found\";\n\nexport type DocumentNotFoundErrorCode = typeof DOCUMENT_NOT_FOUND_ERROR_CODE;\n\nexport const DocumentNotFoundErrorResponseSchema = z.looseObject({\n code: z.literal(DOCUMENT_NOT_FOUND_ERROR_CODE),\n error: z.string().min(1),\n});\n\nexport type DocumentNotFoundErrorResponse = z.infer<\n typeof DocumentNotFoundErrorResponseSchema\n>;\n\n/**\n * Stable codes for document writer-projection failures that surface as 409s.\n * The route deliberately remaps container-level and dependency 404s to 409\n * (a document-route 404 triggers a destructive client wipe), which used to\n * collapse every origin into an uncoded conflict. These codes let a client\n * report WHICH dependency refused without parsing message text.\n */\nexport const DOCUMENT_PROJECTION_ERROR_CODES = {\n containerConflict: \"document_projection_container_conflict\",\n containerUnavailable: \"document_projection_container_unavailable\",\n contentKeyBundleMissing: \"document_projection_content_key_bundle_missing\",\n headMissing: \"document_projection_head_missing\",\n kekTargetsUnavailable: \"document_projection_kek_targets_unavailable\",\n stateInvalid: \"document_projection_state_invalid\",\n} as const;\n\nexport const DocumentProjectionErrorCodeSchema = z.literal([\n DOCUMENT_PROJECTION_ERROR_CODES.containerConflict,\n DOCUMENT_PROJECTION_ERROR_CODES.containerUnavailable,\n DOCUMENT_PROJECTION_ERROR_CODES.contentKeyBundleMissing,\n DOCUMENT_PROJECTION_ERROR_CODES.headMissing,\n DOCUMENT_PROJECTION_ERROR_CODES.kekTargetsUnavailable,\n DOCUMENT_PROJECTION_ERROR_CODES.stateInvalid,\n]);\n\nexport type DocumentProjectionErrorCode = z.infer<\n typeof DocumentProjectionErrorCodeSchema\n>;\n\n// Preserve the writer-projection route's existing sync-code surface. Rotation\n// checkpoint coverage is a document-sync submission concern and must not leak\n// into this read endpoint merely because both responses share this module.\nconst DocumentWriterProjectionSyncErrorCodeSchema = z.literal([\n DOCUMENT_SYNC_ERROR_CODES.conflict,\n DOCUMENT_SYNC_ERROR_CODES.stateStale,\n DOCUMENT_SYNC_ERROR_CODES.updateIdConflict,\n]);\n\nexport const DocumentWriterProjectionErrorResponseSchema = z.looseObject({\n code: z.union([\n DocumentProjectionErrorCodeSchema,\n DocumentWriterProjectionSyncErrorCodeSchema,\n ]),\n error: z.string().min(1),\n});\n\nexport type DocumentWriterProjectionErrorResponse = z.infer<\n typeof DocumentWriterProjectionErrorResponseSchema\n>;\n"]}
|
|
@@ -23,7 +23,7 @@ export { isOrganizationBillingHistoryResponse, type OrganizationBillingHistoryCa
|
|
|
23
23
|
export { isOrganizationBillingManagementUrlResponse, type OrganizationBillingManagementUrlResponse, OrganizationBillingManagementUrlResponseSchema, } from "./organizationBillingManagementUrl.js";
|
|
24
24
|
export { isOrganizationDataUsageResponse, ORGANIZATION_DOCUMENT_USAGE_CATEGORIES, type OrganizationBlobDataUsageResponse, type OrganizationDataUsageResponse, OrganizationDataUsageResponseSchema, type OrganizationDocumentDataUsageResponse, type OrganizationDocumentUsageCategory, type OrganizationDocumentUsageCategoryBreakdown, } from "./organizationDataUsage.js";
|
|
25
25
|
export { isOrganizationNativePurchaseEligibilityResponse, type OrganizationNativePurchaseEligibilityResponse, OrganizationNativePurchaseEligibilityResponseSchema, type OrganizationNativePurchaseIneligibilityReason, OrganizationNativePurchaseIneligibilityReasonSchema, } from "./organizationNativePurchaseEligibility.js";
|
|
26
|
-
export { type OrganizationPolicyHistoryResponse, OrganizationPolicyHistoryResponseSchema, } from "./organizationPolicyHistory.js";
|
|
26
|
+
export { type OrganizationPolicyHistoryResponse, OrganizationPolicyHistoryResponseSchema, PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE, } from "./organizationPolicyHistory.js";
|
|
27
27
|
export { ORGANIZATION_PRESENTATION_ERROR_CODES, type OrganizationPresentationErrorCode, OrganizationPresentationErrorCodeSchema, type OrganizationPresentationFailureResponse, OrganizationPresentationFailureResponseSchema, } from "./organizationPresentationError.js";
|
|
28
28
|
export { type CreateOrganizationResponse, CreateOrganizationResponseSchema, isCreateOrganizationResponse, isOrganizationProvisioningResponse, type OrganizationProvisioningResponse, OrganizationProvisioningResponseSchema, } from "./organizationProvisioning.js";
|
|
29
29
|
export { isOrganizationReadModelResponse, type OrganizationReadModelDeltaResponse, type OrganizationReadModelDirectoryResponse, type OrganizationReadModelGrantsResponse, type OrganizationReadModelGroupMembershipResponse, type OrganizationReadModelGroupMembershipsResponse, type OrganizationReadModelOrganizationPolicyResponse, type OrganizationReadModelResponse, OrganizationReadModelResponseSchema, type OrganizationReadModelSnapshotResponse, } from "./organizationReadModel.js";
|
|
@@ -23,7 +23,7 @@ export { isOrganizationBillingHistoryResponse, OrganizationBillingHistoryCategor
|
|
|
23
23
|
export { isOrganizationBillingManagementUrlResponse, OrganizationBillingManagementUrlResponseSchema, } from "./organizationBillingManagementUrl.js";
|
|
24
24
|
export { isOrganizationDataUsageResponse, ORGANIZATION_DOCUMENT_USAGE_CATEGORIES, OrganizationDataUsageResponseSchema, } from "./organizationDataUsage.js";
|
|
25
25
|
export { isOrganizationNativePurchaseEligibilityResponse, OrganizationNativePurchaseEligibilityResponseSchema, OrganizationNativePurchaseIneligibilityReasonSchema, } from "./organizationNativePurchaseEligibility.js";
|
|
26
|
-
export { OrganizationPolicyHistoryResponseSchema, } from "./organizationPolicyHistory.js";
|
|
26
|
+
export { OrganizationPolicyHistoryResponseSchema, PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE, } from "./organizationPolicyHistory.js";
|
|
27
27
|
export { ORGANIZATION_PRESENTATION_ERROR_CODES, OrganizationPresentationErrorCodeSchema, OrganizationPresentationFailureResponseSchema, } from "./organizationPresentationError.js";
|
|
28
28
|
export { CreateOrganizationResponseSchema, isCreateOrganizationResponse, isOrganizationProvisioningResponse, OrganizationProvisioningResponseSchema, } from "./organizationProvisioning.js";
|
|
29
29
|
export { isOrganizationReadModelResponse, OrganizationReadModelResponseSchema, } from "./organizationReadModel.js";
|