@warlock.js/core 4.0.162 → 4.0.164
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/esm/benchmark/index.d.ts +7 -0
- package/esm/benchmark/index.d.ts.map +1 -0
- package/esm/benchmark/profiler.d.ts +63 -0
- package/esm/benchmark/profiler.d.ts.map +1 -0
- package/esm/benchmark/profiler.js +155 -0
- package/esm/benchmark/profiler.js.map +1 -0
- package/esm/benchmark/types.d.ts +167 -0
- package/esm/benchmark/types.d.ts.map +1 -0
- package/esm/bootstrap/setup.d.ts +2 -0
- package/esm/bootstrap/setup.d.ts.map +1 -0
- package/esm/bootstrap/setup.js +14 -0
- package/esm/bootstrap/setup.js.map +1 -0
- package/esm/bootstrap.d.ts +2 -0
- package/esm/bootstrap.d.ts.map +1 -0
- package/esm/bootstrap.js +5 -0
- package/esm/bootstrap.js.map +1 -0
- package/esm/cache/database-cache-driver.d.ts +56 -0
- package/esm/cache/database-cache-driver.d.ts.map +1 -0
- package/esm/cache/database-cache-driver.js +112 -0
- package/esm/cache/database-cache-driver.js.map +1 -0
- package/esm/cache/index.d.ts +3 -0
- package/esm/cache/index.d.ts.map +1 -0
- package/esm/cache/index.js +1 -0
- package/esm/cache/index.js.map +1 -0
- package/esm/cli/cli-command.d.ts +115 -0
- package/esm/cli/cli-command.d.ts.map +1 -0
- package/esm/cli/cli-command.js +227 -0
- package/esm/cli/cli-command.js.map +1 -0
- package/esm/cli/cli-commands.manager.d.ts +71 -0
- package/esm/cli/cli-commands.manager.d.ts.map +1 -0
- package/esm/cli/cli-commands.manager.js +362 -0
- package/esm/cli/cli-commands.manager.js.map +1 -0
- package/esm/cli/cli-commands.utils.d.ts +69 -0
- package/esm/cli/cli-commands.utils.d.ts.map +1 -0
- package/esm/cli/cli-commands.utils.js +180 -0
- package/esm/cli/cli-commands.utils.js.map +1 -0
- package/esm/cli/commands/add.command.d.ts +2 -0
- package/esm/cli/commands/add.command.d.ts.map +1 -0
- package/esm/cli/commands/add.command.js +15 -0
- package/esm/cli/commands/add.command.js.map +1 -0
- package/esm/cli/commands/build.command.d.ts +2 -0
- package/esm/cli/commands/build.command.d.ts.map +1 -0
- package/esm/cli/commands/build.command.js +8 -0
- package/esm/cli/commands/build.command.js.map +1 -0
- package/esm/cli/commands/create-database.command.d.ts +2 -0
- package/esm/cli/commands/create-database.command.d.ts.map +1 -0
- package/esm/cli/commands/create-database.command.js +18 -0
- package/esm/cli/commands/create-database.command.js.map +1 -0
- package/esm/cli/commands/dev-server.command.d.ts +2 -0
- package/esm/cli/commands/dev-server.command.d.ts.map +1 -0
- package/esm/cli/commands/dev-server.command.js +18 -0
- package/esm/cli/commands/dev-server.command.js.map +1 -0
- package/esm/cli/commands/drop-tables.command.d.ts +2 -0
- package/esm/cli/commands/drop-tables.command.d.ts.map +1 -0
- package/esm/cli/commands/drop-tables.command.js +17 -0
- package/esm/cli/commands/drop-tables.command.js.map +1 -0
- package/esm/cli/commands/generate/generate.command.d.ts +10 -0
- package/esm/cli/commands/generate/generate.command.d.ts.map +1 -0
- package/esm/cli/commands/generate/generate.command.js +188 -0
- package/esm/cli/commands/generate/generate.command.js.map +1 -0
- package/esm/cli/commands/generate/generators/column-dsl-parser.d.ts +11 -0
- package/esm/cli/commands/generate/generators/column-dsl-parser.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/column-dsl-parser.js +47 -0
- package/esm/cli/commands/generate/generators/column-dsl-parser.js.map +1 -0
- package/esm/cli/commands/generate/generators/controller.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/controller.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/controller.generator.js +51 -0
- package/esm/cli/commands/generate/generators/controller.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/migration.generator.d.ts +13 -0
- package/esm/cli/commands/generate/generators/migration.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/migration.generator.js +82 -0
- package/esm/cli/commands/generate/generators/migration.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/model.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/model.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/model.generator.js +58 -0
- package/esm/cli/commands/generate/generators/model.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/module.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/module.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/module.generator.js +149 -0
- package/esm/cli/commands/generate/generators/module.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/repository.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/repository.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/repository.generator.js +37 -0
- package/esm/cli/commands/generate/generators/repository.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/resource.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/resource.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/resource.generator.js +37 -0
- package/esm/cli/commands/generate/generators/resource.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/service.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/service.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/service.generator.js +37 -0
- package/esm/cli/commands/generate/generators/service.generator.js.map +1 -0
- package/esm/cli/commands/generate/generators/validation.generator.d.ts +3 -0
- package/esm/cli/commands/generate/generators/validation.generator.d.ts.map +1 -0
- package/esm/cli/commands/generate/generators/validation.generator.js +46 -0
- package/esm/cli/commands/generate/generators/validation.generator.js.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.d.ts +129 -0
- package/esm/cli/commands/generate/templates/stubs.d.ts.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.js +528 -0
- package/esm/cli/commands/generate/templates/stubs.js.map +1 -0
- package/esm/cli/commands/generate/types.d.ts +53 -0
- package/esm/cli/commands/generate/types.d.ts.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.d.ts +40 -0
- package/esm/cli/commands/generate/utils/name-parser.d.ts.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.js +65 -0
- package/esm/cli/commands/generate/utils/name-parser.js.map +1 -0
- package/esm/cli/commands/generate/utils/path-resolver.d.ts +30 -0
- package/esm/cli/commands/generate/utils/path-resolver.d.ts.map +1 -0
- package/esm/cli/commands/generate/utils/path-resolver.js +42 -0
- package/esm/cli/commands/generate/utils/path-resolver.js.map +1 -0
- package/esm/cli/commands/generate/utils/prompt.d.ts +13 -0
- package/esm/cli/commands/generate/utils/prompt.d.ts.map +1 -0
- package/esm/cli/commands/generate/utils/prompt.js +21 -0
- package/esm/cli/commands/generate/utils/prompt.js.map +1 -0
- package/esm/cli/commands/migrate.command.d.ts +2 -0
- package/esm/cli/commands/migrate.command.d.ts.map +1 -0
- package/esm/cli/commands/migrate.command.js +52 -0
- package/esm/cli/commands/migrate.command.js.map +1 -0
- package/esm/cli/commands/seed.command.d.ts +2 -0
- package/esm/cli/commands/seed.command.d.ts.map +1 -0
- package/esm/cli/commands/seed.command.js +24 -0
- package/esm/cli/commands/seed.command.js.map +1 -0
- package/esm/cli/commands/start-production.command.d.ts +2 -0
- package/esm/cli/commands/start-production.command.d.ts.map +1 -0
- package/esm/cli/commands/start-production.command.js +65 -0
- package/esm/cli/commands/start-production.command.js.map +1 -0
- package/esm/cli/commands/storage-put.action.d.ts +22 -0
- package/esm/cli/commands/storage-put.action.d.ts.map +1 -0
- package/esm/cli/commands/storage-put.action.js +75 -0
- package/esm/cli/commands/storage-put.action.js.map +1 -0
- package/esm/cli/commands/storage-put.command.d.ts +20 -0
- package/esm/cli/commands/storage-put.command.d.ts.map +1 -0
- package/esm/cli/commands/storage-put.command.js +41 -0
- package/esm/cli/commands/storage-put.command.js.map +1 -0
- package/esm/cli/commands/typings-generator.command.d.ts +2 -0
- package/esm/cli/commands/typings-generator.command.d.ts.map +1 -0
- package/esm/cli/commands/typings-generator.command.js +37 -0
- package/esm/cli/commands/typings-generator.command.js.map +1 -0
- package/esm/cli/commands-loader.d.ts +18 -0
- package/esm/cli/commands-loader.d.ts.map +1 -0
- package/esm/cli/commands-loader.js +45 -0
- package/esm/cli/commands-loader.js.map +1 -0
- package/esm/cli/framework-cli-commands.d.ts +2 -0
- package/esm/cli/framework-cli-commands.d.ts.map +1 -0
- package/esm/cli/framework-cli-commands.js +27 -0
- package/esm/cli/framework-cli-commands.js.map +1 -0
- package/esm/cli/index.d.ts +3 -0
- package/esm/cli/index.d.ts.map +1 -0
- package/esm/cli/index.js +1 -0
- package/esm/cli/index.js.map +1 -0
- package/esm/cli/parse-cli-args.d.ts +18 -0
- package/esm/cli/parse-cli-args.d.ts.map +1 -0
- package/esm/cli/parse-cli-args.js +82 -0
- package/esm/cli/parse-cli-args.js.map +1 -0
- package/esm/cli/start.d.ts +2 -0
- package/esm/cli/start.d.ts.map +1 -0
- package/esm/cli/start.js +2 -0
- package/esm/cli/start.js.map +1 -0
- package/esm/cli/string-similarity.d.ts +44 -0
- package/esm/cli/string-similarity.d.ts.map +1 -0
- package/esm/cli/string-similarity.js +57 -0
- package/esm/cli/string-similarity.js.map +1 -0
- package/esm/cli/types.d.ts +218 -0
- package/esm/cli/types.d.ts.map +1 -0
- package/esm/config/config-getter.d.ts +35 -0
- package/esm/config/config-getter.d.ts.map +1 -0
- package/esm/config/config-getter.js +21 -0
- package/esm/config/config-getter.js.map +1 -0
- package/esm/config/config-handlers.d.ts +7 -0
- package/esm/config/config-handlers.d.ts.map +1 -0
- package/esm/config/config-handlers.js +19 -0
- package/esm/config/config-handlers.js.map +1 -0
- package/esm/config/config-loader.d.ts +37 -0
- package/esm/config/config-loader.d.ts.map +1 -0
- package/esm/config/config-loader.js +85 -0
- package/esm/config/config-loader.js.map +1 -0
- package/esm/config/config-manager.d.ts +22 -0
- package/esm/config/config-manager.d.ts.map +1 -0
- package/esm/config/config-manager.js +25 -0
- package/esm/config/config-manager.js.map +1 -0
- package/esm/config/config-special-handlers.d.ts +17 -0
- package/esm/config/config-special-handlers.d.ts.map +1 -0
- package/esm/config/config-special-handlers.js +23 -0
- package/esm/config/config-special-handlers.js.map +1 -0
- package/esm/config/index.d.ts +5 -0
- package/esm/config/index.d.ts.map +1 -0
- package/esm/config/load-config-files.d.ts +6 -0
- package/esm/config/load-config-files.d.ts.map +1 -0
- package/esm/config/load-config-files.js +19 -0
- package/esm/config/load-config-files.js.map +1 -0
- package/esm/config/types.d.ts +52 -0
- package/esm/config/types.d.ts.map +1 -0
- package/esm/connectors/base-connector.d.ts +49 -0
- package/esm/connectors/base-connector.d.ts.map +1 -0
- package/esm/connectors/base-connector.js +48 -0
- package/esm/connectors/base-connector.js.map +1 -0
- package/esm/connectors/cache-connector.d.ts +23 -0
- package/esm/connectors/cache-connector.d.ts.map +1 -0
- package/esm/connectors/cache-connector.js +35 -0
- package/esm/connectors/cache-connector.js.map +1 -0
- package/esm/connectors/communicator-connector.d.ts +23 -0
- package/esm/connectors/communicator-connector.d.ts.map +1 -0
- package/esm/connectors/communicator-connector.js +62 -0
- package/esm/connectors/communicator-connector.js.map +1 -0
- package/esm/connectors/connectors-manager.d.ts +42 -0
- package/esm/connectors/connectors-manager.d.ts.map +1 -0
- package/esm/connectors/connectors-manager.js +93 -0
- package/esm/connectors/connectors-manager.js.map +1 -0
- package/esm/connectors/database-connector.d.ts +23 -0
- package/esm/connectors/database-connector.d.ts.map +1 -0
- package/esm/connectors/database-connector.js +51 -0
- package/esm/connectors/database-connector.js.map +1 -0
- package/esm/connectors/http-connector.d.ts +31 -0
- package/esm/connectors/http-connector.d.ts.map +1 -0
- package/esm/connectors/http-connector.js +83 -0
- package/esm/connectors/http-connector.js.map +1 -0
- package/esm/connectors/index.d.ts +15 -0
- package/esm/connectors/index.d.ts.map +1 -0
- package/esm/connectors/logger-connector.d.ts +23 -0
- package/esm/connectors/logger-connector.d.ts.map +1 -0
- package/esm/connectors/logger-connector.js +45 -0
- package/esm/connectors/logger-connector.js.map +1 -0
- package/esm/connectors/mail-connector.d.ts +23 -0
- package/esm/connectors/mail-connector.d.ts.map +1 -0
- package/esm/connectors/mail-connector.js +45 -0
- package/esm/connectors/mail-connector.js.map +1 -0
- package/esm/connectors/storage.connector.d.ts +23 -0
- package/esm/connectors/storage.connector.d.ts.map +1 -0
- package/esm/connectors/storage.connector.js +30 -0
- package/esm/connectors/storage.connector.js.map +1 -0
- package/esm/connectors/types.d.ts +54 -0
- package/esm/connectors/types.d.ts.map +1 -0
- package/esm/connectors/types.js +13 -0
- package/esm/connectors/types.js.map +1 -0
- package/esm/database/create-database-action.d.ts +3 -0
- package/esm/database/create-database-action.d.ts.map +1 -0
- package/esm/database/create-database-action.js +28 -0
- package/esm/database/create-database-action.js.map +1 -0
- package/esm/database/drop-tables-action.d.ts +3 -0
- package/esm/database/drop-tables-action.d.ts.map +1 -0
- package/esm/database/drop-tables-action.js +29 -0
- package/esm/database/drop-tables-action.js.map +1 -0
- package/esm/database/index.d.ts +4 -0
- package/esm/database/index.d.ts.map +1 -0
- package/esm/database/migrate-action.d.ts +8 -0
- package/esm/database/migrate-action.d.ts.map +1 -0
- package/esm/database/migrate-action.js +118 -0
- package/esm/database/migrate-action.js.map +1 -0
- package/esm/database/models/database-log/database-log.d.ts +16 -0
- package/esm/database/models/database-log/database-log.d.ts.map +1 -0
- package/esm/database/models/database-log/database-log.js +17 -0
- package/esm/database/models/database-log/database-log.js.map +1 -0
- package/esm/database/models/database-log/index.d.ts +2 -0
- package/esm/database/models/database-log/index.d.ts.map +1 -0
- package/esm/database/seed-command-action.d.ts +3 -0
- package/esm/database/seed-command-action.d.ts.map +1 -0
- package/esm/database/seed-command-action.js +36 -0
- package/esm/database/seed-command-action.js.map +1 -0
- package/esm/database/seeds/index.d.ts +3 -0
- package/esm/database/seeds/index.d.ts.map +1 -0
- package/esm/database/seeds/seeder.d.ts +40 -0
- package/esm/database/seeds/seeder.d.ts.map +1 -0
- package/esm/database/seeds/seeder.js +6 -0
- package/esm/database/seeds/seeder.js.map +1 -0
- package/esm/database/seeds/seeders.manager.d.ts +47 -0
- package/esm/database/seeds/seeders.manager.d.ts.map +1 -0
- package/esm/database/seeds/seeders.manager.js +144 -0
- package/esm/database/seeds/seeders.manager.js.map +1 -0
- package/esm/database/seeds/seeds-table-migration.d.ts +8 -0
- package/esm/database/seeds/seeds-table-migration.d.ts.map +1 -0
- package/esm/database/seeds/seeds-table-migration.js +18 -0
- package/esm/database/seeds/seeds-table-migration.js.map +1 -0
- package/esm/database/seeds/types.d.ts +13 -0
- package/esm/database/seeds/types.d.ts.map +1 -0
- package/esm/database/seeds/utils.d.ts +2 -0
- package/esm/database/seeds/utils.d.ts.map +1 -0
- package/esm/database/seeds/utils.js +1 -0
- package/esm/database/seeds/utils.js.map +1 -0
- package/esm/database/utils.d.ts +17 -0
- package/esm/database/utils.d.ts.map +1 -0
- package/esm/database/utils.js +30 -0
- package/esm/database/utils.js.map +1 -0
- package/esm/dev-server/create-worker.d.ts +34 -0
- package/esm/dev-server/create-worker.d.ts.map +1 -0
- package/esm/dev-server/create-worker.js +37 -0
- package/esm/dev-server/create-worker.js.map +1 -0
- package/esm/dev-server/dependency-graph.d.ts +102 -0
- package/esm/dev-server/dependency-graph.d.ts.map +1 -0
- package/esm/dev-server/dependency-graph.js +310 -0
- package/esm/dev-server/dependency-graph.js.map +1 -0
- package/esm/dev-server/dev-logger.d.ts +14 -0
- package/esm/dev-server/dev-logger.d.ts.map +1 -0
- package/esm/dev-server/dev-logger.js +130 -0
- package/esm/dev-server/dev-logger.js.map +1 -0
- package/esm/dev-server/development-server.d.ts +55 -0
- package/esm/dev-server/development-server.d.ts.map +1 -0
- package/esm/dev-server/development-server.js +199 -0
- package/esm/dev-server/development-server.js.map +1 -0
- package/esm/dev-server/events.d.ts +5 -0
- package/esm/dev-server/events.d.ts.map +1 -0
- package/esm/dev-server/events.js +4 -0
- package/esm/dev-server/events.js.map +1 -0
- package/esm/dev-server/export-analyzer.d.ts +84 -0
- package/esm/dev-server/export-analyzer.d.ts.map +1 -0
- package/esm/dev-server/export-analyzer.js +206 -0
- package/esm/dev-server/export-analyzer.js.map +1 -0
- package/esm/dev-server/file-event-handler.d.ts +156 -0
- package/esm/dev-server/file-event-handler.d.ts.map +1 -0
- package/esm/dev-server/file-event-handler.js +309 -0
- package/esm/dev-server/file-event-handler.js.map +1 -0
- package/esm/dev-server/file-manager.d.ts +394 -0
- package/esm/dev-server/file-manager.d.ts.map +1 -0
- package/esm/dev-server/file-manager.js +603 -0
- package/esm/dev-server/file-manager.js.map +1 -0
- package/esm/dev-server/file-operations.d.ts +203 -0
- package/esm/dev-server/file-operations.d.ts.map +1 -0
- package/esm/dev-server/file-operations.js +365 -0
- package/esm/dev-server/file-operations.js.map +1 -0
- package/esm/dev-server/files-orchestrator.d.ts +153 -0
- package/esm/dev-server/files-orchestrator.d.ts.map +1 -0
- package/esm/dev-server/files-orchestrator.js +349 -0
- package/esm/dev-server/files-orchestrator.js.map +1 -0
- package/esm/dev-server/files-watcher.d.ts +67 -0
- package/esm/dev-server/files-watcher.d.ts.map +1 -0
- package/esm/dev-server/files-watcher.js +121 -0
- package/esm/dev-server/files-watcher.js.map +1 -0
- package/esm/dev-server/flags.d.ts +10 -0
- package/esm/dev-server/flags.d.ts.map +1 -0
- package/esm/dev-server/flags.js +9 -0
- package/esm/dev-server/flags.js.map +1 -0
- package/esm/dev-server/health-checker/checkers/base-health-checker.d.ts +52 -0
- package/esm/dev-server/health-checker/checkers/base-health-checker.d.ts.map +1 -0
- package/esm/dev-server/health-checker/checkers/base-health-checker.js +71 -0
- package/esm/dev-server/health-checker/checkers/base-health-checker.js.map +1 -0
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.d.ts +40 -0
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.d.ts.map +1 -0
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.js +217 -0
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.js.map +1 -0
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.d.ts +56 -0
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.d.ts.map +1 -0
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.js +279 -0
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.js.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.ts +59 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.ts.map +1 -0
- package/esm/dev-server/health-checker/file-health-result.d.ts +68 -0
- package/esm/dev-server/health-checker/file-health-result.d.ts.map +1 -0
- package/esm/dev-server/health-checker/file-health-result.js +40 -0
- package/esm/dev-server/health-checker/file-health-result.js.map +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.d.ts +115 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.d.ts.map +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.js +422 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.js.map +1 -0
- package/esm/dev-server/health-checker/index.d.ts +6 -0
- package/esm/dev-server/health-checker/index.d.ts.map +1 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.ts +2 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.ts.map +1 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.js +214 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.js.map +1 -0
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.ts +2 -0
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.ts.map +1 -0
- package/esm/dev-server/health-checker/workers/ts-health.worker.js +261 -0
- package/esm/dev-server/health-checker/workers/ts-health.worker.js.map +1 -0
- package/esm/dev-server/import-deduplicator.d.ts +75 -0
- package/esm/dev-server/import-deduplicator.d.ts.map +1 -0
- package/esm/dev-server/import-deduplicator.js +288 -0
- package/esm/dev-server/import-deduplicator.js.map +1 -0
- package/esm/dev-server/import-deduplicator.test.d.ts +7 -0
- package/esm/dev-server/import-deduplicator.test.d.ts.map +1 -0
- package/esm/dev-server/import-transformer.d.ts +17 -0
- package/esm/dev-server/import-transformer.d.ts.map +1 -0
- package/esm/dev-server/import-transformer.js +221 -0
- package/esm/dev-server/import-transformer.js.map +1 -0
- package/esm/dev-server/index.d.ts +1 -0
- package/esm/dev-server/index.d.ts.map +1 -0
- package/esm/dev-server/layer-executor.d.ts +64 -0
- package/esm/dev-server/layer-executor.d.ts.map +1 -0
- package/esm/dev-server/layer-executor.js +338 -0
- package/esm/dev-server/layer-executor.js.map +1 -0
- package/esm/dev-server/manifest-manager.d.ts +80 -0
- package/esm/dev-server/manifest-manager.d.ts.map +1 -0
- package/esm/dev-server/manifest-manager.js +107 -0
- package/esm/dev-server/manifest-manager.js.map +1 -0
- package/esm/dev-server/module-loader.d.ts +111 -0
- package/esm/dev-server/module-loader.d.ts.map +1 -0
- package/esm/dev-server/module-loader.js +276 -0
- package/esm/dev-server/module-loader.js.map +1 -0
- package/esm/dev-server/package-json-manager.d.ts +16 -0
- package/esm/dev-server/package-json-manager.d.ts.map +1 -0
- package/esm/dev-server/package-json-manager.js +20 -0
- package/esm/dev-server/package-json-manager.js.map +1 -0
- package/esm/dev-server/parse-imports.d.ts +34 -0
- package/esm/dev-server/parse-imports.d.ts.map +1 -0
- package/esm/dev-server/parse-imports.js +426 -0
- package/esm/dev-server/parse-imports.js.map +1 -0
- package/esm/dev-server/path.d.ts +39 -0
- package/esm/dev-server/path.d.ts.map +1 -0
- package/esm/dev-server/path.js +56 -0
- package/esm/dev-server/path.js.map +1 -0
- package/esm/dev-server/runtime-import-helper.d.ts +8 -0
- package/esm/dev-server/runtime-import-helper.d.ts.map +1 -0
- package/esm/dev-server/runtime-import-helper.js +158 -0
- package/esm/dev-server/runtime-import-helper.js.map +1 -0
- package/esm/dev-server/special-files-collector.d.ts +114 -0
- package/esm/dev-server/special-files-collector.d.ts.map +1 -0
- package/esm/dev-server/special-files-collector.js +212 -0
- package/esm/dev-server/special-files-collector.js.map +1 -0
- package/esm/dev-server/start-development-server.d.ts +7 -0
- package/esm/dev-server/start-development-server.d.ts.map +1 -0
- package/esm/dev-server/start-development-server.js +21 -0
- package/esm/dev-server/start-development-server.js.map +1 -0
- package/esm/dev-server/transpile-file.d.ts +11 -0
- package/esm/dev-server/transpile-file.d.ts.map +1 -0
- package/esm/dev-server/transpile-file.js +30 -0
- package/esm/dev-server/transpile-file.js.map +1 -0
- package/esm/dev-server/tsconfig-manager.d.ts +45 -0
- package/esm/dev-server/tsconfig-manager.d.ts.map +1 -0
- package/esm/dev-server/tsconfig-manager.js +107 -0
- package/esm/dev-server/tsconfig-manager.js.map +1 -0
- package/esm/dev-server/type-generator.d.ts +115 -0
- package/esm/dev-server/type-generator.d.ts.map +1 -0
- package/esm/dev-server/type-generator.js +566 -0
- package/esm/dev-server/type-generator.js.map +1 -0
- package/esm/dev-server/types.d.ts +30 -0
- package/esm/dev-server/types.d.ts.map +1 -0
- package/esm/dev-server/utils.d.ts +15 -0
- package/esm/dev-server/utils.d.ts.map +1 -0
- package/esm/dev-server/utils.js +41 -0
- package/esm/dev-server/utils.js.map +1 -0
- package/esm/encryption/encrypt.d.ts +23 -0
- package/esm/encryption/encrypt.d.ts.map +1 -0
- package/esm/encryption/encrypt.js +85 -0
- package/esm/encryption/encrypt.js.map +1 -0
- package/esm/encryption/hash.d.ts +17 -0
- package/esm/encryption/hash.d.ts.map +1 -0
- package/esm/encryption/hash.js +26 -0
- package/esm/encryption/hash.js.map +1 -0
- package/esm/encryption/index.d.ts +5 -0
- package/esm/encryption/index.d.ts.map +1 -0
- package/esm/encryption/password.d.ts +23 -0
- package/esm/encryption/password.d.ts.map +1 -0
- package/esm/encryption/password.js +72 -0
- package/esm/encryption/password.js.map +1 -0
- package/esm/encryption/types.d.ts +51 -0
- package/esm/encryption/types.d.ts.map +1 -0
- package/esm/generations/add-command.action.d.ts +3 -0
- package/esm/generations/add-command.action.d.ts.map +1 -0
- package/esm/generations/add-command.action.js +382 -0
- package/esm/generations/add-command.action.js.map +1 -0
- package/esm/generations/stubs.d.ts +2 -0
- package/esm/generations/stubs.d.ts.map +1 -0
- package/esm/generations/stubs.js +81 -0
- package/esm/generations/stubs.js.map +1 -0
- package/esm/http/config.d.ts +10 -0
- package/esm/http/config.d.ts.map +1 -0
- package/esm/http/config.js +22 -0
- package/esm/http/config.js.map +1 -0
- package/esm/http/context/request-context.d.ts +47 -0
- package/esm/http/context/request-context.d.ts.map +1 -0
- package/esm/http/context/request-context.js +52 -0
- package/esm/http/context/request-context.js.map +1 -0
- package/esm/http/createHttpApplication.d.ts +3 -0
- package/esm/http/createHttpApplication.d.ts.map +1 -0
- package/esm/http/createHttpApplication.js +28 -0
- package/esm/http/createHttpApplication.js.map +1 -0
- package/esm/http/database/RequestLog.d.ts +16 -0
- package/esm/http/database/RequestLog.d.ts.map +1 -0
- package/esm/http/database/RequestLog.js +26 -0
- package/esm/http/database/RequestLog.js.map +1 -0
- package/esm/http/errors/errors.d.ts +39 -0
- package/esm/http/errors/errors.d.ts.map +1 -0
- package/esm/http/errors/errors.js +76 -0
- package/esm/http/errors/errors.js.map +1 -0
- package/esm/http/errors/index.d.ts +2 -0
- package/esm/http/errors/index.d.ts.map +1 -0
- package/esm/http/events.d.ts +4 -0
- package/esm/http/events.d.ts.map +1 -0
- package/esm/http/events.js +26 -0
- package/esm/http/events.js.map +1 -0
- package/esm/http/index.d.ts +17 -0
- package/esm/http/index.d.ts.map +1 -0
- package/esm/http/middleware/cache-response-middleware.d.ts +34 -0
- package/esm/http/middleware/cache-response-middleware.d.ts.map +1 -0
- package/esm/http/middleware/cache-response-middleware.js +45 -0
- package/esm/http/middleware/cache-response-middleware.js.map +1 -0
- package/esm/http/middleware/index.d.ts +3 -0
- package/esm/http/middleware/index.d.ts.map +1 -0
- package/esm/http/middleware/inject-request-context.d.ts +21 -0
- package/esm/http/middleware/inject-request-context.d.ts.map +1 -0
- package/esm/http/middleware/inject-request-context.js +119 -0
- package/esm/http/middleware/inject-request-context.js.map +1 -0
- package/esm/http/plugins.d.ts +3 -0
- package/esm/http/plugins.d.ts.map +1 -0
- package/esm/http/plugins.js +36 -0
- package/esm/http/plugins.js.map +1 -0
- package/esm/http/request-controller.d.ts +11 -0
- package/esm/http/request-controller.d.ts.map +1 -0
- package/esm/http/request-controller.js +9 -0
- package/esm/http/request-controller.js.map +1 -0
- package/esm/http/request.d.ts +400 -0
- package/esm/http/request.d.ts.map +1 -0
- package/esm/http/request.js +766 -0
- package/esm/http/request.js.map +1 -0
- package/esm/http/response.d.ts +374 -0
- package/esm/http/response.d.ts.map +1 -0
- package/esm/http/response.js +974 -0
- package/esm/http/response.js.map +1 -0
- package/esm/http/server.d.ts +8 -0
- package/esm/http/server.d.ts.map +1 -0
- package/esm/http/server.js +15 -0
- package/esm/http/server.js.map +1 -0
- package/esm/http/types.d.ts +230 -0
- package/esm/http/types.d.ts.map +1 -0
- package/esm/http/uploaded-file.d.ts +459 -0
- package/esm/http/uploaded-file.d.ts.map +1 -0
- package/esm/http/uploaded-file.js +709 -0
- package/esm/http/uploaded-file.js.map +1 -0
- package/esm/http/uploads-config.d.ts +26 -0
- package/esm/http/uploads-config.d.ts.map +1 -0
- package/esm/http/uploads-config.js +35 -0
- package/esm/http/uploads-config.js.map +1 -0
- package/esm/http/uploads-types.d.ts +236 -0
- package/esm/http/uploads-types.d.ts.map +1 -0
- package/esm/image/image.d.ts +388 -0
- package/esm/image/image.d.ts.map +1 -0
- package/esm/image/image.js +602 -0
- package/esm/image/image.js.map +1 -0
- package/esm/image/index.d.ts +2 -0
- package/esm/image/index.d.ts.map +1 -0
- package/esm/index.d.ts +34 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/logger/index.d.ts +3 -0
- package/esm/logger/index.d.ts.map +1 -0
- package/esm/logger/logger.d.ts +3 -0
- package/esm/logger/logger.d.ts.map +1 -0
- package/esm/logger/logger.js +16 -0
- package/esm/logger/logger.js.map +1 -0
- package/esm/logger/types.d.ts +39 -0
- package/esm/logger/types.d.ts.map +1 -0
- package/esm/mail/config.d.ts +80 -0
- package/esm/mail/config.d.ts.map +1 -0
- package/esm/mail/config.js +158 -0
- package/esm/mail/config.js.map +1 -0
- package/esm/mail/events.d.ts +96 -0
- package/esm/mail/events.d.ts.map +1 -0
- package/esm/mail/events.js +123 -0
- package/esm/mail/events.js.map +1 -0
- package/esm/mail/index.d.ts +10 -0
- package/esm/mail/index.d.ts.map +1 -0
- package/esm/mail/mail.d.ts +175 -0
- package/esm/mail/mail.d.ts.map +1 -0
- package/esm/mail/mail.js +286 -0
- package/esm/mail/mail.js.map +1 -0
- package/esm/mail/mailer-pool.d.ts +27 -0
- package/esm/mail/mailer-pool.d.ts.map +1 -0
- package/esm/mail/mailer-pool.js +215 -0
- package/esm/mail/mailer-pool.js.map +1 -0
- package/esm/mail/react-mail.d.ts +12 -0
- package/esm/mail/react-mail.d.ts.map +1 -0
- package/esm/mail/react-mail.js +40 -0
- package/esm/mail/react-mail.js.map +1 -0
- package/esm/mail/send-mail.d.ts +33 -0
- package/esm/mail/send-mail.d.ts.map +1 -0
- package/esm/mail/send-mail.js +313 -0
- package/esm/mail/send-mail.js.map +1 -0
- package/esm/mail/test-mailbox.d.ts +110 -0
- package/esm/mail/test-mailbox.d.ts.map +1 -0
- package/esm/mail/test-mailbox.js +143 -0
- package/esm/mail/test-mailbox.js.map +1 -0
- package/esm/mail/types.d.ts +264 -0
- package/esm/mail/types.d.ts.map +1 -0
- package/esm/mail/types.js +13 -0
- package/esm/mail/types.js.map +1 -0
- package/esm/manifest/manifest-manager.d.ts +74 -0
- package/esm/manifest/manifest-manager.d.ts.map +1 -0
- package/esm/manifest/manifest-manager.js +88 -0
- package/esm/manifest/manifest-manager.js.map +1 -0
- package/esm/production/build-app-production.d.ts +6 -0
- package/esm/production/build-app-production.d.ts.map +1 -0
- package/esm/production/build-app-production.js +8 -0
- package/esm/production/build-app-production.js.map +1 -0
- package/esm/production/esbuild-plugins.d.ts +5 -0
- package/esm/production/esbuild-plugins.d.ts.map +1 -0
- package/esm/production/esbuild-plugins.js +23 -0
- package/esm/production/esbuild-plugins.js.map +1 -0
- package/esm/production/production-builder.d.ts +76 -0
- package/esm/production/production-builder.d.ts.map +1 -0
- package/esm/production/production-builder.js +254 -0
- package/esm/production/production-builder.js.map +1 -0
- package/esm/react/index.d.ts +14 -0
- package/esm/react/index.d.ts.map +1 -0
- package/esm/react/index.js +65 -0
- package/esm/react/index.js.map +1 -0
- package/esm/repositories/adapters/cascade/cascade-adapter.d.ts +85 -0
- package/esm/repositories/adapters/cascade/cascade-adapter.d.ts.map +1 -0
- package/esm/repositories/adapters/cascade/cascade-adapter.js +179 -0
- package/esm/repositories/adapters/cascade/cascade-adapter.js.map +1 -0
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.ts +141 -0
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.ts.map +1 -0
- package/esm/repositories/adapters/cascade/cascade-query-builder.js +281 -0
- package/esm/repositories/adapters/cascade/cascade-query-builder.js.map +1 -0
- package/esm/repositories/adapters/cascade/filter-applicator.d.ts +126 -0
- package/esm/repositories/adapters/cascade/filter-applicator.d.ts.map +1 -0
- package/esm/repositories/adapters/cascade/filter-applicator.js +549 -0
- package/esm/repositories/adapters/cascade/filter-applicator.js.map +1 -0
- package/esm/repositories/adapters/cascade/index.d.ts +7 -0
- package/esm/repositories/adapters/cascade/index.d.ts.map +1 -0
- package/esm/repositories/contracts/index.d.ts +8 -0
- package/esm/repositories/contracts/index.d.ts.map +1 -0
- package/esm/repositories/contracts/query-builder.contract.d.ts +320 -0
- package/esm/repositories/contracts/query-builder.contract.d.ts.map +1 -0
- package/esm/repositories/contracts/repository-adapter.contract.d.ts +183 -0
- package/esm/repositories/contracts/repository-adapter.contract.d.ts.map +1 -0
- package/esm/repositories/contracts/types.d.ts +328 -0
- package/esm/repositories/contracts/types.d.ts.map +1 -0
- package/esm/repositories/index.d.ts +8 -0
- package/esm/repositories/index.d.ts.map +1 -0
- package/esm/repositories/repository.manager.d.ts +694 -0
- package/esm/repositories/repository.manager.d.ts.map +1 -0
- package/esm/repositories/repository.manager.js +1123 -0
- package/esm/repositories/repository.manager.js.map +1 -0
- package/esm/resource/define-resource.d.ts +65 -0
- package/esm/resource/define-resource.d.ts.map +1 -0
- package/esm/resource/define-resource.js +62 -0
- package/esm/resource/define-resource.js.map +1 -0
- package/esm/resource/index.d.ts +6 -0
- package/esm/resource/index.d.ts.map +1 -0
- package/esm/resource/register-resource.d.ts +21 -0
- package/esm/resource/register-resource.d.ts.map +1 -0
- package/esm/resource/register-resource.js +23 -0
- package/esm/resource/register-resource.js.map +1 -0
- package/esm/resource/resource-field-builder.d.ts +104 -0
- package/esm/resource/resource-field-builder.d.ts.map +1 -0
- package/esm/resource/resource-field-builder.js +260 -0
- package/esm/resource/resource-field-builder.js.map +1 -0
- package/esm/resource/resource.d.ts +217 -0
- package/esm/resource/resource.d.ts.map +1 -0
- package/esm/resource/resource.js +307 -0
- package/esm/resource/resource.js.map +1 -0
- package/esm/resource/types.d.ts +74 -0
- package/esm/resource/types.d.ts.map +1 -0
- package/esm/restful/index.d.ts +2 -0
- package/esm/restful/index.d.ts.map +1 -0
- package/esm/restful/restful.d.ts +110 -0
- package/esm/restful/restful.d.ts.map +1 -0
- package/esm/restful/restful.js +317 -0
- package/esm/restful/restful.js.map +1 -0
- package/esm/retry/index.d.ts +3 -0
- package/esm/retry/index.d.ts.map +1 -0
- package/esm/retry/retry.d.ts +21 -0
- package/esm/retry/retry.d.ts.map +1 -0
- package/esm/retry/retry.js +39 -0
- package/esm/retry/retry.js.map +1 -0
- package/esm/retry/types.d.ts +27 -0
- package/esm/retry/types.d.ts.map +1 -0
- package/esm/router/index.d.ts +3 -0
- package/esm/router/index.d.ts.map +1 -0
- package/esm/router/route-builder.d.ts +120 -0
- package/esm/router/route-builder.d.ts.map +1 -0
- package/esm/router/route-builder.js +201 -0
- package/esm/router/route-builder.js.map +1 -0
- package/esm/router/route-registry.d.ts +30 -0
- package/esm/router/route-registry.d.ts.map +1 -0
- package/esm/router/route-registry.js +67 -0
- package/esm/router/route-registry.js.map +1 -0
- package/esm/router/route.d.ts +34 -0
- package/esm/router/route.d.ts.map +1 -0
- package/esm/router/router.d.ts +188 -0
- package/esm/router/router.d.ts.map +1 -0
- package/esm/router/router.js +605 -0
- package/esm/router/router.js.map +1 -0
- package/esm/router/types.d.ts +254 -0
- package/esm/router/types.d.ts.map +1 -0
- package/esm/storage/config.d.ts +15 -0
- package/esm/storage/config.d.ts.map +1 -0
- package/esm/storage/config.js +32 -0
- package/esm/storage/config.js.map +1 -0
- package/esm/storage/context/storage-driver-context.d.ts +69 -0
- package/esm/storage/context/storage-driver-context.d.ts.map +1 -0
- package/esm/storage/context/storage-driver-context.js +80 -0
- package/esm/storage/context/storage-driver-context.js.map +1 -0
- package/esm/storage/drivers/cloud-driver.d.ts +206 -0
- package/esm/storage/drivers/cloud-driver.d.ts.map +1 -0
- package/esm/storage/drivers/cloud-driver.js +721 -0
- package/esm/storage/drivers/cloud-driver.js.map +1 -0
- package/esm/storage/drivers/do-spaces-driver.d.ts +43 -0
- package/esm/storage/drivers/do-spaces-driver.d.ts.map +1 -0
- package/esm/storage/drivers/do-spaces-driver.js +50 -0
- package/esm/storage/drivers/do-spaces-driver.js.map +1 -0
- package/esm/storage/drivers/local-driver.d.ts +151 -0
- package/esm/storage/drivers/local-driver.d.ts.map +1 -0
- package/esm/storage/drivers/local-driver.js +448 -0
- package/esm/storage/drivers/local-driver.js.map +1 -0
- package/esm/storage/drivers/r2-driver.d.ts +47 -0
- package/esm/storage/drivers/r2-driver.d.ts.map +1 -0
- package/esm/storage/drivers/r2-driver.js +60 -0
- package/esm/storage/drivers/r2-driver.js.map +1 -0
- package/esm/storage/drivers/s3-driver.d.ts +32 -0
- package/esm/storage/drivers/s3-driver.d.ts.map +1 -0
- package/esm/storage/drivers/s3-driver.js +37 -0
- package/esm/storage/drivers/s3-driver.js.map +1 -0
- package/esm/storage/index.d.ts +13 -0
- package/esm/storage/index.d.ts.map +1 -0
- package/esm/storage/scoped-storage.d.ts +547 -0
- package/esm/storage/scoped-storage.d.ts.map +1 -0
- package/esm/storage/scoped-storage.js +739 -0
- package/esm/storage/scoped-storage.js.map +1 -0
- package/esm/storage/storage-file.d.ts +222 -0
- package/esm/storage/storage-file.d.ts.map +1 -0
- package/esm/storage/storage-file.js +376 -0
- package/esm/storage/storage-file.js.map +1 -0
- package/esm/storage/storage.d.ts +583 -0
- package/esm/storage/storage.d.ts.map +1 -0
- package/esm/storage/storage.js +948 -0
- package/esm/storage/storage.js.map +1 -0
- package/esm/storage/types.d.ts +966 -0
- package/esm/storage/types.d.ts.map +1 -0
- package/esm/storage/utils/mime.d.ts +33 -0
- package/esm/storage/utils/mime.d.ts.map +1 -0
- package/esm/storage/utils/mime.js +45 -0
- package/esm/storage/utils/mime.js.map +1 -0
- package/esm/tests/index.d.ts +9 -0
- package/esm/tests/index.d.ts.map +1 -0
- package/esm/tests/start-http-development-server.d.ts +15 -0
- package/esm/tests/start-http-development-server.d.ts.map +1 -0
- package/esm/tests/start-http-development-server.js +69 -0
- package/esm/tests/start-http-development-server.js.map +1 -0
- package/esm/tests/test-helpers.d.ts +43 -0
- package/esm/tests/test-helpers.d.ts.map +1 -0
- package/esm/tests/test-helpers.js +86 -0
- package/esm/tests/test-helpers.js.map +1 -0
- package/esm/tests/vitest-setup.d.ts +10 -0
- package/esm/tests/vitest-setup.d.ts.map +1 -0
- package/esm/tests/vitest-setup.js +36 -0
- package/esm/tests/vitest-setup.js.map +1 -0
- package/esm/use-cases/index.d.ts +7 -0
- package/esm/use-cases/index.d.ts.map +1 -0
- package/esm/use-cases/types.d.ts +267 -0
- package/esm/use-cases/types.d.ts.map +1 -0
- package/esm/use-cases/use-case-events.d.ts +33 -0
- package/esm/use-cases/use-case-events.d.ts.map +1 -0
- package/esm/use-cases/use-case-events.js +65 -0
- package/esm/use-cases/use-case-events.js.map +1 -0
- package/esm/use-cases/use-case-pipeline.d.ts +29 -0
- package/esm/use-cases/use-case-pipeline.d.ts.map +1 -0
- package/esm/use-cases/use-case-pipeline.js +45 -0
- package/esm/use-cases/use-case-pipeline.js.map +1 -0
- package/esm/use-cases/use-case.d.ts +27 -0
- package/esm/use-cases/use-case.d.ts.map +1 -0
- package/esm/use-cases/use-case.errors.d.ts +6 -0
- package/esm/use-cases/use-case.errors.d.ts.map +1 -0
- package/esm/use-cases/use-case.errors.js +8 -0
- package/esm/use-cases/use-case.errors.js.map +1 -0
- package/esm/use-cases/use-case.js +138 -0
- package/esm/use-cases/use-case.js.map +1 -0
- package/esm/use-cases/use-cases-registry.d.ts +38 -0
- package/esm/use-cases/use-cases-registry.d.ts.map +1 -0
- package/esm/use-cases/use-cases-registry.js +92 -0
- package/esm/use-cases/use-cases-registry.js.map +1 -0
- package/esm/utils/app-log.d.ts +8 -0
- package/esm/utils/app-log.d.ts.map +1 -0
- package/esm/utils/app-log.js +7 -0
- package/esm/utils/app-log.js.map +1 -0
- package/esm/utils/cleanup-temp-files.d.ts +5 -0
- package/esm/utils/cleanup-temp-files.d.ts.map +1 -0
- package/esm/utils/database-log.d.ts +25 -0
- package/esm/utils/database-log.d.ts.map +1 -0
- package/esm/utils/database-log.js +43 -0
- package/esm/utils/database-log.js.map +1 -0
- package/esm/utils/download-file.d.ts +3 -0
- package/esm/utils/download-file.d.ts.map +1 -0
- package/esm/utils/environment.d.ts +4 -0
- package/esm/utils/environment.d.ts.map +1 -0
- package/esm/utils/environment.js +6 -0
- package/esm/utils/environment.js.map +1 -0
- package/esm/utils/framework-vesion.d.ts +6 -0
- package/esm/utils/framework-vesion.d.ts.map +1 -0
- package/esm/utils/framework-vesion.js +18 -0
- package/esm/utils/framework-vesion.js.map +1 -0
- package/esm/utils/get-localized.d.ts +10 -0
- package/esm/utils/get-localized.d.ts.map +1 -0
- package/esm/utils/get-localized.js +15 -0
- package/esm/utils/get-localized.js.map +1 -0
- package/esm/utils/index.d.ts +12 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/internal.d.ts +4 -0
- package/esm/utils/internal.d.ts.map +1 -0
- package/esm/utils/paths.d.ts +55 -0
- package/esm/utils/paths.d.ts.map +1 -0
- package/esm/utils/paths.js +89 -0
- package/esm/utils/paths.js.map +1 -0
- package/esm/utils/promise-all-object.d.ts +8 -0
- package/esm/utils/promise-all-object.d.ts.map +1 -0
- package/esm/utils/promise-all-object.js +12 -0
- package/esm/utils/promise-all-object.js.map +1 -0
- package/esm/utils/queue.d.ts +49 -0
- package/esm/utils/queue.d.ts.map +1 -0
- package/esm/utils/queue.js +89 -0
- package/esm/utils/queue.js.map +1 -0
- package/esm/utils/sleep.d.ts +2 -0
- package/esm/utils/sleep.d.ts.map +1 -0
- package/esm/utils/sleep.js +3 -0
- package/esm/utils/sleep.js.map +1 -0
- package/esm/utils/sluggable.d.ts +5 -0
- package/esm/utils/sluggable.d.ts.map +1 -0
- package/esm/utils/sluggable.js +15 -0
- package/esm/utils/sluggable.js.map +1 -0
- package/esm/utils/to-json.d.ts +2 -0
- package/esm/utils/to-json.d.ts.map +1 -0
- package/esm/utils/to-json.js +26 -0
- package/esm/utils/to-json.js.map +1 -0
- package/esm/utils/types.d.ts +22 -0
- package/esm/utils/types.d.ts.map +1 -0
- package/esm/utils/urls.d.ts +21 -0
- package/esm/utils/urls.d.ts.map +1 -0
- package/esm/utils/urls.js +31 -0
- package/esm/utils/urls.js.map +1 -0
- package/esm/validation/database/exists-except-current-id.d.ts +7 -0
- package/esm/validation/database/exists-except-current-id.d.ts.map +1 -0
- package/esm/validation/database/exists-except-current-id.js +24 -0
- package/esm/validation/database/exists-except-current-id.js.map +1 -0
- package/esm/validation/database/exists-except-current-user.d.ts +7 -0
- package/esm/validation/database/exists-except-current-user.d.ts.map +1 -0
- package/esm/validation/database/exists-except-current-user.js +26 -0
- package/esm/validation/database/exists-except-current-user.js.map +1 -0
- package/esm/validation/database/exists.d.ts +7 -0
- package/esm/validation/database/exists.d.ts.map +1 -0
- package/esm/validation/database/exists.js +22 -0
- package/esm/validation/database/exists.js.map +1 -0
- package/esm/validation/database/index.d.ts +12 -0
- package/esm/validation/database/index.d.ts.map +1 -0
- package/esm/validation/database/types.d.ts +68 -0
- package/esm/validation/database/types.d.ts.map +1 -0
- package/esm/validation/database/unique-except-current-id.d.ts +7 -0
- package/esm/validation/database/unique-except-current-id.d.ts.map +1 -0
- package/esm/validation/database/unique-except-current-id.js +24 -0
- package/esm/validation/database/unique-except-current-id.js.map +1 -0
- package/esm/validation/database/unique-except-current-user.d.ts +7 -0
- package/esm/validation/database/unique-except-current-user.d.ts.map +1 -0
- package/esm/validation/database/unique-except-current-user.js +29 -0
- package/esm/validation/database/unique-except-current-user.js.map +1 -0
- package/esm/validation/database/unique.d.ts +7 -0
- package/esm/validation/database/unique.d.ts.map +1 -0
- package/esm/validation/database/unique.js +31 -0
- package/esm/validation/database/unique.js.map +1 -0
- package/esm/validation/file/file.d.ts +22 -0
- package/esm/validation/file/file.d.ts.map +1 -0
- package/esm/validation/file/file.js +60 -0
- package/esm/validation/file/file.js.map +1 -0
- package/esm/validation/file/index.d.ts +6 -0
- package/esm/validation/file/index.d.ts.map +1 -0
- package/esm/validation/index.d.ts +16 -0
- package/esm/validation/index.d.ts.map +1 -0
- package/esm/validation/init.d.ts +7 -0
- package/esm/validation/init.d.ts.map +1 -0
- package/esm/validation/init.js +36 -0
- package/esm/validation/init.js.map +1 -0
- package/esm/validation/plugins/database-plugin.d.ts +14 -0
- package/esm/validation/plugins/database-plugin.d.ts.map +1 -0
- package/esm/validation/plugins/database-plugin.js +83 -0
- package/esm/validation/plugins/database-plugin.js.map +1 -0
- package/esm/validation/plugins/file-plugin.d.ts +11 -0
- package/esm/validation/plugins/file-plugin.d.ts.map +1 -0
- package/esm/validation/plugins/file-plugin.js +17 -0
- package/esm/validation/plugins/file-plugin.js.map +1 -0
- package/esm/validation/plugins/index.d.ts +9 -0
- package/esm/validation/plugins/index.d.ts.map +1 -0
- package/esm/validation/plugins/localized-plugin.d.ts +11 -0
- package/esm/validation/plugins/localized-plugin.d.ts.map +1 -0
- package/esm/validation/plugins/localized-plugin.js +19 -0
- package/esm/validation/plugins/localized-plugin.js.map +1 -0
- package/esm/validation/types.d.ts +87 -0
- package/esm/validation/types.d.ts.map +1 -0
- package/esm/validation/validateAll.d.ts +7 -0
- package/esm/validation/validateAll.d.ts.map +1 -0
- package/esm/validation/validateAll.js +60 -0
- package/esm/validation/validateAll.js.map +1 -0
- package/esm/validation/validators/file-validator.d.ts +62 -0
- package/esm/validation/validators/file-validator.d.ts.map +1 -0
- package/esm/validation/validators/file-validator.js +136 -0
- package/esm/validation/validators/file-validator.js.map +1 -0
- package/esm/validation/validators/index.d.ts +7 -0
- package/esm/validation/validators/index.d.ts.map +1 -0
- package/esm/warlock-config/default-configurations.d.ts +3 -0
- package/esm/warlock-config/default-configurations.d.ts.map +1 -0
- package/esm/warlock-config/default-configurations.js +8 -0
- package/esm/warlock-config/default-configurations.js.map +1 -0
- package/esm/warlock-config/define-config.d.ts +3 -0
- package/esm/warlock-config/define-config.d.ts.map +1 -0
- package/esm/warlock-config/define-config.js +3 -0
- package/esm/warlock-config/define-config.js.map +1 -0
- package/esm/warlock-config/index.d.ts +4 -0
- package/esm/warlock-config/index.d.ts.map +1 -0
- package/esm/warlock-config/types.d.ts +129 -0
- package/esm/warlock-config/types.d.ts.map +1 -0
- package/esm/warlock-config/warlock-config.manager.d.ts +83 -0
- package/esm/warlock-config/warlock-config.manager.d.ts.map +1 -0
- package/esm/warlock-config/warlock-config.manager.js +141 -0
- package/esm/warlock-config/warlock-config.manager.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connectors/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;CAChD;AAED,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,UAAU,GACV,OAAO,GACP,SAAS,GACT,cAAc,GACd,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,IAAI;IACV,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,OAAO,IAAI;CACZ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connector priority constants
|
|
3
|
+
*/
|
|
4
|
+
var ConnectorPriority;
|
|
5
|
+
(function (ConnectorPriority) {
|
|
6
|
+
ConnectorPriority[ConnectorPriority["LOGGER"] = 0] = "LOGGER";
|
|
7
|
+
ConnectorPriority[ConnectorPriority["MAILER"] = 1] = "MAILER";
|
|
8
|
+
ConnectorPriority[ConnectorPriority["DATABASE"] = 2] = "DATABASE";
|
|
9
|
+
ConnectorPriority[ConnectorPriority["COMMUNICATOR"] = 3] = "COMMUNICATOR";
|
|
10
|
+
ConnectorPriority[ConnectorPriority["CACHE"] = 4] = "CACHE";
|
|
11
|
+
ConnectorPriority[ConnectorPriority["HTTP"] = 5] = "HTTP";
|
|
12
|
+
ConnectorPriority[ConnectorPriority["STORAGE"] = 6] = "STORAGE";
|
|
13
|
+
})(ConnectorPriority || (ConnectorPriority = {}));export{ConnectorPriority};//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/connectors/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAyDA;;AAEG;IACS,kBAQX;AARD,CAAA,UAAY,iBAAiB,EAAA;AAC3B,IAAA,iBAAA,CAAA,iBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU,CAAA;AACV,IAAA,iBAAA,CAAA,iBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU,CAAA;AACV,IAAA,iBAAA,CAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY,CAAA;AACZ,IAAA,iBAAA,CAAA,iBAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAgB,CAAA;AAChB,IAAA,iBAAA,CAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS,CAAA;AACT,IAAA,iBAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;AACR,IAAA,iBAAA,CAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW,CAAA;AACb,CAAC,EARW,iBAAiB,KAAjB,iBAAiB,GAQ5B,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-database-action.d.ts","sourceRoot":"","sources":["../../src/database/create-database-action.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,iBA8CpE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {colors}from'@mongez/copper';import {dataSourceRegistry}from'@warlock.js/cascade';import {log}from'@warlock.js/logger';import {config}from'../config/config-getter.js';import'../config/config-handlers.js';async function createDatabaseAction(command) {
|
|
2
|
+
const name = command.args[0];
|
|
3
|
+
const { connection = "default" } = command.options;
|
|
4
|
+
const dataSource = dataSourceRegistry.get(connection === "default" || connection === true ? undefined : String(connection));
|
|
5
|
+
let databaseName = name;
|
|
6
|
+
if (!databaseName) {
|
|
7
|
+
if (connection === "default") {
|
|
8
|
+
databaseName = config.get("database")?.database;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
if (!databaseName) {
|
|
12
|
+
log.error("database", "create", "Database name is required. Please provide a name or configure it in the database config.");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
log.info("database", "create", `Creating database ${colors.cyan(databaseName)}...`);
|
|
16
|
+
try {
|
|
17
|
+
const created = await dataSource.driver.createDatabase(databaseName);
|
|
18
|
+
if (created) {
|
|
19
|
+
log.success("database", "create", `Database ${colors.green(databaseName)} created successfully.`);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
log.warn("database", "create", `Database ${colors.yellow(databaseName)} already exists.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
log.error("database", "create", `Failed to create database ${colors.red(databaseName)}: ${error.message}`);
|
|
27
|
+
}
|
|
28
|
+
}export{createDatabaseAction};//# sourceMappingURL=create-database-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-database-action.js","sources":["../../src/database/create-database-action.ts"],"sourcesContent":[null],"names":[],"mappings":"mNAMO,eAAe,oBAAoB,CAAC,OAA0B,EAAA;IACnE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAEnD,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CACvC,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CACjF,CAAC;IAEF,IAAI,YAAY,GAAG,IAAI,CAAC;IAExB,IAAI,CAAC,Y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MAAM,cAAc,CAAC;AAEjD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,iBAiDhE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {colors}from'@mongez/copper';import {dataSourceRegistry}from'@warlock.js/cascade';import {log}from'@warlock.js/logger';import {confirm}from'../cli/commands/generate/utils/prompt.js';async function dropTablesAction(command) {
|
|
2
|
+
const { force } = command.options;
|
|
3
|
+
// For now we will support only the default connection
|
|
4
|
+
const dataSource = dataSourceRegistry.get();
|
|
5
|
+
const driver = dataSource.driver;
|
|
6
|
+
if (force) {
|
|
7
|
+
const tables = await driver.blueprint.listTables();
|
|
8
|
+
await driver.dropAllTables();
|
|
9
|
+
log.success("database", "drop", `Dropped ${colors.yellowBright(tables.length)} tables successfully.`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const tables = await driver.blueprint.listTables();
|
|
13
|
+
if (tables.length === 0) {
|
|
14
|
+
log.warn("database", "drop", "No tables found in the database.");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
log.info("database", "drop", `Found ${colors.yellowBright(tables.length)} tables:`);
|
|
18
|
+
for (const table of tables) {
|
|
19
|
+
const count = await driver.queryBuilder(table).count();
|
|
20
|
+
console.log(` - ${colors.cyan(table)}: ${colors.green(count)} rows`);
|
|
21
|
+
}
|
|
22
|
+
const confirmed = await confirm(`Are you sure you want to drop all ${colors.red(tables.length)} tables?`);
|
|
23
|
+
if (!confirmed) {
|
|
24
|
+
log.info("database", "drop", "Operation cancelled.");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
await driver.dropAllTables();
|
|
28
|
+
log.success("database", "drop", `Dropped ${colors.yellowBright(tables.length)} tables successfully.`);
|
|
29
|
+
}export{dropTablesAction};//# sourceMappingURL=drop-tables-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drop-tables-action.js","sources":["../../src/database/drop-tables-action.ts"],"sourcesContent":[null],"names":[],"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,CAAO,CAAC,CAAC;AACvE,KAAA;AAED,IAAA,MAAM,SAAS,GAAG,MAAM,OAAO,CAC7B,qCAAqC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA,QAAA,CAAU,CACzE,CAAC;IAEF,IAAI,CAAC,SAAS,EAAE;QACd,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAAC;QACrD,OAAO;AACR,KAAA;AAED,IAAA,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;AAE7B,IAAA,GAAG,CAAC,OAAO,CACT,UAAU,EACV,MAAM,EACN,CAAW,QAAA,EAAA,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA,qBAAA,CAAuB,CACrE,CAAC;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommandActionData } from "../cli/types";
|
|
2
|
+
/**
|
|
3
|
+
* If path is provided, then run the migration runner against that file only
|
|
4
|
+
* If fresh is provided, then rollback all migrations and run all migrations
|
|
5
|
+
* If rollback is provided, then run the migration runner against all files in reverse order
|
|
6
|
+
*/
|
|
7
|
+
export declare function migrateAction(options: CommandActionData): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=migrate-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-action.d.ts","sourceRoot":"","sources":["../../src/database/migrate-action.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAiDjD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,iBAAiB,iBAiC7D"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {colors}from'@mongez/copper';import {migrationRunner}from'@warlock.js/cascade';import dayjs from'dayjs';import path from'path';import {filesOrchestrator}from'../dev-server/files-orchestrator.js';import {Path}from'../dev-server/path.js';import {getFilesFromDirectory}from'../dev-server/utils.js';import'@warlock.js/logger';import'./models/database-log/database-log.js';import'../http/context/request-context.js';import {srcPath}from'../utils/paths.js';import'@mongez/slug';import'@mongez/supportive-is';import'@mongez/reinforcements';import {warlockConfigManager}from'../warlock-config/warlock-config.manager.js';async function listMigrationsAction() {
|
|
2
|
+
const createdMigrations = await migrationRunner.getExecutedMigrations();
|
|
3
|
+
console.log(`\nTotal Executed Migrations: ${colors.green(createdMigrations.length)}\n`);
|
|
4
|
+
if (createdMigrations.length === 0) {
|
|
5
|
+
console.log(colors.gray(" No migrations have been executed yet.\n"));
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
// Display each migration as a block
|
|
9
|
+
for (const migration of createdMigrations) {
|
|
10
|
+
const executedAt = dayjs(migration.executedAt).format("DD-MM-YYYY hh:mm:ss A");
|
|
11
|
+
const createdAt = migration.createdAt
|
|
12
|
+
? dayjs(migration.createdAt).format("DD-MM-YYYY hh:mm:ss A")
|
|
13
|
+
: null;
|
|
14
|
+
// Migration name with checkmark icon
|
|
15
|
+
console.log(` ${colors.green("✔")} ${colors.cyanBright(migration.name)}`);
|
|
16
|
+
// Executed date
|
|
17
|
+
console.log(` ${colors.gray("Executed:")} ${colors.white(executedAt)}`);
|
|
18
|
+
// Created date (if available)
|
|
19
|
+
if (createdAt) {
|
|
20
|
+
console.log(` ${colors.gray("Created:")} ${colors.yellow(createdAt)}`);
|
|
21
|
+
}
|
|
22
|
+
console.log(""); // Empty line between migrations
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function allMigrationsFilesAction() {
|
|
26
|
+
// get all available migration files in the project
|
|
27
|
+
const files = (await migrationFiles()).map((path) => Path.toRelative(path));
|
|
28
|
+
console.log(`Total Migration Files: ${colors.green(files.length)}`);
|
|
29
|
+
for (const file of files) {
|
|
30
|
+
console.log(colors.yellowBright(file));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* If path is provided, then run the migration runner against that file only
|
|
35
|
+
* If fresh is provided, then rollback all migrations and run all migrations
|
|
36
|
+
* If rollback is provided, then run the migration runner against all files in reverse order
|
|
37
|
+
*/
|
|
38
|
+
async function migrateAction(options) {
|
|
39
|
+
const { fresh, path, rollback, all, list, sql, pendingOnly, compact } = options.options;
|
|
40
|
+
if (list) {
|
|
41
|
+
return await listMigrationsAction();
|
|
42
|
+
}
|
|
43
|
+
if (all) {
|
|
44
|
+
return await allMigrationsFilesAction();
|
|
45
|
+
}
|
|
46
|
+
if (path) {
|
|
47
|
+
await loadMigrationFile(Path.toAbsolute(path));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
await loadAllMigrations();
|
|
51
|
+
}
|
|
52
|
+
if (fresh && rollback) {
|
|
53
|
+
console.log(colors.redBright("You can't use --fresh and --rollback together"));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
if (rollback || fresh) {
|
|
57
|
+
await migrationRunner.rollbackAll();
|
|
58
|
+
}
|
|
59
|
+
if (rollback)
|
|
60
|
+
return;
|
|
61
|
+
if (sql) {
|
|
62
|
+
await migrationRunner.exportSQL({ pendingOnly: pendingOnly, compact: compact });
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
await migrationRunner.runAll();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async function loadMigrationFile(absPath) {
|
|
69
|
+
const relativePath = Path.toRelative(absPath);
|
|
70
|
+
const loadedModule = await filesOrchestrator.load(relativePath);
|
|
71
|
+
if (!loadedModule?.default) {
|
|
72
|
+
throw new Error(`${Path.toRelative(absPath)} must have a default export`);
|
|
73
|
+
}
|
|
74
|
+
const MigrationClass = loadedModule.default;
|
|
75
|
+
if (!MigrationClass.migrationName) {
|
|
76
|
+
MigrationClass.migrationName = path
|
|
77
|
+
.basename(absPath)
|
|
78
|
+
.split(".")[0]
|
|
79
|
+
.replace("-migration", "")
|
|
80
|
+
.replace("_migration", "");
|
|
81
|
+
}
|
|
82
|
+
// Extract createdAt timestamp from filename if not already set
|
|
83
|
+
// Expected format: MM-DD-YYYY_HH-MM-SS-name.migration.ts
|
|
84
|
+
if (!MigrationClass.createdAt) {
|
|
85
|
+
const filename = path.basename(absPath);
|
|
86
|
+
const timestampMatch = filename.match(/^(\d{2}-\d{2}-\d{4}_\d{2}-\d{2}-\d{2})/);
|
|
87
|
+
if (timestampMatch) {
|
|
88
|
+
MigrationClass.createdAt = timestampMatch[1];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
migrationRunner.register(MigrationClass);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @returns List of absolute paths to migration files
|
|
96
|
+
*/
|
|
97
|
+
async function migrationFiles() {
|
|
98
|
+
const migrationFiles = await getFilesFromDirectory(srcPath("app"), "*/models/*/migrations/*");
|
|
99
|
+
const separateMigrationsFolderFIles = await getFilesFromDirectory(srcPath("app"), "*/migrations/*");
|
|
100
|
+
const migrations = [...migrationFiles, ...separateMigrationsFolderFIles];
|
|
101
|
+
return migrations;
|
|
102
|
+
}
|
|
103
|
+
async function loadAllMigrations() {
|
|
104
|
+
// Load config-registered migrations (from packages like @warlock.js/auth)
|
|
105
|
+
const configMigrations = warlockConfigManager.get("database")?.migrations || [];
|
|
106
|
+
for (const MigrationClass of configMigrations) {
|
|
107
|
+
// Use class name as migration name if not set
|
|
108
|
+
if (!MigrationClass.migrationName) {
|
|
109
|
+
MigrationClass.migrationName = MigrationClass.name;
|
|
110
|
+
}
|
|
111
|
+
migrationRunner.register(MigrationClass);
|
|
112
|
+
}
|
|
113
|
+
// Always load file-based migrations from src/app, regardless of config
|
|
114
|
+
const migrations = await migrationFiles();
|
|
115
|
+
for (const migrationFile of migrations) {
|
|
116
|
+
await loadMigrationFile(migrationFile);
|
|
117
|
+
}
|
|
118
|
+
}export{migrateAction};//# sourceMappingURL=migrate-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-action.js","sources":["../../src/database/migrate-action.ts"],"sourcesContent":[null],"names":[],"mappings":"2mBAWA,eAAe,oBAAoB,GAAA;AACjC,IAAA,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AAExE,IAAA,OAAO,CAAC,GAAG,CAAC,CAAA,6BAAA,EAAgC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAA,EAAA,CAAI,CAAC,CAAC;AAExF,IAAA,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE;QAClC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,CAAC;QACtE,OAAO;AACR,KAAA;;AAGD,IAAA,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE;AACzC,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAC/E,QAAA,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS;cACjC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC;cAC1D,IAAI,CAAC;;QAGT,OAAO,CAAC,GAAG,CAAC,CAAA,EAAA,EAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAE,CAAA,CAAC,CAAC;;AAG3E,QAAA,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAI,CAAA,EAAA,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA,CAAE,CAAC,CAAC;;AAG3E,QAAA,IAAI,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,MAAM,iBAAiB,CAAC,aAAa,CAAC,CAAC;AACxC,KAAA;AACH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Model } from "@warlock.js/cascade";
|
|
2
|
+
import { Infer } from "@warlock.js/seal";
|
|
3
|
+
declare const schema: any;
|
|
4
|
+
type LogSchema = Infer<typeof schema>;
|
|
5
|
+
export declare class DatabaseLogModel extends Model<LogSchema> {
|
|
6
|
+
/**
|
|
7
|
+
* Table name
|
|
8
|
+
*/
|
|
9
|
+
static table: string;
|
|
10
|
+
/**
|
|
11
|
+
* {@inheritdoc}
|
|
12
|
+
*/
|
|
13
|
+
static schema: any;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=database-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-log.d.ts","sourceRoot":"","sources":["../../../../src/database/models/database-log/database-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAK,MAAM,kBAAkB,CAAC;AAE5C,QAAA,MAAM,MAAM,KAMV,CAAC;AAEH,KAAK,SAAS,GAAG,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAEtC,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC;IACpD;;OAEG;IACH,OAAc,KAAK,SAAU;IAE7B;;OAEG;IACH,OAAc,MAAM,MAAU;CAC/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {Model}from'@warlock.js/cascade';import {v}from'@warlock.js/seal';const schema = v.object({
|
|
2
|
+
module: v.string(),
|
|
3
|
+
action: v.string(),
|
|
4
|
+
message: v.string(),
|
|
5
|
+
trace: v.record(v.any()),
|
|
6
|
+
level: v.string(),
|
|
7
|
+
});
|
|
8
|
+
class DatabaseLogModel extends Model {
|
|
9
|
+
/**
|
|
10
|
+
* Table name
|
|
11
|
+
*/
|
|
12
|
+
static table = "logs";
|
|
13
|
+
/**
|
|
14
|
+
* {@inheritdoc}
|
|
15
|
+
*/
|
|
16
|
+
static schema = schema;
|
|
17
|
+
}export{DatabaseLogModel};//# sourceMappingURL=database-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-log.js","sources":["../../../../src/database/models/database-log/database-log.ts"],"sourcesContent":[null],"names":[],"mappings":"yEAGA,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AACtB,IAAA,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;AAClB,IAAA,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;AAClB,IAAA,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AACxB,IAAA,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;AAClB,CAAA,CAAC,CAAC;AAIG,MAAO,gBAAiB,SAAQ,KAAgB,CAAA;AACpD;;AAEG;AACI,IAAA,OAAO,KAAK,GAAG,MAAM,CAAC;AAE7B;;AAEG;AACI,IAAA,OAAO,MAAM,GAAG,MAAM,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/database/models/database-log/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-command-action.d.ts","sourceRoot":"","sources":["../../src/database/seed-command-action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAgBjD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,iBAkBjE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {dataSourceRegistry}from'@warlock.js/cascade';import {filesOrchestrator}from'../dev-server/files-orchestrator.js';import {Path}from'../dev-server/path.js';import {getFilesFromDirectory}from'../dev-server/utils.js';import'@warlock.js/logger';import'./models/database-log/database-log.js';import'../http/context/request-context.js';import {srcPath}from'../utils/paths.js';import'@mongez/slug';import'@mongez/supportive-is';import'@mongez/reinforcements';import {SeedersManager}from'./seeds/seeders.manager.js';async function clearAllTables(datasource) {
|
|
2
|
+
const tables = await datasource.driver.blueprint.listTables();
|
|
3
|
+
for (const table of tables) {
|
|
4
|
+
await datasource.driver.truncateTable(table, { cascade: true });
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
async function seedCommandAction(options) {
|
|
8
|
+
const { path, fresh, transaction } = options.options;
|
|
9
|
+
const datasource = dataSourceRegistry.get();
|
|
10
|
+
if (fresh) {
|
|
11
|
+
await clearAllTables(datasource);
|
|
12
|
+
}
|
|
13
|
+
const seeds = path
|
|
14
|
+
? [await loadSeedFile(Path.toAbsolute(path))]
|
|
15
|
+
: await listSeedsFiles();
|
|
16
|
+
const seedersManager = new SeedersManager();
|
|
17
|
+
seedersManager.register(...seeds);
|
|
18
|
+
await seedersManager.run(transaction);
|
|
19
|
+
}
|
|
20
|
+
async function listSeedsFiles() {
|
|
21
|
+
const seedsFiles = await getFilesFromDirectory(srcPath("app"), "*/seeds/*.ts");
|
|
22
|
+
const seeds = [];
|
|
23
|
+
for (const seedFile of seedsFiles) {
|
|
24
|
+
const seed = await loadSeedFile(seedFile);
|
|
25
|
+
seeds.push(seed);
|
|
26
|
+
}
|
|
27
|
+
return seeds;
|
|
28
|
+
}
|
|
29
|
+
async function loadSeedFile(absPath) {
|
|
30
|
+
const relativePath = Path.toRelative(absPath);
|
|
31
|
+
const seedImport = await filesOrchestrator.load(relativePath);
|
|
32
|
+
if (!seedImport || !seedImport.default) {
|
|
33
|
+
throw new Error(`Seeder file ${relativePath} does not export a default seeder.`);
|
|
34
|
+
}
|
|
35
|
+
return seedImport.default;
|
|
36
|
+
}export{seedCommandAction};//# sourceMappingURL=seed-command-action.js.map
|
|
@@ -0,0 +1 @@
|
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AAM,IAAI,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC1C,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClB,KAAA;AAED,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;AAED,eAAe,YAAY,CAAC,OAAe,EAAA;IACzC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAsB,YAAY,CAAC,CAAC;AAEnF,IAAA,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;AACtC,QAAA,MAAM,IAAI,KAAK,CAAC,eAAe,YAAY,CAAA,kCAAA,CAAoC,CAAC,CAAC;AAClF,KAAA;IAED,OAAO,UAAU,CAAC,OAAO,CAAC;AAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/seeds/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SeedResult } from "./types";
|
|
2
|
+
export type Seeder = {
|
|
3
|
+
/**
|
|
4
|
+
* Seed name
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to enable it
|
|
9
|
+
*/
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Seed description
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* List of dependent seeds to run first
|
|
17
|
+
*/
|
|
18
|
+
dependsOn?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Whether to run it once
|
|
21
|
+
*/
|
|
22
|
+
once?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Seed execution order
|
|
25
|
+
*/
|
|
26
|
+
order?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Batch size
|
|
29
|
+
*/
|
|
30
|
+
batchSize?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Run seed
|
|
33
|
+
*/
|
|
34
|
+
run(): Promise<SeedResult | void>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Create a new seeder
|
|
38
|
+
*/
|
|
39
|
+
export declare function seeder(seeder: Seeder): Seeder;
|
|
40
|
+
//# sourceMappingURL=seeder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeder.d.ts","sourceRoot":"","sources":["../../../src/database/seeds/seeder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,UAEpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeder.js","sources":["../../../src/database/seeds/seeder.ts"],"sourcesContent":[null],"names":[],"mappings":"AAqCA;;AAEG;AACG,SAAU,MAAM,CAAC,MAAc,EAAA;AACnC,IAAA,OAAO,MAAM,CAAC;AAChB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type DataSource, type DriverContract } from "@warlock.js/cascade";
|
|
2
|
+
import { Seeder } from "./seeder";
|
|
3
|
+
import { SeederMetadata, SeedResult } from "./types";
|
|
4
|
+
export type SeedersManagerOptions = {
|
|
5
|
+
datasource?: DataSource;
|
|
6
|
+
};
|
|
7
|
+
export declare class SeedersManager {
|
|
8
|
+
protected options?: SeedersManagerOptions;
|
|
9
|
+
seeders: Seeder[];
|
|
10
|
+
protected datasource?: DataSource;
|
|
11
|
+
constructor(options?: SeedersManagerOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Register new seeder
|
|
14
|
+
*/
|
|
15
|
+
register(...seeders: Seeder[]): this;
|
|
16
|
+
/**
|
|
17
|
+
* Initialize before running
|
|
18
|
+
*/
|
|
19
|
+
protected init(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Run seeders
|
|
22
|
+
*/
|
|
23
|
+
run(withTransaction?: boolean): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Prepare seeders to order by the seeder order
|
|
26
|
+
* Also keep an eye on the dependsOn for each seeder to make sure
|
|
27
|
+
* they are ordered correctly
|
|
28
|
+
*/
|
|
29
|
+
prepareSeeders(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Store seed results in db
|
|
32
|
+
*/
|
|
33
|
+
storeSeedsResults(seeder: Seeder, result: SeedResult): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Get seed info from database
|
|
36
|
+
*/
|
|
37
|
+
protected getMetadata(seeder: Seeder): Promise<SeederMetadata>;
|
|
38
|
+
/**
|
|
39
|
+
* Get driver instance
|
|
40
|
+
*/
|
|
41
|
+
protected get driver(): DriverContract;
|
|
42
|
+
/**
|
|
43
|
+
* Check if seeder has been executed before
|
|
44
|
+
*/
|
|
45
|
+
protected seederIsExecutedBefore(seeder: Seeder): Promise<boolean>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=seeders.manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeders.manager.d.ts","sourceRoot":"","sources":["../../../src/database/seeds/seeders.manager.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,cAAc,EAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrD,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,qBAAa,cAAc;IAKN,SAAS,CAAC,OAAO,CAAC,EAAE,qBAAqB;IAJrD,OAAO,EAAE,MAAM,EAAE,CAAM;IAE9B,SAAS,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;gBAEL,OAAO,CAAC,EAAE,qBAAqB;IAI5D;;OAEG;IACI,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE;IAKpC;;OAEG;cACa,IAAI;IAMpB;;OAEG;IACU,GAAG,CAAC,eAAe,UAAO;IA6DvC;;;;OAIG;IACI,cAAc;IAarB;;OAEG;IACU,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAoCjE;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAM9D;;OAEG;IACH,SAAS,KAAK,MAAM,IAAI,cAAc,CAErC;IAED;;OAEG;cACa,sBAAsB,CAAC,MAAM,EAAE,MAAM;CAGtD"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {colors}from'@mongez/copper';import {dataSourceRegistry,migrationRunner,transaction,DatabaseWriterValidationError}from'@warlock.js/cascade';import {SeedsTableMigration}from'./seeds-table-migration.js';import {seedsTableName}from'./utils.js';class SeedersManager {
|
|
2
|
+
options;
|
|
3
|
+
seeders = [];
|
|
4
|
+
datasource;
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
this.datasource = options?.datasource ?? dataSourceRegistry.get();
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Register new seeder
|
|
11
|
+
*/
|
|
12
|
+
register(...seeders) {
|
|
13
|
+
this.seeders.push(...seeders);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Initialize before running
|
|
18
|
+
*/
|
|
19
|
+
async init() {
|
|
20
|
+
if (!(await this.driver.blueprint.tableExists(seedsTableName))) {
|
|
21
|
+
await migrationRunner.run(SeedsTableMigration);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Run seeders
|
|
26
|
+
*/
|
|
27
|
+
async run(withTransaction = true) {
|
|
28
|
+
await this.init();
|
|
29
|
+
this.prepareSeeders();
|
|
30
|
+
console.log(`🌱 Running ${this.seeders.length} seeder(s)...\n`);
|
|
31
|
+
let successCount = 0;
|
|
32
|
+
let skippedCount = 0;
|
|
33
|
+
let failedCount = 0;
|
|
34
|
+
for (const seeder of this.seeders) {
|
|
35
|
+
// Check if already executed
|
|
36
|
+
if (seeder.once && (await this.seederIsExecutedBefore(seeder))) {
|
|
37
|
+
console.log(`⏭️ Skipping ${colors.yellow(seeder.name)} (already executed)`);
|
|
38
|
+
skippedCount++;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
console.log(`🔄 Running ${colors.green(seeder.name)}...`);
|
|
43
|
+
const startTime = Date.now();
|
|
44
|
+
const result = withTransaction
|
|
45
|
+
? await transaction(async () => seeder.run())
|
|
46
|
+
: await seeder.run();
|
|
47
|
+
const duration = Date.now() - startTime;
|
|
48
|
+
if (result) {
|
|
49
|
+
await this.storeSeedsResults(seeder, result);
|
|
50
|
+
}
|
|
51
|
+
console.log(`✅ ${colors.green(seeder.name)} completed (${duration}ms, ${result?.recordsCreated ?? 0} records)\n`);
|
|
52
|
+
successCount++;
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const err = error;
|
|
56
|
+
console.error(`❌ ${colors.red(seeder.name)} failed:`, err.message);
|
|
57
|
+
console.log(err);
|
|
58
|
+
failedCount++;
|
|
59
|
+
if (error instanceof DatabaseWriterValidationError) {
|
|
60
|
+
console.log(error.errors);
|
|
61
|
+
}
|
|
62
|
+
// Re-throw to stop execution (or continue to next seed based on your preference)
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Summary
|
|
67
|
+
console.log("\n" + "=".repeat(50));
|
|
68
|
+
console.log(`✅ Success: ${successCount}`);
|
|
69
|
+
if (skippedCount > 0)
|
|
70
|
+
console.log(`⏭️ Skipped: ${skippedCount}`);
|
|
71
|
+
if (failedCount > 0)
|
|
72
|
+
console.log(`❌ Failed: ${failedCount}`);
|
|
73
|
+
console.log("=".repeat(50));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Prepare seeders to order by the seeder order
|
|
77
|
+
* Also keep an eye on the dependsOn for each seeder to make sure
|
|
78
|
+
* they are ordered correctly
|
|
79
|
+
*/
|
|
80
|
+
prepareSeeders() {
|
|
81
|
+
this.seeders = this.seeders
|
|
82
|
+
.filter((seeder) => seeder.enabled !== false)
|
|
83
|
+
.sort((a, b) => {
|
|
84
|
+
const orderA = a.order ?? Number.MAX_SAFE_INTEGER;
|
|
85
|
+
const orderB = b.order ?? Number.MAX_SAFE_INTEGER;
|
|
86
|
+
return orderA - orderB;
|
|
87
|
+
});
|
|
88
|
+
// TODO: Handle dependsOn resolution
|
|
89
|
+
// This is more complex - needs topological sort
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Store seed results in db
|
|
93
|
+
*/
|
|
94
|
+
async storeSeedsResults(seeder, result) {
|
|
95
|
+
const oldResult = await this.getMetadata(seeder);
|
|
96
|
+
// log with an emoji icon at beginning of text no of total craeted records
|
|
97
|
+
console.log(`📊 Total records created: ${result.recordsCreated}`);
|
|
98
|
+
if (oldResult) {
|
|
99
|
+
// Update existing record - use query builder with WHERE clause
|
|
100
|
+
await this.driver
|
|
101
|
+
.queryBuilder(seedsTableName)
|
|
102
|
+
.where("name", seeder.name)
|
|
103
|
+
.update({
|
|
104
|
+
runCount: oldResult.runCount + 1,
|
|
105
|
+
lastRunAt: new Date(),
|
|
106
|
+
totalRecordsCreated: oldResult.totalRecordsCreated + result.recordsCreated,
|
|
107
|
+
lastRunRecordsCreated: result.recordsCreated,
|
|
108
|
+
});
|
|
109
|
+
// now display total created records so far
|
|
110
|
+
console.log(`📊 Total records created so far: ${oldResult.totalRecordsCreated + result.recordsCreated}`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// Insert new record
|
|
114
|
+
await this.driver.insert(seedsTableName, {
|
|
115
|
+
name: seeder.name,
|
|
116
|
+
createdAt: new Date(),
|
|
117
|
+
firstRunAt: new Date(),
|
|
118
|
+
lastRunAt: new Date(),
|
|
119
|
+
runCount: 1,
|
|
120
|
+
totalRecordsCreated: result.recordsCreated,
|
|
121
|
+
lastRunRecordsCreated: result.recordsCreated,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get seed info from database
|
|
127
|
+
*/
|
|
128
|
+
getMetadata(seeder) {
|
|
129
|
+
const driver = this.datasource.driver;
|
|
130
|
+
return driver.queryBuilder(seedsTableName).where("name", seeder.name).first();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get driver instance
|
|
134
|
+
*/
|
|
135
|
+
get driver() {
|
|
136
|
+
return this.datasource.driver;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Check if seeder has been executed before
|
|
140
|
+
*/
|
|
141
|
+
async seederIsExecutedBefore(seeder) {
|
|
142
|
+
return !!(await this.getMetadata(seeder));
|
|
143
|
+
}
|
|
144
|
+
}export{SeedersManager};//# sourceMappingURL=seeders.manager.js.map
|