@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,241 +0,0 @@
|
|
|
1
|
-
import { encodeVersionVector, exportFullHistorySnapshot, } from "../../../internal/loro/index.js";
|
|
2
|
-
import { addDocumentAttachments } from "../../../data/documents/documentContent.js";
|
|
3
|
-
import { requestDocumentStoreSync } from "../registry.js";
|
|
4
|
-
import { buildAttachmentIntent, buildPendingAttachments, } from "./attachmentIntents.js";
|
|
5
|
-
import { persistStagedAttachmentMutation, restoreFailedAttachmentMutation, } from "./attachmentMutationPersistence.js";
|
|
6
|
-
import { deleteUnreferencedStagedAttachmentBytes, installPendingAttachmentRows, stagePendingAttachments, } from "./attachmentStaging.js";
|
|
7
|
-
import { captureAttachmentWriteGeneration, isAttachmentWriteGenerationCurrent, shouldAbortAttachmentPersistFollowup, } from "./attachmentWriteGeneration.js";
|
|
8
|
-
import { settleDeferredInitialUpdate } from "./deferredInitialUpdate.js";
|
|
9
|
-
import { ensureDocumentStoreReady } from "./initialization.js";
|
|
10
|
-
import { advancePendingBaseVersion, pendingDeltaSinceBase, } from "./persistence.js";
|
|
11
|
-
import { reportDocumentStoreWriteFailure } from "./reportWriteFailure.js";
|
|
12
|
-
import { canAttachFiles, canWriteDocument, } from "./state.js";
|
|
13
|
-
import { captureDocumentStoreSyncGeneration } from "./syncGeneration.js";
|
|
14
|
-
// Fixed literal: a reported message must never carry file names or slot ids.
|
|
15
|
-
export const ATTACHMENT_FAILURE_MESSAGE = "Documents: attachment mutation failed";
|
|
16
|
-
function logAttachedFiles(state, count) {
|
|
17
|
-
state.runtime.util.log(state.runtime.state.online && state.runtime.auth.isAuthenticated
|
|
18
|
-
? `Attached ${count} file${count === 1 ? "" : "s"} to document ${state.localId}.`
|
|
19
|
-
: `Stored ${count} attachment${count === 1 ? "" : "s"} locally for document ${state.localId}.`);
|
|
20
|
-
}
|
|
21
|
-
async function persistAttachedFiles(state, files, writeGeneration) {
|
|
22
|
-
if (!isAttachmentWriteGenerationCurrent(state, writeGeneration))
|
|
23
|
-
return;
|
|
24
|
-
const currentDoc = state.doc;
|
|
25
|
-
if (!currentDoc || !canAttachFiles(state)) {
|
|
26
|
-
state.runtime.util.log("Documents: attachments require a local key package.");
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const generation = captureDocumentStoreSyncGeneration(state, currentDoc);
|
|
30
|
-
if (!generation) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const { nextAttachments, nextPendingAttachments } = await buildPendingAttachments(state.localId, files);
|
|
34
|
-
if (!isAttachmentWriteGenerationCurrent(state, writeGeneration) ||
|
|
35
|
-
state.doc !== currentDoc)
|
|
36
|
-
return;
|
|
37
|
-
const rollbackSnapshot = exportFullHistorySnapshot(currentDoc).slice();
|
|
38
|
-
addDocumentAttachments(currentDoc, nextAttachments);
|
|
39
|
-
const attachmentUpdate = pendingDeltaSinceBase(state, currentDoc);
|
|
40
|
-
// Captured at delta time: the enqueued row proves coverage up to exactly
|
|
41
|
-
// this version, so it is the frontier the persist below may publish.
|
|
42
|
-
const coveredVersion = encodeVersionVector(currentDoc);
|
|
43
|
-
let staged;
|
|
44
|
-
try {
|
|
45
|
-
staged = await stagePendingAttachments({
|
|
46
|
-
files,
|
|
47
|
-
generation,
|
|
48
|
-
pendingAttachments: nextPendingAttachments,
|
|
49
|
-
state,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
await restoreFailedAttachmentMutation({
|
|
54
|
-
generation,
|
|
55
|
-
rollbackSnapshot,
|
|
56
|
-
state,
|
|
57
|
-
});
|
|
58
|
-
throw error;
|
|
59
|
-
}
|
|
60
|
-
if (!staged) {
|
|
61
|
-
await restoreFailedAttachmentMutation({
|
|
62
|
-
generation,
|
|
63
|
-
rollbackSnapshot,
|
|
64
|
-
state,
|
|
65
|
-
});
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
// This persist changes attachments, not prose. setReadySnapshot always
|
|
69
|
-
// re-derives attachments from the doc, but preserve the text/structured
|
|
70
|
-
// fields so an attach that overlaps an in-flight keystroke does not republish
|
|
71
|
-
// a stale doc read over the live optimistic editor value.
|
|
72
|
-
const persisted = await persistStagedAttachmentMutation({
|
|
73
|
-
attachmentUpdate,
|
|
74
|
-
coveredVersion,
|
|
75
|
-
currentDoc,
|
|
76
|
-
generation,
|
|
77
|
-
rollbackSnapshot,
|
|
78
|
-
staged,
|
|
79
|
-
state,
|
|
80
|
-
});
|
|
81
|
-
if (shouldAbortAttachmentPersistFollowup(state, writeGeneration, generation, persisted)) {
|
|
82
|
-
await deleteUnreferencedStagedAttachmentBytes({
|
|
83
|
-
generation,
|
|
84
|
-
pendingAttachments: staged.pendingAttachments,
|
|
85
|
-
state,
|
|
86
|
-
});
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
installPendingAttachmentRows({ ...staged, state });
|
|
90
|
-
advancePendingBaseVersion(state, currentDoc);
|
|
91
|
-
logAttachedFiles(state, files.length);
|
|
92
|
-
requestDocumentStoreSync(state);
|
|
93
|
-
}
|
|
94
|
-
async function persistSlotAttachmentFile(state, slotId, file, writeGeneration) {
|
|
95
|
-
if (!isAttachmentWriteGenerationCurrent(state, writeGeneration))
|
|
96
|
-
return;
|
|
97
|
-
const currentDoc = state.doc;
|
|
98
|
-
if (!currentDoc || !canAttachFiles(state)) {
|
|
99
|
-
state.runtime.util.log("Documents: slot attachments require a local key package.");
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const generation = captureDocumentStoreSyncGeneration(state, currentDoc);
|
|
103
|
-
if (!generation) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const replacementAttachment = await buildAttachmentIntent(slotId, file);
|
|
107
|
-
if (!isAttachmentWriteGenerationCurrent(state, writeGeneration) ||
|
|
108
|
-
state.doc !== currentDoc)
|
|
109
|
-
return;
|
|
110
|
-
const rollbackSnapshot = exportFullHistorySnapshot(currentDoc).slice();
|
|
111
|
-
addDocumentAttachments(currentDoc, [replacementAttachment]);
|
|
112
|
-
const attachmentUpdate = pendingDeltaSinceBase(state, currentDoc);
|
|
113
|
-
const coveredVersion = encodeVersionVector(currentDoc);
|
|
114
|
-
const storageKey = `${state.localId}-${slotId}-${crypto.randomUUID()}`;
|
|
115
|
-
const pendingAttachment = {
|
|
116
|
-
byteLength: replacementAttachment.byteLength,
|
|
117
|
-
contentSha256: replacementAttachment.contentSha256,
|
|
118
|
-
localId: state.localId,
|
|
119
|
-
mimeType: replacementAttachment.mimeType,
|
|
120
|
-
name: replacementAttachment.name,
|
|
121
|
-
slotId,
|
|
122
|
-
storageKey,
|
|
123
|
-
};
|
|
124
|
-
let staged;
|
|
125
|
-
try {
|
|
126
|
-
staged = await stagePendingAttachments({
|
|
127
|
-
files: [file],
|
|
128
|
-
generation,
|
|
129
|
-
pendingAttachments: [pendingAttachment],
|
|
130
|
-
state,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
await restoreFailedAttachmentMutation({
|
|
135
|
-
generation,
|
|
136
|
-
rollbackSnapshot,
|
|
137
|
-
state,
|
|
138
|
-
});
|
|
139
|
-
throw error;
|
|
140
|
-
}
|
|
141
|
-
if (!staged) {
|
|
142
|
-
await restoreFailedAttachmentMutation({
|
|
143
|
-
generation,
|
|
144
|
-
rollbackSnapshot,
|
|
145
|
-
state,
|
|
146
|
-
});
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
// Preserve the optimistic text/structured fields (see persistAttachedFiles):
|
|
150
|
-
// a slot replacement overlapping a keystroke must not regress the editor.
|
|
151
|
-
const persisted = await persistStagedAttachmentMutation({
|
|
152
|
-
attachmentUpdate,
|
|
153
|
-
coveredVersion,
|
|
154
|
-
currentDoc,
|
|
155
|
-
generation,
|
|
156
|
-
rollbackSnapshot,
|
|
157
|
-
staged,
|
|
158
|
-
state,
|
|
159
|
-
});
|
|
160
|
-
if (shouldAbortAttachmentPersistFollowup(state, writeGeneration, generation, persisted)) {
|
|
161
|
-
await deleteUnreferencedStagedAttachmentBytes({
|
|
162
|
-
generation,
|
|
163
|
-
pendingAttachments: staged.pendingAttachments,
|
|
164
|
-
state,
|
|
165
|
-
});
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
installPendingAttachmentRows({ ...staged, state });
|
|
169
|
-
advancePendingBaseVersion(state, currentDoc);
|
|
170
|
-
state.runtime.util.log(`Queued attachment ${file.name} for slot ${slotId}.`);
|
|
171
|
-
requestDocumentStoreSync(state);
|
|
172
|
-
}
|
|
173
|
-
async function captureReadyAttachWrite(state, scheduleSync, callGeneration) {
|
|
174
|
-
let ready;
|
|
175
|
-
try {
|
|
176
|
-
ready = await ensureDocumentStoreReady(state, scheduleSync);
|
|
177
|
-
}
|
|
178
|
-
catch (error) {
|
|
179
|
-
reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);
|
|
180
|
-
return null;
|
|
181
|
-
}
|
|
182
|
-
if (!ready || !state.doc || !canWriteDocument(state))
|
|
183
|
-
return null;
|
|
184
|
-
// A reset or relink while this call waited owns the replacement document.
|
|
185
|
-
if (callGeneration &&
|
|
186
|
-
!isAttachmentWriteGenerationCurrent(state, callGeneration)) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
return captureAttachmentWriteGeneration(state);
|
|
190
|
-
}
|
|
191
|
-
async function attachThenSettle(state, scheduleSync, files, callGeneration) {
|
|
192
|
-
const writeGeneration = files.length === 0
|
|
193
|
-
? null
|
|
194
|
-
: await captureReadyAttachWrite(state, scheduleSync, callGeneration);
|
|
195
|
-
try {
|
|
196
|
-
if (writeGeneration) {
|
|
197
|
-
await persistAttachedFiles(state, files, writeGeneration);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
finally {
|
|
201
|
-
await settleDeferredInitialUpdate(state, writeGeneration);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
export async function attachFilesToDocumentStore(state, scheduleSync, files) {
|
|
205
|
-
// Join the chain before awaiting readiness so settlements keep call order,
|
|
206
|
-
// and settle even when nothing attaches: a deferred birth's sync hold lifts
|
|
207
|
-
// only behind every earlier attach, never while one is still staging. The
|
|
208
|
-
// caller's document is captured now (a cold store captures once ready).
|
|
209
|
-
const callGeneration = captureAttachmentWriteGeneration(state);
|
|
210
|
-
state.writeChain = state.writeChain
|
|
211
|
-
.catch(() => undefined)
|
|
212
|
-
.then(async () => attachThenSettle(state, scheduleSync, files, callGeneration))
|
|
213
|
-
.catch((error) => {
|
|
214
|
-
reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);
|
|
215
|
-
});
|
|
216
|
-
return state.writeChain;
|
|
217
|
-
}
|
|
218
|
-
export async function replaceAttachmentInDocumentStore(state, scheduleSync, slotId, file) {
|
|
219
|
-
let ready;
|
|
220
|
-
try {
|
|
221
|
-
ready = await ensureDocumentStoreReady(state, scheduleSync);
|
|
222
|
-
}
|
|
223
|
-
catch (error) {
|
|
224
|
-
reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
if (!ready || !state.doc || !canWriteDocument(state)) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
const writeGeneration = captureAttachmentWriteGeneration(state);
|
|
231
|
-
if (!writeGeneration)
|
|
232
|
-
return;
|
|
233
|
-
state.writeChain = state.writeChain
|
|
234
|
-
.catch(() => undefined)
|
|
235
|
-
.then(async () => persistSlotAttachmentFile(state, slotId, file, writeGeneration))
|
|
236
|
-
.catch((error) => {
|
|
237
|
-
reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);
|
|
238
|
-
});
|
|
239
|
-
return state.writeChain;
|
|
240
|
-
}
|
|
241
|
-
//# sourceMappingURL=attachments.js.map
|
|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\n exportFullHistorySnapshot,\n} from \"@tearleads/loro\";\nimport { addDocumentAttachments } from \"../../../data/documents/documentContent\";\nimport type { PendingAttachmentRecord } from \"../../../workflows/documents\";\nimport { requestDocumentStoreSync } from \"../registry\";\nimport type { DocumentAttachmentUpload } from \"../types\";\nimport {\n buildAttachmentIntent,\n buildPendingAttachments,\n} from \"./attachmentIntents\";\nimport {\n persistStagedAttachmentMutation,\n restoreFailedAttachmentMutation,\n} from \"./attachmentMutationPersistence\";\nimport {\n deleteUnreferencedStagedAttachmentBytes,\n installPendingAttachmentRows,\n stagePendingAttachments,\n} from \"./attachmentStaging\";\nimport {\n type AttachmentWriteGeneration,\n captureAttachmentWriteGeneration,\n isAttachmentWriteGenerationCurrent,\n shouldAbortAttachmentPersistFollowup,\n} from \"./attachmentWriteGeneration\";\nimport { settleDeferredInitialUpdate } from \"./deferredInitialUpdate\";\nimport { ensureDocumentStoreReady } from \"./initialization\";\nimport {\n advancePendingBaseVersion,\n pendingDeltaSinceBase,\n} from \"./persistence\";\nimport { reportDocumentStoreWriteFailure } from \"./reportWriteFailure\";\nimport {\n canAttachFiles,\n canWriteDocument,\n type DocumentStoreState,\n} from \"./state\";\nimport { captureDocumentStoreSyncGeneration } from \"./syncGeneration\";\n\n// Fixed literal: a reported message must never carry file names or slot ids.\nexport const ATTACHMENT_FAILURE_MESSAGE =\n \"Documents: attachment mutation failed\";\n\nfunction logAttachedFiles(state: DocumentStoreState, count: number) {\n state.runtime.util.log(\n state.runtime.state.online && state.runtime.auth.isAuthenticated\n ? `Attached ${count} file${count === 1 ? \"\" : \"s\"} to document ${state.localId}.`\n : `Stored ${count} attachment${count === 1 ? \"\" : \"s\"} locally for document ${state.localId}.`,\n );\n}\n\nasync function persistAttachedFiles(\n state: DocumentStoreState,\n files: ReadonlyArray<DocumentAttachmentUpload>,\n writeGeneration: AttachmentWriteGeneration,\n) {\n if (!isAttachmentWriteGenerationCurrent(state, writeGeneration)) return;\n const currentDoc = state.doc;\n\n if (!currentDoc || !canAttachFiles(state)) {\n state.runtime.util.log(\n \"Documents: attachments require a local key package.\",\n );\n return;\n }\n const generation = captureDocumentStoreSyncGeneration(state, currentDoc);\n if (!generation) {\n return;\n }\n\n const { nextAttachments, nextPendingAttachments } =\n await buildPendingAttachments(state.localId, files);\n if (\n !isAttachmentWriteGenerationCurrent(state, writeGeneration) ||\n state.doc !== currentDoc\n )\n return;\n const rollbackSnapshot = exportFullHistorySnapshot(currentDoc).slice();\n addDocumentAttachments(currentDoc, nextAttachments);\n const attachmentUpdate = pendingDeltaSinceBase(state, currentDoc);\n // Captured at delta time: the enqueued row proves coverage up to exactly\n // this version, so it is the frontier the persist below may publish.\n const coveredVersion = encodeVersionVector(currentDoc);\n\n let staged: Awaited<ReturnType<typeof stagePendingAttachments>>;\n try {\n staged = await stagePendingAttachments({\n files,\n generation,\n pendingAttachments: nextPendingAttachments,\n state,\n });\n } catch (error) {\n await restoreFailedAttachmentMutation({\n generation,\n rollbackSnapshot,\n state,\n });\n throw error;\n }\n if (!staged) {\n await restoreFailedAttachmentMutation({\n generation,\n rollbackSnapshot,\n state,\n });\n return;\n }\n // This persist changes attachments, not prose. setReadySnapshot always\n // re-derives attachments from the doc, but preserve the text/structured\n // fields so an attach that overlaps an in-flight keystroke does not republish\n // a stale doc read over the live optimistic editor value.\n const persisted = await persistStagedAttachmentMutation({\n attachmentUpdate,\n coveredVersion,\n currentDoc,\n generation,\n rollbackSnapshot,\n staged,\n state,\n });\n if (\n shouldAbortAttachmentPersistFollowup(\n state,\n writeGeneration,\n generation,\n persisted,\n )\n ) {\n await deleteUnreferencedStagedAttachmentBytes({\n generation,\n pendingAttachments: staged.pendingAttachments,\n state,\n });\n return;\n }\n installPendingAttachmentRows({ ...staged, state });\n advancePendingBaseVersion(state, currentDoc);\n logAttachedFiles(state, files.length);\n requestDocumentStoreSync(state);\n}\n\nasync function persistSlotAttachmentFile(\n state: DocumentStoreState,\n slotId: string,\n file: DocumentAttachmentUpload,\n writeGeneration: AttachmentWriteGeneration,\n) {\n if (!isAttachmentWriteGenerationCurrent(state, writeGeneration)) return;\n const currentDoc = state.doc;\n\n if (!currentDoc || !canAttachFiles(state)) {\n state.runtime.util.log(\n \"Documents: slot attachments require a local key package.\",\n );\n return;\n }\n const generation = captureDocumentStoreSyncGeneration(state, currentDoc);\n if (!generation) {\n return;\n }\n\n const replacementAttachment = await buildAttachmentIntent(slotId, file);\n if (\n !isAttachmentWriteGenerationCurrent(state, writeGeneration) ||\n state.doc !== currentDoc\n )\n return;\n const rollbackSnapshot = exportFullHistorySnapshot(currentDoc).slice();\n addDocumentAttachments(currentDoc, [replacementAttachment]);\n const attachmentUpdate = pendingDeltaSinceBase(state, currentDoc);\n const coveredVersion = encodeVersionVector(currentDoc);\n\n const storageKey = `${state.localId}-${slotId}-${crypto.randomUUID()}`;\n const pendingAttachment: PendingAttachmentRecord = {\n byteLength: replacementAttachment.byteLength,\n contentSha256: replacementAttachment.contentSha256,\n localId: state.localId,\n mimeType: replacementAttachment.mimeType,\n name: replacementAttachment.name,\n slotId,\n storageKey,\n };\n let staged: Awaited<ReturnType<typeof stagePendingAttachments>>;\n try {\n staged = await stagePendingAttachments({\n files: [file],\n generation,\n pendingAttachments: [pendingAttachment],\n state,\n });\n } catch (error) {\n await restoreFailedAttachmentMutation({\n generation,\n rollbackSnapshot,\n state,\n });\n throw error;\n }\n if (!staged) {\n await restoreFailedAttachmentMutation({\n generation,\n rollbackSnapshot,\n state,\n });\n return;\n }\n // Preserve the optimistic text/structured fields (see persistAttachedFiles):\n // a slot replacement overlapping a keystroke must not regress the editor.\n const persisted = await persistStagedAttachmentMutation({\n attachmentUpdate,\n coveredVersion,\n currentDoc,\n generation,\n rollbackSnapshot,\n staged,\n state,\n });\n if (\n shouldAbortAttachmentPersistFollowup(\n state,\n writeGeneration,\n generation,\n persisted,\n )\n ) {\n await deleteUnreferencedStagedAttachmentBytes({\n generation,\n pendingAttachments: staged.pendingAttachments,\n state,\n });\n return;\n }\n installPendingAttachmentRows({ ...staged, state });\n advancePendingBaseVersion(state, currentDoc);\n state.runtime.util.log(`Queued attachment ${file.name} for slot ${slotId}.`);\n requestDocumentStoreSync(state);\n}\n\nasync function captureReadyAttachWrite(\n state: DocumentStoreState,\n scheduleSync: () => void,\n callGeneration: AttachmentWriteGeneration | null,\n) {\n let ready: boolean;\n try {\n ready = await ensureDocumentStoreReady(state, scheduleSync);\n } catch (error) {\n reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);\n return null;\n }\n if (!ready || !state.doc || !canWriteDocument(state)) return null;\n // A reset or relink while this call waited owns the replacement document.\n if (\n callGeneration &&\n !isAttachmentWriteGenerationCurrent(state, callGeneration)\n ) {\n return null;\n }\n return captureAttachmentWriteGeneration(state);\n}\n\nasync function attachThenSettle(\n state: DocumentStoreState,\n scheduleSync: () => void,\n files: ReadonlyArray<DocumentAttachmentUpload>,\n callGeneration: AttachmentWriteGeneration | null,\n) {\n const writeGeneration =\n files.length === 0\n ? null\n : await captureReadyAttachWrite(state, scheduleSync, callGeneration);\n try {\n if (writeGeneration) {\n await persistAttachedFiles(state, files, writeGeneration);\n }\n } finally {\n await settleDeferredInitialUpdate(state, writeGeneration);\n }\n}\n\nexport async function attachFilesToDocumentStore(\n state: DocumentStoreState,\n scheduleSync: () => void,\n files: ReadonlyArray<DocumentAttachmentUpload>,\n) {\n // Join the chain before awaiting readiness so settlements keep call order,\n // and settle even when nothing attaches: a deferred birth's sync hold lifts\n // only behind every earlier attach, never while one is still staging. The\n // caller's document is captured now (a cold store captures once ready).\n const callGeneration = captureAttachmentWriteGeneration(state);\n state.writeChain = state.writeChain\n .catch(() => undefined)\n .then(async () =>\n attachThenSettle(state, scheduleSync, files, callGeneration),\n )\n .catch((error: unknown) => {\n reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);\n });\n return state.writeChain;\n}\n\nexport async function replaceAttachmentInDocumentStore(\n state: DocumentStoreState,\n scheduleSync: () => void,\n slotId: string,\n file: DocumentAttachmentUpload,\n) {\n let ready: boolean;\n try {\n ready = await ensureDocumentStoreReady(state, scheduleSync);\n } catch (error) {\n reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);\n return;\n }\n\n if (!ready || !state.doc || !canWriteDocument(state)) {\n return;\n }\n\n const writeGeneration = captureAttachmentWriteGeneration(state);\n if (!writeGeneration) return;\n state.writeChain = state.writeChain\n .catch(() => undefined)\n .then(async () =>\n persistSlotAttachmentFile(state, slotId, file, writeGeneration),\n )\n .catch((error: unknown) => {\n reportDocumentStoreWriteFailure(state, ATTACHMENT_FAILURE_MESSAGE, error);\n });\n return state.writeChain;\n}\n"]}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { encodeVersionVector, satisfiesVersionVector } from "../../../internal/loro/index.js";
|
|
2
|
-
import { createPendingUpdateFields } from "../../../data/documents/documentSync.js";
|
|
3
|
-
import { requestDocumentStoreSync } from "../registry.js";
|
|
4
|
-
import { captureAttachmentWriteGeneration, isAttachmentWriteGenerationCurrent, } from "./attachmentWriteGeneration.js";
|
|
5
|
-
import { reloadDocumentFromDurableHistory } from "./durableDocumentReload.js";
|
|
6
|
-
import { ensureDocumentStoreInitialized } from "./initialization.js";
|
|
7
|
-
import { advancePendingBaseVersion, pendingDeltaSinceBase, persistDocument, } from "./persistence.js";
|
|
8
|
-
import { resetDocumentStore } from "./state.js";
|
|
9
|
-
import { captureDocumentStoreSyncGeneration, isDocumentStoreSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
10
|
-
/**
|
|
11
|
-
* Runs after the first attach on a store opened with `deferInitialUpdate`.
|
|
12
|
-
* Creation committed the birth without a pending update, leaving the marker at
|
|
13
|
-
* the empty version so that attach's delta would carry it, and scheduled sync
|
|
14
|
-
* passes wait meanwhile (see `canRunScheduledSync`) so none ships the birth on
|
|
15
|
-
* its own. When the attach did not land (staging failed or returned null, its
|
|
16
|
-
* persist was refused, or the store could not attach), enqueue the deferred
|
|
17
|
-
* tail now so the document still syncs, without its attachment. Either way,
|
|
18
|
-
* lift the hold and request the pass it skipped.
|
|
19
|
-
*/
|
|
20
|
-
export async function settleDeferredInitialUpdate(state, writeGeneration) {
|
|
21
|
-
if (!state.deferInitialUpdate)
|
|
22
|
-
return;
|
|
23
|
-
// Before initialization finishes no attach has touched a live doc, and a
|
|
24
|
-
// reload here would install one behind initialization's back (or mark a
|
|
25
|
-
// not-yet-created document removed). Lift the hold; initialization then
|
|
26
|
-
// restores the empty marker and schedules the pass that ships the birth.
|
|
27
|
-
if (!state.initialized) {
|
|
28
|
-
state.deferInitialUpdate = false;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
// A pass exports the live doc, so it must hold only durable content (see
|
|
32
|
-
// restoreDurableLiveDocument) before the hold lifts. When that cannot be
|
|
33
|
-
// shown, even after a transient failure, reinitialize from durable history
|
|
34
|
-
// rather than latch the hold: the reset lifts it and drops the live doc.
|
|
35
|
-
let durable = false;
|
|
36
|
-
try {
|
|
37
|
-
durable = await restoreDurableLiveDocument(state);
|
|
38
|
-
}
|
|
39
|
-
finally {
|
|
40
|
-
if (!durable && state.deferInitialUpdate && state.doc) {
|
|
41
|
-
resetDocumentStore(state);
|
|
42
|
-
ensureDocumentStoreInitialized(state, () => requestDocumentStoreSync(state));
|
|
43
|
-
}
|
|
44
|
-
else if (!durable) {
|
|
45
|
-
// No live doc remains to leak (a concurrent removal): just lift it.
|
|
46
|
-
state.deferInitialUpdate = false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (!durable)
|
|
50
|
-
return;
|
|
51
|
-
state.deferInitialUpdate = false;
|
|
52
|
-
try {
|
|
53
|
-
await enqueueDeferredTail(state, writeGeneration);
|
|
54
|
-
}
|
|
55
|
-
finally {
|
|
56
|
-
requestDocumentStoreSync(state);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function isLiveDocumentDurable(state) {
|
|
60
|
-
return (state.doc !== null &&
|
|
61
|
-
state.record !== null &&
|
|
62
|
-
satisfiesVersionVector(state.record.snapshotEndVersion, encodeVersionVector(state.doc)));
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* A failed attach whose rollback reload could not run (its generation went
|
|
66
|
-
* stale mid-stage) leaves the uncommitted slot in the live doc, and that slot
|
|
67
|
-
* must never sync without its staged bytes. Reload durable history under a
|
|
68
|
-
* fresh generation before trusting the live doc.
|
|
69
|
-
*/
|
|
70
|
-
async function restoreDurableLiveDocument(state) {
|
|
71
|
-
if (isLiveDocumentDurable(state))
|
|
72
|
-
return true;
|
|
73
|
-
const generation = captureDocumentStoreSyncGeneration(state, state.doc);
|
|
74
|
-
if (generation) {
|
|
75
|
-
await reloadDocumentFromDurableHistory({
|
|
76
|
-
expectedGeneration: generation,
|
|
77
|
-
preserveQueuedWritesWhenIdentityMatches: true,
|
|
78
|
-
state,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return isLiveDocumentDurable(state);
|
|
82
|
-
}
|
|
83
|
-
async function enqueueDeferredTail(state, writeGeneration) {
|
|
84
|
-
// A reset or relink owns the replacement store; its deferred tail stays
|
|
85
|
-
// durable and the next write or sync pass materializes it. With no attach
|
|
86
|
-
// (nothing to attach, or the store was not writable) the live store owns it.
|
|
87
|
-
const generation = writeGeneration ?? captureAttachmentWriteGeneration(state);
|
|
88
|
-
if (!generation || !isAttachmentWriteGenerationCurrent(state, generation)) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const currentDoc = state.doc;
|
|
92
|
-
const baseVersion = state.pendingBaseVersion;
|
|
93
|
-
if (!currentDoc || baseVersion === null)
|
|
94
|
-
return;
|
|
95
|
-
const documentVersion = encodeVersionVector(currentDoc);
|
|
96
|
-
// Settled: the attach (or an earlier write) already enqueued the birth.
|
|
97
|
-
if (satisfiesVersionVector(baseVersion, documentVersion))
|
|
98
|
-
return;
|
|
99
|
-
const syncGeneration = captureDocumentStoreSyncGeneration(state, currentDoc);
|
|
100
|
-
if (!syncGeneration)
|
|
101
|
-
return;
|
|
102
|
-
const pendingUpdate = createPendingUpdateFields(pendingDeltaSinceBase(state, currentDoc));
|
|
103
|
-
if (!pendingUpdate)
|
|
104
|
-
return;
|
|
105
|
-
const persisted = await persistDocument(state, currentDoc, { snapshotEndVersion: documentVersion }, {
|
|
106
|
-
pendingUpdate,
|
|
107
|
-
preserveSnapshotStructuredFields: true,
|
|
108
|
-
preserveSnapshotText: true,
|
|
109
|
-
}, syncGeneration);
|
|
110
|
-
if (!persisted ||
|
|
111
|
-
!isDocumentStoreSyncGenerationCurrent(state, syncGeneration)) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
advancePendingBaseVersion(state, currentDoc);
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=deferredInitialUpdate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deferredInitialUpdate.js","sourceRoot":"","sources":["deferredInitialUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAEL,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,KAAyB,EACzB,eAAiD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M,SAAS,GAAG,MAAM,eAAe,CACrC,KAAK,EACL,UAAU,EACV,EAAE,kBAAkB,EAAE,eAAe,EAAE,EACvC;QACE,aAAa;QACb,gCAAgC,EAAE,IAAI;QACtC,oBAAoB,EAAE,IAAI;KAC3B,EACD,cAAc,CACf,CAAC;IACF,IACE,CAAC,SAAS;QACV,CAAC,oCAAoC,CAAC,KAAK,EAAE,cAAc,CAAC,EAC5D,CAAC;QACD,OAAO;IACT,CAAC;IACD,yBAAyB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { encodeVersionVector, satisfiesVersionVector } from \"@tearleads/loro\";\nimport { createPendingUpdateFields } from \"../../../data/documents/documentSync\";\nimport { requestDocumentStoreSync } from \"../registry\";\nimport {\n type AttachmentWriteGeneration,\n captureAttachmentWriteGeneration,\n isAttachmentWriteGenerationCurrent,\n} from \"./attachmentWriteGeneration\";\nimport { reloadDocumentFromDurableHistory } from \"./durableDocumentReload\";\nimport { ensureDocumentStoreInitialized } from \"./initialization\";\nimport {\n advancePendingBaseVersion,\n pendingDeltaSinceBase,\n persistDocument,\n} from \"./persistence\";\nimport { type DocumentStoreState, resetDocumentStore } from \"./state\";\nimport {\n captureDocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent,\n} from \"./syncGeneration\";\n\n/**\n * Runs after the first attach on a store opened with `deferInitialUpdate`.\n * Creation committed the birth without a pending update, leaving the marker at\n * the empty version so that attach's delta would carry it, and scheduled sync\n * passes wait meanwhile (see `canRunScheduledSync`) so none ships the birth on\n * its own. When the attach did not land (staging failed or returned null, its\n * persist was refused, or the store could not attach), enqueue the deferred\n * tail now so the document still syncs, without its attachment. Either way,\n * lift the hold and request the pass it skipped.\n */\nexport async function settleDeferredInitialUpdate(\n state: DocumentStoreState,\n writeGeneration: AttachmentWriteGeneration | null,\n): Promise<void> {\n if (!state.deferInitialUpdate) return;\n // Before initialization finishes no attach has touched a live doc, and a\n // reload here would install one behind initialization's back (or mark a\n // not-yet-created document removed). Lift the hold; initialization then\n // restores the empty marker and schedules the pass that ships the birth.\n if (!state.initialized) {\n state.deferInitialUpdate = false;\n return;\n }\n // A pass exports the live doc, so it must hold only durable content (see\n // restoreDurableLiveDocument) before the hold lifts. When that cannot be\n // shown, even after a transient failure, reinitialize from durable history\n // rather than latch the hold: the reset lifts it and drops the live doc.\n let durable = false;\n try {\n durable = await restoreDurableLiveDocument(state);\n } finally {\n if (!durable && state.deferInitialUpdate && state.doc) {\n resetDocumentStore(state);\n ensureDocumentStoreInitialized(state, () =>\n requestDocumentStoreSync(state),\n );\n } else if (!durable) {\n // No live doc remains to leak (a concurrent removal): just lift it.\n state.deferInitialUpdate = false;\n }\n }\n if (!durable) return;\n state.deferInitialUpdate = false;\n try {\n await enqueueDeferredTail(state, writeGeneration);\n } finally {\n requestDocumentStoreSync(state);\n }\n}\n\nfunction isLiveDocumentDurable(state: DocumentStoreState): boolean {\n return (\n state.doc !== null &&\n state.record !== null &&\n satisfiesVersionVector(\n state.record.snapshotEndVersion,\n encodeVersionVector(state.doc),\n )\n );\n}\n\n/**\n * A failed attach whose rollback reload could not run (its generation went\n * stale mid-stage) leaves the uncommitted slot in the live doc, and that slot\n * must never sync without its staged bytes. Reload durable history under a\n * fresh generation before trusting the live doc.\n */\nasync function restoreDurableLiveDocument(\n state: DocumentStoreState,\n): Promise<boolean> {\n if (isLiveDocumentDurable(state)) return true;\n const generation = captureDocumentStoreSyncGeneration(state, state.doc);\n if (generation) {\n await reloadDocumentFromDurableHistory({\n expectedGeneration: generation,\n preserveQueuedWritesWhenIdentityMatches: true,\n state,\n });\n }\n return isLiveDocumentDurable(state);\n}\n\nasync function enqueueDeferredTail(\n state: DocumentStoreState,\n writeGeneration: AttachmentWriteGeneration | null,\n): Promise<void> {\n // A reset or relink owns the replacement store; its deferred tail stays\n // durable and the next write or sync pass materializes it. With no attach\n // (nothing to attach, or the store was not writable) the live store owns it.\n const generation = writeGeneration ?? captureAttachmentWriteGeneration(state);\n if (!generation || !isAttachmentWriteGenerationCurrent(state, generation)) {\n return;\n }\n const currentDoc = state.doc;\n const baseVersion = state.pendingBaseVersion;\n if (!currentDoc || baseVersion === null) return;\n const documentVersion = encodeVersionVector(currentDoc);\n // Settled: the attach (or an earlier write) already enqueued the birth.\n if (satisfiesVersionVector(baseVersion, documentVersion)) return;\n const syncGeneration = captureDocumentStoreSyncGeneration(state, currentDoc);\n if (!syncGeneration) return;\n const pendingUpdate = createPendingUpdateFields(\n pendingDeltaSinceBase(state, currentDoc),\n );\n if (!pendingUpdate) return;\n const persisted = await persistDocument(\n state,\n currentDoc,\n { snapshotEndVersion: documentVersion },\n {\n pendingUpdate,\n preserveSnapshotStructuredFields: true,\n preserveSnapshotText: true,\n },\n syncGeneration,\n );\n if (\n !persisted ||\n !isDocumentStoreSyncGenerationCurrent(state, syncGeneration)\n ) {\n return;\n }\n advancePendingBaseVersion(state, currentDoc);\n}\n"]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { base64ToBytes, bytesToBase64 } from "../../../internal/encoding/index.js";
|
|
2
|
-
import { encodeVersionVector, exportFullHistorySnapshot, updateMatchesDocumentHistory, } from "../../../internal/loro/index.js";
|
|
3
|
-
import { DOCUMENT_HISTORY_COMPACTION_MAX_BYTES, DOCUMENT_HISTORY_COMPACTION_MAX_ROWS, } from "../../../workflows/documents/index.js";
|
|
4
|
-
import { captureDocumentStoreSyncGeneration, isDocumentStoreSyncGenerationCurrent as isSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
5
|
-
/**
|
|
6
|
-
* Refresh the durable full-history checkpoint when the tail has grown past
|
|
7
|
-
* the compaction thresholds, or seed the first checkpoint as soon as the
|
|
8
|
-
* document can export full history (a freshly created or rebuilt document is
|
|
9
|
-
* cheap to export; waiting for the threshold would leave restarts without
|
|
10
|
-
* history until then). The snapshot comes from the LIVE document, which has
|
|
11
|
-
* every tail update imported, so clearing the tail loses nothing.
|
|
12
|
-
*/
|
|
13
|
-
export async function maybeCompactDocumentHistory(state, currentDoc, stillCurrent) {
|
|
14
|
-
const { persistence } = state;
|
|
15
|
-
// Bind this compaction to the store context it started under: a store
|
|
16
|
-
// reset or runtime swap mid-compaction must not let the OLD document's
|
|
17
|
-
// checkpoint overwrite the replacement generation's history (or land in a
|
|
18
|
-
// newly selected database).
|
|
19
|
-
const generation = captureDocumentStoreSyncGeneration(state, currentDoc);
|
|
20
|
-
if (!generation || stillCurrent?.() === false) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const execSql = state.runtime.infra.execSql;
|
|
24
|
-
const tail = await persistence.readHistoryTailSize(execSql, state.localId);
|
|
25
|
-
if (tail.hasCheckpoint &&
|
|
26
|
-
tail.rowCount < DOCUMENT_HISTORY_COMPACTION_MAX_ROWS &&
|
|
27
|
-
tail.byteLength < DOCUMENT_HISTORY_COMPACTION_MAX_BYTES) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// Capture the tail BEFORE exporting, then prove coverage per row: another
|
|
31
|
-
// pane can append ops this pane's document has not merged, so blanket
|
|
32
|
-
// deletion would discard the only durable copy. Unproven rows survive for
|
|
33
|
-
// a later compaction by whichever pane holds their ops.
|
|
34
|
-
const tailEntries = await persistence.listHistoryTailEntries(execSql, state.localId);
|
|
35
|
-
const snapshot = exportFullHistorySnapshot(currentDoc);
|
|
36
|
-
if (!isSyncGenerationCurrent(state, generation) ||
|
|
37
|
-
stillCurrent?.() === false) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const endVersionVector = encodeVersionVector(currentDoc);
|
|
41
|
-
await persistence.replaceHistoryCheckpoint(execSql, {
|
|
42
|
-
coveredTailIds: coveredHistoryTailIds(tailEntries, currentDoc),
|
|
43
|
-
endVersionVector,
|
|
44
|
-
localId: state.localId,
|
|
45
|
-
snapshot: bytesToBase64(snapshot),
|
|
46
|
-
stillCurrent: () => isSyncGenerationCurrent(state, generation) && stillCurrent?.() !== false,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Tail rows whose exact operations already belong to the checkpoint document.
|
|
51
|
-
* Version-vector dominance is insufficient: a same-frontier fork has the same
|
|
52
|
-
* declared range, and malformed rows must survive so recovery fails closed
|
|
53
|
-
* instead of compaction deleting the evidence before provenance validation.
|
|
54
|
-
*/
|
|
55
|
-
function coveredHistoryTailIds(tailEntries, document) {
|
|
56
|
-
return tailEntries.flatMap((entry) => {
|
|
57
|
-
try {
|
|
58
|
-
return updateMatchesDocumentHistory(document, base64ToBytes(entry.updateData))
|
|
59
|
-
? [entry.id]
|
|
60
|
-
: [];
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=documentHistoryCompaction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"documentHistoryCompaction.js","sourceRoot":"","sources":["documentHistoryCompaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,kCAAkC,EAClC,oCAAoC,IAAI,uBAAuB,GAChE,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,KAAyB,EACzB,UAAyB,EACzB,YAA0C;IAE1C,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9B,sEAAsE;IACtE,uEAAuE;IACvE,0EAA0E;IAC1E,4BAA4B;IAC5B,MAAM,UAAU,GAAG,kCAAkC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACzE,IAAI,CAAC,UAAU,IAAI,YAAY,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E,EAAE;QACnC,IAAI,CAAC;YACH,OAAO,4BAA4B,CACjC,QAAQ,EACR,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAChC;gBACC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBACZ,CAAC,CAAC,EAAE,CAAC;QACT,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { base64ToBytes, bytesToBase64 } from \"@tearleads/encoding\";\nimport {\n encodeVersionVector,\n exportFullHistorySnapshot,\n updateMatchesDocumentHistory,\n} from \"@tearleads/loro\";\nimport {\n DOCUMENT_HISTORY_COMPACTION_MAX_BYTES,\n DOCUMENT_HISTORY_COMPACTION_MAX_ROWS,\n} from \"../../../workflows/documents\";\nimport type { DocumentState, DocumentStoreState } from \"./state\";\nimport {\n captureDocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent as isSyncGenerationCurrent,\n} from \"./syncGeneration\";\n\n/**\n * Refresh the durable full-history checkpoint when the tail has grown past\n * the compaction thresholds, or seed the first checkpoint as soon as the\n * document can export full history (a freshly created or rebuilt document is\n * cheap to export; waiting for the threshold would leave restarts without\n * history until then). The snapshot comes from the LIVE document, which has\n * every tail update imported, so clearing the tail loses nothing.\n */\nexport async function maybeCompactDocumentHistory(\n state: DocumentStoreState,\n currentDoc: DocumentState,\n stillCurrent?: (() => boolean) | undefined,\n): Promise<void> {\n const { persistence } = state;\n // Bind this compaction to the store context it started under: a store\n // reset or runtime swap mid-compaction must not let the OLD document's\n // checkpoint overwrite the replacement generation's history (or land in a\n // newly selected database).\n const generation = captureDocumentStoreSyncGeneration(state, currentDoc);\n if (!generation || stillCurrent?.() === false) {\n return;\n }\n const execSql = state.runtime.infra.execSql;\n const tail = await persistence.readHistoryTailSize(execSql, state.localId);\n if (\n tail.hasCheckpoint &&\n tail.rowCount < DOCUMENT_HISTORY_COMPACTION_MAX_ROWS &&\n tail.byteLength < DOCUMENT_HISTORY_COMPACTION_MAX_BYTES\n ) {\n return;\n }\n\n // Capture the tail BEFORE exporting, then prove coverage per row: another\n // pane can append ops this pane's document has not merged, so blanket\n // deletion would discard the only durable copy. Unproven rows survive for\n // a later compaction by whichever pane holds their ops.\n const tailEntries = await persistence.listHistoryTailEntries(\n execSql,\n state.localId,\n );\n const snapshot = exportFullHistorySnapshot(currentDoc);\n if (\n !isSyncGenerationCurrent(state, generation) ||\n stillCurrent?.() === false\n ) {\n return;\n }\n const endVersionVector = encodeVersionVector(currentDoc);\n await persistence.replaceHistoryCheckpoint(execSql, {\n coveredTailIds: coveredHistoryTailIds(tailEntries, currentDoc),\n endVersionVector,\n localId: state.localId,\n snapshot: bytesToBase64(snapshot),\n stillCurrent: () =>\n isSyncGenerationCurrent(state, generation) && stillCurrent?.() !== false,\n });\n}\n\n/**\n * Tail rows whose exact operations already belong to the checkpoint document.\n * Version-vector dominance is insufficient: a same-frontier fork has the same\n * declared range, and malformed rows must survive so recovery fails closed\n * instead of compaction deleting the evidence before provenance validation.\n */\nfunction coveredHistoryTailIds(\n tailEntries: readonly { id: string; updateData: string }[],\n document: DocumentState,\n): string[] {\n return tailEntries.flatMap((entry) => {\n try {\n return updateMatchesDocumentHistory(\n document,\n base64ToBytes(entry.updateData),\n )\n ? [entry.id]\n : [];\n } catch {\n return [];\n }\n });\n}\n"]}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { base64ToBytes } from "../../../internal/encoding/index.js";
|
|
2
|
-
import { importSnapshot } from "../../../internal/loro/index.js";
|
|
3
|
-
import { importDocumentHistoryTailUpdates, runSerializedSqlMutation, } from "../../../workflows/documents/index.js";
|
|
4
|
-
import { markDocumentStoreRemoved, setReadySnapshot, } from "./state.js";
|
|
5
|
-
import { createFreshPeerStoredDocument } from "./storedDocument.js";
|
|
6
|
-
import { isDocumentStoreSyncGenerationCurrent, } from "./syncGeneration.js";
|
|
7
|
-
export function importDurableDocumentHistory(replacementDoc, history) {
|
|
8
|
-
if (history?.snapshot) {
|
|
9
|
-
importSnapshot(replacementDoc, base64ToBytes(history.snapshot));
|
|
10
|
-
}
|
|
11
|
-
if (history) {
|
|
12
|
-
importDocumentHistoryTailUpdates(replacementDoc, history.tailUpdates.map((update) => update.updateData));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function installDurableDocumentReload(input) {
|
|
16
|
-
const { durableRecord, replacementDoc, state } = input;
|
|
17
|
-
const previousDocumentId = input.previousDocumentId === undefined
|
|
18
|
-
? (state.record?.documentId ?? null)
|
|
19
|
-
: input.previousDocumentId;
|
|
20
|
-
const identityChanged = previousDocumentId !== durableRecord.documentId;
|
|
21
|
-
const preserveQueuedWrites = input.preserveQueuedWritesWhenIdentityMatches && !identityChanged;
|
|
22
|
-
if (!preserveQueuedWrites) {
|
|
23
|
-
state.localWriteGeneration += 1;
|
|
24
|
-
state.pendingLocalWrites = 0;
|
|
25
|
-
}
|
|
26
|
-
state.record = durableRecord;
|
|
27
|
-
state.pullContinuation = durableRecord.pullContinuation ?? null;
|
|
28
|
-
state.pendingBaseVersion =
|
|
29
|
-
durableRecord.pendingBaseVersion ??
|
|
30
|
-
(durableRecord.snapshotEndVersion.length > 0
|
|
31
|
-
? durableRecord.snapshotEndVersion
|
|
32
|
-
: null);
|
|
33
|
-
state.doc = replacementDoc;
|
|
34
|
-
state.writerProjection = null;
|
|
35
|
-
if (identityChanged && input.registerIdentityChange !== false) {
|
|
36
|
-
state.effects.registerDocumentIdentity(state.runtime.state.domainScope, durableRecord.id, durableRecord.documentId);
|
|
37
|
-
}
|
|
38
|
-
const preserveOptimisticProjection = preserveQueuedWrites && state.pendingLocalWrites > 0;
|
|
39
|
-
setReadySnapshot(state, replacementDoc, state.snapshot.syncing, preserveOptimisticProjection ? state.snapshot.text : undefined, preserveOptimisticProjection ? state.snapshot.structuredFields : undefined);
|
|
40
|
-
}
|
|
41
|
-
export async function reloadDocumentFromDurableHistory(input) {
|
|
42
|
-
const { expectedGeneration, state } = input;
|
|
43
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const replacementDoc = await createFreshPeerStoredDocument();
|
|
47
|
-
return runSerializedSqlMutation(state.runtime.infra.execSql, async (lockedExecSql) => {
|
|
48
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
const { document: durableRecord, historyRestoreState } = await state.persistence.loadDocumentWithHistoryRestoreState(lockedExecSql, state.localId);
|
|
52
|
-
if (!durableRecord) {
|
|
53
|
-
markDocumentStoreRemoved(state);
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
const canRestoreCapturedSnapshot = Boolean(input.sameIdentitySnapshot &&
|
|
57
|
-
(state.record?.documentId ?? null) === durableRecord.documentId);
|
|
58
|
-
if (canRestoreCapturedSnapshot && input.sameIdentitySnapshot) {
|
|
59
|
-
importSnapshot(replacementDoc, input.sameIdentitySnapshot);
|
|
60
|
-
}
|
|
61
|
-
// The captured snapshot removes the failed in-memory mutation, but it
|
|
62
|
-
// cannot replace the durable source of truth: another pane may have
|
|
63
|
-
// advanced history and the record frontier while attachment staging was
|
|
64
|
-
// in flight. Merge the latest checkpoint and tail in both paths before
|
|
65
|
-
// installing that record/frontier beside the rebuilt CRDT.
|
|
66
|
-
importDurableDocumentHistory(replacementDoc, historyRestoreState);
|
|
67
|
-
if (!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
installDurableDocumentReload({
|
|
71
|
-
durableRecord,
|
|
72
|
-
preserveQueuedWritesWhenIdentityMatches: input.preserveQueuedWritesWhenIdentityMatches,
|
|
73
|
-
replacementDoc,
|
|
74
|
-
state,
|
|
75
|
-
});
|
|
76
|
-
return true;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=durableDocumentReload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"durableDocumentReload.js","sourceRoot":"","sources":["durableDocumentReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAEL,oCAAoC,GACrC,MAAM,kBAAkB,CAAC;AAS1B,MAAM,UAAU,4BAA4B,CAC1C,cAA6B,EAC7B,OAAuB;IAEvB,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,cAAc,CAAC,cAAc,EAAE,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,OAAO,EAAE,CAAC;QACZ,gCAAgC,CAC9B,cAAc,EACd,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CACvD,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,KAO5C;IACC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,kBAAkB,GACtB,KAAK,CAAC,kBAAkB,KAAK,SAAS;QACpC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC;QACpC,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;IAC/B,MAAM,eAAe,GAAG,kBAAkB,KAAK,aAAa,CAAC,UAAU,CAAC;IACxE,MAAM,oBAAoB,GACxB,KAAK,CAAC,uCA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AC,uCAAuC;YAC/C,cAAc;YACd,KAAK;SACN,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { base64ToBytes } from \"@tearleads/encoding\";\nimport { importSnapshot } from \"@tearleads/loro\";\nimport {\n importDocumentHistoryTailUpdates,\n runSerializedSqlMutation,\n} from \"../../../workflows/documents\";\nimport {\n type DocumentState,\n type DocumentStoreState,\n markDocumentStoreRemoved,\n setReadySnapshot,\n} from \"./state\";\nimport { createFreshPeerStoredDocument } from \"./storedDocument\";\nimport {\n type DocumentStoreSyncGeneration,\n isDocumentStoreSyncGenerationCurrent,\n} from \"./syncGeneration\";\n\ntype DurableDocumentRecord = NonNullable<\n Awaited<ReturnType<DocumentStoreState[\"persistence\"][\"loadDocument\"]>>\n>;\ntype DurableHistory = Awaited<\n ReturnType<DocumentStoreState[\"persistence\"][\"loadHistoryRestoreState\"]>\n>;\n\nexport function importDurableDocumentHistory(\n replacementDoc: DocumentState,\n history: DurableHistory,\n): void {\n if (history?.snapshot) {\n importSnapshot(replacementDoc, base64ToBytes(history.snapshot));\n }\n if (history) {\n importDocumentHistoryTailUpdates(\n replacementDoc,\n history.tailUpdates.map((update) => update.updateData),\n );\n }\n}\n\nexport function installDurableDocumentReload(input: {\n durableRecord: DurableDocumentRecord;\n previousDocumentId?: string | null | undefined;\n preserveQueuedWritesWhenIdentityMatches: boolean;\n registerIdentityChange?: boolean | undefined;\n replacementDoc: DocumentState;\n state: DocumentStoreState;\n}): void {\n const { durableRecord, replacementDoc, state } = input;\n const previousDocumentId =\n input.previousDocumentId === undefined\n ? (state.record?.documentId ?? null)\n : input.previousDocumentId;\n const identityChanged = previousDocumentId !== durableRecord.documentId;\n const preserveQueuedWrites =\n input.preserveQueuedWritesWhenIdentityMatches && !identityChanged;\n if (!preserveQueuedWrites) {\n state.localWriteGeneration += 1;\n state.pendingLocalWrites = 0;\n }\n state.record = durableRecord;\n state.pullContinuation = durableRecord.pullContinuation ?? null;\n state.pendingBaseVersion =\n durableRecord.pendingBaseVersion ??\n (durableRecord.snapshotEndVersion.length > 0\n ? durableRecord.snapshotEndVersion\n : null);\n state.doc = replacementDoc;\n state.writerProjection = null;\n if (identityChanged && input.registerIdentityChange !== false) {\n state.effects.registerDocumentIdentity(\n state.runtime.state.domainScope,\n durableRecord.id,\n durableRecord.documentId,\n );\n }\n const preserveOptimisticProjection =\n preserveQueuedWrites && state.pendingLocalWrites > 0;\n setReadySnapshot(\n state,\n replacementDoc,\n state.snapshot.syncing,\n preserveOptimisticProjection ? state.snapshot.text : undefined,\n preserveOptimisticProjection ? state.snapshot.structuredFields : undefined,\n );\n}\n\nexport async function reloadDocumentFromDurableHistory(input: {\n expectedGeneration: DocumentStoreSyncGeneration;\n preserveQueuedWritesWhenIdentityMatches: boolean;\n sameIdentitySnapshot?: Uint8Array | undefined;\n state: DocumentStoreState;\n}): Promise<boolean> {\n const { expectedGeneration, state } = input;\n if (!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) {\n return false;\n }\n\n const replacementDoc = await createFreshPeerStoredDocument();\n return runSerializedSqlMutation(\n state.runtime.infra.execSql,\n async (lockedExecSql) => {\n if (!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) {\n return false;\n }\n const { document: durableRecord, historyRestoreState } =\n await state.persistence.loadDocumentWithHistoryRestoreState(\n lockedExecSql,\n state.localId,\n );\n if (!durableRecord) {\n markDocumentStoreRemoved(state);\n return false;\n }\n const canRestoreCapturedSnapshot = Boolean(\n input.sameIdentitySnapshot &&\n (state.record?.documentId ?? null) === durableRecord.documentId,\n );\n if (canRestoreCapturedSnapshot && input.sameIdentitySnapshot) {\n importSnapshot(replacementDoc, input.sameIdentitySnapshot);\n }\n // The captured snapshot removes the failed in-memory mutation, but it\n // cannot replace the durable source of truth: another pane may have\n // advanced history and the record frontier while attachment staging was\n // in flight. Merge the latest checkpoint and tail in both paths before\n // installing that record/frontier beside the rebuilt CRDT.\n importDurableDocumentHistory(replacementDoc, historyRestoreState);\n if (!isDocumentStoreSyncGenerationCurrent(state, expectedGeneration)) {\n return false;\n }\n\n installDurableDocumentReload({\n durableRecord,\n preserveQueuedWritesWhenIdentityMatches:\n input.preserveQueuedWritesWhenIdentityMatches,\n replacementDoc,\n state,\n });\n return true;\n },\n );\n}\n"]}
|