@warlock.js/core 5.31.0 → 5.32.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/CHANGELOG.md +23 -0
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +1 -2
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +5 -7
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +3 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +14 -12
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
- package/esm/cli/commands/board/board-command.action.mjs +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
- package/esm/cli/commands/check/format-problems.mjs +1 -1
- package/esm/cli/commands/dev-server.command.mjs +3 -2
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +29 -16
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
- package/esm/cli/commands/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/postman-generator.action.mjs +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +1 -1
- package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/framework-cli-commands.mjs +2 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +2 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +3 -3
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +19 -16
- package/esm/config/config-schema.d.mts.map +1 -1
- package/esm/config/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +2 -1
- package/esm/config/index.mjs +1 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +2 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +2 -2
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +8 -7
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/socket-connector.d.mts +1 -3
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +12 -10
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -3
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +2 -3
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +1 -1
- package/esm/dev-server/create-worker.mjs +5 -3
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/files-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +5 -5
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +3 -2
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +2 -1
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +2 -1
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +2 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +6 -38
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/supervisor.mjs +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +28 -35
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/error-codes.d.mts +29 -22
- package/esm/errors/error-codes.d.mts.map +1 -1
- package/esm/errors/warlock-error.d.mts +1 -3
- package/esm/errors/warlock-error.d.mts.map +1 -1
- package/esm/generations/add-command.action.mjs +3 -2
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +2 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +2 -1
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs +2 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +1 -1
- package/esm/generations/generation-run.mjs +1 -1
- package/esm/generations/stubs.mjs +1 -1
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +4 -4
- package/esm/http/bounded-stream-queue.d.mts.map +1 -1
- package/esm/http/bounded-stream-queue.mjs +1 -1
- package/esm/http/bounded-stream-queue.mjs.map +1 -1
- package/esm/http/build-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +2 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +14 -13
- package/esm/http/conditional-request.d.mts.map +1 -1
- package/esm/http/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +10 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +2 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +2 -3
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +28 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/escape-header-value.d.mts +1 -2
- package/esm/http/escape-header-value.d.mts.map +1 -1
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +4 -1
- package/esm/http/index.mjs +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +10 -10
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +4 -3
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +20 -16
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +3 -3
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +8 -7
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +8 -7
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +12 -11
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +7 -7
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +3 -4
- package/esm/http/safe-redirect.d.mts.map +1 -1
- package/esm/http/serialized.d.mts +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +9 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +4 -4
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +49 -43
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +6 -6
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
- package/esm/http/uploads/image-variant-cache.mjs +8 -8
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +7 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +2 -4
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
- package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +1 -1
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +19 -17
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +21 -0
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +4 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +12 -14
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +2 -1
- package/esm/mail/index.mjs +1 -1
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -3
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/types.d.mts +23 -21
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +2 -1
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +12 -32
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/router/index.d.mts +2 -1
- package/esm/router/index.mjs +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +3 -3
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
- package/esm/router/route-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +1 -1
- package/esm/router/route-guard-names.mjs.map +1 -1
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +1 -3
- package/esm/router/route-name-taken-error.d.mts.map +1 -1
- package/esm/router/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +2 -4
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +8 -6
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +25 -26
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
- package/esm/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +1 -1
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +1 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +2 -2
- package/esm/storage/local-disk-roots.mjs.map +1 -1
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +3 -4
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/types.d.mts +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +5 -6
- package/esm/tests/authenticated-test-client.d.mts.map +1 -1
- package/esm/tests/factories.d.mts +38 -23
- package/esm/tests/factories.d.mts.map +1 -1
- package/esm/tests/fakes/cache-fake.d.mts +14 -9
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
- package/esm/tests/fakes/clock-fake.d.mts +13 -8
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
- package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
- package/esm/tests/fakes/ids-fake.d.mts +5 -4
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
- package/esm/tests/fakes/index.d.mts +2 -1
- package/esm/tests/fakes/index.mjs +1 -1
- package/esm/tests/fakes/mail-fake.d.mts +21 -13
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
- package/esm/tests/fakes/queue-fake.d.mts +21 -13
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.d.mts +12 -8
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.mjs +1 -1
- package/esm/tests/fakes/test-fakes.d.mts +8 -9
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +1 -1
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +1 -0
- package/esm/tests/snapshot-response.d.mts +4 -5
- package/esm/tests/snapshot-response.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +4 -6
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +5 -5
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +11 -12
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-http-server.d.mts +14 -10
- package/esm/tests/test-http-server.d.mts.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +6 -7
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
- package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
- package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
- package/esm/tooling/board/board-message.d.mts +4 -6
- package/esm/tooling/board/board-message.d.mts.map +1 -1
- package/esm/tooling/board/board.d.mts +50 -38
- package/esm/tooling/board/board.d.mts.map +1 -1
- package/esm/tooling/board/board.mjs +4 -3
- package/esm/tooling/board/board.mjs.map +1 -1
- package/esm/tooling/board/board.types.d.mts +32 -23
- package/esm/tooling/board/board.types.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.d.mts +4 -6
- package/esm/tooling/check/changed-files.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.mjs +2 -2
- package/esm/tooling/check/changed-files.mjs.map +1 -1
- package/esm/tooling/check/check-report.types.d.mts +22 -17
- package/esm/tooling/check/check-report.types.d.mts.map +1 -1
- package/esm/tooling/check/code-style-conventions.mjs +25 -25
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
- package/esm/tooling/check/conventions-step.d.mts +4 -6
- package/esm/tooling/check/conventions-step.d.mts.map +1 -1
- package/esm/tooling/check/conventions-step.mjs +7 -18
- package/esm/tooling/check/conventions-step.mjs.map +1 -1
- package/esm/tooling/check/environment-step.d.mts +2 -4
- package/esm/tooling/check/environment-step.d.mts.map +1 -1
- package/esm/tooling/check/environment-step.mjs +1 -1
- package/esm/tooling/check/index.mjs +1 -1
- package/esm/tooling/check/lint-step.d.mts +4 -5
- package/esm/tooling/check/lint-step.d.mts.map +1 -1
- package/esm/tooling/check/lint-step.mjs +2 -1
- package/esm/tooling/check/lint-step.mjs.map +1 -1
- package/esm/tooling/check/request-input.mjs +15 -15
- package/esm/tooling/check/request-input.mjs.map +1 -1
- package/esm/tooling/check/run-check.d.mts +22 -14
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-tests.d.mts +22 -15
- package/esm/tooling/check/run-tests.d.mts.map +1 -1
- package/esm/tooling/check/security-conventions.mjs +133 -131
- package/esm/tooling/check/security-conventions.mjs.map +1 -1
- package/esm/tooling/check/source-ast.mjs +92 -132
- package/esm/tooling/check/source-ast.mjs.map +1 -1
- package/esm/tooling/check/tests-step.d.mts +7 -8
- package/esm/tooling/check/tests-step.d.mts.map +1 -1
- package/esm/tooling/check/tests-step.mjs +3 -3
- package/esm/tooling/check/tests-step.mjs.map +1 -1
- package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
- package/esm/tooling/devtools/devtools-client.d.mts +29 -20
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
- package/esm/tooling/generate/generation.d.mts +34 -22
- package/esm/tooling/generate/generation.d.mts.map +1 -1
- package/esm/tooling/generate/generation.mjs +9 -5
- package/esm/tooling/generate/generation.mjs.map +1 -1
- package/esm/tooling/generate/generator-spec.d.mts +9 -9
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
- package/esm/tooling/generate/index.mjs +1 -1
- package/esm/tooling/generate/project-files.mjs +3 -3
- package/esm/tooling/generate/project-files.mjs.map +1 -1
- package/esm/tooling/generate/run-cli.d.mts +14 -11
- package/esm/tooling/generate/run-cli.d.mts.map +1 -1
- package/esm/tooling/generate/run-cli.mjs +2 -2
- package/esm/tooling/generate/run-cli.mjs.map +1 -1
- package/esm/tooling/generate/unified-diff.d.mts +10 -7
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
- package/esm/tooling/index.d.mts +1 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-config.mjs +3 -3
- package/esm/tooling/inspect/collect-config.mjs.map +1 -1
- package/esm/tooling/inspect/collect-models.d.mts +4 -3
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-models.mjs +1 -1
- package/esm/tooling/inspect/collect-packages.d.mts +1 -2
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-pages.mjs +10 -10
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
- package/esm/tooling/inspect/collect-routes.mjs +1 -1
- package/esm/tooling/inspect/event-recorder.d.mts +7 -7
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
- package/esm/tooling/inspect/index.d.mts +2 -1
- package/esm/tooling/inspect/index.mjs +1 -1
- package/esm/tooling/inspect/inspect-app.d.mts +25 -16
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
- package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
- package/esm/tooling/mcp/db-schema.d.mts +10 -9
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
- package/esm/tooling/mcp/docs-search.d.mts +20 -15
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
- package/esm/tooling/mcp/index.mjs +1 -1
- package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
- package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/mcp-tools.mjs +3 -2
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
- package/esm/tooling/mcp/tool-input.d.mts +7 -7
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
- package/esm/tooling/problem.d.mts +27 -17
- package/esm/tooling/problem.d.mts.map +1 -1
- package/esm/tooling/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +36 -22
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.d.mts +27 -20
- package/esm/tooling/trace/trace-request.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.mjs +2 -2
- package/esm/tooling/trace/trace-request.mjs.map +1 -1
- package/esm/tooling/typecheck/index.mjs +1 -1
- package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
- package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/upgrade/codemods/index.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
- package/esm/upgrade/diff.mjs +1 -1
- package/esm/upgrade/diff.mjs.map +1 -1
- package/esm/upgrade/load-ts-morph.mjs +3 -2
- package/esm/upgrade/load-ts-morph.mjs.map +1 -1
- package/esm/upgrade/run-upgrade.mjs +1 -1
- package/esm/use-cases/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +8 -6
- package/esm/utils/clock.d.mts.map +1 -1
- package/esm/utils/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +9 -6
- package/esm/utils/ids.d.mts.map +1 -1
- package/esm/utils/index.d.mts +2 -1
- package/esm/utils/index.mjs +1 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +11 -10
- package/esm/utils/runtime.d.mts.map +1 -1
- package/esm/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +5 -1
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +6 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +2 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +2 -2
- package/esm/validation/validation-failure-status.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +2 -4
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +6 -5
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +2 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/llms-full.txt +55 -5
- package/package.json +17 -15
- package/skills/create-module/SKILL.md +7 -0
- package/skills/index.md +2 -0
- package/skills/report-framework-issue.md +154 -0
- package/skills/run-app/SKILL.md +6 -5
- package/skills/upgrade-from-5-29/SKILL.md +41 -0
- package/skills/warlock-check/SKILL.md +1 -0
- package/esm/tooling/check/index.d.mts +0 -8
- package/esm/tooling/typecheck/index.d.mts +0 -1
|
@@ -2,7 +2,7 @@ import { environment } from "../utils/environment.mjs";
|
|
|
2
2
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
3
3
|
import { BaseConnector } from "./base-connector.mjs";
|
|
4
4
|
import { memoryCacheWarning } from "./single-server-warnings.mjs";
|
|
5
|
-
import
|
|
5
|
+
import baseConfig from "@mongez/config";
|
|
6
6
|
import { log } from "@warlock.js/logger";
|
|
7
7
|
import { cache } from "@warlock.js/cache";
|
|
8
8
|
|
|
@@ -23,11 +23,11 @@ var CacheConnector = class extends BaseConnector {
|
|
|
23
23
|
* Initialize cache connection
|
|
24
24
|
*/
|
|
25
25
|
async start() {
|
|
26
|
-
const cacheConfig =
|
|
26
|
+
const cacheConfig = baseConfig.get("cache");
|
|
27
27
|
if (!cacheConfig) return;
|
|
28
28
|
cache.setCacheConfigurations(cacheConfig);
|
|
29
29
|
await cache.init();
|
|
30
|
-
const warning = memoryCacheWarning(cache.currentDriver?.name ?? cacheConfig.default, cache.currentDriver?.constructor?.name, environment(),
|
|
30
|
+
const warning = memoryCacheWarning(cache.currentDriver?.name ?? cacheConfig.default, cache.currentDriver?.constructor?.name, environment(), baseConfig.get("cache.silenceSingleServerWarning") === true);
|
|
31
31
|
if (warning) log.warn("cache", "single-server", warning);
|
|
32
32
|
this.active = true;
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-connector.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/cache-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { cache } from \"@warlock.js/cache\";\nimport type { CacheDriver } from \"@warlock.js/cache\";\nimport { log } from \"@warlock.js/logger\";\nimport { environment } from \"../utils/environment\";\nimport { BaseConnector } from \"./base-connector\";\nimport { memoryCacheWarning } from \"./single-server-warnings\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\n/**\n * Cache Connector\n * Manages cache engine connection lifecycle\n */\nexport class CacheConnector extends BaseConnector {\n public readonly name = \"cache\";\n public readonly priority = ConnectorPriority.CACHE;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Early;\n\n /**\n * Files that trigger cache restart\n */\n protected readonly watchedFiles = [\"src/config/cache.ts\", \"src/config/cache.tsx\"];\n\n /**\n * Initialize cache connection\n */\n public async start(): Promise<void> {\n const cacheConfig = config.get(\"cache\");\n\n if (!cacheConfig) return;\n\n cache.setCacheConfigurations(cacheConfig);\n\n await cache.init();\n\n const warning = memoryCacheWarning(\n cache.currentDriver?.name ?? cacheConfig.default,\n cache.currentDriver?.constructor?.name,\n environment(),\n config.get(\"cache.silenceSingleServerWarning\") === true,\n );\n\n if (warning) log.warn(\"cache\", \"single-server\", warning);\n\n this.active = true;\n }\n\n /**\n * Shutdown cache connection\n *\n * Disconnects every loaded cache driver so external clients (e.g. a Redis\n * connection) are released instead of left dangling — mirroring the\n * database and herald connectors, which disconnect all registered\n * connections on shutdown.\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n // Disconnect every driver the manager loaded (not just the current one),\n // so secondary drivers selected via `cache.use(\"...\")` also release their\n // connections.\n const drivers: CacheDriver<unknown, unknown>[] = Object.values(cache.loadedDrivers);\n\n for (const driver of drivers) {\n await driver.disconnect();\n }\n\n this.active = false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,iBAAb,cAAoC,cAAc;;;cACzB;;;sBAOW,CAAC,uBAAuB,sBAAsB;;;;;CAKhF,MAAa,QAAuB;EAClC,MAAM,
|
|
1
|
+
{"version":3,"file":"cache-connector.mjs","names":["config"],"sources":["../../../../../../../../packages/core/src/connectors/cache-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { cache } from \"@warlock.js/cache\";\nimport type { CacheDriver } from \"@warlock.js/cache\";\nimport { log } from \"@warlock.js/logger\";\nimport { environment } from \"../utils/environment\";\nimport { BaseConnector } from \"./base-connector\";\nimport { memoryCacheWarning } from \"./single-server-warnings\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\n/**\n * Cache Connector\n * Manages cache engine connection lifecycle\n */\nexport class CacheConnector extends BaseConnector {\n public readonly name = \"cache\";\n public readonly priority = ConnectorPriority.CACHE;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Early;\n\n /**\n * Files that trigger cache restart\n */\n protected readonly watchedFiles = [\"src/config/cache.ts\", \"src/config/cache.tsx\"];\n\n /**\n * Initialize cache connection\n */\n public async start(): Promise<void> {\n const cacheConfig = config.get(\"cache\");\n\n if (!cacheConfig) return;\n\n cache.setCacheConfigurations(cacheConfig);\n\n await cache.init();\n\n const warning = memoryCacheWarning(\n cache.currentDriver?.name ?? cacheConfig.default,\n cache.currentDriver?.constructor?.name,\n environment(),\n config.get(\"cache.silenceSingleServerWarning\") === true,\n );\n\n if (warning) log.warn(\"cache\", \"single-server\", warning);\n\n this.active = true;\n }\n\n /**\n * Shutdown cache connection\n *\n * Disconnects every loaded cache driver so external clients (e.g. a Redis\n * connection) are released instead of left dangling — mirroring the\n * database and herald connectors, which disconnect all registered\n * connections on shutdown.\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n // Disconnect every driver the manager loaded (not just the current one),\n // so secondary drivers selected via `cache.use(\"...\")` also release their\n // connections.\n const drivers: CacheDriver<unknown, unknown>[] = Object.values(cache.loadedDrivers);\n\n for (const driver of drivers) {\n await driver.disconnect();\n }\n\n this.active = false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,iBAAb,cAAoC,cAAc;;;cACzB;;;sBAOW,CAAC,uBAAuB,sBAAsB;;;;;CAKhF,MAAa,QAAuB;EAClC,MAAM,cAAcA,WAAO,IAAI,OAAO;EAEtC,IAAI,CAAC,aAAa;EAElB,MAAM,uBAAuB,WAAW;EAExC,MAAM,MAAM,KAAK;EAEjB,MAAM,UAAU,mBACd,MAAM,eAAe,QAAQ,YAAY,SACzC,MAAM,eAAe,aAAa,MAClC,YAAY,GACZA,WAAO,IAAI,kCAAkC,MAAM,IACrD;EAEA,IAAI,SAAS,IAAI,KAAK,SAAS,iBAAiB,OAAO;EAEvD,KAAK,SAAS;CAChB;;;;;;;;;CAUA,MAAa,WAA0B;EACrC,IAAI,CAAC,KAAK,QACR;EAMF,MAAM,UAA2C,OAAO,OAAO,MAAM,aAAa;EAElF,KAAK,MAAM,UAAU,SACnB,MAAM,OAAO,WAAW;EAG1B,KAAK,SAAS;CAChB;AACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Connector, ConnectorLifecyclePhase, ConnectorName } from "./types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/connectors/connectors-manager.d.ts
|
|
4
|
-
declare class ConnectorsManager {
|
|
3
|
+
export declare class ConnectorsManager {
|
|
5
4
|
/**
|
|
6
5
|
* Connectors list
|
|
7
6
|
*/
|
|
@@ -96,7 +95,6 @@ declare class ConnectorsManager {
|
|
|
96
95
|
*/
|
|
97
96
|
shutdownOnProcessKill(): void;
|
|
98
97
|
}
|
|
99
|
-
declare const connectorsManager: ConnectorsManager;
|
|
98
|
+
export declare const connectorsManager: ConnectorsManager;
|
|
100
99
|
//#endregion
|
|
101
|
-
export { ConnectorsManager, connectorsManager };
|
|
102
100
|
//# sourceMappingURL=connectors-manager.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors-manager.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/connectors-manager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"connectors-manager.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/connectors-manager.ts"],"mappings":";;qBAsBa;;;;mBAIM;;;;;;;;;;;;;mBAcA;;;;EAKjB;;;;;;;;UAqBQ;;;;;;;;;EAgBD,cAAc;;;;EAOd,YAAY,YAAY;;;;EASxB,QAAQ;;;;;;;;EAWR,IAAI,MAAM;;;;EAOJ,MAAM,kBAAkB,kBAAkB;;;;;;;;;;EAuB1C,WAAW,OAAO,0BAA0B;;;;EAiB5C,aAAa,oBAAoB,kBAAkB;;;;EAWnD,YAAY;;;;UA8CX;;;;;;;;;;;;;EAgCP;;qBAyBI,mBAAiB"}
|
|
@@ -11,7 +11,7 @@ import { MailerConnector } from "./mail-connector.mjs";
|
|
|
11
11
|
import { NotificationsConnector } from "./notifications-connector.mjs";
|
|
12
12
|
import { SocketConnector } from "./socket-connector.mjs";
|
|
13
13
|
import { StorageConnector } from "./storage.connector.mjs";
|
|
14
|
-
import
|
|
14
|
+
import baseConfig from "@mongez/config";
|
|
15
15
|
import { log } from "@warlock.js/logger";
|
|
16
16
|
|
|
17
17
|
//#region ../../packages/core/src/connectors/connectors-manager.ts
|
|
@@ -118,7 +118,7 @@ var ConnectorsManager = class {
|
|
|
118
118
|
await Application.runShutdownHooks();
|
|
119
119
|
const reversed = [...this.connectors].reverse();
|
|
120
120
|
const ordered = [...reversed.filter((connector) => connector.name === "http"), ...reversed.filter((connector) => connector.name !== "http")];
|
|
121
|
-
const timeout =
|
|
121
|
+
const timeout = baseConfig.get("app.shutdownTimeout", DEFAULT_SHUTDOWN_TIMEOUT);
|
|
122
122
|
let current;
|
|
123
123
|
const timer = setTimeout(() => {
|
|
124
124
|
console.error(`Shutdown timed out after ${timeout}ms; connector still shutting down: ${current ?? "none"}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors-manager.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/connectors-manager.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { Application } from \"../application\";\nimport { log } from \"@warlock.js/logger\";\nimport { AccessConnector } from \"./access-connector\";\nimport { AiConnector } from \"./ai-connector\";\nimport { CacheConnector } from \"./cache-connector\";\nimport { DatabaseConnector } from \"./database-connector\";\nimport { HeraldConnector } from \"./herald-connector\";\nimport { HttpConnector } from \"./http-connector\";\nimport { LoggerConnector } from \"./logger-connector\";\nimport { MailerConnector } from \"./mail-connector\";\nimport { NotificationsConnector } from \"./notifications-connector\";\nimport { SocketConnector } from \"./socket-connector\";\nimport { StorageConnector } from \"./storage.connector\";\nimport { ConnectorLifecyclePhase } from \"./types\";\nimport type { Connector, ConnectorName } from \"./types\";\n\n/**\n * Overall shutdown budget in ms. Override via `app.shutdownTimeout`.\n */\nconst DEFAULT_SHUTDOWN_TIMEOUT = 10_000;\n\nexport class ConnectorsManager {\n /**\n * Connectors list\n */\n private readonly connectors: Connector[] = [];\n\n /**\n * The names the framework's own connectors hold.\n *\n * Filled by the constructor's own registration calls rather than declared\n * beside them, so there is exactly ONE place a built-in name exists: the\n * connector that owns it. A second list — in the builder, in a config\n * validator, in a test double — is a list that drifts the moment a built-in\n * is added or renamed, and it drifts silently, because nothing compares the\n * two. Both halves of a connector's life read this one through\n * {@link isBuiltInName}: the build refuses a `connectors` array that claims\n * a built-in name, and so does registration.\n */\n private readonly builtInNames = new Set<string>();\n\n /**\n * Constructor\n */\n public constructor() {\n this.registerBuiltIn(new LoggerConnector());\n this.registerBuiltIn(new MailerConnector());\n this.registerBuiltIn(new HttpConnector());\n this.registerBuiltIn(new DatabaseConnector());\n this.registerBuiltIn(new HeraldConnector());\n this.registerBuiltIn(new CacheConnector());\n this.registerBuiltIn(new StorageConnector());\n this.registerBuiltIn(new SocketConnector());\n this.registerBuiltIn(new NotificationsConnector());\n this.registerBuiltIn(new AccessConnector());\n this.registerBuiltIn(new AiConnector());\n }\n\n /**\n * Register a framework-owned connector and reserve its name.\n *\n * Private on purpose: an app connector must not be able to reserve a name,\n * and the set is only correct if every entry in it came from a connector\n * this class constructed itself.\n */\n private registerBuiltIn(...connectors: Connector[]): void {\n for (const connector of connectors) {\n this.builtInNames.add(connector.name);\n }\n\n this.register(...connectors);\n }\n\n /**\n * Whether the given name belongs to a framework built-in connector.\n *\n * Reserved, not merely taken: a configured connector carrying one of these\n * names would be skipped by {@link has} at boot while the build had already\n * drained its contribution, so the artifact would carry a connector the\n * server never runs. Callers refuse the name instead of skipping it.\n */\n public isBuiltInName(name: string): boolean {\n return this.builtInNames.has(name);\n }\n\n /**\n * Register a connector\n */\n public register(...connectors: Connector[]): void {\n this.connectors.push(...connectors);\n // sort connectors by priority\n this.connectors.sort((a, b) => a.priority - b.priority);\n }\n\n /**\n * Get all connectors\n */\n public list(): Connector[] {\n return this.connectors;\n }\n\n /**\n * Whether a connector with the given name is already registered.\n *\n * Names are the identity of a connector here, which is what lets a caller\n * that may run more than once per process register idempotently instead of\n * stacking duplicates that would each boot and shut down.\n */\n public has(name: ConnectorName): boolean {\n return this.connectors.some((connector) => connector.name === name);\n }\n\n /**\n * start all connectors\n */\n public async start(connectorsNames?: ConnectorName[]): Promise<void> {\n const connectorsList = connectorsNames\n ? this.connectors.filter((connector) => connectorsNames.includes(connector.name))\n : this.connectors;\n\n for (const connector of connectorsList) {\n await connector.boot();\n }\n\n for (const connector of connectorsList) {\n await connector.start();\n }\n }\n\n /**\n * Start all connectors in the given lifecycle phase.\n *\n * The production builder and dev preload split startup around app\n * code: early phase before app imports, late phase after. Within a\n * phase, all connectors `boot()` first, then all `start()`, so\n * cross-connector wiring inside the phase still works (e.g. socket\n * reads http's instance during its own boot).\n */\n public async startPhase(phase: ConnectorLifecyclePhase): Promise<void> {\n const phaseConnectors = this.connectors.filter(\n (connector) => connector.lifecyclePhase === phase,\n );\n\n for (const connector of phaseConnectors) {\n await connector.boot();\n }\n\n for (const connector of phaseConnectors) {\n await connector.start();\n }\n }\n\n /**\n * Start all connectors except the given ones\n */\n public async startWithout(excludedConnectors: ConnectorName[]): Promise<void> {\n await this.start(\n this.connectors\n .filter((connector) => !excludedConnectors.includes(connector.name))\n .map((connector) => connector.name),\n );\n }\n\n /**\n * Shutdown all connectors\n */\n public async shutdown(): Promise<void> {\n // App-owned teardown runs first, while every connector (db, cache, http) is\n // still up, so cleanup hooks can use them. Idempotent + error-isolated.\n await Application.runShutdownHooks();\n\n // HTTP stops accepting and drains in-flight requests FIRST, while storage,\n // socket, etc. are still up; then the rest go in reverse priority. Copy the\n // list first — `reverse()` mutates in place, so reversing the live array\n // would corrupt the order on a second shutdown pass.\n const reversed = [...this.connectors].reverse();\n const ordered = [\n ...reversed.filter((connector) => connector.name === \"http\"),\n ...reversed.filter((connector) => connector.name !== \"http\"),\n ];\n\n const timeout = config.get(\"app.shutdownTimeout\", DEFAULT_SHUTDOWN_TIMEOUT);\n let current: string | undefined;\n\n const timer = setTimeout(() => {\n // Sync write: the process exits right after, so an async log would be lost.\n console.error(\n `Shutdown timed out after ${timeout}ms; connector still shutting down: ${current ?? \"none\"}`,\n );\n process.exit(1);\n }, timeout);\n timer.unref?.();\n\n try {\n for (const connector of ordered) {\n current = connector.name;\n await this.shutdownOne(connector);\n }\n current = undefined;\n } finally {\n clearTimeout(timer);\n }\n\n // Log calls return before an async channel (file, Sentry) has written the\n // entry, so a channel would lose it when the process exits; `flush()` waits\n // for those deliveries.\n await log.flush();\n }\n\n /**\n * Shut one connector down, isolating and reporting its failure.\n */\n private async shutdownOne(connector: Connector): Promise<void> {\n try {\n await connector.shutdown();\n } catch (error) {\n try {\n // Synchronous: the entry is handed to every channel before this\n // returns. `shutdown()` then flushes async channels before resolving,\n // because the caller (`shutdownOnProcessKill`) calls `process.exit(0)`\n // as soon as it does.\n log.error(\"connectors\", \"shutdown\", error as Error, { connector: connector.name });\n } catch {\n // Reporting a failure must never become a worse failure than the one\n // being reported: anything thrown here (a redact rule, say) would\n // otherwise abort the remaining teardown. Swallowed\n // rather than re-reported: the only channel we could report it through\n // is the one that just threw.\n }\n }\n }\n\n /**\n * Shutdown connectors on process kill\n *\n * Registers signal handlers that run an idempotent graceful shutdown:\n * - SIGINT: Ctrl+C on Unix, also caught on Windows but unreliable in child processes\n * - SIGTERM: Termination signal (Unix primarily)\n * - SIGHUP: registered on Windows (`win32`) only, to catch Ctrl+C / console close\n *\n * Note: no `beforeExit` handler is registered — `beforeExit` cannot reliably\n * await async teardown (the process exits once the callback returns), so\n * shutdown is driven entirely by the signal handlers above.\n */\n public shutdownOnProcessKill(): void {\n let isShuttingDown = false;\n\n const gracefulShutdown = async (signal: string) => {\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n console.log(`\\nExiting...`);\n await this.shutdown();\n process.exit(0);\n };\n\n // Unix signals\n process.on(\"SIGINT\", () => gracefulShutdown(\"SIGINT\"));\n process.on(\"SIGTERM\", () => gracefulShutdown(\"SIGTERM\"));\n\n // Windows-specific: handle when process is about to exit\n // This is more reliable on Windows for spawned child processes\n if (process.platform === \"win32\") {\n // Handle Ctrl+C on Windows specifically\n process.on(\"SIGHUP\", () => gracefulShutdown(\"SIGHUP\"));\n }\n }\n}\n\nexport const connectorsManager = new ConnectorsManager();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,2BAA2B;AAEjC,IAAa,oBAAb,MAA+B;;;;CAuB7B,AAAO,cAAc;oBAnBsB,CAAC;sCAcZ,IAAI,IAAY;EAM9C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,cAAc,CAAC;EACxC,KAAK,gBAAgB,IAAI,kBAAkB,CAAC;EAC5C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,eAAe,CAAC;EACzC,KAAK,gBAAgB,IAAI,iBAAiB,CAAC;EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,uBAAuB,CAAC;E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":["config"],"sources":["../../../../../../../../packages/core/src/connectors/connectors-manager.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { Application } from \"../application\";\nimport { log } from \"@warlock.js/logger\";\nimport { AccessConnector } from \"./access-connector\";\nimport { AiConnector } from \"./ai-connector\";\nimport { CacheConnector } from \"./cache-connector\";\nimport { DatabaseConnector } from \"./database-connector\";\nimport { HeraldConnector } from \"./herald-connector\";\nimport { HttpConnector } from \"./http-connector\";\nimport { LoggerConnector } from \"./logger-connector\";\nimport { MailerConnector } from \"./mail-connector\";\nimport { NotificationsConnector } from \"./notifications-connector\";\nimport { SocketConnector } from \"./socket-connector\";\nimport { StorageConnector } from \"./storage.connector\";\nimport { ConnectorLifecyclePhase } from \"./types\";\nimport type { Connector, ConnectorName } from \"./types\";\n\n/**\n * Overall shutdown budget in ms. Override via `app.shutdownTimeout`.\n */\nconst DEFAULT_SHUTDOWN_TIMEOUT = 10_000;\n\nexport class ConnectorsManager {\n /**\n * Connectors list\n */\n private readonly connectors: Connector[] = [];\n\n /**\n * The names the framework's own connectors hold.\n *\n * Filled by the constructor's own registration calls rather than declared\n * beside them, so there is exactly ONE place a built-in name exists: the\n * connector that owns it. A second list — in the builder, in a config\n * validator, in a test double — is a list that drifts the moment a built-in\n * is added or renamed, and it drifts silently, because nothing compares the\n * two. Both halves of a connector's life read this one through\n * {@link isBuiltInName}: the build refuses a `connectors` array that claims\n * a built-in name, and so does registration.\n */\n private readonly builtInNames = new Set<string>();\n\n /**\n * Constructor\n */\n public constructor() {\n this.registerBuiltIn(new LoggerConnector());\n this.registerBuiltIn(new MailerConnector());\n this.registerBuiltIn(new HttpConnector());\n this.registerBuiltIn(new DatabaseConnector());\n this.registerBuiltIn(new HeraldConnector());\n this.registerBuiltIn(new CacheConnector());\n this.registerBuiltIn(new StorageConnector());\n this.registerBuiltIn(new SocketConnector());\n this.registerBuiltIn(new NotificationsConnector());\n this.registerBuiltIn(new AccessConnector());\n this.registerBuiltIn(new AiConnector());\n }\n\n /**\n * Register a framework-owned connector and reserve its name.\n *\n * Private on purpose: an app connector must not be able to reserve a name,\n * and the set is only correct if every entry in it came from a connector\n * this class constructed itself.\n */\n private registerBuiltIn(...connectors: Connector[]): void {\n for (const connector of connectors) {\n this.builtInNames.add(connector.name);\n }\n\n this.register(...connectors);\n }\n\n /**\n * Whether the given name belongs to a framework built-in connector.\n *\n * Reserved, not merely taken: a configured connector carrying one of these\n * names would be skipped by {@link has} at boot while the build had already\n * drained its contribution, so the artifact would carry a connector the\n * server never runs. Callers refuse the name instead of skipping it.\n */\n public isBuiltInName(name: string): boolean {\n return this.builtInNames.has(name);\n }\n\n /**\n * Register a connector\n */\n public register(...connectors: Connector[]): void {\n this.connectors.push(...connectors);\n // sort connectors by priority\n this.connectors.sort((a, b) => a.priority - b.priority);\n }\n\n /**\n * Get all connectors\n */\n public list(): Connector[] {\n return this.connectors;\n }\n\n /**\n * Whether a connector with the given name is already registered.\n *\n * Names are the identity of a connector here, which is what lets a caller\n * that may run more than once per process register idempotently instead of\n * stacking duplicates that would each boot and shut down.\n */\n public has(name: ConnectorName): boolean {\n return this.connectors.some((connector) => connector.name === name);\n }\n\n /**\n * start all connectors\n */\n public async start(connectorsNames?: ConnectorName[]): Promise<void> {\n const connectorsList = connectorsNames\n ? this.connectors.filter((connector) => connectorsNames.includes(connector.name))\n : this.connectors;\n\n for (const connector of connectorsList) {\n await connector.boot();\n }\n\n for (const connector of connectorsList) {\n await connector.start();\n }\n }\n\n /**\n * Start all connectors in the given lifecycle phase.\n *\n * The production builder and dev preload split startup around app\n * code: early phase before app imports, late phase after. Within a\n * phase, all connectors `boot()` first, then all `start()`, so\n * cross-connector wiring inside the phase still works (e.g. socket\n * reads http's instance during its own boot).\n */\n public async startPhase(phase: ConnectorLifecyclePhase): Promise<void> {\n const phaseConnectors = this.connectors.filter(\n (connector) => connector.lifecyclePhase === phase,\n );\n\n for (const connector of phaseConnectors) {\n await connector.boot();\n }\n\n for (const connector of phaseConnectors) {\n await connector.start();\n }\n }\n\n /**\n * Start all connectors except the given ones\n */\n public async startWithout(excludedConnectors: ConnectorName[]): Promise<void> {\n await this.start(\n this.connectors\n .filter((connector) => !excludedConnectors.includes(connector.name))\n .map((connector) => connector.name),\n );\n }\n\n /**\n * Shutdown all connectors\n */\n public async shutdown(): Promise<void> {\n // App-owned teardown runs first, while every connector (db, cache, http) is\n // still up, so cleanup hooks can use them. Idempotent + error-isolated.\n await Application.runShutdownHooks();\n\n // HTTP stops accepting and drains in-flight requests FIRST, while storage,\n // socket, etc. are still up; then the rest go in reverse priority. Copy the\n // list first — `reverse()` mutates in place, so reversing the live array\n // would corrupt the order on a second shutdown pass.\n const reversed = [...this.connectors].reverse();\n const ordered = [\n ...reversed.filter((connector) => connector.name === \"http\"),\n ...reversed.filter((connector) => connector.name !== \"http\"),\n ];\n\n const timeout = config.get(\"app.shutdownTimeout\", DEFAULT_SHUTDOWN_TIMEOUT);\n let current: string | undefined;\n\n const timer = setTimeout(() => {\n // Sync write: the process exits right after, so an async log would be lost.\n console.error(\n `Shutdown timed out after ${timeout}ms; connector still shutting down: ${current ?? \"none\"}`,\n );\n process.exit(1);\n }, timeout);\n timer.unref?.();\n\n try {\n for (const connector of ordered) {\n current = connector.name;\n await this.shutdownOne(connector);\n }\n current = undefined;\n } finally {\n clearTimeout(timer);\n }\n\n // Log calls return before an async channel (file, Sentry) has written the\n // entry, so a channel would lose it when the process exits; `flush()` waits\n // for those deliveries.\n await log.flush();\n }\n\n /**\n * Shut one connector down, isolating and reporting its failure.\n */\n private async shutdownOne(connector: Connector): Promise<void> {\n try {\n await connector.shutdown();\n } catch (error) {\n try {\n // Synchronous: the entry is handed to every channel before this\n // returns. `shutdown()` then flushes async channels before resolving,\n // because the caller (`shutdownOnProcessKill`) calls `process.exit(0)`\n // as soon as it does.\n log.error(\"connectors\", \"shutdown\", error as Error, { connector: connector.name });\n } catch {\n // Reporting a failure must never become a worse failure than the one\n // being reported: anything thrown here (a redact rule, say) would\n // otherwise abort the remaining teardown. Swallowed\n // rather than re-reported: the only channel we could report it through\n // is the one that just threw.\n }\n }\n }\n\n /**\n * Shutdown connectors on process kill\n *\n * Registers signal handlers that run an idempotent graceful shutdown:\n * - SIGINT: Ctrl+C on Unix, also caught on Windows but unreliable in child processes\n * - SIGTERM: Termination signal (Unix primarily)\n * - SIGHUP: registered on Windows (`win32`) only, to catch Ctrl+C / console close\n *\n * Note: no `beforeExit` handler is registered — `beforeExit` cannot reliably\n * await async teardown (the process exits once the callback returns), so\n * shutdown is driven entirely by the signal handlers above.\n */\n public shutdownOnProcessKill(): void {\n let isShuttingDown = false;\n\n const gracefulShutdown = async (signal: string) => {\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n console.log(`\\nExiting...`);\n await this.shutdown();\n process.exit(0);\n };\n\n // Unix signals\n process.on(\"SIGINT\", () => gracefulShutdown(\"SIGINT\"));\n process.on(\"SIGTERM\", () => gracefulShutdown(\"SIGTERM\"));\n\n // Windows-specific: handle when process is about to exit\n // This is more reliable on Windows for spawned child processes\n if (process.platform === \"win32\") {\n // Handle Ctrl+C on Windows specifically\n process.on(\"SIGHUP\", () => gracefulShutdown(\"SIGHUP\"));\n }\n }\n}\n\nexport const connectorsManager = new ConnectorsManager();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,2BAA2B;AAEjC,IAAa,oBAAb,MAA+B;;;;CAuB7B,AAAO,cAAc;oBAnBsB,CAAC;sCAcZ,IAAI,IAAY;EAM9C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,cAAc,CAAC;EACxC,KAAK,gBAAgB,IAAI,kBAAkB,CAAC;EAC5C,KAAK,gBAAgB,IAAI,gBAAgB,CAAC;EAC1C,KAAK,gBAAgB,IAAI,eAAe,CAAC;EACzC,KAAK,gBAAgB,IAAI,iBAAiB,CAAC;EAC3C,KAAK,gBAAgB,IAAI,gBAAgB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I,kBAAkB"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
2
2
|
import { BaseConnector } from "./base-connector.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/connectors/database-connector.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Database Connector
|
|
7
6
|
* Manages database connection lifecycle using @warlock.js/cascade
|
|
8
7
|
*/
|
|
9
|
-
declare class DatabaseConnector extends BaseConnector {
|
|
8
|
+
export declare class DatabaseConnector extends BaseConnector {
|
|
10
9
|
readonly name = "database";
|
|
11
10
|
readonly priority = ConnectorPriority.DATABASE;
|
|
12
11
|
readonly lifecyclePhase = ConnectorLifecyclePhase.Early;
|
|
@@ -24,5 +23,4 @@ declare class DatabaseConnector extends BaseConnector {
|
|
|
24
23
|
shutdown(): Promise<void>;
|
|
25
24
|
}
|
|
26
25
|
//#endregion
|
|
27
|
-
export { DatabaseConnector };
|
|
28
26
|
//# sourceMappingURL=database-connector.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/database-connector.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"database-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/database-connector.ts"],"mappings":";;;;;;;qBAUa,0BAA0B;WACrB;WACA,WAAQ,kBAAA;WACR,iBAAc,wBAAA;;;;qBAKX;;;;EAKN,SAAS;;;;EAoBT,YAAY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { container } from "../container/index.mjs";
|
|
2
2
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
3
3
|
import { BaseConnector } from "./base-connector.mjs";
|
|
4
|
-
import
|
|
4
|
+
import baseConfig from "@mongez/config";
|
|
5
5
|
import { connectToDatabase, dataSourceRegistry } from "@warlock.js/cascade";
|
|
6
6
|
|
|
7
7
|
//#region ../../packages/core/src/connectors/database-connector.ts
|
|
@@ -21,7 +21,7 @@ var DatabaseConnector = class extends BaseConnector {
|
|
|
21
21
|
* Initialize database connection
|
|
22
22
|
*/
|
|
23
23
|
async start() {
|
|
24
|
-
const databaseConfig =
|
|
24
|
+
const databaseConfig = baseConfig.get("database");
|
|
25
25
|
if (!databaseConfig) return;
|
|
26
26
|
try {
|
|
27
27
|
const source = await connectToDatabase(databaseConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-connector.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/database-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { connectToDatabase, dataSourceRegistry } from \"@warlock.js/cascade\";\nimport { container } from \"../container\";\nimport { BaseConnector } from \"./base-connector\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\n/**\n * Database Connector\n * Manages database connection lifecycle using @warlock.js/cascade\n */\nexport class DatabaseConnector extends BaseConnector {\n public readonly name = \"database\";\n public readonly priority = ConnectorPriority.DATABASE;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Early;\n\n /**\n * Files that trigger database restart\n */\n protected readonly watchedFiles = [\"src/config/database.ts\", \"src/config/database.tsx\"];\n\n /**\n * Initialize database connection\n */\n public async start(): Promise<void> {\n const databaseConfig = config.get(\"database\");\n\n if (!databaseConfig) {\n return;\n }\n\n try {\n const source = await connectToDatabase(databaseConfig);\n container.set(\"database.source\", source);\n this.active = true;\n } catch (error) {\n console.error(\"Failed to connect to database:\", error);\n throw error;\n }\n }\n\n /**\n * Shutdown database connection\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n try {\n // Disconnect all registered data sources\n const dataSources = dataSourceRegistry.getAllDataSources();\n\n for (const dataSource of dataSources) {\n if (dataSource.driver.isConnected) {\n await dataSource.driver.disconnect();\n }\n }\n\n this.active = false;\n } catch (error) {\n console.error(\"Failed to disconnect from database:\", error);\n throw error;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAUA,IAAa,oBAAb,cAAuC,cAAc;;;cAC5B;;;sBAOW,CAAC,0BAA0B,yBAAyB;;;;;CAKtF,MAAa,QAAuB;EAClC,MAAM,
|
|
1
|
+
{"version":3,"file":"database-connector.mjs","names":["config"],"sources":["../../../../../../../../packages/core/src/connectors/database-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { connectToDatabase, dataSourceRegistry } from \"@warlock.js/cascade\";\nimport { container } from \"../container\";\nimport { BaseConnector } from \"./base-connector\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\n/**\n * Database Connector\n * Manages database connection lifecycle using @warlock.js/cascade\n */\nexport class DatabaseConnector extends BaseConnector {\n public readonly name = \"database\";\n public readonly priority = ConnectorPriority.DATABASE;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Early;\n\n /**\n * Files that trigger database restart\n */\n protected readonly watchedFiles = [\"src/config/database.ts\", \"src/config/database.tsx\"];\n\n /**\n * Initialize database connection\n */\n public async start(): Promise<void> {\n const databaseConfig = config.get(\"database\");\n\n if (!databaseConfig) {\n return;\n }\n\n try {\n const source = await connectToDatabase(databaseConfig);\n container.set(\"database.source\", source);\n this.active = true;\n } catch (error) {\n console.error(\"Failed to connect to database:\", error);\n throw error;\n }\n }\n\n /**\n * Shutdown database connection\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n try {\n // Disconnect all registered data sources\n const dataSources = dataSourceRegistry.getAllDataSources();\n\n for (const dataSource of dataSources) {\n if (dataSource.driver.isConnected) {\n await dataSource.driver.disconnect();\n }\n }\n\n this.active = false;\n } catch (error) {\n console.error(\"Failed to disconnect from database:\", error);\n throw error;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAUA,IAAa,oBAAb,cAAuC,cAAc;;;cAC5B;;;sBAOW,CAAC,0BAA0B,yBAAyB;;;;;CAKtF,MAAa,QAAuB;EAClC,MAAM,iBAAiBA,WAAO,IAAI,UAAU;EAE5C,IAAI,CAAC,gBACH;EAGF,IAAI;GACF,MAAM,SAAS,MAAM,kBAAkB,cAAc;GACrD,UAAU,IAAI,mBAAmB,MAAM;GACvC,KAAK,SAAS;EAChB,SAAS,OAAO;GACd,QAAQ,MAAM,kCAAkC,KAAK;GACrD,MAAM;EACR;CACF;;;;CAKA,MAAa,WAA0B;EACrC,IAAI,CAAC,KAAK,QACR;EAGF,IAAI;GAEF,MAAM,cAAc,mBAAmB,kBAAkB;GAEzD,KAAK,MAAM,cAAc,aACvB,IAAI,WAAW,OAAO,aACpB,MAAM,WAAW,OAAO,WAAW;GAIvC,KAAK,SAAS;EAChB,SAAS,OAAO;GACd,QAAQ,MAAM,uCAAuC,KAAK;GAC1D,MAAM;EACR;CACF;AACF"}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* one would be the same class of lie as printing `app.baseUrl` was.
|
|
45
45
|
*/
|
|
46
46
|
/** Hosts that all mean "this machine" for the purpose of comparing addresses. */
|
|
47
|
-
const LOOPBACK_HOSTS = new Set([
|
|
47
|
+
const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
|
|
48
48
|
"localhost",
|
|
49
49
|
"127.0.0.1",
|
|
50
50
|
"::1",
|
|
@@ -66,7 +66,7 @@ const LOOPBACK_HOSTS = new Set([
|
|
|
66
66
|
* "[::1]"`). The bare forms are listed too so a caller that hands over a host
|
|
67
67
|
* rather than a URL is not silently missed.
|
|
68
68
|
*/
|
|
69
|
-
const DISPLAY_AS_LOCALHOST = new Set([
|
|
69
|
+
const DISPLAY_AS_LOCALHOST = /* @__PURE__ */ new Set([
|
|
70
70
|
"127.0.0.1",
|
|
71
71
|
"[::1]",
|
|
72
72
|
"::1",
|
|
@@ -75,7 +75,7 @@ const DISPLAY_AS_LOCALHOST = new Set([
|
|
|
75
75
|
"::"
|
|
76
76
|
]);
|
|
77
77
|
/** The wildcard spellings — a bind wider than loopback. */
|
|
78
|
-
const WILDCARD_HOSTS = new Set([
|
|
78
|
+
const WILDCARD_HOSTS = /* @__PURE__ */ new Set([
|
|
79
79
|
"0.0.0.0",
|
|
80
80
|
"[::]",
|
|
81
81
|
"::"
|
|
@@ -171,5 +171,5 @@ function describeServerAddress(boundAddress, baseUrl, requestedHost) {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
//#endregion
|
|
174
|
-
export { describeServerAddress };
|
|
174
|
+
export { describeServerAddress, isWildcardBind, isWildcardHost, toDisplayUrl };
|
|
175
175
|
//# sourceMappingURL=describe-server-address.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-server-address.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/describe-server-address.ts"],"sourcesContent":["/**\n * What to say once the HTTP server has bound.\n *\n * ## Why this is not one template string\n *\n * `http-connector.ts` used to bind `httpConfig.port` and then announce\n * `config.get(\"app.baseUrl\")` — a different value, read from a different\n * environment variable (`PORT` vs `BASE_URL`), with nothing checking the two\n * agreed. On 2026-08-24 a server listening on 3000 printed\n * `Server ready at http://localhost:41900`. **Following the line the server\n * itself printed gave connection refused, on a server that was working.** The\n * reference app carried the rule as a comment in `.env` — \"must agree with the\n * port in BASE_URL above\" — and a rule a comment enforces is not enforced.\n *\n * So the ready line now states the address actually bound. `app.baseUrl` is a\n * separate claim, and it is reported separately.\n *\n * ## Why a disagreement is not fatal\n *\n * A reverse-proxied deployment legitimately binds `0.0.0.0:3000` and publishes\n * `https://example.com`. Refusing to boot on a mismatch would break the correct\n * case, and warning on it would fire on every correct production boot — a\n * warning that always fires is one nobody reads.\n *\n * The mismatch worth a warning is the ACTIONABLE one: a base URL that points at\n * **loopback on a port nothing is listening on**, because someone will paste it\n * into a browser and conclude the server is broken. A non-loopback base URL is\n * a deployment address, reported plainly and never flagged.\n *\n * ## Why the address bound and the address printed are not the same string\n *\n * `listen()` resolves `localhost` and hands back whichever address it actually\n * bound — on a dual-stack machine that is `http://[::1]:2030`. That literal is\n * correct and useless: most terminals will not linkify a bracketed IPv6 host,\n * and on a first run it reads as broken output. So {@link toDisplayUrl} maps\n * the *loopback and wildcard* spellings onto `localhost`, which resolves back\n * to the very socket that was bound.\n *\n * This is a DISPLAY transform and nothing else — `host` still reaches\n * `listen()` untouched (`http-connector.ts`), so the set of interfaces the\n * server accepts on is byte-for-byte what it was. A genuine routable IPv6\n * address is left exactly as it is: there is no synonym for it, and inventing\n * one would be the same class of lie as printing `app.baseUrl` was.\n */\n\n/** Hosts that all mean \"this machine\" for the purpose of comparing addresses. */\nconst LOOPBACK_HOSTS = new Set([\"localhost\", \"127.0.0.1\", \"::1\", \"[::1]\", \"0.0.0.0\", \"\"]);\n\n/**\n * Hosts for which `localhost` is a truthful, reachable synonym.\n *\n * The two loopback literals are exact synonyms. The two wildcards (`::`,\n * `0.0.0.0`) are not synonyms — they are strictly wider — but every one of them\n * *includes* loopback, so `localhost` always reaches the server. Callers that\n * need to tell the reader the bind is wider than loopback should say so\n * separately; see `dev-server/ready-block.ts`.\n *\n * The bracketed spellings are the ones that actually occur: WHATWG `hostname`\n * KEEPS the brackets for an IPv6 host (`new URL(\"http://[::1]:1\").hostname ===\n * \"[::1]\"`). The bare forms are listed too so a caller that hands over a host\n * rather than a URL is not silently missed.\n */\nconst DISPLAY_AS_LOCALHOST = new Set([\"127.0.0.1\", \"[::1]\", \"::1\", \"0.0.0.0\", \"[::]\", \"::\"]);\n\n/** The wildcard spellings — a bind wider than loopback. */\nconst WILDCARD_HOSTS = new Set([\"0.0.0.0\", \"[::]\", \"::\"]);\n\n/**\n * Whether the given bound address listens on more than loopback.\n *\n * Used to add \"(all interfaces)\" next to a URL that has been rewritten to\n * `localhost`, so the rewrite never hides a wider bind than the reader thinks.\n */\nexport function isWildcardBind(boundAddress: string | undefined): boolean {\n const url = parseUrl(boundAddress);\n\n if (!url) return false;\n\n return WILDCARD_HOSTS.has(url.hostname);\n}\n\n/**\n * Whether the host a caller ASKED to bind is a wildcard.\n *\n * Needed because `isWildcardBind` alone cannot answer this. Fastify's\n * `listen()` normalises a `0.0.0.0` bind and resolves back\n * `http://127.0.0.1:<port>` — the loopback spelling — while `::` comes back\n * as `http://[::]:<port>` untouched. So the returned address reports the\n * wildcard for one of the two spellings and hides it for the other, and\n * `0.0.0.0` is the one people actually write.\n *\n * The requested host is the ground truth for INTENT; the bound address is the\n * ground truth for what happened. A wildcard in either is a wildcard bind.\n */\nexport function isWildcardHost(host: string | undefined): boolean {\n if (!host) return false;\n\n return WILDCARD_HOSTS.has(host.trim().toLowerCase());\n}\n\n/**\n * The address as it should be SHOWN to a human. See the module doc above.\n *\n * Anything unparseable is returned untouched: a best-effort prettifier must\n * never be the reason a developer is shown something other than what the\n * server reported.\n */\nexport function toDisplayUrl(boundAddress: string | undefined): string {\n if (!boundAddress) return \"\";\n\n const url = parseUrl(boundAddress);\n\n if (!url) return boundAddress;\n\n if (!DISPLAY_AS_LOCALHOST.has(url.hostname)) return boundAddress;\n\n url.hostname = \"localhost\";\n\n // `URL.href` re-appends a trailing slash to a bare origin, which is noise in\n // a status line and is not what `listen()` returned.\n return url.href.replace(/\\/$/, \"\");\n}\n\nexport type ServerAddressReport = {\n /** Where the server is genuinely reachable, spelled for a human. Always present. */\n ready: string;\n /**\n * The same address as a bare URL, ready to paste into a browser — the value\n * `ready` embeds. Callers that render their own layout (the dev ready block)\n * use this instead of re-deriving it.\n */\n url: string;\n /**\n * Exactly what `listen()` returned, untransformed. Kept so a caller that\n * needs to reason about the BIND (which interfaces, which family) reads the\n * fact rather than the presentation of it.\n */\n boundAddress?: string;\n /** Whether the bind covers more than loopback (`0.0.0.0` / `::`). */\n wildcardBind: boolean;\n /** The configured public address, when it is a deployment URL rather than a local one. */\n publicUrl?: string;\n /** Set only when `app.baseUrl` points at loopback on a port nothing bound. */\n warning?: string;\n};\n\nfunction parseUrl(value: unknown): URL | undefined {\n if (typeof value !== \"string\" || value.length === 0) return undefined;\n\n try {\n return new URL(value);\n } catch {\n // An unparseable base URL is a separate problem, and it is NOT evidence of\n // a port mismatch — reporting one from it would be a guess.\n return undefined;\n }\n}\n\nfunction isLoopback(url: URL): boolean {\n return LOOPBACK_HOSTS.has(url.hostname);\n}\n\n/** `:3000` explicitly, or the protocol's default when the URL omits it. */\nfunction effectivePort(url: URL): string {\n if (url.port) return url.port;\n\n return url.protocol === \"https:\" ? \"443\" : \"80\";\n}\n\nexport function describeServerAddress(\n boundAddress: string | undefined,\n baseUrl: unknown,\n /**\n * The host passed to `listen()`. Optional so existing callers keep working,\n * but the connector passes it: without it a `0.0.0.0` bind is reported as\n * loopback-only, and the dev block then omits its \"(all interfaces)\" note in\n * exactly the case a developer most needs it.\n */\n requestedHost?: string,\n): ServerAddressReport {\n const bound = parseUrl(boundAddress);\n const configured = parseUrl(baseUrl);\n\n // No bound address to report means the caller could not obtain one; the\n // configured URL is then the only thing we know, and saying nothing would be\n // worse than saying the one thing we have.\n if (!bound) {\n const fallback = String(configured?.href ?? boundAddress ?? baseUrl ?? \"\");\n\n return {\n ready: `Server ready at ${fallback}`,\n url: fallback,\n boundAddress,\n wildcardBind: isWildcardHost(requestedHost),\n };\n }\n\n // The URL a human is shown. `boundAddress` (the literal `listen()` returned)\n // travels on the report untouched — see the module doc on why these differ.\n const url = toDisplayUrl(boundAddress);\n const base = {\n ready: `Server ready at ${url}`,\n url,\n boundAddress,\n wildcardBind: isWildcardBind(boundAddress) || isWildcardHost(requestedHost),\n };\n\n if (!configured) return base;\n\n if (!isLoopback(configured)) {\n return { ...base, publicUrl: `Public URL (app.baseUrl): ${baseUrl}` };\n }\n\n if (effectivePort(configured) === effectivePort(bound)) {\n return base;\n }\n\n return {\n ...base,\n warning:\n `app.baseUrl is ${baseUrl}, but the server bound port ${effectivePort(bound)}. ` +\n `Nothing is listening on port ${effectivePort(configured)} — ` +\n `check BASE_URL and PORT, including anything exported in your shell.`,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAM,iBAAiB,IAAI,IAAI;CAAC;CAA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B,WAAW,EAAE;EAEzE,OAAO;GACL,OAAO,mBAAmB;GAC1B,KAAK;GACL;GACA,cAAc,eAAe,aAAa;EAC5C;CACF;CAIA,MAAM,MAAM,aAAa,YAAY;CACrC,MAAM,OAAO;EACX,OAAO,mBAAmB;EAC1B;EACA;EACA,cAAc,eAAe,YAAY,KAAK,eAAe,aAAa;CAC5E;CAEA,IAAI,CAAC,YAAY,OAAO;CAExB,IAAI,CAAC,WAAW,UAAU,GACxB,OAAO;EAAE,GAAG;EAAM,WAAW,6BAA6B;CAAU;CAGtE,IAAI,cAAc,UAAU,MAAM,cAAc,KAAK,GACnD,OAAO;CAGT,OAAO;EACL,GAAG;EACH,SACE,kBAAkB,QAAQ,8BAA8B,cAAc,KAAK,EAAE,iCAC7C,cAAc,UAAU,EAAE;CAE9D;AACF"}
|
|
1
|
+
{"version":3,"file":"describe-server-address.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/describe-server-address.ts"],"sourcesContent":["/**\n * What to say once the HTTP server has bound.\n *\n * ## Why this is not one template string\n *\n * `http-connector.ts` used to bind `httpConfig.port` and then announce\n * `config.get(\"app.baseUrl\")` — a different value, read from a different\n * environment variable (`PORT` vs `BASE_URL`), with nothing checking the two\n * agreed. On 2026-08-24 a server listening on 3000 printed\n * `Server ready at http://localhost:41900`. **Following the line the server\n * itself printed gave connection refused, on a server that was working.** The\n * reference app carried the rule as a comment in `.env` — \"must agree with the\n * port in BASE_URL above\" — and a rule a comment enforces is not enforced.\n *\n * So the ready line now states the address actually bound. `app.baseUrl` is a\n * separate claim, and it is reported separately.\n *\n * ## Why a disagreement is not fatal\n *\n * A reverse-proxied deployment legitimately binds `0.0.0.0:3000` and publishes\n * `https://example.com`. Refusing to boot on a mismatch would break the correct\n * case, and warning on it would fire on every correct production boot — a\n * warning that always fires is one nobody reads.\n *\n * The mismatch worth a warning is the ACTIONABLE one: a base URL that points at\n * **loopback on a port nothing is listening on**, because someone will paste it\n * into a browser and conclude the server is broken. A non-loopback base URL is\n * a deployment address, reported plainly and never flagged.\n *\n * ## Why the address bound and the address printed are not the same string\n *\n * `listen()` resolves `localhost` and hands back whichever address it actually\n * bound — on a dual-stack machine that is `http://[::1]:2030`. That literal is\n * correct and useless: most terminals will not linkify a bracketed IPv6 host,\n * and on a first run it reads as broken output. So {@link toDisplayUrl} maps\n * the *loopback and wildcard* spellings onto `localhost`, which resolves back\n * to the very socket that was bound.\n *\n * This is a DISPLAY transform and nothing else — `host` still reaches\n * `listen()` untouched (`http-connector.ts`), so the set of interfaces the\n * server accepts on is byte-for-byte what it was. A genuine routable IPv6\n * address is left exactly as it is: there is no synonym for it, and inventing\n * one would be the same class of lie as printing `app.baseUrl` was.\n */\n\n/** Hosts that all mean \"this machine\" for the purpose of comparing addresses. */\nconst LOOPBACK_HOSTS = new Set([\"localhost\", \"127.0.0.1\", \"::1\", \"[::1]\", \"0.0.0.0\", \"\"]);\n\n/**\n * Hosts for which `localhost` is a truthful, reachable synonym.\n *\n * The two loopback literals are exact synonyms. The two wildcards (`::`,\n * `0.0.0.0`) are not synonyms — they are strictly wider — but every one of them\n * *includes* loopback, so `localhost` always reaches the server. Callers that\n * need to tell the reader the bind is wider than loopback should say so\n * separately; see `dev-server/ready-block.ts`.\n *\n * The bracketed spellings are the ones that actually occur: WHATWG `hostname`\n * KEEPS the brackets for an IPv6 host (`new URL(\"http://[::1]:1\").hostname ===\n * \"[::1]\"`). The bare forms are listed too so a caller that hands over a host\n * rather than a URL is not silently missed.\n */\nconst DISPLAY_AS_LOCALHOST = new Set([\"127.0.0.1\", \"[::1]\", \"::1\", \"0.0.0.0\", \"[::]\", \"::\"]);\n\n/** The wildcard spellings — a bind wider than loopback. */\nconst WILDCARD_HOSTS = new Set([\"0.0.0.0\", \"[::]\", \"::\"]);\n\n/**\n * Whether the given bound address listens on more than loopback.\n *\n * Used to add \"(all interfaces)\" next to a URL that has been rewritten to\n * `localhost`, so the rewrite never hides a wider bind than the reader thinks.\n */\nexport function isWildcardBind(boundAddress: string | undefined): boolean {\n const url = parseUrl(boundAddress);\n\n if (!url) return false;\n\n return WILDCARD_HOSTS.has(url.hostname);\n}\n\n/**\n * Whether the host a caller ASKED to bind is a wildcard.\n *\n * Needed because `isWildcardBind` alone cannot answer this. Fastify's\n * `listen()` normalises a `0.0.0.0` bind and resolves back\n * `http://127.0.0.1:<port>` — the loopback spelling — while `::` comes back\n * as `http://[::]:<port>` untouched. So the returned address reports the\n * wildcard for one of the two spellings and hides it for the other, and\n * `0.0.0.0` is the one people actually write.\n *\n * The requested host is the ground truth for INTENT; the bound address is the\n * ground truth for what happened. A wildcard in either is a wildcard bind.\n */\nexport function isWildcardHost(host: string | undefined): boolean {\n if (!host) return false;\n\n return WILDCARD_HOSTS.has(host.trim().toLowerCase());\n}\n\n/**\n * The address as it should be SHOWN to a human. See the module doc above.\n *\n * Anything unparseable is returned untouched: a best-effort prettifier must\n * never be the reason a developer is shown something other than what the\n * server reported.\n */\nexport function toDisplayUrl(boundAddress: string | undefined): string {\n if (!boundAddress) return \"\";\n\n const url = parseUrl(boundAddress);\n\n if (!url) return boundAddress;\n\n if (!DISPLAY_AS_LOCALHOST.has(url.hostname)) return boundAddress;\n\n url.hostname = \"localhost\";\n\n // `URL.href` re-appends a trailing slash to a bare origin, which is noise in\n // a status line and is not what `listen()` returned.\n return url.href.replace(/\\/$/, \"\");\n}\n\nexport type ServerAddressReport = {\n /** Where the server is genuinely reachable, spelled for a human. Always present. */\n ready: string;\n /**\n * The same address as a bare URL, ready to paste into a browser — the value\n * `ready` embeds. Callers that render their own layout (the dev ready block)\n * use this instead of re-deriving it.\n */\n url: string;\n /**\n * Exactly what `listen()` returned, untransformed. Kept so a caller that\n * needs to reason about the BIND (which interfaces, which family) reads the\n * fact rather than the presentation of it.\n */\n boundAddress?: string;\n /** Whether the bind covers more than loopback (`0.0.0.0` / `::`). */\n wildcardBind: boolean;\n /** The configured public address, when it is a deployment URL rather than a local one. */\n publicUrl?: string;\n /** Set only when `app.baseUrl` points at loopback on a port nothing bound. */\n warning?: string;\n};\n\nfunction parseUrl(value: unknown): URL | undefined {\n if (typeof value !== \"string\" || value.length === 0) return undefined;\n\n try {\n return new URL(value);\n } catch {\n // An unparseable base URL is a separate problem, and it is NOT evidence of\n // a port mismatch — reporting one from it would be a guess.\n return undefined;\n }\n}\n\nfunction isLoopback(url: URL): boolean {\n return LOOPBACK_HOSTS.has(url.hostname);\n}\n\n/** `:3000` explicitly, or the protocol's default when the URL omits it. */\nfunction effectivePort(url: URL): string {\n if (url.port) return url.port;\n\n return url.protocol === \"https:\" ? \"443\" : \"80\";\n}\n\nexport function describeServerAddress(\n boundAddress: string | undefined,\n baseUrl: unknown,\n /**\n * The host passed to `listen()`. Optional so existing callers keep working,\n * but the connector passes it: without it a `0.0.0.0` bind is reported as\n * loopback-only, and the dev block then omits its \"(all interfaces)\" note in\n * exactly the case a developer most needs it.\n */\n requestedHost?: string,\n): ServerAddressReport {\n const bound = parseUrl(boundAddress);\n const configured = parseUrl(baseUrl);\n\n // No bound address to report means the caller could not obtain one; the\n // configured URL is then the only thing we know, and saying nothing would be\n // worse than saying the one thing we have.\n if (!bound) {\n const fallback = String(configured?.href ?? boundAddress ?? baseUrl ?? \"\");\n\n return {\n ready: `Server ready at ${fallback}`,\n url: fallback,\n boundAddress,\n wildcardBind: isWildcardHost(requestedHost),\n };\n }\n\n // The URL a human is shown. `boundAddress` (the literal `listen()` returned)\n // travels on the report untouched — see the module doc on why these differ.\n const url = toDisplayUrl(boundAddress);\n const base = {\n ready: `Server ready at ${url}`,\n url,\n boundAddress,\n wildcardBind: isWildcardBind(boundAddress) || isWildcardHost(requestedHost),\n };\n\n if (!configured) return base;\n\n if (!isLoopback(configured)) {\n return { ...base, publicUrl: `Public URL (app.baseUrl): ${baseUrl}` };\n }\n\n if (effectivePort(configured) === effectivePort(bound)) {\n return base;\n }\n\n return {\n ...base,\n warning:\n `app.baseUrl is ${baseUrl}, but the server bound port ${effectivePort(bound)}. ` +\n `Nothing is listening on port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7C;AAEA,SAAgB,sBACd,cACA,SAOA,eACqB;CACrB,MAAM,QAAQ,SAAS,YAAY;CACnC,MAAM,aAAa,SAAS,OAAO;CAKnC,IAAI,CAAC,OAAO;EACV,MAAM,WAAW,OAAO,YAAY,QAAQ,gBAAgB,WAAW,EAAE;EAEzE,OAAO;GACL,OAAO,mBAAmB;GAC1B,KAAK;GACL;GACA,cAAc,eAAe,aAAa;EAC5C;CACF;CAIA,MAAM,MAAM,aAAa,YAAY;CACrC,MAAM,OAAO;EACX,OAAO,mBAAmB;EAC1B;EACA;EACA,cAAc,eAAe,YAAY,KAAK,eAAe,aAAa;CAC5E;CAEA,IAAI,CAAC,YAAY,OAAO;CAExB,IAAI,CAAC,WAAW,UAAU,GACxB,OAAO;EAAE,GAAG;EAAM,WAAW,6BAA6B;CAAU;CAGtE,IAAI,cAAc,UAAU,MAAM,cAAc,KAAK,GACnD,OAAO;CAGT,OAAO;EACL,GAAG;EACH,SACE,kBAAkB,QAAQ,8BAA8B,cAAc,KAAK,EAAE,iCAC7C,cAAc,UAAU,EAAE;CAE9D;AACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
2
2
|
import { BaseConnector } from "./base-connector.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/connectors/herald-connector.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Herald Connector
|
|
7
6
|
* Manages message broker connection lifecycle using @warlock.js/herald
|
|
8
7
|
*/
|
|
9
|
-
declare class HeraldConnector extends BaseConnector {
|
|
8
|
+
export declare class HeraldConnector extends BaseConnector {
|
|
10
9
|
readonly name = "herald";
|
|
11
10
|
readonly priority = ConnectorPriority.COMMUNICATOR;
|
|
12
11
|
readonly lifecyclePhase = ConnectorLifecyclePhase.Early;
|
|
@@ -24,5 +23,4 @@ declare class HeraldConnector extends BaseConnector {
|
|
|
24
23
|
shutdown(): Promise<void>;
|
|
25
24
|
}
|
|
26
25
|
//#endregion
|
|
27
|
-
export { HeraldConnector };
|
|
28
26
|
//# sourceMappingURL=herald-connector.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"herald-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/herald-connector.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"herald-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/herald-connector.ts"],"mappings":";;;;;;;qBASa,wBAAwB;WACnB;WACA,WAAQ,kBAAA;WACR,iBAAc,wBAAA;;;;qBAKX;;;;EAKN,SAAS;;;;EA8BT,YAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
2
2
|
import { BaseConnector } from "./base-connector.mjs";
|
|
3
|
-
import
|
|
3
|
+
import baseConfig from "@mongez/config";
|
|
4
4
|
import { log } from "@warlock.js/logger";
|
|
5
5
|
|
|
6
6
|
//#region ../../packages/core/src/connectors/herald-connector.ts
|
|
@@ -20,7 +20,7 @@ var HeraldConnector = class extends BaseConnector {
|
|
|
20
20
|
* Initialize broker connection
|
|
21
21
|
*/
|
|
22
22
|
async start() {
|
|
23
|
-
const heraldConfig =
|
|
23
|
+
const heraldConfig = baseConfig.get("herald");
|
|
24
24
|
if (!heraldConfig) return;
|
|
25
25
|
try {
|
|
26
26
|
const { connectToBroker } = await import("@warlock.js/herald");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"herald-connector.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/herald-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { log } from \"@warlock.js/logger\";\nimport { BaseConnector } from \"./base-connector\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\n/**\n * Herald Connector\n * Manages message broker connection lifecycle using @warlock.js/herald\n */\nexport class HeraldConnector extends BaseConnector {\n public readonly name = \"herald\";\n public readonly priority = ConnectorPriority.COMMUNICATOR;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Early;\n\n /**\n * Files that trigger herald restart\n */\n protected readonly watchedFiles = [\"src/config/herald.ts\"];\n\n /**\n * Initialize broker connection\n */\n public async start(): Promise<void> {\n const heraldConfig = config.get(\"herald\");\n\n if (!heraldConfig) {\n return;\n }\n\n try {\n const { connectToBroker } = await import(\"@warlock.js/herald\");\n\n log.info(`herald.${heraldConfig.driver}`, \"connection\", \"Connecting to message broker\");\n await connectToBroker(heraldConfig);\n log.success(`herald.${heraldConfig.driver}`, \"connection\", \"Connected to message broker\");\n this.active = true;\n } catch (error) {\n // Boot-time broker connection failure is unrecoverable — `fatal` makes\n // \"page on fatal only\" alerting clean, aligned with the cascade and\n // cache drivers. Disconnect failures (shutdown path) stay at error.\n log.fatal(\n `herald.${heraldConfig.driver}`,\n \"connection\",\n \"Failed to connect to message broker\",\n );\n throw error;\n }\n }\n\n /**\n * Shutdown broker connection\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n try {\n const { brokerRegistry } = await import(\"@warlock.js/herald\");\n\n // Disconnect all registered brokers\n const brokers = brokerRegistry.getAll();\n\n for (const broker of brokers) {\n if (broker.driver.isConnected) {\n await broker.driver.disconnect();\n }\n }\n\n // Clear the registry for clean restart\n brokerRegistry.clear();\n\n this.active = false;\n } catch (error) {\n log.error(\"herald\", \"shutdown\", \"Failed to disconnect from message broker\");\n throw error;\n }\n }\n}\n"],"mappings":";;;;;;;;;;AASA,IAAa,kBAAb,cAAqC,cAAc;;;cAC1B;;;sBAOW,CAAC,sBAAsB;;;;;CAKzD,MAAa,QAAuB;EAClC,MAAM,
|
|
1
|
+
{"version":3,"file":"herald-connector.mjs","names":["config"],"sources":["../../../../../../../../packages/core/src/connectors/herald-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { log } from \"@warlock.js/logger\";\nimport { BaseConnector } from \"./base-connector\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\n/**\n * Herald Connector\n * Manages message broker connection lifecycle using @warlock.js/herald\n */\nexport class HeraldConnector extends BaseConnector {\n public readonly name = \"herald\";\n public readonly priority = ConnectorPriority.COMMUNICATOR;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Early;\n\n /**\n * Files that trigger herald restart\n */\n protected readonly watchedFiles = [\"src/config/herald.ts\"];\n\n /**\n * Initialize broker connection\n */\n public async start(): Promise<void> {\n const heraldConfig = config.get(\"herald\");\n\n if (!heraldConfig) {\n return;\n }\n\n try {\n const { connectToBroker } = await import(\"@warlock.js/herald\");\n\n log.info(`herald.${heraldConfig.driver}`, \"connection\", \"Connecting to message broker\");\n await connectToBroker(heraldConfig);\n log.success(`herald.${heraldConfig.driver}`, \"connection\", \"Connected to message broker\");\n this.active = true;\n } catch (error) {\n // Boot-time broker connection failure is unrecoverable — `fatal` makes\n // \"page on fatal only\" alerting clean, aligned with the cascade and\n // cache drivers. Disconnect failures (shutdown path) stay at error.\n log.fatal(\n `herald.${heraldConfig.driver}`,\n \"connection\",\n \"Failed to connect to message broker\",\n );\n throw error;\n }\n }\n\n /**\n * Shutdown broker connection\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n try {\n const { brokerRegistry } = await import(\"@warlock.js/herald\");\n\n // Disconnect all registered brokers\n const brokers = brokerRegistry.getAll();\n\n for (const broker of brokers) {\n if (broker.driver.isConnected) {\n await broker.driver.disconnect();\n }\n }\n\n // Clear the registry for clean restart\n brokerRegistry.clear();\n\n this.active = false;\n } catch (error) {\n log.error(\"herald\", \"shutdown\", \"Failed to disconnect from message broker\");\n throw error;\n }\n }\n}\n"],"mappings":";;;;;;;;;;AASA,IAAa,kBAAb,cAAqC,cAAc;;;cAC1B;;;sBAOW,CAAC,sBAAsB;;;;;CAKzD,MAAa,QAAuB;EAClC,MAAM,eAAeA,WAAO,IAAI,QAAQ;EAExC,IAAI,CAAC,cACH;EAGF,IAAI;GACF,MAAM,EAAE,oBAAoB,MAAM,OAAO;GAEzC,IAAI,KAAK,UAAU,aAAa,UAAU,cAAc,8BAA8B;GACtF,MAAM,gBAAgB,YAAY;GAClC,IAAI,QAAQ,UAAU,aAAa,UAAU,cAAc,6BAA6B;GACxF,KAAK,SAAS;EAChB,SAAS,OAAO;GAId,IAAI,MACF,UAAU,aAAa,UACvB,cACA,qCACF;GACA,MAAM;EACR;CACF;;;;CAKA,MAAa,WAA0B;EACrC,IAAI,CAAC,KAAK,QACR;EAGF,IAAI;GACF,MAAM,EAAE,mBAAmB,MAAM,OAAO;GAGxC,MAAM,UAAU,eAAe,OAAO;GAEtC,KAAK,MAAM,UAAU,SACnB,IAAI,OAAO,OAAO,aAChB,MAAM,OAAO,OAAO,WAAW;GAKnC,eAAe,MAAM;GAErB,KAAK,SAAS;EAChB,SAAS,OAAO;GACd,IAAI,MAAM,UAAU,YAAY,0CAA0C;GAC1E,MAAM;EACR;CACF;AACF"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { FastifyInstance } from "../http/server.mjs";
|
|
2
2
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
3
3
|
import { BaseConnector } from "./base-connector.mjs";
|
|
4
|
-
|
|
5
4
|
//#region ../../packages/core/src/connectors/http-connector.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* HTTP Connector
|
|
8
7
|
* Manages HTTP server (Fastify) lifecycle
|
|
9
8
|
*/
|
|
10
|
-
declare class HttpConnector extends BaseConnector {
|
|
9
|
+
export declare class HttpConnector extends BaseConnector {
|
|
11
10
|
readonly name = "http";
|
|
12
11
|
readonly priority = ConnectorPriority.HTTP;
|
|
13
12
|
readonly lifecyclePhase = ConnectorLifecyclePhase.Late;
|
|
@@ -77,5 +76,4 @@ declare class HttpConnector extends BaseConnector {
|
|
|
77
76
|
shouldRestart(changedFiles: string[]): boolean;
|
|
78
77
|
}
|
|
79
78
|
//#endregion
|
|
80
|
-
export { HttpConnector };
|
|
81
79
|
//# sourceMappingURL=http-connector.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/http-connector.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/http-connector.ts"],"mappings":";;;;;;;;qBAiDa,sBAAsB;WACjB;WACA,WAAQ,kBAAA;WACR,iBAAc,wBAAA;;;;;;qBAOX;;;;YAKT,OAAO;;;;;;;;;;;;;;;;;;gBAmBH;;;;;;EASD,QAAI;;;;;;;;UAmCT;;;;;;EAsCK,SAAS;;;;;;EAkKT,WAAW;;;;EAcX,YAAY;;;;;;EA4BlB,cAAc"}
|
|
@@ -16,7 +16,7 @@ import { BaseConnector } from "./base-connector.mjs";
|
|
|
16
16
|
import { ensureFatalIsVisible } from "../logger/fatal-visibility.mjs";
|
|
17
17
|
import { describeServerAddress } from "./describe-server-address.mjs";
|
|
18
18
|
import { readBoundPort } from "./read-bound-port.mjs";
|
|
19
|
-
import
|
|
19
|
+
import baseConfig from "@mongez/config";
|
|
20
20
|
import { log } from "@warlock.js/logger";
|
|
21
21
|
import { colors } from "@mongez/copper";
|
|
22
22
|
|
|
@@ -72,14 +72,15 @@ var HttpConnector = class extends BaseConnector {
|
|
|
72
72
|
* `start()` so it reads the router after app code has registered.
|
|
73
73
|
*/
|
|
74
74
|
async boot() {
|
|
75
|
-
const httpConfig =
|
|
75
|
+
const httpConfig = baseConfig.get("http");
|
|
76
76
|
if (!httpConfig) return;
|
|
77
77
|
const port = httpConfig.port;
|
|
78
78
|
log.info(`http`, "connection", `Starting http server on port ${port} in ${environmentColor(Application.environment)} mode`);
|
|
79
79
|
this.http = startHttpServer(httpConfig.serverOptions);
|
|
80
80
|
container.set("http.server", this.http);
|
|
81
81
|
await registerHttpPlugins(this.http);
|
|
82
|
-
|
|
82
|
+
const baseUrl = baseConfig.get("app.baseUrl");
|
|
83
|
+
setBaseUrl(baseUrl);
|
|
83
84
|
this.registerHealthRoutes();
|
|
84
85
|
}
|
|
85
86
|
/**
|
|
@@ -91,7 +92,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
91
92
|
*/
|
|
92
93
|
registerHealthRoutes() {
|
|
93
94
|
if (!this.http) return;
|
|
94
|
-
const healthConfig =
|
|
95
|
+
const healthConfig = baseConfig.get("http.health");
|
|
95
96
|
if (healthConfig?.enabled === false) return;
|
|
96
97
|
const livenessPath = healthConfig?.path ?? "/health";
|
|
97
98
|
const readinessPath = healthConfig?.readinessPath ?? "/ready";
|
|
@@ -111,7 +112,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
111
112
|
* app code without losing routes.
|
|
112
113
|
*/
|
|
113
114
|
async start() {
|
|
114
|
-
const httpConfig =
|
|
115
|
+
const httpConfig = baseConfig.get("http");
|
|
115
116
|
if (!httpConfig || !this.http) return;
|
|
116
117
|
if (!servesHttp()) {
|
|
117
118
|
log.info("http", "connection", `http: not started (role: ${[...getRoles()].join(", ")})`);
|
|
@@ -133,7 +134,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
133
134
|
});
|
|
134
135
|
const boundPort = readBoundPort(boundAddress, configuredPort);
|
|
135
136
|
Application.setServedPort(boundPort);
|
|
136
|
-
const address = describeServerAddress(boundAddress,
|
|
137
|
+
const address = describeServerAddress(boundAddress, baseConfig.get("app.baseUrl"), httpConfig.host || "localhost");
|
|
137
138
|
setHttpReadyReport({
|
|
138
139
|
boundAddress: address.boundAddress,
|
|
139
140
|
url: address.url,
|
|
@@ -173,7 +174,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
173
174
|
if (!this.active) return;
|
|
174
175
|
const server = getHttpServer();
|
|
175
176
|
if (server) {
|
|
176
|
-
const timeout =
|
|
177
|
+
const timeout = baseConfig.get("http.gracefulShutdown.timeout", DEFAULT_SHUTDOWN_TIMEOUT);
|
|
177
178
|
if (!await closeServerWithTimeout(server, timeout)) log.warn("http", "shutdown", `In-flight requests did not drain within ${timeout}ms; closing anyway`);
|
|
178
179
|
}
|
|
179
180
|
this.active = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-connector.mjs","names":[],"sources":["../../../../../../../../packages/core/src/connectors/http-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { colors } from \"@mongez/copper\";\nimport { log } from \"@warlock.js/logger\";\nimport { Application, getRoles, servesHttp } from \"../application\";\nimport { health } from \"../http/health\";\nimport { assertPortIsAvailable } from \"../http/port-preflight\";\nimport { registerHttpPlugins } from \"../http/plugins\";\nimport { notifyHttpServerRebuilt } from \"../http/server-rebuilt\";\nimport { setHttpReadyReport } from \"../http/ready-report\";\nimport { isCanonicalPortValue, resolveBindPort } from \"../http/resolve-bind-port\";\nimport {\n closeServerWithTimeout,\n type FastifyInstance,\n getHttpServer,\n startHttpServer,\n} from \"../http/server\";\nimport { ensureFatalIsVisible } from \"../logger/fatal-visibility\";\nimport { router } from \"../router/router\";\nimport { type Environment } from \"../utils\";\nimport { setBaseUrl } from \"../utils/urls\";\nimport { container } from \"./../container\";\nimport { BaseConnector } from \"./base-connector\";\nimport { describeServerAddress } from \"./describe-server-address\";\nimport { readBoundPort } from \"./read-bound-port\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\nfunction environmentColor(environment: Environment) {\n switch (environment) {\n case \"development\":\n return colors.magentaBright(environment);\n case \"test\":\n return colors.yellowBright(environment);\n case \"production\":\n return colors.greenBright(environment);\n default:\n return colors.white(environment);\n }\n}\n\n/**\n * Default time to wait for in-flight requests to drain on shutdown before the\n * HTTP server is force-closed. Override via `http.gracefulShutdown.timeout`.\n */\nconst DEFAULT_SHUTDOWN_TIMEOUT = 10_000;\n\n/**\n * HTTP Connector\n * Manages HTTP server (Fastify) lifecycle\n */\nexport class HttpConnector extends BaseConnector {\n public readonly name = \"http\";\n public readonly priority = ConnectorPriority.HTTP;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Late;\n\n /**\n * Files that trigger HTTP server restart\n * Note: routes.ts changes will be handled by HMR with wildcard routing\n * Connectors receive config file paths directly (not .env) thanks to layer-executor\n */\n protected readonly watchedFiles = [\"src/config/http.ts\", \"src/config/http.tsx\"];\n\n /**\n * Fastify Server instance\n */\n protected http?: FastifyInstance;\n\n /**\n * Whether someone downstream will render the combined ready block.\n *\n * Only the dev server does (`dev-server/ready-block.ts`), and only it can:\n * the block reports facts — boot duration, the web surface — that this\n * connector does not own and must not wait for. When it will, this connector\n * records and stays quiet; otherwise it narrates as it always has.\n *\n * Keyed on the runtime strategy rather than on `NODE_ENV`, because that is\n * what actually distinguishes \"a dev server is driving this boot\" from \"an\n * app happens to be running with development config\".\n *\n * `!isBooted` is the second half and it is not a detail. The block summarises\n * a BOOT. A `restart()` after boot — an edited `src/config/http.ts` — is an\n * EVENT, and there is no block coming to carry it, so suppressing the lines\n * there would rebind the port in total silence.\n */\n protected get rendersReadyBlock(): boolean {\n return Application.runtimeStrategy === \"development\" && !Application.isBooted;\n }\n\n /**\n * Boot the connector — construction only (create Fastify, register\n * plugins, populate container). Route scanning is deferred to\n * `start()` so it reads the router after app code has registered.\n */\n public async boot() {\n const httpConfig = config.get(\"http\");\n\n if (!httpConfig) return;\n\n const port = httpConfig.port;\n log.info(\n `http`,\n \"connection\",\n `Starting http server on port ${port} in ${environmentColor(Application.environment)} mode`,\n );\n\n this.http = startHttpServer(httpConfig.serverOptions);\n\n container.set(\"http.server\", this.http);\n\n await registerHttpPlugins(this.http);\n\n const baseUrl = config.get(\"app.baseUrl\");\n\n // update base url\n setBaseUrl(baseUrl);\n\n // Liveness/readiness endpoints — registered on Fastify before start() scans\n // the app router, so they exist by the time the server listens.\n this.registerHealthRoutes();\n }\n\n /**\n * Register the built-in liveness (`/health`) and readiness (`/ready`)\n * endpoints directly on the Fastify instance — infra routes, kept off the app\n * router so they're immune to HMR and never collide with route scanning. Opt\n * out via `http.health.enabled = false`; rename via `http.health.path` /\n * `http.health.readinessPath`.\n */\n private registerHealthRoutes(): void {\n if (!this.http) {\n return;\n }\n\n const healthConfig = config.get(\"http.health\");\n\n if (healthConfig?.enabled === false) {\n return;\n }\n\n const livenessPath = healthConfig?.path ?? \"/health\";\n const readinessPath = healthConfig?.readinessPath ?? \"/ready\";\n\n // Infrastructure probes must stay reachable after client quotas are spent.\n // Opting in inherits the configured global policy and its shared bucket.\n const routeOptions = {\n config: { rateLimit: healthConfig?.rateLimit === true ? undefined : false },\n };\n\n this.http.get(livenessPath, routeOptions, async (_request: any, reply: any) => {\n const result = health.liveness();\n\n return reply.code(result.status === \"ok\" ? 200 : 503).send(result);\n });\n\n this.http.get(readinessPath, routeOptions, async (_request: any, reply: any) => {\n const result = await health.readiness();\n\n return reply.code(result.status === \"ok\" ? 200 : 503).send(result);\n });\n }\n\n /**\n * Initialize HTTP server — bind app-registered routes to Fastify\n * then listen. Scanning here (not in `boot`) lets HTTP boot before\n * app code without losing routes.\n */\n public async start(): Promise<void> {\n const httpConfig = config.get(\"http\");\n\n if (!httpConfig || !this.http) return;\n\n // Neither `api` nor `web` is active — an http-only listener would serve\n // nothing this process is meant to answer, so it never binds. `worker`\n // is the only role that reaches here today; named generically so a\n // future role composition still reads correctly.\n if (!servesHttp()) {\n log.info(\"http\", \"connection\", `http: not started (role: ${[...getRoles()].join(\", \")})`);\n\n return;\n }\n\n // Read once. `Application.isBooted` flips during the same boot this method\n // belongs to, and a predicate that answered differently before and after\n // `listen()` would print half a report.\n const deferToReadyBlock = this.rendersReadyBlock;\n\n if (Application.runtimeStrategy === \"development\") {\n router.scanDevServer(this.http);\n } else {\n router.scan(this.http);\n }\n\n // Surface the route table as a readiness signal + a boot log, so an empty\n // or partial route surface (e.g. a route module that failed to register) is\n // detectable instead of silently 404ing. `addRoutesRegisteredCheck` is\n // keyed by name, so re-running on restart is idempotent.\n health.addRoutesRegisteredCheck(() => router.routeCount());\n\n const routeCount = router.routeCount();\n\n // In development this fact is one line of the single ready block rendered\n // after boot completes (`dev-server/ready-block.ts`); printing it here as\n // well would put the same number on screen twice, in two formats. Outside\n // development the line is load-bearing — a supervisor or CI log greps it —\n // so it stays exactly as it was.\n if (!deferToReadyBlock) {\n log.info(\"http\", \"routes\", `${routeCount} route(s) registered`);\n }\n\n // Resolved ONCE, here, at the top of the bind sequence: `httpConfig.port`\n // may still be a string that round-tripped `env()`'s number coercion\n // (`\"03999\"`, `\" 3999\"`, `\"1e3\"`) — `net.Server.listen({ port })` binds\n // all of those without complaint, silently, sometimes to the WRONG port\n // (`\"1e3\"` -> 1000). Every downstream use of the port — the preflight\n // probe and `listen()` itself — must agree on the same resolved number.\n //\n // This is still the port ASKED for, not the port BOUND — `port: 0` asks\n // for \"any free port\" and this stays `0` for that case. What gets\n // published to `warlock:ready` is read back from `listen()`'s resolved\n // address further down, never this value.\n const configuredPort = resolveBindPort(httpConfig.port);\n\n if (!isCanonicalPortValue(httpConfig.port, configuredPort)) {\n log.info(\n \"http\",\n \"connection\",\n `Configured http.port ${JSON.stringify(httpConfig.port)} normalised to ${configuredPort}.`,\n );\n }\n\n try {\n // Preflight the bind before `listen()` so a collision surfaces as the\n // instruction in `PortInUseError.message` (which names the port) instead\n // of a raw `EADDRINUSE` from deep inside Fastify/libuv.\n //\n // Port 0 is exempt: it asks the OS for a free port, so probing it binds\n // some unrelated ephemeral port and \"passes\" while proving nothing about\n // the port this server will actually take.\n if (configuredPort !== 0) {\n await assertPortIsAvailable(configuredPort, httpConfig.host || \"localhost\");\n }\n\n // `listen()` RESOLVES with the address it actually bound — which is the\n // only address worth announcing. See `describe-server-address.ts` for why\n // announcing `app.baseUrl` here instead was a defect rather than a\n // shortcut.\n const boundAddress = await this.http.listen({\n port: configuredPort,\n host: httpConfig.host || \"localhost\",\n });\n\n // Read the ACTUALLY-bound port back out of what `listen()` resolved,\n // rather than republishing `configuredPort`. With `http.port: 0` the OS\n // picks the port, so `configuredPort` stays `0` forever — publishing it\n // instead of the real port is exactly the \"Server ready at a URL that\n // gives connection refused\" defect `describe-server-address.ts` already\n // fixed for the display string. `boundAddress` always carries an\n // explicit port (Fastify never omits one), so `configuredPort` is only\n // a defensive fallback for an address this parse cannot make sense of.\n const boundPort = readBoundPort(boundAddress, configuredPort);\n\n Application.setServedPort(boundPort);\n\n const address = describeServerAddress(\n boundAddress,\n config.get(\"app.baseUrl\"),\n // Passed because `listen()` does not report it back: Fastify resolves a\n // `0.0.0.0` bind to `http://127.0.0.1:<port>`, so the wildcard is only\n // recoverable from what we ASKED for.\n httpConfig.host || \"localhost\",\n );\n\n // Recorded unconditionally: the ready block reads it in development, and\n // in every other mode it is simply the one place that knows what was\n // bound, which is worth having whether or not anything renders it.\n setHttpReadyReport({\n boundAddress: address.boundAddress,\n url: address.url,\n wildcardBind: address.wildcardBind,\n port: boundPort,\n routeCount,\n publicUrl: address.publicUrl,\n });\n\n if (!deferToReadyBlock) {\n log.success(`http`, \"connection\", address.ready);\n\n if (address.publicUrl) {\n log.info(`http`, \"connection\", address.publicUrl);\n }\n }\n\n // NEVER conditional on the block. A base URL pointing at a port nothing\n // is listening on is the single most misleading state this connector can\n // be in, and a warning a status block swallows is a warning nobody reads\n // — so it is logged where it lands ABOVE the block, in both modes.\n if (address.warning) {\n log.warn(`http`, \"connection\", address.warning);\n }\n } catch (error) {\n // A failed listen()/port-bind at boot means the app can't serve — fatal.\n // `log.fatal` reaches Sentry/file; `await log.flush()` drains buffered and\n // async channels before the process exits.\n await log.fatal(\"http\", \"connection\", error);\n\n // …and `log.fatal` reaches NOBODY when the app's log config declares no\n // terminal channel — the ordinary production shape (`production: {\n // channels: [new FileLog()] }`), and the shape of every app with no `log`\n // config at all, since `LoggerConnector.start()` then returns before\n // `log.configure`. That is how an `EADDRINUSE` at boot became a process\n // that exited 1 in total silence: the error was constructed, thrown and\n // caught exactly as designed, and then written to zero channels. stderr\n // is the one destination that is always there.\n ensureFatalIsVisible(error);\n\n await log.flush();\n\n process.exit(1); // stop the process, exit with error\n }\n\n this.active = true;\n }\n\n /**\n * Restart — needs a fresh Fastify instance since `start()` now\n * re-runs `router.scan()`, and re-scanning the same Fastify would\n * register duplicate route handlers.\n */\n public async restart(): Promise<void> {\n await this.shutdown();\n await this.boot();\n\n // Subscribers (the web connector's Vite middleware) re-attach to the new\n // instance here: after it exists, before `start()` listens.\n if (this.http) notifyHttpServerRebuilt(this.http);\n\n await this.start();\n }\n\n /**\n * Shutdown HTTP server\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n const server = getHttpServer();\n\n if (server) {\n const timeout = config.get(\"http.gracefulShutdown.timeout\", DEFAULT_SHUTDOWN_TIMEOUT);\n const drained = await closeServerWithTimeout(server, timeout);\n\n if (!drained) {\n log.warn(\n \"http\",\n \"shutdown\",\n `In-flight requests did not drain within ${timeout}ms; closing anyway`,\n );\n }\n }\n\n this.active = false;\n }\n\n /**\n * Override shouldRestart to handle routes.ts specially\n * routes.ts changes should NOT restart the server (use HMR instead)\n * Now receives config file paths directly from layer-executor\n */\n public shouldRestart(changedFiles: string[]): boolean {\n // Only restart for config changes, not routes\n return changedFiles.some((file) => {\n const relativePath = file.replace(/\\\\/g, \"/\");\n return this.watchedFiles.includes(relativePath);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,iBAAiB,aAA0B;CAClD,QAAQ,aAAR;EACE,KAAK,eACH,OAAO,OAAO,cAAc,WAAW;EACzC,KAAK,QACH,OAAO,OAAO,aAAa,WAAW;EACxC,KAAK,cACH,OAAO,OAAO,YAAY,WAAW;EACvC,SACE,OAAO,OAAO,MAAM,WAAW;CACnC;AACF;;;;;AAMA,MAAM,2BAA2B;;;;;AAMjC,IAAa,gBAAb,cAAmC,cAAc;;;cACxB;;;sBASW,CAAC,sBAAsB,qBAAqB;;;;;;;;;;;;;;;;;;;CAwB9E,IAAc,oBAA6B;EACzC,OAAO,YAAY,oBAAoB,iBAAiB,CAAC,YAAY;CACvE;;;;;;CAOA,MAAa,OAAO;EAClB,MAAM,aAAa,OAAO,IAAI,M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AK,SAAS;EACpB,MAAM,KAAK,KAAK;EAIhB,IAAI,KAAK,MAAM,wBAAwB,KAAK,IAAI;EAEhD,MAAM,KAAK,MAAM;CACnB;;;;CAKA,MAAa,WAA0B;EACrC,IAAI,CAAC,KAAK,QACR;EAGF,MAAM,SAAS,cAAc;EAE7B,IAAI,QAAQ;GACV,MAAM,UAAU,OAAO,IAAI,iCAAiC,wBAAwB;GAGpF,IAAI,CAAC,MAFiB,uBAAuB,QAAQ,OAAO,GAG1D,IAAI,KACF,QACA,YACA,2CAA2C,QAAQ,mBACrD;EAEJ;EAEA,KAAK,SAAS;CAChB;;;;;;CAOA,AAAO,cAAc,cAAiC;EAEpD,OAAO,aAAa,MAAM,SAAS;GACjC,MAAM,eAAe,KAAK,QAAQ,OAAO,GAAG;GAC5C,OAAO,KAAK,aAAa,SAAS,YAAY;EAChD,CAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"http-connector.mjs","names":["config"],"sources":["../../../../../../../../packages/core/src/connectors/http-connector.ts"],"sourcesContent":["import config from \"@mongez/config\";\nimport { colors } from \"@mongez/copper\";\nimport { log } from \"@warlock.js/logger\";\nimport { Application, getRoles, servesHttp } from \"../application\";\nimport { health } from \"../http/health\";\nimport { assertPortIsAvailable } from \"../http/port-preflight\";\nimport { registerHttpPlugins } from \"../http/plugins\";\nimport { notifyHttpServerRebuilt } from \"../http/server-rebuilt\";\nimport { setHttpReadyReport } from \"../http/ready-report\";\nimport { isCanonicalPortValue, resolveBindPort } from \"../http/resolve-bind-port\";\nimport {\n closeServerWithTimeout,\n type FastifyInstance,\n getHttpServer,\n startHttpServer,\n} from \"../http/server\";\nimport { ensureFatalIsVisible } from \"../logger/fatal-visibility\";\nimport { router } from \"../router/router\";\nimport { type Environment } from \"../utils\";\nimport { setBaseUrl } from \"../utils/urls\";\nimport { container } from \"./../container\";\nimport { BaseConnector } from \"./base-connector\";\nimport { describeServerAddress } from \"./describe-server-address\";\nimport { readBoundPort } from \"./read-bound-port\";\nimport { ConnectorLifecyclePhase, ConnectorPriority } from \"./types\";\n\nfunction environmentColor(environment: Environment) {\n switch (environment) {\n case \"development\":\n return colors.magentaBright(environment);\n case \"test\":\n return colors.yellowBright(environment);\n case \"production\":\n return colors.greenBright(environment);\n default:\n return colors.white(environment);\n }\n}\n\n/**\n * Default time to wait for in-flight requests to drain on shutdown before the\n * HTTP server is force-closed. Override via `http.gracefulShutdown.timeout`.\n */\nconst DEFAULT_SHUTDOWN_TIMEOUT = 10_000;\n\n/**\n * HTTP Connector\n * Manages HTTP server (Fastify) lifecycle\n */\nexport class HttpConnector extends BaseConnector {\n public readonly name = \"http\";\n public readonly priority = ConnectorPriority.HTTP;\n public readonly lifecyclePhase = ConnectorLifecyclePhase.Late;\n\n /**\n * Files that trigger HTTP server restart\n * Note: routes.ts changes will be handled by HMR with wildcard routing\n * Connectors receive config file paths directly (not .env) thanks to layer-executor\n */\n protected readonly watchedFiles = [\"src/config/http.ts\", \"src/config/http.tsx\"];\n\n /**\n * Fastify Server instance\n */\n protected http?: FastifyInstance;\n\n /**\n * Whether someone downstream will render the combined ready block.\n *\n * Only the dev server does (`dev-server/ready-block.ts`), and only it can:\n * the block reports facts — boot duration, the web surface — that this\n * connector does not own and must not wait for. When it will, this connector\n * records and stays quiet; otherwise it narrates as it always has.\n *\n * Keyed on the runtime strategy rather than on `NODE_ENV`, because that is\n * what actually distinguishes \"a dev server is driving this boot\" from \"an\n * app happens to be running with development config\".\n *\n * `!isBooted` is the second half and it is not a detail. The block summarises\n * a BOOT. A `restart()` after boot — an edited `src/config/http.ts` — is an\n * EVENT, and there is no block coming to carry it, so suppressing the lines\n * there would rebind the port in total silence.\n */\n protected get rendersReadyBlock(): boolean {\n return Application.runtimeStrategy === \"development\" && !Application.isBooted;\n }\n\n /**\n * Boot the connector — construction only (create Fastify, register\n * plugins, populate container). Route scanning is deferred to\n * `start()` so it reads the router after app code has registered.\n */\n public async boot() {\n const httpConfig = config.get(\"http\");\n\n if (!httpConfig) return;\n\n const port = httpConfig.port;\n log.info(\n `http`,\n \"connection\",\n `Starting http server on port ${port} in ${environmentColor(Application.environment)} mode`,\n );\n\n this.http = startHttpServer(httpConfig.serverOptions);\n\n container.set(\"http.server\", this.http);\n\n await registerHttpPlugins(this.http);\n\n const baseUrl = config.get(\"app.baseUrl\");\n\n // update base url\n setBaseUrl(baseUrl);\n\n // Liveness/readiness endpoints — registered on Fastify before start() scans\n // the app router, so they exist by the time the server listens.\n this.registerHealthRoutes();\n }\n\n /**\n * Register the built-in liveness (`/health`) and readiness (`/ready`)\n * endpoints directly on the Fastify instance — infra routes, kept off the app\n * router so they're immune to HMR and never collide with route scanning. Opt\n * out via `http.health.enabled = false`; rename via `http.health.path` /\n * `http.health.readinessPath`.\n */\n private registerHealthRoutes(): void {\n if (!this.http) {\n return;\n }\n\n const healthConfig = config.get(\"http.health\");\n\n if (healthConfig?.enabled === false) {\n return;\n }\n\n const livenessPath = healthConfig?.path ?? \"/health\";\n const readinessPath = healthConfig?.readinessPath ?? \"/ready\";\n\n // Infrastructure probes must stay reachable after client quotas are spent.\n // Opting in inherits the configured global policy and its shared bucket.\n const routeOptions = {\n config: { rateLimit: healthConfig?.rateLimit === true ? undefined : false },\n };\n\n this.http.get(livenessPath, routeOptions, async (_request: any, reply: any) => {\n const result = health.liveness();\n\n return reply.code(result.status === \"ok\" ? 200 : 503).send(result);\n });\n\n this.http.get(readinessPath, routeOptions, async (_request: any, reply: any) => {\n const result = await health.readiness();\n\n return reply.code(result.status === \"ok\" ? 200 : 503).send(result);\n });\n }\n\n /**\n * Initialize HTTP server — bind app-registered routes to Fastify\n * then listen. Scanning here (not in `boot`) lets HTTP boot before\n * app code without losing routes.\n */\n public async start(): Promise<void> {\n const httpConfig = config.get(\"http\");\n\n if (!httpConfig || !this.http) return;\n\n // Neither `api` nor `web` is active — an http-only listener would serve\n // nothing this process is meant to answer, so it never binds. `worker`\n // is the only role that reaches here today; named generically so a\n // future role composition still reads correctly.\n if (!servesHttp()) {\n log.info(\"http\", \"connection\", `http: not started (role: ${[...getRoles()].join(\", \")})`);\n\n return;\n }\n\n // Read once. `Application.isBooted` flips during the same boot this method\n // belongs to, and a predicate that answered differently before and after\n // `listen()` would print half a report.\n const deferToReadyBlock = this.rendersReadyBlock;\n\n if (Application.runtimeStrategy === \"development\") {\n router.scanDevServer(this.http);\n } else {\n router.scan(this.http);\n }\n\n // Surface the route table as a readiness signal + a boot log, so an empty\n // or partial route surface (e.g. a route module that failed to register) is\n // detectable instead of silently 404ing. `addRoutesRegisteredCheck` is\n // keyed by name, so re-running on restart is idempotent.\n health.addRoutesRegisteredCheck(() => router.routeCount());\n\n const routeCount = router.routeCount();\n\n // In development this fact is one line of the single ready block rendered\n // after boot completes (`dev-server/ready-block.ts`); printing it here as\n // well would put the same number on screen twice, in two formats. Outside\n // development the line is load-bearing — a supervisor or CI log greps it —\n // so it stays exactly as it was.\n if (!deferToReadyBlock) {\n log.info(\"http\", \"routes\", `${routeCount} route(s) registered`);\n }\n\n // Resolved ONCE, here, at the top of the bind sequence: `httpConfig.port`\n // may still be a string that round-tripped `env()`'s number coercion\n // (`\"03999\"`, `\" 3999\"`, `\"1e3\"`) — `net.Server.listen({ port })` binds\n // all of those without complaint, silently, sometimes to the WRONG port\n // (`\"1e3\"` -> 1000). Every downstream use of the port — the preflight\n // probe and `listen()` itself — must agree on the same resolved number.\n //\n // This is still the port ASKED for, not the port BOUND — `port: 0` asks\n // for \"any free port\" and this stays `0` for that case. What gets\n // published to `warlock:ready` is read back from `listen()`'s resolved\n // address further down, never this value.\n const configuredPort = resolveBindPort(httpConfig.port);\n\n if (!isCanonicalPortValue(httpConfig.port, configuredPort)) {\n log.info(\n \"http\",\n \"connection\",\n `Configured http.port ${JSON.stringify(httpConfig.port)} normalised to ${configuredPort}.`,\n );\n }\n\n try {\n // Preflight the bind before `listen()` so a collision surfaces as the\n // instruction in `PortInUseError.message` (which names the port) instead\n // of a raw `EADDRINUSE` from deep inside Fastify/libuv.\n //\n // Port 0 is exempt: it asks the OS for a free port, so probing it binds\n // some unrelated ephemeral port and \"passes\" while proving nothing about\n // the port this server will actually take.\n if (configuredPort !== 0) {\n await assertPortIsAvailable(configuredPort, httpConfig.host || \"localhost\");\n }\n\n // `listen()` RESOLVES with the address it actually bound — which is the\n // only address worth announcing. See `describe-server-address.ts` for why\n // announcing `app.baseUrl` here instead was a defect rather than a\n // shortcut.\n const boundAddress = await this.http.listen({\n port: configuredPort,\n host: httpConfig.host || \"localhost\",\n });\n\n // Read the ACTUALLY-bound port back out of what `listen()` resolved,\n // rather than republishing `configuredPort`. With `http.port: 0` the OS\n // picks the port, so `configuredPort` stays `0` forever — publishing it\n // instead of the real port is exactly the \"Server ready at a URL that\n // gives connection refused\" defect `describe-server-address.ts` already\n // fixed for the display string. `boundAddress` always carries an\n // explicit port (Fastify never omits one), so `configuredPort` is only\n // a defensive fallback for an address this parse cannot make sense of.\n const boundPort = readBoundPort(boundAddress, configuredPort);\n\n Application.setServedPort(boundPort);\n\n const address = describeServerAddress(\n boundAddress,\n config.get(\"app.baseUrl\"),\n // Passed because `listen()` does not report it back: Fastify resolves a\n // `0.0.0.0` bind to `http://127.0.0.1:<port>`, so the wildcard is only\n // recoverable from what we ASKED for.\n httpConfig.host || \"localhost\",\n );\n\n // Recorded unconditionally: the ready block reads it in development, and\n // in every other mode it is simply the one place that knows what was\n // bound, which is worth having whether or not anything renders it.\n setHttpReadyReport({\n boundAddress: address.boundAddress,\n url: address.url,\n wildcardBind: address.wildcardBind,\n port: boundPort,\n routeCount,\n publicUrl: address.publicUrl,\n });\n\n if (!deferToReadyBlock) {\n log.success(`http`, \"connection\", address.ready);\n\n if (address.publicUrl) {\n log.info(`http`, \"connection\", address.publicUrl);\n }\n }\n\n // NEVER conditional on the block. A base URL pointing at a port nothing\n // is listening on is the single most misleading state this connector can\n // be in, and a warning a status block swallows is a warning nobody reads\n // — so it is logged where it lands ABOVE the block, in both modes.\n if (address.warning) {\n log.warn(`http`, \"connection\", address.warning);\n }\n } catch (error) {\n // A failed listen()/port-bind at boot means the app can't serve — fatal.\n // `log.fatal` reaches Sentry/file; `await log.flush()` drains buffered and\n // async channels before the process exits.\n await log.fatal(\"http\", \"connection\", error);\n\n // …and `log.fatal` reaches NOBODY when the app's log config declares no\n // terminal channel — the ordinary production shape (`production: {\n // channels: [new FileLog()] }`), and the shape of every app with no `log`\n // config at all, since `LoggerConnector.start()` then returns before\n // `log.configure`. That is how an `EADDRINUSE` at boot became a process\n // that exited 1 in total silence: the error was constructed, thrown and\n // caught exactly as designed, and then written to zero channels. stderr\n // is the one destination that is always there.\n ensureFatalIsVisible(error);\n\n await log.flush();\n\n process.exit(1); // stop the process, exit with error\n }\n\n this.active = true;\n }\n\n /**\n * Restart — needs a fresh Fastify instance since `start()` now\n * re-runs `router.scan()`, and re-scanning the same Fastify would\n * register duplicate route handlers.\n */\n public async restart(): Promise<void> {\n await this.shutdown();\n await this.boot();\n\n // Subscribers (the web connector's Vite middleware) re-attach to the new\n // instance here: after it exists, before `start()` listens.\n if (this.http) notifyHttpServerRebuilt(this.http);\n\n await this.start();\n }\n\n /**\n * Shutdown HTTP server\n */\n public async shutdown(): Promise<void> {\n if (!this.active) {\n return;\n }\n\n const server = getHttpServer();\n\n if (server) {\n const timeout = config.get(\"http.gracefulShutdown.timeout\", DEFAULT_SHUTDOWN_TIMEOUT);\n const drained = await closeServerWithTimeout(server, timeout);\n\n if (!drained) {\n log.warn(\n \"http\",\n \"shutdown\",\n `In-flight requests did not drain within ${timeout}ms; closing anyway`,\n );\n }\n }\n\n this.active = false;\n }\n\n /**\n * Override shouldRestart to handle routes.ts specially\n * routes.ts changes should NOT restart the server (use HMR instead)\n * Now receives config file paths directly from layer-executor\n */\n public shouldRestart(changedFiles: string[]): boolean {\n // Only restart for config changes, not routes\n return changedFiles.some((file) => {\n const relativePath = file.replace(/\\\\/g, \"/\");\n return this.watchedFiles.includes(relativePath);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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AQ;IACtB,KAAK,QAAQ;IACb,cAAc,QAAQ;IACtB,MAAM;IACN;IACA,WAAW,QAAQ;GACrB,CAAC;GAED,IAAI,CAAC,mBAAmB;IACtB,IAAI,QAAQ,QAAQ,cAAc,QAAQ,KAAK;IAE/C,IAAI,QAAQ,WACV,IAAI,KAAK,QAAQ,cAAc,QAAQ,SAAS;GAEpD;GAMA,IAAI,QAAQ,SACV,IAAI,KAAK,QAAQ,cAAc,QAAQ,OAAO;EAElD,SAAS,OAAO;GAId,MAAM,IAAI,MAAM,QAAQ,cAAc,KAAK;GAU3C,qBAAqB,KAAK;GAE1B,MAAM,IAAI,MAAM;GAEhB,QAAQ,KAAK,CAAC;EAChB;EAEA,KAAK,SAAS;CAChB;;;;;;CAOA,MAAa,UAAyB;EACpC,MAAM,KAAK,SAAS;EACpB,MAAM,KAAK,KAAK;EAIhB,IAAI,KAAK,MAAM,wBAAwB,KAAK,IAAI;EAEhD,MAAM,KAAK,MAAM;CACnB;;;;CAKA,MAAa,WAA0B;EACrC,IAAI,CAAC,KAAK,QACR;EAGF,MAAM,SAAS,cAAc;EAE7B,IAAI,QAAQ;GACV,MAAM,UAAUA,WAAO,IAAI,iCAAiC,wBAAwB;GAGpF,IAAI,CAAC,MAFiB,uBAAuB,QAAQ,OAAO,GAG1D,IAAI,KACF,QACA,YACA,2CAA2C,QAAQ,mBACrD;EAEJ;EAEA,KAAK,SAAS;CAChB;;;;;;CAOA,AAAO,cAAc,cAAiC;EAEpD,OAAO,aAAa,MAAM,SAAS;GACjC,MAAM,eAAe,KAAK,QAAQ,OAAO,GAAG;GAC5C,OAAO,KAAK,aAAa,SAAS,YAAY;EAChD,CAAC;CACH;AACF"}
|
|
@@ -14,4 +14,5 @@ import { MailerConnector } from "./mail-connector.mjs";
|
|
|
14
14
|
import { NotificationsConnector } from "./notifications-connector.mjs";
|
|
15
15
|
import { RegisterConfiguredConnectorsOptions, registerConfiguredConnectors } from "./register-configured-connectors.mjs";
|
|
16
16
|
import { SocketConnector } from "./socket-connector.mjs";
|
|
17
|
-
import { StorageConnector } from "./storage.connector.mjs";
|
|
17
|
+
import { StorageConnector } from "./storage.connector.mjs";
|
|
18
|
+
export { AccessConnector, AiConnector, BaseConnector, CacheConnector, Connector, ConnectorBuildContext, ConnectorBuildContribution, ConnectorBuildGenerateResult, ConnectorEsbuildPatch, ConnectorLifecyclePhase, ConnectorName, ConnectorPriority, ConnectorsManager, DatabaseConnector, HeraldConnector, HttpConnector, LoggerConnector, MailerConnector, NotificationsConnector, RegisterConfiguredConnectorsOptions, SocketConnector, StorageConnector, assertNoReservedConnectorNames, assertUniqueConnectorNames, connectorsManager, registerConfiguredConnectors };
|
package/esm/connectors/index.mjs
CHANGED
|
@@ -16,4 +16,4 @@ import { assertNoReservedConnectorNames } from "./assert-no-reserved-connector-n
|
|
|
16
16
|
import { assertUniqueConnectorNames } from "./assert-unique-connector-names.mjs";
|
|
17
17
|
import { registerConfiguredConnectors } from "./register-configured-connectors.mjs";
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { AccessConnector, AiConnector, BaseConnector, CacheConnector, ConnectorLifecyclePhase, ConnectorPriority, ConnectorsManager, DatabaseConnector, HeraldConnector, HttpConnector, LoggerConnector, MailerConnector, NotificationsConnector, SocketConnector, StorageConnector, assertNoReservedConnectorNames, assertUniqueConnectorNames, connectorsManager, registerConfiguredConnectors };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ConnectorLifecyclePhase, ConnectorPriority } from "./types.mjs";
|
|
2
2
|
import { BaseConnector } from "./base-connector.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/connectors/logger-connector.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Logger Connector
|
|
7
6
|
* Manages logger lifecycle and ensures synchronous flushing on termination
|
|
8
7
|
*/
|
|
9
|
-
declare class LoggerConnector extends BaseConnector {
|
|
8
|
+
export declare class LoggerConnector extends BaseConnector {
|
|
10
9
|
readonly name = "logger";
|
|
11
10
|
readonly priority = ConnectorPriority.LOGGER;
|
|
12
11
|
readonly lifecyclePhase = ConnectorLifecyclePhase.Early;
|
|
@@ -24,5 +23,4 @@ declare class LoggerConnector extends BaseConnector {
|
|
|
24
23
|
shutdown(): Promise<void>;
|
|
25
24
|
}
|
|
26
25
|
//#endregion
|
|
27
|
-
export { LoggerConnector };
|
|
28
26
|
//# sourceMappingURL=logger-connector.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/logger-connector.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger-connector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/connectors/logger-connector.ts"],"mappings":";;;;;;;qBAUa,wBAAwB;WACnB;WACA,WAAQ,kBAAA;WACR,iBAAc,wBAAA;;;;qBAKX;;;;EAKN,SAAS;;;;EAmBT,YAAY"}
|