@tearleads/client-sdk 0.1.61 → 0.1.63
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/containerContents/documentDiscovery.js +5 -5
- package/client/containerContents/documentDiscovery.js.map +1 -1
- package/client/containerContents/index.d.ts +7 -7
- package/client/containerContents/index.js +7 -7
- package/client/containerContents/index.js.map +1 -1
- package/client/containerContents/types.d.ts +6 -6
- package/client/containerContents/types.js.map +1 -1
- package/client/deviceFirst/index.js +2 -2
- package/client/deviceFirst/index.js.map +1 -1
- package/client/organizations/currentPrincipalMutations.js +5 -5
- package/client/organizations/currentPrincipalMutations.js.map +1 -1
- package/client/organizations/organizationDataUsage.js +1 -1
- package/client/organizations/organizationDataUsage.js.map +1 -1
- package/client/organizations/organizationGroupHistory.js +1 -1
- package/client/organizations/organizationGroupHistory.js.map +1 -1
- package/client/organizations/organizationGroupNameHydration.js +3 -3
- package/client/organizations/organizationGroupNameHydration.js.map +1 -1
- package/client/organizations/organizationHistory.js +2 -2
- package/client/organizations/organizationHistory.js.map +1 -1
- package/client/organizations/organizationReadModels.js +1 -1
- package/client/organizations/organizationReadModels.js.map +1 -1
- package/client/organizations/principalContainerMutations.js +1 -1
- package/client/organizations/principalContainerMutations.js.map +1 -1
- package/client/organizations/principalMutationRecovery.js.map +1 -1
- package/client/organizations/principalMutations.js +5 -5
- package/client/organizations/principalMutations.js.map +1 -1
- package/client/runtime/principalMutationApi.d.ts +1 -1
- package/client/runtime/principalMutationApi.js +2 -2
- package/client/runtime/principalMutationApi.js.map +1 -1
- package/client/runtime/principalMutationDispatch.js +1 -1
- package/client/runtime/principalMutationDispatch.js.map +1 -1
- package/client/session/index.js +1 -1
- package/client/session/index.js.map +1 -1
- package/client/session/sessionOrganizationCreation.js +1 -1
- package/client/session/sessionOrganizationCreation.js.map +1 -1
- package/client/session/sessionPurgeRecovery.js +2 -2
- package/client/session/sessionPurgeRecovery.js.map +1 -1
- package/package.json +1 -1
- package/stores/container-contents/containerStatePersistence.js +1 -1
- package/stores/container-contents/documentRecovery.js +2 -2
- package/stores/container-contents/documentRecovery.js.map +1 -1
- package/stores/container-contents/documentWork.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.js +2 -2
- package/stores/container-contents/operations.js.map +1 -1
- package/stores/container-contents/remoteContainerIngestion.js +1 -1
- package/stores/container-contents/remoteEventSync.js +1 -1
- package/stores/container-contents/remoteHydrationRequest.js +1 -1
- package/stores/container-contents/setContainerIconOperation.js +2 -2
- package/stores/container-contents/setContainerIconOperation.js.map +1 -1
- package/stores/container-contents/shareOperations.js +1 -1
- package/stores/container-contents/startupHydration.js +1 -1
- package/stores/container-contents/syncAgent.d.ts +2 -2
- package/stores/container-contents/syncAgentTypes.d.ts +1 -1
- package/stores/container-contents/syncLaneIteration.js +2 -2
- package/stores/container-contents/syncLaneIteration.js.map +1 -1
- package/stores/container-contents/systemContainerIcon.js +1 -1
- package/stores/container-contents/systemContainerIcon.js.map +1 -1
- package/stores/documents/documentStore/attachmentHydrationCommit.js +1 -1
- package/stores/documents/documentStore/attachmentHydrationCommit.js.map +1 -1
- package/stores/documents/documentStore/attachmentUploadAttempt.js +1 -1
- package/stores/documents/documentStore/syncRemoteSignals.js +1 -1
- package/stores/documents/documentStore/syncRemoteSignals.js.map +1 -1
- package/stores/documents/documentStore/syncShared.js +1 -1
- package/stores/documents/documentStore/syncShared.js.map +1 -1
- package/workflows/blobs/detach.js +1 -1
- package/workflows/blobs/detach.js.map +1 -1
- package/workflows/blobs/hydration/blobChunkDecryption.js +34 -0
- package/workflows/blobs/hydration/blobChunkDecryption.js.map +1 -0
- package/workflows/blobs/hydration/decrypt.d.ts +12 -0
- package/workflows/blobs/hydration/decrypt.js +246 -0
- package/workflows/blobs/hydration/decrypt.js.map +1 -0
- package/workflows/blobs/hydration/hydrate.d.ts +56 -0
- package/workflows/blobs/hydration/hydrate.js +190 -0
- package/workflows/blobs/hydration/hydrate.js.map +1 -0
- package/workflows/blobs/hydration/hydrationResults.js +23 -0
- package/workflows/blobs/hydration/hydrationResults.js.map +1 -0
- package/workflows/blobs/index.d.ts +3 -3
- package/workflows/blobs/index.js +3 -3
- package/workflows/blobs/index.js.map +1 -1
- package/workflows/blobs/upload/automaticMultipartUpload.js +9 -0
- package/workflows/blobs/upload/automaticMultipartUpload.js.map +1 -0
- package/workflows/blobs/upload/index.d.ts +10 -0
- package/workflows/blobs/upload/index.js +243 -0
- package/workflows/blobs/upload/index.js.map +1 -0
- package/workflows/blobs/upload/multipartFirstParts.js +82 -0
- package/workflows/blobs/upload/multipartFirstParts.js.map +1 -0
- package/workflows/blobs/upload/multipartStageFailures.js +36 -0
- package/workflows/blobs/upload/multipartStageFailures.js.map +1 -0
- package/workflows/blobs/upload/multipartStageResolution.js.map +1 -0
- package/workflows/blobs/upload/multipartUpload.js +274 -0
- package/workflows/blobs/upload/multipartUpload.js.map +1 -0
- package/workflows/blobs/verification/attachmentBindingVerification.js +49 -0
- package/workflows/blobs/verification/attachmentBindingVerification.js.map +1 -0
- package/workflows/blobs/verification/attachmentDecryptor.js +41 -0
- package/workflows/blobs/verification/attachmentDecryptor.js.map +1 -0
- package/workflows/blobs/verification/attachmentKeyAuthenticator.js +68 -0
- package/workflows/blobs/verification/attachmentKeyAuthenticator.js.map +1 -0
- package/workflows/blobs/verification/retainedAttachmentVerification.js +40 -0
- package/workflows/blobs/verification/retainedAttachmentVerification.js.map +1 -0
- package/workflows/blobs/verification/verifiedWrapScope.js +20 -0
- package/workflows/blobs/verification/verifiedWrapScope.js.map +1 -0
- package/workflows/blobs/verification/writerProjection.js +29 -0
- package/workflows/blobs/verification/writerProjection.js.map +1 -0
- package/workflows/container-contents/attribution/documentAttributionRanges.d.ts +26 -0
- package/workflows/container-contents/attribution/documentCharacterBlame.js +33 -0
- package/workflows/container-contents/attribution/documentCharacterBlame.js.map +1 -0
- package/workflows/container-contents/attribution/documentFieldBlame.js +26 -0
- package/workflows/container-contents/attribution/documentFieldBlame.js.map +1 -0
- package/workflows/container-contents/container-state/createIntentSync.js +1 -1
- package/workflows/container-contents/container-state/createIntentSync.js.map +1 -1
- package/workflows/container-contents/container-state/moveIntentSync.js +1 -1
- package/workflows/container-contents/container-state/moveIntentSync.js.map +1 -1
- package/workflows/container-contents/container-state/purgeTree.js +2 -2
- package/workflows/container-contents/container-state/purgeTree.js.map +1 -1
- package/workflows/container-contents/container-state/purgeTreeContainerDeletion.js.map +1 -1
- package/workflows/container-contents/container-state/remote.js +1 -1
- package/workflows/container-contents/container-state/remote.js.map +1 -1
- package/workflows/container-contents/container-state/sharePersistence.js +2 -2
- package/workflows/container-contents/container-state/sharePersistence.js.map +1 -1
- package/workflows/container-contents/documentDiscovery/containerDocumentListing.js +106 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryApply.js +65 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryApply.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryCandidates.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryEvidence.js +91 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryEvidence.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryInputs.js +85 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryInputs.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryLanes.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryTypes.d.ts +160 -0
- package/workflows/container-contents/documentDiscovery/documentDiscoveryTypes.js.map +1 -0
- package/workflows/container-contents/documentDiscovery/index.d.ts +12 -0
- package/workflows/container-contents/documentDiscovery/index.js +183 -0
- package/workflows/container-contents/documentDiscovery/index.js.map +1 -0
- package/workflows/container-contents/documentLinks/availableDocumentLinkIntent.js +32 -0
- package/workflows/container-contents/documentLinks/availableDocumentLinkIntent.js.map +1 -0
- package/workflows/container-contents/documentLinks/deferredDocumentLinks.js +9 -0
- package/workflows/container-contents/documentLinks/deferredDocumentLinks.js.map +1 -0
- package/workflows/container-contents/documentLinks/documentLinkIntent.js +82 -0
- package/workflows/container-contents/documentLinks/documentLinkIntent.js.map +1 -0
- package/workflows/container-contents/documentLinks/documentLocalRelink.js.map +1 -0
- package/workflows/container-contents/documentLinks/index.d.ts +64 -0
- package/workflows/container-contents/documentLinks/index.js +264 -0
- package/workflows/container-contents/documentLinks/index.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveDeniedReplay.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveFailure.js +35 -0
- package/workflows/container-contents/documentMove/documentMoveFailure.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveIntent.js +77 -0
- package/workflows/container-contents/documentMove/documentMoveIntent.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveIntentErrors.js +17 -0
- package/workflows/container-contents/documentMove/documentMoveIntentErrors.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveIntentSettlement.js +25 -0
- package/workflows/container-contents/documentMove/documentMoveIntentSettlement.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveIntentSync.js +346 -0
- package/workflows/container-contents/documentMove/documentMoveIntentSync.js.map +1 -0
- package/workflows/container-contents/documentMove/documentMoveVanishedRefresh.js +100 -0
- package/workflows/container-contents/documentMove/documentMoveVanishedRefresh.js.map +1 -0
- package/workflows/container-contents/documentPriming/documentHydrationProbe.js +146 -0
- package/workflows/container-contents/documentPriming/documentHydrationProbe.js.map +1 -0
- package/workflows/container-contents/documentPriming/documentRuntimeTargetSync.js.map +1 -0
- package/workflows/container-contents/documentPriming/index.js +245 -0
- package/workflows/container-contents/documentPriming/index.js.map +1 -0
- package/workflows/container-contents/documentQueries/documentStructure.d.ts +53 -0
- package/workflows/container-contents/documentQueries/documentStructure.js +183 -0
- package/workflows/container-contents/documentQueries/documentStructure.js.map +1 -0
- package/workflows/container-contents/documentQueries/documentStructureTypes.d.ts +32 -0
- package/workflows/container-contents/documentQueries/documentStructureTypes.js.map +1 -0
- package/workflows/container-contents/documentQueries/documentSubtreeQueries.js +169 -0
- package/workflows/container-contents/documentQueries/documentSubtreeQueries.js.map +1 -0
- package/workflows/container-contents/documentQueries/index.d.ts +62 -0
- package/workflows/container-contents/documentQueries/index.js +212 -0
- package/workflows/container-contents/documentQueries/index.js.map +1 -0
- package/workflows/container-contents/documentQueries/orphanedDocumentSql.js +39 -0
- package/workflows/container-contents/documentQueries/orphanedDocumentSql.js.map +1 -0
- package/workflows/container-contents/documentQueries/pendingDownloads.d.ts +12 -0
- package/workflows/container-contents/documentQueries/pendingDownloads.js +42 -0
- package/workflows/container-contents/documentQueries/pendingDownloads.js.map +1 -0
- package/workflows/container-contents/documentQueries/sql.js +1 -1
- package/workflows/container-contents/documentQueries/sql.js.map +1 -1
- package/workflows/container-contents/index.d.ts +13 -13
- package/workflows/container-contents/index.js +11 -11
- package/workflows/container-contents/index.js.map +1 -1
- package/workflows/container-contents/info/blobInfo.d.ts +6 -0
- package/workflows/container-contents/info/blobInfo.js +323 -0
- package/workflows/container-contents/info/blobInfo.js.map +1 -0
- package/workflows/container-contents/info/blobInfoTypes.d.ts +48 -0
- package/workflows/container-contents/info/blobInfoTypes.js.map +1 -0
- package/workflows/container-contents/info/containerInfo.d.ts +77 -0
- package/workflows/container-contents/info/containerInfo.js +200 -0
- package/workflows/container-contents/info/containerInfo.js.map +1 -0
- package/workflows/container-contents/info/documentInfo.d.ts +18 -0
- package/workflows/container-contents/info/documentInfo.js +306 -0
- package/workflows/container-contents/info/documentInfo.js.map +1 -0
- package/workflows/container-contents/info/documentInfoTypes.d.ts +92 -0
- package/workflows/container-contents/info/documentInfoTypes.js.map +1 -0
- package/workflows/container-contents/metadata/index.d.ts +25 -0
- package/workflows/container-contents/metadata/index.js +217 -0
- package/workflows/container-contents/metadata/index.js.map +1 -0
- package/workflows/container-contents/metadata/metadataEvents.d.ts +7 -0
- package/workflows/container-contents/metadata/metadataEvents.js +47 -0
- package/workflows/container-contents/metadata/metadataEvents.js.map +1 -0
- package/workflows/container-contents/metadata/metadataIncomingUpdateIsolation.js +40 -0
- package/workflows/container-contents/metadata/metadataIncomingUpdateIsolation.js.map +1 -0
- package/workflows/container-contents/metadata/metadataMutationPreparation.d.ts +75 -0
- package/workflows/container-contents/metadata/metadataMutationPreparation.js +177 -0
- package/workflows/container-contents/metadata/metadataMutationPreparation.js.map +1 -0
- package/workflows/container-contents/metadata/metadataPersistence.d.ts +34 -0
- package/workflows/container-contents/metadata/metadataPersistence.js +254 -0
- package/workflows/container-contents/metadata/metadataPersistence.js.map +1 -0
- package/workflows/container-contents/metadata/metadataPullContinuationInvalidation.js +65 -0
- package/workflows/container-contents/metadata/metadataPullContinuationInvalidation.js.map +1 -0
- package/workflows/container-contents/metadata/metadataReadState.d.ts +2 -0
- package/workflows/container-contents/metadata/metadataReadState.js.map +1 -0
- package/workflows/container-contents/metadata/metadataRecord.js +43 -0
- package/workflows/container-contents/metadata/metadataRecord.js.map +1 -0
- package/workflows/container-contents/metadata/metadataRemoteSync.d.ts +38 -0
- package/workflows/container-contents/metadata/metadataRemoteSync.js +91 -0
- package/workflows/container-contents/metadata/metadataRemoteSync.js.map +1 -0
- package/workflows/container-contents/metadata/metadataStateInstallation.d.ts +3 -0
- package/workflows/container-contents/metadata/metadataStateInstallation.js.map +1 -0
- package/workflows/container-contents/metadata/metadataStateIsolation.js +80 -0
- package/workflows/container-contents/metadata/metadataStateIsolation.js.map +1 -0
- package/workflows/container-contents/metadata/metadataSyncErrors.js +41 -0
- package/workflows/container-contents/metadata/metadataSyncErrors.js.map +1 -0
- package/workflows/container-contents/metadata/metadataSyncSettlement.d.ts +13 -0
- package/workflows/container-contents/metadata/metadataSyncSettlement.js +27 -0
- package/workflows/container-contents/metadata/metadataSyncSettlement.js.map +1 -0
- package/workflows/container-contents/metadata/metadataTypes.d.ts +54 -0
- package/workflows/container-contents/metadata/metadataTypes.js.map +1 -0
- package/workflows/container-contents/pendingWrites/aggregation.js.map +1 -1
- package/workflows/container-contents/pendingWrites/deferredTails.js.map +1 -1
- package/workflows/container-contents/pendingWrites/index.d.ts +26 -0
- package/workflows/container-contents/pendingWrites/index.js +116 -0
- package/workflows/container-contents/pendingWrites/index.js.map +1 -0
- package/workflows/container-contents/projectionGeneration.js.map +1 -1
- package/workflows/container-contents/projectionView.js +1 -1
- package/workflows/container-contents/projectionView.js.map +1 -1
- package/workflows/container-contents/recovery/folderRecovery.d.ts +19 -0
- package/workflows/container-contents/recovery/folderRecovery.js +32 -0
- package/workflows/container-contents/recovery/folderRecovery.js.map +1 -0
- package/workflows/container-contents/recovery/staleRootRecovery.js +111 -0
- package/workflows/container-contents/recovery/staleRootRecovery.js.map +1 -0
- package/workflows/container-contents/remoteHydration/completeHydration.js +1 -1
- package/workflows/container-contents/remoteHydration/completeHydration.js.map +1 -1
- package/workflows/container-contents/remoteHydration/destinationRootReload.js +1 -1
- package/workflows/container-contents/remoteHydration/destinationRootReload.js.map +1 -1
- package/workflows/container-contents/remoteHydration/heldContainerRebind.js +1 -1
- package/workflows/container-contents/remoteHydration/heldContainerRebind.js.map +1 -1
- package/workflows/container-contents/remoteHydration/index.d.ts +28 -0
- package/workflows/container-contents/remoteHydration/index.js +302 -0
- package/workflows/container-contents/remoteHydration/index.js.map +1 -0
- package/workflows/container-contents/remoteHydration/remoteContainerPageHydration.js +244 -0
- package/workflows/container-contents/remoteHydration/remoteContainerPageHydration.js.map +1 -0
- package/workflows/container-contents/remoteHydration/remoteContainerState.js +263 -0
- package/workflows/container-contents/remoteHydration/remoteContainerState.js.map +1 -0
- package/workflows/container-contents/remoteHydration/types.d.ts +1 -1
- package/workflows/container-contents/remoteHydration/verifiedDestination.js +1 -1
- package/workflows/container-contents/remoteHydration/verifiedDestination.js.map +1 -1
- package/workflows/container-contents/tombstones/documentPurge.d.ts +37 -0
- package/workflows/container-contents/tombstones/documentPurge.js +136 -0
- package/workflows/container-contents/tombstones/documentPurge.js.map +1 -0
- package/workflows/container-contents/tombstones/documentTombstoneEvidence.js +173 -0
- package/workflows/container-contents/tombstones/documentTombstoneEvidence.js.map +1 -0
- package/workflows/container-contents/tombstones/documentTombstoneGate.js +94 -0
- package/workflows/container-contents/tombstones/documentTombstoneGate.js.map +1 -0
- package/workflows/containers/child/currentShareGrantMutation.js +5 -5
- package/workflows/containers/child/currentShareGrantMutation.js.map +1 -1
- package/workflows/containers/child/currentSharePrincipalPolicy.js +5 -5
- package/workflows/containers/child/currentSharePrincipalPolicy.js.map +1 -1
- package/workflows/containers/child/runtimeCurrentGroupShare.js +1 -1
- package/workflows/containers/child/runtimeCurrentGroupShare.js.map +1 -1
- package/workflows/containers/child/share.d.ts +1 -1
- package/workflows/containers/child/share.js +4 -4
- package/workflows/containers/child/share.js.map +1 -1
- package/workflows/containers/child/sharePrincipalPolicy.d.ts +1 -1
- package/workflows/containers/child/sharePrincipalPolicy.js +2 -2
- package/workflows/containers/child/sharePrincipalPolicy.js.map +1 -1
- package/workflows/documents/attachments/attachmentPersistence.d.ts +58 -0
- package/workflows/documents/attachments/attachmentPersistence.js.map +1 -0
- package/workflows/documents/attachments/blobMutationLock.d.ts +8 -0
- package/workflows/documents/attachments/blobMutationLock.js +35 -0
- package/workflows/documents/attachments/blobMutationLock.js.map +1 -0
- package/workflows/documents/attachments/orphanBlobReclaimState.js.map +1 -0
- package/workflows/documents/attachments/orphanBlobReclaims.d.ts +6 -0
- package/workflows/documents/attachments/orphanBlobReclaims.js +143 -0
- package/workflows/documents/attachments/orphanBlobReclaims.js.map +1 -0
- package/workflows/documents/authorAccessFailure.js.map +1 -1
- package/workflows/documents/create/createAdoption.js +100 -0
- package/workflows/documents/create/createAdoption.js.map +1 -0
- package/workflows/documents/create/createProjection.d.ts +14 -0
- package/workflows/documents/create/createProjectionFetch.d.ts +27 -0
- package/workflows/documents/create/createProjectionFetch.js.map +1 -0
- package/workflows/documents/create/createResponse.js +49 -0
- package/workflows/documents/create/createResponse.js.map +1 -0
- package/workflows/documents/create/documentCreationPersistence.js +16 -0
- package/workflows/documents/create/documentCreationPersistence.js.map +1 -0
- package/workflows/documents/create/index.d.ts +56 -0
- package/workflows/documents/create/index.js +258 -0
- package/workflows/documents/create/index.js.map +1 -0
- package/workflows/documents/documentMutationCommit.js +1 -1
- package/workflows/documents/documentMutationCommit.js.map +1 -1
- package/workflows/documents/index.d.ts +17 -17
- package/workflows/documents/index.js +14 -14
- package/workflows/documents/index.js.map +1 -1
- package/workflows/documents/linkSet/index.d.ts +20 -0
- package/workflows/documents/linkSet/index.js +290 -0
- package/workflows/documents/linkSet/index.js.map +1 -0
- package/workflows/documents/linkSet/linkSetAuthority.js +61 -0
- package/workflows/documents/linkSet/linkSetAuthority.js.map +1 -0
- package/workflows/documents/linkSet/linkSetBlobRewraps.js +143 -0
- package/workflows/documents/linkSet/linkSetBlobRewraps.js.map +1 -0
- package/workflows/documents/linkSet/linkSetProjectionSeed.js +119 -0
- package/workflows/documents/linkSet/linkSetProjectionSeed.js.map +1 -0
- package/workflows/documents/linkSet/linkSetRemote.d.ts +23 -0
- package/workflows/documents/linkSet/linkSetRemote.js +187 -0
- package/workflows/documents/linkSet/linkSetRemote.js.map +1 -0
- package/workflows/documents/purge/index.d.ts +53 -0
- package/workflows/documents/purge/index.js +204 -0
- package/workflows/documents/purge/index.js.map +1 -0
- package/workflows/documents/purge/persistedDocumentRemoval.d.ts +44 -0
- package/workflows/documents/purge/persistedDocumentRemoval.js +70 -0
- package/workflows/documents/purge/persistedDocumentRemoval.js.map +1 -0
- package/workflows/documents/purge/subtreePurgeScope.d.ts +8 -0
- package/workflows/documents/purge/subtreePurgeScope.js +18 -0
- package/workflows/documents/purge/subtreePurgeScope.js.map +1 -0
- package/workflows/documents/rotationBaseline.js +1 -1
- package/workflows/documents/rotationBaseline.js.map +1 -1
- package/workflows/documents/sync/index.d.ts +4 -0
- package/workflows/documents/sync/index.js +287 -0
- package/workflows/documents/sync/index.js.map +1 -0
- package/workflows/documents/sync/initialSync.js +65 -0
- package/workflows/documents/sync/initialSync.js.map +1 -0
- package/workflows/documents/sync/readOnlyProjectionFailure.js +30 -0
- package/workflows/documents/sync/readOnlyProjectionFailure.js.map +1 -0
- package/workflows/documents/sync/readOnlySync.d.ts +71 -0
- package/workflows/documents/sync/readOnlySync.js +269 -0
- package/workflows/documents/sync/readOnlySync.js.map +1 -0
- package/workflows/documents/sync/reportDocumentSyncQuarantine.js.map +1 -0
- package/workflows/documents/sync/syncAttemptPlanning.js +79 -0
- package/workflows/documents/sync/syncAttemptPlanning.js.map +1 -0
- package/workflows/documents/sync/syncAttemptState.d.ts +27 -0
- package/workflows/documents/sync/syncAttemptState.js.map +1 -0
- package/workflows/documents/sync/syncLane.d.ts +20 -0
- package/workflows/documents/sync/syncLane.js +94 -0
- package/workflows/documents/sync/syncLane.js.map +1 -0
- package/workflows/documents/sync/syncResponseResult.js +134 -0
- package/workflows/documents/sync/syncResponseResult.js.map +1 -0
- package/workflows/documents/sync/syncSubmittedResult.js +119 -0
- package/workflows/documents/sync/syncSubmittedResult.js.map +1 -0
- package/workflows/documents/sync/syncTrace.js +148 -0
- package/workflows/documents/syncFailures/index.js +252 -0
- package/workflows/documents/syncFailures/index.js.map +1 -0
- package/workflows/documents/syncFailures/syncAbandon.js +51 -0
- package/workflows/documents/syncFailures/syncAbandon.js.map +1 -0
- package/workflows/documents/syncFailures/syncFailureClassification.d.ts +74 -0
- package/workflows/documents/syncFailures/syncFailureClassification.js +122 -0
- package/workflows/documents/syncFailures/syncFailureClassification.js.map +1 -0
- package/workflows/documents/syncFailures/syncPolicyRepair.js +50 -0
- package/workflows/documents/syncFailures/syncPolicyRepair.js.map +1 -0
- package/workflows/documents/syncFailures/syncRepairAbandon.js.map +1 -0
- package/workflows/documents/syncFailures/syncRepairAccess.js +42 -0
- package/workflows/documents/syncFailures/syncRepairAccess.js.map +1 -0
- package/workflows/documents/syncPlan/syncContentKeys.d.ts +39 -0
- package/workflows/documents/syncPlan/syncContentKeys.js +254 -0
- package/workflows/documents/syncPlan/syncContentKeys.js.map +1 -0
- package/workflows/documents/syncPlan/syncPlanIdentity.js +203 -0
- package/workflows/documents/syncPlan/syncPlanIdentity.js.map +1 -0
- package/workflows/documents/syncPlan/syncPlanMaterial.js +306 -0
- package/workflows/documents/syncPlan/syncPlanMaterial.js.map +1 -0
- package/workflows/documents/syncPlan/syncPlanProjection.js.map +1 -0
- package/workflows/documents/syncPlan/syncPlanRequestBounds.js +54 -0
- package/workflows/documents/syncPlan/syncPlanRequestBounds.js.map +1 -0
- package/workflows/documents/syncRekeys/syncAutomaticContainerRekeys.js +119 -0
- package/workflows/documents/syncRekeys/syncAutomaticContainerRekeys.js.map +1 -0
- package/workflows/documents/syncRekeys/syncContainerRekeyPreparation.js +227 -0
- package/workflows/documents/syncRekeys/syncContainerRekeyPreparation.js.map +1 -0
- package/workflows/documents/syncRekeys/syncContainerRekeyProjection.js +79 -0
- package/workflows/documents/syncRekeys/syncContainerRekeyProjection.js.map +1 -0
- package/workflows/documents/syncRekeys/syncContainerRekeys.js +72 -0
- package/workflows/documents/syncRekeys/syncContainerRekeys.js.map +1 -0
- package/workflows/documents/syncRekeys/syncRecoveryRekey.d.ts +70 -0
- package/workflows/documents/syncRekeys/syncRecoveryRekey.js +120 -0
- package/workflows/documents/syncRekeys/syncRecoveryRekey.js.map +1 -0
- package/workflows/documents/syncRekeys/syncRekeyCommit.js +18 -0
- package/workflows/organizations/groupMetadata/currentGroupMetadataAuthority.js +53 -0
- package/workflows/organizations/groupMetadata/currentGroupMetadataAuthority.js.map +1 -0
- package/workflows/organizations/groupMetadata/groupMetadataAccess.d.ts +33 -0
- package/workflows/organizations/groupMetadata/groupMetadataAccess.js +114 -0
- package/workflows/organizations/groupMetadata/groupMetadataAccess.js.map +1 -0
- package/workflows/organizations/groupMetadata/groupMetadataBinding.js +19 -0
- package/workflows/organizations/groupMetadata/groupMetadataBinding.js.map +1 -0
- package/workflows/organizations/groupMetadata/groupMetadataContainerAuthority.js +41 -0
- package/workflows/organizations/groupMetadata/groupMetadataContainerAuthority.js.map +1 -0
- package/workflows/organizations/groupMetadata/groupMetadataErrors.js +40 -0
- package/workflows/organizations/groupMetadata/groupMetadataRootBinding.js +51 -0
- package/workflows/organizations/groupMetadata/groupMetadataRootBinding.js.map +1 -0
- package/workflows/organizations/groupMetadata/groupMetadataRuntime.js +47 -0
- package/workflows/organizations/groupMetadata/groupMetadataRuntime.js.map +1 -0
- package/workflows/organizations/groupMetadata/runtimeGroupMetadataAuthority.js +16 -0
- package/workflows/organizations/groupMetadata/runtimeGroupMetadataAuthority.js.map +1 -0
- package/workflows/organizations/groupNames/currentOrganizationGroupNames.js +72 -0
- package/workflows/organizations/groupNames/currentOrganizationGroupNames.js.map +1 -0
- package/workflows/organizations/groupNames/groupMembershipName.d.ts +8 -0
- package/workflows/organizations/groupNames/groupMembershipName.js +18 -0
- package/workflows/organizations/groupNames/groupMembershipName.js.map +1 -0
- package/workflows/organizations/groupNames/groupNameUniqueness.js +151 -0
- package/workflows/organizations/groupNames/groupNameUniqueness.js.map +1 -0
- package/workflows/organizations/groupNames/organizationGroupNamePolicies.js +48 -0
- package/workflows/organizations/groupNames/organizationGroupNamePolicies.js.map +1 -0
- package/workflows/organizations/groupNames/organizationGroupNames.js +13 -0
- package/workflows/organizations/groupNames/organizationGroupNames.js.map +1 -0
- package/workflows/organizations/groupPolicy/commitCurrentGroupPolicyMutation.js +139 -0
- package/workflows/organizations/groupPolicy/commitCurrentGroupPolicyMutation.js.map +1 -0
- package/workflows/organizations/groupPolicy/currentGroupPolicyMutationContext.js +79 -0
- package/workflows/organizations/groupPolicy/currentGroupPolicyMutationContext.js.map +1 -0
- package/workflows/organizations/groupPolicy/currentPolicyMutationAcknowledgement.js +65 -0
- package/workflows/organizations/groupPolicy/currentPolicyMutationAcknowledgement.js.map +1 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationAcknowledgement.js +174 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationAcknowledgement.js.map +1 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationContext.d.ts +58 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationContext.js +166 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationContext.js.map +1 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationEvidence.d.ts +26 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationEvidence.js +64 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationEvidence.js.map +1 -0
- package/workflows/organizations/groupPolicy/groupPolicyMutationHead.js +26 -0
- package/workflows/organizations/groupPolicy/groupPolicyRequests.js +181 -0
- package/workflows/organizations/groupPolicy/groupPolicyRequests.js.map +1 -0
- package/workflows/organizations/groupPolicy/groupPolicyVerification.js +74 -0
- package/workflows/organizations/groupPolicy/groupPolicyVerification.js.map +1 -0
- package/workflows/organizations/groupPolicy/submitGroupPolicyCommit.d.ts +22 -0
- package/workflows/organizations/groupPolicy/submitGroupPolicyCommit.js +71 -0
- package/workflows/organizations/groupPolicy/submitGroupPolicyCommit.js.map +1 -0
- package/workflows/organizations/groups/createCurrentOrganizationGroup.js +85 -0
- package/workflows/organizations/groups/createCurrentOrganizationGroup.js.map +1 -0
- package/workflows/organizations/groups/deleteCurrentOrganizationGroup.js +35 -0
- package/workflows/organizations/groups/deleteCurrentOrganizationGroup.js.map +1 -0
- package/workflows/organizations/groups/deleteOrganizationGroup.d.ts +19 -0
- package/workflows/organizations/groups/deleteOrganizationGroup.js +75 -0
- package/workflows/organizations/groups/deleteOrganizationGroup.js.map +1 -0
- package/workflows/organizations/groups/groupCreation.d.ts +21 -0
- package/workflows/organizations/groups/groupCreation.js +68 -0
- package/workflows/organizations/groups/groupCreation.js.map +1 -0
- package/workflows/organizations/groups/organizationGroupDirectory.js +153 -0
- package/workflows/organizations/groups/organizationGroupDirectory.js.map +1 -0
- package/workflows/organizations/index.d.ts +13 -13
- package/workflows/organizations/index.js +12 -12
- package/workflows/organizations/index.js.map +1 -1
- package/workflows/organizations/policyHistory/groupPolicyHistoryPage.js.map +1 -0
- package/workflows/organizations/policyHistory/loadPolicyHistoryDetails.js +78 -0
- package/workflows/organizations/policyHistory/loadPolicyHistoryDetails.js.map +1 -0
- package/workflows/organizations/policyHistory/organizationPolicyHistoryDetails.js +110 -0
- package/workflows/organizations/policyHistory/organizationPolicyHistoryDetails.js.map +1 -0
- package/workflows/organizations/policyHistory/organizationPolicyHistoryVerification.js +67 -0
- package/workflows/organizations/policyHistory/organizationPolicyHistoryVerification.js.map +1 -0
- package/workflows/organizations/policyHistory/policyHistoryAccessDenial.js +19 -0
- package/workflows/organizations/policyHistory/policyHistoryAccessDenial.js.map +1 -0
- package/workflows/organizations/policyHistory/policyHistoryCache.js +42 -0
- package/workflows/organizations/policyHistory/policyHistoryCache.js.map +1 -0
- package/workflows/organizations/policyHistory/policyHistoryReadModel.d.ts +9 -0
- package/workflows/organizations/policyHistory/policyHistoryTypes.d.ts +58 -0
- package/workflows/organizations/principalMutations/acknowledgedDirectoryBindings.js +18 -0
- package/workflows/organizations/principalMutations/acknowledgedDirectoryBindings.js.map +1 -0
- package/workflows/organizations/principalMutations/currentGroupMutationReferences.js +35 -0
- package/workflows/organizations/principalMutations/currentGroupMutationReferences.js.map +1 -0
- package/workflows/organizations/principalMutations/currentOrganizationMutationAuthority.js +16 -0
- package/workflows/organizations/principalMutations/currentOrganizationMutationAuthority.js.map +1 -0
- package/workflows/organizations/principalMutations/currentOrganizationMutationRetention.js +64 -0
- package/workflows/organizations/principalMutations/currentOrganizationMutationRetention.js.map +1 -0
- package/workflows/organizations/principalMutations/currentPrincipalMutationLease.js +39 -0
- package/workflows/organizations/principalMutations/currentPrincipalMutationLease.js.map +1 -0
- package/workflows/organizations/principalMutations/principalMutationJournalManagement.d.ts +26 -0
- package/workflows/organizations/principalMutations/principalMutationJournalManagement.js +104 -0
- package/workflows/organizations/principalMutations/principalMutationJournalManagement.js.map +1 -0
- package/workflows/organizations/principalMutations/principalMutationJournalSession.d.ts +26 -0
- package/workflows/organizations/principalMutations/principalMutationJournalSession.js +85 -0
- package/workflows/organizations/principalMutations/principalMutationJournalSession.js.map +1 -0
- package/workflows/organizations/principalMutations/principalMutationReceipt.js +28 -0
- package/workflows/organizations/principalMutations/principalMutationReceipt.js.map +1 -0
- package/workflows/organizations/principalMutations/principalOperationReceipt.d.ts +5 -0
- package/workflows/organizations/principalMutations/principalOperationReceipt.js +36 -0
- package/workflows/organizations/principalMutations/principalOperationReceipt.js.map +1 -0
- package/workflows/organizations/principalMutations/retainAcknowledgedPrincipalCurrents.d.ts +6 -0
- package/workflows/organizations/principalMutations/retainAcknowledgedPrincipalCurrents.js +20 -0
- package/workflows/organizations/principalMutations/retainAcknowledgedPrincipalCurrents.js.map +1 -0
- package/workflows/organizations/principalMutations/runtimeCurrentGroupMutation.js +113 -0
- package/workflows/organizations/principalMutations/runtimeCurrentGroupMutation.js.map +1 -0
- package/workflows/organizations/principalMutations/runtimeCurrentOrganizationMutation.js +48 -0
- package/workflows/organizations/principalMutations/runtimeCurrentOrganizationMutation.js.map +1 -0
- package/workflows/organizations/principalPolicy/index.d.ts +98 -0
- package/workflows/organizations/principalPolicy/index.js +256 -0
- package/workflows/organizations/principalPolicy/index.js.map +1 -0
- package/workflows/organizations/principalPolicy/principalPolicyApi.d.ts +33 -0
- package/workflows/organizations/principalPolicy/principalPolicyApi.js.map +1 -0
- package/workflows/organizations/principalPolicy/principalPolicyReceiptArtifacts.js +74 -0
- package/workflows/organizations/principalPolicy/principalPolicyReceiptArtifacts.js.map +1 -0
- package/workflows/organizations/principalPolicy/principalPolicyRecipients.js +43 -0
- package/workflows/organizations/principalPolicy/principalPolicyRecipients.js.map +1 -0
- package/workflows/organizations/principalPolicy/principalPolicyRequest.d.ts +68 -0
- package/workflows/organizations/principalPolicy/principalPolicyRequest.js +176 -0
- package/workflows/organizations/provisioning/createOrganization.d.ts +62 -0
- package/workflows/organizations/provisioning/createOrganization.js +128 -0
- package/workflows/organizations/provisioning/createOrganization.js.map +1 -0
- package/workflows/organizations/provisioning/organizationProvisioningAttempt.d.ts +36 -0
- package/workflows/organizations/provisioning/organizationProvisioningAttempt.js +205 -0
- package/workflows/organizations/provisioning/organizationProvisioningAttempt.js.map +1 -0
- package/workflows/organizations/provisioning/organizationReplacementVerification.js +26 -0
- package/workflows/organizations/provisioning/organizationReplacementVerification.js.map +1 -0
- package/workflows/organizations/readModel/dataUsageReadModel.d.ts +19 -0
- package/workflows/organizations/readModel/dataUsageReadModel.js +64 -0
- package/workflows/organizations/readModel/dataUsageReadModel.js.map +1 -0
- package/workflows/organizations/readModel/index.d.ts +70 -0
- package/workflows/organizations/readModel/index.js +10 -0
- package/workflows/organizations/readModel/index.js.map +1 -0
- package/workflows/organizations/readModel/listLocalOrganizations.d.ts +20 -0
- package/workflows/organizations/readModel/listLocalOrganizations.js +137 -0
- package/workflows/organizations/readModel/listLocalOrganizations.js.map +1 -0
- package/workflows/organizations/readModel/localReadModelDetails.d.ts +25 -0
- package/workflows/organizations/readModel/localReadModelDetails.js +182 -0
- package/workflows/organizations/readModel/localReadModelDetails.js.map +1 -0
- package/workflows/organizations/readModel/organizationPresentationAccessState.js +173 -0
- package/workflows/organizations/readModel/organizationPresentationAccessState.js.map +1 -0
- package/workflows/organizations/readModel/organizationPresentationFailures.js +7 -0
- package/workflows/organizations/readModel/readModelProjection.d.ts +29 -0
- package/workflows/organizations/readModel/readModelProjection.js +255 -0
- package/workflows/organizations/readModel/readModelProjection.js.map +1 -0
- package/workflows/organizations/rematerialization/authoredPrincipalPolicyWarmer.js +25 -0
- package/workflows/organizations/rematerialization/authoredPrincipalPolicyWarmer.js.map +1 -0
- package/workflows/organizations/rematerialization/precedingPrincipalRematerialization.js +31 -0
- package/workflows/organizations/rematerialization/precedingPrincipalRematerialization.js.map +1 -0
- package/workflows/organizations/rematerialization/principalContainerRematerialization.js +321 -0
- package/workflows/organizations/rematerialization/principalContainerRematerialization.js.map +1 -0
- package/workflows/organizations/rematerialization/principalContainerRematerializationPlanning.js +77 -0
- package/workflows/organizations/rematerialization/principalContainerRematerializationPlanning.js.map +1 -0
- package/workflows/organizations/rematerialization/principalContainerRematerializationTargets.js +79 -0
- package/workflows/organizations/rematerialization/principalContainerRematerializationTargets.js.map +1 -0
- package/workflows/principals/acknowledgements/acknowledgedPrincipalCurrents.d.ts +33 -0
- package/workflows/principals/acknowledgements/acknowledgedPrincipalCurrents.js +140 -0
- package/workflows/principals/acknowledgements/acknowledgedPrincipalCurrents.js.map +1 -0
- package/workflows/principals/acknowledgements/acknowledgedPrincipalPredecessor.d.ts +39 -0
- package/workflows/principals/acknowledgements/acknowledgedPrincipalPredecessor.js +87 -0
- package/workflows/principals/acknowledgements/acknowledgedPrincipalPredecessor.js.map +1 -0
- package/workflows/principals/acknowledgements/initialPrincipalCurrentPublication.js +84 -0
- package/workflows/principals/acknowledgements/initialPrincipalCurrentPublication.js.map +1 -0
- package/workflows/principals/acknowledgements/principalAcknowledgementChecks.d.ts +30 -0
- package/workflows/principals/acknowledgements/principalCurrentPublicationSeal.js +51 -0
- package/workflows/principals/acknowledgements/principalCurrentPublicationSeal.js.map +1 -0
- package/workflows/principals/acknowledgements/reconcileAcknowledgedPrincipalCurrent.js +68 -0
- package/workflows/principals/acknowledgements/reconcileAcknowledgedPrincipalCurrent.js.map +1 -0
- package/workflows/principals/historyRecovery/loadRecoveredPrincipalHistoryPage.d.ts +10 -0
- package/workflows/principals/historyRecovery/loadRecoveredPrincipalHistoryPage.js +119 -0
- package/workflows/principals/historyRecovery/loadRecoveredPrincipalHistoryPage.js.map +1 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryAuthority.js +20 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryAuthority.js.map +1 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryPrefix.js +69 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryPrefix.js.map +1 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryReferences.js +68 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryReferences.js.map +1 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryStage.js +61 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryStage.js.map +1 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryTypes.d.ts +35 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryTypes.js +16 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryTypes.js.map +1 -0
- package/workflows/principals/historyRecovery/principalHistoryRecoveryVerification.js +29 -0
- package/workflows/principals/historyRecovery/recoverCurrentOrganizationPolicy.js +38 -0
- package/workflows/principals/historyRecovery/recoverCurrentOrganizationPolicy.js.map +1 -0
- package/workflows/principals/historyRecovery/recoverPrincipalHistoryPage.js +31 -0
- package/workflows/principals/historyRecovery/recoverPrincipalPolicyHistory.js +295 -0
- package/workflows/principals/historyRecovery/recoverPrincipalPolicyHistory.js.map +1 -0
- package/workflows/principals/historyRecovery/recoverScopedPrincipalPolicyHistory.d.ts +27 -0
- package/workflows/principals/historyRecovery/recoverScopedPrincipalPolicyHistory.js +163 -0
- package/workflows/principals/historyRecovery/recoverScopedPrincipalPolicyHistory.js.map +1 -0
- package/workflows/principals/index.d.ts +6 -6
- package/workflows/principals/index.js +6 -6
- package/workflows/principals/index.js.map +1 -1
- package/workflows/principals/policyCache/index.d.ts +20 -0
- package/workflows/principals/policyCache/index.js +242 -0
- package/workflows/principals/policyCache/index.js.map +1 -0
- package/workflows/principals/policyCache/principalPolicyCacheAdvance.js +39 -0
- package/workflows/principals/policyCache/principalPolicyCacheAdvance.js.map +1 -0
- package/workflows/principals/policyCache/principalPolicyCacheValidation.js +149 -0
- package/workflows/principals/policyCache/principalPolicyCacheValidation.js.map +1 -0
- package/workflows/principals/policyCache/principalPolicyOrganizationScope.js +67 -0
- package/workflows/principals/policyCache/principalPolicyOrganizationScope.js.map +1 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryAuthority.js +60 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryAuthority.js.map +1 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryPage.js +88 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryPage.js.map +1 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryProgress.js +179 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryProgress.js.map +1 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryTypes.d.ts +41 -0
- package/workflows/principals/publicHistory/publicPrincipalHistoryTypes.js.map +1 -0
- package/workflows/principals/publicHistory/publicProjectionDirectory.js +40 -0
- package/workflows/principals/publicHistory/publicProjectionDirectory.js.map +1 -0
- package/workflows/principals/publicHistory/publicProjectionPrincipal.js +54 -0
- package/workflows/principals/publicHistory/publicProjectionPrincipal.js.map +1 -0
- package/workflows/principals/publicHistory/recoverProjectionPolicyHistory.d.ts +9 -0
- package/workflows/principals/publicHistory/recoverProjectionPolicyHistory.js +98 -0
- package/workflows/principals/publicHistory/recoverProjectionPolicyHistory.js.map +1 -0
- package/workflows/principals/publicHistory/recoverPublicPrincipalHistory.js +178 -0
- package/workflows/principals/publicHistory/recoverPublicPrincipalHistory.js.map +1 -0
- package/workflows/principals/publicHistory/selectPublicPrincipalHistory.js +96 -0
- package/workflows/principals/publicHistory/selectPublicPrincipalHistory.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalCurrentRecoveryBatch.js +14 -0
- package/workflows/principals/recoveryOperation/principalCurrentRecoveryBatch.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalRecoveryDirectory.d.ts +10 -0
- package/workflows/principals/recoveryOperation/principalRecoveryDirectory.js +127 -0
- package/workflows/principals/recoveryOperation/principalRecoveryDirectory.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalRecoveryDiscoveryPage.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalRecoveryLocalPreference.js +30 -0
- package/workflows/principals/recoveryOperation/principalRecoveryLocalPreference.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalRecoveryMemo.d.ts +21 -0
- package/workflows/principals/recoveryOperation/principalRecoveryMemo.js +178 -0
- package/workflows/principals/recoveryOperation/principalRecoveryMemo.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalRecoveryMemoValidity.js +33 -0
- package/workflows/principals/recoveryOperation/principalRecoveryMemoValidity.js.map +1 -0
- package/workflows/principals/recoveryOperation/principalRecoveryOutage.js +40 -0
- package/workflows/principals/recoveryOperation/principalRecoveryOutage.js.map +1 -0
- package/workflows/principals/runtimePolicyRecovery.js +3 -3
- package/workflows/principals/runtimePolicyRecovery.js.map +1 -1
- package/workflows/principals/runtimeProjectionPolicyRecovery.js +3 -3
- package/workflows/principals/runtimeProjectionPolicyRecovery.js.map +1 -1
- package/workflows/registration/organizationProvisioningArtifacts.d.ts +1 -1
- package/workflows/registration/provisionedPrincipalHistory.js +1 -1
- package/workflows/registration/provisionedPrincipalHistory.js.map +1 -1
- package/workflows/registration/provisionedProfileDocument.js +1 -1
- package/workflows/registration/provisionedProfileDocument.js.map +1 -1
- package/workflows/registration/provisioningBootstrapBuilders.js +2 -2
- package/workflows/registration/provisioningBootstrapBuilders.js.map +1 -1
- package/workflows/registration/registerIdentity.js +2 -2
- package/workflows/registration/registerIdentity.js.map +1 -1
- package/workflows/sync/remoteReset.js +1 -1
- package/workflows/sync/remoteReset.js.map +1 -1
- package/workflows/blobs/attachmentBindingVerification.js +0 -49
- package/workflows/blobs/attachmentBindingVerification.js.map +0 -1
- package/workflows/blobs/attachmentDecryptor.js +0 -41
- package/workflows/blobs/attachmentDecryptor.js.map +0 -1
- package/workflows/blobs/attachmentKeyAuthenticator.js +0 -68
- package/workflows/blobs/attachmentKeyAuthenticator.js.map +0 -1
- package/workflows/blobs/automaticMultipartUpload.js +0 -9
- package/workflows/blobs/automaticMultipartUpload.js.map +0 -1
- package/workflows/blobs/blobChunkDecryption.js +0 -34
- package/workflows/blobs/blobChunkDecryption.js.map +0 -1
- package/workflows/blobs/decrypt.d.ts +0 -12
- package/workflows/blobs/decrypt.js +0 -246
- package/workflows/blobs/decrypt.js.map +0 -1
- package/workflows/blobs/hydrate.d.ts +0 -56
- package/workflows/blobs/hydrate.js +0 -190
- package/workflows/blobs/hydrate.js.map +0 -1
- package/workflows/blobs/hydrationResults.js +0 -23
- package/workflows/blobs/hydrationResults.js.map +0 -1
- package/workflows/blobs/multipartFirstParts.js +0 -82
- package/workflows/blobs/multipartFirstParts.js.map +0 -1
- package/workflows/blobs/multipartStageFailures.js +0 -36
- package/workflows/blobs/multipartStageFailures.js.map +0 -1
- package/workflows/blobs/multipartStageResolution.js.map +0 -1
- package/workflows/blobs/multipartUpload.js +0 -274
- package/workflows/blobs/multipartUpload.js.map +0 -1
- package/workflows/blobs/retainedAttachmentVerification.js +0 -40
- package/workflows/blobs/retainedAttachmentVerification.js.map +0 -1
- package/workflows/blobs/upload.d.ts +0 -10
- package/workflows/blobs/upload.js +0 -243
- package/workflows/blobs/upload.js.map +0 -1
- package/workflows/blobs/verifiedWrapScope.js +0 -20
- package/workflows/blobs/verifiedWrapScope.js.map +0 -1
- package/workflows/blobs/writerProjection.js +0 -29
- package/workflows/blobs/writerProjection.js.map +0 -1
- package/workflows/container-contents/availableDocumentLinkIntent.js +0 -32
- package/workflows/container-contents/availableDocumentLinkIntent.js.map +0 -1
- package/workflows/container-contents/blobInfo.d.ts +0 -6
- package/workflows/container-contents/blobInfo.js +0 -323
- package/workflows/container-contents/blobInfo.js.map +0 -1
- package/workflows/container-contents/blobInfoTypes.d.ts +0 -48
- package/workflows/container-contents/blobInfoTypes.js.map +0 -1
- package/workflows/container-contents/containerDocumentListing.js +0 -106
- package/workflows/container-contents/containerInfo.d.ts +0 -77
- package/workflows/container-contents/containerInfo.js +0 -200
- package/workflows/container-contents/containerInfo.js.map +0 -1
- package/workflows/container-contents/deferredDocumentLinks.js +0 -9
- package/workflows/container-contents/deferredDocumentLinks.js.map +0 -1
- package/workflows/container-contents/documentAttributionRanges.d.ts +0 -26
- package/workflows/container-contents/documentCharacterBlame.js +0 -33
- package/workflows/container-contents/documentCharacterBlame.js.map +0 -1
- package/workflows/container-contents/documentDiscovery.d.ts +0 -12
- package/workflows/container-contents/documentDiscovery.js +0 -183
- package/workflows/container-contents/documentDiscovery.js.map +0 -1
- package/workflows/container-contents/documentDiscoveryApply.js +0 -65
- package/workflows/container-contents/documentDiscoveryApply.js.map +0 -1
- package/workflows/container-contents/documentDiscoveryCandidates.js.map +0 -1
- package/workflows/container-contents/documentDiscoveryEvidence.js +0 -91
- package/workflows/container-contents/documentDiscoveryEvidence.js.map +0 -1
- package/workflows/container-contents/documentDiscoveryInputs.js +0 -85
- package/workflows/container-contents/documentDiscoveryInputs.js.map +0 -1
- package/workflows/container-contents/documentDiscoveryLanes.js.map +0 -1
- package/workflows/container-contents/documentDiscoveryTypes.d.ts +0 -160
- package/workflows/container-contents/documentDiscoveryTypes.js.map +0 -1
- package/workflows/container-contents/documentFieldBlame.js +0 -26
- package/workflows/container-contents/documentFieldBlame.js.map +0 -1
- package/workflows/container-contents/documentHydrationProbe.js +0 -146
- package/workflows/container-contents/documentHydrationProbe.js.map +0 -1
- package/workflows/container-contents/documentInfo.d.ts +0 -18
- package/workflows/container-contents/documentInfo.js +0 -306
- package/workflows/container-contents/documentInfo.js.map +0 -1
- package/workflows/container-contents/documentInfoTypes.d.ts +0 -92
- package/workflows/container-contents/documentInfoTypes.js.map +0 -1
- package/workflows/container-contents/documentLinkIntent.js +0 -82
- package/workflows/container-contents/documentLinkIntent.js.map +0 -1
- package/workflows/container-contents/documentLinks.d.ts +0 -64
- package/workflows/container-contents/documentLinks.js +0 -264
- package/workflows/container-contents/documentLinks.js.map +0 -1
- package/workflows/container-contents/documentLocalRelink.js.map +0 -1
- package/workflows/container-contents/documentMoveDeniedReplay.js.map +0 -1
- package/workflows/container-contents/documentMoveFailure.js +0 -35
- package/workflows/container-contents/documentMoveFailure.js.map +0 -1
- package/workflows/container-contents/documentMoveIntent.js +0 -77
- package/workflows/container-contents/documentMoveIntent.js.map +0 -1
- package/workflows/container-contents/documentMoveIntentErrors.js +0 -17
- package/workflows/container-contents/documentMoveIntentErrors.js.map +0 -1
- package/workflows/container-contents/documentMoveIntentSettlement.js +0 -25
- package/workflows/container-contents/documentMoveIntentSettlement.js.map +0 -1
- package/workflows/container-contents/documentMoveIntentSync.js +0 -346
- package/workflows/container-contents/documentMoveIntentSync.js.map +0 -1
- package/workflows/container-contents/documentMoveVanishedRefresh.js +0 -100
- package/workflows/container-contents/documentMoveVanishedRefresh.js.map +0 -1
- package/workflows/container-contents/documentPriming.js +0 -245
- package/workflows/container-contents/documentPriming.js.map +0 -1
- package/workflows/container-contents/documentPurge.d.ts +0 -37
- package/workflows/container-contents/documentPurge.js +0 -136
- package/workflows/container-contents/documentPurge.js.map +0 -1
- package/workflows/container-contents/documentQueries.d.ts +0 -62
- package/workflows/container-contents/documentQueries.js +0 -212
- package/workflows/container-contents/documentQueries.js.map +0 -1
- package/workflows/container-contents/documentRuntimeTargetSync.js.map +0 -1
- package/workflows/container-contents/documentStructure.d.ts +0 -53
- package/workflows/container-contents/documentStructure.js +0 -183
- package/workflows/container-contents/documentStructure.js.map +0 -1
- package/workflows/container-contents/documentStructureTypes.d.ts +0 -32
- package/workflows/container-contents/documentStructureTypes.js.map +0 -1
- package/workflows/container-contents/documentSubtreeQueries.js +0 -169
- package/workflows/container-contents/documentSubtreeQueries.js.map +0 -1
- package/workflows/container-contents/documentTombstoneEvidence.js +0 -173
- package/workflows/container-contents/documentTombstoneEvidence.js.map +0 -1
- package/workflows/container-contents/documentTombstoneGate.js +0 -94
- package/workflows/container-contents/documentTombstoneGate.js.map +0 -1
- package/workflows/container-contents/folderRecovery.d.ts +0 -19
- package/workflows/container-contents/folderRecovery.js +0 -32
- package/workflows/container-contents/folderRecovery.js.map +0 -1
- package/workflows/container-contents/metadata.d.ts +0 -25
- package/workflows/container-contents/metadata.js +0 -217
- package/workflows/container-contents/metadata.js.map +0 -1
- package/workflows/container-contents/metadataEvents.d.ts +0 -7
- package/workflows/container-contents/metadataEvents.js +0 -47
- package/workflows/container-contents/metadataEvents.js.map +0 -1
- package/workflows/container-contents/metadataIncomingUpdateIsolation.js +0 -40
- package/workflows/container-contents/metadataIncomingUpdateIsolation.js.map +0 -1
- package/workflows/container-contents/metadataMutationPreparation.d.ts +0 -75
- package/workflows/container-contents/metadataMutationPreparation.js +0 -177
- package/workflows/container-contents/metadataMutationPreparation.js.map +0 -1
- package/workflows/container-contents/metadataPersistence.d.ts +0 -34
- package/workflows/container-contents/metadataPersistence.js +0 -254
- package/workflows/container-contents/metadataPersistence.js.map +0 -1
- package/workflows/container-contents/metadataPullContinuationInvalidation.js +0 -65
- package/workflows/container-contents/metadataPullContinuationInvalidation.js.map +0 -1
- package/workflows/container-contents/metadataReadState.d.ts +0 -2
- package/workflows/container-contents/metadataReadState.js.map +0 -1
- package/workflows/container-contents/metadataRecord.js +0 -43
- package/workflows/container-contents/metadataRecord.js.map +0 -1
- package/workflows/container-contents/metadataRemoteSync.d.ts +0 -38
- package/workflows/container-contents/metadataRemoteSync.js +0 -91
- package/workflows/container-contents/metadataRemoteSync.js.map +0 -1
- package/workflows/container-contents/metadataStateInstallation.d.ts +0 -3
- package/workflows/container-contents/metadataStateInstallation.js.map +0 -1
- package/workflows/container-contents/metadataStateIsolation.js +0 -80
- package/workflows/container-contents/metadataStateIsolation.js.map +0 -1
- package/workflows/container-contents/metadataSyncErrors.js +0 -41
- package/workflows/container-contents/metadataSyncErrors.js.map +0 -1
- package/workflows/container-contents/metadataSyncSettlement.d.ts +0 -13
- package/workflows/container-contents/metadataSyncSettlement.js +0 -27
- package/workflows/container-contents/metadataSyncSettlement.js.map +0 -1
- package/workflows/container-contents/metadataTypes.d.ts +0 -54
- package/workflows/container-contents/metadataTypes.js.map +0 -1
- package/workflows/container-contents/orphanedDocumentSql.js +0 -39
- package/workflows/container-contents/orphanedDocumentSql.js.map +0 -1
- package/workflows/container-contents/pendingDownloads.d.ts +0 -12
- package/workflows/container-contents/pendingDownloads.js +0 -42
- package/workflows/container-contents/pendingDownloads.js.map +0 -1
- package/workflows/container-contents/pendingWrites.d.ts +0 -26
- package/workflows/container-contents/pendingWrites.js +0 -116
- package/workflows/container-contents/pendingWrites.js.map +0 -1
- package/workflows/container-contents/remoteContainerPageHydration.js +0 -244
- package/workflows/container-contents/remoteContainerPageHydration.js.map +0 -1
- package/workflows/container-contents/remoteContainerState.js +0 -263
- package/workflows/container-contents/remoteContainerState.js.map +0 -1
- package/workflows/container-contents/remoteHydration.d.ts +0 -28
- package/workflows/container-contents/remoteHydration.js +0 -302
- package/workflows/container-contents/remoteHydration.js.map +0 -1
- package/workflows/container-contents/staleRootRecovery.js +0 -111
- package/workflows/container-contents/staleRootRecovery.js.map +0 -1
- package/workflows/documents/attachmentPersistence.d.ts +0 -58
- package/workflows/documents/attachmentPersistence.js.map +0 -1
- package/workflows/documents/blobMutationLock.d.ts +0 -8
- package/workflows/documents/blobMutationLock.js +0 -35
- package/workflows/documents/blobMutationLock.js.map +0 -1
- package/workflows/documents/create.d.ts +0 -56
- package/workflows/documents/create.js +0 -258
- package/workflows/documents/create.js.map +0 -1
- package/workflows/documents/createAdoption.js +0 -100
- package/workflows/documents/createAdoption.js.map +0 -1
- package/workflows/documents/createProjection.d.ts +0 -14
- package/workflows/documents/createProjectionFetch.d.ts +0 -27
- package/workflows/documents/createProjectionFetch.js.map +0 -1
- package/workflows/documents/createResponse.js +0 -49
- package/workflows/documents/createResponse.js.map +0 -1
- package/workflows/documents/documentCreationPersistence.js +0 -16
- package/workflows/documents/documentCreationPersistence.js.map +0 -1
- package/workflows/documents/initialSync.js +0 -65
- package/workflows/documents/initialSync.js.map +0 -1
- package/workflows/documents/linkSet.d.ts +0 -20
- package/workflows/documents/linkSet.js +0 -290
- package/workflows/documents/linkSet.js.map +0 -1
- package/workflows/documents/linkSetAuthority.js +0 -61
- package/workflows/documents/linkSetAuthority.js.map +0 -1
- package/workflows/documents/linkSetBlobRewraps.js +0 -143
- package/workflows/documents/linkSetBlobRewraps.js.map +0 -1
- package/workflows/documents/linkSetProjectionSeed.js +0 -119
- package/workflows/documents/linkSetProjectionSeed.js.map +0 -1
- package/workflows/documents/linkSetRemote.d.ts +0 -23
- package/workflows/documents/linkSetRemote.js +0 -187
- package/workflows/documents/linkSetRemote.js.map +0 -1
- package/workflows/documents/orphanBlobReclaimState.js.map +0 -1
- package/workflows/documents/orphanBlobReclaims.d.ts +0 -6
- package/workflows/documents/orphanBlobReclaims.js +0 -143
- package/workflows/documents/orphanBlobReclaims.js.map +0 -1
- package/workflows/documents/persistedDocumentRemoval.d.ts +0 -44
- package/workflows/documents/persistedDocumentRemoval.js +0 -70
- package/workflows/documents/persistedDocumentRemoval.js.map +0 -1
- package/workflows/documents/purge.d.ts +0 -53
- package/workflows/documents/purge.js +0 -204
- package/workflows/documents/purge.js.map +0 -1
- package/workflows/documents/readOnlyProjectionFailure.js +0 -30
- package/workflows/documents/readOnlyProjectionFailure.js.map +0 -1
- package/workflows/documents/readOnlySync.d.ts +0 -71
- package/workflows/documents/readOnlySync.js +0 -269
- package/workflows/documents/readOnlySync.js.map +0 -1
- package/workflows/documents/reportDocumentSyncQuarantine.js.map +0 -1
- package/workflows/documents/subtreePurgeScope.d.ts +0 -8
- package/workflows/documents/subtreePurgeScope.js +0 -18
- package/workflows/documents/subtreePurgeScope.js.map +0 -1
- package/workflows/documents/sync.d.ts +0 -4
- package/workflows/documents/sync.js +0 -287
- package/workflows/documents/sync.js.map +0 -1
- package/workflows/documents/syncAbandon.js +0 -51
- package/workflows/documents/syncAbandon.js.map +0 -1
- package/workflows/documents/syncAttemptPlanning.js +0 -79
- package/workflows/documents/syncAttemptPlanning.js.map +0 -1
- package/workflows/documents/syncAttemptState.d.ts +0 -27
- package/workflows/documents/syncAttemptState.js.map +0 -1
- package/workflows/documents/syncAutomaticContainerRekeys.js +0 -119
- package/workflows/documents/syncAutomaticContainerRekeys.js.map +0 -1
- package/workflows/documents/syncContainerRekeyPreparation.js +0 -227
- package/workflows/documents/syncContainerRekeyPreparation.js.map +0 -1
- package/workflows/documents/syncContainerRekeyProjection.js +0 -79
- package/workflows/documents/syncContainerRekeyProjection.js.map +0 -1
- package/workflows/documents/syncContainerRekeys.js +0 -72
- package/workflows/documents/syncContainerRekeys.js.map +0 -1
- package/workflows/documents/syncContentKeys.d.ts +0 -39
- package/workflows/documents/syncContentKeys.js +0 -254
- package/workflows/documents/syncContentKeys.js.map +0 -1
- package/workflows/documents/syncFailureClassification.d.ts +0 -74
- package/workflows/documents/syncFailureClassification.js +0 -122
- package/workflows/documents/syncFailureClassification.js.map +0 -1
- package/workflows/documents/syncFailures.js +0 -252
- package/workflows/documents/syncFailures.js.map +0 -1
- package/workflows/documents/syncLane.d.ts +0 -20
- package/workflows/documents/syncLane.js +0 -94
- package/workflows/documents/syncLane.js.map +0 -1
- package/workflows/documents/syncPlanIdentity.js +0 -203
- package/workflows/documents/syncPlanIdentity.js.map +0 -1
- package/workflows/documents/syncPlanMaterial.js +0 -306
- package/workflows/documents/syncPlanMaterial.js.map +0 -1
- package/workflows/documents/syncPlanProjection.js.map +0 -1
- package/workflows/documents/syncPlanRequestBounds.js +0 -54
- package/workflows/documents/syncPlanRequestBounds.js.map +0 -1
- package/workflows/documents/syncPolicyRepair.js +0 -50
- package/workflows/documents/syncPolicyRepair.js.map +0 -1
- package/workflows/documents/syncRecoveryRekey.d.ts +0 -70
- package/workflows/documents/syncRecoveryRekey.js +0 -120
- package/workflows/documents/syncRecoveryRekey.js.map +0 -1
- package/workflows/documents/syncRekeyCommit.js +0 -18
- package/workflows/documents/syncRepairAbandon.js.map +0 -1
- package/workflows/documents/syncRepairAccess.js +0 -42
- package/workflows/documents/syncRepairAccess.js.map +0 -1
- package/workflows/documents/syncResponseResult.js +0 -134
- package/workflows/documents/syncResponseResult.js.map +0 -1
- package/workflows/documents/syncSubmittedResult.js +0 -119
- package/workflows/documents/syncSubmittedResult.js.map +0 -1
- package/workflows/documents/syncTrace.js +0 -148
- package/workflows/organizations/acknowledgedDirectoryBindings.js +0 -18
- package/workflows/organizations/acknowledgedDirectoryBindings.js.map +0 -1
- package/workflows/organizations/authoredPrincipalPolicyWarmer.js +0 -25
- package/workflows/organizations/authoredPrincipalPolicyWarmer.js.map +0 -1
- package/workflows/organizations/commitCurrentGroupPolicyMutation.js +0 -139
- package/workflows/organizations/commitCurrentGroupPolicyMutation.js.map +0 -1
- package/workflows/organizations/createCurrentOrganizationGroup.js +0 -85
- package/workflows/organizations/createCurrentOrganizationGroup.js.map +0 -1
- package/workflows/organizations/createOrganization.d.ts +0 -62
- package/workflows/organizations/createOrganization.js +0 -128
- package/workflows/organizations/createOrganization.js.map +0 -1
- package/workflows/organizations/currentGroupMetadataAuthority.js +0 -53
- package/workflows/organizations/currentGroupMetadataAuthority.js.map +0 -1
- package/workflows/organizations/currentGroupMutationReferences.js +0 -35
- package/workflows/organizations/currentGroupMutationReferences.js.map +0 -1
- package/workflows/organizations/currentGroupPolicyMutationContext.js +0 -79
- package/workflows/organizations/currentGroupPolicyMutationContext.js.map +0 -1
- package/workflows/organizations/currentOrganizationGroupNames.js +0 -72
- package/workflows/organizations/currentOrganizationGroupNames.js.map +0 -1
- package/workflows/organizations/currentOrganizationMutationAuthority.js +0 -16
- package/workflows/organizations/currentOrganizationMutationAuthority.js.map +0 -1
- package/workflows/organizations/currentOrganizationMutationRetention.js +0 -64
- package/workflows/organizations/currentOrganizationMutationRetention.js.map +0 -1
- package/workflows/organizations/currentPolicyMutationAcknowledgement.js +0 -65
- package/workflows/organizations/currentPolicyMutationAcknowledgement.js.map +0 -1
- package/workflows/organizations/currentPrincipalMutationLease.js +0 -39
- package/workflows/organizations/currentPrincipalMutationLease.js.map +0 -1
- package/workflows/organizations/dataUsageReadModel.d.ts +0 -19
- package/workflows/organizations/dataUsageReadModel.js +0 -64
- package/workflows/organizations/dataUsageReadModel.js.map +0 -1
- package/workflows/organizations/deleteCurrentOrganizationGroup.js +0 -35
- package/workflows/organizations/deleteCurrentOrganizationGroup.js.map +0 -1
- package/workflows/organizations/deleteOrganizationGroup.d.ts +0 -19
- package/workflows/organizations/deleteOrganizationGroup.js +0 -75
- package/workflows/organizations/deleteOrganizationGroup.js.map +0 -1
- package/workflows/organizations/groupCreation.d.ts +0 -21
- package/workflows/organizations/groupCreation.js +0 -68
- package/workflows/organizations/groupCreation.js.map +0 -1
- package/workflows/organizations/groupMembershipName.d.ts +0 -8
- package/workflows/organizations/groupMembershipName.js +0 -18
- package/workflows/organizations/groupMembershipName.js.map +0 -1
- package/workflows/organizations/groupMetadataAccess.d.ts +0 -33
- package/workflows/organizations/groupMetadataAccess.js +0 -114
- package/workflows/organizations/groupMetadataAccess.js.map +0 -1
- package/workflows/organizations/groupMetadataBinding.js +0 -19
- package/workflows/organizations/groupMetadataBinding.js.map +0 -1
- package/workflows/organizations/groupMetadataContainerAuthority.js +0 -41
- package/workflows/organizations/groupMetadataContainerAuthority.js.map +0 -1
- package/workflows/organizations/groupMetadataErrors.js +0 -40
- package/workflows/organizations/groupMetadataRootBinding.js +0 -51
- package/workflows/organizations/groupMetadataRootBinding.js.map +0 -1
- package/workflows/organizations/groupMetadataRuntime.js +0 -47
- package/workflows/organizations/groupMetadataRuntime.js.map +0 -1
- package/workflows/organizations/groupNameUniqueness.js +0 -151
- package/workflows/organizations/groupNameUniqueness.js.map +0 -1
- package/workflows/organizations/groupPolicyHistoryPage.js.map +0 -1
- package/workflows/organizations/groupPolicyMutationAcknowledgement.js +0 -174
- package/workflows/organizations/groupPolicyMutationAcknowledgement.js.map +0 -1
- package/workflows/organizations/groupPolicyMutationContext.d.ts +0 -58
- package/workflows/organizations/groupPolicyMutationContext.js +0 -166
- package/workflows/organizations/groupPolicyMutationContext.js.map +0 -1
- package/workflows/organizations/groupPolicyMutationEvidence.d.ts +0 -26
- package/workflows/organizations/groupPolicyMutationEvidence.js +0 -64
- package/workflows/organizations/groupPolicyMutationEvidence.js.map +0 -1
- package/workflows/organizations/groupPolicyMutationHead.js +0 -26
- package/workflows/organizations/groupPolicyRequests.js +0 -181
- package/workflows/organizations/groupPolicyRequests.js.map +0 -1
- package/workflows/organizations/groupPolicyVerification.js +0 -74
- package/workflows/organizations/groupPolicyVerification.js.map +0 -1
- package/workflows/organizations/listLocalOrganizations.d.ts +0 -20
- package/workflows/organizations/listLocalOrganizations.js +0 -137
- package/workflows/organizations/listLocalOrganizations.js.map +0 -1
- package/workflows/organizations/loadPolicyHistoryDetails.js +0 -78
- package/workflows/organizations/loadPolicyHistoryDetails.js.map +0 -1
- package/workflows/organizations/localReadModelDetails.d.ts +0 -25
- package/workflows/organizations/localReadModelDetails.js +0 -182
- package/workflows/organizations/localReadModelDetails.js.map +0 -1
- package/workflows/organizations/organizationGroupDirectory.js +0 -153
- package/workflows/organizations/organizationGroupDirectory.js.map +0 -1
- package/workflows/organizations/organizationGroupNamePolicies.js +0 -48
- package/workflows/organizations/organizationGroupNamePolicies.js.map +0 -1
- package/workflows/organizations/organizationGroupNames.js +0 -13
- package/workflows/organizations/organizationGroupNames.js.map +0 -1
- package/workflows/organizations/organizationPolicyHistoryDetails.js +0 -110
- package/workflows/organizations/organizationPolicyHistoryDetails.js.map +0 -1
- package/workflows/organizations/organizationPolicyHistoryVerification.js +0 -67
- package/workflows/organizations/organizationPolicyHistoryVerification.js.map +0 -1
- package/workflows/organizations/organizationPresentationAccessState.js +0 -173
- package/workflows/organizations/organizationPresentationAccessState.js.map +0 -1
- package/workflows/organizations/organizationPresentationFailures.js +0 -7
- package/workflows/organizations/organizationProvisioningAttempt.d.ts +0 -36
- package/workflows/organizations/organizationProvisioningAttempt.js +0 -205
- package/workflows/organizations/organizationProvisioningAttempt.js.map +0 -1
- package/workflows/organizations/organizationReplacementVerification.js +0 -26
- package/workflows/organizations/organizationReplacementVerification.js.map +0 -1
- package/workflows/organizations/policyHistoryAccessDenial.js +0 -19
- package/workflows/organizations/policyHistoryAccessDenial.js.map +0 -1
- package/workflows/organizations/policyHistoryCache.js +0 -42
- package/workflows/organizations/policyHistoryCache.js.map +0 -1
- package/workflows/organizations/policyHistoryReadModel.d.ts +0 -9
- package/workflows/organizations/policyHistoryTypes.d.ts +0 -58
- package/workflows/organizations/precedingPrincipalRematerialization.js +0 -31
- package/workflows/organizations/precedingPrincipalRematerialization.js.map +0 -1
- package/workflows/organizations/principalContainerRematerialization.js +0 -321
- package/workflows/organizations/principalContainerRematerialization.js.map +0 -1
- package/workflows/organizations/principalContainerRematerializationPlanning.js +0 -77
- package/workflows/organizations/principalContainerRematerializationPlanning.js.map +0 -1
- package/workflows/organizations/principalContainerRematerializationTargets.js +0 -79
- package/workflows/organizations/principalContainerRematerializationTargets.js.map +0 -1
- package/workflows/organizations/principalMutationJournalManagement.d.ts +0 -26
- package/workflows/organizations/principalMutationJournalManagement.js +0 -104
- package/workflows/organizations/principalMutationJournalManagement.js.map +0 -1
- package/workflows/organizations/principalMutationJournalSession.d.ts +0 -26
- package/workflows/organizations/principalMutationJournalSession.js +0 -85
- package/workflows/organizations/principalMutationJournalSession.js.map +0 -1
- package/workflows/organizations/principalMutationReceipt.js +0 -28
- package/workflows/organizations/principalMutationReceipt.js.map +0 -1
- package/workflows/organizations/principalOperationReceipt.d.ts +0 -5
- package/workflows/organizations/principalOperationReceipt.js +0 -36
- package/workflows/organizations/principalOperationReceipt.js.map +0 -1
- package/workflows/organizations/principalPolicy.d.ts +0 -98
- package/workflows/organizations/principalPolicy.js +0 -256
- package/workflows/organizations/principalPolicy.js.map +0 -1
- package/workflows/organizations/principalPolicyApi.d.ts +0 -33
- package/workflows/organizations/principalPolicyApi.js.map +0 -1
- package/workflows/organizations/principalPolicyReceiptArtifacts.js +0 -74
- package/workflows/organizations/principalPolicyReceiptArtifacts.js.map +0 -1
- package/workflows/organizations/principalPolicyRecipients.js +0 -43
- package/workflows/organizations/principalPolicyRecipients.js.map +0 -1
- package/workflows/organizations/principalPolicyRequest.d.ts +0 -68
- package/workflows/organizations/principalPolicyRequest.js +0 -176
- package/workflows/organizations/readModel.d.ts +0 -70
- package/workflows/organizations/readModel.js +0 -10
- package/workflows/organizations/readModel.js.map +0 -1
- package/workflows/organizations/readModelProjection.d.ts +0 -29
- package/workflows/organizations/readModelProjection.js +0 -255
- package/workflows/organizations/readModelProjection.js.map +0 -1
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.d.ts +0 -6
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.js +0 -20
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.js.map +0 -1
- package/workflows/organizations/runtimeCurrentGroupMutation.js +0 -113
- package/workflows/organizations/runtimeCurrentGroupMutation.js.map +0 -1
- package/workflows/organizations/runtimeCurrentOrganizationMutation.js +0 -48
- package/workflows/organizations/runtimeCurrentOrganizationMutation.js.map +0 -1
- package/workflows/organizations/runtimeGroupMetadataAuthority.js +0 -16
- package/workflows/organizations/runtimeGroupMetadataAuthority.js.map +0 -1
- package/workflows/organizations/submitGroupPolicyCommit.d.ts +0 -22
- package/workflows/organizations/submitGroupPolicyCommit.js +0 -71
- package/workflows/organizations/submitGroupPolicyCommit.js.map +0 -1
- package/workflows/principals/acknowledgedPrincipalCurrents.d.ts +0 -33
- package/workflows/principals/acknowledgedPrincipalCurrents.js +0 -140
- package/workflows/principals/acknowledgedPrincipalCurrents.js.map +0 -1
- package/workflows/principals/acknowledgedPrincipalPredecessor.d.ts +0 -39
- package/workflows/principals/acknowledgedPrincipalPredecessor.js +0 -87
- package/workflows/principals/acknowledgedPrincipalPredecessor.js.map +0 -1
- package/workflows/principals/initialPrincipalCurrentPublication.js +0 -84
- package/workflows/principals/initialPrincipalCurrentPublication.js.map +0 -1
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.d.ts +0 -10
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.js +0 -119
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.js.map +0 -1
- package/workflows/principals/policyCache.d.ts +0 -20
- package/workflows/principals/policyCache.js +0 -242
- package/workflows/principals/policyCache.js.map +0 -1
- package/workflows/principals/principalAcknowledgementChecks.d.ts +0 -30
- package/workflows/principals/principalCurrentPublicationSeal.js +0 -51
- package/workflows/principals/principalCurrentPublicationSeal.js.map +0 -1
- package/workflows/principals/principalCurrentRecoveryBatch.js +0 -14
- package/workflows/principals/principalCurrentRecoveryBatch.js.map +0 -1
- package/workflows/principals/principalHistoryRecoveryAuthority.js +0 -20
- package/workflows/principals/principalHistoryRecoveryAuthority.js.map +0 -1
- package/workflows/principals/principalHistoryRecoveryPrefix.js +0 -69
- package/workflows/principals/principalHistoryRecoveryPrefix.js.map +0 -1
- package/workflows/principals/principalHistoryRecoveryReferences.js +0 -68
- package/workflows/principals/principalHistoryRecoveryReferences.js.map +0 -1
- package/workflows/principals/principalHistoryRecoveryStage.js +0 -61
- package/workflows/principals/principalHistoryRecoveryStage.js.map +0 -1
- package/workflows/principals/principalHistoryRecoveryTypes.d.ts +0 -35
- package/workflows/principals/principalHistoryRecoveryTypes.js +0 -16
- package/workflows/principals/principalHistoryRecoveryTypes.js.map +0 -1
- package/workflows/principals/principalHistoryRecoveryVerification.js +0 -29
- package/workflows/principals/principalPolicyCacheAdvance.js +0 -39
- package/workflows/principals/principalPolicyCacheAdvance.js.map +0 -1
- package/workflows/principals/principalPolicyCacheValidation.js +0 -149
- package/workflows/principals/principalPolicyCacheValidation.js.map +0 -1
- package/workflows/principals/principalPolicyOrganizationScope.js +0 -67
- package/workflows/principals/principalPolicyOrganizationScope.js.map +0 -1
- package/workflows/principals/principalRecoveryDirectory.d.ts +0 -10
- package/workflows/principals/principalRecoveryDirectory.js +0 -127
- package/workflows/principals/principalRecoveryDirectory.js.map +0 -1
- package/workflows/principals/principalRecoveryDiscoveryPage.js.map +0 -1
- package/workflows/principals/principalRecoveryLocalPreference.js +0 -30
- package/workflows/principals/principalRecoveryLocalPreference.js.map +0 -1
- package/workflows/principals/principalRecoveryMemo.d.ts +0 -21
- package/workflows/principals/principalRecoveryMemo.js +0 -178
- package/workflows/principals/principalRecoveryMemo.js.map +0 -1
- package/workflows/principals/principalRecoveryMemoValidity.js +0 -33
- package/workflows/principals/principalRecoveryMemoValidity.js.map +0 -1
- package/workflows/principals/principalRecoveryOutage.js +0 -40
- package/workflows/principals/principalRecoveryOutage.js.map +0 -1
- package/workflows/principals/publicPrincipalHistoryAuthority.js +0 -60
- package/workflows/principals/publicPrincipalHistoryAuthority.js.map +0 -1
- package/workflows/principals/publicPrincipalHistoryPage.js +0 -88
- package/workflows/principals/publicPrincipalHistoryPage.js.map +0 -1
- package/workflows/principals/publicPrincipalHistoryProgress.js +0 -179
- package/workflows/principals/publicPrincipalHistoryProgress.js.map +0 -1
- package/workflows/principals/publicPrincipalHistoryTypes.d.ts +0 -41
- package/workflows/principals/publicPrincipalHistoryTypes.js.map +0 -1
- package/workflows/principals/publicProjectionDirectory.js +0 -40
- package/workflows/principals/publicProjectionDirectory.js.map +0 -1
- package/workflows/principals/publicProjectionPrincipal.js +0 -54
- package/workflows/principals/publicProjectionPrincipal.js.map +0 -1
- package/workflows/principals/reconcileAcknowledgedPrincipalCurrent.js +0 -68
- package/workflows/principals/reconcileAcknowledgedPrincipalCurrent.js.map +0 -1
- package/workflows/principals/recoverCurrentOrganizationPolicy.js +0 -38
- package/workflows/principals/recoverCurrentOrganizationPolicy.js.map +0 -1
- package/workflows/principals/recoverPrincipalHistoryPage.js +0 -31
- package/workflows/principals/recoverPrincipalPolicyHistory.js +0 -295
- package/workflows/principals/recoverPrincipalPolicyHistory.js.map +0 -1
- package/workflows/principals/recoverProjectionPolicyHistory.d.ts +0 -9
- package/workflows/principals/recoverProjectionPolicyHistory.js +0 -98
- package/workflows/principals/recoverProjectionPolicyHistory.js.map +0 -1
- package/workflows/principals/recoverPublicPrincipalHistory.js +0 -178
- package/workflows/principals/recoverPublicPrincipalHistory.js.map +0 -1
- package/workflows/principals/recoverScopedPrincipalPolicyHistory.d.ts +0 -27
- package/workflows/principals/recoverScopedPrincipalPolicyHistory.js +0 -163
- package/workflows/principals/recoverScopedPrincipalPolicyHistory.js.map +0 -1
- package/workflows/principals/selectPublicPrincipalHistory.js +0 -96
- package/workflows/principals/selectPublicPrincipalHistory.js.map +0 -1
- /package/workflows/blobs/{readAttachmentTransfer.js → hydration/readAttachmentTransfer.js} +0 -0
- /package/workflows/blobs/{readAttachmentTransfer.js.map → hydration/readAttachmentTransfer.js.map} +0 -0
- /package/workflows/blobs/{multipartStageResolution.js → upload/multipartStageResolution.js} +0 -0
- /package/workflows/container-contents/{documentAttributionRanges.js → attribution/documentAttributionRanges.js} +0 -0
- /package/workflows/container-contents/{documentAttributionRanges.js.map → attribution/documentAttributionRanges.js.map} +0 -0
- /package/workflows/container-contents/{containerDocumentListing.js.map → documentDiscovery/containerDocumentListing.js.map} +0 -0
- /package/workflows/container-contents/{documentDiscoveryCandidates.js → documentDiscovery/documentDiscoveryCandidates.js} +0 -0
- /package/workflows/container-contents/{documentDiscoveryLanes.js → documentDiscovery/documentDiscoveryLanes.js} +0 -0
- /package/workflows/container-contents/{documentDiscoveryTypes.js → documentDiscovery/documentDiscoveryTypes.js} +0 -0
- /package/workflows/container-contents/{documentHeadScope.js → documentDiscovery/documentHeadScope.js} +0 -0
- /package/workflows/container-contents/{documentHeadScope.js.map → documentDiscovery/documentHeadScope.js.map} +0 -0
- /package/workflows/container-contents/{documentLocalRelink.js → documentLinks/documentLocalRelink.js} +0 -0
- /package/workflows/container-contents/{documentMoveDeniedReplay.js → documentMove/documentMoveDeniedReplay.js} +0 -0
- /package/workflows/container-contents/{documentMoveUnlinkIds.js → documentMove/documentMoveUnlinkIds.js} +0 -0
- /package/workflows/container-contents/{documentMoveUnlinkIds.js.map → documentMove/documentMoveUnlinkIds.js.map} +0 -0
- /package/workflows/container-contents/{documentRuntimeTargetSync.js → documentPriming/documentRuntimeTargetSync.js} +0 -0
- /package/workflows/container-contents/{documentStructureTypes.js → documentQueries/documentStructureTypes.js} +0 -0
- /package/workflows/container-contents/{blobInfoRows.js → info/blobInfoRows.js} +0 -0
- /package/workflows/container-contents/{blobInfoRows.js.map → info/blobInfoRows.js.map} +0 -0
- /package/workflows/container-contents/{blobInfoTypes.js → info/blobInfoTypes.js} +0 -0
- /package/workflows/container-contents/{documentInfoTypes.js → info/documentInfoTypes.js} +0 -0
- /package/workflows/container-contents/{metadataReadState.js → metadata/metadataReadState.js} +0 -0
- /package/workflows/container-contents/{metadataStateInstallation.js → metadata/metadataStateInstallation.js} +0 -0
- /package/workflows/container-contents/{metadataSyncFollowup.js → metadata/metadataSyncFollowup.js} +0 -0
- /package/workflows/container-contents/{metadataSyncFollowup.js.map → metadata/metadataSyncFollowup.js.map} +0 -0
- /package/workflows/container-contents/{metadataSyncRegistrations.d.ts → metadata/metadataSyncRegistrations.d.ts} +0 -0
- /package/workflows/container-contents/{metadataSyncRegistrations.js → metadata/metadataSyncRegistrations.js} +0 -0
- /package/workflows/container-contents/{metadataSyncRegistrations.js.map → metadata/metadataSyncRegistrations.js.map} +0 -0
- /package/workflows/container-contents/{metadataTypes.js → metadata/metadataTypes.js} +0 -0
- /package/workflows/container-contents/{pendingWritesTypes.d.ts → pendingWrites/pendingWritesTypes.d.ts} +0 -0
- /package/workflows/container-contents/{pendingWritesTypes.js → pendingWrites/pendingWritesTypes.js} +0 -0
- /package/workflows/container-contents/{pendingWritesTypes.js.map → pendingWrites/pendingWritesTypes.js.map} +0 -0
- /package/workflows/container-contents/{remoteHydrationLog.js → remoteHydration/remoteHydrationLog.js} +0 -0
- /package/workflows/container-contents/{remoteHydrationLog.js.map → remoteHydration/remoteHydrationLog.js.map} +0 -0
- /package/workflows/documents/{attachmentPersistence.js → attachments/attachmentPersistence.js} +0 -0
- /package/workflows/documents/{orphanBlobReclaimState.js → attachments/orphanBlobReclaimState.js} +0 -0
- /package/workflows/documents/{createProjection.js → create/createProjection.js} +0 -0
- /package/workflows/documents/{createProjection.js.map → create/createProjection.js.map} +0 -0
- /package/workflows/documents/{createProjectionFetch.js → create/createProjectionFetch.js} +0 -0
- /package/workflows/documents/{reportDocumentSyncQuarantine.js → sync/reportDocumentSyncQuarantine.js} +0 -0
- /package/workflows/documents/{syncAttemptState.js → sync/syncAttemptState.js} +0 -0
- /package/workflows/documents/{syncTrace.d.ts → sync/syncTrace.d.ts} +0 -0
- /package/workflows/documents/{syncTrace.js.map → sync/syncTrace.js.map} +0 -0
- /package/workflows/documents/{syncFailureClearance.d.ts → syncFailures/syncFailureClearance.d.ts} +0 -0
- /package/workflows/documents/{syncFailureClearance.js → syncFailures/syncFailureClearance.js} +0 -0
- /package/workflows/documents/{syncFailureClearance.js.map → syncFailures/syncFailureClearance.js.map} +0 -0
- /package/workflows/documents/{syncRepairAbandon.js → syncFailures/syncRepairAbandon.js} +0 -0
- /package/workflows/documents/{syncPlanProjection.js → syncPlan/syncPlanProjection.js} +0 -0
- /package/workflows/documents/{syncRekeyCommit.js.map → syncRekeys/syncRekeyCommit.js.map} +0 -0
- /package/workflows/organizations/{groupMetadataErrors.js.map → groupMetadata/groupMetadataErrors.js.map} +0 -0
- /package/workflows/organizations/{groupMutationAuthorization.js → groupPolicy/groupMutationAuthorization.js} +0 -0
- /package/workflows/organizations/{groupMutationAuthorization.js.map → groupPolicy/groupMutationAuthorization.js.map} +0 -0
- /package/workflows/organizations/{groupPolicyMutationHead.js.map → groupPolicy/groupPolicyMutationHead.js.map} +0 -0
- /package/workflows/organizations/{groupPolicyHistoryPage.js → policyHistory/groupPolicyHistoryPage.js} +0 -0
- /package/workflows/organizations/{policyHistoryReadModel.js → policyHistory/policyHistoryReadModel.js} +0 -0
- /package/workflows/organizations/{policyHistoryReadModel.js.map → policyHistory/policyHistoryReadModel.js.map} +0 -0
- /package/workflows/organizations/{policyHistoryTypes.js → policyHistory/policyHistoryTypes.js} +0 -0
- /package/workflows/organizations/{policyHistoryTypes.js.map → policyHistory/policyHistoryTypes.js.map} +0 -0
- /package/workflows/organizations/{principalPolicyApi.js → principalPolicy/principalPolicyApi.js} +0 -0
- /package/workflows/organizations/{principalPolicyRequest.js.map → principalPolicy/principalPolicyRequest.js.map} +0 -0
- /package/workflows/organizations/{organizationPresentationFailures.js.map → readModel/organizationPresentationFailures.js.map} +0 -0
- /package/workflows/principals/{principalAcknowledgementChecks.js → acknowledgements/principalAcknowledgementChecks.js} +0 -0
- /package/workflows/principals/{principalAcknowledgementChecks.js.map → acknowledgements/principalAcknowledgementChecks.js.map} +0 -0
- /package/workflows/principals/{principalHistoryRecoveryVerification.js.map → historyRecovery/principalHistoryRecoveryVerification.js.map} +0 -0
- /package/workflows/principals/{recoverPrincipalHistoryPage.js.map → historyRecovery/recoverPrincipalHistoryPage.js.map} +0 -0
- /package/workflows/principals/{recoverPrincipalPolicyHistory.d.ts → historyRecovery/recoverPrincipalPolicyHistory.d.ts} +0 -0
- /package/workflows/principals/{principalPolicyCacheScope.js → policyCache/principalPolicyCacheScope.js} +0 -0
- /package/workflows/principals/{principalPolicyCacheScope.js.map → policyCache/principalPolicyCacheScope.js.map} +0 -0
- /package/workflows/principals/{publicPrincipalHistoryTypes.js → publicHistory/publicPrincipalHistoryTypes.js} +0 -0
- /package/workflows/principals/{principalRecoveryDiscoveryPage.js → recoveryOperation/principalRecoveryDiscoveryPage.js} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { DocumentWriterProjectionResponse } from "../../../internal/validators/response/index.js";
|
|
2
|
+
import type { DocumentSyncUpdateIsolationError, IncomingDocumentSyncUpdateValidator } from "../../../data/documents/shared/documentSyncUpdateIsolation.js";
|
|
3
|
+
import { type DocumentSyncPullContinuation } from "../../../data/documents/shared/syncPagination.js";
|
|
4
|
+
import type { DocumentCreateAuthor, DocumentSyncApi, DocumentWriterPublicKeyResolver, PersistedDocumentSyncState, SyncRemoteDocumentResult } from "../../../data/documents/shared/types.js";
|
|
5
|
+
import type { ProjectionUserKeyResolver, ReferencedPrincipalPolicyWarmer } from "../../../data/keyingProjectionVerification/index.js";
|
|
6
|
+
import type { PendingUpdateRecord } from "../../../data/sqlite/documentPersistence.js";
|
|
7
|
+
import type { ExecSql } from "../../../data/sqlite/sqlSchema.js";
|
|
8
|
+
import { type RemoteDocumentDeletionHandler, type TerminalSubmitFailureHandler } from "../syncFailures/syncFailureClassification.js";
|
|
9
|
+
import type { RekeyPendingUpdate } from "../syncRekeys/syncRecoveryRekey.js";
|
|
10
|
+
import type { DocumentSyncContainerRekeyBuilder } from "./syncAttemptState.js";
|
|
11
|
+
import { type DocumentSyncTraceEmitter } from "./syncTrace.js";
|
|
12
|
+
type PersistedReadOnlyDocumentSyncResult = {
|
|
13
|
+
kind: "completed";
|
|
14
|
+
result: SyncRemoteDocumentResult | null;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "not_completed";
|
|
17
|
+
};
|
|
18
|
+
export interface SyncRemoteDocumentInput {
|
|
19
|
+
apiClient: DocumentSyncApi;
|
|
20
|
+
author: DocumentCreateAuthor;
|
|
21
|
+
/**
|
|
22
|
+
* Supplies a full-history Loro snapshot of the local document so a
|
|
23
|
+
* write-bearing pass can heal a stale content-key bundle by rotating to a
|
|
24
|
+
* fresh content key anchored by a rotation baseline.
|
|
25
|
+
*/
|
|
26
|
+
buildRotationSnapshot?: (() => Promise<Uint8Array | null>) | undefined;
|
|
27
|
+
/** Overrides automatic ancestor repair for each submission's current projection. */
|
|
28
|
+
buildContainerRekeys?: DocumentSyncContainerRekeyBuilder;
|
|
29
|
+
documentId: string;
|
|
30
|
+
execSql: ExecSql;
|
|
31
|
+
/** Explicit read-only recovery that bypasses rotation-baseline redirect. */
|
|
32
|
+
historyMode?: "raw" | undefined;
|
|
33
|
+
isRemoteSyncBlocked?: ((organizationId: string) => boolean) | undefined;
|
|
34
|
+
localVersionVector: string | null;
|
|
35
|
+
minLsn?: string | undefined;
|
|
36
|
+
pullContinuation?: DocumentSyncPullContinuation | undefined;
|
|
37
|
+
/** Atomically commits the verified purge proof with matching local teardown. */
|
|
38
|
+
onRemoteDocumentDeleted?: RemoteDocumentDeletionHandler | undefined;
|
|
39
|
+
onSyncAbandoned?: ((reason: string) => void) | undefined;
|
|
40
|
+
/** Clipboard-safe trace sink (see syncTrace.ts); never receives content. */
|
|
41
|
+
onSyncTrace?: DocumentSyncTraceEmitter | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Fires when a pass WITHOUT queued writes cannot resolve its writer
|
|
44
|
+
* projection (e.g. a coded 409 from the projection route). Read-only
|
|
45
|
+
* revalidation otherwise fails silently — one burned request and a trace
|
|
46
|
+
* line — leaving the document permanently stale with nothing durable to
|
|
47
|
+
* explain why (edge-case row 13).
|
|
48
|
+
*/
|
|
49
|
+
onReadOnlyProjectionFailure?: TerminalSubmitFailureHandler | undefined;
|
|
50
|
+
/** Records a verified response update that could not be decrypted/imported. */
|
|
51
|
+
onIncomingUpdateIsolationFailure?: ((failure: DocumentSyncUpdateIsolationError) => void | Promise<void>) | undefined;
|
|
52
|
+
/** Fires immediately before a materialized outgoing batch is submitted. */
|
|
53
|
+
onOutgoingUpdatesMaterialized?: ((updateIds: readonly string[]) => void) | undefined;
|
|
54
|
+
/** Invalidates continuation state after the server rejects its snapshot. */
|
|
55
|
+
onPullContinuationInvalidated?: ((continuation: DocumentSyncPullContinuation) => void | Promise<void>) | undefined;
|
|
56
|
+
onTerminalSubmitFailure?: TerminalSubmitFailureHandler | undefined;
|
|
57
|
+
pendingUpdates?: readonly PendingUpdateRecord[] | undefined;
|
|
58
|
+
persistedState?: PersistedDocumentSyncState | null | undefined;
|
|
59
|
+
rekeyPendingUpdate?: RekeyPendingUpdate | undefined;
|
|
60
|
+
resolveProjectionUserKey: ProjectionUserKeyResolver;
|
|
61
|
+
resolveWriterPublicKey: DocumentWriterPublicKeyResolver;
|
|
62
|
+
signedAt?: string | undefined;
|
|
63
|
+
stillCurrent?: (() => boolean) | undefined;
|
|
64
|
+
targetSecretKey: Uint8Array;
|
|
65
|
+
/** Validates decrypted updates against scratch state before callers persist. */
|
|
66
|
+
validateIncomingUpdates: IncomingDocumentSyncUpdateValidator;
|
|
67
|
+
warmReferencedPrincipalPolicies?: ReferencedPrincipalPolicyWarmer | undefined;
|
|
68
|
+
writerProjection?: DocumentWriterProjectionResponse | undefined;
|
|
69
|
+
}
|
|
70
|
+
export declare function tryPersistedReadOnlyDocumentSync(input: SyncRemoteDocumentInput, resolveProjectionUserKey: ProjectionUserKeyResolver): Promise<PersistedReadOnlyDocumentSyncResult | null>;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { isAccessManifestBundleWireResponse, isDocumentContentKeyBundleResponse, isDocumentKekTargetsResponse, } from "../../../internal/validators/response/index.js";
|
|
2
|
+
import { isRetryableDocumentSyncConflict, persistedDocumentSyncStateFromResponse, submitDocumentSync, } from "../../../data/documents/shared/responses.js";
|
|
3
|
+
import { resolvePullContinuationMinLsn, } from "../../../data/documents/shared/syncPagination.js";
|
|
4
|
+
import { projectionVerificationOptions } from "../../../data/documents/shared/types.js";
|
|
5
|
+
import { readCanonicalRecord } from "../../../data/keying/canonicalJson.js";
|
|
6
|
+
import { limitDocumentSyncRequestBytes } from "../../../data/sync/documentSyncOutgoingBatch.js";
|
|
7
|
+
import { assertRawContinuationCanRetry, refreshSyncAttemptWriterProjection, resolveSyncAttemptWriterProjection, } from "../syncFailures/index.js";
|
|
8
|
+
import { handleUpstreamDeletedDocumentSyncFailure, projectionIntegrityErrorCode, } from "../syncFailures/syncFailureClassification.js";
|
|
9
|
+
import { DocumentRawHistoryUnavailableError } from "../syncPlan/syncContentKeys.js";
|
|
10
|
+
import { buildDocumentSyncPlan } from "../syncPlan/syncPlanIdentity.js";
|
|
11
|
+
import { buildMaterializedDocumentSyncPlan } from "../syncPlan/syncPlanMaterial.js";
|
|
12
|
+
import { handleReadOnlyProjectionCompletionError, REFRESH_CACHED_PROJECTION, } from "./readOnlyProjectionFailure.js";
|
|
13
|
+
import { syncRemoteDocumentResultFromResponse } from "./syncResponseResult.js";
|
|
14
|
+
import { traceSubmitFailed } from "./syncTrace.js";
|
|
15
|
+
async function completeReadOnlyRemoteDocumentSyncWithProjection(input) {
|
|
16
|
+
const materializedPlan = await buildMaterializedDocumentSyncPlan({
|
|
17
|
+
author: input.author,
|
|
18
|
+
execSql: input.execSql,
|
|
19
|
+
historyMode: input.historyMode,
|
|
20
|
+
localVersionVector: input.localVersionVector,
|
|
21
|
+
minLsn: resolvePullContinuationMinLsn(input.pullContinuation, input.minLsn),
|
|
22
|
+
pullCursor: input.pullContinuation?.cursor,
|
|
23
|
+
onSyncTrace: input.onSyncTrace,
|
|
24
|
+
pendingUpdates: [],
|
|
25
|
+
signedAt: input.signedAt,
|
|
26
|
+
targetSecretKey: input.targetSecretKey,
|
|
27
|
+
writerProjection: input.writerProjection,
|
|
28
|
+
...projectionVerificationOptions(input),
|
|
29
|
+
});
|
|
30
|
+
const result = await syncRemoteDocumentResultFromResponse({
|
|
31
|
+
...projectionVerificationOptions(input),
|
|
32
|
+
execSql: input.execSql,
|
|
33
|
+
materializedPlan,
|
|
34
|
+
recoveryPendingUpdatesById: new Map(),
|
|
35
|
+
resolveWriterPublicKey: input.resolveWriterPublicKey,
|
|
36
|
+
response: input.response,
|
|
37
|
+
targetSecretKey: input.targetSecretKey,
|
|
38
|
+
validateIncomingUpdates: input.validateIncomingUpdates,
|
|
39
|
+
writerProjection: input.writerProjection,
|
|
40
|
+
resolveProjectionUserKey: input.resolveProjectionUserKey,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
...result,
|
|
44
|
+
hasIncompletePull: !input.pullComplete,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function parsePersistedDocumentSyncRecord(value, label, isRecord) {
|
|
48
|
+
if (!value) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const record = readCanonicalRecord(JSON.parse(value), label);
|
|
53
|
+
return isRecord(record) ? record : null;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function parsePersistedDocumentSyncState(persistedState, documentId) {
|
|
60
|
+
if (persistedState?.documentId !== documentId) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const contentKeyBundle = parsePersistedDocumentSyncRecord(persistedState.contentKeyBundle, "Persisted document sync content-key bundle", isDocumentContentKeyBundleResponse);
|
|
64
|
+
const documentKekTargets = parsePersistedDocumentSyncRecord(persistedState.documentKekTargets, "Persisted document sync KEK targets", isDocumentKekTargetsResponse);
|
|
65
|
+
const documentManifest = parsePersistedDocumentSyncRecord(persistedState.documentManifestBundle, "Persisted document sync manifest", isAccessManifestBundleWireResponse);
|
|
66
|
+
if (!contentKeyBundle || !documentKekTargets || !documentManifest) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
contentKeyBundle,
|
|
71
|
+
documentKekTargets,
|
|
72
|
+
documentManifest,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
async function buildReadOnlyDocumentSyncPlanFromPersistedState(input) {
|
|
76
|
+
const persisted = parsePersistedDocumentSyncState(input.persistedState, input.documentId);
|
|
77
|
+
if (!persisted) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const plan = await buildDocumentSyncPlan({
|
|
81
|
+
author: input.author,
|
|
82
|
+
contentKeyBundle: persisted.contentKeyBundle,
|
|
83
|
+
documentId: input.documentId,
|
|
84
|
+
documentKekTargets: persisted.documentKekTargets,
|
|
85
|
+
documentManifest: persisted.documentManifest,
|
|
86
|
+
historyMode: input.historyMode,
|
|
87
|
+
localVersionVector: input.localVersionVector,
|
|
88
|
+
minLsn: resolvePullContinuationMinLsn(input.pullContinuation, input.minLsn),
|
|
89
|
+
outgoingUpdates: [],
|
|
90
|
+
pullCursor: input.pullContinuation?.cursor,
|
|
91
|
+
signedAt: input.signedAt,
|
|
92
|
+
});
|
|
93
|
+
const request = limitDocumentSyncRequestBytes(plan.request);
|
|
94
|
+
return request === plan.request ? plan : { ...plan, request };
|
|
95
|
+
}
|
|
96
|
+
async function tryCompleteReadOnlyRemoteDocumentSyncWithProjection(input) {
|
|
97
|
+
try {
|
|
98
|
+
return await completeReadOnlyRemoteDocumentSyncWithProjection({
|
|
99
|
+
...input.completion,
|
|
100
|
+
writerProjection: input.writerProjection,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
return handleReadOnlyProjectionCompletionError(error, {
|
|
105
|
+
allowCachedProjectionRefresh: input.allowCachedProjectionRefresh,
|
|
106
|
+
historyMode: input.completion.historyMode,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function completeReadOnlyRemoteDocumentSyncWithUpdates(input) {
|
|
111
|
+
const reusableWriterProjection = input.writerProjection?.documentId === input.documentId
|
|
112
|
+
? input.writerProjection
|
|
113
|
+
: null;
|
|
114
|
+
const writerProjection = reusableWriterProjection ??
|
|
115
|
+
(await resolveSyncAttemptWriterProjection({
|
|
116
|
+
apiClient: input.apiClient,
|
|
117
|
+
documentId: input.documentId,
|
|
118
|
+
onRemoteDocumentDeleted: input.onRemoteDocumentDeleted,
|
|
119
|
+
onSyncTrace: input.onSyncTrace,
|
|
120
|
+
onTerminalFailure: input.onReadOnlyProjectionFailure,
|
|
121
|
+
reusableWriterProjection: null,
|
|
122
|
+
stillCurrent: input.stillCurrent,
|
|
123
|
+
}));
|
|
124
|
+
if (!writerProjection) {
|
|
125
|
+
return { kind: "completed", result: null };
|
|
126
|
+
}
|
|
127
|
+
const canRefreshProjection = input.historyMode === "raw" || Boolean(reusableWriterProjection);
|
|
128
|
+
let result = null;
|
|
129
|
+
let retryAfterRollback = false;
|
|
130
|
+
try {
|
|
131
|
+
result = await tryCompleteReadOnlyRemoteDocumentSyncWithProjection({
|
|
132
|
+
allowCachedProjectionRefresh: canRefreshProjection,
|
|
133
|
+
completion: input,
|
|
134
|
+
writerProjection,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
if (projectionIntegrityErrorCode(error) !== "rollback") {
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
retryAfterRollback = true;
|
|
142
|
+
}
|
|
143
|
+
if (!retryAfterRollback &&
|
|
144
|
+
result !== REFRESH_CACHED_PROJECTION &&
|
|
145
|
+
!(result instanceof DocumentRawHistoryUnavailableError) &&
|
|
146
|
+
(result || !reusableWriterProjection)) {
|
|
147
|
+
return { kind: "completed", result };
|
|
148
|
+
}
|
|
149
|
+
const freshWriterProjection = await refreshSyncAttemptWriterProjection({
|
|
150
|
+
apiClient: input.apiClient,
|
|
151
|
+
documentId: input.documentId,
|
|
152
|
+
onRemoteDocumentDeleted: input.onRemoteDocumentDeleted,
|
|
153
|
+
onSyncTrace: input.onSyncTrace,
|
|
154
|
+
onTerminalFailure: input.onReadOnlyProjectionFailure,
|
|
155
|
+
stillCurrent: input.stillCurrent,
|
|
156
|
+
unavailableError: result instanceof DocumentRawHistoryUnavailableError ? result : undefined,
|
|
157
|
+
});
|
|
158
|
+
if (!freshWriterProjection) {
|
|
159
|
+
return { kind: "completed", result: null };
|
|
160
|
+
}
|
|
161
|
+
const freshResult = await tryCompleteReadOnlyRemoteDocumentSyncWithProjection({
|
|
162
|
+
allowCachedProjectionRefresh: false,
|
|
163
|
+
completion: input,
|
|
164
|
+
writerProjection: freshWriterProjection,
|
|
165
|
+
});
|
|
166
|
+
if (freshResult === REFRESH_CACHED_PROJECTION ||
|
|
167
|
+
freshResult instanceof DocumentRawHistoryUnavailableError) {
|
|
168
|
+
throw new Error("Fresh document projection unexpectedly requested refresh");
|
|
169
|
+
}
|
|
170
|
+
return freshResult
|
|
171
|
+
? { kind: "completed", result: freshResult }
|
|
172
|
+
: { kind: "not_completed" };
|
|
173
|
+
}
|
|
174
|
+
async function syncReadOnlyRemoteDocumentFromPersistedState(input) {
|
|
175
|
+
let plan;
|
|
176
|
+
try {
|
|
177
|
+
plan = await buildReadOnlyDocumentSyncPlanFromPersistedState(input);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
plan = null;
|
|
181
|
+
}
|
|
182
|
+
if (!plan) {
|
|
183
|
+
return { kind: "not_completed" };
|
|
184
|
+
}
|
|
185
|
+
if (input.stillCurrent?.() === false) {
|
|
186
|
+
return { kind: "completed", result: null };
|
|
187
|
+
}
|
|
188
|
+
const submitted = await submitDocumentSync({
|
|
189
|
+
apiClient: input.apiClient,
|
|
190
|
+
expectedCommitLsnMode: input.pullContinuation?.commitLsnMode,
|
|
191
|
+
plan,
|
|
192
|
+
});
|
|
193
|
+
if (input.stillCurrent?.() === false) {
|
|
194
|
+
return { kind: "completed", result: null };
|
|
195
|
+
}
|
|
196
|
+
if (!submitted) {
|
|
197
|
+
return { kind: "completed", result: null };
|
|
198
|
+
}
|
|
199
|
+
if (!submitted.ok) {
|
|
200
|
+
if (await handleUpstreamDeletedDocumentSyncFailure({
|
|
201
|
+
documentId: input.documentId,
|
|
202
|
+
failure: submitted,
|
|
203
|
+
onRemoteDocumentDeleted: input.onRemoteDocumentDeleted,
|
|
204
|
+
})) {
|
|
205
|
+
return { kind: "completed", result: null };
|
|
206
|
+
}
|
|
207
|
+
if (isRetryableDocumentSyncConflict(submitted)) {
|
|
208
|
+
traceSubmitFailed(input.onSyncTrace, {
|
|
209
|
+
action: "retry",
|
|
210
|
+
code: submitted.code,
|
|
211
|
+
documentId: input.documentId,
|
|
212
|
+
status: submitted.status,
|
|
213
|
+
});
|
|
214
|
+
assertRawContinuationCanRetry(input.historyMode, input.pullContinuation);
|
|
215
|
+
return { kind: "not_completed" };
|
|
216
|
+
}
|
|
217
|
+
traceSubmitFailed(input.onSyncTrace, {
|
|
218
|
+
action: "stop",
|
|
219
|
+
code: submitted.code,
|
|
220
|
+
documentId: input.documentId,
|
|
221
|
+
status: submitted.status,
|
|
222
|
+
});
|
|
223
|
+
submitted.report();
|
|
224
|
+
return { kind: "completed", result: null };
|
|
225
|
+
}
|
|
226
|
+
if (submitted.response.updates.length > 0) {
|
|
227
|
+
return completeReadOnlyRemoteDocumentSyncWithUpdates({
|
|
228
|
+
...input,
|
|
229
|
+
pullComplete: submitted.pullComplete,
|
|
230
|
+
response: submitted.response,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const persistedState = await persistedDocumentSyncStateFromResponse(plan, submitted.response, { resolveWriterPublicKey: input.resolveWriterPublicKey });
|
|
235
|
+
return {
|
|
236
|
+
kind: "completed",
|
|
237
|
+
result: {
|
|
238
|
+
contentKey: new Uint8Array(),
|
|
239
|
+
decryptedUpdates: [],
|
|
240
|
+
exhaustedPendingUpdateCount: 0,
|
|
241
|
+
hasDeferredPendingUpdates: false,
|
|
242
|
+
hasIncompletePull: !submitted.pullComplete,
|
|
243
|
+
persistedState,
|
|
244
|
+
plan,
|
|
245
|
+
rekeyedPendingUpdateIds: [],
|
|
246
|
+
response: submitted.response,
|
|
247
|
+
settledPendingUpdateIds: [],
|
|
248
|
+
acceptedRecoveryBaseline: false,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
if (input.historyMode === "raw") {
|
|
254
|
+
throw error;
|
|
255
|
+
}
|
|
256
|
+
return { kind: "not_completed" };
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
export async function tryPersistedReadOnlyDocumentSync(input, resolveProjectionUserKey) {
|
|
260
|
+
if (input.stillCurrent?.() === false)
|
|
261
|
+
return null;
|
|
262
|
+
if ((input.pendingUpdates ?? []).length > 0)
|
|
263
|
+
return null;
|
|
264
|
+
return syncReadOnlyRemoteDocumentFromPersistedState({
|
|
265
|
+
...input,
|
|
266
|
+
resolveProjectionUserKey,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=readOnlySync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readOnlySync.js","sourceRoot":"","sources":["readOnlySync.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,4BAA4B,GAC7B,MA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umentWriterProjectionResponse,\n} from \"@tearleads/validators/response\";\nimport {\n isAccessManifestBundleWireResponse,\n isDocumentContentKeyBundleResponse,\n isDocumentKekTargetsResponse,\n} from \"@tearleads/validators/response\";\nimport type {\n DocumentSyncUpdateIsolationError,\n IncomingDocumentSyncUpdateValidator,\n} from \"../../../data/documents/shared/documentSyncUpdateIsolation\";\nimport {\n isRetryableDocumentSyncConflict,\n persistedDocumentSyncStateFromResponse,\n submitDocumentSync,\n} from \"../../../data/documents/shared/responses\";\nimport {\n type DocumentSyncPullContinuation,\n resolvePullContinuationMinLsn,\n} from \"../../../data/documents/shared/syncPagination\";\nimport type {\n DocumentCreateAuthor,\n DocumentSyncApi,\n DocumentSyncPlan,\n DocumentWriterPublicKeyResolver,\n PersistedDocumentSyncState,\n SyncRemoteDocumentResult,\n} from \"../../../data/documents/shared/types\";\nimport { projectionVerificationOptions } from \"../../../data/documents/shared/types\";\nimport { readCanonicalRecord } from \"../../../data/keying/canonicalJson\";\nimport type {\n ProjectionUserKeyResolver,\n ReferencedPrincipalPolicyWarmer,\n} from \"../../../data/keyingProjectionVerification\";\nimport type { PendingUpdateRecord } from \"../../../data/sqlite/documentPersistence\";\nimport type { ExecSql } from \"../../../data/sqlite/sqlSchema\";\nimport { limitDocumentSyncRequestBytes } from \"../../../data/sync/documentSyncOutgoingBatch\";\nimport {\n assertRawContinuationCanRetry,\n refreshSyncAttemptWriterProjection,\n resolveSyncAttemptWriterProjection,\n} from \"../syncFailures\";\nimport {\n handleUpstreamDeletedDocumentSyncFailure,\n projectionIntegrityErrorCode,\n type RemoteDocumentDeletionHandler,\n type TerminalSubmitFailureHandler,\n} from \"../syncFailures/syncFailureClassification\";\nimport { DocumentRawHistoryUnavailableError } from \"../syncPlan/syncContentKeys\";\nimport { buildDocumentSyncPlan } from \"../syncPlan/syncPlanIdentity\";\nimport { buildMaterializedDocumentSyncPlan } from \"../syncPlan/syncPlanMaterial\";\nimport type { RekeyPendingUpdate } from \"../syncRekeys/syncRecoveryRekey\";\nimport {\n handleReadOnlyProjectionCompletionError,\n REFRESH_CACHED_PROJECTION,\n} from \"./readOnlyProjectionFailure\";\nimport type { DocumentSyncContainerRekeyBuilder } from \"./syncAttemptState\";\nimport { syncRemoteDocumentResultFromResponse } from \"./syncResponseResult\";\nimport { type DocumentSyncTraceEmitter, traceSubmitFailed } from \"./syncTrace\";\n\nasync function completeReadOnlyRemoteDocumentSyncWithProjection(\n input: Omit<ReadOnlyDocumentSyncCompletionInput, \"writerProjection\"> & {\n writerProjection: DocumentWriterProjectionResponse;\n },\n): Promise<SyncRemoteDocumentResult> {\n const materializedPlan = await buildMaterializedDocumentSyncPlan({\n author: input.author,\n execSql: input.execSql,\n historyMode: input.historyMode,\n localVersionVector: input.localVersionVector,\n minLsn: resolvePullContinuationMinLsn(input.pullContinuation, input.minLsn),\n pullCursor: input.pullContinuation?.cursor,\n onSyncTrace: input.onSyncTrace,\n pendingUpdates: [],\n signedAt: input.signedAt,\n targetSecretKey: input.targetSecretKey,\n writerProjection: input.writerProjection,\n ...projectionVerificationOptions(input),\n });\n\n const result = await syncRemoteDocumentResultFromResponse({\n ...projectionVerificationOptions(input),\n execSql: input.execSql,\n materializedPlan,\n recoveryPendingUpdatesById: new Map(),\n resolveWriterPublicKey: input.resolveWriterPublicKey,\n response: input.response,\n targetSecretKey: input.targetSecretKey,\n validateIncomingUpdates: input.validateIncomingUpdates,\n writerProjection: input.writerProjection,\n resolveProjectionUserKey: input.resolveProjectionUserKey,\n });\n return {\n ...result,\n hasIncompletePull: !input.pullComplete,\n };\n}\n\nfunction parsePersistedDocumentSyncRecord<T>(\n value: string | null | undefined,\n label: string,\n isRecord: (value: unknown) => value is T,\n): T | null {\n if (!value) {\n return null;\n }\n\n try {\n const record = readCanonicalRecord(JSON.parse(value), label);\n return isRecord(record) ? record : null;\n } catch {\n return null;\n }\n}\n\nfunction parsePersistedDocumentSyncState(\n persistedState: PersistedDocumentSyncState | null | undefined,\n documentId: string,\n): {\n contentKeyBundle: DocumentCreateResponse[\"contentKeyBundle\"];\n documentKekTargets: DocumentSyncResponse[\"documentKekTargets\"];\n documentManifest: DocumentCreateResponse[\"accessManifest\"];\n} | null {\n if (persistedState?.documentId !== documentId) {\n return null;\n }\n\n const contentKeyBundle = parsePersistedDocumentSyncRecord(\n persistedState.contentKeyBundle,\n \"Persisted document sync content-key bundle\",\n isDocumentContentKeyBundleResponse,\n );\n const documentKekTargets = parsePersistedDocumentSyncRecord(\n persistedState.documentKekTargets,\n \"Persisted document sync KEK targets\",\n isDocumentKekTargetsResponse,\n );\n const documentManifest = parsePersistedDocumentSyncRecord(\n persistedState.documentManifestBundle,\n \"Persisted document sync manifest\",\n isAccessManifestBundleWireResponse,\n );\n\n if (!contentKeyBundle || !documentKekTargets || !documentManifest) {\n return null;\n }\n\n return {\n contentKeyBundle,\n documentKekTargets,\n documentManifest,\n };\n}\n\nasync function buildReadOnlyDocumentSyncPlanFromPersistedState(input: {\n author: DocumentCreateAuthor;\n documentId: string;\n historyMode?: \"raw\" | undefined;\n localVersionVector: string | null;\n minLsn?: string | undefined;\n pullContinuation?: DocumentSyncPullContinuation | undefined;\n persistedState?: PersistedDocumentSyncState | null | undefined;\n signedAt?: string | undefined;\n}): Promise<DocumentSyncPlan | null> {\n const persisted = parsePersistedDocumentSyncState(\n input.persistedState,\n input.documentId,\n );\n if (!persisted) {\n return null;\n }\n\n const plan = await buildDocumentSyncPlan({\n author: input.author,\n contentKeyBundle: persisted.contentKeyBundle,\n documentId: input.documentId,\n documentKekTargets: persisted.documentKekTargets,\n documentManifest: persisted.documentManifest,\n historyMode: input.historyMode,\n localVersionVector: input.localVersionVector,\n minLsn: resolvePullContinuationMinLsn(input.pullContinuation, input.minLsn),\n outgoingUpdates: [],\n pullCursor: input.pullContinuation?.cursor,\n signedAt: input.signedAt,\n });\n const request = limitDocumentSyncRequestBytes(plan.request);\n return request === plan.request ? plan : { ...plan, request };\n}\n\ntype PersistedReadOnlyDocumentSyncResult =\n | {\n kind: \"completed\";\n result: SyncRemoteDocumentResult | null;\n }\n | {\n kind: \"not_completed\";\n };\n\ninterface ReadOnlyDocumentSyncCompletionInput {\n apiClient: DocumentSyncApi;\n author: DocumentCreateAuthor;\n documentId: string;\n execSql: ExecSql;\n historyMode?: \"raw\" | undefined;\n localVersionVector: string | null;\n minLsn?: string | undefined;\n pullContinuation?: DocumentSyncPullContinuation | undefined;\n onReadOnlyProjectionFailure?: TerminalSubmitFailureHandler | undefined;\n onRemoteDocumentDeleted?: RemoteDocumentDeletionHandler | undefined;\n onSyncTrace?: DocumentSyncTraceEmitter | undefined;\n pullComplete: boolean;\n resolveProjectionUserKey: ProjectionUserKeyResolver;\n resolveWriterPublicKey: DocumentWriterPublicKeyResolver;\n response: DocumentSyncResponse;\n signedAt?: string | undefined;\n stillCurrent?: (() => boolean) | undefined;\n targetSecretKey: Uint8Array;\n validateIncomingUpdates: IncomingDocumentSyncUpdateValidator;\n warmReferencedPrincipalPolicies?: ReferencedPrincipalPolicyWarmer | undefined;\n writerProjection?: DocumentWriterProjectionResponse | undefined;\n}\n\nasync function tryCompleteReadOnlyRemoteDocumentSyncWithProjection(input: {\n allowCachedProjectionRefresh: boolean;\n completion: ReadOnlyDocumentSyncCompletionInput;\n writerProjection: DocumentWriterProjectionResponse;\n}): Promise<\n | DocumentRawHistoryUnavailableError\n | SyncRemoteDocumentResult\n | null\n | typeof REFRESH_CACHED_PROJECTION\n> {\n try {\n return await completeReadOnlyRemoteDocumentSyncWithProjection({\n ...input.completion,\n writerProjection: input.writerProjection,\n });\n } catch (error) {\n return handleReadOnlyProjectionCompletionError(error, {\n allowCachedProjectionRefresh: input.allowCachedProjectionRefresh,\n historyMode: input.completion.historyMode,\n });\n }\n}\nasync function completeReadOnlyRemoteDocumentSyncWithUpdates(\n input: ReadOnlyDocumentSyncCompletionInput,\n): Promise<PersistedReadOnlyDocumentSyncResult> {\n const reusableWriterProjection =\n input.writerProjection?.documentId === input.documentId\n ? input.writerProjection\n : null;\n const writerProjection =\n reusableWriterProjection ??\n (await resolveSyncAttemptWriterProjection({\n apiClient: input.apiClient,\n documentId: input.documentId,\n onRemoteDocumentDeleted: input.onRemoteDocumentDeleted,\n onSyncTrace: input.onSyncTrace,\n onTerminalFailure: input.onReadOnlyProjectionFailure,\n reusableWriterProjection: null,\n stillCurrent: input.stillCurrent,\n }));\n if (!writerProjection) {\n return { kind: \"completed\", result: null };\n }\n const canRefreshProjection =\n input.historyMode === \"raw\" || Boolean(reusableWriterProjection);\n let result:\n | DocumentRawHistoryUnavailableError\n | SyncRemoteDocumentResult\n | null\n | typeof REFRESH_CACHED_PROJECTION = null;\n let retryAfterRollback = false;\n try {\n result = await tryCompleteReadOnlyRemoteDocumentSyncWithProjection({\n allowCachedProjectionRefresh: canRefreshProjection,\n completion: input,\n writerProjection,\n });\n } catch (error) {\n if (projectionIntegrityErrorCode(error) !== \"rollback\") {\n throw error;\n }\n retryAfterRollback = true;\n }\n if (\n !retryAfterRollback &&\n result !== REFRESH_CACHED_PROJECTION &&\n !(result instanceof DocumentRawHistoryUnavailableError) &&\n (result || !reusableWriterProjection)\n ) {\n return { kind: \"completed\", result };\n }\n const freshWriterProjection = await refreshSyncAttemptWriterProjection({\n apiClient: input.apiClient,\n documentId: input.documentId,\n onRemoteDocumentDeleted: input.onRemoteDocumentDeleted,\n onSyncTrace: input.onSyncTrace,\n onTerminalFailure: input.onReadOnlyProjectionFailure,\n stillCurrent: input.stillCurrent,\n unavailableError:\n result instanceof DocumentRawHistoryUnavailableError ? result : undefined,\n });\n if (!freshWriterProjection) {\n return { kind: \"completed\", result: null };\n }\n const freshResult = await tryCompleteReadOnlyRemoteDocumentSyncWithProjection(\n {\n allowCachedProjectionRefresh: false,\n completion: input,\n writerProjection: freshWriterProjection,\n },\n );\n if (\n freshResult === REFRESH_CACHED_PROJECTION ||\n freshResult instanceof DocumentRawHistoryUnavailableError\n ) {\n throw new Error(\"Fresh document projection unexpectedly requested refresh\");\n }\n return freshResult\n ? { kind: \"completed\", result: freshResult }\n : { kind: \"not_completed\" };\n}\nasync function syncReadOnlyRemoteDocumentFromPersistedState(\n input: Omit<\n ReadOnlyDocumentSyncCompletionInput,\n \"pullComplete\" | \"response\"\n > & {\n persistedState?: PersistedDocumentSyncState | null | undefined;\n },\n): Promise<PersistedReadOnlyDocumentSyncResult> {\n let plan: DocumentSyncPlan | null;\n try {\n plan = await buildReadOnlyDocumentSyncPlanFromPersistedState(input);\n } catch {\n plan = null;\n }\n if (!plan) {\n return { kind: \"not_completed\" };\n }\n if (input.stillCurrent?.() === false) {\n return { kind: \"completed\", result: null };\n }\n const submitted = await submitDocumentSync({\n apiClient: input.apiClient,\n expectedCommitLsnMode: input.pullContinuation?.commitLsnMode,\n plan,\n });\n if (input.stillCurrent?.() === false) {\n return { kind: \"completed\", result: null };\n }\n if (!submitted) {\n return { kind: \"completed\", result: null };\n }\n if (!submitted.ok) {\n if (\n await handleUpstreamDeletedDocumentSyncFailure({\n documentId: input.documentId,\n failure: submitted,\n onRemoteDocumentDeleted: input.onRemoteDocumentDeleted,\n })\n ) {\n return { kind: \"completed\", result: null };\n }\n\n if (isRetryableDocumentSyncConflict(submitted)) {\n traceSubmitFailed(input.onSyncTrace, {\n action: \"retry\",\n code: submitted.code,\n documentId: input.documentId,\n status: submitted.status,\n });\n assertRawContinuationCanRetry(input.historyMode, input.pullContinuation);\n return { kind: \"not_completed\" };\n }\n\n traceSubmitFailed(input.onSyncTrace, {\n action: \"stop\",\n code: submitted.code,\n documentId: input.documentId,\n status: submitted.status,\n });\n submitted.report();\n return { kind: \"completed\", result: null };\n }\n\n if (submitted.response.updates.length > 0) {\n return completeReadOnlyRemoteDocumentSyncWithUpdates({\n ...input,\n pullComplete: submitted.pullComplete,\n response: submitted.response,\n });\n }\n\n try {\n const persistedState = await persistedDocumentSyncStateFromResponse(\n plan,\n submitted.response,\n { resolveWriterPublicKey: input.resolveWriterPublicKey },\n );\n\n return {\n kind: \"completed\",\n result: {\n contentKey: new Uint8Array(),\n decryptedUpdates: [],\n exhaustedPendingUpdateCount: 0,\n hasDeferredPendingUpdates: false,\n hasIncompletePull: !submitted.pullComplete,\n persistedState,\n plan,\n rekeyedPendingUpdateIds: [],\n response: submitted.response,\n settledPendingUpdateIds: [],\n acceptedRecoveryBaseline: false,\n },\n };\n } catch (error) {\n if (input.historyMode === \"raw\") {\n throw error;\n }\n return { kind: \"not_completed\" };\n }\n}\n\nexport interface SyncRemoteDocumentInput {\n apiClient: DocumentSyncApi;\n author: DocumentCreateAuthor;\n /**\n * Supplies a full-history Loro snapshot of the local document so a\n * write-bearing pass can heal a stale content-key bundle by rotating to a\n * fresh content key anchored by a rotation baseline.\n */\n buildRotationSnapshot?: (() => Promise<Uint8Array | null>) | undefined;\n /** Overrides automatic ancestor repair for each submission's current projection. */\n buildContainerRekeys?: DocumentSyncContainerRekeyBuilder;\n documentId: string;\n execSql: ExecSql;\n /** Explicit read-only recovery that bypasses rotation-baseline redirect. */\n historyMode?: \"raw\" | undefined;\n isRemoteSyncBlocked?: ((organizationId: string) => boolean) | undefined;\n localVersionVector: string | null;\n minLsn?: string | undefined;\n pullContinuation?: DocumentSyncPullContinuation | undefined;\n /** Atomically commits the verified purge proof with matching local teardown. */\n onRemoteDocumentDeleted?: RemoteDocumentDeletionHandler | undefined;\n onSyncAbandoned?: ((reason: string) => void) | undefined;\n /** Clipboard-safe trace sink (see syncTrace.ts); never receives content. */\n onSyncTrace?: DocumentSyncTraceEmitter | undefined;\n /**\n * Fires when a pass WITHOUT queued writes cannot resolve its writer\n * projection (e.g. a coded 409 from the projection route). Read-only\n * revalidation otherwise fails silently — one burned request and a trace\n * line — leaving the document permanently stale with nothing durable to\n * explain why (edge-case row 13).\n */\n onReadOnlyProjectionFailure?: TerminalSubmitFailureHandler | undefined;\n /** Records a verified response update that could not be decrypted/imported. */\n onIncomingUpdateIsolationFailure?:\n | ((failure: DocumentSyncUpdateIsolationError) => void | Promise<void>)\n | undefined;\n /** Fires immediately before a materialized outgoing batch is submitted. */\n onOutgoingUpdatesMaterialized?:\n | ((updateIds: readonly string[]) => void)\n | undefined;\n /** Invalidates continuation state after the server rejects its snapshot. */\n onPullContinuationInvalidated?:\n | ((continuation: DocumentSyncPullContinuation) => void | Promise<void>)\n | undefined;\n onTerminalSubmitFailure?: TerminalSubmitFailureHandler | undefined;\n pendingUpdates?: readonly PendingUpdateRecord[] | undefined;\n persistedState?: PersistedDocumentSyncState | null | undefined;\n rekeyPendingUpdate?: RekeyPendingUpdate | undefined;\n resolveProjectionUserKey: ProjectionUserKeyResolver;\n resolveWriterPublicKey: DocumentWriterPublicKeyResolver;\n signedAt?: string | undefined;\n stillCurrent?: (() => boolean) | undefined;\n targetSecretKey: Uint8Array;\n /** Validates decrypted updates against scratch state before callers persist. */\n validateIncomingUpdates: IncomingDocumentSyncUpdateValidator;\n warmReferencedPrincipalPolicies?: ReferencedPrincipalPolicyWarmer | undefined;\n writerProjection?: DocumentWriterProjectionResponse | undefined;\n}\n\nexport async function tryPersistedReadOnlyDocumentSync(\n input: SyncRemoteDocumentInput,\n resolveProjectionUserKey: ProjectionUserKeyResolver,\n): Promise<PersistedReadOnlyDocumentSyncResult | null> {\n if (input.stillCurrent?.() === false) return null;\n if ((input.pendingUpdates ?? []).length > 0) return null;\n\n return syncReadOnlyRemoteDocumentFromPersistedState({\n ...input,\n resolveProjectionUserKey,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reportDocumentSyncQuarantine.js","sourceRoot":"","sources":["reportDocumentSyncQuarantine.ts"],"names":[],"mappings":"AAGA,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAkB,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,UAAU,4BAA4B,CAC1C,KAAa,EACb,QAA0D,EAC1D,OAAyC;IAEzC,IAAI,CAAC,QAAQ;QAAE,OAAO;IACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;IAC5E,IAAI,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,SAAS;QAAE,OAAO;IAC3D,4EAA4E;IAC5E,yEAAyE;IACzE,qBAAqB,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC;QACH,KAAK,OAAO,CAAC,OAAO,CAClB,QAAQ,CAAC,qCAAqC,EAAE,OAAO,CAAC,CACzD,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,8DAA8D;IAChE,CAAC;AACH,CAAC","sourcesContent":["import type { DocumentSyncUpdateIsolationError } from \"../../../data/documents/shared/documentSyncUpdateIsolation\";\nimport type { WorkflowRuntimeUtilInput } from \"../../shared/runtimeInput\";\n\nconst lastQuarantineByScope = new WeakMap<object, string>();\n\n/** Keep host diagnostics failures from replacing the durable quarantine. */\nexport function reportDocumentSyncQuarantine(\n scope: object,\n logError: WorkflowRuntimeUtilInput[\"logError\"] | undefined,\n failure: DocumentSyncUpdateIsolationError,\n): void {\n if (!logError) return;\n const signature = JSON.stringify([failure.message, failure.batchUpdateIds]);\n if (lastQuarantineByScope.get(scope) === signature) return;\n // Suppress repeats before the host appends local logs and breadcrumbs. Keep\n // only the last failure, and let discarded document scopes be collected.\n lastQuarantineByScope.set(scope, signature);\n try {\n void Promise.resolve(\n logError(\"Documents: sync updates quarantined\", failure),\n ).catch(() => undefined);\n } catch {\n // Hosts may throw synchronously or return a rejected promise.\n }\n}\n"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ContainerKekRepairInaccessibleError } from "../../../data/documents/shared/containerKekCurrency.js";
|
|
2
|
+
import { assertDocumentManifestBundleConsistent } from "../../../data/documents/shared/readers.js";
|
|
3
|
+
import { resolvePullContinuationMinLsn, } from "../../../data/documents/shared/syncPagination.js";
|
|
4
|
+
import { isDocumentSyncRequestLimitError } from "../../../data/sync/documentSyncOutgoingBatch.js";
|
|
5
|
+
import { retrySyncPlanOrAbandon } from "../syncFailures/index.js";
|
|
6
|
+
import { abandonAncestorRepair, abandonBlockedSync, abandonInaccessibleAncestorRepair, abandonOversizedSyncPlan, } from "../syncFailures/syncAbandon.js";
|
|
7
|
+
import { DocumentAncestorRepairAbandonedError, DocumentSyncPreparationRequiredError, } from "../syncFailures/syncRepairAbandon.js";
|
|
8
|
+
import { prepareSyncAttemptContainerRekeys } from "../syncRekeys/syncContainerRekeyPreparation.js";
|
|
9
|
+
import { buildRemoteDocumentSyncPlan } from "../syncRekeys/syncContainerRekeys.js";
|
|
10
|
+
/**
|
|
11
|
+
* A write-bearing pass records through the submit handler (its queued writes
|
|
12
|
+
* are what the failure blocks). A read-only pass records through the
|
|
13
|
+
* revalidation handler so the refusal still leaves a durable trail instead
|
|
14
|
+
* of silently never revalidating (edge-case row 13). A cursor continuation is
|
|
15
|
+
* wire-level read-only, but its failure still blocks the queued writes it
|
|
16
|
+
* deliberately deferred. Update-id recovery likewise empties the in-flight
|
|
17
|
+
* batch while durable rows remain. Both keep the submit classification and
|
|
18
|
+
* its 403 handling.
|
|
19
|
+
*/
|
|
20
|
+
export function projectionFailureHandler(input, failureBlocksQueuedWrites) {
|
|
21
|
+
return failureBlocksQueuedWrites
|
|
22
|
+
? input.onTerminalSubmitFailure
|
|
23
|
+
: input.onReadOnlyProjectionFailure;
|
|
24
|
+
}
|
|
25
|
+
export async function planDocumentSyncAttempt(input) {
|
|
26
|
+
try {
|
|
27
|
+
const pendingUpdates = input.pullContinuation === undefined ? input.pendingUpdates : [];
|
|
28
|
+
if (pendingUpdates.length &&
|
|
29
|
+
input.sync.isRemoteSyncBlocked?.((await assertDocumentManifestBundleConsistent({
|
|
30
|
+
bundle: input.writerProjection.documentManifest,
|
|
31
|
+
label: "Document sync manifest",
|
|
32
|
+
})).organizationId)) {
|
|
33
|
+
return abandonBlockedSync(input.sync);
|
|
34
|
+
}
|
|
35
|
+
// Durable repair happens once at this explicit attempt boundary. The
|
|
36
|
+
// retryable builder below may only sign inline plans against its projection.
|
|
37
|
+
const prepared = pendingUpdates.length &&
|
|
38
|
+
!input.sync.buildContainerRekeys &&
|
|
39
|
+
input.sync.buildRotationSnapshot
|
|
40
|
+
? await prepareSyncAttemptContainerRekeys(input.sync, input.writerProjection)
|
|
41
|
+
: { projection: input.writerProjection, plans: undefined };
|
|
42
|
+
if (!prepared)
|
|
43
|
+
return null;
|
|
44
|
+
return await retrySyncPlanOrAbandon({
|
|
45
|
+
apiClient: input.sync.apiClient,
|
|
46
|
+
buildWithProjection: (projection) => buildRemoteDocumentSyncPlan({
|
|
47
|
+
pendingUpdates,
|
|
48
|
+
preparedRekeys: projection === prepared.projection ? prepared.plans : undefined,
|
|
49
|
+
minLsn: resolvePullContinuationMinLsn(input.pullContinuation, input.sync.minLsn),
|
|
50
|
+
pullCursor: input.pullContinuation?.cursor,
|
|
51
|
+
projection,
|
|
52
|
+
regenerateQueuedCheckpoints: input.regenerateQueuedCheckpoints,
|
|
53
|
+
sync: input.sync,
|
|
54
|
+
}),
|
|
55
|
+
documentId: input.sync.documentId,
|
|
56
|
+
onRemoteDocumentDeleted: input.sync.onRemoteDocumentDeleted,
|
|
57
|
+
onSyncAbandoned: input.sync.onSyncAbandoned,
|
|
58
|
+
onSyncTrace: input.sync.onSyncTrace,
|
|
59
|
+
onTerminalFailure: projectionFailureHandler(input.sync, input.failureBlocksQueuedWrites),
|
|
60
|
+
stillCurrent: input.sync.stillCurrent,
|
|
61
|
+
writerProjection: prepared.projection,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error instanceof DocumentSyncPreparationRequiredError)
|
|
66
|
+
return "retry";
|
|
67
|
+
if (error instanceof DocumentAncestorRepairAbandonedError) {
|
|
68
|
+
return abandonAncestorRepair(input.sync, error);
|
|
69
|
+
}
|
|
70
|
+
if (error instanceof ContainerKekRepairInaccessibleError) {
|
|
71
|
+
return abandonInaccessibleAncestorRepair(input.sync, error);
|
|
72
|
+
}
|
|
73
|
+
if (!isDocumentSyncRequestLimitError(error)) {
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
return abandonOversizedSyncPlan(input.sync, error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=syncAttemptPlanning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncAttemptPlanning.js","sourceRoot":"","sources":["syncAttemptPlanning.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAAM,qDAAqD,CAAC;AAC1G,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAEL,6BAA6B,GAC9B,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,iCAAiC,EACjC,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,oCAAoC,EACpC,oCAAoC,GACrC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAGhF;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAA8B,EAC9B,yBAAkC;IAElC,OAAO,yBAAyB;QAC9B,CAAC,CAAC,KAAK,CAAC,uBAAuB;QAC/B,CAAC,CAAC,KAAK,CAAC,2BAA2B,CAAC;AACxC,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,KAO7C;IACC,IAAI,CAAC;QACH,MAAM,cAAc,GAClB,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAA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AC,IAAI;aACjB,CAAC;YACJ,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU;YACjC,uBAAuB,EAAE,KAAK,CAAC,IAAI,CAAC,uBAAuB;YAC3D,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe;YAC3C,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW;YACnC,iBAAiB,EAAE,wBAAwB,CACzC,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,yBAAyB,CAChC;YACD,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY;YACrC,gBAAgB,EAAE,QAAQ,CAAC,UAAU;SACtC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,oCAAoC;YACvD,OAAO,OAAgB,CAAC;QAC1B,IAAI,KAAK,YAAY,oCAAoC,EAAE,CAAC;YAC1D,OAAO,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,KAAK,YAAY,mCAAmC,EAAE,CAAC;YACzD,OAAO,iCAAiC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,CAAC,+BAA+B,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;AACH,CAAC","sourcesContent":["import type { DocumentWriterProjectionResponse } from \"@tearleads/validators/response\";\nimport { ContainerKekRepairInaccessibleError } from \"../../../data/documents/shared/containerKekCurrency\";\nimport { assertDocumentManifestBundleConsistent } from \"../../../data/documents/shared/readers\";\nimport {\n type DocumentSyncPullContinuation,\n resolvePullContinuationMinLsn,\n} from \"../../../data/documents/shared/syncPagination\";\nimport type { PendingUpdateRecord } from \"../../../data/sqlite/documentPersistence\";\nimport { isDocumentSyncRequestLimitError } from \"../../../data/sync/documentSyncOutgoingBatch\";\nimport { retrySyncPlanOrAbandon } from \"../syncFailures\";\nimport {\n abandonAncestorRepair,\n abandonBlockedSync,\n abandonInaccessibleAncestorRepair,\n abandonOversizedSyncPlan,\n} from \"../syncFailures/syncAbandon\";\nimport type { TerminalSubmitFailureHandler } from \"../syncFailures/syncFailureClassification\";\nimport {\n DocumentAncestorRepairAbandonedError,\n DocumentSyncPreparationRequiredError,\n} from \"../syncFailures/syncRepairAbandon\";\nimport { prepareSyncAttemptContainerRekeys } from \"../syncRekeys/syncContainerRekeyPreparation\";\nimport { buildRemoteDocumentSyncPlan } from \"../syncRekeys/syncContainerRekeys\";\nimport type { SyncRemoteDocumentInput } from \"./readOnlySync\";\n\n/**\n * A write-bearing pass records through the submit handler (its queued writes\n * are what the failure blocks). A read-only pass records through the\n * revalidation handler so the refusal still leaves a durable trail instead\n * of silently never revalidating (edge-case row 13). A cursor continuation is\n * wire-level read-only, but its failure still blocks the queued writes it\n * deliberately deferred. Update-id recovery likewise empties the in-flight\n * batch while durable rows remain. Both keep the submit classification and\n * its 403 handling.\n */\nexport function projectionFailureHandler(\n input: SyncRemoteDocumentInput,\n failureBlocksQueuedWrites: boolean,\n): TerminalSubmitFailureHandler | undefined {\n return failureBlocksQueuedWrites\n ? input.onTerminalSubmitFailure\n : input.onReadOnlyProjectionFailure;\n}\nexport async function planDocumentSyncAttempt(input: {\n pendingUpdates: readonly PendingUpdateRecord[];\n pullContinuation?: DocumentSyncPullContinuation | undefined;\n regenerateQueuedCheckpoints: boolean;\n sync: SyncRemoteDocumentInput;\n failureBlocksQueuedWrites: boolean;\n writerProjection: DocumentWriterProjectionResponse;\n}) {\n try {\n const pendingUpdates =\n input.pullContinuation === undefined ? input.pendingUpdates : [];\n if (\n pendingUpdates.length &&\n input.sync.isRemoteSyncBlocked?.(\n (\n await assertDocumentManifestBundleConsistent({\n bundle: input.writerProjection.documentManifest,\n label: \"Document sync manifest\",\n })\n ).organizationId,\n )\n ) {\n return abandonBlockedSync(input.sync);\n }\n // Durable repair happens once at this explicit attempt boundary. The\n // retryable builder below may only sign inline plans against its projection.\n const prepared =\n pendingUpdates.length &&\n !input.sync.buildContainerRekeys &&\n input.sync.buildRotationSnapshot\n ? await prepareSyncAttemptContainerRekeys(\n input.sync,\n input.writerProjection,\n )\n : { projection: input.writerProjection, plans: undefined };\n if (!prepared) return null;\n return await retrySyncPlanOrAbandon({\n apiClient: input.sync.apiClient,\n buildWithProjection: (projection) =>\n buildRemoteDocumentSyncPlan({\n pendingUpdates,\n preparedRekeys:\n projection === prepared.projection ? prepared.plans : undefined,\n minLsn: resolvePullContinuationMinLsn(\n input.pullContinuation,\n input.sync.minLsn,\n ),\n pullCursor: input.pullContinuation?.cursor,\n projection,\n regenerateQueuedCheckpoints: input.regenerateQueuedCheckpoints,\n sync: input.sync,\n }),\n documentId: input.sync.documentId,\n onRemoteDocumentDeleted: input.sync.onRemoteDocumentDeleted,\n onSyncAbandoned: input.sync.onSyncAbandoned,\n onSyncTrace: input.sync.onSyncTrace,\n onTerminalFailure: projectionFailureHandler(\n input.sync,\n input.failureBlocksQueuedWrites,\n ),\n stillCurrent: input.sync.stillCurrent,\n writerProjection: prepared.projection,\n });\n } catch (error) {\n if (error instanceof DocumentSyncPreparationRequiredError)\n return \"retry\" as const;\n if (error instanceof DocumentAncestorRepairAbandonedError) {\n return abandonAncestorRepair(input.sync, error);\n }\n if (error instanceof ContainerKekRepairInaccessibleError) {\n return abandonInaccessibleAncestorRepair(input.sync, error);\n }\n if (!isDocumentSyncRequestLimitError(error)) {\n throw error;\n }\n return abandonOversizedSyncPlan(input.sync, error);\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DocumentWriterProjectionResponse } from "../../../internal/validators/response/index.js";
|
|
2
|
+
import type { MaterializedContainerRekeyPlan } from "../../../data/containers/shared/types.js";
|
|
3
|
+
import type { DocumentSyncPullContinuation } from "../../../data/documents/shared/syncPagination.js";
|
|
4
|
+
import type { SyncRemoteDocumentResult } from "../../../data/documents/shared/types.js";
|
|
5
|
+
import type { PendingUpdateRecord } from "../../../data/sqlite/documentPersistence.js";
|
|
6
|
+
export type DocumentSyncContainerRekeyBuilder = (writerProjection: DocumentWriterProjectionResponse, verification: {
|
|
7
|
+
readonly persistVerificationCheckpoints: false;
|
|
8
|
+
}) => Promise<readonly MaterializedContainerRekeyPlan[]>;
|
|
9
|
+
export interface RemoteDocumentSyncAttemptState {
|
|
10
|
+
pendingUpdates: readonly PendingUpdateRecord[];
|
|
11
|
+
pullContinuation: DocumentSyncPullContinuation | undefined;
|
|
12
|
+
recoveryPendingUpdatesById: Map<string, PendingUpdateRecord>;
|
|
13
|
+
regenerateQueuedCheckpoints: boolean;
|
|
14
|
+
reusableWriterProjection: DocumentWriterProjectionResponse | null;
|
|
15
|
+
}
|
|
16
|
+
export type RemoteDocumentSyncAttemptOutcome = {
|
|
17
|
+
kind: "complete";
|
|
18
|
+
result: SyncRemoteDocumentResult | null;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "recover";
|
|
21
|
+
updates: Map<string, PendingUpdateRecord>;
|
|
22
|
+
} | {
|
|
23
|
+
kind: "regenerate";
|
|
24
|
+
} | {
|
|
25
|
+
kind: "retry";
|
|
26
|
+
pullContinuation: DocumentSyncPullContinuation | undefined;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncAttemptState.js","sourceRoot":"","sources":["syncAttemptState.ts"],"names":[],"mappings":"","sourcesContent":["import type { DocumentWriterProjectionResponse } from \"@tearleads/validators/response\";\nimport type { MaterializedContainerRekeyPlan } from \"../../../data/containers/shared/types\";\nimport type { DocumentSyncPullContinuation } from \"../../../data/documents/shared/syncPagination\";\nimport type { SyncRemoteDocumentResult } from \"../../../data/documents/shared/types\";\nimport type { PendingUpdateRecord } from \"../../../data/sqlite/documentPersistence\";\n\nexport type DocumentSyncContainerRekeyBuilder = (\n writerProjection: DocumentWriterProjectionResponse,\n verification: { readonly persistVerificationCheckpoints: false },\n) => Promise<readonly MaterializedContainerRekeyPlan[]>;\n\nexport interface RemoteDocumentSyncAttemptState {\n pendingUpdates: readonly PendingUpdateRecord[];\n pullContinuation: DocumentSyncPullContinuation | undefined;\n recoveryPendingUpdatesById: Map<string, PendingUpdateRecord>;\n regenerateQueuedCheckpoints: boolean;\n reusableWriterProjection: DocumentWriterProjectionResponse | null;\n}\n\nexport type RemoteDocumentSyncAttemptOutcome =\n | { kind: \"complete\"; result: SyncRemoteDocumentResult | null }\n | { kind: \"recover\"; updates: Map<string, PendingUpdateRecord> }\n | { kind: \"regenerate\" }\n | {\n kind: \"retry\";\n pullContinuation: DocumentSyncPullContinuation | undefined;\n };\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DomainScope } from "../../../data/shared/domainScope.js";
|
|
2
|
+
import { type SyncLane } from "../../../data/sync/syncCoordinator.js";
|
|
3
|
+
export { sequenceUnchanged } from "../../../data/sync/sequence.js";
|
|
4
|
+
export type DocumentSyncLane = SyncLane;
|
|
5
|
+
export declare function registerDocumentSyncLane(input: {
|
|
6
|
+
readonly domainScope: DomainScope;
|
|
7
|
+
readonly localId: string;
|
|
8
|
+
/** Host diagnostics sink; bare runtimes do not structure errors. */
|
|
9
|
+
readonly logError?: ((message: string, error: unknown) => void) | undefined;
|
|
10
|
+
readonly run: () => Promise<void>;
|
|
11
|
+
readonly priority?: (() => number) | undefined;
|
|
12
|
+
}): DocumentSyncLane;
|
|
13
|
+
export declare function requestDocumentSyncLaneAndWait(input: {
|
|
14
|
+
readonly didCompleteRequest: () => boolean;
|
|
15
|
+
readonly domainScope: DomainScope;
|
|
16
|
+
readonly localId: string;
|
|
17
|
+
readonly onInvalidated?: (() => void) | undefined;
|
|
18
|
+
readonly request: () => void;
|
|
19
|
+
readonly signal?: AbortSignal | undefined;
|
|
20
|
+
}): Promise<boolean>;
|