@warlock.js/core 5.28.0 → 5.30.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 +71 -0
- package/esm/application/app.d.mts +1 -1
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/app.mjs +1 -1
- package/esm/application/app.mjs.map +1 -1
- package/esm/application/application-config-types.d.mts +1 -1
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +1 -1
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +1 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +1 -1
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/boot-signal.mjs +1 -1
- package/esm/application/boot-signal.mjs.map +1 -1
- package/esm/application/public-url.d.mts +1 -1
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/public-url.mjs +1 -1
- package/esm/application/public-url.mjs.map +1 -1
- package/esm/application/roles.d.mts +1 -1
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/application/roles.mjs +1 -1
- package/esm/application/roles.mjs.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.mjs +1 -1
- package/esm/benchmark/benchmark-snapshots.mjs.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -1
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/benchmark.mjs +1 -1
- package/esm/benchmark/benchmark.mjs.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -1
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.mjs +1 -1
- package/esm/benchmark/channels/console.channel.mjs.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.mjs +1 -1
- package/esm/benchmark/channels/noop.channel.mjs.map +1 -1
- package/esm/benchmark/profiler.d.mts +1 -1
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +1 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +1 -1
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -1
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap/setup.mjs +1 -1
- package/esm/bootstrap/setup.mjs.map +1 -1
- package/esm/bootstrap.d.mts +1 -1
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/bootstrap.mjs +1 -1
- package/esm/bootstrap.mjs.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +1 -1
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/database-cache-driver.mjs.map +1 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cache/index.mjs.map +1 -1
- package/esm/cli/cli-commands.manager.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/cli-commands.utils.mjs +1 -1
- package/esm/cli/cli-commands.utils.mjs.map +1 -1
- package/esm/cli/commands/add.command.mjs +1 -1
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/build.command.mjs +1 -1
- package/esm/cli/commands/build.command.mjs.map +1 -1
- package/esm/cli/commands/create-database.command.mjs +1 -1
- package/esm/cli/commands/create-database.command.mjs.map +1 -1
- package/esm/cli/commands/dev-server.command.mjs +1 -1
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/config.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/config.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/connectors.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/connectors.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/health.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/health.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/index.mjs +1 -1
- package/esm/cli/commands/doctor/checks/index.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/routes.check.mjs +1 -1
- package/esm/cli/commands/doctor/checks/routes.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/doctor/format-report.mjs +1 -1
- package/esm/cli/commands/doctor/format-report.mjs.map +1 -1
- package/esm/cli/commands/doctor/run-checks.mjs +1 -1
- package/esm/cli/commands/doctor/run-checks.mjs.map +1 -1
- package/esm/cli/commands/doctor.command.mjs +1 -1
- package/esm/cli/commands/doctor.command.mjs.map +1 -1
- package/esm/cli/commands/drop-tables.command.mjs +1 -1
- package/esm/cli/commands/drop-tables.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generate.command.mjs +1 -1
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/column-dsl-parser.mjs +1 -1
- package/esm/cli/commands/generate/generators/column-dsl-parser.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/migration.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/module.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/module.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/use-case.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/use-case.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/stubs.mjs +1 -1
- package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/prompt.mjs +1 -1
- package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/writer.mjs +1 -1
- package/esm/cli/commands/generate/utils/writer.mjs.map +1 -1
- package/esm/cli/commands/migrate.command.mjs +1 -1
- package/esm/cli/commands/migrate.command.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.command.mjs +1 -1
- package/esm/cli/commands/openapi-generator.command.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.action.mjs +1 -1
- package/esm/cli/commands/postman-generator.action.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.command.mjs +1 -1
- package/esm/cli/commands/postman-generator.command.mjs.map +1 -1
- package/esm/cli/commands/routes/diff-page-routes.mjs +1 -1
- package/esm/cli/commands/routes/diff-page-routes.mjs.map +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs.map +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs.map +1 -1
- package/esm/cli/commands/routes/routes-command.action.mjs +1 -1
- package/esm/cli/commands/routes/routes-command.action.mjs.map +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/routes/with-console-on-stderr.mjs +1 -1
- package/esm/cli/commands/routes/with-console-on-stderr.mjs.map +1 -1
- package/esm/cli/commands/routes.command.mjs +1 -1
- package/esm/cli/commands/routes.command.mjs.map +1 -1
- package/esm/cli/commands/seed.command.mjs +1 -1
- package/esm/cli/commands/seed.command.mjs.map +1 -1
- package/esm/cli/commands/start-production.command.mjs +1 -1
- package/esm/cli/commands/start-production.command.mjs.map +1 -1
- package/esm/cli/commands/storage-put.action.mjs +1 -1
- package/esm/cli/commands/storage-put.action.mjs.map +1 -1
- package/esm/cli/commands/storage-put.command.mjs +1 -1
- package/esm/cli/commands/storage-put.command.mjs.map +1 -1
- package/esm/cli/commands/typings-generator.command.mjs +1 -1
- package/esm/cli/commands/typings-generator.command.mjs.map +1 -1
- package/esm/cli/commands/update.command.mjs +1 -1
- package/esm/cli/commands/update.command.mjs.map +1 -1
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/commands-loader.mjs.map +1 -1
- package/esm/cli/framework-cli-commands.mjs +1 -1
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +1 -1
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.mjs +1 -1
- package/esm/cli/start.mjs.map +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/cli/string-similarity.mjs.map +1 -1
- package/esm/commands/cli-command.d.mts +1 -1
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/cli-command.mjs +1 -1
- package/esm/commands/cli-command.mjs.map +1 -1
- package/esm/commands/types.d.mts +1 -1
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +1 -1
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +1 -1
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -1
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-handlers.mjs +1 -1
- package/esm/config/config-handlers.mjs.map +1 -1
- package/esm/config/config-key-from-path.mjs +1 -1
- package/esm/config/config-key-from-path.mjs.map +1 -1
- package/esm/config/config-loader.d.mts +1 -1
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +1 -1
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-manager.mjs.map +1 -1
- package/esm/config/config-setter.d.mts +1 -1
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +1 -1
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +1 -1
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/config-special-handlers.mjs +1 -1
- package/esm/config/config-special-handlers.mjs.map +1 -1
- package/esm/config/load-config-files.mjs +1 -1
- package/esm/config/load-config-files.mjs.map +1 -1
- package/esm/config/locale-configuration.mjs +1 -1
- package/esm/config/locale-configuration.mjs.map +1 -1
- package/esm/config/types.d.mts +1 -1
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -1
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +1 -1
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -1
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +1 -1
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -1
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/base-connector.mjs +1 -1
- package/esm/connectors/base-connector.mjs.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -1
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +1 -1
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +1 -1
- 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 -1
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +1 -1
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +1 -1
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -1
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +1 -1
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -1
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +1 -1
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -1
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +1 -1
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -1
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +1 -1
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -1
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +1 -1
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/read-bound-port.mjs +1 -1
- package/esm/connectors/read-bound-port.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +1 -1
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/register-configured-connectors.mjs +1 -1
- package/esm/connectors/register-configured-connectors.mjs.map +1 -1
- package/esm/connectors/single-server-warnings.mjs +1 -1
- package/esm/connectors/single-server-warnings.mjs.map +1 -1
- package/esm/connectors/socket-connector.d.mts +1 -1
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +1 -1
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -1
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +1 -1
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +1 -1
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/connectors/types.mjs +1 -1
- package/esm/connectors/types.mjs.map +1 -1
- package/esm/container/container-instance-registry.mjs +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +31 -0
- package/esm/container/development-app-modules.d.mts.map +1 -0
- package/esm/container/development-model-modules.d.mts +1 -1
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +3 -1
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/create-database-action.mjs +1 -1
- package/esm/database/create-database-action.mjs.map +1 -1
- package/esm/database/drop-tables-action.mjs +1 -1
- package/esm/database/drop-tables-action.mjs.map +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +31 -39
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/database-log.mjs +1 -1
- package/esm/database/models/database-log/database-log.mjs.map +1 -1
- package/esm/database/pending-exit-code.mjs +1 -1
- package/esm/database/pending-exit-code.mjs.map +1 -1
- package/esm/database/resolve-pending-migrations.mjs +1 -1
- package/esm/database/resolve-pending-migrations.mjs.map +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seed-command-action.mjs.map +1 -1
- package/esm/database/seeds/seed-records-table-migration.mjs +1 -1
- package/esm/database/seeds/seed-records-table-migration.mjs.map +1 -1
- package/esm/database/seeds/seeder.d.mts +1 -1
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +1 -1
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.mjs +1 -1
- package/esm/database/seeds/seeder.errors.mjs.map +1 -1
- package/esm/database/seeds/seeder.mjs +1 -1
- package/esm/database/seeds/seeder.mjs.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +1 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/seeds-table-migration.mjs +1 -1
- package/esm/database/seeds/seeds-table-migration.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +1 -1
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/seeds/utils.mjs +1 -1
- package/esm/database/seeds/utils.mjs.map +1 -1
- package/esm/database/utils.d.mts +1 -1
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/database/utils.mjs +1 -1
- package/esm/database/utils.mjs.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +52 -0
- package/esm/dev-server/app-module-registry.mjs.map +1 -0
- package/esm/dev-server/boot-precondition-error.mjs +1 -1
- package/esm/dev-server/boot-precondition-error.mjs.map +1 -1
- package/esm/dev-server/build-development-openapi-document.mjs +1 -1
- package/esm/dev-server/build-development-openapi-document.mjs.map +1 -1
- package/esm/dev-server/check-for-updates.mjs +1 -1
- package/esm/dev-server/check-for-updates.mjs.map +1 -1
- package/esm/dev-server/collect-development-api-routes.mjs +1 -1
- package/esm/dev-server/collect-development-api-routes.mjs.map +1 -1
- package/esm/dev-server/create-worker.mjs +1 -1
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -1
- 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/dev-logger.mjs +1 -1
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +1 -1
- package/esm/dev-server/development-server.mjs.map +1 -1
- package/esm/dev-server/events.mjs +1 -1
- package/esm/dev-server/events.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +1 -1
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-event-handler.mjs +1 -1
- package/esm/dev-server/file-event-handler.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +1 -1
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-manager.mjs +1 -1
- package/esm/dev-server/file-manager.mjs.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -1
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/file-operations.mjs +1 -1
- package/esm/dev-server/file-operations.mjs.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +28 -14
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.mjs +1 -1
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/flags.mjs +1 -1
- package/esm/dev-server/flags.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/base-health-checker.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/base-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +1 -1
- 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 +1 -1
- 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 +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.mjs +1 -1
- package/esm/dev-server/health-checker/file-health-result.mjs.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/layer-executor.mjs +1 -1
- package/esm/dev-server/layer-executor.mjs.map +1 -1
- package/esm/dev-server/legacy-locales-warning.mjs +1 -1
- package/esm/dev-server/legacy-locales-warning.mjs.map +1 -1
- package/esm/dev-server/loader/build-transpile-init.mjs +1 -1
- package/esm/dev-server/loader/build-transpile-init.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/hook-thread.mjs +1 -1
- package/esm/dev-server/loader/hook-thread.mjs.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +1 -1
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +1 -1
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs +34 -0
- package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -0
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/own-resolver.mjs.map +1 -1
- package/esm/dev-server/loader/register-loader.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-capture.mjs +1 -1
- package/esm/dev-server/loader/resolve-capture.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +2 -2
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/source-slug.mjs +1 -1
- package/esm/dev-server/loader/source-slug.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/loader/version-registry.mjs +1 -1
- package/esm/dev-server/loader/version-registry.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -1
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/manifest-manager.mjs +1 -1
- package/esm/dev-server/manifest-manager.mjs.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +1 -1
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +1 -1
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +1 -1
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/package-json-manager.mjs.map +1 -1
- package/esm/dev-server/parse-imports.mjs +73 -6
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +1 -1
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/ready-block.mjs.map +1 -1
- package/esm/dev-server/register-dev-shortcuts.mjs +1 -1
- package/esm/dev-server/register-dev-shortcuts.mjs.map +1 -1
- package/esm/dev-server/register-installed-devtools.mjs +1 -1
- package/esm/dev-server/register-installed-devtools.mjs.map +1 -1
- package/esm/dev-server/restart-dev-server.mjs +1 -1
- package/esm/dev-server/restart-dev-server.mjs.map +1 -1
- package/esm/dev-server/route-types-publisher.mjs +1 -1
- package/esm/dev-server/route-types-publisher.mjs.map +1 -1
- package/esm/dev-server/run-connector-typings.mjs +1 -1
- package/esm/dev-server/run-connector-typings.mjs.map +1 -1
- package/esm/dev-server/run-typings-generation.mjs +1 -1
- package/esm/dev-server/run-typings-generation.mjs.map +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs.map +1 -1
- package/esm/dev-server/special-file-patterns.mjs +1 -1
- package/esm/dev-server/special-file-patterns.mjs.map +1 -1
- package/esm/dev-server/special-files-collector.d.mts +1 -1
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/special-files-collector.mjs +1 -1
- package/esm/dev-server/special-files-collector.mjs.map +1 -1
- package/esm/dev-server/start-development-server.mjs +1 -1
- package/esm/dev-server/start-development-server.mjs.map +1 -1
- package/esm/dev-server/supervisor.mjs +1 -1
- package/esm/dev-server/supervisor.mjs.map +1 -1
- package/esm/dev-server/translation-keys-sources.mjs +1 -1
- package/esm/dev-server/translation-keys-sources.mjs.map +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +1 -1
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +32 -11
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +1 -1
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +1 -1
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/dev-server/utils.mjs +1 -1
- package/esm/dev-server/utils.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +1 -1
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/encrypt.mjs +1 -1
- package/esm/encryption/encrypt.mjs.map +1 -1
- package/esm/encryption/hash.d.mts +1 -1
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/hash.mjs +1 -1
- package/esm/encryption/hash.mjs.map +1 -1
- package/esm/encryption/password.d.mts +1 -1
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/password.mjs +1 -1
- package/esm/encryption/password.mjs.map +1 -1
- package/esm/encryption/types.d.mts +1 -1
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/container-key-missing-error.mjs +1 -1
- package/esm/errors/container-key-missing-error.mjs.map +1 -1
- package/esm/errors/esbuild-binary-missing-error.mjs +1 -1
- package/esm/errors/esbuild-binary-missing-error.mjs.map +1 -1
- package/esm/errors/index.d.mts +2 -0
- package/esm/errors/index.mjs +3 -0
- package/esm/errors/unknown-locale-error.mjs +1 -1
- package/esm/errors/unknown-locale-error.mjs.map +1 -1
- package/esm/generations/add-command.action.mjs +29 -6
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/access.feature.mjs +1 -1
- package/esm/generations/features/access.feature.mjs.map +1 -1
- package/esm/generations/features/ai-anthropic.feature.mjs +1 -1
- package/esm/generations/features/ai-anthropic.feature.mjs.map +1 -1
- package/esm/generations/features/ai-bedrock.feature.mjs +1 -1
- package/esm/generations/features/ai-bedrock.feature.mjs.map +1 -1
- package/esm/generations/features/ai-google.feature.mjs +1 -1
- package/esm/generations/features/ai-google.feature.mjs.map +1 -1
- package/esm/generations/features/ai-ollama.feature.mjs +1 -1
- package/esm/generations/features/ai-ollama.feature.mjs.map +1 -1
- package/esm/generations/features/ai-openai.feature.mjs +1 -1
- package/esm/generations/features/ai-openai.feature.mjs.map +1 -1
- package/esm/generations/features/ai-panoptic.feature.mjs +1 -1
- package/esm/generations/features/ai-panoptic.feature.mjs.map +1 -1
- package/esm/generations/features/ai-tools.feature.mjs +1 -1
- package/esm/generations/features/ai-tools.feature.mjs.map +1 -1
- package/esm/generations/features/ai-workspace.feature.mjs +1 -1
- package/esm/generations/features/ai-workspace.feature.mjs.map +1 -1
- package/esm/generations/features/ai.feature.mjs +1 -1
- package/esm/generations/features/ai.feature.mjs.map +1 -1
- package/esm/generations/features/auth-google.feature.mjs +1 -1
- package/esm/generations/features/auth-google.feature.mjs.map +1 -1
- package/esm/generations/features/auth-passkeys.feature.mjs +1 -1
- package/esm/generations/features/auth-passkeys.feature.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +1 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/devtools.feature.mjs +1 -1
- package/esm/generations/features/devtools.feature.mjs.map +1 -1
- package/esm/generations/features/herald.feature.mjs +1 -1
- package/esm/generations/features/herald.feature.mjs.map +1 -1
- package/esm/generations/features/image.feature.mjs +1 -1
- package/esm/generations/features/image.feature.mjs.map +1 -1
- package/esm/generations/features/index.mjs +1 -1
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/mail.feature.mjs +1 -1
- package/esm/generations/features/mail.feature.mjs.map +1 -1
- package/esm/generations/features/mongodb.feature.mjs +1 -1
- package/esm/generations/features/mongodb.feature.mjs.map +1 -1
- package/esm/generations/features/mysql.feature.mjs +1 -1
- package/esm/generations/features/mysql.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +121 -17
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/postgres.feature.mjs +1 -1
- package/esm/generations/features/postgres.feature.mjs.map +1 -1
- package/esm/generations/features/queue.feature.mjs +1 -1
- package/esm/generations/features/queue.feature.mjs.map +1 -1
- package/esm/generations/features/react-email.feature.mjs +1 -1
- package/esm/generations/features/react-email.feature.mjs.map +1 -1
- package/esm/generations/features/react.feature.mjs +1 -1
- package/esm/generations/features/react.feature.mjs.map +1 -1
- package/esm/generations/features/redis.feature.mjs +1 -1
- package/esm/generations/features/redis.feature.mjs.map +1 -1
- package/esm/generations/features/s3.feature.mjs +1 -1
- package/esm/generations/features/s3.feature.mjs.map +1 -1
- package/esm/generations/features/scheduler.feature.mjs +1 -1
- package/esm/generations/features/scheduler.feature.mjs.map +1 -1
- package/esm/generations/features/ses.feature.mjs +1 -1
- package/esm/generations/features/ses.feature.mjs.map +1 -1
- package/esm/generations/features/shadcn.feature.mjs +1 -1
- package/esm/generations/features/shadcn.feature.mjs.map +1 -1
- package/esm/generations/features/shared/insert-connector-entry.mjs +1 -1
- package/esm/generations/features/shared/insert-connector-entry.mjs.map +1 -1
- package/esm/generations/features/shared/insert-queue-dashboard-block.mjs +1 -1
- package/esm/generations/features/shared/insert-queue-dashboard-block.mjs.map +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs.map +1 -1
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs +1 -1
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/migration-timestamp.mjs +1 -1
- package/esm/generations/features/shared/migration-timestamp.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
- package/esm/generations/features/shared/resolve-contact-scaffold.mjs +1 -1
- package/esm/generations/features/shared/resolve-contact-scaffold.mjs.map +1 -1
- package/esm/generations/features/sitemap.feature.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/features/socket.feature.mjs +1 -1
- package/esm/generations/features/socket.feature.mjs.map +1 -1
- package/esm/generations/features/tailwind.feature.mjs +1 -1
- package/esm/generations/features/tailwind.feature.mjs.map +1 -1
- package/esm/generations/features/test.feature.mjs +1 -1
- package/esm/generations/features/test.feature.mjs.map +1 -1
- package/esm/generations/features/types.mjs +1 -1
- package/esm/generations/features/types.mjs.map +1 -1
- package/esm/generations/features/web.feature.mjs +1 -1
- package/esm/generations/features/web.feature.mjs.map +1 -1
- package/esm/generations/pnpm-build-approvals.mjs +89 -3
- package/esm/generations/pnpm-build-approvals.mjs.map +1 -1
- package/esm/generations/stubs.mjs +184 -78
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +1 -1
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +1 -1
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/build-cors-options.mjs +1 -1
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +22 -1
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +7 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/config.d.mts +1 -1
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +1 -1
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +1 -1
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-context.mjs +1 -1
- package/esm/http/context/request-context.mjs.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -1
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/context/request-memo.mjs +1 -1
- package/esm/http/context/request-memo.mjs.map +1 -1
- package/esm/http/createHttpApplication.d.mts +1 -1
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +1 -1
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +1 -1
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +1 -1
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +1 -1
- 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 +1 -1
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +1 -1
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +63 -111
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/database/RequestLog.mjs +1 -1
- package/esm/http/database/RequestLog.mjs.map +1 -1
- package/esm/http/error-codes.d.mts +1 -1
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-codes.mjs +1 -1
- package/esm/http/error-codes.mjs.map +1 -1
- package/esm/http/error-mapper.d.mts +48 -0
- package/esm/http/error-mapper.d.mts.map +1 -0
- package/esm/http/error-mapper.mjs +48 -0
- package/esm/http/error-mapper.mjs.map +1 -0
- package/esm/http/errors/errors.d.mts +1 -1
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +1 -1
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/events.d.mts +1 -1
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/events.mjs +1 -1
- package/esm/http/events.mjs.map +1 -1
- package/esm/http/flush-pending-cookies.mjs +1 -1
- package/esm/http/flush-pending-cookies.mjs.map +1 -1
- package/esm/http/health.d.mts +1 -1
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/health.mjs +1 -1
- package/esm/http/health.mjs.map +1 -1
- package/esm/http/index.d.mts +10 -6
- package/esm/http/index.mjs +8 -5
- package/esm/http/middleware/cache-response-middleware.d.mts +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/cache-response-middleware.mjs +1 -1
- package/esm/http/middleware/cache-response-middleware.mjs.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.mjs +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +1 -1
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +4 -2
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.mjs +1 -1
- package/esm/http/middleware/ip-filter.middleware.mjs.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.mjs +1 -1
- package/esm/http/middleware/max-body-size.middleware.mjs.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -1
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.mjs +1 -1
- package/esm/http/middleware/middleware-list.mjs.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +20 -5
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +34 -12
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/cidr-match.mjs +1 -1
- package/esm/http/middleware/utils/cidr-match.mjs.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.mjs +1 -1
- package/esm/http/middleware/utils/idempotency-key.mjs.map +1 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -1
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +1 -1
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/parse-urlencoded-body.mjs +1 -1
- package/esm/http/parse-urlencoded-body.mjs.map +1 -1
- package/esm/http/plugins.d.mts +9 -2
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +18 -4
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +1 -1
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/port-preflight.mjs +1 -1
- package/esm/http/port-preflight.mjs.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +155 -0
- package/esm/http/rate-limit-cache-store.mjs.map +1 -0
- package/esm/http/ready-report.d.mts +1 -1
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/ready-report.mjs +1 -1
- package/esm/http/ready-report.mjs.map +1 -1
- package/esm/http/request-controller.d.mts +1 -1
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-controller.mjs +1 -1
- package/esm/http/request-controller.mjs.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +123 -0
- package/esm/http/request-log-snapshot.d.mts.map +1 -0
- package/esm/http/request-log-snapshot.mjs +141 -0
- package/esm/http/request-log-snapshot.mjs.map +1 -0
- package/esm/http/request.d.mts +41 -2
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +65 -2
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/resolve-bind-port.mjs +1 -1
- package/esm/http/resolve-bind-port.mjs.map +1 -1
- package/esm/http/response.d.mts +40 -8
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +173 -61
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/serialized.d.mts +1 -1
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +1 -1
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server-rebuilt.mjs +1 -1
- package/esm/http/server-rebuilt.mjs.map +1 -1
- package/esm/http/server.d.mts +34 -6
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +70 -5
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +1 -1
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/stream-react-response.mjs +1 -1
- package/esm/http/stream-react-response.mjs.map +1 -1
- package/esm/http/stream-transport.mjs +75 -0
- package/esm/http/stream-transport.mjs.map +1 -0
- package/esm/http/tracing/trace-id.d.mts +1 -1
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/trace-id.mjs +1 -1
- package/esm/http/tracing/trace-id.mjs.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +1 -1
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +131 -6
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +2 -2
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploaded-file.mjs +2 -2
- package/esm/http/uploaded-file.mjs.map +1 -1
- package/esm/http/uploads/detect-image-format.mjs +1 -1
- package/esm/http/uploads/detect-image-format.mjs.map +1 -1
- package/esm/http/uploads/generate-image-variant.mjs +1 -1
- package/esm/http/uploads/generate-image-variant.mjs.map +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +15 -7
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache.mjs +143 -0
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -0
- package/esm/http/uploads/image-variant-types.d.mts +1 -1
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.mjs +1 -1
- package/esm/http/uploads/image-variants-config-error.mjs.map +1 -1
- package/esm/http/uploads/index.d.mts +3 -1
- package/esm/http/uploads/index.mjs +3 -1
- package/esm/http/uploads/is-path-inside.mjs +1 -1
- package/esm/http/uploads/is-path-inside.mjs.map +1 -1
- package/esm/http/uploads/load-variant-source.mjs +1 -1
- package/esm/http/uploads/load-variant-source.mjs.map +1 -1
- package/esm/http/uploads/local-disk-root.mjs +24 -0
- package/esm/http/uploads/local-disk-root.mjs.map +1 -0
- package/esm/http/uploads/matches-if-none-match.mjs +1 -1
- package/esm/http/uploads/matches-if-none-match.mjs.map +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 +32 -0
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -0
- package/esm/http/uploads/purge-image-variants.mjs +46 -0
- package/esm/http/uploads/purge-image-variants.mjs.map +1 -0
- package/esm/http/uploads/read-file-head.mjs +1 -1
- package/esm/http/uploads/read-file-head.mjs.map +1 -1
- package/esm/http/uploads/resolve-image-variant.d.mts +73 -0
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -0
- package/esm/http/uploads/resolve-image-variant.mjs +107 -0
- package/esm/http/uploads/resolve-image-variant.mjs.map +1 -0
- package/esm/http/uploads/resolve-image-variants-config.mjs +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-inline-image-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-inline-image-content-type.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/resolve-upload-path.mjs +3 -2
- package/esm/http/uploads/resolve-upload-path.mjs.map +1 -1
- package/esm/http/uploads/resolve-variant-candidate.mjs +1 -1
- package/esm/http/uploads/resolve-variant-candidate.mjs.map +1 -1
- package/esm/http/uploads/single-flight.mjs +1 -1
- package/esm/http/uploads/single-flight.mjs.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.d.mts +24 -6
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +63 -91
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +30 -5
- package/esm/http/uploads/variant-cache-key.mjs.map +1 -1
- package/esm/http/uploads/variant-generations.mjs +1 -1
- package/esm/http/uploads/variant-generations.mjs.map +1 -1
- package/esm/http/uploads-config.d.mts +1 -1
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-config.mjs +1 -1
- package/esm/http/uploads-config.mjs.map +1 -1
- package/esm/http/uploads-types.d.mts +1 -1
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -1
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +1 -1
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/index.d.mts +15 -9
- package/esm/index.mjs +11 -7
- package/esm/loader/app-module-importer.d.mts +1 -1
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/loader/app-module-importer.mjs +1 -1
- package/esm/loader/app-module-importer.mjs.map +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +7 -2
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +6 -2
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +1 -1
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +1 -1
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -1
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/fatal-visibility.mjs +1 -1
- package/esm/logger/fatal-visibility.mjs.map +1 -1
- package/esm/logger/logger.d.mts +1 -1
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/logger.mjs +1 -1
- package/esm/logger/logger.mjs.map +1 -1
- package/esm/logger/types.d.mts +1 -1
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +1 -1
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/config.mjs +1 -1
- package/esm/mail/config.mjs.map +1 -1
- package/esm/mail/events.d.mts +1 -1
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/events.mjs +1 -1
- package/esm/mail/events.mjs.map +1 -1
- package/esm/mail/mail.d.mts +1 -1
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mail.mjs +1 -1
- package/esm/mail/mail.mjs.map +1 -1
- package/esm/mail/mailer-pool.d.mts +1 -1
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/mailer-pool.mjs +1 -1
- package/esm/mail/mailer-pool.mjs.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -1
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/react-mail.mjs +1 -1
- package/esm/mail/react-mail.mjs.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -1
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +7 -7
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +1 -1
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/test-mailbox.mjs +1 -1
- package/esm/mail/test-mailbox.mjs.map +1 -1
- package/esm/mail/types.d.mts +1 -1
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/mail/types.mjs +1 -1
- package/esm/mail/types.mjs.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/manifest/manifest-manager.mjs.map +1 -1
- package/esm/openapi/build-openapi-document.d.mts +1 -1
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/build-openapi-document.mjs +1 -1
- package/esm/openapi/build-openapi-document.mjs.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/cast-schema.mjs.map +1 -1
- package/esm/openapi/collect-openapi-document.mjs +1 -1
- package/esm/openapi/collect-openapi-document.mjs.map +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +1 -1
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/development-openapi-provider.mjs +1 -1
- package/esm/openapi/development-openapi-provider.mjs.map +1 -1
- package/esm/openapi/error-responses.mjs +1 -1
- package/esm/openapi/error-responses.mjs.map +1 -1
- package/esm/openapi/openapi-child-output.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/openapi-protocol.mjs +1 -1
- package/esm/openapi/openapi-protocol.mjs.map +1 -1
- package/esm/openapi/paths.mjs +1 -1
- package/esm/openapi/paths.mjs.map +1 -1
- package/esm/openapi/postman/build-request-body.mjs +1 -1
- package/esm/openapi/postman/build-request-body.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +1 -1
- package/esm/openapi/postman/build-request-url.mjs.map +1 -1
- package/esm/openapi/postman/build-saved-responses.mjs +1 -1
- package/esm/openapi/postman/build-saved-responses.mjs.map +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/example-from-schema.mjs +1 -1
- package/esm/openapi/postman/example-from-schema.mjs.map +1 -1
- package/esm/openapi/postman/http-status-text.mjs +1 -1
- package/esm/openapi/postman/http-status-text.mjs.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.mjs +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +1 -1
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/resolve-operation-auth.mjs +1 -1
- package/esm/openapi/postman/resolve-operation-auth.mjs.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -1
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.mjs +1 -1
- package/esm/openapi/postman/schema-refs.mjs.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +1 -1
- package/esm/openapi/postman/uuid-v5.mjs.map +1 -1
- package/esm/openapi/request-schemas.mjs +1 -1
- package/esm/openapi/request-schemas.mjs.map +1 -1
- package/esm/openapi/response-schemas.mjs +5 -2
- package/esm/openapi/response-schemas.mjs.map +1 -1
- package/esm/openapi/schema-registry.mjs +7 -1
- package/esm/openapi/schema-registry.mjs.map +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/security.mjs.map +1 -1
- package/esm/openapi/types.d.mts +1 -1
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-dist-ready-to-start.mjs +1 -1
- package/esm/production/assert-dist-ready-to-start.mjs.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -1
- package/esm/production/assert-generated-imports.mjs.map +1 -1
- package/esm/production/build-app-production.mjs +1 -1
- package/esm/production/build-app-production.mjs.map +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/build-contributions.mjs.map +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs.map +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs.map +1 -1
- package/esm/production/esbuild-plugins.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/esbuild-preflight.mjs.map +1 -1
- package/esm/production/production-builder.mjs +1 -1
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/production-supervisor.mjs.map +1 -1
- package/esm/production/promote-dist.mjs +1 -1
- package/esm/production/promote-dist.mjs.map +1 -1
- package/esm/production/registration-child-runner.mjs +1 -1
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +1 -1
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -1
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.mjs +1 -1
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs +1 -1
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/production/tsconfig-path-aliases.mjs.map +1 -1
- package/esm/react/index.d.mts +1 -1
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.mjs +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.mjs +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +1 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +1 -1
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/repository.manager.d.mts +1 -1
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +1 -1
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +1 -1
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/define-resource.mjs +1 -1
- package/esm/resource/define-resource.mjs.map +1 -1
- package/esm/resource/index.d.mts +1 -0
- package/esm/resource/index.mjs +1 -0
- package/esm/resource/nullable-resource.d.mts +44 -0
- package/esm/resource/nullable-resource.d.mts.map +1 -0
- package/esm/resource/nullable-resource.mjs +38 -0
- package/esm/resource/nullable-resource.mjs.map +1 -0
- package/esm/resource/register-resource.d.mts +1 -1
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.mjs +1 -1
- package/esm/resource/register-resource.mjs.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -1
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.mjs +1 -1
- package/esm/resource/resource-field-builder.mjs.map +1 -1
- package/esm/resource/resource.d.mts +1 -1
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +23 -4
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +11 -6
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/restful.d.mts +1 -1
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/restful/restful.mjs +1 -1
- package/esm/restful/restful.mjs.map +1 -1
- package/esm/router/build-route-rate-limit.mjs +1 -1
- package/esm/router/build-route-rate-limit.mjs.map +1 -1
- package/esm/router/describe-route-for-log.mjs +1 -1
- package/esm/router/describe-route-for-log.mjs.map +1 -1
- package/esm/router/dev-dispatch.mjs +1 -1
- package/esm/router/dev-dispatch.mjs.map +1 -1
- package/esm/router/log-request-lifecycle.mjs +1 -1
- package/esm/router/log-request-lifecycle.mjs.map +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +1 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -1
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-request-path.mjs +1 -1
- package/esm/router/normalize-request-path.mjs.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -1
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.mjs +1 -1
- package/esm/router/normalize-route-path.mjs.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.mjs +1 -1
- package/esm/router/positional-handler-diagnostics.mjs.map +1 -1
- package/esm/router/response-schema-types.mjs +3 -1
- package/esm/router/response-schema-types.mjs.map +1 -1
- package/esm/router/route-builder.d.mts +1 -1
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-builder.mjs +1 -1
- package/esm/router/route-builder.mjs.map +1 -1
- package/esm/router/route-name-method-suffix.d.mts +1 -1
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-method-suffix.mjs +1 -1
- package/esm/router/route-name-method-suffix.mjs.map +1 -1
- package/esm/router/route-registry.d.mts +1 -1
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/route-registry.mjs +1 -1
- package/esm/router/route-registry.mjs.map +1 -1
- package/esm/router/router.d.mts +8 -1
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +20 -15
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +13 -1
- package/esm/router/types.d.mts.map +1 -1
- package/esm/socket/types.d.mts +1 -1
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +1 -1
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/socket/utils.mjs +1 -1
- package/esm/socket/utils.mjs.map +1 -1
- package/esm/storage/config.d.mts +1 -1
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/config.mjs +1 -1
- package/esm/storage/config.mjs.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +1 -1
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.mjs +1 -1
- package/esm/storage/context/storage-driver-context.mjs.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.mjs +1 -1
- package/esm/storage/drivers/do-spaces-driver.mjs.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +12 -1
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +33 -1
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -1
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/r2-driver.mjs +1 -1
- package/esm/storage/drivers/r2-driver.mjs.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -1
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.mjs +1 -1
- package/esm/storage/drivers/s3-driver.mjs.map +1 -1
- package/esm/storage/index.d.mts +1 -1
- package/esm/storage/scoped-storage.d.mts +1 -1
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/scoped-storage.mjs +1 -1
- package/esm/storage/scoped-storage.mjs.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -1
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage-file.mjs +1 -1
- package/esm/storage/storage-file.mjs.map +1 -1
- package/esm/storage/storage.d.mts +3 -3
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/storage.mjs +1 -1
- package/esm/storage/storage.mjs.map +1 -1
- package/esm/storage/types.d.mts +3 -2
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.mjs +1 -1
- package/esm/storage/utils/classify-ip-address.mjs.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -1
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.mjs +1 -1
- package/esm/storage/utils/contain-path.mjs.map +1 -1
- package/esm/storage/utils/mime.d.mts +1 -1
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/mime.mjs +1 -1
- package/esm/storage/utils/mime.mjs.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +1 -1
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +1 -1
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-capability-error.mjs +1 -1
- package/esm/storage/utils/storage-capability-error.mjs.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +1 -1
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.mjs +1 -1
- package/esm/storage/utils/storage-error.mjs.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.mjs +1 -1
- package/esm/storage/utils/storage-not-initialized-error.mjs.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +1 -1
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +1 -1
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +1 -1
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-connectors-selection.mjs.map +1 -1
- package/esm/tests/test-helpers.d.mts +1 -1
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-helpers.mjs +1 -1
- package/esm/tests/test-helpers.mjs.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/test-lifecycle-state.mjs.map +1 -1
- package/esm/tests/test-server-port-channel.mjs +1 -1
- package/esm/tests/test-server-port-channel.mjs.map +1 -1
- package/esm/tests/test-setup-timeout.mjs +1 -1
- package/esm/tests/test-setup-timeout.mjs.map +1 -1
- package/esm/tests/vitest-setup.d.mts +1 -1
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +1 -1
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/updater/package-manager.mjs +1 -1
- package/esm/updater/package-manager.mjs.map +1 -1
- package/esm/updater/update-warlock-packages.mjs +1 -1
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/use-cases/types.d.mts +1 -1
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.mjs +1 -1
- package/esm/use-cases/use-case-broadcast.mjs.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +1 -1
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.mjs +1 -1
- package/esm/use-cases/use-case-events.mjs.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.mjs +1 -1
- package/esm/use-cases/use-case-pipeline.mjs.map +1 -1
- package/esm/use-cases/use-case.d.mts +1 -1
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -1
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.mjs +1 -1
- package/esm/use-cases/use-case.errors.mjs.map +1 -1
- package/esm/use-cases/use-case.mjs +1 -1
- package/esm/use-cases/use-case.mjs.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +1 -1
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.mjs +1 -1
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/app-log.d.mts +6 -6
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/app-log.mjs +1 -1
- package/esm/utils/app-log.mjs.map +1 -1
- package/esm/utils/database-log.d.mts +1 -1
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/database-log.mjs +1 -1
- package/esm/utils/database-log.mjs.map +1 -1
- package/esm/utils/detect-environment-overrides.mjs +1 -1
- package/esm/utils/detect-environment-overrides.mjs.map +1 -1
- package/esm/utils/environment.d.mts +1 -1
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/environment.mjs +1 -1
- package/esm/utils/environment.mjs.map +1 -1
- package/esm/utils/framework-vesion.mjs +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +1 -1
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/get-localized.mjs +1 -1
- package/esm/utils/get-localized.mjs.map +1 -1
- package/esm/utils/is-test-file.mjs +1 -1
- package/esm/utils/is-test-file.mjs.map +1 -1
- package/esm/utils/load-environment.mjs +1 -1
- package/esm/utils/load-environment.mjs.map +1 -1
- package/esm/utils/normalized-path.d.mts +1 -1
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/normalized-path.mjs +1 -1
- package/esm/utils/normalized-path.mjs.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -1
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/npm-registry.mjs +1 -1
- package/esm/utils/npm-registry.mjs.map +1 -1
- package/esm/utils/paths.d.mts +1 -1
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +1 -1
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -1
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/promise-all-object.mjs +1 -1
- package/esm/utils/promise-all-object.mjs.map +1 -1
- package/esm/utils/queue.d.mts +1 -1
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/queue.mjs +1 -1
- package/esm/utils/queue.mjs.map +1 -1
- package/esm/utils/recorded-environment-overrides.mjs +1 -1
- package/esm/utils/recorded-environment-overrides.mjs.map +1 -1
- package/esm/utils/report-environment-overrides.mjs +1 -1
- package/esm/utils/report-environment-overrides.mjs.map +1 -1
- package/esm/utils/sleep.d.mts +1 -1
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sleep.mjs +1 -1
- package/esm/utils/sleep.mjs.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -1
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/sluggable.mjs +1 -1
- package/esm/utils/sluggable.mjs.map +1 -1
- package/esm/utils/to-json.d.mts +1 -1
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/to-json.mjs +1 -1
- package/esm/utils/to-json.mjs.map +1 -1
- package/esm/utils/types.d.mts +1 -1
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +1 -1
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/urls.mjs +1 -1
- package/esm/utils/urls.mjs.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -1
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/utils/version-compare.mjs +1 -1
- package/esm/utils/version-compare.mjs.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.mjs +1 -1
- package/esm/validation/database/exists-except-current-id.mjs.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.mjs +1 -1
- package/esm/validation/database/exists-except-current-user.mjs.map +1 -1
- package/esm/validation/database/types.d.mts +1 -1
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.mjs +1 -1
- package/esm/validation/database/unique-except-current-id.mjs.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.mjs +1 -1
- package/esm/validation/database/unique-except-current-user.mjs.map +1 -1
- package/esm/validation/file/file.d.mts +1 -1
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/file.mjs +1 -1
- package/esm/validation/file/file.mjs.map +1 -1
- package/esm/validation/init.mjs +1 -1
- package/esm/validation/init.mjs.map +1 -1
- package/esm/validation/plugins/database-plugin.mjs +1 -1
- package/esm/validation/plugins/database-plugin.mjs.map +1 -1
- package/esm/validation/plugins/file-plugin.mjs +1 -1
- package/esm/validation/plugins/file-plugin.mjs.map +1 -1
- package/esm/validation/plugins/localized-plugin.mjs +1 -1
- package/esm/validation/plugins/localized-plugin.mjs.map +1 -1
- package/esm/validation/types.d.mts +1 -1
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +1 -1
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +44 -41
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/file-validator.mjs +4 -1
- package/esm/validation/validators/file-validator.mjs.map +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/vite/lower-stage3-decorators.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.mjs.map +1 -1
- package/esm/warlock-config/bundle-config.mjs +148 -0
- package/esm/warlock-config/bundle-config.mjs.map +1 -0
- package/esm/warlock-config/default-configurations.mjs +1 -1
- package/esm/warlock-config/default-configurations.mjs.map +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -1
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +1 -1
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +1 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/normalize-build-config.mjs +1 -1
- package/esm/warlock-config/normalize-build-config.mjs.map +1 -1
- package/esm/warlock-config/types.d.mts +1 -1
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +32 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +94 -18
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs.map +1 -1
- package/llms-full.txt +306 -249
- package/llms.txt +42 -42
- package/package.json +20 -13
- package/skills/README.md +39 -39
- package/skills/add-connector/SKILL.md +4 -4
- package/skills/benchmark-code/SKILL.md +3 -3
- package/skills/build-restful/SKILL.md +5 -5
- package/skills/build-url/SKILL.md +7 -7
- package/skills/configure-app/SKILL.md +30 -8
- package/skills/create-controller/SKILL.md +12 -8
- package/skills/create-module/SKILL.md +9 -9
- package/skills/define-resource/SKILL.md +4 -4
- package/skills/encrypt-data/SKILL.md +7 -7
- package/skills/generate-openapi/SKILL.md +5 -5
- package/skills/hash-password/SKILL.md +8 -8
- package/skills/health-checks/SKILL.md +8 -6
- package/skills/lower-stage3-decorators/SKILL.md +4 -4
- package/skills/process-image/SKILL.md +5 -5
- package/skills/register-route/SKILL.md +16 -6
- package/skills/request-memo/SKILL.md +4 -4
- package/skills/request-tracing/SKILL.md +6 -6
- package/skills/resolve-path/SKILL.md +6 -6
- package/skills/retry-operation/SKILL.md +4 -4
- package/skills/run-app/SKILL.md +20 -13
- package/skills/send-mail/SKILL.md +3 -3
- package/skills/send-response/SKILL.md +16 -8
- package/skills/store-file/SKILL.md +9 -5
- package/skills/test-http/SKILL.md +5 -5
- package/skills/test-service/SKILL.md +5 -5
- package/skills/update-packages/SKILL.md +6 -6
- package/skills/upload-file/SKILL.md +7 -7
- package/skills/use-app-context/SKILL.md +7 -7
- package/skills/use-localization/SKILL.md +6 -6
- package/skills/use-middleware/SKILL.md +8 -8
- package/skills/use-model-transformers/SKILL.md +6 -6
- package/skills/use-repository/SKILL.md +7 -7
- package/skills/use-request-locals/SKILL.md +4 -4
- package/skills/validate-input/SKILL.md +7 -7
- package/skills/warlock-conventions/SKILL.md +6 -6
- package/skills/warlock-doctor/SKILL.md +5 -5
- package/skills/warlock-routes/SKILL.md +6 -6
- package/skills/wire-socket/SKILL.md +4 -4
- package/skills/write-cli-command/SKILL.md +6 -6
- package/skills/write-middleware/SKILL.md +8 -8
- package/skills/write-seeder/SKILL.md +5 -5
- package/skills/write-use-case/SKILL.md +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-route-for-log.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"describe-route-for-log.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/describe-route-for-log.ts"],"sourcesContent":["/**\n * The `[GET /products]` label that identifies a route in the request log.\n *\n * A trailing `/*` is stripped because a prefixed route is more readable as the\n * prefix it serves — `/products/*` is `/products` to anyone reading a log.\n *\n * Two things the previous one-liner (`path.replace(\"/*\", \"\")`) got wrong:\n *\n * 1. The BARE catch-all `/*` became the empty string, so every unmatched\n * request logged as `[GET ]`. The reader is looking for which route\n * matched; a blank is the one answer that helps nobody.\n * 2. `replace` removes the FIRST occurrence wherever it sits, so a `/*` in the\n * middle of a path would have been silently deleted from the label. Nothing\n * declares such a route today — which is exactly why it would go unnoticed\n * if something did.\n */\nexport function describeRouteForLog(method: string, path: string): string {\n return `${method} ${stripTrailingWildcard(path)}`;\n}\n\nfunction stripTrailingWildcard(path: string): string {\n if (!path.endsWith(\"/*\")) return path;\n\n const withoutWildcard = path.slice(0, -\"/*\".length);\n\n // `/*` alone leaves nothing behind. Show the route's own declared path\n // instead of a blank.\n return withoutWildcard.length > 0 ? withoutWildcard : path;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,oBAAoB,QAAgB,MAAsB;CACxE,OAAO,GAAG,OAAO,GAAG,sBAAsB,IAAI;AAChD;AAEA,SAAS,sBAAsB,MAAsB;CACnD,IAAI,CAAC,KAAK,SAAS,IAAI,GAAG,OAAO;CAEjC,MAAM,kBAAkB,KAAK,MAAM,GAAG,EAAY;CAIlD,OAAO,gBAAgB,SAAS,IAAI,kBAAkB;AACxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildRouteRateLimit } from "./build-route-rate-limit.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../packages/core/src/router/dev-dispatch.ts
|
|
4
4
|
/**
|
|
5
5
|
* Every verb the dev wildcard answers. Mirrors what production registers per
|
|
6
6
|
* route: `head`/`options` routes are ordinary registrations there, so the dev
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-dispatch.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"dev-dispatch.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/dev-dispatch.ts"],"sourcesContent":["import type { FastifyInstance, FastifyReply, FastifyRequest } from \"fastify\";\nimport { buildRouteRateLimit } from \"./build-route-rate-limit\";\nimport type { Route } from \"./types\";\n\n/**\n * Every verb the dev wildcard answers. Mirrors what production registers per\n * route: `head`/`options` routes are ordinary registrations there, so the dev\n * dispatcher must be reachable for them too.\n */\nexport const DEV_DISPATCH_METHODS = [\n \"GET\",\n \"HEAD\",\n \"POST\",\n \"PUT\",\n \"DELETE\",\n \"PATCH\",\n \"OPTIONS\",\n] as const;\n\n/**\n * The body of an unmatched request — Fastify's own default 404 shape, so an\n * unknown URL looks the same in dev as it does in production.\n */\nexport function buildNotFoundBody(method: string, url: string) {\n return {\n message: `Route ${method}:${url} not found`,\n error: \"Not Found\",\n statusCode: 404,\n };\n}\n\ntype RateLimitHandler = (request: FastifyRequest, reply: FastifyReply) => Promise<unknown>;\n\n/**\n * Per-route rate limiting for the dev wildcard dispatcher.\n *\n * `@fastify/rate-limit` reads `config.rateLimit` in its `onRoute` hook, which\n * never sees individual routes behind a wildcard. It exposes the same limiter\n * as `server.rateLimit(options)`, built here from the identical\n * `buildRouteRateLimit` options `scan()` passes in production. Limiters are\n * cached per rate-limit config + method so counters survive across requests.\n */\nexport function createDevRateLimiter(server: FastifyInstance) {\n const limiters = new WeakMap<object, Map<string, RateLimitHandler>>();\n\n return async (route: Route, request: FastifyRequest, reply: FastifyReply) => {\n const options = route.rateLimit;\n\n const factory = (server as any).rateLimit;\n\n if (!options || typeof factory !== \"function\") {\n return undefined;\n }\n\n let byMethod = limiters.get(options);\n\n if (!byMethod) {\n byMethod = new Map();\n limiters.set(options, byMethod);\n }\n\n // `all` routes are expanded per verb in production, each with its own counter.\n let limiter = byMethod.get(request.method);\n\n if (!limiter) {\n limiter = factory.call(server, buildRouteRateLimit(options)) as RateLimitHandler;\n byMethod.set(request.method, limiter);\n }\n\n return limiter(request, reply);\n };\n}\n"],"mappings":";;;;;;;;AASA,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;AAMA,SAAgB,kBAAkB,QAAgB,KAAa;CAC7D,OAAO;EACL,SAAS,SAAS,OAAO,GAAG,IAAI;EAChC,OAAO;EACP,YAAY;CACd;AACF;;;;;;;;;;AAaA,SAAgB,qBAAqB,QAAyB;CAC5D,MAAM,2BAAW,IAAI,QAA+C;CAEpE,OAAO,OAAO,OAAc,SAAyB,UAAwB;EAC3E,MAAM,UAAU,MAAM;EAEtB,MAAM,UAAW,OAAe;EAEhC,IAAI,CAAC,WAAW,OAAO,YAAY,YACjC;EAGF,IAAI,WAAW,SAAS,IAAI,OAAO;EAEnC,IAAI,CAAC,UAAU;GACb,2BAAW,IAAI,IAAI;GACnB,SAAS,IAAI,SAAS,QAAQ;EAChC;EAGA,IAAI,UAAU,SAAS,IAAI,QAAQ,MAAM;EAEzC,IAAI,CAAC,SAAS;GACZ,UAAU,QAAQ,KAAK,QAAQ,oBAAoB,OAAO,CAAC;GAC3D,SAAS,IAAI,QAAQ,QAAQ,OAAO;EACtC;EAEA,OAAO,QAAQ,SAAS,KAAK;CAC/B;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildTracingContext, dispatchRequestEnd, dispatchRequestStart, isTracingEnabled } from "../http/tracing/tracing-dispatcher.mjs";
|
|
2
2
|
import "../http/tracing/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../packages/core/src/router/log-request-lifecycle.ts
|
|
5
5
|
function levelForStatus(statusCode) {
|
|
6
6
|
if (statusCode === void 0) return "info";
|
|
7
7
|
if (statusCode >= 500) return "error";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-request-lifecycle.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"log-request-lifecycle.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/log-request-lifecycle.ts"],"sourcesContent":["/**\n * Both ends of a request's log entry.\n *\n * ## Why the completion line exists\n *\n * The router logged `Starting Request: <id>` and nothing else. A request that\n * hung for thirty seconds and one that returned in two milliseconds produced\n * **byte-identical output**, so the log could not answer the one question\n * anyone opens it to ask.\n *\n * Note what \"detecting a hang\" actually means. Nothing can log the completion\n * of a request that never completes — the mechanism is the **absence** of a\n * completion line beside a start line that has one. That only works if the\n * completion line is emitted on every settled path, **including a throw**,\n * which is why the error path here is not an afterthought.\n *\n * ## Why the level tracks the status\n *\n * A handled 500 does not throw; it returns a response. Logging it at `info`\n * would bury the exact entries someone scanning the log is hunting for, so the\n * level is derived from the outcome: informational below 400, a warning for\n * client errors, an error for server errors and for anything that threw.\n *\n * ## Ports rather than a direct `log` import\n *\n * The behaviour worth pinning down is *which lines come out, in which order,\n * at which level, when the run throws*. Injecting the sink and the clock makes\n * that assertable without a server, a socket or a fake timer.\n *\n * ## Tracing\n *\n * This function is the single funnel for both the success and throw paths\n * (the try/catch below), and it already reads the settled status via\n * `descriptor.statusCode()` after the run settles — the natural place to\n * fire `onRequestStart` / `onRequestEnd`, since that is when the response is\n * actually written and a trace can record what really happened. Gated on\n * `isTracingEnabled()` before building any context object, so a disabled app\n * pays one boolean check and allocates nothing extra.\n */\nimport type { Request } from \"../http/request\";\nimport { buildTracingContext, dispatchRequestEnd, dispatchRequestStart, isTracingEnabled } from \"../http/tracing\";\n\nexport type RequestLogEntry = {\n module: string;\n action: string;\n message: string;\n /**\n * Typed as the logger accepts it, not as `unknown`. These entries exist to be\n * handed to `log.info` / `warn` / `error`, whose parameter is\n * `Record<string, any>` — `unknown` was not assignable, so the adapter in\n * router.ts could not compile even though every real caller passes an object.\n */\n context?: Record<string, any>;\n};\n\nexport type RequestLogPorts = {\n info(entry: RequestLogEntry): void;\n warn(entry: RequestLogEntry): void;\n error(entry: RequestLogEntry): void;\n /** Monotonic milliseconds. Called exactly twice per request. */\n now(): number;\n};\n\nexport type RequestLogDescriptor = {\n module: string;\n action: string;\n requestId: string;\n /**\n * Typed as the logger accepts it, not as `unknown`. These entries exist to be\n * handed to `log.info` / `warn` / `error`, whose parameter is\n * `Record<string, any>` — `unknown` was not assignable, so the adapter in\n * router.ts could not compile even though every real caller passes an object.\n */\n context?: Record<string, any>;\n /**\n * Read AFTER the run settles — the status is decided during the request, so\n * capturing it up front would report the default on every entry.\n */\n statusCode(): number | undefined;\n /**\n * The `Request` instance, when tracing needs it to build\n * the `TracingContext` for `onRequestStart` / `onRequestEnd`. Optional —\n * absent, tracing dispatch for this request is skipped, which is correct\n * for any non-HTTP caller of this same lifecycle wrapper.\n */\n request?: Request;\n};\n\ntype Level = \"info\" | \"warn\" | \"error\";\n\nfunction levelForStatus(statusCode: number | undefined): Level {\n // An unknown status is not evidence of a problem; saying \"error\" because we\n // failed to read a number would be inventing a defect.\n if (statusCode === undefined) return \"info\";\n\n if (statusCode >= 500) return \"error\";\n\n if (statusCode >= 400) return \"warn\";\n\n return \"info\";\n}\n\nexport async function logRequestLifecycle<TResult>(\n ports: RequestLogPorts,\n descriptor: RequestLogDescriptor,\n run: () => Promise<TResult>,\n): Promise<TResult> {\n const startedAt = ports.now();\n const tracingEnabled = isTracingEnabled();\n\n ports.info({\n module: descriptor.module,\n action: descriptor.action,\n message: `Starting Request: ${descriptor.requestId}`,\n context: descriptor.context,\n });\n\n if (tracingEnabled && descriptor.request) {\n dispatchRequestStart(buildTracingContext(descriptor.request));\n }\n\n const finish = (level: Level, outcome: string, error?: unknown): void => {\n const duration = Math.round(ports.now() - startedAt);\n\n ports[level]({\n module: descriptor.module,\n action: descriptor.action,\n message: `Completed Request: ${descriptor.requestId} — ${outcome} in ${duration}ms`,\n context: descriptor.context,\n });\n\n if (tracingEnabled && descriptor.request) {\n dispatchRequestEnd(buildTracingContext(descriptor.request), {\n status: descriptor.statusCode(),\n durationMs: duration,\n error,\n });\n }\n };\n\n try {\n const result = await run();\n\n const statusCode = descriptor.statusCode();\n\n finish(levelForStatus(statusCode), statusCode === undefined ? \"no status\" : String(statusCode));\n\n return result;\n } catch (error) {\n // The throw is reported and then re-thrown untouched: this function\n // observes the request, it does not own its error handling.\n finish(\"error\", `threw ${error instanceof Error ? error.name : typeof error}`, error);\n\n throw error;\n }\n}\n"],"mappings":";;;;AA0FA,SAAS,eAAe,YAAuC;CAG7D,IAAI,eAAe,QAAW,OAAO;CAErC,IAAI,cAAc,KAAK,OAAO;CAE9B,IAAI,cAAc,KAAK,OAAO;CAE9B,OAAO;AACT;AAEA,eAAsB,oBACpB,OACA,YACA,KACkB;CAClB,MAAM,YAAY,MAAM,IAAI;CAC5B,MAAM,iBAAiB,iBAAiB;CAExC,MAAM,KAAK;EACT,QAAQ,WAAW;EACnB,QAAQ,WAAW;EACnB,SAAS,qBAAqB,WAAW;EACzC,SAAS,WAAW;CACtB,CAAC;CAED,IAAI,kBAAkB,WAAW,SAC/B,qBAAqB,oBAAoB,WAAW,OAAO,CAAC;CAG9D,MAAM,UAAU,OAAc,SAAiB,UAA0B;EACvE,MAAM,WAAW,KAAK,MAAM,MAAM,IAAI,IAAI,SAAS;EAEnD,MAAM,MAAM,CAAC;GACX,QAAQ,WAAW;GACnB,QAAQ,WAAW;GACnB,SAAS,sBAAsB,WAAW,UAAU,KAAK,QAAQ,MAAM,SAAS;GAChF,SAAS,WAAW;EACtB,CAAC;EAED,IAAI,kBAAkB,WAAW,SAC/B,mBAAmB,oBAAoB,WAAW,OAAO,GAAG;GAC1D,QAAQ,WAAW,WAAW;GAC9B,YAAY;GACZ;EACF,CAAC;CAEL;CAEA,IAAI;EACF,MAAM,SAAS,MAAM,IAAI;EAEzB,MAAM,aAAa,WAAW,WAAW;EAEzC,OAAO,eAAe,UAAU,GAAG,eAAe,SAAY,cAAc,OAAO,UAAU,CAAC;EAE9F,OAAO;CACT,SAAS,OAAO;EAGd,OAAO,SAAS,SAAS,iBAAiB,QAAQ,MAAM,OAAO,OAAO,SAAS,KAAK;EAEpF,MAAM;CACR;AACF"}
|
|
@@ -3,7 +3,7 @@ import { importAppModule } from "../loader/app-module-importer.mjs";
|
|
|
3
3
|
import { buildResourceMap, createResourceTypeResolver, describeResponseSchemaTypes } from "./response-schema-types.mjs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../../packages/core/src/router/named-api-routes-with-responses.ts
|
|
7
7
|
const RESOURCE_FILE_PATTERN = /(^|\/)src\/.*\.resource\.tsx?$/;
|
|
8
8
|
function isResourceFile(file) {
|
|
9
9
|
return RESOURCE_FILE_PATTERN.test(file.relativePath.replace(/\\/g, "/"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named-api-routes-with-responses.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"named-api-routes-with-responses.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/named-api-routes-with-responses.ts"],"sourcesContent":["import { pathToFileURL } from \"node:url\";\nimport { importAppModule } from \"../loader/app-module-importer\";\nimport {\n buildResourceMap,\n createResourceTypeResolver,\n describeResponseSchemaTypes,\n type ResourceModuleExport,\n type ResourceModuleNamespace,\n type ResourceTypeResolver,\n} from \"./response-schema-types\";\nimport { router } from \"./router\";\nimport type { NamedApiRoute } from \"./types\";\n\nconst RESOURCE_FILE_PATTERN = /(^|\\/)src\\/.*\\.resource\\.tsx?$/;\n\nexport type ResourceSourceFile = Readonly<{\n absolutePath: string;\n relativePath: string;\n}>;\n\nexport type NamedApiRoutesWithResponsesOptions = Readonly<{\n /**\n * Application root, the folder that contains `.warlock/typings/`.\n */\n appRoot: string;\n /**\n * Every file the orchestrator knows about. `*.resource.ts(x)` files under `src/` are\n * imported to map resource classes back to their exports.\n */\n files: Iterable<ResourceSourceFile>;\n /**\n * Receives a human readable warning (unmapped resource, unreadable resource module).\n */\n onWarn?: (message: string) => void;\n}>;\n\nfunction isResourceFile(file: ResourceSourceFile): boolean {\n return RESOURCE_FILE_PATTERN.test(file.relativePath.replace(/\\\\/g, \"/\"));\n}\n\nasync function importResourceNamespaces(\n files: readonly ResourceSourceFile[],\n onWarn: ((message: string) => void) | undefined,\n): Promise<ResourceModuleNamespace[]> {\n const namespaces: ResourceModuleNamespace[] = [];\n\n for (const file of files) {\n try {\n const namespace = (await importAppModule(pathToFileURL(file.absolutePath).href)) as Record<\n string,\n unknown\n >;\n\n namespaces.push({ file: file.absolutePath, namespace });\n } catch (error) {\n onWarn?.(\n `Could not import ${file.relativePath} to type API responses: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n }\n }\n\n return namespaces;\n}\n\n/**\n * Identity map from every resource class exported by a `*.resource.ts(x)` file under\n * `src/` to the module export it came from.\n *\n * The modules are imported through the same importer the routes used, so a resource class\n * found in a `responseSchema` is the very instance exported by its module. A module that\n * cannot be imported is reported once through `onWarn` and left out of the map.\n */\nexport async function collectResourceExportMap(\n files: Iterable<ResourceSourceFile>,\n onWarn?: (message: string) => void,\n): Promise<Map<unknown, ResourceModuleExport>> {\n const namespaces = await importResourceNamespaces([...files].filter(isResourceFile), onWarn);\n\n return buildResourceMap(namespaces);\n}\n\n/**\n * Named API route snapshots, with a `response` type map on every route whose handler\n * declares `responseSchema`.\n *\n * Resource modules are imported only when at least one route declares a schema, through\n * the same importer the routes used, so a resource class seen in a schema is the very\n * instance exported by its module. Never throws: if anything fails the routes come back\n * without `response` (and the failure is reported once through `onWarn`).\n */\nexport async function collectNamedApiRoutesWithResponses(\n options: NamedApiRoutesWithResponsesOptions,\n): Promise<readonly NamedApiRoute[]> {\n try {\n const declaresSchema = router.list().some((route) => route.handler?.responseSchema);\n\n if (!declaresSchema) return router.getNamedApiRoutes();\n\n const resolveResource: ResourceTypeResolver = createResourceTypeResolver(\n await collectResourceExportMap(options.files, options.onWarn),\n options.appRoot,\n );\n\n return router.getNamedApiRoutes({\n resolveResponse: (schema, route) =>\n describeResponseSchemaTypes(schema, resolveResource, (fieldPath) => {\n options.onWarn?.(\n `Route \"${route.name}\" (${route.method} ${route.path}): response ${fieldPath} is a resource that is not exported from a *.resource.ts file, typed as unknown.`,\n );\n }),\n });\n } catch (error) {\n options.onWarn?.(\n `Could not type API responses: ${error instanceof Error ? error.message : String(error)}`,\n );\n\n return router.getNamedApiRoutes();\n }\n}\n"],"mappings":";;;;;;AAaA,MAAM,wBAAwB;AAuB9B,SAAS,eAAe,MAAmC;CACzD,OAAO,sBAAsB,KAAK,KAAK,aAAa,QAAQ,OAAO,GAAG,CAAC;AACzE;AAEA,eAAe,yBACb,OACA,QACoC;CACpC,MAAM,aAAwC,CAAC;CAE/C,KAAK,MAAM,QAAQ,OACjB,IAAI;EACF,MAAM,YAAa,MAAM,gBAAgB,cAAc,KAAK,YAAY,CAAC,CAAC,IAAI;EAK9E,WAAW,KAAK;GAAE,MAAM,KAAK;GAAc;EAAU,CAAC;CACxD,SAAS,OAAO;EACd,SACE,oBAAoB,KAAK,aAAa,0BACpC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAEzD;CACF;CAGF,OAAO;AACT;;;;;;;;;AAUA,eAAsB,yBACpB,OACA,QAC6C;CAG7C,OAAO,iBAAiB,MAFC,yBAAyB,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,cAAc,GAAG,MAAM,CAEzD;AACpC;;;;;;;;;;AAWA,eAAsB,mCACpB,SACmC;CACnC,IAAI;EAGF,IAAI,CAFmB,OAAO,KAAK,CAAC,CAAC,MAAM,UAAU,MAAM,SAAS,cAElD,GAAG,OAAO,OAAO,kBAAkB;EAErD,MAAM,kBAAwC,2BAC5C,MAAM,yBAAyB,QAAQ,OAAO,QAAQ,MAAM,GAC5D,QAAQ,OACV;EAEA,OAAO,OAAO,kBAAkB,EAC9B,kBAAkB,QAAQ,UACxB,4BAA4B,QAAQ,kBAAkB,cAAc;GAClE,QAAQ,SACN,UAAU,MAAM,KAAK,KAAK,MAAM,OAAO,GAAG,MAAM,KAAK,cAAc,UAAU,iFAC/E;EACF,CAAC,EACL,CAAC;CACH,SAAS,OAAO;EACd,QAAQ,SACN,iCAAiC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GACxF;EAEA,OAAO,OAAO,kBAAkB;CAClC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-request-path.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"normalize-request-path.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/normalize-request-path.ts"],"mappings":";;AASA;;;;AAAqD;;;;iBAArC,oBAAA,CAAqB,QAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-request-path.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"normalize-request-path.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/normalize-request-path.ts"],"sourcesContent":["/**\n * Canonicalize an incoming request pathname before either router matches it.\n *\n * This is deliberately narrower than `normalizeRoutePath`, which joins route\n * declarations and also resolves doubled slashes plus `.` / `..` segments.\n * A request must keep those bytes unchanged; v5.2 only makes one terminal\n * slash optional. The root path is already canonical and must never become an\n * empty string.\n */\nexport function normalizeRequestPath(pathname: string): string {\n if (pathname === \"\" || pathname === \"/\") return \"/\";\n return pathname.endsWith(\"/\") ? pathname.slice(0, -1) : pathname;\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,qBAAqB,UAA0B;CAC7D,IAAI,aAAa,MAAM,aAAa,KAAK,OAAO;CAChD,OAAO,SAAS,SAAS,GAAG,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AAC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-route-path.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"normalize-route-path.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/normalize-route-path.ts"],"mappings":";;AAyBA;;;;AAA8C;;;;;;;;;;;;;;;;;;iBAA9B,kBAAA,IAAsB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-route-path.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"normalize-route-path.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/normalize-route-path.ts"],"sourcesContent":["import concatRoute from \"@mongez/concat-route\";\n\n/**\n * Normalize route path segments into the canonical path the router serves.\n *\n * This is the ONE definition of a route path's canonical form. `Router.add`\n * calls it to join a group prefix onto a route path, and that call is the only\n * reason a bare `\"*\"` (the not-found catch-all) is registered — and therefore\n * matched, listed and diffed — as `\"/*\"`.\n *\n * Anything that PREDICTS or RECORDS a route path outside registration has to\n * call this same function. The build-time page-route manifest is the case that\n * forced it into existence: it is derived from a filesystem scan that never\n * registers a route, so before it normalized here it persisted `\"*\"` while the\n * running router held `\"/*\"`, and `warlock routes:diff` reported a route as\n * changed immediately after a successful build.\n *\n * Keeping one implementation is what lets the diff stay a STRICT string\n * comparison instead of teaching every consumer which spellings are secretly\n * equivalent.\n *\n * @example normalizeRoutePath(\"*\") // \"/*\"\n * @example normalizeRoutePath(\"/users/\", \"/:id\") // \"/users/:id\"\n * @example normalizeRoutePath(\"\") // \"/\"\n */\nexport function normalizeRoutePath(...segments: string[]): string {\n return concatRoute(...segments);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,mBAAmB,GAAG,UAA4B;CAChE,OAAO,YAAY,GAAG,QAAQ;AAChC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Route } from "./types.mjs";
|
|
2
2
|
import { log } from "@warlock.js/logger";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../packages/core/src/router/positional-handler-diagnostics.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* One route whose handler looks like it was written for v4.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positional-handler-diagnostics.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"positional-handler-diagnostics.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/positional-handler-diagnostics.ts"],"mappings":";;;;AA+PsE;AAmBtE;;AAnBsE,KA3N1D,wBAAA;EA8OsE,kDA5OhF,MAAA,EAAQ,KAAK,YAqPC;EAlPd,IAAA;EAGA,WAAA,UA+OgE;EA5OhE,UAAA;AAAA;;;AA0P4C;AAS9C;;;;AAAkF;AAclF;;;;;;;;;;;;;AAAsF;;;;;;;;;;;iBApGtE,0BAAA,CAA2B,OAAgB;;;;;;;;;iBAiC3C,uBAAA,CACd,OAAA,WACA,KAAA;EAAS,MAAA,EAAQ,KAAK;EAAY,IAAA;EAAc,UAAA;AAAA;;;;iBAmBlC,6BAAA,aAA0C,wBAAwB;;;;;;iBASlE,+BAAA,CAAgC,UAAkB;;;;;iBAclD,8BAAA;;;;;;iBASA,gCAAA,CAAiC,OAAiC,EAAxB,wBAAwB;;;;;;;iBAclE,+BAAA,CAAgC,MAAA,GAAQ,IAAA,QAAY,GAAA,YAAkB,wBAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { log } from "@warlock.js/logger";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../packages/core/src/router/positional-handler-diagnostics.ts
|
|
4
4
|
/**
|
|
5
5
|
* Early detection of route handlers still written against the **v4 positional
|
|
6
6
|
* signature** — `(request, response)` — after v5 moved to a single context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positional-handler-diagnostics.mjs","names":[],"sources":["../../../../../../../core/src/router/positional-handler-diagnostics.ts"],"sourcesContent":["/**\n * Early detection of route handlers still written against the **v4 positional\n * signature** — `(request, response)` — after v5 moved to a single context\n * object, `({ request, response })`.\n *\n * ## Why this exists\n *\n * A v4 handler is not rejected anywhere. It registers fine, and the router\n * calls it with one argument, so `response` is simply `undefined`. The app only\n * breaks on the first request that reaches it, with:\n *\n * TypeError: Cannot read properties of undefined (reading 'success')\n *\n * That message names nothing the reader can act on — not the route, not the\n * handler, not the change to make. This module turns that late, opaque failure\n * into one explicit list printed at boot, and into a `warlock doctor` check.\n *\n * The break itself is intentional; nothing here restores the positional form.\n * Detection and diagnostics only.\n *\n * ## Why it warns and never throws\n *\n * The signal is a heuristic (see {@link looksLikePositionalHandler}), so a\n * false positive is possible in principle. Turning one into a boot failure\n * would take a working application down over a guess, which is strictly worse\n * than the problem being diagnosed. Everything on this path is therefore a\n * warning: nothing here throws, and nothing here changes how a handler is\n * called. A miss simply degrades to the old runtime `TypeError`.\n */\n\nimport { log } from \"@warlock.js/logger\";\nimport type { Route } from \"./types\";\n\n/**\n * One route whose handler looks like it was written for v4.\n */\nexport type PositionalHandlerSuspect = {\n /** HTTP method the route was registered under. */\n method: Route[\"method\"];\n\n /** Full route path, prefixes already applied. */\n path: string;\n\n /** Handler function name, or `\"(anonymous)\"` when it has none. */\n handlerName: string;\n\n /** Route file the route came from, when the router knows it. */\n sourceFile: string;\n};\n\n/**\n * Collected across the whole registration pass so the warning can be emitted\n * ONCE, as a single list, rather than one line per route (or — as before — one\n * mystery 500 per request).\n */\nconst suspects: PositionalHandlerSuspect[] = [];\n\n/**\n * Split the parameter list of a function's source into top-level parameters.\n *\n * Depth-aware and quote-aware, because a default value may itself contain\n * commas, parentheses, braces or strings — `(request, response = f(a, b))` is\n * two parameters, not three. Anything unbalanced returns `undefined`: refusing\n * to guess is what keeps a parse quirk from becoming a false warning.\n *\n * @param openIndex index of the `(` that opens the parameter list.\n */\nfunction splitTopLevelParameters(source: string, openIndex: number): string[] | undefined {\n const parameters: string[] = [];\n\n let depth = 0;\n let current = \"\";\n let quote = \"\";\n\n for (let index = openIndex; index < source.length; index++) {\n const char = source[index];\n\n if (quote) {\n if (char === \"\\\\\") {\n current += char + (source[index + 1] ?? \"\");\n index++;\n continue;\n }\n\n if (char === quote) {\n quote = \"\";\n }\n\n current += char;\n continue;\n }\n\n if (char === '\"' || char === \"'\" || char === \"`\") {\n quote = char;\n current += char;\n continue;\n }\n\n if (char === \"(\" || char === \"[\" || char === \"{\") {\n depth++;\n\n // The paren that opens the list is punctuation, not part of a parameter.\n if (depth === 1) continue;\n\n current += char;\n continue;\n }\n\n if (char === \")\" || char === \"]\" || char === \"}\") {\n depth--;\n\n if (depth === 0) {\n if (current.trim()) {\n parameters.push(current.trim());\n }\n\n return parameters;\n }\n\n current += char;\n continue;\n }\n\n if (char === \",\" && depth === 1) {\n parameters.push(current.trim());\n current = \"\";\n continue;\n }\n\n current += char;\n }\n\n // Never found the closing paren — treat the source as unreadable.\n return undefined;\n}\n\n/**\n * Read a function's declared parameters from its own source.\n *\n * Returns `undefined` whenever the source cannot be trusted, which callers must\n * treat as \"no information\" rather than \"no parameters\":\n *\n * - `Function.prototype.bind` replaces the body with `[native code]`, so every\n * `[Controller, \"method\"]` tuple handler lands here (the router binds them);\n * - native functions likewise;\n * - a class, whose first `(` belongs to a constructor or a method, not to a\n * parameter list;\n * - anything that fails to parse.\n */\nfunction readParameterList(handler: Function): string[] | undefined {\n let source: string;\n\n try {\n source = Function.prototype.toString.call(handler);\n } catch {\n return undefined;\n }\n\n if (source.includes(\"[native code]\")) return undefined;\n\n if (/^\\s*class[\\s{]/.test(source)) return undefined;\n\n // A single parameter needs no parentheses: `ctx => …`, `async ctx => …`.\n const bareArrow = source.match(/^\\s*(?:async\\s+)?([A-Za-z_$][\\w$]*)\\s*=>/);\n\n if (bareArrow) {\n const parameter = bareArrow[1];\n\n return parameter === undefined ? undefined : [parameter];\n }\n\n const openIndex = source.indexOf(\"(\");\n\n if (openIndex === -1) return undefined;\n\n return splitTopLevelParameters(source, openIndex);\n}\n\n/**\n * Whether a parameter is written as a destructuring pattern — `{ request }` or\n * `[a, b]` — as opposed to a plain name.\n */\nfunction isDestructured(parameter: string) {\n const start = parameter.trimStart();\n\n return start.startsWith(\"{\") || start.startsWith(\"[\");\n}\n\n/**\n * Does this handler look like it was written for the v4 positional signature?\n *\n * ## The signal, and what it misses\n *\n * `Function.length` alone is not enough, because it stops counting at the first\n * defaulted parameter:\n *\n * | handler | `.length` | actually |\n * | ---------------------------------- | --------- | -------- |\n * | `({ request, response }) => …` | 1 | v5 |\n * | `(ctx) => …` | 1 | v5 |\n * | `(request, response) => …` | 2 | v4 |\n * | `(request, response = x) => …` | 1 | v4 |\n *\n * So the primary signal is the function's own source: a handler is suspect when\n * it declares **two or more** parameters and the first is **not** destructured.\n * Reading the source catches the defaulted row that arity cannot, and rules out\n * the `({ … }, extra)` shape that arity would wrongly flag.\n *\n * When the source is unreadable — a bound or native function — this falls back\n * to `handler.length >= 2`, which `bind` preserves. That is a weaker signal but\n * never a wrong one for the common cases; it only loses the defaulted row.\n *\n * ## What is still missed, by design\n *\n * A one-parameter v4 handler (`(request) => …`) is indistinguishable from a v5\n * `(ctx) => …` and is deliberately not flagged — guessing there would produce\n * false positives on correct code. False positives against the canonical\n * `({ … })` form are essentially nil, and every miss simply leaves today's\n * behaviour in place.\n */\nexport function looksLikePositionalHandler(handler: unknown): boolean {\n if (typeof handler !== \"function\") return false;\n\n const parameters = readParameterList(handler);\n\n if (parameters) {\n const firstParameter = parameters[0];\n\n return parameters.length >= 2 && firstParameter !== undefined && !isDestructured(firstParameter);\n }\n\n return handler.length >= 2;\n}\n\n/**\n * The name to print for a handler.\n *\n * `Function.bind` prefixes the name with `\"bound \"`, and the router binds every\n * `[Controller, \"method\"]` tuple handler. The bare method name is what the user\n * actually wrote, so that is what gets printed.\n */\nfunction handlerDisplayName(handler: Function): string {\n return handler.name?.replace(/^bound /, \"\").trim() || \"(anonymous)\";\n}\n\n/**\n * Inspect one route's handler as it registers, recording it when it looks like\n * the v4 positional form. Called from `Router.add`, so the cost is paid once per\n * route at registration and never per request.\n *\n * Deliberately total: any unexpected failure in the heuristic is swallowed, so a\n * diagnostic can never be the reason a route fails to register.\n */\nexport function inspectHandlerSignature(\n handler: unknown,\n route: { method: Route[\"method\"]; path: string; sourceFile: string },\n) {\n try {\n if (!looksLikePositionalHandler(handler)) return;\n\n suspects.push({\n method: route.method,\n path: route.path,\n handlerName: handlerDisplayName(handler as Function),\n sourceFile: route.sourceFile,\n });\n } catch {\n // A diagnostic must never break registration.\n }\n}\n\n/**\n * Every suspect recorded so far, in registration order.\n */\nexport function listPositionalHandlerSuspects(): readonly PositionalHandlerSuspect[] {\n return suspects;\n}\n\n/**\n * Drop the suspects belonging to a route file. Kept in step with\n * `Router.removeRoutesBySourceFile` so an HMR reload that fixes a handler does\n * not keep reporting the version it replaced.\n */\nexport function forgetPositionalHandlerSuspects(sourceFile: string) {\n for (let index = suspects.length - 1; index >= 0; index--) {\n const suspect = suspects[index];\n\n if (suspect?.sourceFile === sourceFile) {\n suspects.splice(index, 1);\n }\n }\n}\n\n/**\n * Drop every recorded suspect. Intended for tests, which share the router\n * singleton.\n */\nexport function clearPositionalHandlerSuspects() {\n suspects.length = 0;\n}\n\n/**\n * The one-line diagnostic for a single route. Written for someone who has never\n * read Warlock's internals: it names the handler, the route, what is wrong, and\n * the exact edit that fixes it.\n */\nexport function describePositionalHandlerSuspect(suspect: PositionalHandlerSuspect): string {\n return (\n `Handler \"${suspect.handlerName}\" (${suspect.method} ${suspect.path}) looks like ` +\n `the v4 positional signature (request, response). ` +\n `v5 passes a single context object — change it to ({ request, response }).`\n );\n}\n\n/**\n * The full boot-time warning: every suspect, once, in one entry.\n *\n * One boot, one list — not one warning per route, and emphatically not one 500\n * per request. Returns the reported suspects so callers can assert on them.\n */\nexport function reportPositionalHandlerSuspects(logger: Pick<typeof log, \"warn\"> = log) {\n const reported = [...suspects];\n\n if (reported.length === 0) return reported;\n\n const headline =\n reported.length === 1\n ? \"1 route handler looks like the v4 positional signature.\"\n : `${reported.length} route handlers look like the v4 positional signature.`;\n\n logger.warn({\n module: \"router\",\n action: \"handlerSignature\",\n message:\n `${headline} Warlock v5 calls every route handler with a single context object, ` +\n `so a second parameter is always undefined and the request fails as soon as it is used:\\n` +\n reported.map((suspect) => ` - ${describePositionalHandlerSuspect(suspect)}`).join(\"\\n\"),\n context: { handlers: reported },\n });\n\n return reported;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,WAAuC,CAAC;;;;;;;;;;;AAY9C,SAAS,wBAAwB,QAAgB,WAAyC;CACxF,MAAM,aAAuB,CAAC;CAE9B,IAAI,QAAQ;CACZ,IAAI,UAAU;CACd,IAAI,QAAQ;CAEZ,KAAK,IAAI,QAAQ,WAAW,QAAQ,OAAO,QAAQ,SAAS;EAC1D,MAAM,OAAO,OAAO;EAEpB,IAAI,OAAO;GACT,IAAI,SAAS,MAAM;IACjB,WAAW,QAAQ,OAAO,QAAQ,MAAM;IACxC;IACA;GACF;GAEA,IAAI,SAAS,OACX,QAAQ;GAGV,WAAW;GACX;EACF;EAEA,IAAI,SAAS,QAAO,SAAS,OAAO,SAAS,KAAK;GAChD,QAAQ;GACR,WAAW;GACX;EACF;EAEA,IAAI,SAAS,OAAO,SAAS,OAAO,SAAS,KAAK;GAChD;GAGA,IAAI,UAAU,GA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OAAO,QAAQ,MAAM,QAAQ,WAAW,EAAE,CAAC,CAAC,KAAK,KAAK;AACxD;;;;;;;;;AAUA,SAAgB,wBACd,SACA,OACA;CACA,IAAI;EACF,IAAI,CAAC,2BAA2B,OAAO,GAAG;EAE1C,SAAS,KAAK;GACZ,QAAQ,MAAM;GACd,MAAM,MAAM;GACZ,aAAa,mBAAmB,OAAmB;GACnD,YAAY,MAAM;EACpB,CAAC;CACH,QAAQ,CAER;AACF;;;;AAKA,SAAgB,gCAAqE;CACnF,OAAO;AACT;;;;;;AAOA,SAAgB,gCAAgC,YAAoB;CAClE,KAAK,IAAI,QAAQ,SAAS,SAAS,GAAG,SAAS,GAAG,SAGhD,IAFgB,SAAS,MAEd,EAAE,eAAe,YAC1B,SAAS,OAAO,OAAO,CAAC;AAG9B;;;;;AAMA,SAAgB,iCAAiC;CAC/C,SAAS,SAAS;AACpB;;;;;;AAOA,SAAgB,iCAAiC,SAA2C;CAC1F,OACE,YAAY,QAAQ,YAAY,KAAK,QAAQ,OAAO,GAAG,QAAQ,KAAK;AAIxE;;;;;;;AAQA,SAAgB,gCAAgC,SAAmC,KAAK;CACtF,MAAM,WAAW,CAAC,GAAG,QAAQ;CAE7B,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,WACJ,SAAS,WAAW,IAChB,4DACA,GAAG,SAAS,OAAO;CAEzB,OAAO,KAAK;EACV,QAAQ;EACR,QAAQ;EACR,SACE,GAAG,SAAS,gKAEZ,SAAS,KAAK,YAAY,OAAO,iCAAiC,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI;EACzF,SAAS,EAAE,UAAU,SAAS;CAChC,CAAC;CAED,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"positional-handler-diagnostics.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/positional-handler-diagnostics.ts"],"sourcesContent":["/**\n * Early detection of route handlers still written against the **v4 positional\n * signature** — `(request, response)` — after v5 moved to a single context\n * object, `({ request, response })`.\n *\n * ## Why this exists\n *\n * A v4 handler is not rejected anywhere. It registers fine, and the router\n * calls it with one argument, so `response` is simply `undefined`. The app only\n * breaks on the first request that reaches it, with:\n *\n * TypeError: Cannot read properties of undefined (reading 'success')\n *\n * That message names nothing the reader can act on — not the route, not the\n * handler, not the change to make. This module turns that late, opaque failure\n * into one explicit list printed at boot, and into a `warlock doctor` check.\n *\n * The break itself is intentional; nothing here restores the positional form.\n * Detection and diagnostics only.\n *\n * ## Why it warns and never throws\n *\n * The signal is a heuristic (see {@link looksLikePositionalHandler}), so a\n * false positive is possible in principle. Turning one into a boot failure\n * would take a working application down over a guess, which is strictly worse\n * than the problem being diagnosed. Everything on this path is therefore a\n * warning: nothing here throws, and nothing here changes how a handler is\n * called. A miss simply degrades to the old runtime `TypeError`.\n */\n\nimport { log } from \"@warlock.js/logger\";\nimport type { Route } from \"./types\";\n\n/**\n * One route whose handler looks like it was written for v4.\n */\nexport type PositionalHandlerSuspect = {\n /** HTTP method the route was registered under. */\n method: Route[\"method\"];\n\n /** Full route path, prefixes already applied. */\n path: string;\n\n /** Handler function name, or `\"(anonymous)\"` when it has none. */\n handlerName: string;\n\n /** Route file the route came from, when the router knows it. */\n sourceFile: string;\n};\n\n/**\n * Collected across the whole registration pass so the warning can be emitted\n * ONCE, as a single list, rather than one line per route (or — as before — one\n * mystery 500 per request).\n */\nconst suspects: PositionalHandlerSuspect[] = [];\n\n/**\n * Split the parameter list of a function's source into top-level parameters.\n *\n * Depth-aware and quote-aware, because a default value may itself contain\n * commas, parentheses, braces or strings — `(request, response = f(a, b))` is\n * two parameters, not three. Anything unbalanced returns `undefined`: refusing\n * to guess is what keeps a parse quirk from becoming a false warning.\n *\n * @param openIndex index of the `(` that opens the parameter list.\n */\nfunction splitTopLevelParameters(source: string, openIndex: number): string[] | undefined {\n const parameters: string[] = [];\n\n let depth = 0;\n let current = \"\";\n let quote = \"\";\n\n for (let index = openIndex; index < source.length; index++) {\n const char = source[index];\n\n if (quote) {\n if (char === \"\\\\\") {\n current += char + (source[index + 1] ?? \"\");\n index++;\n continue;\n }\n\n if (char === quote) {\n quote = \"\";\n }\n\n current += char;\n continue;\n }\n\n if (char === '\"' || char === \"'\" || char === \"`\") {\n quote = char;\n current += char;\n continue;\n }\n\n if (char === \"(\" || char === \"[\" || char === \"{\") {\n depth++;\n\n // The paren that opens the list is punctuation, not part of a parameter.\n if (depth === 1) continue;\n\n current += char;\n continue;\n }\n\n if (char === \")\" || char === \"]\" || char === \"}\") {\n depth--;\n\n if (depth === 0) {\n if (current.trim()) {\n parameters.push(current.trim());\n }\n\n return parameters;\n }\n\n current += char;\n continue;\n }\n\n if (char === \",\" && depth === 1) {\n parameters.push(current.trim());\n current = \"\";\n continue;\n }\n\n current += char;\n }\n\n // Never found the closing paren — treat the source as unreadable.\n return undefined;\n}\n\n/**\n * Read a function's declared parameters from its own source.\n *\n * Returns `undefined` whenever the source cannot be trusted, which callers must\n * treat as \"no information\" rather than \"no parameters\":\n *\n * - `Function.prototype.bind` replaces the body with `[native code]`, so every\n * `[Controller, \"method\"]` tuple handler lands here (the router binds them);\n * - native functions likewise;\n * - a class, whose first `(` belongs to a constructor or a method, not to a\n * parameter list;\n * - anything that fails to parse.\n */\nfunction readParameterList(handler: Function): string[] | undefined {\n let source: string;\n\n try {\n source = Function.prototype.toString.call(handler);\n } catch {\n return undefined;\n }\n\n if (source.includes(\"[native code]\")) return undefined;\n\n if (/^\\s*class[\\s{]/.test(source)) return undefined;\n\n // A single parameter needs no parentheses: `ctx => …`, `async ctx => …`.\n const bareArrow = source.match(/^\\s*(?:async\\s+)?([A-Za-z_$][\\w$]*)\\s*=>/);\n\n if (bareArrow) {\n const parameter = bareArrow[1];\n\n return parameter === undefined ? undefined : [parameter];\n }\n\n const openIndex = source.indexOf(\"(\");\n\n if (openIndex === -1) return undefined;\n\n return splitTopLevelParameters(source, openIndex);\n}\n\n/**\n * Whether a parameter is written as a destructuring pattern — `{ request }` or\n * `[a, b]` — as opposed to a plain name.\n */\nfunction isDestructured(parameter: string) {\n const start = parameter.trimStart();\n\n return start.startsWith(\"{\") || start.startsWith(\"[\");\n}\n\n/**\n * Does this handler look like it was written for the v4 positional signature?\n *\n * ## The signal, and what it misses\n *\n * `Function.length` alone is not enough, because it stops counting at the first\n * defaulted parameter:\n *\n * | handler | `.length` | actually |\n * | ---------------------------------- | --------- | -------- |\n * | `({ request, response }) => …` | 1 | v5 |\n * | `(ctx) => …` | 1 | v5 |\n * | `(request, response) => …` | 2 | v4 |\n * | `(request, response = x) => …` | 1 | v4 |\n *\n * So the primary signal is the function's own source: a handler is suspect when\n * it declares **two or more** parameters and the first is **not** destructured.\n * Reading the source catches the defaulted row that arity cannot, and rules out\n * the `({ … }, extra)` shape that arity would wrongly flag.\n *\n * When the source is unreadable — a bound or native function — this falls back\n * to `handler.length >= 2`, which `bind` preserves. That is a weaker signal but\n * never a wrong one for the common cases; it only loses the defaulted row.\n *\n * ## What is still missed, by design\n *\n * A one-parameter v4 handler (`(request) => …`) is indistinguishable from a v5\n * `(ctx) => …` and is deliberately not flagged — guessing there would produce\n * false positives on correct code. False positives against the canonical\n * `({ … })` form are essentially nil, and every miss simply leaves today's\n * behaviour in place.\n */\nexport function looksLikePositionalHandler(handler: unknown): boolean {\n if (typeof handler !== \"function\") return false;\n\n const parameters = readParameterList(handler);\n\n if (parameters) {\n const firstParameter = parameters[0];\n\n return parameters.length >= 2 && firstParameter !== undefined && !isDestructured(firstParameter);\n }\n\n return handler.length >= 2;\n}\n\n/**\n * The name to print for a handler.\n *\n * `Function.bind` prefixes the name with `\"bound \"`, and the router binds every\n * `[Controller, \"method\"]` tuple handler. The bare method name is what the user\n * actually wrote, so that is what gets printed.\n */\nfunction handlerDisplayName(handler: Function): string {\n return handler.name?.replace(/^bound /, \"\").trim() || \"(anonymous)\";\n}\n\n/**\n * Inspect one route's handler as it registers, recording it when it looks like\n * the v4 positional form. Called from `Router.add`, so the cost is paid once per\n * route at registration and never per request.\n *\n * Deliberately total: any unexpected failure in the heuristic is swallowed, so a\n * diagnostic can never be the reason a route fails to register.\n */\nexport function inspectHandlerSignature(\n handler: unknown,\n route: { method: Route[\"method\"]; path: string; sourceFile: string },\n) {\n try {\n if (!looksLikePositionalHandler(handler)) return;\n\n suspects.push({\n method: route.method,\n path: route.path,\n handlerName: handlerDisplayName(handler as Function),\n sourceFile: route.sourceFile,\n });\n } catch {\n // A diagnostic must never break registration.\n }\n}\n\n/**\n * Every suspect recorded so far, in registration order.\n */\nexport function listPositionalHandlerSuspects(): readonly PositionalHandlerSuspect[] {\n return suspects;\n}\n\n/**\n * Drop the suspects belonging to a route file. Kept in step with\n * `Router.removeRoutesBySourceFile` so an HMR reload that fixes a handler does\n * not keep reporting the version it replaced.\n */\nexport function forgetPositionalHandlerSuspects(sourceFile: string) {\n for (let index = suspects.length - 1; index >= 0; index--) {\n const suspect = suspects[index];\n\n if (suspect?.sourceFile === sourceFile) {\n suspects.splice(index, 1);\n }\n }\n}\n\n/**\n * Drop every recorded suspect. Intended for tests, which share the router\n * singleton.\n */\nexport function clearPositionalHandlerSuspects() {\n suspects.length = 0;\n}\n\n/**\n * The one-line diagnostic for a single route. Written for someone who has never\n * read Warlock's internals: it names the handler, the route, what is wrong, and\n * the exact edit that fixes it.\n */\nexport function describePositionalHandlerSuspect(suspect: PositionalHandlerSuspect): string {\n return (\n `Handler \"${suspect.handlerName}\" (${suspect.method} ${suspect.path}) looks like ` +\n `the v4 positional signature (request, response). ` +\n `v5 passes a single context object — change it to ({ request, response }).`\n );\n}\n\n/**\n * The full boot-time warning: every suspect, once, in one entry.\n *\n * One boot, one list — not one warning per route, and emphatically not one 500\n * per request. Returns the reported suspects so callers can assert on them.\n */\nexport function reportPositionalHandlerSuspects(logger: Pick<typeof log, \"warn\"> = log) {\n const reported = [...suspects];\n\n if (reported.length === 0) return reported;\n\n const headline =\n reported.length === 1\n ? \"1 route handler looks like the v4 positional signature.\"\n : `${reported.length} route handlers look like the v4 positional signature.`;\n\n logger.warn({\n module: \"router\",\n action: \"handlerSignature\",\n message:\n `${headline} Warlock v5 calls every route handler with a single context object, ` +\n `so a second parameter is always undefined and the request fails as soon as it is used:\\n` +\n reported.map((suspect) => ` - ${describePositionalHandlerSuspect(suspect)}`).join(\"\\n\"),\n context: { handlers: reported },\n });\n\n return reported;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,WAAuC,CAAC;;;;;;;;;;;AAY9C,SAAS,wBAAwB,QAAgB,WAAyC;CACxF,MAAM,aAAuB,CAAC;CAE9B,IAAI,QAAQ;CACZ,IAAI,UAAU;CACd,IAAI,QAAQ;CAEZ,KAAK,IAAI,QAAQ,WAAW,QAAQ,OAAO,QAAQ,SAAS;EAC1D,MAAM,OAAO,OAAO;EAEpB,IAAI,OAAO;GACT,IAAI,SAAS,MAAM;IACjB,WAAW,QAAQ,OAAO,QAAQ,MAAM;IACxC;IACA;GACF;GAEA,IAAI,SAAS,OACX,QAAQ;GAGV,WAAW;GACX;EACF;EAEA,IAAI,SAAS,QAAO,SAAS,OAAO,SAAS,KAAK;GAChD,QAAQ;GACR,WAAW;GACX;EACF;EAEA,IAAI,SAAS,OAAO,SAAS,OAAO,SAAS,KAAK;GAChD;GAGA,IAAI,UAAU,GAAG;GAEjB,WAAW;GACX;EACF;EAEA,IAAI,SAAS,OAAO,SAAS,OAAO,SAAS,KAAK;GAChD;GAEA,IAAI,UAAU,GAAG;IACf,IAAI,QAAQ,KAAK,GACf,WAAW,KAAK,QAAQ,KAAK,CAAC;IAGhC,OAAO;GACT;GAEA,WAAW;GACX;EACF;EAEA,IAAI,SAAS,OAAO,UAAU,GAAG;GAC/B,WAAW,KAAK,QAAQ,KAAK,CAAC;GAC9B,UAAU;GACV;EACF;EAEA,WAAW;CACb;AAIF;;;;;;;;;;;;;;AAeA,SAAS,kBAAkB,SAAyC;CAClE,IAAI;CAEJ,IAAI;EACF,SAAS,SAAS,UAAU,SAAS,KAAK,OAAO;CACnD,QAAQ;EACN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AE,eAAe,YAC1B,SAAS,OAAO,OAAO,CAAC;AAG9B;;;;;AAMA,SAAgB,iCAAiC;CAC/C,SAAS,SAAS;AACpB;;;;;;AAOA,SAAgB,iCAAiC,SAA2C;CAC1F,OACE,YAAY,QAAQ,YAAY,KAAK,QAAQ,OAAO,GAAG,QAAQ,KAAK;AAIxE;;;;;;;AAQA,SAAgB,gCAAgC,SAAmC,KAAK;CACtF,MAAM,WAAW,CAAC,GAAG,QAAQ;CAE7B,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,WACJ,SAAS,WAAW,IAChB,4DACA,GAAG,SAAS,OAAO;CAEzB,OAAO,KAAK;EACV,QAAQ;EACR,QAAQ;EACR,SACE,GAAG,SAAS,gKAEZ,SAAS,KAAK,YAAY,OAAO,iCAAiC,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI;EACzF,SAAS,EAAE,UAAU,SAAS;CAChC,CAAC;CAED,OAAO;AACT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { isNullableResource } from "../resource/nullable-resource.mjs";
|
|
1
2
|
import { posix, relative, sep } from "node:path";
|
|
2
3
|
|
|
3
|
-
//#region
|
|
4
|
+
//#region ../../packages/core/src/router/response-schema-types.ts
|
|
4
5
|
const CORE_PACKAGE = "@warlock.js/core";
|
|
5
6
|
function isIndexFile(file) {
|
|
6
7
|
return /(^|[\\/])index\.[cm]?[jt]sx?$/.test(file);
|
|
@@ -52,6 +53,7 @@ function describeResource(reference) {
|
|
|
52
53
|
}
|
|
53
54
|
function describeBodyValue(value, path, resolveResource, onUnmapped) {
|
|
54
55
|
if (typeof value === "string") return describeCast(value);
|
|
56
|
+
if (isNullableResource(value)) return `(${describeBodyValue(value.resource, path, resolveResource, onUnmapped)}) | null`;
|
|
55
57
|
if (typeof value === "function") {
|
|
56
58
|
const reference = resolveResource(value);
|
|
57
59
|
if (!reference) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-schema-types.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"response-schema-types.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/response-schema-types.ts"],"sourcesContent":["import { posix, relative, sep } from \"node:path\";\nimport { isNullableResource } from \"../resource/nullable-resource\";\n\n/**\n * Where a resource class lives: the module it is exported from and the export name.\n */\nexport type ResourceModuleExport = Readonly<{\n file: string;\n exportName: string;\n}>;\n\n/**\n * Import location of a resource as it is written in a generated declaration file.\n * `importPath` has no extension and starts with `./` or `../`.\n */\nexport type ResourceTypeReference = Readonly<{\n importPath: string;\n exportName: string;\n}>;\n\n/**\n * Maps a response-schema resource value back to where it is exported from.\n * Returns `undefined` when the value is not a known resource export.\n */\nexport type ResourceTypeResolver = (value: unknown) => ResourceTypeReference | undefined;\n\n/**\n * A loaded module namespace together with the file it was imported from.\n */\nexport type ResourceModuleNamespace = Readonly<{\n file: string;\n namespace: Record<string, unknown>;\n}>;\n\n/**\n * Called with the dotted path of every field that could not be mapped\n * (for example `200.body.user`).\n */\nexport type UnmappedResourceHandler = (fieldPath: string) => void;\n\nconst CORE_PACKAGE = \"@warlock.js/core\";\n\nfunction isIndexFile(file: string): boolean {\n return /(^|[\\\\/])index\\.[cm]?[jt]sx?$/.test(file);\n}\n\n/**\n * Build an identity map from every function export (resource classes) to the module\n * export it came from.\n *\n * When the same value is exported more than once (a barrel re-export, or a default next\n * to a named export) the most specific location wins: a non-`index.*` file beats an\n * `index.*` file, then a named export beats `default`, then the first one seen.\n */\nexport function buildResourceMap(\n namespaces: readonly ResourceModuleNamespace[],\n): Map<unknown, ResourceModuleExport> {\n const map = new Map<unknown, ResourceModuleExport>();\n\n const rank = (location: ResourceModuleExport): number =>\n (isIndexFile(location.file) ? 2 : 0) + (location.exportName === \"default\" ? 1 : 0);\n\n for (const { file, namespace } of namespaces) {\n for (const [exportName, value] of Object.entries(namespace)) {\n if (typeof value !== \"function\") continue;\n\n const candidate: ResourceModuleExport = { file, exportName };\n const existing = map.get(value);\n\n if (!existing || rank(candidate) < rank(existing)) {\n map.set(value, candidate);\n }\n }\n }\n\n return map;\n}\n\n/**\n * Turn a resource map into a resolver whose import paths are relative to\n * `<appRoot>/.warlock/typings/`, the folder the generated declarations live in.\n */\nexport function createResourceTypeResolver(\n map: ReadonlyMap<unknown, ResourceModuleExport>,\n appRoot: string,\n): ResourceTypeResolver {\n const typingsDirectory = `${appRoot}${sep}.warlock${sep}typings`;\n\n return (value) => {\n const location = map.get(value);\n\n if (!location) return undefined;\n\n let importPath = relative(typingsDirectory, location.file)\n .split(sep)\n .join(posix.sep)\n .replace(/\\.[cm]?[jt]sx?$/, \"\");\n\n if (!importPath.startsWith(\".\")) {\n importPath = `./${importPath}`;\n }\n\n return { importPath, exportName: location.exportName };\n };\n}\n\nfunction describeCast(cast: string): string {\n return `import(${JSON.stringify(CORE_PACKAGE)}).CastOutput<${JSON.stringify(cast)}>`;\n}\n\nfunction describeResource(reference: ResourceTypeReference): string {\n return (\n `import(${JSON.stringify(CORE_PACKAGE)}).ResourceOutput<` +\n `typeof import(${JSON.stringify(reference.importPath)})[${JSON.stringify(reference.exportName)}]>`\n );\n}\n\nfunction describeBodyValue(\n value: unknown,\n path: string,\n resolveResource: ResourceTypeResolver,\n onUnmapped: UnmappedResourceHandler | undefined,\n): string {\n if (typeof value === \"string\") {\n return describeCast(value);\n }\n\n if (isNullableResource(value)) {\n return `(${describeBodyValue(value.resource, path, resolveResource, onUnmapped)}) | null`;\n }\n\n if (typeof value === \"function\") {\n const reference = resolveResource(value);\n\n if (!reference) {\n onUnmapped?.(path);\n return \"unknown\";\n }\n\n return describeResource(reference);\n }\n\n if (Array.isArray(value)) {\n return `(${describeBodyValue(value[0], path, resolveResource, onUnmapped)})[]`;\n }\n\n if (typeof value === \"object\" && value !== null) {\n const members = Object.entries(value).map(\n ([key, member]) =>\n `${JSON.stringify(key)}: ${describeBodyValue(member, `${path}.${key}`, resolveResource, onUnmapped)}`,\n );\n\n return members.length === 0 ? \"{}\" : `{ ${members.join(\"; \")} }`;\n }\n\n return \"unknown\";\n}\n\n/**\n * Serialize a route's `responseSchema` into TypeScript type expressions, one per status code.\n *\n * The expressions are self-contained: they reference only `CastOutput` and `ResourceOutput`\n * from `@warlock.js/core`, `typeof import(...)` of resource modules, object literal types\n * and arrays. A resource that `resolveResource` cannot map becomes `unknown` and is\n * reported through `onUnmapped`.\n *\n * Both the typings child process and the dev server call this, so their output matches.\n *\n * @returns `undefined` when the schema declares no status code.\n *\n * @example\n * describeResponseSchemaTypes({ 400: { body: { error: \"string\" } } }, resolve);\n * // { \"400\": '{ \"error\": import(\"@warlock.js/core\").CastOutput<\"string\"> }' }\n */\nexport function describeResponseSchemaTypes(\n schema: unknown,\n resolveResource: ResourceTypeResolver,\n onUnmapped?: UnmappedResourceHandler,\n): Record<string, string> | undefined {\n if (typeof schema !== \"object\" || schema === null) return undefined;\n\n const described: Record<string, string> = {};\n\n for (const [status, entry] of Object.entries(schema)) {\n if (typeof entry !== \"object\" || entry === null) continue;\n\n const body = (entry as { body?: unknown }).body;\n\n if (typeof body !== \"object\" || body === null) continue;\n\n described[status] = describeBodyValue(body, `${status}.body`, resolveResource, onUnmapped);\n }\n\n return Object.keys(described).length === 0 ? undefined : described;\n}\n"],"mappings":";;;;AAwCA,MAAM,eAAe;AAErB,SAAS,YAAY,MAAuB;CAC1C,OAAO,gCAAgC,KAAK,IAAI;AAClD;;;;;;;;;AAUA,SAAgB,iBACd,YACoC;CACpC,MAAM,sBAAM,IAAI,IAAmC;CAEnD,MAAM,QAAQ,cACX,YAAY,SAAS,IAAI,IAAI,IAAI,MAAM,SAAS,eAAe,YAAY,IAAI;CAElF,KAAK,MAAM,EAAE,MAAM,eAAe,YAChC,KAAK,MAAM,CAAC,YAAY,UAAU,OAAO,QAAQ,SAAS,GAAG;EAC3D,IAAI,OAAO,UAAU,YAAY;EAEjC,MAAM,YAAkC;GAAE;GAAM;EAAW;EAC3D,MAAM,WAAW,IAAI,IAAI,KAAK;EAE9B,IAAI,CAAC,YAA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;EAC/C,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,KACnC,CAAC,KAAK,YACL,GAAG,KAAK,UAAU,GAAG,EAAE,IAAI,kBAAkB,QAAQ,GAAG,KAAK,GAAG,OAAO,iBAAiB,UAAU,GACtG;EAEA,OAAO,QAAQ,WAAW,IAAI,OAAO,KAAK,QAAQ,KAAK,IAAI,EAAE;CAC/D;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;AAkBA,SAAgB,4BACd,QACA,iBACA,YACoC;CACpC,IAAI,OAAO,WAAW,YAAY,WAAW,MAAM,OAAO;CAE1D,MAAM,YAAoC,CAAC;CAE3C,KAAK,MAAM,CAAC,QAAQ,UAAU,OAAO,QAAQ,MAAM,GAAG;EACpD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAEjD,MAAM,OAAQ,MAA6B;EAE3C,IAAI,OAAO,SAAS,YAAY,SAAS,MAAM;EAE/C,UAAU,UAAU,kBAAkB,MAAM,GAAG,OAAO,QAAQ,iBAAiB,UAAU;CAC3F;CAEA,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,WAAW,IAAI,SAAY;AAC3D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RequestHandlerType, RouteOptions } from "./types.mjs";
|
|
2
2
|
import { Router } from "./router.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../packages/core/src/router/route-builder.d.ts
|
|
5
5
|
declare class RouteBuilder {
|
|
6
6
|
private readonly router;
|
|
7
7
|
private readonly path;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-builder.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"route-builder.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/route-builder.ts"],"mappings":";;;;cAIa,YAAA;EAAA,iBAYQ,MAAA;EAAA,iBACA,IAAA;EAAA,iBACA,WAAA;EAAA,UAbT,WAAA;;;;;;;;;cAWS,MAAA,EAAQ,M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,YAAA;EAzGhD;;;;;;;;;;;;EA2HA,IAAA,CACL,QAAA;IACE,IAAA,GAAO,kBAAA;IACP,MAAA,GAAS,kBAAA;IACT,IAAA,GAAO,kBAAA;IACP,MAAA,GAAS,kBAAA;IACT,OAAA,GAAU,kBAAA;IACV,KAAA,GAAQ,kBAAA;EAAA,GAEV,OAAA,GAAS,YAAA;EA1FJ;;;EAAA,UAwGG,WAAA,CAAY,OAAA,GAAS,YAAA,GAAiB,YAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { merge } from "@mongez/reinforcements";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../packages/core/src/router/route-builder.ts
|
|
4
4
|
var RouteBuilder = class RouteBuilder {
|
|
5
5
|
constructor(router, path, moreOptions = {}) {
|
|
6
6
|
this.router = router;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-builder.mjs","names":[],"sources":["../../../../../../../core/src/router/route-builder.ts"],"sourcesContent":["import { merge } from \"@mongez/reinforcements\";\nimport { type Router } from \"./router\";\nimport type { RequestHandlerType, RouteOptions } from \"./types\";\n\nexport class RouteBuilder {\n protected addedRoutes = {\n get: false,\n post: false,\n put: false,\n delete: false,\n patch: false,\n options: false,\n head: false,\n };\n\n public constructor(\n private readonly router: Router,\n private readonly path: string,\n private readonly moreOptions: RouteOptions = {},\n ) {\n //\n }\n\n /**\n * Add a get method to the route\n */\n public get(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.get) {\n throw new Error(`Route ${this.path} already has a GET method`);\n }\n\n this.addedRoutes.get = true;\n this.router.get(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Get one resource, appends /:id to the path\n * For example: /posts/:id\n */\n public getOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.get(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a post method to the route\n */\n public post(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.post) {\n throw new Error(`Route ${this.path} already has a POST method`);\n }\n\n this.addedRoutes.post = true;\n this.router.post(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Post one resource, appends /:id to the path\n * For example: /posts/:id\n */\n public postOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.post(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a PUT request handler for current path\n */\n public put(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.put) {\n throw new Error(`Route ${this.path} already has a PUT method`);\n }\n\n this.addedRoutes.put = true;\n this.router.put(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Update one resource, appends /:id to the path\n */\n public updateOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.put(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a PATCH request handler for current path\n */\n public patch(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.patch) {\n throw new Error(`Route ${this.path} already has a PATCH method`);\n }\n\n this.addedRoutes.patch = true;\n this.router.patch(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Patch one resource, appends /:id to the path\n */\n public patchOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.patch(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a DELETE request handler for current path\n */\n public delete(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.delete) {\n throw new Error(`Route ${this.path} already has a DELETE method`);\n }\n\n this.addedRoutes.delete = true;\n this.router.delete(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Delete one resource, appends /:id to the path\n */\n public deleteOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.delete(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n // ============================================================================\n // RESTful Semantic Aliases\n // ============================================================================\n\n /**\n * List all resources (RESTful alias for GET collection)\n * @example router.route(\"/posts\").list(listPosts)\n */\n public list(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.get(handler, options);\n }\n\n /**\n * Create a new resource (RESTful alias for POST)\n * @example router.route(\"/posts\").create(createPost)\n */\n public create(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.post(handler, options);\n }\n\n /**\n * Show a single resource (RESTful alias for GET one)\n * @example router.route(\"/posts\").show(showPost) // GET /posts/:id\n */\n public show(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.getOne(handler, options);\n }\n\n /**\n * Update a resource (RESTful alias for PUT one)\n * @example router.route(\"/posts\").update(updatePost) // PUT /posts/:id\n */\n public update(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.updateOne(handler, options);\n }\n\n /**\n * Destroy a resource (RESTful alias for DELETE one)\n * @example router.route(\"/posts\").destroy(deletePost) // DELETE /posts/:id\n */\n public destroy(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.deleteOne(handler, options);\n }\n\n // ============================================================================\n // Route Nesting\n // ============================================================================\n\n /**\n * Create a nested route builder\n * Useful for building nested resources like /posts/:id/comments\n * @example\n * router.route(\"/posts/:id\")\n * .getOne(showPost)\n * .nest(\"/comments\")\n * .list(listComments) // GET /posts/:id/comments\n * .create(createComment); // POST /posts/:id/comments\n */\n public nest(path: string, options: RouteOptions = {}): RouteBuilder {\n const nestedPath = `${this.path}${path}`;\n const mergedOptions = this.withOptions(options);\n return new RouteBuilder(this.router, nestedPath, mergedOptions);\n }\n\n /**\n * Set up common RESTful CRUD routes in one call\n * @example\n * router.route(\"/posts\").crud({\n * list: listPosts, // GET /posts\n * create: createPost, // POST /posts\n * show: showPost, // GET /posts/:id\n * update: updatePost, // PUT /posts/:id\n * destroy: deletePost, // DELETE /posts/:id\n * patch: patchPost, // PATCH /posts/:id\n * });\n */\n public crud(\n handlers: {\n list?: RequestHandlerType;\n create?: RequestHandlerType;\n show?: RequestHandlerType;\n update?: RequestHandlerType;\n destroy?: RequestHandlerType;\n patch?: RequestHandlerType;\n },\n options: RouteOptions = {},\n ) {\n if (handlers.list) this.get(handlers.list, options);\n if (handlers.create) this.post(handlers.create, options);\n if (handlers.show) this.getOne(handlers.show, options);\n if (handlers.update) this.updateOne(handlers.update, options);\n if (handlers.destroy) this.deleteOne(handlers.destroy, options);\n if (handlers.patch) this.patchOne(handlers.patch, options);\n return this;\n }\n\n /**\n * Merge options with moreOptions\n */\n protected withOptions(options: RouteOptions = {}) {\n const merged = merge(this.moreOptions, options);\n\n // builder middleware runs first, then the verb/nested ones (deduplicated by reference)\n const middleware = [...(this.moreOptions.middleware || []), ...(options.middleware || [])];\n\n if (middleware.length > 0) {\n merged.middleware = [...new Set(middleware)];\n }\n\n return merged;\n }\n}\n"],"mappings":";;;AAIA,IAAa,eAAb,MAAa,aAAa;CAWxB,AAAO,YACL,AAAiB,QACjB,AAAiB,MACjB,AAAiB,cAA4B,CAAC,GAC9C;EAHiB;EACA;EACA;qBAbK;GACtB,KAAK;GACL,MAAM;GACN,KAAK;GACL,QAAQ;GACR,OAAO;GACP,SAAS;GACT,MAAM;EACR;CAQA;;;;CAKA,AAAO,IAAI,SAA6B,UAAwB,CAAC,GAAG;EAClE,IAAI,KAAK,YAAY,KACnB,MAAM,IAAI,MAAM,SAAS,KAAK,KAAK,0BAA0B;EAG/D,KAAK,YAAY,MAAM;EACvB,KAAK,OAAO,IAAI,KAAK,MAAM,SAAS,KAAK,YAAY,OAAO,CAAC;EAC7D,OAAO;CACT;;;;;CAMA,AAAO,OAAO,SAA6B,UAAwB,CAAC,GAAG;EACrE,KAAK,OAAO,IAAI,GAAG,KAAK,KAAK,OAAO,SAAS,KAAK,YAAY,OAAO,CAAC;EACtE,OAAO;CACT;;;;CAKA,AAAO,KAAK,SAA6B,UAAwB,CAAC,GAAG;EACnE,IAAI,KAAK,YAAY,MACnB,MAAM,IAAI,MAAM,SAAS,KAAK,KAAK,2BAA2B;EAGhE,KAAK,YAAY,OAAO;EACxB,KAAK,OAAO,KAAK,KA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;EAG9C,MAAM,aAAa,CAAC,GAAI,KAAK,YAAY,cAAc,CAAC,GAAI,GAAI,QAAQ,cAAc,CAAC,CAAE;EAEzF,IAAI,WAAW,SAAS,GACtB,OAAO,aAAa,CAAC,GAAG,IAAI,IAAI,UAAU,CAAC;EAG7C,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"route-builder.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/route-builder.ts"],"sourcesContent":["import { merge } from \"@mongez/reinforcements\";\nimport { type Router } from \"./router\";\nimport type { RequestHandlerType, RouteOptions } from \"./types\";\n\nexport class RouteBuilder {\n protected addedRoutes = {\n get: false,\n post: false,\n put: false,\n delete: false,\n patch: false,\n options: false,\n head: false,\n };\n\n public constructor(\n private readonly router: Router,\n private readonly path: string,\n private readonly moreOptions: RouteOptions = {},\n ) {\n //\n }\n\n /**\n * Add a get method to the route\n */\n public get(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.get) {\n throw new Error(`Route ${this.path} already has a GET method`);\n }\n\n this.addedRoutes.get = true;\n this.router.get(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Get one resource, appends /:id to the path\n * For example: /posts/:id\n */\n public getOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.get(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a post method to the route\n */\n public post(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.post) {\n throw new Error(`Route ${this.path} already has a POST method`);\n }\n\n this.addedRoutes.post = true;\n this.router.post(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Post one resource, appends /:id to the path\n * For example: /posts/:id\n */\n public postOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.post(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a PUT request handler for current path\n */\n public put(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.put) {\n throw new Error(`Route ${this.path} already has a PUT method`);\n }\n\n this.addedRoutes.put = true;\n this.router.put(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Update one resource, appends /:id to the path\n */\n public updateOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.put(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a PATCH request handler for current path\n */\n public patch(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.patch) {\n throw new Error(`Route ${this.path} already has a PATCH method`);\n }\n\n this.addedRoutes.patch = true;\n this.router.patch(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Patch one resource, appends /:id to the path\n */\n public patchOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.patch(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Add a DELETE request handler for current path\n */\n public delete(handler: RequestHandlerType, options: RouteOptions = {}) {\n if (this.addedRoutes.delete) {\n throw new Error(`Route ${this.path} already has a DELETE method`);\n }\n\n this.addedRoutes.delete = true;\n this.router.delete(this.path, handler, this.withOptions(options));\n return this;\n }\n\n /**\n * Delete one resource, appends /:id to the path\n */\n public deleteOne(handler: RequestHandlerType, options: RouteOptions = {}) {\n this.router.delete(`${this.path}/:id`, handler, this.withOptions(options));\n return this;\n }\n\n // ============================================================================\n // RESTful Semantic Aliases\n // ============================================================================\n\n /**\n * List all resources (RESTful alias for GET collection)\n * @example router.route(\"/posts\").list(listPosts)\n */\n public list(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.get(handler, options);\n }\n\n /**\n * Create a new resource (RESTful alias for POST)\n * @example router.route(\"/posts\").create(createPost)\n */\n public create(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.post(handler, options);\n }\n\n /**\n * Show a single resource (RESTful alias for GET one)\n * @example router.route(\"/posts\").show(showPost) // GET /posts/:id\n */\n public show(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.getOne(handler, options);\n }\n\n /**\n * Update a resource (RESTful alias for PUT one)\n * @example router.route(\"/posts\").update(updatePost) // PUT /posts/:id\n */\n public update(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.updateOne(handler, options);\n }\n\n /**\n * Destroy a resource (RESTful alias for DELETE one)\n * @example router.route(\"/posts\").destroy(deletePost) // DELETE /posts/:id\n */\n public destroy(handler: RequestHandlerType, options: RouteOptions = {}) {\n return this.deleteOne(handler, options);\n }\n\n // ============================================================================\n // Route Nesting\n // ============================================================================\n\n /**\n * Create a nested route builder\n * Useful for building nested resources like /posts/:id/comments\n * @example\n * router.route(\"/posts/:id\")\n * .getOne(showPost)\n * .nest(\"/comments\")\n * .list(listComments) // GET /posts/:id/comments\n * .create(createComment); // POST /posts/:id/comments\n */\n public nest(path: string, options: RouteOptions = {}): RouteBuilder {\n const nestedPath = `${this.path}${path}`;\n const mergedOptions = this.withOptions(options);\n return new RouteBuilder(this.router, nestedPath, mergedOptions);\n }\n\n /**\n * Set up common RESTful CRUD routes in one call\n * @example\n * router.route(\"/posts\").crud({\n * list: listPosts, // GET /posts\n * create: createPost, // POST /posts\n * show: showPost, // GET /posts/:id\n * update: updatePost, // PUT /posts/:id\n * destroy: deletePost, // DELETE /posts/:id\n * patch: patchPost, // PATCH /posts/:id\n * });\n */\n public crud(\n handlers: {\n list?: RequestHandlerType;\n create?: RequestHandlerType;\n show?: RequestHandlerType;\n update?: RequestHandlerType;\n destroy?: RequestHandlerType;\n patch?: RequestHandlerType;\n },\n options: RouteOptions = {},\n ) {\n if (handlers.list) this.get(handlers.list, options);\n if (handlers.create) this.post(handlers.create, options);\n if (handlers.show) this.getOne(handlers.show, options);\n if (handlers.update) this.updateOne(handlers.update, options);\n if (handlers.destroy) this.deleteOne(handlers.destroy, options);\n if (handlers.patch) this.patchOne(handlers.patch, options);\n return this;\n }\n\n /**\n * Merge options with moreOptions\n */\n protected withOptions(options: RouteOptions = {}) {\n const merged = merge(this.moreOptions, options);\n\n // builder middleware runs first, then the verb/nested ones (deduplicated by reference)\n const middleware = [...(this.moreOptions.middleware || []), ...(options.middleware || [])];\n\n if (middleware.length > 0) {\n merged.middleware = [...new Set(middleware)];\n }\n\n return merged;\n }\n}\n"],"mappings":";;;AAIA,IAAa,eAAb,MAAa,aAAa;CAWxB,AAAO,YACL,AAAiB,QACjB,AAAiB,MACjB,AAAiB,cAA4B,CAAC,GAC9C;EAHiB;EACA;EACA;qBAbK;GACtB,KAAK;GACL,MAAM;GACN,KAAK;GACL,QAAQ;GACR,OAAO;GACP,SAAS;GACT,MAAM;EACR;CAQA;;;;CAKA,AAAO,IAAI,SAA6B,UAAwB,CAAC,GAAG;EAClE,IAAI,KAAK,YAAY,KACnB,MAAM,IAAI,MAAM,SAAS,KAAK,KAAK,0BAA0B;EAG/D,KAAK,YAAY,MAAM;EACvB,KAAK,OAAO,IAAI,KAAK,MAAM,SAAS,KAAK,YAAY,OAAO,CAAC;EAC7D,OAAO;CACT;;;;;CAMA,AAAO,OAAO,SAA6B,UAAwB,CAAC,GAAG;EACrE,KAAK,OAAO,IAAI,GAAG,KAAK,KAAK,OAAO,SAAS,KAAK,YAAY,OAAO,CAAC;EACtE,OAAO;CACT;;;;CAKA,AAAO,KAAK,SAA6B,UAAwB,CAAC,GAAG;EACnE,IAAI,KAAK,YAAY,MACnB,MAAM,IAAI,MAAM,SAAS,KAAK,KAAK,2BAA2B;EAGhE,KAAK,YAAY,OAAO;EACxB,KAAK,OAAO,KAAK,KAAK,MAAM,SAAS,KAAK,YAAY,OAAO,CAAC;EAC9D,OAAO;CACT;;;;;CAMA,AAAO,QAAQ,SAA6B,UAAwB,CAAC,GAAG;EACtE,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK,OAAO,SAAS,KAAK,YAAY,OAAO,CAAC;EACvE,OAAO;CACT;;;;CAKA,AAAO,IAAI,SAA6B,UAAwB,CAAC,GAAG;EAClE,IAAI,KAAK,YAAY,KACnB,MAAM,IAAI,MAAM,SAAS,KAAK,KAAK,0BAA0B;EAG/D,KAAK,YAA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KAAK,OAAO,SAAS,OAAO;CACrC;;;;;CAMA,AAAO,OAAO,SAA6B,UAAwB,CAAC,GAAG;EACrE,OAAO,KAAK,UAAU,SAAS,OAAO;CACxC;;;;;CAMA,AAAO,QAAQ,SAA6B,UAAwB,CAAC,GAAG;EACtE,OAAO,KAAK,UAAU,SAAS,OAAO;CACxC;;;;;;;;;;;CAgBA,AAAO,KAAK,MAAc,UAAwB,CAAC,GAAiB;EAClE,MAAM,aAAa,GAAG,KAAK,OAAO;EAClC,MAAM,gBAAgB,KAAK,YAAY,OAAO;EAC9C,OAAO,IAAI,aAAa,KAAK,QAAQ,YAAY,aAAa;CAChE;;;;;;;;;;;;;CAcA,AAAO,KACL,UAQA,UAAwB,CAAC,GACzB;EACA,IAAI,SAAS,MAAM,KAAK,IAAI,SAAS,MAAM,OAAO;EAClD,IAAI,SAAS,QAAQ,KAAK,KAAK,SAAS,QAAQ,OAAO;EACvD,IAAI,SAAS,MAAM,KAAK,OAAO,SAAS,MAAM,OAAO;EACrD,IAAI,SAAS,QAAQ,KAAK,UAAU,SAAS,QAAQ,OAAO;EAC5D,IAAI,SAAS,SAAS,KAAK,UAAU,SAAS,SAAS,OAAO;EAC9D,IAAI,SAAS,OAAO,KAAK,SAAS,SAAS,OAAO,OAAO;EACzD,OAAO;CACT;;;;CAKA,AAAU,YAAY,UAAwB,CAAC,GAAG;EAChD,MAAM,SAAS,MAAM,KAAK,aAAa,OAAO;EAG9C,MAAM,aAAa,CAAC,GAAI,KAAK,YAAY,cAAc,CAAC,GAAI,GAAI,QAAQ,cAAc,CAAC,CAAE;EAEzF,IAAI,WAAW,SAAS,GACtB,OAAO,aAAa,CAAC,GAAG,IAAI,IAAI,UAAU,CAAC;EAG7C,OAAO;CACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-name-method-suffix.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"route-name-method-suffix.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/route-name-method-suffix.ts"],"mappings":";;AAmBA;;;;AAAoD;AAapD;;;;;;;;AAGgB;;;;AAAA,iBAhBA,qBAAA,CAAsB,MAAc;;;;;;;;;;iBAapC,uBAAA,CACd,WAAA,UACA,cAAA,UACA,MAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-name-method-suffix.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"route-name-method-suffix.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/route-name-method-suffix.ts"],"sourcesContent":["/**\n * The route-name suffix the router appends at REGISTRATION time, and its\n * inverse.\n *\n * `Router.add` gives a route the name it was asked for — unless another route\n * already claimed that name under a DIFFERENT method, in which case it appends\n * `.<method>` so both can coexist. That decision depends on the whole\n * registration order across pages AND API routes, so it cannot be predicted by\n * anything that only looks at one route, or at only one kind of route.\n *\n * Both halves live here so the rule is written down once: `Router.add` builds\n * the suffix with {@link routeNameMethodSuffix}, and anything comparing a\n * DERIVED name against a REGISTERED one uses {@link matchesDerivedRouteName}.\n */\n\n/**\n * The suffix `Router.add` appends to a route name already claimed by another\n * method.\n */\nexport function routeNameMethodSuffix(method: string): string {\n return `.${method.toLowerCase()}`;\n}\n\n/**\n * Whether `registeredName` is what the router would have registered for a\n * route whose name was DERIVED as `derivedName`.\n *\n * True for exactly two spellings: the derived name itself, and the derived\n * name plus the registration collision suffix for `method`. It is not a fuzzy\n * match — a `.get` suffix is accepted only where the router itself could have\n * added one, and any other difference is still a difference.\n */\nexport function matchesDerivedRouteName(\n derivedName: string,\n registeredName: string,\n method: string,\n): boolean {\n if (registeredName === derivedName) {\n return true;\n }\n\n return registeredName === derivedName + routeNameMethodSuffix(method);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,sBAAsB,QAAwB;CAC5D,OAAO,IAAI,OAAO,YAAY;AAChC;;;;;;;;;;AAWA,SAAgB,wBACd,aACA,gBACA,QACS;CACT,IAAI,mBAAmB,aACrB,OAAO;CAGT,OAAO,mBAAmB,cAAc,sBAAsB,MAAM;AACtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-registry.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"route-registry.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/route-registry.ts"],"mappings":";;;;;AAuBA;;cAAa,aAAA;EAAA,QACH,MAAA;;EAgDI;;;EAjCL,QAAA,CAAS,MAAA,EAAQ,KAAA;EAfhB;;;EAkCD,aAAA,CAAc,KAAA,EAAO,KAAA;EAnBZ;;;;EA8BT,IAAA,CACL,MAAA,UACA,GAAA;IACG,KAAA,EAAO,KAAA;IAAO,MAAA,EAAQ,MAAA;EAAA;EAAf;;;EAqBL,aAAA;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeRequestPath } from "./normalize-request-path.mjs";
|
|
2
2
|
import FindMyWay from "find-my-way";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../packages/core/src/router/route-registry.ts
|
|
5
5
|
/**
|
|
6
6
|
* The concrete HTTP verbs an `all` route expands into.
|
|
7
7
|
* Mirrors the set Fastify's `.all()` answers in production, so `router.any()`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-registry.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"route-registry.mjs","names":[],"sources":["../../../../../../../../packages/core/src/router/route-registry.ts"],"sourcesContent":["import FindMyWay, { type HTTPMethod, type Instance } from \"find-my-way\";\nimport { normalizeRequestPath } from \"./normalize-request-path\";\nimport type { RequestMethod, Route } from \"./types\";\n\n/**\n * The concrete HTTP verbs an `all` route expands into.\n * Mirrors the set Fastify's `.all()` answers in production, so `router.any()`\n * routes behave identically under the dev server and prod Fastify.\n */\nconst ALL_METHODS: Exclude<RequestMethod, \"all\">[] = [\n \"GET\",\n \"POST\",\n \"PUT\",\n \"PATCH\",\n \"DELETE\",\n \"OPTIONS\",\n \"HEAD\",\n];\n\n/**\n * Route Registry\n * Manages dynamic route matching using find-my-way for HMR support\n */\nexport class RouteRegistry {\n private router: Instance<any>;\n\n public constructor() {\n this.router = FindMyWay({\n // Request paths are normalized explicitly in `find`; leaving this off\n // makes that shared normalizer, rather than a second router option, the\n // reason development accepts a terminal slash.\n ignoreTrailingSlash: false,\n caseSensitive: true,\n });\n }\n\n /**\n * Register all routes from the router's internal list\n */\n public register(routes: Route[]): void {\n // Register each route\n for (const route of routes) {\n if (route.method === \"all\") {\n for (const method of ALL_METHODS) {\n this.registerRoute({\n ...route,\n method,\n });\n }\n } else {\n this.registerRoute(route);\n }\n }\n }\n\n /**\n * Register a single route\n */\n public registerRoute(route: Route): void {\n this.router.on(route.method as HTTPMethod, route.path, (req, res, params) => {\n // Store the route and params for later use\n return { route, params };\n });\n }\n\n /**\n * Find a matching route for the given method and URL\n * @returns Matched route with extracted params, or null if no match\n */\n public find(\n method: string,\n url: string,\n ): { route: Route; params: Record<string, string> } | null {\n // Strip query string from URL (find-my-way expects just the path)\n const path = normalizeRequestPath(url.split(\"?\")[0] ?? \"/\");\n\n // HEAD falls back to the GET route, as Fastify's implicit HEAD does in production.\n const match =\n this.router.find(method as HTTPMethod, path) ??\n (method === \"HEAD\" ? this.router.find(\"GET\", path) : null);\n\n if (!match) {\n return null;\n }\n\n // find-my-way handler expects (req, res, params, store, searchParams)\n // We only care about the return value which contains { route, params }\n return match.handler(null as any, null as any, match.params, match.store, {});\n }\n\n /**\n * Get all registered routes count (for debugging)\n */\n public getRouteCount(): number {\n return this.router\n .prettyPrint()\n .split(\"\\n\")\n .filter((line) => line.trim()).length;\n }\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,cAA+C;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;AAMA,IAAa,gBAAb,MAA2B;CAGzB,AAAO,cAAc;EACnB,KAAK,SAAS,UAAU;GAItB,qBAAqB;GACrB,eAAe;EACjB,CAAC;CACH;;;;CAKA,AAAO,SAAS,QAAuB;EAErC,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,WAAW,OACnB,KAAK,MAAM,UAAU,aACnB,KAAK,cAAc;GACjB,GAAG;GACH;EACF,CAAC;OAGH,KAAK,cAAc,KAAK;CAG9B;;;;CAKA,AAAO,cAAc,OAAoB;EACvC,KAAK,OAAO,GAAG,MAAM,QAAsB,MAAM,OAAO,KAAK,KAAK,WAAW;GAE3E,OAAO;IAAE;IAAO;GAAO;EACzB,CAAC;CACH;;;;;CAMA,AAAO,KACL,QACA,KACyD;EAEzD,MAAM,OAAO,qBAAqB,IAAI,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG;EAG1D,MAAM,QACJ,KAAK,OAAO,KAAK,QAAsB,IAAI,MAC1C,WAAW,SAAS,KAAK,OAAO,KAAK,OAAO,IAAI,IAAI;EAEvD,IAAI,CAAC,OACH,OAAO;EAKT,OAAO,MAAM,QAAQ,MAAa,MAAa,MAAM,QAAQ,MAAM,OAAO,CAAC,CAAC;CAC9E;;;;CAKA,AAAO,gBAAwB;EAC7B,OAAO,KAAK,OACT,YAAY,CAAC,CACb,MAAM,IAAI,CAAC,CACX,QAAQ,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC;CACnC;AACF"}
|
package/esm/router/router.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { RouteBuilder } from "./route-builder.mjs";
|
|
|
4
4
|
import { FastifyHttpProxyOptions } from "@fastify/http-proxy";
|
|
5
5
|
import { FastifyStaticOptions } from "@fastify/static";
|
|
6
6
|
|
|
7
|
-
//#region
|
|
7
|
+
//#region ../../packages/core/src/router/router.d.ts
|
|
8
8
|
declare class Router {
|
|
9
9
|
/**
|
|
10
10
|
* Routes list
|
|
@@ -62,6 +62,13 @@ declare class Router {
|
|
|
62
62
|
* Server static folder
|
|
63
63
|
*/
|
|
64
64
|
directory(options: FastifyStaticOptions): this;
|
|
65
|
+
/**
|
|
66
|
+
* Register every `directory()` with `@fastify/static`. The plugin is
|
|
67
|
+
* imported only when at least one directory was declared: loading it is not
|
|
68
|
+
* free (its directory-listing module calls `os.cpus()` at load), and an app
|
|
69
|
+
* that serves no static folder should not pay for it (WR-027).
|
|
70
|
+
*/
|
|
71
|
+
protected registerStaticDirectories(server: FastifyInstance): void;
|
|
65
72
|
/**
|
|
66
73
|
* Serve file
|
|
67
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"router.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/router/router.ts"],"mappings":";;;;;;;cA8Ja,MAAA;;AAAb;;UAIU,MAAA;EA8BqB;;;;;;;;EAAA,QApBrB,aAAA;EAiEgD;;;;EAAA,QA3DhD,2BAAA;EAoJS;;;EAAA,eA3IF,QAAA;EAoKJ;;;EAAA,UA/JD,iBAAA,EAAmB,oBAAA;EA6RK;;;EAAA,UAxRxB,cAAA,EAAgB,MAAA,WAAiB,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,eAAA;EAsSjC;;;;EAAA,UA/RxB,MAAA,EAAQ,YAAA;EA6S+C;;;EAAA,OApSnD,WAAA,IAAW,MAAA;EAAA,QAQlB,WAAA;EAiT6B;;;EA1S7B,cAAA,CAAe,QAAA,GAAW,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,eAAA;EA4T9C;;;EAnTJ,aAAA,CAAc,QAAA,GAAW,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,eAAA;EAqTlC;;;EA5Sf,QAAA,CAAS,IAAA,UAAc,EAAA,UAAY,YAAA;EAmZY;;;EA1Y/C,SAAA,CAAU,OAAA,EAAS,oBAAA;EA2df;;;;;;EAAA,UA/cD,yBAAA,CAA0B,MAAA,EAAQ,eAAA;EA6gBzC;;;EA7fI,IAAA,CAAK,IAAA,UAAc,QAAA,UAAkB,SAAA;EAiqBxB;;;EAxpBb,UAAA,CAAW,IAAA,UAAc,QAAA,UAAkB,SAAA;EAs1BN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