@warlock.js/core 5.30.0 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +165 -36
- package/README.md +28 -23
- package/bin/source-load-hook.mjs +63 -0
- package/bin/warlock.js +102 -42
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +1 -2
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +5 -7
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +3 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +14 -12
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/add.command.mjs +4 -2
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +70 -0
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -0
- package/esm/cli/commands/agents-md.command.mjs +38 -0
- package/esm/cli/commands/agents-md.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +279 -0
- package/esm/cli/commands/board/board-command.action.mjs.map +1 -0
- package/esm/cli/commands/board.command.mjs +78 -0
- package/esm/cli/commands/board.command.mjs.map +1 -0
- package/esm/cli/commands/build.command.mjs +6 -1
- package/esm/cli/commands/build.command.mjs.map +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +57 -0
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -0
- package/esm/cli/commands/check/child-typecheck.mjs +66 -0
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -0
- package/esm/cli/commands/check/format-problems.mjs +43 -0
- package/esm/cli/commands/check/format-problems.mjs.map +1 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs +61 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs.map +1 -0
- package/esm/cli/commands/check.command.mjs +50 -0
- package/esm/cli/commands/check.command.mjs.map +1 -0
- package/esm/cli/commands/dev-server.command.mjs +12 -3
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs +8 -3
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +89 -0
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/connectors.check.mjs +2 -0
- package/esm/cli/commands/doctor/checks/connectors.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/health.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/health.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +23 -27
- 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 -0
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs +4 -0
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/routes.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/routes.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +15 -6
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/doctor/format-report.mjs +30 -2
- package/esm/cli/commands/doctor/format-report.mjs.map +1 -1
- package/esm/cli/commands/doctor.command.mjs +4 -0
- package/esm/cli/commands/doctor.command.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +64 -0
- package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -0
- package/esm/cli/commands/explain.command.mjs +23 -0
- package/esm/cli/commands/explain.command.mjs.map +1 -0
- package/esm/cli/commands/generate/generate.command.mjs +124 -124
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +313 -0
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -0
- 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 +4 -3
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +341 -0
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.mjs +19 -6
- package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +136 -0
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs +2 -2
- 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/prompt.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/writer.mjs +38 -13
- package/esm/cli/commands/generate/utils/writer.mjs.map +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +73 -0
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -0
- package/esm/cli/commands/inspect.command.mjs +39 -0
- package/esm/cli/commands/inspect.command.mjs.map +1 -0
- package/esm/cli/commands/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +104 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -0
- package/esm/cli/commands/mcp.command.mjs +76 -0
- package/esm/cli/commands/mcp.command.mjs.map +1 -0
- 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.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.map +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +3 -3
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +131 -0
- package/esm/cli/commands/test.command.mjs.map +1 -0
- package/esm/cli/commands/trace/trace-command.action.mjs +145 -0
- package/esm/cli/commands/trace/trace-command.action.mjs.map +1 -0
- package/esm/cli/commands/trace.command.mjs +60 -0
- package/esm/cli/commands/trace.command.mjs.map +1 -0
- package/esm/cli/commands/typecheck.command.mjs +40 -0
- package/esm/cli/commands/typecheck.command.mjs.map +1 -0
- package/esm/cli/commands/upgrade.command.mjs +46 -0
- package/esm/cli/commands/upgrade.command.mjs.map +1 -0
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/flush-and-exit.mjs +34 -0
- package/esm/cli/flush-and-exit.mjs.map +1 -0
- package/esm/cli/framework-cli-commands.mjs +25 -1
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +3 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +35 -14
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +70 -0
- package/esm/config/config-schema.d.mts.map +1 -0
- package/esm/config/config-schema.mjs +77 -0
- package/esm/config/config-schema.mjs.map +1 -0
- package/esm/config/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +7 -0
- package/esm/config/index.mjs +2 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs +2 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +26 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +2 -2
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +11 -9
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/single-server-warnings.mjs.map +1 -1
- package/esm/connectors/socket-connector.d.mts +1 -3
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +12 -10
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -31
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +6 -3
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.mjs +2 -0
- package/esm/database/seeds/seeder.errors.mjs.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +1 -1
- package/esm/dev-server/boot-precondition-error.mjs +1 -0
- package/esm/dev-server/boot-precondition-error.mjs.map +1 -1
- package/esm/dev-server/create-worker.mjs +17 -9
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/dev-agent-tooling.mjs +135 -0
- package/esm/dev-server/dev-agent-tooling.mjs.map +1 -0
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +8 -0
- package/esm/dev-server/development-server.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +4 -5
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +2 -3
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs +33 -0
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs.map +1 -0
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/default-health-checkers.mjs +31 -0
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +12 -6
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +16 -4
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +303 -0
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs +42 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +4 -3
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +3 -2
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +3 -2
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +3 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +7 -39
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/route-types-publisher.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/start-development-server.mjs.map +1 -1
- package/esm/dev-server/supervisor.mjs +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 +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +31 -38
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/container-key-missing-error.mjs +1 -0
- package/esm/errors/container-key-missing-error.mjs.map +1 -1
- package/esm/errors/error-codes.d.mts +660 -0
- package/esm/errors/error-codes.d.mts.map +1 -0
- package/esm/errors/error-codes.mjs +634 -0
- package/esm/errors/error-codes.mjs.map +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs.map +1 -1
- package/esm/errors/index.d.mts +3 -1
- package/esm/errors/index.mjs +3 -1
- package/esm/errors/unknown-locale-error.mjs +1 -0
- package/esm/errors/unknown-locale-error.mjs.map +1 -1
- package/esm/errors/warlock-error.d.mts +21 -0
- package/esm/errors/warlock-error.d.mts.map +1 -0
- package/esm/errors/warlock-error.mjs +22 -0
- package/esm/errors/warlock-error.mjs.map +1 -0
- package/esm/generations/add-command.action.mjs +22 -5
- 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/bull-board.feature.mjs +3 -2
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/mysql.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +7 -3
- package/esm/generations/features/notifications.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/shadcn.feature.mjs +1 -1
- package/esm/generations/features/shadcn.feature.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 +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +2 -2
- package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +2 -2
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
- package/esm/generations/features/sitemap.feature.mjs +3 -2
- package/esm/generations/features/sitemap.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 +11 -6
- package/esm/generations/features/test.feature.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/generation-fs.mjs +73 -0
- package/esm/generations/generation-fs.mjs.map +1 -0
- package/esm/generations/generation-run.mjs +185 -0
- package/esm/generations/generation-run.mjs.map +1 -0
- package/esm/generations/stubs.mjs +156 -14
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +10 -0
- package/esm/http/bounded-stream-queue.d.mts.map +1 -0
- package/esm/http/bounded-stream-queue.mjs +97 -0
- package/esm/http/bounded-stream-queue.mjs.map +1 -0
- package/esm/http/build-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +15 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +87 -0
- package/esm/http/conditional-request.d.mts.map +1 -0
- package/esm/http/conditional-request.mjs +121 -0
- package/esm/http/conditional-request.mjs.map +1 -0
- package/esm/http/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +12 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +3 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +26 -87
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +30 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +1 -0
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/escape-header-value.d.mts +17 -0
- package/esm/http/escape-header-value.d.mts.map +1 -0
- package/esm/http/escape-header-value.mjs +27 -0
- package/esm/http/escape-header-value.mjs.map +1 -0
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/flush-pending-cookies.mjs.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +9 -3
- package/esm/http/index.mjs +5 -2
- package/esm/http/lazy-static.mjs +194 -0
- package/esm/http/lazy-static.mjs.map +1 -0
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +17 -14
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +6 -4
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +26 -15
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +85 -6
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +6 -5
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +13 -11
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +23 -12
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +169 -81
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +50 -0
- package/esm/http/safe-redirect.d.mts.map +1 -0
- package/esm/http/safe-redirect.mjs +80 -0
- package/esm/http/safe-redirect.mjs.map +1 -0
- package/esm/http/serialized.d.mts +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +11 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +17 -7
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/stream-transport.mjs +4 -2
- package/esm/http/stream-transport.mjs.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +78 -39
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variant.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +13 -10
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +62 -25
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +78 -0
- package/esm/http/uploads/image-variant-cache-entries.mjs.map +1 -0
- package/esm/http/uploads/image-variant-cache.mjs +72 -30
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +9 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +4 -3
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.mjs +3 -2
- package/esm/http/uploads/image-variants-config-error.mjs.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +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/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 +9 -6
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/purge-image-variants.mjs +16 -16
- package/esm/http/uploads/purge-image-variants.mjs.map +1 -1
- package/esm/http/uploads/remote-variant-source.mjs +115 -0
- package/esm/http/uploads/remote-variant-source.mjs.map +1 -0
- package/esm/http/uploads/resolve-image-variant.d.mts +6 -9
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.mjs +10 -18
- package/esm/http/uploads/resolve-image-variant.mjs.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +7 -5
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
- package/esm/http/uploads/resolve-remote-image-variant.mjs +89 -0
- package/esm/http/uploads/resolve-remote-image-variant.mjs.map +1 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs +193 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -0
- package/esm/http/uploads/uploaded-file.controller.d.mts +9 -6
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +18 -9
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +2 -2
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +22 -16
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +38 -6
- package/esm/index.mjs +14 -3
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +6 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +2 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +21 -12
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/config.mjs +16 -1
- package/esm/mail/config.mjs.map +1 -1
- package/esm/mail/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +3 -2
- package/esm/mail/index.mjs +2 -2
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/net/index.d.mts +2 -0
- package/esm/net/index.mjs +3 -0
- package/esm/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/build-openapi-document.mjs +8 -5
- package/esm/openapi/build-openapi-document.mjs.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/error-responses.mjs +28 -2
- package/esm/openapi/error-responses.mjs.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-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.map +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -3
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/example-from-schema.mjs.map +1 -1
- package/esm/openapi/postman/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/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.map +1 -1
- package/esm/openapi/response-schemas.mjs.map +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -0
- 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 +23 -20
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +2 -1
- package/esm/production/assert-generated-imports.mjs.map +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +14 -5
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +2 -1
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +11 -31
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/restful/restful.mjs.map +1 -1
- package/esm/router/build-route-rate-limit.mjs.map +1 -1
- package/esm/router/dev-dispatch.mjs +31 -12
- package/esm/router/dev-dispatch.mjs.map +1 -1
- package/esm/router/index.d.mts +5 -2
- package/esm/router/index.mjs +3 -1
- package/esm/router/log-request-lifecycle.mjs.map +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.mjs.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +47 -0
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -0
- package/esm/router/resolve-route-validation.mjs +19 -0
- package/esm/router/resolve-route-validation.mjs.map +1 -0
- package/esm/router/route-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +30 -0
- package/esm/router/route-guard-names.mjs.map +1 -0
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +12 -0
- package/esm/router/route-name-taken-error.d.mts.map +1 -0
- package/esm/router/route-name-taken-error.mjs +18 -0
- package/esm/router/route-name-taken-error.mjs.map +1 -0
- package/esm/router/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +34 -17
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +74 -39
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +156 -37
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +38 -0
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -0
- package/esm/router/unguarded-route-diagnostics.mjs +95 -0
- package/esm/router/unguarded-route-diagnostics.mjs.map +1 -0
- package/esm/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +1 -1
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +1 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +24 -0
- package/esm/storage/local-disk-roots.mjs.map +1 -0
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +17 -4
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/storage.mjs +22 -0
- package/esm/storage/storage.mjs.map +1 -1
- package/esm/storage/types.d.mts +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +3 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.mjs +1 -0
- package/esm/storage/utils/storage-not-initialized-error.mjs.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +31 -0
- package/esm/tests/authenticated-test-client.d.mts.map +1 -0
- package/esm/tests/authenticated-test-client.mjs +40 -0
- package/esm/tests/authenticated-test-client.mjs.map +1 -0
- package/esm/tests/factories.d.mts +74 -0
- package/esm/tests/factories.d.mts.map +1 -0
- package/esm/tests/factories.mjs +105 -0
- package/esm/tests/factories.mjs.map +1 -0
- package/esm/tests/fakes/cache-fake.d.mts +34 -0
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -0
- package/esm/tests/fakes/cache-fake.mjs +79 -0
- package/esm/tests/fakes/cache-fake.mjs.map +1 -0
- package/esm/tests/fakes/clock-fake.d.mts +37 -0
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -0
- package/esm/tests/fakes/clock-fake.mjs +69 -0
- package/esm/tests/fakes/clock-fake.mjs.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts +12 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.mjs +20 -0
- package/esm/tests/fakes/fake-assertion-error.mjs.map +1 -0
- package/esm/tests/fakes/ids-fake.d.mts +23 -0
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -0
- package/esm/tests/fakes/ids-fake.mjs +57 -0
- package/esm/tests/fakes/ids-fake.mjs.map +1 -0
- package/esm/tests/fakes/index.d.mts +9 -0
- package/esm/tests/fakes/index.mjs +10 -0
- package/esm/tests/fakes/mail-fake.d.mts +49 -0
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -0
- package/esm/tests/fakes/mail-fake.mjs +111 -0
- package/esm/tests/fakes/mail-fake.mjs.map +1 -0
- package/esm/tests/fakes/queue-fake.d.mts +56 -0
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -0
- package/esm/tests/fakes/queue-fake.mjs +134 -0
- package/esm/tests/fakes/queue-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +35 -0
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -0
- package/esm/tests/fakes/storage-fake.mjs +122 -0
- package/esm/tests/fakes/storage-fake.mjs.map +1 -0
- package/esm/tests/fakes/test-fakes.d.mts +38 -0
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -0
- package/esm/tests/fakes/test-fakes.mjs +90 -0
- package/esm/tests/fakes/test-fakes.mjs.map +1 -0
- package/esm/tests/index.d.mts +15 -2
- package/esm/tests/index.mjs +15 -2
- package/esm/tests/snapshot-response.d.mts +33 -0
- package/esm/tests/snapshot-response.d.mts.map +1 -0
- package/esm/tests/snapshot-response.mjs +42 -0
- package/esm/tests/snapshot-response.mjs.map +1 -0
- package/esm/tests/start-http-development-server.d.mts +25 -5
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +41 -8
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +28 -10
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-helpers.mjs +40 -27
- package/esm/tests/test-helpers.mjs.map +1 -1
- package/esm/tests/test-http-server.d.mts +66 -0
- package/esm/tests/test-http-server.d.mts.map +1 -0
- package/esm/tests/test-http-server.mjs +119 -0
- package/esm/tests/test-http-server.mjs.map +1 -0
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +17 -7
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +12 -4
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +26 -0
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs +60 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +43 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs +72 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs.map +1 -0
- package/esm/tooling/agents-md/index.mjs +7 -0
- package/esm/tooling/agents-md/installed-skills.d.mts +34 -0
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -0
- package/esm/tooling/agents-md/installed-skills.mjs +74 -0
- package/esm/tooling/agents-md/installed-skills.mjs.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts +34 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.mjs +195 -0
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts +38 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.mjs +49 -0
- package/esm/tooling/agents-md/write-agents-md.mjs.map +1 -0
- package/esm/tooling/board/board-message.d.mts +29 -0
- package/esm/tooling/board/board-message.d.mts.map +1 -0
- package/esm/tooling/board/board-message.mjs +86 -0
- package/esm/tooling/board/board-message.mjs.map +1 -0
- package/esm/tooling/board/board.d.mts +121 -0
- package/esm/tooling/board/board.d.mts.map +1 -0
- package/esm/tooling/board/board.mjs +407 -0
- package/esm/tooling/board/board.mjs.map +1 -0
- package/esm/tooling/board/board.types.d.mts +81 -0
- package/esm/tooling/board/board.types.d.mts.map +1 -0
- package/esm/tooling/board/board.types.mjs +54 -0
- package/esm/tooling/board/board.types.mjs.map +1 -0
- package/esm/tooling/check/changed-files.d.mts +31 -0
- package/esm/tooling/check/changed-files.d.mts.map +1 -0
- package/esm/tooling/check/changed-files.mjs +73 -0
- package/esm/tooling/check/changed-files.mjs.map +1 -0
- package/esm/tooling/check/check-report.types.d.mts +67 -0
- package/esm/tooling/check/check-report.types.d.mts.map +1 -0
- package/esm/tooling/check/check-report.types.mjs +37 -0
- package/esm/tooling/check/check-report.types.mjs.map +1 -0
- package/esm/tooling/check/code-style-conventions.mjs +106 -0
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -0
- package/esm/tooling/check/conventions-step.d.mts +32 -0
- package/esm/tooling/check/conventions-step.d.mts.map +1 -0
- package/esm/tooling/check/conventions-step.mjs +173 -0
- package/esm/tooling/check/conventions-step.mjs.map +1 -0
- package/esm/tooling/check/environment-step.d.mts +16 -0
- package/esm/tooling/check/environment-step.d.mts.map +1 -0
- package/esm/tooling/check/environment-step.mjs +78 -0
- package/esm/tooling/check/environment-step.mjs.map +1 -0
- package/esm/tooling/check/index.mjs +10 -0
- package/esm/tooling/check/lint-step.d.mts +18 -0
- package/esm/tooling/check/lint-step.d.mts.map +1 -0
- package/esm/tooling/check/lint-step.mjs +112 -0
- package/esm/tooling/check/lint-step.mjs.map +1 -0
- package/esm/tooling/check/request-input.mjs +132 -0
- package/esm/tooling/check/request-input.mjs.map +1 -0
- package/esm/tooling/check/run-check.d.mts +43 -0
- package/esm/tooling/check/run-check.d.mts.map +1 -0
- package/esm/tooling/check/run-check.mjs +192 -0
- package/esm/tooling/check/run-check.mjs.map +1 -0
- package/esm/tooling/check/run-tests.d.mts +55 -0
- package/esm/tooling/check/run-tests.d.mts.map +1 -0
- package/esm/tooling/check/run-tests.mjs +93 -0
- package/esm/tooling/check/run-tests.mjs.map +1 -0
- package/esm/tooling/check/security-conventions.mjs +650 -0
- package/esm/tooling/check/security-conventions.mjs.map +1 -0
- package/esm/tooling/check/source-ast.mjs +155 -0
- package/esm/tooling/check/source-ast.mjs.map +1 -0
- package/esm/tooling/check/source-files.mjs +27 -0
- package/esm/tooling/check/source-files.mjs.map +1 -0
- package/esm/tooling/check/tests-step.d.mts +33 -0
- package/esm/tooling/check/tests-step.d.mts.map +1 -0
- package/esm/tooling/check/tests-step.mjs +177 -0
- package/esm/tooling/check/tests-step.mjs.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts +43 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.mjs +67 -0
- package/esm/tooling/dev-state/dev-server-state.mjs.map +1 -0
- package/esm/tooling/devtools/devtools-client.d.mts +100 -0
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -0
- package/esm/tooling/devtools/devtools-client.mjs +155 -0
- package/esm/tooling/devtools/devtools-client.mjs.map +1 -0
- package/esm/tooling/generate/generation.d.mts +90 -0
- package/esm/tooling/generate/generation.d.mts.map +1 -0
- package/esm/tooling/generate/generation.mjs +127 -0
- package/esm/tooling/generate/generation.mjs.map +1 -0
- package/esm/tooling/generate/generator-spec.d.mts +57 -0
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -0
- package/esm/tooling/generate/generator-spec.mjs +102 -0
- package/esm/tooling/generate/generator-spec.mjs.map +1 -0
- package/esm/tooling/generate/index.mjs +6 -0
- package/esm/tooling/generate/project-files.mjs +121 -0
- package/esm/tooling/generate/project-files.mjs.map +1 -0
- package/esm/tooling/generate/run-cli.d.mts +43 -0
- package/esm/tooling/generate/run-cli.d.mts.map +1 -0
- package/esm/tooling/generate/run-cli.mjs +93 -0
- package/esm/tooling/generate/run-cli.mjs.map +1 -0
- package/esm/tooling/generate/unified-diff.d.mts +40 -0
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -0
- package/esm/tooling/generate/unified-diff.mjs +161 -0
- package/esm/tooling/generate/unified-diff.mjs.map +1 -0
- package/esm/tooling/index.d.mts +42 -0
- package/esm/tooling/index.mjs +45 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +23 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs +63 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs.map +1 -0
- package/esm/tooling/inspect/collect-config.mjs +77 -0
- package/esm/tooling/inspect/collect-config.mjs.map +1 -0
- package/esm/tooling/inspect/collect-models.d.mts +10 -0
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-models.mjs +154 -0
- package/esm/tooling/inspect/collect-models.mjs.map +1 -0
- package/esm/tooling/inspect/collect-packages.d.mts +9 -0
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-packages.mjs +157 -0
- package/esm/tooling/inspect/collect-packages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-pages.mjs +108 -0
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-routes.mjs +168 -0
- package/esm/tooling/inspect/collect-routes.mjs.map +1 -0
- package/esm/tooling/inspect/event-recorder.d.mts +37 -0
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -0
- package/esm/tooling/inspect/event-recorder.mjs +91 -0
- package/esm/tooling/inspect/event-recorder.mjs.map +1 -0
- package/esm/tooling/inspect/index.d.mts +8 -0
- package/esm/tooling/inspect/index.mjs +7 -0
- package/esm/tooling/inspect/inspect-app.d.mts +62 -0
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-app.mjs +92 -0
- package/esm/tooling/inspect/inspect-app.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts +14 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs +463 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts +228 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.mjs +33 -0
- package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts +29 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.mjs +75 -0
- package/esm/tooling/mcp/create-mcp-context.mjs.map +1 -0
- package/esm/tooling/mcp/db-schema.d.mts +50 -0
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -0
- package/esm/tooling/mcp/db-schema.mjs +56 -0
- package/esm/tooling/mcp/db-schema.mjs.map +1 -0
- package/esm/tooling/mcp/docs-search.d.mts +77 -0
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -0
- package/esm/tooling/mcp/docs-search.mjs +178 -0
- package/esm/tooling/mcp/docs-search.mjs.map +1 -0
- package/esm/tooling/mcp/index.mjs +9 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts +61 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/load-ai-tools.mjs +45 -0
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -0
- package/esm/tooling/mcp/mcp-tools.d.mts +70 -0
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/mcp-tools.mjs +514 -0
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts +63 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.mjs +126 -0
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -0
- package/esm/tooling/mcp/tool-input.d.mts +75 -0
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -0
- package/esm/tooling/mcp/tool-input.mjs +72 -0
- package/esm/tooling/mcp/tool-input.mjs.map +1 -0
- package/esm/tooling/problem.d.mts +55 -0
- package/esm/tooling/problem.d.mts.map +1 -0
- package/esm/tooling/problem.mjs +28 -0
- package/esm/tooling/problem.mjs.map +1 -0
- package/esm/tooling/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +85 -0
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -0
- package/esm/tooling/trace/trace-report.types.mjs +7 -0
- package/esm/tooling/trace/trace-report.types.mjs.map +1 -0
- package/esm/tooling/trace/trace-request.d.mts +90 -0
- package/esm/tooling/trace/trace-request.d.mts.map +1 -0
- package/esm/tooling/trace/trace-request.mjs +241 -0
- package/esm/tooling/trace/trace-request.mjs.map +1 -0
- package/esm/tooling/typecheck/index.mjs +3 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts +26 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -0
- package/esm/tooling/typecheck/run-typecheck.mjs +90 -0
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -0
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/upgrade/codemods/head-viewport.mjs +46 -0
- package/esm/upgrade/codemods/head-viewport.mjs.map +1 -0
- package/esm/upgrade/codemods/helpers.mjs +81 -0
- package/esm/upgrade/codemods/helpers.mjs.map +1 -0
- package/esm/upgrade/codemods/index.mjs +34 -0
- package/esm/upgrade/codemods/index.mjs.map +1 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs +57 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -0
- package/esm/upgrade/codemods/package-json.mjs +122 -0
- package/esm/upgrade/codemods/package-json.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +82 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -0
- package/esm/upgrade/codemods/review-sites.mjs +262 -0
- package/esm/upgrade/codemods/review-sites.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +119 -0
- package/esm/upgrade/diff.mjs.map +1 -0
- package/esm/upgrade/format-upgrade-report.mjs +32 -0
- package/esm/upgrade/format-upgrade-report.mjs.map +1 -0
- package/esm/upgrade/load-ts-morph.mjs +49 -0
- package/esm/upgrade/load-ts-morph.mjs.map +1 -0
- package/esm/upgrade/notes.mjs +16 -0
- package/esm/upgrade/notes.mjs.map +1 -0
- package/esm/upgrade/run-upgrade.mjs +246 -0
- package/esm/upgrade/run-upgrade.mjs.map +1 -0
- package/esm/upgrade/upgrade-command.action.mjs +37 -0
- package/esm/upgrade/upgrade-command.action.mjs.map +1 -0
- package/esm/upgrade/version.mjs +39 -0
- package/esm/upgrade/version.mjs.map +1 -0
- package/esm/use-cases/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +35 -0
- package/esm/utils/clock.d.mts.map +1 -0
- package/esm/utils/clock.mjs +27 -0
- package/esm/utils/clock.mjs.map +1 -0
- package/esm/utils/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +35 -0
- package/esm/utils/ids.d.mts.map +1 -0
- package/esm/utils/ids.mjs +33 -0
- package/esm/utils/ids.mjs.map +1 -0
- package/esm/utils/index.d.mts +5 -1
- package/esm/utils/index.mjs +4 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +60 -0
- package/esm/utils/runtime.d.mts.map +1 -0
- package/esm/utils/runtime.mjs +85 -0
- package/esm/utils/runtime.mjs.map +1 -0
- package/esm/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +6 -2
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +61 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +21 -4
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +15 -0
- package/esm/validation/validation-failure-status.mjs.map +1 -0
- package/esm/validation/validators/file-validator.d.mts +2 -20
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/bundle-config.mjs +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +31 -6
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +2 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/llms-full.txt +3211 -731
- package/llms.txt +16 -6
- package/package.json +47 -15
- package/schemas/inspect-report.schema.json +554 -0
- package/skills/README.md +9 -0
- package/skills/add-connector/SKILL.md +26 -38
- package/skills/benchmark-code/SKILL.md +30 -24
- package/skills/build-restful/SKILL.md +14 -14
- package/skills/build-url/SKILL.md +18 -18
- package/skills/configure-app/SKILL.md +107 -14
- package/skills/create-controller/SKILL.md +25 -12
- package/skills/create-module/SKILL.md +10 -3
- package/skills/define-resource/SKILL.md +32 -29
- package/skills/encrypt-data/SKILL.md +21 -19
- package/skills/generate-openapi/SKILL.md +50 -24
- package/skills/hash-password/SKILL.md +2 -2
- package/skills/health-checks/SKILL.md +24 -7
- package/skills/index.md +11 -4
- package/skills/lower-stage3-decorators/SKILL.md +4 -4
- package/skills/make-endpoint/SKILL.md +110 -0
- package/skills/model-factories/SKILL.md +92 -0
- package/skills/process-image/SKILL.md +32 -30
- package/skills/register-route/SKILL.md +109 -10
- package/skills/report-framework-issue.md +154 -0
- package/skills/request-memo/SKILL.md +1 -1
- package/skills/request-tracing/SKILL.md +4 -1
- package/skills/resolve-path/SKILL.md +45 -44
- package/skills/retry-operation/SKILL.md +20 -11
- package/skills/run-app/SKILL.md +107 -22
- package/skills/send-response/SKILL.md +179 -14
- package/skills/store-file/SKILL.md +93 -53
- package/skills/test-fakes/SKILL.md +123 -0
- package/skills/test-http/SKILL.md +125 -21
- package/skills/test-service/SKILL.md +41 -1
- package/skills/update-packages/SKILL.md +29 -18
- package/skills/upgrade-from-5-29/SKILL.md +454 -0
- package/skills/upload-file/SKILL.md +31 -33
- package/skills/use-app-context/SKILL.md +38 -31
- package/skills/use-middleware/SKILL.md +45 -25
- package/skills/use-model-transformers/SKILL.md +37 -28
- package/skills/use-repository/SKILL.md +2 -2
- package/skills/validate-input/SKILL.md +72 -28
- package/skills/warlock-agents-md/SKILL.md +96 -0
- package/skills/warlock-board/SKILL.md +123 -0
- package/skills/warlock-check/SKILL.md +133 -0
- package/skills/warlock-conventions/SKILL.md +115 -0
- package/skills/warlock-doctor/SKILL.md +55 -22
- package/skills/warlock-inspect/SKILL.md +134 -0
- package/skills/warlock-mcp/SKILL.md +120 -0
- package/skills/warlock-routes/SKILL.md +18 -11
- package/skills/warlock-trace/SKILL.md +81 -0
- package/skills/wire-socket/SKILL.md +8 -8
- package/skills/write-seeder/SKILL.md +46 -32
- package/skills/write-use-case/SKILL.md +40 -27
- package/esm/http/uploads/matches-if-none-match.mjs +0 -13
- package/esm/http/uploads/matches-if-none-match.mjs.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { variantCacheGenerations } from "./image-variant-cache-entries.mjs";
|
|
2
|
+
import { log } from "@warlock.js/logger";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
|
|
5
|
+
//#region ../../packages/core/src/http/uploads/trim-image-variant-cache.ts
|
|
6
|
+
const SWEEP_INTERVAL_MS = 6e4;
|
|
7
|
+
/**
|
|
8
|
+
* A writer's temporary file older than this is an orphan left by a crashed
|
|
9
|
+
* write and is removed by the sweep. Younger ones are never touched: a writer
|
|
10
|
+
* may still be renaming them into place.
|
|
11
|
+
*/
|
|
12
|
+
const ORPHAN_TEMP_AGE_MS = 36e5;
|
|
13
|
+
/**
|
|
14
|
+
* A generation directory left without derivatives is removed only when it
|
|
15
|
+
* was last changed longer ago than this, so a directory a writer has just
|
|
16
|
+
* created for its first derivative survives. The writers also retry once when
|
|
17
|
+
* their directory vanishes between `mkdir` and the rename.
|
|
18
|
+
*/
|
|
19
|
+
const EMPTY_GENERATION_GRACE_MS = 3e5;
|
|
20
|
+
const caches = /* @__PURE__ */ new Map();
|
|
21
|
+
function cacheState(directory) {
|
|
22
|
+
let state = caches.get(directory);
|
|
23
|
+
if (!state) {
|
|
24
|
+
state = {
|
|
25
|
+
lastSweep: 0,
|
|
26
|
+
lastWalk: 0,
|
|
27
|
+
bytes: 0,
|
|
28
|
+
sizes: /* @__PURE__ */ new Map(),
|
|
29
|
+
keep: /* @__PURE__ */ new Set(),
|
|
30
|
+
reconciled: false
|
|
31
|
+
};
|
|
32
|
+
caches.set(directory, state);
|
|
33
|
+
}
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
function errorCode(error) {
|
|
37
|
+
return error?.code;
|
|
38
|
+
}
|
|
39
|
+
/** Age is measured from generation; hits do not extend a derivative's life. */
|
|
40
|
+
async function freshImageVariant(target, maxAgeSeconds) {
|
|
41
|
+
try {
|
|
42
|
+
const stats = await fs.stat(target);
|
|
43
|
+
return stats.isFile() && Date.now() - stats.mtimeMs < maxAgeSeconds * 1e3;
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (errorCode(error) === "ENOENT") return false;
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether a scheduled check must walk the cache. It may skip only when a walk
|
|
51
|
+
* has already reconciled the byte estimate, the cache is within its byte
|
|
52
|
+
* budget, nothing retained has expired (new writes are always younger than
|
|
53
|
+
* the oldest retained derivative), and a walk ran within the last
|
|
54
|
+
* `maxCacheAge`, which also bounds how long an orphaned temporary can linger.
|
|
55
|
+
*/
|
|
56
|
+
function sweepIsDue(state, images) {
|
|
57
|
+
const maxAgeMs = images.maxCacheAge * 1e3;
|
|
58
|
+
const now = Date.now();
|
|
59
|
+
return !state.reconciled || state.bytes > images.maxCacheBytes || state.oldestMtimeMs !== void 0 && state.oldestMtimeMs <= now - maxAgeMs || now - state.lastWalk >= maxAgeMs;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Schedule housekeeping only after a write. Hits do no cache-directory I/O.
|
|
63
|
+
* Writes update a running byte estimate; at most one background check per
|
|
64
|
+
* minute walks the cache, and only when it may have something to reclaim
|
|
65
|
+
* (see {@link sweepIsDue}).
|
|
66
|
+
*/
|
|
67
|
+
function scheduleImageVariantCacheTrim(images, target) {
|
|
68
|
+
const state = cacheState(images.cacheDirectory);
|
|
69
|
+
fs.stat(target).then((stats) => {
|
|
70
|
+
state.bytes += stats.size - (state.sizes.get(target) ?? 0);
|
|
71
|
+
state.sizes.set(target, stats.size);
|
|
72
|
+
state.oldestMtimeMs = Math.min(state.oldestMtimeMs ?? stats.mtimeMs, stats.mtimeMs);
|
|
73
|
+
if (state.timer) return;
|
|
74
|
+
const delay = Math.max(0, state.lastSweep + SWEEP_INTERVAL_MS - Date.now());
|
|
75
|
+
state.timer = setTimeout(() => {
|
|
76
|
+
state.timer = void 0;
|
|
77
|
+
if (!sweepIsDue(state, images)) {
|
|
78
|
+
state.lastSweep = Date.now();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
trimImageVariantCache(images, target).catch((error) => {
|
|
82
|
+
log.warn("uploads", "image-variants", error);
|
|
83
|
+
});
|
|
84
|
+
}, delay);
|
|
85
|
+
state.timer.unref();
|
|
86
|
+
}).catch((error) => {
|
|
87
|
+
if (errorCode(error) !== "ENOENT") log.warn("uploads", "image-variants", error);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** Remove a temporary only when it is a regular file older than {@link ORPHAN_TEMP_AGE_MS}. */
|
|
91
|
+
async function removeOrphanTemporary(target) {
|
|
92
|
+
try {
|
|
93
|
+
const stats = await fs.lstat(target);
|
|
94
|
+
if (stats.isFile() && Date.now() - stats.mtimeMs > 36e5) await fs.rm(target, { force: true });
|
|
95
|
+
} catch (error) {
|
|
96
|
+
if (errorCode(error) !== "ENOENT") throw error;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Remove a generation left without derivatives: its manifest, then the
|
|
101
|
+
* directory itself with a non-recursive `rmdir`, so anything a writer has put
|
|
102
|
+
* there since the walk keeps the directory in place.
|
|
103
|
+
*/
|
|
104
|
+
async function removeEmptyGeneration(generation) {
|
|
105
|
+
if (generation.derivatives > 0) return;
|
|
106
|
+
if (Date.now() - generation.mtimeMs <= 3e5) return;
|
|
107
|
+
if (generation.manifest) await fs.rm(generation.manifest, { force: true });
|
|
108
|
+
try {
|
|
109
|
+
if (!(await fs.lstat(generation.directory)).isDirectory()) return;
|
|
110
|
+
await fs.rmdir(generation.directory);
|
|
111
|
+
} catch (error) {
|
|
112
|
+
const code = errorCode(error);
|
|
113
|
+
if (code !== "ENOENT" && code !== "ENOTEMPTY" && code !== "EEXIST") throw error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Join an in-flight sweep rather than queueing another walk. Retain the file
|
|
118
|
+
* about to be served, even if it alone exceeds the byte budget. Only paths in
|
|
119
|
+
* the generated cache layout are touched and symlinks are never followed:
|
|
120
|
+
* expired and oldest derivatives are evicted, writer temporaries older than
|
|
121
|
+
* {@link ORPHAN_TEMP_AGE_MS} are removed, and a generation directory left
|
|
122
|
+
* without derivatives loses its manifest and the directory itself once it is
|
|
123
|
+
* older than {@link EMPTY_GENERATION_GRACE_MS}. The cache root, shard and
|
|
124
|
+
* source directories, user folders and unrelated files stay in place.
|
|
125
|
+
*/
|
|
126
|
+
async function trimImageVariantCache(images, keep) {
|
|
127
|
+
const state = cacheState(images.cacheDirectory);
|
|
128
|
+
state.keep.add(keep);
|
|
129
|
+
if (state.sweep) return state.sweep;
|
|
130
|
+
state.lastSweep = Date.now();
|
|
131
|
+
state.lastWalk = state.lastSweep;
|
|
132
|
+
const sweep = (async () => {
|
|
133
|
+
const files = [];
|
|
134
|
+
const generations = [];
|
|
135
|
+
for await (const found of variantCacheGenerations(images.cacheDirectory)) {
|
|
136
|
+
let mtimeMs;
|
|
137
|
+
try {
|
|
138
|
+
mtimeMs = (await fs.lstat(found.directory)).mtimeMs;
|
|
139
|
+
} catch (error) {
|
|
140
|
+
if (errorCode(error) === "ENOENT") continue;
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
const generation = {
|
|
144
|
+
directory: found.directory,
|
|
145
|
+
mtimeMs,
|
|
146
|
+
derivatives: 0
|
|
147
|
+
};
|
|
148
|
+
generations.push(generation);
|
|
149
|
+
for (const entry of found.entries) if (entry.type === "manifest") generation.manifest = entry.target;
|
|
150
|
+
else if (entry.type === "temporary") await removeOrphanTemporary(entry.target);
|
|
151
|
+
else try {
|
|
152
|
+
const stats = await fs.stat(entry.target);
|
|
153
|
+
files.push({
|
|
154
|
+
target: entry.target,
|
|
155
|
+
size: stats.size,
|
|
156
|
+
mtimeMs: stats.mtimeMs,
|
|
157
|
+
generation
|
|
158
|
+
});
|
|
159
|
+
generation.derivatives += 1;
|
|
160
|
+
} catch (error) {
|
|
161
|
+
if (errorCode(error) !== "ENOENT") throw error;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
state.sizes = new Map(files.map((file) => [file.target, file.size]));
|
|
165
|
+
state.bytes = files.reduce((sum, file) => sum + file.size, 0);
|
|
166
|
+
const cutoff = Date.now() - images.maxCacheAge * 1e3;
|
|
167
|
+
let oldestMtimeMs;
|
|
168
|
+
for (const file of files.sort((a, b) => a.mtimeMs - b.mtimeMs)) {
|
|
169
|
+
if (!state.keep.has(file.target) && (file.mtimeMs <= cutoff || state.bytes > images.maxCacheBytes)) {
|
|
170
|
+
await fs.rm(file.target, { force: true });
|
|
171
|
+
state.bytes -= file.size;
|
|
172
|
+
state.sizes.delete(file.target);
|
|
173
|
+
file.generation.derivatives -= 1;
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
oldestMtimeMs = Math.min(oldestMtimeMs ?? file.mtimeMs, file.mtimeMs);
|
|
177
|
+
}
|
|
178
|
+
for (const generation of generations) await removeEmptyGeneration(generation);
|
|
179
|
+
state.oldestMtimeMs = oldestMtimeMs;
|
|
180
|
+
state.reconciled = true;
|
|
181
|
+
})();
|
|
182
|
+
state.sweep = sweep;
|
|
183
|
+
try {
|
|
184
|
+
await sweep;
|
|
185
|
+
} finally {
|
|
186
|
+
state.sweep = void 0;
|
|
187
|
+
state.keep.clear();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
export { EMPTY_GENERATION_GRACE_MS, ORPHAN_TEMP_AGE_MS, freshImageVariant, scheduleImageVariantCacheTrim, trimImageVariantCache };
|
|
193
|
+
//# sourceMappingURL=trim-image-variant-cache.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim-image-variant-cache.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/http/uploads/trim-image-variant-cache.ts"],"sourcesContent":["import { log } from \"@warlock.js/logger\";\nimport fs from \"node:fs/promises\";\nimport type { ResolvedImageVariantsConfig } from \"./image-variant-types\";\nimport { variantCacheGenerations } from \"./image-variant-cache-entries\";\n\nconst SWEEP_INTERVAL_MS = 60_000;\n\n/**\n * A writer's temporary file older than this is an orphan left by a crashed\n * write and is removed by the sweep. Younger ones are never touched: a writer\n * may still be renaming them into place.\n */\nexport const ORPHAN_TEMP_AGE_MS = 60 * 60_000;\n\n/**\n * A generation directory left without derivatives is removed only when it\n * was last changed longer ago than this, so a directory a writer has just\n * created for its first derivative survives. The writers also retry once when\n * their directory vanishes between `mkdir` and the rename.\n */\nexport const EMPTY_GENERATION_GRACE_MS = 5 * 60_000;\n\ntype CacheState = {\n sweep?: Promise<void>;\n timer?: ReturnType<typeof setTimeout>;\n /** When the last scheduled check ran, whether or not it walked the cache. */\n lastSweep: number;\n /** When the cache was last walked. */\n lastWalk: number;\n bytes: number;\n sizes: Map<string, number>;\n keep: Set<string>;\n /** True once a walk has reconciled `bytes` with the disk. */\n reconciled: boolean;\n /** The oldest retained derivative's mtime; undefined when none is known. */\n oldestMtimeMs?: number;\n};\nconst caches = new Map<string, CacheState>();\nfunction cacheState(directory: string): CacheState {\n let state = caches.get(directory);\n if (!state) {\n state = {\n lastSweep: 0,\n lastWalk: 0,\n bytes: 0,\n sizes: new Map(),\n keep: new Set(),\n reconciled: false,\n };\n caches.set(directory, state);\n }\n return state;\n}\n\nfunction errorCode(error: unknown): string | undefined {\n return (error as NodeJS.ErrnoException | undefined)?.code;\n}\n\n/** Age is measured from generation; hits do not extend a derivative's life. */\nexport async function freshImageVariant(target: string, maxAgeSeconds: number): Promise<boolean> {\n try {\n const stats = await fs.stat(target);\n return stats.isFile() && Date.now() - stats.mtimeMs < maxAgeSeconds * 1000;\n } catch (error) {\n if (errorCode(error) === \"ENOENT\") return false;\n throw error;\n }\n}\n\n/**\n * Whether a scheduled check must walk the cache. It may skip only when a walk\n * has already reconciled the byte estimate, the cache is within its byte\n * budget, nothing retained has expired (new writes are always younger than\n * the oldest retained derivative), and a walk ran within the last\n * `maxCacheAge`, which also bounds how long an orphaned temporary can linger.\n */\nfunction sweepIsDue(state: CacheState, images: ResolvedImageVariantsConfig): boolean {\n const maxAgeMs = images.maxCacheAge * 1000;\n const now = Date.now();\n return (\n !state.reconciled ||\n state.bytes > images.maxCacheBytes ||\n (state.oldestMtimeMs !== undefined && state.oldestMtimeMs <= now - maxAgeMs) ||\n now - state.lastWalk >= maxAgeMs\n );\n}\n\n/**\n * Schedule housekeeping only after a write. Hits do no cache-directory I/O.\n * Writes update a running byte estimate; at most one background check per\n * minute walks the cache, and only when it may have something to reclaim\n * (see {@link sweepIsDue}).\n */\nexport function scheduleImageVariantCacheTrim(\n images: ResolvedImageVariantsConfig,\n target: string,\n): void {\n const state = cacheState(images.cacheDirectory);\n void fs\n .stat(target)\n .then((stats) => {\n state.bytes += stats.size - (state.sizes.get(target) ?? 0);\n state.sizes.set(target, stats.size);\n state.oldestMtimeMs = Math.min(state.oldestMtimeMs ?? stats.mtimeMs, stats.mtimeMs);\n if (state.timer) return;\n const delay = Math.max(0, state.lastSweep + SWEEP_INTERVAL_MS - Date.now());\n state.timer = setTimeout(() => {\n state.timer = undefined;\n if (!sweepIsDue(state, images)) {\n state.lastSweep = Date.now();\n return;\n }\n void trimImageVariantCache(images, target).catch((error: unknown) => {\n log.warn(\"uploads\", \"image-variants\", error);\n });\n }, delay);\n state.timer.unref();\n })\n .catch((error: unknown) => {\n if (errorCode(error) !== \"ENOENT\") log.warn(\"uploads\", \"image-variants\", error);\n });\n}\n\ntype Derivative = { target: string; size: number; mtimeMs: number; generation: Generation };\ntype Generation = {\n directory: string;\n /** The directory's mtime before this sweep removed anything from it. */\n mtimeMs: number;\n derivatives: number;\n manifest?: string;\n};\n\n/** Remove a temporary only when it is a regular file older than {@link ORPHAN_TEMP_AGE_MS}. */\nasync function removeOrphanTemporary(target: string): Promise<void> {\n try {\n const stats = await fs.lstat(target);\n if (stats.isFile() && Date.now() - stats.mtimeMs > ORPHAN_TEMP_AGE_MS) {\n await fs.rm(target, { force: true });\n }\n } catch (error) {\n if (errorCode(error) !== \"ENOENT\") throw error;\n }\n}\n\n/**\n * Remove a generation left without derivatives: its manifest, then the\n * directory itself with a non-recursive `rmdir`, so anything a writer has put\n * there since the walk keeps the directory in place.\n */\nasync function removeEmptyGeneration(generation: Generation): Promise<void> {\n if (generation.derivatives > 0) return;\n if (Date.now() - generation.mtimeMs <= EMPTY_GENERATION_GRACE_MS) return;\n if (generation.manifest) await fs.rm(generation.manifest, { force: true });\n try {\n if (!(await fs.lstat(generation.directory)).isDirectory()) return;\n await fs.rmdir(generation.directory);\n } catch (error) {\n const code = errorCode(error);\n if (code !== \"ENOENT\" && code !== \"ENOTEMPTY\" && code !== \"EEXIST\") throw error;\n }\n}\n\n/**\n * Join an in-flight sweep rather than queueing another walk. Retain the file\n * about to be served, even if it alone exceeds the byte budget. Only paths in\n * the generated cache layout are touched and symlinks are never followed:\n * expired and oldest derivatives are evicted, writer temporaries older than\n * {@link ORPHAN_TEMP_AGE_MS} are removed, and a generation directory left\n * without derivatives loses its manifest and the directory itself once it is\n * older than {@link EMPTY_GENERATION_GRACE_MS}. The cache root, shard and\n * source directories, user folders and unrelated files stay in place.\n */\nexport async function trimImageVariantCache(\n images: ResolvedImageVariantsConfig,\n keep: string,\n): Promise<void> {\n const state = cacheState(images.cacheDirectory);\n state.keep.add(keep);\n if (state.sweep) return state.sweep;\n state.lastSweep = Date.now();\n state.lastWalk = state.lastSweep;\n const sweep = (async () => {\n const files: Derivative[] = [];\n const generations: Generation[] = [];\n for await (const found of variantCacheGenerations(images.cacheDirectory)) {\n let mtimeMs: number;\n try {\n mtimeMs = (await fs.lstat(found.directory)).mtimeMs;\n } catch (error) {\n if (errorCode(error) === \"ENOENT\") continue;\n throw error;\n }\n const generation: Generation = { directory: found.directory, mtimeMs, derivatives: 0 };\n generations.push(generation);\n for (const entry of found.entries) {\n if (entry.type === \"manifest\") {\n generation.manifest = entry.target;\n } else if (entry.type === \"temporary\") {\n await removeOrphanTemporary(entry.target);\n } else {\n try {\n const stats = await fs.stat(entry.target);\n files.push({\n target: entry.target,\n size: stats.size,\n mtimeMs: stats.mtimeMs,\n generation,\n });\n generation.derivatives += 1;\n } catch (error) {\n if (errorCode(error) !== \"ENOENT\") throw error;\n }\n }\n }\n }\n state.sizes = new Map(files.map((file) => [file.target, file.size]));\n state.bytes = files.reduce((sum, file) => sum + file.size, 0);\n const cutoff = Date.now() - images.maxCacheAge * 1000;\n let oldestMtimeMs: number | undefined;\n for (const file of files.sort((a, b) => a.mtimeMs - b.mtimeMs)) {\n if (\n !state.keep.has(file.target) &&\n (file.mtimeMs <= cutoff || state.bytes > images.maxCacheBytes)\n ) {\n await fs.rm(file.target, { force: true });\n state.bytes -= file.size;\n state.sizes.delete(file.target);\n file.generation.derivatives -= 1;\n continue;\n }\n oldestMtimeMs = Math.min(oldestMtimeMs ?? file.mtimeMs, file.mtimeMs);\n }\n for (const generation of generations) await removeEmptyGeneration(generation);\n state.oldestMtimeMs = oldestMtimeMs;\n state.reconciled = true;\n })();\n state.sweep = sweep;\n try {\n await sweep;\n } finally {\n state.sweep = undefined;\n state.keep.clear();\n }\n}\n"],"mappings":";;;;;AAKA,MAAM,oBAAoB;;;;;;AAO1B,MAAa,qBAAqB;;;;;;;AAQlC,MAAa,4BAA4B;AAiBzC,MAAM,yBAAS,IAAI,IAAwB;AAC3C,SAAS,WAAW,WAA+B;CACjD,IAAI,QAAQ,OAAO,IAAI,SAAS;CAChC,IAAI,CAAC,OAAO;EACV,QAAQ;GACN,WAAW;GACX,UAAU;GACV,OAAO;GACP,uBAAO,IAAI,IAAI;GACf,sBAAM,IAAI,IAAI;GACd,YAAY;EACd;EACA,OAAO,IAAI,WAAW,KAAK;CAC7B;CACA,OAAO;AACT;AAEA,SAAS,UAAU,OAAoC;CACrD,OAAQ,OAA6C;AACvD;;AAGA,eAAsB,kBAAkB,QAAgB,eAAyC;CAC/F,IAAI;EACF,MAAM,QAAQ,MAAM,GAAG,KAAK,MAAM;EAClC,OAAO,MAAM,OAAO,KAAK,KAAK,IAAI,IAAI,MAAM,UAAU,gBAAgB;CACxE,SAAS,OAAO;EACd,IAAI,UAAU,KAAK,MAAM,UAAU,OAAO;EAC1C,MAAM;CACR;AACF;;;;;;;;AASA,SAAS,WAAW,OAAmB,QAA8C;CACnF,MAAM,WAAW,OAAO,cAAc;CACtC,MAAM,MAAM,KAAK,IAAI;CACrB,OACE,CAAC,MAAM,cACP,MAAM,QAAQ,OAAO,iBACpB,MAAM,kBAAkB,UAAa,MAAM,iBAAiB,MAAM,YACnE,MAAM,MAAM,YAAY;AAE5B;;;;;;;AAQA,SAAgB,8BACd,QACA,QACM;CACN,MAAM,QAAQ,WAAW,OAAO,cAAc;CAC9C,AAAK,GACF,KAAK,MAAM,CAAC,CACZ,MAAM,UAAU;EACf,MAAM,SAAS,MAAM,QAAQ,MAAM,MAAM,IAAI,MAAM,KAAK;EACxD,MAAM,MAAM,IAAI,QAAQ,MAAM,IAAI;EAClC,MAAM,gBAAgB,KAAK,IAAI,MAAM,iBAAiB,MAAM,SAAS,MAAM,OAAO;EAClF,IAAI,MAAM,OAAO;EACjB,MAAM,QAAQ,KAAK,IAAI,GAAG,MAAM,YAAY,oBAAoB,KAAK,IAAI,CAAC;EAC1E,MAAM,QAAQ,iBAAiB;GAC7B,MAAM,QAAQ;GACd,IAAI,CAAC,WAAW,OAAO,MAAM,GAAG;IAC9B,MAAM,YAAY,KAAK,IAAI;IAC3B;GACF;GACA,AAAK,sBAAsB,QAAQ,MAAM,CAAC,CAAC,OAAO,UAAmB;IACnE,IAAI,KAAK,WAAW,kBAAkB,KAAK;GAC7C,CAAC;EACH,GAAG,KAAK;EACR,MAAM,MAAM,MAAM;CACpB,CAAC,CAAC,CACD,OAAO,UAAmB;EACzB,IAAI,UAAU,KAAK,MAAM,UAAU,IAAI,KAAK,WAAW,kBAAkB,KAAK;CAChF,CAAC;AACL;;AAYA,eAAe,sBAAsB,QAA+B;CAClE,IAAI;EACF,MAAM,QAAQ,MAAM,GAAG,MAAM,MAAM;EACnC,IAAI,MAAM,OAAO,KAAK,KAAK,IAAI,IAAI,MAAM,gBACvC,MAAM,GAAG,GAAG,QAAQ,EAAE,OAAO,KAAK,CAAC;CAEvC,SAAS,OAAO;EACd,IAAI,UAAU,KAAK,MAAM,UAAU,MAAM;CAC3C;AACF;;;;;;AAOA,eAAe,sBAAsB,YAAuC;CAC1E,IAAI,WAAW,cAAc,GAAG;CAChC,IAAI,KAAK,IAAI,IAAI,WAAW,gBAAsC;CAClE,IAAI,WAAW,UAAU,MAAM,GAAG,GAAG,WAAW,UAAU,EAAE,OAAO,KAAK,CAAC;CACzE,IAAI;EACF,IAAI,EAAE,MAAM,GAAG,MAAM,WAAW,SAAS,EAAC,CAAE,YAAY,GAAG;EAC3D,MAAM,GAAG,MAAM,WAAW,SAAS;CACrC,SAAS,OAAO;EACd,MAAM,OAAO,UAAU,KAAK;EAC5B,IAAI,SAAS,YAAY,SAAS,eAAe,SAAS,UAAU,MAAM;CAC5E;AACF;;;;;;;;;;;AAYA,eAAsB,sBACpB,QACA,MACe;CACf,MAAM,QAAQ,WAAW,OAAO,cAAc;CAC9C,MAAM,KAAK,IAAI,IAAI;CACnB,IAAI,MAAM,OAAO,OAAO,MAAM;CAC9B,MAAM,YAAY,KAAK,IAAI;CAC3B,MAAM,WAAW,MAAM;CACvB,MAAM,SAAS,YAAY;EACzB,MAAM,QAAsB,CAAC;EAC7B,MAAM,cAA4B,CAAC;EACnC,WAAW,MAAM,SAAS,wBAAwB,OAAO,cAAc,GAAG;GACxE,IAAI;GACJ,IAAI;IACF,WAAW,MAAM,GAAG,MAAM,MAAM,SAAS,EAAC,CAAE;GAC9C,SAAS,OAAO;IACd,IAAI,UAAU,KAAK,MAAM,UAAU;IACnC,MAAM;GACR;GACA,MAAM,aAAyB;IAAE,WAAW,MAAM;IAAW;IAAS,aAAa;GAAE;GACrF,YAAY,KAAK,UAAU;GAC3B,KAAK,MAAM,SAAS,MAAM,SACxB,IAAI,MAAM,SAAS,YACjB,WAAW,WAAW,MAAM;QACvB,IAAI,MAAM,SAAS,aACxB,MAAM,sBAAsB,MAAM,MAAM;QAExC,IAAI;IACF,MAAM,QAAQ,MAAM,GAAG,KAAK,MAAM,MAAM;IACxC,MAAM,KAAK;KACT,QAAQ,MAAM;KACd,MAAM,MAAM;KACZ,SAAS,MAAM;KACf;IACF,CAAC;IACD,WAAW,eAAe;GAC5B,SAAS,OAAO;IACd,IAAI,UAAU,KAAK,MAAM,UAAU,MAAM;GAC3C;EAGN;EACA,MAAM,QAAQ,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,KAAK,QAAQ,KAAK,IAAI,CAAC,CAAC;EACnE,MAAM,QAAQ,MAAM,QAAQ,KAAK,SAAS,MAAM,KAAK,MAAM,CAAC;EAC5D,MAAM,SAAS,KAAK,IAAI,IAAI,OAAO,cAAc;EACjD,IAAI;EACJ,KAAK,MAAM,QAAQ,MAAM,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG;GAC9D,IACE,CAAC,MAAM,KAAK,IAAI,KAAK,MAAM,MAC1B,KAAK,WAAW,UAAU,MAAM,QAAQ,OAAO,gBAChD;IACA,MAAM,GAAG,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK,CAAC;IACxC,MAAM,SAAS,KAAK;IACpB,MAAM,MAAM,OAAO,KAAK,MAAM;IAC9B,KAAK,WAAW,eAAe;IAC/B;GACF;GACA,gBAAgB,KAAK,IAAI,iBAAiB,KAAK,SAAS,KAAK,OAAO;EACtE;EACA,KAAK,MAAM,cAAc,aAAa,MAAM,sBAAsB,UAAU;EAC5E,MAAM,gBAAgB;EACtB,MAAM,aAAa;CACrB,EAAC,CAAE;CACH,MAAM,QAAQ;CACd,IAAI;EACF,MAAM;CACR,UAAU;EACR,MAAM,QAAQ;EACd,MAAM,KAAK,MAAM;CACnB;AACF"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { StorageDriverName } from "../../storage/types.mjs";
|
|
2
2
|
import { RequestHandler } from "../../router/types.mjs";
|
|
3
|
+
import "../../router/index.mjs";
|
|
3
4
|
//#region ../../packages/core/src/http/uploads/uploaded-file.controller.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Options for {@link createUploadedFileController}
|
|
6
7
|
*/
|
|
7
|
-
type UploadedFileControllerOptions = {
|
|
8
|
+
export type UploadedFileControllerOptions = {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Disk to serve from; remote disks support variants only. Uses the default
|
|
11
|
+
* disk when omitted. A private disk
|
|
10
12
|
* should be served from a route that checks access first.
|
|
11
13
|
*/
|
|
12
14
|
disk?: StorageDriverName;
|
|
15
|
+
/** Allow derivatives from the default cloud disk. Explicit disk selection also opts in. */
|
|
16
|
+
remote?: boolean;
|
|
13
17
|
};
|
|
14
18
|
/**
|
|
15
|
-
* Serves local uploads
|
|
19
|
+
* Serves local uploads and bounded on-demand image variants from any disk.
|
|
16
20
|
*
|
|
17
21
|
* ```ts
|
|
18
22
|
* router.get("/uploads/*", uploadedFileController);
|
|
@@ -32,11 +36,10 @@ type UploadedFileControllerOptions = {
|
|
|
32
36
|
* (see `resolveImageVariant`), written atomically, generated once per key even
|
|
33
37
|
* under concurrent requests, and sent with an immutable cache and an ETag.
|
|
34
38
|
*/
|
|
35
|
-
declare function createUploadedFileController(options?: UploadedFileControllerOptions): RequestHandler;
|
|
39
|
+
export declare function createUploadedFileController(options?: UploadedFileControllerOptions): RequestHandler;
|
|
36
40
|
/**
|
|
37
41
|
* Serves the default disk's uploads; see {@link createUploadedFileController}
|
|
38
42
|
*/
|
|
39
|
-
declare const uploadedFileController: RequestHandler;
|
|
43
|
+
export declare const uploadedFileController: RequestHandler;
|
|
40
44
|
//#endregion
|
|
41
|
-
export { UploadedFileControllerOptions, createUploadedFileController, uploadedFileController };
|
|
42
45
|
//# sourceMappingURL=uploaded-file.controller.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploaded-file.controller.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/http/uploads/uploaded-file.controller.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"uploaded-file.controller.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/http/uploads/uploaded-file.controller.ts"],"mappings":";;;;;;;YA6FY;;;;;;EAMV,OAAO;;EAGP;;;;;;;;;;;;;;;;;;;;;;;wBAwBc,6BACd,UAAS,gCACR;;;;qBA+HU,wBAAwB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HttpError } from "../errors/errors.mjs";
|
|
2
|
+
import { evaluateConditionalRequest } from "../conditional-request.mjs";
|
|
2
3
|
import { isMissingFileError, variantCacheDirectoryFor } from "./image-variant-cache.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { localDiskRoot } from "./local-disk-root.mjs";
|
|
4
5
|
import { detectImageFormat, isVariantSourceFormat } from "./detect-image-format.mjs";
|
|
5
6
|
import { readFileHead } from "./read-file-head.mjs";
|
|
6
7
|
import { resolveUploadPath } from "./resolve-upload-path.mjs";
|
|
7
|
-
import { localDiskRoot } from "./local-disk-root.mjs";
|
|
8
8
|
import { resolveImageVariant } from "./resolve-image-variant.mjs";
|
|
9
9
|
import { parseUploadedFileQuery } from "./parse-uploaded-file-query.mjs";
|
|
10
10
|
import { resolveInlineImageContentType } from "./resolve-inline-image-content-type.mjs";
|
|
@@ -70,7 +70,7 @@ async function sendOriginalInline(response, absolutePath, contentType) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Serves local uploads
|
|
73
|
+
* Serves local uploads and bounded on-demand image variants from any disk.
|
|
74
74
|
*
|
|
75
75
|
* ```ts
|
|
76
76
|
* router.get("/uploads/*", uploadedFileController);
|
|
@@ -93,17 +93,19 @@ async function sendOriginalInline(response, absolutePath, contentType) {
|
|
|
93
93
|
function createUploadedFileController(options = {}) {
|
|
94
94
|
return async ({ request, response }) => {
|
|
95
95
|
const diskRoot = localDiskRoot(options.disk);
|
|
96
|
-
if (!diskRoot)
|
|
97
|
-
log.error("uploads", "serve", options.disk === void 0 ? "uploadedFileController needs a local storage driver with a root." : `uploadedFileController needs a local disk; "${options.disk}" is not one.`);
|
|
98
|
-
return notFound(response);
|
|
99
|
-
}
|
|
96
|
+
if (!diskRoot && options.disk === void 0 && options.remote !== true) return notFound(response);
|
|
100
97
|
const query = parseUploadedFileQuery(request.url);
|
|
101
98
|
if (query.type === "invalid") return response.badRequest({ error: query.reason });
|
|
102
99
|
response.header("X-Content-Type-Options", "nosniff");
|
|
103
100
|
if (query.type === "original") {
|
|
101
|
+
if (!diskRoot) {
|
|
102
|
+
log.error("uploads", "serve", options.disk === void 0 ? "uploadedFileController needs a local storage driver with a root." : `uploadedFileController needs a local disk; "${options.disk}" is not one.`);
|
|
103
|
+
return notFound(response);
|
|
104
|
+
}
|
|
104
105
|
const source = await resolveUploadPath(request.params["*"], diskRoot, [path.join(diskRoot, ".cache", "image-variants"), variantCacheDirectoryFor(diskRoot)]);
|
|
105
106
|
if (!source) return notFound(response);
|
|
106
|
-
const
|
|
107
|
+
const head = await readFileHead(source.absolutePath, 512);
|
|
108
|
+
const sniffedFormat = detectImageFormat(head);
|
|
107
109
|
if (!isVariantSourceFormat(sniffedFormat)) return sendOriginalAsAttachment(response, source.absolutePath);
|
|
108
110
|
const inlineContentType = resolveInlineImageContentType(source.absolutePath, sniffedFormat);
|
|
109
111
|
if (!inlineContentType) return sendOriginalAsAttachment(response, source.absolutePath);
|
|
@@ -118,7 +120,14 @@ function createUploadedFileController(options = {}) {
|
|
|
118
120
|
};
|
|
119
121
|
let variant = await resolveImageVariant(variantInput);
|
|
120
122
|
if (!variant) return notFound(response);
|
|
121
|
-
|
|
123
|
+
const precondition = evaluateConditionalRequest({
|
|
124
|
+
method: request.method,
|
|
125
|
+
etag: `"${variant.hash}"`,
|
|
126
|
+
ifMatch: request.header("if-match"),
|
|
127
|
+
ifNoneMatch: request.header("if-none-match")
|
|
128
|
+
});
|
|
129
|
+
if (precondition === "not-modified") return response.baseResponse.status(304).send();
|
|
130
|
+
if (precondition === "precondition-failed") return response.baseResponse.status(412).send();
|
|
122
131
|
let body;
|
|
123
132
|
try {
|
|
124
133
|
body = await fs.readFile(variant.absolutePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploaded-file.controller.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/http/uploads/uploaded-file.controller.ts"],"sourcesContent":["import { log } from \"@warlock.js/logger\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { RequestHandler } from \"../../router\";\nimport type { StorageDriverName } from \"../../storage/types\";\nimport { HttpError } from \"../errors\";\nimport type { Response } from \"../response\";\nimport {\n detectImageFormat,\n IMAGE_SIGNATURE_BYTES,\n isVariantSourceFormat,\n} from \"./detect-image-format\";\nimport { isMissingFileError, variantCacheDirectoryFor } from \"./image-variant-cache\";\nimport type { VariantOutputFormat } from \"./image-variant-types\";\nimport { localDiskRoot } from \"./local-disk-root\";\nimport { matchesIfNoneMatch } from \"./matches-if-none-match\";\nimport { parseUploadedFileQuery } from \"./parse-uploaded-file-query\";\nimport { readFileHead } from \"./read-file-head\";\nimport { resolveImageVariant } from \"./resolve-image-variant\";\nimport { resolveInlineImageContentType } from \"./resolve-inline-image-content-type\";\nimport { resolveOriginalContentType } from \"./resolve-original-content-type\";\nimport { resolveUploadPath } from \"./resolve-upload-path\";\n\n/**\n * One year, in seconds: originals and derivatives are both long-lived\n */\nconst ONE_YEAR = 31_536_000;\n\nconst CONTENT_TYPES: Record<VariantOutputFormat, string> = {\n jpeg: \"image/jpeg\",\n png: \"image/png\",\n webp: \"image/webp\",\n avif: \"image/avif\",\n};\n\nfunction notFound(response: Response) {\n return response.notFound({ error: \"File Not Found\" });\n}\n\nasync function sendVariant(\n response: Response,\n body: Buffer,\n hash: string,\n format: VariantOutputFormat,\n) {\n return response.sendBuffer(body, {\n contentType: CONTENT_TYPES[format],\n cacheTime: ONE_YEAR,\n immutable: true,\n etag: `\"${hash}\"`,\n });\n}\n\n/**\n * Serve an upload original that isn't safe to render inline: a non-raster\n * format (html, xml, the svg family, anything unrecognised) is markup a\n * browser will parse and execute, and a raster-sniffed file whose extension\n * doesn't back that format up (see `resolveInlineImageContentType`) is a\n * polyglot — so both go out as a download instead of a rendered response.\n * `Content-Type` stays extension-derived, except the svg/html/xml family,\n * which is downgraded to `application/octet-stream` so the browser never\n * renders it even if it ignores the disposition.\n */\nasync function sendOriginalAsAttachment(response: Response, absolutePath: string) {\n response.header(\"Content-Security-Policy\", \"sandbox\");\n\n return response.sendBuffer(await fs.readFile(absolutePath), {\n contentType: resolveOriginalContentType(absolutePath),\n cacheTime: ONE_YEAR,\n immutable: true,\n inline: false,\n filename: path.basename(absolutePath),\n });\n}\n\n/**\n * Serve an upload original inline, once the sniffed raster format and the\n * extension-derived format have been confirmed to agree. The content type is\n * always the SNIFFED image type, passed explicitly — never `sendFile`'s\n * extension-derived guess, which is exactly what let a JPEG named `.html`\n * out as `text/html` before this existed.\n */\nasync function sendOriginalInline(response: Response, absolutePath: string, contentType: string) {\n return response.sendBuffer(await fs.readFile(absolutePath), {\n contentType,\n cacheTime: ONE_YEAR,\n immutable: true,\n });\n}\n\n/**\n * Options for {@link createUploadedFileController}\n */\nexport type UploadedFileControllerOptions = {\n /**\n * Local disk to serve from; the default disk when omitted. A private disk\n * should be served from a route that checks access first.\n */\n disk?: StorageDriverName;\n};\n\n/**\n * Serves local uploads, and bounded on-demand variants of the images among them.\n *\n * ```ts\n * router.get(\"/uploads/*\", uploadedFileController);\n * router.get(\"/invoices/*\", createUploadedFileController({ disk: \"private\" }), {\n * middleware: [authMiddleware()],\n * });\n * ```\n *\n * - `GET /uploads/<path>` sends the original file with a one-year cache.\n * - `GET /uploads/<path>?variant=<name>[&format=webp|avif]` sends a derivative\n * rendered from a variant named in `uploads.images.variants`. No other query\n * key is accepted, so a client can never ask for an arbitrary size.\n *\n * The path must stay inside the disk root (after symlinks are resolved) and\n * outside the variant cache; anything else is a 404, the same answer a missing\n * file gets. Derivatives are cached on disk under a directory per source\n * (see `resolveImageVariant`), written atomically, generated once per key even\n * under concurrent requests, and sent with an immutable cache and an ETag.\n */\nexport function createUploadedFileController(\n options: UploadedFileControllerOptions = {},\n): RequestHandler {\n return async ({ request, response }) => {\n const diskRoot = localDiskRoot(options.disk);\n\n if (!diskRoot) {\n log.error(\n \"uploads\",\n \"serve\",\n options.disk === undefined\n ? \"uploadedFileController needs a local storage driver with a root.\"\n : `uploadedFileController needs a local disk; \"${options.disk}\" is not one.`,\n );\n\n return notFound(response);\n }\n\n const query = parseUploadedFileQuery(request.url);\n\n if (query.type === \"invalid\") {\n return response.badRequest({ error: query.reason });\n }\n\n // Every uploads response — originals and variants — tells the browser not\n // to guess a content type from the bytes, so a mislabeled body can never be\n // sniffed into something executable.\n response.header(\"X-Content-Type-Options\", \"nosniff\");\n\n if (query.type === \"original\") {\n const source = await resolveUploadPath(request.params[\"*\"], diskRoot, [\n path.join(diskRoot, \".cache\", \"image-variants\"),\n variantCacheDirectoryFor(diskRoot),\n ]);\n\n if (!source) return notFound(response);\n\n // Inline is decided by SNIFFED bytes, never by extension: an svg (or any\n // other non-raster file) named `.png` must still download, not render.\n const head = await readFileHead(source.absolutePath, IMAGE_SIGNATURE_BYTES);\n const sniffedFormat = detectImageFormat(head);\n\n if (!isVariantSourceFormat(sniffedFormat)) {\n return sendOriginalAsAttachment(response, source.absolutePath);\n }\n\n // Inline is only safe when the extension-derived type agrees with the\n // sniffed bytes too — otherwise `sendFile` would advertise the\n // extension's type (e.g. text/html for JPEG bytes named `.html`).\n const inlineContentType = resolveInlineImageContentType(source.absolutePath, sniffedFormat);\n\n if (!inlineContentType) {\n return sendOriginalAsAttachment(response, source.absolutePath);\n }\n\n return sendOriginalInline(response, source.absolutePath, inlineContentType);\n }\n\n try {\n const variantInput = {\n path: request.params[\"*\"] as string,\n variant: query.variant,\n ...(query.format !== undefined ? { format: query.format as VariantOutputFormat } : {}),\n ...(options.disk !== undefined ? { disk: options.disk } : {}),\n };\n let variant = await resolveImageVariant(variantInput);\n\n if (!variant) return notFound(response);\n\n if (matchesIfNoneMatch(request.header(\"if-none-match\"), `\"${variant.hash}\"`)) {\n return response.baseResponse.status(304).send();\n }\n\n let body: Buffer;\n\n try {\n body = await fs.readFile(variant.absolutePath);\n } catch (readError) {\n if (!isMissingFileError(readError)) throw readError;\n\n // Pruned between the existence check and the read: the source was\n // rewritten in place and a request for the new version cleared the\n // old generation. Resolve (and render) once more.\n variant = await resolveImageVariant(variantInput);\n\n if (!variant) return notFound(response);\n\n body = await fs.readFile(variant.absolutePath);\n }\n\n return sendVariant(response, body, variant.hash, variant.format);\n } catch (error) {\n if (error instanceof HttpError) {\n return response.send({ error: error.message }, error.status);\n }\n\n log.error(\n \"uploads\",\n \"variant\",\n `Could not generate variant \"${query.variant}\" of ${String(request.params[\"*\"])}: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n\n return response.serverError({ error: \"Could not generate the image variant.\" });\n }\n };\n}\n\n/**\n * Serves the default disk's uploads; see {@link createUploadedFileController}\n */\nexport const uploadedFileController: RequestHandler = createUploadedFileController();\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"uploaded-file.controller.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/http/uploads/uploaded-file.controller.ts"],"sourcesContent":["import { log } from \"@warlock.js/logger\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { RequestHandler } from \"../../router\";\nimport type { StorageDriverName } from \"../../storage/types\";\nimport { HttpError } from \"../errors\";\nimport type { Response } from \"../response\";\nimport {\n detectImageFormat,\n IMAGE_SIGNATURE_BYTES,\n isVariantSourceFormat,\n} from \"./detect-image-format\";\nimport { isMissingFileError, variantCacheDirectoryFor } from \"./image-variant-cache\";\nimport type { VariantOutputFormat } from \"./image-variant-types\";\nimport { localDiskRoot } from \"./local-disk-root\";\nimport { evaluateConditionalRequest } from \"../conditional-request\";\nimport { parseUploadedFileQuery } from \"./parse-uploaded-file-query\";\nimport { readFileHead } from \"./read-file-head\";\nimport { resolveImageVariant } from \"./resolve-image-variant\";\nimport { resolveInlineImageContentType } from \"./resolve-inline-image-content-type\";\nimport { resolveOriginalContentType } from \"./resolve-original-content-type\";\nimport { resolveUploadPath } from \"./resolve-upload-path\";\n\n/**\n * One year, in seconds: originals and derivatives are both long-lived\n */\nconst ONE_YEAR = 31_536_000;\n\nconst CONTENT_TYPES: Record<VariantOutputFormat, string> = {\n jpeg: \"image/jpeg\",\n png: \"image/png\",\n webp: \"image/webp\",\n avif: \"image/avif\",\n};\n\nfunction notFound(response: Response) {\n return response.notFound({ error: \"File Not Found\" });\n}\n\nasync function sendVariant(\n response: Response,\n body: Buffer,\n hash: string,\n format: VariantOutputFormat,\n) {\n return response.sendBuffer(body, {\n contentType: CONTENT_TYPES[format],\n cacheTime: ONE_YEAR,\n immutable: true,\n etag: `\"${hash}\"`,\n });\n}\n\n/**\n * Serve an upload original that isn't safe to render inline: a non-raster\n * format (html, xml, the svg family, anything unrecognised) is markup a\n * browser will parse and execute, and a raster-sniffed file whose extension\n * doesn't back that format up (see `resolveInlineImageContentType`) is a\n * polyglot — so both go out as a download instead of a rendered response.\n * `Content-Type` stays extension-derived, except the svg/html/xml family,\n * which is downgraded to `application/octet-stream` so the browser never\n * renders it even if it ignores the disposition.\n */\nasync function sendOriginalAsAttachment(response: Response, absolutePath: string) {\n response.header(\"Content-Security-Policy\", \"sandbox\");\n\n return response.sendBuffer(await fs.readFile(absolutePath), {\n contentType: resolveOriginalContentType(absolutePath),\n cacheTime: ONE_YEAR,\n immutable: true,\n inline: false,\n filename: path.basename(absolutePath),\n });\n}\n\n/**\n * Serve an upload original inline, once the sniffed raster format and the\n * extension-derived format have been confirmed to agree. The content type is\n * always the SNIFFED image type, passed explicitly — never `sendFile`'s\n * extension-derived guess, which is exactly what let a JPEG named `.html`\n * out as `text/html` before this existed.\n */\nasync function sendOriginalInline(response: Response, absolutePath: string, contentType: string) {\n return response.sendBuffer(await fs.readFile(absolutePath), {\n contentType,\n cacheTime: ONE_YEAR,\n immutable: true,\n });\n}\n\n/**\n * Options for {@link createUploadedFileController}\n */\nexport type UploadedFileControllerOptions = {\n /**\n * Disk to serve from; remote disks support variants only. Uses the default\n * disk when omitted. A private disk\n * should be served from a route that checks access first.\n */\n disk?: StorageDriverName;\n\n /** Allow derivatives from the default cloud disk. Explicit disk selection also opts in. */\n remote?: boolean;\n};\n\n/**\n * Serves local uploads and bounded on-demand image variants from any disk.\n *\n * ```ts\n * router.get(\"/uploads/*\", uploadedFileController);\n * router.get(\"/invoices/*\", createUploadedFileController({ disk: \"private\" }), {\n * middleware: [authMiddleware()],\n * });\n * ```\n *\n * - `GET /uploads/<path>` sends the original file with a one-year cache.\n * - `GET /uploads/<path>?variant=<name>[&format=webp|avif]` sends a derivative\n * rendered from a variant named in `uploads.images.variants`. No other query\n * key is accepted, so a client can never ask for an arbitrary size.\n *\n * The path must stay inside the disk root (after symlinks are resolved) and\n * outside the variant cache; anything else is a 404, the same answer a missing\n * file gets. Derivatives are cached on disk under a directory per source\n * (see `resolveImageVariant`), written atomically, generated once per key even\n * under concurrent requests, and sent with an immutable cache and an ETag.\n */\nexport function createUploadedFileController(\n options: UploadedFileControllerOptions = {},\n): RequestHandler {\n return async ({ request, response }) => {\n const diskRoot = localDiskRoot(options.disk);\n // The scaffold's public route must not expose private objects when the\n // default disk changes to a cloud bucket. Remote access is deliberate.\n if (!diskRoot && options.disk === undefined && options.remote !== true)\n return notFound(response);\n\n const query = parseUploadedFileQuery(request.url);\n\n if (query.type === \"invalid\") {\n return response.badRequest({ error: query.reason });\n }\n\n // Every uploads response — originals and variants — tells the browser not\n // to guess a content type from the bytes, so a mislabeled body can never be\n // sniffed into something executable.\n response.header(\"X-Content-Type-Options\", \"nosniff\");\n\n if (query.type === \"original\") {\n if (!diskRoot) {\n log.error(\n \"uploads\",\n \"serve\",\n options.disk === undefined\n ? \"uploadedFileController needs a local storage driver with a root.\"\n : `uploadedFileController needs a local disk; \"${options.disk}\" is not one.`,\n );\n\n return notFound(response);\n }\n\n const source = await resolveUploadPath(request.params[\"*\"], diskRoot, [\n path.join(diskRoot, \".cache\", \"image-variants\"),\n variantCacheDirectoryFor(diskRoot),\n ]);\n\n if (!source) return notFound(response);\n\n // Inline is decided by SNIFFED bytes, never by extension: an svg (or any\n // other non-raster file) named `.png` must still download, not render.\n const head = await readFileHead(source.absolutePath, IMAGE_SIGNATURE_BYTES);\n const sniffedFormat = detectImageFormat(head);\n\n if (!isVariantSourceFormat(sniffedFormat)) {\n return sendOriginalAsAttachment(response, source.absolutePath);\n }\n\n // Inline is only safe when the extension-derived type agrees with the\n // sniffed bytes too — otherwise `sendFile` would advertise the\n // extension's type (e.g. text/html for JPEG bytes named `.html`).\n const inlineContentType = resolveInlineImageContentType(source.absolutePath, sniffedFormat);\n\n if (!inlineContentType) {\n return sendOriginalAsAttachment(response, source.absolutePath);\n }\n\n return sendOriginalInline(response, source.absolutePath, inlineContentType);\n }\n\n try {\n const variantInput = {\n path: request.params[\"*\"] as string,\n variant: query.variant,\n ...(query.format !== undefined ? { format: query.format as VariantOutputFormat } : {}),\n ...(options.disk !== undefined ? { disk: options.disk } : {}),\n };\n let variant = await resolveImageVariant(variantInput);\n\n if (!variant) return notFound(response);\n\n // The variant hash is a strong validator: If-None-Match compares weakly,\n // If-Match strongly (RFC 9110 §13.1).\n const precondition = evaluateConditionalRequest({\n method: request.method,\n etag: `\"${variant.hash}\"`,\n ifMatch: request.header(\"if-match\"),\n ifNoneMatch: request.header(\"if-none-match\"),\n });\n\n if (precondition === \"not-modified\") {\n return response.baseResponse.status(304).send();\n }\n\n if (precondition === \"precondition-failed\") {\n return response.baseResponse.status(412).send();\n }\n\n let body: Buffer;\n\n try {\n body = await fs.readFile(variant.absolutePath);\n } catch (readError) {\n if (!isMissingFileError(readError)) throw readError;\n\n // Pruned between the existence check and the read: the source was\n // rewritten in place and a request for the new version cleared the\n // old generation. Resolve (and render) once more.\n variant = await resolveImageVariant(variantInput);\n\n if (!variant) return notFound(response);\n\n body = await fs.readFile(variant.absolutePath);\n }\n\n return sendVariant(response, body, variant.hash, variant.format);\n } catch (error) {\n if (error instanceof HttpError) {\n return response.send({ error: error.message }, error.status);\n }\n\n log.error(\n \"uploads\",\n \"variant\",\n `Could not generate variant \"${query.variant}\" of ${String(request.params[\"*\"])}: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n\n return response.serverError({ error: \"Could not generate the image variant.\" });\n }\n };\n}\n\n/**\n * Serves the default disk's uploads; see {@link createUploadedFileController}\n */\nexport const uploadedFileController: RequestHandler = createUploadedFileController();\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region ../../packages/core/src/http/uploads/variant-cache-key.ts
|
|
5
5
|
/**
|
|
@@ -66,5 +66,5 @@ function variantCachePath(cacheDirectory, source, hash, format) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
//#endregion
|
|
69
|
-
export { variantCacheKey, variantCachePath, variantGenerationTag, variantSourceDirectory, variantSourceKey };
|
|
69
|
+
export { variantCacheKey, variantCachePath, variantExtension, variantGenerationTag, variantSourceDirectory, variantSourceKey };
|
|
70
70
|
//# sourceMappingURL=variant-cache-key.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UploadsConfigurations } from "./uploads-types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/http/uploads-config.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Default uploads configuration values
|
|
@@ -7,7 +6,7 @@ import { UploadsConfigurations } from "./uploads-types.mjs";
|
|
|
7
6
|
* These defaults are used when no configuration is provided
|
|
8
7
|
* or when specific keys are missing from the app config.
|
|
9
8
|
*/
|
|
10
|
-
declare const UPLOADS_DEFAULTS: UploadsConfigurations;
|
|
9
|
+
export declare const UPLOADS_DEFAULTS: UploadsConfigurations;
|
|
11
10
|
/**
|
|
12
11
|
* Get uploads configuration value
|
|
13
12
|
*
|
|
@@ -24,7 +23,6 @@ declare const UPLOADS_DEFAULTS: UploadsConfigurations;
|
|
|
24
23
|
* const length = uploadsConfig("randomLength", 32);
|
|
25
24
|
* ```
|
|
26
25
|
*/
|
|
27
|
-
declare function uploadsConfig<K extends keyof UploadsConfigurations>(key: K, defaultValue?: UploadsConfigurations[K]): UploadsConfigurations[K];
|
|
26
|
+
export declare function uploadsConfig<K extends keyof UploadsConfigurations>(key: K, defaultValue?: UploadsConfigurations[K]): UploadsConfigurations[K];
|
|
28
27
|
//#endregion
|
|
29
|
-
export { UPLOADS_DEFAULTS, uploadsConfig };
|
|
30
28
|
//# sourceMappingURL=uploads-config.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads-config.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/uploads-config.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"uploads-config.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/uploads-config.ts"],"mappings":";;;;;;;;qBASa,kBAAkB;;;;;;;;;;;;;;;;;wBA0Bf,cAAc,gBAAgB,uBAC5C,KAAK,GACL,eAAe,sBAAsB,KACpC,sBAAsB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StorageDriverName } from "../storage/types.mjs";
|
|
2
|
+
import "../storage/index.mjs";
|
|
2
3
|
import { Image, ImageFormat, ImageTransformOptions } from "../image/image.mjs";
|
|
4
|
+
import "../image/index.mjs";
|
|
3
5
|
import { FileValidationOptions } from "./uploaded-file.mjs";
|
|
4
|
-
|
|
5
6
|
//#region ../../packages/core/src/http/uploads-types.d.ts
|
|
6
7
|
/**
|
|
7
8
|
* Prefix options for file path generation
|
|
@@ -24,7 +25,7 @@ import { FileValidationOptions } from "./uploaded-file.mjs";
|
|
|
24
25
|
* // → a7x9/image.png
|
|
25
26
|
* ```
|
|
26
27
|
*/
|
|
27
|
-
type PrefixOptions = {
|
|
28
|
+
export type PrefixOptions = {
|
|
28
29
|
/**
|
|
29
30
|
* Date format string using tokens:
|
|
30
31
|
* - `dd`: Day (01-31)
|
|
@@ -65,7 +66,7 @@ type PrefixOptions = {
|
|
|
65
66
|
* - `string`: Static prefix string (e.g., "avatar-", "user-123-")
|
|
66
67
|
* - `PrefixOptions`: Full control over format, randomness, and output mode
|
|
67
68
|
*/
|
|
68
|
-
type PrefixConfig = boolean | string | PrefixOptions;
|
|
69
|
+
export type PrefixConfig = boolean | string | PrefixOptions;
|
|
69
70
|
/**
|
|
70
71
|
* File naming strategy
|
|
71
72
|
*
|
|
@@ -73,7 +74,7 @@ type PrefixConfig = boolean | string | PrefixOptions;
|
|
|
73
74
|
* - `"original"`: Use the original uploaded filename (sanitized)
|
|
74
75
|
* - `string`: Custom filename (extension auto-appended from original file)
|
|
75
76
|
*/
|
|
76
|
-
type FileNamingStrategy = "random" | "original" | (string & {});
|
|
77
|
+
export type FileNamingStrategy = "random" | "original" | (string & {});
|
|
77
78
|
/**
|
|
78
79
|
* Options for saving uploaded files
|
|
79
80
|
*
|
|
@@ -92,7 +93,7 @@ type FileNamingStrategy = "random" | "original" | (string & {});
|
|
|
92
93
|
* });
|
|
93
94
|
* ```
|
|
94
95
|
*/
|
|
95
|
-
type SaveOptions = {
|
|
96
|
+
export type SaveOptions = {
|
|
96
97
|
/**
|
|
97
98
|
* Filename strategy
|
|
98
99
|
*
|
|
@@ -133,7 +134,7 @@ type SaveOptions = {
|
|
|
133
134
|
*
|
|
134
135
|
* Same as SaveOptions but without name/prefix since the full path is explicit.
|
|
135
136
|
*/
|
|
136
|
-
type SaveAsOptions = Omit<SaveOptions, "name" | "prefix">;
|
|
137
|
+
export type SaveAsOptions = Omit<SaveOptions, "name" | "prefix">;
|
|
137
138
|
/**
|
|
138
139
|
* Image transformation callback function
|
|
139
140
|
*
|
|
@@ -149,7 +150,7 @@ type SaveAsOptions = Omit<SaveOptions, "name" | "prefix">;
|
|
|
149
150
|
* );
|
|
150
151
|
* ```
|
|
151
152
|
*/
|
|
152
|
-
type ImageTransformCallback = (img: Image) => Image;
|
|
153
|
+
export type ImageTransformCallback = (img: Image) => Image;
|
|
153
154
|
/**
|
|
154
155
|
* Image transformation configuration
|
|
155
156
|
*
|
|
@@ -157,7 +158,7 @@ type ImageTransformCallback = (img: Image) => Image;
|
|
|
157
158
|
* - An options object with predefined transforms
|
|
158
159
|
* - A callback function for full control
|
|
159
160
|
*/
|
|
160
|
-
type ImageTransformConfig = ImageTransformOptions | ImageTransformCallback;
|
|
161
|
+
export type ImageTransformConfig = ImageTransformOptions | ImageTransformCallback;
|
|
161
162
|
/**
|
|
162
163
|
* Uploads configuration for app config
|
|
163
164
|
*
|
|
@@ -172,7 +173,7 @@ type ImageTransformConfig = ImageTransformOptions | ImageTransformCallback;
|
|
|
172
173
|
* }
|
|
173
174
|
* ```
|
|
174
175
|
*/
|
|
175
|
-
type UploadsConfigurations = {
|
|
176
|
+
export type UploadsConfigurations = {
|
|
176
177
|
/**
|
|
177
178
|
* Default naming strategy for uploaded files
|
|
178
179
|
*
|
|
@@ -216,11 +217,11 @@ type UploadsConfigurations = {
|
|
|
216
217
|
/**
|
|
217
218
|
* Output formats a client may request with `&format=` on an image variant
|
|
218
219
|
*/
|
|
219
|
-
type ImageVariantOutputFormat = "avif" | "webp";
|
|
220
|
+
export type ImageVariantOutputFormat = "avif" | "webp";
|
|
220
221
|
/**
|
|
221
222
|
* How an image variant fits into its box, see sharp's `fit` resize option
|
|
222
223
|
*/
|
|
223
|
-
type ImageVariantFit = "cover" | "contain" | "inside";
|
|
224
|
+
export type ImageVariantFit = "cover" | "contain" | "inside";
|
|
224
225
|
/**
|
|
225
226
|
* One named image variant
|
|
226
227
|
*
|
|
@@ -229,7 +230,7 @@ type ImageVariantFit = "cover" | "contain" | "inside";
|
|
|
229
230
|
* { width: 640, height: 480, fit: "cover", quality: 80 }
|
|
230
231
|
* ```
|
|
231
232
|
*/
|
|
232
|
-
type ImageVariantDefinition = {
|
|
233
|
+
export type ImageVariantDefinition = {
|
|
233
234
|
/**
|
|
234
235
|
* Target width in pixels, a positive integer up to 8192
|
|
235
236
|
*/
|
|
@@ -272,7 +273,7 @@ type ImageVariantDefinition = {
|
|
|
272
273
|
* }
|
|
273
274
|
* ```
|
|
274
275
|
*/
|
|
275
|
-
type UploadsImagesConfigurations = {
|
|
276
|
+
export type UploadsImagesConfigurations = {
|
|
276
277
|
/**
|
|
277
278
|
* The named variants a client may request with `?variant=<name>`
|
|
278
279
|
*/
|
|
@@ -296,18 +297,24 @@ type UploadsImagesConfigurations = {
|
|
|
296
297
|
*/
|
|
297
298
|
maxSourcePixels?: number;
|
|
298
299
|
/**
|
|
299
|
-
* Absolute directory
|
|
300
|
+
* Absolute directory dedicated to generated variants. Keep originals and
|
|
301
|
+
* other application files elsewhere; purge removes recognized cache files
|
|
302
|
+
* without deleting this directory.
|
|
300
303
|
*
|
|
301
304
|
* @default storage.root(".cache/image-variants")
|
|
302
305
|
*/
|
|
303
306
|
cacheDirectory?: string;
|
|
307
|
+
/** Maximum total cached derivative bytes. Default 512 MiB. */
|
|
308
|
+
maxCacheBytes?: number;
|
|
309
|
+
/** Maximum derivative age in seconds, measured from generation. Default 7 days. */
|
|
310
|
+
maxCacheAge?: number;
|
|
304
311
|
};
|
|
305
312
|
/**
|
|
306
313
|
* High-level image options that can be chained on UploadedFile
|
|
307
314
|
*
|
|
308
315
|
* These are stored internally and applied before saving.
|
|
309
316
|
*/
|
|
310
|
-
type UploadedFileImageOptions = {
|
|
317
|
+
export type UploadedFileImageOptions = {
|
|
311
318
|
/**
|
|
312
319
|
* Resize dimensions
|
|
313
320
|
*/
|
|
@@ -337,5 +344,4 @@ type UploadedFileImageOptions = {
|
|
|
337
344
|
grayscale?: boolean;
|
|
338
345
|
};
|
|
339
346
|
//#endregion
|
|
340
|
-
export { FileNamingStrategy, ImageTransformCallback, ImageTransformConfig, ImageVariantDefinition, ImageVariantFit, ImageVariantOutputFormat, PrefixConfig, PrefixOptions, SaveAsOptions, SaveOptions, UploadedFileImageOptions, UploadsConfigurations, UploadsImagesConfigurations };
|
|
341
347
|
//# sourceMappingURL=uploads-types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads-types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/uploads-types.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"uploads-types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/uploads-types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;YAyBY;;;;;;;;;;;;;;EAcV;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;;YAWU,kCAAkC;;;;;;;;YASlC;;;;;;;;;;;;;;;;;;;YAoBA;;;;;;;;;;EAUV,OAAO;;;;;;;;;;EAWP,SAAS;;;;;;;;EAST,SAAS;;;;;;EAOT,WAAW;;;;;;;YAQD,gBAAgB,KAAK;;;;;;;;;;;;;;;;YAiBrB,0BAA0B,KAAK,UAAU;;;;;;;;YASzC,uBAAuB,wBAAwB;;;;;;;;;;;;;;;YAgB/C;;;;;;EAMV;;;;;;EAOA;;;;;;;;;EAUA,SAAS;;;;;;EAOT;;;;;;;;;;;;EAaA,SAAS;;;;;YAMC;;;;YAKA;;;;;;;;;YAUA;;;;EAIV;;;;EAKA;;;;;;EAOA,MAAM;;;;EAKN;;;;;;;;EASA;;;;;;;;;;;;;;;;;YAkBU;;;;EAIV,UAAU,SAAS,eAAe;;;;;;EAOlC,mBAAmB;;;;;;EAOnB;;;;;;EAOA;;;;;;;;EASA;;EAGA;;EAGA;;;;;;;YAQU;;;;EAIV;IAAW;IAAe;;;;;EAK1B;;;;EAKA,SAAS;;;;EAKT;;;;EAKA;;;;EAKA"}
|
package/esm/http/xmlable.d.mts
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* feed package) never imports core — a `Sitemap` satisfies `XMLable` just by
|
|
7
7
|
* having a `toXML()` method.
|
|
8
8
|
*/
|
|
9
|
-
interface XMLable {
|
|
9
|
+
export interface XMLable {
|
|
10
10
|
toXML(): string;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
export { XMLable };
|
|
14
13
|
//# sourceMappingURL=xmlable.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlable.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/xmlable.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"xmlable.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/xmlable.ts"],"mappings":";;;;;;;;iBAOiB;EACf"}
|
package/esm/image/image.d.mts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import sharp, { FormatEnum } from "sharp";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/image/image.d.ts
|
|
4
|
-
type ImageFormat = keyof FormatEnum;
|
|
5
|
-
type ImageInput = string | Buffer | Uint8Array | ArrayBuffer;
|
|
3
|
+
export type ImageFormat = keyof FormatEnum;
|
|
4
|
+
export type ImageInput = string | Buffer | Uint8Array | ArrayBuffer;
|
|
6
5
|
/**
|
|
7
6
|
* Watermark configuration for deferred execution
|
|
8
7
|
*/
|
|
9
|
-
type WatermarkConfig = {
|
|
8
|
+
export type WatermarkConfig = {
|
|
10
9
|
image: ImageInput | Image;
|
|
11
10
|
options: sharp.OverlayOptions;
|
|
12
11
|
};
|
|
@@ -70,7 +69,7 @@ type ImageOperation = {
|
|
|
70
69
|
* 10. opacity - Transparency (applied via composite)
|
|
71
70
|
* 11. format/quality - Applied on save/export
|
|
72
71
|
*/
|
|
73
|
-
type ImageTransformOptions = {
|
|
72
|
+
export type ImageTransformOptions = {
|
|
74
73
|
/**
|
|
75
74
|
* Output quality (1-100), applied based on final format
|
|
76
75
|
*/
|
|
@@ -174,7 +173,7 @@ type InternalOptions = {
|
|
|
174
173
|
* .save("output.jpg");
|
|
175
174
|
* ```
|
|
176
175
|
*/
|
|
177
|
-
declare class Image {
|
|
176
|
+
export declare class Image {
|
|
178
177
|
/**
|
|
179
178
|
* Image options that will be applied on save/export
|
|
180
179
|
*/
|
|
@@ -386,5 +385,5 @@ declare class Image {
|
|
|
386
385
|
reset(): this;
|
|
387
386
|
}
|
|
388
387
|
//#endregion
|
|
389
|
-
export {
|
|
388
|
+
export {};
|
|
390
389
|
//# sourceMappingURL=image.d.mts.map
|