@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,237 @@
|
|
|
1
|
+
import { OperationKeys } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
3
|
+
import { CascadeMetadata } from "../repository/types.cjs";
|
|
4
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
5
|
+
import type { Repo } from "../repository/Repository.cjs";
|
|
6
|
+
import { JoinColumnOptions, JoinTableMultipleColumnsOptions, JoinTableOptions, RelationsMetadata } from "./types.cjs";
|
|
7
|
+
import { ContextOf } from "../persistence/types.cjs";
|
|
8
|
+
/**
|
|
9
|
+
* @description Specifies the database table name for a model
|
|
10
|
+
* @summary Decorator that sets the table name for a model class in the database
|
|
11
|
+
* @param {string} opts - The name of the table in the database
|
|
12
|
+
* @return {Function} A decorator function that can be applied to a class
|
|
13
|
+
* @function table
|
|
14
|
+
* @category Class Decorators
|
|
15
|
+
*/
|
|
16
|
+
export declare function table<OPTS = string>(opts?: OPTS): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
17
|
+
/**
|
|
18
|
+
* @description Specifies the database column name for a model property
|
|
19
|
+
* @summary Decorator that maps a model property to a specific column name in the database
|
|
20
|
+
* @param {string} columnName - The name of the column in the database
|
|
21
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
22
|
+
* @function column
|
|
23
|
+
* @category Property Decorators
|
|
24
|
+
*/
|
|
25
|
+
export declare function column<OPTS = string>(columnName?: OPTS): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
26
|
+
/**
|
|
27
|
+
* @description Enforces uniqueness constraint during model creation and update
|
|
28
|
+
* @summary Internal function used by the unique decorator to check if a property value already exists in the database
|
|
29
|
+
* @template M - The model type extending Model
|
|
30
|
+
* @template R - The repository type extending Repo<M, F, C>
|
|
31
|
+
* @template V - The metadata type
|
|
32
|
+
* @template F - The repository flags type
|
|
33
|
+
* @template C - The context type extending Context<F>
|
|
34
|
+
* @param {R} this - The repository instance
|
|
35
|
+
* @param {Context<F>} context - The context for the operation
|
|
36
|
+
* @param {V} data - The metadata for the property
|
|
37
|
+
* @param key - The property key to check for uniqueness
|
|
38
|
+
* @param {M} model - The model instance being created or updated
|
|
39
|
+
* @return {Promise<void>} A promise that resolves when the check is complete or rejects with a ConflictError
|
|
40
|
+
* @function uniqueOnCreateUpdate
|
|
41
|
+
* @memberOf module:core
|
|
42
|
+
*/
|
|
43
|
+
export declare function uniqueOnCreateUpdate<M extends Model, R extends Repo<M>>(this: R, context: ContextOf<R>, data: object, key: keyof M, model: M): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* @description Tags a property as unique
|
|
46
|
+
* @summary Decorator that ensures a property value is unique across all instances of a model in the database
|
|
47
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
48
|
+
* @function unique
|
|
49
|
+
* @category Property Decorators
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* class User extends BaseModel {
|
|
53
|
+
* @unique()
|
|
54
|
+
* @required()
|
|
55
|
+
* username!: string;
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function unique(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
60
|
+
/**
|
|
61
|
+
* @description Handles user identification for ownership tracking
|
|
62
|
+
* @summary Internal function used by the createdBy and updatedBy decorators to set ownership information
|
|
63
|
+
* @template M - The model type extending Model
|
|
64
|
+
* @template R - The repository type extending Repo<M, F, C>
|
|
65
|
+
* @template V - The relations metadata type extending RelationsMetadata
|
|
66
|
+
* @template F - The repository flags type
|
|
67
|
+
* @template C - The context type extending Context<F>
|
|
68
|
+
* @param {R} this - The repository instance
|
|
69
|
+
* @param {Context<F>} context - The context for the operation
|
|
70
|
+
* @param {V} data - The metadata for the property
|
|
71
|
+
* @param key - The property key to store the user identifier
|
|
72
|
+
* @param {M} model - The model instance being created or updated
|
|
73
|
+
* @return {Promise<void>} A promise that rejects with an AuthorizationError if user identification is not supported
|
|
74
|
+
* @function createdByOnCreateUpdate
|
|
75
|
+
* @memberOf module:core
|
|
76
|
+
*/
|
|
77
|
+
export declare function createdByOnCreateUpdate<M extends Model, R extends Repo<M>>(this: R, context: ContextOf<R>, data: RelationsMetadata, key: keyof M, model: M): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* @description Tracks the creator of a model instance
|
|
80
|
+
* @summary Decorator that marks a property to store the identifier of the user who created the model instance
|
|
81
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
82
|
+
* @function createdBy
|
|
83
|
+
* @category Property Decorators
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* class Document extends BaseModel {
|
|
87
|
+
* @createdBy()
|
|
88
|
+
* creator!: string;
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function createdBy(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
93
|
+
/**
|
|
94
|
+
* @description Tracks the last updater of a model instance
|
|
95
|
+
* @summary Decorator that marks a property to store the identifier of the user who last updated the model instance
|
|
96
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
97
|
+
* @function updatedBy
|
|
98
|
+
* @category Property Decorators
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* class Document extends BaseModel {
|
|
102
|
+
* @updatedBy()
|
|
103
|
+
* lastEditor!: string;
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export declare function updatedBy(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
108
|
+
export declare function createdAt(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
109
|
+
export declare function updatedAt(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
110
|
+
export declare function persistentVersion(): (target: any, propertyKey?: any) => any;
|
|
111
|
+
export declare function version(persistent?: boolean): (target: any, propertyKey?: any) => any;
|
|
112
|
+
export declare function getPkTypes(model: Constructor | (() => Constructor)): (() => any)[];
|
|
113
|
+
/**
|
|
114
|
+
* @description Defines a one-to-one relationship between models
|
|
115
|
+
* @summary Decorator that establishes a one-to-one relationship between the current model and another model
|
|
116
|
+
* @template M - The related model type extending Model
|
|
117
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
118
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
119
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
120
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
121
|
+
* @function oneToOne
|
|
122
|
+
* @category Property Decorators
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* class User extends BaseModel {
|
|
126
|
+
* @oneToOne(Profile)
|
|
127
|
+
* profile!: string | Profile;
|
|
128
|
+
* }
|
|
129
|
+
*
|
|
130
|
+
* class Profile extends BaseModel {
|
|
131
|
+
* @required()
|
|
132
|
+
* bio!: string;
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
* @see oneToMany
|
|
136
|
+
* @see manyToOne
|
|
137
|
+
*/
|
|
138
|
+
export declare function oneToOne<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinColumnOpts?: JoinColumnOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
139
|
+
/**
|
|
140
|
+
* @description Defines a one-to-many relationship between models
|
|
141
|
+
* @summary Decorator that establishes a one-to-many relationship between the current model and multiple instances of another model
|
|
142
|
+
* @template M - The related model type extending Model
|
|
143
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
144
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
145
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
146
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
147
|
+
* @function oneToMany
|
|
148
|
+
* @category Property Decorators
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* class Author extends BaseModel {
|
|
152
|
+
* @required()
|
|
153
|
+
* name!: string;
|
|
154
|
+
*
|
|
155
|
+
* @oneToMany(Book)
|
|
156
|
+
* books!: string[] | Book[];
|
|
157
|
+
* }
|
|
158
|
+
*
|
|
159
|
+
* class Book extends BaseModel {
|
|
160
|
+
* @required()
|
|
161
|
+
* title!: string;
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
* @see oneToOne
|
|
165
|
+
* @see manyToOne
|
|
166
|
+
*/
|
|
167
|
+
export declare function oneToMany<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinTableOpts?: JoinTableOptions | JoinTableMultipleColumnsOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
168
|
+
/**
|
|
169
|
+
* @description Defines a many-to-one relationship between models
|
|
170
|
+
* @summary Decorator that establishes a many-to-one relationship between multiple instances of the current model and another model
|
|
171
|
+
* @template M - The related model type extending Model
|
|
172
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
173
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
174
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
175
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
176
|
+
* @function manyToOne
|
|
177
|
+
* @category Property Decorators
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* class Book extends BaseModel {
|
|
181
|
+
* @required()
|
|
182
|
+
* title!: string;
|
|
183
|
+
*
|
|
184
|
+
* @manyToOne(Author)
|
|
185
|
+
* author!: string | Author;
|
|
186
|
+
* }
|
|
187
|
+
*
|
|
188
|
+
* class Author extends BaseModel {
|
|
189
|
+
* @required()
|
|
190
|
+
* name!: string;
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
193
|
+
* @see oneToMany
|
|
194
|
+
* @see oneToOne
|
|
195
|
+
*/
|
|
196
|
+
export declare function manyToOne<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinTableOpts?: JoinTableOptions | JoinTableMultipleColumnsOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
197
|
+
/**
|
|
198
|
+
* @description Defines a many-to-one relationship between models
|
|
199
|
+
* @summary Decorator that establishes a many-to-one relationship between multiple instances of the current model and another model
|
|
200
|
+
* @template M - The related model type extending Model
|
|
201
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
202
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
203
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
204
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
205
|
+
* @function manyToOne
|
|
206
|
+
* @category Property Decorators
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* class Book extends BaseModel {
|
|
210
|
+
* @required()
|
|
211
|
+
* title!: string;
|
|
212
|
+
*
|
|
213
|
+
* @manyToOne(Author)
|
|
214
|
+
* author!: string | Author;
|
|
215
|
+
* }
|
|
216
|
+
*
|
|
217
|
+
* class Author extends BaseModel {
|
|
218
|
+
* @required()
|
|
219
|
+
* name!: string;
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
* @see oneToMany
|
|
223
|
+
* @see oneToOne
|
|
224
|
+
*/
|
|
225
|
+
export declare function manyToMany<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinTableOpts?: JoinTableOptions | JoinTableMultipleColumnsOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
226
|
+
export declare function noValidateOn(...ops: OperationKeys[]): (target: any, propertyKey?: any) => void;
|
|
227
|
+
export declare function noValidateOnCreate(): (target: any, propertyKey?: any) => void;
|
|
228
|
+
export declare function noValidateOnUpdate(): (target: any, propertyKey?: any) => void;
|
|
229
|
+
export declare function noValidateOnCreateUpdate(): (target: any, propertyKey?: any) => void;
|
|
230
|
+
/**
|
|
231
|
+
* @description Specifies the model property as a relation
|
|
232
|
+
* @summary Decorator that specifies the model property as a relation in the database
|
|
233
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
234
|
+
* @function relation
|
|
235
|
+
* @category Property Decorators
|
|
236
|
+
*/
|
|
237
|
+
export declare function relation(relationKey: string, meta: RelationsMetadata): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { OperationKeys } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
3
|
+
import { CascadeMetadata } from "../repository/types.js";
|
|
4
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
5
|
+
import type { Repo } from "../repository/Repository.js";
|
|
6
|
+
import { JoinColumnOptions, JoinTableMultipleColumnsOptions, JoinTableOptions, RelationsMetadata } from "./types.js";
|
|
7
|
+
import { ContextOf } from "../persistence/types.js";
|
|
8
|
+
/**
|
|
9
|
+
* @description Specifies the database table name for a model
|
|
10
|
+
* @summary Decorator that sets the table name for a model class in the database
|
|
11
|
+
* @param {string} opts - The name of the table in the database
|
|
12
|
+
* @return {Function} A decorator function that can be applied to a class
|
|
13
|
+
* @function table
|
|
14
|
+
* @category Class Decorators
|
|
15
|
+
*/
|
|
16
|
+
export declare function table<OPTS = string>(opts?: OPTS): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
17
|
+
/**
|
|
18
|
+
* @description Specifies the database column name for a model property
|
|
19
|
+
* @summary Decorator that maps a model property to a specific column name in the database
|
|
20
|
+
* @param {string} columnName - The name of the column in the database
|
|
21
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
22
|
+
* @function column
|
|
23
|
+
* @category Property Decorators
|
|
24
|
+
*/
|
|
25
|
+
export declare function column<OPTS = string>(columnName?: OPTS): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
26
|
+
/**
|
|
27
|
+
* @description Enforces uniqueness constraint during model creation and update
|
|
28
|
+
* @summary Internal function used by the unique decorator to check if a property value already exists in the database
|
|
29
|
+
* @template M - The model type extending Model
|
|
30
|
+
* @template R - The repository type extending Repo<M, F, C>
|
|
31
|
+
* @template V - The metadata type
|
|
32
|
+
* @template F - The repository flags type
|
|
33
|
+
* @template C - The context type extending Context<F>
|
|
34
|
+
* @param {R} this - The repository instance
|
|
35
|
+
* @param {Context<F>} context - The context for the operation
|
|
36
|
+
* @param {V} data - The metadata for the property
|
|
37
|
+
* @param key - The property key to check for uniqueness
|
|
38
|
+
* @param {M} model - The model instance being created or updated
|
|
39
|
+
* @return {Promise<void>} A promise that resolves when the check is complete or rejects with a ConflictError
|
|
40
|
+
* @function uniqueOnCreateUpdate
|
|
41
|
+
* @memberOf module:core
|
|
42
|
+
*/
|
|
43
|
+
export declare function uniqueOnCreateUpdate<M extends Model, R extends Repo<M>>(this: R, context: ContextOf<R>, data: object, key: keyof M, model: M): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* @description Tags a property as unique
|
|
46
|
+
* @summary Decorator that ensures a property value is unique across all instances of a model in the database
|
|
47
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
48
|
+
* @function unique
|
|
49
|
+
* @category Property Decorators
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* class User extends BaseModel {
|
|
53
|
+
* @unique()
|
|
54
|
+
* @required()
|
|
55
|
+
* username!: string;
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function unique(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
60
|
+
/**
|
|
61
|
+
* @description Handles user identification for ownership tracking
|
|
62
|
+
* @summary Internal function used by the createdBy and updatedBy decorators to set ownership information
|
|
63
|
+
* @template M - The model type extending Model
|
|
64
|
+
* @template R - The repository type extending Repo<M, F, C>
|
|
65
|
+
* @template V - The relations metadata type extending RelationsMetadata
|
|
66
|
+
* @template F - The repository flags type
|
|
67
|
+
* @template C - The context type extending Context<F>
|
|
68
|
+
* @param {R} this - The repository instance
|
|
69
|
+
* @param {Context<F>} context - The context for the operation
|
|
70
|
+
* @param {V} data - The metadata for the property
|
|
71
|
+
* @param key - The property key to store the user identifier
|
|
72
|
+
* @param {M} model - The model instance being created or updated
|
|
73
|
+
* @return {Promise<void>} A promise that rejects with an AuthorizationError if user identification is not supported
|
|
74
|
+
* @function createdByOnCreateUpdate
|
|
75
|
+
* @memberOf module:core
|
|
76
|
+
*/
|
|
77
|
+
export declare function createdByOnCreateUpdate<M extends Model, R extends Repo<M>>(this: R, context: ContextOf<R>, data: RelationsMetadata, key: keyof M, model: M): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* @description Tracks the creator of a model instance
|
|
80
|
+
* @summary Decorator that marks a property to store the identifier of the user who created the model instance
|
|
81
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
82
|
+
* @function createdBy
|
|
83
|
+
* @category Property Decorators
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* class Document extends BaseModel {
|
|
87
|
+
* @createdBy()
|
|
88
|
+
* creator!: string;
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function createdBy(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
93
|
+
/**
|
|
94
|
+
* @description Tracks the last updater of a model instance
|
|
95
|
+
* @summary Decorator that marks a property to store the identifier of the user who last updated the model instance
|
|
96
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
97
|
+
* @function updatedBy
|
|
98
|
+
* @category Property Decorators
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* class Document extends BaseModel {
|
|
102
|
+
* @updatedBy()
|
|
103
|
+
* lastEditor!: string;
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export declare function updatedBy(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
108
|
+
export declare function createdAt(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
109
|
+
export declare function updatedAt(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
110
|
+
export declare function persistentVersion(): (target: any, propertyKey?: any) => any;
|
|
111
|
+
export declare function version(persistent?: boolean): (target: any, propertyKey?: any) => any;
|
|
112
|
+
export declare function getPkTypes(model: Constructor | (() => Constructor)): (() => any)[];
|
|
113
|
+
/**
|
|
114
|
+
* @description Defines a one-to-one relationship between models
|
|
115
|
+
* @summary Decorator that establishes a one-to-one relationship between the current model and another model
|
|
116
|
+
* @template M - The related model type extending Model
|
|
117
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
118
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
119
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
120
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
121
|
+
* @function oneToOne
|
|
122
|
+
* @category Property Decorators
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* class User extends BaseModel {
|
|
126
|
+
* @oneToOne(Profile)
|
|
127
|
+
* profile!: string | Profile;
|
|
128
|
+
* }
|
|
129
|
+
*
|
|
130
|
+
* class Profile extends BaseModel {
|
|
131
|
+
* @required()
|
|
132
|
+
* bio!: string;
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
* @see oneToMany
|
|
136
|
+
* @see manyToOne
|
|
137
|
+
*/
|
|
138
|
+
export declare function oneToOne<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinColumnOpts?: JoinColumnOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
139
|
+
/**
|
|
140
|
+
* @description Defines a one-to-many relationship between models
|
|
141
|
+
* @summary Decorator that establishes a one-to-many relationship between the current model and multiple instances of another model
|
|
142
|
+
* @template M - The related model type extending Model
|
|
143
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
144
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
145
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
146
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
147
|
+
* @function oneToMany
|
|
148
|
+
* @category Property Decorators
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* class Author extends BaseModel {
|
|
152
|
+
* @required()
|
|
153
|
+
* name!: string;
|
|
154
|
+
*
|
|
155
|
+
* @oneToMany(Book)
|
|
156
|
+
* books!: string[] | Book[];
|
|
157
|
+
* }
|
|
158
|
+
*
|
|
159
|
+
* class Book extends BaseModel {
|
|
160
|
+
* @required()
|
|
161
|
+
* title!: string;
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
* @see oneToOne
|
|
165
|
+
* @see manyToOne
|
|
166
|
+
*/
|
|
167
|
+
export declare function oneToMany<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinTableOpts?: JoinTableOptions | JoinTableMultipleColumnsOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
168
|
+
/**
|
|
169
|
+
* @description Defines a many-to-one relationship between models
|
|
170
|
+
* @summary Decorator that establishes a many-to-one relationship between multiple instances of the current model and another model
|
|
171
|
+
* @template M - The related model type extending Model
|
|
172
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
173
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
174
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
175
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
176
|
+
* @function manyToOne
|
|
177
|
+
* @category Property Decorators
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* class Book extends BaseModel {
|
|
181
|
+
* @required()
|
|
182
|
+
* title!: string;
|
|
183
|
+
*
|
|
184
|
+
* @manyToOne(Author)
|
|
185
|
+
* author!: string | Author;
|
|
186
|
+
* }
|
|
187
|
+
*
|
|
188
|
+
* class Author extends BaseModel {
|
|
189
|
+
* @required()
|
|
190
|
+
* name!: string;
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
193
|
+
* @see oneToMany
|
|
194
|
+
* @see oneToOne
|
|
195
|
+
*/
|
|
196
|
+
export declare function manyToOne<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinTableOpts?: JoinTableOptions | JoinTableMultipleColumnsOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
197
|
+
/**
|
|
198
|
+
* @description Defines a many-to-one relationship between models
|
|
199
|
+
* @summary Decorator that establishes a many-to-one relationship between multiple instances of the current model and another model
|
|
200
|
+
* @template M - The related model type extending Model
|
|
201
|
+
* @param {Constructor<M>} clazz - The constructor of the related model class
|
|
202
|
+
* @param {CascadeMetadata} [cascadeOptions=DefaultCascade] - Options for cascading operations (create, update, delete)
|
|
203
|
+
* @param {boolean} [populate=true] - If true, automatically populates the relationship when the model is retrieved
|
|
204
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
205
|
+
* @function manyToOne
|
|
206
|
+
* @category Property Decorators
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* class Book extends BaseModel {
|
|
210
|
+
* @required()
|
|
211
|
+
* title!: string;
|
|
212
|
+
*
|
|
213
|
+
* @manyToOne(Author)
|
|
214
|
+
* author!: string | Author;
|
|
215
|
+
* }
|
|
216
|
+
*
|
|
217
|
+
* class Author extends BaseModel {
|
|
218
|
+
* @required()
|
|
219
|
+
* name!: string;
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
* @see oneToMany
|
|
223
|
+
* @see oneToOne
|
|
224
|
+
*/
|
|
225
|
+
export declare function manyToMany<M extends Model>(clazz: Constructor<M> | (() => Constructor<M>), cascadeOptions?: CascadeMetadata, populate?: boolean, joinTableOpts?: JoinTableOptions | JoinTableMultipleColumnsOptions, fk?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
226
|
+
export declare function noValidateOn(...ops: OperationKeys[]): (target: any, propertyKey?: any) => void;
|
|
227
|
+
export declare function noValidateOnCreate(): (target: any, propertyKey?: any) => void;
|
|
228
|
+
export declare function noValidateOnUpdate(): (target: any, propertyKey?: any) => void;
|
|
229
|
+
export declare function noValidateOnCreateUpdate(): (target: any, propertyKey?: any) => void;
|
|
230
|
+
/**
|
|
231
|
+
* @description Specifies the model property as a relation
|
|
232
|
+
* @summary Decorator that specifies the model property as a relation in the database
|
|
233
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
234
|
+
* @function relation
|
|
235
|
+
* @category Property Decorators
|
|
236
|
+
*/
|
|
237
|
+
export declare function relation(relationKey: string, meta: RelationsMetadata): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Exports for the model module.
|
|
3
|
+
* @summary This file exports all the necessary components for the model functionality, including the BaseModel, construction utilities, decorators, and more.
|
|
4
|
+
* @module core/model
|
|
5
|
+
*/
|
|
6
|
+
export * from "./BaseModel.cjs";
|
|
7
|
+
export * from "./construction.cjs";
|
|
8
|
+
export * from "./decorators.cjs";
|
|
9
|
+
export * from "./indexing.cjs";
|
|
10
|
+
export * from "./SequenceModel.cjs";
|
|
11
|
+
export * from "./types.cjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Exports for the model module.
|
|
3
|
+
* @summary This file exports all the necessary components for the model functionality, including the BaseModel, construction utilities, decorators, and more.
|
|
4
|
+
* @module core/model
|
|
5
|
+
*/
|
|
6
|
+
export * from "./BaseModel.js";
|
|
7
|
+
export * from "./construction.js";
|
|
8
|
+
export * from "./decorators.js";
|
|
9
|
+
export * from "./indexing.js";
|
|
10
|
+
export * from "./SequenceModel.js";
|
|
11
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OrderDirection } from "../repository/constants.cjs";
|
|
2
|
+
import { propMetadata } from "@decaf-ts/decoration";
|
|
3
|
+
/**
|
|
4
|
+
* @description Creates an index on a model property for improved query performance
|
|
5
|
+
* @summary Decorator that marks a property to be indexed in the database, optionally with specific directions and compositions
|
|
6
|
+
* @param {OrderDirection[]} [directions] - Optional array of sort directions for the index
|
|
7
|
+
* @param {string[]} [compositions] - Optional array of property names to create a composite index
|
|
8
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
9
|
+
* @function index
|
|
10
|
+
* @category Property Decorators
|
|
11
|
+
*/
|
|
12
|
+
export declare function index(): ReturnType<typeof propMetadata>;
|
|
13
|
+
export declare function index(name: string): ReturnType<typeof propMetadata>;
|
|
14
|
+
export declare function index(directions: OrderDirection[]): ReturnType<typeof propMetadata>;
|
|
15
|
+
export declare function index(directions: OrderDirection[], name: string): ReturnType<typeof propMetadata>;
|
|
16
|
+
export declare function index(directions: OrderDirection[], compositions: string[]): ReturnType<typeof propMetadata>;
|
|
17
|
+
export declare function index(directions: readonly OrderDirection[], compositions: readonly string[]): ReturnType<typeof propMetadata>;
|
|
18
|
+
export declare function index(directions: readonly OrderDirection[], compositions: readonly string[], name: string): ReturnType<typeof propMetadata>;
|
|
19
|
+
export declare function index(compositions: string[]): ReturnType<typeof propMetadata>;
|
|
20
|
+
export declare function index(compositions: string[], name: string): ReturnType<typeof propMetadata>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OrderDirection } from "../repository/constants.js";
|
|
2
|
+
import { propMetadata } from "@decaf-ts/decoration";
|
|
3
|
+
/**
|
|
4
|
+
* @description Creates an index on a model property for improved query performance
|
|
5
|
+
* @summary Decorator that marks a property to be indexed in the database, optionally with specific directions and compositions
|
|
6
|
+
* @param {OrderDirection[]} [directions] - Optional array of sort directions for the index
|
|
7
|
+
* @param {string[]} [compositions] - Optional array of property names to create a composite index
|
|
8
|
+
* @return {Function} A decorator function that can be applied to a class property
|
|
9
|
+
* @function index
|
|
10
|
+
* @category Property Decorators
|
|
11
|
+
*/
|
|
12
|
+
export declare function index(): ReturnType<typeof propMetadata>;
|
|
13
|
+
export declare function index(name: string): ReturnType<typeof propMetadata>;
|
|
14
|
+
export declare function index(directions: OrderDirection[]): ReturnType<typeof propMetadata>;
|
|
15
|
+
export declare function index(directions: OrderDirection[], name: string): ReturnType<typeof propMetadata>;
|
|
16
|
+
export declare function index(directions: OrderDirection[], compositions: string[]): ReturnType<typeof propMetadata>;
|
|
17
|
+
export declare function index(directions: readonly OrderDirection[], compositions: readonly string[]): ReturnType<typeof propMetadata>;
|
|
18
|
+
export declare function index(directions: readonly OrderDirection[], compositions: readonly string[], name: string): ReturnType<typeof propMetadata>;
|
|
19
|
+
export declare function index(compositions: string[]): ReturnType<typeof propMetadata>;
|
|
20
|
+
export declare function index(compositions: string[], name: string): ReturnType<typeof propMetadata>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
2
|
+
import { CascadeMetadata } from "../repository/index.cjs";
|
|
3
|
+
import { PersistenceKeys } from "../persistence/constants.cjs";
|
|
4
|
+
/**
|
|
5
|
+
* Describes join column options.
|
|
6
|
+
*/
|
|
7
|
+
export type JoinColumnOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Name of the column.
|
|
10
|
+
*/
|
|
11
|
+
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Name of the column in the entity to which this column is referenced.
|
|
14
|
+
*/
|
|
15
|
+
referencedColumnName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Name of the foreign key constraint.
|
|
18
|
+
*/
|
|
19
|
+
foreignKeyConstraintName?: string;
|
|
20
|
+
};
|
|
21
|
+
export type JoinTableOptions = {
|
|
22
|
+
/**
|
|
23
|
+
* Name of the table that will be created to store values of the both tables (join table).
|
|
24
|
+
* By default is auto generated.
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
27
|
+
/**
|
|
28
|
+
* First column of the join table.
|
|
29
|
+
*/
|
|
30
|
+
joinColumn?: JoinColumnOptions;
|
|
31
|
+
/**
|
|
32
|
+
* Second (inverse) column of the join table.
|
|
33
|
+
*/
|
|
34
|
+
inverseJoinColumn?: JoinColumnOptions;
|
|
35
|
+
};
|
|
36
|
+
export type JoinTableMultipleColumnsOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* Name of the table that will be created to store values of the both tables (join table).
|
|
39
|
+
* By default is auto generated.
|
|
40
|
+
*/
|
|
41
|
+
name?: string;
|
|
42
|
+
/**
|
|
43
|
+
* First column of the join table.
|
|
44
|
+
*/
|
|
45
|
+
joinColumns?: JoinColumnOptions[];
|
|
46
|
+
/**
|
|
47
|
+
* Second (inverse) column of the join table.
|
|
48
|
+
*/
|
|
49
|
+
inverseJoinColumns?: JoinColumnOptions[];
|
|
50
|
+
};
|
|
51
|
+
export type RelationsMetadata = {
|
|
52
|
+
class: Constructor<any> | (() => Constructor<any>);
|
|
53
|
+
cascade: CascadeMetadata;
|
|
54
|
+
populate: boolean;
|
|
55
|
+
name?: string;
|
|
56
|
+
joinTable?: JoinTableOptions;
|
|
57
|
+
};
|
|
58
|
+
export type ExtendedRelationsMetadata = RelationsMetadata & {
|
|
59
|
+
key: PersistenceKeys.ONE_TO_ONE | PersistenceKeys.ONE_TO_MANY | PersistenceKeys.MANY_TO_ONE | PersistenceKeys.MANY_TO_MANY;
|
|
60
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
2
|
+
import { CascadeMetadata } from "../repository/index.js";
|
|
3
|
+
import { PersistenceKeys } from "../persistence/constants.js";
|
|
4
|
+
/**
|
|
5
|
+
* Describes join column options.
|
|
6
|
+
*/
|
|
7
|
+
export type JoinColumnOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Name of the column.
|
|
10
|
+
*/
|
|
11
|
+
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Name of the column in the entity to which this column is referenced.
|
|
14
|
+
*/
|
|
15
|
+
referencedColumnName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Name of the foreign key constraint.
|
|
18
|
+
*/
|
|
19
|
+
foreignKeyConstraintName?: string;
|
|
20
|
+
};
|
|
21
|
+
export type JoinTableOptions = {
|
|
22
|
+
/**
|
|
23
|
+
* Name of the table that will be created to store values of the both tables (join table).
|
|
24
|
+
* By default is auto generated.
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
27
|
+
/**
|
|
28
|
+
* First column of the join table.
|
|
29
|
+
*/
|
|
30
|
+
joinColumn?: JoinColumnOptions;
|
|
31
|
+
/**
|
|
32
|
+
* Second (inverse) column of the join table.
|
|
33
|
+
*/
|
|
34
|
+
inverseJoinColumn?: JoinColumnOptions;
|
|
35
|
+
};
|
|
36
|
+
export type JoinTableMultipleColumnsOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* Name of the table that will be created to store values of the both tables (join table).
|
|
39
|
+
* By default is auto generated.
|
|
40
|
+
*/
|
|
41
|
+
name?: string;
|
|
42
|
+
/**
|
|
43
|
+
* First column of the join table.
|
|
44
|
+
*/
|
|
45
|
+
joinColumns?: JoinColumnOptions[];
|
|
46
|
+
/**
|
|
47
|
+
* Second (inverse) column of the join table.
|
|
48
|
+
*/
|
|
49
|
+
inverseJoinColumns?: JoinColumnOptions[];
|
|
50
|
+
};
|
|
51
|
+
export type RelationsMetadata = {
|
|
52
|
+
class: Constructor<any> | (() => Constructor<any>);
|
|
53
|
+
cascade: CascadeMetadata;
|
|
54
|
+
populate: boolean;
|
|
55
|
+
name?: string;
|
|
56
|
+
joinTable?: JoinTableOptions;
|
|
57
|
+
};
|
|
58
|
+
export type ExtendedRelationsMetadata = RelationsMetadata & {
|
|
59
|
+
key: PersistenceKeys.ONE_TO_ONE | PersistenceKeys.ONE_TO_MANY | PersistenceKeys.MANY_TO_ONE | PersistenceKeys.MANY_TO_MANY;
|
|
60
|
+
};
|