@decaf-ts/core 0.13.1 → 0.14.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 +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/lib/cjs/auth/constants.js.map +1 -0
- package/lib/cjs/auth/decorators.js.map +1 -0
- package/lib/cjs/auth/index.js.map +1 -0
- package/lib/cjs/fs/FilesystemAdapter.js.map +1 -0
- package/lib/cjs/fs/FsDispatch.js.map +1 -0
- package/lib/cjs/fs/helpers.js.map +1 -0
- package/lib/cjs/fs/index.js.map +1 -0
- package/lib/cjs/fs/indexStore.js.map +1 -0
- package/lib/cjs/fs/locks/FilesystemLock.js.map +1 -0
- package/lib/cjs/fs/locks/FilesystemMultiLock.js.map +1 -0
- package/lib/{fs → cjs/fs}/types.js.map +1 -1
- package/lib/cjs/identity/decorators.js.map +1 -0
- package/lib/cjs/identity/index.js.map +1 -0
- package/lib/{index.cjs → cjs/index.cjs} +1 -1
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/interfaces/ContextuallyLogged.js.map +1 -0
- package/lib/cjs/interfaces/ErrorParser.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/Executor.js.map +1 -1
- package/lib/cjs/interfaces/Observable.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/Observer.js.map +1 -1
- package/lib/cjs/interfaces/Paginatable.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/Queriable.js.map +1 -1
- package/lib/cjs/interfaces/RawExecutor.js.map +1 -0
- package/lib/cjs/interfaces/SequenceOptions.js.map +1 -0
- package/lib/cjs/interfaces/index.js.map +1 -0
- package/lib/cjs/migrations/Migration.js.map +1 -0
- package/lib/cjs/migrations/MigrationService.js.map +1 -0
- package/lib/cjs/migrations/MigrationTaskBuilder.js.map +1 -0
- package/lib/cjs/migrations/MigrationTasks.js.map +1 -0
- package/lib/cjs/migrations/MigrationVersioning.js.map +1 -0
- package/lib/cjs/migrations/SemverMigrationVersioning.js.map +1 -0
- package/lib/cjs/migrations/StandardMigrationVersioning.js.map +1 -0
- package/lib/cjs/migrations/constants.js.map +1 -0
- package/lib/cjs/migrations/decorators.js.map +1 -0
- package/lib/cjs/migrations/index.js.map +1 -0
- package/lib/{persistence → cjs/migrations}/types.js.map +1 -1
- package/lib/cjs/model/BaseModel.js.map +1 -0
- package/lib/cjs/model/SequenceModel.js.map +1 -0
- package/lib/cjs/model/construction.js.map +1 -0
- package/lib/cjs/model/decorators.js.map +1 -0
- package/lib/cjs/model/index.js.map +1 -0
- package/lib/cjs/model/indexing.js.map +1 -0
- package/lib/{model → cjs/model}/types.js.map +1 -1
- package/lib/cjs/overrides/Metadata.js.map +1 -0
- package/lib/cjs/overrides/Model.js.map +1 -0
- package/lib/cjs/overrides/ModelBuilder.js.map +1 -0
- package/lib/cjs/overrides/index.js.map +1 -0
- package/lib/cjs/overrides/injectables.js.map +1 -0
- package/lib/cjs/overrides/overrides.js.map +1 -0
- package/lib/{persistence → cjs/persistence}/Adapter.cjs +12 -4
- package/lib/cjs/persistence/Adapter.js.map +1 -0
- package/lib/cjs/persistence/Context.js.map +1 -0
- package/lib/cjs/persistence/ContextLock.js.map +1 -0
- package/lib/cjs/persistence/Dispatch.js.map +1 -0
- package/lib/cjs/persistence/ObserverHandler.js.map +1 -0
- package/lib/cjs/persistence/Sequence.js.map +1 -0
- package/lib/cjs/persistence/constants.js.map +1 -0
- package/lib/cjs/persistence/decorators.js.map +1 -0
- package/lib/cjs/persistence/errors.js.map +1 -0
- package/lib/cjs/persistence/event-filters.js.map +1 -0
- package/lib/cjs/persistence/generators.js.map +1 -0
- package/lib/cjs/persistence/index.js.map +1 -0
- package/lib/cjs/persistence/transactions.js.map +1 -0
- package/lib/cjs/persistence/types.js.map +1 -0
- package/lib/cjs/query/Condition.js.map +1 -0
- package/lib/cjs/query/MethodQueryBuilder.js.map +1 -0
- package/lib/cjs/query/Paginator.js.map +1 -0
- package/lib/cjs/query/Statement.js.map +1 -0
- package/lib/cjs/query/constants.js.map +1 -0
- package/lib/cjs/query/decorators.js.map +1 -0
- package/lib/cjs/query/errors.js.map +1 -0
- package/lib/cjs/query/index.js.map +1 -0
- package/lib/{query → cjs/query}/options.js.map +1 -1
- package/lib/{query → cjs/query}/selectors.js.map +1 -1
- package/lib/cjs/query/types.js.map +1 -0
- package/lib/cjs/query/utils.js.map +1 -0
- package/lib/cjs/ram/RamAdapter.js.map +1 -0
- package/lib/cjs/ram/RamPaginator.js.map +1 -0
- package/lib/cjs/ram/RamStatement.js.map +1 -0
- package/lib/cjs/ram/constants.js.map +1 -0
- package/lib/cjs/ram/handlers.js.map +1 -0
- package/lib/cjs/ram/index.js.map +1 -0
- package/lib/{tasks → cjs/ram}/types.js.map +1 -1
- package/lib/{repository → cjs/repository}/Repository.cjs +10 -2
- package/lib/cjs/repository/Repository.js.map +1 -0
- package/lib/cjs/repository/constants.js.map +1 -0
- package/lib/cjs/repository/decorators.js.map +1 -0
- package/lib/cjs/repository/errors.js.map +1 -0
- package/lib/cjs/repository/index.js.map +1 -0
- package/lib/cjs/repository/injectables.js.map +1 -0
- package/lib/cjs/repository/types.js.map +1 -0
- package/lib/cjs/repository/utils.js.map +1 -0
- package/lib/cjs/services/ModelService.js.map +1 -0
- package/lib/cjs/services/PersistenceService.js.map +1 -0
- package/lib/cjs/services/index.js.map +1 -0
- package/lib/cjs/services/services.js.map +1 -0
- package/lib/cjs/tasks/CleanUpTask.js.map +1 -0
- package/lib/cjs/tasks/TaskContext.js.map +1 -0
- package/lib/cjs/tasks/TaskEngine.js.map +1 -0
- package/lib/cjs/tasks/TaskErrors.js.map +1 -0
- package/lib/cjs/tasks/TaskEventBus.js.map +1 -0
- package/lib/cjs/tasks/TaskEventService.js.map +1 -0
- package/lib/cjs/tasks/TaskHandler.js.map +1 -0
- package/lib/cjs/tasks/TaskHandlerRegistry.js.map +1 -0
- package/lib/cjs/tasks/TaskService.js.map +1 -0
- package/lib/cjs/tasks/TaskStateChangeError.js.map +1 -0
- package/lib/cjs/tasks/TaskTracker.js.map +1 -0
- package/lib/cjs/tasks/builder.js.map +1 -0
- package/lib/cjs/tasks/constants.js.map +1 -0
- package/lib/cjs/tasks/decorators.js.map +1 -0
- package/lib/cjs/tasks/index.js.map +1 -0
- package/lib/cjs/tasks/logging.js.map +1 -0
- package/lib/cjs/tasks/models/TaskBackoffModel.js.map +1 -0
- package/lib/cjs/tasks/models/TaskErrorModel.js.map +1 -0
- package/lib/cjs/tasks/models/TaskEventModel.js.map +1 -0
- package/lib/cjs/tasks/models/TaskIOSerializer.js.map +1 -0
- package/lib/cjs/tasks/models/TaskLogEntryModel.js.map +1 -0
- package/lib/cjs/tasks/models/TaskModel.js.map +1 -0
- package/lib/cjs/tasks/models/TaskStepResultModel.js.map +1 -0
- package/lib/cjs/tasks/models/TaskStepSpecModel.js.map +1 -0
- package/lib/cjs/tasks/models/index.js.map +1 -0
- package/lib/{ram → cjs/tasks}/types.js.map +1 -1
- package/lib/cjs/tasks/utils.js.map +1 -0
- package/lib/cjs/utils/ContextualLoggedClass.js.map +1 -0
- package/lib/cjs/utils/decorators.js.map +1 -0
- package/lib/cjs/utils/errors.js.map +1 -0
- package/lib/cjs/utils/index.js.map +1 -0
- package/lib/cjs/utils/throttling.js.map +1 -0
- package/lib/cjs/utils/types.js.map +1 -0
- package/lib/cjs/utils/utils.js.map +1 -0
- package/lib/cjs/workers/TaskEngine.js.map +1 -0
- package/lib/cjs/workers/WorkThreadEnvironment.js.map +1 -0
- package/lib/cjs/workers/index.js.map +1 -0
- package/lib/{workers → cjs/workers}/messages.js.map +1 -1
- package/lib/{migrations → cjs/workers}/types.js.map +1 -1
- package/lib/cjs/workers/workerThread.js.map +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/persistence/Adapter.js +12 -4
- package/lib/esm/persistence/Adapter.js.map +1 -1
- package/lib/esm/repository/Repository.js +10 -2
- package/lib/esm/repository/Repository.js.map +1 -1
- package/lib/{esm → types}/index.d.ts +1 -1
- package/lib/{esm → types}/persistence/transactions.d.ts +1 -1
- package/lib/{repository → types/repository}/Repository.d.ts +1 -1
- package/lib/{services → types/services}/ModelService.d.ts +2 -2
- package/lib/{esm → types}/tasks/TaskService.d.ts +2 -2
- package/package.json +26 -20
- package/lib/auth/constants.js.map +0 -1
- package/lib/auth/decorators.js.map +0 -1
- package/lib/auth/index.js.map +0 -1
- package/lib/esm/auth/constants.d.ts +0 -5
- package/lib/esm/auth/decorators.d.ts +0 -5
- package/lib/esm/auth/index.d.ts +0 -2
- package/lib/esm/repository/Repository.d.ts +0 -501
- package/lib/esm/services/ModelService.d.ts +0 -45
- package/lib/fs/FilesystemAdapter.d.ts +0 -70
- package/lib/fs/FilesystemAdapter.js.map +0 -1
- package/lib/fs/FsDispatch.d.ts +0 -7
- package/lib/fs/FsDispatch.js.map +0 -1
- package/lib/fs/helpers.d.ts +0 -17
- package/lib/fs/helpers.js.map +0 -1
- package/lib/fs/index.d.ts +0 -4
- package/lib/fs/index.js.map +0 -1
- package/lib/fs/indexStore.d.ts +0 -28
- package/lib/fs/indexStore.js.map +0 -1
- package/lib/fs/locks/FilesystemLock.d.ts +0 -13
- package/lib/fs/locks/FilesystemLock.js.map +0 -1
- package/lib/fs/locks/FilesystemMultiLock.d.ts +0 -8
- package/lib/fs/locks/FilesystemMultiLock.js.map +0 -1
- package/lib/fs/types.d.ts +0 -40
- package/lib/identity/decorators.d.ts +0 -72
- package/lib/identity/decorators.js.map +0 -1
- package/lib/identity/index.d.ts +0 -6
- package/lib/identity/index.js.map +0 -1
- package/lib/index.d.ts +0 -33
- package/lib/index.js.map +0 -1
- package/lib/interfaces/ContextuallyLogged.d.ts +0 -8
- package/lib/interfaces/ContextuallyLogged.js.map +0 -1
- package/lib/interfaces/ErrorParser.d.ts +0 -16
- package/lib/interfaces/ErrorParser.js.map +0 -1
- package/lib/interfaces/Executor.d.ts +0 -16
- package/lib/interfaces/Observable.d.ts +0 -33
- package/lib/interfaces/Observable.js.map +0 -1
- package/lib/interfaces/Observer.d.ts +0 -15
- package/lib/interfaces/Paginatable.d.ts +0 -20
- package/lib/interfaces/Paginatable.js.map +0 -1
- package/lib/interfaces/Queriable.d.ts +0 -47
- package/lib/interfaces/RawExecutor.d.ts +0 -28
- package/lib/interfaces/RawExecutor.js.map +0 -1
- package/lib/interfaces/SequenceOptions.d.ts +0 -79
- package/lib/interfaces/SequenceOptions.js.map +0 -1
- package/lib/interfaces/index.d.ts +0 -12
- package/lib/interfaces/index.js.map +0 -1
- package/lib/migrations/Migration.d.ts +0 -19
- package/lib/migrations/Migration.js.map +0 -1
- package/lib/migrations/MigrationService.d.ts +0 -63
- package/lib/migrations/MigrationService.js.map +0 -1
- package/lib/migrations/MigrationTaskBuilder.d.ts +0 -10
- package/lib/migrations/MigrationTaskBuilder.js.map +0 -1
- package/lib/migrations/MigrationTasks.d.ts +0 -9
- package/lib/migrations/MigrationTasks.js.map +0 -1
- package/lib/migrations/MigrationVersioning.d.ts +0 -7
- package/lib/migrations/MigrationVersioning.js.map +0 -1
- package/lib/migrations/SemverMigrationVersioning.d.ts +0 -10
- package/lib/migrations/SemverMigrationVersioning.js.map +0 -1
- package/lib/migrations/StandardMigrationVersioning.d.ts +0 -12
- package/lib/migrations/StandardMigrationVersioning.js.map +0 -1
- package/lib/migrations/constants.d.ts +0 -2
- package/lib/migrations/constants.js.map +0 -1
- package/lib/migrations/decorators.d.ts +0 -12
- package/lib/migrations/decorators.js.map +0 -1
- package/lib/migrations/index.d.ts +0 -14
- package/lib/migrations/index.js.map +0 -1
- package/lib/migrations/types.d.ts +0 -46
- package/lib/model/BaseModel.d.ts +0 -37
- package/lib/model/BaseModel.js.map +0 -1
- package/lib/model/SequenceModel.d.ts +0 -32
- package/lib/model/SequenceModel.js.map +0 -1
- package/lib/model/construction.d.ts +0 -455
- package/lib/model/construction.js.map +0 -1
- package/lib/model/decorators.d.ts +0 -237
- package/lib/model/decorators.js.map +0 -1
- package/lib/model/index.d.ts +0 -11
- package/lib/model/index.js.map +0 -1
- package/lib/model/indexing.d.ts +0 -20
- package/lib/model/indexing.js.map +0 -1
- package/lib/model/types.d.ts +0 -60
- package/lib/overrides/Metadata.d.ts +0 -22
- package/lib/overrides/Metadata.js.map +0 -1
- package/lib/overrides/Model.d.ts +0 -94
- package/lib/overrides/Model.js.map +0 -1
- package/lib/overrides/ModelBuilder.d.ts +0 -31
- package/lib/overrides/ModelBuilder.js.map +0 -1
- package/lib/overrides/index.d.ts +0 -10
- package/lib/overrides/index.js.map +0 -1
- package/lib/overrides/injectables.d.ts +0 -10
- package/lib/overrides/injectables.js.map +0 -1
- package/lib/overrides/overrides.d.ts +0 -1
- package/lib/overrides/overrides.js.map +0 -1
- package/lib/persistence/Adapter.d.ts +0 -469
- package/lib/persistence/Adapter.js.map +0 -1
- package/lib/persistence/Context.d.ts +0 -16
- package/lib/persistence/Context.js.map +0 -1
- package/lib/persistence/ContextLock.d.ts +0 -18
- package/lib/persistence/ContextLock.js.map +0 -1
- package/lib/persistence/Dispatch.d.ts +0 -128
- package/lib/persistence/Dispatch.js.map +0 -1
- package/lib/persistence/ObserverHandler.d.ts +0 -111
- package/lib/persistence/ObserverHandler.js.map +0 -1
- package/lib/persistence/Sequence.d.ts +0 -126
- package/lib/persistence/Sequence.js.map +0 -1
- package/lib/persistence/constants.d.ts +0 -74
- package/lib/persistence/constants.js.map +0 -1
- package/lib/persistence/decorators.d.ts +0 -28
- package/lib/persistence/decorators.js.map +0 -1
- package/lib/persistence/errors.d.ts +0 -33
- package/lib/persistence/errors.js.map +0 -1
- package/lib/persistence/event-filters.d.ts +0 -20
- package/lib/persistence/event-filters.js.map +0 -1
- package/lib/persistence/generators.d.ts +0 -14
- package/lib/persistence/generators.js.map +0 -1
- package/lib/persistence/index.d.ts +0 -18
- package/lib/persistence/index.js.map +0 -1
- package/lib/persistence/transactions.d.ts +0 -4
- package/lib/persistence/transactions.js.map +0 -1
- package/lib/persistence/types.d.ts +0 -86
- package/lib/query/Condition.d.ts +0 -131
- package/lib/query/Condition.js.map +0 -1
- package/lib/query/MethodQueryBuilder.d.ts +0 -185
- package/lib/query/MethodQueryBuilder.js.map +0 -1
- package/lib/query/Paginator.d.ts +0 -105
- package/lib/query/Paginator.js.map +0 -1
- package/lib/query/Statement.d.ts +0 -136
- package/lib/query/Statement.js.map +0 -1
- package/lib/query/constants.d.ts +0 -69
- package/lib/query/constants.js.map +0 -1
- package/lib/query/decorators.d.ts +0 -8
- package/lib/query/decorators.js.map +0 -1
- package/lib/query/errors.d.ts +0 -21
- package/lib/query/errors.js.map +0 -1
- package/lib/query/index.d.ts +0 -16
- package/lib/query/index.js.map +0 -1
- package/lib/query/options.d.ts +0 -393
- package/lib/query/selectors.d.ts +0 -39
- package/lib/query/types.d.ts +0 -158
- package/lib/query/types.js.map +0 -1
- package/lib/query/utils.d.ts +0 -40
- package/lib/query/utils.js.map +0 -1
- package/lib/ram/RamAdapter.d.ts +0 -341
- package/lib/ram/RamAdapter.js.map +0 -1
- package/lib/ram/RamPaginator.d.ts +0 -54
- package/lib/ram/RamPaginator.js.map +0 -1
- package/lib/ram/RamStatement.d.ts +0 -92
- package/lib/ram/RamStatement.js.map +0 -1
- package/lib/ram/constants.d.ts +0 -8
- package/lib/ram/constants.js.map +0 -1
- package/lib/ram/handlers.d.ts +0 -24
- package/lib/ram/handlers.js.map +0 -1
- package/lib/ram/index.d.ts +0 -6
- package/lib/ram/index.js.map +0 -1
- package/lib/ram/types.d.ts +0 -50
- package/lib/repository/Repository.js.map +0 -1
- package/lib/repository/constants.d.ts +0 -36
- package/lib/repository/constants.js.map +0 -1
- package/lib/repository/decorators.d.ts +0 -30
- package/lib/repository/decorators.js.map +0 -1
- package/lib/repository/errors.d.ts +0 -19
- package/lib/repository/errors.js.map +0 -1
- package/lib/repository/index.d.ts +0 -12
- package/lib/repository/index.js.map +0 -1
- package/lib/repository/injectables.d.ts +0 -95
- package/lib/repository/injectables.js.map +0 -1
- package/lib/repository/types.d.ts +0 -28
- package/lib/repository/types.js.map +0 -1
- package/lib/repository/utils.d.ts +0 -36
- package/lib/repository/utils.js.map +0 -1
- package/lib/services/ModelService.js.map +0 -1
- package/lib/services/PersistenceService.d.ts +0 -17
- package/lib/services/PersistenceService.js.map +0 -1
- package/lib/services/index.d.ts +0 -8
- package/lib/services/index.js.map +0 -1
- package/lib/services/services.d.ts +0 -96
- package/lib/services/services.js.map +0 -1
- package/lib/tasks/CleanUpTask.d.ts +0 -15
- package/lib/tasks/CleanUpTask.js.map +0 -1
- package/lib/tasks/TaskContext.d.ts +0 -30
- package/lib/tasks/TaskContext.js.map +0 -1
- package/lib/tasks/TaskEngine.d.ts +0 -97
- package/lib/tasks/TaskEngine.js.map +0 -1
- package/lib/tasks/TaskErrors.d.ts +0 -65
- package/lib/tasks/TaskErrors.js.map +0 -1
- package/lib/tasks/TaskEventBus.d.ts +0 -17
- package/lib/tasks/TaskEventBus.js.map +0 -1
- package/lib/tasks/TaskEventService.d.ts +0 -7
- package/lib/tasks/TaskEventService.js.map +0 -1
- package/lib/tasks/TaskHandler.d.ts +0 -12
- package/lib/tasks/TaskHandler.js.map +0 -1
- package/lib/tasks/TaskHandlerRegistry.d.ts +0 -8
- package/lib/tasks/TaskHandlerRegistry.js.map +0 -1
- package/lib/tasks/TaskService.d.ts +0 -65
- package/lib/tasks/TaskService.js.map +0 -1
- package/lib/tasks/TaskStateChangeError.d.ts +0 -11
- package/lib/tasks/TaskStateChangeError.js.map +0 -1
- package/lib/tasks/TaskTracker.d.ts +0 -47
- package/lib/tasks/TaskTracker.js.map +0 -1
- package/lib/tasks/builder.d.ts +0 -72
- package/lib/tasks/builder.js.map +0 -1
- package/lib/tasks/constants.d.ts +0 -31
- package/lib/tasks/constants.js.map +0 -1
- package/lib/tasks/decorators.d.ts +0 -4
- package/lib/tasks/decorators.js.map +0 -1
- package/lib/tasks/index.d.ts +0 -22
- package/lib/tasks/index.js.map +0 -1
- package/lib/tasks/logging.d.ts +0 -31
- package/lib/tasks/logging.js.map +0 -1
- package/lib/tasks/models/TaskBackoffModel.d.ts +0 -9
- package/lib/tasks/models/TaskBackoffModel.js.map +0 -1
- package/lib/tasks/models/TaskErrorModel.d.ts +0 -8
- package/lib/tasks/models/TaskErrorModel.js.map +0 -1
- package/lib/tasks/models/TaskEventModel.d.ts +0 -11
- package/lib/tasks/models/TaskEventModel.js.map +0 -1
- package/lib/tasks/models/TaskIOSerializer.d.ts +0 -33
- package/lib/tasks/models/TaskIOSerializer.js.map +0 -1
- package/lib/tasks/models/TaskLogEntryModel.d.ts +0 -10
- package/lib/tasks/models/TaskLogEntryModel.js.map +0 -1
- package/lib/tasks/models/TaskModel.d.ts +0 -43
- package/lib/tasks/models/TaskModel.js.map +0 -1
- package/lib/tasks/models/TaskStepResultModel.d.ts +0 -9
- package/lib/tasks/models/TaskStepResultModel.js.map +0 -1
- package/lib/tasks/models/TaskStepSpecModel.d.ts +0 -9
- package/lib/tasks/models/TaskStepSpecModel.js.map +0 -1
- package/lib/tasks/models/index.d.ts +0 -8
- package/lib/tasks/models/index.js.map +0 -1
- package/lib/tasks/types.d.ts +0 -71
- package/lib/tasks/utils.d.ts +0 -5
- package/lib/tasks/utils.js.map +0 -1
- package/lib/utils/ContextualLoggedClass.d.ts +0 -37
- package/lib/utils/ContextualLoggedClass.js.map +0 -1
- package/lib/utils/decorators.d.ts +0 -27
- package/lib/utils/decorators.js.map +0 -1
- package/lib/utils/errors.d.ts +0 -56
- package/lib/utils/errors.js.map +0 -1
- package/lib/utils/index.d.ts +0 -11
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/throttling.d.ts +0 -9
- package/lib/utils/throttling.js.map +0 -1
- package/lib/utils/types.d.ts +0 -23
- package/lib/utils/types.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -22
- package/lib/utils/utils.js.map +0 -1
- package/lib/workers/TaskEngine.d.ts +0 -40
- package/lib/workers/TaskEngine.js.map +0 -1
- package/lib/workers/WorkThreadEnvironment.d.ts +0 -35
- package/lib/workers/WorkThreadEnvironment.js.map +0 -1
- package/lib/workers/index.d.ts +0 -4
- package/lib/workers/index.js.map +0 -1
- package/lib/workers/messages.d.ts +0 -69
- package/lib/workers/types.d.ts +0 -41
- package/lib/workers/types.js.map +0 -1
- package/lib/workers/workerThread.d.ts +0 -1
- package/lib/workers/workerThread.js.map +0 -1
- /package/lib/{auth → cjs/auth}/constants.cjs +0 -0
- /package/lib/{auth → cjs/auth}/decorators.cjs +0 -0
- /package/lib/{auth → cjs/auth}/index.cjs +0 -0
- /package/lib/{fs → cjs/fs}/FilesystemAdapter.cjs +0 -0
- /package/lib/{fs → cjs/fs}/FsDispatch.cjs +0 -0
- /package/lib/{fs → cjs/fs}/helpers.cjs +0 -0
- /package/lib/{fs → cjs/fs}/index.cjs +0 -0
- /package/lib/{fs → cjs/fs}/indexStore.cjs +0 -0
- /package/lib/{fs → cjs/fs}/locks/FilesystemLock.cjs +0 -0
- /package/lib/{fs → cjs/fs}/locks/FilesystemMultiLock.cjs +0 -0
- /package/lib/{fs → cjs/fs}/types.cjs +0 -0
- /package/lib/{identity → cjs/identity}/decorators.cjs +0 -0
- /package/lib/{identity → cjs/identity}/index.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/ContextuallyLogged.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/ErrorParser.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/Executor.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/Observable.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/Observer.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/Paginatable.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/Queriable.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/RawExecutor.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/SequenceOptions.cjs +0 -0
- /package/lib/{interfaces → cjs/interfaces}/index.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/Migration.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/MigrationService.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/MigrationTaskBuilder.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/MigrationTasks.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/MigrationVersioning.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/SemverMigrationVersioning.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/StandardMigrationVersioning.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/constants.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/decorators.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/index.cjs +0 -0
- /package/lib/{migrations → cjs/migrations}/types.cjs +0 -0
- /package/lib/{model → cjs/model}/BaseModel.cjs +0 -0
- /package/lib/{model → cjs/model}/SequenceModel.cjs +0 -0
- /package/lib/{model → cjs/model}/construction.cjs +0 -0
- /package/lib/{model → cjs/model}/decorators.cjs +0 -0
- /package/lib/{model → cjs/model}/index.cjs +0 -0
- /package/lib/{model → cjs/model}/indexing.cjs +0 -0
- /package/lib/{model → cjs/model}/types.cjs +0 -0
- /package/lib/{overrides → cjs/overrides}/Metadata.cjs +0 -0
- /package/lib/{overrides → cjs/overrides}/Model.cjs +0 -0
- /package/lib/{overrides → cjs/overrides}/ModelBuilder.cjs +0 -0
- /package/lib/{overrides → cjs/overrides}/index.cjs +0 -0
- /package/lib/{overrides → cjs/overrides}/injectables.cjs +0 -0
- /package/lib/{overrides → cjs/overrides}/overrides.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/Context.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/ContextLock.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/Dispatch.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/ObserverHandler.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/Sequence.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/constants.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/decorators.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/errors.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/event-filters.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/generators.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/index.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/transactions.cjs +0 -0
- /package/lib/{persistence → cjs/persistence}/types.cjs +0 -0
- /package/lib/{query → cjs/query}/Condition.cjs +0 -0
- /package/lib/{query → cjs/query}/MethodQueryBuilder.cjs +0 -0
- /package/lib/{query → cjs/query}/Paginator.cjs +0 -0
- /package/lib/{query → cjs/query}/Statement.cjs +0 -0
- /package/lib/{query → cjs/query}/constants.cjs +0 -0
- /package/lib/{query → cjs/query}/decorators.cjs +0 -0
- /package/lib/{query → cjs/query}/errors.cjs +0 -0
- /package/lib/{query → cjs/query}/index.cjs +0 -0
- /package/lib/{query → cjs/query}/options.cjs +0 -0
- /package/lib/{query → cjs/query}/selectors.cjs +0 -0
- /package/lib/{query → cjs/query}/types.cjs +0 -0
- /package/lib/{query → cjs/query}/utils.cjs +0 -0
- /package/lib/{ram → cjs/ram}/RamAdapter.cjs +0 -0
- /package/lib/{ram → cjs/ram}/RamPaginator.cjs +0 -0
- /package/lib/{ram → cjs/ram}/RamStatement.cjs +0 -0
- /package/lib/{ram → cjs/ram}/constants.cjs +0 -0
- /package/lib/{ram → cjs/ram}/handlers.cjs +0 -0
- /package/lib/{ram → cjs/ram}/index.cjs +0 -0
- /package/lib/{ram → cjs/ram}/types.cjs +0 -0
- /package/lib/{repository → cjs/repository}/constants.cjs +0 -0
- /package/lib/{repository → cjs/repository}/decorators.cjs +0 -0
- /package/lib/{repository → cjs/repository}/errors.cjs +0 -0
- /package/lib/{repository → cjs/repository}/index.cjs +0 -0
- /package/lib/{repository → cjs/repository}/injectables.cjs +0 -0
- /package/lib/{repository → cjs/repository}/types.cjs +0 -0
- /package/lib/{repository → cjs/repository}/utils.cjs +0 -0
- /package/lib/{services → cjs/services}/ModelService.cjs +0 -0
- /package/lib/{services → cjs/services}/PersistenceService.cjs +0 -0
- /package/lib/{services → cjs/services}/index.cjs +0 -0
- /package/lib/{services → cjs/services}/services.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/CleanUpTask.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskContext.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskEngine.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskErrors.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskEventBus.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskEventService.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskHandler.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskHandlerRegistry.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskService.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskStateChangeError.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/TaskTracker.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/builder.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/constants.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/decorators.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/index.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/logging.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskBackoffModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskErrorModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskEventModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskIOSerializer.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskLogEntryModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskStepResultModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/TaskStepSpecModel.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/models/index.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/types.cjs +0 -0
- /package/lib/{tasks → cjs/tasks}/utils.cjs +0 -0
- /package/lib/{utils → cjs/utils}/ContextualLoggedClass.cjs +0 -0
- /package/lib/{utils → cjs/utils}/decorators.cjs +0 -0
- /package/lib/{utils → cjs/utils}/errors.cjs +0 -0
- /package/lib/{utils → cjs/utils}/index.cjs +0 -0
- /package/lib/{utils → cjs/utils}/throttling.cjs +0 -0
- /package/lib/{utils → cjs/utils}/types.cjs +0 -0
- /package/lib/{utils → cjs/utils}/utils.cjs +0 -0
- /package/lib/{workers → cjs/workers}/TaskEngine.cjs +0 -0
- /package/lib/{workers → cjs/workers}/WorkThreadEnvironment.cjs +0 -0
- /package/lib/{workers → cjs/workers}/index.cjs +0 -0
- /package/lib/{workers → cjs/workers}/messages.cjs +0 -0
- /package/lib/{workers → cjs/workers}/types.cjs +0 -0
- /package/lib/{workers → cjs/workers}/workerThread.cjs +0 -0
- /package/lib/{auth → types/auth}/constants.d.ts +0 -0
- /package/lib/{auth → types/auth}/decorators.d.ts +0 -0
- /package/lib/{auth → types/auth}/index.d.ts +0 -0
- /package/lib/{esm → types}/fs/FilesystemAdapter.d.ts +0 -0
- /package/lib/{esm → types}/fs/FsDispatch.d.ts +0 -0
- /package/lib/{esm → types}/fs/helpers.d.ts +0 -0
- /package/lib/{esm → types}/fs/index.d.ts +0 -0
- /package/lib/{esm → types}/fs/indexStore.d.ts +0 -0
- /package/lib/{esm → types}/fs/locks/FilesystemLock.d.ts +0 -0
- /package/lib/{esm → types}/fs/locks/FilesystemMultiLock.d.ts +0 -0
- /package/lib/{esm → types}/fs/types.d.ts +0 -0
- /package/lib/{esm → types}/identity/decorators.d.ts +0 -0
- /package/lib/{esm → types}/identity/index.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/ContextuallyLogged.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/ErrorParser.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/Executor.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/Observable.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/Observer.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/Paginatable.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/Queriable.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/RawExecutor.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/SequenceOptions.d.ts +0 -0
- /package/lib/{esm → types}/interfaces/index.d.ts +0 -0
- /package/lib/{esm → types}/migrations/Migration.d.ts +0 -0
- /package/lib/{esm → types}/migrations/MigrationService.d.ts +0 -0
- /package/lib/{esm → types}/migrations/MigrationTaskBuilder.d.ts +0 -0
- /package/lib/{esm → types}/migrations/MigrationTasks.d.ts +0 -0
- /package/lib/{esm → types}/migrations/MigrationVersioning.d.ts +0 -0
- /package/lib/{esm → types}/migrations/SemverMigrationVersioning.d.ts +0 -0
- /package/lib/{esm → types}/migrations/StandardMigrationVersioning.d.ts +0 -0
- /package/lib/{esm → types}/migrations/constants.d.ts +0 -0
- /package/lib/{esm → types}/migrations/decorators.d.ts +0 -0
- /package/lib/{esm → types}/migrations/index.d.ts +0 -0
- /package/lib/{esm → types}/migrations/types.d.ts +0 -0
- /package/lib/{esm → types}/model/BaseModel.d.ts +0 -0
- /package/lib/{esm → types}/model/SequenceModel.d.ts +0 -0
- /package/lib/{esm → types}/model/construction.d.ts +0 -0
- /package/lib/{esm → types}/model/decorators.d.ts +0 -0
- /package/lib/{esm → types}/model/index.d.ts +0 -0
- /package/lib/{esm → types}/model/indexing.d.ts +0 -0
- /package/lib/{esm → types}/model/types.d.ts +0 -0
- /package/lib/{esm → types}/overrides/Metadata.d.ts +0 -0
- /package/lib/{esm → types}/overrides/Model.d.ts +0 -0
- /package/lib/{esm → types}/overrides/ModelBuilder.d.ts +0 -0
- /package/lib/{esm → types}/overrides/index.d.ts +0 -0
- /package/lib/{esm → types}/overrides/injectables.d.ts +0 -0
- /package/lib/{esm → types}/overrides/overrides.d.ts +0 -0
- /package/lib/{esm → types}/persistence/Adapter.d.ts +0 -0
- /package/lib/{esm → types}/persistence/Context.d.ts +0 -0
- /package/lib/{esm → types}/persistence/ContextLock.d.ts +0 -0
- /package/lib/{esm → types}/persistence/Dispatch.d.ts +0 -0
- /package/lib/{esm → types}/persistence/ObserverHandler.d.ts +0 -0
- /package/lib/{esm → types}/persistence/Sequence.d.ts +0 -0
- /package/lib/{esm → types}/persistence/constants.d.ts +0 -0
- /package/lib/{esm → types}/persistence/decorators.d.ts +0 -0
- /package/lib/{esm → types}/persistence/errors.d.ts +0 -0
- /package/lib/{esm → types}/persistence/event-filters.d.ts +0 -0
- /package/lib/{esm → types}/persistence/generators.d.ts +0 -0
- /package/lib/{esm → types}/persistence/index.d.ts +0 -0
- /package/lib/{esm → types}/persistence/types.d.ts +0 -0
- /package/lib/{esm → types}/query/Condition.d.ts +0 -0
- /package/lib/{esm → types}/query/MethodQueryBuilder.d.ts +0 -0
- /package/lib/{esm → types}/query/Paginator.d.ts +0 -0
- /package/lib/{esm → types}/query/Statement.d.ts +0 -0
- /package/lib/{esm → types}/query/constants.d.ts +0 -0
- /package/lib/{esm → types}/query/decorators.d.ts +0 -0
- /package/lib/{esm → types}/query/errors.d.ts +0 -0
- /package/lib/{esm → types}/query/index.d.ts +0 -0
- /package/lib/{esm → types}/query/options.d.ts +0 -0
- /package/lib/{esm → types}/query/selectors.d.ts +0 -0
- /package/lib/{esm → types}/query/types.d.ts +0 -0
- /package/lib/{esm → types}/query/utils.d.ts +0 -0
- /package/lib/{esm → types}/ram/RamAdapter.d.ts +0 -0
- /package/lib/{esm → types}/ram/RamPaginator.d.ts +0 -0
- /package/lib/{esm → types}/ram/RamStatement.d.ts +0 -0
- /package/lib/{esm → types}/ram/constants.d.ts +0 -0
- /package/lib/{esm → types}/ram/handlers.d.ts +0 -0
- /package/lib/{esm → types}/ram/index.d.ts +0 -0
- /package/lib/{esm → types}/ram/types.d.ts +0 -0
- /package/lib/{esm → types}/repository/constants.d.ts +0 -0
- /package/lib/{esm → types}/repository/decorators.d.ts +0 -0
- /package/lib/{esm → types}/repository/errors.d.ts +0 -0
- /package/lib/{esm → types}/repository/index.d.ts +0 -0
- /package/lib/{esm → types}/repository/injectables.d.ts +0 -0
- /package/lib/{esm → types}/repository/types.d.ts +0 -0
- /package/lib/{esm → types}/repository/utils.d.ts +0 -0
- /package/lib/{esm → types}/services/PersistenceService.d.ts +0 -0
- /package/lib/{esm → types}/services/index.d.ts +0 -0
- /package/lib/{esm → types}/services/services.d.ts +0 -0
- /package/lib/{esm → types}/tasks/CleanUpTask.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskContext.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskEngine.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskErrors.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskEventBus.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskEventService.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskHandler.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskHandlerRegistry.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskStateChangeError.d.ts +0 -0
- /package/lib/{esm → types}/tasks/TaskTracker.d.ts +0 -0
- /package/lib/{esm → types}/tasks/builder.d.ts +0 -0
- /package/lib/{esm → types}/tasks/constants.d.ts +0 -0
- /package/lib/{esm → types}/tasks/decorators.d.ts +0 -0
- /package/lib/{esm → types}/tasks/index.d.ts +0 -0
- /package/lib/{esm → types}/tasks/logging.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskBackoffModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskErrorModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskEventModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskIOSerializer.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskLogEntryModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskStepResultModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/TaskStepSpecModel.d.ts +0 -0
- /package/lib/{esm → types}/tasks/models/index.d.ts +0 -0
- /package/lib/{esm → types}/tasks/types.d.ts +0 -0
- /package/lib/{esm → types}/tasks/utils.d.ts +0 -0
- /package/lib/{esm → types}/utils/ContextualLoggedClass.d.ts +0 -0
- /package/lib/{esm → types}/utils/decorators.d.ts +0 -0
- /package/lib/{esm → types}/utils/errors.d.ts +0 -0
- /package/lib/{esm → types}/utils/index.d.ts +0 -0
- /package/lib/{esm → types}/utils/throttling.d.ts +0 -0
- /package/lib/{esm → types}/utils/types.d.ts +0 -0
- /package/lib/{esm → types}/utils/utils.d.ts +0 -0
- /package/lib/{esm → types}/workers/TaskEngine.d.ts +0 -0
- /package/lib/{esm → types}/workers/WorkThreadEnvironment.d.ts +0 -0
- /package/lib/{esm → types}/workers/index.d.ts +0 -0
- /package/lib/{esm → types}/workers/messages.d.ts +0 -0
- /package/lib/{esm → types}/workers/types.d.ts +0 -0
- /package/lib/{esm → types}/workers/workerThread.d.ts +0 -0
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
|
|
2
|
-
import { ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
3
|
-
import { Observer } from "../interfaces";
|
|
4
|
-
import { Adapter } from "./Adapter";
|
|
5
|
-
import { AdapterDispatch, ContextOf, EventIds } from "./types";
|
|
6
|
-
import { Constructor } from "@decaf-ts/decoration";
|
|
7
|
-
import { ContextualArgs, ContextualizedArgs, ContextualLoggedClass, MaybeContextualArg, MethodOrOperation } from "../utils/ContextualLoggedClass";
|
|
8
|
-
/**
|
|
9
|
-
* @description Dispatches database operation events to observers
|
|
10
|
-
* @summary The Dispatch class implements the Observable interface and is responsible for intercepting
|
|
11
|
-
* database operations from an Adapter and notifying observers when changes occur. It uses proxies to
|
|
12
|
-
* wrap the adapter's CRUD methods and automatically trigger observer updates after operations complete.
|
|
13
|
-
* @template Y - The native database driver type
|
|
14
|
-
* @param {void} - No constructor parameters
|
|
15
|
-
* @class Dispatch
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* // Creating and using a Dispatch instance
|
|
19
|
-
* const dispatch = new Dispatch<PostgresDriver>();
|
|
20
|
-
*
|
|
21
|
-
* // Connect it to an adapter
|
|
22
|
-
* const adapter = new PostgresAdapter(connection);
|
|
23
|
-
* dispatch.observe(adapter);
|
|
24
|
-
*
|
|
25
|
-
* // Now any CRUD operations on the adapter will automatically
|
|
26
|
-
* // trigger observer notifications
|
|
27
|
-
* await adapter.create('users', 123, userModel);
|
|
28
|
-
* // Observers will be notified about the creation
|
|
29
|
-
*
|
|
30
|
-
* // When done, you can disconnect
|
|
31
|
-
* dispatch.unObserve(adapter);
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare class Dispatch<A extends Adapter<any, any, any, any>> extends ContextualLoggedClass<ContextOf<A>> implements AdapterDispatch<A> {
|
|
35
|
-
private isSameObservedAdapter;
|
|
36
|
-
/**
|
|
37
|
-
* Indicates whether the dispatcher has already been initialized.
|
|
38
|
-
*
|
|
39
|
-
* @description Tracks the initialization state to prevent duplicate setup
|
|
40
|
-
* @summary Whether the dispatcher is initialized and ready to observe adapter operations
|
|
41
|
-
*/
|
|
42
|
-
protected initialized: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* @description The adapter being observed
|
|
45
|
-
* @summary Reference to the database adapter whose operations are being monitored
|
|
46
|
-
*/
|
|
47
|
-
protected adapter?: A;
|
|
48
|
-
/**
|
|
49
|
-
* @description List of model constructors
|
|
50
|
-
* @summary Array of model constructors that are registered with the adapter
|
|
51
|
-
*/
|
|
52
|
-
protected models: ModelConstructor<any>[];
|
|
53
|
-
/**
|
|
54
|
-
* @description Creates a new Dispatch instance
|
|
55
|
-
* @summary Initializes a new Dispatch instance without any adapter
|
|
56
|
-
*/
|
|
57
|
-
constructor();
|
|
58
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
59
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
60
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
|
|
61
|
-
/**
|
|
62
|
-
* @description Initializes the dispatch by proxying adapter methods
|
|
63
|
-
* @summary Sets up proxies on the adapter's CRUD methods to intercept operations and notify observers.
|
|
64
|
-
* This method is called automatically when an adapter is observed.
|
|
65
|
-
* @return {Promise<void>} A promise that resolves when initialization is complete
|
|
66
|
-
* @mermaid
|
|
67
|
-
* sequenceDiagram
|
|
68
|
-
* participant Dispatch
|
|
69
|
-
* participant Adapter
|
|
70
|
-
* participant Proxy
|
|
71
|
-
*
|
|
72
|
-
* Dispatch->>Dispatch: initialize()
|
|
73
|
-
* Dispatch->>Dispatch: Check if adapter exists
|
|
74
|
-
* alt No adapter
|
|
75
|
-
* Dispatch-->>Dispatch: Throw InternalError
|
|
76
|
-
* end
|
|
77
|
-
*
|
|
78
|
-
* loop For each CRUD method
|
|
79
|
-
* Dispatch->>Adapter: Check if method exists
|
|
80
|
-
* alt Method doesn't exist
|
|
81
|
-
* Dispatch-->>Dispatch: Throw InternalError
|
|
82
|
-
* end
|
|
83
|
-
*
|
|
84
|
-
* Dispatch->>Adapter: Get property descriptor
|
|
85
|
-
* loop While descriptor not found
|
|
86
|
-
* Dispatch->>Adapter: Check prototype chain
|
|
87
|
-
* end
|
|
88
|
-
*
|
|
89
|
-
* alt Descriptor not found or not writable
|
|
90
|
-
* Dispatch->>Dispatch: Log error and continue
|
|
91
|
-
* else Descriptor found and writable
|
|
92
|
-
* Dispatch->>Proxy: Create proxy for method
|
|
93
|
-
* Dispatch->>Adapter: Replace method with proxy
|
|
94
|
-
* end
|
|
95
|
-
* end
|
|
96
|
-
*/
|
|
97
|
-
protected initialize(...args: MaybeContextualArg<ContextOf<A>>): Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* @description Closes the dispatch
|
|
100
|
-
* @summary Performs any necessary cleanup when the dispatch is no longer needed
|
|
101
|
-
* @return {Promise<void>} A promise that resolves when closing is complete
|
|
102
|
-
*/
|
|
103
|
-
close(...ctxArgs: ContextualArgs<ContextOf<A>>): Promise<void>;
|
|
104
|
-
/**
|
|
105
|
-
* @description Starts observing an adapter
|
|
106
|
-
* @summary Connects this dispatch to an adapter to monitor its operations
|
|
107
|
-
* @param {Adapter<any, any, any, any>} observer - The adapter to observe
|
|
108
|
-
* @return {void}
|
|
109
|
-
*/
|
|
110
|
-
observe(observer: A): () => void;
|
|
111
|
-
/**
|
|
112
|
-
* @description Stops observing an adapter
|
|
113
|
-
* @summary Disconnects this dispatch from an adapter
|
|
114
|
-
* @param {Observer} observer - The adapter to stop observing
|
|
115
|
-
* @return {void}
|
|
116
|
-
*/
|
|
117
|
-
unObserve(observer: Observer): void;
|
|
118
|
-
/**
|
|
119
|
-
* @description Updates observers about a database event
|
|
120
|
-
* @summary Notifies observers about a change in the database
|
|
121
|
-
* @param {string} table - The name of the table where the change occurred
|
|
122
|
-
* @param {OperationKeys|BulkCrudOperationKeys|string} event - The type of operation that occurred
|
|
123
|
-
* @param {EventIds} id - The identifier(s) of the affected record(s)
|
|
124
|
-
* @return {Promise<void>} A promise that resolves when all observers have been notified
|
|
125
|
-
*/
|
|
126
|
-
updateObservers(model: Constructor<any> | string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
|
|
127
|
-
toString(): string;
|
|
128
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dispatch.js","sourceRoot":"","sources":["../../src/persistence/Dispatch.ts"],"names":[],"mappings":";;;AAAA,2DAIiC;AACjC,yEAAyE;AAEzE,2CAAoC;AACpC,yCAA4C;AAG5C,gFAMwC;AACxC,+CAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,QACX,SAAQ,6CAAmC;IAGnC,qBAAqB,CAAC,QAAkB;QAC9C,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAC;QAChC,IAAI,IAAI,CAAC,OAAO,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAE3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiD,CAAC;QACvE,MAAM,SAAS,GAAG,QAAkD,CAAC;QACrE,IAAI,CAAC,CAAC,SAAS,YAAY,iBAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QAElD,OAAO,CACL,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO,CAC3E,CAAC;IACJ,CAAC;IAsBD;;;OAGG;IACH;QACE,KAAK,EAAE,CAAC;QAzBV;;;;;WAKG;QACO,gBAAW,GAAY,KAAK,CAAC;IAoBvC,CAAC;IAmCkB,MAAM,CAIvB,IAA4C,EAC5C,SAAiB,EACjB,cAAuB,KAAK;QAc5B,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,6BAAa,CAAC,qBAAqB,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,WAAkB,CAY5D,CAAC;IACR,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CACP,kEAAkE,KAAK,IAAI,KAAK,EAAE,CACnF,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC;YACH,GAAG,CAAC,KAAK,CACP,oCAAoC,KAAK,IAAI,KAAK,KAAK,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,EAAE,CACxH,CAAC;YACF,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,MAAM,IAAI,6BAAa,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAEQ,QAAQ;QACf,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,eAAe,iBAAiB,CAAC;IACtF,CAAC;CACF;AAjWD,4BAiWC;AAED,IAAI,iBAAO;IAAE,iBAAO,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { Observer } from "../interfaces";
|
|
2
|
-
import { EventIds, ObserverFilter, PersistenceObservable } from "./types";
|
|
3
|
-
import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
|
|
4
|
-
import { Model } from "@decaf-ts/decorator-validation";
|
|
5
|
-
import { Constructor } from "@decaf-ts/decoration";
|
|
6
|
-
import { ContextualArgs } from "../utils/ContextualLoggedClass";
|
|
7
|
-
import { Context } from "./Context";
|
|
8
|
-
/**
|
|
9
|
-
* @description Manages a collection of observers for database events
|
|
10
|
-
* @summary The ObserverHandler class implements the Observable interface and provides a centralized
|
|
11
|
-
* way to manage multiple observers. It allows registering observers with optional filters to control
|
|
12
|
-
* which events they receive notifications for, and handles the process of notifying all relevant
|
|
13
|
-
* observers when database events occur.
|
|
14
|
-
* @class ObserverHandler
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* // Create an observer handler
|
|
18
|
-
* const handler = new ObserverHandler();
|
|
19
|
-
*
|
|
20
|
-
* // Register an observer
|
|
21
|
-
* const myObserver = {
|
|
22
|
-
* refresh: async (table, event, id) => {
|
|
23
|
-
* console.log(`Change in ${table}: ${event} for ID ${id}`);
|
|
24
|
-
* }
|
|
25
|
-
* };
|
|
26
|
-
*
|
|
27
|
-
* // Add observer with a filter for only user table events
|
|
28
|
-
* handler.observe(myObserver, (table, event, id) => table === 'users');
|
|
29
|
-
*
|
|
30
|
-
* // Notify observers about an event
|
|
31
|
-
* await handler.updateObservers(logger, 'users', 'CREATE', 123);
|
|
32
|
-
*
|
|
33
|
-
* // Remove an observer when no longer needed
|
|
34
|
-
* handler.unObserve(myObserver);
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export declare class ObserverHandler<C extends Context<any> = Context> implements PersistenceObservable<C> {
|
|
38
|
-
/**
|
|
39
|
-
* @description Collection of registered observers
|
|
40
|
-
* @summary Array of observer objects along with their optional filters
|
|
41
|
-
*/
|
|
42
|
-
protected readonly observers: {
|
|
43
|
-
observer: Observer;
|
|
44
|
-
filter?: ObserverFilter;
|
|
45
|
-
}[];
|
|
46
|
-
/**
|
|
47
|
-
* @description Gets the number of registered observers
|
|
48
|
-
* @summary Returns the count of observers currently registered with this handler
|
|
49
|
-
* @return {number} The number of registered observers
|
|
50
|
-
*/
|
|
51
|
-
count(): number;
|
|
52
|
-
/**
|
|
53
|
-
* @description Registers a new observer
|
|
54
|
-
* @summary Adds an observer to the collection with an optional filter function
|
|
55
|
-
* @param {Observer} observer - The observer to register
|
|
56
|
-
* @param {ObserverFilter} [filter] - Optional filter function to determine which events the observer receives
|
|
57
|
-
* @return {void}
|
|
58
|
-
*/
|
|
59
|
-
observe(observer: Observer, filter?: ObserverFilter): () => void;
|
|
60
|
-
/**
|
|
61
|
-
* @description Unregisters an observer
|
|
62
|
-
* @summary Removes an observer from the collection
|
|
63
|
-
* @param {Observer} observer - The observer to unregister
|
|
64
|
-
* @return {void}
|
|
65
|
-
*/
|
|
66
|
-
unObserve(observer: Observer): void;
|
|
67
|
-
/**
|
|
68
|
-
* @description Notifies all relevant observers about a database event
|
|
69
|
-
* @summary Filters observers based on their filter functions and calls refresh on each matching observer
|
|
70
|
-
* @param {string} table - The name of the table where the event occurred
|
|
71
|
-
* @param {OperationKeys|BulkCrudOperationKeys|string} event - The type of operation that occurred
|
|
72
|
-
* @param {EventIds} id - The identifier(s) of the affected record(s)
|
|
73
|
-
* @param {...any[]} args - Additional arguments to pass to the observers
|
|
74
|
-
* @return {Promise<void>} A promise that resolves when all observers have been notified
|
|
75
|
-
* @mermaid
|
|
76
|
-
* sequenceDiagram
|
|
77
|
-
* participant Client
|
|
78
|
-
* participant ObserverHandler
|
|
79
|
-
* participant Observer
|
|
80
|
-
*
|
|
81
|
-
* Client->>ObserverHandler: updateObservers(log, table, event, id, ...args)
|
|
82
|
-
*
|
|
83
|
-
* ObserverHandler->>ObserverHandler: Filter observers
|
|
84
|
-
*
|
|
85
|
-
* loop For each observer with matching filter
|
|
86
|
-
* alt Observer has filter
|
|
87
|
-
* ObserverHandler->>Observer: Apply filter(table, event, id)
|
|
88
|
-
* alt Filter throws error
|
|
89
|
-
* ObserverHandler->>Logger: Log error
|
|
90
|
-
* ObserverHandler-->>ObserverHandler: Skip observer
|
|
91
|
-
* else Filter returns true
|
|
92
|
-
* ObserverHandler->>Observer: refresh(table, event, id, ...args)
|
|
93
|
-
* else Filter returns false
|
|
94
|
-
* ObserverHandler-->>ObserverHandler: Skip observer
|
|
95
|
-
* end
|
|
96
|
-
* else No filter
|
|
97
|
-
* ObserverHandler->>Observer: refresh(table, event, id, ...args)
|
|
98
|
-
* end
|
|
99
|
-
* end
|
|
100
|
-
*
|
|
101
|
-
* ObserverHandler->>ObserverHandler: Process results
|
|
102
|
-
* loop For each result
|
|
103
|
-
* alt Result is rejected
|
|
104
|
-
* ObserverHandler->>Logger: Log error
|
|
105
|
-
* end
|
|
106
|
-
* end
|
|
107
|
-
*
|
|
108
|
-
* ObserverHandler-->>Client: Return
|
|
109
|
-
*/
|
|
110
|
-
updateObservers<M extends Model>(model: Constructor<M> | string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, ...args: ContextualArgs<any>): Promise<void>;
|
|
111
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObserverHandler.js","sourceRoot":"","sources":["../../src/persistence/ObserverHandler.ts"],"names":[],"mappings":";;;AAEA,2DAIiC;AAGjC,gFAGwC;AAGxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,eAAe;IAA5B;QAGE;;;WAGG;QACgB,cAAS,GAGtB,EAAE,CAAC;IAqHX,CAAC;IAnHC;;;;OAIG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,QAAkB,EAAE,MAAuB;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtE,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,MAAM,IAAI,6BAAa,CAAC,6BAA6B,CAAC,CAAC;QACzE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5D,OAAO,GAAG,EAAE,CAAC,IA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CAAC,CAAC,CAAC,EAAE,EAAE;YACT,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC;QACnD,CAAC,CAAC,CACL,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU;gBAC9B,GAAG,CAAC,KAAK,CACP,+BAA+B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,CAChF,CAAC;QACN,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/HD,0CA+HC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Model } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { SequenceOptions, SequenceOptionsType } from "../interfaces/SequenceOptions";
|
|
3
|
-
import { Constructor } from "@decaf-ts/decoration";
|
|
4
|
-
import { ContextualizedArgs, ContextualLoggedClass, MaybeContextualArg, MethodOrOperation } from "../utils/ContextualLoggedClass";
|
|
5
|
-
import { Adapter } from "./Adapter";
|
|
6
|
-
import { Repo } from "../repository/Repository";
|
|
7
|
-
import { SequenceModel } from "../model/SequenceModel";
|
|
8
|
-
import { Context } from "./Context";
|
|
9
|
-
import { MultiLock } from "@decaf-ts/transactional-decorators";
|
|
10
|
-
import type { ContextOf, FlagsOf } from "./types";
|
|
11
|
-
/**
|
|
12
|
-
* @description Abstract base class for sequence generation
|
|
13
|
-
* @summary Provides a framework for generating sequential values (like primary keys) in the persistence layer.
|
|
14
|
-
* Implementations of this class handle the specifics of how sequences are stored and incremented in different
|
|
15
|
-
* database systems.
|
|
16
|
-
* @param {SequenceOptions} options - Configuration options for the sequence generator
|
|
17
|
-
* @class Sequence
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* // Example implementation for a specific database
|
|
21
|
-
* class PostgresSequence extends Sequence {
|
|
22
|
-
* constructor(options: SequenceOptions) {
|
|
23
|
-
* super(options);
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* async next(): Promise<number> {
|
|
27
|
-
* // Implementation to get next value from PostgreSQL sequence
|
|
28
|
-
* const result = await this.options.executor.raw(`SELECT nextval('${this.options.name}')`);
|
|
29
|
-
* return parseInt(result.rows[0].nextval);
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* async current(): Promise<number> {
|
|
33
|
-
* // Implementation to get current value from PostgreSQL sequence
|
|
34
|
-
* const result = await this.options.executor.raw(`SELECT currval('${this.options.name}')`);
|
|
35
|
-
* return parseInt(result.rows[0].currval);
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
38
|
-
* async range(count: number): Promise<number[]> {
|
|
39
|
-
* // Implementation to get a range of values
|
|
40
|
-
* const values: number[] = [];
|
|
41
|
-
* for (let i = 0; i < count; i++) {
|
|
42
|
-
* values.push(await this.next());
|
|
43
|
-
* }
|
|
44
|
-
* return values;
|
|
45
|
-
* }
|
|
46
|
-
* }
|
|
47
|
-
*
|
|
48
|
-
* // Usage
|
|
49
|
-
* const sequence = new PostgresSequence({
|
|
50
|
-
* name: 'user_id_seq',
|
|
51
|
-
* executor: dbExecutor
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* const nextId = await sequence.next();
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare class Sequence<A extends Adapter<any, any, any, any> = Adapter<any, any, any, any>> extends ContextualLoggedClass<any> {
|
|
58
|
-
protected readonly options: SequenceOptions;
|
|
59
|
-
protected readonly adapter: A;
|
|
60
|
-
protected repo: Repo<SequenceModel>;
|
|
61
|
-
protected static readonly lock: MultiLock;
|
|
62
|
-
/**
|
|
63
|
-
* @description Creates a new sequence instance
|
|
64
|
-
* @summary Protected constructor that initializes the sequence with the provided options
|
|
65
|
-
*/
|
|
66
|
-
constructor(options: SequenceOptions, adapter: A, overrides?: Partial<FlagsOf<A>>);
|
|
67
|
-
/**
|
|
68
|
-
* @description Retrieves the current value of the sequence
|
|
69
|
-
* @summary Gets the current value of the sequence from storage. If the sequence
|
|
70
|
-
* doesn't exist yet, it returns the configured starting value.
|
|
71
|
-
* @return A promise that resolves to the current sequence value
|
|
72
|
-
*/
|
|
73
|
-
current(...args: MaybeContextualArg<any>): Promise<string | number | bigint>;
|
|
74
|
-
/**
|
|
75
|
-
* @description Increments the sequence value
|
|
76
|
-
* @summary Increases the current sequence value by the specified amount and persists
|
|
77
|
-
* the new value to storage. This method handles both numeric and BigInt sequence types.
|
|
78
|
-
* @param {string | number | bigint} current - The current value of the sequence
|
|
79
|
-
* @param {number} [count] - Optional amount to increment by, defaults to the sequence's incrementBy value
|
|
80
|
-
* @return A promise that resolves to the new sequence value after incrementing
|
|
81
|
-
*/
|
|
82
|
-
protected increment(count: number | undefined, context: Context<any>): Promise<string | number | bigint>;
|
|
83
|
-
/**
|
|
84
|
-
* @description Gets the next value in the sequence
|
|
85
|
-
* @summary Retrieves the current value of the sequence and increments it by the
|
|
86
|
-
* configured increment amount. This is the main method used to get a new sequential value.
|
|
87
|
-
* @return A promise that resolves to the next value in the sequence
|
|
88
|
-
*/
|
|
89
|
-
next(...argz: MaybeContextualArg<any>): Promise<number | string | bigint>;
|
|
90
|
-
/**
|
|
91
|
-
* @description Generates a range of sequential values
|
|
92
|
-
* @summary Retrieves a specified number of sequential values from the sequence.
|
|
93
|
-
* This is useful when you need to allocate multiple IDs at once.
|
|
94
|
-
* The method increments the sequence by the total amount needed and returns all values in the range.
|
|
95
|
-
* @param {number} count - The number of sequential values to generate
|
|
96
|
-
* @return A promise that resolves to an array of sequential values
|
|
97
|
-
*/
|
|
98
|
-
range(count: number, ...argz: MaybeContextualArg<any>): Promise<(number | string | bigint)[]>;
|
|
99
|
-
/**
|
|
100
|
-
* @description Ensures the sequence exists and is at least a given value
|
|
101
|
-
* @summary Upserts the sequence record to the provided value when missing, and optionally only when the
|
|
102
|
-
* provided value is greater than the persisted one. This is used by decorators that want to "seed" a
|
|
103
|
-
* sequence based on an existing model value (for example when overriding/bootstrapping sequences).
|
|
104
|
-
*/
|
|
105
|
-
ensureAtLeast(value: string | number | bigint, ...argz: MaybeContextualArg<any>): Promise<string | number | bigint>;
|
|
106
|
-
protected parse(value: string | number | bigint): string | number | bigint;
|
|
107
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<typeof this.adapter>, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<typeof this.adapter>, ARGS, METHOD extends string ? true : false>;
|
|
108
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<typeof this.adapter>, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<typeof this.adapter>, ARGS, METHOD extends string ? true : false>;
|
|
109
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<typeof this.adapter>, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<typeof this.adapter>, ARGS, METHOD extends string ? true : false>>;
|
|
110
|
-
/**
|
|
111
|
-
* @description Gets the primary key sequence name for a model
|
|
112
|
-
* @summary Utility method that returns the standardized sequence name for a model's primary key
|
|
113
|
-
* @template M - The model type
|
|
114
|
-
* @param {M|Constructor<M>} model - The model instance or constructor
|
|
115
|
-
* @return {string} The sequence name for the model's primary key
|
|
116
|
-
*/
|
|
117
|
-
static pk<M extends Model>(model: M | Constructor<M>): string;
|
|
118
|
-
/**
|
|
119
|
-
* @description Parses a sequence value to the appropriate type
|
|
120
|
-
* @summary Converts a sequence value to the specified type (Number or BigInt)
|
|
121
|
-
* @param {"Number"|"BigInt"|undefined} type - The target type to convert to
|
|
122
|
-
* @param {string|number|bigint} value - The value to convert
|
|
123
|
-
* @return {string|number|bigint} The converted value
|
|
124
|
-
*/
|
|
125
|
-
static parseValue(type: SequenceOptionsType, value: string | number | bigint): string | number | bigint;
|
|
126
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sequence.js","sourceRoot":"","sources":["../../src/persistence/Sequence.ts"],"names":[],"mappings":";;;AAAA,yEAAuD;AAKvD,yCAA4C;AAE5C,2DAKiC;AACjC,gFAKwC;AACxC,2CAAoC;AACpC,+DAA4D;AAC5D,gEAAuD;AACvD,iDAA4C;AAE5C,iFAA+D;AAG/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAa,QAEX,SAAQ,6CAA0B;aAER,SAAI,GAAG,IAAI,oCAAS,EAAE,CAAC;IAEjD;;;OAGG;IACH,YACqB,OAAwB,EACxB,OAAU,EAC7B,YAAiC,EAAE;QAEnC,KAAK,EAAE,CAAC;QAJW,YAAO,GAAP,OAAO,CAAiB;QACxB,YAAO,GAAP,OAAO,CAAG;QAI7B,IAAI,CAAC,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,6BAAa,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CACpE,SAAS,CACV,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CACX,GAAG,IAA6B;QAEhC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,6BAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACzC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAkB,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAc,EAAE,GAAG,CAAC,CAAC;YAC1E,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAA0B,CAAC,CAAC;QACzD,CAAC;QAAC,OA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AK,QAAQ;wBACzB,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtB,KAAK,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;gBAC3C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACvB,KAAK,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;gBAC3C,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC1B,KAAK,SAAS,CAAC;YACf,KAAK,MAAM,CAAC;YACZ,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC;YACf;gBACE,MAAM,IAAI,yBAAgB,CACxB,8BAA8B,IAAI,gBAAgB,IAAI,EAAE,CACzD,CAAC;QACN,CAAC;IACH,CAAC;;AApaH,4BAqaC;AAED,iBAAO,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
|
|
2
|
-
import { AdapterFlags, ContextFlags } from "./types";
|
|
3
|
-
import { PreparedStatementKeys } from "../query/constants";
|
|
4
|
-
/**
|
|
5
|
-
* @description Persistence-related constant keys
|
|
6
|
-
* @summary Enum containing string constants used throughout the persistence layer for metadata, relations, and other persistence-related operations
|
|
7
|
-
* @enum {string}
|
|
8
|
-
* @readonly
|
|
9
|
-
* @memberOf module:core
|
|
10
|
-
*/
|
|
11
|
-
export declare enum PersistenceKeys {
|
|
12
|
-
PERSISTENCE = "persistence",
|
|
13
|
-
/** @description Key for index metadata */
|
|
14
|
-
INDEX = "index",
|
|
15
|
-
/** @description Key for sequence metadata */
|
|
16
|
-
SEQUENCE = "sequence",
|
|
17
|
-
/** @description Key for unique constraint metadata */
|
|
18
|
-
UNIQUE = "unique",
|
|
19
|
-
/** @description Key for adapter metadata */
|
|
20
|
-
ADAPTER = "adapter",
|
|
21
|
-
/** @description Template for injectable adapter names */
|
|
22
|
-
INJECTABLE = "decaf_{0}_adapter_for_{1}",
|
|
23
|
-
SERVICE = "service",
|
|
24
|
-
/** @description Key for table name metadata */
|
|
25
|
-
TABLE = "table",
|
|
26
|
-
/** @description Key for column name metadata */
|
|
27
|
-
COLUMN = "column",
|
|
28
|
-
/** @description Key for general metadata storage */
|
|
29
|
-
METADATA = "__metadata",
|
|
30
|
-
/** @description Key for created-by ownership metadata */
|
|
31
|
-
OWNERSHIP = "ownership",
|
|
32
|
-
/** @description Key for created-by ownership metadata */
|
|
33
|
-
CREATED_BY = "ownership.created-by",
|
|
34
|
-
/** @description Key for updated-by ownership metadata */
|
|
35
|
-
UPDATED_BY = "ownership.updated-by",
|
|
36
|
-
/** @description Key for relations metadata storage */
|
|
37
|
-
RELATIONS = "__relations",
|
|
38
|
-
/** @description Key for relations metadata storage */
|
|
39
|
-
RELATION = "relation",
|
|
40
|
-
/** @description Key for one-to-one relation metadata */
|
|
41
|
-
ONE_TO_ONE = "relation.one-to-one",
|
|
42
|
-
/** @description Key for one-to-many relation metadata */
|
|
43
|
-
ONE_TO_MANY = "relation.one-to-many",
|
|
44
|
-
/** @description Key for many-to-one relation metadata */
|
|
45
|
-
MANY_TO_ONE = "relation.many-to-one",
|
|
46
|
-
/** @description Key for many-to-one relation metadata */
|
|
47
|
-
MANY_TO_MANY = "relation.many-to-many",
|
|
48
|
-
/** @description Key for populate metadata */
|
|
49
|
-
POPULATE = "populate",
|
|
50
|
-
/** @description Key for populate metadata */
|
|
51
|
-
NO_VALIDATE = "no-validate",
|
|
52
|
-
/** @description Key for migration classes */
|
|
53
|
-
MIGRATION = "migration",
|
|
54
|
-
STATEMENT = "statement",
|
|
55
|
-
QUERY = "query",
|
|
56
|
-
UUID = "uuid",
|
|
57
|
-
TAG_FOR_DELETION = "tag_for_deletion",
|
|
58
|
-
INITIALIZATION = "initialization",
|
|
59
|
-
SHUTDOWN = "shutdown",
|
|
60
|
-
BY_KEY = "by-key",
|
|
61
|
-
AUTH = "auth",
|
|
62
|
-
AUTH_ROLE = "auth-role",
|
|
63
|
-
DECAF_ROUTE = "DecafRoute",
|
|
64
|
-
THROTTLE = "throttle",
|
|
65
|
-
PERSISTENT_VERSION = "persistent-version",
|
|
66
|
-
DEFAULT_QUERY_ATTR = "default-query-attr"
|
|
67
|
-
}
|
|
68
|
-
export declare const DefaultContextFlags: ContextFlags<any>;
|
|
69
|
-
export declare const DefaultAdapterFlags: AdapterFlags;
|
|
70
|
-
export declare const TransactionOperationKeys: (string | OperationKeys | BulkCrudOperationKeys | PersistenceKeys | PreparedStatementKeys)[];
|
|
71
|
-
export declare const NonTransactionOperationKeys: (string | OperationKeys | BulkCrudOperationKeys | PersistenceKeys | PreparedStatementKeys)[];
|
|
72
|
-
export declare const SelectOperationKeys: (string | OperationKeys | BulkCrudOperationKeys | PersistenceKeys | PreparedStatementKeys)[];
|
|
73
|
-
export declare const MultipleSelectOperationKeys: (string | OperationKeys | BulkCrudOperationKeys | PersistenceKeys | PreparedStatementKeys)[];
|
|
74
|
-
export declare const PaginationOperationKeys: (string | OperationKeys | BulkCrudOperationKeys | PersistenceKeys | PreparedStatementKeys)[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/persistence/constants.ts"],"names":[],"mappings":";;;AAAA,2DAIiC;AAEjC,wDAA2D;AAE3D;;;;;;GAMG;AACH,IAAY,eAuFX;AAvFD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,0CAA0C;IAC1C,kCAAe,CAAA;IAEf,6CAA6C;IAC7C,wCAAqB,CAAA;IAErB,sDAAsD;IACtD,oCAAiB,CAAA;IAEjB,4CAA4C;IAC5C,sCAAmB,CAAA;IAEnB,yDAAyD;IACzD,2DAAwC,CAAA;IAExC,sCAAmB,CAAA;IACnB,+CAA+C;IAC/C,kCAAe,CAAA;IAEf,gDAAgD;IAChD,oCAAiB,CAAA;IAEjB,oDAAoD;IACp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AChC,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,KAAK;IACzB,MAAM,EAAE,KAAK;IACb,kBAAkB,EAAE,KAAK;CAC1B,CACc,CAAC;AAEL,QAAA,wBAAwB,GAM/B;IACJ,6BAAa,CAAC,MAAM;IACpB,6BAAa,CAAC,MAAM;IACpB,6BAAa,CAAC,MAAM;IACpB,qCAAqB,CAAC,UAAU;IAChC,qCAAqB,CAAC,UAAU;IAChC,qCAAqB,CAAC,UAAU;CACjC,CAAC;AAEW,QAAA,2BAA2B,GAMlC,CAAC,6BAAa,CAAC,IAAI,EAAE,qCAAqB,CAAC,QAAQ,CAAC,CAAC;AAE9C,QAAA,mBAAmB,GAM1B,CAAC,eAAe,CAAC,SAAS,EAAE,iCAAqB,CAAC,WAAW,CAAC,CAAC;AAExD,QAAA,2BAA2B,GAMlC;IACJ,eAAe,CAAC,KAAK;IACrB,iCAAqB,CAAC,OAAO;IAC7B,iCAAqB,CAAC,gBAAgB;IACtC,iCAAqB,CAAC,OAAO;IAC7B,iCAAqB,CAAC,OAAO;IAC7B,iCAAqB,CAAC,IAAI;IAC1B,iCAAqB,CAAC,IAAI;CAC3B,CAAC;AAEW,QAAA,uBAAuB,GAM9B;IACJ,iCAAqB,CAAC,OAAO;IAC7B,iCAAqB,CAAC,gBAAgB;IACtC,iCAAqB,CAAC,IAAI;CAC3B,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Model } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { ContextOf } from "./types";
|
|
3
|
-
import { Repo } from "../repository/Repository";
|
|
4
|
-
import { ContextualArgs } from "../utils/ContextualLoggedClass";
|
|
5
|
-
/**
|
|
6
|
-
* @description Handler function that sets a timestamp property to the current timestamp.
|
|
7
|
-
* @summary Updates a model property with the current timestamp from the repository context.
|
|
8
|
-
* @template M - The model type extending Model
|
|
9
|
-
* @template R - The repository type extending IRepository
|
|
10
|
-
* @template V - The data type for the operation
|
|
11
|
-
* @template F - The repository flags type
|
|
12
|
-
* @template C - The context type
|
|
13
|
-
* @param {C} context - The repository context containing the current timestamp
|
|
14
|
-
* @param {V} data - The data being processed
|
|
15
|
-
* @param key - The property key to update
|
|
16
|
-
* @param {M} model - The model instance being updated
|
|
17
|
-
* @return {Promise<void>} A promise that resolves when the timestamp has been set
|
|
18
|
-
* @function uuidCreateUpdateHandler
|
|
19
|
-
*/
|
|
20
|
-
export declare function uuidCreateUpdateHandler<M extends Model<boolean>, R extends Repo<M>>(this: R, context: ContextOf<R>, data: UUIDMetadata, key: keyof M, model: M): Promise<void>;
|
|
21
|
-
export type UUIDMetadata = {
|
|
22
|
-
update: boolean;
|
|
23
|
-
seed?: string | (<M extends Model>(model: M, ...args: ContextualArgs<any>) => string);
|
|
24
|
-
args?: any[];
|
|
25
|
-
};
|
|
26
|
-
export declare function uuid(...args: any[]): (target: any, propertyKey?: any) => void;
|
|
27
|
-
export declare function uuid(update: boolean, ...args: any[]): (target: any, propertyKey?: any) => void;
|
|
28
|
-
export declare function uuid(seed: string | (<M extends Model>(model: M, ...args: ContextualArgs<any>) => string), ...args: any[]): (target: any, propertyKey?: any) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/persistence/decorators.ts"],"names":[],"mappings":";;AA6BA,0DAuBC;AAoBD,oBA6CC;AArHD,+CAA8C;AAC9C,yEAAiE;AACjE,2DAKiC;AACjC,qDAAyD;AAGzD,iDAAoC;AAGpC;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,uBAAuB,CAK3C,OAAqB,EACrB,IAAkB,EAClB,GAAY,EACZ,KAAQ;IAER,IACE,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;QACtC,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,WAAW,EACjC,CAAC;QACD,OAAO;IACT,CAAC;IAED,wCAAwC;IACxC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;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AC,GAAG,CAAC,aAAa,CAAC;SACjC,MAAM,CAAC;QACN,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;KAC9B,CAAC;SACD,KAAK,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { InternalError } from "@decaf-ts/db-decorators";
|
|
2
|
-
/**
|
|
3
|
-
* @description Error thrown when an unsupported operation is attempted
|
|
4
|
-
* @summary This error is thrown when an operation is requested that is not supported by the current
|
|
5
|
-
* persistence adapter or configuration. It extends the BaseError class and sets a 500 status code.
|
|
6
|
-
* @param {string|Error} msg - The error message or an Error object to wrap
|
|
7
|
-
* @class UnsupportedError
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* // Throwing an UnsupportedError
|
|
11
|
-
* if (!adapter.supportsTransactions()) {
|
|
12
|
-
* throw new UnsupportedError('Transactions are not supported by this adapter');
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* // Catching an UnsupportedError
|
|
16
|
-
* try {
|
|
17
|
-
* await adapter.beginTransaction();
|
|
18
|
-
* } catch (error) {
|
|
19
|
-
* if (error instanceof UnsupportedError) {
|
|
20
|
-
* console.error('Operation not supported:', error.message);
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare class UnsupportedError extends InternalError {
|
|
26
|
-
constructor(msg: string | Error | unknown);
|
|
27
|
-
}
|
|
28
|
-
export declare class MigrationError extends InternalError {
|
|
29
|
-
constructor(msg: string | Error | unknown, name?: string);
|
|
30
|
-
}
|
|
31
|
-
export declare class MigrationRuleError extends MigrationError {
|
|
32
|
-
constructor(msg: string | Error | unknown);
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/persistence/errors.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,gBAAiB,SAAQ,6BAAa;IACjD,YAAY,GAA6B;QACvC,KAAK,CAAC,GAAG,EAAE,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAJD,4CAIC;AAED,MAAa,cAAe,SAAQ,6BAAa;IAC/C,YAAY,GAA6B,EAAE,IAAI,GAAG,cAAc,CAAC,IAAI;QACnE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC;CACF;AAJD,wCAIC;AAED,MAAa,kBAAmB,SAAQ,cAAc;IACpD,YAAY,GAA6B;QACvC,KAAK,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CACF;AAJD,gDAIC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AllOperationKeys, ObserverFilter } from "./types";
|
|
2
|
-
import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
3
|
-
import type { Repo } from "../repository/Repository";
|
|
4
|
-
export declare function onlyOnCreate(clazz: ModelConstructor<any>): ObserverFilter;
|
|
5
|
-
export declare function onlyOnUpdate(clazz: ModelConstructor<any>): ObserverFilter;
|
|
6
|
-
export declare function onlyOnDelete(clazz: ModelConstructor<any>): ObserverFilter;
|
|
7
|
-
export declare function onlyOnTransactional(clazz: ModelConstructor<any>): ObserverFilter;
|
|
8
|
-
export declare function onlyOnSingle(clazz: ModelConstructor<any>): ObserverFilter;
|
|
9
|
-
export declare function onlyOnBulk(clazz: ModelConstructor<any>): ObserverFilter;
|
|
10
|
-
export declare function onlyOnFilter(clazz: ModelConstructor<any>, ops: AllOperationKeys[]): ObserverFilter;
|
|
11
|
-
export type AvailableFilters = typeof DefaultRepositoryFilters;
|
|
12
|
-
export declare const DefaultRepositoryFilters: {
|
|
13
|
-
onlyOnCreate: typeof onlyOnCreate;
|
|
14
|
-
onlyOnUpdate: typeof onlyOnUpdate;
|
|
15
|
-
onlyOnDelete: typeof onlyOnDelete;
|
|
16
|
-
onlyOnTransactional: typeof onlyOnTransactional;
|
|
17
|
-
onlyOnSingle: typeof onlyOnSingle;
|
|
18
|
-
onlyOnBulk: typeof onlyOnBulk;
|
|
19
|
-
};
|
|
20
|
-
export declare function getFilters<M extends Model>(repo: Repo<M>): Record<keyof typeof DefaultRepositoryFilters, ObserverFilter>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-filters.js","sourceRoot":"","sources":["../../src/persistence/event-filters.ts"],"names":[],"mappings":";;;AAeA,oCAKC;AAED,oCAKC;AAED,oCAKC;AAED,kDAEC;AAED,oCAEC;AAED,gCAEC;AAED,oCA4BC;AAaD,gCAQC;AAjGD,qDAA6D;AAC7D,2DAIiC;AAEjC,yEAAyE;AACzE,gFAGwC;AACxC,+CAAuD;AAGvD,SAAgB,YAAY,CAAC,KAA4B;IACvD,OAAO,YAAY,CAAC,KAAK,EAAE;QACzB,6BAAa,CAAC,MAAM;QACpB,qCAAqB,CAAC,UAAU;KACjC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,YAAY,CAAC,KAA4B;IACvD,OAAO,YAAY,CAAC,KAAK,EAAE;QACzB,6BAAa,CAAC,MAAM;QACpB,qCAAqB,CAAC,UAAU;KACjC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,YAAY,CAAC,KAA4B;IACvD,OAAO,YAAY,CAAC,KAAK,EAAE;QACzB,6BAAa,CAAC,MAAM;QACpB,qCAAqB,CAAC,UAAU;KACjC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAA4B;IAC9D,OAAO,YAAY,CAAC,KAAK,EAAE,oCAAwB,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,YAAY,CAAC,KAA4B;IACvD,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,CAAC,CAAC;AAC3D,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IAC5D,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9C,OAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAmB,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,OAAO,OAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface Generator<OUT extends string | number = string> {
|
|
2
|
-
generate(prev?: OUT): OUT | Promise<OUT>;
|
|
3
|
-
}
|
|
4
|
-
export declare class UUID implements Generator {
|
|
5
|
-
private static _instance;
|
|
6
|
-
generate(prev?: string): string | Promise<string>;
|
|
7
|
-
static get instance(): UUID;
|
|
8
|
-
}
|
|
9
|
-
export declare class Serial implements Generator {
|
|
10
|
-
private static _instance;
|
|
11
|
-
private count;
|
|
12
|
-
generate(prev?: string): string | Promise<string>;
|
|
13
|
-
static get instance(): Serial;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../src/persistence/generators.ts"],"names":[],"mappings":";;;AAIA,MAAa,IAAI;IAGf,6DAA6D;IAC7D,QAAQ,CAAC,IAAa;QACpB,OAAO,sCAAsC,CAAC,OAAO,CACnD,OAAO,EACP,UAAU,CAAC;YACT,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAChC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;YACrC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC,CACF,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,QAAQ;QACjB,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAnBD,oBAmBC;AAED,MAAa,MAAM;IAAnB;QAGU,UAAK,GAAG,EAAE,CAAC;IAarB,CAAC;IAXC,QAAQ,CAAC,IAAa;QACpB,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAsB,CAAC;QACzE,OAAO,CAAE,IAA0B,GAAG,CAAC,CAAC;aACrC,QAAQ,EAAE;aACV,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,KAAK,QAAQ;QACjB,IAAI,CAAC,MAAM,CAAC,SAAS;YAAE,MAAM,CAAC,SAAS,GAAG,IAAI,MAAM,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;CACF;AAhBD,wBAgBC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Exports for the persistence module.
|
|
3
|
-
* @summary This file exports all the necessary components for the persistence functionality, including Dispatch, constants, and more.
|
|
4
|
-
* @module core/persistence
|
|
5
|
-
*/
|
|
6
|
-
export * from "./Dispatch";
|
|
7
|
-
export * from "./constants";
|
|
8
|
-
export * from "./Context";
|
|
9
|
-
export * from "./ContextLock";
|
|
10
|
-
export * from "./decorators";
|
|
11
|
-
export * from "./errors";
|
|
12
|
-
export * from "./generators";
|
|
13
|
-
export * from "./event-filters";
|
|
14
|
-
export * from "./ObserverHandler";
|
|
15
|
-
export * from "./Sequence";
|
|
16
|
-
export * from "./types";
|
|
17
|
-
export * from "./transactions";
|
|
18
|
-
export * from "./Adapter";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/persistence/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,2BAA2B;AAC3B,iDAA2B;AAC3B,kDAA4B;AAC5B,gDAA0B;AAC1B,oDAA8B;AAC9B,mDAA6B;AAC7B,+CAAyB;AACzB,mDAA6B;AAC7B,sDAAgC;AAChC,wDAAkC;AAClC,iDAA2B;AAC3B,8CAAwB;AACxB,qDAA+B;AAC/B,gDAA0B"}
|