@starci/hfs 5.0.7 → 5.1.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 (204) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +7 -8
  3. package/cache/fake-session.mjs +1 -1
  4. package/cache/hfs-family.mjs +22 -9
  5. package/cache/import-graph.d.mts +32 -4
  6. package/cache/import-graph.mjs +88 -11
  7. package/cache/lint-family.d.mts +10 -3
  8. package/cache/lint-family.mjs +65 -37
  9. package/cache/records.d.mts +7 -0
  10. package/cache/records.mjs +17 -1
  11. package/cache/run.d.mts +1 -1
  12. package/cache/session.mjs +6 -2
  13. package/cache/side-key.d.mts +2 -0
  14. package/cache/side-key.mjs +5 -1
  15. package/cache/structure-memo.d.mts +34 -0
  16. package/cache/structure-memo.mjs +150 -0
  17. package/cache/types.d.mts +6 -2
  18. package/cache/wiring-family.mjs +1 -1
  19. package/codemod/directive-first.d.mts +48 -0
  20. package/codemod/directive-first.mjs +136 -0
  21. package/codemod/explicit-surface-edit.d.mts +14 -0
  22. package/codemod/explicit-surface-edit.mjs +57 -0
  23. package/codemod/explicit-surface-names.d.mts +30 -0
  24. package/codemod/explicit-surface-names.mjs +135 -0
  25. package/codemod/explicit-surface-render.d.mts +29 -0
  26. package/codemod/explicit-surface-render.mjs +197 -0
  27. package/codemod/explicit-surface.d.mts +50 -0
  28. package/codemod/explicit-surface.mjs +374 -0
  29. package/codemod/main.d.mts +7 -5
  30. package/codemod/main.mjs +37 -16
  31. package/codemod/small-renames.mjs +22 -2
  32. package/codemod/source-tree.d.mts +8 -0
  33. package/codemod/source-tree.mjs +23 -0
  34. package/lint/eslint-list.cjs +55 -0
  35. package/lint/run.d.mts +35 -61
  36. package/lint/run.mjs +91 -288
  37. package/package.json +1 -1
  38. package/release/lint-report.d.mts +1 -1
  39. package/release/lint-report.mjs +3 -3
  40. package/report/sonar.d.mts +1 -1
  41. package/report/sonar.mjs +3 -3
  42. package/report/stylelint-findings.d.mts +23 -0
  43. package/report/stylelint-findings.mjs +9 -0
  44. package/runtime/knowledge/hfs/canon-pins.yaml +8 -8
  45. package/runtime/knowledge/hfs/ci-standard.yaml +2 -2
  46. package/runtime/knowledge/hfs/rules.yaml +56 -5
  47. package/runtime/knowledge/hfs/slots.yaml +1 -1
  48. package/runtime/knowledge/sonar-gate.yaml +2 -2
  49. package/runtime/modules/kernel/failure-codes.yaml +4 -4
  50. package/runtime/scripts/api/node/run-node.d.mts +5 -0
  51. package/runtime/scripts/hfs/architecture/test-world-files.d.mts +4 -3
  52. package/runtime/scripts/hfs/architecture/test-world-files.mjs +26 -7
  53. package/runtime/scripts/hfs/check.d.mts +16 -1
  54. package/runtime/scripts/hfs/check.mjs +18 -7
  55. package/runtime/scripts/hfs/explicit-surface-rule.d.mts +58 -0
  56. package/runtime/scripts/hfs/explicit-surface-rule.mjs +59 -0
  57. package/runtime/scripts/hfs/gate-threshold.mjs +1 -1
  58. package/runtime/scripts/hfs/rule-memo.d.mts +30 -0
  59. package/runtime/scripts/hfs/rule-memo.mjs +24 -0
  60. package/runtime/scripts/hfs/rules/a15-findings.d.mts +6 -0
  61. package/runtime/scripts/hfs/rules/a15-findings.mjs +11 -2
  62. package/runtime/scripts/hfs/rules/ci-standard.mjs +2 -2
  63. package/runtime/scripts/hfs/rules/monorepo.d.mts +1 -3
  64. package/runtime/scripts/hfs/rules/monorepo.mjs +9 -11
  65. package/runtime/scripts/hfs/rules/pipeline.mjs +13 -9
  66. package/runtime/scripts/hfs/rules/read.d.mts +5 -0
  67. package/runtime/scripts/hfs/rules/read.mjs +13 -0
  68. package/runtime/scripts/hfs/rules/secrets.d.mts +2 -0
  69. package/runtime/scripts/hfs/rules/secrets.mjs +4 -1
  70. package/runtime/scripts/hfs/rules/stacks-release.mjs +35 -21
  71. package/runtime/scripts/lib/declaration-surface.d.mts +35 -0
  72. package/runtime/scripts/lib/declaration-surface.mjs +112 -0
  73. package/runtime/scripts/lib/worktree-exclude.mjs +1 -1
  74. package/scaffold/app.mjs +3 -3
  75. package/src/check-cache-structure-support.d.mts +52 -0
  76. package/src/main.d.mts +3 -2
  77. package/src/main.mjs +123 -109
  78. package/sync/ci-commands.d.mts +2 -1
  79. package/sync/ci-commands.mjs +19 -20
  80. package/sync/index.mjs +2 -2
  81. package/templates/app/package-scripts/core.json +2 -2
  82. package/templates/app/task-graph/turbo.json +0 -3
  83. package/templates/be/inbox/delivery-recorded.event.ts.tpl +2 -2
  84. package/templates/be/inbox/entities.index.ts.tpl +1 -1
  85. package/templates/be/inbox/module-definition.ts.tpl +8 -2
  86. package/templates/be/inbox/platform/event-bus/event-bus.module-definition.ts.tpl +10 -2
  87. package/templates/be/inbox/platform/inbox/inbox.module-definition.ts.tpl +8 -2
  88. package/templates/be/patterns/api/feature.module-definition.ts.tpl +9 -3
  89. package/templates/be/patterns/api/graphql.module-definition.ts.tpl +9 -3
  90. package/templates/be/patterns/cli/group.module-definition.ts.tpl +9 -3
  91. package/templates/be/patterns/event-bus/platform/event-bus.module-definition.ts.tpl +8 -3
  92. package/templates/be/patterns/event-bus/platform/persistence/connection.ts.tpl +3 -2
  93. package/templates/be/patterns/event-bus/platform/persistence/event-bus.sql.ts.tpl +4 -3
  94. package/templates/be/patterns/idempotency/platform/inbox/inbox.module-definition.ts.tpl +8 -3
  95. package/templates/be/patterns/idempotency/platform/inbox/persistence/connection.ts.tpl +3 -2
  96. package/templates/be/patterns/idempotency/platform/inbox/persistence/inbox.sql.ts.tpl +7 -6
  97. package/templates/be/patterns/jobs/job.module-definition.ts.tpl +9 -3
  98. package/templates/be/patterns/jobs/job.processor.ts.tpl +1 -1
  99. package/templates/be/patterns/jobs/job.queue.module-definition.ts.tpl +9 -3
  100. package/templates/be/patterns/jobs/platform/jobs.module-definition.ts.tpl +8 -3
  101. package/templates/be/patterns/jobs/platform/persistence.connection.ts.tpl +3 -2
  102. package/templates/be/patterns/jobs/platform/persistence.jobs.sql.ts.tpl +5 -4
  103. package/templates/be/patterns/projections/persistence.connection.ts.tpl +3 -2
  104. package/templates/be/patterns/projections/projection.module-definition.ts.tpl +8 -3
  105. package/templates/be/patterns/queues/platform/persistence.connection.ts.tpl +3 -2
  106. package/templates/be/patterns/queues/platform/persistence.queue.sql.ts.tpl +4 -3
  107. package/templates/be/patterns/queues/platform/queue.module-definition.ts.tpl +8 -3
  108. package/templates/be/patterns/queues/queue.module-definition.ts.tpl +9 -3
  109. package/templates/be/patterns/reactors/consumer.ts.tpl +1 -1
  110. package/templates/be/patterns/reactors/message.module-definition.ts.tpl +9 -3
  111. package/templates/be/patterns/reactors/reactor.module-definition.ts.tpl +9 -3
  112. package/templates/be/patterns/realtime/channel.graphql.module-definition.ts.tpl +9 -3
  113. package/templates/be/patterns/realtime/channel.sse.module-definition.ts.tpl +9 -3
  114. package/templates/be/patterns/realtime/channel.websocket.module-definition.ts.tpl +9 -3
  115. package/templates/be/patterns/saga/saga.done.consumer.ts.tpl +1 -1
  116. package/templates/be/patterns/saga/saga.failed.consumer.ts.tpl +1 -1
  117. package/templates/be/patterns/saga/saga.message.module-definition.ts.tpl +9 -3
  118. package/templates/be/patterns/saga/saga.module-definition.ts.tpl +9 -3
  119. package/templates/be/patterns/webhooks/webhook.http.module-definition.ts.tpl +9 -3
  120. package/templates/be/platform/graphql/graphql.module-definition.ts +8 -3
  121. package/templates/be/skeleton/src/features/api/system-health/system-health.module-definition.ts +9 -3
  122. package/templates/be/skeleton/src/features/api/system-health/transport/http/system-health-http.module-definition.ts +9 -3
  123. package/templates/be/skeleton/src/features/cli/cli.module-definition.ts +9 -3
  124. package/templates/be/skeleton/src/features/cli/migrate/migrate.module-definition.ts +9 -3
  125. package/templates/be/skeleton/src/features/cli/seed/seed.module-definition.ts +9 -3
  126. package/templates/be/skeleton/src/modules/domain/identity/identity.module-definition.ts +8 -3
  127. package/templates/be/skeleton/src/modules/domain/liveness/liveness.module-definition.ts +8 -3
  128. package/templates/be/skeleton/src/modules/domain/note/note.module-definition.ts +8 -3
  129. package/templates/be/skeleton/src/modules/domain/note/persistence/connection.ts +3 -2
  130. package/templates/be/skeleton/src/modules/domain/note/persistence/note.sql.ts +2 -1
  131. package/templates/be/skeleton/src/modules/platform/clock/clock.module-definition.ts +8 -3
  132. package/templates/be/skeleton/src/modules/platform/cqrs/cqrs.module-definition.ts +8 -3
  133. package/templates/be/skeleton/src/modules/platform/database/database.module-definition.ts +8 -3
  134. package/templates/be/skeleton/src/modules/platform/database/index.ts +1 -0
  135. package/templates/be/skeleton/src/modules/platform/errors/errors.module-definition.ts +10 -4
  136. package/templates/be/skeleton/src/modules/platform/http/http.module-definition.ts +8 -4
  137. package/templates/be/skeleton/src/modules/platform/http-security/http-security.module-definition.ts +10 -4
  138. package/templates/be/skeleton/src/modules/platform/http-security/persistence/connection.ts +3 -2
  139. package/templates/be/skeleton/src/modules/platform/http-security/persistence/rate-limit.sql.ts +3 -2
  140. package/templates/be/skeleton/src/modules/platform/i18n/i18n.module-definition.ts +10 -4
  141. package/templates/be/skeleton/src/modules/platform/ids/ids.module-definition.ts +8 -3
  142. package/templates/be/skeleton/src/modules/platform/logging/logging.module-definition.ts +8 -3
  143. package/templates/be/skeleton/src/modules/platform/retry/retry.module-definition.ts +8 -3
  144. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.decorators.ts +1 -1
  145. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/google.strategy.ts +5 -1
  146. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/local.strategy.ts +5 -1
  147. package/templates/be/skeleton-lite/src/modules/platform/database/database.port.ts +1 -1
  148. package/templates/be/skeleton-lite/src/modules/platform/http-security/persistence/entities/index.ts +1 -1
  149. package/templates/be/skeleton-lite/src/tests/fixtures/builders/api.builder.ts +7 -1
  150. package/templates/be/skeleton-lite/src/tests/fixtures/builders/cli.builder.ts +7 -1
  151. package/templates/be/table/api/feature.module-definition.ts.tpl +9 -3
  152. package/templates/be/table/api/graphql.module-definition.ts.tpl +9 -3
  153. package/templates/be/table/entities.index.ts.tpl +1 -1
  154. package/templates/be/table/module-definition.ts.tpl +8 -3
  155. package/templates/be/test-world/fixtures/migrations.sql.ts.tpl +1 -0
  156. package/templates/be/test-world/world/test-world.config.ts.tpl +8 -1
  157. package/templates/fe/common/app-layout.tsx.partial +1 -1
  158. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSession.ts +2 -1
  159. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSignIn.ts +11 -3
  160. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSignOut.ts +8 -2
  161. package/templates/fe/skeleton/apps/__app__/src/hooks/zustand/appGuide/store.ts +2 -1
  162. package/templates/fe/skeleton/apps/__app__/src/modules/toast/hooks.ts +1 -1
  163. package/templates/fe/skeleton/apps/__app__/src/modules/toast/toast.tsx +4 -1
  164. package/templates/fe/skeleton/apps/__app__/src/redux/hooks.ts +3 -2
  165. package/templates/fe/skeleton/apps/__app__/src/redux/index.ts +1 -0
  166. package/templates/fe/skeleton/apps/__app__/src/redux/slices/session.ts +12 -4
  167. package/templates/fe/skeleton/apps/__app__/src/redux/store.ts +8 -3
  168. package/templates/fe/skeleton/apps/app/src/app/[locale]/layout.tsx +4 -3
  169. package/templates/fe/skeleton/apps/app/src/features/layouts/AppLayout/index.tsx +1 -1
  170. package/templates/fe/skeleton/apps/app/src/features/pages/AppHomePage/index.tsx +2 -1
  171. package/templates/fe/skeleton/apps/app/src/features/pages/AppLoadingPage/index.tsx +2 -1
  172. package/templates/fe/skeleton/apps/app/src/features/pages/AppNotFoundPage/index.tsx +2 -1
  173. package/templates/fe/skeleton/apps/app/src/modules/i18n/index.ts +2 -1
  174. package/templates/fe/skeleton/apps/app/src/modules/i18n/request.ts +4 -1
  175. package/templates/fe/skeleton/apps/landing/src/app/[locale]/layout.tsx +4 -3
  176. package/templates/fe/skeleton/apps/landing/src/features/layouts/LandingLayout/index.tsx +2 -2
  177. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingLoadingPage/index.tsx +2 -1
  178. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingNotFoundPage/index.tsx +2 -1
  179. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingPage/index.tsx +2 -1
  180. package/templates/fe/skeleton/apps/landing/src/modules/i18n/index.ts +2 -1
  181. package/templates/fe/skeleton/apps/landing/src/modules/i18n/request.ts +4 -1
  182. package/templates/fe/skeleton/packages/__project__-i18n/src/index.ts +19 -1
  183. package/templates/fe/skeleton/packages/__project__-i18n/src/proxy.ts +1 -1
  184. package/templates/fe/skeleton/packages/__project__-i18n/src/routing.ts +5 -1
  185. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/layout.tsx +4 -3
  186. package/templates/fe/skeleton-lite/apps/web/src/features/layouts/AppLayout/index.tsx +2 -2
  187. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppHomePage/index.tsx +2 -1
  188. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppLoadingPage/index.tsx +2 -1
  189. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppNotFoundPage/index.tsx +2 -1
  190. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/request.ts +3 -1
  191. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/routing.ts +5 -1
  192. package/templates/fe/table/graphql/useMutateSwr.ts.tpl +2 -1
  193. package/templates/fe/table/graphql/useQuerySwr.ts.tpl +2 -1
  194. package/templates/fe/transport/graphql/clients/clients/auth.ts +1 -1
  195. package/templates/fe/transport/graphql/clients/clients/no-auth.ts +1 -1
  196. package/templates/fe/transport/graphql/clients/links/attach-access-token.ts +1 -1
  197. package/templates/fe/transport/graphql/clients/links/error.ts +1 -1
  198. package/templates/fe/transport/graphql/clients/links/http.ts +1 -1
  199. package/templates/fe/transport/graphql/clients/links/locale.ts +1 -1
  200. package/templates/fe/transport/graphql/clients/links/refresh-token.ts +1 -1
  201. package/templates/fe/transport/graphql/clients/links/retry.ts +1 -1
  202. package/templates/fe/transport/graphql/clients/links/timeout.ts +1 -1
  203. package/templates/fe/units/page/index.tsx.tpl +3 -2
  204. package/templates/fe/units/slot/SlotView.tsx.tpl +1 -1
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Reactor@@Options } from "./@@reactor@@.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Reactor@@Options>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Reactor@@Options, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@reactor@@ module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Reactor@@Options>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Channel@@GraphqlOptions } from "./@@channel@@-graphql.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Channel@@GraphqlOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Channel@@GraphqlOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@channel@@-graphql module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Channel@@GraphqlOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Channel@@SseOptions } from "./@@channel@@-sse.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Channel@@SseOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Channel@@SseOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@channel@@-sse module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Channel@@SseOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Channel@@WebsocketOptions } from "./@@channel@@-websocket.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Channel@@WebsocketOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Channel@@WebsocketOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@channel@@-websocket module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Channel@@WebsocketOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -8,7 +8,7 @@ import { Complete@@Saga@@Command } from "../../application/complete-@@saga@@.com
8
8
  @Injectable()
