@warlock.js/core 5.27.0 → 5.29.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/esm/cli/commands/openapi-generator.action.mjs +1 -1
  3. package/esm/cli/commands/openapi-generator.action.mjs.map +1 -1
  4. package/esm/cli/commands/postman-generator.action.mjs +47 -0
  5. package/esm/cli/commands/postman-generator.action.mjs.map +1 -0
  6. package/esm/cli/commands/postman-generator.command.mjs +43 -0
  7. package/esm/cli/commands/postman-generator.command.mjs.map +1 -0
  8. package/esm/cli/framework-cli-commands.mjs +2 -0
  9. package/esm/cli/framework-cli-commands.mjs.map +1 -1
  10. package/esm/container/development-app-modules.d.mts +31 -0
  11. package/esm/container/development-app-modules.d.mts.map +1 -0
  12. package/esm/container/index.d.mts +2 -0
  13. package/esm/container/index.d.mts.map +1 -1
  14. package/esm/container/index.mjs.map +1 -1
  15. package/esm/dev-server/app-module-registry.mjs +52 -0
  16. package/esm/dev-server/app-module-registry.mjs.map +1 -0
  17. package/esm/dev-server/files-orchestrator.mjs +13 -2
  18. package/esm/dev-server/files-orchestrator.mjs.map +1 -1
  19. package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
  20. package/esm/http/middleware/inject-request-context.mjs +29 -3
  21. package/esm/http/middleware/inject-request-context.mjs.map +1 -1
  22. package/esm/http/request.d.mts +2 -2
  23. package/esm/http/request.d.mts.map +1 -1
  24. package/esm/index.d.mts +7 -2
  25. package/esm/index.mjs +5 -2
  26. package/esm/localization/parse-locale-dictionary.d.mts +6 -1
  27. package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
  28. package/esm/localization/parse-locale-dictionary.mjs +5 -1
  29. package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
  30. package/esm/openapi/development-openapi-provider.d.mts +12 -1
  31. package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
  32. package/esm/openapi/development-openapi-provider.mjs +15 -1
  33. package/esm/openapi/development-openapi-provider.mjs.map +1 -1
  34. package/esm/openapi/index.d.mts +5 -2
  35. package/esm/openapi/index.mjs +3 -1
  36. package/esm/openapi/postman/build-request-body.mjs +86 -0
  37. package/esm/openapi/postman/build-request-body.mjs.map +1 -0
  38. package/esm/openapi/postman/build-request-url.mjs +85 -0
  39. package/esm/openapi/postman/build-request-url.mjs.map +1 -0
  40. package/esm/openapi/postman/build-saved-responses.mjs +60 -0
  41. package/esm/openapi/postman/build-saved-responses.mjs.map +1 -0
  42. package/esm/openapi/postman/example-from-schema.d.mts +17 -0
  43. package/esm/openapi/postman/example-from-schema.d.mts.map +1 -0
  44. package/esm/openapi/postman/example-from-schema.mjs +92 -0
  45. package/esm/openapi/postman/example-from-schema.mjs.map +1 -0
  46. package/esm/openapi/postman/http-status-text.mjs +31 -0
  47. package/esm/openapi/postman/http-status-text.mjs.map +1 -0
  48. package/esm/openapi/postman/index.d.mts +3 -0
  49. package/esm/openapi/postman/openapi-to-postman-collection.d.mts +22 -0
  50. package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -0
  51. package/esm/openapi/postman/openapi-to-postman-collection.mjs +109 -0
  52. package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -0
  53. package/esm/openapi/postman/postman-types.d.mts +119 -0
  54. package/esm/openapi/postman/postman-types.d.mts.map +1 -0
  55. package/esm/openapi/postman/resolve-operation-auth.mjs +51 -0
  56. package/esm/openapi/postman/resolve-operation-auth.mjs.map +1 -0
  57. package/esm/openapi/postman/schema-refs.d.mts +7 -0
  58. package/esm/openapi/postman/schema-refs.d.mts.map +1 -0
  59. package/esm/openapi/postman/schema-refs.mjs +41 -0
  60. package/esm/openapi/postman/schema-refs.mjs.map +1 -0
  61. package/esm/openapi/postman/uuid-v5.mjs +29 -0
  62. package/esm/openapi/postman/uuid-v5.mjs.map +1 -0
  63. package/esm/openapi/response-schemas.mjs +4 -1
  64. package/esm/openapi/response-schemas.mjs.map +1 -1
  65. package/esm/openapi/schema-registry.mjs +6 -0
  66. package/esm/openapi/schema-registry.mjs.map +1 -1
  67. package/esm/resource/index.d.mts +1 -0
  68. package/esm/resource/index.mjs +1 -0
  69. package/esm/resource/nullable-resource.d.mts +44 -0
  70. package/esm/resource/nullable-resource.d.mts.map +1 -0
  71. package/esm/resource/nullable-resource.mjs +38 -0
  72. package/esm/resource/nullable-resource.mjs.map +1 -0
  73. package/esm/resource/resource.d.mts.map +1 -1
  74. package/esm/resource/resource.mjs +24 -7
  75. package/esm/resource/resource.mjs.map +1 -1
  76. package/esm/resource/types.d.mts +10 -5
  77. package/esm/resource/types.d.mts.map +1 -1
  78. package/esm/restful/restful.d.mts +5 -5
  79. package/esm/restful/restful.d.mts.map +1 -1
  80. package/esm/router/response-schema-types.mjs +2 -0
  81. package/esm/router/response-schema-types.mjs.map +1 -1
  82. package/llms-full.txt +269 -241
  83. package/llms.txt +42 -42
  84. package/package.json +12 -12
  85. package/skills/README.md +39 -39
  86. package/skills/add-connector/SKILL.md +4 -4
  87. package/skills/benchmark-code/SKILL.md +3 -3
  88. package/skills/build-restful/SKILL.md +5 -5
  89. package/skills/build-url/SKILL.md +7 -7
  90. package/skills/configure-app/SKILL.md +7 -7
  91. package/skills/create-controller/SKILL.md +8 -8
  92. package/skills/create-module/SKILL.md +9 -9
  93. package/skills/define-resource/SKILL.md +4 -4
  94. package/skills/encrypt-data/SKILL.md +7 -7
  95. package/skills/generate-openapi/SKILL.md +33 -5
  96. package/skills/hash-password/SKILL.md +8 -8
  97. package/skills/health-checks/SKILL.md +6 -6
  98. package/skills/lower-stage3-decorators/SKILL.md +4 -4
  99. package/skills/process-image/SKILL.md +5 -5
  100. package/skills/register-route/SKILL.md +6 -6
  101. package/skills/request-memo/SKILL.md +4 -4
  102. package/skills/request-tracing/SKILL.md +6 -6
  103. package/skills/resolve-path/SKILL.md +6 -6
  104. package/skills/retry-operation/SKILL.md +4 -4
  105. package/skills/run-app/SKILL.md +11 -11
  106. package/skills/send-mail/SKILL.md +3 -3
  107. package/skills/send-response/SKILL.md +6 -6
  108. package/skills/store-file/SKILL.md +4 -4
  109. package/skills/test-http/SKILL.md +5 -5
  110. package/skills/test-service/SKILL.md +5 -5
  111. package/skills/update-packages/SKILL.md +6 -6
  112. package/skills/upload-file/SKILL.md +7 -7
  113. package/skills/use-app-context/SKILL.md +7 -7
  114. package/skills/use-localization/SKILL.md +6 -6
  115. package/skills/use-middleware/SKILL.md +6 -6
  116. package/skills/use-model-transformers/SKILL.md +6 -6
  117. package/skills/use-repository/SKILL.md +7 -7
  118. package/skills/use-request-locals/SKILL.md +4 -4
  119. package/skills/validate-input/SKILL.md +7 -7
  120. package/skills/warlock-conventions/SKILL.md +6 -6
  121. package/skills/warlock-doctor/SKILL.md +5 -5
  122. package/skills/warlock-routes/SKILL.md +6 -6
  123. package/skills/wire-socket/SKILL.md +4 -4
  124. package/skills/write-cli-command/SKILL.md +6 -6
  125. package/skills/write-middleware/SKILL.md +8 -8
  126. package/skills/write-seeder/SKILL.md +5 -5
  127. package/skills/write-use-case/SKILL.md +3 -3
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-cli-command
3
- description: 'Author a custom `warlock <my-cmd>` command via the `command()` factory — name, description, action, options, preload, then register in `warlock.config.ts > cli.commands` or drop in `src/app/<module>/commands/`. Also covers built-in `warlock add` feature scaffolding, including the Web starter and `index.register.ts`. Triggers: `command`, `CLICommand`, `CLICommandPreload`, `CLICommandOption`, `preload`, `preAction`, `persistent`, `colors`, `warlock add`, `warlock add bull-board`, `index.register.ts`; "write a custom warlock command", "one-off maintenance task", "ship a CLI from a package", "framework built-in commands"; typical import `import { command } from "@warlock.js/core"`. Skip: framework dev/build/start — `@warlock.js/core/run-app/SKILL.md`; warlock.config.ts wiring — `@warlock.js/core/configure-app/SKILL.md`; competing libs `commander`, `yargs`, `oclif`.'
3
+ description: 'Author a custom `warlock <my-cmd>` command via the `command()` factory — name, description, action, options, preload, then register in `warlock.config.ts > cli.commands` or drop in `src/app/<module>/commands/`. Also covers built-in `warlock add` feature scaffolding, including the Web starter and `index.register.ts`. Triggers: `command`, `CLICommand`, `CLICommandPreload`, `CLICommandOption`, `preload`, `preAction`, `persistent`, `colors`, `warlock add`, `warlock add bull-board`, `index.register.ts`; "write a custom warlock command", "one-off maintenance task", "ship a CLI from a package", "framework built-in commands"; typical import `import { command } from "@warlock.js/core"`. Skip: framework dev/build/start — the `run-app` topic; warlock.config.ts wiring — the `configure-app` topic; competing libs `commander`, `yargs`, `oclif`.'
4
4
  ---
