@decaf-ts/core 0.18.0 → 0.19.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.cts +5 -0
- package/lib/types/auth/constants.d.mts +5 -0
- package/lib/types/auth/decorators.d.cts +5 -0
- package/lib/types/auth/decorators.d.mts +5 -0
- 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.mts +70 -0
- package/lib/types/fs/FsDispatch.d.cts +7 -0
- package/lib/types/fs/FsDispatch.d.mts +7 -0
- package/lib/types/fs/helpers.d.cts +17 -0
- 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.mts +28 -0
- package/lib/types/fs/locks/FilesystemLock.d.cts +13 -0
- package/lib/types/fs/locks/FilesystemLock.d.mts +13 -0
- package/lib/types/fs/locks/FilesystemMultiLock.d.cts +8 -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.mts +40 -0
- package/lib/types/identity/decorators.d.cts +72 -0
- package/lib/types/identity/decorators.d.mts +72 -0
- package/lib/types/identity/index.d.cts +6 -0
- package/lib/types/identity/index.d.mts +6 -0
- package/lib/types/index.d.cts +34 -0
- package/lib/types/index.d.mts +34 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/interfaces/ContextuallyLogged.d.cts +8 -0
- package/lib/types/interfaces/ContextuallyLogged.d.mts +8 -0
- package/lib/types/interfaces/ErrorParser.d.cts +16 -0
- package/lib/types/interfaces/ErrorParser.d.mts +16 -0
- package/lib/types/interfaces/Executor.d.cts +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.mts +33 -0
- package/lib/types/interfaces/Observer.d.cts +15 -0
- package/lib/types/interfaces/Observer.d.mts +15 -0
- package/lib/types/interfaces/Paginatable.d.cts +20 -0
- package/lib/types/interfaces/Paginatable.d.mts +20 -0
- package/lib/types/interfaces/Queriable.d.cts +47 -0
- package/lib/types/interfaces/Queriable.d.mts +47 -0
- package/lib/types/interfaces/RawExecutor.d.cts +28 -0
- package/lib/types/interfaces/RawExecutor.d.mts +28 -0
- package/lib/types/interfaces/SequenceOptions.d.cts +79 -0
- 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.mts +19 -0
- package/lib/types/migrations/MigrationService.d.cts +63 -0
- package/lib/types/migrations/MigrationService.d.mts +63 -0
- package/lib/types/migrations/MigrationTaskBuilder.d.cts +10 -0
- package/lib/types/migrations/MigrationTaskBuilder.d.mts +10 -0
- package/lib/types/migrations/MigrationTasks.d.cts +9 -0
- package/lib/types/migrations/MigrationTasks.d.mts +9 -0
- package/lib/types/migrations/MigrationVersioning.d.cts +7 -0
- package/lib/types/migrations/MigrationVersioning.d.mts +7 -0
- package/lib/types/migrations/SemverMigrationVersioning.d.cts +10 -0
- package/lib/types/migrations/SemverMigrationVersioning.d.mts +10 -0
- package/lib/types/migrations/StandardMigrationVersioning.d.cts +12 -0
- package/lib/types/migrations/StandardMigrationVersioning.d.mts +12 -0
- package/lib/types/migrations/constants.d.cts +2 -0
- package/lib/types/migrations/constants.d.mts +2 -0
- package/lib/types/migrations/decorators.d.cts +12 -0
- package/lib/types/migrations/decorators.d.mts +12 -0
- 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.mts +46 -0
- package/lib/types/model/BaseModel.d.cts +37 -0
- package/lib/types/model/BaseModel.d.mts +37 -0
- package/lib/types/model/SequenceModel.d.cts +32 -0
- package/lib/types/model/SequenceModel.d.mts +32 -0
- package/lib/types/model/construction.d.cts +455 -0
- package/lib/types/model/construction.d.mts +455 -0
- package/lib/types/model/decorators.d.cts +237 -0
- package/lib/types/model/decorators.d.mts +237 -0
- package/lib/types/model/index.d.cts +11 -0
- package/lib/types/model/index.d.mts +11 -0
- package/lib/types/model/indexing.d.cts +20 -0
- package/lib/types/model/indexing.d.mts +20 -0
- package/lib/types/model/types.d.cts +60 -0
- package/lib/types/model/types.d.mts +60 -0
- package/lib/types/overrides/Metadata.d.cts +22 -0
- package/lib/types/overrides/Metadata.d.mts +22 -0
- package/lib/types/overrides/Model.d.cts +94 -0
- package/lib/types/overrides/Model.d.mts +94 -0
- package/lib/types/overrides/ModelBuilder.d.cts +31 -0
- package/lib/types/overrides/ModelBuilder.d.mts +31 -0
- package/lib/types/overrides/index.d.cts +11 -0
- package/lib/types/overrides/index.d.mts +11 -0
- package/lib/types/overrides/injectables.d.cts +10 -0
- package/lib/types/overrides/injectables.d.mts +10 -0
- package/lib/types/overrides/overrides.d.cts +1 -0
- package/lib/types/overrides/overrides.d.mts +1 -0
- package/lib/types/persistence/Adapter.d.cts +469 -0
- package/lib/types/persistence/Adapter.d.mts +469 -0
- package/lib/types/persistence/Context.d.cts +16 -0
- package/lib/types/persistence/Context.d.mts +16 -0
- package/lib/types/persistence/ContextLock.d.cts +18 -0
- package/lib/types/persistence/ContextLock.d.mts +18 -0
- package/lib/types/persistence/Dispatch.d.cts +128 -0
- package/lib/types/persistence/Dispatch.d.mts +128 -0
- package/lib/types/persistence/ObserverHandler.d.cts +111 -0
- package/lib/types/persistence/ObserverHandler.d.mts +111 -0
- package/lib/types/persistence/Sequence.d.cts +126 -0
- package/lib/types/persistence/Sequence.d.mts +126 -0
- package/lib/types/persistence/constants.d.cts +74 -0
- package/lib/types/persistence/constants.d.mts +74 -0
- package/lib/types/persistence/decorators.d.cts +28 -0
- package/lib/types/persistence/decorators.d.mts +28 -0
- package/lib/types/persistence/errors.d.cts +33 -0
- 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.mts +20 -0
- package/lib/types/persistence/generators.d.cts +14 -0
- 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.mts +4 -0
- package/lib/types/persistence/types.d.cts +86 -0
- package/lib/types/persistence/types.d.mts +86 -0
- package/lib/types/query/Condition.d.cts +131 -0
- package/lib/types/query/Condition.d.mts +131 -0
- package/lib/types/query/MethodQueryBuilder.d.cts +185 -0
- package/lib/types/query/MethodQueryBuilder.d.mts +185 -0
- package/lib/types/query/Paginator.d.cts +105 -0
- package/lib/types/query/Paginator.d.mts +105 -0
- package/lib/types/query/Statement.d.cts +136 -0
- package/lib/types/query/Statement.d.mts +136 -0
- package/lib/types/query/constants.d.cts +69 -0
- package/lib/types/query/constants.d.mts +69 -0
- package/lib/types/query/decorators.d.cts +8 -0
- package/lib/types/query/decorators.d.mts +8 -0
- package/lib/types/query/errors.d.cts +21 -0
- 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.mts +393 -0
- package/lib/types/query/selectors.d.cts +39 -0
- package/lib/types/query/selectors.d.mts +39 -0
- package/lib/types/query/types.d.cts +158 -0
- package/lib/types/query/types.d.mts +158 -0
- package/lib/types/query/utils.d.cts +40 -0
- package/lib/types/query/utils.d.mts +40 -0
- package/lib/types/ram/RamAdapter.d.cts +341 -0
- package/lib/types/ram/RamAdapter.d.mts +341 -0
- package/lib/types/ram/RamPaginator.d.cts +54 -0
- package/lib/types/ram/RamPaginator.d.mts +54 -0
- package/lib/types/ram/RamStatement.d.cts +92 -0
- package/lib/types/ram/RamStatement.d.mts +92 -0
- package/lib/types/ram/constants.d.cts +8 -0
- package/lib/types/ram/constants.d.mts +8 -0
- package/lib/types/ram/handlers.d.cts +24 -0
- package/lib/types/ram/handlers.d.mts +24 -0
- package/lib/types/ram/index.d.cts +12 -0
- package/lib/types/ram/index.d.mts +12 -0
- package/lib/types/ram/types.d.cts +50 -0
- package/lib/types/ram/types.d.mts +50 -0
- package/lib/types/repository/Repository.d.cts +501 -0
- package/lib/types/repository/Repository.d.mts +501 -0
- package/lib/types/repository/constants.d.cts +36 -0
- package/lib/types/repository/constants.d.mts +36 -0
- package/lib/types/repository/decorators.d.cts +30 -0
- package/lib/types/repository/decorators.d.mts +30 -0
- package/lib/types/repository/errors.d.cts +19 -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.mts +12 -0
- package/lib/types/repository/injectables.d.cts +95 -0
- package/lib/types/repository/injectables.d.mts +95 -0
- package/lib/types/repository/types.d.cts +28 -0
- package/lib/types/repository/types.d.mts +28 -0
- package/lib/types/repository/utils.d.cts +36 -0
- package/lib/types/repository/utils.d.mts +36 -0
- package/lib/types/services/ModelService.d.cts +45 -0
- package/lib/types/services/ModelService.d.mts +45 -0
- package/lib/types/services/PersistenceService.d.cts +17 -0
- package/lib/types/services/PersistenceService.d.mts +17 -0
- package/lib/types/services/index.d.cts +8 -0
- package/lib/types/services/index.d.mts +8 -0
- package/lib/types/services/services.d.cts +96 -0
- package/lib/types/services/services.d.mts +96 -0
- package/lib/types/tasks/CleanUpTask.d.cts +15 -0
- package/lib/types/tasks/CleanUpTask.d.mts +15 -0
- package/lib/types/tasks/TaskContext.d.cts +30 -0
- package/lib/types/tasks/TaskContext.d.mts +30 -0
- package/lib/types/tasks/TaskEngine.d.cts +97 -0
- package/lib/types/tasks/TaskEngine.d.mts +97 -0
- package/lib/types/tasks/TaskErrors.d.cts +65 -0
- package/lib/types/tasks/TaskErrors.d.mts +65 -0
- package/lib/types/tasks/TaskEventBus.d.cts +17 -0
- package/lib/types/tasks/TaskEventBus.d.mts +17 -0
- 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.mts +12 -0
- package/lib/types/tasks/TaskHandlerRegistry.d.cts +8 -0
- package/lib/types/tasks/TaskHandlerRegistry.d.mts +8 -0
- package/lib/types/tasks/TaskService.d.cts +65 -0
- package/lib/types/tasks/TaskService.d.mts +65 -0
- package/lib/types/tasks/TaskStateChangeError.d.cts +11 -0
- package/lib/types/tasks/TaskStateChangeError.d.mts +11 -0
- package/lib/types/tasks/TaskTracker.d.cts +47 -0
- package/lib/types/tasks/TaskTracker.d.mts +47 -0
- package/lib/types/tasks/builder.d.cts +72 -0
- package/lib/types/tasks/builder.d.mts +72 -0
- package/lib/types/tasks/constants.d.cts +31 -0
- package/lib/types/tasks/constants.d.mts +31 -0
- package/lib/types/tasks/decorators.d.cts +4 -0
- 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.mts +31 -0
- package/lib/types/tasks/models/TaskBackoffModel.d.cts +9 -0
- package/lib/types/tasks/models/TaskBackoffModel.d.mts +9 -0
- package/lib/types/tasks/models/TaskErrorModel.d.cts +8 -0
- 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.mts +11 -0
- package/lib/types/tasks/models/TaskIOSerializer.d.cts +33 -0
- package/lib/types/tasks/models/TaskIOSerializer.d.mts +33 -0
- package/lib/types/tasks/models/TaskLogEntryModel.d.cts +10 -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.mts +43 -0
- package/lib/types/tasks/models/TaskStepResultModel.d.cts +9 -0
- package/lib/types/tasks/models/TaskStepResultModel.d.mts +9 -0
- package/lib/types/tasks/models/TaskStepSpecModel.d.cts +9 -0
- 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.mts +71 -0
- package/lib/types/tasks/utils.d.cts +5 -0
- package/lib/types/tasks/utils.d.mts +5 -0
- package/lib/types/utils/ContextualLoggedClass.d.cts +37 -0
- package/lib/types/utils/ContextualLoggedClass.d.mts +37 -0
- package/lib/types/utils/decorators.d.cts +27 -0
- package/lib/types/utils/decorators.d.mts +27 -0
- package/lib/types/utils/errors.d.cts +56 -0
- package/lib/types/utils/errors.d.mts +56 -0
- package/lib/types/utils/index.d.cts +11 -0
- package/lib/types/utils/index.d.mts +11 -0
- package/lib/types/utils/throttling.d.cts +9 -0
- package/lib/types/utils/throttling.d.mts +9 -0
- package/lib/types/utils/types.d.cts +23 -0
- package/lib/types/utils/types.d.mts +23 -0
- package/lib/types/utils/utils.d.cts +22 -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.mts +40 -0
- package/lib/types/workers/WorkThreadEnvironment.d.cts +35 -0
- package/lib/types/workers/WorkThreadEnvironment.d.mts +35 -0
- 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.mts +69 -0
- package/lib/types/workers/types.d.cts +41 -0
- package/lib/types/workers/types.d.mts +41 -0
- package/lib/types/workers/workerThread.d.cts +1 -0
- 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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Condition } from "./Condition.js";
|
|
2
|
+
import { OrderBySelector } from "./selectors.js";
|
|
3
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
4
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
5
|
+
import { OrderDirection } from "../repository/constants.js";
|
|
6
|
+
/**
|
|
7
|
+
* @description
|
|
8
|
+
* Options for configuring query building behavior.
|
|
9
|
+
*
|
|
10
|
+
* @summary
|
|
11
|
+
* The `QueryOptions` type defines flags that determine whether certain clauses
|
|
12
|
+
* (limit, offset, order by) are permitted, as well as whether violations
|
|
13
|
+
* should throw an error during query construction.
|
|
14
|
+
*
|
|
15
|
+
* @memberOf module:query
|
|
16
|
+
*/
|
|
17
|
+
export type QueryOptions = {
|
|
18
|
+
allowLimit?: boolean;
|
|
19
|
+
allowOffset?: boolean;
|
|
20
|
+
allowOrderBy?: boolean;
|
|
21
|
+
throws?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type OrderLimitOffsetExtract = {
|
|
24
|
+
orderBy?: OrderBySelector<any>[];
|
|
25
|
+
limit?: number;
|
|
26
|
+
offset?: number;
|
|
27
|
+
};
|
|
28
|
+
export type DirectionLimitOffset = {
|
|
29
|
+
direction?: OrderDirection;
|
|
30
|
+
order?: OrderBySelector<any>[];
|
|
31
|
+
limit?: number;
|
|
32
|
+
offset?: number;
|
|
33
|
+
bookmark?: string | number;
|
|
34
|
+
};
|
|
35
|
+
export type PreparedStatement<M extends Model> = {
|
|
36
|
+
class: Constructor<M>;
|
|
37
|
+
method: string;
|
|
38
|
+
args: any[];
|
|
39
|
+
params: DirectionLimitOffset;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @description
|
|
43
|
+
* Structured query object representing parsed query clauses.
|
|
44
|
+
*
|
|
45
|
+
* @summary
|
|
46
|
+
* The `QueryAssist` interface defines the standard structure returned
|
|
47
|
+
* by query builders. It includes actions such as find, optional clauses
|
|
48
|
+
* like select, groupBy, and orderBy, and pagination controls (limit, offset).
|
|
49
|
+
*
|
|
50
|
+
* @template T The entity or record type that conditions may apply to.
|
|
51
|
+
*
|
|
52
|
+
* @interface QueryAssist
|
|
53
|
+
* @memberOf module:query
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* @description
|
|
57
|
+
* Supported query action types for method-based queries.
|
|
58
|
+
*
|
|
59
|
+
* @summary
|
|
60
|
+
* The `QueryAction` type defines the possible actions that can be
|
|
61
|
+
* performed by a query built from a method name.
|
|
62
|
+
*
|
|
63
|
+
* @memberOf module:query
|
|
64
|
+
*/
|
|
65
|
+
export type QueryAction = "find" | "page" | "count" | "sum" | "avg" | "min" | "max" | "distinct" | "group";
|
|
66
|
+
export interface QueryAssist {
|
|
67
|
+
action: QueryAction;
|
|
68
|
+
select: undefined | string[];
|
|
69
|
+
selector?: string;
|
|
70
|
+
where?: Condition<any>;
|
|
71
|
+
groupBy?: string[];
|
|
72
|
+
orderBy?: OrderBySelector<any>[];
|
|
73
|
+
limit: number | undefined;
|
|
74
|
+
offset: number | undefined;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @description
|
|
78
|
+
* Enumeration of supported query clauses for building method-based queries.
|
|
79
|
+
*
|
|
80
|
+
* @summary
|
|
81
|
+
* The `QueryClause` enum defines string literals that represent
|
|
82
|
+
* different segments of a query (e.g., `findBy`, `Select`, `And`, `Or`).
|
|
83
|
+
*
|
|
84
|
+
* @enum QueryClause
|
|
85
|
+
* @memberOf module:query
|
|
86
|
+
*/
|
|
87
|
+
export declare enum QueryClause {
|
|
88
|
+
FIND_BY = "findBy",
|
|
89
|
+
PAGE_BY = "pageBy",
|
|
90
|
+
COUNT_BY = "countBy",
|
|
91
|
+
SUM_BY = "sumBy",
|
|
92
|
+
AVG_BY = "avgBy",
|
|
93
|
+
MIN_BY = "minBy",
|
|
94
|
+
MAX_BY = "maxBy",
|
|
95
|
+
DISTINCT_BY = "distinctBy",
|
|
96
|
+
GROUP_BY_PREFIX = "groupBy",
|
|
97
|
+
SELECT = "Select",
|
|
98
|
+
AND = "And",
|
|
99
|
+
OR = "Or",
|
|
100
|
+
GROUP_BY = "GroupBy",
|
|
101
|
+
ORDER_BY = "OrderBy",
|
|
102
|
+
THEN = "Then",
|
|
103
|
+
THEN_BY = "ThenBy"
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @description
|
|
107
|
+
* Function signature for parsing operators in query building.
|
|
108
|
+
*
|
|
109
|
+
* @summary
|
|
110
|
+
* The `OperatorParser` type represents a function that takes a field name
|
|
111
|
+
* and arguments, then produces a `Condition` object that can be used in a query.
|
|
112
|
+
*
|
|
113
|
+
* @template T The type of the condition result.
|
|
114
|
+
*
|
|
115
|
+
* @param field {string} - The name of the field being parsed.
|
|
116
|
+
* @param args {any[]} - Additional arguments for operator evaluation.
|
|
117
|
+
*
|
|
118
|
+
* @return {Condition<any>} A condition object representing the parsed operator.
|
|
119
|
+
*
|
|
120
|
+
* @memberOf module:query
|
|
121
|
+
*/
|
|
122
|
+
export type OperatorParser = (field: string, ...args: any) => Condition<any>;
|
|
123
|
+
/**
|
|
124
|
+
* @description
|
|
125
|
+
* Descriptor for fields and their associated operators in query parsing.
|
|
126
|
+
*
|
|
127
|
+
* @summary
|
|
128
|
+
* The `FilterDescriptor` interface defines the structure used when parsing
|
|
129
|
+
* method segments into filterable fields and associated operators.
|
|
130
|
+
*
|
|
131
|
+
* @interface FilterDescriptor
|
|
132
|
+
* @memberOf module:query
|
|
133
|
+
*/
|
|
134
|
+
export interface FilterDescriptor {
|
|
135
|
+
field: string;
|
|
136
|
+
operator?: string;
|
|
137
|
+
}
|
|
138
|
+
export type ViewKey = string | string[];
|
|
139
|
+
export type ViewKind = "view" | "groupBy" | "count" | "sum" | "max" | "min" | "distinct";
|
|
140
|
+
export interface ViewAuthOptions {
|
|
141
|
+
expression?: string;
|
|
142
|
+
field?: string;
|
|
143
|
+
roles?: string[];
|
|
144
|
+
mode?: "any" | "all";
|
|
145
|
+
}
|
|
146
|
+
export interface ViewOptions {
|
|
147
|
+
name?: string;
|
|
148
|
+
key?: ViewKey;
|
|
149
|
+
value?: ViewKey | null;
|
|
150
|
+
condition?: Condition<any> | string;
|
|
151
|
+
auth?: string | ViewAuthOptions;
|
|
152
|
+
compositions?: string[];
|
|
153
|
+
directions?: OrderDirection[];
|
|
154
|
+
}
|
|
155
|
+
export interface ViewMetadata extends ViewOptions {
|
|
156
|
+
kind: ViewKind;
|
|
157
|
+
attribute: string;
|
|
158
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { OperatorParser } from "./types.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Map of supported operators to their corresponding parser functions.
|
|
5
|
+
*
|
|
6
|
+
* @summary
|
|
7
|
+
* The `OperatorsMap` defines a collection of operator names as keys
|
|
8
|
+
* (such as `Equals`, `LessThan`, `Between`, etc.), each mapped to a
|
|
9
|
+
* function that constructs a `Condition` object for that operator.
|
|
10
|
+
* These functions translate query clauses into concrete condition
|
|
11
|
+
* builders, enabling dynamic query construction from method names.
|
|
12
|
+
*
|
|
13
|
+
* @template T The type of the field values used in conditions.
|
|
14
|
+
*
|
|
15
|
+
* @param f {string} - The field name the condition applies to.
|
|
16
|
+
* @param v1 {any} - The value to compare the field against or the lower bound value for range-based operators.
|
|
17
|
+
* @param v2 {any} - The upper bound value for range-based operators.
|
|
18
|
+
*
|
|
19
|
+
* @return {Condition<any>} A condition object representing the operator applied to the field.
|
|
20
|
+
*
|
|
21
|
+
* @function OperatorsMap
|
|
22
|
+
*
|
|
23
|
+
* @mermaid
|
|
24
|
+
* sequenceDiagram
|
|
25
|
+
* participant Client as Caller
|
|
26
|
+
* participant Map as OperatorsMap
|
|
27
|
+
* participant Parser as OperatorParser
|
|
28
|
+
* participant Cond as Condition
|
|
29
|
+
*
|
|
30
|
+
* Client->>Map: Request operator parser ("Between", field, v1, v2)
|
|
31
|
+
* Map->>Parser: Call corresponding operator function
|
|
32
|
+
* Parser->>Cond: Condition.attribute(field)
|
|
33
|
+
* Cond-->>Parser: Condition instance
|
|
34
|
+
* Parser->>Cond: Apply gte(v1)
|
|
35
|
+
* Parser->>Cond: Apply and(lte(v2))
|
|
36
|
+
* Parser-->>Client: Return built Condition
|
|
37
|
+
*
|
|
38
|
+
* @memberOf module:query
|
|
39
|
+
*/
|
|
40
|
+
export declare const OperatorsMap: Record<string, OperatorParser>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { OperatorParser } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Map of supported operators to their corresponding parser functions.
|
|
5
|
+
*
|
|
6
|
+
* @summary
|
|
7
|
+
* The `OperatorsMap` defines a collection of operator names as keys
|
|
8
|
+
* (such as `Equals`, `LessThan`, `Between`, etc.), each mapped to a
|
|
9
|
+
* function that constructs a `Condition` object for that operator.
|
|
10
|
+
* These functions translate query clauses into concrete condition
|
|
11
|
+
* builders, enabling dynamic query construction from method names.
|
|
12
|
+
*
|
|
13
|
+
* @template T The type of the field values used in conditions.
|
|
14
|
+
*
|
|
15
|
+
* @param f {string} - The field name the condition applies to.
|
|
16
|
+
* @param v1 {any} - The value to compare the field against or the lower bound value for range-based operators.
|
|
17
|
+
* @param v2 {any} - The upper bound value for range-based operators.
|
|
18
|
+
*
|
|
19
|
+
* @return {Condition<any>} A condition object representing the operator applied to the field.
|
|
20
|
+
*
|
|
21
|
+
* @function OperatorsMap
|
|
22
|
+
*
|
|
23
|
+
* @mermaid
|
|
24
|
+
* sequenceDiagram
|
|
25
|
+
* participant Client as Caller
|
|
26
|
+
* participant Map as OperatorsMap
|
|
27
|
+
* participant Parser as OperatorParser
|
|
28
|
+
* participant Cond as Condition
|
|
29
|
+
*
|
|
30
|
+
* Client->>Map: Request operator parser ("Between", field, v1, v2)
|
|
31
|
+
* Map->>Parser: Call corresponding operator function
|
|
32
|
+
* Parser->>Cond: Condition.attribute(field)
|
|
33
|
+
* Cond-->>Parser: Condition instance
|
|
34
|
+
* Parser->>Cond: Apply gte(v1)
|
|
35
|
+
* Parser->>Cond: Apply and(lte(v2))
|
|
36
|
+
* Parser-->>Client: Return built Condition
|
|
37
|
+
*
|
|
38
|
+
* @memberOf module:query
|
|
39
|
+
*/
|
|
40
|
+
export declare const OperatorsMap: Record<string, OperatorParser>;
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { RamConfig, RamContext, RamFlags, RamStorage, RawRamQuery } from "./types.cjs";
|
|
2
|
+
import { RamStatement } from "./RamStatement.cjs";
|
|
3
|
+
import { Repository } from "../repository/Repository.cjs";
|
|
4
|
+
import { Dispatch } from "../persistence/Dispatch.cjs";
|
|
5
|
+
import { Adapter, AdapterFlags, RawResult } from "../persistence/index.cjs";
|
|
6
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
7
|
+
import { BaseError, OperationKeys, PrimaryKeyType } from "@decaf-ts/db-decorators";
|
|
8
|
+
import type { Constructor } from "@decaf-ts/decoration";
|
|
9
|
+
import { RamPaginator } from "./RamPaginator.cjs";
|
|
10
|
+
import { ContextualArgs } from "../utils/ContextualLoggedClass.cjs";
|
|
11
|
+
/**
|
|
12
|
+
* @description In-memory adapter for data persistence
|
|
13
|
+
* @summary The RamAdapter provides an in-memory implementation of the persistence layer.
|
|
14
|
+
* It stores data in JavaScript Maps and provides CRUD operations and query capabilities.
|
|
15
|
+
* This adapter is useful for testing, prototyping, and applications that don't require
|
|
16
|
+
* persistent storage across application restarts.
|
|
17
|
+
* @class RamAdapter
|
|
18
|
+
* @category Ram
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // Create a new RAM adapter
|
|
22
|
+
* const adapter = new RamAdapter('myRamAdapter');
|
|
23
|
+
*
|
|
24
|
+
* // Create a repository for a model
|
|
25
|
+
* const userRepo = new (adapter.repository<User>())(User, adapter);
|
|
26
|
+
*
|
|
27
|
+
* // Perform CRUD operations
|
|
28
|
+
* const user = new User({ name: 'John', email: 'john@example.com' });
|
|
29
|
+
* await userRepo.create(user);
|
|
30
|
+
* const retrievedUser = await userRepo.findById(user.id);
|
|
31
|
+
* ```
|
|
32
|
+
* @mermaid
|
|
33
|
+
* sequenceDiagram
|
|
34
|
+
* participant Client
|
|
35
|
+
* participant Repository
|
|
36
|
+
* participant RamAdapter
|
|
37
|
+
* participant Storage as In-Memory Storage
|
|
38
|
+
*
|
|
39
|
+
* Client->>Repository: create(model)
|
|
40
|
+
* Repository->>RamAdapter: create(tableName, id, model)
|
|
41
|
+
* RamAdapter->>RamAdapter: lock.acquire()
|
|
42
|
+
* RamAdapter->>Storage: set(id, model)
|
|
43
|
+
* RamAdapter->>RamAdapter: lock.release()
|
|
44
|
+
* RamAdapter-->>Repository: model
|
|
45
|
+
* Repository-->>Client: model
|
|
46
|
+
*
|
|
47
|
+
* Client->>Repository: findById(id)
|
|
48
|
+
* Repository->>RamAdapter: read(tableName, id)
|
|
49
|
+
* RamAdapter->>Storage: get(id)
|
|
50
|
+
* Storage-->>RamAdapter: model
|
|
51
|
+
* RamAdapter-->>Repository: model
|
|
52
|
+
* Repository-->>Client: model
|
|
53
|
+
*/
|
|
54
|
+
export declare class RamAdapter extends Adapter<RamConfig, RamStorage, RawRamQuery, RamContext> {
|
|
55
|
+
constructor(conf?: RamConfig, alias?: string);
|
|
56
|
+
/**
|
|
57
|
+
* @description Gets the repository constructor for a model
|
|
58
|
+
* @summary Returns a constructor for creating repositories that work with the specified model type.
|
|
59
|
+
* This method overrides the base implementation to provide RAM-specific repository functionality.
|
|
60
|
+
* @template M - The model type for the repository
|
|
61
|
+
* @return {Constructor<RamRepository<M>>} A constructor for creating RAM repositories
|
|
62
|
+
*/
|
|
63
|
+
repository<R extends Repository<any, Adapter<any, any, any, any>>>(): Constructor<R>;
|
|
64
|
+
/**
|
|
65
|
+
* @description Creates operation flags with UUID
|
|
66
|
+
* @summary Extends the base flags with a UUID for user identification.
|
|
67
|
+
* This method ensures that all operations have a unique identifier for tracking purposes.
|
|
68
|
+
* @template M - The model type for the operation
|
|
69
|
+
* @param {OperationKeys} operation - The type of operation being performed
|
|
70
|
+
* @param {Constructor<M>} model - The model constructor
|
|
71
|
+
* @param {Partial<RamFlags>} flags - Partial flags to be extended
|
|
72
|
+
* @return {Promise<RamFlags>} Complete flags with UUID
|
|
73
|
+
*/
|
|
74
|
+
flags<M extends Model<boolean>>(operation: OperationKeys, model: Constructor<M>, flags: Partial<RamFlags>): Promise<RamFlags>;
|
|
75
|
+
protected Dispatch(): Dispatch<RamAdapter>;
|
|
76
|
+
private indexes;
|
|
77
|
+
private lock;
|
|
78
|
+
/**
|
|
79
|
+
* @description Indexes models in the RAM adapter
|
|
80
|
+
* @summary A no-op indexing method for the RAM adapter.
|
|
81
|
+
* Since RAM adapter doesn't require explicit indexing, this method simply resolves immediately.
|
|
82
|
+
* @param models - Models to be indexed (unused)
|
|
83
|
+
* @return {Promise<any>} A promise that resolves when indexing is complete
|
|
84
|
+
*/
|
|
85
|
+
index(...models: Record<string, any>[]): Promise<any>;
|
|
86
|
+
/**
|
|
87
|
+
* @description Prepares a model for storage
|
|
88
|
+
* @summary Converts a model instance to a format suitable for storage in the RAM adapter.
|
|
89
|
+
* This method extracts the primary key and creates a record without the primary key field.
|
|
90
|
+
* @template M - The model type being prepared
|
|
91
|
+
* @param {M} model - The model instance to prepare
|
|
92
|
+
* @param pk - The primary key property name
|
|
93
|
+
* @return Object containing the record and ID
|
|
94
|
+
*/
|
|
95
|
+
prepare<M extends Model>(model: M, ...args: [...any[], RamContext]): {
|
|
96
|
+
record: Record<string, any>;
|
|
97
|
+
id: string;
|
|
98
|
+
transient?: Record<string, any>;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @description Converts a stored record back to a model instance
|
|
102
|
+
* @summary Reconstructs a model instance from a stored record by adding back the primary key.
|
|
103
|
+
* This method is the inverse of the prepare method.
|
|
104
|
+
* @template M - The model type to revert to
|
|
105
|
+
* @param {Record<string, any>} obj - The stored record
|
|
106
|
+
* @param {Constructor<M>} clazz - The model class or name
|
|
107
|
+
* @param {PrimaryKeyType} id - The primary key value
|
|
108
|
+
* @return {M} The reconstructed model instance
|
|
109
|
+
*/
|
|
110
|
+
revert<M extends Model>(obj: Record<string, any>, clazz: Constructor<M>, id: PrimaryKeyType, transient?: Record<string, any>, ...args: [...any[], RamContext]): M;
|
|
111
|
+
/**
|
|
112
|
+
* @description Creates a new record in the in-memory storage
|
|
113
|
+
* @summary Stores a new record in the specified table with the given ID.
|
|
114
|
+
* This method acquires a lock to ensure thread safety, creates the table if it doesn't exist,
|
|
115
|
+
* checks for conflicts, and stores the model.
|
|
116
|
+
* @param {string} clazz - The name of the table to store the record in
|
|
117
|
+
* @param {string | number} id - The unique identifier for the record
|
|
118
|
+
* @param {Record<string, any>} model - The record data to store
|
|
119
|
+
* @return {Promise<Record<string, any>>} A promise that resolves to the stored record
|
|
120
|
+
* @mermaid
|
|
121
|
+
* sequenceDiagram
|
|
122
|
+
* participant Caller
|
|
123
|
+
* participant RamAdapter
|
|
124
|
+
* participant Storage as In-Memory Storage
|
|
125
|
+
*
|
|
126
|
+
* Caller->>RamAdapter: create(tableName, id, model)
|
|
127
|
+
* RamAdapter->>RamAdapter: lock.acquire()
|
|
128
|
+
* RamAdapter->>Storage: has(tableName)
|
|
129
|
+
* alt Table doesn't exist
|
|
130
|
+
* RamAdapter->>Storage: set(tableName, new Map())
|
|
131
|
+
* end
|
|
132
|
+
* RamAdapter->>Storage: has(id)
|
|
133
|
+
* alt Record exists
|
|
134
|
+
* RamAdapter-->>Caller: throw ConflictError
|
|
135
|
+
* end
|
|
136
|
+
* RamAdapter->>Storage: set(id, model)
|
|
137
|
+
* RamAdapter->>RamAdapter: lock.release()
|
|
138
|
+
* RamAdapter-->>Caller: model
|
|
139
|
+
*/
|
|
140
|
+
create<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
|
|
141
|
+
/**
|
|
142
|
+
* @description Retrieves a record from in-memory storage
|
|
143
|
+
* @summary Fetches a record with the specified ID from the given table.
|
|
144
|
+
* This method checks if the table and record exist and throws appropriate errors if not.
|
|
145
|
+
* @param {Constructor} clazz - The name of the table to retrieve from
|
|
146
|
+
* @param {PrimaryKeyType} id - The unique identifier of the record to retrieve
|
|
147
|
+
* @return {Promise<Record<string, any>>} A promise that resolves to the retrieved record
|
|
148
|
+
* @mermaid
|
|
149
|
+
* sequenceDiagram
|
|
150
|
+
* participant Caller
|
|
151
|
+
* participant RamAdapter
|
|
152
|
+
* participant Storage as In-Memory Storage
|
|
153
|
+
*
|
|
154
|
+
* Caller->>RamAdapter: read(tableName, id)
|
|
155
|
+
* RamAdapter->>Storage: has(tableName)
|
|
156
|
+
* alt Table doesn't exist
|
|
157
|
+
* RamAdapter-->>Caller: throw NotFoundError
|
|
158
|
+
* end
|
|
159
|
+
* RamAdapter->>Storage: has(id)
|
|
160
|
+
* alt Record doesn't exist
|
|
161
|
+
* RamAdapter-->>Caller: throw NotFoundError
|
|
162
|
+
* end
|
|
163
|
+
* RamAdapter->>Storage: get(id)
|
|
164
|
+
* Storage-->>RamAdapter: record
|
|
165
|
+
* RamAdapter-->>Caller: record
|
|
166
|
+
*/
|
|
167
|
+
read<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
|
|
168
|
+
/**
|
|
169
|
+
* @description Updates an existing record in the in-memory storage
|
|
170
|
+
* @summary Updates a record with the specified ID in the given table.
|
|
171
|
+
* This method acquires a lock to ensure thread safety, checks if the table and record exist,
|
|
172
|
+
* and updates the record with the new data.
|
|
173
|
+
* @param {string} tableName - The name of the table containing the record
|
|
174
|
+
* @param {string | number} id - The unique identifier of the record to update
|
|
175
|
+
* @param {Record<string, any>} model - The new record data
|
|
176
|
+
* @return {Promise<Record<string, any>>} A promise that resolves to the updated record
|
|
177
|
+
* @mermaid
|
|
178
|
+
* sequenceDiagram
|
|
179
|
+
* participant Caller
|
|
180
|
+
* participant RamAdapter
|
|
181
|
+
* participant Storage as In-Memory Storage
|
|
182
|
+
*
|
|
183
|
+
* Caller->>RamAdapter: update(tableName, id, model)
|
|
184
|
+
* RamAdapter->>RamAdapter: lock.acquire()
|
|
185
|
+
* RamAdapter->>Storage: has(tableName)
|
|
186
|
+
* alt Table doesn't exist
|
|
187
|
+
* RamAdapter-->>Caller: throw NotFoundError
|
|
188
|
+
* end
|
|
189
|
+
* RamAdapter->>Storage: has(id)
|
|
190
|
+
* alt Record doesn't exist
|
|
191
|
+
* RamAdapter-->>Caller: throw NotFoundError
|
|
192
|
+
* end
|
|
193
|
+
* RamAdapter->>Storage: set(id, model)
|
|
194
|
+
* RamAdapter->>RamAdapter: lock.release()
|
|
195
|
+
* RamAdapter-->>Caller: model
|
|
196
|
+
*/
|
|
197
|
+
update<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
|
|
198
|
+
/**
|
|
199
|
+
* @description Deletes a record from the in-memory storage
|
|
200
|
+
* @summary Removes a record with the specified ID from the given table.
|
|
201
|
+
* This method acquires a lock to ensure thread safety, checks if the table and record exist,
|
|
202
|
+
* retrieves the record before deletion, and then removes it from storage.
|
|
203
|
+
* @param {string} tableName - The name of the table containing the record
|
|
204
|
+
* @param {string | number} id - The unique identifier of the record to delete
|
|
205
|
+
* @return {Promise<Record<string, any>>} A promise that resolves to the deleted record
|
|
206
|
+
* @mermaid
|
|
207
|
+
* sequenceDiagram
|
|
208
|
+
* participant Caller
|
|
209
|
+
* participant RamAdapter
|
|
210
|
+
* participant Storage as In-Memory Storage
|
|
211
|
+
*
|
|
212
|
+
* Caller->>RamAdapter: delete(tableName, id)
|
|
213
|
+
* RamAdapter->>RamAdapter: lock.acquire()
|
|
214
|
+
* RamAdapter->>Storage: has(tableName)
|
|
215
|
+
* alt Table doesn't exist
|
|
216
|
+
* RamAdapter-->>Caller: throw NotFoundError
|
|
217
|
+
* end
|
|
218
|
+
* RamAdapter->>Storage: has(id)
|
|
219
|
+
* alt Record doesn't exist
|
|
220
|
+
* RamAdapter-->>Caller: throw NotFoundError
|
|
221
|
+
* end
|
|
222
|
+
* RamAdapter->>Storage: get(id)
|
|
223
|
+
* Storage-->>RamAdapter: record
|
|
224
|
+
* RamAdapter->>Storage: delete(id)
|
|
225
|
+
* RamAdapter->>RamAdapter: lock.release()
|
|
226
|
+
* RamAdapter-->>Caller: record
|
|
227
|
+
*/
|
|
228
|
+
delete<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
|
|
229
|
+
/**
|
|
230
|
+
* @description Gets or creates a table in the in-memory storage
|
|
231
|
+
* @summary Retrieves the Map representing a table for a given model class.
|
|
232
|
+
* If the table doesn't exist, it creates a new one so callers can insert or
|
|
233
|
+
* query entities without null reference checks.
|
|
234
|
+
* @template M - The model type for the table
|
|
235
|
+
* @param {Constructor<M>} from - The model class
|
|
236
|
+
* @return {Map<string | number, any> | undefined} The table Map or undefined
|
|
237
|
+
*/
|
|
238
|
+
protected tableFor<M extends Model>(from: Constructor<M>): Map<PrimaryKeyType, any> | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* @description Executes a raw query against the in-memory storage
|
|
241
|
+
* @summary Performs a query operation on the in-memory data store using the provided query specification.
|
|
242
|
+
* This method supports filtering, sorting, pagination, and field selection.
|
|
243
|
+
* @template R - The return type of the query
|
|
244
|
+
* @param {RawRamQuery<any>} rawInput - The query specification
|
|
245
|
+
* @return {Promise<R>} A promise that resolves to the query results
|
|
246
|
+
* @mermaid
|
|
247
|
+
* sequenceDiagram
|
|
248
|
+
* participant Caller
|
|
249
|
+
* participant RamAdapter
|
|
250
|
+
* participant Storage as In-Memory Storage
|
|
251
|
+
*
|
|
252
|
+
* Caller->>RamAdapter: raw(rawInput)
|
|
253
|
+
* RamAdapter->>RamAdapter: tableFor(from)
|
|
254
|
+
* alt Table doesn't exist
|
|
255
|
+
* RamAdapter-->>Caller: throw InternalError
|
|
256
|
+
* end
|
|
257
|
+
* RamAdapter->>RamAdapter: findPrimaryKey(new from())
|
|
258
|
+
* RamAdapter->>Storage: entries()
|
|
259
|
+
* Storage-->>RamAdapter: entries
|
|
260
|
+
* loop For each entry
|
|
261
|
+
* RamAdapter->>RamAdapter: revert(r, from, id, pk)
|
|
262
|
+
* end
|
|
263
|
+
* alt Where condition exists
|
|
264
|
+
* RamAdapter->>RamAdapter: result.filter(where)
|
|
265
|
+
* end
|
|
266
|
+
* alt Sort condition exists
|
|
267
|
+
* RamAdapter->>RamAdapter: result.sort(sort)
|
|
268
|
+
* end
|
|
269
|
+
* alt Skip specified
|
|
270
|
+
* RamAdapter->>RamAdapter: result.slice(skip)
|
|
271
|
+
* end
|
|
272
|
+
* alt Limit specified
|
|
273
|
+
* RamAdapter->>RamAdapter: result.slice(0, limit)
|
|
274
|
+
* end
|
|
275
|
+
* alt Select fields specified
|
|
276
|
+
* loop For each result
|
|
277
|
+
* RamAdapter->>RamAdapter: Filter to selected fields
|
|
278
|
+
* end
|
|
279
|
+
* end
|
|
280
|
+
* RamAdapter-->>Caller: result
|
|
281
|
+
*/
|
|
282
|
+
raw<R, D extends boolean>(rawInput: RawRamQuery<any>, docsOnly?: D, ...args: ContextualArgs<RamContext>): Promise<RawResult<R, D>>;
|
|
283
|
+
private groupRecords;
|
|
284
|
+
private normalizeGroupKey;
|
|
285
|
+
private applyGroupPagination;
|
|
286
|
+
/**
|
|
287
|
+
* @description Parses and converts errors to appropriate types
|
|
288
|
+
* @summary Ensures that errors are of the correct type for consistent error handling.
|
|
289
|
+
* If the error is already a BaseError, it's returned as is; otherwise, it's wrapped in an InternalError.
|
|
290
|
+
* @template V - The expected error type, extending BaseError
|
|
291
|
+
* @param {Error} err - The error to parse
|
|
292
|
+
* @return {V} The parsed error of the expected type
|
|
293
|
+
*/
|
|
294
|
+
parseError<V extends BaseError>(err: Error): V;
|
|
295
|
+
/**
|
|
296
|
+
* @description Creates a new statement builder for queries
|
|
297
|
+
* @summary Factory method that creates a new RamStatement instance for building queries.
|
|
298
|
+
* This method allows for fluent query construction against the RAM adapter.
|
|
299
|
+
* @template M - The model type for the statement
|
|
300
|
+
* @return {RamStatement<M, any>} A new statement builder instance
|
|
301
|
+
*/
|
|
302
|
+
Statement<M extends Model<boolean>>(overrides?: Partial<AdapterFlags>): RamStatement<M, any, Adapter<any, any, RawRamQuery<M>, RamContext>>;
|
|
303
|
+
Paginator<M extends Model<boolean>>(query: RawRamQuery, size: number, clazz: Constructor<M>): RamPaginator<M>;
|
|
304
|
+
for(config: Partial<RamConfig>, ...args: any[]): typeof this;
|
|
305
|
+
/**
|
|
306
|
+
* @description Sets up RAM-specific decorations for model properties
|
|
307
|
+
* @summary Configures decorations for createdBy and updatedBy fields in the RAM adapter.
|
|
308
|
+
* This static method is called during initialization to set up handlers that automatically
|
|
309
|
+
* populate these fields with the current user's UUID during create and update operations.
|
|
310
|
+
* @return {void}
|
|
311
|
+
* @mermaid
|
|
312
|
+
* sequenceDiagram
|
|
313
|
+
* participant RamAdapter
|
|
314
|
+
* participant Decoration
|
|
315
|
+
* participant Repository
|
|
316
|
+
*
|
|
317
|
+
* RamAdapter->>Repository: key(PersistenceKeys.CREATED_BY)
|
|
318
|
+
* Repository-->>RamAdapter: createdByKey
|
|
319
|
+
* RamAdapter->>Repository: key(PersistenceKeys.UPDATED_BY)
|
|
320
|
+
* Repository-->>RamAdapter: updatedByKey
|
|
321
|
+
*
|
|
322
|
+
* RamAdapter->>Decoration: flavouredAs(RamFlavour)
|
|
323
|
+
* Decoration-->>RamAdapter: DecoratorBuilder
|
|
324
|
+
* RamAdapter->>Decoration: for(createdByKey)
|
|
325
|
+
* RamAdapter->>Decoration: define(onCreate, propMetadata)
|
|
326
|
+
* RamAdapter->>Decoration: apply()
|
|
327
|
+
*
|
|
328
|
+
* RamAdapter->>Decoration: flavouredAs(RamFlavour)
|
|
329
|
+
* Decoration-->>RamAdapter: DecoratorBuilder
|
|
330
|
+
* RamAdapter->>Decoration: for(updatedByKey)
|
|
331
|
+
* RamAdapter->>Decoration: define(onCreate, propMetadata)
|
|
332
|
+
* RamAdapter->>Decoration: apply()
|
|
333
|
+
*/
|
|
334
|
+
static decoration(): void;
|
|
335
|
+
private ensureFieldType;
|
|
336
|
+
private resolveFieldType;
|
|
337
|
+
private normalizeMetaType;
|
|
338
|
+
private isNumericType;
|
|
339
|
+
private toNumericValue;
|
|
340
|
+
protected getClient(): RamStorage;
|
|
341
|
+
}
|