9
9
  /** Consumer of `@@from@@.@@done@@`, the last event of the @@saga@@ saga: hands each delivery to the complete command. */
10
10
  export class @@Done@@Consumer implements EventConsumer<@@Done@@Event> {
11
- readonly event = @@Done@@Event
11
+ readonly event: typeof @@Done@@Event = @@Done@@Event
12
12
 
13
13
  constructor(@InjectCommandBus() private readonly commandBus: CommandBus) {}
14
14
 
@@ -8,7 +8,7 @@ import { Compensate@@Saga@@Command } from "../../application/compensate-@@saga@@
8
8
  @Injectable()
9
9
  /** Consumer of `@@from@@.@@failed@@`, the failure event of the @@saga@@ saga: hands each delivery to the compensate command. */
10
10
  export class @@Failed@@Consumer implements EventConsumer<@@Failed@@Event> {
11
- readonly event = @@Failed@@Event
11
+ readonly event: typeof @@Failed@@Event = @@Failed@@Event
12
12
 
13
13
  constructor(@InjectCommandBus() private readonly commandBus: CommandBus) {}
14
14
 
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Saga@@MessageOptions } from "./@@saga@@-message.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Saga@@MessageOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Saga@@MessageOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@saga@@-message module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Saga@@MessageOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Saga@@Options } from "./@@saga@@.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Saga@@Options>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Saga@@Options, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@saga@@ module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Saga@@Options>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Provider@@HttpOptions } from "./@@provider@@-http.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Provider@@HttpOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Provider@@HttpOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@provider@@-http module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Provider@@HttpOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { GraphqlOptions } from "./graphql.options"
3
3
 