5
5
 
6
6
  # Warlock — write a CLI command
@@ -150,7 +150,7 @@ console.log(colors.green("✓") + " user promoted");
150
150
 
151
151
  The framework ships a fixed set of commands you call but don't author. Knowing their flags up front saves a `--help` round-trip.
152
152
 
153
- > For `warlock dev` / `warlock build` / `warlock start` — see [`run-app/SKILL.md`](../run-app/SKILL.md). Everything below covers the rest.
153
+ > For `warlock dev` / `warlock build` / `warlock start` — see the `run-app` topic. Everything below covers the rest.
154
154
 
155
155
  ### Database + migrations
156
156
 
@@ -196,7 +196,7 @@ warlock generate.typings
196
196
  warlock generate (alias: g) — interactive picker
197
197
  ```
198
198
 
199
- `<m>/<n>` is `<module>/<name>` (e.g. `products/create-product`). See [`create-module/SKILL.md`](../create-module/SKILL.md) for the full scaffolding flow.
199
+ `<m>/<n>` is `<module>/<name>` (e.g. `products/create-product`). See the `create-module` topic for the full scaffolding flow.
200
200
 
201
201
  ### Feature installation
202
202
 
@@ -311,6 +311,6 @@ export default command({
311
311
 
312
312
  ## See also
313
313
 
314
- - [`run-app/SKILL.md`](../run-app/SKILL.md) — the operational commands (`dev` / `build` / `start`) with all flags and config knobs.
315
- - [`configure-app/SKILL.md`](../configure-app/SKILL.md) — wiring `defineConfig` and `warlock.config.ts`.
316
- - [`warlock-conventions/SKILL.md`](../warlock-conventions/SKILL.md) — module layout, canonical imports.
314
+ - The `run-app` topic — the operational commands (`dev` / `build` / `start`) with all flags and config knobs.
315
+ - The `configure-app` topic — wiring `defineConfig` and `warlock.config.ts`.
316
+ - The `warlock-conventions` topic — module layout, canonical imports.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-middleware
3
- description: 'Author HTTP middleware for @warlock.js/core — the `({ request, response })` signature, short-circuit by returning a response, enrich the request with extra fields, register per-route, per-group, or app-wide. Triggers: `Middleware`, `MiddlewareResponse`, `router.group`, `guarded`, `request.detectIp`, `authMiddleware`; "write a custom middleware", "short-circuit a request", "enrich the request with extra fields", "per-route vs per-group middleware"; typical import `import type { Middleware } from "@warlock.js/core"`. Skip: built-in middleware catalog — `@warlock.js/core/use-middleware/SKILL.md`; route attachment — `@warlock.js/core/register-route/SKILL.md`; response helpers — `@warlock.js/core/send-response/SKILL.md`; competing patterns: `express` `(req, res, next)` middleware, Fastify `preHandler` hooks.'
3
+ description: 'Author HTTP middleware for @warlock.js/core — the `({ request, response })` signature, short-circuit by returning a response, enrich the request with extra fields, register per-route, per-group, or app-wide. Triggers: `Middleware`, `MiddlewareResponse`, `router.group`, `guarded`, `request.detectIp`, `authMiddleware`; "write a custom middleware", "short-circuit a request", "enrich the request with extra fields", "per-route vs per-group middleware"; typical import `import type { Middleware } from "@warlock.js/core"`. Skip: built-in middleware catalog — the `use-middleware` topic; route attachment — the `register-route` topic; response helpers — the `send-response` topic; competing patterns: `express` `(req, res, next)` middleware, Fastify `preHandler` hooks.'
4
4
  ---
5
5
 
6
6
  # Warlock — write a middleware
@@ -51,7 +51,7 @@ export const requireFeatureFlag: Middleware = async ({ request, response }) => {
51
51
  };
52
52
  ```
