@tearleads/client-sdk 0.1.63 → 0.1.65
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/organizationAccessRestoration.js +1 -1
- package/data/containers/shared/mutationAcknowledgement.js +1 -1
- package/data/containers/shared/mutationAcknowledgement.js.map +1 -1
- package/data/documents/blob/shared/projection.js +4 -4
- package/data/documents/blob/shared/projection.js.map +1 -1
- package/data/documents/shared/containerKek/containerKekCurrency.d.ts +22 -0
- package/data/documents/shared/containerKek/containerKekEntryVerification.js +15 -0
- package/data/documents/shared/containerKek/containerKekLogFetch.d.ts +18 -0
- package/data/documents/shared/containerKek/containerKekLogFetch.js +76 -0
- package/data/documents/shared/containerKek/containerKekPath.js +265 -0
- package/data/documents/shared/containerKek/containerKekPath.js.map +1 -0
- package/data/documents/shared/containerKek/containerKekPathHistory.d.ts +61 -0
- package/data/documents/shared/containerKek/containerKekPathHistory.js +223 -0
- package/data/documents/shared/containerKek/containerKekPathHistory.js.map +1 -0
- package/data/documents/shared/containerKek/containerKekPathVerification.d.ts +15 -0
- package/data/documents/shared/containerKek/containerKekPathVerification.js +23 -0
- package/data/documents/shared/containerKek/containerKekPathVerification.js.map +1 -0
- package/data/documents/shared/containerKek/containerKekWrapping.js +61 -0
- package/data/documents/shared/containerKek/containerKekWrapping.js.map +1 -0
- package/data/documents/shared/containerKek/keyringLogWalk.d.ts +45 -0
- package/data/documents/shared/containerKek/keyringLogWalk.js +204 -0
- package/data/documents/shared/containerKek/keyringRebuild.d.ts +60 -0
- package/data/documents/shared/containerKek/keyringRebuild.js +242 -0
- package/data/documents/shared/containerKek/keyringRebuild.js.map +1 -0
- package/data/documents/shared/crypto.js +2 -2
- package/data/documents/shared/crypto.js.map +1 -1
- package/data/documents/shared/events.js +1 -1
- package/data/documents/shared/projection/index.d.ts +25 -0
- package/data/documents/shared/projection/index.js +132 -0
- package/data/documents/shared/projection/index.js.map +1 -0
- package/data/documents/shared/projection/projectionContentKeys.d.ts +90 -0
- package/data/documents/shared/projection/projectionContentKeys.js +262 -0
- package/data/documents/shared/projection/projectionContentKeys.js.map +1 -0
- package/data/documents/shared/projection/projectionTargets.d.ts +38 -0
- package/data/documents/shared/projection/projectionTargets.js +164 -0
- package/data/documents/shared/projection/projectionTargets.js.map +1 -0
- package/data/documents/shared/responses.d.ts +1 -1
- package/data/documents/shared/responses.js +1 -1
- package/data/documents/shared/responses.js.map +1 -1
- package/data/documents/shared/sync/documentSyncUpdateDecryption.js +238 -0
- package/data/documents/shared/sync/documentSyncUpdateDecryption.js.map +1 -0
- package/data/documents/shared/sync/documentSyncUpdateIsolation.d.ts +55 -0
- package/data/documents/shared/sync/documentSyncUpdateIsolation.js +298 -0
- package/data/documents/shared/sync/documentSyncUpdateIsolation.js.map +1 -0
- package/data/documents/shared/sync/mutationAcknowledgement.js +10 -0
- package/data/documents/shared/sync/mutationAcknowledgement.js.map +1 -0
- package/data/documents/shared/sync/pullContinuation.js +53 -0
- package/data/documents/shared/sync/syncPagination.d.ts +20 -0
- package/data/documents/shared/sync/syncPagination.js +109 -0
- package/data/documents/shared/sync/syncPagination.js.map +1 -0
- package/data/documents/shared/sync/syncResponseAuthorization.js +63 -0
- package/data/documents/shared/sync/syncResponseAuthorization.js.map +1 -0
- package/data/documents/shared/sync/syncResponses.d.ts +11 -0
- package/data/documents/shared/sync/syncResponses.js +285 -0
- package/data/documents/shared/sync/syncResponses.js.map +1 -0
- package/data/documents/shared/sync/syncSubmitFailure.d.ts +9 -0
- package/data/documents/shared/types.d.ts +3 -3
- package/data/documents/shared/types.js.map +1 -1
- package/data/keyingProjectionVerification/checkpoints/accessManifestCheckpointEnforcement.js +61 -0
- package/data/keyingProjectionVerification/checkpoints/accessManifestCheckpointEnforcement.js.map +1 -0
- package/data/keyingProjectionVerification/checkpoints/bundleVerification.js +61 -0
- package/data/keyingProjectionVerification/checkpoints/bundleVerification.js.map +1 -0
- package/data/keyingProjectionVerification/checkpoints/checkpointContext.d.ts +45 -0
- package/data/keyingProjectionVerification/checkpoints/checkpointContext.js +120 -0
- package/data/keyingProjectionVerification/checkpoints/checkpointContext.js.map +1 -0
- package/data/keyingProjectionVerification/checkpoints/manifestCheckpointVerification.js +64 -0
- package/data/keyingProjectionVerification/checkpoints/manifestCheckpointVerification.js.map +1 -0
- package/data/keyingProjectionVerification/container/containerAncestorCitations.js +164 -0
- package/data/keyingProjectionVerification/container/containerAncestorCitations.js.map +1 -0
- package/data/keyingProjectionVerification/container/containerCreateManifest.js +28 -0
- package/data/keyingProjectionVerification/container/containerDestinationVerification.js +51 -0
- package/data/keyingProjectionVerification/container/containerDestinationVerification.js.map +1 -0
- package/data/keyingProjectionVerification/container/containerManifestVerification.js +285 -0
- package/data/keyingProjectionVerification/container/containerManifestVerification.js.map +1 -0
- package/data/keyingProjectionVerification/container/containerPathVerification.js +51 -0
- package/data/keyingProjectionVerification/container/containerPathVerification.js.map +1 -0
- package/data/keyingProjectionVerification/container/containerProjectionVerification.d.ts +25 -0
- package/data/keyingProjectionVerification/container/containerProjectionVerification.js +254 -0
- package/data/keyingProjectionVerification/container/containerProjectionVerification.js.map +1 -0
- package/data/keyingProjectionVerification/document/documentDependencyPaths.d.ts +17 -0
- package/data/keyingProjectionVerification/document/documentDependencyPaths.js +70 -0
- package/data/keyingProjectionVerification/document/documentDependencyPaths.js.map +1 -0
- package/data/keyingProjectionVerification/document/documentManifestPolicies.js +32 -0
- package/data/keyingProjectionVerification/document/documentManifestPolicies.js.map +1 -0
- package/data/keyingProjectionVerification/document/documentManifestPredecessor.js +12 -0
- package/data/keyingProjectionVerification/document/documentManifestVerification.js +135 -0
- package/data/keyingProjectionVerification/document/documentManifestVerification.js.map +1 -0
- package/data/keyingProjectionVerification/document/documentProjectionVerification.d.ts +24 -0
- package/data/keyingProjectionVerification/document/documentProjectionVerification.js +172 -0
- package/data/keyingProjectionVerification/document/documentProjectionVerification.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeCheckpointCurrency.js +100 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeCheckpointCurrency.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeCheckpointEnforcement.js +8 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeCheckpointEnforcement.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeDocumentChainVerification.js +177 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeDocumentChainVerification.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgePolicyCheckpoints.js +17 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgePolicyCheckpoints.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgePolicyCurrency.js +55 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgePolicyCurrency.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgePrincipalEvidence.js +116 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgePrincipalEvidence.js.map +1 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeProofVerification.d.ts +34 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeProofVerification.js +208 -0
- package/data/keyingProjectionVerification/documentPurge/documentPurgeProofVerification.js.map +1 -0
- package/data/keyingProjectionVerification/index.d.ts +4 -4
- package/data/keyingProjectionVerification/index.js +4 -4
- package/data/keyingProjectionVerification/index.js.map +1 -1
- package/data/keyingProjectionVerification/principalPolicy/mergeProjectionPolicyEvidence.js +45 -0
- package/data/keyingProjectionVerification/principalPolicy/mergeProjectionPolicyEvidence.js.map +1 -0
- package/data/keyingProjectionVerification/principalPolicy/organizationFounderBinding.js +41 -0
- package/data/keyingProjectionVerification/principalPolicy/organizationFounderBinding.js.map +1 -0
- package/data/keyingProjectionVerification/principalPolicy/principalPolicyCache.js +76 -0
- package/data/keyingProjectionVerification/principalPolicy/principalPolicyCache.js.map +1 -0
- package/data/keyingProjectionVerification/principalPolicy/principalPolicyVerification.js +252 -0
- package/data/keyingProjectionVerification/principalPolicy/principalPolicyVerification.js.map +1 -0
- package/data/keyingProjectionVerification/principalPolicy/projectionAuthorizationEvidence.js +63 -0
- package/data/keyingProjectionVerification/principalPolicy/projectionAuthorizationEvidence.js.map +1 -0
- package/data/keyingProjectionVerification/principalPolicy/projectionPolicyEvidence.js +23 -0
- package/data/keyingProjectionVerification/principalPolicy/projectionPolicyEvidence.js.map +1 -0
- package/data/keyingProjectionVerification/principalPolicy/resolvedPrincipalPolicy.js +72 -0
- package/data/keyingProjectionVerification/principalPolicy/resolvedPrincipalPolicy.js.map +1 -0
- package/data/persistence/container-contents/containerContentsPersistence.js +3 -3
- package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerContentsPersistenceTypes.d.ts +2 -2
- package/data/persistence/container-contents/containerContentsPersistenceTypes.js.map +1 -1
- package/data/persistence/container-contents/containerCreateIntentSettlement.js +1 -1
- package/data/persistence/container-contents/containerDeletionPersistence.js +2 -2
- package/data/persistence/container-contents/containerDocumentReassignment.js +2 -2
- package/data/persistence/container-contents/containerDocumentReassignment.js.map +1 -1
- package/data/persistence/container-contents/containerHydrationPersistence.js +3 -3
- package/data/persistence/container-contents/containerHydrationPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerIntentPersistence.js +1 -1
- package/data/persistence/container-contents/containerMetadataMutationPersistence.js +5 -5
- package/data/persistence/container-contents/containerMetadataMutationPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerMetadataPullContinuationPersistence.js +1 -1
- package/data/persistence/container-contents/containerMetadataRows.js +3 -3
- package/data/persistence/container-contents/containerMetadataRows.js.map +1 -1
- package/data/persistence/container-contents/containerMoveAbandonPersistence.js +1 -1
- package/data/persistence/container-contents/containerMoveIntentRows.js +1 -1
- package/data/persistence/container-contents/containerPendingUpdatePersistence.js +3 -3
- package/data/persistence/container-contents/containerPendingUpdatePersistence.js.map +1 -1
- package/data/persistence/container-contents/containerRebindPersistence.js +1 -1
- package/data/persistence/container-contents/containerReconcilePersistence.js +2 -2
- package/data/persistence/container-contents/containerRecoveryPersistence.js +1 -1
- package/data/persistence/container-contents/containerRemovalWork.js +3 -3
- package/data/persistence/container-contents/containerRemovalWork.js.map +1 -1
- package/data/persistence/container-contents/containerStructuralRepair.js +1 -1
- package/data/persistence/container-contents/documentLinkRemovalRepair.js +2 -2
- package/data/persistence/container-contents/documentLinkRemovalRepair.js.map +1 -1
- package/data/persistence/container-contents/documentMoveIntentPersistence.js +2 -2
- package/data/persistence/container-contents/documentMoveIntentPersistence.js.map +1 -1
- package/data/persistence/container-contents/documentPlacementIntentEnqueue.js +2 -2
- package/data/persistence/container-contents/documentPlacementIntentEnqueue.js.map +1 -1
- package/data/persistence/container-contents/documentPurgePlacement.js +1 -1
- package/data/persistence/container-contents/dormantContainerMetadata.js +1 -1
- package/data/persistence/container-contents/dormantMetadataSweep.js +1 -1
- package/data/persistence/container-contents/pendingContainerCreate.js +1 -1
- package/data/persistence/container-contents/supersededContainerBindings.js +1 -1
- package/data/persistence/containers/containerPersistence.js +1 -1
- package/data/persistence/containers/containerSyncWatermarkPersistence.js +1 -1
- package/data/persistence/containers/documentContainerProjectionPersistence.js +1 -1
- package/data/persistence/containers/documentPlacement.js +1 -1
- package/data/persistence/documents/containerDocumentTombstoneHoldsPersistence.js +1 -1
- package/data/persistence/documents/documentDiscoveryEvidencePersistence.js +3 -3
- package/data/persistence/documents/documentDiscoveryEvidencePersistence.js.map +1 -1
- package/data/persistence/documents/documentDiscoveryReset.js +1 -1
- package/data/persistence/documents/documentDiscoveryReset.js.map +1 -1
- package/data/persistence/documents/documentsPersistence.js +3 -3
- package/data/persistence/documents/documentsPersistence.js.map +1 -1
- package/data/persistence/documents/internal/attachmentStagingPersistence.js +1 -1
- package/data/persistence/documents/internal/containerDocumentTombstoneHolds.js +1 -1
- package/data/persistence/documents/internal/containerDocumentTombstones.js +1 -1
- package/data/persistence/documents/internal/createDocumentWithHistoryCheckpoint.js +2 -2
- package/data/persistence/documents/internal/createDocumentWithHistoryCheckpoint.js.map +1 -1
- package/data/persistence/documents/internal/discardDocument.js +3 -3
- package/data/persistence/documents/internal/discardDocument.js.map +1 -1
- package/data/persistence/documents/internal/documentDeletionPersistence.js +4 -4
- package/data/persistence/documents/internal/documentDeletionPersistence.js.map +1 -1
- package/data/persistence/documents/internal/documentMutationPersistence.js +5 -5
- package/data/persistence/documents/internal/documentMutationPersistence.js.map +1 -1
- package/data/persistence/documents/internal/documentProjectionRows.js +1 -1
- package/data/persistence/documents/internal/documentPullContinuationPersistence.js +1 -1
- package/data/persistence/documents/internal/documentRows.js +2 -2
- package/data/persistence/documents/internal/documentRows.js.map +1 -1
- package/data/persistence/documents/internal/documentSummaryQueries.js +1 -1
- package/data/persistence/documents/internal/ensureDocumentsSchema.js +2 -2
- package/data/persistence/documents/internal/hydratedAttachmentPersistence.js +1 -1
- package/data/persistence/documents/internal/orphanSideRows.js +2 -2
- package/data/persistence/documents/internal/orphanSideRows.js.map +1 -1
- package/data/persistence/documents/internal/pendingCreateAdoption.js +1 -1
- package/data/persistence/documents/internal/rowQueryPersistence.js +2 -2
- package/data/persistence/documents/internal/syncQueuePersistence.js +3 -3
- package/data/persistence/documents/internal/syncQueuePersistence.js.map +1 -1
- package/data/persistence/documents/types.d.ts +3 -3
- package/data/persistence/documents/types.js.map +1 -1
- package/data/persistence/keyingCheckpoints/documentPurgeCheckpointPersistence.d.ts +10 -0
- package/data/persistence/keyingCheckpoints/documentPurgeCheckpointPersistence.js +43 -0
- package/data/persistence/keyingCheckpoints/documentPurgeCheckpointPersistence.js.map +1 -0
- package/data/persistence/keyingCheckpoints/keyingCheckpointAdvancePersistence.js +222 -0
- package/data/persistence/keyingCheckpoints/keyingCheckpointAdvancePersistence.js.map +1 -0
- package/data/persistence/keyingCheckpoints/keyingCheckpointEvidence.js +32 -0
- package/data/persistence/keyingCheckpoints/keyingCheckpointPersistence.js +133 -0
- package/data/persistence/keyingCheckpoints/keyingCheckpointPersistence.js.map +1 -0
- package/data/persistence/keyingCheckpoints/locallyAcknowledgedCheckpointPersistence.d.ts +53 -0
- package/data/persistence/keyingCheckpoints/locallyAcknowledgedCheckpointPersistence.js +167 -0
- package/data/persistence/keyingCheckpoints/locallyAcknowledgedCheckpointPersistence.js.map +1 -0
- package/data/persistence/keyingCheckpoints/organizationReplacementCheckpointPersistence.js +72 -0
- package/data/persistence/keyingCheckpoints/organizationReplacementCheckpointPersistence.js.map +1 -0
- package/data/persistence/keyingCheckpoints/principalAuthorizationCheckpoints.js +29 -0
- package/data/persistence/keyingCheckpoints/principalAuthorizationCheckpoints.js.map +1 -0
- package/data/persistence/organizationFounderPersistence.js +2 -2
- package/data/persistence/organizationFounderPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationAccessRevocationPersistence.js +3 -3
- package/data/persistence/organizations/organizationAccessRevocationPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationDataUsagePersistence.js +2 -2
- package/data/persistence/organizations/organizationDataUsagePersistence.js.map +1 -1
- package/data/persistence/organizations/organizationGroupNamePersistence.js +2 -2
- package/data/persistence/organizations/organizationGroupNamePersistence.js.map +1 -1
- package/data/persistence/organizations/organizationPresentationDenialPersistence.js +2 -2
- package/data/persistence/organizations/organizationPresentationDenialPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationProfileDocumentPointers.js +2 -2
- package/data/persistence/organizations/organizationProfileDocumentPointers.js.map +1 -1
- package/data/persistence/organizations/organizationProvisioningAttemptPersistence.js +1 -1
- package/data/persistence/organizations/organizationProvisioningAttemptPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelGrantPersistence.js +1 -1
- package/data/persistence/organizations/organizationReadModelGrantPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelMemberLoad.js +1 -1
- package/data/persistence/organizations/organizationReadModelMemberLoad.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelMembershipPersistence.js +1 -1
- package/data/persistence/organizations/organizationReadModelMembershipPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelPersistence.js +3 -3
- package/data/persistence/organizations/organizationReadModelPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelProjection.js +1 -1
- package/data/persistence/organizations/organizationReadModelProjection.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelPurge.js +3 -3
- package/data/persistence/organizations/organizationReadModelPurge.js.map +1 -1
- package/data/persistence/principalCurrentAcknowledgementPersistence.d.ts +3 -3
- package/data/persistence/principalCurrentAcknowledgementPersistence.js +10 -10
- package/data/persistence/principalCurrentAcknowledgementPersistence.js.map +1 -1
- package/data/persistence/principalHistory/principalHistoryEvidencePersistence.d.ts +32 -0
- package/data/persistence/principalHistory/principalHistoryEvidencePersistence.js +92 -0
- package/data/persistence/principalHistory/principalHistoryEvidencePersistence.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryIncompleteRetention.js +26 -0
- package/data/persistence/principalHistory/principalHistoryIncompleteRetention.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryNodeRetention.js +201 -0
- package/data/persistence/principalHistory/principalHistoryNodeRetention.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryPrefixPersistence.d.ts +29 -0
- package/data/persistence/principalHistory/principalHistoryPrefixPersistence.js +102 -0
- package/data/persistence/principalHistory/principalHistoryPrefixPersistence.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryRootOwnership.js +71 -0
- package/data/persistence/principalHistory/principalHistoryRootOwnership.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryStagePersistence.d.ts +15 -0
- package/data/persistence/principalHistory/principalHistoryStagePersistence.js +96 -0
- package/data/persistence/principalHistory/principalHistoryStagePersistence.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryStageRetention.js +45 -0
- package/data/persistence/principalHistory/principalHistoryStageRetention.js.map +1 -0
- package/data/persistence/principalHistory/principalHistoryUnpublishedRetention.js +64 -0
- package/data/persistence/principalHistory/principalHistoryUnpublishedRetention.js.map +1 -0
- package/data/persistence/principalKeys/principalGrantRetirementPersistence.d.ts +9 -0
- package/data/persistence/principalKeys/principalGrantRetirementPersistence.js +43 -0
- package/data/persistence/principalKeys/principalGrantRetirementPersistence.js.map +1 -0
- package/data/persistence/principalKeys/principalKeyEnvelopeArchivePersistence.js +63 -0
- package/data/persistence/principalKeys/principalKeyEnvelopeArchivePersistence.js.map +1 -0
- package/data/persistence/principalKeys/principalKeyEnvelopeCandidates.js +87 -0
- package/data/persistence/principalKeys/principalKeyEnvelopeCandidates.js.map +1 -0
- package/data/persistence/principalMutationJournalPersistence.d.ts +1 -1
- package/data/persistence/principalMutationJournalPersistence.js +1 -1
- package/data/persistence/principalMutationJournalPersistence.js.map +1 -1
- package/data/persistence/principalPolicy/principalPolicyBundleIntegrity.js +49 -0
- package/data/persistence/principalPolicy/principalPolicyBundleIntegrity.js.map +1 -0
- package/data/persistence/principalPolicy/principalPolicyCheckpointSelection.js +26 -0
- package/data/persistence/principalPolicy/principalPolicyCheckpointSelection.js.map +1 -0
- package/data/persistence/principalPolicy/principalPolicyOrganizationPersistence.js +42 -0
- package/data/persistence/principalPolicy/principalPolicyOrganizationPersistence.js.map +1 -0
- package/data/persistence/principalPolicy/principalPolicyPersistence.js +279 -0
- package/data/persistence/principalPolicy/principalPolicyPersistence.js.map +1 -0
- package/data/persistence/principalPolicy/principalPolicyReferenceCheckpoint.js +27 -0
- package/data/persistence/principalPolicy/principalPolicyReferenceCheckpoint.js.map +1 -0
- package/data/persistence/principalPolicy/principalPolicyReferenceIndexPersistence.js +115 -0
- package/data/persistence/principalPolicy/principalPolicyReferenceIndexPersistence.js.map +1 -0
- package/data/persistence/principalPolicy/principalPolicyReferencePersistence.js +215 -0
- package/data/persistence/principalPolicy/principalPolicyReferencePersistence.js.map +1 -0
- package/data/persistence/principalPolicy/verifiedPrincipalPolicyBundle.js +33 -0
- package/data/persistence/principalPolicy/verifiedPrincipalPolicyBundle.js.map +1 -0
- package/data/persistence/principalPolicy/verifiedPrincipalPolicyCurrent.js +56 -0
- package/data/persistence/principalPolicy/verifiedPrincipalPolicyCurrent.js.map +1 -0
- package/data/persistence/principalPolicy/verifiedPrincipalPolicyRetentionPersistence.js +18 -0
- package/data/persistence/principalPolicy/verifiedPrincipalPolicyRetentionPersistence.js.map +1 -0
- package/data/persistence/securityIncidentPersistence.js +1 -1
- package/data/persistence/securityIncidentPersistence.js.map +1 -1
- package/data/persistence/trustedUserIdentityPinPersistence.js +1 -1
- package/data/persistence/verifiedManifestBundlePersistence.d.ts +1 -1
- package/data/persistence/verifiedManifestBundlePersistence.js +4 -4
- package/data/persistence/verifiedManifestBundlePersistence.js.map +1 -1
- package/data/principals/organizationGroupRoles.js +2 -2
- package/data/principals/organizationGroupRoles.js.map +1 -1
- package/data/principals/principalHistoryPrefixProtection.js.map +1 -1
- package/data/principals/principalHistoryStageProtection.js.map +1 -1
- package/data/principals/principalPolicyCrypto.js +1 -1
- package/data/principals/principalPolicyCrypto.js.map +1 -1
- package/data/sqlite/documentPersistence/documentHistoryPersistence.d.ts +86 -0
- package/data/sqlite/documentPersistence/documentHistoryPersistence.js +304 -0
- package/data/sqlite/documentPersistence/documentHistoryPersistence.js.map +1 -0
- package/data/sqlite/documentPersistence/documentOrphanBlobReclaims.js +6 -0
- package/data/sqlite/documentPersistence/documentOrphanBlobReclaims.js.map +1 -0
- package/data/sqlite/documentPersistence/documentPendingUpdatePersistence.d.ts +103 -0
- package/data/sqlite/documentPersistence/documentPendingUpdatePersistence.js +243 -0
- package/data/sqlite/documentPersistence/documentPendingUpdatePersistence.js.map +1 -0
- package/data/sqlite/documentPersistence/documentPersistenceTypes.d.ts +79 -0
- package/data/sqlite/documentPersistence/documentPersistenceTypes.js.map +1 -0
- package/data/sqlite/documentPersistence/documentRecordPersistence.d.ts +275 -0
- package/data/sqlite/documentPersistence/documentRecordPersistence.js +103 -0
- package/data/sqlite/documentPersistence/documentRecordPersistence.js.map +1 -0
- package/data/sqlite/documentPersistence/documentSyncFailurePersistence.d.ts +39 -0
- package/data/sqlite/documentPersistence/documentSyncFailurePersistence.js +81 -0
- package/data/sqlite/documentPersistence/documentSyncFailurePersistence.js.map +1 -0
- package/data/sqlite/documentPersistence/index.d.ts +22 -0
- package/data/sqlite/documentPersistence/index.js +35 -0
- package/data/sqlite/documentPersistence/index.js.map +1 -0
- package/data/sqlite/schema/containerSchema.d.ts +1193 -0
- package/data/sqlite/schema/containerSchema.js +103 -0
- package/data/sqlite/schema/containerSchema.js.map +1 -0
- package/data/sqlite/schema/index.d.ts +8055 -0
- package/data/sqlite/schema/index.js +525 -0
- package/data/sqlite/schema/index.js.map +1 -0
- package/data/sqlite/schema/organizationDataUsageSchema.js +34 -0
- package/data/sqlite/schema/organizationDataUsageSchema.js.map +1 -0
- package/data/sqlite/schema/organizationProvisioningAttemptSchema.js +23 -0
- package/data/sqlite/schema/organizationProvisioningAttemptSchema.js.map +1 -0
- package/data/sqlite/schema/organizationReadModelTableRegistry.d.ts +1332 -0
- package/data/sqlite/schema/organizationReadModelTableRegistry.js +31 -0
- package/data/sqlite/schema/organizationReadModelTableRegistry.js.map +1 -0
- package/data/sqlite/schema/principalHistoryEvidenceSchema.d.ts +308 -0
- package/data/sqlite/schema/principalHistoryEvidenceSchema.js +48 -0
- package/data/sqlite/schema/principalHistoryEvidenceSchema.js.map +1 -0
- package/data/sqlite/schema/principalHistoryNodeRetentionSchema.js +30 -0
- package/data/sqlite/schema/principalHistoryNodeRetentionSchema.js.map +1 -0
- package/data/sqlite/schema/principalHistoryRetentionSchema.js +25 -0
- package/data/sqlite/schema/principalHistoryRetentionSchema.js.map +1 -0
- package/data/sqlite/schema/principalHistoryStageSchema.d.ts +161 -0
- package/data/sqlite/schema/principalHistoryStageSchema.js +34 -0
- package/data/sqlite/schema/principalHistoryStageSchema.js.map +1 -0
- package/data/sqlite/schema/principalMutationJournalSchema.d.ts +85 -0
- package/data/sqlite/schema/principalMutationJournalSchema.js +13 -0
- package/data/sqlite/schema/principalMutationJournalSchema.js.map +1 -0
- package/data/sqlite/schema/principalPolicySchema.js +72 -0
- package/data/sqlite/schema/principalPolicySchema.js.map +1 -0
- package/data/sqlite/schema/securityIncidentSchema.d.ts +224 -0
- package/data/sqlite/schema/securityIncidentSchema.js +28 -0
- package/data/sqlite/schema/securityIncidentSchema.js.map +1 -0
- package/data/sqlite/schema/verifiedManifestBundleSchema.d.ts +174 -0
- package/data/sqlite/schema/verifiedManifestBundleSchema.js +36 -0
- package/data/sqlite/schema/verifiedManifestBundleSchema.js.map +1 -0
- package/data/sqlite/sqlitePersistenceRuntime.d.ts +1 -1
- package/data/sqlite/sqlitePersistenceRuntime.js +1 -1
- package/package.json +1 -1
- package/sqlite/index.d.ts +1 -1
- package/sqlite/index.js +1 -1
- package/stores/container-contents/accessRestorationSweep.js +1 -1
- package/stores/container-contents/accessRestorationSweep.js.map +1 -1
- package/stores/container-contents/containerContentsStore.d.ts +1 -1
- package/stores/container-contents/containerContentsStore.js +12 -12
- package/stores/container-contents/containerContentsStore.js.map +1 -1
- package/stores/container-contents/containerState/containerStateMap.js.map +1 -0
- package/stores/container-contents/containerState/containerStatePersistence.js +57 -0
- package/stores/container-contents/containerState/containerStatePersistence.js.map +1 -0
- package/stores/container-contents/containerState/missingContainerState.js +10 -0
- package/stores/container-contents/containerState/missingContainerState.js.map +1 -0
- package/stores/container-contents/containerState/missingSyncedContainerState.js.map +1 -0
- package/stores/container-contents/containerState/reconcilableContainer.d.ts +48 -0
- package/stores/container-contents/containerState/reconcilableContainer.js.map +1 -0
- package/stores/container-contents/documentWork/documentRecovery.js +114 -0
- package/stores/container-contents/documentWork/documentRecovery.js.map +1 -0
- package/stores/container-contents/documentWork/documentRotation.js +13 -0
- package/stores/container-contents/documentWork/documentRotation.js.map +1 -0
- package/stores/container-contents/documentWork/index.js +29 -0
- package/stores/container-contents/documentWork/index.js.map +1 -0
- package/stores/container-contents/hydration/backgroundHydration.js +32 -0
- package/stores/container-contents/hydration/backgroundHydration.js.map +1 -0
- package/stores/container-contents/hydration/remoteHydrationRequest.js +245 -0
- package/stores/container-contents/hydration/remoteHydrationRequest.js.map +1 -0
- package/stores/container-contents/hydration/startupHydration.js +110 -0
- package/stores/container-contents/hydration/startupHydration.js.map +1 -0
- package/stores/container-contents/index.d.ts +3 -3
- package/stores/container-contents/index.js +2 -2
- package/stores/container-contents/index.js.map +1 -1
- package/stores/container-contents/localRefresh.js +2 -2
- package/stores/container-contents/localRefresh.js.map +1 -1
- package/stores/container-contents/operations/containerPurgeCore.js +98 -0
- package/stores/container-contents/operations/containerPurgeCore.js.map +1 -0
- package/stores/container-contents/operations/emptyTrashOperation.js.map +1 -0
- package/stores/container-contents/operations/groupRewrapOperation.js +52 -0
- package/stores/container-contents/operations/groupRewrapOperation.js.map +1 -0
- package/stores/container-contents/operations/index.js +301 -0
- package/stores/container-contents/operations/index.js.map +1 -0
- package/stores/container-contents/operations/purgeContainerOperation.js.map +1 -0
- package/stores/container-contents/operations/reportShareFailure.js +44 -0
- package/stores/container-contents/operations/reportShareFailure.js.map +1 -0
- package/stores/container-contents/operations/setContainerIconOperation.js +47 -0
- package/stores/container-contents/operations/setContainerIconOperation.js.map +1 -0
- package/stores/container-contents/operations/shareOperations.js +90 -0
- package/stores/container-contents/operations/shareOperations.js.map +1 -0
- package/stores/container-contents/remoteEvents/remoteBackedContainerState.js.map +1 -0
- package/stores/container-contents/remoteEvents/remoteContainerIngestion.js +59 -0
- package/stores/container-contents/remoteEvents/remoteContainerIngestion.js.map +1 -0
- package/stores/container-contents/remoteEvents/remoteEventProjectionInvalidation.js +36 -0
- package/stores/container-contents/remoteEvents/remoteEventProjectionInvalidation.js.map +1 -0
- package/stores/container-contents/remoteEvents/remoteEventSync.js +38 -0
- package/stores/container-contents/remoteEvents/remoteEventSync.js.map +1 -0
- package/stores/container-contents/remoteWrites/remoteWriteGuards.js +54 -0
- package/stores/container-contents/remoteWrites/remoteWriteGuards.js.map +1 -0
- package/stores/container-contents/remoteWrites/remoteWriteQueue.js +51 -0
- package/stores/container-contents/remoteWrites/remoteWriteQueue.js.map +1 -0
- package/stores/container-contents/remoteWrites/writeGeneration.js.map +1 -0
- package/stores/container-contents/state.d.ts +1 -1
- package/stores/container-contents/state.js +2 -2
- package/stores/container-contents/state.js.map +1 -1
- package/stores/container-contents/syncAgent/index.d.ts +8 -0
- package/stores/container-contents/syncAgent/index.js +241 -0
- package/stores/container-contents/syncAgent/index.js.map +1 -0
- package/stores/container-contents/syncAgent/metadataSyncSignal.js +37 -0
- package/stores/container-contents/syncAgent/metadataSyncSignal.js.map +1 -0
- package/stores/container-contents/syncAgent/syncAgentTypes.d.ts +81 -0
- package/stores/container-contents/syncAgent/syncAgentTypes.js.map +1 -0
- package/stores/container-contents/syncAgent/syncLaneIteration.js +237 -0
- package/stores/container-contents/syncAgent/syncLaneIteration.js.map +1 -0
- package/stores/container-contents/systemContainers/existingSystemContainer.js +58 -0
- package/stores/container-contents/systemContainers/existingSystemContainer.js.map +1 -0
- package/stores/container-contents/systemContainers/organizationMetadataSystemContainer.js +44 -0
- package/stores/container-contents/systemContainers/organizationMetadataSystemContainer.js.map +1 -0
- package/stores/container-contents/systemContainers/systemContainerHydration.js +30 -0
- package/stores/container-contents/systemContainers/systemContainerHydration.js.map +1 -0
- package/stores/container-contents/systemContainers/systemContainerIcon.js +42 -0
- package/stores/container-contents/systemContainers/systemContainerIcon.js.map +1 -0
- package/stores/container-contents/systemContainers/systemContainerLookup.js.map +1 -0
- package/stores/container-contents/systemContainers/systemContainerPostCreate.js +109 -0
- package/stores/container-contents/systemContainers/systemContainerPostCreate.js.map +1 -0
- package/stores/container-contents/systemContainers/systemContainerPromotion.js +49 -0
- package/stores/container-contents/systemContainers/systemContainerPromotion.js.map +1 -0
- package/stores/container-contents/types.d.ts +2 -2
- package/stores/container-contents/types.js.map +1 -1
- package/stores/documents/documentStore/attachmentUpload/attachmentSourceUpload.js +39 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentSourceUpload.js.map +1 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentStaging.js +84 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentStaging.js.map +1 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentUploadAttempt.js +97 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentUploadAttempt.js.map +1 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentUploadLane.js +49 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentUploadLane.js.map +1 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentUploadResume.js +95 -0
- package/stores/documents/documentStore/attachmentUpload/attachmentUploadResume.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentDetachState.js +54 -0
- package/stores/documents/documentStore/attachments/attachmentDetachState.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentHydration.js +90 -0
- package/stores/documents/documentStore/attachments/attachmentHydration.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentHydrationCommit.js +53 -0
- package/stores/documents/documentStore/attachments/attachmentHydrationCommit.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentIntents.js +39 -0
- package/stores/documents/documentStore/attachments/attachmentIntents.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentMutationPersistence.js +37 -0
- package/stores/documents/documentStore/attachments/attachmentMutationPersistence.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentPersistFollowup.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentPersistence.js +106 -0
- package/stores/documents/documentStore/attachments/attachmentPersistence.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentRemoval.js +136 -0
- package/stores/documents/documentStore/attachments/attachmentRemoval.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentSnapshot.js.map +1 -0
- package/stores/documents/documentStore/attachments/attachmentWriteGeneration.js +32 -0
- package/stores/documents/documentStore/attachments/attachmentWriteGeneration.js.map +1 -0
- package/stores/documents/documentStore/attachments/index.js +241 -0
- package/stores/documents/documentStore/attachments/index.js.map +1 -0
- package/stores/documents/documentStore/history/documentHistoryCompaction.js +67 -0
- package/stores/documents/documentStore/history/documentHistoryCompaction.js.map +1 -0
- package/stores/documents/documentStore/history/durableDocumentReload.js +79 -0
- package/stores/documents/documentStore/history/durableDocumentReload.js.map +1 -0
- package/stores/documents/documentStore/history/historyRebuild.js +75 -0
- package/stores/documents/documentStore/history/historyRebuild.js.map +1 -0
- package/stores/documents/documentStore/index.d.ts +8 -0
- package/stores/documents/documentStore/index.js +215 -0
- package/stores/documents/documentStore/index.js.map +1 -0
- package/stores/documents/documentStore/initialization/deferredInitialUpdate.js +116 -0
- package/stores/documents/documentStore/initialization/deferredInitialUpdate.js.map +1 -0
- package/stores/documents/documentStore/initialization/index.js +330 -0
- package/stores/documents/documentStore/initialization/index.js.map +1 -0
- package/stores/documents/documentStore/initialization/initializationAttachments.js +9 -0
- package/stores/documents/documentStore/initialization/initializationAttachments.js.map +1 -0
- package/stores/documents/documentStore/initialization/initializationHistory.js +33 -0
- package/stores/documents/documentStore/initialization/initializationHistory.js.map +1 -0
- package/stores/documents/documentStore/initialization/initializationRecovery.js +107 -0
- package/stores/documents/documentStore/initialization/initializationRecovery.js.map +1 -0
- package/stores/documents/documentStore/mutationIdentityRevalidation.js.map +1 -1
- package/stores/documents/documentStore/mutations.js +2 -2
- package/stores/documents/documentStore/mutations.js.map +1 -1
- package/stores/documents/documentStore/pendingUpdateRefusal.js +1 -1
- package/stores/documents/documentStore/pendingUpdateRefusal.js.map +1 -1
- package/stores/documents/documentStore/persistence.js +3 -3
- package/stores/documents/documentStore/persistence.js.map +1 -1
- package/stores/documents/documentStore/rotation/index.js +307 -0
- package/stores/documents/documentStore/rotation/index.js.map +1 -0
- package/stores/documents/documentStore/rotation/rotationProvenance.js +52 -0
- package/stores/documents/documentStore/rotation/rotationProvenance.js.map +1 -0
- package/stores/documents/documentStore/rotation/rotationSettlement.js +222 -0
- package/stores/documents/documentStore/rotation/rotationSettlement.js.map +1 -0
- package/stores/documents/documentStore/rows.js +2 -2
- package/stores/documents/documentStore/rows.js.map +1 -1
- package/stores/documents/documentStore/state.js +1 -1
- package/stores/documents/documentStore/state.js.map +1 -1
- package/stores/documents/documentStore/sync/index.js +299 -0
- package/stores/documents/documentStore/sync/index.js.map +1 -0
- package/stores/documents/documentStore/sync/pullContinuationInvalidation.js +61 -0
- package/stores/documents/documentStore/sync/pullContinuationInvalidation.js.map +1 -0
- package/stores/documents/documentStore/sync/remoteRevalidationTelemetry.js +15 -0
- package/stores/documents/documentStore/sync/remoteRevalidationTelemetry.js.map +1 -0
- package/stores/documents/documentStore/sync/remoteWork.js.map +1 -0
- package/stores/documents/documentStore/sync/syncAcceptedUpdateIds.js.map +1 -0
- package/stores/documents/documentStore/sync/syncAttachmentSettlement.js +72 -0
- package/stores/documents/documentStore/sync/syncAttachmentSettlement.js.map +1 -0
- package/stores/documents/documentStore/sync/syncAttachments.js +323 -0
- package/stores/documents/documentStore/sync/syncAttachments.js.map +1 -0
- package/stores/documents/documentStore/sync/syncDetachedAttachments.js +129 -0
- package/stores/documents/documentStore/sync/syncDetachedAttachments.js.map +1 -0
- package/stores/documents/documentStore/sync/syncFinalize.js +204 -0
- package/stores/documents/documentStore/sync/syncFinalize.js.map +1 -0
- package/stores/documents/documentStore/sync/syncGeneration.js.map +1 -0
- package/stores/documents/documentStore/sync/syncOutgoingCoverage.js +96 -0
- package/stores/documents/documentStore/sync/syncOutgoingCoverage.js.map +1 -0
- package/stores/documents/documentStore/sync/syncRemoteSignals.js +67 -0
- package/stores/documents/documentStore/sync/syncRemoteSignals.js.map +1 -0
- package/stores/documents/documentStore/sync/syncRequest.js +157 -0
- package/stores/documents/documentStore/sync/syncRequest.js.map +1 -0
- package/stores/documents/documentStore/sync/syncShared.js +211 -0
- package/stores/documents/documentStore/sync/syncShared.js.map +1 -0
- package/stores/documents/documentStore/sync/syncUpdateImport.js +62 -0
- package/stores/documents/documentStore/sync/syncUpdateImport.js.map +1 -0
- package/stores/documents/documentStore/sync/versionCoverage.js +45 -0
- package/stores/documents/index.d.ts +1 -1
- package/stores/documents/index.js +1 -1
- package/stores/local-projection/localProjectionStore.d.ts +1 -1
- package/stores/local-projection/localProjectionStore.js +1 -1
- package/stores/local-projection/localProjectionStore.js.map +1 -1
- package/stores/local-projection/registry.d.ts +1 -1
- package/stores/local-projection/types.d.ts +1 -1
- package/workflows/blobs/detach.js +1 -1
- package/workflows/blobs/hydration/decrypt.js +2 -2
- package/workflows/blobs/hydration/decrypt.js.map +1 -1
- package/workflows/blobs/upload/index.js +1 -1
- package/workflows/blobs/verification/retainedAttachmentVerification.js +1 -1
- package/workflows/blobs/verification/writerProjection.js +1 -1
- package/workflows/container-contents/container-state/create/createAdoption.js +193 -0
- package/workflows/container-contents/container-state/create/createAdoption.js.map +1 -0
- package/workflows/container-contents/container-state/create/createChild.js +217 -0
- package/workflows/container-contents/container-state/create/createChild.js.map +1 -0
- package/workflows/container-contents/container-state/create/createIntentDepth.js +36 -0
- package/workflows/container-contents/container-state/create/createIntentDepth.js.map +1 -0
- package/workflows/container-contents/container-state/create/createIntentSettlement.js.map +1 -0
- package/workflows/container-contents/container-state/create/createIntentSync.js +354 -0
- package/workflows/container-contents/container-state/create/createIntentSync.js.map +1 -0
- package/workflows/container-contents/container-state/create/createTerminalFailure.js +19 -0
- package/workflows/container-contents/container-state/create/createTerminalFailure.js.map +1 -0
- package/workflows/container-contents/container-state/create/createWithMetadata.js +270 -0
- package/workflows/container-contents/container-state/create/createWithMetadata.js.map +1 -0
- package/workflows/container-contents/container-state/create/createWithMetadataPlan.js +68 -0
- package/workflows/container-contents/container-state/create/createWithMetadataPlan.js.map +1 -0
- package/workflows/container-contents/container-state/purge/localPurgeScope.js +49 -0
- package/workflows/container-contents/container-state/purge/localPurgeScope.js.map +1 -0
- package/workflows/container-contents/container-state/purge/purgeTree.js +298 -0
- package/workflows/container-contents/container-state/purge/purgeTree.js.map +1 -0
- package/workflows/container-contents/container-state/purge/purgeTreeCollection.js.map +1 -0
- package/workflows/container-contents/container-state/purge/purgeTreeContainerDeletion.js +75 -0
- package/workflows/container-contents/container-state/purge/purgeTreeContainerDeletion.js.map +1 -0
- package/workflows/container-contents/container-state/purge/purgeTreeScope.js +175 -0
- package/workflows/container-contents/container-state/purge/purgeTreeScope.js.map +1 -0
- package/workflows/container-contents/container-state/purge/readLocalPurgeScope.js +18 -0
- package/workflows/container-contents/container-state/purge/readLocalPurgeScope.js.map +1 -0
- package/workflows/container-contents/container-state/remote.js +2 -2
- package/workflows/container-contents/container-state/remote.js.map +1 -1
- package/workflows/container-contents/container-state/share/groupGrantVerification.js +71 -0
- package/workflows/container-contents/container-state/share/groupGrantVerification.js.map +1 -0
- package/workflows/container-contents/container-state/share/groupShareEpoch.js +16 -0
- package/workflows/container-contents/container-state/share/groupShareEpoch.js.map +1 -0
- package/workflows/container-contents/container-state/share/index.js +283 -0
- package/workflows/container-contents/container-state/share/index.js.map +1 -0
- package/workflows/container-contents/container-state/share/sharePersistence.js +136 -0
- package/workflows/container-contents/container-state/share/sharePersistence.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryApply.js +1 -1
- package/workflows/container-contents/documentDiscovery/documentDiscoveryApply.js.map +1 -1
- package/workflows/container-contents/documentDiscovery/index.js +1 -1
- package/workflows/container-contents/documentDiscovery/index.js.map +1 -1
- package/workflows/container-contents/documentLinks/index.js +1 -1
- package/workflows/container-contents/documentMove/documentMoveVanishedRefresh.js +1 -1
- package/workflows/container-contents/documentPriming/documentHydrationProbe.js +1 -1
- package/workflows/container-contents/documentPriming/index.js +1 -1
- package/workflows/container-contents/documentQueries/index.js +1 -1
- package/workflows/container-contents/documentQueries/sql.js +1 -1
- package/workflows/container-contents/info/blobInfo.js +1 -1
- package/workflows/container-contents/info/containerInfo.js +1 -1
- package/workflows/container-contents/info/documentInfo.js +1 -1
- package/workflows/container-contents/metadata/index.js +1 -1
- package/workflows/container-contents/metadata/index.js.map +1 -1
- package/workflows/container-contents/metadata/metadataEvents.d.ts +1 -1
- package/workflows/container-contents/metadata/metadataIncomingUpdateIsolation.js +2 -2
- package/workflows/container-contents/metadata/metadataIncomingUpdateIsolation.js.map +1 -1
- package/workflows/container-contents/metadata/metadataMutationPreparation.js +1 -1
- package/workflows/container-contents/metadata/metadataMutationPreparation.js.map +1 -1
- package/workflows/container-contents/metadata/metadataPullContinuationInvalidation.js +1 -1
- package/workflows/container-contents/metadata/metadataPullContinuationInvalidation.js.map +1 -1
- package/workflows/container-contents/metadata/metadataRemoteSync.d.ts +1 -1
- package/workflows/container-contents/metadata/metadataSyncErrors.js +2 -2
- package/workflows/container-contents/metadata/metadataSyncErrors.js.map +1 -1
- package/workflows/container-contents/metadata/metadataSyncSettlement.d.ts +1 -1
- package/workflows/container-contents/metadata/metadataSyncSettlement.js.map +1 -1
- package/workflows/container-contents/metadata/metadataTypes.d.ts +1 -1
- package/workflows/container-contents/metadata/metadataTypes.js.map +1 -1
- package/workflows/container-contents/pendingWrites/index.js +2 -2
- package/workflows/container-contents/pendingWrites/sources.js +1 -1
- package/workflows/container-contents/remoteHydration/destination/destinationPrefetch.js.map +1 -0
- package/workflows/container-contents/remoteHydration/destination/destinationRoleCache.js.map +1 -0
- package/workflows/container-contents/remoteHydration/destination/destinationRootReload.js +10 -0
- package/workflows/container-contents/remoteHydration/destination/destinationRootReload.js.map +1 -0
- package/workflows/container-contents/remoteHydration/destination/replacementBinding.js +75 -0
- package/workflows/container-contents/remoteHydration/destination/replacementBinding.js.map +1 -0
- package/workflows/container-contents/remoteHydration/destination/verifiedDestination.js +296 -0
- package/workflows/container-contents/remoteHydration/destination/verifiedDestination.js.map +1 -0
- package/workflows/container-contents/remoteHydration/index.js +4 -4
- package/workflows/container-contents/remoteHydration/index.js.map +1 -1
- package/workflows/container-contents/remoteHydration/lanes/childIndex.js.map +1 -0
- package/workflows/container-contents/remoteHydration/lanes/laneFetchMarkers.js +21 -0
- package/workflows/container-contents/remoteHydration/lanes/laneFetchMarkers.js.map +1 -0
- package/workflows/container-contents/remoteHydration/lanes/parentLaneFetch.js +61 -0
- package/workflows/container-contents/remoteHydration/lanes/parentLaneFetch.js.map +1 -0
- package/workflows/container-contents/remoteHydration/lanes/parentLaneQueue.js.map +1 -0
- package/workflows/container-contents/remoteHydration/principalPolicyCache.js +1 -1
- package/workflows/container-contents/remoteHydration/principalPolicyCache.js.map +1 -1
- package/workflows/container-contents/remoteHydration/reattachMetadata.js.map +1 -1
- package/workflows/container-contents/remoteHydration/reconciliation.js +2 -2
- package/workflows/container-contents/remoteHydration/reconciliation.js.map +1 -1
- package/workflows/container-contents/remoteHydration/remoteContainers/containerStateFingerprint.js.map +1 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/insertRemoteContainer.js +135 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/insertRemoteContainer.js.map +1 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerPageHydration.js +244 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerPageHydration.js.map +1 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerState.js +263 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerState.js.map +1 -0
- package/workflows/container-contents/remoteHydration/remoteContainers/remoteContainerTimestamps.js.map +1 -0
- package/workflows/container-contents/remoteHydration/tombstoneApplication.js +2 -2
- package/workflows/container-contents/remoteHydration/tombstoneApplication.js.map +1 -1
- package/workflows/container-contents/tombstones/documentTombstoneEvidence.js +2 -2
- package/workflows/container-contents/tombstones/documentTombstoneEvidence.js.map +1 -1
- package/workflows/containers/child/create/createProjection.d.ts +6 -0
- package/workflows/containers/child/create/createProjection.js +43 -0
- package/workflows/containers/child/create/createProjection.js.map +1 -0
- package/workflows/containers/child/create/createSubmission.d.ts +56 -0
- package/workflows/containers/child/create/createSubmission.js +43 -0
- package/workflows/containers/child/create/createSubmission.js.map +1 -0
- package/workflows/containers/child/create/index.d.ts +24 -0
- package/workflows/containers/child/create/index.js +335 -0
- package/workflows/containers/child/create/index.js.map +1 -0
- package/workflows/containers/child/move/index.d.ts +23 -0
- package/workflows/containers/child/move/index.js +268 -0
- package/workflows/containers/child/move/index.js.map +1 -0
- package/workflows/containers/child/move/moveArtifacts.js +102 -0
- package/workflows/containers/child/move/moveArtifacts.js.map +1 -0
- package/workflows/containers/child/move/moveRotation.js +88 -0
- package/workflows/containers/child/move/moveRotation.js.map +1 -0
- package/workflows/containers/child/move/moveWraps.js +49 -0
- package/workflows/containers/child/move/moveWraps.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/recite.js +2 -2
- package/workflows/containers/child/recite.js.map +1 -1
- package/workflows/containers/child/rekey/carriedDescendantRekeys.js +126 -0
- package/workflows/containers/child/rekey/carriedDescendantRekeys.js.map +1 -0
- package/workflows/containers/child/rekey/index.d.ts +32 -0
- package/workflows/containers/child/rekey/index.js +227 -0
- package/workflows/containers/child/rekey/index.js.map +1 -0
- package/workflows/containers/child/rekey/keyringOverrideLineage.d.ts +22 -0
- package/workflows/containers/child/rekey/keyringOverrideLineage.js +39 -0
- package/workflows/containers/child/rekey/rekeyProjection.d.ts +46 -0
- package/workflows/containers/child/rekey/rekeyProjection.js +151 -0
- package/workflows/containers/child/rekey/rekeyProjection.js.map +1 -0
- package/workflows/containers/child/rekey/rekeyRemote.d.ts +24 -0
- package/workflows/containers/child/rekey/rekeyRemote.js +64 -0
- package/workflows/containers/child/rekey/rekeyRemote.js.map +1 -0
- package/workflows/containers/child/revoke.js +5 -5
- package/workflows/containers/child/revoke.js.map +1 -1
- package/workflows/containers/child/rotation/replacementPrincipalPolicyReferences.js +19 -0
- package/workflows/containers/child/rotation/replacementPrincipalPolicyReferences.js.map +1 -0
- package/workflows/containers/child/rotation/rotationContext.js +64 -0
- package/workflows/containers/child/rotation/rotationContext.js.map +1 -0
- package/workflows/containers/child/rotation/rotationPrincipalPolicies.js +19 -0
- package/workflows/containers/child/rotation/rotationPrincipalPolicies.js.map +1 -0
- package/workflows/containers/child/rotation/rotationWraps.js +85 -0
- package/workflows/containers/child/rotation/rotationWraps.js.map +1 -0
- package/workflows/containers/child/share/currentShareGrantMutation.js +82 -0
- package/workflows/containers/child/share/currentShareGrantMutation.js.map +1 -0
- package/workflows/containers/child/share/currentSharePrincipalPolicy.js +83 -0
- package/workflows/containers/child/share/currentSharePrincipalPolicy.js.map +1 -0
- package/workflows/containers/child/share/index.d.ts +65 -0
- package/workflows/containers/child/share/index.js +256 -0
- package/workflows/containers/child/share/index.js.map +1 -0
- package/workflows/containers/child/share/runtimeCurrentGroupShare.js +79 -0
- package/workflows/containers/child/share/runtimeCurrentGroupShare.js.map +1 -0
- package/workflows/containers/child/share/shareAncestorRepair.js +95 -0
- package/workflows/containers/child/share/shareAncestorRepair.js.map +1 -0
- package/workflows/containers/child/share/shareMaterialization.d.ts +25 -0
- package/workflows/containers/child/share/shareMaterialization.js +164 -0
- package/workflows/containers/child/share/shareMaterialization.js.map +1 -0
- package/workflows/containers/child/share/sharePlanCore.d.ts +82 -0
- package/workflows/containers/child/share/sharePlanCore.js +191 -0
- package/workflows/containers/child/share/sharePlanCore.js.map +1 -0
- package/workflows/containers/child/share/sharePrincipalPolicy.d.ts +51 -0
- package/workflows/containers/child/share/sharePrincipalPolicy.js +194 -0
- package/workflows/containers/child/share/sharePrincipalPolicy.js.map +1 -0
- package/workflows/containers/child/share/shareProjection.js.map +1 -0
- package/workflows/containers/index.d.ts +13 -13
- package/workflows/containers/index.js +12 -12
- package/workflows/containers/index.js.map +1 -1
- package/workflows/containers/writeRefusal.js +1 -1
- package/workflows/containers/writeRefusal.js.map +1 -1
- package/workflows/documents/create/createAdoption.js +1 -1
- package/workflows/documents/create/createResponse.js +2 -2
- package/workflows/documents/create/createResponse.js.map +1 -1
- package/workflows/documents/create/index.js +1 -1
- package/workflows/documents/documentMutationCommit.d.ts +1 -1
- package/workflows/documents/documentMutationPreparation.d.ts +1 -1
- package/workflows/documents/documentMutationPreparation.js +1 -1
- package/workflows/documents/documentMutationPreparation.js.map +1 -1
- package/workflows/documents/index.d.ts +5 -5
- package/workflows/documents/index.js +5 -5
- package/workflows/documents/index.js.map +1 -1
- package/workflows/documents/linkSet/index.js +2 -2
- package/workflows/documents/linkSet/index.js.map +1 -1
- package/workflows/documents/linkSet/linkSetAuthority.js +2 -2
- package/workflows/documents/linkSet/linkSetAuthority.js.map +1 -1
- package/workflows/documents/linkSet/linkSetBlobRewraps.js +2 -2
- package/workflows/documents/linkSet/linkSetBlobRewraps.js.map +1 -1
- package/workflows/documents/linkSet/linkSetProjectionSeed.js +2 -2
- package/workflows/documents/linkSet/linkSetProjectionSeed.js.map +1 -1
- package/workflows/documents/linkSet/linkSetRemote.js +1 -1
- package/workflows/documents/linkSet/linkSetRemote.js.map +1 -1
- package/workflows/documents/purge/index.js +2 -2
- package/workflows/documents/purge/index.js.map +1 -1
- package/workflows/documents/sync/index.js +2 -2
- package/workflows/documents/sync/index.js.map +1 -1
- package/workflows/documents/sync/initialSync.js +1 -1
- package/workflows/documents/sync/readOnlyProjectionFailure.js +1 -1
- package/workflows/documents/sync/readOnlyProjectionFailure.js.map +1 -1
- package/workflows/documents/sync/readOnlySync.d.ts +3 -3
- package/workflows/documents/sync/readOnlySync.js +1 -1
- package/workflows/documents/sync/readOnlySync.js.map +1 -1
- package/workflows/documents/sync/reportDocumentSyncQuarantine.js.map +1 -1
- package/workflows/documents/sync/syncAttemptPlanning.js +2 -2
- package/workflows/documents/sync/syncAttemptPlanning.js.map +1 -1
- package/workflows/documents/sync/syncAttemptState.d.ts +2 -2
- package/workflows/documents/sync/syncAttemptState.js.map +1 -1
- package/workflows/documents/sync/syncResponseResult.js +2 -2
- package/workflows/documents/sync/syncResponseResult.js.map +1 -1
- package/workflows/documents/syncFailures/index.js +1 -1
- package/workflows/documents/syncFailures/index.js.map +1 -1
- package/workflows/documents/syncFailures/syncAbandon.js.map +1 -1
- package/workflows/documents/syncFailures/syncFailureClassification.js +1 -1
- package/workflows/documents/syncFailures/syncFailureClassification.js.map +1 -1
- package/workflows/documents/syncPlan/syncContentKeys.d.ts +1 -1
- package/workflows/documents/syncPlan/syncContentKeys.js +3 -3
- package/workflows/documents/syncPlan/syncContentKeys.js.map +1 -1
- package/workflows/documents/syncPlan/syncPlanMaterial.js +2 -2
- package/workflows/documents/syncPlan/syncPlanMaterial.js.map +1 -1
- package/workflows/documents/syncRekeys/syncAutomaticContainerRekeys.js +4 -4
- package/workflows/documents/syncRekeys/syncAutomaticContainerRekeys.js.map +1 -1
- package/workflows/documents/syncRekeys/syncContainerRekeyPreparation.js +1 -1
- package/workflows/documents/syncRekeys/syncRecoveryRekey.d.ts +1 -1
- package/workflows/documents/syncRekeys/syncRecoveryRekey.js +1 -1
- package/workflows/organizations/currentOrganizationAuthority.js +2 -2
- package/workflows/organizations/currentOrganizationAuthority.js.map +1 -1
- package/workflows/organizations/groupMetadata/groupMetadataAccess.js +1 -1
- package/workflows/organizations/groupMetadata/groupMetadataAccess.js.map +1 -1
- package/workflows/organizations/groupMetadata/groupMetadataContainerAuthority.js +1 -1
- package/workflows/organizations/groupMetadata/groupMetadataContainerAuthority.js.map +1 -1
- package/workflows/organizations/groupNames/currentOrganizationGroupNames.js +1 -1
- package/workflows/organizations/groupNames/currentOrganizationGroupNames.js.map +1 -1
- package/workflows/organizations/groupNames/groupNameUniqueness.js +3 -3
- package/workflows/organizations/groupNames/groupNameUniqueness.js.map +1 -1
- package/workflows/organizations/groupNames/organizationGroupNamePolicies.js +2 -2
- package/workflows/organizations/groupNames/organizationGroupNamePolicies.js.map +1 -1
- package/workflows/organizations/groupPolicy/currentGroupPolicyMutationContext.js +1 -1
- package/workflows/organizations/groupPolicy/currentGroupPolicyMutationContext.js.map +1 -1
- package/workflows/organizations/groupPolicy/groupPolicyMutationContext.js +2 -2
- package/workflows/organizations/groupPolicy/groupPolicyMutationContext.js.map +1 -1
- package/workflows/organizations/groupPolicy/groupPolicyMutationEvidence.js +1 -1
- package/workflows/organizations/groupPolicy/groupPolicyMutationEvidence.js.map +1 -1
- package/workflows/organizations/groupPolicy/groupPolicyVerification.js +1 -1
- package/workflows/organizations/groupPolicy/groupPolicyVerification.js.map +1 -1
- package/workflows/organizations/groups/createCurrentOrganizationGroup.js +1 -1
- package/workflows/organizations/groups/createCurrentOrganizationGroup.js.map +1 -1
- package/workflows/organizations/groups/deleteOrganizationGroup.js +1 -1
- package/workflows/organizations/groups/deleteOrganizationGroup.js.map +1 -1
- package/workflows/organizations/groups/organizationGroupDirectory.js +1 -1
- package/workflows/organizations/groups/organizationGroupDirectory.js.map +1 -1
- package/workflows/organizations/principalMutations/runtimeCurrentOrganizationMutation.js +1 -1
- package/workflows/organizations/principalMutations/runtimeCurrentOrganizationMutation.js.map +1 -1
- package/workflows/organizations/provisioning/organizationReplacementVerification.js +1 -1
- package/workflows/organizations/provisioning/organizationReplacementVerification.js.map +1 -1
- package/workflows/organizations/readModel/listLocalOrganizations.js +1 -1
- package/workflows/organizations/readModel/localReadModelDetails.js +1 -1
- package/workflows/organizations/readModel/localReadModelDetails.js.map +1 -1
- package/workflows/organizations/rematerialization/precedingPrincipalRematerialization.js +1 -1
- package/workflows/organizations/rematerialization/precedingPrincipalRematerialization.js.map +1 -1
- package/workflows/organizations/rematerialization/principalContainerRematerialization.js +5 -5
- package/workflows/organizations/rematerialization/principalContainerRematerialization.js.map +1 -1
- package/workflows/organizations/rematerialization/principalContainerRematerializationPlanning.js +1 -1
- package/workflows/organizations/rematerialization/principalContainerRematerializationPlanning.js.map +1 -1
- package/workflows/organizations/rematerialization/principalContainerRematerializationTargets.js +1 -1
- package/workflows/organizations/rematerialization/principalContainerRematerializationTargets.js.map +1 -1
- package/workflows/principals/acknowledgements/acknowledgedPrincipalCurrents.js +1 -1
- package/workflows/principals/acknowledgements/acknowledgedPrincipalCurrents.js.map +1 -1
- package/workflows/principals/acknowledgements/acknowledgedPrincipalPredecessor.d.ts +1 -1
- package/workflows/principals/acknowledgements/acknowledgedPrincipalPredecessor.js +1 -1
- package/workflows/principals/acknowledgements/acknowledgedPrincipalPredecessor.js.map +1 -1
- package/workflows/principals/acknowledgements/initialPrincipalCurrentPublication.js +1 -1
- package/workflows/principals/acknowledgements/initialPrincipalCurrentPublication.js.map +1 -1
- package/workflows/principals/acknowledgements/reconcileAcknowledgedPrincipalCurrent.js +2 -2
- package/workflows/principals/acknowledgements/reconcileAcknowledgedPrincipalCurrent.js.map +1 -1
- package/workflows/principals/externalAdminPolicy.js +2 -2
- package/workflows/principals/externalAdminPolicy.js.map +1 -1
- package/workflows/principals/historyRecovery/loadRecoveredPrincipalHistoryPage.js +2 -2
- package/workflows/principals/historyRecovery/loadRecoveredPrincipalHistoryPage.js.map +1 -1
- package/workflows/principals/historyRecovery/principalHistoryRecoveryPrefix.js +1 -1
- package/workflows/principals/historyRecovery/principalHistoryRecoveryPrefix.js.map +1 -1
- package/workflows/principals/historyRecovery/principalHistoryRecoveryReferences.js +1 -1
- package/workflows/principals/historyRecovery/principalHistoryRecoveryReferences.js.map +1 -1
- package/workflows/principals/historyRecovery/principalHistoryRecoveryStage.js +1 -1
- package/workflows/principals/historyRecovery/principalHistoryRecoveryStage.js.map +1 -1
- package/workflows/principals/historyRecovery/recoverPrincipalPolicyHistory.js +3 -3
- package/workflows/principals/historyRecovery/recoverPrincipalPolicyHistory.js.map +1 -1
- package/workflows/principals/policyCache/index.js +4 -4
- package/workflows/principals/policyCache/index.js.map +1 -1
- package/workflows/principals/policyCache/principalPolicyCacheAdvance.js +1 -1
- package/workflows/principals/policyCache/principalPolicyCacheAdvance.js.map +1 -1
- package/workflows/principals/policyCache/principalPolicyOrganizationScope.js +3 -3
- package/workflows/principals/policyCache/principalPolicyOrganizationScope.js.map +1 -1
- package/workflows/principals/policyRepair.js +1 -1
- package/workflows/principals/policyRepair.js.map +1 -1
- package/workflows/principals/publicHistory/publicPrincipalHistoryAuthority.js.map +1 -1
- package/workflows/principals/publicHistory/publicPrincipalHistoryPage.js +2 -2
- package/workflows/principals/publicHistory/publicPrincipalHistoryPage.js.map +1 -1
- package/workflows/principals/publicHistory/publicPrincipalHistoryProgress.js +3 -3
- package/workflows/principals/publicHistory/publicPrincipalHistoryProgress.js.map +1 -1
- package/workflows/principals/publicHistory/publicPrincipalHistoryTypes.d.ts +2 -2
- package/workflows/principals/publicHistory/publicPrincipalHistoryTypes.js.map +1 -1
- package/workflows/principals/publicHistory/publicProjectionPrincipal.js +1 -1
- package/workflows/principals/publicHistory/publicProjectionPrincipal.js.map +1 -1
- package/workflows/principals/publicHistory/recoverPublicPrincipalHistory.js +1 -1
- package/workflows/principals/publicHistory/recoverPublicPrincipalHistory.js.map +1 -1
- package/workflows/principals/publicHistory/selectPublicPrincipalHistory.js +1 -1
- package/workflows/principals/publicHistory/selectPublicPrincipalHistory.js.map +1 -1
- package/workflows/principals/recoveryOperation/principalRecoveryDirectory.js +1 -1
- package/workflows/principals/recoveryOperation/principalRecoveryDirectory.js.map +1 -1
- package/workflows/principals/recoveryOperation/principalRecoveryMemoValidity.js +1 -1
- package/workflows/principals/recoveryOperation/principalRecoveryMemoValidity.js.map +1 -1
- package/workflows/registration/organizationProvisioningArtifacts.d.ts +1 -1
- package/workflows/registration/persistRegistrationBootstrap.d.ts +2 -2
- package/workflows/registration/persistRegistrationBootstrap.js +2 -2
- package/workflows/registration/persistRegistrationBootstrap.js.map +1 -1
- package/workflows/registration/provisioningAcknowledgement.js +1 -1
- package/workflows/registration/provisioningAcknowledgement.js.map +1 -1
- package/workflows/registration/provisioningBootstrapBuilders.js +1 -1
- package/workflows/registration/registrationPrincipalPolicyPersistence.js +1 -1
- package/workflows/registration/registrationPrincipalPolicyPersistence.js.map +1 -1
- package/workflows/sync/remoteReset.js +7 -7
- package/workflows/sync/remoteReset.js.map +1 -1
- package/workflows/sync/remoteResetAttachments.js +1 -1
- package/workflows/sync/remoteResetCursorScope.js +1 -1
- package/workflows/sync/remoteResetPlans.js +1 -1
- package/workflows/sync/remoteResetPrincipalScope.js +5 -5
- package/workflows/sync/remoteResetPrincipalScope.js.map +1 -1
- package/workflows/sync/remoteResetScope.js +1 -1
- package/data/documents/shared/containerKekCurrency.d.ts +0 -22
- package/data/documents/shared/containerKekEntryVerification.js +0 -15
- package/data/documents/shared/containerKekLogFetch.d.ts +0 -18
- package/data/documents/shared/containerKekLogFetch.js +0 -76
- package/data/documents/shared/containerKekPath.js +0 -265
- package/data/documents/shared/containerKekPath.js.map +0 -1
- package/data/documents/shared/containerKekPathHistory.d.ts +0 -61
- package/data/documents/shared/containerKekPathHistory.js +0 -223
- package/data/documents/shared/containerKekPathHistory.js.map +0 -1
- package/data/documents/shared/containerKekPathVerification.d.ts +0 -15
- package/data/documents/shared/containerKekPathVerification.js +0 -23
- package/data/documents/shared/containerKekPathVerification.js.map +0 -1
- package/data/documents/shared/containerKekWrapping.js +0 -61
- package/data/documents/shared/containerKekWrapping.js.map +0 -1
- package/data/documents/shared/documentSyncUpdateDecryption.js +0 -238
- package/data/documents/shared/documentSyncUpdateDecryption.js.map +0 -1
- package/data/documents/shared/documentSyncUpdateIsolation.d.ts +0 -55
- package/data/documents/shared/documentSyncUpdateIsolation.js +0 -298
- package/data/documents/shared/documentSyncUpdateIsolation.js.map +0 -1
- package/data/documents/shared/keyringLogWalk.d.ts +0 -45
- package/data/documents/shared/keyringLogWalk.js +0 -204
- package/data/documents/shared/keyringRebuild.d.ts +0 -60
- package/data/documents/shared/keyringRebuild.js +0 -242
- package/data/documents/shared/keyringRebuild.js.map +0 -1
- package/data/documents/shared/mutationAcknowledgement.js +0 -10
- package/data/documents/shared/mutationAcknowledgement.js.map +0 -1
- package/data/documents/shared/projection.d.ts +0 -25
- package/data/documents/shared/projection.js +0 -132
- package/data/documents/shared/projection.js.map +0 -1
- package/data/documents/shared/projectionContentKeys.d.ts +0 -90
- package/data/documents/shared/projectionContentKeys.js +0 -262
- package/data/documents/shared/projectionContentKeys.js.map +0 -1
- package/data/documents/shared/projectionTargets.d.ts +0 -38
- package/data/documents/shared/projectionTargets.js +0 -164
- package/data/documents/shared/projectionTargets.js.map +0 -1
- package/data/documents/shared/pullContinuation.js +0 -53
- package/data/documents/shared/syncPagination.d.ts +0 -20
- package/data/documents/shared/syncPagination.js +0 -109
- package/data/documents/shared/syncPagination.js.map +0 -1
- package/data/documents/shared/syncResponseAuthorization.js +0 -63
- package/data/documents/shared/syncResponseAuthorization.js.map +0 -1
- package/data/documents/shared/syncResponses.d.ts +0 -11
- package/data/documents/shared/syncResponses.js +0 -285
- package/data/documents/shared/syncResponses.js.map +0 -1
- package/data/documents/shared/syncSubmitFailure.d.ts +0 -9
- package/data/keyingProjectionVerification/accessManifestCheckpointEnforcement.js +0 -61
- package/data/keyingProjectionVerification/accessManifestCheckpointEnforcement.js.map +0 -1
- package/data/keyingProjectionVerification/bundleVerification.js +0 -61
- package/data/keyingProjectionVerification/bundleVerification.js.map +0 -1
- package/data/keyingProjectionVerification/checkpointContext.d.ts +0 -45
- package/data/keyingProjectionVerification/checkpointContext.js +0 -120
- package/data/keyingProjectionVerification/checkpointContext.js.map +0 -1
- package/data/keyingProjectionVerification/containerAncestorCitations.js +0 -164
- package/data/keyingProjectionVerification/containerAncestorCitations.js.map +0 -1
- package/data/keyingProjectionVerification/containerCreateManifest.js +0 -28
- package/data/keyingProjectionVerification/containerDestinationVerification.js +0 -51
- package/data/keyingProjectionVerification/containerDestinationVerification.js.map +0 -1
- package/data/keyingProjectionVerification/containerManifestVerification.js +0 -285
- package/data/keyingProjectionVerification/containerManifestVerification.js.map +0 -1
- package/data/keyingProjectionVerification/containerPathVerification.js +0 -51
- package/data/keyingProjectionVerification/containerPathVerification.js.map +0 -1
- package/data/keyingProjectionVerification/containerProjectionVerification.d.ts +0 -25
- package/data/keyingProjectionVerification/containerProjectionVerification.js +0 -254
- package/data/keyingProjectionVerification/containerProjectionVerification.js.map +0 -1
- package/data/keyingProjectionVerification/documentDependencyPaths.d.ts +0 -17
- package/data/keyingProjectionVerification/documentDependencyPaths.js +0 -70
- package/data/keyingProjectionVerification/documentDependencyPaths.js.map +0 -1
- package/data/keyingProjectionVerification/documentManifestPolicies.js +0 -32
- package/data/keyingProjectionVerification/documentManifestPolicies.js.map +0 -1
- package/data/keyingProjectionVerification/documentManifestPredecessor.js +0 -12
- package/data/keyingProjectionVerification/documentManifestVerification.js +0 -135
- package/data/keyingProjectionVerification/documentManifestVerification.js.map +0 -1
- package/data/keyingProjectionVerification/documentProjectionVerification.d.ts +0 -24
- package/data/keyingProjectionVerification/documentProjectionVerification.js +0 -172
- package/data/keyingProjectionVerification/documentProjectionVerification.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgeCheckpointCurrency.js +0 -100
- package/data/keyingProjectionVerification/documentPurgeCheckpointCurrency.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgeCheckpointEnforcement.js +0 -8
- package/data/keyingProjectionVerification/documentPurgeCheckpointEnforcement.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgeDocumentChainVerification.js +0 -177
- package/data/keyingProjectionVerification/documentPurgeDocumentChainVerification.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgePolicyCheckpoints.js +0 -17
- package/data/keyingProjectionVerification/documentPurgePolicyCheckpoints.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgePolicyCurrency.js +0 -55
- package/data/keyingProjectionVerification/documentPurgePolicyCurrency.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgePrincipalEvidence.js +0 -116
- package/data/keyingProjectionVerification/documentPurgePrincipalEvidence.js.map +0 -1
- package/data/keyingProjectionVerification/documentPurgeProofVerification.d.ts +0 -34
- package/data/keyingProjectionVerification/documentPurgeProofVerification.js +0 -208
- package/data/keyingProjectionVerification/documentPurgeProofVerification.js.map +0 -1
- package/data/keyingProjectionVerification/manifestCheckpointVerification.js +0 -64
- package/data/keyingProjectionVerification/manifestCheckpointVerification.js.map +0 -1
- package/data/keyingProjectionVerification/mergeProjectionPolicyEvidence.js +0 -45
- package/data/keyingProjectionVerification/mergeProjectionPolicyEvidence.js.map +0 -1
- package/data/keyingProjectionVerification/organizationFounderBinding.js +0 -41
- package/data/keyingProjectionVerification/organizationFounderBinding.js.map +0 -1
- package/data/keyingProjectionVerification/principalPolicyCache.js +0 -76
- package/data/keyingProjectionVerification/principalPolicyCache.js.map +0 -1
- package/data/keyingProjectionVerification/principalPolicyVerification.js +0 -252
- package/data/keyingProjectionVerification/principalPolicyVerification.js.map +0 -1
- package/data/keyingProjectionVerification/projectionAuthorizationEvidence.js +0 -63
- package/data/keyingProjectionVerification/projectionAuthorizationEvidence.js.map +0 -1
- package/data/keyingProjectionVerification/projectionPolicyEvidence.js +0 -23
- package/data/keyingProjectionVerification/projectionPolicyEvidence.js.map +0 -1
- package/data/keyingProjectionVerification/resolvedPrincipalPolicy.js +0 -72
- package/data/keyingProjectionVerification/resolvedPrincipalPolicy.js.map +0 -1
- package/data/persistence/documentPurgeCheckpointPersistence.d.ts +0 -10
- package/data/persistence/documentPurgeCheckpointPersistence.js +0 -43
- package/data/persistence/documentPurgeCheckpointPersistence.js.map +0 -1
- package/data/persistence/keyingCheckpointAdvancePersistence.js +0 -222
- package/data/persistence/keyingCheckpointAdvancePersistence.js.map +0 -1
- package/data/persistence/keyingCheckpointEvidence.js +0 -32
- package/data/persistence/keyingCheckpointPersistence.js +0 -133
- package/data/persistence/keyingCheckpointPersistence.js.map +0 -1
- package/data/persistence/locallyAcknowledgedCheckpointPersistence.d.ts +0 -53
- package/data/persistence/locallyAcknowledgedCheckpointPersistence.js +0 -167
- package/data/persistence/locallyAcknowledgedCheckpointPersistence.js.map +0 -1
- package/data/persistence/organizationReplacementCheckpointPersistence.js +0 -72
- package/data/persistence/organizationReplacementCheckpointPersistence.js.map +0 -1
- package/data/persistence/principalAuthorizationCheckpoints.js +0 -29
- package/data/persistence/principalAuthorizationCheckpoints.js.map +0 -1
- package/data/persistence/principalGrantRetirementPersistence.d.ts +0 -9
- package/data/persistence/principalGrantRetirementPersistence.js +0 -43
- package/data/persistence/principalGrantRetirementPersistence.js.map +0 -1
- package/data/persistence/principalHistoryEvidencePersistence.d.ts +0 -32
- package/data/persistence/principalHistoryEvidencePersistence.js +0 -92
- package/data/persistence/principalHistoryEvidencePersistence.js.map +0 -1
- package/data/persistence/principalHistoryIncompleteRetention.js +0 -26
- package/data/persistence/principalHistoryIncompleteRetention.js.map +0 -1
- package/data/persistence/principalHistoryNodeRetention.js +0 -201
- package/data/persistence/principalHistoryNodeRetention.js.map +0 -1
- package/data/persistence/principalHistoryPrefixPersistence.d.ts +0 -29
- package/data/persistence/principalHistoryPrefixPersistence.js +0 -102
- package/data/persistence/principalHistoryPrefixPersistence.js.map +0 -1
- package/data/persistence/principalHistoryRootOwnership.js +0 -71
- package/data/persistence/principalHistoryRootOwnership.js.map +0 -1
- package/data/persistence/principalHistoryStagePersistence.d.ts +0 -15
- package/data/persistence/principalHistoryStagePersistence.js +0 -96
- package/data/persistence/principalHistoryStagePersistence.js.map +0 -1
- package/data/persistence/principalHistoryStageRetention.js +0 -45
- package/data/persistence/principalHistoryStageRetention.js.map +0 -1
- package/data/persistence/principalHistoryUnpublishedRetention.js +0 -64
- package/data/persistence/principalHistoryUnpublishedRetention.js.map +0 -1
- package/data/persistence/principalKeyEnvelopeArchivePersistence.js +0 -63
- package/data/persistence/principalKeyEnvelopeArchivePersistence.js.map +0 -1
- package/data/persistence/principalKeyEnvelopeCandidates.js +0 -87
- package/data/persistence/principalKeyEnvelopeCandidates.js.map +0 -1
- package/data/persistence/principalPolicyBundleIntegrity.js +0 -49
- package/data/persistence/principalPolicyBundleIntegrity.js.map +0 -1
- package/data/persistence/principalPolicyCheckpointSelection.js +0 -26
- package/data/persistence/principalPolicyCheckpointSelection.js.map +0 -1
- package/data/persistence/principalPolicyOrganizationPersistence.js +0 -42
- package/data/persistence/principalPolicyOrganizationPersistence.js.map +0 -1
- package/data/persistence/principalPolicyPersistence.js +0 -279
- package/data/persistence/principalPolicyPersistence.js.map +0 -1
- package/data/persistence/principalPolicyReferenceCheckpoint.js +0 -27
- package/data/persistence/principalPolicyReferenceCheckpoint.js.map +0 -1
- package/data/persistence/principalPolicyReferenceIndexPersistence.js +0 -115
- package/data/persistence/principalPolicyReferenceIndexPersistence.js.map +0 -1
- package/data/persistence/principalPolicyReferencePersistence.js +0 -215
- package/data/persistence/principalPolicyReferencePersistence.js.map +0 -1
- package/data/persistence/verifiedPrincipalPolicyBundle.js +0 -33
- package/data/persistence/verifiedPrincipalPolicyBundle.js.map +0 -1
- package/data/persistence/verifiedPrincipalPolicyCurrent.js +0 -56
- package/data/persistence/verifiedPrincipalPolicyCurrent.js.map +0 -1
- package/data/persistence/verifiedPrincipalPolicyRetentionPersistence.js +0 -18
- package/data/persistence/verifiedPrincipalPolicyRetentionPersistence.js.map +0 -1
- package/data/sqlite/containerSchema.d.ts +0 -1193
- package/data/sqlite/containerSchema.js +0 -103
- package/data/sqlite/containerSchema.js.map +0 -1
- package/data/sqlite/documentHistoryPersistence.d.ts +0 -86
- package/data/sqlite/documentHistoryPersistence.js +0 -304
- package/data/sqlite/documentHistoryPersistence.js.map +0 -1
- package/data/sqlite/documentOrphanBlobReclaims.js +0 -6
- package/data/sqlite/documentOrphanBlobReclaims.js.map +0 -1
- package/data/sqlite/documentPendingUpdatePersistence.d.ts +0 -103
- package/data/sqlite/documentPendingUpdatePersistence.js +0 -243
- package/data/sqlite/documentPendingUpdatePersistence.js.map +0 -1
- package/data/sqlite/documentPersistence.d.ts +0 -22
- package/data/sqlite/documentPersistence.js +0 -35
- package/data/sqlite/documentPersistence.js.map +0 -1
- package/data/sqlite/documentPersistenceTypes.d.ts +0 -79
- package/data/sqlite/documentPersistenceTypes.js.map +0 -1
- package/data/sqlite/documentRecordPersistence.d.ts +0 -275
- package/data/sqlite/documentRecordPersistence.js +0 -103
- package/data/sqlite/documentRecordPersistence.js.map +0 -1
- package/data/sqlite/documentSyncFailurePersistence.d.ts +0 -39
- package/data/sqlite/documentSyncFailurePersistence.js +0 -81
- package/data/sqlite/documentSyncFailurePersistence.js.map +0 -1
- package/data/sqlite/organizationDataUsageSchema.js +0 -34
- package/data/sqlite/organizationDataUsageSchema.js.map +0 -1
- package/data/sqlite/organizationProvisioningAttemptSchema.js +0 -23
- package/data/sqlite/organizationProvisioningAttemptSchema.js.map +0 -1
- package/data/sqlite/organizationReadModelTableRegistry.d.ts +0 -1332
- package/data/sqlite/organizationReadModelTableRegistry.js +0 -31
- package/data/sqlite/organizationReadModelTableRegistry.js.map +0 -1
- package/data/sqlite/principalHistoryEvidenceSchema.d.ts +0 -308
- package/data/sqlite/principalHistoryEvidenceSchema.js +0 -48
- package/data/sqlite/principalHistoryEvidenceSchema.js.map +0 -1
- package/data/sqlite/principalHistoryNodeRetentionSchema.js +0 -30
- package/data/sqlite/principalHistoryNodeRetentionSchema.js.map +0 -1
- package/data/sqlite/principalHistoryRetentionSchema.js +0 -25
- package/data/sqlite/principalHistoryRetentionSchema.js.map +0 -1
- package/data/sqlite/principalHistoryStageSchema.d.ts +0 -161
- package/data/sqlite/principalHistoryStageSchema.js +0 -34
- package/data/sqlite/principalHistoryStageSchema.js.map +0 -1
- package/data/sqlite/principalMutationJournalSchema.d.ts +0 -85
- package/data/sqlite/principalMutationJournalSchema.js +0 -13
- package/data/sqlite/principalMutationJournalSchema.js.map +0 -1
- package/data/sqlite/principalPolicySchema.js +0 -72
- package/data/sqlite/principalPolicySchema.js.map +0 -1
- package/data/sqlite/schema.d.ts +0 -8055
- package/data/sqlite/schema.js +0 -525
- package/data/sqlite/schema.js.map +0 -1
- package/data/sqlite/securityIncidentSchema.d.ts +0 -224
- package/data/sqlite/securityIncidentSchema.js +0 -28
- package/data/sqlite/securityIncidentSchema.js.map +0 -1
- package/data/sqlite/verifiedManifestBundleSchema.d.ts +0 -174
- package/data/sqlite/verifiedManifestBundleSchema.js +0 -36
- package/data/sqlite/verifiedManifestBundleSchema.js.map +0 -1
- package/stores/container-contents/backgroundHydration.js +0 -32
- package/stores/container-contents/backgroundHydration.js.map +0 -1
- package/stores/container-contents/containerPurgeCore.js +0 -98
- package/stores/container-contents/containerPurgeCore.js.map +0 -1
- package/stores/container-contents/containerStateMap.js.map +0 -1
- package/stores/container-contents/containerStatePersistence.js +0 -57
- package/stores/container-contents/containerStatePersistence.js.map +0 -1
- package/stores/container-contents/documentRecovery.js +0 -114
- package/stores/container-contents/documentRecovery.js.map +0 -1
- package/stores/container-contents/documentRotation.js +0 -13
- package/stores/container-contents/documentRotation.js.map +0 -1
- package/stores/container-contents/documentWork.js +0 -29
- package/stores/container-contents/documentWork.js.map +0 -1
- package/stores/container-contents/emptyTrashOperation.js.map +0 -1
- package/stores/container-contents/existingSystemContainer.js +0 -58
- package/stores/container-contents/existingSystemContainer.js.map +0 -1
- package/stores/container-contents/groupRewrapOperation.js +0 -52
- package/stores/container-contents/groupRewrapOperation.js.map +0 -1
- package/stores/container-contents/metadataSyncSignal.js +0 -37
- package/stores/container-contents/metadataSyncSignal.js.map +0 -1
- package/stores/container-contents/missingContainerState.js +0 -10
- package/stores/container-contents/missingContainerState.js.map +0 -1
- package/stores/container-contents/missingSyncedContainerState.js.map +0 -1
- package/stores/container-contents/operations.js +0 -301
- package/stores/container-contents/operations.js.map +0 -1
- package/stores/container-contents/organizationMetadataSystemContainer.js +0 -44
- package/stores/container-contents/organizationMetadataSystemContainer.js.map +0 -1
- package/stores/container-contents/purgeContainerOperation.js.map +0 -1
- package/stores/container-contents/reconcilableContainer.d.ts +0 -48
- package/stores/container-contents/reconcilableContainer.js.map +0 -1
- package/stores/container-contents/remoteBackedContainerState.js.map +0 -1
- package/stores/container-contents/remoteContainerIngestion.js +0 -59
- package/stores/container-contents/remoteContainerIngestion.js.map +0 -1
- package/stores/container-contents/remoteEventProjectionInvalidation.js +0 -36
- package/stores/container-contents/remoteEventProjectionInvalidation.js.map +0 -1
- package/stores/container-contents/remoteEventSync.js +0 -38
- package/stores/container-contents/remoteEventSync.js.map +0 -1
- package/stores/container-contents/remoteHydrationRequest.js +0 -245
- package/stores/container-contents/remoteHydrationRequest.js.map +0 -1
- package/stores/container-contents/remoteWriteGuards.js +0 -54
- package/stores/container-contents/remoteWriteGuards.js.map +0 -1
- package/stores/container-contents/remoteWriteQueue.js +0 -51
- package/stores/container-contents/remoteWriteQueue.js.map +0 -1
- package/stores/container-contents/reportShareFailure.js +0 -44
- package/stores/container-contents/reportShareFailure.js.map +0 -1
- package/stores/container-contents/setContainerIconOperation.js +0 -47
- package/stores/container-contents/setContainerIconOperation.js.map +0 -1
- package/stores/container-contents/shareOperations.js +0 -90
- package/stores/container-contents/shareOperations.js.map +0 -1
- package/stores/container-contents/startupHydration.js +0 -110
- package/stores/container-contents/startupHydration.js.map +0 -1
- package/stores/container-contents/syncAgent.d.ts +0 -8
- package/stores/container-contents/syncAgent.js +0 -241
- package/stores/container-contents/syncAgent.js.map +0 -1
- package/stores/container-contents/syncAgentTypes.d.ts +0 -81
- package/stores/container-contents/syncAgentTypes.js.map +0 -1
- package/stores/container-contents/syncLaneIteration.js +0 -237
- package/stores/container-contents/syncLaneIteration.js.map +0 -1
- package/stores/container-contents/systemContainerHydration.js +0 -30
- package/stores/container-contents/systemContainerHydration.js.map +0 -1
- package/stores/container-contents/systemContainerIcon.js +0 -42
- package/stores/container-contents/systemContainerIcon.js.map +0 -1
- package/stores/container-contents/systemContainerLookup.js.map +0 -1
- package/stores/container-contents/systemContainerPostCreate.js +0 -109
- package/stores/container-contents/systemContainerPostCreate.js.map +0 -1
- package/stores/container-contents/systemContainerPromotion.js +0 -49
- package/stores/container-contents/systemContainerPromotion.js.map +0 -1
- package/stores/container-contents/writeGeneration.js.map +0 -1
- package/stores/documents/documentStore/attachmentDetachState.js +0 -54
- package/stores/documents/documentStore/attachmentDetachState.js.map +0 -1
- package/stores/documents/documentStore/attachmentHydration.js +0 -90
- package/stores/documents/documentStore/attachmentHydration.js.map +0 -1
- package/stores/documents/documentStore/attachmentHydrationCommit.js +0 -53
- package/stores/documents/documentStore/attachmentHydrationCommit.js.map +0 -1
- package/stores/documents/documentStore/attachmentIntents.js +0 -39
- package/stores/documents/documentStore/attachmentIntents.js.map +0 -1
- package/stores/documents/documentStore/attachmentMutationPersistence.js +0 -37
- package/stores/documents/documentStore/attachmentMutationPersistence.js.map +0 -1
- package/stores/documents/documentStore/attachmentPersistFollowup.js.map +0 -1
- package/stores/documents/documentStore/attachmentPersistence.js +0 -106
- package/stores/documents/documentStore/attachmentPersistence.js.map +0 -1
- package/stores/documents/documentStore/attachmentRemoval.js +0 -136
- package/stores/documents/documentStore/attachmentRemoval.js.map +0 -1
- package/stores/documents/documentStore/attachmentSnapshot.js.map +0 -1
- package/stores/documents/documentStore/attachmentSourceUpload.js +0 -39
- package/stores/documents/documentStore/attachmentSourceUpload.js.map +0 -1
- package/stores/documents/documentStore/attachmentStaging.js +0 -84
- package/stores/documents/documentStore/attachmentStaging.js.map +0 -1
- package/stores/documents/documentStore/attachmentUploadAttempt.js +0 -97
- package/stores/documents/documentStore/attachmentUploadAttempt.js.map +0 -1
- package/stores/documents/documentStore/attachmentUploadLane.js +0 -49
- package/stores/documents/documentStore/attachmentUploadLane.js.map +0 -1
- package/stores/documents/documentStore/attachmentUploadResume.js +0 -95
- package/stores/documents/documentStore/attachmentUploadResume.js.map +0 -1
- package/stores/documents/documentStore/attachmentWriteGeneration.js +0 -32
- package/stores/documents/documentStore/attachmentWriteGeneration.js.map +0 -1
- package/stores/documents/documentStore/attachments.js +0 -241
- package/stores/documents/documentStore/attachments.js.map +0 -1
- package/stores/documents/documentStore/deferredInitialUpdate.js +0 -116
- package/stores/documents/documentStore/deferredInitialUpdate.js.map +0 -1
- package/stores/documents/documentStore/documentHistoryCompaction.js +0 -67
- package/stores/documents/documentStore/documentHistoryCompaction.js.map +0 -1
- package/stores/documents/documentStore/durableDocumentReload.js +0 -79
- package/stores/documents/documentStore/durableDocumentReload.js.map +0 -1
- package/stores/documents/documentStore/historyRebuild.js +0 -75
- package/stores/documents/documentStore/historyRebuild.js.map +0 -1
- package/stores/documents/documentStore/initialization.js +0 -330
- package/stores/documents/documentStore/initialization.js.map +0 -1
- package/stores/documents/documentStore/initializationAttachments.js +0 -9
- package/stores/documents/documentStore/initializationAttachments.js.map +0 -1
- package/stores/documents/documentStore/initializationHistory.js +0 -33
- package/stores/documents/documentStore/initializationHistory.js.map +0 -1
- package/stores/documents/documentStore/initializationRecovery.js +0 -107
- package/stores/documents/documentStore/initializationRecovery.js.map +0 -1
- package/stores/documents/documentStore/pullContinuationInvalidation.js +0 -61
- package/stores/documents/documentStore/pullContinuationInvalidation.js.map +0 -1
- package/stores/documents/documentStore/remoteRevalidationTelemetry.js +0 -15
- package/stores/documents/documentStore/remoteRevalidationTelemetry.js.map +0 -1
- package/stores/documents/documentStore/remoteWork.js.map +0 -1
- package/stores/documents/documentStore/rotation.js +0 -307
- package/stores/documents/documentStore/rotation.js.map +0 -1
- package/stores/documents/documentStore/rotationProvenance.js +0 -52
- package/stores/documents/documentStore/rotationProvenance.js.map +0 -1
- package/stores/documents/documentStore/rotationSettlement.js +0 -222
- package/stores/documents/documentStore/rotationSettlement.js.map +0 -1
- package/stores/documents/documentStore/sync.js +0 -299
- package/stores/documents/documentStore/sync.js.map +0 -1
- package/stores/documents/documentStore/syncAcceptedUpdateIds.js.map +0 -1
- package/stores/documents/documentStore/syncAttachmentSettlement.js +0 -72
- package/stores/documents/documentStore/syncAttachmentSettlement.js.map +0 -1
- package/stores/documents/documentStore/syncAttachments.js +0 -323
- package/stores/documents/documentStore/syncAttachments.js.map +0 -1
- package/stores/documents/documentStore/syncDetachedAttachments.js +0 -129
- package/stores/documents/documentStore/syncDetachedAttachments.js.map +0 -1
- package/stores/documents/documentStore/syncFinalize.js +0 -204
- package/stores/documents/documentStore/syncFinalize.js.map +0 -1
- package/stores/documents/documentStore/syncGeneration.js.map +0 -1
- package/stores/documents/documentStore/syncOutgoingCoverage.js +0 -96
- package/stores/documents/documentStore/syncOutgoingCoverage.js.map +0 -1
- package/stores/documents/documentStore/syncRemoteSignals.js +0 -67
- package/stores/documents/documentStore/syncRemoteSignals.js.map +0 -1
- package/stores/documents/documentStore/syncRequest.js +0 -157
- package/stores/documents/documentStore/syncRequest.js.map +0 -1
- package/stores/documents/documentStore/syncShared.js +0 -211
- package/stores/documents/documentStore/syncShared.js.map +0 -1
- package/stores/documents/documentStore/syncUpdateImport.js +0 -62
- package/stores/documents/documentStore/syncUpdateImport.js.map +0 -1
- package/stores/documents/documentStore/versionCoverage.js +0 -45
- package/stores/documents/documentStore.d.ts +0 -8
- package/stores/documents/documentStore.js +0 -215
- package/stores/documents/documentStore.js.map +0 -1
- package/workflows/container-contents/container-state/createAdoption.js +0 -193
- package/workflows/container-contents/container-state/createAdoption.js.map +0 -1
- package/workflows/container-contents/container-state/createChild.js +0 -217
- package/workflows/container-contents/container-state/createChild.js.map +0 -1
- package/workflows/container-contents/container-state/createIntentDepth.js +0 -36
- package/workflows/container-contents/container-state/createIntentDepth.js.map +0 -1
- package/workflows/container-contents/container-state/createIntentSettlement.js.map +0 -1
- package/workflows/container-contents/container-state/createIntentSync.js +0 -354
- package/workflows/container-contents/container-state/createIntentSync.js.map +0 -1
- package/workflows/container-contents/container-state/createTerminalFailure.js +0 -19
- package/workflows/container-contents/container-state/createTerminalFailure.js.map +0 -1
- package/workflows/container-contents/container-state/createWithMetadata.js +0 -270
- package/workflows/container-contents/container-state/createWithMetadata.js.map +0 -1
- package/workflows/container-contents/container-state/createWithMetadataPlan.js +0 -68
- package/workflows/container-contents/container-state/createWithMetadataPlan.js.map +0 -1
- package/workflows/container-contents/container-state/groupGrantVerification.js +0 -71
- package/workflows/container-contents/container-state/groupGrantVerification.js.map +0 -1
- package/workflows/container-contents/container-state/groupShareEpoch.js +0 -16
- package/workflows/container-contents/container-state/groupShareEpoch.js.map +0 -1
- package/workflows/container-contents/container-state/localPurgeScope.js +0 -49
- package/workflows/container-contents/container-state/localPurgeScope.js.map +0 -1
- package/workflows/container-contents/container-state/purgeTree.js +0 -298
- package/workflows/container-contents/container-state/purgeTree.js.map +0 -1
- package/workflows/container-contents/container-state/purgeTreeCollection.js.map +0 -1
- package/workflows/container-contents/container-state/purgeTreeContainerDeletion.js +0 -75
- package/workflows/container-contents/container-state/purgeTreeContainerDeletion.js.map +0 -1
- package/workflows/container-contents/container-state/purgeTreeScope.js +0 -175
- package/workflows/container-contents/container-state/purgeTreeScope.js.map +0 -1
- package/workflows/container-contents/container-state/readLocalPurgeScope.js +0 -18
- package/workflows/container-contents/container-state/readLocalPurgeScope.js.map +0 -1
- package/workflows/container-contents/container-state/share.js +0 -283
- package/workflows/container-contents/container-state/share.js.map +0 -1
- package/workflows/container-contents/container-state/sharePersistence.js +0 -136
- package/workflows/container-contents/container-state/sharePersistence.js.map +0 -1
- package/workflows/container-contents/remoteHydration/childIndex.js.map +0 -1
- package/workflows/container-contents/remoteHydration/containerStateFingerprint.js.map +0 -1
- package/workflows/container-contents/remoteHydration/destinationPrefetch.js.map +0 -1
- package/workflows/container-contents/remoteHydration/destinationRoleCache.js.map +0 -1
- package/workflows/container-contents/remoteHydration/destinationRootReload.js +0 -10
- package/workflows/container-contents/remoteHydration/destinationRootReload.js.map +0 -1
- package/workflows/container-contents/remoteHydration/insertRemoteContainer.js +0 -135
- package/workflows/container-contents/remoteHydration/insertRemoteContainer.js.map +0 -1
- package/workflows/container-contents/remoteHydration/laneFetchMarkers.js +0 -21
- package/workflows/container-contents/remoteHydration/laneFetchMarkers.js.map +0 -1
- package/workflows/container-contents/remoteHydration/parentLaneFetch.js +0 -61
- package/workflows/container-contents/remoteHydration/parentLaneFetch.js.map +0 -1
- package/workflows/container-contents/remoteHydration/parentLaneQueue.js.map +0 -1
- package/workflows/container-contents/remoteHydration/remoteContainerPageHydration.js +0 -244
- package/workflows/container-contents/remoteHydration/remoteContainerPageHydration.js.map +0 -1
- package/workflows/container-contents/remoteHydration/remoteContainerState.js +0 -263
- package/workflows/container-contents/remoteHydration/remoteContainerState.js.map +0 -1
- package/workflows/container-contents/remoteHydration/remoteContainerTimestamps.js.map +0 -1
- package/workflows/container-contents/remoteHydration/replacementBinding.js +0 -75
- package/workflows/container-contents/remoteHydration/replacementBinding.js.map +0 -1
- package/workflows/container-contents/remoteHydration/verifiedDestination.js +0 -296
- package/workflows/container-contents/remoteHydration/verifiedDestination.js.map +0 -1
- package/workflows/containers/child/carriedDescendantRekeys.js +0 -126
- package/workflows/containers/child/carriedDescendantRekeys.js.map +0 -1
- package/workflows/containers/child/create.d.ts +0 -24
- package/workflows/containers/child/create.js +0 -335
- package/workflows/containers/child/create.js.map +0 -1
- package/workflows/containers/child/createProjection.d.ts +0 -6
- package/workflows/containers/child/createProjection.js +0 -43
- package/workflows/containers/child/createProjection.js.map +0 -1
- package/workflows/containers/child/createSubmission.d.ts +0 -56
- package/workflows/containers/child/createSubmission.js +0 -43
- package/workflows/containers/child/createSubmission.js.map +0 -1
- package/workflows/containers/child/currentShareGrantMutation.js +0 -82
- package/workflows/containers/child/currentShareGrantMutation.js.map +0 -1
- package/workflows/containers/child/currentSharePrincipalPolicy.js +0 -83
- package/workflows/containers/child/currentSharePrincipalPolicy.js.map +0 -1
- package/workflows/containers/child/keyringOverrideLineage.d.ts +0 -22
- package/workflows/containers/child/keyringOverrideLineage.js +0 -39
- package/workflows/containers/child/move.d.ts +0 -23
- package/workflows/containers/child/move.js +0 -268
- package/workflows/containers/child/move.js.map +0 -1
- package/workflows/containers/child/moveArtifacts.js +0 -102
- package/workflows/containers/child/moveArtifacts.js.map +0 -1
- package/workflows/containers/child/moveRotation.js +0 -88
- package/workflows/containers/child/moveRotation.js.map +0 -1
- package/workflows/containers/child/moveWraps.js +0 -49
- package/workflows/containers/child/moveWraps.js.map +0 -1
- package/workflows/containers/child/rekey.d.ts +0 -32
- package/workflows/containers/child/rekey.js +0 -227
- package/workflows/containers/child/rekey.js.map +0 -1
- package/workflows/containers/child/rekeyProjection.d.ts +0 -46
- package/workflows/containers/child/rekeyProjection.js +0 -151
- package/workflows/containers/child/rekeyProjection.js.map +0 -1
- package/workflows/containers/child/rekeyRemote.d.ts +0 -24
- package/workflows/containers/child/rekeyRemote.js +0 -64
- package/workflows/containers/child/rekeyRemote.js.map +0 -1
- package/workflows/containers/child/replacementPrincipalPolicyReferences.js +0 -19
- package/workflows/containers/child/replacementPrincipalPolicyReferences.js.map +0 -1
- package/workflows/containers/child/rotationContext.js +0 -64
- package/workflows/containers/child/rotationContext.js.map +0 -1
- package/workflows/containers/child/rotationPrincipalPolicies.js +0 -19
- package/workflows/containers/child/rotationPrincipalPolicies.js.map +0 -1
- package/workflows/containers/child/rotationWraps.js +0 -85
- package/workflows/containers/child/rotationWraps.js.map +0 -1
- package/workflows/containers/child/runtimeCurrentGroupShare.js +0 -79
- package/workflows/containers/child/runtimeCurrentGroupShare.js.map +0 -1
- package/workflows/containers/child/share.d.ts +0 -65
- package/workflows/containers/child/share.js +0 -256
- package/workflows/containers/child/share.js.map +0 -1
- package/workflows/containers/child/shareAncestorRepair.js +0 -95
- package/workflows/containers/child/shareAncestorRepair.js.map +0 -1
- package/workflows/containers/child/shareMaterialization.d.ts +0 -25
- package/workflows/containers/child/shareMaterialization.js +0 -164
- package/workflows/containers/child/shareMaterialization.js.map +0 -1
- package/workflows/containers/child/sharePlanCore.d.ts +0 -82
- package/workflows/containers/child/sharePlanCore.js +0 -191
- package/workflows/containers/child/sharePlanCore.js.map +0 -1
- package/workflows/containers/child/sharePrincipalPolicy.d.ts +0 -51
- package/workflows/containers/child/sharePrincipalPolicy.js +0 -194
- package/workflows/containers/child/sharePrincipalPolicy.js.map +0 -1
- package/workflows/containers/child/shareProjection.js.map +0 -1
- /package/data/documents/shared/{containerKekCurrency.js → containerKek/containerKekCurrency.js} +0 -0
- /package/data/documents/shared/{containerKekCurrency.js.map → containerKek/containerKekCurrency.js.map} +0 -0
- /package/data/documents/shared/{containerKekEntryVerification.js.map → containerKek/containerKekEntryVerification.js.map} +0 -0
- /package/data/documents/shared/{containerKekLogFetch.js.map → containerKek/containerKekLogFetch.js.map} +0 -0
- /package/data/documents/shared/{containerKekPath.d.ts → containerKek/containerKekPath.d.ts} +0 -0
- /package/data/documents/shared/{keyringLogWalk.js.map → containerKek/keyringLogWalk.js.map} +0 -0
- /package/data/documents/shared/{pullContinuation.d.ts → sync/pullContinuation.d.ts} +0 -0
- /package/data/documents/shared/{pullContinuation.js.map → sync/pullContinuation.js.map} +0 -0
- /package/data/documents/shared/{syncSubmitFailure.js → sync/syncSubmitFailure.js} +0 -0
- /package/data/documents/shared/{syncSubmitFailure.js.map → sync/syncSubmitFailure.js.map} +0 -0
- /package/data/keyingProjectionVerification/{containerCreateManifest.js.map → container/containerCreateManifest.js.map} +0 -0
- /package/data/keyingProjectionVerification/{documentContainerProjections.js → document/documentContainerProjections.js} +0 -0
- /package/data/keyingProjectionVerification/{documentContainerProjections.js.map → document/documentContainerProjections.js.map} +0 -0
- /package/data/keyingProjectionVerification/{documentManifestPredecessor.js.map → document/documentManifestPredecessor.js.map} +0 -0
- /package/data/persistence/{keyingCheckpointEvidence.js.map → keyingCheckpoints/keyingCheckpointEvidence.js.map} +0 -0
- /package/data/persistence/{storedPrincipalPolicyBundle.js → principalPolicy/storedPrincipalPolicyBundle.js} +0 -0
- /package/data/persistence/{storedPrincipalPolicyBundle.js.map → principalPolicy/storedPrincipalPolicyBundle.js.map} +0 -0
- /package/data/sqlite/{documentPersistenceTypes.js → documentPersistence/documentPersistenceTypes.js} +0 -0
- /package/data/sqlite/{containerDocumentTombstoneHoldSchema.d.ts → schema/containerDocumentTombstoneHoldSchema.d.ts} +0 -0
- /package/data/sqlite/{containerDocumentTombstoneHoldSchema.js → schema/containerDocumentTombstoneHoldSchema.js} +0 -0
- /package/data/sqlite/{containerDocumentTombstoneHoldSchema.js.map → schema/containerDocumentTombstoneHoldSchema.js.map} +0 -0
- /package/data/sqlite/{documentAttachmentSchema.d.ts → schema/documentAttachmentSchema.d.ts} +0 -0
- /package/data/sqlite/{documentAttachmentSchema.js → schema/documentAttachmentSchema.js} +0 -0
- /package/data/sqlite/{documentAttachmentSchema.js.map → schema/documentAttachmentSchema.js.map} +0 -0
- /package/data/sqlite/{documentDiscoveryEvidenceSchema.js → schema/documentDiscoveryEvidenceSchema.js} +0 -0
- /package/data/sqlite/{documentDiscoveryEvidenceSchema.js.map → schema/documentDiscoveryEvidenceSchema.js.map} +0 -0
- /package/data/sqlite/{documentPlacementIntentSchema.js → schema/documentPlacementIntentSchema.js} +0 -0
- /package/data/sqlite/{documentPlacementIntentSchema.js.map → schema/documentPlacementIntentSchema.js.map} +0 -0
- /package/data/sqlite/{localIntentSchema.d.ts → schema/localIntentSchema.d.ts} +0 -0
- /package/data/sqlite/{localIntentSchema.js → schema/localIntentSchema.js} +0 -0
- /package/data/sqlite/{localIntentSchema.js.map → schema/localIntentSchema.js.map} +0 -0
- /package/data/sqlite/{organizationFounderSchema.js → schema/organizationFounderSchema.js} +0 -0
- /package/data/sqlite/{organizationFounderSchema.js.map → schema/organizationFounderSchema.js.map} +0 -0
- /package/data/sqlite/{organizationReadModelSchema.js → schema/organizationReadModelSchema.js} +0 -0
- /package/data/sqlite/{organizationReadModelSchema.js.map → schema/organizationReadModelSchema.js.map} +0 -0
- /package/data/sqlite/{principalGrantRetirementSchema.js → schema/principalGrantRetirementSchema.js} +0 -0
- /package/data/sqlite/{principalGrantRetirementSchema.js.map → schema/principalGrantRetirementSchema.js.map} +0 -0
- /package/data/sqlite/{principalPolicySchema.d.ts → schema/principalPolicySchema.d.ts} +0 -0
- /package/stores/container-contents/{containerStateMap.js → containerState/containerStateMap.js} +0 -0
- /package/stores/container-contents/{missingSyncedContainerState.js → containerState/missingSyncedContainerState.js} +0 -0
- /package/stores/container-contents/{reconcilableContainer.js → containerState/reconcilableContainer.js} +0 -0
- /package/stores/container-contents/{remoteHydrationRefresh.js → hydration/remoteHydrationRefresh.js} +0 -0
- /package/stores/container-contents/{remoteHydrationRefresh.js.map → hydration/remoteHydrationRefresh.js.map} +0 -0
- /package/stores/container-contents/{emptyTrashOperation.js → operations/emptyTrashOperation.js} +0 -0
- /package/stores/container-contents/{purgeContainerOperation.js → operations/purgeContainerOperation.js} +0 -0
- /package/stores/container-contents/{remoteBackedContainerState.js → remoteEvents/remoteBackedContainerState.js} +0 -0
- /package/stores/container-contents/{writeGeneration.js → remoteWrites/writeGeneration.js} +0 -0
- /package/stores/container-contents/{syncAgentTypes.js → syncAgent/syncAgentTypes.js} +0 -0
- /package/stores/container-contents/{systemContainerLookup.js → systemContainers/systemContainerLookup.js} +0 -0
- /package/stores/documents/documentStore/{attachmentPersistFollowup.js → attachments/attachmentPersistFollowup.js} +0 -0
- /package/stores/documents/documentStore/{attachmentSnapshot.js → attachments/attachmentSnapshot.js} +0 -0
- /package/stores/documents/documentStore/{remoteWork.js → sync/remoteWork.js} +0 -0
- /package/stores/documents/documentStore/{syncAcceptedUpdateIds.js → sync/syncAcceptedUpdateIds.js} +0 -0
- /package/stores/documents/documentStore/{syncGeneration.js → sync/syncGeneration.js} +0 -0
- /package/stores/documents/documentStore/{versionCoverage.js.map → sync/versionCoverage.js.map} +0 -0
- /package/workflows/container-contents/container-state/{createIntentSettlement.js → create/createIntentSettlement.js} +0 -0
- /package/workflows/container-contents/container-state/{purgeProgress.d.ts → purge/purgeProgress.d.ts} +0 -0
- /package/workflows/container-contents/container-state/{purgeProgress.js → purge/purgeProgress.js} +0 -0
- /package/workflows/container-contents/container-state/{purgeProgress.js.map → purge/purgeProgress.js.map} +0 -0
- /package/workflows/container-contents/container-state/{purgeTreeCollection.js → purge/purgeTreeCollection.js} +0 -0
- /package/workflows/container-contents/remoteHydration/{destinationPrefetch.js → destination/destinationPrefetch.js} +0 -0
- /package/workflows/container-contents/remoteHydration/{destinationRoleCache.js → destination/destinationRoleCache.js} +0 -0
- /package/workflows/container-contents/remoteHydration/{childIndex.js → lanes/childIndex.js} +0 -0
- /package/workflows/container-contents/remoteHydration/{parentLaneQueue.js → lanes/parentLaneQueue.js} +0 -0
- /package/workflows/container-contents/remoteHydration/{containerStateFingerprint.js → remoteContainers/containerStateFingerprint.js} +0 -0
- /package/workflows/container-contents/remoteHydration/{remoteContainerTimestamps.js → remoteContainers/remoteContainerTimestamps.js} +0 -0
- /package/workflows/containers/child/{keyringOverrideLineage.js.map → rekey/keyringOverrideLineage.js.map} +0 -0
- /package/workflows/containers/child/{shareProjection.js → share/shareProjection.js} +0 -0
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { encodeVersionVector, exportFullHistorySnapshot, } from "../../../internal/loro/index.js";
|
|
2
|
-
import { createDocumentWriterPublicKeyResolver, deletePersistedDocument, resolveDocumentCreateAuthor, syncRemoteDocument, validateDocumentSyncUpdateImports, } from "../../../workflows/documents/index.js";
|
|
3
|
-
import { createRuntimePrincipalPolicyWarmer } from "../../../workflows/principals/runtimePolicyWarmer.js";
|
|
4
|
-
import { requestDocumentStoreSync } from "../registry.js";
|
|
5
|
-
import { parkForAncestorRepair } from "./ancestorRepairPark.js";
|
|
6
|
-
import { chainIdentityWrite } from "./identityWriteChain.js";
|
|
7
|
-
import { runDocumentOrphanMaintenance } from "./orphanMaintenance.js";
|
|
8
|
-
import { invalidateDocumentStorePullContinuation } from "./pullContinuationInvalidation.js";
|
|
9
|
-
import { markDocumentStoreRemoved, } from "./state.js";
|
|
10
|
-
import { isDocumentStoreSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
11
|
-
import { documentIncomingUpdateIsolationFailureHandler, documentRevalidationFailureHandler, documentTerminalSubmitFailureHandler, } from "./syncShared.js";
|
|
12
|
-
import { documentSyncContextMatches } from "./syncUpdateImport.js";
|
|
13
|
-
/**
|
|
14
|
-
* Destroying queued local edits here is settled policy, not an oversight
|
|
15
|
-
* (docs/sync-edge-cases.md row 1): deletion is a privacy operation, so an
|
|
16
|
-
* authoritative remote delete removes the document and its unsynced edits
|
|
17
|
-
* everywhere with no preservation copy. Quarantine/export were rejected —
|
|
18
|
-
* they retain or re-upload content the user deliberately destroyed.
|
|
19
|
-
*/
|
|
20
|
-
export async function deleteUpstreamDeletedDocument(state, generation, requestRecord, remoteDocumentId, commitPurgeProof) {
|
|
21
|
-
await chainIdentityWrite(state, async () => {
|
|
22
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, generation) ||
|
|
23
|
-
!documentSyncContextMatches(state.record, requestRecord, remoteDocumentId)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const canDeleteCapturedDocument = () => isDocumentStoreSyncGenerationCurrent(state, generation) &&
|
|
27
|
-
documentSyncContextMatches(state.record, requestRecord, remoteDocumentId);
|
|
28
|
-
let removedInMutation = false;
|
|
29
|
-
const deletionStarted = await deletePersistedDocument({
|
|
30
|
-
beforeDeleteInTransaction: commitPurgeProof,
|
|
31
|
-
canStartDurableMutation: canDeleteCapturedDocument,
|
|
32
|
-
documentProjectors: state.runtime.infra.documentProjectors,
|
|
33
|
-
execSql: generation.execSql,
|
|
34
|
-
expectedRecord: requestRecord,
|
|
35
|
-
localId: requestRecord.id,
|
|
36
|
-
// Invalidate the store generation INSIDE the deletion mutation: a
|
|
37
|
-
// terminal failure handler queued behind it then observes the stale
|
|
38
|
-
// generation and cannot resurrect a failure row the deletes removed.
|
|
39
|
-
onDeletedInMutation: () => {
|
|
40
|
-
if (canDeleteCapturedDocument()) {
|
|
41
|
-
markDocumentStoreRemoved(state);
|
|
42
|
-
removedInMutation = true;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
persistence: state.persistence,
|
|
46
|
-
});
|
|
47
|
-
if (!deletionStarted || !removedInMutation) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
void runDocumentOrphanMaintenance(state);
|
|
51
|
-
state.runtime.util.log(`Documents: removed local document ${state.localId} after remote deletion.`);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function createDocumentSyncAttempt(input) {
|
|
55
|
-
return {
|
|
56
|
-
consumedPullContinuation: input.synced.plan.request.pullCursor === undefined
|
|
57
|
-
? null
|
|
58
|
-
: input.requestedPullContinuation,
|
|
59
|
-
outgoingUpdateCount: input.outgoingUpdateCount,
|
|
60
|
-
requestRecord: input.currentRecord,
|
|
61
|
-
synced: input.synced,
|
|
62
|
-
writerProjectionGeneration: input.writerProjectionGeneration,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function runRemoteDocumentSync(input, author, documentId, requestedPullContinuation) {
|
|
66
|
-
const { currentDoc, currentRecord, generation, pendingUpdates, state } = input;
|
|
67
|
-
const runtime = state.runtime;
|
|
68
|
-
const writerProjectionGenerationAtStart = state.writerProjectionGeneration;
|
|
69
|
-
state.awaitingAncestorRepair = false;
|
|
70
|
-
return syncRemoteDocument({
|
|
71
|
-
apiClient: runtime.apiClient,
|
|
72
|
-
author,
|
|
73
|
-
// Heal a stale content-key bundle from this full-history snapshot. Rotation
|
|
74
|
-
// settlement disables this: it may submit only the ordinary local stream.
|
|
75
|
-
...(input.allowRecoveryBaseline === false
|
|
76
|
-
? {}
|
|
77
|
-
: {
|
|
78
|
-
buildRotationSnapshot: async () => exportFullHistorySnapshot(currentDoc),
|
|
79
|
-
}),
|
|
80
|
-
documentId,
|
|
81
|
-
execSql: runtime.infra.execSql,
|
|
82
|
-
isRemoteSyncBlocked: runtime.util.isRemoteSyncBlocked,
|
|
83
|
-
localVersionVector: encodeVersionVector(currentDoc),
|
|
84
|
-
minLsn: currentRecord.lastCommitLsn ?? undefined,
|
|
85
|
-
onRemoteDocumentDeleted: ({ commitPurgeProof, documentId }) => deleteUpstreamDeletedDocument(state, generation, currentRecord, documentId, commitPurgeProof),
|
|
86
|
-
onSyncAbandoned: (reason) => {
|
|
87
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, generation))
|
|
88
|
-
return;
|
|
89
|
-
const hintLandedMidPass = parkForAncestorRepair(state, reason, writerProjectionGenerationAtStart);
|
|
90
|
-
if (hintLandedMidPass)
|
|
91
|
-
requestDocumentStoreSync(state);
|
|
92
|
-
},
|
|
93
|
-
onSyncTrace: (line) => runtime.util.log(`Documents: ${line}`),
|
|
94
|
-
onReadOnlyProjectionFailure: documentRevalidationFailureHandler(state, generation),
|
|
95
|
-
onIncomingUpdateIsolationFailure: documentIncomingUpdateIsolationFailureHandler(state, generation),
|
|
96
|
-
onOutgoingUpdatesMaterialized: input.onOutgoingUpdatesMaterialized,
|
|
97
|
-
onPullContinuationInvalidated: (continuation) => invalidateDocumentStorePullContinuation({
|
|
98
|
-
continuation,
|
|
99
|
-
currentRecord,
|
|
100
|
-
generation,
|
|
101
|
-
state,
|
|
102
|
-
}),
|
|
103
|
-
onTerminalSubmitFailure: documentTerminalSubmitFailureHandler(state, generation),
|
|
104
|
-
pendingUpdates,
|
|
105
|
-
persistedState: currentRecord,
|
|
106
|
-
pullContinuation: requestedPullContinuation ?? undefined,
|
|
107
|
-
rekeyPendingUpdate: state.persistence.rekeyPendingUpdate,
|
|
108
|
-
resolveProjectionUserKey: state.resolveProjectionUserKey,
|
|
109
|
-
resolveWriterPublicKey: createDocumentWriterPublicKeyResolver({
|
|
110
|
-
logPrefix: "Documents",
|
|
111
|
-
runtime,
|
|
112
|
-
writerKeyLabel: "writer key",
|
|
113
|
-
}),
|
|
114
|
-
stillCurrent: () => isDocumentStoreSyncGenerationCurrent(state, generation),
|
|
115
|
-
targetSecretKey: input.encapsulationKeyPair.secretKey,
|
|
116
|
-
validateIncomingUpdates: (result) => validateDocumentSyncUpdateImports({
|
|
117
|
-
currentDocument: currentDoc,
|
|
118
|
-
decryptedUpdates: result.decryptedUpdates,
|
|
119
|
-
responseUpdates: result.response.updates,
|
|
120
|
-
}),
|
|
121
|
-
warmReferencedPrincipalPolicies: createRuntimePrincipalPolicyWarmer(runtime),
|
|
122
|
-
writerProjection: state.writerProjection?.documentId === currentRecord.documentId
|
|
123
|
-
? state.writerProjection
|
|
124
|
-
: undefined,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
export async function requestRemoteDocumentSync(input) {
|
|
128
|
-
const { currentRecord, generation, pendingUpdates, state, unavailableWriterLogMessage, } = input;
|
|
129
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, generation))
|
|
130
|
-
return null;
|
|
131
|
-
// Captured before the network round trip: a hint that lands meanwhile
|
|
132
|
-
// must keep the response's projection out of the cache.
|
|
133
|
-
const writerProjectionGeneration = state.writerProjectionGeneration;
|
|
134
|
-
const runtime = state.runtime;
|
|
135
|
-
if (!currentRecord.documentId)
|
|
136
|
-
return null;
|
|
137
|
-
const requestedPullContinuation = state.pullContinuation;
|
|
138
|
-
const author = resolveDocumentCreateAuthor(runtime);
|
|
139
|
-
if (!author) {
|
|
140
|
-
runtime.util.log(unavailableWriterLogMessage);
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
const synced = await runRemoteDocumentSync(input, author, currentRecord.documentId, requestedPullContinuation);
|
|
144
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, generation))
|
|
145
|
-
return null;
|
|
146
|
-
if (!synced)
|
|
147
|
-
return null;
|
|
148
|
-
const outgoingUpdateCount = input.queuedUpdateCount ?? pendingUpdates.length;
|
|
149
|
-
return createDocumentSyncAttempt({
|
|
150
|
-
currentRecord,
|
|
151
|
-
outgoingUpdateCount,
|
|
152
|
-
requestedPullContinuation,
|
|
153
|
-
synced,
|
|
154
|
-
writerProjectionGeneration,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=syncRequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncRequest.js","sourceRoot":"","sources":["syncRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qCAAqC,EAErC,uBAAuB,EAGvB,2BAA2B,EAC3B,kBAAkB,EAClB,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AACvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,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B,IAAI,CAAC,aAAa,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE3C,MAAM,yBAAyB,GAAG,KAAK,CAAC,gBAAgB,CAAC;IAEzD,MAAM,MAAM,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,qBAAqB,CACxC,KAAK,EACL,MAAM,EACN,aAAa,CAAC,UAAU,EACxB,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,oCAAoC,CAAC,KAAK,EAAE,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1E,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,mBAAmB,GAAG,KAAK,CAAC,iBAAiB,IAAI,cAAc,CAAC,MAAM,CAAC;IAC7E,OAAO,yBAAyB,CAAC;QAC/B,aAAa;QACb,mBAAmB;QACnB,yBAAyB;QACzB,MAAM;QACN,0BAA0B;KAC3B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n encodeVersionVector,\n exportFullHistorySnapshot,\n} from \"@tearleads/loro\";\nimport {\n createDocumentWriterPublicKeyResolver,\n type DocumentRecord,\n deletePersistedDocument,\n type ExecSql,\n type PendingUpdateRecord,\n resolveDocumentCreateAuthor,\n syncRemoteDocument,\n validateDocumentSyncUpdateImports,\n} from \"../../../workflows/documents\";\nimport { createRuntimePrincipalPolicyWarmer } from \"../../../workflows/principals/runtimePolicyWarmer\";\nimport { requestDocumentStoreSync } from \"../registry\";\nimport { parkForAncestorRepair } from \"./ancestorRepairPark\";\nimport { chainIdentityWrite } from \"./identityWriteChain\";\nimport { runDocumentOrphanMaintenance } from \"./orphanMaintenance\";\nimport { invalidateDocumentStorePullContinuation } from \"./pullContinuationInvalidation\";\nimport {\n type DocumentState,\n type DocumentStoreState,\n type DocumentSyncAttempt,\n type EncapsulationKeyPair,\n markDocumentStoreRemoved,\n} from \"./state\";\nimport {\n type DocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent,\n} from \"./syncGeneration\";\nimport {\n documentIncomingUpdateIsolationFailureHandler,\n documentRevalidationFailureHandler,\n documentTerminalSubmitFailureHandler,\n} from \"./syncShared\";\nimport { documentSyncContextMatches } from \"./syncUpdateImport\";\n\n/**\n * Destroying queued local edits here is settled policy, not an oversight\n * (docs/sync-edge-cases.md row 1): deletion is a privacy operation, so an\n * authoritative remote delete removes the document and its unsynced edits\n * everywhere with no preservation copy. Quarantine/export were rejected —\n * they retain or re-upload content the user deliberately destroyed.\n */\nexport async function deleteUpstreamDeletedDocument(\n state: DocumentStoreState,\n generation: DocumentStoreSyncGeneration,\n requestRecord: DocumentRecord,\n remoteDocumentId: string,\n commitPurgeProof?: (transactionExecSql: ExecSql) => Promise<void>,\n) {\n await chainIdentityWrite(state, async () => {\n if (\n !isDocumentStoreSyncGenerationCurrent(state, generation) ||\n !documentSyncContextMatches(state.record, requestRecord, remoteDocumentId)\n ) {\n return;\n }\n\n const canDeleteCapturedDocument = () =>\n isDocumentStoreSyncGenerationCurrent(state, generation) &&\n documentSyncContextMatches(state.record, requestRecord, remoteDocumentId);\n let removedInMutation = false;\n const deletionStarted = await deletePersistedDocument({\n beforeDeleteInTransaction: commitPurgeProof,\n canStartDurableMutation: canDeleteCapturedDocument,\n documentProjectors: state.runtime.infra.documentProjectors,\n execSql: generation.execSql,\n expectedRecord: requestRecord,\n localId: requestRecord.id,\n // Invalidate the store generation INSIDE the deletion mutation: a\n // terminal failure handler queued behind it then observes the stale\n // generation and cannot resurrect a failure row the deletes removed.\n onDeletedInMutation: () => {\n if (canDeleteCapturedDocument()) {\n markDocumentStoreRemoved(state);\n removedInMutation = true;\n }\n },\n persistence: state.persistence,\n });\n if (!deletionStarted || !removedInMutation) {\n return;\n }\n void runDocumentOrphanMaintenance(state);\n state.runtime.util.log(\n `Documents: removed local document ${state.localId} after remote deletion.`,\n );\n });\n}\n\nfunction createDocumentSyncAttempt(input: {\n currentRecord: DocumentRecord;\n outgoingUpdateCount: number;\n requestedPullContinuation: DocumentStoreState[\"pullContinuation\"];\n synced: DocumentSyncAttempt[\"synced\"];\n writerProjectionGeneration: number;\n}): DocumentSyncAttempt {\n return {\n consumedPullContinuation:\n input.synced.plan.request.pullCursor === undefined\n ? null\n : input.requestedPullContinuation,\n outgoingUpdateCount: input.outgoingUpdateCount,\n requestRecord: input.currentRecord,\n synced: input.synced,\n writerProjectionGeneration: input.writerProjectionGeneration,\n };\n}\n\ninterface RequestRemoteDocumentSyncInput {\n allowRecoveryBaseline?: boolean | undefined;\n currentDoc: DocumentState;\n currentRecord: DocumentRecord;\n encapsulationKeyPair: EncapsulationKeyPair;\n generation: DocumentStoreSyncGeneration;\n onOutgoingUpdatesMaterialized?:\n | ((updateIds: readonly string[]) => void)\n | undefined;\n pendingUpdates: PendingUpdateRecord[];\n queuedUpdateCount?: number | undefined;\n state: DocumentStoreState;\n unavailableWriterLogMessage: string;\n}\n\nfunction runRemoteDocumentSync(\n input: RequestRemoteDocumentSyncInput,\n author: NonNullable<ReturnType<typeof resolveDocumentCreateAuthor>>,\n documentId: string,\n requestedPullContinuation: DocumentStoreState[\"pullContinuation\"],\n) {\n const { currentDoc, currentRecord, generation, pendingUpdates, state } =\n input;\n const runtime = state.runtime;\n const writerProjectionGenerationAtStart = state.writerProjectionGeneration;\n state.awaitingAncestorRepair = false;\n return syncRemoteDocument({\n apiClient: runtime.apiClient,\n author,\n // Heal a stale content-key bundle from this full-history snapshot. Rotation\n // settlement disables this: it may submit only the ordinary local stream.\n ...(input.allowRecoveryBaseline === false\n ? {}\n : {\n buildRotationSnapshot: async () =>\n exportFullHistorySnapshot(currentDoc),\n }),\n documentId,\n execSql: runtime.infra.execSql,\n isRemoteSyncBlocked: runtime.util.isRemoteSyncBlocked,\n localVersionVector: encodeVersionVector(currentDoc),\n minLsn: currentRecord.lastCommitLsn ?? undefined,\n onRemoteDocumentDeleted: ({ commitPurgeProof, documentId }) =>\n deleteUpstreamDeletedDocument(\n state,\n generation,\n currentRecord,\n documentId,\n commitPurgeProof,\n ),\n onSyncAbandoned: (reason) => {\n if (!isDocumentStoreSyncGenerationCurrent(state, generation)) return;\n const hintLandedMidPass = parkForAncestorRepair(\n state,\n reason,\n writerProjectionGenerationAtStart,\n );\n if (hintLandedMidPass) requestDocumentStoreSync(state);\n },\n onSyncTrace: (line) => runtime.util.log(`Documents: ${line}`),\n onReadOnlyProjectionFailure: documentRevalidationFailureHandler(\n state,\n generation,\n ),\n onIncomingUpdateIsolationFailure:\n documentIncomingUpdateIsolationFailureHandler(state, generation),\n onOutgoingUpdatesMaterialized: input.onOutgoingUpdatesMaterialized,\n onPullContinuationInvalidated: (continuation) =>\n invalidateDocumentStorePullContinuation({\n continuation,\n currentRecord,\n generation,\n state,\n }),\n onTerminalSubmitFailure: documentTerminalSubmitFailureHandler(\n state,\n generation,\n ),\n pendingUpdates,\n persistedState: currentRecord,\n pullContinuation: requestedPullContinuation ?? undefined,\n rekeyPendingUpdate: state.persistence.rekeyPendingUpdate,\n resolveProjectionUserKey: state.resolveProjectionUserKey,\n resolveWriterPublicKey: createDocumentWriterPublicKeyResolver({\n logPrefix: \"Documents\",\n runtime,\n writerKeyLabel: \"writer key\",\n }),\n stillCurrent: () => isDocumentStoreSyncGenerationCurrent(state, generation),\n targetSecretKey: input.encapsulationKeyPair.secretKey,\n validateIncomingUpdates: (result) =>\n validateDocumentSyncUpdateImports({\n currentDocument: currentDoc,\n decryptedUpdates: result.decryptedUpdates,\n responseUpdates: result.response.updates,\n }),\n warmReferencedPrincipalPolicies:\n createRuntimePrincipalPolicyWarmer(runtime),\n writerProjection:\n state.writerProjection?.documentId === currentRecord.documentId\n ? state.writerProjection\n : undefined,\n });\n}\n\nexport async function requestRemoteDocumentSync(\n input: RequestRemoteDocumentSyncInput,\n): Promise<DocumentSyncAttempt | null> {\n const {\n currentRecord,\n generation,\n pendingUpdates,\n state,\n unavailableWriterLogMessage,\n } = input;\n if (!isDocumentStoreSyncGenerationCurrent(state, generation)) return null;\n // Captured before the network round trip: a hint that lands meanwhile\n // must keep the response's projection out of the cache.\n const writerProjectionGeneration = state.writerProjectionGeneration;\n\n const runtime = state.runtime;\n if (!currentRecord.documentId) return null;\n\n const requestedPullContinuation = state.pullContinuation;\n\n const author = resolveDocumentCreateAuthor(runtime);\n if (!author) {\n runtime.util.log(unavailableWriterLogMessage);\n return null;\n }\n\n const synced = await runRemoteDocumentSync(\n input,\n author,\n currentRecord.documentId,\n requestedPullContinuation,\n );\n if (!isDocumentStoreSyncGenerationCurrent(state, generation)) return null;\n if (!synced) return null;\n\n const outgoingUpdateCount = input.queuedUpdateCount ?? pendingUpdates.length;\n return createDocumentSyncAttempt({\n currentRecord,\n outgoingUpdateCount,\n requestedPullContinuation,\n synced,\n writerProjectionGeneration,\n });\n}\n"]}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { deriveStableDocumentId } from "../../../data/documents/shared/stableDocumentId.js";
|
|
2
|
-
import { createRemoteDocument, DOCUMENTS_APP_KIND, describeDocumentRevalidationFailure, describeDocumentSyncSubmitFailure, recordDocumentSyncFailure, resolveDocumentCreateAuthor, runSerializedSqlMutation, } from "../../../workflows/documents/index.js";
|
|
3
|
-
import { reportDocumentSyncQuarantine } from "../../../workflows/documents/sync/reportDocumentSyncQuarantine.js";
|
|
4
|
-
import { createRuntimePrincipalPolicyWarmer } from "../../../workflows/principals/runtimePolicyWarmer.js";
|
|
5
|
-
import { chainIdentityWrite } from "./identityWriteChain.js";
|
|
6
|
-
import { persistDocument } from "./persistence.js";
|
|
7
|
-
import { markDocumentStoreRemoved, } from "./state.js";
|
|
8
|
-
import { isDocumentStoreSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
9
|
-
import { installDocumentWriterProjection } from "./writerProjectionGeneration.js";
|
|
10
|
-
/**
|
|
11
|
-
* Record a refused read-only revalidation on this document's failure row, so
|
|
12
|
-
* a document that can never refresh stops failing silently (edge-case row
|
|
13
|
-
* 13). 403s stay suppressed on purpose — a read-only 403 must never flag
|
|
14
|
-
* unattempted local edits (row 9) — and the row clears on the next clean
|
|
15
|
-
* pass like every other sync failure.
|
|
16
|
-
*/
|
|
17
|
-
export function documentRevalidationFailureHandler(state, generation) {
|
|
18
|
-
return documentSyncFailureHandler({
|
|
19
|
-
describeFailure: describeDocumentRevalidationFailure,
|
|
20
|
-
generation,
|
|
21
|
-
state,
|
|
22
|
-
suppressForbidden: true,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Record a terminal submit failure on this document's write-queue row. Shared
|
|
27
|
-
* by every store pass that can submit queued writes (create and sync), so
|
|
28
|
-
* re-key exhaustion and denial failures surface no matter which pass hits
|
|
29
|
-
* them first.
|
|
30
|
-
*/
|
|
31
|
-
export function documentTerminalSubmitFailureHandler(state, generation) {
|
|
32
|
-
return documentSyncFailureHandler({
|
|
33
|
-
describeFailure: describeDocumentSyncSubmitFailure,
|
|
34
|
-
generation,
|
|
35
|
-
state,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/** Persist quarantine and report its Error through the host's diagnostics. */
|
|
39
|
-
export function documentIncomingUpdateIsolationFailureHandler(state, generation) {
|
|
40
|
-
const recordFailure = documentSyncFailureHandler({
|
|
41
|
-
describeFailure: (failure) => failure.message,
|
|
42
|
-
generation,
|
|
43
|
-
state,
|
|
44
|
-
});
|
|
45
|
-
return async (failure) => {
|
|
46
|
-
await recordFailure({ message: failure.message, status: null });
|
|
47
|
-
if (generation && !isDocumentStoreSyncGenerationCurrent(state, generation))
|
|
48
|
-
return;
|
|
49
|
-
reportDocumentSyncQuarantine(generation?.currentDoc ?? state.doc ?? state, state.runtime.util.logError, failure);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The generation recheck runs INSIDE the serialized mutation (like the
|
|
54
|
-
* attachment failure path): a teardown (discard/reset) that wins the ordering
|
|
55
|
-
* deletes this document's rows first and invalidates the generation, so a
|
|
56
|
-
* stale handler can never resurrect a deleted or orphan failure row
|
|
57
|
-
* afterwards.
|
|
58
|
-
*/
|
|
59
|
-
function documentSyncFailureHandler(input) {
|
|
60
|
-
const { generation, state } = input;
|
|
61
|
-
return async (failure) => {
|
|
62
|
-
if (input.suppressForbidden && failure.status === 403) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
await runSerializedSqlMutation(generation?.execSql ?? state.runtime.infra.execSql, async (lockedExecSql) => {
|
|
66
|
-
if (generation &&
|
|
67
|
-
!isDocumentStoreSyncGenerationCurrent(state, generation)) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
await recordDocumentSyncFailure(lockedExecSql, { appKind: DOCUMENTS_APP_KIND, localId: state.localId }, {
|
|
71
|
-
attemptedAt: new Date().toISOString(),
|
|
72
|
-
message: input.describeFailure(failure),
|
|
73
|
-
status: failure.status,
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function hasPersistedRemoteDocumentSyncState(record) {
|
|
79
|
-
return (record.lastCommitLsn !== null &&
|
|
80
|
-
record.contentKeyBundle !== null &&
|
|
81
|
-
record.documentKekTargets !== null &&
|
|
82
|
-
record.documentManifestBundle !== null);
|
|
83
|
-
}
|
|
84
|
-
export function shouldSkipCleanScheduledDocumentSync(input) {
|
|
85
|
-
return (input.pendingUpdates.length === 0 &&
|
|
86
|
-
input.state.pendingAttachments.length === 0 &&
|
|
87
|
-
input.state.pullContinuation === null &&
|
|
88
|
-
!input.currentRecord.pullContinuationRecoveryRequired &&
|
|
89
|
-
!input.state.remoteUpdatePending &&
|
|
90
|
-
hasPersistedRemoteDocumentSyncState(input.currentRecord));
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* True when the store's container exists locally but has not been created on
|
|
94
|
-
* the server yet (its own create intent is still pending). Creating a document
|
|
95
|
-
* inside it would 404 on the container writer projection and surface a
|
|
96
|
-
* spurious sync error; the container-contents lane re-arms document sync once
|
|
97
|
-
* the container lands. An unknown or unqueryable container resolves false so
|
|
98
|
-
* store-level consumers without container persistence keep creating eagerly.
|
|
99
|
-
*/
|
|
100
|
-
export async function isContainerAwaitingRemoteCreate(state) {
|
|
101
|
-
const containerId = state.runtime.state.containerId;
|
|
102
|
-
if (!containerId) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
try {
|
|
106
|
-
const rows = await state.runtime.infra.execSql("SELECT server_created_at FROM containers WHERE id = :containerId", { ":containerId": containerId });
|
|
107
|
-
const row = rows[0];
|
|
108
|
-
return row !== undefined && Reflect.get(row, "server_created_at") == null;
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async function hasDurableDocumentForCreate(state, isCurrent) {
|
|
115
|
-
// A bulk import can leave this store queued long after trash purged its
|
|
116
|
-
// durable row. The persistence guard runs too late to prevent an orphaned
|
|
117
|
-
// remote create, so check existence before beginning the network work.
|
|
118
|
-
const record = await state.persistence.loadDocument(state.runtime.infra.execSql, state.localId);
|
|
119
|
-
if (!isCurrent())
|
|
120
|
-
return false;
|
|
121
|
-
if (record)
|
|
122
|
-
return true;
|
|
123
|
-
markDocumentStoreRemoved(state);
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
export async function ensureRemoteDocument(state, currentDoc, nextRecord, encapsulationKeyPair, generation) {
|
|
127
|
-
const generationIsCurrent = () => !generation || isDocumentStoreSyncGenerationCurrent(state, generation);
|
|
128
|
-
if (!generationIsCurrent())
|
|
129
|
-
return state.record ?? nextRecord;
|
|
130
|
-
if (nextRecord?.documentId) {
|
|
131
|
-
return nextRecord;
|
|
132
|
-
}
|
|
133
|
-
const runtime = state.runtime;
|
|
134
|
-
if (!runtime.state.containerId) {
|
|
135
|
-
runtime.util.log("Documents: cannot create a remote document without a container.");
|
|
136
|
-
// A local-only document with no container scope (e.g. a last-link orphan
|
|
137
|
-
// from a tombstone cascade, docs/sync-edge-cases.md row 3) can never
|
|
138
|
-
// create; record the stuck state durably so the write queue surfaces it
|
|
139
|
-
// instead of this lane going silent on every trigger.
|
|
140
|
-
await documentTerminalSubmitFailureHandler(state, generation)({
|
|
141
|
-
message: "Local document has no container for its remote create",
|
|
142
|
-
status: null,
|
|
143
|
-
});
|
|
144
|
-
return nextRecord;
|
|
145
|
-
}
|
|
146
|
-
const author = resolveDocumentCreateAuthor(runtime);
|
|
147
|
-
if (!author) {
|
|
148
|
-
runtime.util.log("Documents: skipped remote create because the writer context is unavailable.");
|
|
149
|
-
return nextRecord;
|
|
150
|
-
}
|
|
151
|
-
const documentId = nextRecord?.recoveryDocumentId ??
|
|
152
|
-
(await deriveStableDocumentId(state.localId));
|
|
153
|
-
if (!generationIsCurrent())
|
|
154
|
-
return state.record ?? nextRecord;
|
|
155
|
-
if (!(await hasDurableDocumentForCreate(state, generationIsCurrent)))
|
|
156
|
-
return state.record;
|
|
157
|
-
const writerProjectionGeneration = state.writerProjectionGeneration;
|
|
158
|
-
const created = await createRemoteDocument({
|
|
159
|
-
apiClient: runtime.apiClient,
|
|
160
|
-
author,
|
|
161
|
-
containerId: runtime.state.containerId,
|
|
162
|
-
// Derive the remote id from the stable local id so a retry after a lost
|
|
163
|
-
// create response re-sends the same id and adopts the existing remote
|
|
164
|
-
// document instead of creating a duplicate.
|
|
165
|
-
documentId,
|
|
166
|
-
execSql: runtime.infra.execSql,
|
|
167
|
-
isRemoteSyncBlocked: runtime.util.isRemoteSyncBlocked,
|
|
168
|
-
onTerminalSubmitFailure: documentTerminalSubmitFailureHandler(state, generation),
|
|
169
|
-
resolveProjectionUserKey: state.resolveProjectionUserKey,
|
|
170
|
-
stillCurrent: generationIsCurrent,
|
|
171
|
-
targetSecretKey: encapsulationKeyPair.secretKey,
|
|
172
|
-
warmReferencedPrincipalPolicies: createRuntimePrincipalPolicyWarmer(runtime),
|
|
173
|
-
});
|
|
174
|
-
if (!generationIsCurrent())
|
|
175
|
-
return state.record ?? nextRecord;
|
|
176
|
-
if (!created) {
|
|
177
|
-
return nextRecord;
|
|
178
|
-
}
|
|
179
|
-
return chainIdentityWrite(state, async () => {
|
|
180
|
-
if (!generationIsCurrent())
|
|
181
|
-
return state.record ?? nextRecord;
|
|
182
|
-
// A concurrent relink (e.g. live duplicate-facade resolution) may have
|
|
183
|
-
// assigned this store a different remote identity while the create round
|
|
184
|
-
// trip was in flight. That identity wins: persisting the created one here
|
|
185
|
-
// would clobber the relink. The just-created remote document is left an
|
|
186
|
-
// orphan, the same benign outcome as a lost create response.
|
|
187
|
-
const liveDocumentId = state.record?.documentId;
|
|
188
|
-
if (liveDocumentId && liveDocumentId !== created.documentId) {
|
|
189
|
-
return state.record;
|
|
190
|
-
}
|
|
191
|
-
runtime.util.log(`Created document: ${created.documentId}`);
|
|
192
|
-
installDocumentWriterProjection(state, created.writerProjection, writerProjectionGeneration);
|
|
193
|
-
// This persist is a remote-identity write (documentId + content keys), not a
|
|
194
|
-
// content change. It runs after a network round trip, during which the user
|
|
195
|
-
// may have kept typing into a brand-new note. The Loro doc is mutated
|
|
196
|
-
// asynchronously on the write chain, so it can lag the optimistic snapshot;
|
|
197
|
-
// re-deriving text/structured fields from the doc here would republish that
|
|
198
|
-
// stale read over the live editor value and drop the just-typed characters
|
|
199
|
-
// (the new-note "type immediately" race). Preserve the optimistic snapshot —
|
|
200
|
-
// documentId/keys still propagate via state.record, independent of the
|
|
201
|
-
// snapshot text — matching finalizeDocumentSync and the keystroke writes.
|
|
202
|
-
const persistPatch = { ...created.persistedState };
|
|
203
|
-
const persistOptions = {
|
|
204
|
-
preserveSnapshotStructuredFields: true,
|
|
205
|
-
preserveSnapshotText: true,
|
|
206
|
-
};
|
|
207
|
-
const persisted = await persistDocument(state, currentDoc, persistPatch, persistOptions, generation);
|
|
208
|
-
return persisted?.record ?? state.record ?? nextRecord;
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
//# sourceMappingURL=syncShared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncShared.js","sourceRoot":"","sources":["syncShared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAGlB,mCAAmC,EACnC,iCAAiC,EAEjC,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gEAAgE,CAAC;AAC9G,OAAO,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAIL,wBAAwB,GACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,oCAAoC,GACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CAChD,KAAyB,EACzB,UAAwC;IAExC,OAAO,0BAA0B,CAAC;QAChC,eAAe,EAAE,mCAAmC;QACpD,UAAU;QACV,KAAK;QACL,iBAAiB,EAAE,IAAI;KACxB,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,KAAyB,EACzB,UAAwC;IAExC,OAAO,0BAA0B,CAAC;QAChC,eAAe,EAAE,iCAAiC;QAClD,UAAU;QACV,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,6CAA6C,CAC3D,KAAyB,EACzB,UAAwC;IAExC,MAAM,aAAa,GAAG,0BAA0B,CAAC;QAC/C,eAAe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,EAAE,KAAK,IAAI,EAAE;QAC1C,IAAI,CAAC,mBAAmB,EAAE;YAAE,OAAO,KAAK,CAAC,MAAM,IAAI,UAAU,CAAC;QAE9D,uEAAuE;QACvE,yEAAyE;QACzE,0EAA0E;QAC1E,wEAAwE;QACxE,6DAA6D;QAC7D,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC;QAChD,IAAI,cAAc,IAAI,cAAc,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC;YAC5D,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5D,+BAA+B,CAC7B,KAAK,EACL,OAAO,CAAC,gBAAgB,EACxB,0BAA0B,CAC3B,CAAC;QAEF,6EAA6E;QAC7E,4EAA4E;QAC5E,sEAAsE;QACtE,4EAA4E;QAC5E,4EAA4E;QAC5E,2EAA2E;QAC3E,6EAA6E;QAC7E,uEAAuE;QACvE,0EAA0E;QAC1E,MAAM,YAAY,GAAG,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QACnD,MAAM,cAAc,GAAG;YACrB,gCAAgC,EAAE,IAAI;YACtC,oBAAoB,EAAE,IAAI;SAC3B,CAAC;QACF,MAAM,SAAS,GAAG,MAAM,eAAe,CACrC,KAAK,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,UAAU,CACX,CAAC;QACF,OAAO,SAAS,EAAE,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,UAAU,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { deriveStableDocumentId } from \"../../../data/documents/shared/stableDocumentId\";\nimport {\n createRemoteDocument,\n DOCUMENTS_APP_KIND,\n type DocumentRecord,\n type DocumentSyncUpdateIsolationError,\n describeDocumentRevalidationFailure,\n describeDocumentSyncSubmitFailure,\n type PendingUpdateRecord,\n recordDocumentSyncFailure,\n resolveDocumentCreateAuthor,\n runSerializedSqlMutation,\n} from \"../../../workflows/documents\";\nimport { reportDocumentSyncQuarantine } from \"../../../workflows/documents/sync/reportDocumentSyncQuarantine\";\nimport { createRuntimePrincipalPolicyWarmer } from \"../../../workflows/principals/runtimePolicyWarmer\";\nimport { chainIdentityWrite } from \"./identityWriteChain\";\nimport { persistDocument } from \"./persistence\";\nimport {\n type DocumentState,\n type DocumentStoreState,\n type EncapsulationKeyPair,\n markDocumentStoreRemoved,\n} from \"./state\";\nimport {\n type DocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent,\n} from \"./syncGeneration\";\nimport { installDocumentWriterProjection } from \"./writerProjectionGeneration\";\n\n/**\n * Record a refused read-only revalidation on this document's failure row, so\n * a document that can never refresh stops failing silently (edge-case row\n * 13). 403s stay suppressed on purpose — a read-only 403 must never flag\n * unattempted local edits (row 9) — and the row clears on the next clean\n * pass like every other sync failure.\n */\nexport function documentRevalidationFailureHandler(\n state: DocumentStoreState,\n generation?: DocumentStoreSyncGeneration,\n) {\n return documentSyncFailureHandler({\n describeFailure: describeDocumentRevalidationFailure,\n generation,\n state,\n suppressForbidden: true,\n });\n}\n\n/**\n * Record a terminal submit failure on this document's write-queue row. Shared\n * by every store pass that can submit queued writes (create and sync), so\n * re-key exhaustion and denial failures surface no matter which pass hits\n * them first.\n */\nexport function documentTerminalSubmitFailureHandler(\n state: DocumentStoreState,\n generation?: DocumentStoreSyncGeneration,\n) {\n return documentSyncFailureHandler({\n describeFailure: describeDocumentSyncSubmitFailure,\n generation,\n state,\n });\n}\n\n/** Persist quarantine and report its Error through the host's diagnostics. */\nexport function documentIncomingUpdateIsolationFailureHandler(\n state: DocumentStoreState,\n generation?: DocumentStoreSyncGeneration,\n) {\n const recordFailure = documentSyncFailureHandler({\n describeFailure: (failure) => failure.message,\n generation,\n state,\n });\n return async (failure: DocumentSyncUpdateIsolationError) => {\n await recordFailure({ message: failure.message, status: null });\n if (generation && !isDocumentStoreSyncGenerationCurrent(state, generation))\n return;\n reportDocumentSyncQuarantine(\n generation?.currentDoc ?? state.doc ?? state,\n state.runtime.util.logError,\n failure,\n );\n };\n}\n\n/**\n * The generation recheck runs INSIDE the serialized mutation (like the\n * attachment failure path): a teardown (discard/reset) that wins the ordering\n * deletes this document's rows first and invalidates the generation, so a\n * stale handler can never resurrect a deleted or orphan failure row\n * afterwards.\n */\nfunction documentSyncFailureHandler(input: {\n describeFailure: (failure: {\n readonly message: string;\n readonly status: number | null;\n }) => string;\n generation: DocumentStoreSyncGeneration | undefined;\n state: DocumentStoreState;\n suppressForbidden?: boolean;\n}) {\n const { generation, state } = input;\n return async (failure: {\n readonly message: string;\n readonly status: number | null;\n }) => {\n if (input.suppressForbidden && failure.status === 403) {\n return;\n }\n\n await runSerializedSqlMutation(\n generation?.execSql ?? state.runtime.infra.execSql,\n async (lockedExecSql) => {\n if (\n generation &&\n !isDocumentStoreSyncGenerationCurrent(state, generation)\n ) {\n return;\n }\n await recordDocumentSyncFailure(\n lockedExecSql,\n { appKind: DOCUMENTS_APP_KIND, localId: state.localId },\n {\n attemptedAt: new Date().toISOString(),\n message: input.describeFailure(failure),\n status: failure.status,\n },\n );\n },\n );\n };\n}\n\nfunction hasPersistedRemoteDocumentSyncState(record: DocumentRecord): boolean {\n return (\n record.lastCommitLsn !== null &&\n record.contentKeyBundle !== null &&\n record.documentKekTargets !== null &&\n record.documentManifestBundle !== null\n );\n}\n\nexport function shouldSkipCleanScheduledDocumentSync(input: {\n currentRecord: DocumentRecord;\n pendingUpdates: readonly PendingUpdateRecord[];\n state: DocumentStoreState;\n}): boolean {\n return (\n input.pendingUpdates.length === 0 &&\n input.state.pendingAttachments.length === 0 &&\n input.state.pullContinuation === null &&\n !input.currentRecord.pullContinuationRecoveryRequired &&\n !input.state.remoteUpdatePending &&\n hasPersistedRemoteDocumentSyncState(input.currentRecord)\n );\n}\n\n/**\n * True when the store's container exists locally but has not been created on\n * the server yet (its own create intent is still pending). Creating a document\n * inside it would 404 on the container writer projection and surface a\n * spurious sync error; the container-contents lane re-arms document sync once\n * the container lands. An unknown or unqueryable container resolves false so\n * store-level consumers without container persistence keep creating eagerly.\n */\nexport async function isContainerAwaitingRemoteCreate(\n state: DocumentStoreState,\n): Promise<boolean> {\n const containerId = state.runtime.state.containerId;\n if (!containerId) {\n return false;\n }\n\n try {\n const rows = await state.runtime.infra.execSql(\n \"SELECT server_created_at FROM containers WHERE id = :containerId\",\n { \":containerId\": containerId },\n );\n const row = rows[0];\n return row !== undefined && Reflect.get(row, \"server_created_at\") == null;\n } catch {\n return false;\n }\n}\n\nasync function hasDurableDocumentForCreate(\n state: DocumentStoreState,\n isCurrent: () => boolean,\n): Promise<boolean> {\n // A bulk import can leave this store queued long after trash purged its\n // durable row. The persistence guard runs too late to prevent an orphaned\n // remote create, so check existence before beginning the network work.\n const record = await state.persistence.loadDocument(\n state.runtime.infra.execSql,\n state.localId,\n );\n if (!isCurrent()) return false;\n if (record) return true;\n markDocumentStoreRemoved(state);\n return false;\n}\n\nexport async function ensureRemoteDocument(\n state: DocumentStoreState,\n currentDoc: DocumentState,\n nextRecord: DocumentRecord | null,\n encapsulationKeyPair: EncapsulationKeyPair,\n generation?: DocumentStoreSyncGeneration,\n): Promise<DocumentRecord | null> {\n const generationIsCurrent = () =>\n !generation || isDocumentStoreSyncGenerationCurrent(state, generation);\n if (!generationIsCurrent()) return state.record ?? nextRecord;\n\n if (nextRecord?.documentId) {\n return nextRecord;\n }\n\n const runtime = state.runtime;\n if (!runtime.state.containerId) {\n runtime.util.log(\n \"Documents: cannot create a remote document without a container.\",\n );\n // A local-only document with no container scope (e.g. a last-link orphan\n // from a tombstone cascade, docs/sync-edge-cases.md row 3) can never\n // create; record the stuck state durably so the write queue surfaces it\n // instead of this lane going silent on every trigger.\n await documentTerminalSubmitFailureHandler(\n state,\n generation,\n )({\n message: \"Local document has no container for its remote create\",\n status: null,\n });\n return nextRecord;\n }\n\n const author = resolveDocumentCreateAuthor(runtime);\n if (!author) {\n runtime.util.log(\n \"Documents: skipped remote create because the writer context is unavailable.\",\n );\n return nextRecord;\n }\n\n const documentId =\n nextRecord?.recoveryDocumentId ??\n (await deriveStableDocumentId(state.localId));\n if (!generationIsCurrent()) return state.record ?? nextRecord;\n\n if (!(await hasDurableDocumentForCreate(state, generationIsCurrent)))\n return state.record;\n\n const writerProjectionGeneration = state.writerProjectionGeneration;\n const created = await createRemoteDocument({\n apiClient: runtime.apiClient,\n author,\n containerId: runtime.state.containerId,\n // Derive the remote id from the stable local id so a retry after a lost\n // create response re-sends the same id and adopts the existing remote\n // document instead of creating a duplicate.\n documentId,\n execSql: runtime.infra.execSql,\n isRemoteSyncBlocked: runtime.util.isRemoteSyncBlocked,\n onTerminalSubmitFailure: documentTerminalSubmitFailureHandler(\n state,\n generation,\n ),\n resolveProjectionUserKey: state.resolveProjectionUserKey,\n stillCurrent: generationIsCurrent,\n targetSecretKey: encapsulationKeyPair.secretKey,\n warmReferencedPrincipalPolicies:\n createRuntimePrincipalPolicyWarmer(runtime),\n });\n if (!generationIsCurrent()) return state.record ?? nextRecord;\n if (!created) {\n return nextRecord;\n }\n\n return chainIdentityWrite(state, async () => {\n if (!generationIsCurrent()) return state.record ?? nextRecord;\n\n // A concurrent relink (e.g. live duplicate-facade resolution) may have\n // assigned this store a different remote identity while the create round\n // trip was in flight. That identity wins: persisting the created one here\n // would clobber the relink. The just-created remote document is left an\n // orphan, the same benign outcome as a lost create response.\n const liveDocumentId = state.record?.documentId;\n if (liveDocumentId && liveDocumentId !== created.documentId) {\n return state.record;\n }\n\n runtime.util.log(`Created document: ${created.documentId}`);\n installDocumentWriterProjection(\n state,\n created.writerProjection,\n writerProjectionGeneration,\n );\n\n // This persist is a remote-identity write (documentId + content keys), not a\n // content change. It runs after a network round trip, during which the user\n // may have kept typing into a brand-new note. The Loro doc is mutated\n // asynchronously on the write chain, so it can lag the optimistic snapshot;\n // re-deriving text/structured fields from the doc here would republish that\n // stale read over the live editor value and drop the just-typed characters\n // (the new-note \"type immediately\" race). Preserve the optimistic snapshot —\n // documentId/keys still propagate via state.record, independent of the\n // snapshot text — matching finalizeDocumentSync and the keystroke writes.\n const persistPatch = { ...created.persistedState };\n const persistOptions = {\n preserveSnapshotStructuredFields: true,\n preserveSnapshotText: true,\n };\n const persisted = await persistDocument(\n state,\n currentDoc,\n persistPatch,\n persistOptions,\n generation,\n );\n return persisted?.record ?? state.record ?? nextRecord;\n });\n}\n"]}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { encodeVersionVector } from "../../../internal/loro/index.js";
|
|
2
|
-
import { importDecryptedDocumentSyncUpdates } from "../../../data/documents/shared/documentSyncUpdateIsolation.js";
|
|
3
|
-
import { setReadySnapshot, } from "./state.js";
|
|
4
|
-
import { isDocumentStoreSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
5
|
-
import { extendDocumentVersionCoverage } from "./versionCoverage.js";
|
|
6
|
-
function sameNullableValue(left, right) {
|
|
7
|
-
return (left ?? null) === (right ?? null);
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A response may mutate document content only while the identity and access
|
|
11
|
-
* context used to create its request are still live. Local content fields and
|
|
12
|
-
* the pending marker are deliberately excluded because edits may advance them
|
|
13
|
-
* while the request is in flight.
|
|
14
|
-
*/
|
|
15
|
-
export function documentSyncContextMatches(liveRecord, requestRecord, responseDocumentId) {
|
|
16
|
-
return (liveRecord !== null &&
|
|
17
|
-
liveRecord.id === requestRecord.id &&
|
|
18
|
-
liveRecord.documentId === requestRecord.documentId &&
|
|
19
|
-
liveRecord.documentId === responseDocumentId &&
|
|
20
|
-
liveRecord.containerId === requestRecord.containerId &&
|
|
21
|
-
liveRecord.accessEpoch === requestRecord.accessEpoch &&
|
|
22
|
-
sameNullableValue(liveRecord.accessStateHash, requestRecord.accessStateHash) &&
|
|
23
|
-
(liveRecord.effectiveAccessLevel ?? null) ===
|
|
24
|
-
(requestRecord.effectiveAccessLevel ?? null) &&
|
|
25
|
-
sameNullableValue(liveRecord.contentKeyBundle, requestRecord.contentKeyBundle) &&
|
|
26
|
-
sameNullableValue(liveRecord.documentKekTargets, requestRecord.documentKekTargets) &&
|
|
27
|
-
sameNullableValue(liveRecord.documentManifestBundle, requestRecord.documentManifestBundle));
|
|
28
|
-
}
|
|
29
|
-
export function importSyncedDocumentUpdates(currentDoc, updates) {
|
|
30
|
-
importDecryptedDocumentSyncUpdates(currentDoc, updates);
|
|
31
|
-
return currentDoc;
|
|
32
|
-
}
|
|
33
|
-
export function applyIncomingSyncedUpdates(state, currentDoc, requestRecord, syncAttempt, expectedGeneration) {
|
|
34
|
-
if ((expectedGeneration &&
|
|
35
|
-
!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) ||
|
|
36
|
-
!documentSyncContextMatches(state.record, requestRecord, syncAttempt.synced.plan.documentId)) {
|
|
37
|
-
return currentDoc;
|
|
38
|
-
}
|
|
39
|
-
const updates = syncAttempt.synced.decryptedUpdates;
|
|
40
|
-
if (updates.length === 0)
|
|
41
|
-
return currentDoc;
|
|
42
|
-
const mergedDoc = importSyncedDocumentUpdates(currentDoc, updates);
|
|
43
|
-
const baseVersion = state.pendingBaseVersion;
|
|
44
|
-
if (baseVersion === null) {
|
|
45
|
-
throw new Error("Document sync requires an initialized pending base");
|
|
46
|
-
}
|
|
47
|
-
// Promote only through update spans proven to be remote. Advancing to the
|
|
48
|
-
// whole merged document would also cross a concurrent deferRemoteSync edit
|
|
49
|
-
// and could permanently classify that local-only operation as synced.
|
|
50
|
-
state.pendingBaseVersion = extendDocumentVersionCoverage({
|
|
51
|
-
baseVersion,
|
|
52
|
-
documentVersion: encodeVersionVector(mergedDoc),
|
|
53
|
-
spans: updates,
|
|
54
|
-
});
|
|
55
|
-
if (state.pendingLocalWrites > 0) {
|
|
56
|
-
setReadySnapshot(state, mergedDoc, true, state.snapshot.text, state.snapshot.structuredFields);
|
|
57
|
-
return mergedDoc;
|
|
58
|
-
}
|
|
59
|
-
setReadySnapshot(state, mergedDoc, true);
|
|
60
|
-
return mergedDoc;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=syncUpdateImport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncUpdateImport.js","sourceRoot":"","sources":["syncUpdateImport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,kCAAkC,EAAE,MAAM,4DAA4D,CAAC;AAIhH,OAAO,EAGL,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,oCAAoC,GACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAElE,SAAS,iBAAiB,CACxB,IAA+B,EAC/B,KAAgC;IAEhC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,UAAiC,EACjC,aAA6B,EAC7B,kBAAiC;IAEjC,OAAO,CACL,UAAU,KAAK,IAAI;QACnB,UAAU,CAAC,EAAE,KAAK,aAAa,CAAC,EAAE;QAClC,UAAU,CAAC,UAAU,KAAK,aAAa,CAAC,UAAU;QAClD,UAAU,CAAC,UAAU,KAAK,kBAAkB;QAC5C,UAAU,CAAC,WAAW,KAAK,aAAa,CAAC,WAAW;QACpD,UAAU,CAAC,WAAW,KAAK,aAAa,CAAC,WAAW;QACpD,iBAAiB,CACf,UAAU,CAAC,eAAe,EAC1B,aAAa,CAAC,eAAe,CAC9B;QACD,CAAC,UAAU,CAAC,oBAAoB,IAAI,IAAI,CAAC;YACvC,CAAC,aAAa,CAAC,oBAAoB,IAAI,IAAI,CAAC;QAC9C,iBAAiB,CACf,UAAU,CAAC,gBAAgB,EAC3B,aAAa,CAAC,gBAAgB,CAC/B;QACD,iBAAiB,CACf,UAAU,CAAC,k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,EACL,SAAS,EACT,IAAI,EACJ,KAAK,CAAC,QAAQ,CAAC,IAAI,EACnB,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAChC,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { encodeVersionVector } from \"@tearleads/loro\";\nimport { importDecryptedDocumentSyncUpdates } from \"../../../data/documents/shared/documentSyncUpdateIsolation\";\nimport type { DecryptedDocumentSyncUpdate } from \"../../../data/documents/shared/types\";\nimport type { DocumentRecord } from \"../../../workflows/documents\";\nimport type { DocumentSyncAttempt } from \"./state\";\nimport {\n type DocumentState,\n type DocumentStoreState,\n setReadySnapshot,\n} from \"./state\";\nimport {\n type DocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent,\n} from \"./syncGeneration\";\nimport { extendDocumentVersionCoverage } from \"./versionCoverage\";\n\nfunction sameNullableValue(\n left: string | null | undefined,\n right: string | null | undefined,\n): boolean {\n return (left ?? null) === (right ?? null);\n}\n\n/**\n * A response may mutate document content only while the identity and access\n * context used to create its request are still live. Local content fields and\n * the pending marker are deliberately excluded because edits may advance them\n * while the request is in flight.\n */\nexport function documentSyncContextMatches(\n liveRecord: DocumentRecord | null,\n requestRecord: DocumentRecord,\n responseDocumentId: string | null,\n): boolean {\n return (\n liveRecord !== null &&\n liveRecord.id === requestRecord.id &&\n liveRecord.documentId === requestRecord.documentId &&\n liveRecord.documentId === responseDocumentId &&\n liveRecord.containerId === requestRecord.containerId &&\n liveRecord.accessEpoch === requestRecord.accessEpoch &&\n sameNullableValue(\n liveRecord.accessStateHash,\n requestRecord.accessStateHash,\n ) &&\n (liveRecord.effectiveAccessLevel ?? null) ===\n (requestRecord.effectiveAccessLevel ?? null) &&\n sameNullableValue(\n liveRecord.contentKeyBundle,\n requestRecord.contentKeyBundle,\n ) &&\n sameNullableValue(\n liveRecord.documentKekTargets,\n requestRecord.documentKekTargets,\n ) &&\n sameNullableValue(\n liveRecord.documentManifestBundle,\n requestRecord.documentManifestBundle,\n )\n );\n}\n\nexport function importSyncedDocumentUpdates(\n currentDoc: DocumentState,\n updates: readonly DecryptedDocumentSyncUpdate[],\n): DocumentState {\n importDecryptedDocumentSyncUpdates(currentDoc, updates);\n return currentDoc;\n}\n\nexport function applyIncomingSyncedUpdates(\n state: DocumentStoreState,\n currentDoc: DocumentState,\n requestRecord: DocumentRecord,\n syncAttempt: DocumentSyncAttempt,\n expectedGeneration?: DocumentStoreSyncGeneration,\n): DocumentState {\n if (\n (expectedGeneration &&\n !isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) ||\n !documentSyncContextMatches(\n state.record,\n requestRecord,\n syncAttempt.synced.plan.documentId,\n )\n ) {\n return currentDoc;\n }\n\n const updates = syncAttempt.synced.decryptedUpdates;\n if (updates.length === 0) return currentDoc;\n\n const mergedDoc = importSyncedDocumentUpdates(currentDoc, updates);\n const baseVersion = state.pendingBaseVersion;\n if (baseVersion === null) {\n throw new Error(\"Document sync requires an initialized pending base\");\n }\n // Promote only through update spans proven to be remote. Advancing to the\n // whole merged document would also cross a concurrent deferRemoteSync edit\n // and could permanently classify that local-only operation as synced.\n state.pendingBaseVersion = extendDocumentVersionCoverage({\n baseVersion,\n documentVersion: encodeVersionVector(mergedDoc),\n spans: updates,\n });\n\n if (state.pendingLocalWrites > 0) {\n setReadySnapshot(\n state,\n mergedDoc,\n true,\n state.snapshot.text,\n state.snapshot.structuredFields,\n );\n return mergedDoc;\n }\n\n setReadySnapshot(state, mergedDoc, true);\n return mergedDoc;\n}\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { mergeVersionVectors, satisfiesVersionVector } from "../../../internal/loro/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Extend a trusted coverage frontier through durable or remotely accepted
|
|
4
|
-
* update spans. A span is usable only when its start is already covered and
|
|
5
|
-
* its end belongs to the current document. Iterating to a fixed point lets a
|
|
6
|
-
* persisted queue restore coverage even when its rows are not topologically
|
|
7
|
-
* ordered.
|
|
8
|
-
*
|
|
9
|
-
* Invalid or disconnected spans are ignored. The caller can then materialize
|
|
10
|
-
* the remaining frontier instead of classifying unproven operations as safe.
|
|
11
|
-
*/
|
|
12
|
-
export function extendDocumentVersionCoverage(input) {
|
|
13
|
-
let coverage = mergeVersionVectors([input.baseVersion]);
|
|
14
|
-
if (!satisfiesVersionVector(input.documentVersion, coverage)) {
|
|
15
|
-
throw new Error("Document coverage base is outside the current snapshot");
|
|
16
|
-
}
|
|
17
|
-
const remaining = new Set(input.spans.keys());
|
|
18
|
-
let advanced = true;
|
|
19
|
-
while (advanced) {
|
|
20
|
-
advanced = false;
|
|
21
|
-
for (const index of remaining) {
|
|
22
|
-
const span = input.spans[index];
|
|
23
|
-
if (!span)
|
|
24
|
-
continue;
|
|
25
|
-
try {
|
|
26
|
-
const isConnected = satisfiesVersionVector(coverage, span.partialStartVersionVector);
|
|
27
|
-
const isWellFormed = satisfiesVersionVector(span.partialEndVersionVector, span.partialStartVersionVector);
|
|
28
|
-
const belongsToDocument = satisfiesVersionVector(input.documentVersion, span.partialEndVersionVector);
|
|
29
|
-
if (!isConnected || !isWellFormed || !belongsToDocument)
|
|
30
|
-
continue;
|
|
31
|
-
coverage = mergeVersionVectors([
|
|
32
|
-
coverage,
|
|
33
|
-
span.partialEndVersionVector,
|
|
34
|
-
]);
|
|
35
|
-
remaining.delete(index);
|
|
36
|
-
advanced = true;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
remaining.delete(index);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return coverage;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=versionCoverage.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { StoredDocumentKind } from "../../data/documents/documentKinds.js";
|
|
2
|
-
import type { DomainScope } from "../../data/shared/domainScope.js";
|
|
3
|
-
import { type DocumentsPersistence } from "../../workflows/documents/index.js";
|
|
4
|
-
import type { DocumentStore, DocumentStoreFacade, DocumentStoreOpenOptions, DocumentsRuntime } from "./types.js";
|
|
5
|
-
export { discardRegisteredDocumentLocalState, requestDomainDocumentSync, subscribeToPersistedDocuments, } from "./registry.js";
|
|
6
|
-
export declare function createDocumentStore(localId: string, initialRuntime: DocumentsRuntime, persistence?: DocumentsPersistence, initialDocumentId?: string | null, initialText?: string, initialDocumentKind?: StoredDocumentKind, options?: DocumentStoreOpenOptions): DocumentStoreFacade;
|
|
7
|
-
export declare function getOrCreateDocumentStore(domainScope: DomainScope, localId: string, runtime: DocumentsRuntime, initialDocumentId?: string | null, initialText?: string, initialDocumentKind?: StoredDocumentKind, options?: DocumentStoreOpenOptions): DocumentStore;
|
|
8
|
-
export declare function openDocumentStore(domainScope: DomainScope, localId: string, runtime: DocumentsRuntime, initialDocumentId?: string | null, initialText?: string, initialDocumentKind?: StoredDocumentKind, options?: DocumentStoreOpenOptions): DocumentStore;
|