4
- /** The configurable-module base of the graphql capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<GraphqlOptions>()
4
+ const built = new ConfigurableModuleBuilder<GraphqlOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<GraphqlOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the graphql capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { SystemHealthOptions } from "./system-health.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<SystemHealthOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<SystemHealthOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the system-health module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<SystemHealthOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { SystemHealthHttpOptions } from "./system-health-http.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<SystemHealthHttpOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<SystemHealthHttpOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the system-health-http module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<SystemHealthHttpOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { CliOptions } from "./cli.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<CliOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<CliOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the cli module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<CliOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { MigrateOptions } from "./migrate.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<MigrateOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<MigrateOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the migrate module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<MigrateOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,6 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { SeedOptions } from "./seed.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<SeedOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<SeedOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the seed module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<SeedOptions>().setClassMethodName("register").build()
8
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
9
+ /** The injection token of the registered options. */
10
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { IdentityOptions } from "./identity.options"
3
3
 
4
- /** The configurable-module base of the identity capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<IdentityOptions>()
4
+ const built = new ConfigurableModuleBuilder<IdentityOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<IdentityOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the identity capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { LivenessOptions } from "./liveness.options"
3
3
 
4
- /** The configurable-module base of the liveness capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<LivenessOptions>()
4
+ const built = new ConfigurableModuleBuilder<LivenessOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<LivenessOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the liveness capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { NoteOptions } from "./note.options"
3
3
 
4
- /** The configurable-module base of the note capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<NoteOptions>()
4
+ const built = new ConfigurableModuleBuilder<NoteOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<NoteOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the note capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,8 +1,9 @@
1
+ import type { DatabaseConnectionOptions } from "@modules/platform/database"
1
2
  import { NoteEntity } from "./entities/note.entity"
2
3
  import { InitNote1790000000000 } from "./migrations/1790000000000-init-note"
3
4
 
4
5
  /** The entities of the note capability, for the connection that holds them. */
