@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"principalPolicyCache.js","sourceRoot":"","sources":["principalPolicyCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"principalPolicyCache.js","sourceRoot":"","sources":["principalPolicyCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iFAAiF,CAAC;AAU/H,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAAC,KAM3D;IACC,MAAM,gCAAgC,GACpC,KAAK,CAAC,gCAAgC,CAAC;IACzC,IAAI,CAAC,gCAAgC,EAAE,CAAC;QACtC,OAAO;IACT,CAAC;IAED,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAGvC,CAAC;IAEJ,KAAK,MAAM,eAAe,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACrD,MAAM,UAAU,GAAG,eAAe,CAAC,4BAA4B,CAAC;QAChE,MAAM,EAAE,cAAc,EAAE,GAAG,eAAe,CAAC;QAC3C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,SAAS;QACX,CAAC;QAED,MAAM,sBAAsB,GAC1B,0BAA0B,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAC9D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,sBAAsB,CAAC,GAAG,CACxB,4BAA4B,CAAC,SAAS,CAAC,EACvC,SAAS,CACV,CAAC;QACJ,CAAC;QACD,0BAA0B,CAAC,GAAG,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,GAAG,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,EAAE,EAAE,CACxE,gCAAgC,CAAC;QAC/B,cAAc;QACd,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QACzC,YAAY,EAAE,KAAK,CAAC,YAAY;KACjC,CAAC,CACH,CACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ReferencedPrincipalPolicyWarmer } from \"../../../data/keyingProjectionVerification\";\nimport { referencedPrincipalPolicyKey } from \"../../../data/keyingProjectionVerification/principalPolicy/principalPolicyCache\";\nimport type { RemoteContainer } from \"./types\";\n\ntype RemoteContainerPrincipalReferences = Pick<\n RemoteContainer,\n \"metadataReferencedPrincipals\" | \"organizationId\"\n>;\ntype PrincipalReference =\n RemoteContainer[\"metadataReferencedPrincipals\"][number];\n\nexport async function cacheRemoteContainerPrincipalPolicies(input: {\n readonly cacheReferencedPrincipalPolicies?:\n | ReferencedPrincipalPolicyWarmer\n | undefined;\n readonly remoteContainers: readonly RemoteContainerPrincipalReferences[];\n readonly stillCurrent?: (() => boolean) | undefined;\n}): Promise<void> {\n const cacheReferencedPrincipalPolicies =\n input.cacheReferencedPrincipalPolicies;\n if (!cacheReferencedPrincipalPolicies) {\n return;\n }\n\n const referencesByOrganizationId = new Map<\n string,\n Map<string, PrincipalReference>\n >();\n\n for (const remoteContainer of input.remoteContainers) {\n const references = remoteContainer.metadataReferencedPrincipals;\n const { organizationId } = remoteContainer;\n if (references.length === 0 || !organizationId) {\n continue;\n }\n\n const organizationReferences =\n referencesByOrganizationId.get(organizationId) ?? new Map();\n for (const reference of references) {\n organizationReferences.set(\n referencedPrincipalPolicyKey(reference),\n reference,\n );\n }\n referencesByOrganizationId.set(organizationId, organizationReferences);\n }\n\n await Promise.all(\n [...referencesByOrganizationId].map(([organizationId, referencesByKey]) =>\n cacheReferencedPrincipalPolicies({\n organizationId,\n references: [...referencesByKey.values()],\n stillCur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BAAgB,CAAC,GAAG,CAAC,CAAC;QACvE,aAAa,EAAE,aAAa,CAAC,aAAa,IAAI,IAAI;QAClD,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,gBAAgB,EAAE,aAAa,CAAC,gCAAgC;YAC9D,CAAC,CAAC,aAAa,CAAC,gBAAgB;YAChC,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAgB,IAAI,IAAI,CAAC;QAC5C,GAAG,CAAC,aAAa,CAAC,gCAAgC;YAChD,CAAC,CAAC,EAAE,gCAAgC,EAAE,IAAa,EAAE;YACrD,CAAC,CAAC,EAAE,CAAC;QACP,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;KACrD,CAAC;AACJ,CAAC","sourcesContent":["import { base64ToBytes, bytesToBase64 } from \"@tearleads/encoding\";\nimport { exportAllUpdates, importUpdates } from \"@tearleads/loro\";\nimport { readContainerMetadataValue } from \"../../../data/containers/containerMetadataDocument\";\nimport type { DocumentSyncPullContinuation } from \"../../../data/documents/shared/pullContinuation\";\nimport type { ContainerMetadataRecord } from \"../containerPersistence\";\nimport type { ContainerMetadataDocumentState } from \"./types\";\n\n/**\n * Resolve a freshly discovered container's metadata content against dormant\n * retained state (docs/sync-edge-cases.md row 4, access_revoked branch). A\n * dormant record makes this a re-attach: its content is imported into the\n * live document and projected, so a queued local rename or icon edit renders\n * immediately instead of a default name until sync succeeds. Without one, the\n * document seeds fresh with the default projection.\n */\nexport function reattachDormantContainerMetadata(input: {\n defaultName: string;\n doc: ContainerMetadataDocumentState;\n dormantRecord: ContainerMetadataRecord | null;\n remoteMetadataDocumentId: string;\n}): {\n icon: string | null;\n initialSnapshot: string;\n lastCommitLsn: string | null;\n name: string;\n pullContinuation: DocumentSyncPullContinuation | null | undefined;\n pullContinuationRecoveryRequired?: true | undefined;\n snapshotEndVersion: string;\n} {\n const { defaultName, doc, dormantRecord } = input;\n // The signed metadata document id never changes, and hydration refuses a\n // relisting that conflicts with the retained binding before reaching here.\n // A null id is a lost-response create retained via its own tombstone.\n if (\n dormantRecord?.documentId != null &&\n dormantRecord.documentId !== input.remoteMetadataDocumentId\n ) {\n throw new Error(\"Dormant container metadata binding was not verified\");\n }\n if (!dormantRecord) {\n return {\n icon: null,\n initialSnapshot: bytesToBase64(exportAllUpdates(doc)),\n lastCommitLsn: null,\n name: defaultName,\n pullContinuation: null,\n snapshotEndVersion: \"\",\n };\n }\n\n if (dormantRecord.metadataUpdates) {\n importUpdates(doc, [base64ToBytes(dormantRecord.metadataUpdates)]);\n }\n const metadata = readContainerMetadataValue(doc, defaultName);\n return {\n icon: metadata.icon,\n initialSnapshot:\n dormantRecord.metadataUpdates || bytesToBase64(exportAllUpdates(doc)),\n lastCommitLsn: dormantRecord.lastCommitLsn ?? null,\n name: metadata.name,\n pullContinuation: dormantRecord.pullContinuationRecoveryRequired\n ? dormantRecord.pullContinuation\n : (dormantRecord.pullContinuation ?? null),\n ...(dormantRecord.pullContinuationRecoveryRequired\n ? { pullContinuationRecoveryRequired: true as const }\n : {}),\n snapshotEndVersion: dormantRecord.snapshotEndVersion,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reattachMetadata.js","sourceRoot":"","sources":["reattachMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAKhG;;;;;;;GAOG;AACH,MAAM,UAAU,gCAAgC,CAAC,KAKhD;IASC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAClD,yEAAyE;IACzE,2EAA2E;IAC3E,sEAAsE;IACtE,IACE,aAAa,EAAE,UAAU,IAAI,IAAI;QACjC,aAAa,CAAC,UAAU,KAAK,KAAK,CAAC,wBAAwB,EAC3D,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,eAAe,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;YACrD,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,WAAW;YACjB,gBAAgB,EAAE,IAAI;YACtB,kBAAkB,EAAE,EAAE;SACvB,CAAC;IACJ,CAAC;IAED,IAAI,aAAa,CAAC,eAAe,EAAE,CAAC;QAClC,aAAa,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,QAAQ,GAAG,0BAA0B,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC9D,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,eAAe,EACb,aAAa,CAAC,eAAe,IAAI,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACvE,aAAa,EAAE,aAAa,CAAC,aAAa,IAAI,IAAI;QAClD,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,gBAAgB,EAAE,aAAa,CAAC,gCAAgC;YAC9D,CAAC,CAAC,aAAa,CAAC,gBAAgB;YAChC,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAgB,IAAI,IAAI,CAAC;QAC5C,GAAG,CAAC,aAAa,CAAC,gCAAgC;YAChD,CAAC,CAAC,EAAE,gCAAgC,EAAE,IAAa,EAAE;YACrD,CAAC,CAAC,EAAE,CAAC;QACP,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;KACrD,CAAC;AACJ,CAAC","sourcesContent":["import { base64ToBytes, bytesToBase64 } from \"@tearleads/encoding\";\nimport { exportAllUpdates, importUpdates } from \"@tearleads/loro\";\nimport { readContainerMetadataValue } from \"../../../data/containers/containerMetadataDocument\";\nimport type { DocumentSyncPullContinuation } from \"../../../data/documents/shared/sync/pullContinuation\";\nimport type { ContainerMetadataRecord } from \"../containerPersistence\";\nimport type { ContainerMetadataDocumentState } from \"./types\";\n\n/**\n * Resolve a freshly discovered container's metadata content against dormant\n * retained state (docs/sync-edge-cases.md row 4, access_revoked branch). A\n * dormant record makes this a re-attach: its content is imported into the\n * live document and projected, so a queued local rename or icon edit renders\n * immediately instead of a default name until sync succeeds. Without one, the\n * document seeds fresh with the default projection.\n */\nexport function reattachDormantContainerMetadata(input: {\n defaultName: string;\n doc: ContainerMetadataDocumentState;\n dormantRecord: ContainerMetadataRecord | null;\n remoteMetadataDocumentId: string;\n}): {\n icon: string | null;\n initialSnapshot: string;\n lastCommitLsn: string | null;\n name: string;\n pullContinuation: DocumentSyncPullContinuation | null | undefined;\n pullContinuationRecoveryRequired?: true | undefined;\n snapshotEndVersion: string;\n} {\n const { defaultName, doc, dormantRecord } = input;\n // The signed metadata document id never changes, and hydration refuses a\n // relisting that conflicts with the retained binding before reaching here.\n // A null id is a lost-response create retained via its own tombstone.\n if (\n dormantRecord?.documentId != null &&\n dormantRecord.documentId !== input.remoteMetadataDocumentId\n ) {\n throw new Error(\"Dormant container metadata binding was not verified\");\n }\n if (!dormantRecord) {\n return {\n icon: null,\n initialSnapshot: bytesToBase64(exportAllUpdates(doc)),\n lastCommitLsn: null,\n name: defaultName,\n pullContinuation: null,\n snapshotEndVersion: \"\",\n };\n }\n\n if (dormantRecord.metadataUpdates) {\n importUpdates(doc, [base64ToBytes(dormantRecord.metadataUpdates)]);\n }\n const metadata = readContainerMetadataValue(doc, defaultName);\n return {\n icon: metadata.icon,\n initialSnapshot:\n dormantRecord.metadataUpdates || bytesToBase64(exportAllUpdates(doc)),\n lastCommitLsn: dormantRecord.lastCommitLsn ?? null,\n name: metadata.name,\n pullContinuation: dormantRecord.pullContinuationRecoveryRequired\n ? dormantRecord.pullContinuation\n : (dormantRecord.pullContinuation ?? null),\n ...(dormantRecord.pullContinuationRecoveryRequired\n ? { pullContinuationRecoveryRequired: true as const }\n : {}),\n snapshotEndVersion: dormantRecord.snapshotEndVersion,\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isSessionRootState, isVerifiedLocalRootReconciliationTarget, } from "./destination/verifiedDestination.js";
|
|
2
|
+
import { createContainerChildIndex, moveIndexedContainerChild, removeIndexedContainerChild, } from "./lanes/childIndex.js";
|
|
3
3
|
export function hasRemoteContainerMetadataState(containerState) {
|
|
4
4
|
return (typeof containerState.record.documentId === "string" &&
|
|
5
5
|
containerState.record.documentId.length > 0 &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconciliation.js","sourceRoot":"","sources":["reconciliation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AAMtB,OAAO,EACL,kBAAkB,EAClB,uCAAuC,GACxC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,UAAU,+BAA+B,CAC7C,cAA8B;IAE9B,OAAO,CACL,OAAO,cAAc,CAAC,MAAM,CAAC,UAAU,KAAK,QAAQ;QACpD,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QAC3C,OAAO,cAAc,CAAC,MAAM,CAAC,eAAe,KAAK,QAAQ;QACzD,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;QAChD,OAAO,cAAc,CAAC,SAAS,CAAC,kBAAkB,KAAK,QAAQ;QAC/D,cAAc,CAAC,SAAS,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CACvD,CAAC;AACJ,CAAC;AAED,SAAS,6BAA6B,CACpC,cAA8B;IAE9B,OAAO,CACL,cAAc,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI;QAC1C,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU;QACpC,CAAC,+BAA+B,CAAC,cAAc,CAAC,CACjD,CAAC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AAI,CAAC,GAAG,CACpB,yDAAyD,gBAAgB,CAAC,SAAS,CAAC,EAAE,iCAAiC,iBAAiB,CAAC,SAAS,CAAC,EAAE,EAAE,CACxJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kCAAkC,CAAC,KAMxD;IACC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/D,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;QAC3D,iBAAiB;QACjB,KAAK;KACN,CAAC,CAAC;IAEH,IAAI,8BAA8B,GAAG,CAAC,CAAC;IACvC,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;QACjD,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,8BAA8B,CAAC;QACxC,CAAC;QACD,MAAM,iCAAiC,CAAC;YACtC,kBAAkB;YAClB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,gBAAgB;YAChB,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,8BAA8B,CAAC;QACxC,CAAC;QACD,8BAA8B,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,8BAA8B,GAAG,CAAC,EAAE,CAAC;QACvC,KAAK,CAAC,sBAAsB,EAAE,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,8BAA8B,CAAC;AACxC,CAAC","sourcesContent":["import type { LocalRootDescendantReparentInput } from \"../containerPersistence\";\nimport {\n createContainerChildIndex,\n moveIndexedContainerChild,\n removeIndexedContainerChild,\n} from \"./childIndex\";\nimport type {\n ContainerChildIndex,\n ContainerState,\n RemoteContainerHydrationState,\n} from \"./types\";\nimport {\n isSessionRootState,\n isVerifiedLocalRootReconciliationTarget,\n} from \"./verifiedDestination\";\n\nexport function hasRemoteContainerMetadataState(\n containerState: ContainerState,\n): boolean {\n return (\n typeof containerState.record.documentId === \"string\" &&\n containerState.record.documentId.length > 0 &&\n typeof containerState.record.accessStateHash === \"string\" &&\n containerState.record.accessStateHash.length > 0 &&\n typeof containerState.container.metadataDocumentId === \"string\" &&\n containerState.container.metadataDocumentId.length > 0\n );\n}\n\nfunction isLocalOnlyRootContainerState(\n containerState: ContainerState,\n): boolean {\n return (\n containerState.container.parentId === null &&\n !containerState.container.systemSlot &&\n !hasRemoteContainerMetadataState(containerState)\n );\n}\n\nfunction collectContainerSubtreeStates(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n containersById: ReadonlyMap<string, ContainerState>;\n rootContainerId: string;\n}): ContainerState[] {\n const { childIdsByParentId, containersById, rootContainerId } = input;\n const subtreeStates: ContainerState[] = [];\n const pendingContainerIds = [rootContainerId];\n const enqueuedContainerIds = new Set<string>([rootContainerId]);\n const index = childIdsByParentId ?? createContainerChildIndex(containersById);\n\n while (pendingContainerIds.length > 0) {\n const containerId = pendingContainerIds.pop();\n if (!containerId) {\n continue;\n }\n\n const childIds = index.get(containerId);\n if (!childIds) {\n continue;\n }\n\n for (const childId of childIds) {\n if (enqueuedContainerIds.has(childId)) {\n continue;\n }\n const childState = containersById.get(childId);\n if (!childState) {\n continue;\n }\n\n enqueuedContainerIds.add(childId);\n subtreeStates.push(childState);\n pendingContainerIds.push(childId);\n }\n }\n\n return subtreeStates;\n}\n\nfunction buildLocalRootDescendantReparents(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n localRootState: ContainerState;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): {\n descendantReparents: LocalRootDescendantReparentInput[];\n descendants: ContainerState[];\n} {\n const { childIdsByParentId, localRootState, remoteRootState, state } = input;\n const descendants = collectContainerSubtreeStates({\n childIdsByParentId,\n containersById: state.containersById,\n rootContainerId: localRootState.container.id,\n });\n const descendantReparents = descendants.map((descendant) => {\n const previousParentId = descendant.container.parentId;\n const parentContainerId =\n previousParentId === localRootState.container.id\n ? remoteRootState.container.id\n : previousParentId;\n\n return {\n containerId: descendant.container.id,\n parentContainerId,\n updateCreateIntent: !descendant.record.documentId && !!parentContainerId,\n };\n });\n\n return { descendantReparents, descendants };\n}\n\nfunction applyLocalRootDescendantReparents(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n descendantReparents: ReadonlyArray<LocalRootDescendantReparentInput>;\n descendants: ReadonlyArray<ContainerState>;\n remoteRootState: ContainerState;\n updatedAt: string;\n}): void {\n const {\n childIdsByParentId,\n descendantReparents,\n descendants,\n remoteRootState,\n updatedAt,\n } = input;\n const reparentByContainerId = new Map(\n descendantReparents.map((reparent) => [reparent.containerId, reparent]),\n );\n\n for (const descendant of descendants) {\n const previousParentId = descendant.container.parentId;\n const reparent = reparentByContainerId.get(descendant.container.id);\n if (!reparent) {\n continue;\n }\n\n descendant.container = {\n ...descendant.container,\n organizationId: remoteRootState.container.organizationId,\n parentId: reparent.parentContainerId,\n localUpdatedAt: updatedAt,\n updatedAt: descendant.container.serverUpdatedAt ?? updatedAt,\n };\n moveIndexedContainerChild(\n childIdsByParentId,\n descendant.container.id,\n previousParentId,\n reparent.parentContainerId,\n );\n }\n}\n\nfunction adoptReconciledSessionRoot(input: {\n localRootState: ContainerState;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): void {\n const { localRootState, remoteRootState, state } = input;\n const adopter = state.runtime.adoptRootContainer;\n const defaultOrganizationId = state.runtime.auth.defaultOrganizationId;\n const userId = state.runtime.auth.userId;\n if (\n !adopter ||\n !defaultOrganizationId ||\n defaultOrganizationId === remoteRootState.container.organizationId ||\n !userId\n ) {\n return;\n }\n\n // Personal-org adoption waits for the complete root lane so hydration cannot\n // re-enter the store before its child lanes are applied. The heuristic is\n // intentionally personal-only, so use this exact durable identity pair to\n // close the corresponding recovery gap for an active secondary organization.\n adopter({\n domainScope: state.runtime.state.domainScope,\n expectedContainerId: localRootState.container.id,\n nextContainerId: remoteRootState.container.id,\n organizationId: remoteRootState.container.organizationId,\n userId,\n });\n}\n\nasync function reconcileLocalOnlyRootContainer(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n localRootState: ContainerState;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<void> {\n const { childIdsByParentId, localRootState, remoteRootState, state } = input;\n const execSql = state.runtime.infra.execSql;\n const updatedAt = new Date().toISOString();\n const { descendantReparents, descendants } =\n buildLocalRootDescendantReparents({\n childIdsByParentId,\n localRootState,\n remoteRootState,\n state,\n });\n\n await state.persistence.reconcileLocalRootContainer(execSql, {\n descendantReparents,\n localRootContainerId: localRootState.container.id,\n remoteOrganizationId: remoteRootState.container.organizationId,\n remoteRootContainerId: remoteRootState.container.id,\n stillCurrent: input.isCurrent,\n updatedAt,\n });\n if (input.isCurrent?.() === false) {\n return;\n }\n applyLocalRootDescendantReparents({\n childIdsByParentId,\n descendantReparents,\n descendants,\n remoteRootState,\n updatedAt,\n });\n\n if (childIdsByParentId) {\n removeIndexedContainerChild(\n childIdsByParentId,\n localRootState.container.id,\n localRootState.container.parentId,\n );\n childIdsByParentId.delete(localRootState.container.id);\n }\n state.containersById.delete(localRootState.container.id);\n adoptReconciledSessionRoot({ localRootState, remoteRootState, state });\n state.runtime.util.log(\n `Container contents: reconciled local root ${localRootState.container.id} into remote root ${remoteRootState.container.id}`,\n );\n}\n\nexport async function reconcileLocalOnlyRootContainers(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n requestDocumentPriming?: (() => void) | undefined;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<number> {\n const { childIdsByParentId, remoteRootState, state } = input;\n if (\n input.isCurrent?.() === false ||\n !isSessionRootState(remoteRootState, state)\n ) {\n return 0;\n }\n\n const localRootStates = Array.from(state.containersById.values()).filter(\n (containerState) =>\n containerState.container.id !== remoteRootState.container.id &&\n isLocalOnlyRootContainerState(containerState),\n );\n // The unsigned login answer names the root; only the verified root created\n // by the session user may absorb local content (see verifiedDestination).\n // Checked only when there is local root content to merge, from the cached\n // role alone, so a local refresh never waits on the network.\n if (\n localRootStates.length > 0 &&\n !(await isVerifiedLocalRootReconciliationTarget({ remoteRootState, state }))\n ) {\n return 0;\n }\n\n let reconciledRootContainerCount = 0;\n for (const localRootState of localRootStates) {\n if (input.isCurrent?.() === false) {\n return reconciledRootContainerCount;\n }\n await reconcileLocalOnlyRootContainer({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n localRootState,\n remoteRootState,\n state,\n });\n if (input.isCurrent?.() === false) {\n return reconciledRootContainerCount;\n }\n reconciledRootContainerCount += 1;\n }\n // A remote system child can be applied before its remote root (for example,\n // from an earlier page/pass). Its local twin does not match while it is still\n // parented to the pre-auth root. Root reconciliation fixes the parent and\n // organization, so retry every already-known remote system sibling now. The\n // normal root-first ordering still reconciles when the remote system arrives.\n let reconciledSystemContainerCount = 0;\n for (const knownRemoteSystemState of Array.from(\n state.containersById.values(),\n )) {\n if (\n (knownRemoteSystemState.container.systemSlot ?? null) !== null &&\n hasRemoteContainerMetadataState(knownRemoteSystemState)\n ) {\n reconciledSystemContainerCount +=\n await reconcileLocalOnlySystemContainers({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n remoteSystemState: knownRemoteSystemState,\n state,\n });\n }\n }\n if (reconciledRootContainerCount + reconciledSystemContainerCount > 0) {\n input.requestDocumentPriming?.();\n }\n\n return reconciledRootContainerCount;\n}\n\nfunction isLocalOnlySystemContainerState(input: {\n containerState: ContainerState;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): boolean {\n const { containerState, remoteSystemState, state } = input;\n const localSystemSlot = containerState.container.systemSlot ?? null;\n const remoteSystemSlot = remoteSystemState.container.systemSlot ?? null;\n\n if (\n remoteSystemSlot === null ||\n localSystemSlot !== remoteSystemSlot ||\n containerState.container.id === remoteSystemState.container.id ||\n hasRemoteContainerMetadataState(containerState)\n ) {\n return false;\n }\n\n const sharesRemoteLocation =\n containerState.container.organizationId ===\n remoteSystemState.container.organizationId &&\n containerState.container.parentId === remoteSystemState.container.parentId;\n if (sharesRemoteLocation) {\n return true;\n }\n\n const homeOrganizationId = state.runtime.auth.organizationId;\n if (\n !homeOrganizationId ||\n remoteSystemState.container.organizationId !== homeOrganizationId ||\n containerState.container.organizationId !== \"\"\n ) {\n return false;\n }\n\n const localParentId = containerState.container.parentId;\n const localParentState = localParentId\n ? state.containersById.get(localParentId)\n : null;\n\n return !localParentState || isLocalOnlyRootContainerState(localParentState);\n}\n\nfunction findLocalOnlySystemContainerStates(input: {\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): ContainerState[] {\n const { remoteSystemState, state } = input;\n if ((remoteSystemState.container.systemSlot ?? null) === null) {\n return [];\n }\n\n return Array.from(state.containersById.values()).filter((containerState) =>\n isLocalOnlySystemContainerState({\n containerState,\n remoteSystemState,\n state,\n }),\n );\n}\n\nfunction applyLocalSystemContainerChildReparents(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n localSystemState: ContainerState;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n updatedAt: string;\n}): void {\n const { childIdsByParentId, localSystemState, remoteSystemState, state } =\n input;\n const localContainerId = localSystemState.container.id;\n const childContainerIds = childIdsByParentId\n ? Array.from(childIdsByParentId.get(localContainerId) ?? [])\n : Array.from(state.containersById.values()).flatMap((containerState) =>\n containerState.container.parentId === localContainerId\n ? [containerState.container.id]\n : [],\n );\n\n for (const childContainerId of childContainerIds) {\n const childState = state.containersById.get(childContainerId);\n if (!childState) {\n continue;\n }\n\n const previousParentId = childState.container.parentId;\n childState.container = {\n ...childState.container,\n organizationId: remoteSystemState.container.organizationId,\n parentId: remoteSystemState.container.id,\n localUpdatedAt: input.updatedAt,\n updatedAt: childState.container.serverUpdatedAt ?? input.updatedAt,\n };\n moveIndexedContainerChild(\n childIdsByParentId,\n childState.container.id,\n previousParentId,\n remoteSystemState.container.id,\n );\n }\n}\n\nasync function reconcileLocalOnlySystemContainer(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n localSystemState: ContainerState;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<void> {\n const { childIdsByParentId, localSystemState, remoteSystemState, state } =\n input;\n const updatedAt = new Date().toISOString();\n const execSql = state.runtime.infra.execSql;\n\n await state.persistence.reconcileLocalSystemContainer(execSql, {\n localContainerId: localSystemState.container.id,\n remoteContainerId: remoteSystemState.container.id,\n remoteOrganizationId: remoteSystemState.container.organizationId,\n stillCurrent: input.isCurrent,\n updatedAt,\n });\n if (input.isCurrent?.() === false) {\n return;\n }\n applyLocalSystemContainerChildReparents({\n childIdsByParentId,\n localSystemState,\n remoteSystemState,\n state,\n updatedAt,\n });\n\n if (childIdsByParentId) {\n removeIndexedContainerChild(\n childIdsByParentId,\n localSystemState.container.id,\n localSystemState.container.parentId,\n );\n childIdsByParentId.delete(localSystemState.container.id);\n }\n state.containersById.delete(localSystemState.container.id);\n state.runtime.util.log(\n `Container contents: reconciled local system container ${localSystemState.container.id} into remote system container ${remoteSystemState.container.id}`,\n );\n}\n\nexport async function reconcileLocalOnlySystemContainers(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n requestDocumentPriming?: (() => void) | undefined;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<number> {\n const { childIdsByParentId, remoteSystemState, state } = input;\n if (input.isCurrent?.() === false) {\n return 0;\n }\n const localSystemStates = findLocalOnlySystemContainerStates({\n remoteSystemState,\n state,\n });\n\n let reconciledSystemContainerCount = 0;\n for (const localSystemState of localSystemStates) {\n if (input.isCurrent?.() === false) {\n return reconciledSystemContainerCount;\n }\n await reconcileLocalOnlySystemContainer({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n localSystemState,\n remoteSystemState,\n state,\n });\n if (input.isCurrent?.() === false) {\n return reconciledSystemContainerCount;\n }\n reconciledSystemContainerCount += 1;\n }\n if (reconciledSystemContainerCount > 0) {\n input.requestDocumentPriming?.();\n }\n\n return reconciledSystemContainerCount;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reconciliation.js","sourceRoot":"","sources":["reconciliation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,uCAAuC,GACxC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAO5B,MAAM,UAAU,+BAA+B,CAC7C,cAA8B;IAE9B,OAAO,CACL,OAAO,cAAc,CAAC,MAAM,CAAC,UAAU,KAAK,QAAQ;QACpD,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QAC3C,OAAO,cAAc,CAAC,MAAM,CAAC,eAAe,KAAK,QAAQ;QACzD,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;QAChD,OAAO,cAAc,CAAC,SAAS,CAAC,kBAAkB,KAAK,QAAQ;QAC/D,cAAc,CAAC,SAAS,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CACvD,CAAC;AACJ,CAAC;AAED,SAAS,6BAA6B,CACpC,cAA8B;IAE9B,OAAO,CACL,cAAc,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI;QAC1C,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU;QACpC,CAAC,+BAA+B,CAAC,cAAc,CAAC,CACjD,CAAC;AACJ,CAAC;AAED,SAAS,6BAA6B,CAAC,KAItC;IACC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IACtE,MAAM,aAAa,GAAqB,EAAE,CAAC;IAC3C,MAAM,mBAAm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AAC,KAMxD;IACC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/D,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;QAC3D,iBAAiB;QACjB,KAAK;KACN,CAAC,CAAC;IAEH,IAAI,8BAA8B,GAAG,CAAC,CAAC;IACvC,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;QACjD,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,8BAA8B,CAAC;QACxC,CAAC;QACD,MAAM,iCAAiC,CAAC;YACtC,kBAAkB;YAClB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,gBAAgB;YAChB,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,8BAA8B,CAAC;QACxC,CAAC;QACD,8BAA8B,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,8BAA8B,GAAG,CAAC,EAAE,CAAC;QACvC,KAAK,CAAC,sBAAsB,EAAE,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,8BAA8B,CAAC;AACxC,CAAC","sourcesContent":["import type { LocalRootDescendantReparentInput } from \"../containerPersistence\";\nimport {\n isSessionRootState,\n isVerifiedLocalRootReconciliationTarget,\n} from \"./destination/verifiedDestination\";\nimport {\n createContainerChildIndex,\n moveIndexedContainerChild,\n removeIndexedContainerChild,\n} from \"./lanes/childIndex\";\nimport type {\n ContainerChildIndex,\n ContainerState,\n RemoteContainerHydrationState,\n} from \"./types\";\n\nexport function hasRemoteContainerMetadataState(\n containerState: ContainerState,\n): boolean {\n return (\n typeof containerState.record.documentId === \"string\" &&\n containerState.record.documentId.length > 0 &&\n typeof containerState.record.accessStateHash === \"string\" &&\n containerState.record.accessStateHash.length > 0 &&\n typeof containerState.container.metadataDocumentId === \"string\" &&\n containerState.container.metadataDocumentId.length > 0\n );\n}\n\nfunction isLocalOnlyRootContainerState(\n containerState: ContainerState,\n): boolean {\n return (\n containerState.container.parentId === null &&\n !containerState.container.systemSlot &&\n !hasRemoteContainerMetadataState(containerState)\n );\n}\n\nfunction collectContainerSubtreeStates(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n containersById: ReadonlyMap<string, ContainerState>;\n rootContainerId: string;\n}): ContainerState[] {\n const { childIdsByParentId, containersById, rootContainerId } = input;\n const subtreeStates: ContainerState[] = [];\n const pendingContainerIds = [rootContainerId];\n const enqueuedContainerIds = new Set<string>([rootContainerId]);\n const index = childIdsByParentId ?? createContainerChildIndex(containersById);\n\n while (pendingContainerIds.length > 0) {\n const containerId = pendingContainerIds.pop();\n if (!containerId) {\n continue;\n }\n\n const childIds = index.get(containerId);\n if (!childIds) {\n continue;\n }\n\n for (const childId of childIds) {\n if (enqueuedContainerIds.has(childId)) {\n continue;\n }\n const childState = containersById.get(childId);\n if (!childState) {\n continue;\n }\n\n enqueuedContainerIds.add(childId);\n subtreeStates.push(childState);\n pendingContainerIds.push(childId);\n }\n }\n\n return subtreeStates;\n}\n\nfunction buildLocalRootDescendantReparents(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n localRootState: ContainerState;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): {\n descendantReparents: LocalRootDescendantReparentInput[];\n descendants: ContainerState[];\n} {\n const { childIdsByParentId, localRootState, remoteRootState, state } = input;\n const descendants = collectContainerSubtreeStates({\n childIdsByParentId,\n containersById: state.containersById,\n rootContainerId: localRootState.container.id,\n });\n const descendantReparents = descendants.map((descendant) => {\n const previousParentId = descendant.container.parentId;\n const parentContainerId =\n previousParentId === localRootState.container.id\n ? remoteRootState.container.id\n : previousParentId;\n\n return {\n containerId: descendant.container.id,\n parentContainerId,\n updateCreateIntent: !descendant.record.documentId && !!parentContainerId,\n };\n });\n\n return { descendantReparents, descendants };\n}\n\nfunction applyLocalRootDescendantReparents(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n descendantReparents: ReadonlyArray<LocalRootDescendantReparentInput>;\n descendants: ReadonlyArray<ContainerState>;\n remoteRootState: ContainerState;\n updatedAt: string;\n}): void {\n const {\n childIdsByParentId,\n descendantReparents,\n descendants,\n remoteRootState,\n updatedAt,\n } = input;\n const reparentByContainerId = new Map(\n descendantReparents.map((reparent) => [reparent.containerId, reparent]),\n );\n\n for (const descendant of descendants) {\n const previousParentId = descendant.container.parentId;\n const reparent = reparentByContainerId.get(descendant.container.id);\n if (!reparent) {\n continue;\n }\n\n descendant.container = {\n ...descendant.container,\n organizationId: remoteRootState.container.organizationId,\n parentId: reparent.parentContainerId,\n localUpdatedAt: updatedAt,\n updatedAt: descendant.container.serverUpdatedAt ?? updatedAt,\n };\n moveIndexedContainerChild(\n childIdsByParentId,\n descendant.container.id,\n previousParentId,\n reparent.parentContainerId,\n );\n }\n}\n\nfunction adoptReconciledSessionRoot(input: {\n localRootState: ContainerState;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): void {\n const { localRootState, remoteRootState, state } = input;\n const adopter = state.runtime.adoptRootContainer;\n const defaultOrganizationId = state.runtime.auth.defaultOrganizationId;\n const userId = state.runtime.auth.userId;\n if (\n !adopter ||\n !defaultOrganizationId ||\n defaultOrganizationId === remoteRootState.container.organizationId ||\n !userId\n ) {\n return;\n }\n\n // Personal-org adoption waits for the complete root lane so hydration cannot\n // re-enter the store before its child lanes are applied. The heuristic is\n // intentionally personal-only, so use this exact durable identity pair to\n // close the corresponding recovery gap for an active secondary organization.\n adopter({\n domainScope: state.runtime.state.domainScope,\n expectedContainerId: localRootState.container.id,\n nextContainerId: remoteRootState.container.id,\n organizationId: remoteRootState.container.organizationId,\n userId,\n });\n}\n\nasync function reconcileLocalOnlyRootContainer(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n localRootState: ContainerState;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<void> {\n const { childIdsByParentId, localRootState, remoteRootState, state } = input;\n const execSql = state.runtime.infra.execSql;\n const updatedAt = new Date().toISOString();\n const { descendantReparents, descendants } =\n buildLocalRootDescendantReparents({\n childIdsByParentId,\n localRootState,\n remoteRootState,\n state,\n });\n\n await state.persistence.reconcileLocalRootContainer(execSql, {\n descendantReparents,\n localRootContainerId: localRootState.container.id,\n remoteOrganizationId: remoteRootState.container.organizationId,\n remoteRootContainerId: remoteRootState.container.id,\n stillCurrent: input.isCurrent,\n updatedAt,\n });\n if (input.isCurrent?.() === false) {\n return;\n }\n applyLocalRootDescendantReparents({\n childIdsByParentId,\n descendantReparents,\n descendants,\n remoteRootState,\n updatedAt,\n });\n\n if (childIdsByParentId) {\n removeIndexedContainerChild(\n childIdsByParentId,\n localRootState.container.id,\n localRootState.container.parentId,\n );\n childIdsByParentId.delete(localRootState.container.id);\n }\n state.containersById.delete(localRootState.container.id);\n adoptReconciledSessionRoot({ localRootState, remoteRootState, state });\n state.runtime.util.log(\n `Container contents: reconciled local root ${localRootState.container.id} into remote root ${remoteRootState.container.id}`,\n );\n}\n\nexport async function reconcileLocalOnlyRootContainers(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n requestDocumentPriming?: (() => void) | undefined;\n remoteRootState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<number> {\n const { childIdsByParentId, remoteRootState, state } = input;\n if (\n input.isCurrent?.() === false ||\n !isSessionRootState(remoteRootState, state)\n ) {\n return 0;\n }\n\n const localRootStates = Array.from(state.containersById.values()).filter(\n (containerState) =>\n containerState.container.id !== remoteRootState.container.id &&\n isLocalOnlyRootContainerState(containerState),\n );\n // The unsigned login answer names the root; only the verified root created\n // by the session user may absorb local content (see verifiedDestination).\n // Checked only when there is local root content to merge, from the cached\n // role alone, so a local refresh never waits on the network.\n if (\n localRootStates.length > 0 &&\n !(await isVerifiedLocalRootReconciliationTarget({ remoteRootState, state }))\n ) {\n return 0;\n }\n\n let reconciledRootContainerCount = 0;\n for (const localRootState of localRootStates) {\n if (input.isCurrent?.() === false) {\n return reconciledRootContainerCount;\n }\n await reconcileLocalOnlyRootContainer({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n localRootState,\n remoteRootState,\n state,\n });\n if (input.isCurrent?.() === false) {\n return reconciledRootContainerCount;\n }\n reconciledRootContainerCount += 1;\n }\n // A remote system child can be applied before its remote root (for example,\n // from an earlier page/pass). Its local twin does not match while it is still\n // parented to the pre-auth root. Root reconciliation fixes the parent and\n // organization, so retry every already-known remote system sibling now. The\n // normal root-first ordering still reconciles when the remote system arrives.\n let reconciledSystemContainerCount = 0;\n for (const knownRemoteSystemState of Array.from(\n state.containersById.values(),\n )) {\n if (\n (knownRemoteSystemState.container.systemSlot ?? null) !== null &&\n hasRemoteContainerMetadataState(knownRemoteSystemState)\n ) {\n reconciledSystemContainerCount +=\n await reconcileLocalOnlySystemContainers({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n remoteSystemState: knownRemoteSystemState,\n state,\n });\n }\n }\n if (reconciledRootContainerCount + reconciledSystemContainerCount > 0) {\n input.requestDocumentPriming?.();\n }\n\n return reconciledRootContainerCount;\n}\n\nfunction isLocalOnlySystemContainerState(input: {\n containerState: ContainerState;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): boolean {\n const { containerState, remoteSystemState, state } = input;\n const localSystemSlot = containerState.container.systemSlot ?? null;\n const remoteSystemSlot = remoteSystemState.container.systemSlot ?? null;\n\n if (\n remoteSystemSlot === null ||\n localSystemSlot !== remoteSystemSlot ||\n containerState.container.id === remoteSystemState.container.id ||\n hasRemoteContainerMetadataState(containerState)\n ) {\n return false;\n }\n\n const sharesRemoteLocation =\n containerState.container.organizationId ===\n remoteSystemState.container.organizationId &&\n containerState.container.parentId === remoteSystemState.container.parentId;\n if (sharesRemoteLocation) {\n return true;\n }\n\n const homeOrganizationId = state.runtime.auth.organizationId;\n if (\n !homeOrganizationId ||\n remoteSystemState.container.organizationId !== homeOrganizationId ||\n containerState.container.organizationId !== \"\"\n ) {\n return false;\n }\n\n const localParentId = containerState.container.parentId;\n const localParentState = localParentId\n ? state.containersById.get(localParentId)\n : null;\n\n return !localParentState || isLocalOnlyRootContainerState(localParentState);\n}\n\nfunction findLocalOnlySystemContainerStates(input: {\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): ContainerState[] {\n const { remoteSystemState, state } = input;\n if ((remoteSystemState.container.systemSlot ?? null) === null) {\n return [];\n }\n\n return Array.from(state.containersById.values()).filter((containerState) =>\n isLocalOnlySystemContainerState({\n containerState,\n remoteSystemState,\n state,\n }),\n );\n}\n\nfunction applyLocalSystemContainerChildReparents(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n localSystemState: ContainerState;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n updatedAt: string;\n}): void {\n const { childIdsByParentId, localSystemState, remoteSystemState, state } =\n input;\n const localContainerId = localSystemState.container.id;\n const childContainerIds = childIdsByParentId\n ? Array.from(childIdsByParentId.get(localContainerId) ?? [])\n : Array.from(state.containersById.values()).flatMap((containerState) =>\n containerState.container.parentId === localContainerId\n ? [containerState.container.id]\n : [],\n );\n\n for (const childContainerId of childContainerIds) {\n const childState = state.containersById.get(childContainerId);\n if (!childState) {\n continue;\n }\n\n const previousParentId = childState.container.parentId;\n childState.container = {\n ...childState.container,\n organizationId: remoteSystemState.container.organizationId,\n parentId: remoteSystemState.container.id,\n localUpdatedAt: input.updatedAt,\n updatedAt: childState.container.serverUpdatedAt ?? input.updatedAt,\n };\n moveIndexedContainerChild(\n childIdsByParentId,\n childState.container.id,\n previousParentId,\n remoteSystemState.container.id,\n );\n }\n}\n\nasync function reconcileLocalOnlySystemContainer(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n localSystemState: ContainerState;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<void> {\n const { childIdsByParentId, localSystemState, remoteSystemState, state } =\n input;\n const updatedAt = new Date().toISOString();\n const execSql = state.runtime.infra.execSql;\n\n await state.persistence.reconcileLocalSystemContainer(execSql, {\n localContainerId: localSystemState.container.id,\n remoteContainerId: remoteSystemState.container.id,\n remoteOrganizationId: remoteSystemState.container.organizationId,\n stillCurrent: input.isCurrent,\n updatedAt,\n });\n if (input.isCurrent?.() === false) {\n return;\n }\n applyLocalSystemContainerChildReparents({\n childIdsByParentId,\n localSystemState,\n remoteSystemState,\n state,\n updatedAt,\n });\n\n if (childIdsByParentId) {\n removeIndexedContainerChild(\n childIdsByParentId,\n localSystemState.container.id,\n localSystemState.container.parentId,\n );\n childIdsByParentId.delete(localSystemState.container.id);\n }\n state.containersById.delete(localSystemState.container.id);\n state.runtime.util.log(\n `Container contents: reconciled local system container ${localSystemState.container.id} into remote system container ${remoteSystemState.container.id}`,\n );\n}\n\nexport async function reconcileLocalOnlySystemContainers(input: {\n childIdsByParentId?: ContainerChildIndex | undefined;\n isCurrent?: (() => boolean) | undefined;\n requestDocumentPriming?: (() => void) | undefined;\n remoteSystemState: ContainerState;\n state: RemoteContainerHydrationState;\n}): Promise<number> {\n const { childIdsByParentId, remoteSystemState, state } = input;\n if (input.isCurrent?.() === false) {\n return 0;\n }\n const localSystemStates = findLocalOnlySystemContainerStates({\n remoteSystemState,\n state,\n });\n\n let reconciledSystemContainerCount = 0;\n for (const localSystemState of localSystemStates) {\n if (input.isCurrent?.() === false) {\n return reconciledSystemContainerCount;\n }\n await reconcileLocalOnlySystemContainer({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n localSystemState,\n remoteSystemState,\n state,\n });\n if (input.isCurrent?.() === false) {\n return reconciledSystemContainerCount;\n }\n reconciledSystemContainerCount += 1;\n }\n if (reconciledSystemContainerCount > 0) {\n input.requestDocumentPriming?.();\n }\n\n return reconciledSystemContainerCount;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerStateFingerprint.js","sourceRoot":"","sources":["containerStateFingerprint.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAqB;IACnE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,KAGhD;IACC,OAAO,CACL,CAAC,KAAK,CAAC,YAAY;QACjB,CAAC,CAAC,+BAA+B,CAAC,KAAK,CAAC,YAAY,CAAC;QACrD,CAAC,CAAC,SAAS,CAAC,KAAK,KAAK,CAAC,mBAAmB,CAC7C,CAAC;AACJ,CAAC","sourcesContent":["import type { ContainerState } from \"../types\";\n\n/**\n * Immutable request-time identity for one live container state. Hydration\n * mutates ContainerState objects in place, so retaining the object reference is\n * not enough to detect a newer local or remote commit while a page is fetched.\n */\nexport function createContainerStateFingerprint(state: ContainerState): string {\n return JSON.stringify([state.container, state.record]);\n}\n\nexport function containerStateMatchesFingerprint(input: {\n currentState: ContainerState | undefined;\n expectedFingerprint: string | undefined;\n}): boolean {\n return (\n (input.currentState\n ? createContainerStateFingerprint(input.currentState)\n : undefined) === input.expectedFingerprint\n );\n}\n"]}
|
package/workflows/container-contents/remoteHydration/remoteContainers/insertRemoteContainer.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { assertHeldContainerBinding, heldContainerBinding, } from "../../../../data/containers/containerBinding.js";
|
|
2
|
+
import { createContainerMetadataDocument, getDefaultContainerName, } from "../../../../data/containers/containerMetadataDocument.js";
|
|
3
|
+
import { materializeStoredContainerStateReadOnly } from "../../storedContainerState.js";
|
|
4
|
+
import { addIndexedContainerChild } from "../lanes/childIndex.js";
|
|
5
|
+
import { reattachDormantContainerMetadata } from "../reattachMetadata.js";
|
|
6
|
+
import { reconcileLocalOnlyRootContainers } from "../reconciliation.js";
|
|
7
|
+
import { applyRemoteContainerTimestamps, remoteContainerHydrationSaveOptions, } from "./remoteContainerTimestamps.js";
|
|
8
|
+
function createInsertedRemoteContainerState(input) {
|
|
9
|
+
const { doc, dormantRecord, remoteContainer } = input;
|
|
10
|
+
const reattached = reattachDormantContainerMetadata({
|
|
11
|
+
defaultName: getDefaultContainerName(remoteContainer.parentId),
|
|
12
|
+
doc,
|
|
13
|
+
dormantRecord,
|
|
14
|
+
remoteMetadataDocumentId: remoteContainer.metadataDocumentId,
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
container: applyRemoteContainerTimestamps({
|
|
18
|
+
id: remoteContainer.id,
|
|
19
|
+
effectiveAccessLevel: remoteContainer.effectiveAccessLevel,
|
|
20
|
+
organizationId: remoteContainer.organizationId,
|
|
21
|
+
parentId: remoteContainer.parentId,
|
|
22
|
+
metadataDocumentId: remoteContainer.metadataDocumentId,
|
|
23
|
+
systemSlot: remoteContainer.systemSlot ?? null,
|
|
24
|
+
name: reattached.name,
|
|
25
|
+
icon: reattached.icon,
|
|
26
|
+
}, remoteContainer),
|
|
27
|
+
metadataReferencedPrincipals: remoteContainer.metadataReferencedPrincipals,
|
|
28
|
+
doc,
|
|
29
|
+
record: {
|
|
30
|
+
accessEpoch: remoteContainer.metadataAccessEpoch,
|
|
31
|
+
accessStateHash: remoteContainer.metadataAccessStateHash,
|
|
32
|
+
documentId: remoteContainer.metadataDocumentId,
|
|
33
|
+
id: remoteContainer.id,
|
|
34
|
+
lastCommitLsn: reattached.lastCommitLsn,
|
|
35
|
+
metadataUpdates: reattached.initialSnapshot,
|
|
36
|
+
...(reattached.pullContinuation === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: { pullContinuation: reattached.pullContinuation }),
|
|
39
|
+
...(reattached.pullContinuationRecoveryRequired
|
|
40
|
+
? { pullContinuationRecoveryRequired: true }
|
|
41
|
+
: {}),
|
|
42
|
+
snapshotEndVersion: reattached.snapshotEndVersion,
|
|
43
|
+
contentKeyBundle: null,
|
|
44
|
+
documentKekTargets: null,
|
|
45
|
+
documentManifestBundle: null,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Insert a verified container the device holds no live row for, re-attaching
|
|
51
|
+
* retained dormant metadata whose binding matches.
|
|
52
|
+
*/
|
|
53
|
+
export async function insertRemoteContainerState(input) {
|
|
54
|
+
const { childIdsByParentId, host, remoteContainer, state } = input;
|
|
55
|
+
const execSql = state.runtime.infra.execSql;
|
|
56
|
+
const persistence = state.persistence;
|
|
57
|
+
const doc = await createContainerMetadataDocument(remoteContainer.id);
|
|
58
|
+
if (input.isCurrent?.() === false) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
// A container inserted with dormant retained metadata (row 4's
|
|
62
|
+
// access_revoked branch) is a re-attach, not a fresh discovery: import the
|
|
63
|
+
// retained content and markers instead of overwriting them with an empty
|
|
64
|
+
// document. Access and keying fields still come from the remote container —
|
|
65
|
+
// revocation may have rotated them.
|
|
66
|
+
const dormantRecord = await persistence.loadContainerMetadataRecord(execSql, remoteContainer.id);
|
|
67
|
+
if (input.isCurrent?.() === false) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
// Destination verification refused a relisting that conflicts with the
|
|
71
|
+
// retained organization or metadata target. A record committed since then
|
|
72
|
+
// by a concurrent hydration is refused here; commit rechecks both durably.
|
|
73
|
+
assertHeldContainerBinding({
|
|
74
|
+
organizationId: "",
|
|
75
|
+
metadataDocumentId: dormantRecord?.documentId ?? null,
|
|
76
|
+
}, {
|
|
77
|
+
organizationId: remoteContainer.organizationId,
|
|
78
|
+
metadataDocumentIds: [remoteContainer.metadataDocumentId],
|
|
79
|
+
});
|
|
80
|
+
const containerState = createInsertedRemoteContainerState({
|
|
81
|
+
doc,
|
|
82
|
+
dormantRecord,
|
|
83
|
+
remoteContainer,
|
|
84
|
+
});
|
|
85
|
+
const committed = await persistence.commitHydratedContainer(execSql, {
|
|
86
|
+
container: containerState.container,
|
|
87
|
+
expectedDormantRecord: dormantRecord,
|
|
88
|
+
expectedHydrationTombstone: input.expectedHydrationTombstone,
|
|
89
|
+
expectedPlacementCheckpoint: input.expectedPlacementCheckpoint,
|
|
90
|
+
record: containerState.record,
|
|
91
|
+
remoteUpdatedAt: remoteContainer.updatedAt,
|
|
92
|
+
saveOptions: remoteContainerHydrationSaveOptions({ remoteContainer }),
|
|
93
|
+
stillCurrent: input.isCurrent,
|
|
94
|
+
});
|
|
95
|
+
let installedState = containerState;
|
|
96
|
+
if (committed.committed) {
|
|
97
|
+
installedState.container = committed.container;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const winningStoredState = await persistence.loadContainerMetadataState(execSql, remoteContainer.id);
|
|
101
|
+
if (!winningStoredState)
|
|
102
|
+
return null;
|
|
103
|
+
// A concurrent hydration that won the insert holds the binding now.
|
|
104
|
+
assertHeldContainerBinding(heldContainerBinding(winningStoredState), {
|
|
105
|
+
organizationId: remoteContainer.organizationId,
|
|
106
|
+
metadataDocumentIds: [remoteContainer.metadataDocumentId],
|
|
107
|
+
});
|
|
108
|
+
const winningState = await materializeStoredContainerStateReadOnly({
|
|
109
|
+
storedContainer: winningStoredState,
|
|
110
|
+
});
|
|
111
|
+
if (!winningState ||
|
|
112
|
+
!(await persistence.containerExists(execSql, remoteContainer.id))) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
installedState = winningState;
|
|
116
|
+
installedState.metadataReferencedPrincipals =
|
|
117
|
+
remoteContainer.metadataReferencedPrincipals;
|
|
118
|
+
}
|
|
119
|
+
if (input.isCurrent?.() === false) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
state.containersById.set(remoteContainer.id, installedState);
|
|
123
|
+
if (childIdsByParentId) {
|
|
124
|
+
addIndexedContainerChild(childIdsByParentId, remoteContainer.id, installedState.container.parentId);
|
|
125
|
+
}
|
|
126
|
+
await reconcileLocalOnlyRootContainers({
|
|
127
|
+
childIdsByParentId,
|
|
128
|
+
isCurrent: input.isCurrent,
|
|
129
|
+
remoteRootState: installedState,
|
|
130
|
+
requestDocumentPriming: host.requestDocumentPriming,
|
|
131
|
+
state,
|
|
132
|
+
});
|
|
133
|
+
return installedState;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=insertRemoteContainer.js.map
|
package/workflows/container-contents/remoteHydration/remoteContainers/insertRemoteContainer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertRemoteContainer.js","sourceRoot":"","sources":["insertRemoteContainer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAAE,uCAAuC,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAQrE,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAYrC,SAAS,kCAAkC,CAAC,KAQ3C;IACC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IACtD,MAAM,UAAU,GAAG,gCAAgC,CAAC;QAClD,WAAW,EAAE,uBAAuB,CAAC,eAAe,CAAC,QAAQ,CAAC;QAC9D,GAAG;QACH,aAAa;QACb,wBAAwB,EAAE,eAAe,CAAC,kBAAkB;KAC7D,CAAC,CAAC;IACH,OAAO;QACL,SAAS,EAAE,8BAA8B,CACvC;YACE,EAAE,EAAE,eAAe,CAAC,EAAE;YACtB,oBAA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AK,CAAC,SAAS;QAC1B,eAAe,EAAE,cAAc;QAC/B,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;QACnD,KAAK;KACN,CAAC,CAAC;IACH,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import type { AccessManifestCheckpoint } from \"@tearleads/crypto\";\nimport {\n assertHeldContainerBinding,\n heldContainerBinding,\n} from \"../../../../data/containers/containerBinding\";\nimport {\n createContainerMetadataDocument,\n getDefaultContainerName,\n} from \"../../../../data/containers/containerMetadataDocument\";\nimport type { ContainerHydrationTombstone } from \"../../containerPersistence\";\nimport { materializeStoredContainerStateReadOnly } from \"../../storedContainerState\";\nimport { addIndexedContainerChild } from \"../lanes/childIndex\";\nimport { reattachDormantContainerMetadata } from \"../reattachMetadata\";\nimport { reconcileLocalOnlyRootContainers } from \"../reconciliation\";\nimport type {\n ContainerChildIndex,\n ContainerState,\n RemoteContainer,\n RemoteContainerHydrationHost,\n RemoteContainerHydrationState,\n} from \"../types\";\nimport {\n applyRemoteContainerTimestamps,\n remoteContainerHydrationSaveOptions,\n} from \"./remoteContainerTimestamps\";\n\ninterface InsertRemoteContainerStateInput {\n childIdsByParentId?: ContainerChildIndex | undefined;\n host: RemoteContainerHydrationHost;\n expectedHydrationTombstone: ContainerHydrationTombstone | null;\n expectedPlacementCheckpoint?: AccessManifestCheckpoint | undefined;\n isCurrent?: (() => boolean) | undefined;\n remoteContainer: RemoteContainer;\n state: RemoteContainerHydrationState;\n}\n\nfunction createInsertedRemoteContainerState(input: {\n doc: ContainerState[\"doc\"];\n dormantRecord: Awaited<\n ReturnType<\n RemoteContainerHydrationState[\"persistence\"][\"loadContainerMetadataRecord\"]\n >\n >;\n remoteContainer: RemoteContainer;\n}): ContainerState {\n const { doc, dormantRecord, remoteContainer } = input;\n const reattached = reattachDormantContainerMetadata({\n defaultName: getDefaultContainerName(remoteContainer.parentId),\n doc,\n dormantRecord,\n remoteMetadataDocumentId: remoteContainer.metadataDocumentId,\n });\n return {\n container: applyRemoteContainerTimestamps(\n {\n id: remoteContainer.id,\n effectiveAccessLevel: remoteContainer.effectiveAccessLevel,\n organizationId: remoteContainer.organizationId,\n parentId: remoteContainer.parentId,\n metadataDocumentId: remoteContainer.metadataDocumentId,\n systemSlot: remoteContainer.systemSlot ?? null,\n name: reattached.name,\n icon: reattached.icon,\n },\n remoteContainer,\n ),\n metadataReferencedPrincipals: remoteContainer.metadataReferencedPrincipals,\n doc,\n record: {\n accessEpoch: remoteContainer.metadataAccessEpoch,\n accessStateHash: remoteContainer.metadataAccessStateHash,\n documentId: remoteContainer.metadataDocumentId,\n id: remoteContainer.id,\n lastCommitLsn: reattached.lastCommitLsn,\n metadataUpdates: reattached.initialSnapshot,\n ...(reattached.pullContinuation === undefined\n ? {}\n : { pullContinuation: reattached.pullContinuation }),\n ...(reattached.pullContinuationRecoveryRequired\n ? { pullContinuationRecoveryRequired: true as const }\n : {}),\n snapshotEndVersion: reattached.snapshotEndVersion,\n contentKeyBundle: null,\n documentKekTargets: null,\n documentManifestBundle: null,\n },\n };\n}\n\n/**\n * Insert a verified container the device holds no live row for, re-attaching\n * retained dormant metadata whose binding matches.\n */\nexport async function insertRemoteContainerState(\n input: InsertRemoteContainerStateInput,\n): Promise<ContainerState | null> {\n const { childIdsByParentId, host, remoteContainer, state } = input;\n const execSql = state.runtime.infra.execSql;\n const persistence = state.persistence;\n const doc = await createContainerMetadataDocument(remoteContainer.id);\n if (input.isCurrent?.() === false) {\n return null;\n }\n // A container inserted with dormant retained metadata (row 4's\n // access_revoked branch) is a re-attach, not a fresh discovery: import the\n // retained content and markers instead of overwriting them with an empty\n // document. Access and keying fields still come from the remote container —\n // revocation may have rotated them.\n const dormantRecord = await persistence.loadContainerMetadataRecord(\n execSql,\n remoteContainer.id,\n );\n if (input.isCurrent?.() === false) {\n return null;\n }\n // Destination verification refused a relisting that conflicts with the\n // retained organization or metadata target. A record committed since then\n // by a concurrent hydration is refused here; commit rechecks both durably.\n assertHeldContainerBinding(\n {\n organizationId: \"\",\n metadataDocumentId: dormantRecord?.documentId ?? null,\n },\n {\n organizationId: remoteContainer.organizationId,\n metadataDocumentIds: [remoteContainer.metadataDocumentId],\n },\n );\n const containerState = createInsertedRemoteContainerState({\n doc,\n dormantRecord,\n remoteContainer,\n });\n\n const committed = await persistence.commitHydratedContainer(execSql, {\n container: containerState.container,\n expectedDormantRecord: dormantRecord,\n expectedHydrationTombstone: input.expectedHydrationTombstone,\n expectedPlacementCheckpoint: input.expectedPlacementCheckpoint,\n record: containerState.record,\n remoteUpdatedAt: remoteContainer.updatedAt,\n saveOptions: remoteContainerHydrationSaveOptions({ remoteContainer }),\n stillCurrent: input.isCurrent,\n });\n let installedState = containerState;\n if (committed.committed) {\n installedState.container = committed.container;\n } else {\n const winningStoredState = await persistence.loadContainerMetadataState(\n execSql,\n remoteContainer.id,\n );\n if (!winningStoredState) return null;\n // A concurrent hydration that won the insert holds the binding now.\n assertHeldContainerBinding(heldContainerBinding(winningStoredState), {\n organizationId: remoteContainer.organizationId,\n metadataDocumentIds: [remoteContainer.metadataDocumentId],\n });\n const winningState = await materializeStoredContainerStateReadOnly({\n storedContainer: winningStoredState,\n });\n if (\n !winningState ||\n !(await persistence.containerExists(execSql, remoteContainer.id))\n ) {\n return null;\n }\n installedState = winningState;\n installedState.metadataReferencedPrincipals =\n remoteContainer.metadataReferencedPrincipals;\n }\n if (input.isCurrent?.() === false) {\n return null;\n }\n state.containersById.set(remoteContainer.id, installedState);\n if (childIdsByParentId) {\n addIndexedContainerChild(\n childIdsByParentId,\n remoteContainer.id,\n installedState.container.parentId,\n );\n }\n await reconcileLocalOnlyRootContainers({\n childIdsByParentId,\n isCurrent: input.isCurrent,\n remoteRootState: installedState,\n requestDocumentPriming: host.requestDocumentPriming,\n state,\n });\n return installedState;\n}\n"]}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { createRuntimePrincipalPolicyWarmer } from "../../../principals/runtimePolicyWarmer.js";
|
|
2
|
+
import { prefetchDestinationProjections } from "../destination/destinationPrefetch.js";
|
|
3
|
+
import { cachedDestinationRole } from "../destination/destinationRoleCache.js";
|
|
4
|
+
import { markContainerParentLaneFetched } from "../lanes/laneFetchMarkers.js";
|
|
5
|
+
import { fetchContainerParentLaneBatch } from "../lanes/parentLaneFetch.js";
|
|
6
|
+
import { cacheRemoteContainerPrincipalPolicies } from "../principalPolicyCache.js";
|
|
7
|
+
import { applyContainerTombstones, getApplicableRemoteContainerItems, } from "../tombstoneApplication.js";
|
|
8
|
+
import { containerStateMatchesFingerprint } from "./containerStateFingerprint.js";
|
|
9
|
+
import { listRemoteContainerIdsWithPendingMetadataUpdates, listRemoteContainerIdsWithPendingStructuralIntents, upsertIsolatedRemoteContainerState, } from "./remoteContainerState.js";
|
|
10
|
+
const CONTAINER_PARENT_HYDRATION_CONCURRENCY = 4;
|
|
11
|
+
async function applyRemoteContainerPage(input) {
|
|
12
|
+
const { childIdsByParentId, expectedContainerStates, expectedHydrationTombstones, host, items, queueParentLane, seenContainerIds, state, } = input;
|
|
13
|
+
let hydratedCount = 0;
|
|
14
|
+
let pageCompleted = true;
|
|
15
|
+
await cacheRemoteContainerPrincipalPolicies({
|
|
16
|
+
cacheReferencedPrincipalPolicies: createRuntimePrincipalPolicyWarmer(state.runtime),
|
|
17
|
+
remoteContainers: items,
|
|
18
|
+
stillCurrent: input.isCurrent,
|
|
19
|
+
});
|
|
20
|
+
if (input.isCurrent?.() === false) {
|
|
21
|
+
return { changedCount: 0, completed: false };
|
|
22
|
+
}
|
|
23
|
+
const [containerIdsWithPendingMetadataUpdates, containerIdsWithPendingStructuralIntents,] = await Promise.all([
|
|
24
|
+
listRemoteContainerIdsWithPendingMetadataUpdates({
|
|
25
|
+
remoteContainers: items,
|
|
26
|
+
state,
|
|
27
|
+
}),
|
|
28
|
+
listRemoteContainerIdsWithPendingStructuralIntents({
|
|
29
|
+
remoteContainers: items,
|
|
30
|
+
state,
|
|
31
|
+
}),
|
|
32
|
+
]);
|
|
33
|
+
if (input.isCurrent?.() === false) {
|
|
34
|
+
return { changedCount: 0, completed: false };
|
|
35
|
+
}
|
|
36
|
+
const prefetchedProjections = await prefetchDestinationProjections({
|
|
37
|
+
containerIds: items.flatMap((item) => seenContainerIds.has(item.id) ||
|
|
38
|
+
state.containersById.has(item.id) ||
|
|
39
|
+
expectedHydrationTombstones.get(item.id) ||
|
|
40
|
+
cachedDestinationRole(state.runtime.infra.execSql, item)
|
|
41
|
+
? []
|
|
42
|
+
: [item.id]),
|
|
43
|
+
isCurrent: input.isCurrent,
|
|
44
|
+
runtime: state.runtime,
|
|
45
|
+
});
|
|
46
|
+
for (const container of items) {
|
|
47
|
+
if (input.isCurrent?.() === false) {
|
|
48
|
+
return { changedCount: hydratedCount, completed: false };
|
|
49
|
+
}
|
|
50
|
+
if (!seenContainerIds.has(container.id)) {
|
|
51
|
+
if (!containerStateMatchesFingerprint({
|
|
52
|
+
currentState: state.containersById.get(container.id),
|
|
53
|
+
expectedFingerprint: expectedContainerStates.get(container.id)
|
|
54
|
+
?.fingerprint,
|
|
55
|
+
})) {
|
|
56
|
+
pageCompleted = false;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const upserted = await upsertIsolatedRemoteContainerState({
|
|
60
|
+
childIdsByParentId,
|
|
61
|
+
containerIdsWithPendingMetadataUpdates,
|
|
62
|
+
containerIdsWithPendingStructuralIntents,
|
|
63
|
+
host,
|
|
64
|
+
isCurrent: input.isCurrent,
|
|
65
|
+
expectedHydrationTombstone: expectedHydrationTombstones.get(container.id) ?? null,
|
|
66
|
+
prefetchedProjection: prefetchedProjections.get(container.id),
|
|
67
|
+
remoteContainer: container,
|
|
68
|
+
state,
|
|
69
|
+
});
|
|
70
|
+
if (!upserted) {
|
|
71
|
+
pageCompleted = false;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
seenContainerIds.add(container.id);
|
|
75
|
+
hydratedCount += 1;
|
|
76
|
+
if (input.isCurrent?.() === false) {
|
|
77
|
+
return { changedCount: hydratedCount, completed: false };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
queueParentLane(container.id);
|
|
81
|
+
}
|
|
82
|
+
return { changedCount: hydratedCount, completed: pageCompleted };
|
|
83
|
+
}
|
|
84
|
+
export function canHydrateRemoteContainers(state) {
|
|
85
|
+
return (state.runtime.auth.isAuthenticated &&
|
|
86
|
+
state.runtime.state.online &&
|
|
87
|
+
state.runtime.infra.dbStatus === "ready");
|
|
88
|
+
}
|
|
89
|
+
async function applyContainerParentLanePage(input) {
|
|
90
|
+
const { childIdsByParentId, fetchedPage, host, queueContinuationLane, queueParentLane, seenContainerIds, state, } = input;
|
|
91
|
+
const { expectedContainerStates, expectedHydrationTombstones, lane, response, syncLane, } = fetchedPage;
|
|
92
|
+
let changedCount = 0;
|
|
93
|
+
if (input.isCurrent?.() === false) {
|
|
94
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
95
|
+
}
|
|
96
|
+
const remoteContainerItems = getApplicableRemoteContainerItems(response);
|
|
97
|
+
const tombstoneResult = await applyContainerTombstones({
|
|
98
|
+
childIdsByParentId,
|
|
99
|
+
expectedContainerStates,
|
|
100
|
+
isCurrent: input.isCurrent,
|
|
101
|
+
remoteContainerItems,
|
|
102
|
+
response,
|
|
103
|
+
state,
|
|
104
|
+
});
|
|
105
|
+
if (!tombstoneResult.current) {
|
|
106
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
107
|
+
}
|
|
108
|
+
changedCount += tombstoneResult.changedCount;
|
|
109
|
+
if (input.isCurrent?.() === false) {
|
|
110
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
111
|
+
}
|
|
112
|
+
if (tombstoneResult.changedCount > 0) {
|
|
113
|
+
// A live tombstone cascade may have orphaned documents (row 3); re-arm
|
|
114
|
+
// document priming so their null-scoped passes run now rather than on
|
|
115
|
+
// the next startup.
|
|
116
|
+
host.requestDocumentPriming?.();
|
|
117
|
+
}
|
|
118
|
+
const appliedPage = await applyRemoteContainerPage({
|
|
119
|
+
childIdsByParentId,
|
|
120
|
+
expectedContainerStates,
|
|
121
|
+
expectedHydrationTombstones,
|
|
122
|
+
host,
|
|
123
|
+
isCurrent: input.isCurrent,
|
|
124
|
+
items: remoteContainerItems,
|
|
125
|
+
queueParentLane,
|
|
126
|
+
seenContainerIds,
|
|
127
|
+
state,
|
|
128
|
+
});
|
|
129
|
+
changedCount += appliedPage.changedCount;
|
|
130
|
+
if (!tombstoneResult.completed || !appliedPage.completed) {
|
|
131
|
+
// Keep this page retryable without discarding independent lanes, including
|
|
132
|
+
// children of roots first discovered here. Otherwise the root becomes known
|
|
133
|
+
// but its children are never fetched by subsequent root-only refreshes.
|
|
134
|
+
return { changedCount, complete: false, shouldStop: false };
|
|
135
|
+
}
|
|
136
|
+
if (input.isCurrent?.() === false) {
|
|
137
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
138
|
+
}
|
|
139
|
+
const didMarkFetched = await markContainerParentLaneFetched({
|
|
140
|
+
isCurrent: input.isCurrent,
|
|
141
|
+
response,
|
|
142
|
+
state,
|
|
143
|
+
syncLane,
|
|
144
|
+
});
|
|
145
|
+
if (!didMarkFetched) {
|
|
146
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
147
|
+
}
|
|
148
|
+
if (!response.hasMore) {
|
|
149
|
+
return { changedCount, complete: true, shouldStop: false };
|
|
150
|
+
}
|
|
151
|
+
if (!response.nextWatermark) {
|
|
152
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
153
|
+
}
|
|
154
|
+
queueContinuationLane({
|
|
155
|
+
parentId: lane.parentId,
|
|
156
|
+
watermark: response.nextWatermark,
|
|
157
|
+
});
|
|
158
|
+
return { changedCount, complete: true, shouldStop: false };
|
|
159
|
+
}
|
|
160
|
+
function takeContainerParentLaneBatch(input) {
|
|
161
|
+
const { lanes, state } = input;
|
|
162
|
+
const batch = [];
|
|
163
|
+
while (lanes.length > 0 &&
|
|
164
|
+
batch.length < CONTAINER_PARENT_HYDRATION_CONCURRENCY) {
|
|
165
|
+
const lane = lanes.shift();
|
|
166
|
+
if (lane &&
|
|
167
|
+
(lane.parentId === null || state.containersById.has(lane.parentId))) {
|
|
168
|
+
batch.push(lane);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return batch;
|
|
172
|
+
}
|
|
173
|
+
async function applyContainerParentLaneBatch(input) {
|
|
174
|
+
const { childIdsByParentId, fetchedPages, host, lanes, queueParentLane, seenContainerIds, state, } = input;
|
|
175
|
+
let changedCount = 0;
|
|
176
|
+
let complete = true;
|
|
177
|
+
for (const fetchedPage of fetchedPages) {
|
|
178
|
+
if (!canHydrateRemoteContainers(state) || input.isCurrent?.() === false) {
|
|
179
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
180
|
+
}
|
|
181
|
+
if (fetchedPage.lane.parentId !== null &&
|
|
182
|
+
!state.containersById.has(fetchedPage.lane.parentId)) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const result = await applyContainerParentLanePage({
|
|
186
|
+
childIdsByParentId,
|
|
187
|
+
fetchedPage,
|
|
188
|
+
host,
|
|
189
|
+
isCurrent: input.isCurrent,
|
|
190
|
+
queueContinuationLane: (lane) => lanes.push(lane),
|
|
191
|
+
queueParentLane,
|
|
192
|
+
seenContainerIds,
|
|
193
|
+
state,
|
|
194
|
+
});
|
|
195
|
+
changedCount += result.changedCount;
|
|
196
|
+
complete &&= result.complete;
|
|
197
|
+
if (result.shouldStop) {
|
|
198
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return { changedCount, complete, shouldStop: false };
|
|
202
|
+
}
|
|
203
|
+
export async function hydrateContainerParentLanes(input) {
|
|
204
|
+
const { childIdsByParentId, host, lanes, queueParentLane, seenContainerIds, state, } = input;
|
|
205
|
+
let changedCount = 0;
|
|
206
|
+
let complete = true;
|
|
207
|
+
while (lanes.length > 0) {
|
|
208
|
+
if (!canHydrateRemoteContainers(state) || input.isCurrent?.() === false) {
|
|
209
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
210
|
+
}
|
|
211
|
+
const batch = takeContainerParentLaneBatch({ lanes, state });
|
|
212
|
+
if (batch.length === 0) {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
const fetchedPages = await fetchContainerParentLaneBatch({
|
|
216
|
+
batch,
|
|
217
|
+
isCurrent: input.isCurrent,
|
|
218
|
+
state,
|
|
219
|
+
});
|
|
220
|
+
if (!fetchedPages) {
|
|
221
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
222
|
+
}
|
|
223
|
+
if (input.isCurrent?.() === false) {
|
|
224
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
225
|
+
}
|
|
226
|
+
const result = await applyContainerParentLaneBatch({
|
|
227
|
+
childIdsByParentId,
|
|
228
|
+
fetchedPages,
|
|
229
|
+
host,
|
|
230
|
+
isCurrent: input.isCurrent,
|
|
231
|
+
lanes,
|
|
232
|
+
queueParentLane,
|
|
233
|
+
seenContainerIds,
|
|
234
|
+
state,
|
|
235
|
+
});
|
|
236
|
+
changedCount += result.changedCount;
|
|
237
|
+
complete &&= result.complete;
|
|
238
|
+
if (result.shouldStop) {
|
|
239
|
+
return { changedCount, complete: false, shouldStop: true };
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return { changedCount, complete, shouldStop: false };
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=remoteContainerPageHydration.js.map
|