53
53
 
54
- If you short-circuit, the controller never runs. The response helper you pick (`forbidden`, `unauthorized`, `badRequest`, etc.) sets the status — see [`send-response`](../send-response/SKILL.md).
54
+ If you short-circuit, the controller never runs. The response helper you pick (`forbidden`, `unauthorized`, `badRequest`, etc.) sets the status — see the `send-response` topic.
55
55
 
56
56
  ## Enriching the request
57
57
 
@@ -200,7 +200,7 @@ export const optionalAuth: Middleware = async ({ request, response }) => {
200
200
 
201
201
  ## Using built-in middleware
202
202
 
203
- `@warlock.js/core` ships seven built-in middlewares (rate limit, concurrency cap, body cap, idempotency, maintenance, IP filter, response cache) under the `middleware` namespace from `@warlock.js/core`. They cover the patterns most apps need — see [`use-middleware`](../use-middleware/SKILL.md) for the catalog, per-primitive deep-dives, error semantics, and gotchas specific to using them.
203
+ `@warlock.js/core` ships seven built-in middlewares (rate limit, concurrency cap, body cap, idempotency, maintenance, IP filter, response cache) under the `middleware` namespace from `@warlock.js/core`. They cover the patterns most apps need — see the `use-middleware` topic for the catalog, per-primitive deep-dives, error semantics, and gotchas specific to using them.
204
204
 
205
205
  `X-Request-Id` correlation is wired automatically (inherit + echo on every response) — the same skill covers that too. It's not a middleware; nothing to register.
206
206
 
@@ -217,8 +217,8 @@ export const optionalAuth: Middleware = async ({ request, response }) => {
217
217
 
218
218
  ## See also
219
219
 
220
- - [`use-middleware/SKILL.md`](../use-middleware/SKILL.md) — the built-in middleware catalog (`rateLimit`, `idempotency`, `maxBodySize`, etc.) + request-id correlation.
221
- - [`register-route/SKILL.md`](../register-route/SKILL.md) — where middleware attaches: `router.group` and route-options.
222
- - [`create-controller/SKILL.md`](../create-controller/SKILL.md) — how the controller picks up `request.locals.user`, `request.validated()`, etc., set by upstream middleware.
223
- - [`send-response/SKILL.md`](../send-response/SKILL.md) — the response helpers used to short-circuit.
224
- - [`warlock-conventions/SKILL.md`](../warlock-conventions/SKILL.md) — the `guarded()` / `guardedAdmin()` / `publicRoutes()` convention.
220
+ - The `use-middleware` topic — the built-in middleware catalog (`rateLimit`, `idempotency`, `maxBodySize`, etc.) + request-id correlation.
221
+ - The `register-route` topic — where middleware attaches: `router.group` and route-options.
222
+ - The `create-controller` topic — how the controller picks up `request.locals.user`, `request.validated()`, etc., set by upstream middleware.
223
+ - The `send-response` topic — the response helpers used to short-circuit.
224
+ - The `warlock-conventions` topic — the `guarded()` / `guardedAdmin()` / `publicRoutes()` convention.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-seeder
3
- description: 'Author a seed file under `src/app/<module>/seeds/<name>.ts` using the `seeder()` factory — `name`, `dependsOn`, `once`, `order`, `batchSize`, `run({ track, now, batchSize })`. Auto-discovered by `warlock seed`; tracked in a `seeds` table; per-record refs in `seed_records` so `warlock seed --drop` can undo a seed. Triggers: `seeder`, `Seeder`, `SeedResult`, `SeedContext`, `SeedClock`, `track`, `now`, `batchSize`, `SeedersManager`, `warlock seed`, `--fresh`, `--drop`, `--list`, `--path`; "seed default roles", "undo a seed", "one-time data migration", "auto-discovered seeds", "order seeds by dependency", "deterministic seed timestamps", "inject a seed clock"; typical import `import { seeder } from "@warlock.js/core"`. Skip: module folder layout — `@warlock.js/core/create-module/SKILL.md`; repository CRUD — `@warlock.js/core/use-repository/SKILL.md`; CLI flags — `@warlock.js/core/write-cli-command/SKILL.md`; competing patterns: hand-rolled `node scripts/seed.js`, `typeorm-seeding`.'
3
+ description: 'Author a seed file under `src/app/<module>/seeds/<name>.ts` using the `seeder()` factory — `name`, `dependsOn`, `once`, `order`, `batchSize`, `run({ track, now, batchSize })`. Auto-discovered by `warlock seed`; tracked in a `seeds` table; per-record refs in `seed_records` so `warlock seed --drop` can undo a seed. Triggers: `seeder`, `Seeder`, `SeedResult`, `SeedContext`, `SeedClock`, `track`, `now`, `batchSize`, `SeedersManager`, `warlock seed`, `--fresh`, `--drop`, `--list`, `--path`; "seed default roles", "undo a seed", "one-time data migration", "auto-discovered seeds", "order seeds by dependency", "deterministic seed timestamps", "inject a seed clock"; typical import `import { seeder } from "@warlock.js/core"`. Skip: module folder layout — the `create-module` topic; repository CRUD — the `use-repository` topic; CLI flags — the `write-cli-command` topic; competing patterns: hand-rolled `node scripts/seed.js`, `typeorm-seeding`.'
4
4
  ---
5
5
 
6
6
  # Warlock — write a seeder
@@ -371,7 +371,7 @@ warlock seed --transaction # (default true) — pass --transaction=false to s
371
371
 
372
372
  ## See also
373
373
 
374
- - [`create-module/SKILL.md`](../create-module/SKILL.md) — the `seeds/` folder layout in a module, `generate.module` scaffolding.
375
- - [`use-repository/SKILL.md`](../use-repository/SKILL.md) — the model `create` / `first` calls used inside seeds.
376
- - [`write-cli-command/SKILL.md`](../write-cli-command/SKILL.md) — the `warlock seed` CLI flags and full preload shape.
377
- - [`warlock-conventions/SKILL.md`](../warlock-conventions/SKILL.md) — `seeds/` is the canonical folder name (singular `seed/` is incorrect).
374
+ - The `create-module` topic — the `seeds/` folder layout in a module, `generate.module` scaffolding.
375
+ - The `use-repository` topic — the model `create` / `first` calls used inside seeds.
376
+ - The `write-cli-command` topic — the `warlock seed` CLI flags and full preload shape.
377
+ - The `warlock-conventions` topic — `seeds/` is the canonical folder name (singular `seed/` is incorrect).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-use-case
3
- description: 'Author `useCase()` pipelines for business logic — guards, schema, before/after middleware, retry, benchmark, broadcast, lifecycle callbacks; transport-agnostic and observable by default. Input is inferred from the `schema`. Triggers: `useCase`, `UseCaseContext`, `UseCaseResult`, `retry`, `benchmark`, `broadcast`, `description`, `globalUseCasesEvents`, `UseCaseBroadcastChannel`; "encapsulate a business operation", "share logic between HTTP and CLI", "add guards and lifecycle hooks", "broadcast a use case result", "transport-agnostic pipeline"; typical import `import { useCase } from "@warlock.js/core"`. Skip: thin handler shape — `@warlock.js/core/create-controller/SKILL.md`; schema details — `@warlock.js/core/validate-input/SKILL.md`; the standalone retry util — `@warlock.js/core/retry-operation/SKILL.md`; competing libs `@nestjs/cqrs`, `inversify`, hand-rolled service classes.'
3
+ description: 'Author `useCase()` pipelines for business logic — guards, schema, before/after middleware, retry, benchmark, broadcast, lifecycle callbacks; transport-agnostic and observable by default. Input is inferred from the `schema`. Triggers: `useCase`, `UseCaseContext`, `UseCaseResult`, `retry`, `benchmark`, `broadcast`, `description`, `globalUseCasesEvents`, `UseCaseBroadcastChannel`; "encapsulate a business operation", "share logic between HTTP and CLI", "add guards and lifecycle hooks", "broadcast a use case result", "transport-agnostic pipeline"; typical import `import { useCase } from "@warlock.js/core"`. Skip: thin handler shape — the `create-controller` topic; schema details — the `validate-input` topic; the standalone retry util — the `retry-operation` topic; competing libs `@nestjs/cqrs`, `inversify`, hand-rolled service classes.'
4
4
  ---
5
5
 
6
6
  # Warlock — write a use case
@@ -290,6 +290,6 @@ For the plain-function flavour (`warlock generate.use-case <module>/<verb-noun>`
290
290
 
291
291
  ## See also
292
292
 
293
- - [`@warlock.js/core/create-controller/SKILL.md`](@warlock.js/core/create-controller/SKILL.md) — the usual next step: invoke this use case from an HTTP controller.
294
- - [`@warlock.js/herald/publish-message/SKILL.md`](@warlock.js/herald/publish-message/SKILL.md) — the message bus the `broadcast` adapter publishes to (cross-package).
293
+ - The `create-controller` topic — the usual next step: invoke this use case from an HTTP controller.
294
+ - The `publish-message` topic of the `warlock-js-herald` skill — the message bus the `broadcast` adapter publishes to (cross-package).
295
295