@decaf-ts/core 0.18.0 → 0.20.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/lib/cjs/auth/constants.cjs +2 -2
- package/lib/cjs/auth/constants.cjs.map +1 -0
- package/lib/cjs/auth/decorators.cjs +1 -0
- package/lib/cjs/auth/decorators.cjs.map +1 -0
- package/lib/cjs/auth/index.cjs +1 -0
- package/lib/cjs/auth/index.cjs.map +1 -0
- package/lib/cjs/fs/FilesystemAdapter.cjs +40 -39
- package/lib/cjs/fs/FilesystemAdapter.cjs.map +1 -0
- package/lib/cjs/fs/FsDispatch.cjs +3 -2
- package/lib/cjs/fs/FsDispatch.cjs.map +1 -0
- package/lib/cjs/fs/helpers.cjs +1 -0
- package/lib/cjs/fs/helpers.cjs.map +1 -0
- package/lib/cjs/fs/index.cjs +1 -0
- package/lib/cjs/fs/index.cjs.map +1 -0
- package/lib/cjs/fs/indexStore.cjs +8 -7
- package/lib/cjs/fs/indexStore.cjs.map +1 -0
- package/lib/cjs/fs/locks/FilesystemLock.cjs +3 -2
- package/lib/cjs/fs/locks/FilesystemLock.cjs.map +1 -0
- package/lib/cjs/fs/locks/FilesystemMultiLock.cjs +5 -4
- package/lib/cjs/fs/locks/FilesystemMultiLock.cjs.map +1 -0
- package/lib/cjs/fs/types.cjs +1 -0
- package/lib/cjs/fs/types.cjs.map +1 -0
- package/lib/cjs/identity/decorators.cjs +11 -10
- package/lib/cjs/identity/decorators.cjs.map +1 -0
- package/lib/cjs/identity/index.cjs +1 -0
- package/lib/cjs/identity/index.cjs.map +1 -0
- package/lib/cjs/index.cjs +4 -3
- package/lib/cjs/index.cjs.map +1 -0
- package/lib/cjs/interfaces/ContextuallyLogged.cjs +1 -0
- package/lib/cjs/interfaces/ContextuallyLogged.cjs.map +1 -0
- package/lib/cjs/interfaces/ErrorParser.cjs +1 -0
- package/lib/cjs/interfaces/ErrorParser.cjs.map +1 -0
- package/lib/cjs/interfaces/Executor.cjs +1 -0
- package/lib/cjs/interfaces/Executor.cjs.map +1 -0
- package/lib/cjs/interfaces/Observable.cjs +1 -0
- package/lib/cjs/interfaces/Observable.cjs.map +1 -0
- package/lib/cjs/interfaces/Observer.cjs +1 -0
- package/lib/cjs/interfaces/Observer.cjs.map +1 -0
- package/lib/cjs/interfaces/Paginatable.cjs +1 -0
- package/lib/cjs/interfaces/Paginatable.cjs.map +1 -0
- package/lib/cjs/interfaces/Queriable.cjs +1 -0
- package/lib/cjs/interfaces/Queriable.cjs.map +1 -0
- package/lib/cjs/interfaces/RawExecutor.cjs +1 -0
- package/lib/cjs/interfaces/RawExecutor.cjs.map +1 -0
- package/lib/cjs/interfaces/SequenceOptions.cjs +1 -0
- package/lib/cjs/interfaces/SequenceOptions.cjs.map +1 -0
- package/lib/cjs/interfaces/index.cjs +1 -0
- package/lib/cjs/interfaces/index.cjs.map +1 -0
- package/lib/cjs/migrations/Migration.cjs +16 -15
- package/lib/cjs/migrations/Migration.cjs.map +1 -0
- package/lib/cjs/migrations/MigrationService.cjs +38 -37
- package/lib/cjs/migrations/MigrationService.cjs.map +1 -0
- package/lib/cjs/migrations/MigrationTaskBuilder.cjs +3 -2
- package/lib/cjs/migrations/MigrationTaskBuilder.cjs.map +1 -0
- package/lib/cjs/migrations/MigrationTasks.cjs +22 -17
- package/lib/cjs/migrations/MigrationTasks.cjs.map +1 -0
- package/lib/cjs/migrations/MigrationVersioning.cjs +1 -0
- package/lib/cjs/migrations/MigrationVersioning.cjs.map +1 -0
- package/lib/cjs/migrations/SemverMigrationVersioning.cjs +1 -0
- package/lib/cjs/migrations/SemverMigrationVersioning.cjs.map +1 -0
- package/lib/cjs/migrations/StandardMigrationVersioning.cjs +1 -0
- package/lib/cjs/migrations/StandardMigrationVersioning.cjs.map +1 -0
- package/lib/cjs/migrations/constants.cjs +3 -2
- package/lib/cjs/migrations/constants.cjs.map +1 -0
- package/lib/cjs/migrations/decorators.cjs +10 -9
- package/lib/cjs/migrations/decorators.cjs.map +1 -0
- package/lib/cjs/migrations/index.cjs +6 -5
- package/lib/cjs/migrations/index.cjs.map +1 -0
- package/lib/cjs/migrations/types.cjs +1 -0
- package/lib/cjs/migrations/types.cjs.map +1 -0
- package/lib/cjs/model/BaseModel.cjs +14 -8
- package/lib/cjs/model/BaseModel.cjs.map +1 -0
- package/lib/cjs/model/SequenceModel.cjs +19 -13
- package/lib/cjs/model/SequenceModel.cjs.map +1 -0
- package/lib/cjs/model/construction.cjs +27 -26
- package/lib/cjs/model/construction.cjs.map +1 -0
- package/lib/cjs/model/decorators.cjs +48 -47
- package/lib/cjs/model/decorators.cjs.map +1 -0
- package/lib/cjs/model/index.cjs +1 -0
- package/lib/cjs/model/index.cjs.map +1 -0
- package/lib/cjs/model/indexing.cjs +6 -5
- package/lib/cjs/model/indexing.cjs.map +1 -0
- package/lib/cjs/model/types.cjs +1 -0
- package/lib/cjs/model/types.cjs.map +1 -0
- package/lib/cjs/overrides/Metadata.cjs +1 -0
- package/lib/cjs/overrides/Metadata.cjs.map +1 -0
- package/lib/cjs/overrides/Model.cjs +1 -0
- package/lib/cjs/overrides/Model.cjs.map +1 -0
- package/lib/cjs/overrides/ModelBuilder.cjs +1 -0
- package/lib/cjs/overrides/ModelBuilder.cjs.map +1 -0
- package/lib/cjs/overrides/index.cjs +1 -0
- package/lib/cjs/overrides/index.cjs.map +1 -0
- package/lib/cjs/overrides/injectables.cjs +1 -0
- package/lib/cjs/overrides/injectables.cjs.map +1 -0
- package/lib/cjs/overrides/overrides.cjs +22 -21
- package/lib/cjs/overrides/overrides.cjs.map +1 -0
- package/lib/cjs/persistence/Adapter.cjs +47 -41
- package/lib/cjs/persistence/Adapter.cjs.map +1 -0
- package/lib/cjs/persistence/Context.cjs +10 -7
- package/lib/cjs/persistence/Context.cjs.map +1 -0
- package/lib/cjs/persistence/ContextLock.cjs +1 -0
- package/lib/cjs/persistence/ContextLock.cjs.map +1 -0
- package/lib/cjs/persistence/Dispatch.cjs +15 -14
- package/lib/cjs/persistence/Dispatch.cjs.map +1 -0
- package/lib/cjs/persistence/ObserverHandler.cjs +3 -2
- package/lib/cjs/persistence/ObserverHandler.cjs.map +1 -0
- package/lib/cjs/persistence/Sequence.cjs +19 -18
- package/lib/cjs/persistence/Sequence.cjs.map +1 -0
- package/lib/cjs/persistence/constants.cjs +14 -21
- package/lib/cjs/persistence/constants.cjs.map +1 -0
- package/lib/cjs/persistence/decorators.cjs +6 -5
- package/lib/cjs/persistence/decorators.cjs.map +1 -0
- package/lib/cjs/persistence/errors.cjs +1 -0
- package/lib/cjs/persistence/errors.cjs.map +1 -0
- package/lib/cjs/persistence/event-filters.cjs +5 -4
- package/lib/cjs/persistence/event-filters.cjs.map +1 -0
- package/lib/cjs/persistence/generators.cjs +1 -0
- package/lib/cjs/persistence/generators.cjs.map +1 -0
- package/lib/cjs/persistence/index.cjs +1 -0
- package/lib/cjs/persistence/index.cjs.map +1 -0
- package/lib/cjs/persistence/transactions.cjs +9 -8
- package/lib/cjs/persistence/transactions.cjs.map +1 -0
- package/lib/cjs/persistence/types.cjs +1 -0
- package/lib/cjs/persistence/types.cjs.map +1 -0
- package/lib/cjs/query/Condition.cjs +173 -165
- package/lib/cjs/query/Condition.cjs.map +1 -0
- package/lib/cjs/query/MethodQueryBuilder.cjs +37 -34
- package/lib/cjs/query/MethodQueryBuilder.cjs.map +1 -0
- package/lib/cjs/query/Paginator.cjs +28 -27
- package/lib/cjs/query/Paginator.cjs.map +1 -0
- package/lib/cjs/query/Statement.cjs +90 -84
- package/lib/cjs/query/Statement.cjs.map +1 -0
- package/lib/cjs/query/constants.cjs +5 -21
- package/lib/cjs/query/constants.cjs.map +1 -0
- package/lib/cjs/query/decorators.cjs +16 -15
- package/lib/cjs/query/decorators.cjs.map +1 -0
- package/lib/cjs/query/errors.cjs +1 -0
- package/lib/cjs/query/errors.cjs.map +1 -0
- package/lib/cjs/query/index.cjs +1 -0
- package/lib/cjs/query/index.cjs.map +1 -0
- package/lib/cjs/query/options.cjs +1 -0
- package/lib/cjs/query/options.cjs.map +1 -0
- package/lib/cjs/query/selectors.cjs +1 -0
- package/lib/cjs/query/selectors.cjs.map +1 -0
- package/lib/cjs/query/types.cjs +2 -13
- package/lib/cjs/query/types.cjs.map +1 -0
- package/lib/cjs/query/utils.cjs +10 -9
- package/lib/cjs/query/utils.cjs.map +1 -0
- package/lib/cjs/ram/RamAdapter.cjs +21 -20
- package/lib/cjs/ram/RamAdapter.cjs.map +1 -0
- package/lib/cjs/ram/RamPaginator.cjs +3 -2
- package/lib/cjs/ram/RamPaginator.cjs.map +1 -0
- package/lib/cjs/ram/RamStatement.cjs +38 -37
- package/lib/cjs/ram/RamStatement.cjs.map +1 -0
- package/lib/cjs/ram/constants.cjs +1 -0
- package/lib/cjs/ram/constants.cjs.map +1 -0
- package/lib/cjs/ram/handlers.cjs +3 -2
- package/lib/cjs/ram/handlers.cjs.map +1 -0
- package/lib/cjs/ram/index.cjs +8 -7
- package/lib/cjs/ram/index.cjs.map +1 -0
- package/lib/cjs/ram/types.cjs +1 -0
- package/lib/cjs/ram/types.cjs.map +1 -0
- package/lib/cjs/repository/Repository.cjs +85 -79
- package/lib/cjs/repository/Repository.cjs.map +1 -0
- package/lib/cjs/repository/constants.cjs +5 -20
- package/lib/cjs/repository/constants.cjs.map +1 -0
- package/lib/cjs/repository/decorators.cjs +7 -6
- package/lib/cjs/repository/decorators.cjs.map +1 -0
- package/lib/cjs/repository/errors.cjs +1 -0
- package/lib/cjs/repository/errors.cjs.map +1 -0
- package/lib/cjs/repository/index.cjs +1 -0
- package/lib/cjs/repository/index.cjs.map +1 -0
- package/lib/cjs/repository/injectables.cjs +14 -13
- package/lib/cjs/repository/injectables.cjs.map +1 -0
- package/lib/cjs/repository/types.cjs +1 -0
- package/lib/cjs/repository/types.cjs.map +1 -0
- package/lib/cjs/repository/utils.cjs +3 -2
- package/lib/cjs/repository/utils.cjs.map +1 -0
- package/lib/cjs/services/ModelService.cjs +36 -30
- package/lib/cjs/services/ModelService.cjs.map +1 -0
- package/lib/cjs/services/PersistenceService.cjs +9 -8
- package/lib/cjs/services/PersistenceService.cjs.map +1 -0
- package/lib/cjs/services/index.cjs +1 -0
- package/lib/cjs/services/index.cjs.map +1 -0
- package/lib/cjs/services/services.cjs +37 -31
- package/lib/cjs/services/services.cjs.map +1 -0
- package/lib/cjs/tasks/CleanUpTask.cjs +30 -24
- package/lib/cjs/tasks/CleanUpTask.cjs.map +1 -0
- package/lib/cjs/tasks/TaskContext.cjs +16 -15
- package/lib/cjs/tasks/TaskContext.cjs.map +1 -0
- package/lib/cjs/tasks/TaskEngine.cjs +112 -111
- package/lib/cjs/tasks/TaskEngine.cjs.map +1 -0
- package/lib/cjs/tasks/TaskErrors.cjs +1 -0
- package/lib/cjs/tasks/TaskErrors.cjs.map +1 -0
- package/lib/cjs/tasks/TaskEventBus.cjs +7 -6
- package/lib/cjs/tasks/TaskEventBus.cjs.map +1 -0
- package/lib/cjs/tasks/TaskEventService.cjs +8 -7
- package/lib/cjs/tasks/TaskEventService.cjs.map +1 -0
- package/lib/cjs/tasks/TaskHandler.cjs +5 -4
- package/lib/cjs/tasks/TaskHandler.cjs.map +1 -0
- package/lib/cjs/tasks/TaskHandlerRegistry.cjs +1 -0
- package/lib/cjs/tasks/TaskHandlerRegistry.cjs.map +1 -0
- package/lib/cjs/tasks/TaskService.cjs +43 -37
- package/lib/cjs/tasks/TaskService.cjs.map +1 -0
- package/lib/cjs/tasks/TaskStateChangeError.cjs +1 -0
- package/lib/cjs/tasks/TaskStateChangeError.cjs.map +1 -0
- package/lib/cjs/tasks/TaskTracker.cjs +62 -61
- package/lib/cjs/tasks/TaskTracker.cjs.map +1 -0
- package/lib/cjs/tasks/builder.cjs +30 -24
- package/lib/cjs/tasks/builder.cjs.map +1 -0
- package/lib/cjs/tasks/constants.cjs +6 -10
- package/lib/cjs/tasks/constants.cjs.map +1 -0
- package/lib/cjs/tasks/decorators.cjs +5 -4
- package/lib/cjs/tasks/decorators.cjs.map +1 -0
- package/lib/cjs/tasks/index.cjs +6 -5
- package/lib/cjs/tasks/index.cjs.map +1 -0
- package/lib/cjs/tasks/logging.cjs +12 -11
- package/lib/cjs/tasks/logging.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskBackoffModel.cjs +16 -10
- package/lib/cjs/tasks/models/TaskBackoffModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskErrorModel.cjs +11 -5
- package/lib/cjs/tasks/models/TaskErrorModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskEventModel.cjs +29 -23
- package/lib/cjs/tasks/models/TaskEventModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskIOSerializer.cjs +4 -3
- package/lib/cjs/tasks/models/TaskIOSerializer.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskLogEntryModel.cjs +11 -5
- package/lib/cjs/tasks/models/TaskLogEntryModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskModel.cjs +72 -66
- package/lib/cjs/tasks/models/TaskModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskStepResultModel.cjs +14 -8
- package/lib/cjs/tasks/models/TaskStepResultModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/TaskStepSpecModel.cjs +11 -5
- package/lib/cjs/tasks/models/TaskStepSpecModel.cjs.map +1 -0
- package/lib/cjs/tasks/models/index.cjs +1 -0
- package/lib/cjs/tasks/models/index.cjs.map +1 -0
- package/lib/cjs/tasks/types.cjs +1 -0
- package/lib/cjs/tasks/types.cjs.map +1 -0
- package/lib/cjs/tasks/utils.cjs +6 -5
- package/lib/cjs/tasks/utils.cjs.map +1 -0
- package/lib/cjs/utils/ContextualLoggedClass.cjs +5 -4
- package/lib/cjs/utils/ContextualLoggedClass.cjs.map +1 -0
- package/lib/cjs/utils/decorators.cjs +9 -8
- package/lib/cjs/utils/decorators.cjs.map +1 -0
- package/lib/cjs/utils/errors.cjs +1 -0
- package/lib/cjs/utils/errors.cjs.map +1 -0
- package/lib/cjs/utils/index.cjs +1 -0
- package/lib/cjs/utils/index.cjs.map +1 -0
- package/lib/cjs/utils/throttling.cjs +4 -3
- package/lib/cjs/utils/throttling.cjs.map +1 -0
- package/lib/cjs/utils/types.cjs +1 -0
- package/lib/cjs/utils/types.cjs.map +1 -0
- package/lib/cjs/utils/utils.cjs +3 -2
- package/lib/cjs/utils/utils.cjs.map +1 -0
- package/lib/cjs/workers/TaskEngine.cjs +30 -29
- package/lib/cjs/workers/TaskEngine.cjs.map +1 -0
- package/lib/cjs/workers/WorkThreadEnvironment.cjs +1 -0
- package/lib/cjs/workers/WorkThreadEnvironment.cjs.map +1 -0
- package/lib/cjs/workers/index.cjs +1 -0
- package/lib/cjs/workers/index.cjs.map +1 -0
- package/lib/cjs/workers/messages.cjs +1 -0
- package/lib/cjs/workers/messages.cjs.map +1 -0
- package/lib/cjs/workers/types.cjs +1 -0
- package/lib/cjs/workers/types.cjs.map +1 -0
- package/lib/cjs/workers/workerThread.cjs +18 -17
- package/lib/cjs/workers/workerThread.cjs.map +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/types/auth/constants.d.mts +5 -0
- package/lib/types/auth/decorators.d.cts +5 -0
- package/lib/types/auth/{decorators.d.ts → decorators.d.mts} +2 -2
- package/lib/types/auth/index.d.cts +2 -0
- package/lib/types/auth/index.d.mts +2 -0
- package/lib/types/fs/FilesystemAdapter.d.cts +70 -0
- package/lib/types/fs/{FilesystemAdapter.d.ts → FilesystemAdapter.d.mts} +5 -5
- package/lib/types/fs/FsDispatch.d.cts +7 -0
- package/lib/types/fs/{FsDispatch.d.ts → FsDispatch.d.mts} +4 -4
- package/lib/types/fs/helpers.d.mts +17 -0
- package/lib/types/fs/index.d.cts +4 -0
- package/lib/types/fs/index.d.mts +4 -0
- package/lib/types/fs/indexStore.d.cts +28 -0
- package/lib/types/fs/{indexStore.d.ts → indexStore.d.mts} +2 -2
- package/lib/types/fs/locks/FilesystemLock.d.mts +13 -0
- package/lib/types/fs/locks/FilesystemMultiLock.d.mts +8 -0
- package/lib/types/fs/types.d.cts +40 -0
- package/lib/types/fs/{types.d.ts → types.d.mts} +2 -2
- package/lib/types/identity/decorators.d.cts +72 -0
- package/lib/types/identity/{decorators.d.ts → decorators.d.mts} +3 -3
- package/lib/types/identity/index.d.cts +6 -0
- package/lib/types/identity/{index.d.ts → index.d.mts} +1 -1
- package/lib/types/index.d.cts +34 -0
- package/lib/types/{index.d.ts → index.d.mts} +13 -13
- package/lib/types/interfaces/ContextuallyLogged.d.cts +8 -0
- package/lib/types/interfaces/{ContextuallyLogged.d.ts → ContextuallyLogged.d.mts} +2 -2
- package/lib/types/interfaces/ErrorParser.d.mts +16 -0
- package/lib/types/interfaces/Executor.d.mts +16 -0
- package/lib/types/interfaces/Observable.d.cts +33 -0
- package/lib/types/interfaces/{Observable.d.ts → Observable.d.mts} +1 -1
- package/lib/types/interfaces/Observer.d.mts +15 -0
- package/lib/types/interfaces/Paginatable.d.cts +20 -0
- package/lib/types/interfaces/{Paginatable.d.ts → Paginatable.d.mts} +1 -1
- package/lib/types/interfaces/Queriable.d.cts +47 -0
- package/lib/types/interfaces/{Queriable.d.ts → Queriable.d.mts} +2 -2
- package/lib/types/interfaces/RawExecutor.d.cts +28 -0
- package/lib/types/interfaces/{RawExecutor.d.ts → RawExecutor.d.mts} +1 -1
- package/lib/types/interfaces/SequenceOptions.d.mts +79 -0
- package/lib/types/interfaces/index.d.cts +12 -0
- package/lib/types/interfaces/index.d.mts +12 -0
- package/lib/types/migrations/Migration.d.cts +19 -0
- package/lib/types/migrations/{Migration.d.ts → Migration.d.mts} +4 -4
- package/lib/types/migrations/MigrationService.d.cts +63 -0
- package/lib/types/migrations/{MigrationService.d.ts → MigrationService.d.mts} +7 -7
- package/lib/types/migrations/MigrationTaskBuilder.d.cts +10 -0
- package/lib/types/migrations/{MigrationTaskBuilder.d.ts → MigrationTaskBuilder.d.mts} +3 -3
- package/lib/types/migrations/MigrationTasks.d.cts +9 -0
- package/lib/types/migrations/{MigrationTasks.d.ts → MigrationTasks.d.mts} +2 -2
- package/lib/types/migrations/MigrationVersioning.d.mts +7 -0
- package/lib/types/migrations/SemverMigrationVersioning.d.cts +10 -0
- package/lib/types/migrations/{SemverMigrationVersioning.d.ts → SemverMigrationVersioning.d.mts} +1 -1
- package/lib/types/migrations/StandardMigrationVersioning.d.cts +12 -0
- package/lib/types/migrations/{StandardMigrationVersioning.d.ts → StandardMigrationVersioning.d.mts} +1 -1
- package/lib/types/migrations/constants.d.cts +2 -0
- package/lib/types/migrations/{constants.d.ts → constants.d.mts} +1 -1
- package/lib/types/migrations/decorators.d.cts +12 -0
- package/lib/types/migrations/{decorators.d.ts → decorators.d.mts} +1 -1
- package/lib/types/migrations/index.d.cts +15 -0
- package/lib/types/migrations/index.d.mts +15 -0
- package/lib/types/migrations/types.d.cts +46 -0
- package/lib/types/migrations/{types.d.ts → types.d.mts} +5 -5
- package/lib/types/model/BaseModel.d.mts +37 -0
- package/lib/types/model/SequenceModel.d.cts +32 -0
- package/lib/types/model/{SequenceModel.d.ts → SequenceModel.d.mts} +1 -1
- package/lib/types/model/construction.d.cts +455 -0
- package/lib/types/model/{construction.d.ts → construction.d.mts} +4 -4
- package/lib/types/model/decorators.d.cts +237 -0
- package/lib/types/model/{decorators.d.ts → decorators.d.mts} +4 -4
- package/lib/types/model/index.d.cts +11 -0
- package/lib/types/model/{index.d.ts → index.d.mts} +6 -6
- package/lib/types/model/indexing.d.cts +20 -0
- package/lib/types/model/{indexing.d.ts → indexing.d.mts} +1 -1
- package/lib/types/model/types.d.cts +60 -0
- package/lib/types/model/{types.d.ts → types.d.mts} +2 -2
- package/lib/types/overrides/Metadata.d.cts +22 -0
- package/lib/types/overrides/{Metadata.d.ts → Metadata.d.mts} +6 -6
- package/lib/types/overrides/Model.d.cts +94 -0
- package/lib/types/overrides/{Model.d.ts → Model.d.mts} +3 -3
- package/lib/types/overrides/ModelBuilder.d.mts +31 -0
- package/lib/types/overrides/index.d.cts +11 -0
- package/lib/types/overrides/{index.d.ts → index.d.mts} +5 -5
- package/lib/types/overrides/injectables.d.cts +10 -0
- package/lib/types/overrides/{injectables.d.ts → injectables.d.mts} +2 -2
- package/lib/types/overrides/overrides.d.mts +1 -0
- package/lib/types/persistence/Adapter.d.cts +469 -0
- package/lib/types/persistence/{Adapter.d.ts → Adapter.d.mts} +15 -15
- package/lib/types/persistence/Context.d.cts +16 -0
- package/lib/types/persistence/{Context.d.ts → Context.d.mts} +1 -1
- package/lib/types/persistence/ContextLock.d.cts +18 -0
- package/lib/types/persistence/{ContextLock.d.ts → ContextLock.d.mts} +1 -1
- package/lib/types/persistence/Dispatch.d.cts +128 -0
- package/lib/types/persistence/{Dispatch.d.ts → Dispatch.d.mts} +4 -4
- package/lib/types/persistence/ObserverHandler.d.cts +111 -0
- package/lib/types/persistence/{ObserverHandler.d.ts → ObserverHandler.d.mts} +4 -4
- package/lib/types/persistence/Sequence.d.cts +126 -0
- package/lib/types/persistence/{Sequence.d.ts → Sequence.d.mts} +7 -7
- package/lib/types/persistence/constants.d.cts +74 -0
- package/lib/types/persistence/{constants.d.ts → constants.d.mts} +2 -2
- package/lib/types/persistence/decorators.d.cts +28 -0
- package/lib/types/persistence/{decorators.d.ts → decorators.d.mts} +3 -3
- package/lib/types/persistence/errors.d.mts +33 -0
- package/lib/types/persistence/event-filters.d.cts +20 -0
- package/lib/types/persistence/{event-filters.d.ts → event-filters.d.mts} +2 -2
- package/lib/types/persistence/generators.d.mts +14 -0
- package/lib/types/persistence/index.d.cts +18 -0
- package/lib/types/persistence/index.d.mts +18 -0
- package/lib/types/persistence/transactions.d.cts +4 -0
- package/lib/types/persistence/{transactions.d.ts → transactions.d.mts} +2 -2
- package/lib/types/persistence/types.d.cts +86 -0
- package/lib/types/persistence/{types.d.ts → types.d.mts} +8 -8
- package/lib/types/query/Condition.d.cts +131 -0
- package/lib/types/query/{Condition.d.ts → Condition.d.mts} +2 -2
- package/lib/types/query/MethodQueryBuilder.d.cts +185 -0
- package/lib/types/query/{MethodQueryBuilder.d.ts → MethodQueryBuilder.d.mts} +1 -1
- package/lib/types/query/Paginator.d.cts +105 -0
- package/lib/types/query/{Paginator.d.ts → Paginator.d.mts} +3 -3
- package/lib/types/query/Statement.d.cts +136 -0
- package/lib/types/query/{Statement.d.ts → Statement.d.mts} +11 -11
- package/lib/types/query/constants.d.mts +69 -0
- package/lib/types/query/decorators.d.cts +8 -0
- package/lib/types/query/{decorators.d.ts → decorators.d.mts} +3 -3
- package/lib/types/query/errors.d.mts +21 -0
- package/lib/types/query/index.d.cts +16 -0
- package/lib/types/query/index.d.mts +16 -0
- package/lib/types/query/options.d.cts +393 -0
- package/lib/types/query/{options.d.ts → options.d.mts} +4 -4
- package/lib/types/query/selectors.d.cts +39 -0
- package/lib/types/query/{selectors.d.ts → selectors.d.mts} +1 -1
- package/lib/types/query/types.d.cts +158 -0
- package/lib/types/query/{types.d.ts → types.d.mts} +3 -3
- package/lib/types/query/utils.d.cts +40 -0
- package/lib/types/query/{utils.d.ts → utils.d.mts} +1 -1
- package/lib/types/ram/RamAdapter.d.cts +341 -0
- package/lib/types/ram/{RamAdapter.d.ts → RamAdapter.d.mts} +7 -7
- package/lib/types/ram/RamPaginator.d.cts +54 -0
- package/lib/types/ram/{RamPaginator.d.ts → RamPaginator.d.mts} +4 -4
- package/lib/types/ram/RamStatement.d.cts +92 -0
- package/lib/types/ram/{RamStatement.d.ts → RamStatement.d.mts} +5 -5
- package/lib/types/ram/constants.d.mts +8 -0
- package/lib/types/ram/handlers.d.cts +24 -0
- package/lib/types/ram/{handlers.d.ts → handlers.d.mts} +3 -3
- package/lib/types/ram/index.d.cts +12 -0
- package/lib/types/ram/{index.d.ts → index.d.mts} +6 -6
- package/lib/types/ram/types.d.cts +50 -0
- package/lib/types/ram/{types.d.ts → types.d.mts} +3 -3
- package/lib/types/repository/Repository.d.cts +501 -0
- package/lib/types/repository/{Repository.d.ts → Repository.d.mts} +13 -13
- package/lib/types/repository/constants.d.cts +36 -0
- package/lib/types/repository/{constants.d.ts → constants.d.mts} +1 -1
- package/lib/types/repository/decorators.d.mts +30 -0
- package/lib/types/repository/errors.d.mts +19 -0
- package/lib/types/repository/index.d.cts +12 -0
- package/lib/types/repository/{index.d.ts → index.d.mts} +7 -7
- package/lib/types/repository/injectables.d.mts +95 -0
- package/lib/types/repository/types.d.cts +28 -0
- package/lib/types/repository/{types.d.ts → types.d.mts} +1 -1
- package/lib/types/repository/utils.d.mts +36 -0
- package/lib/types/services/ModelService.d.cts +45 -0
- package/lib/types/services/{ModelService.d.ts → ModelService.d.mts} +8 -8
- package/lib/types/services/PersistenceService.d.cts +17 -0
- package/lib/types/services/{PersistenceService.d.ts → PersistenceService.d.mts} +4 -4
- package/lib/types/services/index.d.cts +8 -0
- package/lib/types/services/{index.d.ts → index.d.mts} +3 -3
- package/lib/types/services/services.d.cts +96 -0
- package/lib/types/services/{services.d.ts → services.d.mts} +5 -5
- package/lib/types/tasks/CleanUpTask.d.cts +15 -0
- package/lib/types/tasks/{CleanUpTask.d.ts → CleanUpTask.d.mts} +5 -5
- package/lib/types/tasks/TaskContext.d.cts +30 -0
- package/lib/types/tasks/{TaskContext.d.ts → TaskContext.d.mts} +7 -7
- package/lib/types/tasks/TaskEngine.d.cts +97 -0
- package/lib/types/tasks/{TaskEngine.d.ts → TaskEngine.d.mts} +18 -18
- package/lib/types/tasks/TaskErrors.d.cts +65 -0
- package/lib/types/tasks/{TaskErrors.d.ts → TaskErrors.d.mts} +2 -2
- package/lib/types/tasks/TaskEventBus.d.cts +17 -0
- package/lib/types/tasks/{TaskEventBus.d.ts → TaskEventBus.d.mts} +7 -7
- package/lib/types/tasks/TaskEventService.d.cts +7 -0
- package/lib/types/tasks/TaskEventService.d.mts +7 -0
- package/lib/types/tasks/TaskHandler.d.cts +12 -0
- package/lib/types/tasks/{TaskHandler.d.ts → TaskHandler.d.mts} +3 -3
- package/lib/types/tasks/TaskHandlerRegistry.d.cts +8 -0
- package/lib/types/tasks/{TaskHandlerRegistry.d.ts → TaskHandlerRegistry.d.mts} +1 -1
- package/lib/types/tasks/TaskService.d.cts +65 -0
- package/lib/types/tasks/{TaskService.d.ts → TaskService.d.mts} +15 -15
- package/lib/types/tasks/TaskStateChangeError.d.cts +11 -0
- package/lib/types/tasks/{TaskStateChangeError.d.ts → TaskStateChangeError.d.mts} +2 -2
- package/lib/types/tasks/TaskTracker.d.cts +47 -0
- package/lib/types/tasks/{TaskTracker.d.ts → TaskTracker.d.mts} +8 -8
- package/lib/types/tasks/builder.d.cts +72 -0
- package/lib/types/tasks/{builder.d.ts → builder.d.mts} +4 -4
- package/lib/types/tasks/constants.d.cts +31 -0
- package/lib/types/tasks/{constants.d.ts → constants.d.mts} +1 -1
- package/lib/types/tasks/decorators.d.mts +4 -0
- package/lib/types/tasks/index.d.cts +23 -0
- package/lib/types/tasks/index.d.mts +23 -0
- package/lib/types/tasks/logging.d.cts +31 -0
- package/lib/types/tasks/{logging.d.ts → logging.d.mts} +1 -1
- package/lib/types/tasks/models/TaskBackoffModel.d.cts +9 -0
- package/lib/types/tasks/models/{TaskBackoffModel.d.ts → TaskBackoffModel.d.mts} +1 -1
- package/lib/types/tasks/models/TaskErrorModel.d.mts +8 -0
- package/lib/types/tasks/models/TaskEventModel.d.cts +11 -0
- package/lib/types/tasks/models/{TaskEventModel.d.ts → TaskEventModel.d.mts} +1 -1
- package/lib/types/tasks/models/TaskIOSerializer.d.mts +33 -0
- package/lib/types/tasks/models/TaskLogEntryModel.d.mts +10 -0
- package/lib/types/tasks/models/TaskModel.d.cts +43 -0
- package/lib/types/tasks/models/{TaskModel.d.ts → TaskModel.d.mts} +6 -6
- package/lib/types/tasks/models/TaskStepResultModel.d.cts +9 -0
- package/lib/types/tasks/models/{TaskStepResultModel.d.ts → TaskStepResultModel.d.mts} +2 -2
- package/lib/types/tasks/models/TaskStepSpecModel.d.mts +9 -0
- package/lib/types/tasks/models/index.d.cts +8 -0
- package/lib/types/tasks/models/index.d.mts +8 -0
- package/lib/types/tasks/types.d.cts +71 -0
- package/lib/types/tasks/{types.d.ts → types.d.mts} +10 -10
- package/lib/types/tasks/utils.d.cts +5 -0
- package/lib/types/tasks/{utils.d.ts → utils.d.mts} +2 -2
- package/lib/types/utils/ContextualLoggedClass.d.cts +37 -0
- package/lib/types/utils/{ContextualLoggedClass.d.ts → ContextualLoggedClass.d.mts} +4 -4
- package/lib/types/utils/decorators.d.cts +27 -0
- package/lib/types/utils/{decorators.d.ts → decorators.d.mts} +1 -1
- package/lib/types/utils/errors.d.mts +56 -0
- package/lib/types/utils/index.d.cts +11 -0
- package/lib/types/utils/{index.d.ts → index.d.mts} +6 -6
- package/lib/types/utils/throttling.d.mts +9 -0
- package/lib/types/utils/types.d.mts +23 -0
- package/lib/types/utils/utils.d.mts +22 -0
- package/lib/types/workers/TaskEngine.d.cts +40 -0
- package/lib/types/workers/{TaskEngine.d.ts → TaskEngine.d.mts} +6 -6
- package/lib/types/workers/WorkThreadEnvironment.d.cts +35 -0
- package/lib/types/workers/{WorkThreadEnvironment.d.ts → WorkThreadEnvironment.d.mts} +1 -1
- package/lib/types/workers/index.d.cts +5 -0
- package/lib/types/workers/index.d.mts +5 -0
- package/lib/types/workers/messages.d.cts +69 -0
- package/lib/types/workers/{messages.d.ts → messages.d.mts} +1 -1
- package/lib/types/workers/types.d.cts +41 -0
- package/lib/types/workers/{types.d.ts → types.d.mts} +3 -3
- package/lib/types/workers/workerThread.d.mts +1 -0
- package/package.json +4 -4
- package/lib/cjs/auth/constants.js.map +0 -1
- package/lib/cjs/auth/decorators.js.map +0 -1
- package/lib/cjs/auth/index.js.map +0 -1
- package/lib/cjs/fs/FilesystemAdapter.js.map +0 -1
- package/lib/cjs/fs/FsDispatch.js.map +0 -1
- package/lib/cjs/fs/helpers.js.map +0 -1
- package/lib/cjs/fs/index.js.map +0 -1
- package/lib/cjs/fs/indexStore.js.map +0 -1
- package/lib/cjs/fs/locks/FilesystemLock.js.map +0 -1
- package/lib/cjs/fs/locks/FilesystemMultiLock.js.map +0 -1
- package/lib/cjs/fs/types.js.map +0 -1
- package/lib/cjs/identity/decorators.js.map +0 -1
- package/lib/cjs/identity/index.js.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/interfaces/ContextuallyLogged.js.map +0 -1
- package/lib/cjs/interfaces/ErrorParser.js.map +0 -1
- package/lib/cjs/interfaces/Executor.js.map +0 -1
- package/lib/cjs/interfaces/Observable.js.map +0 -1
- package/lib/cjs/interfaces/Observer.js.map +0 -1
- package/lib/cjs/interfaces/Paginatable.js.map +0 -1
- package/lib/cjs/interfaces/Queriable.js.map +0 -1
- package/lib/cjs/interfaces/RawExecutor.js.map +0 -1
- package/lib/cjs/interfaces/SequenceOptions.js.map +0 -1
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/migrations/Migration.js.map +0 -1
- package/lib/cjs/migrations/MigrationService.js.map +0 -1
- package/lib/cjs/migrations/MigrationTaskBuilder.js.map +0 -1
- package/lib/cjs/migrations/MigrationTasks.js.map +0 -1
- package/lib/cjs/migrations/MigrationVersioning.js.map +0 -1
- package/lib/cjs/migrations/SemverMigrationVersioning.js.map +0 -1
- package/lib/cjs/migrations/StandardMigrationVersioning.js.map +0 -1
- package/lib/cjs/migrations/constants.js.map +0 -1
- package/lib/cjs/migrations/decorators.js.map +0 -1
- package/lib/cjs/migrations/index.js.map +0 -1
- package/lib/cjs/migrations/types.js.map +0 -1
- package/lib/cjs/model/BaseModel.js.map +0 -1
- package/lib/cjs/model/SequenceModel.js.map +0 -1
- package/lib/cjs/model/construction.js.map +0 -1
- package/lib/cjs/model/decorators.js.map +0 -1
- package/lib/cjs/model/index.js.map +0 -1
- package/lib/cjs/model/indexing.js.map +0 -1
- package/lib/cjs/model/types.js.map +0 -1
- package/lib/cjs/overrides/Metadata.js.map +0 -1
- package/lib/cjs/overrides/Model.js.map +0 -1
- package/lib/cjs/overrides/ModelBuilder.js.map +0 -1
- package/lib/cjs/overrides/index.js.map +0 -1
- package/lib/cjs/overrides/injectables.js.map +0 -1
- package/lib/cjs/overrides/overrides.js.map +0 -1
- package/lib/cjs/persistence/Adapter.js.map +0 -1
- package/lib/cjs/persistence/Context.js.map +0 -1
- package/lib/cjs/persistence/ContextLock.js.map +0 -1
- package/lib/cjs/persistence/Dispatch.js.map +0 -1
- package/lib/cjs/persistence/ObserverHandler.js.map +0 -1
- package/lib/cjs/persistence/Sequence.js.map +0 -1
- package/lib/cjs/persistence/constants.js.map +0 -1
- package/lib/cjs/persistence/decorators.js.map +0 -1
- package/lib/cjs/persistence/errors.js.map +0 -1
- package/lib/cjs/persistence/event-filters.js.map +0 -1
- package/lib/cjs/persistence/generators.js.map +0 -1
- package/lib/cjs/persistence/index.js.map +0 -1
- package/lib/cjs/persistence/transactions.js.map +0 -1
- package/lib/cjs/persistence/types.js.map +0 -1
- package/lib/cjs/query/Condition.js.map +0 -1
- package/lib/cjs/query/MethodQueryBuilder.js.map +0 -1
- package/lib/cjs/query/Paginator.js.map +0 -1
- package/lib/cjs/query/Statement.js.map +0 -1
- package/lib/cjs/query/constants.js.map +0 -1
- package/lib/cjs/query/decorators.js.map +0 -1
- package/lib/cjs/query/errors.js.map +0 -1
- package/lib/cjs/query/index.js.map +0 -1
- package/lib/cjs/query/options.js.map +0 -1
- package/lib/cjs/query/selectors.js.map +0 -1
- package/lib/cjs/query/types.js.map +0 -1
- package/lib/cjs/query/utils.js.map +0 -1
- package/lib/cjs/ram/RamAdapter.js.map +0 -1
- package/lib/cjs/ram/RamPaginator.js.map +0 -1
- package/lib/cjs/ram/RamStatement.js.map +0 -1
- package/lib/cjs/ram/constants.js.map +0 -1
- package/lib/cjs/ram/handlers.js.map +0 -1
- package/lib/cjs/ram/index.js.map +0 -1
- package/lib/cjs/ram/types.js.map +0 -1
- package/lib/cjs/repository/Repository.js.map +0 -1
- package/lib/cjs/repository/constants.js.map +0 -1
- package/lib/cjs/repository/decorators.js.map +0 -1
- package/lib/cjs/repository/errors.js.map +0 -1
- package/lib/cjs/repository/index.js.map +0 -1
- package/lib/cjs/repository/injectables.js.map +0 -1
- package/lib/cjs/repository/types.js.map +0 -1
- package/lib/cjs/repository/utils.js.map +0 -1
- package/lib/cjs/services/ModelService.js.map +0 -1
- package/lib/cjs/services/PersistenceService.js.map +0 -1
- package/lib/cjs/services/index.js.map +0 -1
- package/lib/cjs/services/services.js.map +0 -1
- package/lib/cjs/tasks/CleanUpTask.js.map +0 -1
- package/lib/cjs/tasks/TaskContext.js.map +0 -1
- package/lib/cjs/tasks/TaskEngine.js.map +0 -1
- package/lib/cjs/tasks/TaskErrors.js.map +0 -1
- package/lib/cjs/tasks/TaskEventBus.js.map +0 -1
- package/lib/cjs/tasks/TaskEventService.js.map +0 -1
- package/lib/cjs/tasks/TaskHandler.js.map +0 -1
- package/lib/cjs/tasks/TaskHandlerRegistry.js.map +0 -1
- package/lib/cjs/tasks/TaskService.js.map +0 -1
- package/lib/cjs/tasks/TaskStateChangeError.js.map +0 -1
- package/lib/cjs/tasks/TaskTracker.js.map +0 -1
- package/lib/cjs/tasks/builder.js.map +0 -1
- package/lib/cjs/tasks/constants.js.map +0 -1
- package/lib/cjs/tasks/decorators.js.map +0 -1
- package/lib/cjs/tasks/index.js.map +0 -1
- package/lib/cjs/tasks/logging.js.map +0 -1
- package/lib/cjs/tasks/models/TaskBackoffModel.js.map +0 -1
- package/lib/cjs/tasks/models/TaskErrorModel.js.map +0 -1
- package/lib/cjs/tasks/models/TaskEventModel.js.map +0 -1
- package/lib/cjs/tasks/models/TaskIOSerializer.js.map +0 -1
- package/lib/cjs/tasks/models/TaskLogEntryModel.js.map +0 -1
- package/lib/cjs/tasks/models/TaskModel.js.map +0 -1
- package/lib/cjs/tasks/models/TaskStepResultModel.js.map +0 -1
- package/lib/cjs/tasks/models/TaskStepSpecModel.js.map +0 -1
- package/lib/cjs/tasks/models/index.js.map +0 -1
- package/lib/cjs/tasks/types.js.map +0 -1
- package/lib/cjs/tasks/utils.js.map +0 -1
- package/lib/cjs/utils/ContextualLoggedClass.js.map +0 -1
- package/lib/cjs/utils/decorators.js.map +0 -1
- package/lib/cjs/utils/errors.js.map +0 -1
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/cjs/utils/throttling.js.map +0 -1
- package/lib/cjs/utils/types.js.map +0 -1
- package/lib/cjs/utils/utils.js.map +0 -1
- package/lib/cjs/workers/TaskEngine.js.map +0 -1
- package/lib/cjs/workers/WorkThreadEnvironment.js.map +0 -1
- package/lib/cjs/workers/index.js.map +0 -1
- package/lib/cjs/workers/messages.js.map +0 -1
- package/lib/cjs/workers/types.js.map +0 -1
- package/lib/cjs/workers/workerThread.js.map +0 -1
- package/lib/types/auth/index.d.ts +0 -2
- package/lib/types/fs/index.d.ts +0 -4
- package/lib/types/interfaces/index.d.ts +0 -12
- package/lib/types/migrations/index.d.ts +0 -15
- package/lib/types/persistence/index.d.ts +0 -18
- package/lib/types/query/index.d.ts +0 -16
- package/lib/types/tasks/TaskEventService.d.ts +0 -7
- package/lib/types/tasks/index.d.ts +0 -23
- package/lib/types/tasks/models/index.d.ts +0 -8
- package/lib/types/workers/index.d.ts +0 -5
- /package/lib/types/auth/{constants.d.ts → constants.d.cts} +0 -0
- /package/lib/types/fs/{helpers.d.ts → helpers.d.cts} +0 -0
- /package/lib/types/fs/locks/{FilesystemLock.d.ts → FilesystemLock.d.cts} +0 -0
- /package/lib/types/fs/locks/{FilesystemMultiLock.d.ts → FilesystemMultiLock.d.cts} +0 -0
- /package/lib/types/interfaces/{ErrorParser.d.ts → ErrorParser.d.cts} +0 -0
- /package/lib/types/interfaces/{Executor.d.ts → Executor.d.cts} +0 -0
- /package/lib/types/interfaces/{Observer.d.ts → Observer.d.cts} +0 -0
- /package/lib/types/interfaces/{SequenceOptions.d.ts → SequenceOptions.d.cts} +0 -0
- /package/lib/types/migrations/{MigrationVersioning.d.ts → MigrationVersioning.d.cts} +0 -0
- /package/lib/types/model/{BaseModel.d.ts → BaseModel.d.cts} +0 -0
- /package/lib/types/overrides/{ModelBuilder.d.ts → ModelBuilder.d.cts} +0 -0
- /package/lib/types/overrides/{overrides.d.ts → overrides.d.cts} +0 -0
- /package/lib/types/persistence/{errors.d.ts → errors.d.cts} +0 -0
- /package/lib/types/persistence/{generators.d.ts → generators.d.cts} +0 -0
- /package/lib/types/query/{constants.d.ts → constants.d.cts} +0 -0
- /package/lib/types/query/{errors.d.ts → errors.d.cts} +0 -0
- /package/lib/types/ram/{constants.d.ts → constants.d.cts} +0 -0
- /package/lib/types/repository/{decorators.d.ts → decorators.d.cts} +0 -0
- /package/lib/types/repository/{errors.d.ts → errors.d.cts} +0 -0
- /package/lib/types/repository/{injectables.d.ts → injectables.d.cts} +0 -0
- /package/lib/types/repository/{utils.d.ts → utils.d.cts} +0 -0
- /package/lib/types/tasks/{decorators.d.ts → decorators.d.cts} +0 -0
- /package/lib/types/tasks/models/{TaskErrorModel.d.ts → TaskErrorModel.d.cts} +0 -0
- /package/lib/types/tasks/models/{TaskIOSerializer.d.ts → TaskIOSerializer.d.cts} +0 -0
- /package/lib/types/tasks/models/{TaskLogEntryModel.d.ts → TaskLogEntryModel.d.cts} +0 -0
- /package/lib/types/tasks/models/{TaskStepSpecModel.d.ts → TaskStepSpecModel.d.cts} +0 -0
- /package/lib/types/utils/{errors.d.ts → errors.d.cts} +0 -0
- /package/lib/types/utils/{throttling.d.ts → throttling.d.cts} +0 -0
- /package/lib/types/utils/{types.d.ts → types.d.cts} +0 -0
- /package/lib/types/utils/{utils.d.ts → utils.d.cts} +0 -0
- /package/lib/types/workers/{workerThread.d.ts → workerThread.d.cts} +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { TaskModel } from "./models/TaskModel.cjs";
|
|
2
|
+
import { Repo } from "../repository/Repository.cjs";
|
|
3
|
+
import { TaskEventModel } from "./models/TaskEventModel.cjs";
|
|
4
|
+
import { TaskHandlerRegistry } from "./TaskHandlerRegistry.cjs";
|
|
5
|
+
import { TaskEventBus } from "./TaskEventBus.cjs";
|
|
6
|
+
import { TaskStepResultModel } from "./models/TaskStepResultModel.cjs";
|
|
7
|
+
import { TaskLogEntryModel } from "./models/TaskLogEntryModel.cjs";
|
|
8
|
+
import { TaskBackoffModel } from "./models/TaskBackoffModel.cjs";
|
|
9
|
+
import { TaskStepSpecModel } from "./models/TaskStepSpecModel.cjs";
|
|
10
|
+
import { TaskEventType, TaskStatus } from "./constants.cjs";
|
|
11
|
+
import { Adapter } from "../persistence/Adapter.cjs";
|
|
12
|
+
import { Context } from "../persistence/Context.cjs";
|
|
13
|
+
import { ContextOf, FlagsOf } from "../persistence/types.cjs";
|
|
14
|
+
import { LogLevel } from "@decaf-ts/logging";
|
|
15
|
+
import { AbsContextual, ContextualArgs, MaybeContextualArg } from "../utils/ContextualLoggedClass.cjs";
|
|
16
|
+
import { OperationKeys } from "@decaf-ts/db-decorators";
|
|
17
|
+
import { TaskContext } from "./TaskContext.cjs";
|
|
18
|
+
import { TaskStateChangeRequest } from "./TaskStateChangeError.cjs";
|
|
19
|
+
import { DateTarget } from "@decaf-ts/decorator-validation";
|
|
20
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
21
|
+
import { TaskEngineConfig, TaskFlags } from "./types.cjs";
|
|
22
|
+
import { TaskTracker } from "./TaskTracker.cjs";
|
|
23
|
+
import { Lock } from "@decaf-ts/transactional-decorators";
|
|
24
|
+
type ParsedTaskDependency = {
|
|
25
|
+
taskId: string;
|
|
26
|
+
stepRef?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare class TaskEngine<A extends Adapter<any, any, any, any>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> extends AbsContextual<ContextOf<A>> {
|
|
29
|
+
protected config: C;
|
|
30
|
+
private _tasks?;
|
|
31
|
+
private _events?;
|
|
32
|
+
private _adapter?;
|
|
33
|
+
protected lock: Lock;
|
|
34
|
+
protected get Context(): Constructor<ContextOf<A>>;
|
|
35
|
+
protected get adapter(): A;
|
|
36
|
+
protected get registry(): TaskHandlerRegistry;
|
|
37
|
+
protected get bus(): TaskEventBus;
|
|
38
|
+
protected get tasks(): Repo<TaskModel>;
|
|
39
|
+
protected get events(): Repo<TaskEventModel>;
|
|
40
|
+
protected running: boolean;
|
|
41
|
+
private idleDelayMs;
|
|
42
|
+
static createTaskContext(base?: Context<any>, overrides?: Partial<TaskFlags>): TaskContext;
|
|
43
|
+
constructor(config: C);
|
|
44
|
+
push<I, O>(task: TaskModel<I, O>, ...args: MaybeContextualArg<any>): Promise<TaskModel<I, O>>;
|
|
45
|
+
push<I, O>(task: TaskModel<I, O>, track: false, ...args: MaybeContextualArg<any>): Promise<TaskModel<I, O>>;
|
|
46
|
+
push<I, O>(task: TaskModel<I, O>, track: true, ...args: MaybeContextualArg<any>): Promise<{
|
|
47
|
+
task: TaskModel<I, O>;
|
|
48
|
+
tracker: TaskTracker<(typeof task)["output"]>;
|
|
49
|
+
}>;
|
|
50
|
+
schedule<I, O>(task: TaskModel<I, O>, ...args: MaybeContextualArg<any>): {
|
|
51
|
+
for: (when: DateTarget) => Promise<TaskModel<I, O>>;
|
|
52
|
+
};
|
|
53
|
+
schedule<I, O>(task: TaskModel<I, O>, track: false, ...args: MaybeContextualArg<any>): {
|
|
54
|
+
for: (when: DateTarget) => Promise<TaskModel<I, O>>;
|
|
55
|
+
};
|
|
56
|
+
schedule<I, O>(task: TaskModel<I, O>, track: true, ...args: MaybeContextualArg<any>): {
|
|
57
|
+
for: (when: DateTarget) => Promise<{
|
|
58
|
+
task: TaskModel<I, O>;
|
|
59
|
+
tracker: TaskTracker<O>;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
track(id: string, ...args: MaybeContextualArg<any>): Promise<{
|
|
63
|
+
task: TaskModel<any, any>;
|
|
64
|
+
tracker: TaskTracker<any>;
|
|
65
|
+
}>;
|
|
66
|
+
protected ensureTaskError(task: TaskModel, ctx: Context): Promise<TaskModel>;
|
|
67
|
+
cancel(id: string, ...args: MaybeContextualArg<any>): Promise<TaskModel>;
|
|
68
|
+
isRunning(): Promise<boolean>;
|
|
69
|
+
start(...args: MaybeContextualArg<any>): Promise<void>;
|
|
70
|
+
stop(...args: MaybeContextualArg<any>): Promise<void>;
|
|
71
|
+
protected loop(...args: ContextualArgs<any>): Promise<void>;
|
|
72
|
+
protected claimBatch(ctx: Context<any>): Promise<TaskModel[]>;
|
|
73
|
+
protected tryClaim(task: TaskModel, ctx: Context): Promise<TaskModel | null>;
|
|
74
|
+
protected isTaskFinished(status?: TaskStatus): boolean;
|
|
75
|
+
protected parseTaskDependency(value: string): ParsedTaskDependency | undefined;
|
|
76
|
+
protected normalizeDependencies(deps: string[] | string | undefined): ParsedTaskDependency[];
|
|
77
|
+
protected resolveDependencyStepIndex(task: TaskModel, stepRef: string): number | undefined;
|
|
78
|
+
protected areDependenciesSatisfied(dependencies: ParsedTaskDependency[], ctx: Context): Promise<boolean>;
|
|
79
|
+
protected getStepLock(task: TaskModel, stepIndex: number | undefined): string | undefined;
|
|
80
|
+
protected hasLockConflict(task: TaskModel, stepIndex: number | undefined, ctx: Context): Promise<boolean>;
|
|
81
|
+
protected isRunnable(task: TaskModel, ctx: Context): Promise<boolean>;
|
|
82
|
+
protected executeClaimed(task: TaskModel): Promise<void>;
|
|
83
|
+
protected handleTaskStateChange(request: TaskStateChangeRequest, task: TaskModel, ctx: TaskContext): Promise<void>;
|
|
84
|
+
protected runComposite(task: TaskModel, context: TaskContext): Promise<any>;
|
|
85
|
+
protected normalizeBackoff(backoff: TaskBackoffModel | string | object | any): TaskBackoffModel;
|
|
86
|
+
protected normalizeSteps(steps: TaskStepSpecModel[] | string | undefined): TaskStepSpecModel[];
|
|
87
|
+
protected normalizeStepResults(results: TaskStepResultModel[] | string | undefined): TaskStepResultModel[];
|
|
88
|
+
protected appendLog(ctx: TaskContext | Context, task: TaskModel, logEntries: [LogLevel, string] | [LogLevel, string, any] | ([LogLevel, string] | [LogLevel, string, any])[]): Promise<[TaskModel, TaskLogEntryModel[]]>;
|
|
89
|
+
protected emitStatus(ctx: TaskContext | Context, task: TaskModel, status: TaskStatus, outputOrError?: any | Error, originalError?: Error): Promise<void>;
|
|
90
|
+
protected emitLog(ctx: TaskContext | Context, taskId: string, entries: TaskLogEntryModel[]): Promise<void>;
|
|
91
|
+
protected normalizePipeArgs(args: any[]): ([LogLevel, string] | [LogLevel, string, any])[];
|
|
92
|
+
protected emitProgress(ctx: TaskContext | Context, taskId: string, data: any): Promise<void>;
|
|
93
|
+
protected persistEvent(ctx: TaskContext | Context, taskId: string, type: TaskEventType, payload: any): Promise<TaskEventModel>;
|
|
94
|
+
toString(): string;
|
|
95
|
+
context(operation: ((...args: any[]) => any) | OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE | string, overrides: Partial<FlagsOf<ContextOf<A>>>, ...args: any[]): Promise<ContextOf<A>>;
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { TaskModel } from "./models/TaskModel";
|
|
2
|
-
import { Repo } from "../repository/Repository";
|
|
3
|
-
import { TaskEventModel } from "./models/TaskEventModel";
|
|
4
|
-
import { TaskHandlerRegistry } from "./TaskHandlerRegistry";
|
|
5
|
-
import { TaskEventBus } from "./TaskEventBus";
|
|
6
|
-
import { TaskStepResultModel } from "./models/TaskStepResultModel";
|
|
7
|
-
import { TaskLogEntryModel } from "./models/TaskLogEntryModel";
|
|
8
|
-
import { TaskBackoffModel } from "./models/TaskBackoffModel";
|
|
9
|
-
import { TaskStepSpecModel } from "./models/TaskStepSpecModel";
|
|
10
|
-
import { TaskEventType, TaskStatus } from "./constants";
|
|
11
|
-
import { Adapter } from "../persistence/Adapter";
|
|
12
|
-
import { Context } from "../persistence/Context";
|
|
13
|
-
import { ContextOf, FlagsOf } from "../persistence/types";
|
|
1
|
+
import { TaskModel } from "./models/TaskModel.js";
|
|
2
|
+
import { Repo } from "../repository/Repository.js";
|
|
3
|
+
import { TaskEventModel } from "./models/TaskEventModel.js";
|
|
4
|
+
import { TaskHandlerRegistry } from "./TaskHandlerRegistry.js";
|
|
5
|
+
import { TaskEventBus } from "./TaskEventBus.js";
|
|
6
|
+
import { TaskStepResultModel } from "./models/TaskStepResultModel.js";
|
|
7
|
+
import { TaskLogEntryModel } from "./models/TaskLogEntryModel.js";
|
|
8
|
+
import { TaskBackoffModel } from "./models/TaskBackoffModel.js";
|
|
9
|
+
import { TaskStepSpecModel } from "./models/TaskStepSpecModel.js";
|
|
10
|
+
import { TaskEventType, TaskStatus } from "./constants.js";
|
|
11
|
+
import { Adapter } from "../persistence/Adapter.js";
|
|
12
|
+
import { Context } from "../persistence/Context.js";
|
|
13
|
+
import { ContextOf, FlagsOf } from "../persistence/types.js";
|
|
14
14
|
import { LogLevel } from "@decaf-ts/logging";
|
|
15
|
-
import { AbsContextual, ContextualArgs, MaybeContextualArg } from "../utils/ContextualLoggedClass";
|
|
15
|
+
import { AbsContextual, ContextualArgs, MaybeContextualArg } from "../utils/ContextualLoggedClass.js";
|
|
16
16
|
import { OperationKeys } from "@decaf-ts/db-decorators";
|
|
17
|
-
import { TaskContext } from "./TaskContext";
|
|
18
|
-
import { TaskStateChangeRequest } from "./TaskStateChangeError";
|
|
17
|
+
import { TaskContext } from "./TaskContext.js";
|
|
18
|
+
import { TaskStateChangeRequest } from "./TaskStateChangeError.js";
|
|
19
19
|
import { DateTarget } from "@decaf-ts/decorator-validation";
|
|
20
20
|
import { Constructor } from "@decaf-ts/decoration";
|
|
21
|
-
import { TaskEngineConfig, TaskFlags } from "./types";
|
|
22
|
-
import { TaskTracker } from "./TaskTracker";
|
|
21
|
+
import { TaskEngineConfig, TaskFlags } from "./types.js";
|
|
22
|
+
import { TaskTracker } from "./TaskTracker.js";
|
|
23
23
|
import { Lock } from "@decaf-ts/transactional-decorators";
|
|
24
24
|
type ParsedTaskDependency = {
|
|
25
25
|
taskId: string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BaseError } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { TaskErrorModel } from "./models/TaskErrorModel.cjs";
|
|
3
|
+
import { TaskStatus } from "./constants.cjs";
|
|
4
|
+
/**
|
|
5
|
+
* Represents the next action to take after a task error.
|
|
6
|
+
* Used to identify the appropriate response to task failures.
|
|
7
|
+
*/
|
|
8
|
+
export type TaskNextAction = TaskStatus.CANCELED | TaskStatus.WAITING_RETRY | TaskStatus.SCHEDULED | TaskStatus.FAILED;
|
|
9
|
+
/**
|
|
10
|
+
* Additional properties added to errors from TaskTracker.resolve() and TaskTracker.wait()
|
|
11
|
+
*/
|
|
12
|
+
export type TaskErrorProps = {
|
|
13
|
+
/** The next action to take in response to this error */
|
|
14
|
+
nextAction: TaskNextAction;
|
|
15
|
+
/** The task ID this error relates to (optional, present on TaskControlError) */
|
|
16
|
+
taskId?: string;
|
|
17
|
+
/** Additional error details (optional, present on TaskControlError) */
|
|
18
|
+
details?: TaskErrorModel;
|
|
19
|
+
/** Additional metadata (optional, present on TaskControlError) */
|
|
20
|
+
meta?: Record<string, any>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Generic type that preserves the original error type while adding task-specific properties.
|
|
24
|
+
* Use this to type errors from TaskTracker.resolve() and TaskTracker.wait().
|
|
25
|
+
*
|
|
26
|
+
* The original error is preserved (e.g., ValidationError stays ValidationError),
|
|
27
|
+
* with the nextAction property added to identify the appropriate response:
|
|
28
|
+
* - `TaskStatus.CANCELED`: Task was explicitly canceled
|
|
29
|
+
* - `TaskStatus.SCHEDULED`: Task was rescheduled
|
|
30
|
+
* - `TaskStatus.WAITING_RETRY`: Task is waiting for retry
|
|
31
|
+
* - `TaskStatus.FAILED`: Task has permanently failed
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* try {
|
|
36
|
+
* await tracker.resolve();
|
|
37
|
+
* } catch (error: unknown) {
|
|
38
|
+
* if (isTaskError<ValidationError>(error, ValidationError)) {
|
|
39
|
+
* // error is typed as TaskErrorFrom<ValidationError>
|
|
40
|
+
* console.log(error.nextAction); // TaskNextAction
|
|
41
|
+
* console.log(error.code); // ValidationError's code property
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export type TaskErrorFrom<E extends Error> = E & TaskErrorProps;
|
|
47
|
+
export declare function isTaskError<E extends Error = Error>(error: unknown, ErrorClass?: new (...args: any[]) => E): error is TaskErrorFrom<E>;
|
|
48
|
+
export declare class TaskControlError extends BaseError {
|
|
49
|
+
readonly taskId: string;
|
|
50
|
+
readonly details?: TaskErrorModel;
|
|
51
|
+
readonly meta?: Record<string, any>;
|
|
52
|
+
constructor(name: string, taskId: string, message: string, details?: TaskErrorModel, meta?: Record<string, any>, code?: number);
|
|
53
|
+
}
|
|
54
|
+
export declare class TaskFailError extends TaskControlError {
|
|
55
|
+
constructor(taskId: string, details?: TaskErrorModel, meta?: Record<string, any>);
|
|
56
|
+
}
|
|
57
|
+
export declare class TaskRetryError extends TaskControlError {
|
|
58
|
+
constructor(taskId: string, details?: TaskErrorModel, meta?: Record<string, any>);
|
|
59
|
+
}
|
|
60
|
+
export declare class TaskCancelError extends TaskControlError {
|
|
61
|
+
constructor(taskId: string, details?: TaskErrorModel, meta?: Record<string, any>);
|
|
62
|
+
}
|
|
63
|
+
export declare class TaskRescheduleError extends TaskControlError {
|
|
64
|
+
constructor(taskId: string, details?: TaskErrorModel, meta?: Record<string, any>);
|
|
65
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseError } from "@decaf-ts/db-decorators";
|
|
2
|
-
import { TaskErrorModel } from "./models/TaskErrorModel";
|
|
3
|
-
import { TaskStatus } from "./constants";
|
|
2
|
+
import { TaskErrorModel } from "./models/TaskErrorModel.js";
|
|
3
|
+
import { TaskStatus } from "./constants.js";
|
|
4
4
|
/**
|
|
5
5
|
* Represents the next action to take after a task error.
|
|
6
6
|
* Used to identify the appropriate response to task failures.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TaskEventModel } from "./models/TaskEventModel.cjs";
|
|
2
|
+
import { Context } from "../persistence/Context.cjs";
|
|
3
|
+
import { ObserverHandler } from "../persistence/ObserverHandler.cjs";
|
|
4
|
+
import { EventIds, ObserverFilter } from "../persistence/types.cjs";
|
|
5
|
+
import { TaskContext } from "./TaskContext.cjs";
|
|
6
|
+
import { Observer } from "../interfaces/Observer.cjs";
|
|
7
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
8
|
+
import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
|
|
9
|
+
import { ContextualArgs } from "../utils/index.cjs";
|
|
10
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
11
|
+
export declare class TaskEventBus extends ObserverHandler<TaskContext> {
|
|
12
|
+
protected readonly listeners: Set<(evt: TaskEventModel) => void>;
|
|
13
|
+
observe(observer: Observer, filter?: ObserverFilter): () => void;
|
|
14
|
+
unObserve(observer: Observer): void;
|
|
15
|
+
emit(evt: TaskEventModel, ctx: Context): void;
|
|
16
|
+
updateObservers<M extends Model>(model: Constructor<M> | string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, evt: TaskEventModel, ...args: ContextualArgs<any>): Promise<void>;
|
|
17
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TaskEventModel } from "./models/TaskEventModel";
|
|
2
|
-
import { Context } from "../persistence/Context";
|
|
3
|
-
import { ObserverHandler } from "../persistence/ObserverHandler";
|
|
4
|
-
import { EventIds, ObserverFilter } from "../persistence/types";
|
|
5
|
-
import { TaskContext } from "./TaskContext";
|
|
6
|
-
import { Observer } from "../interfaces/Observer";
|
|
1
|
+
import { TaskEventModel } from "./models/TaskEventModel.js";
|
|
2
|
+
import { Context } from "../persistence/Context.js";
|
|
3
|
+
import { ObserverHandler } from "../persistence/ObserverHandler.js";
|
|
4
|
+
import { EventIds, ObserverFilter } from "../persistence/types.js";
|
|
5
|
+
import { TaskContext } from "./TaskContext.js";
|
|
6
|
+
import { Observer } from "../interfaces/Observer.js";
|
|
7
7
|
import { Constructor } from "@decaf-ts/decoration";
|
|
8
8
|
import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
|
|
9
|
-
import { ContextualArgs } from "../utils/index";
|
|
9
|
+
import { ContextualArgs } from "../utils/index.js";
|
|
10
10
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
11
11
|
export declare class TaskEventBus extends ObserverHandler<TaskContext> {
|
|
12
12
|
protected readonly listeners: Set<(evt: TaskEventModel) => void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Repo } from "../repository/Repository.cjs";
|
|
2
|
+
import { ModelService } from "../services/ModelService.cjs";
|
|
3
|
+
import { TaskEventModel } from "./models/TaskEventModel.cjs";
|
|
4
|
+
export declare class TaskEventService extends ModelService<TaskEventModel> {
|
|
5
|
+
constructor();
|
|
6
|
+
get repo(): Repo<TaskEventModel>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Repo } from "../repository/Repository.js";
|
|
2
|
+
import { ModelService } from "../services/ModelService.js";
|
|
3
|
+
import { TaskEventModel } from "./models/TaskEventModel.js";
|
|
4
|
+
export declare class TaskEventService extends ModelService<TaskEventModel> {
|
|
5
|
+
constructor();
|
|
6
|
+
get repo(): Repo<TaskEventModel>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ITaskHandler } from "./types.cjs";
|
|
2
|
+
import { AbsContextual, ContextualArgs } from "../utils/ContextualLoggedClass.cjs";
|
|
3
|
+
import { TaskContext } from "./TaskContext.cjs";
|
|
4
|
+
export declare abstract class TaskHandler<I, O> extends AbsContextual<TaskContext> implements ITaskHandler<I, O> {
|
|
5
|
+
private _type?;
|
|
6
|
+
get type(): string;
|
|
7
|
+
protected constructor();
|
|
8
|
+
protected runPrefix(input: I, ...args: ContextualArgs<TaskContext>): Promise<any[]>;
|
|
9
|
+
protected runSuffix(output: O, ctx: TaskContext): O;
|
|
10
|
+
catch(input: I, error: unknown, ctx: TaskContext): Promise<void>;
|
|
11
|
+
abstract run(input: I, ctx: TaskContext): Promise<O>;
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ITaskHandler } from "./types";
|
|
2
|
-
import { AbsContextual, ContextualArgs } from "../utils/ContextualLoggedClass";
|
|
3
|
-
import { TaskContext } from "./TaskContext";
|
|
1
|
+
import { ITaskHandler } from "./types.js";
|
|
2
|
+
import { AbsContextual, ContextualArgs } from "../utils/ContextualLoggedClass.js";
|
|
3
|
+
import { TaskContext } from "./TaskContext.js";
|
|
4
4
|
export declare abstract class TaskHandler<I, O> extends AbsContextual<TaskContext> implements ITaskHandler<I, O> {
|
|
5
5
|
private _type?;
|
|
6
6
|
get type(): string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type ContextualArgs, type ContextualizedArgs, type MaybeContextualArg, type MethodOrOperation } from "../utils/ContextualLoggedClass.cjs";
|
|
2
|
+
import { ClientBasedService } from "../services/services.cjs";
|
|
3
|
+
import { TaskEngine } from "./TaskEngine.cjs";
|
|
4
|
+
import { Adapter } from "../persistence/Adapter.cjs";
|
|
5
|
+
import { type AllOperationKeys, type ContextOf, type EventIds, type ObserverFilter } from "../persistence/types.cjs";
|
|
6
|
+
import { type PrimaryKeyType } from "@decaf-ts/db-decorators";
|
|
7
|
+
import { OrderDirection } from "../repository/constants.cjs";
|
|
8
|
+
import { type Repo } from "../repository/Repository.cjs";
|
|
9
|
+
import { TaskModel } from "./models/TaskModel.cjs";
|
|
10
|
+
import { type DirectionLimitOffset } from "../query/types.cjs";
|
|
11
|
+
import type { Constructor } from "@decaf-ts/decoration";
|
|
12
|
+
import type { Observer } from "../interfaces/Observer.cjs";
|
|
13
|
+
import type { ArrayMode } from "../services/ModelService.cjs";
|
|
14
|
+
import { TaskEngineConfig } from "./types.cjs";
|
|
15
|
+
import { TaskTracker } from "./TaskTracker.cjs";
|
|
16
|
+
import { TaskEventModel } from "./models/index.cjs";
|
|
17
|
+
import { SelectSelector, WhereOption } from "../query/index.cjs";
|
|
18
|
+
export type TaskServiceConfig<A extends Adapter<any, any, any, any>, T extends TaskEngine<A> = TaskEngine<A>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> = C & {
|
|
19
|
+
engine?: Constructor<T>;
|
|
20
|
+
};
|
|
21
|
+
export declare class TaskService<A extends Adapter<any, any, any, any>> extends ClientBasedService<TaskEngine<A>, TaskEngineConfig<A>> {
|
|
22
|
+
protected get adapter(): A;
|
|
23
|
+
protected get tasks(): Repo<TaskModel>;
|
|
24
|
+
protected get events(): Repo<TaskEventModel>;
|
|
25
|
+
constructor();
|
|
26
|
+
initialize(...args: MaybeContextualArg<ContextOf<A>>): Promise<{
|
|
27
|
+
config: TaskServiceConfig<A, any, any>;
|
|
28
|
+
client: TaskEngine<A>;
|
|
29
|
+
}>;
|
|
30
|
+
push<I, O>(task: TaskModel<I, O>, ...args: MaybeContextualArg<any>): Promise<TaskModel<I, O>>;
|
|
31
|
+
push<I, O>(task: TaskModel<I, O>, track: false, ...args: MaybeContextualArg<any>): Promise<TaskModel<I, O>>;
|
|
32
|
+
push<I, O>(task: TaskModel<I, O>, track: true, ...args: MaybeContextualArg<any>): Promise<{
|
|
33
|
+
task: TaskModel<I, O>;
|
|
34
|
+
tracker: TaskTracker<O>;
|
|
35
|
+
}>;
|
|
36
|
+
track(id: string, ...args: MaybeContextualArg<any>): Promise<{
|
|
37
|
+
task: TaskModel;
|
|
38
|
+
tracker: TaskTracker<any>;
|
|
39
|
+
}>;
|
|
40
|
+
select<S extends readonly SelectSelector<TaskModel>[]>(): WhereOption<TaskModel, TaskModel[]>;
|
|
41
|
+
select<S extends readonly SelectSelector<TaskModel>[]>(selector: readonly [...S]): WhereOption<TaskModel, Pick<TaskModel, S[number]>[]>;
|
|
42
|
+
create(model: TaskModel, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel>;
|
|
43
|
+
createAll(models: TaskModel[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel[]>;
|
|
44
|
+
delete(key: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel>;
|
|
45
|
+
deleteAll(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel[]>;
|
|
46
|
+
read(key: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel>;
|
|
47
|
+
readAll(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel[]>;
|
|
48
|
+
query<M, R extends ArrayMode = "one">(methodName: string, ...args: MaybeContextualArg<ContextOf<A>>): Promise<R extends "one" ? M : M[]>;
|
|
49
|
+
update(model: TaskModel, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel>;
|
|
50
|
+
updateAll(models: TaskModel[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel[]>;
|
|
51
|
+
listBy(key: keyof TaskModel, order: OrderDirection, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel<any, any>[]>;
|
|
52
|
+
paginateBy(key: keyof TaskModel, order: OrderDirection, ref: Omit<DirectionLimitOffset, "direction">, ...args: MaybeContextualArg<ContextOf<A>>): Promise<import("..").SerializedPage<TaskModel<any, any>>>;
|
|
53
|
+
findOneBy(key: keyof TaskModel, value: any, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel<any, any>>;
|
|
54
|
+
findBy(key: keyof TaskModel, value: any, ...args: MaybeContextualArg<ContextOf<A>>): Promise<TaskModel<any, any>[]>;
|
|
55
|
+
findByPaginate(key: keyof TaskModel, value: any, ref: DirectionLimitOffset, ...args: MaybeContextualArg<ContextOf<A>>): Promise<import("..").SerializedPage<TaskModel<any, any>>>;
|
|
56
|
+
statement(name: string, ...args: MaybeContextualArg<ContextOf<A>>): Promise<any>;
|
|
57
|
+
refresh(table: Constructor<any>, event: AllOperationKeys, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
|
|
58
|
+
observe(observer: Observer, filter?: ObserverFilter): () => void;
|
|
59
|
+
unObserve(observer: Observer): void;
|
|
60
|
+
updateObservers(model: Constructor, operation: AllOperationKeys, ids: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
|
|
61
|
+
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>;
|
|
62
|
+
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>;
|
|
63
|
+
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>>;
|
|
64
|
+
shutdown(...args: MaybeContextualArg<any>): Promise<void>;
|
|
65
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { type ContextualArgs, type ContextualizedArgs, type MaybeContextualArg, type MethodOrOperation } from "../utils/ContextualLoggedClass";
|
|
2
|
-
import { ClientBasedService } from "../services/services";
|
|
3
|
-
import { TaskEngine } from "./TaskEngine";
|
|
4
|
-
import { Adapter } from "../persistence/Adapter";
|
|
5
|
-
import { type AllOperationKeys, type ContextOf, type EventIds, type ObserverFilter } from "../persistence/types";
|
|
1
|
+
import { type ContextualArgs, type ContextualizedArgs, type MaybeContextualArg, type MethodOrOperation } from "../utils/ContextualLoggedClass.js";
|
|
2
|
+
import { ClientBasedService } from "../services/services.js";
|
|
3
|
+
import { TaskEngine } from "./TaskEngine.js";
|
|
4
|
+
import { Adapter } from "../persistence/Adapter.js";
|
|
5
|
+
import { type AllOperationKeys, type ContextOf, type EventIds, type ObserverFilter } from "../persistence/types.js";
|
|
6
6
|
import { type PrimaryKeyType } from "@decaf-ts/db-decorators";
|
|
7
|
-
import { OrderDirection } from "../repository/constants";
|
|
8
|
-
import { type Repo } from "../repository/Repository";
|
|
9
|
-
import { TaskModel } from "./models/TaskModel";
|
|
10
|
-
import { type DirectionLimitOffset } from "../query/types";
|
|
7
|
+
import { OrderDirection } from "../repository/constants.js";
|
|
8
|
+
import { type Repo } from "../repository/Repository.js";
|
|
9
|
+
import { TaskModel } from "./models/TaskModel.js";
|
|
10
|
+
import { type DirectionLimitOffset } from "../query/types.js";
|
|
11
11
|
import type { Constructor } from "@decaf-ts/decoration";
|
|
12
|
-
import type { Observer } from "../interfaces/Observer";
|
|
13
|
-
import type { ArrayMode } from "../services/ModelService";
|
|
14
|
-
import { TaskEngineConfig } from "./types";
|
|
15
|
-
import { TaskTracker } from "./TaskTracker";
|
|
16
|
-
import { TaskEventModel } from "./models/index";
|
|
17
|
-
import { SelectSelector, WhereOption } from "../query/index";
|
|
12
|
+
import type { Observer } from "../interfaces/Observer.js";
|
|
13
|
+
import type { ArrayMode } from "../services/ModelService.js";
|
|
14
|
+
import { TaskEngineConfig } from "./types.js";
|
|
15
|
+
import { TaskTracker } from "./TaskTracker.js";
|
|
16
|
+
import { TaskEventModel } from "./models/index.js";
|
|
17
|
+
import { SelectSelector, WhereOption } from "../query/index.js";
|
|
18
18
|
export type TaskServiceConfig<A extends Adapter<any, any, any, any>, T extends TaskEngine<A> = TaskEngine<A>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> = C & {
|
|
19
19
|
engine?: Constructor<T>;
|
|
20
20
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TaskStatus } from "./constants.cjs";
|
|
2
|
+
import { TaskErrorModel } from "./models/TaskErrorModel.cjs";
|
|
3
|
+
export interface TaskStateChangeRequest {
|
|
4
|
+
status: TaskStatus;
|
|
5
|
+
error?: TaskErrorModel;
|
|
6
|
+
scheduledTo?: Date;
|
|
7
|
+
}
|
|
8
|
+
export declare class TaskStateChangeError extends Error {
|
|
9
|
+
readonly request: TaskStateChangeRequest;
|
|
10
|
+
constructor(request: TaskStateChangeRequest);
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskStatus } from "./constants";
|
|
2
|
-
import { TaskErrorModel } from "./models/TaskErrorModel";
|
|
1
|
+
import { TaskStatus } from "./constants.js";
|
|
2
|
+
import { TaskErrorModel } from "./models/TaskErrorModel.js";
|
|
3
3
|
export interface TaskStateChangeRequest {
|
|
4
4
|
status: TaskStatus;
|
|
5
5
|
error?: TaskErrorModel;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Observer } from "../interfaces/Observer.cjs";
|
|
2
|
+
import { TaskEventModel } from "./models/TaskEventModel.cjs";
|
|
3
|
+
import { Logger } from "@decaf-ts/logging";
|
|
4
|
+
import { TaskEventType, TaskStatus } from "./constants.cjs";
|
|
5
|
+
import { EventPipe, LogPipe, LogPipeOptions } from "./types.cjs";
|
|
6
|
+
import { TaskModel } from "./models/TaskModel.cjs";
|
|
7
|
+
import { Context } from "../persistence/index.cjs";
|
|
8
|
+
import { TaskEventBus } from "./TaskEventBus.cjs";
|
|
9
|
+
import { TaskControlError } from "./TaskErrors.cjs";
|
|
10
|
+
export declare class TaskTracker<O = any> implements Observer<[TaskEventModel, Context]> {
|
|
11
|
+
protected bus: TaskEventBus;
|
|
12
|
+
private readonly task;
|
|
13
|
+
protected unregistration: () => void;
|
|
14
|
+
protected pipes?: Record<TaskEventType, Set<EventPipe>>;
|
|
15
|
+
private resolved;
|
|
16
|
+
private terminalContext?;
|
|
17
|
+
constructor(bus: TaskEventBus, task: TaskModel);
|
|
18
|
+
resolve(): Promise<O>;
|
|
19
|
+
wait(): Promise<O>;
|
|
20
|
+
attach(log: Logger, opts?: LogPipeOptions): void;
|
|
21
|
+
logs(pipe: LogPipe): void;
|
|
22
|
+
pipe(pipe: EventPipe, type?: TaskEventType): void;
|
|
23
|
+
protected succeed(_result?: O): void;
|
|
24
|
+
protected fail(_error?: TaskControlError): void;
|
|
25
|
+
protected cancel(evt: TaskEventModel): void;
|
|
26
|
+
protected retry(): void;
|
|
27
|
+
protected reschedule(): void;
|
|
28
|
+
onSucceed(handler: EventPipe): () => void;
|
|
29
|
+
onFailure(handler: EventPipe): () => void;
|
|
30
|
+
onCancel(handler: EventPipe): () => void;
|
|
31
|
+
onUpdate(handler: EventPipe): () => void;
|
|
32
|
+
private awaitStatusTerminal;
|
|
33
|
+
private extractOutput;
|
|
34
|
+
private extractError;
|
|
35
|
+
private complete;
|
|
36
|
+
protected isTerminalStatus(status: TaskStatus): boolean;
|
|
37
|
+
protected track(evt: TaskEventModel, ctx: Context): Promise<void>;
|
|
38
|
+
private registerStatusHandler;
|
|
39
|
+
private getTerminalContext;
|
|
40
|
+
private buildTerminalEvent;
|
|
41
|
+
private createTaskControlError;
|
|
42
|
+
private assignNextAction;
|
|
43
|
+
private getNextAction;
|
|
44
|
+
private buildMeta;
|
|
45
|
+
private resolveTerminalState;
|
|
46
|
+
refresh(evt: TaskEventModel, ctx: Context): Promise<void>;
|
|
47
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Observer } from "../interfaces/Observer";
|
|
2
|
-
import { TaskEventModel } from "./models/TaskEventModel";
|
|
1
|
+
import { Observer } from "../interfaces/Observer.js";
|
|
2
|
+
import { TaskEventModel } from "./models/TaskEventModel.js";
|
|
3
3
|
import { Logger } from "@decaf-ts/logging";
|
|
4
|
-
import { TaskEventType, TaskStatus } from "./constants";
|
|
5
|
-
import { EventPipe, LogPipe, LogPipeOptions } from "./types";
|
|
6
|
-
import { TaskModel } from "./models/TaskModel";
|
|
7
|
-
import { Context } from "../persistence/index";
|
|
8
|
-
import { TaskEventBus } from "./TaskEventBus";
|
|
9
|
-
import { TaskControlError } from "./TaskErrors";
|
|
4
|
+
import { TaskEventType, TaskStatus } from "./constants.js";
|
|
5
|
+
import { EventPipe, LogPipe, LogPipeOptions } from "./types.js";
|
|
6
|
+
import { TaskModel } from "./models/TaskModel.js";
|
|
7
|
+
import { Context } from "../persistence/index.js";
|
|
8
|
+
import { TaskEventBus } from "./TaskEventBus.js";
|
|
9
|
+
import { TaskControlError } from "./TaskErrors.js";
|
|
10
10
|
export declare class TaskTracker<O = any> implements Observer<[TaskEventModel, Context]> {
|
|
11
11
|
protected bus: TaskEventBus;
|
|
12
12
|
private readonly task;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { TaskModel } from "./models/TaskModel.cjs";
|
|
2
|
+
import { BackoffStrategy, JitterStrategy, TaskStatus, TaskType } from "./constants.cjs";
|
|
3
|
+
import { TaskBackoffModel } from "./models/index.cjs";
|
|
4
|
+
import { TaskStepSpecModel } from "./models/TaskStepSpecModel.cjs";
|
|
5
|
+
import { Model, ModelArg } from "@decaf-ts/decorator-validation";
|
|
6
|
+
export declare class TaskBackoffBuilder<NESTED extends boolean = false> extends Model {
|
|
7
|
+
baseMs: number;
|
|
8
|
+
jitter: JitterStrategy;
|
|
9
|
+
maxMs: number;
|
|
10
|
+
strategy: BackoffStrategy;
|
|
11
|
+
constructor(arg?: ModelArg<TaskBackoffBuilder>);
|
|
12
|
+
setBaseMs(value: number): this;
|
|
13
|
+
setJitter(value: JitterStrategy): this;
|
|
14
|
+
setMaxMs(value: number): this;
|
|
15
|
+
setStrategy(value: BackoffStrategy): this;
|
|
16
|
+
build(): NESTED extends false ? TaskBackoffModel : TaskBuilder;
|
|
17
|
+
}
|
|
18
|
+
export declare class TaskBuilder extends Model {
|
|
19
|
+
protected classification: string;
|
|
20
|
+
protected name?: string;
|
|
21
|
+
protected status: TaskStatus;
|
|
22
|
+
protected atomicity: TaskType;
|
|
23
|
+
protected backoff: TaskBackoffModel;
|
|
24
|
+
protected input?: any;
|
|
25
|
+
protected lock?: string;
|
|
26
|
+
protected dependencies?: string[];
|
|
27
|
+
protected maxAttempts: number;
|
|
28
|
+
setClassification(value: string): this;
|
|
29
|
+
setName(value: string): this;
|
|
30
|
+
setAtomicity(value: TaskType): this;
|
|
31
|
+
setBackoff<V extends TaskBackoffModel>(value?: TaskBackoffModel): V extends TaskBackoffModel ? this : TaskBackoffBuilder<true>;
|
|
32
|
+
setInput(value: any): this;
|
|
33
|
+
setLock(value?: string): this;
|
|
34
|
+
setDependencies(value?: string[]): this;
|
|
35
|
+
setDependsOn(value?: string[]): this;
|
|
36
|
+
setMaxAttempts(value: number): this;
|
|
37
|
+
constructor(arg?: ModelArg<TaskBuilder>);
|
|
38
|
+
build(): TaskModel<any, any>;
|
|
39
|
+
}
|
|
40
|
+
export declare class TaskStepSpecBuilder {
|
|
41
|
+
protected parent: CompositeTaskBuilder;
|
|
42
|
+
protected step: TaskStepSpecModel;
|
|
43
|
+
constructor(parent: CompositeTaskBuilder, step: TaskStepSpecModel);
|
|
44
|
+
setClassification(value: string): this;
|
|
45
|
+
setName(value?: string): this;
|
|
46
|
+
setInput(value: any): this;
|
|
47
|
+
setLock(value?: string): this;
|
|
48
|
+
setDependsOn(value?: string[]): this;
|
|
49
|
+
addStep(classification: string): TaskStepSpecBuilder;
|
|
50
|
+
addStep(classification: string, input: any): CompositeTaskBuilder;
|
|
51
|
+
addStep(classification: string, name: string, input?: any): CompositeTaskBuilder;
|
|
52
|
+
setSteps(value: TaskStepSpecModel[]): CompositeTaskBuilder;
|
|
53
|
+
build(): CompositeTaskBuilder;
|
|
54
|
+
}
|
|
55
|
+
export declare class CompositeTaskBuilder extends TaskBuilder {
|
|
56
|
+
protected steps?: TaskStepSpecModel[];
|
|
57
|
+
protected stepResults?: TaskStepSpecModel[];
|
|
58
|
+
constructor(arg?: ModelArg<CompositeTaskBuilder>);
|
|
59
|
+
setAtomicity(value: TaskType): this;
|
|
60
|
+
setSteps(value: TaskStepSpecModel[]): this;
|
|
61
|
+
/**
|
|
62
|
+
* Backwards compatible:
|
|
63
|
+
* - addStep(classification, input?)
|
|
64
|
+
* - addStep(classification, name, input?)
|
|
65
|
+
*
|
|
66
|
+
* When called with only `classification`, returns a TaskStepSpecBuilder so
|
|
67
|
+
* callers can configure the step and then `.build()` back to this builder.
|
|
68
|
+
*/
|
|
69
|
+
addStep(classification: string): TaskStepSpecBuilder;
|
|
70
|
+
addStep(classification: string, input: any): this;
|
|
71
|
+
addStep(classification: string, name: string, input?: any): this;
|
|
72
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TaskModel } from "./models/TaskModel";
|
|
2
|
-
import { BackoffStrategy, JitterStrategy, TaskStatus, TaskType } from "./constants";
|
|
3
|
-
import { TaskBackoffModel } from "./models/index";
|
|
4
|
-
import { TaskStepSpecModel } from "./models/TaskStepSpecModel";
|
|
1
|
+
import { TaskModel } from "./models/TaskModel.js";
|
|
2
|
+
import { BackoffStrategy, JitterStrategy, TaskStatus, TaskType } from "./constants.js";
|
|
3
|
+
import { TaskBackoffModel } from "./models/index.js";
|
|
4
|
+
import { TaskStepSpecModel } from "./models/TaskStepSpecModel.js";
|
|
5
5
|
import { Model, ModelArg } from "@decaf-ts/decorator-validation";
|
|
6
6
|
export declare class TaskBackoffBuilder<NESTED extends boolean = false> extends Model {
|
|
7
7
|
baseMs: number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TaskEngineConfig } from "./types.cjs";
|
|
2
|
+
export declare enum TaskStatus {
|
|
3
|
+
PENDING = "pending",
|
|
4
|
+
SCHEDULED = "scheduled",
|
|
5
|
+
RUNNING = "running",
|
|
6
|
+
FAILED = "failed",
|
|
7
|
+
SUCCEEDED = "succeeded",
|
|
8
|
+
CANCELED = "canceled",
|
|
9
|
+
WAITING_RETRY = "waiting_retry"
|
|
10
|
+
}
|
|
11
|
+
export declare enum BackoffStrategy {
|
|
12
|
+
EXPONENTIAL = "exponential",
|
|
13
|
+
FIXED = "fixed"
|
|
14
|
+
}
|
|
15
|
+
export declare enum JitterStrategy {
|
|
16
|
+
NONE = "none",
|
|
17
|
+
FULL = "full"
|
|
18
|
+
}
|
|
19
|
+
export declare enum TaskEventType {
|
|
20
|
+
STATUS = "status",
|
|
21
|
+
UPDATE = "update",
|
|
22
|
+
LOG = "log",
|
|
23
|
+
PROGRESS = "progress",
|
|
24
|
+
ALL = "all"
|
|
25
|
+
}
|
|
26
|
+
export declare enum TaskType {
|
|
27
|
+
ATOMIC = "atomic",
|
|
28
|
+
COMPOSITE = "composite"
|
|
29
|
+
}
|
|
30
|
+
export declare const TasksKey = "tasks";
|
|
31
|
+
export declare const DefaultTaskEngineConfig: TaskEngineConfig<any>;
|