@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTextValue } from "../../internal/loro/index.js";
|
|
2
2
|
import { DEFAULT_DOCUMENT_ACCESS_EPOCH, DEFAULT_DOCUMENT_KIND, } from "../../data/documents/documentConstants.js";
|
|
3
3
|
import { readStoredDocumentState, } from "../../data/documents/documentKinds.js";
|
|
4
|
-
import { createInitialDocumentRows } from "./documentCreationPersistence.js";
|
|
4
|
+
import { createInitialDocumentRows } from "./create/documentCreationPersistence.js";
|
|
5
5
|
import { documentSyncSecurityContextMatches, prepareDocumentMutation, } from "./documentMutationPreparation.js";
|
|
6
6
|
import { refuseDeletedDocumentPersist } from "./documentPersistGuards.js";
|
|
7
7
|
const MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS = 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentMutationCommit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IACd,CAAC;IACD,MAAM,wBAAwB,GAAG,YAAY,CAAC,wBAAwB,IAAI,EAAE,CAAC;IAC7E,KACE,IAAI,OAAO,GAAG,CAAC,EACf,OAAO,GAAG,qCAAqC,EAC/C,OAAO,IAAI,CAAC,EACZ,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAC5C,YAAY,EACZ,aAAa,EACb,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,IAAI,QAAQ,CAAC,0BAA0B,EAAE,CAAC;YACxC,OAAO,gCAAgC,CAAC;gBACtC,wBAAwB;gBACxB,aAAa;gBACb,QAAQ;gBACR,YAAY;aACb,CAAC,CAAC;QACL,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,iCAAiC,CAAC;YACrD,wBAAwB;YACxB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,aAAa;YACb,QAAQ;YACR,YAAY;SACb,CAAC,CAAC;QACH,IAAI,MAAM,KAAK,OAAO;YAAE,OAAO,MAAM,CAAC;IACxC,CAAC;IACD,MAAM,IAAI,KAAK,CACb,0CAA0C,qCAAqC,uBAAuB,CACvG,CAAC;AACJ,CAAC","sourcesContent":["import { type encodeVersionVector, getTextValue } from \"@tearleads/loro\";\nimport {\n DEFAULT_DOCUMENT_ACCESS_EPOCH,\n DEFAULT_DOCUMENT_KIND,\n} from \"../../data/documents/documentConstants\";\nimport {\n type DocumentProjectorRegistry,\n type DocumentProjectorRegistryInput,\n readStoredDocumentState,\n} from \"../../data/documents/documentKinds\";\nimport type {\n DocumentsPersistence,\n StoredDocumentRecord,\n} from \"../../data/persistence/documents/documentsPersistence\";\nimport type { PendingUpdateFields } from \"../../data/sqlite/documentPersistence\";\nimport type { ExecSql } from \"../../data/sqlite/sqlSchema\";\nimport { createInitialDocumentRows } from \"./documentCreationPersistence\";\nimport {\n documentSyncSecurityContextMatches,\n type PrepareDocumentMutationInput,\n prepareDocumentMutation,\n} from \"./documentMutationPreparation\";\nimport { refuseDeletedDocumentPersist } from \"./documentPersistGuards\";\n\ntype DocumentContentState = Parameters<typeof encodeVersionVector>[0];\ntype NullableDocumentRuntimeField =\n | \"accessStateHash\"\n | \"lastCommitLsn\"\n | \"contentKeyBundle\"\n | \"documentKekTargets\"\n | \"documentManifestBundle\";\n\nconst MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS = 8;\n\nexport interface PersistedDocumentState {\n creationSuperseded?: true;\n historyRestoreState?:\n | Awaited<ReturnType<DocumentsPersistence[\"loadHistoryRestoreState\"]>>\n | undefined;\n pullContinuationSuperseded?: true;\n record: StoredDocumentRecord;\n syncIdentitySuperseded?: true;\n updatedAt?: string | undefined;\n}\n\nexport interface PersistDocumentStateInput\n extends PrepareDocumentMutationInput {\n acceptedPendingUpdateIds?: readonly string[] | undefined;\n attachmentRemoval?:\n | Parameters<\n DocumentsPersistence[\"commitDocumentMutation\"]\n >[1][\"attachmentRemoval\"]\n | undefined;\n attachmentStaging?:\n | Parameters<\n DocumentsPersistence[\"commitDocumentMutation\"]\n >[1][\"attachmentStaging\"]\n | undefined;\n canStartDurableMutation?: (() => boolean) | undefined;\n clearSyncFailure?: boolean | undefined;\n commitSideEffect?: (transactionExecSql: ExecSql) => Promise<void>;\n containerId?: string | null | undefined;\n documentProjectors: DocumentProjectorRegistryInput;\n execSql: ExecSql;\n patch?: Partial<StoredDocumentRecord> | undefined;\n pendingUpdate?: PendingUpdateFields | undefined;\n}\n\nasync function loadSupersededPersistedDocumentState(input: {\n creationSuperseded: boolean;\n execSql: ExecSql;\n localId: string;\n persistence: DocumentsPersistence;\n record: StoredDocumentRecord;\n syncIdentitySuperseded: boolean;\n}): Promise<PersistedDocumentState | null> {\n const { document, historyRestoreState } =\n await input.persistence.loadDocumentWithHistoryRestoreState(\n input.execSql,\n input.localId,\n );\n if (!document) return null;\n const syncIdentitySuperseded =\n input.syncIdentitySuperseded ||\n !documentSyncSecurityContextMatches(document, input.record);\n return {\n ...(input.creationSuperseded ? { creationSuperseded: true as const } : {}),\n historyRestoreState,\n pullContinuationSuperseded: true,\n record: document,\n ...(syncIdentitySuperseded\n ? { syncIdentitySuperseded: true as const }\n : {}),\n };\n}\n\nfunction resolveNullableDocumentRuntimeField(\n patch: Partial<StoredDocumentRecord>,\n key: NullableDocumentRuntimeField,\n currentValue: string | null | undefined,\n resetWhenUnpatched = false,\n): string | null {\n if (Object.hasOwn(patch, key)) return patch[key] ?? null;\n return resetWhenUnpatched ? null : (currentValue ?? null);\n}\n\nfunction resolveStoredDocumentContainerId(input: {\n containerId?: string | null | undefined;\n currentRecord: StoredDocumentRecord | null;\n patch: Partial<StoredDocumentRecord>;\n}): string | null {\n if (Object.hasOwn(input.patch, \"containerId\")) {\n return input.patch.containerId ?? null;\n }\n return input.currentRecord?.containerId ?? input.containerId ?? null;\n}\n\nfunction resolveStoredDocumentPullState(input: {\n currentRecord: StoredDocumentRecord | null;\n patch: Partial<StoredDocumentRecord>;\n securityContextChanged: boolean;\n}): Pick<\n StoredDocumentRecord,\n \"pullContinuation\" | \"pullContinuationRecoveryRequired\"\n> {\n if (Object.hasOwn(input.patch, \"pullContinuation\")) {\n return { pullContinuation: input.patch.pullContinuation ?? null };\n }\n if (input.securityContextChanged) return { pullContinuation: null };\n if (input.currentRecord?.pullContinuationRecoveryRequired) {\n return { pullContinuationRecoveryRequired: true };\n }\n return { pullContinuation: input.currentRecord?.pullContinuation ?? null };\n}\n\nfunction buildStoredDocumentRecord(input: {\n containerId?: string | null | undefined;\n currentDoc: DocumentContentState;\n currentRecord: StoredDocumentRecord | null;\n documentProjectors: DocumentProjectorRegistry;\n localId: string;\n patch: Partial<StoredDocumentRecord>;\n}) {\n const { currentDoc, currentRecord, documentProjectors, localId, patch } =\n input;\n const currentDocumentId = currentRecord?.documentId ?? null;\n const nextDocumentId = patch.documentId ?? currentDocumentId;\n const documentIdChanged = nextDocumentId !== currentDocumentId;\n const currentAccessEpoch =\n currentRecord?.accessEpoch ?? DEFAULT_DOCUMENT_ACCESS_EPOCH;\n const nextAccessEpoch = patch.accessEpoch ?? currentAccessEpoch;\n const securityContextChanged =\n documentIdChanged || nextAccessEpoch !== currentAccessEpoch;\n const documentState = readStoredDocumentState(currentDoc, documentProjectors);\n const record: StoredDocumentRecord = {\n id: currentRecord?.id ?? localId,\n accessEpoch: nextAccessEpoch,\n accessStateHash: resolveNullableDocumentRuntimeField(\n patch,\n \"accessStateHash\",\n currentRecord?.accessStateHash,\n securityContextChanged,\n ),\n containerId: resolveStoredDocumentContainerId({\n containerId: input.containerId,\n currentRecord,\n patch,\n }),\n contentKeyBundle: resolveNullableDocumentRuntimeField(\n patch,\n \"contentKeyBundle\",\n currentRecord?.contentKeyBundle,\n securityContextChanged,\n ),\n documentId: nextDocumentId,\n effectiveAccessLevel:\n patch.effectiveAccessLevel ?? currentRecord?.effectiveAccessLevel ?? null,\n documentKekTargets: resolveNullableDocumentRuntimeField(\n patch,\n \"documentKekTargets\",\n currentRecord?.documentKekTargets,\n securityContextChanged,\n ),\n documentKind: patch.documentKind ?? documentState.documentKind,\n documentManifestBundle: resolveNullableDocumentRuntimeField(\n patch,\n \"documentManifestBundle\",\n currentRecord?.documentManifestBundle,\n securityContextChanged,\n ),\n lastCommitLsn: resolveNullableDocumentRuntimeField(\n patch,\n \"lastCommitLsn\",\n currentRecord?.lastCommitLsn,\n documentIdChanged,\n ),\n snapshotEndVersion:\n patch.snapshotEndVersion ?? currentRecord?.snapshotEndVersion ?? \"\",\n pendingBaseVersion:\n patch.pendingBaseVersion !== undefined\n ? patch.pendingBaseVersion\n : (currentRecord?.pendingBaseVersion ?? null),\n recoveryGeneration:\n patch.recoveryGeneration ?? currentRecord?.recoveryGeneration ?? 0,\n ...resolveStoredDocumentPullState({\n currentRecord,\n patch,\n securityContextChanged,\n }),\n text: patch.text ?? getTextValue(currentDoc),\n title: patch.title ?? documentState.title,\n };\n return { documentState, record };\n}\n\nasync function saveDocumentClientProjection(input: {\n currentRecord: StoredDocumentRecord | null;\n documentProjectors: DocumentProjectorRegistry;\n documentState: ReturnType<typeof readStoredDocumentState>;\n execSql: ExecSql;\n localId: string;\n record: StoredDocumentRecord;\n updatedAt: string;\n}): Promise<void> {\n const previousKind =\n input.currentRecord?.documentKind ?? DEFAULT_DOCUMENT_KIND;\n const nextKind = input.record.documentKind ?? DEFAULT_DOCUMENT_KIND;\n if (previousKind !== nextKind) {\n await input.documentProjectors.deleteStoredDocumentClientProjection({\n documentKind: previousKind,\n execSql: input.execSql,\n localId: input.localId,\n });\n }\n await input.documentProjectors.saveStoredDocumentClientProjection({\n containerId: input.record.containerId,\n documentId: input.record.documentId,\n documentKind: nextKind,\n execSql: input.execSql,\n localId: input.record.id,\n structuredFields: input.documentState.structuredFields,\n text: input.record.text,\n title: input.record.title ?? input.documentState.title,\n updatedAt: input.updatedAt,\n });\n}\n\nasync function settleSupersededDocumentMutation(input: {\n acceptedPendingUpdateIds: readonly string[];\n lockedExecSql: ExecSql;\n mutation: Awaited<ReturnType<typeof prepareDocumentMutation>>;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState | null> {\n const { mutation, persistInput } = input;\n if (!mutation.mutationCurrentRecord) return null;\n const authoritativeRecord = persistInput.expectedSyncState\n ? await persistInput.persistence.settleAcceptedPendingUpdates(\n input.lockedExecSql,\n {\n expectedRecord: persistInput.expectedSyncState.record,\n pendingUpdateIds: input.acceptedPendingUpdateIds,\n },\n )\n : mutation.mutationCurrentRecord;\n if (!authoritativeRecord) return null;\n return loadSupersededPersistedDocumentState({\n creationSuperseded: mutation.creationSuperseded,\n execSql: input.lockedExecSql,\n localId: persistInput.localId,\n persistence: persistInput.persistence,\n record: authoritativeRecord,\n syncIdentitySuperseded: !mutation.securityContextMatches,\n });\n}\n\nasync function loadConcurrentCreationWinner(input: {\n execSql: ExecSql;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState> {\n const winningRecord = await input.persistInput.persistence.loadDocument(\n input.execSql,\n input.persistInput.localId,\n );\n if (!winningRecord) {\n throw new Error(\"Concurrent document creation lost without a winner\");\n }\n const winner = await loadSupersededPersistedDocumentState({\n creationSuperseded: true,\n execSql: input.execSql,\n localId: input.persistInput.localId,\n persistence: input.persistInput.persistence,\n record: winningRecord,\n syncIdentitySuperseded: true,\n });\n if (!winner) {\n throw new Error(\"Concurrent document creation winner disappeared\");\n }\n return winner;\n}\n\nasync function resolveInitialDocumentCreation(input: {\n execSql: ExecSql;\n persistInput: PersistDocumentStateInput;\n record: StoredDocumentRecord;\n savedAt: string | null;\n}): Promise<PersistedDocumentState | null> {\n if (input.savedAt !== null) {\n return { record: input.record, updatedAt: input.savedAt };\n }\n if (\n input.persistInput.canStartDurableMutation &&\n !input.persistInput.canStartDurableMutation()\n ) {\n return null;\n }\n return loadConcurrentCreationWinner({\n execSql: input.execSql,\n persistInput: input.persistInput,\n });\n}\n\nasync function resolveDocumentMutationCommit(input: {\n committed: Awaited<\n ReturnType<DocumentsPersistence[\"commitDocumentMutation\"]>\n >;\n lockedExecSql: ExecSql;\n persistInput: PersistDocumentStateInput;\n record: StoredDocumentRecord;\n}): Promise<PersistedDocumentState | null | \"retry\"> {\n const { committed, persistInput, record } = input;\n if (\n persistInput.canStartDurableMutation &&\n !persistInput.canStartDurableMutation()\n ) {\n return null;\n }\n if (committed.committed) return { record, updatedAt: committed.updatedAt };\n if (!committed.currentRecord) return null;\n if (persistInput.expectedSyncState === undefined) return \"retry\";\n return loadSupersededPersistedDocumentState({\n creationSuperseded: false,\n execSql: input.lockedExecSql,\n localId: persistInput.localId,\n persistence: persistInput.persistence,\n record: committed.currentRecord,\n syncIdentitySuperseded: !documentSyncSecurityContextMatches(\n committed.currentRecord,\n persistInput.expectedSyncState.record,\n ),\n });\n}\n\nasync function commitOnePreparedDocumentMutation(input: {\n acceptedPendingUpdateIds: readonly string[];\n documentProjectors: DocumentProjectorRegistry;\n lockedExecSql: ExecSql;\n mutation: Exclude<\n Awaited<ReturnType<typeof prepareDocumentMutation>>,\n { pullContinuationSuperseded: true }\n >;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState | null | \"retry\"> {\n const { mutation, persistInput } = input;\n const { documentState, record } = buildStoredDocumentRecord({\n containerId: persistInput.containerId,\n currentDoc: persistInput.currentDoc,\n currentRecord: mutation.mutationCurrentRecord,\n documentProjectors: input.documentProjectors,\n localId: persistInput.localId,\n patch: mutation.resolvedPatch,\n });\n if (!mutation.mutationCurrentRecord) {\n const savedAt = await createInitialDocumentRows({\n currentDoc: persistInput.currentDoc,\n execSql: input.lockedExecSql,\n pendingUpdate: persistInput.pendingUpdate,\n persistence: persistInput.persistence,\n record,\n stillCurrent: persistInput.canStartDurableMutation,\n saveClientProjection: (transactionExecSql, updatedAt) =>\n saveDocumentClientProjection({\n currentRecord: null,\n documentProjectors: input.documentProjectors,\n documentState,\n execSql: transactionExecSql,\n localId: persistInput.localId,\n record,\n updatedAt,\n }),\n });\n return resolveInitialDocumentCreation({\n execSql: input.lockedExecSql,\n persistInput,\n record,\n savedAt,\n });\n }\n\n const committed = await persistInput.persistence.commitDocumentMutation(\n input.lockedExecSql,\n {\n acceptedPendingUpdateIds: input.acceptedPendingUpdateIds,\n clearSyncFailure: persistInput.clearSyncFailure,\n ...(persistInput.attachmentRemoval\n ? { attachmentRemoval: persistInput.attachmentRemoval }\n : {}),\n ...(persistInput.attachmentStaging\n ? { attachmentStaging: persistInput.attachmentStaging }\n : {}),\n document: record,\n expectedRecord: mutation.mutationCurrentRecord,\n ...(persistInput.historyCheckpoint\n ? { historyCheckpoint: persistInput.historyCheckpoint }\n : {}),\n ...(persistInput.historyUpdateOrigin\n ? { historyUpdateOrigin: persistInput.historyUpdateOrigin }\n : {}),\n ...(persistInput.historyUpdates\n ? { historyUpdates: persistInput.historyUpdates }\n : {}),\n ...(persistInput.pendingUpdate\n ? { pendingUpdate: persistInput.pendingUpdate }\n : {}),\n settleAcceptedPendingOnConflict:\n persistInput.expectedSyncState !== undefined,\n ...(persistInput.canStartDurableMutation\n ? { stillCurrent: persistInput.canStartDurableMutation }\n : {}),\n },\n async (transactionExecSql, updatedAt) => {\n await saveDocumentClientProjection({\n currentRecord: mutation.mutationCurrentRecord,\n documentProjectors: input.documentProjectors,\n documentState,\n execSql: transactionExecSql,\n localId: persistInput.localId,\n record,\n updatedAt,\n });\n await persistInput.commitSideEffect?.(transactionExecSql);\n },\n );\n return resolveDocumentMutationCommit({\n committed,\n lockedExecSql: input.lockedExecSql,\n persistInput,\n record,\n });\n}\n\nexport async function commitPreparedDocumentState(input: {\n documentProjectors: DocumentProjectorRegistry;\n lockedExecSql: ExecSql;\n patch: Partial<StoredDocumentRecord>;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState | null> {\n const { lockedExecSql, persistInput } = input;\n if (\n await refuseDeletedDocumentPersist({\n currentRecord: persistInput.currentRecord,\n documentProjectors: input.documentProjectors,\n execSql: lockedExecSql,\n localId: persistInput.localId,\n persistence: persistInput.persistence,\n })\n ) {\n return null;\n }\n const acceptedPendingUpdateIds = persistInput.acceptedPendingUpdateIds ?? [];\n for (\n let attempt = 0;\n attempt < MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS;\n attempt += 1\n ) {\n const mutation = await prepareDocumentMutation(\n persistInput,\n lockedExecSql,\n input.patch,\n );\n if (mutation.pullContinuationSuperseded) {\n return settleSupersededDocumentMutation({\n acceptedPendingUpdateIds,\n lockedExecSql,\n mutation,\n persistInput,\n });\n }\n const result = await commitOnePreparedDocumentMutation({\n acceptedPendingUpdateIds,\n documentProjectors: input.documentProjectors,\n lockedExecSql,\n mutation,\n persistInput,\n });\n if (result !== \"retry\") return result;\n }\n throw new Error(\n `Document mutation commit gave up after ${MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS} concurrent conflicts`,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"documentMutationCommit.js","sourceRoot":"","sources":["documentMutationCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,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f,OAAO,GAAG,qCAAqC,EAC/C,OAAO,IAAI,CAAC,EACZ,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAC5C,YAAY,EACZ,aAAa,EACb,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,IAAI,QAAQ,CAAC,0BAA0B,EAAE,CAAC;YACxC,OAAO,gCAAgC,CAAC;gBACtC,wBAAwB;gBACxB,aAAa;gBACb,QAAQ;gBACR,YAAY;aACb,CAAC,CAAC;QACL,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,iCAAiC,CAAC;YACrD,wBAAwB;YACxB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,aAAa;YACb,QAAQ;YACR,YAAY;SACb,CAAC,CAAC;QACH,IAAI,MAAM,KAAK,OAAO;YAAE,OAAO,MAAM,CAAC;IACxC,CAAC;IACD,MAAM,IAAI,KAAK,CACb,0CAA0C,qCAAqC,uBAAuB,CACvG,CAAC;AACJ,CAAC","sourcesContent":["import { type encodeVersionVector, getTextValue } from \"@tearleads/loro\";\nimport {\n DEFAULT_DOCUMENT_ACCESS_EPOCH,\n DEFAULT_DOCUMENT_KIND,\n} from \"../../data/documents/documentConstants\";\nimport {\n type DocumentProjectorRegistry,\n type DocumentProjectorRegistryInput,\n readStoredDocumentState,\n} from \"../../data/documents/documentKinds\";\nimport type {\n DocumentsPersistence,\n StoredDocumentRecord,\n} from \"../../data/persistence/documents/documentsPersistence\";\nimport type { PendingUpdateFields } from \"../../data/sqlite/documentPersistence\";\nimport type { ExecSql } from \"../../data/sqlite/sqlSchema\";\nimport { createInitialDocumentRows } from \"./create/documentCreationPersistence\";\nimport {\n documentSyncSecurityContextMatches,\n type PrepareDocumentMutationInput,\n prepareDocumentMutation,\n} from \"./documentMutationPreparation\";\nimport { refuseDeletedDocumentPersist } from \"./documentPersistGuards\";\n\ntype DocumentContentState = Parameters<typeof encodeVersionVector>[0];\ntype NullableDocumentRuntimeField =\n | \"accessStateHash\"\n | \"lastCommitLsn\"\n | \"contentKeyBundle\"\n | \"documentKekTargets\"\n | \"documentManifestBundle\";\n\nconst MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS = 8;\n\nexport interface PersistedDocumentState {\n creationSuperseded?: true;\n historyRestoreState?:\n | Awaited<ReturnType<DocumentsPersistence[\"loadHistoryRestoreState\"]>>\n | undefined;\n pullContinuationSuperseded?: true;\n record: StoredDocumentRecord;\n syncIdentitySuperseded?: true;\n updatedAt?: string | undefined;\n}\n\nexport interface PersistDocumentStateInput\n extends PrepareDocumentMutationInput {\n acceptedPendingUpdateIds?: readonly string[] | undefined;\n attachmentRemoval?:\n | Parameters<\n DocumentsPersistence[\"commitDocumentMutation\"]\n >[1][\"attachmentRemoval\"]\n | undefined;\n attachmentStaging?:\n | Parameters<\n DocumentsPersistence[\"commitDocumentMutation\"]\n >[1][\"attachmentStaging\"]\n | undefined;\n canStartDurableMutation?: (() => boolean) | undefined;\n clearSyncFailure?: boolean | undefined;\n commitSideEffect?: (transactionExecSql: ExecSql) => Promise<void>;\n containerId?: string | null | undefined;\n documentProjectors: DocumentProjectorRegistryInput;\n execSql: ExecSql;\n patch?: Partial<StoredDocumentRecord> | undefined;\n pendingUpdate?: PendingUpdateFields | undefined;\n}\n\nasync function loadSupersededPersistedDocumentState(input: {\n creationSuperseded: boolean;\n execSql: ExecSql;\n localId: string;\n persistence: DocumentsPersistence;\n record: StoredDocumentRecord;\n syncIdentitySuperseded: boolean;\n}): Promise<PersistedDocumentState | null> {\n const { document, historyRestoreState } =\n await input.persistence.loadDocumentWithHistoryRestoreState(\n input.execSql,\n input.localId,\n );\n if (!document) return null;\n const syncIdentitySuperseded =\n input.syncIdentitySuperseded ||\n !documentSyncSecurityContextMatches(document, input.record);\n return {\n ...(input.creationSuperseded ? { creationSuperseded: true as const } : {}),\n historyRestoreState,\n pullContinuationSuperseded: true,\n record: document,\n ...(syncIdentitySuperseded\n ? { syncIdentitySuperseded: true as const }\n : {}),\n };\n}\n\nfunction resolveNullableDocumentRuntimeField(\n patch: Partial<StoredDocumentRecord>,\n key: NullableDocumentRuntimeField,\n currentValue: string | null | undefined,\n resetWhenUnpatched = false,\n): string | null {\n if (Object.hasOwn(patch, key)) return patch[key] ?? null;\n return resetWhenUnpatched ? null : (currentValue ?? null);\n}\n\nfunction resolveStoredDocumentContainerId(input: {\n containerId?: string | null | undefined;\n currentRecord: StoredDocumentRecord | null;\n patch: Partial<StoredDocumentRecord>;\n}): string | null {\n if (Object.hasOwn(input.patch, \"containerId\")) {\n return input.patch.containerId ?? null;\n }\n return input.currentRecord?.containerId ?? input.containerId ?? null;\n}\n\nfunction resolveStoredDocumentPullState(input: {\n currentRecord: StoredDocumentRecord | null;\n patch: Partial<StoredDocumentRecord>;\n securityContextChanged: boolean;\n}): Pick<\n StoredDocumentRecord,\n \"pullContinuation\" | \"pullContinuationRecoveryRequired\"\n> {\n if (Object.hasOwn(input.patch, \"pullContinuation\")) {\n return { pullContinuation: input.patch.pullContinuation ?? null };\n }\n if (input.securityContextChanged) return { pullContinuation: null };\n if (input.currentRecord?.pullContinuationRecoveryRequired) {\n return { pullContinuationRecoveryRequired: true };\n }\n return { pullContinuation: input.currentRecord?.pullContinuation ?? null };\n}\n\nfunction buildStoredDocumentRecord(input: {\n containerId?: string | null | undefined;\n currentDoc: DocumentContentState;\n currentRecord: StoredDocumentRecord | null;\n documentProjectors: DocumentProjectorRegistry;\n localId: string;\n patch: Partial<StoredDocumentRecord>;\n}) {\n const { currentDoc, currentRecord, documentProjectors, localId, patch } =\n input;\n const currentDocumentId = currentRecord?.documentId ?? null;\n const nextDocumentId = patch.documentId ?? currentDocumentId;\n const documentIdChanged = nextDocumentId !== currentDocumentId;\n const currentAccessEpoch =\n currentRecord?.accessEpoch ?? DEFAULT_DOCUMENT_ACCESS_EPOCH;\n const nextAccessEpoch = patch.accessEpoch ?? currentAccessEpoch;\n const securityContextChanged =\n documentIdChanged || nextAccessEpoch !== currentAccessEpoch;\n const documentState = readStoredDocumentState(currentDoc, documentProjectors);\n const record: StoredDocumentRecord = {\n id: currentRecord?.id ?? localId,\n accessEpoch: nextAccessEpoch,\n accessStateHash: resolveNullableDocumentRuntimeField(\n patch,\n \"accessStateHash\",\n currentRecord?.accessStateHash,\n securityContextChanged,\n ),\n containerId: resolveStoredDocumentContainerId({\n containerId: input.containerId,\n currentRecord,\n patch,\n }),\n contentKeyBundle: resolveNullableDocumentRuntimeField(\n patch,\n \"contentKeyBundle\",\n currentRecord?.contentKeyBundle,\n securityContextChanged,\n ),\n documentId: nextDocumentId,\n effectiveAccessLevel:\n patch.effectiveAccessLevel ?? currentRecord?.effectiveAccessLevel ?? null,\n documentKekTargets: resolveNullableDocumentRuntimeField(\n patch,\n \"documentKekTargets\",\n currentRecord?.documentKekTargets,\n securityContextChanged,\n ),\n documentKind: patch.documentKind ?? documentState.documentKind,\n documentManifestBundle: resolveNullableDocumentRuntimeField(\n patch,\n \"documentManifestBundle\",\n currentRecord?.documentManifestBundle,\n securityContextChanged,\n ),\n lastCommitLsn: resolveNullableDocumentRuntimeField(\n patch,\n \"lastCommitLsn\",\n currentRecord?.lastCommitLsn,\n documentIdChanged,\n ),\n snapshotEndVersion:\n patch.snapshotEndVersion ?? currentRecord?.snapshotEndVersion ?? \"\",\n pendingBaseVersion:\n patch.pendingBaseVersion !== undefined\n ? patch.pendingBaseVersion\n : (currentRecord?.pendingBaseVersion ?? null),\n recoveryGeneration:\n patch.recoveryGeneration ?? currentRecord?.recoveryGeneration ?? 0,\n ...resolveStoredDocumentPullState({\n currentRecord,\n patch,\n securityContextChanged,\n }),\n text: patch.text ?? getTextValue(currentDoc),\n title: patch.title ?? documentState.title,\n };\n return { documentState, record };\n}\n\nasync function saveDocumentClientProjection(input: {\n currentRecord: StoredDocumentRecord | null;\n documentProjectors: DocumentProjectorRegistry;\n documentState: ReturnType<typeof readStoredDocumentState>;\n execSql: ExecSql;\n localId: string;\n record: StoredDocumentRecord;\n updatedAt: string;\n}): Promise<void> {\n const previousKind =\n input.currentRecord?.documentKind ?? DEFAULT_DOCUMENT_KIND;\n const nextKind = input.record.documentKind ?? DEFAULT_DOCUMENT_KIND;\n if (previousKind !== nextKind) {\n await input.documentProjectors.deleteStoredDocumentClientProjection({\n documentKind: previousKind,\n execSql: input.execSql,\n localId: input.localId,\n });\n }\n await input.documentProjectors.saveStoredDocumentClientProjection({\n containerId: input.record.containerId,\n documentId: input.record.documentId,\n documentKind: nextKind,\n execSql: input.execSql,\n localId: input.record.id,\n structuredFields: input.documentState.structuredFields,\n text: input.record.text,\n title: input.record.title ?? input.documentState.title,\n updatedAt: input.updatedAt,\n });\n}\n\nasync function settleSupersededDocumentMutation(input: {\n acceptedPendingUpdateIds: readonly string[];\n lockedExecSql: ExecSql;\n mutation: Awaited<ReturnType<typeof prepareDocumentMutation>>;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState | null> {\n const { mutation, persistInput } = input;\n if (!mutation.mutationCurrentRecord) return null;\n const authoritativeRecord = persistInput.expectedSyncState\n ? await persistInput.persistence.settleAcceptedPendingUpdates(\n input.lockedExecSql,\n {\n expectedRecord: persistInput.expectedSyncState.record,\n pendingUpdateIds: input.acceptedPendingUpdateIds,\n },\n )\n : mutation.mutationCurrentRecord;\n if (!authoritativeRecord) return null;\n return loadSupersededPersistedDocumentState({\n creationSuperseded: mutation.creationSuperseded,\n execSql: input.lockedExecSql,\n localId: persistInput.localId,\n persistence: persistInput.persistence,\n record: authoritativeRecord,\n syncIdentitySuperseded: !mutation.securityContextMatches,\n });\n}\n\nasync function loadConcurrentCreationWinner(input: {\n execSql: ExecSql;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState> {\n const winningRecord = await input.persistInput.persistence.loadDocument(\n input.execSql,\n input.persistInput.localId,\n );\n if (!winningRecord) {\n throw new Error(\"Concurrent document creation lost without a winner\");\n }\n const winner = await loadSupersededPersistedDocumentState({\n creationSuperseded: true,\n execSql: input.execSql,\n localId: input.persistInput.localId,\n persistence: input.persistInput.persistence,\n record: winningRecord,\n syncIdentitySuperseded: true,\n });\n if (!winner) {\n throw new Error(\"Concurrent document creation winner disappeared\");\n }\n return winner;\n}\n\nasync function resolveInitialDocumentCreation(input: {\n execSql: ExecSql;\n persistInput: PersistDocumentStateInput;\n record: StoredDocumentRecord;\n savedAt: string | null;\n}): Promise<PersistedDocumentState | null> {\n if (input.savedAt !== null) {\n return { record: input.record, updatedAt: input.savedAt };\n }\n if (\n input.persistInput.canStartDurableMutation &&\n !input.persistInput.canStartDurableMutation()\n ) {\n return null;\n }\n return loadConcurrentCreationWinner({\n execSql: input.execSql,\n persistInput: input.persistInput,\n });\n}\n\nasync function resolveDocumentMutationCommit(input: {\n committed: Awaited<\n ReturnType<DocumentsPersistence[\"commitDocumentMutation\"]>\n >;\n lockedExecSql: ExecSql;\n persistInput: PersistDocumentStateInput;\n record: StoredDocumentRecord;\n}): Promise<PersistedDocumentState | null | \"retry\"> {\n const { committed, persistInput, record } = input;\n if (\n persistInput.canStartDurableMutation &&\n !persistInput.canStartDurableMutation()\n ) {\n return null;\n }\n if (committed.committed) return { record, updatedAt: committed.updatedAt };\n if (!committed.currentRecord) return null;\n if (persistInput.expectedSyncState === undefined) return \"retry\";\n return loadSupersededPersistedDocumentState({\n creationSuperseded: false,\n execSql: input.lockedExecSql,\n localId: persistInput.localId,\n persistence: persistInput.persistence,\n record: committed.currentRecord,\n syncIdentitySuperseded: !documentSyncSecurityContextMatches(\n committed.currentRecord,\n persistInput.expectedSyncState.record,\n ),\n });\n}\n\nasync function commitOnePreparedDocumentMutation(input: {\n acceptedPendingUpdateIds: readonly string[];\n documentProjectors: DocumentProjectorRegistry;\n lockedExecSql: ExecSql;\n mutation: Exclude<\n Awaited<ReturnType<typeof prepareDocumentMutation>>,\n { pullContinuationSuperseded: true }\n >;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState | null | \"retry\"> {\n const { mutation, persistInput } = input;\n const { documentState, record } = buildStoredDocumentRecord({\n containerId: persistInput.containerId,\n currentDoc: persistInput.currentDoc,\n currentRecord: mutation.mutationCurrentRecord,\n documentProjectors: input.documentProjectors,\n localId: persistInput.localId,\n patch: mutation.resolvedPatch,\n });\n if (!mutation.mutationCurrentRecord) {\n const savedAt = await createInitialDocumentRows({\n currentDoc: persistInput.currentDoc,\n execSql: input.lockedExecSql,\n pendingUpdate: persistInput.pendingUpdate,\n persistence: persistInput.persistence,\n record,\n stillCurrent: persistInput.canStartDurableMutation,\n saveClientProjection: (transactionExecSql, updatedAt) =>\n saveDocumentClientProjection({\n currentRecord: null,\n documentProjectors: input.documentProjectors,\n documentState,\n execSql: transactionExecSql,\n localId: persistInput.localId,\n record,\n updatedAt,\n }),\n });\n return resolveInitialDocumentCreation({\n execSql: input.lockedExecSql,\n persistInput,\n record,\n savedAt,\n });\n }\n\n const committed = await persistInput.persistence.commitDocumentMutation(\n input.lockedExecSql,\n {\n acceptedPendingUpdateIds: input.acceptedPendingUpdateIds,\n clearSyncFailure: persistInput.clearSyncFailure,\n ...(persistInput.attachmentRemoval\n ? { attachmentRemoval: persistInput.attachmentRemoval }\n : {}),\n ...(persistInput.attachmentStaging\n ? { attachmentStaging: persistInput.attachmentStaging }\n : {}),\n document: record,\n expectedRecord: mutation.mutationCurrentRecord,\n ...(persistInput.historyCheckpoint\n ? { historyCheckpoint: persistInput.historyCheckpoint }\n : {}),\n ...(persistInput.historyUpdateOrigin\n ? { historyUpdateOrigin: persistInput.historyUpdateOrigin }\n : {}),\n ...(persistInput.historyUpdates\n ? { historyUpdates: persistInput.historyUpdates }\n : {}),\n ...(persistInput.pendingUpdate\n ? { pendingUpdate: persistInput.pendingUpdate }\n : {}),\n settleAcceptedPendingOnConflict:\n persistInput.expectedSyncState !== undefined,\n ...(persistInput.canStartDurableMutation\n ? { stillCurrent: persistInput.canStartDurableMutation }\n : {}),\n },\n async (transactionExecSql, updatedAt) => {\n await saveDocumentClientProjection({\n currentRecord: mutation.mutationCurrentRecord,\n documentProjectors: input.documentProjectors,\n documentState,\n execSql: transactionExecSql,\n localId: persistInput.localId,\n record,\n updatedAt,\n });\n await persistInput.commitSideEffect?.(transactionExecSql);\n },\n );\n return resolveDocumentMutationCommit({\n committed,\n lockedExecSql: input.lockedExecSql,\n persistInput,\n record,\n });\n}\n\nexport async function commitPreparedDocumentState(input: {\n documentProjectors: DocumentProjectorRegistry;\n lockedExecSql: ExecSql;\n patch: Partial<StoredDocumentRecord>;\n persistInput: PersistDocumentStateInput;\n}): Promise<PersistedDocumentState | null> {\n const { lockedExecSql, persistInput } = input;\n if (\n await refuseDeletedDocumentPersist({\n currentRecord: persistInput.currentRecord,\n documentProjectors: input.documentProjectors,\n execSql: lockedExecSql,\n localId: persistInput.localId,\n persistence: persistInput.persistence,\n })\n ) {\n return null;\n }\n const acceptedPendingUpdateIds = persistInput.acceptedPendingUpdateIds ?? [];\n for (\n let attempt = 0;\n attempt < MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS;\n attempt += 1\n ) {\n const mutation = await prepareDocumentMutation(\n persistInput,\n lockedExecSql,\n input.patch,\n );\n if (mutation.pullContinuationSuperseded) {\n return settleSupersededDocumentMutation({\n acceptedPendingUpdateIds,\n lockedExecSql,\n mutation,\n persistInput,\n });\n }\n const result = await commitOnePreparedDocumentMutation({\n acceptedPendingUpdateIds,\n documentProjectors: input.documentProjectors,\n lockedExecSql,\n mutation,\n persistInput,\n });\n if (result !== \"retry\") return result;\n }\n throw new Error(\n `Document mutation commit gave up after ${MAX_DOCUMENT_MUTATION_COMMIT_ATTEMPTS} concurrent conflicts`,\n );\n}\n"]}
|
|
@@ -9,27 +9,27 @@ export type { ExecSql } from "../../data/sqlite/sqlSchema.js";
|
|
|
9
9
|
export { selectDocumentSyncOutgoingBatch } from "../../data/sync/documentSyncOutgoingBatch.js";
|
|
10
10
|
export { settleOutgoingPassAndDecideReArm } from "../../data/sync/outgoingUpdateSettlement.js";
|
|
11
11
|
export { didRegainSyncPrerequisites, isDatabaseUnavailableError, } from "../../data/sync/syncCoordinator.js";
|
|
12
|
-
export { deleteLocalDocumentAttachment, deletePendingDocumentAttachment, markLocalDocumentAttachmentDetached, saveLocalDocumentAttachments, savePendingDocumentAttachment, } from "./attachmentPersistence.js";
|
|
12
|
+
export { deleteLocalDocumentAttachment, deletePendingDocumentAttachment, markLocalDocumentAttachmentDetached, saveLocalDocumentAttachments, savePendingDocumentAttachment, } from "./attachments/attachmentPersistence.js";
|
|
13
|
+
export { runSerializedDocumentBlobMutation } from "./attachments/blobMutationLock.js";
|
|
14
|
+
export { reclaimDocumentOrphanBlobs } from "./attachments/orphanBlobReclaims.js";
|
|
13
15
|
export { resolveDocumentCreateAuthor } from "./author.js";
|
|
14
|
-
export {
|
|
15
|
-
export { buildMaterializedDocumentCreatePlan, createRemoteDocument, documentWriterProjectionFromCreateResponse, } from "./create.js";
|
|
16
|
+
export { buildMaterializedDocumentCreatePlan, createRemoteDocument, documentWriterProjectionFromCreateResponse, } from "./create/index.js";
|
|
16
17
|
export { importDocumentHistoryTailUpdates, loadPersistedDocumentContent, mergePersistedDocumentHistory, } from "./historyContent.js";
|
|
17
|
-
export { buildMaterializedDocumentLinkSetMutationPlan } from "./linkSet.js";
|
|
18
|
-
export { relinkRemoteDocument } from "./linkSetRemote.js";
|
|
19
|
-
export { reclaimDocumentOrphanBlobs } from "./orphanBlobReclaims.js";
|
|
18
|
+
export { buildMaterializedDocumentLinkSetMutationPlan } from "./linkSet/index.js";
|
|
19
|
+
export { relinkRemoteDocument } from "./linkSet/linkSetRemote.js";
|
|
20
20
|
export { enqueuePendingDocumentUpdate, listPendingDocumentUpdates, } from "./pendingUpdatePersistence.js";
|
|
21
|
-
export { type DiscardedDocumentShellResult, deletePersistedDocument, discardPersistedDocumentToShell, } from "./persistedDocumentRemoval.js";
|
|
22
21
|
export { type AttachmentRemovalRows, type AttachmentStagingRows, DOCUMENTS_APP_KIND, type DocumentRecord, type DocumentsPersistence, defaultDocumentsPersistence, type LocalAttachmentRecord, loadPersistedDocumentStoreState, type PendingAttachmentRecord, type PendingAttachmentUploadIdentity, type PendingUpdateInsert, type PendingUpdateRecord, persistDocumentState, type RelinkPersistedDocumentInput, runSerializedSqlMutation, } from "./persistence.js";
|
|
23
22
|
export { createDocumentProjectionUserKeyResolver, type DocumentProjectionKeyRuntime, type DocumentProjectionUserKeyResolver, didDocumentProjectionKeyRuntimeChange, } from "./projectionKeys.js";
|
|
24
|
-
export { buildDocumentPurgeRequest, purgeRemoteDocument, } from "./purge.js";
|
|
25
|
-
export type
|
|
23
|
+
export { buildDocumentPurgeRequest, purgeRemoteDocument, } from "./purge/index.js";
|
|
24
|
+
export { type DiscardedDocumentShellResult, deletePersistedDocument, discardPersistedDocumentToShell, } from "./purge/persistedDocumentRemoval.js";
|
|
26
25
|
export { createDocumentsWorkflowRuntime, type DocumentsWorkflowRuntime, type DocumentsWorkflowRuntimeGroups, type DocumentsWorkflowRuntimeInfra, type DocumentsWorkflowRuntimeInput, type DocumentsWorkflowRuntimeInputGroups, } from "./runtime.js";
|
|
27
|
-
export { hasDocumentUpdateEvent, syncRemoteDocument, } from "./sync.js";
|
|
28
|
-
export type {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export
|
|
34
|
-
export {
|
|
26
|
+
export { hasDocumentUpdateEvent, syncRemoteDocument, } from "./sync/index.js";
|
|
27
|
+
export type { SyncRemoteDocumentInput } from "./sync/readOnlySync.js";
|
|
28
|
+
export type { DocumentSyncContainerRekeyBuilder } from "./sync/syncAttemptState.js";
|
|
29
|
+
export { type DocumentSyncLane, registerDocumentSyncLane, requestDocumentSyncLaneAndWait, } from "./sync/syncLane.js";
|
|
30
|
+
export { DOCUMENT_SYNC_TRACE_FRAGMENT, DOCUMENT_SYNC_TRACE_PATTERN, } from "./sync/syncTrace.js";
|
|
31
|
+
export { describeDocumentRevalidationFailure, describeDocumentSyncSubmitFailure, type TerminalSubmitFailureHandler, } from "./syncFailures/syncFailureClassification.js";
|
|
32
|
+
export { shouldClearDocumentSyncFailureAfterPass } from "./syncFailures/syncFailureClearance.js";
|
|
33
|
+
export { DocumentRawHistoryUnavailableError } from "./syncPlan/syncContentKeys.js";
|
|
34
|
+
export type { RekeyPendingUpdate } from "./syncRekeys/syncRecoveryRekey.js";
|
|
35
35
|
export { createDocumentWriterPublicKeyResolver } from "./writerKeys.js";
|
|
@@ -7,25 +7,25 @@ export { clearDocumentSyncFailure, invalidateDocumentSyncPullContinuation, recor
|
|
|
7
7
|
export { selectDocumentSyncOutgoingBatch } from "../../data/sync/documentSyncOutgoingBatch.js";
|
|
8
8
|
export { settleOutgoingPassAndDecideReArm } from "../../data/sync/outgoingUpdateSettlement.js";
|
|
9
9
|
export { didRegainSyncPrerequisites, isDatabaseUnavailableError, } from "../../data/sync/syncCoordinator.js";
|
|
10
|
-
export { deleteLocalDocumentAttachment, deletePendingDocumentAttachment, markLocalDocumentAttachmentDetached, saveLocalDocumentAttachments, savePendingDocumentAttachment, } from "./attachmentPersistence.js";
|
|
10
|
+
export { deleteLocalDocumentAttachment, deletePendingDocumentAttachment, markLocalDocumentAttachmentDetached, saveLocalDocumentAttachments, savePendingDocumentAttachment, } from "./attachments/attachmentPersistence.js";
|
|
11
|
+
export { runSerializedDocumentBlobMutation } from "./attachments/blobMutationLock.js";
|
|
12
|
+
export { reclaimDocumentOrphanBlobs } from "./attachments/orphanBlobReclaims.js";
|
|
11
13
|
export { resolveDocumentCreateAuthor } from "./author.js";
|
|
12
|
-
export {
|
|
13
|
-
export { buildMaterializedDocumentCreatePlan, createRemoteDocument, documentWriterProjectionFromCreateResponse, } from "./create.js";
|
|
14
|
+
export { buildMaterializedDocumentCreatePlan, createRemoteDocument, documentWriterProjectionFromCreateResponse, } from "./create/index.js";
|
|
14
15
|
export { importDocumentHistoryTailUpdates, loadPersistedDocumentContent, mergePersistedDocumentHistory, } from "./historyContent.js";
|
|
15
|
-
export { buildMaterializedDocumentLinkSetMutationPlan } from "./linkSet.js";
|
|
16
|
-
export { relinkRemoteDocument } from "./linkSetRemote.js";
|
|
17
|
-
export { reclaimDocumentOrphanBlobs } from "./orphanBlobReclaims.js";
|
|
16
|
+
export { buildMaterializedDocumentLinkSetMutationPlan } from "./linkSet/index.js";
|
|
17
|
+
export { relinkRemoteDocument } from "./linkSet/linkSetRemote.js";
|
|
18
18
|
export { enqueuePendingDocumentUpdate, listPendingDocumentUpdates, } from "./pendingUpdatePersistence.js";
|
|
19
|
-
export { deletePersistedDocument, discardPersistedDocumentToShell, } from "./persistedDocumentRemoval.js";
|
|
20
19
|
export { DOCUMENTS_APP_KIND, defaultDocumentsPersistence, loadPersistedDocumentStoreState, persistDocumentState, runSerializedSqlMutation, } from "./persistence.js";
|
|
21
20
|
export { createDocumentProjectionUserKeyResolver, didDocumentProjectionKeyRuntimeChange, } from "./projectionKeys.js";
|
|
22
|
-
export { buildDocumentPurgeRequest, purgeRemoteDocument, } from "./purge.js";
|
|
21
|
+
export { buildDocumentPurgeRequest, purgeRemoteDocument, } from "./purge/index.js";
|
|
22
|
+
export { deletePersistedDocument, discardPersistedDocumentToShell, } from "./purge/persistedDocumentRemoval.js";
|
|
23
23
|
export { createDocumentsWorkflowRuntime, } from "./runtime.js";
|
|
24
|
-
export { hasDocumentUpdateEvent, syncRemoteDocument, } from "./sync.js";
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
24
|
+
export { hasDocumentUpdateEvent, syncRemoteDocument, } from "./sync/index.js";
|
|
25
|
+
export { registerDocumentSyncLane, requestDocumentSyncLaneAndWait, } from "./sync/syncLane.js";
|
|
26
|
+
export { DOCUMENT_SYNC_TRACE_FRAGMENT, DOCUMENT_SYNC_TRACE_PATTERN, } from "./sync/syncTrace.js";
|
|
27
|
+
export { describeDocumentRevalidationFailure, describeDocumentSyncSubmitFailure, } from "./syncFailures/syncFailureClassification.js";
|
|
28
|
+
export { shouldClearDocumentSyncFailureAfterPass } from "./syncFailures/syncFailureClearance.js";
|
|
29
|
+
export { DocumentRawHistoryUnavailableError } from "./syncPlan/syncContentKeys.js";
|
|
30
30
|
export { createDocumentWriterPublicKeyResolver } from "./writerKeys.js";
|
|
31
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wCAAwC,EAAE,MAAM,uCAAuC,CAAC;AACjG,OAAO,EAEL,kCAAkC,EAClC,oBAAoB,GACrB,MAAM,4CAA4C,CAAC;AAOpD,OAAO,EACL,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,wBAAwB,EACxB,sCAAsC,EACtC,yBAAyB,GAC1B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,mCAAmC,EACnC,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wCAAwC,EAAE,MAAM,uCAAuC,CAAC;AACjG,OAAO,EAEL,kCAAkC,EAClC,oBAAoB,GACrB,MA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,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,8BAA8B,GAM/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAEL,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mCAAmC,EACnC,iCAAiC,GAElC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,uCAAuC,EAAE,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,qCAAqC,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export {\n type DocumentSyncUpdateIsolationError,\n type IncomingDocumentSyncUpdateValidator,\n isDocumentSyncUpdateIsolationError,\n validateDocumentSyncUpdateImports,\n} from \"../../data/documents/shared/documentSyncUpdateIsolation\";\nexport {\n unwrapContainerKekPath,\n unwrapDocumentContentKeyTarget,\n} from \"../../data/documents/shared/projection\";\nexport { persistedDocumentCreateStateFromResponse } from \"../../data/documents/shared/responses\";\nexport {\n type DocumentSyncPullContinuation,\n documentSyncPullContinuationsEqual,\n readPullContinuation,\n} from \"../../data/documents/shared/syncPagination\";\nexport type {\n DocumentCreateAuthor,\n DocumentLinkSetFailureHandler,\n DocumentLinkSetMutationFailure,\n RelinkRemoteDocumentResult,\n} from \"../../data/documents/shared/types\";\nexport {\n DOCUMENT_HISTORY_COMPACTION_MAX_BYTES,\n DOCUMENT_HISTORY_COMPACTION_MAX_ROWS,\n} from \"../../data/sqlite/documentHistoryPersistence\";\nexport {\n clearDocumentSyncFailure,\n invalidateDocumentSyncPullContinuation,\n recordDocumentSyncFailure,\n} from \"../../data/sqlite/documentPersistence\";\nexport type { ExecSql } from \"../../data/sqlite/sqlSchema\";\nexport { selectDocumentSyncOutgoingBatch } from \"../../data/sync/documentSyncOutgoingBatch\";\nexport { settleOutgoingPassAndDecideReArm } from \"../../data/sync/outgoingUpdateSettlement\";\nexport {\n didRegainSyncPrerequisites,\n isDatabaseUnavailableError,\n} from \"../../data/sync/syncCoordinator\";\nexport {\n deleteLocalDocumentAttachment,\n deletePendingDocumentAttachment,\n markLocalDocumentAttachmentDetached,\n saveLocalDocumentAttachments,\n savePendingDocumentAttachment,\n} from \"./attachments/attachmentPersistence\";\nexport { runSerializedDocumentBlobMutation } from \"./attachments/blobMutationLock\";\nexport { reclaimDocumentOrphanBlobs } from \"./attachments/orphanBlobReclaims\";\nexport { resolveDocumentCreateAuthor } from \"./author\";\nexport {\n buildMaterializedDocumentCreatePlan,\n createRemoteDocument,\n documentWriterProjectionFromCreateResponse,\n} from \"./create\";\nexport {\n importDocumentHistoryTailUpdates,\n loadPersistedDocumentContent,\n mergePersistedDocumentHistory,\n} from \"./historyContent\";\nexport { buildMaterializedDocumentLinkSetMutationPlan } from \"./linkSet\";\nexport { relinkRemoteDocument } from \"./linkSet/linkSetRemote\";\nexport {\n enqueuePendingDocumentUpdate,\n listPendingDocumentUpdates,\n} from \"./pendingUpdatePersistence\";\nexport {\n type AttachmentRemovalRows,\n type AttachmentStagingRows,\n DOCUMENTS_APP_KIND,\n type DocumentRecord,\n type DocumentsPersistence,\n defaultDocumentsPersistence,\n type LocalAttachmentRecord,\n loadPersistedDocumentStoreState,\n type PendingAttachmentRecord,\n type PendingAttachmentUploadIdentity,\n type PendingUpdateInsert,\n type PendingUpdateRecord,\n persistDocumentState,\n type RelinkPersistedDocumentInput,\n runSerializedSqlMutation,\n} from \"./persistence\";\nexport {\n createDocumentProjectionUserKeyResolver,\n type DocumentProjectionKeyRuntime,\n type DocumentProjectionUserKeyResolver,\n didDocumentProjectionKeyRuntimeChange,\n} from \"./projectionKeys\";\nexport {\n buildDocumentPurgeRequest,\n purgeRemoteDocument,\n} from \"./purge\";\nexport {\n type DiscardedDocumentShellResult,\n deletePersistedDocument,\n discardPersistedDocumentToShell,\n} from \"./purge/persistedDocumentRemoval\";\nexport {\n createDocumentsWorkflowRuntime,\n type DocumentsWorkflowRuntime,\n type DocumentsWorkflowRuntimeGroups,\n type DocumentsWorkflowRuntimeInfra,\n type DocumentsWorkflowRuntimeInput,\n type DocumentsWorkflowRuntimeInputGroups,\n} from \"./runtime\";\nexport {\n hasDocumentUpdateEvent,\n syncRemoteDocument,\n} from \"./sync\";\nexport type { SyncRemoteDocumentInput } from \"./sync/readOnlySync\";\nexport type { DocumentSyncContainerRekeyBuilder } from \"./sync/syncAttemptState\";\nexport {\n type DocumentSyncLane,\n registerDocumentSyncLane,\n requestDocumentSyncLaneAndWait,\n} from \"./sync/syncLane\";\nexport {\n DOCUMENT_SYNC_TRACE_FRAGMENT,\n DOCUMENT_SYNC_TRACE_PATTERN,\n} from \"./sync/syncTrace\";\nexport {\n describeDocumentRevalidationFailure,\n describeDocumentSyncSubmitFailure,\n type TerminalSubmitFailureHandler,\n} from \"./syncFailures/syncFailureClassification\";\nexport { shouldClearDocumentSyncFailureAfterPass } from \"./syncFailures/syncFailureClearance\";\nexport { DocumentRawHistoryUnavailableError } from \"./syncPlan/syncContentKeys\";\nexport type { RekeyPendingUpdate } from \"./syncRekeys/syncRecoveryRekey\";\nexport { createDocumentWriterPublicKeyResolver } from \"./writerKeys\";\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type DocumentContentKeyTarget } from "../../../internal/crypto/index.js";
|
|
2
|
+
import type { ContainerWriterProjectionResponse, DocumentWriterProjectionResponse } from "../../../internal/validators/response/index.js";
|
|
3
|
+
import { type BuildDocumentLinkSetMutationPlanInput, type DocumentCreateAuthor, type DocumentLinkSetMutationOperation, type MaterializedDocumentLinkSetMutationPlan, type ProjectionVerificationOptions } from "../../../data/documents/shared/types.js";
|
|
4
|
+
import type { ExecSql } from "../../../data/sqlite/sqlSchema.js";
|
|
5
|
+
import { type SubtreePurgeRoot } from "../purge/subtreePurgeScope.js";
|
|
6
|
+
export declare function assertDocumentLinkTargetCapacity(currentTargetCount: number): void;
|
|
7
|
+
export declare function assertDocumentLinkAuthorizationPathCapacity(currentPathLengths: readonly number[], targetPathLength: number): void;
|
|
8
|
+
export declare function buildMaterializedDocumentLinkSetMutationPlan(input: {
|
|
9
|
+
author: DocumentCreateAuthor;
|
|
10
|
+
expectedSubtreeRoot?: SubtreePurgeRoot | undefined;
|
|
11
|
+
prepareBlobRewraps: (targets: readonly DocumentContentKeyTarget[]) => Promise<BuildDocumentLinkSetMutationPlanInput["blobRewraps"]>;
|
|
12
|
+
contentKey?: Uint8Array | undefined;
|
|
13
|
+
eventId?: string | undefined;
|
|
14
|
+
execSql?: ExecSql | undefined;
|
|
15
|
+
operation: DocumentLinkSetMutationOperation;
|
|
16
|
+
signedAt?: string | undefined;
|
|
17
|
+
targetContainerProjection: ContainerWriterProjectionResponse;
|
|
18
|
+
targetSecretKey: Uint8Array;
|
|
19
|
+
writerProjection: DocumentWriterProjectionResponse;
|
|
20
|
+
} & ProjectionVerificationOptions): Promise<MaterializedDocumentLinkSetMutationPlan>;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { computeAccessManifestHash, computeDocumentContentKeyTargetHash, DOCUMENT_CONTENT_KEY_WRAP_SUITE, deriveDocumentLinkSetManifest, wrapContentKey, } from "../../../internal/crypto/index.js";
|
|
2
|
+
import { bytesToBase64 } from "../../../internal/encoding/index.js";
|
|
3
|
+
import { isPlainObject as isPlainRecord } from "../../../internal/validators/isPlainObject.js";
|
|
4
|
+
import { MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS, MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS, } from "../../../internal/validators/util/index.js";
|
|
5
|
+
import { assertContainerKekPathCurrent, assertDocumentKekPathsCurrent, } from "../../../data/documents/shared/containerKekCurrency.js";
|
|
6
|
+
import { buildDocumentLinkSetEventPlan } from "../../../data/documents/shared/events.js";
|
|
7
|
+
import { assertDocumentWriterProjectionConsistent, collectContainerKeksForDocumentSync, containerPathRefs, currentDocumentTargets, deriveDocumentTargetFromProjection, mergeTargetEnvelopes, readLinkedContainerIdsFromDocumentManifest, unwrapContainerKekPath, unwrapDocumentContentKeyFromWriterProjection, verifiedDocumentWrapTargets, } from "../../../data/documents/shared/projection.js";
|
|
8
|
+
import { assertDocumentManifestBundleConsistent, describeDocumentTargetKek, sortDocumentTargets, targetKey, uniqueSortedStrings, } from "../../../data/documents/shared/readers.js";
|
|
9
|
+
import { projectionVerificationOptions, } from "../../../data/documents/shared/types.js";
|
|
10
|
+
import { readCanonicalRecord } from "../../../data/keying/canonicalJson.js";
|
|
11
|
+
import { assertSubtreePurgePath, } from "../purge/subtreePurgeScope.js";
|
|
12
|
+
import { assertDocumentLinkAuthorAccess, verifyDocumentLinkSetCurrentPolicies, } from "./linkSetAuthority.js";
|
|
13
|
+
function deriveDocumentLinkSetTargetState(input) {
|
|
14
|
+
const currentTargets = currentDocumentTargets(input.writerProjection);
|
|
15
|
+
const currentLinkedContainerIds = readLinkedContainerIdsFromDocumentManifest(input.writerProjection);
|
|
16
|
+
const target = deriveDocumentTargetFromProjection(input.targetContainerProjection);
|
|
17
|
+
const currentTarget = currentTargets.find((candidate) => candidate.containerId === target.containerId);
|
|
18
|
+
if (input.operation === "link") {
|
|
19
|
+
if (currentTarget) {
|
|
20
|
+
throw new Error("Document link target is already linked");
|
|
21
|
+
}
|
|
22
|
+
assertDocumentLinkTargetCapacity(currentTargets.length);
|
|
23
|
+
assertDocumentLinkAuthorizationPathCapacity(input.writerProjection.authorizingContainerPaths.map((projection) => projection.path.length), input.targetContainerProjection.path.length);
|
|
24
|
+
return {
|
|
25
|
+
currentTargets,
|
|
26
|
+
linkedContainerIds: uniqueSortedStrings([
|
|
27
|
+
...currentLinkedContainerIds,
|
|
28
|
+
target.containerId,
|
|
29
|
+
]),
|
|
30
|
+
target,
|
|
31
|
+
targets: sortDocumentTargets([...currentTargets, target]),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (!currentTarget) {
|
|
35
|
+
throw new Error("Document unlink target is not linked");
|
|
36
|
+
}
|
|
37
|
+
if (targetKey(currentTarget) !== targetKey(target)) {
|
|
38
|
+
throw new Error("Document unlink target projection is stale");
|
|
39
|
+
}
|
|
40
|
+
const linkedContainerIds = currentLinkedContainerIds.filter((containerId) => containerId !== target.containerId);
|
|
41
|
+
if (linkedContainerIds.length === 0) {
|
|
42
|
+
throw new Error("Document unlink must leave a linked container");
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
currentTargets,
|
|
46
|
+
linkedContainerIds,
|
|
47
|
+
target,
|
|
48
|
+
targets: currentTargets.filter((candidate) => candidate.containerId !== target.containerId),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export function assertDocumentLinkTargetCapacity(currentTargetCount) {
|
|
52
|
+
if (currentTargetCount >= MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS) {
|
|
53
|
+
throw new RangeError(`A document cannot be linked to more than ${MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS} containers`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function assertDocumentLinkAuthorizationPathCapacity(currentPathLengths, targetPathLength) {
|
|
57
|
+
const totalReferences = currentPathLengths.reduce((total, length) => total + length, targetPathLength);
|
|
58
|
+
if (totalReferences > MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS) {
|
|
59
|
+
throw new RangeError(`Document links cannot require more than ${MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS} authorization references`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function wrapDocumentContentKeyForTargets(input) {
|
|
63
|
+
return Promise.all(sortDocumentTargets(input.targets).map(async (target) => {
|
|
64
|
+
const targetKek = input.keksByEpochId.get(target.containerKeyEpochId);
|
|
65
|
+
if (!targetKek) {
|
|
66
|
+
throw new Error(`Document target KEK could not be unwrapped for ${describeDocumentTargetKek(target)}`);
|
|
67
|
+
}
|
|
68
|
+
const wrapped = await wrapContentKey(input.contentKey, targetKek, {
|
|
69
|
+
kind: "Document",
|
|
70
|
+
objectId: input.documentId,
|
|
71
|
+
contentKeyEpoch: input.contentKeyEpoch,
|
|
72
|
+
containerId: target.containerId,
|
|
73
|
+
containerKeyEpochId: target.containerKeyEpochId,
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
...target,
|
|
77
|
+
wrappedKey: bytesToBase64(wrapped.ciphertext),
|
|
78
|
+
wrappingMetadata: {
|
|
79
|
+
suite: DOCUMENT_CONTENT_KEY_WRAP_SUITE,
|
|
80
|
+
iv: bytesToBase64(wrapped.iv),
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
// Resolve the organization a link/unlink mutation belongs to: the document's
|
|
86
|
+
// own org (from its manifest), which must equal the target container's org —
|
|
87
|
+
// both are owned by the same organization. The acting member's personal org is
|
|
88
|
+
// intentionally not part of this check; a member may link documents within any
|
|
89
|
+
// org they belong to. Returns the document org so the plan stamps it onto the
|
|
90
|
+
// signed event and manifest rather than the author's org.
|
|
91
|
+
async function resolveDocumentLinkSetMutationOrganization(input) {
|
|
92
|
+
const manifestIdentity = await assertDocumentManifestBundleConsistent({
|
|
93
|
+
bundle: input.writerProjection.documentManifest,
|
|
94
|
+
label: "Document link-set manifest",
|
|
95
|
+
});
|
|
96
|
+
if (manifestIdentity.organizationId !==
|
|
97
|
+
input.targetContainerProjection.organizationId) {
|
|
98
|
+
throw new Error("Document target container organization mismatch");
|
|
99
|
+
}
|
|
100
|
+
return manifestIdentity.organizationId;
|
|
101
|
+
}
|
|
102
|
+
function readDocumentLinkSetPreviousEpoch(writerProjection) {
|
|
103
|
+
const previousState = writerProjection.documentManifest.state;
|
|
104
|
+
const previousEpoch = isPlainRecord(previousState)
|
|
105
|
+
? Reflect.get(previousState, "epoch")
|
|
106
|
+
: undefined;
|
|
107
|
+
if (typeof previousEpoch !== "number" ||
|
|
108
|
+
!Number.isInteger(previousEpoch) ||
|
|
109
|
+
previousEpoch <= 0) {
|
|
110
|
+
throw new Error("Document link-set previous epoch is invalid");
|
|
111
|
+
}
|
|
112
|
+
return previousEpoch;
|
|
113
|
+
}
|
|
114
|
+
async function buildDocumentLinkSetMutationPlan({ author, blobRewraps, contentKeyEpoch, eventId = crypto.randomUUID(), operation, signedAt = new Date().toISOString(), targetContainerProjection, targetEnvelopes, writerProjection, }) {
|
|
115
|
+
const organizationId = await resolveDocumentLinkSetMutationOrganization({
|
|
116
|
+
targetContainerProjection,
|
|
117
|
+
writerProjection,
|
|
118
|
+
});
|
|
119
|
+
const targetState = deriveDocumentLinkSetTargetState({
|
|
120
|
+
operation,
|
|
121
|
+
targetContainerProjection,
|
|
122
|
+
writerProjection,
|
|
123
|
+
});
|
|
124
|
+
const targetEnvelopesForRequest = mergeTargetEnvelopes(targetState.targets, targetEnvelopes);
|
|
125
|
+
const targetContainerPathRefs = containerPathRefs(targetContainerProjection.path);
|
|
126
|
+
const eventPlan = await buildDocumentLinkSetEventPlan({
|
|
127
|
+
author,
|
|
128
|
+
blobRewraps,
|
|
129
|
+
eventId,
|
|
130
|
+
operation,
|
|
131
|
+
organizationId,
|
|
132
|
+
signedAt,
|
|
133
|
+
targetContainerPathRefs,
|
|
134
|
+
targetState,
|
|
135
|
+
writerProjection,
|
|
136
|
+
});
|
|
137
|
+
const previousEpoch = readDocumentLinkSetPreviousEpoch(writerProjection);
|
|
138
|
+
const state = {
|
|
139
|
+
version: 1,
|
|
140
|
+
documentId: writerProjection.documentId,
|
|
141
|
+
organizationId,
|
|
142
|
+
epoch: previousEpoch + 1,
|
|
143
|
+
previousManifestHash: writerProjection.documentManifest.manifestHash,
|
|
144
|
+
eventHash: eventPlan.eventHash,
|
|
145
|
+
linkedContainerIds: [...targetState.linkedContainerIds],
|
|
146
|
+
};
|
|
147
|
+
const manifest = await deriveDocumentLinkSetManifest(state);
|
|
148
|
+
const manifestHash = await computeAccessManifestHash(manifest);
|
|
149
|
+
const targetHash = await computeDocumentContentKeyTargetHash(targetState.targets);
|
|
150
|
+
return {
|
|
151
|
+
body: eventPlan.body,
|
|
152
|
+
contentKeyEpoch,
|
|
153
|
+
documentId: writerProjection.documentId,
|
|
154
|
+
event: eventPlan.event,
|
|
155
|
+
eventHash: eventPlan.eventHash,
|
|
156
|
+
manifest,
|
|
157
|
+
manifestHash,
|
|
158
|
+
operation,
|
|
159
|
+
request: {
|
|
160
|
+
event: readCanonicalRecord(eventPlan.event, "Document link-set event"),
|
|
161
|
+
body: readCanonicalRecord(eventPlan.body, "Document link-set body"),
|
|
162
|
+
expectedManifestHash: manifestHash,
|
|
163
|
+
manifest: readCanonicalRecord(manifest, "Document link-set manifest"),
|
|
164
|
+
targetContainerPathRefs,
|
|
165
|
+
authorizingContainerPathRefs: eventPlan.authorizingContainerPathRefs,
|
|
166
|
+
contentKeyBundle: {
|
|
167
|
+
contentKeyEpoch,
|
|
168
|
+
linkSetManifestHash: manifestHash,
|
|
169
|
+
targetHash,
|
|
170
|
+
targets: targetEnvelopesForRequest,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
state,
|
|
174
|
+
targetHash,
|
|
175
|
+
targets: sortDocumentTargets(targetState.targets),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
export async function buildMaterializedDocumentLinkSetMutationPlan(input) {
|
|
179
|
+
const verificationOptions = projectionVerificationOptions(input);
|
|
180
|
+
const principalPolicyCache = new Map();
|
|
181
|
+
await assertDocumentWriterProjectionConsistent(input.writerProjection, {
|
|
182
|
+
execSql: input.execSql,
|
|
183
|
+
principalPolicyCache,
|
|
184
|
+
...verificationOptions,
|
|
185
|
+
});
|
|
186
|
+
await verifyDocumentLinkSetCurrentPolicies({
|
|
187
|
+
execSql: input.execSql,
|
|
188
|
+
principalPolicyCache,
|
|
189
|
+
targetContainerProjection: input.targetContainerProjection,
|
|
190
|
+
writerProjection: input.writerProjection,
|
|
191
|
+
...verificationOptions,
|
|
192
|
+
});
|
|
193
|
+
assertSubtreePurgePath(input.targetContainerProjection.path, input.expectedSubtreeRoot);
|
|
194
|
+
if (input.resolveProjectionUserKey)
|
|
195
|
+
assertDocumentLinkAuthorAccess({
|
|
196
|
+
...input,
|
|
197
|
+
principalPolicies: [...principalPolicyCache.values()],
|
|
198
|
+
});
|
|
199
|
+
const targetState = deriveDocumentLinkSetTargetState({
|
|
200
|
+
operation: input.operation,
|
|
201
|
+
targetContainerProjection: input.targetContainerProjection,
|
|
202
|
+
writerProjection: input.writerProjection,
|
|
203
|
+
});
|
|
204
|
+
assertLinkSetWriteKeksCurrent(input, targetState.linkedContainerIds);
|
|
205
|
+
const currentContentKey = await unwrapDocumentContentKeyFromWriterProjection({
|
|
206
|
+
execSql: input.execSql,
|
|
207
|
+
secretKey: input.targetSecretKey,
|
|
208
|
+
writerProjection: input.writerProjection,
|
|
209
|
+
...verificationOptions,
|
|
210
|
+
});
|
|
211
|
+
const contentKeyRotated = input.operation === "unlink";
|
|
212
|
+
const contentKey = contentKeyRotated
|
|
213
|
+
? (input.contentKey ?? crypto.getRandomValues(new Uint8Array(32)))
|
|
214
|
+
: currentContentKey;
|
|
215
|
+
if (contentKey.byteLength !== 32) {
|
|
216
|
+
throw new Error("Document content key must be 32 bytes");
|
|
217
|
+
}
|
|
218
|
+
// A link carries the existing envelopes forward at the same epoch; an
|
|
219
|
+
// unlink rotates to a fresh key at the next one.
|
|
220
|
+
const contentKeyEpoch = input.writerProjection.contentKeyBundle.contentKeyEpoch +
|
|
221
|
+
(contentKeyRotated ? 1 : 0);
|
|
222
|
+
const targetEnvelopes = await buildLinkSetTargetEnvelopes(input, {
|
|
223
|
+
contentKey,
|
|
224
|
+
contentKeyEpoch,
|
|
225
|
+
targetState,
|
|
226
|
+
});
|
|
227
|
+
const plan = await buildDocumentLinkSetMutationPlan({
|
|
228
|
+
author: input.author,
|
|
229
|
+
blobRewraps: await input.prepareBlobRewraps(targetState.targets),
|
|
230
|
+
contentKeyEpoch,
|
|
231
|
+
eventId: input.eventId,
|
|
232
|
+
operation: input.operation,
|
|
233
|
+
signedAt: input.signedAt,
|
|
234
|
+
targetContainerProjection: input.targetContainerProjection,
|
|
235
|
+
targetEnvelopes,
|
|
236
|
+
writerProjection: input.writerProjection,
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
contentKey,
|
|
240
|
+
contentKeyRotated,
|
|
241
|
+
plan,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
async function buildLinkSetTargetEnvelopes(input, wrap) {
|
|
245
|
+
const verificationOptions = projectionVerificationOptions(input);
|
|
246
|
+
const sealing = {
|
|
247
|
+
contentKey: wrap.contentKey,
|
|
248
|
+
contentKeyEpoch: wrap.contentKeyEpoch,
|
|
249
|
+
documentId: input.writerProjection.documentId,
|
|
250
|
+
};
|
|
251
|
+
if (input.operation === "link") {
|
|
252
|
+
return [
|
|
253
|
+
...input.writerProjection.contentKeyBundle.targets,
|
|
254
|
+
...(await wrapDocumentContentKeyForTargets({
|
|
255
|
+
...sealing,
|
|
256
|
+
keksByEpochId: await unwrapContainerKekPath({
|
|
257
|
+
execSql: input.execSql,
|
|
258
|
+
projection: input.targetContainerProjection,
|
|
259
|
+
secretKey: input.targetSecretKey,
|
|
260
|
+
...verificationOptions,
|
|
261
|
+
}),
|
|
262
|
+
targets: [wrap.targetState.target],
|
|
263
|
+
})),
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
return wrapDocumentContentKeyForTargets({
|
|
267
|
+
...sealing,
|
|
268
|
+
keksByEpochId: (await collectContainerKeksForDocumentSync({
|
|
269
|
+
execSql: input.execSql,
|
|
270
|
+
secretKey: input.targetSecretKey,
|
|
271
|
+
writerProjection: input.writerProjection,
|
|
272
|
+
...verificationOptions,
|
|
273
|
+
})).keksByEpochId,
|
|
274
|
+
// The rotated key is wrapped only to verified current heads of the
|
|
275
|
+
// remaining linked containers, never to a server-listed epoch.
|
|
276
|
+
targets: verifiedDocumentWrapTargets({
|
|
277
|
+
linkedContainerIds: wrap.targetState.linkedContainerIds,
|
|
278
|
+
serverTargets: wrap.targetState.targets,
|
|
279
|
+
writerProjection: input.writerProjection,
|
|
280
|
+
}),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function assertLinkSetWriteKeksCurrent(input, linkedContainerIds) {
|
|
284
|
+
// Unlink can escape a stale branch; only recipients of the successor key must be current.
|
|
285
|
+
assertDocumentKekPathsCurrent(input.writerProjection, new Set(linkedContainerIds));
|
|
286
|
+
if (input.operation === "link") {
|
|
287
|
+
assertContainerKekPathCurrent(input.targetContainerProjection.containerKeks);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=index.js.map
|