@abloatai/humans 0.37.0
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/README.md +52 -0
- package/dist/Ablo.d.ts +208 -0
- package/dist/Ablo.js +120 -0
- package/dist/client.d.ts +317 -0
- package/dist/client.js +13 -0
- package/dist/core.d.ts +35 -0
- package/dist/core.js +48 -0
- package/dist/humans.d.ts +28 -0
- package/dist/humans.js +34 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +6 -0
- package/dist/local/BaseSyncedStore.d.ts +807 -0
- package/dist/local/BaseSyncedStore.js +1516 -0
- package/dist/local/Database.d.ts +322 -0
- package/dist/local/Database.js +1589 -0
- package/dist/local/InstanceCache.d.ts +255 -0
- package/dist/local/InstanceCache.js +1263 -0
- package/dist/local/LazyReferenceCollection.d.ts +177 -0
- package/dist/local/LazyReferenceCollection.js +461 -0
- package/dist/local/Model.d.ts +475 -0
- package/dist/local/Model.js +950 -0
- package/dist/local/ModelRegistry.d.ts +225 -0
- package/dist/local/ModelRegistry.js +539 -0
- package/dist/local/NetworkMonitor.d.ts +28 -0
- package/dist/local/NetworkMonitor.js +79 -0
- package/dist/local/RuntimeContext.d.ts +52 -0
- package/dist/local/RuntimeContext.js +80 -0
- package/dist/local/SyncClient.d.ts +516 -0
- package/dist/local/SyncClient.js +1754 -0
- package/dist/local/adapters/alwaysOnline.d.ts +14 -0
- package/dist/local/adapters/alwaysOnline.js +17 -0
- package/dist/local/adapters/inMemoryStorage.d.ts +37 -0
- package/dist/local/adapters/inMemoryStorage.js +122 -0
- package/dist/local/client/clientPrelude.d.ts +52 -0
- package/dist/local/client/clientPrelude.js +60 -0
- package/dist/local/client/consoleLogger.d.ts +35 -0
- package/dist/local/client/consoleLogger.js +44 -0
- package/dist/local/client/createInternalComponents.d.ts +50 -0
- package/dist/local/client/createInternalComponents.js +98 -0
- package/dist/local/client/createModelProxy.d.ts +248 -0
- package/dist/local/client/createModelProxy.js +880 -0
- package/dist/local/client/modelRegistration.d.ts +10 -0
- package/dist/local/client/modelRegistration.js +316 -0
- package/dist/local/client/options.d.ts +440 -0
- package/dist/local/client/options.js +7 -0
- package/dist/local/client/reactiveEngine.d.ts +53 -0
- package/dist/local/client/reactiveEngine.js +705 -0
- package/dist/local/client/resourceTypes.d.ts +12 -0
- package/dist/local/client/resourceTypes.js +10 -0
- package/dist/local/client/schemaConfig.d.ts +44 -0
- package/dist/local/client/schemaConfig.js +185 -0
- package/dist/local/client/storeCluster.d.ts +46 -0
- package/dist/local/client/storeCluster.js +133 -0
- package/dist/local/client/storeLifecycle.d.ts +61 -0
- package/dist/local/client/storeLifecycle.js +236 -0
- package/dist/local/client/validateAbloOptions.d.ts +42 -0
- package/dist/local/client/validateAbloOptions.js +43 -0
- package/dist/local/client/wsMutationExecutor.d.ts +27 -0
- package/dist/local/client/wsMutationExecutor.js +72 -0
- package/dist/local/context.d.ts +42 -0
- package/dist/local/context.js +81 -0
- package/dist/local/coordination/ClaimLog.d.ts +26 -0
- package/dist/local/coordination/ClaimLog.js +32 -0
- package/dist/local/interfaces/index.d.ts +311 -0
- package/dist/local/interfaces/index.js +9 -0
- package/dist/local/localModelContract.d.ts +14 -0
- package/dist/local/localModelContract.js +1 -0
- package/dist/local/logPosition.d.ts +31 -0
- package/dist/local/logPosition.js +53 -0
- package/dist/local/mutationPersistence.d.ts +6 -0
- package/dist/local/mutationPersistence.js +1 -0
- package/dist/local/mutators/RecordingMutation.d.ts +36 -0
- package/dist/local/mutators/RecordingMutation.js +182 -0
- package/dist/local/mutators/Transaction.d.ts +40 -0
- package/dist/local/mutators/Transaction.js +58 -0
- package/dist/local/mutators/UndoManager.d.ts +258 -0
- package/dist/local/mutators/UndoManager.js +665 -0
- package/dist/local/mutators/defineMutators.d.ts +60 -0
- package/dist/local/mutators/defineMutators.js +18 -0
- package/dist/local/mutators/inverseOp.d.ts +126 -0
- package/dist/local/mutators/inverseOp.js +71 -0
- package/dist/local/mutators/mutateActions.d.ts +45 -0
- package/dist/local/mutators/mutateActions.js +105 -0
- package/dist/local/mutators/readerActions.d.ts +33 -0
- package/dist/local/mutators/readerActions.js +57 -0
- package/dist/local/mutators/undoApply.d.ts +51 -0
- package/dist/local/mutators/undoApply.js +117 -0
- package/dist/local/persistence.d.ts +7 -0
- package/dist/local/persistence.js +9 -0
- package/dist/local/query/QueryProcessor.d.ts +75 -0
- package/dist/local/query/QueryProcessor.js +255 -0
- package/dist/local/query/client.d.ts +64 -0
- package/dist/local/query/client.js +138 -0
- package/dist/local/query/types.d.ts +85 -0
- package/dist/local/query/types.js +16 -0
- package/dist/local/schema/serialize.d.ts +1 -0
- package/dist/local/schema/serialize.js +1 -0
- package/dist/local/store/queryApi.d.ts +13 -0
- package/dist/local/store/queryApi.js +35 -0
- package/dist/local/storeContract.d.ts +145 -0
- package/dist/local/storeContract.js +12 -0
- package/dist/local/stores/DatabaseManager.d.ts +112 -0
- package/dist/local/stores/DatabaseManager.js +400 -0
- package/dist/local/stores/ObjectStore.d.ts +115 -0
- package/dist/local/stores/ObjectStore.js +393 -0
- package/dist/local/stores/ObjectStoreContract.d.ts +38 -0
- package/dist/local/stores/ObjectStoreContract.js +1 -0
- package/dist/local/stores/StoreManager.d.ts +114 -0
- package/dist/local/stores/StoreManager.js +304 -0
- package/dist/local/stores/SyncActionStore.d.ts +99 -0
- package/dist/local/stores/SyncActionStore.js +506 -0
- package/dist/local/stores/openIDBWithTimeout.d.ts +65 -0
- package/dist/local/stores/openIDBWithTimeout.js +153 -0
- package/dist/local/stores/persistenceCleanup.d.ts +7 -0
- package/dist/local/stores/persistenceCleanup.js +26 -0
- package/dist/local/stores/persistenceIdentity.d.ts +27 -0
- package/dist/local/stores/persistenceIdentity.js +38 -0
- package/dist/local/stores/syncAction.d.ts +26 -0
- package/dist/local/stores/syncAction.js +16 -0
- package/dist/local/stores/v1PersistenceDeletion.d.ts +8 -0
- package/dist/local/stores/v1PersistenceDeletion.js +16 -0
- package/dist/local/sync/BootstrapFetcher.d.ts +284 -0
- package/dist/local/sync/BootstrapFetcher.js +964 -0
- package/dist/local/sync/ConnectionManager.d.ts +8 -0
- package/dist/local/sync/ConnectionManager.js +8 -0
- package/dist/local/sync/OnDemandLoader.d.ts +231 -0
- package/dist/local/sync/OnDemandLoader.js +743 -0
- package/dist/local/sync/SubscriptionManager.d.ts +159 -0
- package/dist/local/sync/SubscriptionManager.js +243 -0
- package/dist/local/sync/SyncWebSocket.d.ts +173 -0
- package/dist/local/sync/SyncWebSocket.js +438 -0
- package/dist/local/sync/bootstrapApply.d.ts +73 -0
- package/dist/local/sync/bootstrapApply.js +73 -0
- package/dist/local/sync/commitFrames.d.ts +8 -0
- package/dist/local/sync/commitFrames.js +8 -0
- package/dist/local/sync/connectionManagerLifecycle.d.ts +23 -0
- package/dist/local/sync/connectionManagerLifecycle.js +126 -0
- package/dist/local/sync/contextPorts.d.ts +18 -0
- package/dist/local/sync/contextPorts.js +31 -0
- package/dist/local/sync/createClaimStream.d.ts +64 -0
- package/dist/local/sync/createClaimStream.js +475 -0
- package/dist/local/sync/createSnapshot.d.ts +29 -0
- package/dist/local/sync/createSnapshot.js +116 -0
- package/dist/local/sync/credentialLifecycle.d.ts +7 -0
- package/dist/local/sync/credentialLifecycle.js +7 -0
- package/dist/local/sync/deltaPipeline.d.ts +116 -0
- package/dist/local/sync/deltaPipeline.js +357 -0
- package/dist/local/sync/groupChange.d.ts +116 -0
- package/dist/local/sync/groupChange.js +244 -0
- package/dist/local/sync/initialize.d.ts +27 -0
- package/dist/local/sync/initialize.js +137 -0
- package/dist/local/sync/participants.d.ts +132 -0
- package/dist/local/sync/participants.js +342 -0
- package/dist/local/sync/persistedPrefix.d.ts +12 -0
- package/dist/local/sync/persistedPrefix.js +22 -0
- package/dist/local/sync/reconnect.d.ts +23 -0
- package/dist/local/sync/reconnect.js +55 -0
- package/dist/local/sync/schemaDrift.d.ts +55 -0
- package/dist/local/sync/schemaDrift.js +53 -0
- package/dist/local/sync/schemas.d.ts +71 -0
- package/dist/local/sync/schemas.js +94 -0
- package/dist/local/sync/socketEventWiring.d.ts +31 -0
- package/dist/local/sync/socketEventWiring.js +130 -0
- package/dist/local/sync/syncCursor.d.ts +40 -0
- package/dist/local/sync/syncCursor.js +55 -0
- package/dist/local/sync/syncPlan.d.ts +54 -0
- package/dist/local/sync/syncPlan.js +50 -0
- package/dist/local/sync/terminalSessionLifecycle.d.ts +20 -0
- package/dist/local/sync/terminalSessionLifecycle.js +50 -0
- package/dist/local/sync/wsFrameHandlers.d.ts +8 -0
- package/dist/local/sync/wsFrameHandlers.js +8 -0
- package/dist/local/transactions/databaseCommitOutbox.d.ts +15 -0
- package/dist/local/transactions/databaseCommitOutbox.js +16 -0
- package/dist/local/transactions/localMutation.d.ts +10 -0
- package/dist/local/transactions/localMutation.js +37 -0
- package/dist/local/transactions/mutations/MutationQueue.d.ts +511 -0
- package/dist/local/transactions/mutations/MutationQueue.js +1498 -0
- package/dist/local/transactions/mutations/MutationStore.d.ts +20 -0
- package/dist/local/transactions/mutations/MutationStore.js +53 -0
- package/dist/local/transactions/mutations/UnconfirmedWrites.d.ts +82 -0
- package/dist/local/transactions/mutations/UnconfirmedWrites.js +104 -0
- package/dist/local/transactions/mutations/batchProcessing.d.ts +64 -0
- package/dist/local/transactions/mutations/batchProcessing.js +349 -0
- package/dist/local/transactions/mutations/coalesceRules.d.ts +58 -0
- package/dist/local/transactions/mutations/coalesceRules.js +140 -0
- package/dist/local/transactions/mutations/commitApi.d.ts +19 -0
- package/dist/local/transactions/mutations/commitApi.js +74 -0
- package/dist/local/transactions/mutations/commitLane.d.ts +70 -0
- package/dist/local/transactions/mutations/commitLane.js +140 -0
- package/dist/local/transactions/mutations/commitLatency.d.ts +52 -0
- package/dist/local/transactions/mutations/commitLatency.js +130 -0
- package/dist/local/transactions/mutations/commitPayload.d.ts +165 -0
- package/dist/local/transactions/mutations/commitPayload.js +152 -0
- package/dist/local/transactions/mutations/commitTransport.d.ts +36 -0
- package/dist/local/transactions/mutations/commitTransport.js +104 -0
- package/dist/local/transactions/mutations/deltaConfirmation.d.ts +63 -0
- package/dist/local/transactions/mutations/deltaConfirmation.js +235 -0
- package/dist/local/transactions/mutations/durableCommitRestore.d.ts +17 -0
- package/dist/local/transactions/mutations/durableCommitRestore.js +95 -0
- package/dist/local/transactions/mutations/durableWriteStore.d.ts +14 -0
- package/dist/local/transactions/mutations/durableWriteStore.js +12 -0
- package/dist/local/transactions/mutations/executionSelection.d.ts +6 -0
- package/dist/local/transactions/mutations/executionSelection.js +42 -0
- package/dist/local/transactions/mutations/failureHandling.d.ts +16 -0
- package/dist/local/transactions/mutations/failureHandling.js +130 -0
- package/dist/local/transactions/mutations/failurePolicy.d.ts +13 -0
- package/dist/local/transactions/mutations/failurePolicy.js +48 -0
- package/dist/local/transactions/mutations/localMutation.d.ts +58 -0
- package/dist/local/transactions/mutations/localMutation.js +75 -0
- package/dist/local/transactions/mutations/modelOperations.d.ts +44 -0
- package/dist/local/transactions/mutations/modelOperations.js +144 -0
- package/dist/local/transactions/mutations/mutationPersistence.d.ts +25 -0
- package/dist/local/transactions/mutations/mutationPersistence.js +188 -0
- package/dist/local/transactions/mutations/pendingDrain.d.ts +33 -0
- package/dist/local/transactions/mutations/pendingDrain.js +112 -0
- package/dist/local/transactions/mutations/processingScheduler.d.ts +14 -0
- package/dist/local/transactions/mutations/processingScheduler.js +24 -0
- package/dist/local/transactions/mutations/queueCoalescing.d.ts +13 -0
- package/dist/local/transactions/mutations/queueCoalescing.js +35 -0
- package/dist/local/transactions/mutations/replayValidation.d.ts +187 -0
- package/dist/local/transactions/mutations/replayValidation.js +164 -0
- package/dist/local/transactions/reconnectDrain.d.ts +11 -0
- package/dist/local/transactions/reconnectDrain.js +13 -0
- package/dist/local/utils/mobxSetup.d.ts +53 -0
- package/dist/local/utils/mobxSetup.js +330 -0
- package/dist/local/views/QueryView.d.ts +79 -0
- package/dist/local/views/QueryView.js +218 -0
- package/dist/local/views/ViewRegistry.d.ts +20 -0
- package/dist/local/views/ViewRegistry.js +57 -0
- package/dist/local/views/incrementalView.d.ts +45 -0
- package/dist/local/views/incrementalView.js +69 -0
- package/dist/plugin.d.ts +285 -0
- package/dist/plugin.js +106 -0
- package/dist/presenceStream.d.ts +69 -0
- package/dist/presenceStream.js +200 -0
- package/dist/react/AbloProvider.d.ts +242 -0
- package/dist/react/AbloProvider.js +456 -0
- package/dist/react/ClientSideSuspense.d.ts +36 -0
- package/dist/react/ClientSideSuspense.js +17 -0
- package/dist/react/DefaultFallback.d.ts +24 -0
- package/dist/react/DefaultFallback.js +43 -0
- package/dist/react/context.d.ts +55 -0
- package/dist/react/context.js +29 -0
- package/dist/react/createAbloReact.d.ts +50 -0
- package/dist/react/createAbloReact.js +48 -0
- package/dist/react/internalContext.d.ts +33 -0
- package/dist/react/internalContext.js +3 -0
- package/dist/react/useAblo.d.ts +96 -0
- package/dist/react/useAblo.js +120 -0
- package/dist/react/useCurrentUserId.d.ts +2 -0
- package/dist/react/useCurrentUserId.js +12 -0
- package/dist/react/useErrorListener.d.ts +2 -0
- package/dist/react/useErrorListener.js +14 -0
- package/dist/react/useMutationFailureListener.d.ts +8 -0
- package/dist/react/useMutationFailureListener.js +19 -0
- package/dist/react/useMutators.d.ts +56 -0
- package/dist/react/useMutators.js +84 -0
- package/dist/react/useSyncStatus.d.ts +19 -0
- package/dist/react/useSyncStatus.js +37 -0
- package/dist/react/useUndoScope.d.ts +34 -0
- package/dist/react/useUndoScope.js +73 -0
- package/dist/react.d.ts +18 -0
- package/dist/react.js +14 -0
- package/dist/reactRuntime.d.ts +4 -0
- package/dist/reactRuntime.js +2 -0
- package/dist/surface.d.ts +36 -0
- package/dist/surface.js +77 -0
- package/dist/useReactive.d.ts +6 -0
- package/dist/useReactive.js +43 -0
- package/package.json +119 -0
- package/src/Ablo.ts +456 -0
- package/src/client.ts +374 -0
- package/src/core.ts +104 -0
- package/src/humans.ts +61 -0
- package/src/index.ts +40 -0
- package/src/local/BaseSyncedStore.ts +1991 -0
- package/src/local/Database.ts +2052 -0
- package/src/local/InstanceCache.ts +1503 -0
- package/src/local/LazyReferenceCollection.ts +563 -0
- package/src/local/Model.ts +1124 -0
- package/src/local/ModelRegistry.ts +762 -0
- package/src/local/NetworkMonitor.ts +88 -0
- package/src/local/RuntimeContext.ts +141 -0
- package/src/local/SyncClient.ts +2131 -0
- package/src/local/adapters/alwaysOnline.ts +20 -0
- package/src/local/adapters/inMemoryStorage.ts +141 -0
- package/src/local/client/clientPrelude.ts +112 -0
- package/src/local/client/consoleLogger.ts +60 -0
- package/src/local/client/createInternalComponents.ts +163 -0
- package/src/local/client/createModelProxy.ts +1390 -0
- package/src/local/client/modelRegistration.ts +350 -0
- package/src/local/client/options.ts +526 -0
- package/src/local/client/reactiveEngine.ts +935 -0
- package/src/local/client/resourceTypes.ts +37 -0
- package/src/local/client/schemaConfig.ts +194 -0
- package/src/local/client/storeCluster.ts +172 -0
- package/src/local/client/storeLifecycle.ts +343 -0
- package/src/local/client/validateAbloOptions.ts +95 -0
- package/src/local/client/wsMutationExecutor.ts +110 -0
- package/src/local/context.ts +96 -0
- package/src/local/coordination/ClaimLog.ts +39 -0
- package/src/local/interfaces/index.ts +468 -0
- package/src/local/localModelContract.ts +15 -0
- package/src/local/logPosition.ts +84 -0
- package/src/local/mutationPersistence.ts +7 -0
- package/src/local/mutators/RecordingMutation.ts +222 -0
- package/src/local/mutators/Transaction.ts +97 -0
- package/src/local/mutators/UndoManager.ts +741 -0
- package/src/local/mutators/defineMutators.ts +76 -0
- package/src/local/mutators/inverseOp.ts +83 -0
- package/src/local/mutators/mutateActions.ts +167 -0
- package/src/local/mutators/readerActions.ts +99 -0
- package/src/local/mutators/undoApply.ts +141 -0
- package/src/local/persistence.ts +16 -0
- package/src/local/query/QueryProcessor.ts +347 -0
- package/src/local/query/client.ts +197 -0
- package/src/local/query/types.ts +102 -0
- package/src/local/schema/serialize.ts +1 -0
- package/src/local/store/queryApi.ts +56 -0
- package/src/local/storeContract.ts +146 -0
- package/src/local/stores/DatabaseManager.ts +507 -0
- package/src/local/stores/ObjectStore.ts +449 -0
- package/src/local/stores/ObjectStoreContract.ts +48 -0
- package/src/local/stores/StoreManager.ts +388 -0
- package/src/local/stores/SyncActionStore.ts +579 -0
- package/src/local/stores/openIDBWithTimeout.ts +195 -0
- package/src/local/stores/persistenceCleanup.ts +43 -0
- package/src/local/stores/persistenceIdentity.ts +83 -0
- package/src/local/stores/syncAction.ts +21 -0
- package/src/local/stores/v1PersistenceDeletion.ts +21 -0
- package/src/local/sync/BootstrapFetcher.ts +1224 -0
- package/src/local/sync/ConnectionManager.ts +15 -0
- package/src/local/sync/OnDemandLoader.ts +927 -0
- package/src/local/sync/SubscriptionManager.ts +300 -0
- package/src/local/sync/SyncWebSocket.ts +584 -0
- package/src/local/sync/bootstrapApply.ts +130 -0
- package/src/local/sync/commitFrames.ts +16 -0
- package/src/local/sync/connectionManagerLifecycle.ts +158 -0
- package/src/local/sync/contextPorts.ts +37 -0
- package/src/local/sync/createClaimStream.ts +668 -0
- package/src/local/sync/createSnapshot.ts +160 -0
- package/src/local/sync/credentialLifecycle.ts +18 -0
- package/src/local/sync/deltaPipeline.ts +473 -0
- package/src/local/sync/groupChange.ts +343 -0
- package/src/local/sync/initialize.ts +205 -0
- package/src/local/sync/participants.ts +564 -0
- package/src/local/sync/persistedPrefix.ts +27 -0
- package/src/local/sync/reconnect.ts +88 -0
- package/src/local/sync/schemaDrift.ts +86 -0
- package/src/local/sync/schemas.ts +118 -0
- package/src/local/sync/socketEventWiring.ts +196 -0
- package/src/local/sync/syncCursor.ts +62 -0
- package/src/local/sync/syncPlan.ts +89 -0
- package/src/local/sync/terminalSessionLifecycle.ts +66 -0
- package/src/local/sync/wsFrameHandlers.ts +20 -0
- package/src/local/transactions/databaseCommitOutbox.ts +33 -0
- package/src/local/transactions/localMutation.ts +58 -0
- package/src/local/transactions/mutations/MutationQueue.ts +1998 -0
- package/src/local/transactions/mutations/MutationStore.ts +65 -0
- package/src/local/transactions/mutations/UnconfirmedWrites.ts +133 -0
- package/src/local/transactions/mutations/batchProcessing.ts +469 -0
- package/src/local/transactions/mutations/coalesceRules.ts +192 -0
- package/src/local/transactions/mutations/commitApi.ts +97 -0
- package/src/local/transactions/mutations/commitLane.ts +191 -0
- package/src/local/transactions/mutations/commitLatency.ts +164 -0
- package/src/local/transactions/mutations/commitPayload.ts +281 -0
- package/src/local/transactions/mutations/commitTransport.ts +174 -0
- package/src/local/transactions/mutations/deltaConfirmation.ts +298 -0
- package/src/local/transactions/mutations/durableCommitRestore.ts +128 -0
- package/src/local/transactions/mutations/durableWriteStore.ts +21 -0
- package/src/local/transactions/mutations/executionSelection.ts +42 -0
- package/src/local/transactions/mutations/failureHandling.ts +154 -0
- package/src/local/transactions/mutations/failurePolicy.ts +61 -0
- package/src/local/transactions/mutations/localMutation.ts +135 -0
- package/src/local/transactions/mutations/modelOperations.ts +210 -0
- package/src/local/transactions/mutations/mutationPersistence.ts +231 -0
- package/src/local/transactions/mutations/pendingDrain.ts +160 -0
- package/src/local/transactions/mutations/processingScheduler.ts +35 -0
- package/src/local/transactions/mutations/queueCoalescing.ts +45 -0
- package/src/local/transactions/mutations/replayValidation.ts +192 -0
- package/src/local/transactions/reconnectDrain.ts +24 -0
- package/src/local/utils/mobxSetup.ts +388 -0
- package/src/local/views/QueryView.ts +311 -0
- package/src/local/views/ViewRegistry.ts +61 -0
- package/src/local/views/incrementalView.ts +92 -0
- package/src/plugin.ts +396 -0
- package/src/presenceStream.ts +279 -0
- package/src/react/AbloProvider.tsx +744 -0
- package/src/react/ClientSideSuspense.tsx +57 -0
- package/src/react/DefaultFallback.tsx +60 -0
- package/src/react/context.ts +89 -0
- package/src/react/createAbloReact.ts +116 -0
- package/src/react/internalContext.ts +38 -0
- package/src/react/useAblo.ts +280 -0
- package/src/react/useCurrentUserId.ts +17 -0
- package/src/react/useErrorListener.ts +22 -0
- package/src/react/useMutationFailureListener.ts +34 -0
- package/src/react/useMutators.ts +184 -0
- package/src/react/useSyncStatus.ts +42 -0
- package/src/react/useUndoScope.ts +143 -0
- package/src/react.ts +69 -0
- package/src/reactRuntime.ts +10 -0
- package/src/surface.ts +106 -0
- package/src/useReactive.ts +51 -0
package/src/Ablo.ts
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Ablo` — the one-call entry point to the sync engine client. It hides the
|
|
3
|
+
* internal wiring — the object pool, local database, sync client, WebSocket,
|
|
4
|
+
* bootstrap, and offline queue — behind a single function that returns a typed
|
|
5
|
+
* client with one property per model in your schema.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { Ablo } from '@abloatai/humans';
|
|
9
|
+
* import { schema } from './schema';
|
|
10
|
+
*
|
|
11
|
+
* const sync = Ablo({ schema, apiKey: process.env.ABLO_API_KEY });
|
|
12
|
+
*
|
|
13
|
+
* const reports = sync.reports.list({ where: { status: 'todo' } });
|
|
14
|
+
* await sync.reports.create({ data: { title: 'Fix bug' } });
|
|
15
|
+
* await sync.reports.update({
|
|
16
|
+
* id: reportId,
|
|
17
|
+
* data: { status: 'ready' },
|
|
18
|
+
* });
|
|
19
|
+
* await sync.reports.delete({ id: reportId });
|
|
20
|
+
*
|
|
21
|
+
* This module is the composition root and the merge point, and only those.
|
|
22
|
+
* `Ablo` is three declarations sharing one name — the factory, the client
|
|
23
|
+
* type, and the `Ablo.*` namespace — and TypeScript merges declarations only
|
|
24
|
+
* within a single file, so the three have to sit together. Their bodies do
|
|
25
|
+
* not: the client's shape is `./abloClient`, the pass over the options bag is
|
|
26
|
+
* `./clientPrelude`, and the client this dispatches to is `./reactiveEngine`.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import type { SchemaRecord } from '@abloatai/transaction/schema/schema';
|
|
30
|
+
import { AbloValidationError } from '@abloatai/transaction/errors';
|
|
31
|
+
import { SyncWebSocket, type DefaultCollaborationEvents } from './local/sync/SyncWebSocket.js';
|
|
32
|
+
// Both halves of the plugin lifecycle: `resolvePlugins` turns the declared list
|
|
33
|
+
// into a surface, `layerPluginSurface` merges that surface onto the built client.
|
|
34
|
+
import {
|
|
35
|
+
layerPluginSurface,
|
|
36
|
+
resolvePlugins,
|
|
37
|
+
type AbloPlugin,
|
|
38
|
+
type MergedSurface,
|
|
39
|
+
} from '@abloatai/humans/plugin';
|
|
40
|
+
import { humans, type HumansSurface } from './humans.js';
|
|
41
|
+
import { kStoreCluster } from './local/client/storeCluster.js';
|
|
42
|
+
import { buildReactiveEngine } from './local/client/reactiveEngine.js';
|
|
43
|
+
import { resolveClientPrelude } from './local/client/clientPrelude.js';
|
|
44
|
+
|
|
45
|
+
// ── Supporting modules ────────────────────────────────────────────────────
|
|
46
|
+
// The option types, the client's public shape, the pass over the options bag,
|
|
47
|
+
// the resource-type surface, and the default WebSocket mutation executor each
|
|
48
|
+
// live in their own module. The type-only ones (`options`, `abloClient`,
|
|
49
|
+
// `resourceTypes`) carry no runtime imports, which lets the HTTP client and the
|
|
50
|
+
// session-mint helpers reference the client types without importing this
|
|
51
|
+
// factory back and creating an import cycle.
|
|
52
|
+
import type { AbloOptions } from './local/client/options.js';
|
|
53
|
+
// `AbloReads` is named by `Ablo.Reads` in the namespace below as well as
|
|
54
|
+
// re-exported, so it needs the import too — same reason as `AbloOptions`.
|
|
55
|
+
import type { AbloClient, AbloReads } from './client.js';
|
|
56
|
+
|
|
57
|
+
// `AbloOptions` is named in the signatures below as well as re-exported, so it
|
|
58
|
+
// needs the import above in addition to this line — `export … from` re-exports
|
|
59
|
+
// a name without binding it locally.
|
|
60
|
+
export type {
|
|
61
|
+
CredentialProvider,
|
|
62
|
+
AbloOptions,
|
|
63
|
+
InternalAbloOptions,
|
|
64
|
+
} from './local/client/options.js';
|
|
65
|
+
export type { AbloReads } from './client.js';
|
|
66
|
+
// `ModelTarget` (the model/id locator) and `ModelClaim` (the resolved claim
|
|
67
|
+
// view) are defined once in the settlement core, derived from a single zod
|
|
68
|
+
// schema so the typed client, the HTTP client, and the server share one
|
|
69
|
+
// definition. They reach consumers through `./resourceTypes` with the rest of
|
|
70
|
+
// the resource surface; re-exported here so `ablo.ModelTarget` and
|
|
71
|
+
// `ablo.ModelClaim` stay stable.
|
|
72
|
+
export type { ModelTarget, ModelClaim } from './local/client/resourceTypes.js';
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The typed sync engine client — one property per model in the schema.
|
|
76
|
+
*
|
|
77
|
+
* The shape itself is declared in `./abloClient`; this alias is what merges
|
|
78
|
+
* with the factory and the namespace under the one `Ablo` name.
|
|
79
|
+
*/
|
|
80
|
+
export type Ablo<S extends SchemaRecord> = AbloClient<S>;
|
|
81
|
+
|
|
82
|
+
// ── The factory ───────────────────────────────────────────────────────────
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Create a sync engine client in one call.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* const sync = Ablo({ schema, apiKey: process.env.ABLO_API_KEY });
|
|
89
|
+
*
|
|
90
|
+
* const reports = sync.weatherReports.list({ where: { status: 'pending' } });
|
|
91
|
+
* await sync.weatherReports.create({ location: 'Stockholm', status: 'pending' });
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* In the browser (or any client that shouldn't hold a secret key), point
|
|
95
|
+
* `authEndpoint` at your session-mint route instead — the SDK fetches it, keeps the
|
|
96
|
+
* short-lived token fresh, and re-mints on expiry:
|
|
97
|
+
*
|
|
98
|
+
* ```ts
|
|
99
|
+
* const ablo = Ablo({ schema, authEndpoint: '/api/ablo-session' });
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* Server-side agents, workers, and services use `@abloatai/transaction`.
|
|
103
|
+
*/
|
|
104
|
+
export function Ablo<
|
|
105
|
+
const S extends SchemaRecord,
|
|
106
|
+
const P extends readonly AbloPlugin[],
|
|
107
|
+
>(
|
|
108
|
+
options: AbloOptions<S> & { plugins: P },
|
|
109
|
+
): Ablo<S> & MergedSurface<P>;
|
|
110
|
+
export function Ablo<const S extends SchemaRecord>(
|
|
111
|
+
options: AbloOptions<S>,
|
|
112
|
+
): Ablo<S>;
|
|
113
|
+
export function Ablo<const S extends SchemaRecord>(
|
|
114
|
+
options: AbloOptions<S>,
|
|
115
|
+
): Ablo<S> {
|
|
116
|
+
// 1. One pass over the options bag settles the credential and its refresh
|
|
117
|
+
// resolver, the base URL, the logger, and this participant's identity —
|
|
118
|
+
// and fails on a misconfiguration before anything is constructed.
|
|
119
|
+
const prelude = resolveClientPrelude(options);
|
|
120
|
+
const { internalOptions, authCredentials, logger, url, participantId, kind } = prelude;
|
|
121
|
+
|
|
122
|
+
// 2. The connection, built here in the composition root — before the plugin
|
|
123
|
+
// list resolves, so `PluginContext.transport` carries the instance a
|
|
124
|
+
// plugin holds for the client's lifetime. It holds no socket until
|
|
125
|
+
// `connect()`, and `deferConnect` keeps even that closed until the store
|
|
126
|
+
// has seeded identity and read scope during `ready()` — the late-bound
|
|
127
|
+
// values (`kind`, the credential, `syncGroups`, the resume cursor) are
|
|
128
|
+
// seeded there, not here. Whether to build it is read off what the
|
|
129
|
+
// listed plugins DECLARE — a plugin that requires a duplex transport
|
|
130
|
+
// gets one to attach to — never off a plugin's name.
|
|
131
|
+
const pluginList: readonly AbloPlugin[] = options.plugins ?? [humans()];
|
|
132
|
+
const transport = pluginList.some((plugin) => plugin.requires?.duplex === true)
|
|
133
|
+
? new SyncWebSocket<DefaultCollaborationEvents>({
|
|
134
|
+
baseUrl: url,
|
|
135
|
+
kind,
|
|
136
|
+
getAuthToken: authCredentials.getAuthToken,
|
|
137
|
+
collaborationEvents: [...(internalOptions.collaborationEvents ?? [])],
|
|
138
|
+
syncGroups: [...(internalOptions.syncGroups ?? [])],
|
|
139
|
+
deferConnect: true,
|
|
140
|
+
})
|
|
141
|
+
: null;
|
|
142
|
+
|
|
143
|
+
// Resolve the capability list before anything heavy is constructed
|
|
144
|
+
// (ADR 0016). The two configuration gates — a duplicate id, a transport
|
|
145
|
+
// mismatch — fire here, while the stack still points at the caller's own
|
|
146
|
+
// setup. With no list given, the reactive local store is installed.
|
|
147
|
+
// The context carries the host's resolved values — url,
|
|
148
|
+
// credential source, identity — so `humans().init` constructs the store
|
|
149
|
+
// cluster right here, during resolution.
|
|
150
|
+
const installedPlugins: Record<string, unknown> = resolvePlugins(
|
|
151
|
+
pluginList,
|
|
152
|
+
{ duplex: true },
|
|
153
|
+
{
|
|
154
|
+
logger,
|
|
155
|
+
observability: internalOptions.observability,
|
|
156
|
+
// The raw options bag plus the host's resolved values, so plugins
|
|
157
|
+
// read configuration without re-deriving identity.
|
|
158
|
+
options,
|
|
159
|
+
...(transport ? { transport } : {}),
|
|
160
|
+
participant: { id: participantId, kind },
|
|
161
|
+
syncGroups: internalOptions.syncGroups ?? [],
|
|
162
|
+
url,
|
|
163
|
+
auth: authCredentials,
|
|
164
|
+
},
|
|
165
|
+
);
|
|
166
|
+
const humansSurface = installedPlugins.humans as HumansSurface | undefined;
|
|
167
|
+
if (!humansSurface) {
|
|
168
|
+
throw new AbloValidationError(
|
|
169
|
+
'The humans client requires the humans() materializer plugin.',
|
|
170
|
+
{ code: 'invalid_options', param: 'plugins' },
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
if (!humansSurface.presence) {
|
|
174
|
+
// A foreign plugin is squatting on the reserved 'humans' id — its surface
|
|
175
|
+
// is not the one this client is built from.
|
|
176
|
+
throw new AbloValidationError(
|
|
177
|
+
"The 'humans' plugin id is reserved for the SDK's own humans() plugin. " +
|
|
178
|
+
'Rename the custom plugin.',
|
|
179
|
+
{ code: 'invalid_options', param: 'plugins' },
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (!transport) {
|
|
184
|
+
// Unreachable: the humans surface exists only when the list contained
|
|
185
|
+
// 'humans', which is exactly the condition the transport was built under.
|
|
186
|
+
throw new AbloValidationError(
|
|
187
|
+
'The reactive client was selected but no connection was constructed.',
|
|
188
|
+
{ code: 'invalid_options', param: 'plugins' },
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const cluster = humansSurface[kStoreCluster];
|
|
193
|
+
if (!cluster) {
|
|
194
|
+
// Unreachable on this path: the context above carries everything the
|
|
195
|
+
// cluster needs (connection, url, credential source, schema). A missing
|
|
196
|
+
// cluster means the context and the plugin disagree — say so rather
|
|
197
|
+
// than building a client with no store.
|
|
198
|
+
throw new AbloValidationError(
|
|
199
|
+
'The reactive client was selected but no store was constructed.',
|
|
200
|
+
{ code: 'invalid_options', param: 'plugins' },
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// The reactive engine is the humans() capability: `init` constructed the
|
|
205
|
+
// store cluster (runtime, component graph, store) from the widened
|
|
206
|
+
// context; what remains here builds in `./reactiveEngine.ts`, fed the
|
|
207
|
+
// prelude plus the plugin's contributions. The host owns assembly;
|
|
208
|
+
// plugins declare and construct their own parts. A plugin surface that
|
|
209
|
+
// hands back a whole-client constructor inverts that relationship —
|
|
210
|
+
// tried and rejected (ADR 0016, follow-up 3b).
|
|
211
|
+
return layerPluginSurface(buildReactiveEngine<S>({
|
|
212
|
+
...prelude,
|
|
213
|
+
options,
|
|
214
|
+
transport,
|
|
215
|
+
presence: humansSurface.presence,
|
|
216
|
+
cluster,
|
|
217
|
+
createSibling: (siblingOptions) => Ablo(siblingOptions),
|
|
218
|
+
}), installedPlugins);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
222
|
+
// Ablo namespace — type access via `Ablo.X` for the modern SDK shape
|
|
223
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
224
|
+
//
|
|
225
|
+
// One default import, with types hung underneath via namespace dots:
|
|
226
|
+
// `import { Ablo } from "@abloatai/humans"` gets the factory, its return type, and
|
|
227
|
+
// every type a typical consumer references (`Ablo.Peer`, `Ablo.Snapshot<S, K>`,
|
|
228
|
+
// and so on) — all purely type-level, with zero runtime cost.
|
|
229
|
+
//
|
|
230
|
+
// The types still live in their canonical homes (`types/streams`, `principal`,
|
|
231
|
+
// this file); the namespace re-exports them as a convenience path. Named imports
|
|
232
|
+
// continue to work for callers who prefer them.
|
|
233
|
+
|
|
234
|
+
import type * as _Streams from '@abloatai/transaction/types/streams';
|
|
235
|
+
import type * as _Participants from './local/sync/participants.js';
|
|
236
|
+
import type * as _Policy from '@abloatai/transaction/policy/types';
|
|
237
|
+
import type * as _Mutators from './local/mutators/defineMutators.js';
|
|
238
|
+
import type * as _Tx from './local/mutators/Transaction.js';
|
|
239
|
+
import type * as _Undo from './local/mutators/UndoManager.js';
|
|
240
|
+
import type * as _SchemaTypes from '@abloatai/transaction/schema/schema';
|
|
241
|
+
import type * as _Global from '@abloatai/transaction/types/global';
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The canonical type namespace.
|
|
245
|
+
*
|
|
246
|
+
* Rules applied uniformly to every addition:
|
|
247
|
+
*
|
|
248
|
+
* 1. Flat by default. `Ablo.X`. Fewest dots wins.
|
|
249
|
+
* 2. Sub-namespace only when (a) four or more types share a single conceptual
|
|
250
|
+
* prefix and (b) the names read better with it (`Conflict.Kind` over
|
|
251
|
+
* `ConflictKind`). If the cluster is heterogeneous (streams, data, handles),
|
|
252
|
+
* keep it flat.
|
|
253
|
+
* 3. Only types a consumer would write `: Ablo.X` for. Inferred-only types stay
|
|
254
|
+
* unexported.
|
|
255
|
+
* 4. Wire shapes never appear on `Ablo.*` — engine vocabulary only.
|
|
256
|
+
* 5. Advanced or framework-integration types stay internal unless they graduate
|
|
257
|
+
* into one of the public subpaths.
|
|
258
|
+
*/
|
|
259
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
260
|
+
export namespace Ablo {
|
|
261
|
+
// ── Factory options ────────────────────────────────────────────────
|
|
262
|
+
export type Options<S extends SchemaRecord = SchemaRecord> = AbloOptions<S>;
|
|
263
|
+
/**
|
|
264
|
+
* The read view of the client that `useAblo` selectors receive: model reads
|
|
265
|
+
* typed as reactive rows (data fields + computeds, no relation accessors).
|
|
266
|
+
*/
|
|
267
|
+
export type Reads<S extends SchemaRecord = SchemaRecord> = AbloReads<S>;
|
|
268
|
+
// Claimed-state options stay flat — same concept reused by claims and models.
|
|
269
|
+
export type IfClaimedPolicy = import('./local/client/resourceTypes.js').IfClaimedPolicy;
|
|
270
|
+
export type ClaimedOptions = import('./local/client/resourceTypes.js').ClaimedOptions;
|
|
271
|
+
|
|
272
|
+
// ── Entity pointers (flat — input shapes used everywhere) ─────────
|
|
273
|
+
export type ClaimTarget = _Streams.ClaimTarget;
|
|
274
|
+
export type PresenceTarget = _Streams.PresenceTarget;
|
|
275
|
+
export type Duration = _Streams.Duration;
|
|
276
|
+
|
|
277
|
+
// ── Real-time multiplayer (flat — heterogeneous cluster) ──────────
|
|
278
|
+
export type PresenceStream = _Streams.PresenceStream;
|
|
279
|
+
export type ClaimStream = _Streams.ClaimStream;
|
|
280
|
+
export type Peer = _Streams.Peer;
|
|
281
|
+
export type Activity = _Streams.Activity;
|
|
282
|
+
export type Claim = _Streams.Claim;
|
|
283
|
+
export type ClaimRejection = _Streams.ClaimRejection;
|
|
284
|
+
export type ClaimLost = _Streams.ClaimLost;
|
|
285
|
+
|
|
286
|
+
// ── Long-running work (flat — the async surface of a claim) ───────
|
|
287
|
+
// Work that outlives a claim's crash-cleanup TTL holds its lease by
|
|
288
|
+
// BEATING (`held.heartbeat()` / `claim({ heartbeat: true })`). The beat's
|
|
289
|
+
// answer carries the extended expiry and the queue pressure behind the
|
|
290
|
+
// lease; a beat on a lapsed lease rejects with `AbloClaimedError` — for a
|
|
291
|
+
// socketless worker, the failed beat IS the loss notification.
|
|
292
|
+
export type ClaimHeartbeat = _Streams.ClaimHeartbeat;
|
|
293
|
+
export type ClaimHeartbeatOptions = _Streams.ClaimHeartbeatOptions;
|
|
294
|
+
|
|
295
|
+
// ── Singletons (flat — no cohort) ─────────────────────────────────
|
|
296
|
+
export type Snapshot<
|
|
297
|
+
TSchema extends _SchemaTypes.Schema = _SchemaTypes.Schema,
|
|
298
|
+
K extends keyof TSchema['models'] = keyof TSchema['models'],
|
|
299
|
+
> = _Streams.Snapshot<TSchema, K>;
|
|
300
|
+
|
|
301
|
+
// ── Auth (sub-namespace — actor attribution) ──────────────────────
|
|
302
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
303
|
+
export namespace Auth {
|
|
304
|
+
export type Actor = _Streams.ParticipantRef;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// ── Participant (sub-namespace — 5 names, shared concept) ─────────
|
|
308
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
309
|
+
export namespace Participant {
|
|
310
|
+
export type Manager = _Participants.ParticipantManager;
|
|
311
|
+
export type Joined = _Participants.JoinedParticipant;
|
|
312
|
+
export type Scope = _Participants.ParticipantScope;
|
|
313
|
+
export type Status = _Participants.ParticipantStatus;
|
|
314
|
+
export type JoinOptions = _Participants.ParticipantJoinOptions;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// ── Schema (type + sub-namespace via declaration merge) ───────────
|
|
318
|
+
export type Schema<S extends _SchemaTypes.SchemaRecord = _SchemaTypes.SchemaRecord> = _SchemaTypes.Schema<S>;
|
|
319
|
+
/**
|
|
320
|
+
* The schema this program has registered via `interface Register { Schema }`
|
|
321
|
+
* (falls back to a loose shape when unregistered). Use it where shared code
|
|
322
|
+
* needs "this app's schema" without importing a specific one —
|
|
323
|
+
* `Ablo<Ablo.ResolveSchema['models']>` resolves to whatever the consuming
|
|
324
|
+
* app registered, so one component types correctly across apps that bind
|
|
325
|
+
* different schemas.
|
|
326
|
+
*/
|
|
327
|
+
export type ResolveSchema = _Global.ResolveSchema;
|
|
328
|
+
/**
|
|
329
|
+
* `ResolveSchema` guaranteed to satisfy the `Schema` bound. `ResolveSchema`
|
|
330
|
+
* falls back to a loose `{ models }` shape when nothing is registered, which
|
|
331
|
+
* doesn't extend the branded `Schema` type — so generics bounded by `Schema`
|
|
332
|
+
* (mutator anchors, `Transaction<S>`) can't take `ResolveSchema` directly.
|
|
333
|
+
* `RegisteredSchema` collapses that fallback to `Schema`, so shared mutator
|
|
334
|
+
* code can anchor "this app's schema" and stay assignable at the consumer,
|
|
335
|
+
* which reads the same `Register`. Both resolve in lockstep per app.
|
|
336
|
+
*/
|
|
337
|
+
export type RegisteredSchema = _Global.ResolveSchema extends _SchemaTypes.Schema
|
|
338
|
+
? _Global.ResolveSchema
|
|
339
|
+
: _SchemaTypes.Schema;
|
|
340
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
341
|
+
export namespace Schema {
|
|
342
|
+
export type Model<
|
|
343
|
+
S extends _SchemaTypes.Schema,
|
|
344
|
+
K extends keyof S['models'],
|
|
345
|
+
> = _SchemaTypes.Model<S, K>;
|
|
346
|
+
export type InferCreate<
|
|
347
|
+
S extends _SchemaTypes.Schema,
|
|
348
|
+
K extends keyof S['models'],
|
|
349
|
+
> = _SchemaTypes.InferCreate<S, K>;
|
|
350
|
+
/**
|
|
351
|
+
* The reactive-row companion to {@link Model}: data fields + computed
|
|
352
|
+
* getters, no relation accessors, no model methods — the shape `useAblo`
|
|
353
|
+
* reads return.
|
|
354
|
+
*/
|
|
355
|
+
export type InferRow<
|
|
356
|
+
S extends _SchemaTypes.Schema,
|
|
357
|
+
K extends keyof S['models'],
|
|
358
|
+
> = _SchemaTypes.InferRow<S, K>;
|
|
359
|
+
export type InferModelNames<S extends _SchemaTypes.Schema> = _SchemaTypes.InferModelNames<S>;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// ── Conflict (type + sub-namespace via declaration merge) ─────────
|
|
363
|
+
export type Conflict = _Policy.Conflict;
|
|
364
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
365
|
+
export namespace Conflict {
|
|
366
|
+
export type Kind = _Policy.ConflictKind;
|
|
367
|
+
export type Operation = _Policy.ConflictOperation;
|
|
368
|
+
export type Decision = _Policy.ConflictDecision;
|
|
369
|
+
export type Policy = _Policy.ConflictPolicy;
|
|
370
|
+
export type Axis = _Policy.ConflictAxis;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// ── Commit (sub-namespace — write-side cohort) ────────────────────
|
|
374
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
375
|
+
export namespace Commit {
|
|
376
|
+
export type Wait = import('./local/client/resourceTypes.js').CommitWait;
|
|
377
|
+
export type OperationAction = import('./local/client/resourceTypes.js').ModelOperationAction;
|
|
378
|
+
export type OperationInput = import('./local/client/resourceTypes.js').CommitOperationInput;
|
|
379
|
+
export type CreateOptions = import('./local/client/resourceTypes.js').CommitCreateOptions;
|
|
380
|
+
export type Receipt = import('./local/client/resourceTypes.js').CommitReceipt;
|
|
381
|
+
export type Client = import('./local/client/resourceTypes.js').CommitResource;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// ── Claim (sub-namespace — peer-claim cohort) ────────────────────
|
|
385
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
386
|
+
export namespace Claim {
|
|
387
|
+
export type Handle = import('./local/client/resourceTypes.js').Claim;
|
|
388
|
+
export type Held<T = Record<string, unknown>> = import('@abloatai/transaction/types/streams').HeldClaim<T>;
|
|
389
|
+
export type CreateOptions = import('./local/client/resourceTypes.js').ClaimCreateOptions;
|
|
390
|
+
export type WaitOptions = import('./local/client/resourceTypes.js').ClaimWaitOptions;
|
|
391
|
+
export type Client = import('./local/client/resourceTypes.js').ClaimResource;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// ── Model (sub-namespace — typed-row read/write cohort) ───────────
|
|
395
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
396
|
+
export namespace Model {
|
|
397
|
+
export type Target = import('./local/client/resourceTypes.js').ModelTarget;
|
|
398
|
+
export type Claim = import('./local/client/resourceTypes.js').ModelClaim;
|
|
399
|
+
export type Operations<T, CreateInput = T> = import('./local/client/createModelProxy.js').ModelOperations<
|
|
400
|
+
T,
|
|
401
|
+
CreateInput
|
|
402
|
+
>;
|
|
403
|
+
export type ClaimOptions<T = Record<string, unknown>> =
|
|
404
|
+
import('./local/client/createModelProxy.js').ClaimOptions<T>;
|
|
405
|
+
export type ClaimParams<T = Record<string, unknown>> =
|
|
406
|
+
import('./local/client/createModelProxy.js').ClaimParams<T>;
|
|
407
|
+
export type ClaimLookupParams<T = Record<string, unknown>> =
|
|
408
|
+
import('./local/client/createModelProxy.js').ClaimLookupParams<T>;
|
|
409
|
+
export type ClaimReorderParams<T = Record<string, unknown>> =
|
|
410
|
+
import('./local/client/createModelProxy.js').ClaimReorderParams<T>;
|
|
411
|
+
export type MutationOptions = import('./local/client/resourceTypes.js').ModelMutationOptions;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// ── Source (sub-namespace — customer-owned storage adapter) ──────
|
|
415
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
416
|
+
export namespace Source {
|
|
417
|
+
export type Operation = import('@abloatai/transaction/source').SourceOperation;
|
|
418
|
+
export type Event = import('@abloatai/transaction/source').SourceEvent;
|
|
419
|
+
export type EventForOperationOptions =
|
|
420
|
+
import('@abloatai/transaction/source').SourceEventForOperationOptions;
|
|
421
|
+
export type EventsResult = import('@abloatai/transaction/source').SourceEventsResult;
|
|
422
|
+
export type Scope = import('@abloatai/transaction/source').SourceScope;
|
|
423
|
+
export type ApiKey = import('@abloatai/transaction/source').SourceApiKey;
|
|
424
|
+
export type Options<
|
|
425
|
+
S extends _SchemaTypes.SchemaRecord = _SchemaTypes.SchemaRecord,
|
|
426
|
+
TAuth = unknown,
|
|
427
|
+
> = import('@abloatai/transaction/source').DataSourceOptions<S, TAuth>;
|
|
428
|
+
export type ModelHandlers<
|
|
429
|
+
Row,
|
|
430
|
+
CreateInput,
|
|
431
|
+
TAuth = unknown,
|
|
432
|
+
> = import('@abloatai/transaction/source').SourceModelHandlers<Row, CreateInput, TAuth>;
|
|
433
|
+
export type SignatureVerificationResult =
|
|
434
|
+
import('@abloatai/transaction/source').SourceSignatureVerificationResult;
|
|
435
|
+
|
|
436
|
+
// Commit sub-cohort — params/result pair.
|
|
437
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
438
|
+
export namespace Commit {
|
|
439
|
+
export type Params<TAuth = unknown> =
|
|
440
|
+
import('@abloatai/transaction/source').SourceCommitParams<TAuth>;
|
|
441
|
+
export type Result<Row = Record<string, unknown>> =
|
|
442
|
+
import('@abloatai/transaction/source').SourceCommitResult<Row>;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// ── Mutator (sub-namespace — 5 names including undo) ──────────────
|
|
447
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
448
|
+
export namespace Mutator {
|
|
449
|
+
export type Fn<S extends _SchemaTypes.Schema, TArgs, TResult = void> =
|
|
450
|
+
_Mutators.MutatorFn<S, TArgs, TResult>;
|
|
451
|
+
export type Transaction<S extends _SchemaTypes.Schema> = _Tx.Transaction<S>;
|
|
452
|
+
export type UndoEntry = _Undo.UndoEntry;
|
|
453
|
+
export type UndoScope<S extends _SchemaTypes.Schema = _SchemaTypes.Schema> = _Undo.UndoScope<S>;
|
|
454
|
+
export type InverseOp = _Undo.InverseOp;
|
|
455
|
+
}
|
|
456
|
+
}
|