@warlock.js/core 5.31.0 → 5.33.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 +61 -0
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +9 -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 +22 -20
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/boot-signal.mjs +15 -9
- package/esm/application/boot-signal.mjs.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
- package/esm/cli/commands/ai/ai-command.action.mjs +140 -0
- package/esm/cli/commands/ai/ai-command.action.mjs.map +1 -0
- package/esm/cli/commands/ai.command.mjs +50 -0
- package/esm/cli/commands/ai.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +4 -1
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
- package/esm/cli/commands/check/format-problems.mjs +1 -1
- package/esm/cli/commands/check.command.mjs +6 -1
- package/esm/cli/commands/check.command.mjs.map +1 -1
- package/esm/cli/commands/dev-server.command.mjs +3 -2
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +29 -16
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
- package/esm/cli/commands/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/pm2/pm2-command.action.mjs +91 -0
- package/esm/cli/commands/pm2/pm2-command.action.mjs.map +1 -0
- package/esm/cli/commands/pm2/pm2-config.mjs +115 -0
- package/esm/cli/commands/pm2/pm2-config.mjs.map +1 -0
- package/esm/cli/commands/pm2.command.mjs +53 -0
- package/esm/cli/commands/pm2.command.mjs.map +1 -0
- package/esm/cli/commands/postman-generator.action.mjs +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +1 -1
- package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/framework-cli-commands.mjs +6 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +2 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +3 -3
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +19 -16
- package/esm/config/config-schema.d.mts.map +1 -1
- package/esm/config/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +2 -1
- package/esm/config/index.mjs +1 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +2 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +3 -6
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +8 -7
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/shutdown-timeout.mjs +7 -0
- package/esm/connectors/shutdown-timeout.mjs.map +1 -0
- 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 +20 -11
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -3
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +2 -3
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +1 -1
- package/esm/dev-server/create-worker.mjs +5 -3
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/files-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +6 -8
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +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 +6 -15
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -1
- package/esm/dev-server/health-checker/eslint-support.mjs +27 -0
- package/esm/dev-server/health-checker/eslint-support.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +7 -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 +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +2 -11
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +3 -2
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +2 -1
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +2 -1
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +2 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +6 -38
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/supervisor.mjs +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +28 -35
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/error-codes.d.mts +29 -22
- package/esm/errors/error-codes.d.mts.map +1 -1
- package/esm/errors/warlock-error.d.mts +1 -3
- package/esm/errors/warlock-error.d.mts.map +1 -1
- package/esm/generations/add-command.action.mjs +3 -2
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +2 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/index.mjs +2 -0
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +2 -1
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/process.feature.mjs +65 -0
- package/esm/generations/features/process.feature.mjs.map +1 -0
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs +2 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +1 -1
- package/esm/generations/generation-run.mjs +1 -1
- package/esm/generations/stubs.mjs +1 -1
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +4 -4
- package/esm/http/bounded-stream-queue.d.mts.map +1 -1
- package/esm/http/bounded-stream-queue.mjs +1 -1
- package/esm/http/bounded-stream-queue.mjs.map +1 -1
- package/esm/http/build-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +2 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +14 -13
- package/esm/http/conditional-request.d.mts.map +1 -1
- package/esm/http/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +10 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +2 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +2 -3
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +28 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/escape-header-value.d.mts +1 -2
- package/esm/http/escape-header-value.d.mts.map +1 -1
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +4 -1
- package/esm/http/index.mjs +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +10 -10
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/port-preflight.mjs +2 -0
- package/esm/http/port-preflight.mjs.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +4 -3
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +20 -16
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +3 -3
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +8 -7
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +8 -7
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +12 -11
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +7 -7
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +3 -4
- package/esm/http/safe-redirect.d.mts.map +1 -1
- package/esm/http/serialized.d.mts +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +9 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +4 -4
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +49 -43
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +6 -6
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
- package/esm/http/uploads/image-variant-cache.mjs +8 -8
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +7 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +2 -4
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
- package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +1 -1
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +19 -17
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +28 -2
- package/esm/index.mjs +7 -2
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +4 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +12 -14
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +2 -1
- package/esm/mail/index.mjs +1 -1
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -3
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/types.d.mts +23 -21
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +2 -1
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +12 -32
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/router/index.d.mts +2 -1
- package/esm/router/index.mjs +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +3 -3
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
- package/esm/router/route-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +1 -1
- package/esm/router/route-guard-names.mjs.map +1 -1
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +1 -3
- package/esm/router/route-name-taken-error.d.mts.map +1 -1
- package/esm/router/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +2 -4
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +8 -6
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +25 -26
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
- package/esm/secrets/errors.d.mts +9 -0
- package/esm/secrets/errors.d.mts.map +1 -0
- package/esm/secrets/errors.mjs +22 -0
- package/esm/secrets/errors.mjs.map +1 -0
- package/esm/secrets/file-backend.mjs +167 -0
- package/esm/secrets/file-backend.mjs.map +1 -0
- package/esm/secrets/index.d.mts +6 -0
- package/esm/secrets/index.mjs +6 -0
- package/esm/secrets/keyring-backend.mjs +50 -0
- package/esm/secrets/keyring-backend.mjs.map +1 -0
- package/esm/secrets/memory-backend.d.mts +12 -0
- package/esm/secrets/memory-backend.d.mts.map +1 -0
- package/esm/secrets/memory-backend.mjs +28 -0
- package/esm/secrets/memory-backend.mjs.map +1 -0
- package/esm/secrets/secret-store.d.mts +25 -0
- package/esm/secrets/secret-store.d.mts.map +1 -0
- package/esm/secrets/secret-store.mjs +117 -0
- package/esm/secrets/secret-store.mjs.map +1 -0
- package/esm/secrets/secrets.d.mts +11 -0
- package/esm/secrets/secrets.d.mts.map +1 -0
- package/esm/secrets/secrets.mjs +63 -0
- package/esm/secrets/secrets.mjs.map +1 -0
- package/esm/secrets/types.d.mts +22 -0
- package/esm/secrets/types.d.mts.map +1 -0
- package/esm/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +2 -2
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +8 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/socket/utils.mjs +12 -1
- package/esm/socket/utils.mjs.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +2 -2
- package/esm/storage/local-disk-roots.mjs.map +1 -1
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +3 -4
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/types.d.mts +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +5 -6
- package/esm/tests/authenticated-test-client.d.mts.map +1 -1
- package/esm/tests/factories.d.mts +38 -23
- package/esm/tests/factories.d.mts.map +1 -1
- package/esm/tests/fakes/cache-fake.d.mts +14 -9
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
- package/esm/tests/fakes/clock-fake.d.mts +13 -8
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
- package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
- package/esm/tests/fakes/ids-fake.d.mts +5 -4
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
- package/esm/tests/fakes/index.d.mts +3 -1
- package/esm/tests/fakes/index.mjs +2 -1
- package/esm/tests/fakes/mail-fake.d.mts +21 -13
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
- package/esm/tests/fakes/queue-fake.d.mts +21 -13
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
- package/esm/tests/fakes/secrets-fake.d.mts +13 -0
- package/esm/tests/fakes/secrets-fake.d.mts.map +1 -0
- package/esm/tests/fakes/secrets-fake.mjs +50 -0
- package/esm/tests/fakes/secrets-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +12 -8
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.mjs +1 -1
- package/esm/tests/fakes/test-fakes.d.mts +9 -10
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +6 -3
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +3 -1
- package/esm/tests/index.mjs +2 -1
- package/esm/tests/snapshot-response.d.mts +4 -5
- package/esm/tests/snapshot-response.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +4 -6
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +5 -5
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +11 -12
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-http-server.d.mts +14 -10
- package/esm/tests/test-http-server.d.mts.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +7 -8
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
- package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
- package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
- package/esm/tooling/board/board-message.d.mts +4 -6
- package/esm/tooling/board/board-message.d.mts.map +1 -1
- package/esm/tooling/board/board.d.mts +50 -38
- package/esm/tooling/board/board.d.mts.map +1 -1
- package/esm/tooling/board/board.mjs +4 -3
- package/esm/tooling/board/board.mjs.map +1 -1
- package/esm/tooling/board/board.types.d.mts +32 -23
- package/esm/tooling/board/board.types.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.d.mts +4 -6
- package/esm/tooling/check/changed-files.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.mjs +2 -2
- package/esm/tooling/check/changed-files.mjs.map +1 -1
- package/esm/tooling/check/check-report.types.d.mts +22 -17
- package/esm/tooling/check/check-report.types.d.mts.map +1 -1
- package/esm/tooling/check/code-style-conventions.mjs +25 -25
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
- package/esm/tooling/check/conventions-step.d.mts +4 -6
- package/esm/tooling/check/conventions-step.d.mts.map +1 -1
- package/esm/tooling/check/conventions-step.mjs +7 -18
- package/esm/tooling/check/conventions-step.mjs.map +1 -1
- package/esm/tooling/check/environment-step.d.mts +2 -4
- package/esm/tooling/check/environment-step.d.mts.map +1 -1
- package/esm/tooling/check/environment-step.mjs +1 -1
- package/esm/tooling/check/index.mjs +1 -1
- package/esm/tooling/check/lint-step.d.mts +5 -12
- package/esm/tooling/check/lint-step.d.mts.map +1 -1
- package/esm/tooling/check/lint-step.mjs +16 -12
- package/esm/tooling/check/lint-step.mjs.map +1 -1
- package/esm/tooling/check/request-input.mjs +15 -15
- package/esm/tooling/check/request-input.mjs.map +1 -1
- package/esm/tooling/check/run-check.d.mts +24 -14
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-check.mjs +2 -2
- package/esm/tooling/check/run-check.mjs.map +1 -1
- package/esm/tooling/check/run-tests.d.mts +22 -15
- package/esm/tooling/check/run-tests.d.mts.map +1 -1
- package/esm/tooling/check/security-conventions.mjs +133 -131
- package/esm/tooling/check/security-conventions.mjs.map +1 -1
- package/esm/tooling/check/source-ast.mjs +92 -132
- package/esm/tooling/check/source-ast.mjs.map +1 -1
- package/esm/tooling/check/tests-step.d.mts +7 -8
- package/esm/tooling/check/tests-step.d.mts.map +1 -1
- package/esm/tooling/check/tests-step.mjs +3 -3
- package/esm/tooling/check/tests-step.mjs.map +1 -1
- package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
- package/esm/tooling/devtools/devtools-client.d.mts +29 -20
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
- package/esm/tooling/generate/generation.d.mts +34 -22
- package/esm/tooling/generate/generation.d.mts.map +1 -1
- package/esm/tooling/generate/generation.mjs +9 -5
- package/esm/tooling/generate/generation.mjs.map +1 -1
- package/esm/tooling/generate/generator-spec.d.mts +9 -9
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
- package/esm/tooling/generate/index.mjs +1 -1
- package/esm/tooling/generate/project-files.mjs +3 -3
- package/esm/tooling/generate/project-files.mjs.map +1 -1
- package/esm/tooling/generate/run-cli.d.mts +14 -11
- package/esm/tooling/generate/run-cli.d.mts.map +1 -1
- package/esm/tooling/generate/run-cli.mjs +2 -2
- package/esm/tooling/generate/run-cli.mjs.map +1 -1
- package/esm/tooling/generate/unified-diff.d.mts +10 -7
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
- package/esm/tooling/index.d.mts +1 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-config.mjs +3 -3
- package/esm/tooling/inspect/collect-config.mjs.map +1 -1
- package/esm/tooling/inspect/collect-models.d.mts +4 -3
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-models.mjs +1 -1
- package/esm/tooling/inspect/collect-packages.d.mts +1 -2
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-pages.mjs +10 -10
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
- package/esm/tooling/inspect/collect-routes.mjs +1 -1
- package/esm/tooling/inspect/event-recorder.d.mts +7 -7
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
- package/esm/tooling/inspect/index.d.mts +2 -1
- package/esm/tooling/inspect/index.mjs +1 -1
- package/esm/tooling/inspect/inspect-app.d.mts +25 -16
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
- package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
- package/esm/tooling/mcp/db-schema.d.mts +10 -9
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
- package/esm/tooling/mcp/docs-search.d.mts +20 -15
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
- package/esm/tooling/mcp/index.mjs +1 -1
- package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
- package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/mcp-tools.mjs +3 -2
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
- package/esm/tooling/mcp/tool-input.d.mts +7 -7
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
- package/esm/tooling/problem.d.mts +27 -17
- package/esm/tooling/problem.d.mts.map +1 -1
- package/esm/tooling/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +36 -22
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.d.mts +27 -20
- package/esm/tooling/trace/trace-request.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.mjs +2 -2
- package/esm/tooling/trace/trace-request.mjs.map +1 -1
- package/esm/tooling/typecheck/index.mjs +1 -1
- package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
- package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/upgrade/codemods/index.mjs +3 -1
- package/esm/upgrade/codemods/index.mjs.map +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
- package/esm/upgrade/codemods/oxc-toolchain.mjs +142 -0
- package/esm/upgrade/codemods/oxc-toolchain.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
- package/esm/upgrade/codemods/toolchain-templates.mjs +244 -0
- package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +1 -1
- package/esm/upgrade/diff.mjs.map +1 -1
- package/esm/upgrade/load-ts-morph.mjs +3 -2
- package/esm/upgrade/load-ts-morph.mjs.map +1 -1
- package/esm/upgrade/run-upgrade.mjs +26 -7
- package/esm/upgrade/run-upgrade.mjs.map +1 -1
- package/esm/use-cases/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +8 -6
- package/esm/utils/clock.d.mts.map +1 -1
- package/esm/utils/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +9 -6
- package/esm/utils/ids.d.mts.map +1 -1
- package/esm/utils/index.d.mts +2 -1
- package/esm/utils/index.mjs +1 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +11 -10
- package/esm/utils/runtime.d.mts.map +1 -1
- package/esm/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +5 -1
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +6 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +2 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +2 -2
- package/esm/validation/validation-failure-status.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +2 -4
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +8 -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 +379 -22
- package/llms.txt +3 -2
- package/package.json +27 -15
- package/skills/README.md +2 -1
- package/skills/create-module/SKILL.md +7 -0
- package/skills/index.md +3 -1
- package/skills/report-framework-issue.md +154 -0
- package/skills/run-app/SKILL.md +120 -10
- package/skills/store-secrets/SKILL.md +102 -0
- package/skills/test-fakes/SKILL.md +13 -11
- package/skills/upgrade-from-5-29/SKILL.md +78 -0
- package/skills/warlock-check/SKILL.md +6 -1
- package/skills/warlock-doctor/SKILL.md +9 -0
- package/skills/wire-socket/SKILL.md +19 -0
- package/skills/write-cli-command/SKILL.md +21 -0
- package/esm/tooling/check/index.d.mts +0 -8
- package/esm/tooling/typecheck/index.d.mts +0 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { parseSync, visitorKeys } from "oxc-parser";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/tooling/syntax/ast.ts
|
|
4
|
+
const parents = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
const sources = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function forEachChild(node, visit) {
|
|
7
|
+
const record = node;
|
|
8
|
+
for (const key of visitorKeys[node.type] ?? []) {
|
|
9
|
+
const value = record[key];
|
|
10
|
+
for (const child of Array.isArray(value) ? value : [value]) if (child && typeof child === "object" && "type" in child) visit(child);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function parseSourceFile(fileName, text) {
|
|
14
|
+
const source = Object.assign(parseSync(fileName, text).program, {
|
|
15
|
+
fileName,
|
|
16
|
+
text
|
|
17
|
+
});
|
|
18
|
+
const attach = (node) => {
|
|
19
|
+
sources.set(node, source);
|
|
20
|
+
forEachChild(node, (child) => {
|
|
21
|
+
parents.set(child, node);
|
|
22
|
+
attach(child);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
attach(source);
|
|
26
|
+
return source;
|
|
27
|
+
}
|
|
28
|
+
function parentOf(node) {
|
|
29
|
+
return parents.get(node);
|
|
30
|
+
}
|
|
31
|
+
function sourceOf(node) {
|
|
32
|
+
const source = sources.get(node);
|
|
33
|
+
if (!source) throw new Error("Node has no source file.");
|
|
34
|
+
return source;
|
|
35
|
+
}
|
|
36
|
+
function textOf(node) {
|
|
37
|
+
return node.type === "Identifier" ? node.name : sourceOf(node).text.slice(node.start, node.end);
|
|
38
|
+
}
|
|
39
|
+
function keyName(node) {
|
|
40
|
+
if (!node) return void 0;
|
|
41
|
+
const parent = parentOf(node);
|
|
42
|
+
if (parent && "computed" in parent && parent.computed) return void 0;
|
|
43
|
+
if (node.type === "Identifier" || node.type === "PrivateIdentifier") return node.name;
|
|
44
|
+
if (node.type === "JSXIdentifier") return node.name;
|
|
45
|
+
if (node.type === "Literal" && (typeof node.value === "string" || typeof node.value === "number")) return String(node.value);
|
|
46
|
+
if (node.type === "TemplateLiteral" && node.expressions.length === 0) return node.quasis[0]?.value.cooked ?? void 0;
|
|
47
|
+
}
|
|
48
|
+
function positionOf(source, node) {
|
|
49
|
+
const lines = source.text.slice(0, node.start).split("\n");
|
|
50
|
+
return {
|
|
51
|
+
line: lines.length,
|
|
52
|
+
column: (lines.at(-1)?.length ?? 0) + 1
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function expressionOf(node) {
|
|
56
|
+
if (node.type === "CallExpression" || node.type === "NewExpression") return node.callee;
|
|
57
|
+
if (node.type === "MemberExpression") return node.object;
|
|
58
|
+
if (node.type === "AwaitExpression" || node.type === "SpreadElement") return node.argument;
|
|
59
|
+
if (node.type === "IfStatement") return node.test;
|
|
60
|
+
if ("expression" in node && node.expression && typeof node.expression === "object") return node.expression;
|
|
61
|
+
throw new Error(`No expression on ${node.type}.`);
|
|
62
|
+
}
|
|
63
|
+
function nameNode(node) {
|
|
64
|
+
if ("id" in node && node.id) return node.id;
|
|
65
|
+
if ("key" in node) return node.key;
|
|
66
|
+
if (node.type === "ImportSpecifier" || node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier") return node.local;
|
|
67
|
+
if (node.type === "JSXAttribute") return node.name;
|
|
68
|
+
throw new Error(`No name on ${node.type}.`);
|
|
69
|
+
}
|
|
70
|
+
function declarationName(node) {
|
|
71
|
+
return "id" in node && node.id?.type === "Identifier" ? node.id.name : void 0;
|
|
72
|
+
}
|
|
73
|
+
function valueText(node) {
|
|
74
|
+
return keyName(node) ?? (node.type === "Literal" ? node.raw ?? "" : textOf(node));
|
|
75
|
+
}
|
|
76
|
+
function isCallExpression(node) {
|
|
77
|
+
return node.type === "CallExpression";
|
|
78
|
+
}
|
|
79
|
+
function isNewExpression(node) {
|
|
80
|
+
return node.type === "NewExpression";
|
|
81
|
+
}
|
|
82
|
+
function isIdentifier(node) {
|
|
83
|
+
return node.type === "Identifier";
|
|
84
|
+
}
|
|
85
|
+
function isObjectLiteralExpression(node) {
|
|
86
|
+
return node.type === "ObjectExpression";
|
|
87
|
+
}
|
|
88
|
+
function isVariableDeclaration(node) {
|
|
89
|
+
return node.type === "VariableDeclarator";
|
|
90
|
+
}
|
|
91
|
+
function isVariableStatement(node) {
|
|
92
|
+
return node.type === "VariableDeclaration";
|
|
93
|
+
}
|
|
94
|
+
function isImportDeclaration(node) {
|
|
95
|
+
return node.type === "ImportDeclaration";
|
|
96
|
+
}
|
|
97
|
+
function isPropertyAssignment(node) {
|
|
98
|
+
return node.type === "Property" && !node.shorthand && !node.method && node.kind === "init";
|
|
99
|
+
}
|
|
100
|
+
function isShorthandPropertyAssignment(node) {
|
|
101
|
+
return node.type === "Property" && node.shorthand;
|
|
102
|
+
}
|
|
103
|
+
function isPropertyDeclaration(node) {
|
|
104
|
+
return node.type === "PropertyDefinition";
|
|
105
|
+
}
|
|
106
|
+
function isExportAssignment(node) {
|
|
107
|
+
return node.type === "ExportDefaultDeclaration";
|
|
108
|
+
}
|
|
109
|
+
function isExportDeclaration(node) {
|
|
110
|
+
return node.type === "ExportNamedDeclaration";
|
|
111
|
+
}
|
|
112
|
+
function isClassDeclaration(node) {
|
|
113
|
+
return node.type === "ClassDeclaration";
|
|
114
|
+
}
|
|
115
|
+
function isFunctionDeclaration(node) {
|
|
116
|
+
return node.type === "FunctionDeclaration";
|
|
117
|
+
}
|
|
118
|
+
function isFunctionExpression(node) {
|
|
119
|
+
return node.type === "FunctionExpression";
|
|
120
|
+
}
|
|
121
|
+
function isArrowFunction(node) {
|
|
122
|
+
return node.type === "ArrowFunctionExpression";
|
|
123
|
+
}
|
|
124
|
+
function isInterfaceDeclaration(node) {
|
|
125
|
+
return node.type === "TSInterfaceDeclaration";
|
|
126
|
+
}
|
|
127
|
+
function isTypeAliasDeclaration(node) {
|
|
128
|
+
return node.type === "TSTypeAliasDeclaration";
|
|
129
|
+
}
|
|
130
|
+
function isAwaitExpression(node) {
|
|
131
|
+
return node.type === "AwaitExpression";
|
|
132
|
+
}
|
|
133
|
+
function isArrayLiteralExpression(node) {
|
|
134
|
+
return node.type === "ArrayExpression";
|
|
135
|
+
}
|
|
136
|
+
function isSpreadElement(node) {
|
|
137
|
+
return node.type === "SpreadElement";
|
|
138
|
+
}
|
|
139
|
+
function isSpreadAssignment(node) {
|
|
140
|
+
return node.type === "SpreadElement";
|
|
141
|
+
}
|
|
142
|
+
function isAsExpression(node) {
|
|
143
|
+
return node.type === "TSAsExpression";
|
|
144
|
+
}
|
|
145
|
+
function isNonNullExpression(node) {
|
|
146
|
+
return node.type === "TSNonNullExpression";
|
|
147
|
+
}
|
|
148
|
+
function isSatisfiesExpression(node) {
|
|
149
|
+
return node.type === "TSSatisfiesExpression";
|
|
150
|
+
}
|
|
151
|
+
function isTypeAssertionExpression(node) {
|
|
152
|
+
return node.type === "TSTypeAssertion";
|
|
153
|
+
}
|
|
154
|
+
function isParenthesizedExpression(node) {
|
|
155
|
+
return node.type === "ParenthesizedExpression";
|
|
156
|
+
}
|
|
157
|
+
function isJsxAttribute(node) {
|
|
158
|
+
return node.type === "JSXAttribute";
|
|
159
|
+
}
|
|
160
|
+
function isJsxExpression(node) {
|
|
161
|
+
return node.type === "JSXExpressionContainer";
|
|
162
|
+
}
|
|
163
|
+
function isJsxOpeningElement(node) {
|
|
164
|
+
return node.type === "JSXOpeningElement";
|
|
165
|
+
}
|
|
166
|
+
function isJsxSelfClosingElement(node) {
|
|
167
|
+
return node.type === "JSXOpeningElement" && node.selfClosing;
|
|
168
|
+
}
|
|
169
|
+
function isIfStatement(node) {
|
|
170
|
+
return node.type === "IfStatement";
|
|
171
|
+
}
|
|
172
|
+
function isConditionalExpression(node) {
|
|
173
|
+
return node.type === "ConditionalExpression";
|
|
174
|
+
}
|
|
175
|
+
function isTemplateExpression(node) {
|
|
176
|
+
return node.type === "TemplateLiteral" && node.expressions.length > 0;
|
|
177
|
+
}
|
|
178
|
+
function isPropertySignature(node) {
|
|
179
|
+
return node.type === "TSPropertySignature";
|
|
180
|
+
}
|
|
181
|
+
function isUnionTypeNode(node) {
|
|
182
|
+
return node.type === "TSUnionType";
|
|
183
|
+
}
|
|
184
|
+
function isLiteralTypeNode(node) {
|
|
185
|
+
return node.type === "TSLiteralType";
|
|
186
|
+
}
|
|
187
|
+
function isExpressionStatement(node) {
|
|
188
|
+
return node.type === "ExpressionStatement";
|
|
189
|
+
}
|
|
190
|
+
function isStringLiteral(node) {
|
|
191
|
+
return node.type === "Literal" && typeof node.value === "string";
|
|
192
|
+
}
|
|
193
|
+
function isNumericLiteral(node) {
|
|
194
|
+
return node.type === "Literal" && typeof node.value === "number";
|
|
195
|
+
}
|
|
196
|
+
function isNoSubstitutionTemplateLiteral(node) {
|
|
197
|
+
return node.type === "TemplateLiteral" && node.expressions.length === 0;
|
|
198
|
+
}
|
|
199
|
+
function isBinaryExpression(node) {
|
|
200
|
+
return node.type === "BinaryExpression" || node.type === "LogicalExpression" || node.type === "AssignmentExpression";
|
|
201
|
+
}
|
|
202
|
+
function isRegularExpressionLiteral(node) {
|
|
203
|
+
return node.type === "Literal" && "regex" in node;
|
|
204
|
+
}
|
|
205
|
+
function isElementAccessExpression(node) {
|
|
206
|
+
return node.type === "MemberExpression" && node.computed;
|
|
207
|
+
}
|
|
208
|
+
function isComputedPropertyName(node) {
|
|
209
|
+
const parent = parentOf(node);
|
|
210
|
+
return !!parent && "computed" in parent && parent.computed;
|
|
211
|
+
}
|
|
212
|
+
function isOmittedExpression(node) {
|
|
213
|
+
return node === null;
|
|
214
|
+
}
|
|
215
|
+
function hasModifier(node, modifier) {
|
|
216
|
+
const parent = parentOf(node);
|
|
217
|
+
if (modifier === "export") return parent?.type === "ExportNamedDeclaration" || parent?.type === "ExportDefaultDeclaration";
|
|
218
|
+
if (modifier === "default") return parent?.type === "ExportDefaultDeclaration";
|
|
219
|
+
return modifier in node && Reflect.get(node, modifier) === true;
|
|
220
|
+
}
|
|
221
|
+
function topLevelDeclarations(source) {
|
|
222
|
+
return source.body.map((statement) => (statement.type === "ExportNamedDeclaration" || statement.type === "ExportDefaultDeclaration") && statement.declaration ? statement.declaration : statement);
|
|
223
|
+
}
|
|
224
|
+
function isEnumDeclaration(node) {
|
|
225
|
+
return node.type === "TSEnumDeclaration";
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
//#endregion
|
|
229
|
+
export { declarationName, expressionOf, forEachChild, hasModifier, isArrayLiteralExpression, isArrowFunction, isAsExpression, isAwaitExpression, isBinaryExpression, isCallExpression, isClassDeclaration, isComputedPropertyName, isConditionalExpression, isElementAccessExpression, isEnumDeclaration, isExportAssignment, isExportDeclaration, isExpressionStatement, isFunctionDeclaration, isFunctionExpression, isIdentifier, isIfStatement, isImportDeclaration, isInterfaceDeclaration, isJsxAttribute, isJsxExpression, isJsxOpeningElement, isJsxSelfClosingElement, isLiteralTypeNode, isNewExpression, isNoSubstitutionTemplateLiteral, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isOmittedExpression, isParenthesizedExpression, isPropertyAssignment, isPropertyDeclaration, isPropertySignature, isRegularExpressionLiteral, isSatisfiesExpression, isShorthandPropertyAssignment, isSpreadAssignment, isSpreadElement, isStringLiteral, isTemplateExpression, isTypeAliasDeclaration, isTypeAssertionExpression, isUnionTypeNode, isVariableDeclaration, isVariableStatement, keyName, nameNode, parentOf, parseSourceFile, positionOf, sourceOf, textOf, topLevelDeclarations, valueText };
|
|
230
|
+
//# sourceMappingURL=ast.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/syntax/ast.ts"],"sourcesContent":["import { parseSync, visitorKeys, type Node, type Program } from \"oxc-parser\";\nexport type * from \"oxc-parser\";\n\nexport type SourceFile = Program & { fileName: string; text: string };\nconst parents = new WeakMap<Node, Node>();\nconst sources = new WeakMap<Node, SourceFile>();\n\nexport function forEachChild(node: Node, visit: (node: Node) => void): void {\n const record = node as unknown as Record<string, unknown>;\n for (const key of visitorKeys[node.type] ?? []) {\n const value = record[key];\n for (const child of Array.isArray(value) ? value : [value]) {\n if (child && typeof child === \"object\" && \"type\" in child) visit(child as Node);\n }\n }\n}\n\nexport function parseSourceFile(fileName: string, text: string): SourceFile {\n const source = Object.assign(parseSync(fileName, text).program, { fileName, text });\n const attach = (node: Node): void => {\n sources.set(node, source);\n forEachChild(node, (child) => {\n parents.set(child, node);\n attach(child);\n });\n };\n attach(source);\n return source;\n}\nexport function parentOf(node: Node): Node | undefined {\n return parents.get(node);\n}\nexport function sourceOf(node: Node): SourceFile {\n const source = sources.get(node);\n if (!source) throw new Error(\"Node has no source file.\");\n return source;\n}\nexport function textOf(node: Node): string {\n return node.type === \"Identifier\" ? node.name : sourceOf(node).text.slice(node.start, node.end);\n}\nexport function keyName(node: Node | null | undefined): string | undefined {\n if (!node) return undefined;\n const parent = parentOf(node);\n if (parent && \"computed\" in parent && parent.computed) return undefined;\n if (node.type === \"Identifier\" || node.type === \"PrivateIdentifier\") return node.name;\n if (node.type === \"JSXIdentifier\") return node.name;\n if (node.type === \"Literal\" && (typeof node.value === \"string\" || typeof node.value === \"number\"))\n return String(node.value);\n if (node.type === \"TemplateLiteral\" && node.expressions.length === 0)\n return node.quasis[0]?.value.cooked ?? undefined;\n return undefined;\n}\nexport function positionOf(source: SourceFile, node: Node): { line: number; column: number } {\n const lines = source.text.slice(0, node.start).split(\"\\n\");\n return { line: lines.length, column: (lines.at(-1)?.length ?? 0) + 1 };\n}\n\nexport function expressionOf(node: Node): Node {\n if (node.type === \"CallExpression\" || node.type === \"NewExpression\") return node.callee;\n if (node.type === \"MemberExpression\") return node.object;\n if (node.type === \"AwaitExpression\" || node.type === \"SpreadElement\") return node.argument;\n if (node.type === \"IfStatement\") return node.test;\n if (\"expression\" in node && node.expression && typeof node.expression === \"object\")\n return node.expression;\n throw new Error(`No expression on ${node.type}.`);\n}\nexport function nameNode(node: Node): Node {\n if (\"id\" in node && node.id) return node.id;\n if (\"key\" in node) return node.key;\n if (\n node.type === \"ImportSpecifier\" ||\n node.type === \"ImportDefaultSpecifier\" ||\n node.type === \"ImportNamespaceSpecifier\"\n )\n return node.local;\n if (node.type === \"JSXAttribute\") return node.name;\n throw new Error(`No name on ${node.type}.`);\n}\nexport function declarationName(node: Node): string | undefined {\n return \"id\" in node && node.id?.type === \"Identifier\" ? node.id.name : undefined;\n}\nexport function valueText(node: Node): string {\n return keyName(node) ?? (node.type === \"Literal\" ? (node.raw ?? \"\") : textOf(node));\n}\nexport function initializerOf(\n node: import(\"oxc-parser\").ObjectProperty,\n): import(\"oxc-parser\").Expression;\nexport function initializerOf(node: Node): Node | null;\nexport function initializerOf(node: Node): Node | null {\n if (node.type === \"Property\") return node.value;\n if (node.type === \"VariableDeclarator\") return node.init;\n if (node.type === \"PropertyDefinition\" || node.type === \"JSXAttribute\") return node.value;\n return null;\n}\n\nexport function isCallExpression(node: Node): node is Node & { type: \"CallExpression\" } {\n return node.type === \"CallExpression\";\n}\n\nexport function isNewExpression(node: Node): node is Node & { type: \"NewExpression\" } {\n return node.type === \"NewExpression\";\n}\n\nexport function isIdentifier(node: Node): node is Node & { type: \"Identifier\" } {\n return node.type === \"Identifier\";\n}\n\nexport function isObjectLiteralExpression(node: Node): node is Node & { type: \"ObjectExpression\" } {\n return node.type === \"ObjectExpression\";\n}\n\nexport function isVariableDeclaration(node: Node): node is Node & { type: \"VariableDeclarator\" } {\n return node.type === \"VariableDeclarator\";\n}\n\nexport function isVariableStatement(node: Node): node is Node & { type: \"VariableDeclaration\" } {\n return node.type === \"VariableDeclaration\";\n}\n\nexport function isImportDeclaration(node: Node): node is Node & { type: \"ImportDeclaration\" } {\n return node.type === \"ImportDeclaration\";\n}\n\nexport function isPropertyAssignment(\n node: Node,\n): node is Node & { type: \"Property\"; shorthand: false; method: false; kind: \"init\" } {\n return node.type === \"Property\" && !node.shorthand && !node.method && node.kind === \"init\";\n}\n\nexport function isShorthandPropertyAssignment(\n node: Node,\n): node is Node & { type: \"Property\"; shorthand: true } {\n return node.type === \"Property\" && node.shorthand;\n}\n\nexport function isPropertyDeclaration(node: Node): node is Node & { type: \"PropertyDefinition\" } {\n return node.type === \"PropertyDefinition\";\n}\n\nexport function isExportAssignment(\n node: Node,\n): node is Node & { type: \"ExportDefaultDeclaration\" } {\n return node.type === \"ExportDefaultDeclaration\";\n}\n\nexport function isExportDeclaration(node: Node): node is Node & { type: \"ExportNamedDeclaration\" } {\n return node.type === \"ExportNamedDeclaration\";\n}\n\nexport function isClassDeclaration(node: Node): node is Node & { type: \"ClassDeclaration\" } {\n return node.type === \"ClassDeclaration\";\n}\n\nexport function isClassExpression(node: Node): node is Node & { type: \"ClassExpression\" } {\n return node.type === \"ClassExpression\";\n}\n\nexport function isFunctionDeclaration(node: Node): node is Node & { type: \"FunctionDeclaration\" } {\n return node.type === \"FunctionDeclaration\";\n}\n\nexport function isFunctionExpression(node: Node): node is Node & { type: \"FunctionExpression\" } {\n return node.type === \"FunctionExpression\";\n}\n\nexport function isArrowFunction(node: Node): node is Node & { type: \"ArrowFunctionExpression\" } {\n return node.type === \"ArrowFunctionExpression\";\n}\n\nexport function isInterfaceDeclaration(\n node: Node,\n): node is Node & { type: \"TSInterfaceDeclaration\" } {\n return node.type === \"TSInterfaceDeclaration\";\n}\n\nexport function isTypeAliasDeclaration(\n node: Node,\n): node is Node & { type: \"TSTypeAliasDeclaration\" } {\n return node.type === \"TSTypeAliasDeclaration\";\n}\n\nexport function isTypeReferenceNode(node: Node): node is Node & { type: \"TSTypeReference\" } {\n return node.type === \"TSTypeReference\";\n}\n\nexport function isAwaitExpression(node: Node): node is Node & { type: \"AwaitExpression\" } {\n return node.type === \"AwaitExpression\";\n}\n\nexport function isArrayLiteralExpression(node: Node): node is Node & { type: \"ArrayExpression\" } {\n return node.type === \"ArrayExpression\";\n}\n\nexport function isSpreadElement(node: Node): node is Node & { type: \"SpreadElement\" } {\n return node.type === \"SpreadElement\";\n}\n\nexport function isSpreadAssignment(node: Node): node is Node & { type: \"SpreadElement\" } {\n return node.type === \"SpreadElement\";\n}\n\nexport function isAsExpression(node: Node): node is Node & { type: \"TSAsExpression\" } {\n return node.type === \"TSAsExpression\";\n}\n\nexport function isNonNullExpression(node: Node): node is Node & { type: \"TSNonNullExpression\" } {\n return node.type === \"TSNonNullExpression\";\n}\n\nexport function isSatisfiesExpression(\n node: Node,\n): node is Node & { type: \"TSSatisfiesExpression\" } {\n return node.type === \"TSSatisfiesExpression\";\n}\n\nexport function isTypeAssertionExpression(node: Node): node is Node & { type: \"TSTypeAssertion\" } {\n return node.type === \"TSTypeAssertion\";\n}\n\nexport function isParenthesizedExpression(\n node: Node,\n): node is Node & { type: \"ParenthesizedExpression\" } {\n return node.type === \"ParenthesizedExpression\";\n}\n\nexport function isJsxAttribute(node: Node): node is Node & { type: \"JSXAttribute\" } {\n return node.type === \"JSXAttribute\";\n}\n\nexport function isJsxExpression(node: Node): node is Node & { type: \"JSXExpressionContainer\" } {\n return node.type === \"JSXExpressionContainer\";\n}\n\nexport function isJsxOpeningElement(node: Node): node is Node & { type: \"JSXOpeningElement\" } {\n return node.type === \"JSXOpeningElement\";\n}\n\nexport function isJsxSelfClosingElement(node: Node): node is Node & { type: \"JSXOpeningElement\" } {\n return node.type === \"JSXOpeningElement\" && node.selfClosing;\n}\n\nexport function isIfStatement(node: Node): node is Node & { type: \"IfStatement\" } {\n return node.type === \"IfStatement\";\n}\n\nexport function isConditionalExpression(\n node: Node,\n): node is Node & { type: \"ConditionalExpression\" } {\n return node.type === \"ConditionalExpression\";\n}\n\nexport function isTemplateExpression(node: Node): node is Node & { type: \"TemplateLiteral\" } {\n return node.type === \"TemplateLiteral\" && node.expressions.length > 0;\n}\n\nexport function isPropertySignature(node: Node): node is Node & { type: \"TSPropertySignature\" } {\n return node.type === \"TSPropertySignature\";\n}\n\nexport function isUnionTypeNode(node: Node): node is Node & { type: \"TSUnionType\" } {\n return node.type === \"TSUnionType\";\n}\n\nexport function isLiteralTypeNode(node: Node): node is Node & { type: \"TSLiteralType\" } {\n return node.type === \"TSLiteralType\";\n}\n\nexport function isPrivateIdentifier(node: Node): node is Node & { type: \"PrivateIdentifier\" } {\n return node.type === \"PrivateIdentifier\";\n}\n\nexport function isExpressionStatement(node: Node): node is Node & { type: \"ExpressionStatement\" } {\n return node.type === \"ExpressionStatement\";\n}\n\nexport function isStringLiteral(node: Node): node is import(\"oxc-parser\").StringLiteral {\n return node.type === \"Literal\" && typeof node.value === \"string\";\n}\nexport function isNumericLiteral(node: Node): node is import(\"oxc-parser\").NumericLiteral {\n return node.type === \"Literal\" && typeof node.value === \"number\";\n}\nexport function isNoSubstitutionTemplateLiteral(\n node: Node,\n): node is import(\"oxc-parser\").TemplateLiteral {\n return node.type === \"TemplateLiteral\" && node.expressions.length === 0;\n}\nexport function isBinaryExpression(\n node: Node,\n): node is\n | import(\"oxc-parser\").BinaryExpression\n | import(\"oxc-parser\").LogicalExpression\n | import(\"oxc-parser\").AssignmentExpression {\n return (\n node.type === \"BinaryExpression\" ||\n node.type === \"LogicalExpression\" ||\n node.type === \"AssignmentExpression\"\n );\n}\nexport function isRegularExpressionLiteral(node: Node): node is import(\"oxc-parser\").RegExpLiteral {\n return node.type === \"Literal\" && \"regex\" in node;\n}\nexport function isPropertyAccessExpression(\n node: Node,\n): node is import(\"oxc-parser\").MemberExpression & { computed: false } {\n return node.type === \"MemberExpression\" && !node.computed;\n}\nexport function isElementAccessExpression(\n node: Node,\n): node is import(\"oxc-parser\").MemberExpression & { computed: true } {\n return node.type === \"MemberExpression\" && node.computed;\n}\nexport function isComputedPropertyName(node: Node): boolean {\n const parent = parentOf(node);\n return !!parent && \"computed\" in parent && parent.computed;\n}\nexport function isOmittedExpression(node: Node | null): node is null {\n return node === null;\n}\nexport function hasModifier(\n node: Node,\n modifier: \"export\" | \"default\" | \"static\" | \"declare\",\n): boolean {\n const parent = parentOf(node);\n if (modifier === \"export\")\n return parent?.type === \"ExportNamedDeclaration\" || parent?.type === \"ExportDefaultDeclaration\";\n if (modifier === \"default\") return parent?.type === \"ExportDefaultDeclaration\";\n return modifier in node && Reflect.get(node, modifier) === true;\n}\nexport function topLevelDeclarations(source: SourceFile): Node[] {\n return source.body.map((statement) =>\n (statement.type === \"ExportNamedDeclaration\" ||\n statement.type === \"ExportDefaultDeclaration\") &&\n statement.declaration\n ? statement.declaration\n : statement,\n );\n}\n\nexport type Identifier = Node & { type: \"Identifier\" };\nexport type FunctionDeclaration = Node & { type: \"FunctionDeclaration\" };\nexport type FunctionExpression = Node & { type: \"FunctionExpression\" };\nexport function isEnumDeclaration(node: Node): node is Node & { type: \"TSEnumDeclaration\" } {\n return node.type === \"TSEnumDeclaration\";\n}\n"],"mappings":";;;AAIA,MAAM,0BAAU,IAAI,QAAoB;AACxC,MAAM,0BAAU,IAAI,QAA0B;AAE9C,SAAgB,aAAa,MAAY,OAAmC;CAC1E,MAAM,SAAS;CACf,KAAK,MAAM,OAAO,YAAY,KAAK,SAAS,CAAC,GAAG;EAC9C,MAAM,QAAQ,OAAO;EACrB,KAAK,MAAM,SAAS,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK,GACvD,IAAI,SAAS,OAAO,UAAU,YAAY,UAAU,OAAO,MAAM,KAAa;CAElF;AACF;AAE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,SAAgB,0BACd,MACoE;CACpE,OAAO,KAAK,SAAS,sBAAsB,KAAK;AAClD;AACA,SAAgB,uBAAuB,MAAqB;CAC1D,MAAM,SAAS,SAAS,IAAI;CAC5B,OAAO,CAAC,CAAC,UAAU,cAAc,UAAU,OAAO;AACpD;AACA,SAAgB,oBAAoB,MAAiC;CACnE,OAAO,SAAS;AAClB;AACA,SAAgB,YACd,MACA,UACS;CACT,MAAM,SAAS,SAAS,IAAI;CAC5B,IAAI,aAAa,UACf,OAAO,QAAQ,SAAS,4BAA4B,QAAQ,SAAS;CACvE,IAAI,aAAa,WAAW,OAAO,QAAQ,SAAS;CACpD,OAAO,YAAY,QAAQ,QAAQ,IAAI,MAAM,QAAQ,MAAM;AAC7D;AACA,SAAgB,qBAAqB,QAA4B;CAC/D,OAAO,OAAO,KAAK,KAAK,eACrB,UAAU,SAAS,4BAClB,UAAU,SAAS,+BACrB,UAAU,cACN,UAAU,cACV,SACN;AACF;AAKA,SAAgB,kBAAkB,MAA0D;CAC1F,OAAO,KAAK,SAAS;AACvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { forEachChild, parseSourceFile } from "./ast.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/tooling/syntax/imports.ts
|
|
4
|
+
/** Module references in real syntax, including type-only, dynamic and require references. */
|
|
5
|
+
function importSpecifiers(fileName, source) {
|
|
6
|
+
const found = [];
|
|
7
|
+
const visit = (node) => {
|
|
8
|
+
if ((node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") && node.source) found.push({
|
|
9
|
+
specifier: node.source.value,
|
|
10
|
+
node: node.source,
|
|
11
|
+
dynamic: false
|
|
12
|
+
});
|
|
13
|
+
else if (node.type === "ImportExpression" && node.source.type === "Literal" && typeof node.source.value === "string") found.push({
|
|
14
|
+
specifier: node.source.value,
|
|
15
|
+
node: node.source,
|
|
16
|
+
dynamic: true
|
|
17
|
+
});
|
|
18
|
+
else if (node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "require") {
|
|
19
|
+
const argument = node.arguments[0];
|
|
20
|
+
if (argument?.type === "Literal" && typeof argument.value === "string") found.push({
|
|
21
|
+
specifier: argument.value,
|
|
22
|
+
node: argument,
|
|
23
|
+
dynamic: false
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
forEachChild(node, visit);
|
|
27
|
+
};
|
|
28
|
+
visit(parseSourceFile(fileName, source));
|
|
29
|
+
return found;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { importSpecifiers };
|
|
34
|
+
//# sourceMappingURL=imports.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/syntax/imports.ts"],"sourcesContent":["import { forEachChild, parseSourceFile, type Node } from \"./ast\";\n\n/** Module references in real syntax, including type-only, dynamic and require references. */\nexport function importSpecifiers(\n fileName: string,\n source: string,\n): { specifier: string; node: Node; dynamic: boolean }[] {\n const found: { specifier: string; node: Node; dynamic: boolean }[] = [];\n const visit = (node: Node): void => {\n if (\n (node.type === \"ImportDeclaration\" ||\n node.type === \"ExportNamedDeclaration\" ||\n node.type === \"ExportAllDeclaration\") &&\n node.source\n )\n found.push({ specifier: node.source.value, node: node.source, dynamic: false });\n else if (\n node.type === \"ImportExpression\" &&\n node.source.type === \"Literal\" &&\n typeof node.source.value === \"string\"\n )\n found.push({ specifier: node.source.value, node: node.source, dynamic: true });\n else if (\n node.type === \"CallExpression\" &&\n node.callee.type === \"Identifier\" &&\n node.callee.name === \"require\"\n ) {\n const argument = node.arguments[0];\n if (argument?.type === \"Literal\" && typeof argument.value === \"string\")\n found.push({ specifier: argument.value, node: argument, dynamic: false });\n }\n forEachChild(node, visit);\n };\n visit(parseSourceFile(fileName, source));\n return found;\n}\n"],"mappings":";;;;AAGA,SAAgB,iBACd,UACA,QACuD;CACvD,MAAM,QAA+D,CAAC;CACtE,MAAM,SAAS,SAAqB;EAClC,KACG,KAAK,SAAS,uBACb,KAAK,SAAS,4BACd,KAAK,SAAS,2BAChB,KAAK,QAEL,MAAM,KAAK;GAAE,WAAW,KAAK,OAAO;GAAO,MAAM,KAAK;GAAQ,SAAS;EAAM,CAAC;OAC3E,IACH,KAAK,SAAS,sBACd,KAAK,OAAO,SAAS,aACrB,OAAO,KAAK,OAAO,UAAU,UAE7B,MAAM,KAAK;GAAE,WAAW,KAAK,OAAO;GAAO,MAAM,KAAK;GAAQ,SAAS;EAAK,CAAC;OAC1E,IACH,KAAK,SAAS,oBACd,KAAK,OAAO,SAAS,gBACrB,KAAK,OAAO,SAAS,WACrB;GACA,MAAM,WAAW,KAAK,UAAU;GAChC,IAAI,UAAU,SAAS,aAAa,OAAO,SAAS,UAAU,UAC5D,MAAM,KAAK;IAAE,WAAW,SAAS;IAAO,MAAM;IAAU,SAAS;GAAM,CAAC;EAC5E;EACA,aAAa,MAAM,KAAK;CAC1B;CACA,MAAM,gBAAgB,UAAU,MAAM,CAAC;CACvC,OAAO;AACT"}
|
|
@@ -1,51 +1,61 @@
|
|
|
1
1
|
import { DevtoolsPhaseRecord } from "../devtools/devtools-client.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/tooling/trace/trace-report.types.d.ts
|
|
4
3
|
/** The `schemaVersion` of {@link TraceReport}. Fields are only added within a version. */
|
|
5
|
-
declare const TRACE_SCHEMA_VERSION = 1;
|
|
4
|
+
export declare const TRACE_SCHEMA_VERSION = 1;
|
|
6
5
|
/** One middleware run, in the order it ran. */
|
|
7
|
-
type TraceMiddleware = {
|
|
6
|
+
export type TraceMiddleware = {
|
|
8
7
|
name: string | null;
|
|
9
8
|
index: number | null;
|
|
10
9
|
durationMs: number;
|
|
11
10
|
};
|
|
12
11
|
/** What the route's validation did. */
|
|
13
|
-
type TraceValidation = {
|
|
14
|
-
/** Whether a validation phase ran (the route declares a schema or a `validate` function). */
|
|
12
|
+
export type TraceValidation = {
|
|
13
|
+
/** Whether a validation phase ran (the route declares a schema or a `validate` function). */
|
|
14
|
+
ran: boolean;
|
|
15
15
|
durationMs: number | null;
|
|
16
16
|
/**
|
|
17
17
|
* `true` when validation ran and the handler ran after it (or the response
|
|
18
18
|
* succeeded); `false` when it ran, the handler did not, and the response is
|
|
19
19
|
* an error; `null` when validation did not run.
|
|
20
20
|
*/
|
|
21
|
-
passed: boolean | null;
|
|
21
|
+
passed: boolean | null;
|
|
22
|
+
/** The response body's `errors` (or the whole body) when validation failed; otherwise `null`. */
|
|
22
23
|
errors: unknown;
|
|
23
24
|
};
|
|
24
25
|
/** One recorded query, with its N+1 flag. */
|
|
25
|
-
type TraceQuery = Record<string, unknown> & {
|
|
26
|
-
/** `true` when the query's shape is one devtools reported as an N+1. */
|
|
26
|
+
export type TraceQuery = Record<string, unknown> & {
|
|
27
|
+
/** `true` when the query's shape is one devtools reported as an N+1. */
|
|
28
|
+
nPlusOne: boolean;
|
|
27
29
|
};
|
|
28
30
|
/** What `warlock trace --json` prints and `traceRequest()` returns. */
|
|
29
|
-
type TraceReport = {
|
|
30
|
-
schemaVersion: typeof TRACE_SCHEMA_VERSION;
|
|
31
|
-
|
|
31
|
+
export type TraceReport = {
|
|
32
|
+
schemaVersion: typeof TRACE_SCHEMA_VERSION;
|
|
33
|
+
/** The request id the server used (the `x-request-id` it echoed). */
|
|
34
|
+
requestId: string;
|
|
35
|
+
/** The dev server origin the request went to. */
|
|
32
36
|
server: string;
|
|
33
37
|
request: {
|
|
34
38
|
method: string;
|
|
35
|
-
url: string;
|
|
39
|
+
url: string;
|
|
40
|
+
/** Sent headers; `authorization`, `cookie` and `proxy-authorization` values read `[redacted]`. */
|
|
36
41
|
headers: Record<string, string>;
|
|
37
42
|
body: unknown;
|
|
38
43
|
};
|
|
39
44
|
response: {
|
|
40
45
|
status: number;
|
|
41
|
-
headers: Record<string, string>;
|
|
42
|
-
|
|
46
|
+
headers: Record<string, string>;
|
|
47
|
+
/** Parsed JSON when the content type is JSON, else text; `null` for an empty body. */
|
|
48
|
+
body: unknown;
|
|
49
|
+
/** Whether `body` was cut to the first 64 KiB. */
|
|
43
50
|
truncated: boolean;
|
|
44
|
-
};
|
|
45
|
-
|
|
51
|
+
};
|
|
52
|
+
/** The matched route pattern, e.g. `/posts/:id`, or `null`. */
|
|
53
|
+
route: string | null;
|
|
54
|
+
/** The error devtools recorded for the request, or `null`. */
|
|
46
55
|
error: string | null;
|
|
47
56
|
timeline: {
|
|
48
|
-
/** Every recorded phase in the order it was recorded. */
|
|
57
|
+
/** Every recorded phase in the order it was recorded. */
|
|
58
|
+
phases: DevtoolsPhaseRecord[];
|
|
49
59
|
routeMatch: {
|
|
50
60
|
durationMs: number;
|
|
51
61
|
} | null;
|
|
@@ -55,17 +65,21 @@ type TraceReport = {
|
|
|
55
65
|
durationMs: number;
|
|
56
66
|
} | null;
|
|
57
67
|
};
|
|
58
|
-
queries: TraceQuery[];
|
|
68
|
+
queries: TraceQuery[];
|
|
69
|
+
/** Devtools warnings for the request (`{ type: "n+1", message, shape, count, caller }`). */
|
|
59
70
|
warnings: Record<string, unknown>[];
|
|
60
71
|
logs: Record<string, unknown>[];
|
|
61
|
-
cache: Record<string, unknown>[];
|
|
72
|
+
cache: Record<string, unknown>[];
|
|
73
|
+
/** Ids of mails captured during the request. */
|
|
62
74
|
mails: string[];
|
|
63
75
|
timings: {
|
|
64
|
-
/** The server-side duration devtools measured, or `null` while unsettled. */
|
|
65
|
-
|
|
76
|
+
/** The server-side duration devtools measured, or `null` while unsettled. */
|
|
77
|
+
totalMs: number | null;
|
|
78
|
+
/** The round trip measured by the client. */
|
|
79
|
+
clientMs: number;
|
|
80
|
+
/** Total time per phase name. */
|
|
66
81
|
phasesMs: Record<string, number>;
|
|
67
82
|
};
|
|
68
83
|
};
|
|
69
84
|
//#endregion
|
|
70
|
-
export { TRACE_SCHEMA_VERSION, TraceMiddleware, TraceQuery, TraceReport, TraceValidation };
|
|
71
85
|
//# sourceMappingURL=trace-report.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace-report.types.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/trace/trace-report.types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"trace-report.types.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/trace/trace-report.types.ts"],"mappings":";;;qBAGa;;YAGD;EACV;EACA;EACA;;;YAIU;;EAEV;EACA;;;;;;EAMA;;EAEA;;;YAIU,aAAa;;EAEvB;;;YAIU;EACV,sBAAsB;;EAEtB;;EAEA;EACA;IACE;IACA;;IAEA,SAAS;IACT;;EAEF;IACE;IACA,SAAS;;IAET;;IAEA;;;EAGF;;EAEA;EACA;;IAEE,QAAQ;IACR;MAAc;;IACd,YAAY;IACZ,YAAY;IACZ;MAAW;;;EAEb,SAAS;;EAET,UAAU;EACV,MAAM;EACN,OAAO;;EAEP;EACA;;IAEE;;IAEA;;IAEA,UAAU"}
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import { DevtoolsFetch, DevtoolsRequestRecord } from "../devtools/devtools-client.mjs";
|
|
2
2
|
import { TraceReport } from "./trace-report.types.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/tooling/trace/trace-request.d.ts
|
|
5
4
|
/** The correlation header core reads and echoes by default (`http.requestId.header`). */
|
|
6
|
-
declare const TRACE_REQUEST_ID_HEADER = "x-request-id";
|
|
5
|
+
export declare const TRACE_REQUEST_ID_HEADER = "x-request-id";
|
|
7
6
|
/** Response bodies longer than this are cut in the report. */
|
|
8
|
-
declare const TRACE_BODY_LIMIT: number;
|
|
7
|
+
export declare const TRACE_BODY_LIMIT: number;
|
|
9
8
|
/** Inputs of {@link traceRequest}. */
|
|
10
|
-
type TraceRequestOptions = {
|
|
11
|
-
/** HTTP method, any case. */
|
|
9
|
+
export type TraceRequestOptions = {
|
|
10
|
+
/** HTTP method, any case. */
|
|
11
|
+
method: string;
|
|
12
|
+
/** A path on the dev server (`/posts?page=2`) or an absolute URL. */
|
|
12
13
|
url: string;
|
|
13
14
|
/**
|
|
14
15
|
* The request body. A string is sent as-is; anything else is sent as JSON
|
|
15
16
|
* with `content-type: application/json` unless `headers` sets a content type.
|
|
16
17
|
*/
|
|
17
|
-
body?: unknown;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
body?: unknown;
|
|
19
|
+
/** Extra request headers. */
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
/** Project root, where `.warlock/dev-server.json` is read. Default: `process.cwd()`. */
|
|
22
|
+
cwd?: string;
|
|
23
|
+
/** The dev server origin; overrides the recorded one. */
|
|
24
|
+
serverUrl?: string;
|
|
25
|
+
/** The devtools mount; overrides the recorded one (default `/__warlock`). */
|
|
21
26
|
devtoolsPath?: string;
|
|
22
|
-
fetch?: DevtoolsFetch;
|
|
23
|
-
|
|
27
|
+
fetch?: DevtoolsFetch;
|
|
28
|
+
/** How long to wait for devtools to settle the request record. Default 5000 ms. */
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
/** Poll interval while waiting for the record. Default 50 ms. */
|
|
24
31
|
intervalMs?: number;
|
|
25
32
|
/**
|
|
26
33
|
* The correlation header the app reads and echoes (`http.requestId.header`).
|
|
@@ -29,13 +36,14 @@ type TraceRequestOptions = {
|
|
|
29
36
|
requestIdHeader?: string;
|
|
30
37
|
};
|
|
31
38
|
/** The HTTP response as the report needs it. */
|
|
32
|
-
type TracedResponse = {
|
|
39
|
+
export type TracedResponse = {
|
|
33
40
|
status: number;
|
|
34
|
-
headers: Record<string, string>;
|
|
41
|
+
headers: Record<string, string>;
|
|
42
|
+
/** The raw response text. */
|
|
35
43
|
text: string;
|
|
36
44
|
};
|
|
37
45
|
/** Inputs of {@link buildTraceReport}. */
|
|
38
|
-
type BuildTraceReportInput = {
|
|
46
|
+
export type BuildTraceReportInput = {
|
|
39
47
|
requestId: string;
|
|
40
48
|
server: string;
|
|
41
49
|
request: {
|
|
@@ -49,9 +57,9 @@ type BuildTraceReportInput = {
|
|
|
49
57
|
clientMs: number;
|
|
50
58
|
};
|
|
51
59
|
/** Headers with credential values replaced by `[redacted]`. */
|
|
52
|
-
declare function redactHeaders(headers: Record<string, string>): Record<string, string>;
|
|
60
|
+
export declare function redactHeaders(headers: Record<string, string>): Record<string, string>;
|
|
53
61
|
/** The response body as the report prints it: parsed JSON, else text, cut at the limit. */
|
|
54
|
-
declare function readResponseBody(text: string, contentType: string | undefined): {
|
|
62
|
+
export declare function readResponseBody(text: string, contentType: string | undefined): {
|
|
55
63
|
body: unknown;
|
|
56
64
|
truncated: boolean;
|
|
57
65
|
};
|
|
@@ -59,9 +67,9 @@ declare function readResponseBody(text: string, contentType: string | undefined)
|
|
|
59
67
|
* Assemble a {@link TraceReport} from the HTTP response and the devtools
|
|
60
68
|
* record of the same request. Pure: no I/O, so it is testable on its own.
|
|
61
69
|
*/
|
|
62
|
-
declare function buildTraceReport(input: BuildTraceReportInput): TraceReport;
|
|
70
|
+
export declare function buildTraceReport(input: BuildTraceReportInput): TraceReport;
|
|
63
71
|
/** The absolute URL a trace sends to: `url` as-is when absolute, else joined to the server origin. */
|
|
64
|
-
declare function resolveTraceUrl(server: string, url: string): string;
|
|
72
|
+
export declare function resolveTraceUrl(server: string, url: string): string;
|
|
65
73
|
/**
|
|
66
74
|
* Send one request to the running dev server and return its devtools
|
|
67
75
|
* timeline: middleware, validation result, handler, queries (with N+1 flags),
|
|
@@ -77,7 +85,6 @@ declare function resolveTraceUrl(server: string, url: string): string;
|
|
|
77
85
|
* const report = await traceRequest({ method: "POST", url: "/posts", body: { title: "Hi" } });
|
|
78
86
|
* report.timeline.validation.passed; // false when the body was refused
|
|
79
87
|
*/
|
|
80
|
-
declare function traceRequest(options: TraceRequestOptions): Promise<TraceReport>;
|
|
88
|
+
export declare function traceRequest(options: TraceRequestOptions): Promise<TraceReport>;
|
|
81
89
|
//#endregion
|
|
82
|
-
export { BuildTraceReportInput, TRACE_BODY_LIMIT, TRACE_REQUEST_ID_HEADER, TraceRequestOptions, TracedResponse, buildTraceReport, readResponseBody, redactHeaders, resolveTraceUrl, traceRequest };
|
|
83
90
|
//# sourceMappingURL=trace-request.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace-request.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/trace/trace-request.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"trace-request.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/trace/trace-request.ts"],"mappings":";;;;qBAgBa;;qBAGA;;YAMD;;EAEV;;EAEA;;;;;EAKA;;EAEA,UAAU;;EAEV;;EAEA;;EAEA;EACA,QAAQ;;EAER;;EAEA;;;;;EAKA;;;YAIU;EACV;EACA,SAAS;;EAET;;;YAIU;EACV;EACA;EACA;IAAW;IAAgB;IAAa,SAAS;IAAwB;;EACzE,UAAU;EACV,QAAQ;EACR;;;wBAkBc,cAAc,SAAS,yBAAyB;;wBAWhD,iBACd,cACA;EACG;EAAe;;;;;;wBA6DJ,iBAAiB,OAAO,wBAAwB;;wBAoEhD,gBAAgB,gBAAgB;;;;;;;;;;;;;;;;wBA2C1B,aAAa,SAAS,sBAAsB,QAAQ"}
|
|
@@ -7,9 +7,9 @@ import { randomUUID } from "node:crypto";
|
|
|
7
7
|
/** The correlation header core reads and echoes by default (`http.requestId.header`). */
|
|
8
8
|
const TRACE_REQUEST_ID_HEADER = "x-request-id";
|
|
9
9
|
/** Response bodies longer than this are cut in the report. */
|
|
10
|
-
const TRACE_BODY_LIMIT =
|
|
10
|
+
const TRACE_BODY_LIMIT = 65536;
|
|
11
11
|
/** Header values never printed in a report. */
|
|
12
|
-
const REDACTED_HEADERS = new Set([
|
|
12
|
+
const REDACTED_HEADERS = /* @__PURE__ */ new Set([
|
|
13
13
|
"authorization",
|
|
14
14
|
"cookie",
|
|
15
15
|
"proxy-authorization"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace-request.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/trace/trace-request.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { WarlockError } from \"../../errors/warlock-error\";\nimport {\n connectDevtools,\n type DevtoolsFetch,\n type DevtoolsRequestRecord,\n} from \"../devtools/devtools-client\";\nimport {\n TRACE_SCHEMA_VERSION,\n type TraceMiddleware,\n type TraceQuery,\n type TraceReport,\n type TraceValidation,\n} from \"./trace-report.types\";\n\n/** The correlation header core reads and echoes by default (`http.requestId.header`). */\nexport const TRACE_REQUEST_ID_HEADER = \"x-request-id\";\n\n/** Response bodies longer than this are cut in the report. */\nexport const TRACE_BODY_LIMIT = 64 * 1024;\n\n/** Header values never printed in a report. */\nconst REDACTED_HEADERS = new Set([\"authorization\", \"cookie\", \"proxy-authorization\"]);\n\n/** Inputs of {@link traceRequest}. */\nexport type TraceRequestOptions = {\n /** HTTP method, any case. */\n method: string;\n /** A path on the dev server (`/posts?page=2`) or an absolute URL. */\n url: string;\n /**\n * The request body. A string is sent as-is; anything else is sent as JSON\n * with `content-type: application/json` unless `headers` sets a content type.\n */\n body?: unknown;\n /** Extra request headers. */\n headers?: Record<string, string>;\n /** Project root, where `.warlock/dev-server.json` is read. Default: `process.cwd()`. */\n cwd?: string;\n /** The dev server origin; overrides the recorded one. */\n serverUrl?: string;\n /** The devtools mount; overrides the recorded one (default `/__warlock`). */\n devtoolsPath?: string;\n fetch?: DevtoolsFetch;\n /** How long to wait for devtools to settle the request record. Default 5000 ms. */\n timeoutMs?: number;\n /** Poll interval while waiting for the record. Default 50 ms. */\n intervalMs?: number;\n /**\n * The correlation header the app reads and echoes (`http.requestId.header`).\n * Default `x-request-id`.\n */\n requestIdHeader?: string;\n};\n\n/** The HTTP response as the report needs it. */\nexport type TracedResponse = {\n status: number;\n headers: Record<string, string>;\n /** The raw response text. */\n text: string;\n};\n\n/** Inputs of {@link buildTraceReport}. */\nexport type BuildTraceReportInput = {\n requestId: string;\n server: string;\n request: { method: string; url: string; headers: Record<string, string>; body: unknown };\n response: TracedResponse;\n record: DevtoolsRequestRecord;\n clientMs: number;\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction lowerCaseKeys(headers: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(headers)) {\n result[key.toLowerCase()] = value;\n }\n\n return result;\n}\n\n/** Headers with credential values replaced by `[redacted]`. */\nexport function redactHeaders(headers: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(headers)) {\n result[key] = REDACTED_HEADERS.has(key.toLowerCase()) ? \"[redacted]\" : value;\n }\n\n return result;\n}\n\n/** The response body as the report prints it: parsed JSON, else text, cut at the limit. */\nexport function readResponseBody(\n text: string,\n contentType: string | undefined,\n): { body: unknown; truncated: boolean } {\n if (text.length === 0) return { body: null, truncated: false };\n\n const truncated = text.length > TRACE_BODY_LIMIT;\n\n if (!truncated && contentType !== undefined && /\\bjson\\b/i.test(contentType)) {\n try {\n return { body: JSON.parse(text), truncated: false };\n } catch {\n // Fall through to text: a body that claims JSON and is not is worth seeing as-is.\n }\n }\n\n return { body: truncated ? text.slice(0, TRACE_BODY_LIMIT) : text, truncated };\n}\n\nfunction attrNumber(attrs: Record<string, unknown> | undefined, key: string): number | null {\n const value = attrs?.[key];\n\n return typeof value === \"number\" ? value : null;\n}\n\nfunction attrString(attrs: Record<string, unknown> | undefined, key: string): string | null {\n const value = attrs?.[key];\n\n return typeof value === \"string\" ? value : null;\n}\n\nfunction validationOf(\n record: DevtoolsRequestRecord,\n status: number,\n body: unknown,\n): TraceValidation {\n const phases = record.phases.filter((phase) => phase.name === \"validation\");\n\n if (phases.length === 0) {\n return { ran: false, durationMs: null, passed: null, errors: null };\n }\n\n const durationMs = phases.reduce((total, phase) => total + phase.durationMs, 0);\n const handlerRan = record.phases.some((phase) => phase.name === \"handler\");\n // A validation failure answers before the handler runs, with the configured\n // failure status (422 by default, `validation.response.status`).\n const passed = handlerRan || status < 400;\n const errors = passed ? null : isRecord(body) && \"errors\" in body ? body.errors : body;\n\n return { ran: true, durationMs, passed, errors };\n}\n\nfunction sumPhase(record: DevtoolsRequestRecord, name: string): { durationMs: number } | null {\n const phases = record.phases.filter((phase) => phase.name === name);\n\n if (phases.length === 0) return null;\n\n return { durationMs: phases.reduce((total, phase) => total + phase.durationMs, 0) };\n}\n\n/**\n * Assemble a {@link TraceReport} from the HTTP response and the devtools\n * record of the same request. Pure: no I/O, so it is testable on its own.\n */\nexport function buildTraceReport(input: BuildTraceReportInput): TraceReport {\n const { record, response } = input;\n const responseHeaders = lowerCaseKeys(response.headers);\n const { body, truncated } = readResponseBody(response.text, responseHeaders[\"content-type\"]);\n\n const middleware: TraceMiddleware[] = record.phases\n .filter((phase) => phase.name === \"middleware\")\n .map((phase) => ({\n name: attrString(phase.attrs, \"name\"),\n index: attrNumber(phase.attrs, \"index\"),\n durationMs: phase.durationMs,\n }));\n\n const nPlusOneShapes = new Set(\n record.warnings.flatMap((warning) =>\n warning.type === \"n+1\" && typeof warning.shape === \"string\" ? [warning.shape] : [],\n ),\n );\n const queries: TraceQuery[] = record.queries.map((query) => ({\n ...query,\n nPlusOne: typeof query.shape === \"string\" && nPlusOneShapes.has(query.shape),\n }));\n\n const phasesMs: Record<string, number> = {};\n\n for (const phase of record.phases) {\n phasesMs[phase.name] = (phasesMs[phase.name] ?? 0) + phase.durationMs;\n }\n\n return {\n schemaVersion: TRACE_SCHEMA_VERSION,\n requestId: input.requestId,\n server: input.server,\n request: {\n method: input.request.method,\n url: input.request.url,\n headers: redactHeaders(input.request.headers),\n body: input.request.body,\n },\n response: {\n status: response.status,\n headers: redactHeaders(responseHeaders),\n body,\n truncated,\n },\n route: record.route ?? null,\n error: record.error ?? null,\n timeline: {\n phases: record.phases,\n routeMatch: sumPhase(record, \"route.match\"),\n middleware,\n validation: validationOf(record, response.status, body),\n handler: sumPhase(record, \"handler\"),\n },\n queries,\n warnings: record.warnings,\n logs: record.logs,\n cache: record.cache,\n mails: record.mails,\n timings: {\n totalMs: record.durationMs ?? null,\n clientMs: input.clientMs,\n phasesMs,\n },\n };\n}\n\n/** The absolute URL a trace sends to: `url` as-is when absolute, else joined to the server origin. */\nexport function resolveTraceUrl(server: string, url: string): string {\n if (/^https?:\\/\\//i.test(url)) return url;\n\n return `${server}${url.startsWith(\"/\") ? url : `/${url}`}`;\n}\n\n/** The body and headers to send for a {@link TraceRequestOptions.body}. */\nfunction encodeBody(\n body: unknown,\n headers: Record<string, string>,\n): { payload: string | undefined; headers: Record<string, string> } {\n if (body === undefined) return { payload: undefined, headers };\n if (typeof body === \"string\") return { payload: body, headers };\n\n const hasContentType = Object.keys(headers).some((key) => key.toLowerCase() === \"content-type\");\n\n return {\n payload: JSON.stringify(body),\n headers: hasContentType ? headers : { ...headers, \"content-type\": \"application/json\" },\n };\n}\n\nfunction headerValue(headers: Record<string, string>, name: string): string | undefined {\n const key = Object.keys(headers).find((candidate) => candidate.toLowerCase() === name);\n\n return key === undefined ? undefined : headers[key];\n}\n\n/**\n * Send one request to the running dev server and return its devtools\n * timeline: middleware, validation result, handler, queries (with N+1 flags),\n * logs, cache operations, captured mails, the response and the timings.\n *\n * Devtools is reached first, so a missing dev server (`WL8008`) or devtools\n * (`WL8009`) fails before anything is sent. The request carries an\n * `x-request-id` (unless the caller set one), which core adopts as\n * `request.id` and echoes back; that id is how the devtools record is found.\n * Throws `WL5004` when devtools never recorded the request.\n *\n * @example\n * const report = await traceRequest({ method: \"POST\", url: \"/posts\", body: { title: \"Hi\" } });\n * report.timeline.validation.passed; // false when the body was refused\n */\nexport async function traceRequest(options: TraceRequestOptions): Promise<TraceReport> {\n const fetcher: DevtoolsFetch = options.fetch ?? ((input, init) => fetch(input, init));\n const devtools = await connectDevtools({\n cwd: options.cwd,\n url: options.serverUrl,\n devtoolsPath: options.devtoolsPath,\n fetch: fetcher,\n });\n\n const method = options.method.toUpperCase();\n const url = resolveTraceUrl(devtools.url, options.url);\n const idHeader = (options.requestIdHeader ?? TRACE_REQUEST_ID_HEADER).toLowerCase();\n const ownId = headerValue(options.headers ?? {}, idHeader);\n const sentId = ownId ?? randomUUID();\n const base =\n ownId === undefined ? { ...options.headers, [idHeader]: sentId } : { ...options.headers };\n const { payload, headers } = encodeBody(options.body, base);\n\n const startedAt = performance.now();\n let response: Response;\n\n try {\n response = await fetcher(url, { method, headers, body: payload });\n } catch (error) {\n throw new WarlockError(\n \"WL8008\",\n `The dev server at ${devtools.url} did not answer ${method} ${url}: ${error instanceof Error ? error.message : String(error)}.`,\n { cause: error },\n );\n }\n\n const text = await response.text();\n const clientMs = performance.now() - startedAt;\n const responseHeaders: Record<string, string> = {};\n\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n\n const requestId = responseHeaders[idHeader] ?? sentId;\n const record = await devtools.waitForRequest(requestId, {\n timeoutMs: options.timeoutMs,\n intervalMs: options.intervalMs,\n });\n\n if (!record) {\n throw new WarlockError(\n \"WL5004\",\n `Devtools holds no record of request ${requestId} (${method} ${url} answered ${response.status}). Keep http.requestId enabled so the id is echoed; paths under ${devtools.devtoolsPath} are never recorded.`,\n );\n }\n\n return buildTraceReport({\n requestId,\n server: devtools.url,\n request: { method, url, headers, body: options.body ?? null },\n response: { status: response.status, headers: responseHeaders, text },\n record,\n clientMs,\n });\n}\n"],"mappings":";;;;;;;AAgBA,MAAa,0BAA0B;;AAGvC,MAAa,mBAAmB,KAAK;;AAGrC,MAAM,mBAAmB,IAAI,IAAI;CAAC;CAAiB;CAAU;AAAqB,CAAC;AAmDnF,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,cAAc,SAAyD;CAC9E,MAAM,SAAiC,CAAC;CAExC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,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UAAU;GAAE,QAAQ,SAAS;GAAQ,SAAS;GAAiB;EAAK;EACpE;EACA;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"trace-request.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/trace/trace-request.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { WarlockError } from \"../../errors/warlock-error\";\nimport {\n connectDevtools,\n type DevtoolsFetch,\n type DevtoolsRequestRecord,\n} from \"../devtools/devtools-client\";\nimport {\n TRACE_SCHEMA_VERSION,\n type TraceMiddleware,\n type TraceQuery,\n type TraceReport,\n type TraceValidation,\n} from \"./trace-report.types\";\n\n/** The correlation header core reads and echoes by default (`http.requestId.header`). */\nexport const TRACE_REQUEST_ID_HEADER = \"x-request-id\";\n\n/** Response bodies longer than this are cut in the report. */\nexport const TRACE_BODY_LIMIT = 64 * 1024;\n\n/** Header values never printed in a report. */\nconst REDACTED_HEADERS = new Set([\"authorization\", \"cookie\", \"proxy-authorization\"]);\n\n/** Inputs of {@link traceRequest}. */\nexport type TraceRequestOptions = {\n /** HTTP method, any case. */\n method: string;\n /** A path on the dev server (`/posts?page=2`) or an absolute URL. */\n url: string;\n /**\n * The request body. A string is sent as-is; anything else is sent as JSON\n * with `content-type: application/json` unless `headers` sets a content type.\n */\n body?: unknown;\n /** Extra request headers. */\n headers?: Record<string, string>;\n /** Project root, where `.warlock/dev-server.json` is read. Default: `process.cwd()`. */\n cwd?: string;\n /** The dev server origin; overrides the recorded one. */\n serverUrl?: string;\n /** The devtools mount; overrides the recorded one (default `/__warlock`). */\n devtoolsPath?: string;\n fetch?: DevtoolsFetch;\n /** How long to wait for devtools to settle the request record. Default 5000 ms. */\n timeoutMs?: number;\n /** Poll interval while waiting for the record. Default 50 ms. */\n intervalMs?: number;\n /**\n * The correlation header the app reads and echoes (`http.requestId.header`).\n * Default `x-request-id`.\n */\n requestIdHeader?: string;\n};\n\n/** The HTTP response as the report needs it. */\nexport type TracedResponse = {\n status: number;\n headers: Record<string, string>;\n /** The raw response text. */\n text: string;\n};\n\n/** Inputs of {@link buildTraceReport}. */\nexport type BuildTraceReportInput = {\n requestId: string;\n server: string;\n request: { method: string; url: string; headers: Record<string, string>; body: unknown };\n response: TracedResponse;\n record: DevtoolsRequestRecord;\n clientMs: number;\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction lowerCaseKeys(headers: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(headers)) {\n result[key.toLowerCase()] = value;\n }\n\n return result;\n}\n\n/** Headers with credential values replaced by `[redacted]`. */\nexport function redactHeaders(headers: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(headers)) {\n result[key] = REDACTED_HEADERS.has(key.toLowerCase()) ? \"[redacted]\" : value;\n }\n\n return result;\n}\n\n/** The response body as the report prints it: parsed JSON, else text, cut at the limit. */\nexport function readResponseBody(\n text: string,\n contentType: string | undefined,\n): { body: unknown; truncated: boolean } {\n if (text.length === 0) return { body: null, truncated: false };\n\n const truncated = text.length > TRACE_BODY_LIMIT;\n\n if (!truncated && contentType !== undefined && /\\bjson\\b/i.test(contentType)) {\n try {\n return { body: JSON.parse(text), truncated: false };\n } catch {\n // Fall through to text: a body that claims JSON and is not is worth seeing as-is.\n }\n }\n\n return { body: truncated ? text.slice(0, TRACE_BODY_LIMIT) : text, truncated };\n}\n\nfunction attrNumber(attrs: Record<string, unknown> | undefined, key: string): number | null {\n const value = attrs?.[key];\n\n return typeof value === \"number\" ? value : null;\n}\n\nfunction attrString(attrs: Record<string, unknown> | undefined, key: string): string | null {\n const value = attrs?.[key];\n\n return typeof value === \"string\" ? value : null;\n}\n\nfunction validationOf(\n record: DevtoolsRequestRecord,\n status: number,\n body: unknown,\n): TraceValidation {\n const phases = record.phases.filter((phase) => phase.name === \"validation\");\n\n if (phases.length === 0) {\n return { ran: false, durationMs: null, passed: null, errors: null };\n }\n\n const durationMs = phases.reduce((total, phase) => total + phase.durationMs, 0);\n const handlerRan = record.phases.some((phase) => phase.name === \"handler\");\n // A validation failure answers before the handler runs, with the configured\n // failure status (422 by default, `validation.response.status`).\n const passed = handlerRan || status < 400;\n const errors = passed ? null : isRecord(body) && \"errors\" in body ? body.errors : body;\n\n return { ran: true, durationMs, passed, errors };\n}\n\nfunction sumPhase(record: DevtoolsRequestRecord, name: string): { durationMs: number } | null {\n const phases = record.phases.filter((phase) => phase.name === name);\n\n if (phases.length === 0) return null;\n\n return { durationMs: phases.reduce((total, phase) => total + phase.durationMs, 0) };\n}\n\n/**\n * Assemble a {@link TraceReport} from the HTTP response and the devtools\n * record of the same request. Pure: no I/O, so it is testable on its own.\n */\nexport function buildTraceReport(input: BuildTraceReportInput): TraceReport {\n const { record, response } = input;\n const responseHeaders = lowerCaseKeys(response.headers);\n const { body, truncated } = readResponseBody(response.text, responseHeaders[\"content-type\"]);\n\n const middleware: TraceMiddleware[] = record.phases\n .filter((phase) => phase.name === \"middleware\")\n .map((phase) => ({\n name: attrString(phase.attrs, \"name\"),\n index: attrNumber(phase.attrs, \"index\"),\n durationMs: phase.durationMs,\n }));\n\n const nPlusOneShapes = new Set(\n record.warnings.flatMap((warning) =>\n warning.type === \"n+1\" && typeof warning.shape === \"string\" ? [warning.shape] : [],\n ),\n );\n const queries: TraceQuery[] = record.queries.map((query) => ({\n ...query,\n nPlusOne: typeof query.shape === \"string\" && nPlusOneShapes.has(query.shape),\n }));\n\n const phasesMs: Record<string, number> = {};\n\n for (const phase of record.phases) {\n phasesMs[phase.name] = (phasesMs[phase.name] ?? 0) + phase.durationMs;\n }\n\n return {\n schemaVersion: TRACE_SCHEMA_VERSION,\n requestId: input.requestId,\n server: input.server,\n request: {\n method: input.request.method,\n url: input.request.url,\n headers: redactHeaders(input.request.headers),\n body: input.request.body,\n },\n response: {\n status: response.status,\n headers: redactHeaders(responseHeaders),\n body,\n truncated,\n },\n route: record.route ?? null,\n error: record.error ?? null,\n timeline: {\n phases: record.phases,\n routeMatch: sumPhase(record, \"route.match\"),\n middleware,\n validation: validationOf(record, response.status, body),\n handler: sumPhase(record, \"handler\"),\n },\n queries,\n warnings: record.warnings,\n logs: record.logs,\n cache: record.cache,\n mails: record.mails,\n timings: {\n totalMs: record.durationMs ?? null,\n clientMs: input.clientMs,\n phasesMs,\n },\n };\n}\n\n/** The absolute URL a trace sends to: `url` as-is when absolute, else joined to the server origin. */\nexport function resolveTraceUrl(server: string, url: string): string {\n if (/^https?:\\/\\//i.test(url)) return url;\n\n return `${server}${url.startsWith(\"/\") ? url : `/${url}`}`;\n}\n\n/** The body and headers to send for a {@link TraceRequestOptions.body}. */\nfunction encodeBody(\n body: unknown,\n headers: Record<string, string>,\n): { payload: string | undefined; headers: Record<string, string> } {\n if (body === undefined) return { payload: undefined, headers };\n if (typeof body === \"string\") return { payload: body, headers };\n\n const hasContentType = Object.keys(headers).some((key) => key.toLowerCase() === \"content-type\");\n\n return {\n payload: JSON.stringify(body),\n headers: hasContentType ? headers : { ...headers, \"content-type\": \"application/json\" },\n };\n}\n\nfunction headerValue(headers: Record<string, string>, name: string): string | undefined {\n const key = Object.keys(headers).find((candidate) => candidate.toLowerCase() === name);\n\n return key === undefined ? undefined : headers[key];\n}\n\n/**\n * Send one request to the running dev server and return its devtools\n * timeline: middleware, validation result, handler, queries (with N+1 flags),\n * logs, cache operations, captured mails, the response and the timings.\n *\n * Devtools is reached first, so a missing dev server (`WL8008`) or devtools\n * (`WL8009`) fails before anything is sent. The request carries an\n * `x-request-id` (unless the caller set one), which core adopts as\n * `request.id` and echoes back; that id is how the devtools record is found.\n * Throws `WL5004` when devtools never recorded the request.\n *\n * @example\n * const report = await traceRequest({ method: \"POST\", url: \"/posts\", body: { title: \"Hi\" } });\n * report.timeline.validation.passed; // false when the body was refused\n */\nexport async function traceRequest(options: TraceRequestOptions): Promise<TraceReport> {\n const fetcher: DevtoolsFetch = options.fetch ?? ((input, init) => fetch(input, init));\n const devtools = await connectDevtools({\n cwd: options.cwd,\n url: options.serverUrl,\n devtoolsPath: options.devtoolsPath,\n fetch: fetcher,\n });\n\n const method = options.method.toUpperCase();\n const url = resolveTraceUrl(devtools.url, options.url);\n const idHeader = (options.requestIdHeader ?? TRACE_REQUEST_ID_HEADER).toLowerCase();\n const ownId = headerValue(options.headers ?? {}, idHeader);\n const sentId = ownId ?? randomUUID();\n const base =\n ownId === undefined ? { ...options.headers, [idHeader]: sentId } : { ...options.headers };\n const { payload, headers } = encodeBody(options.body, base);\n\n const startedAt = performance.now();\n let response: Response;\n\n try {\n response = await fetcher(url, { method, headers, body: payload });\n } catch (error) {\n throw new WarlockError(\n \"WL8008\",\n `The dev server at ${devtools.url} did not answer ${method} ${url}: ${error instanceof Error ? error.message : String(error)}.`,\n { cause: error },\n );\n }\n\n const text = await response.text();\n const clientMs = performance.now() - startedAt;\n const responseHeaders: Record<string, string> = {};\n\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n\n const requestId = responseHeaders[idHeader] ?? sentId;\n const record = await devtools.waitForRequest(requestId, {\n timeoutMs: options.timeoutMs,\n intervalMs: options.intervalMs,\n });\n\n if (!record) {\n throw new WarlockError(\n \"WL5004\",\n `Devtools holds no record of request ${requestId} (${method} ${url} answered ${response.status}). Keep http.requestId enabled so the id is echoed; paths under ${devtools.devtoolsPath} are never recorded.`,\n );\n }\n\n return buildTraceReport({\n requestId,\n server: devtools.url,\n request: { method, url, headers, body: options.body ?? null },\n response: { status: response.status, headers: responseHeaders, text },\n record,\n clientMs,\n });\n}\n"],"mappings":";;;;;;;AAgBA,MAAa,0BAA0B;;AAGvC,MAAa,mBAAmB;;AAGhC,MAAM,mCAAmB,IAAI,IAAI;CAAC;CAAiB;CAAU;AAAqB,CAAC;AAmDnF,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,cAAc,SA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