@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,75 +0,0 @@
|
|
|
1
|
-
import { bytesToBase64 } from "../../../internal/encoding/index.js";
|
|
2
|
-
import { encodeVersionVector, exportFullHistorySnapshot, } from "../../../internal/loro/index.js";
|
|
3
|
-
import { readPullContinuation } from "../../../data/documents/shared/syncPagination.js";
|
|
4
|
-
import { persistDocument } from "./persistence.js";
|
|
5
|
-
import { isDocumentStoreSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
6
|
-
import { installDocumentWriterProjection } from "./writerProjectionGeneration.js";
|
|
7
|
-
/**
|
|
8
|
-
* Machinery for reconstructing a full-history document from a verified remote
|
|
9
|
-
* pull. Used by the rotation preflight (rotation.ts): it pulls the remote op
|
|
10
|
-
* log, replays it into a fresh document alongside the durable local queue,
|
|
11
|
-
* and installs the rebuilt document — preserving op identity end to end.
|
|
12
|
-
*/
|
|
13
|
-
export async function installRebuiltDocument(input) {
|
|
14
|
-
// The guarded persist makes the recovered history durable BEFORE publishing
|
|
15
|
-
// the newer record. Checkpoint-ahead is the safe crash direction: restore
|
|
16
|
-
// reads the checkpoint and the record catches up on the next persist.
|
|
17
|
-
const fullHistorySnapshot = exportFullHistorySnapshot(input.rebuiltDoc);
|
|
18
|
-
const rebuiltEndVersion = encodeVersionVector(input.rebuiltDoc);
|
|
19
|
-
const persisted = await persistDocument(input.state, input.rebuiltDoc, {
|
|
20
|
-
...input.synced.persistedState,
|
|
21
|
-
lastCommitLsn: input.synced.response.commitLsn ??
|
|
22
|
-
input.currentRecord.lastCommitLsn ??
|
|
23
|
-
null,
|
|
24
|
-
pullContinuation: readPullContinuation(input.synced.response),
|
|
25
|
-
recoveryGeneration: (input.currentRecord.recoveryGeneration ?? 0) + 1,
|
|
26
|
-
// The guarded checkpoint below covers exactly this frontier.
|
|
27
|
-
snapshotEndVersion: rebuiltEndVersion,
|
|
28
|
-
}, {
|
|
29
|
-
acceptedPendingUpdateIds: input.synced.settledPendingUpdateIds,
|
|
30
|
-
expectedSyncState: {
|
|
31
|
-
pullContinuation: input.consumedPullContinuation,
|
|
32
|
-
record: input.currentRecord,
|
|
33
|
-
},
|
|
34
|
-
historyCheckpoint: {
|
|
35
|
-
coveredTailIds: [],
|
|
36
|
-
endVersionVector: rebuiltEndVersion,
|
|
37
|
-
pruneCoveredLocalState: true,
|
|
38
|
-
snapshot: bytesToBase64(fullHistorySnapshot),
|
|
39
|
-
},
|
|
40
|
-
pendingBaseVersionOverride: rebuiltEndVersion,
|
|
41
|
-
preserveSnapshotStructuredFields: input.state.pendingLocalWrites > 0,
|
|
42
|
-
preserveSnapshotText: input.state.pendingLocalWrites > 0,
|
|
43
|
-
}, input.generation);
|
|
44
|
-
if (!persisted) {
|
|
45
|
-
if (!isDocumentStoreSyncGenerationCurrent(input.state, input.generation)) {
|
|
46
|
-
throw new Error("Document changed during rotation recovery; retry key rotation");
|
|
47
|
-
}
|
|
48
|
-
// The resurrect guard refused: another subsystem deleted this document
|
|
49
|
-
// while the rebuild was in flight, and saveDocumentRecord cleared the
|
|
50
|
-
// zombie store — pendingBaseVersion included. Restoring the rebuilt doc,
|
|
51
|
-
// projection, or the captured base version here would resurrect state
|
|
52
|
-
// over that clearing.
|
|
53
|
-
throw new Error("Document was deleted while its history rebuild was in flight");
|
|
54
|
-
}
|
|
55
|
-
if (!persisted.pullContinuationSuperseded &&
|
|
56
|
-
!persisted.syncIdentitySuperseded) {
|
|
57
|
-
input.state.pendingBaseVersion = rebuiltEndVersion;
|
|
58
|
-
input.state.doc = input.rebuiltDoc;
|
|
59
|
-
}
|
|
60
|
-
if (persisted.pullContinuationSuperseded)
|
|
61
|
-
input.state.writerProjection = null;
|
|
62
|
-
else
|
|
63
|
-
installDocumentWriterProjection(input.state, input.synced.writerProjection ?? input.state.writerProjection, input.writerProjectionGeneration);
|
|
64
|
-
const installedDoc = input.state.doc ?? input.rebuiltDoc;
|
|
65
|
-
return {
|
|
66
|
-
fullHistorySnapshot: persisted.pullContinuationSuperseded
|
|
67
|
-
? exportFullHistorySnapshot(installedDoc)
|
|
68
|
-
: fullHistorySnapshot,
|
|
69
|
-
settlementRequiresRetry: persisted.pullContinuationSuperseded === true ||
|
|
70
|
-
persisted.syncIdentitySuperseded === true ||
|
|
71
|
-
persisted.record.pullContinuation != null ||
|
|
72
|
-
persisted.record.pullContinuationRecoveryRequired === true,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=historyRebuild.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"historyRebuild.js","sourceRoot":"","sources":["historyRebuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAKrF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAEL,oCAAoC,GACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAE/E;;;;;GAKG;AAEH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAS5C;IAIC,4EAA4E;IAC5E,0EAA0E;IAC1E,sEAAsE;IACtE,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxE,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,MAAM,eAAe,CACrC,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,UAAU,EAChB;QACE,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc;QAC9B,aAAa,EACX,KAAK,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KAAK,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;QACnD,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IACD,IAAI,SAAS,CAAC,0BAA0B;QAAE,KAAK,CAAC,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;;QAE5E,+BAA+B,CAC7B,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAAI,KAAK,CAAC,KAAK,CAAC,gBAAgB,EAC7D,KAAK,CAAC,0BAA0B,CACjC,CAAC;IACJ,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC;IACzD,OAAO;QACL,mBAAmB,EAAE,SAAS,CAAC,0BAA0B;YACvD,CAAC,CAAC,yBAAyB,CAAC,YAAY,CAAC;YACzC,CAAC,CAAC,mBAAmB;QACvB,uBAAuB,EACrB,SAAS,CAAC,0BAA0B,KAAK,IAAI;YAC7C,SAAS,CAAC,sBAAsB,KAAK,IAAI;YACzC,SAAS,CAAC,MAAM,CAAC,gBAAgB,IAAI,IAAI;YACzC,SAAS,CAAC,MAAM,CAAC,gCAAgC,KAAK,IAAI;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import { bytesToBase64 } from \"@tearleads/encoding\";\nimport {\n encodeVersionVector,\n exportFullHistorySnapshot,\n} from \"@tearleads/loro\";\nimport { readPullContinuation } from \"../../../data/documents/shared/syncPagination\";\nimport type {\n DocumentSyncPullContinuation,\n syncRemoteDocument,\n} from \"../../../workflows/documents\";\nimport { persistDocument } from \"./persistence\";\nimport type { DocumentState, DocumentStoreState } from \"./state\";\nimport {\n type DocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent,\n} from \"./syncGeneration\";\nimport { installDocumentWriterProjection } from \"./writerProjectionGeneration\";\n\n/**\n * Machinery for reconstructing a full-history document from a verified remote\n * pull. Used by the rotation preflight (rotation.ts): it pulls the remote op\n * log, replays it into a fresh document alongside the durable local queue,\n * and installs the rebuilt document — preserving op identity end to end.\n */\n\nexport async function installRebuiltDocument(input: {\n consumedPullContinuation: DocumentSyncPullContinuation | null;\n currentRecord: NonNullable<DocumentStoreState[\"record\"]>;\n generation: DocumentStoreSyncGeneration;\n rebuiltDoc: DocumentState;\n state: DocumentStoreState;\n synced: NonNullable<Awaited<ReturnType<typeof syncRemoteDocument>>>;\n /** `state.writerProjectionGeneration` when the recovery pull started. */\n writerProjectionGeneration: number;\n}): Promise<{\n fullHistorySnapshot: Uint8Array;\n settlementRequiresRetry: boolean;\n}> {\n // The guarded persist makes the recovered history durable BEFORE publishing\n // the newer record. Checkpoint-ahead is the safe crash direction: restore\n // reads the checkpoint and the record catches up on the next persist.\n const fullHistorySnapshot = exportFullHistorySnapshot(input.rebuiltDoc);\n const rebuiltEndVersion = encodeVersionVector(input.rebuiltDoc);\n const persisted = await persistDocument(\n input.state,\n input.rebuiltDoc,\n {\n ...input.synced.persistedState,\n lastCommitLsn:\n input.synced.response.commitLsn ??\n input.currentRecord.lastCommitLsn ??\n null,\n pullContinuation: readPullContinuation(input.synced.response),\n recoveryGeneration: (input.currentRecord.recoveryGeneration ?? 0) + 1,\n // The guarded checkpoint below covers exactly this frontier.\n snapshotEndVersion: rebuiltEndVersion,\n },\n {\n acceptedPendingUpdateIds: input.synced.settledPendingUpdateIds,\n expectedSyncState: {\n pullContinuation: input.consumedPullContinuation,\n record: input.currentRecord,\n },\n historyCheckpoint: {\n coveredTailIds: [],\n endVersionVector: rebuiltEndVersion,\n pruneCoveredLocalState: true,\n snapshot: bytesToBase64(fullHistorySnapshot),\n },\n pendingBaseVersionOverride: rebuiltEndVersion,\n preserveSnapshotStructuredFields: input.state.pendingLocalWrites > 0,\n preserveSnapshotText: input.state.pendingLocalWrites > 0,\n },\n input.generation,\n );\n if (!persisted) {\n if (!isDocumentStoreSyncGenerationCurrent(input.state, input.generation)) {\n throw new Error(\n \"Document changed during rotation recovery; retry key rotation\",\n );\n }\n // The resurrect guard refused: another subsystem deleted this document\n // while the rebuild was in flight, and saveDocumentRecord cleared the\n // zombie store — pendingBaseVersion included. Restoring the rebuilt doc,\n // projection, or the captured base version here would resurrect state\n // over that clearing.\n throw new Error(\n \"Document was deleted while its history rebuild was in flight\",\n );\n }\n if (\n !persisted.pullContinuationSuperseded &&\n !persisted.syncIdentitySuperseded\n ) {\n input.state.pendingBaseVersion = rebuiltEndVersion;\n input.state.doc = input.rebuiltDoc;\n }\n if (persisted.pullContinuationSuperseded) input.state.writerProjection = null;\n else\n installDocumentWriterProjection(\n input.state,\n input.synced.writerProjection ?? input.state.writerProjection,\n input.writerProjectionGeneration,\n );\n const installedDoc = input.state.doc ?? input.rebuiltDoc;\n return {\n fullHistorySnapshot: persisted.pullContinuationSuperseded\n ? exportFullHistorySnapshot(installedDoc)\n : fullHistorySnapshot,\n settlementRequiresRetry:\n persisted.pullContinuationSuperseded === true ||\n persisted.syncIdentitySuperseded === true ||\n persisted.record.pullContinuation != null ||\n persisted.record.pullContinuationRecoveryRequired === true,\n };\n}\n"]}
|
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { bytesToBase64 } from "../../../internal/encoding/index.js";
|
|
2
|
-
import { emptyVersionVector, encodeVersionVector, exportAllUpdates, exportFullHistorySnapshot, mergeVersionVectors, } from "../../../internal/loro/index.js";
|
|
3
|
-
import { DEFAULT_DOCUMENT_ACCESS_EPOCH, DEFAULT_DOCUMENT_KIND, } from "../../../data/documents/documentConstants.js";
|
|
4
|
-
import { initializeStoredDocumentKind, readStoredDocumentState, } from "../../../data/documents/documentKinds.js";
|
|
5
|
-
import { createPendingUpdateFields } from "../../../data/documents/documentSync.js";
|
|
6
|
-
import { isDatabaseUnavailableError, loadPersistedDocumentStoreState, } from "../../../workflows/documents/index.js";
|
|
7
|
-
import { chainIdentityWrite } from "./identityWriteChain.js";
|
|
8
|
-
import { installPersistedAttachments, } from "./initializationAttachments.js";
|
|
9
|
-
import { restoredRemoteTailCoverage, restorePersistedDocumentContent, } from "./initializationHistory.js";
|
|
10
|
-
import { healLocalAttachmentDetachState, recoverDroppedAttachmentSlots, } from "./initializationRecovery.js";
|
|
11
|
-
import { runDocumentOrphanMaintenance } from "./orphanMaintenance.js";
|
|
12
|
-
import { advancePendingBaseVersion, documentSummaryFromRecord, persistDocument, saveDocumentRecord, } from "./persistence.js";
|
|
13
|
-
import { logRevalidationScheduled } from "./remoteRevalidationTelemetry.js";
|
|
14
|
-
import { setReadySnapshot, } from "./state.js";
|
|
15
|
-
import { createStoredDocument } from "./storedDocument.js";
|
|
16
|
-
import { allowDocumentStoreRemoteSync, captureDocumentStoreSyncGeneration, invalidateDocumentStoreRemoteSync, isDocumentStoreSyncGenerationCurrent, markDocumentStoreRemoteSyncPending, } from "./syncGeneration.js";
|
|
17
|
-
async function createInitialDocumentRecord(state, nextDoc) {
|
|
18
|
-
initializeStoredDocumentKind(nextDoc, state.initialDocumentKind, state.runtime.infra.documentProjectors);
|
|
19
|
-
if (state.initialText.length > 0) {
|
|
20
|
-
nextDoc.getText("text").update(state.initialText);
|
|
21
|
-
}
|
|
22
|
-
const initialDocumentState = readStoredDocumentState(nextDoc, state.runtime.infra.documentProjectors);
|
|
23
|
-
const hasInitialContent = state.initialText.length > 0 ||
|
|
24
|
-
state.initialDocumentKind !== DEFAULT_DOCUMENT_KIND;
|
|
25
|
-
const initialUpdate = hasInitialContent
|
|
26
|
-
? createPendingUpdateFields(exportAllUpdates(nextDoc))
|
|
27
|
-
: null;
|
|
28
|
-
// A deferred birth still commits its checkpoint, but leaves the marker at the
|
|
29
|
-
// empty version with nothing queued: the promised attach exports every op
|
|
30
|
-
// since that marker, so one update carries the birth and the attachment.
|
|
31
|
-
const birthDurability = !initialUpdate
|
|
32
|
-
? {}
|
|
33
|
-
: state.deferInitialUpdate
|
|
34
|
-
? { pendingBaseVersionOverride: emptyVersionVector() }
|
|
35
|
-
: { pendingUpdate: initialUpdate };
|
|
36
|
-
const created = {
|
|
37
|
-
id: state.localId,
|
|
38
|
-
containerId: state.runtime.state.containerId ?? null,
|
|
39
|
-
documentId: state.initialDocumentId,
|
|
40
|
-
documentKind: initialDocumentState.documentKind,
|
|
41
|
-
text: initialDocumentState.text,
|
|
42
|
-
title: initialDocumentState.title,
|
|
43
|
-
snapshotEndVersion: encodeVersionVector(nextDoc),
|
|
44
|
-
accessEpoch: DEFAULT_DOCUMENT_ACCESS_EPOCH,
|
|
45
|
-
accessStateHash: null,
|
|
46
|
-
effectiveAccessLevel: "admin",
|
|
47
|
-
lastCommitLsn: null,
|
|
48
|
-
contentKeyBundle: null,
|
|
49
|
-
documentKekTargets: null,
|
|
50
|
-
documentManifestBundle: null,
|
|
51
|
-
};
|
|
52
|
-
// The create-only persistence primitive commits the canonical row and birth
|
|
53
|
-
// checkpoint together. A concurrent initializer either wins both or adopts
|
|
54
|
-
// both, so it cannot replace another pane's history or keying state.
|
|
55
|
-
const persisted = await saveDocumentRecord(state, nextDoc, {
|
|
56
|
-
...created,
|
|
57
|
-
snapshotEndVersion: encodeVersionVector(nextDoc),
|
|
58
|
-
}, {
|
|
59
|
-
historyCheckpoint: {
|
|
60
|
-
coveredTailIds: [],
|
|
61
|
-
endVersionVector: encodeVersionVector(nextDoc),
|
|
62
|
-
pruneCoveredLocalState: false,
|
|
63
|
-
snapshot: bytesToBase64(exportFullHistorySnapshot(nextDoc)),
|
|
64
|
-
},
|
|
65
|
-
...birthDurability,
|
|
66
|
-
});
|
|
67
|
-
return persisted;
|
|
68
|
-
}
|
|
69
|
-
function installPersistedDocumentRecord(state, record) {
|
|
70
|
-
state.record = record;
|
|
71
|
-
state.pullContinuation = record.pullContinuation ?? null;
|
|
72
|
-
}
|
|
73
|
-
async function restoreLoadedInitialDocument(input) {
|
|
74
|
-
const { initializeGeneration, persistedState, state } = input;
|
|
75
|
-
const record = persistedState.document;
|
|
76
|
-
if (!record)
|
|
77
|
-
return null;
|
|
78
|
-
const history = await restorePersistedDocumentContent(input.nextDoc, persistedState.historyRestoreState);
|
|
79
|
-
if (state.localWriteGeneration !== initializeGeneration)
|
|
80
|
-
return null;
|
|
81
|
-
installPersistedDocumentRecord(state, record);
|
|
82
|
-
return {
|
|
83
|
-
activePersistedState: persistedState,
|
|
84
|
-
activeRecord: record,
|
|
85
|
-
doc: input.nextDoc,
|
|
86
|
-
history,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
async function restoreOrCreateInitialDocument(input) {
|
|
90
|
-
const { initializeGeneration, persistedState, state } = input;
|
|
91
|
-
if (persistedState.document) {
|
|
92
|
-
return restoreLoadedInitialDocument(input);
|
|
93
|
-
}
|
|
94
|
-
const created = await createInitialDocumentRecord(state, input.nextDoc);
|
|
95
|
-
if (!created || state.localWriteGeneration !== initializeGeneration) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
const activePersistedState = await loadPersistedDocumentStoreState({
|
|
99
|
-
execSql: state.runtime.infra.execSql,
|
|
100
|
-
localId: state.localId,
|
|
101
|
-
persistence: state.persistence,
|
|
102
|
-
});
|
|
103
|
-
if (state.localWriteGeneration !== initializeGeneration) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
if (!activePersistedState.document) {
|
|
107
|
-
throw new Error("Document creation completed without a durable record");
|
|
108
|
-
}
|
|
109
|
-
const replacementDoc = await createStoredDocument(state);
|
|
110
|
-
return restoreLoadedInitialDocument({
|
|
111
|
-
initializeGeneration,
|
|
112
|
-
nextDoc: replacementDoc,
|
|
113
|
-
persistedState: activePersistedState,
|
|
114
|
-
state,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
function restorePendingBaseVersion(input) {
|
|
118
|
-
const { activeRecord, doc, history, state } = input;
|
|
119
|
-
const markerBase = activeRecord.pendingBaseVersion ??
|
|
120
|
-
(activeRecord.snapshotEndVersion.length > 0
|
|
121
|
-
? activeRecord.snapshotEndVersion
|
|
122
|
-
: null);
|
|
123
|
-
if (markerBase === null) {
|
|
124
|
-
advancePendingBaseVersion(state, doc);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
const remoteCoverage = restoredRemoteTailCoverage(history);
|
|
128
|
-
state.pendingBaseVersion =
|
|
129
|
-
remoteCoverage.length > 0
|
|
130
|
-
? mergeVersionVectors([markerBase, ...remoteCoverage])
|
|
131
|
-
: markerBase;
|
|
132
|
-
}
|
|
133
|
-
async function initializeDocumentStore(state, scheduleSync) {
|
|
134
|
-
if (state.runtime.infra.dbStatus !== "ready") {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
// A store reset while this fire-and-forget initialization is loading (a
|
|
138
|
-
// runtime swap, or a local-edits discard that re-seeds the persisted rows)
|
|
139
|
-
// must win: assigning the state loaded BEFORE the reset would bring the
|
|
140
|
-
// replaced record and doc back to life. Every reset bumps the local write
|
|
141
|
-
// generation, so a stale capture here aborts before each assignment batch.
|
|
142
|
-
const initializeGeneration = state.localWriteGeneration;
|
|
143
|
-
const nextDoc = await createStoredDocument(state);
|
|
144
|
-
const persistedState = await loadPersistedDocumentStoreState({
|
|
145
|
-
execSql: state.runtime.infra.execSql,
|
|
146
|
-
localId: state.localId,
|
|
147
|
-
persistence: state.persistence,
|
|
148
|
-
});
|
|
149
|
-
if (state.localWriteGeneration !== initializeGeneration) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const restored = await restoreOrCreateInitialDocument({
|
|
153
|
-
initializeGeneration,
|
|
154
|
-
nextDoc,
|
|
155
|
-
persistedState,
|
|
156
|
-
state,
|
|
157
|
-
});
|
|
158
|
-
if (!restored) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
const activePersistedState = restored.activePersistedState;
|
|
162
|
-
installPersistedAttachments(state, activePersistedState);
|
|
163
|
-
state.doc = restored.doc;
|
|
164
|
-
// Restore the durable outgoing-delta marker. Re-seeding it to the restored
|
|
165
|
-
// document's version would move it PAST any device-first `deferRemoteSync`
|
|
166
|
-
// op (persisted into the durable history but deliberately left un-enqueued
|
|
167
|
-
// and behind the marker), permanently dropping that op from sync across a
|
|
168
|
-
// restart. When a marker was persisted, restore it so the next edit still
|
|
169
|
-
// re-derives the deferred delta. Only seed for rows that never persisted
|
|
170
|
-
// one, from the RECORD's persisted frontier rather than the restored
|
|
171
|
-
// document: a crash between the tail append and the queue/marker writes can
|
|
172
|
-
// resurrect ops the outgoing queue never durably received, and seeding from
|
|
173
|
-
// the restored document would classify those as covered and orphan them
|
|
174
|
-
// from sync forever.
|
|
175
|
-
restorePendingBaseVersion({
|
|
176
|
-
activeRecord: restored.activeRecord,
|
|
177
|
-
doc: restored.doc,
|
|
178
|
-
history: restored.history,
|
|
179
|
-
state,
|
|
180
|
-
});
|
|
181
|
-
// Heal attachment slots lost to an interrupted attach write before marking
|
|
182
|
-
// ready, so the recovered slots are in the snapshot the editor first renders
|
|
183
|
-
// and are queued for sync. recoverDroppedAttachmentSlots advances the marker
|
|
184
|
-
// again for whatever it re-derives. Both helpers gate every durable write
|
|
185
|
-
// on this generation (validated inside the writes' serialized mutations),
|
|
186
|
-
// so a reset mid-helper cannot repopulate discarded state.
|
|
187
|
-
const writeGeneration = captureDocumentStoreSyncGeneration(state, restored.doc);
|
|
188
|
-
if (!writeGeneration) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
await recoverDroppedAttachmentSlots(state, restored.doc, writeGeneration);
|
|
192
|
-
if (state.localWriteGeneration !== initializeGeneration) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
await healLocalAttachmentDetachState(state, restored.doc, activePersistedState, writeGeneration);
|
|
196
|
-
if (state.localWriteGeneration !== initializeGeneration) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
state.initialized = true;
|
|
200
|
-
state.initializePromise = null;
|
|
201
|
-
setReadySnapshot(state, restored.doc, false);
|
|
202
|
-
if (restored.activeRecord.documentId && state.scheduleStartupRemoteSync) {
|
|
203
|
-
// Websocket invalidations are intentionally session-local. A process can
|
|
204
|
-
// stop before receiving a peer device's update event, and no event survives
|
|
205
|
-
// the restart to distinguish a clean local snapshot from a stale one. Probe
|
|
206
|
-
// each opened remote document once after loading it; unopened documents stay
|
|
207
|
-
// lazy, while body and attachment state for a restored window converges.
|
|
208
|
-
allowDocumentStoreRemoteSync(state);
|
|
209
|
-
markDocumentStoreRemoteSyncPending(state, "independent");
|
|
210
|
-
logRevalidationScheduled(state.runtime, "startup");
|
|
211
|
-
}
|
|
212
|
-
scheduleSync();
|
|
213
|
-
void runDocumentOrphanMaintenance(state);
|
|
214
|
-
}
|
|
215
|
-
export function ensureDocumentStoreInitialized(state, scheduleSync) {
|
|
216
|
-
if (state.initialized ||
|
|
217
|
-
state.initializePromise ||
|
|
218
|
-
state.runtime.infra.dbStatus !== "ready") {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const initializePromise = initializeDocumentStore(state, scheduleSync).catch((error) => {
|
|
222
|
-
state.initializePromise = null;
|
|
223
|
-
// A caller that deferred the birth for its attach may give up once
|
|
224
|
-
// opening fails; never leave its durable birth holding sync. No attach
|
|
225
|
-
// has reached a live doc yet, so lifting the hold ships nothing unsafe.
|
|
226
|
-
state.deferInitialUpdate = false;
|
|
227
|
-
if (isDatabaseUnavailableError(error)) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
throw error;
|
|
231
|
-
});
|
|
232
|
-
state.initializePromise = initializePromise;
|
|
233
|
-
void initializePromise.catch(() => undefined);
|
|
234
|
-
}
|
|
235
|
-
export async function awaitInitializationForSync(state) {
|
|
236
|
-
if (!state.initializePromise) {
|
|
237
|
-
return true;
|
|
238
|
-
}
|
|
239
|
-
try {
|
|
240
|
-
await state.initializePromise;
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
catch (error) {
|
|
244
|
-
if (isDatabaseUnavailableError(error)) {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
throw error;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
export async function ensureDocumentStoreReady(state, scheduleSync) {
|
|
251
|
-
ensureDocumentStoreInitialized(state, scheduleSync);
|
|
252
|
-
if (state.initialized) {
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
if (!state.initializePromise) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
return awaitInitializationForSync(state);
|
|
259
|
-
}
|
|
260
|
-
export async function relinkDocumentStore(state, input, scheduleSync, commitSideEffect) {
|
|
261
|
-
if (input.stillCurrent?.() === false ||
|
|
262
|
-
!(await ensureDocumentStoreReady(state, scheduleSync)) ||
|
|
263
|
-
input.stillCurrent?.() === false ||
|
|
264
|
-
!state.doc) {
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
const currentDoc = state.doc;
|
|
268
|
-
const generation = captureDocumentStoreSyncGeneration(state, currentDoc);
|
|
269
|
-
if (!generation)
|
|
270
|
-
return null;
|
|
271
|
-
// Read the record and persist on the identity-write chain so an in-flight
|
|
272
|
-
// eager create cannot interleave: a create that captured a null identity
|
|
273
|
-
// before its network round trip would otherwise write the derived documentId
|
|
274
|
-
// over the one this relink assigns.
|
|
275
|
-
const persisted = await chainIdentityWrite(state, async () => {
|
|
276
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, generation))
|
|
277
|
-
return null;
|
|
278
|
-
const currentDocumentId = state.record?.documentId ?? null;
|
|
279
|
-
const currentAccessEpoch = state.record?.accessEpoch ?? DEFAULT_DOCUMENT_ACCESS_EPOCH;
|
|
280
|
-
const patch = {
|
|
281
|
-
accessEpoch: Math.max(currentAccessEpoch, input.accessEpoch),
|
|
282
|
-
accessStateHash: input.accessStateHash === undefined
|
|
283
|
-
? (state.record?.accessStateHash ?? null)
|
|
284
|
-
: input.accessStateHash,
|
|
285
|
-
containerId: input.containerId,
|
|
286
|
-
documentId: input.documentId,
|
|
287
|
-
};
|
|
288
|
-
if (input.contentKeyBundle !== undefined) {
|
|
289
|
-
patch.contentKeyBundle = input.contentKeyBundle;
|
|
290
|
-
}
|
|
291
|
-
if (input.documentKekTargets !== undefined) {
|
|
292
|
-
patch.documentKekTargets = input.documentKekTargets;
|
|
293
|
-
}
|
|
294
|
-
if (input.documentManifestBundle !== undefined) {
|
|
295
|
-
patch.documentManifestBundle = input.documentManifestBundle;
|
|
296
|
-
}
|
|
297
|
-
// Relink rewrites access/identity metadata, not content. If it lands while
|
|
298
|
-
// the user is mid-edit, re-deriving text/structured fields from the
|
|
299
|
-
// (possibly lagging) doc would republish a stale read over the live
|
|
300
|
-
// optimistic snapshot and drop in-flight keystrokes; preserve the snapshot
|
|
301
|
-
// like the keystroke and sync persists do.
|
|
302
|
-
// A prior chained write may have cleared this store (resurrect-guard
|
|
303
|
-
// refusal): persisting the captured doc against a null record would
|
|
304
|
-
// resurrect the document as a create. The identity check runs inside
|
|
305
|
-
// the chain, after every earlier write settled.
|
|
306
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, generation)) {
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
const result = await persistDocument(state, currentDoc, patch, {
|
|
310
|
-
preserveSnapshotStructuredFields: true,
|
|
311
|
-
preserveSnapshotText: true,
|
|
312
|
-
stillCurrent: input.stillCurrent,
|
|
313
|
-
}, generation, commitSideEffect);
|
|
314
|
-
if (result && currentDocumentId !== input.documentId) {
|
|
315
|
-
state.writerProjection = null;
|
|
316
|
-
invalidateDocumentStoreRemoteSync(state);
|
|
317
|
-
}
|
|
318
|
-
return result;
|
|
319
|
-
});
|
|
320
|
-
// A refused persist means the durable row vanished mid-relink (resurrect
|
|
321
|
-
// guard); there is no summary to report.
|
|
322
|
-
if (!persisted) {
|
|
323
|
-
return null;
|
|
324
|
-
}
|
|
325
|
-
if (persisted.updatedAt === undefined) {
|
|
326
|
-
return null;
|
|
327
|
-
}
|
|
328
|
-
return documentSummaryFromRecord(persisted.record, persisted.updatedAt, state.runtime.infra.documentProjectors);
|
|
329
|
-
}
|
|
330
|
-
//# sourceMappingURL=initialization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initialization.js","sourceRoot":"","sources":["initialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAEL,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,2BAA2B,GAE5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,eAAe,EACf,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAGL,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,iCAAiC,EACjC,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,kBAAkB,CAAC;AAE1B,KAAK,UAAU,2BAA2B,CACxC,KAAyB,EACzB,OAAsB;IAEtB,4BAA4B,CAC1B,OAAO,EAC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AC,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,KAAK,EACL,UAAU,EACV,KAAK,EACL;YACE,gCAAgC,EAAE,IAAI;YACtC,oBAAoB,EAAE,IAAI;YAC1B,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,EACD,UAAU,EACV,gBAAgB,CACjB,CAAC;QACF,IAAI,MAAM,IAAI,iBAAiB,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC;YACrD,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC9B,iCAAiC,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;IACH,yEAAyE;IACzE,yCAAyC;IACzC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,yBAAyB,CAC9B,SAAS,CAAC,MAAM,EAChB,SAAS,CAAC,SAAS,EACnB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CACvC,CAAC;AACJ,CAAC","sourcesContent":["import { bytesToBase64 } from \"@tearleads/encoding\";\nimport {\n emptyVersionVector,\n encodeVersionVector,\n exportAllUpdates,\n exportFullHistorySnapshot,\n mergeVersionVectors,\n} from \"@tearleads/loro\";\nimport {\n DEFAULT_DOCUMENT_ACCESS_EPOCH,\n DEFAULT_DOCUMENT_KIND,\n} from \"../../../data/documents/documentConstants\";\nimport {\n initializeStoredDocumentKind,\n readStoredDocumentState,\n} from \"../../../data/documents/documentKinds\";\nimport type { DocumentSummary } from \"../../../data/documents/documentSummary\";\nimport { createPendingUpdateFields } from \"../../../data/documents/documentSync\";\nimport {\n type DocumentRecord,\n isDatabaseUnavailableError,\n loadPersistedDocumentStoreState,\n} from \"../../../workflows/documents\";\nimport type { DocumentStoreRelinkInput } from \"../types\";\nimport { chainIdentityWrite } from \"./identityWriteChain\";\nimport {\n installPersistedAttachments,\n type LoadedDocumentStoreState,\n} from \"./initializationAttachments\";\nimport {\n type RestoredHistoryState,\n restoredRemoteTailCoverage,\n restorePersistedDocumentContent,\n} from \"./initializationHistory\";\nimport {\n healLocalAttachmentDetachState,\n recoverDroppedAttachmentSlots,\n} from \"./initializationRecovery\";\nimport type { DocumentRelinkCommitSideEffect } from \"./internalRelink\";\nimport { runDocumentOrphanMaintenance } from \"./orphanMaintenance\";\nimport {\n advancePendingBaseVersion,\n documentSummaryFromRecord,\n persistDocument,\n saveDocumentRecord,\n} from \"./persistence\";\nimport { logRevalidationScheduled } from \"./remoteRevalidationTelemetry\";\nimport {\n type DocumentState,\n type DocumentStoreState,\n setReadySnapshot,\n} from \"./state\";\nimport { createStoredDocument } from \"./storedDocument\";\nimport {\n allowDocumentStoreRemoteSync,\n captureDocumentStoreSyncGeneration,\n invalidateDocumentStoreRemoteSync,\n isDocumentStoreSyncGenerationCurrent,\n markDocumentStoreRemoteSyncPending,\n} from \"./syncGeneration\";\n\nasync function createInitialDocumentRecord(\n state: DocumentStoreState,\n nextDoc: DocumentState,\n): ReturnType<typeof saveDocumentRecord> {\n initializeStoredDocumentKind(\n nextDoc,\n state.initialDocumentKind,\n state.runtime.infra.documentProjectors,\n );\n if (state.initialText.length > 0) {\n nextDoc.getText(\"text\").update(state.initialText);\n }\n const initialDocumentState = readStoredDocumentState(\n nextDoc,\n state.runtime.infra.documentProjectors,\n );\n const hasInitialContent =\n state.initialText.length > 0 ||\n state.initialDocumentKind !== DEFAULT_DOCUMENT_KIND;\n const initialUpdate = hasInitialContent\n ? createPendingUpdateFields(exportAllUpdates(nextDoc))\n : null;\n // A deferred birth still commits its checkpoint, but leaves the marker at the\n // empty version with nothing queued: the promised attach exports every op\n // since that marker, so one update carries the birth and the attachment.\n const birthDurability = !initialUpdate\n ? {}\n : state.deferInitialUpdate\n ? { pendingBaseVersionOverride: emptyVersionVector() }\n : { pendingUpdate: initialUpdate };\n\n const created: DocumentRecord = {\n id: state.localId,\n containerId: state.runtime.state.containerId ?? null,\n documentId: state.initialDocumentId,\n documentKind: initialDocumentState.documentKind,\n text: initialDocumentState.text,\n title: initialDocumentState.title,\n snapshotEndVersion: encodeVersionVector(nextDoc),\n accessEpoch: DEFAULT_DOCUMENT_ACCESS_EPOCH,\n accessStateHash: null,\n effectiveAccessLevel: \"admin\",\n lastCommitLsn: null,\n contentKeyBundle: null,\n documentKekTargets: null,\n documentManifestBundle: null,\n };\n // The create-only persistence primitive commits the canonical row and birth\n // checkpoint together. A concurrent initializer either wins both or adopts\n // both, so it cannot replace another pane's history or keying state.\n const persisted = await saveDocumentRecord(\n state,\n nextDoc,\n {\n ...created,\n snapshotEndVersion: encodeVersionVector(nextDoc),\n },\n {\n historyCheckpoint: {\n coveredTailIds: [],\n endVersionVector: encodeVersionVector(nextDoc),\n pruneCoveredLocalState: false,\n snapshot: bytesToBase64(exportFullHistorySnapshot(nextDoc)),\n },\n ...birthDurability,\n },\n );\n return persisted;\n}\n\nfunction installPersistedDocumentRecord(\n state: DocumentStoreState,\n record: NonNullable<DocumentStoreState[\"record\"]>,\n): void {\n state.record = record;\n state.pullContinuation = record.pullContinuation ?? null;\n}\n\ninterface RestoredInitialDocumentState {\n activePersistedState: LoadedDocumentStoreState;\n activeRecord: NonNullable<DocumentStoreState[\"record\"]>;\n doc: DocumentState;\n history: RestoredHistoryState | null;\n}\n\nasync function restoreLoadedInitialDocument(input: {\n initializeGeneration: number;\n nextDoc: DocumentState;\n persistedState: LoadedDocumentStoreState;\n state: DocumentStoreState;\n}): Promise<RestoredInitialDocumentState | null> {\n const { initializeGeneration, persistedState, state } = input;\n const record = persistedState.document;\n if (!record) return null;\n const history = await restorePersistedDocumentContent(\n input.nextDoc,\n persistedState.historyRestoreState,\n );\n if (state.localWriteGeneration !== initializeGeneration) return null;\n installPersistedDocumentRecord(state, record);\n return {\n activePersistedState: persistedState,\n activeRecord: record,\n doc: input.nextDoc,\n history,\n };\n}\n\nasync function restoreOrCreateInitialDocument(input: {\n initializeGeneration: number;\n nextDoc: DocumentState;\n persistedState: LoadedDocumentStoreState;\n state: DocumentStoreState;\n}): Promise<RestoredInitialDocumentState | null> {\n const { initializeGeneration, persistedState, state } = input;\n if (persistedState.document) {\n return restoreLoadedInitialDocument(input);\n }\n\n const created = await createInitialDocumentRecord(state, input.nextDoc);\n if (!created || state.localWriteGeneration !== initializeGeneration) {\n return null;\n }\n const activePersistedState = await loadPersistedDocumentStoreState({\n execSql: state.runtime.infra.execSql,\n localId: state.localId,\n persistence: state.persistence,\n });\n if (state.localWriteGeneration !== initializeGeneration) {\n return null;\n }\n if (!activePersistedState.document) {\n throw new Error(\"Document creation completed without a durable record\");\n }\n const replacementDoc = await createStoredDocument(state);\n return restoreLoadedInitialDocument({\n initializeGeneration,\n nextDoc: replacementDoc,\n persistedState: activePersistedState,\n state,\n });\n}\n\nfunction restorePendingBaseVersion(input: {\n activeRecord: NonNullable<DocumentStoreState[\"record\"]>;\n doc: DocumentState;\n history: RestoredHistoryState | null;\n state: DocumentStoreState;\n}): void {\n const { activeRecord, doc, history, state } = input;\n const markerBase =\n activeRecord.pendingBaseVersion ??\n (activeRecord.snapshotEndVersion.length > 0\n ? activeRecord.snapshotEndVersion\n : null);\n if (markerBase === null) {\n advancePendingBaseVersion(state, doc);\n return;\n }\n\n const remoteCoverage = restoredRemoteTailCoverage(history);\n state.pendingBaseVersion =\n remoteCoverage.length > 0\n ? mergeVersionVectors([markerBase, ...remoteCoverage])\n : markerBase;\n}\n\nasync function initializeDocumentStore(\n state: DocumentStoreState,\n scheduleSync: () => void,\n) {\n if (state.runtime.infra.dbStatus !== \"ready\") {\n return;\n }\n\n // A store reset while this fire-and-forget initialization is loading (a\n // runtime swap, or a local-edits discard that re-seeds the persisted rows)\n // must win: assigning the state loaded BEFORE the reset would bring the\n // replaced record and doc back to life. Every reset bumps the local write\n // generation, so a stale capture here aborts before each assignment batch.\n const initializeGeneration = state.localWriteGeneration;\n\n const nextDoc = await createStoredDocument(state);\n const persistedState = await loadPersistedDocumentStoreState({\n execSql: state.runtime.infra.execSql,\n localId: state.localId,\n persistence: state.persistence,\n });\n if (state.localWriteGeneration !== initializeGeneration) {\n return;\n }\n const restored = await restoreOrCreateInitialDocument({\n initializeGeneration,\n nextDoc,\n persistedState,\n state,\n });\n if (!restored) {\n return;\n }\n const activePersistedState = restored.activePersistedState;\n installPersistedAttachments(state, activePersistedState);\n\n state.doc = restored.doc;\n // Restore the durable outgoing-delta marker. Re-seeding it to the restored\n // document's version would move it PAST any device-first `deferRemoteSync`\n // op (persisted into the durable history but deliberately left un-enqueued\n // and behind the marker), permanently dropping that op from sync across a\n // restart. When a marker was persisted, restore it so the next edit still\n // re-derives the deferred delta. Only seed for rows that never persisted\n // one, from the RECORD's persisted frontier rather than the restored\n // document: a crash between the tail append and the queue/marker writes can\n // resurrect ops the outgoing queue never durably received, and seeding from\n // the restored document would classify those as covered and orphan them\n // from sync forever.\n restorePendingBaseVersion({\n activeRecord: restored.activeRecord,\n doc: restored.doc,\n history: restored.history,\n state,\n });\n // Heal attachment slots lost to an interrupted attach write before marking\n // ready, so the recovered slots are in the snapshot the editor first renders\n // and are queued for sync. recoverDroppedAttachmentSlots advances the marker\n // again for whatever it re-derives. Both helpers gate every durable write\n // on this generation (validated inside the writes' serialized mutations),\n // so a reset mid-helper cannot repopulate discarded state.\n const writeGeneration = captureDocumentStoreSyncGeneration(\n state,\n restored.doc,\n );\n if (!writeGeneration) {\n return;\n }\n await recoverDroppedAttachmentSlots(state, restored.doc, writeGeneration);\n if (state.localWriteGeneration !== initializeGeneration) {\n return;\n }\n await healLocalAttachmentDetachState(\n state,\n restored.doc,\n activePersistedState,\n writeGeneration,\n );\n if (state.localWriteGeneration !== initializeGeneration) {\n return;\n }\n state.initialized = true;\n state.initializePromise = null;\n setReadySnapshot(state, restored.doc, false);\n\n if (restored.activeRecord.documentId && state.scheduleStartupRemoteSync) {\n // Websocket invalidations are intentionally session-local. A process can\n // stop before receiving a peer device's update event, and no event survives\n // the restart to distinguish a clean local snapshot from a stale one. Probe\n // each opened remote document once after loading it; unopened documents stay\n // lazy, while body and attachment state for a restored window converges.\n allowDocumentStoreRemoteSync(state);\n markDocumentStoreRemoteSyncPending(state, \"independent\");\n logRevalidationScheduled(state.runtime, \"startup\");\n }\n scheduleSync();\n void runDocumentOrphanMaintenance(state);\n}\n\nexport function ensureDocumentStoreInitialized(\n state: DocumentStoreState,\n scheduleSync: () => void,\n) {\n if (\n state.initialized ||\n state.initializePromise ||\n state.runtime.infra.dbStatus !== \"ready\"\n ) {\n return;\n }\n\n const initializePromise = initializeDocumentStore(state, scheduleSync).catch(\n (error: unknown) => {\n state.initializePromise = null;\n // A caller that deferred the birth for its attach may give up once\n // opening fails; never leave its durable birth holding sync. No attach\n // has reached a live doc yet, so lifting the hold ships nothing unsafe.\n state.deferInitialUpdate = false;\n\n if (isDatabaseUnavailableError(error)) {\n return;\n }\n\n throw error;\n },\n );\n state.initializePromise = initializePromise;\n void initializePromise.catch(() => undefined);\n}\n\nexport async function awaitInitializationForSync(state: DocumentStoreState) {\n if (!state.initializePromise) {\n return true;\n }\n\n try {\n await state.initializePromise;\n return true;\n } catch (error) {\n if (isDatabaseUnavailableError(error)) {\n return false;\n }\n\n throw error;\n }\n}\n\nexport async function ensureDocumentStoreReady(\n state: DocumentStoreState,\n scheduleSync: () => void,\n): Promise<boolean> {\n ensureDocumentStoreInitialized(state, scheduleSync);\n\n if (state.initialized) {\n return true;\n }\n\n if (!state.initializePromise) {\n return false;\n }\n\n return awaitInitializationForSync(state);\n}\n\nexport async function relinkDocumentStore(\n state: DocumentStoreState,\n input: DocumentStoreRelinkInput,\n scheduleSync: () => void,\n commitSideEffect?: DocumentRelinkCommitSideEffect,\n): Promise<DocumentSummary | null> {\n if (\n input.stillCurrent?.() === false ||\n !(await ensureDocumentStoreReady(state, scheduleSync)) ||\n input.stillCurrent?.() === false ||\n !state.doc\n ) {\n return null;\n }\n const currentDoc = state.doc;\n const generation = captureDocumentStoreSyncGeneration(state, currentDoc);\n if (!generation) return null;\n // Read the record and persist on the identity-write chain so an in-flight\n // eager create cannot interleave: a create that captured a null identity\n // before its network round trip would otherwise write the derived documentId\n // over the one this relink assigns.\n const persisted = await chainIdentityWrite(state, async () => {\n if (!isDocumentStoreSyncGenerationCurrent(state, generation)) return null;\n const currentDocumentId = state.record?.documentId ?? null;\n const currentAccessEpoch =\n state.record?.accessEpoch ?? DEFAULT_DOCUMENT_ACCESS_EPOCH;\n const patch: Partial<DocumentRecord> = {\n accessEpoch: Math.max(currentAccessEpoch, input.accessEpoch),\n accessStateHash:\n input.accessStateHash === undefined\n ? (state.record?.accessStateHash ?? null)\n : input.accessStateHash,\n containerId: input.containerId,\n documentId: input.documentId,\n };\n if (input.contentKeyBundle !== undefined) {\n patch.contentKeyBundle = input.contentKeyBundle;\n }\n if (input.documentKekTargets !== undefined) {\n patch.documentKekTargets = input.documentKekTargets;\n }\n if (input.documentManifestBundle !== undefined) {\n patch.documentManifestBundle = input.documentManifestBundle;\n }\n\n // Relink rewrites access/identity metadata, not content. If it lands while\n // the user is mid-edit, re-deriving text/structured fields from the\n // (possibly lagging) doc would republish a stale read over the live\n // optimistic snapshot and drop in-flight keystrokes; preserve the snapshot\n // like the keystroke and sync persists do.\n // A prior chained write may have cleared this store (resurrect-guard\n // refusal): persisting the captured doc against a null record would\n // resurrect the document as a create. The identity check runs inside\n // the chain, after every earlier write settled.\n if (!isDocumentStoreSyncGenerationCurrent(state, generation)) {\n return null;\n }\n const result = await persistDocument(\n state,\n currentDoc,\n patch,\n {\n preserveSnapshotStructuredFields: true,\n preserveSnapshotText: true,\n stillCurrent: input.stillCurrent,\n },\n generation,\n commitSideEffect,\n );\n if (result && currentDocumentId !== input.documentId) {\n state.writerProjection = null;\n invalidateDocumentStoreRemoteSync(state);\n }\n return result;\n });\n // A refused persist means the durable row vanished mid-relink (resurrect\n // guard); there is no summary to report.\n if (!persisted) {\n return null;\n }\n if (persisted.updatedAt === undefined) {\n return null;\n }\n return documentSummaryFromRecord(\n persisted.record,\n persisted.updatedAt,\n state.runtime.infra.documentProjectors,\n );\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { assignLocalAttachmentSlots } from "./attachmentPersistence.js";
|
|
2
|
-
export function installPersistedAttachments(state, persistedState) {
|
|
3
|
-
state.pendingAttachments = persistedState.pendingAttachments;
|
|
4
|
-
state.attachmentBlobIdBySlotId = {};
|
|
5
|
-
state.attachmentContentSha256BySlotId = {};
|
|
6
|
-
state.attachmentStorageKeyBySlotId = {};
|
|
7
|
-
assignLocalAttachmentSlots(state, persistedState.localAttachments);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=initializationAttachments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initializationAttachments.js","sourceRoot":"","sources":["initializationAttachments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAOrE,MAAM,UAAU,2BAA2B,CACzC,KAAyB,EACzB,cAAwC;IAExC,KAAK,CAAC,kBAAkB,GAAG,cAAc,CAAC,kBAAkB,CAAC;IAC7D,KAAK,CAAC,wBAAwB,GAAG,EAAE,CAAC;IACpC,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC;IAC3C,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC;IACxC,0BAA0B,CAAC,KAAK,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import type { loadPersistedDocumentStoreState } from \"../../../workflows/documents\";\nimport { assignLocalAttachmentSlots } from \"./attachmentPersistence\";\nimport type { DocumentStoreState } from \"./state\";\n\nexport type LoadedDocumentStoreState = Awaited<\n ReturnType<typeof loadPersistedDocumentStoreState>\n>;\n\nexport function installPersistedAttachments(\n state: DocumentStoreState,\n persistedState: LoadedDocumentStoreState,\n): void {\n state.pendingAttachments = persistedState.pendingAttachments;\n state.attachmentBlobIdBySlotId = {};\n state.attachmentContentSha256BySlotId = {};\n state.attachmentStorageKeyBySlotId = {};\n assignLocalAttachmentSlots(state, persistedState.localAttachments);\n}\n"]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { base64ToBytes } from "../../../internal/encoding/index.js";
|
|
2
|
-
import { getImportBlobMetadata, importSnapshot } from "../../../internal/loro/index.js";
|
|
3
|
-
import { importDocumentHistoryTailUpdates, } from "../../../workflows/documents/index.js";
|
|
4
|
-
function installRestoredDocumentContent(nextDoc, history) {
|
|
5
|
-
if (history.snapshot.length > 0) {
|
|
6
|
-
importSnapshot(nextDoc, base64ToBytes(history.snapshot));
|
|
7
|
-
}
|
|
8
|
-
importDocumentHistoryTailUpdates(nextDoc, history.tailUpdates.map((update) => update.updateData));
|
|
9
|
-
}
|
|
10
|
-
export function restorePersistedDocumentContent(nextDoc, history) {
|
|
11
|
-
if (!history)
|
|
12
|
-
return null;
|
|
13
|
-
installRestoredDocumentContent(nextDoc, history);
|
|
14
|
-
return history;
|
|
15
|
-
}
|
|
16
|
-
export function restoredRemoteTailCoverage(history) {
|
|
17
|
-
if (!history)
|
|
18
|
-
return [];
|
|
19
|
-
return history.tailUpdates.flatMap((update) => {
|
|
20
|
-
if (update.origin !== "remote")
|
|
21
|
-
return [];
|
|
22
|
-
try {
|
|
23
|
-
return [
|
|
24
|
-
getImportBlobMetadata(base64ToBytes(update.updateData))
|
|
25
|
-
.partialEndVersionVector,
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=initializationHistory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initializationHistory.js","sourceRoot":"","sources":["initializationHistory.ts"],"names":[],"mappings":"AAAA,O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loro\";\nimport {\n type DocumentsPersistence,\n importDocumentHistoryTailUpdates,\n} from \"../../../workflows/documents\";\nimport type { DocumentState } from \"./state\";\n\nexport type RestoredHistoryState = NonNullable<\n Awaited<ReturnType<DocumentsPersistence[\"loadHistoryRestoreState\"]>>\n>;\n\nfunction installRestoredDocumentContent(\n nextDoc: DocumentState,\n history: RestoredHistoryState,\n): void {\n if (history.snapshot.length > 0) {\n importSnapshot(nextDoc, base64ToBytes(history.snapshot));\n }\n importDocumentHistoryTailUpdates(\n nextDoc,\n history.tailUpdates.map((update) => update.updateData),\n );\n}\n\nexport function restorePersistedDocumentContent(\n nextDoc: DocumentState,\n history: RestoredHistoryState | null,\n): RestoredHistoryState | null {\n if (!history) return null;\n installRestoredDocumentContent(nextDoc, history);\n return history;\n}\n\nexport function restoredRemoteTailCoverage(\n history: RestoredHistoryState | null,\n): string[] {\n if (!history) return [];\n return history.tailUpdates.flatMap((update) => {\n if (update.origin !== \"remote\") return [];\n try {\n return [\n getImportBlobMetadata(base64ToBytes(update.updateData))\n .partialEndVersionVector,\n ];\n } catch {\n return [];\n }\n });\n}\n"]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { encodeVersionVector } from "../../../internal/loro/index.js";
|
|
2
|
-
import { addDocumentAttachments, getDocumentAttachments, } from "../../../data/documents/documentContent.js";
|
|
3
|
-
import { reconcileLocalAttachmentDetachState } from "./attachmentDetachState.js";
|
|
4
|
-
import { saveLocalAttachmentRecord } from "./attachmentPersistence.js";
|
|
5
|
-
import { rebaseDocumentAfterPendingUpdateRefusal } from "./pendingUpdateRefusal.js";
|
|
6
|
-
import { advancePendingBaseVersion, enqueuePendingUpdate, pendingDeltaSinceBase, persistDocument, } from "./persistence.js";
|
|
7
|
-
import { isDocumentStoreSyncGenerationCurrent } from "./syncGeneration.js";
|
|
8
|
-
// Re-derive any attachment slot that lives in a durable pending-upload row but
|
|
9
|
-
// is missing (or stale) in the loaded snapshot. The attach write path persists
|
|
10
|
-
// the blob bytes + pending-attachment row BEFORE it enqueues the slot's CRDT op
|
|
11
|
-
// and persists the snapshot, so a crash in that window leaves bytes+row durable
|
|
12
|
-
// but the slot gone from the document — the attachment would otherwise silently
|
|
13
|
-
// disappear on restart while its bytes upload to a binding nothing references
|
|
14
|
-
// (and a slot replace would keep stale metadata). Because the pending row still
|
|
15
|
-
// carries the slot's metadata and staging digest, we can rebuild the slot without
|
|
16
|
-
// opening bytes; normal upload reports missing sources. Runs on init only; a
|
|
17
|
-
// no-op when every pending attachment already matches a slot.
|
|
18
|
-
export async function recoverDroppedAttachmentSlots(state, doc, writeGeneration) {
|
|
19
|
-
if (!doc || state.pendingAttachments.length === 0) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const existingBySlotId = new Map(getDocumentAttachments(doc).map((attachment) => [
|
|
23
|
-
attachment.slotId,
|
|
24
|
-
attachment,
|
|
25
|
-
]));
|
|
26
|
-
const recovered = [];
|
|
27
|
-
for (const pending of state.pendingAttachments) {
|
|
28
|
-
const mimeType = pending.mimeType ?? null;
|
|
29
|
-
const existing = existingBySlotId.get(pending.slotId);
|
|
30
|
-
const contentSha256 = pending.contentSha256;
|
|
31
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, writeGeneration))
|
|
32
|
-
return;
|
|
33
|
-
if (existing &&
|
|
34
|
-
existing.name === pending.name &&
|
|
35
|
-
existing.byteLength === pending.byteLength &&
|
|
36
|
-
existing.mimeType === mimeType &&
|
|
37
|
-
existing.contentSha256 === contentSha256) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
recovered.push({
|
|
41
|
-
contentSha256,
|
|
42
|
-
byteLength: pending.byteLength,
|
|
43
|
-
mimeType,
|
|
44
|
-
name: pending.name,
|
|
45
|
-
slotId: pending.slotId,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (recovered.length === 0) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
addDocumentAttachments(doc, recovered);
|
|
52
|
-
const update = pendingDeltaSinceBase(state, doc);
|
|
53
|
-
// Every durable write is gated on the captured generation — the enqueue
|
|
54
|
-
// validates it INSIDE its serialized mutation, and the persist re-checks
|
|
55
|
-
// via its expectedGeneration overload — so a store reset (e.g. a
|
|
56
|
-
// local-edits discard) racing this recovery cannot see it re-enqueue or
|
|
57
|
-
// re-persist the state the teardown just removed.
|
|
58
|
-
if (update.byteLength > 0) {
|
|
59
|
-
const enqueued = await enqueuePendingUpdate(state, update, undefined, writeGeneration);
|
|
60
|
-
if (!enqueued) {
|
|
61
|
-
const rebased = await rebaseDocumentAfterPendingUpdateRefusal(state, writeGeneration);
|
|
62
|
-
if (rebased) {
|
|
63
|
-
// Initialization captured the losing identity and must restart from
|
|
64
|
-
// the winner, including its attachment rows and detach markers.
|
|
65
|
-
throw new Error("Document identity changed during attachment recovery; retry initialization");
|
|
66
|
-
}
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Derive the snapshot from the loaded doc (do NOT preserve the snapshot). This
|
|
71
|
-
// runs during init, before the store is ready, so state.snapshot is still the
|
|
72
|
-
// empty initial snapshot — preserving it would publish a ready snapshot with
|
|
73
|
-
// empty text/structured fields (a flash of empty content) over the real loaded
|
|
74
|
-
// content. There is no in-flight user edit to protect here. The doc is
|
|
75
|
-
// private to initialization and the enqueue above dual-wrote its delta, so
|
|
76
|
-
// its version is a durably covered frontier.
|
|
77
|
-
const persisted = await persistDocument(state, doc, { snapshotEndVersion: encodeVersionVector(doc) }, {}, writeGeneration);
|
|
78
|
-
if (!persisted ||
|
|
79
|
-
persisted.pullContinuationSuperseded ||
|
|
80
|
-
persisted.syncIdentitySuperseded) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
advancePendingBaseVersion(state, doc);
|
|
84
|
-
state.runtime.util.log(`Documents: recovered ${recovered.length} attachment slot(s) from pending uploads after an interrupted write.`);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Realign detach markers with the loaded document.
|
|
88
|
-
*
|
|
89
|
-
* Removing an attachment marks its row detached and then persists the document;
|
|
90
|
-
* a stop between those two writes leaves the halves disagreeing, and neither
|
|
91
|
-
* the sync detach pass (which reads the document) nor the read models (which
|
|
92
|
-
* read the marker) can resolve that on their own. The loaded document is the
|
|
93
|
-
* durable truth, so the marker follows it.
|
|
94
|
-
*/
|
|
95
|
-
export async function healLocalAttachmentDetachState(state, doc, persistedState, writeGeneration) {
|
|
96
|
-
const healed = reconcileLocalAttachmentDetachState(persistedState.localAttachments, doc);
|
|
97
|
-
for (const attachment of healed) {
|
|
98
|
-
// The save validates the generation inside its serialized mutation, so a
|
|
99
|
-
// concurrent store reset can never see this heal rewrite rows the
|
|
100
|
-
// teardown just removed.
|
|
101
|
-
await saveLocalAttachmentRecord(state, attachment, doc, writeGeneration);
|
|
102
|
-
}
|
|
103
|
-
if (healed.length > 0) {
|
|
104
|
-
state.runtime.util.log(`Documents: realigned ${healed.length} attachment detach marker(s) with the loaded document.`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=initializationRecovery.js.map
|