5
- export const noteEntities = [NoteEntity]
6
+ export const noteEntities: DatabaseConnectionOptions["entities"] = [NoteEntity]
6
7
 
7
8
  /** The migrations of the note capability, in the order they run. */
8
- export const noteMigrations = [InitNote1790000000000]
9
+ export const noteMigrations: DatabaseConnectionOptions["migrations"] = [InitNote1790000000000]
@@ -1,4 +1,5 @@
1
1
  import { sql } from "@modules/platform/database"
2
+ import type { SqlText } from "@modules/platform/database"
2
3
 
3
4
  /** Writes one note ($1 body, $2 written at) and answers the stored row. */
4
- export const INSERT_NOTE = sql`INSERT INTO notes (body, created_at) VALUES ($1, $2) RETURNING id, body, created_at`
5
+ export const INSERT_NOTE: SqlText = sql`INSERT INTO notes (body, created_at) VALUES ($1, $2) RETURNING id, body, created_at`
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { ClockOptions } from "./clock.options"
3
3
 
4
- /** The configurable-module base of the clock capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<ClockOptions>()
4
+ const built = new ConfigurableModuleBuilder<ClockOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<ClockOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the clock capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { CqrsOptions } from "./cqrs.options"
3
3
 
4
- /** The configurable-module base of the cqrs capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<CqrsOptions>()
4
+ const built = new ConfigurableModuleBuilder<CqrsOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<CqrsOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the cqrs capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,9 +1,8 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import { DATABASE_OPTIONS } from "./database.port"
3
3
  import type { DatabaseOptions } from "./database.options"
4
4
 
5
- /** The configurable-module base of the database capability; `isGlobal` is decided by the app root. */
6
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<DatabaseOptions>({
5
+ const built = new ConfigurableModuleBuilder<DatabaseOptions>({
7
6
  optionsInjectionToken: DATABASE_OPTIONS,
8
7
  })
9
8
  .setExtras({ isGlobal: false }, (definition, extras) => ({
@@ -11,3 +10,9 @@ export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleB
11
10
  global: extras.isGlobal,
12
11
  }))
13
12
  .build()
13
+ type Host = ConfigurableModuleHost<DatabaseOptions, "register", "create", { isGlobal: boolean }>
14
+
15
+ /** The configurable-module base of the database capability; `isGlobal` is decided by the app root. */
16
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
17
+ /** The options of a synchronous registration, for the register signature. */
18
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -6,6 +6,7 @@ export { DEFAULT_SEED_ENV } from "./seed-connections.client"
6
6
  export { SeedRunnerService } from "./seed-runner.service"
7
7
  export type { DatabaseConnectionConfig, DatabaseConnectionOptions } from "./database.options"
8
8
  export { LIST_ROWS_MAX, sql } from "./database.sql"
9
+ export type { SqlText } from "./database.sql"
9
10
  export { DATABASE_ERROR_KINDS } from "./errors/database.error"
10
11
  export { returnedRows, rowShape } from "./returned-rows.policy"
11
12
  export { parsePrimaryDatabaseConfig } from "./primary.config"
@@ -1,9 +1,15 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import { ERRORS_OPTIONS } from "./errors.decorators"
3
3
  import type { ErrorsOptions } from "./errors.options"
4
4
 
5
- /** The configurable-module base of the errors capability; `isGlobal` is decided by the app root. */
6
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
7
- new ConfigurableModuleBuilder<ErrorsOptions>({ optionsInjectionToken: ERRORS_OPTIONS })
5
+ const built = new ConfigurableModuleBuilder<ErrorsOptions>({ optionsInjectionToken: ERRORS_OPTIONS })
8
6
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
9
7
  .build()
8
+ type Host = ConfigurableModuleHost<ErrorsOptions, "register", "create", { isGlobal: boolean }>
9
+
10
+ /** The configurable-module base of the errors capability; `isGlobal` is decided by the app root. */
11
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
12
+ /** The injection token of the registered options. */
13
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
14
+ /** The options of a synchronous registration, for the register signature. */
15
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,9 +1,13 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import { HTTP_OPTIONS } from "./http.decorators"
3
3
  import type { HttpOptions } from "./http.options"
4
4
 
5
- /** The configurable-module base of the http capability; `isGlobal` is decided by the app root. */
6
- export const { ConfigurableModuleClass, OPTIONS_TYPE } =
7
- new ConfigurableModuleBuilder<HttpOptions>({ optionsInjectionToken: HTTP_OPTIONS })
5
+ const built = new ConfigurableModuleBuilder<HttpOptions>({ optionsInjectionToken: HTTP_OPTIONS })
8
6
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
9
7
  .build()
8
+ type Host = ConfigurableModuleHost<HttpOptions, "register", "create", { isGlobal: boolean }>
9
+
10
+ /** The configurable-module base of the http capability; `isGlobal` is decided by the app root. */
11
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
12
+ /** The options of a synchronous registration, for the register signature. */
13
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,9 +1,15 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import { HTTP_SECURITY_OPTIONS } from "./http-security.decorators"
3
3
  import type { HttpSecurityOptions } from "./http-security.options"
4
4
 
5
- /** The configurable-module base of the http-security capability; `isGlobal` is decided by the app root. */
6
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
7
- new ConfigurableModuleBuilder<HttpSecurityOptions>({ optionsInjectionToken: HTTP_SECURITY_OPTIONS })
5
+ const built = new ConfigurableModuleBuilder<HttpSecurityOptions>({ optionsInjectionToken: HTTP_SECURITY_OPTIONS })
8
6
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
9
7
  .build()
8
+ type Host = ConfigurableModuleHost<HttpSecurityOptions, "register", "create", { isGlobal: boolean }>
9
+
10
+ /** The configurable-module base of the http-security capability; `isGlobal` is decided by the app root. */
11
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
12
+ /** The injection token of the registered options. */
13
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
14
+ /** The options of a synchronous registration, for the register signature. */
15
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,8 +1,9 @@
1
+ import type { DatabaseConnectionOptions } from "@modules/platform/database"
1
2
  import { RateWindowEntity } from "./entities/rate-window.entity"
2
3
  import { CreateRateWindows1789900000000 } from "./migrations/1789900000000-create-rate-windows"
3
4
 
4
5
  /** The entities of the http-security capability, for the primary connection its rate limit counts in. */
5
- export const httpSecurityEntities = [RateWindowEntity]
6
+ export const httpSecurityEntities: DatabaseConnectionOptions["entities"] = [RateWindowEntity]
6
7
 
7
8
  /** The migrations of the http-security capability, in the order they run. */
8
- export const httpSecurityMigrations = [CreateRateWindows1789900000000]
9
+ export const httpSecurityMigrations: DatabaseConnectionOptions["migrations"] = [CreateRateWindows1789900000000]
@@ -1,10 +1,11 @@
1
1
  import { sql } from "@modules/platform/database"
2
+ import type { SqlText } from "@modules/platform/database"
2
3
 
3
4
  /**
4
5
  * Counts one hit in the caller's window and answers the hits of that window: a missing or expired window opens afresh at one
5
6
  * hit and ends at $3 ($1 tier and address key, $2 instant, $3 end of a fresh window).
6
7
  */
7
- export const HIT_RATE_WINDOW = sql`INSERT INTO http_security_rate_windows (key, hits, reset_at)
8
+ export const HIT_RATE_WINDOW: SqlText = sql`INSERT INTO http_security_rate_windows (key, hits, reset_at)
8
9
  VALUES ($1::varchar, 1, $3::timestamptz)
9
10
  ON CONFLICT (key) DO UPDATE SET
10
11
  hits = CASE WHEN http_security_rate_windows.reset_at <= $2::timestamptz THEN 1
@@ -14,7 +15,7 @@ export const HIT_RATE_WINDOW = sql`INSERT INTO http_security_rate_windows (key,
14
15
  RETURNING hits`
15
16
 
16
17
  /** Deletes a bounded batch of the windows that ended by $1; a second replica skips the rows this one holds. */
17
- export const PRUNE_RATE_WINDOWS = sql`DELETE FROM http_security_rate_windows WHERE key IN (
18
+ export const PRUNE_RATE_WINDOWS: SqlText = sql`DELETE FROM http_security_rate_windows WHERE key IN (
18
19
  SELECT key FROM http_security_rate_windows WHERE reset_at <= $1::timestamptz
19
20
  LIMIT 100 FOR UPDATE SKIP LOCKED
20
21
  )`
@@ -1,9 +1,15 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import { I18N_OPTIONS } from "./i18n.decorators"
3
3
  import type { I18nOptions } from "./i18n.options"
4
4
 
5
- /** The configurable-module base of the i18n capability; `isGlobal` is decided by the app root. */
6
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
7
- new ConfigurableModuleBuilder<I18nOptions>({ optionsInjectionToken: I18N_OPTIONS })
5
+ const built = new ConfigurableModuleBuilder<I18nOptions>({ optionsInjectionToken: I18N_OPTIONS })
8
6
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
9
7
  .build()
8
+ type Host = ConfigurableModuleHost<I18nOptions, "register", "create", { isGlobal: boolean }>
9
+
10
+ /** The configurable-module base of the i18n capability; `isGlobal` is decided by the app root. */
11
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
12
+ /** The injection token of the registered options. */
13
+ export const MODULE_OPTIONS_TOKEN: Host["MODULE_OPTIONS_TOKEN"] = built.MODULE_OPTIONS_TOKEN
14
+ /** The options of a synchronous registration, for the register signature. */
15
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { IdsOptions } from "./ids.options"
3
3
 
4
- /** The configurable-module base of the ids capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<IdsOptions>()
4
+ const built = new ConfigurableModuleBuilder<IdsOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<IdsOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the ids capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { LoggingOptions } from "./logging.options"
3
3
 
4
- /** The configurable-module base of the logging capability; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<LoggingOptions>()
4
+ const built = new ConfigurableModuleBuilder<LoggingOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<LoggingOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the logging capability; `isGlobal` is decided by the app root. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { RetryOptions } from "./retry.options"
3
3
 
4
- /** The configurable-module base of the retry capability; the app root decides its global scope. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<RetryOptions>()
4
+ const built = new ConfigurableModuleBuilder<RetryOptions>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<RetryOptions, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the retry capability; the app root decides its global scope. */
10
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
11
+ /** The options of a synchronous registration, for the register signature. */
12
+ export const OPTIONS_TYPE: Host["OPTIONS_TYPE"] = built.OPTIONS_TYPE
@@ -47,7 +47,7 @@ export const Credential = (metadata: CredentialMetadata): DoorDecorator =>
47
47
  applyDecorators(SetMetadata(CREDENTIAL_KEY, metadata), ServerToServer())
48
48
 
49
49
  /** The authenticated caller established by the default-deny guard. */
50
- export const CurrentPrincipal = createParamDecorator((_data: unknown, context: ExecutionContext): Principal => {
50
+ export const CurrentPrincipal: ReturnType<typeof createParamDecorator> = createParamDecorator((_data: unknown, context: ExecutionContext): Principal => {
51
51
  const principal = requestOf(context).principal
52
52
  if (!principal) throw new IdentityError({ code: IdentityErrorCode.Unauthenticated })
53
53
  return principal
@@ -1,4 +1,5 @@
1
1
  import { Injectable } from "@nestjs/common"
2
+ import type { Type } from "@nestjs/common"
2
3
  import { PassportStrategy } from "@nestjs/passport"
3
4
  import { Strategy } from "passport-google-oauth20"
4
5
  import type { Profile } from "passport-google-oauth20"
@@ -14,9 +15,12 @@ export interface GoogleIdentity {
14
15
  readonly email?: string
15
16
  }
16
17
 
18
+ /** The Passport strategy base of the google scheme, typed as the class the strategy extends. */
19
+ const GoogleStrategyBase: Type<object> = PassportStrategy(Strategy, "google")
20
+
17
21
  @Injectable()
18
22
  /** Google OAuth 2.0 (authorization code with state and PKCE): it proves the Google identity and never signs the user in itself. */
19
- export class GoogleStrategy extends PassportStrategy(Strategy, "google") {
23
+ export class GoogleStrategy extends GoogleStrategyBase {
20
24
  constructor(@InjectPassportOptions() options: PassportOptions) {
21
25
  super({
22
26
  clientID: options.google.clientId,