@starci/hfs 5.0.8 → 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 (152) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cache/import-graph.mjs +6 -61
  3. package/cache/lint-family.d.mts +10 -1
  4. package/cache/lint-family.mjs +12 -5
  5. package/codemod/directive-first.d.mts +48 -0
  6. package/codemod/directive-first.mjs +136 -0
  7. package/codemod/explicit-surface-edit.d.mts +14 -0
  8. package/codemod/explicit-surface-edit.mjs +57 -0
  9. package/codemod/explicit-surface-names.d.mts +30 -0
  10. package/codemod/explicit-surface-names.mjs +135 -0
  11. package/codemod/explicit-surface-render.d.mts +29 -0
  12. package/codemod/explicit-surface-render.mjs +197 -0
  13. package/codemod/explicit-surface.d.mts +50 -0
  14. package/codemod/explicit-surface.mjs +374 -0
  15. package/codemod/main.d.mts +7 -5
  16. package/codemod/main.mjs +37 -16
  17. package/codemod/source-tree.d.mts +8 -0
  18. package/codemod/source-tree.mjs +23 -0
  19. package/lint/eslint-list.cjs +29 -0
  20. package/lint/run.d.mts +19 -5
  21. package/lint/run.mjs +47 -14
  22. package/package.json +1 -1
  23. package/runtime/knowledge/hfs/canon-pins.yaml +7 -7
  24. package/runtime/knowledge/hfs/rules.yaml +52 -1
  25. package/runtime/scripts/hfs/architecture/test-world-files.d.mts +4 -3
  26. package/runtime/scripts/hfs/architecture/test-world-files.mjs +26 -7
  27. package/runtime/scripts/hfs/explicit-surface-rule.d.mts +58 -0
  28. package/runtime/scripts/hfs/explicit-surface-rule.mjs +59 -0
  29. package/runtime/scripts/lib/declaration-surface.d.mts +35 -0
  30. package/runtime/scripts/lib/declaration-surface.mjs +112 -0
  31. package/templates/be/inbox/delivery-recorded.event.ts.tpl +2 -2
  32. package/templates/be/inbox/entities.index.ts.tpl +1 -1
  33. package/templates/be/inbox/module-definition.ts.tpl +8 -2
  34. package/templates/be/inbox/platform/event-bus/event-bus.module-definition.ts.tpl +10 -2
  35. package/templates/be/inbox/platform/inbox/inbox.module-definition.ts.tpl +8 -2
  36. package/templates/be/patterns/api/feature.module-definition.ts.tpl +9 -3
  37. package/templates/be/patterns/api/graphql.module-definition.ts.tpl +9 -3
  38. package/templates/be/patterns/cli/group.module-definition.ts.tpl +9 -3
  39. package/templates/be/patterns/event-bus/platform/event-bus.module-definition.ts.tpl +8 -3
  40. package/templates/be/patterns/event-bus/platform/persistence/connection.ts.tpl +3 -2
  41. package/templates/be/patterns/event-bus/platform/persistence/event-bus.sql.ts.tpl +4 -3
  42. package/templates/be/patterns/idempotency/platform/inbox/inbox.module-definition.ts.tpl +8 -3
  43. package/templates/be/patterns/idempotency/platform/inbox/persistence/connection.ts.tpl +3 -2
  44. package/templates/be/patterns/idempotency/platform/inbox/persistence/inbox.sql.ts.tpl +7 -6
  45. package/templates/be/patterns/jobs/job.module-definition.ts.tpl +9 -3
  46. package/templates/be/patterns/jobs/job.processor.ts.tpl +1 -1
  47. package/templates/be/patterns/jobs/job.queue.module-definition.ts.tpl +9 -3
  48. package/templates/be/patterns/jobs/platform/jobs.module-definition.ts.tpl +8 -3
  49. package/templates/be/patterns/jobs/platform/persistence.connection.ts.tpl +3 -2
  50. package/templates/be/patterns/jobs/platform/persistence.jobs.sql.ts.tpl +5 -4
  51. package/templates/be/patterns/projections/persistence.connection.ts.tpl +3 -2
  52. package/templates/be/patterns/projections/projection.module-definition.ts.tpl +8 -3
  53. package/templates/be/patterns/queues/platform/persistence.connection.ts.tpl +3 -2
  54. package/templates/be/patterns/queues/platform/persistence.queue.sql.ts.tpl +4 -3
  55. package/templates/be/patterns/queues/platform/queue.module-definition.ts.tpl +8 -3
  56. package/templates/be/patterns/queues/queue.module-definition.ts.tpl +9 -3
  57. package/templates/be/patterns/reactors/consumer.ts.tpl +1 -1
  58. package/templates/be/patterns/reactors/message.module-definition.ts.tpl +9 -3
  59. package/templates/be/patterns/reactors/reactor.module-definition.ts.tpl +9 -3
  60. package/templates/be/patterns/realtime/channel.graphql.module-definition.ts.tpl +9 -3
  61. package/templates/be/patterns/realtime/channel.sse.module-definition.ts.tpl +9 -3
  62. package/templates/be/patterns/realtime/channel.websocket.module-definition.ts.tpl +9 -3
  63. package/templates/be/patterns/saga/saga.done.consumer.ts.tpl +1 -1
  64. package/templates/be/patterns/saga/saga.failed.consumer.ts.tpl +1 -1
  65. package/templates/be/patterns/saga/saga.message.module-definition.ts.tpl +9 -3
  66. package/templates/be/patterns/saga/saga.module-definition.ts.tpl +9 -3
  67. package/templates/be/patterns/webhooks/webhook.http.module-definition.ts.tpl +9 -3
  68. package/templates/be/platform/graphql/graphql.module-definition.ts +8 -3
  69. package/templates/be/skeleton/src/features/api/system-health/system-health.module-definition.ts +9 -3
  70. package/templates/be/skeleton/src/features/api/system-health/transport/http/system-health-http.module-definition.ts +9 -3
  71. package/templates/be/skeleton/src/features/cli/cli.module-definition.ts +9 -3
  72. package/templates/be/skeleton/src/features/cli/migrate/migrate.module-definition.ts +9 -3
  73. package/templates/be/skeleton/src/features/cli/seed/seed.module-definition.ts +9 -3
  74. package/templates/be/skeleton/src/modules/domain/identity/identity.module-definition.ts +8 -3
  75. package/templates/be/skeleton/src/modules/domain/liveness/liveness.module-definition.ts +8 -3
  76. package/templates/be/skeleton/src/modules/domain/note/note.module-definition.ts +8 -3
  77. package/templates/be/skeleton/src/modules/domain/note/persistence/connection.ts +3 -2
  78. package/templates/be/skeleton/src/modules/domain/note/persistence/note.sql.ts +2 -1
  79. package/templates/be/skeleton/src/modules/platform/clock/clock.module-definition.ts +8 -3
  80. package/templates/be/skeleton/src/modules/platform/cqrs/cqrs.module-definition.ts +8 -3
  81. package/templates/be/skeleton/src/modules/platform/database/database.module-definition.ts +8 -3
  82. package/templates/be/skeleton/src/modules/platform/database/index.ts +1 -0
  83. package/templates/be/skeleton/src/modules/platform/errors/errors.module-definition.ts +10 -4
  84. package/templates/be/skeleton/src/modules/platform/http/http.module-definition.ts +8 -4
  85. package/templates/be/skeleton/src/modules/platform/http-security/http-security.module-definition.ts +10 -4
  86. package/templates/be/skeleton/src/modules/platform/http-security/persistence/connection.ts +3 -2
  87. package/templates/be/skeleton/src/modules/platform/http-security/persistence/rate-limit.sql.ts +3 -2
  88. package/templates/be/skeleton/src/modules/platform/i18n/i18n.module-definition.ts +10 -4
  89. package/templates/be/skeleton/src/modules/platform/ids/ids.module-definition.ts +8 -3
  90. package/templates/be/skeleton/src/modules/platform/logging/logging.module-definition.ts +8 -3
  91. package/templates/be/skeleton/src/modules/platform/retry/retry.module-definition.ts +8 -3
  92. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.decorators.ts +1 -1
  93. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/google.strategy.ts +5 -1
  94. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/local.strategy.ts +5 -1
  95. package/templates/be/skeleton-lite/src/modules/platform/database/database.port.ts +1 -1
  96. package/templates/be/skeleton-lite/src/modules/platform/http-security/persistence/entities/index.ts +1 -1
  97. package/templates/be/skeleton-lite/src/tests/fixtures/builders/api.builder.ts +7 -1
  98. package/templates/be/skeleton-lite/src/tests/fixtures/builders/cli.builder.ts +7 -1
  99. package/templates/be/table/api/feature.module-definition.ts.tpl +9 -3
  100. package/templates/be/table/api/graphql.module-definition.ts.tpl +9 -3
  101. package/templates/be/table/entities.index.ts.tpl +1 -1
  102. package/templates/be/table/module-definition.ts.tpl +8 -3
  103. package/templates/be/test-world/fixtures/migrations.sql.ts.tpl +1 -0
  104. package/templates/be/test-world/world/test-world.config.ts.tpl +8 -1
  105. package/templates/fe/common/app-layout.tsx.partial +1 -1
  106. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSession.ts +2 -1
  107. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSignIn.ts +11 -3
  108. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSignOut.ts +8 -2
  109. package/templates/fe/skeleton/apps/__app__/src/hooks/zustand/appGuide/store.ts +2 -1
  110. package/templates/fe/skeleton/apps/__app__/src/modules/toast/hooks.ts +1 -1
  111. package/templates/fe/skeleton/apps/__app__/src/modules/toast/toast.tsx +4 -1
  112. package/templates/fe/skeleton/apps/__app__/src/redux/hooks.ts +3 -2
  113. package/templates/fe/skeleton/apps/__app__/src/redux/index.ts +1 -0
  114. package/templates/fe/skeleton/apps/__app__/src/redux/slices/session.ts +12 -4
  115. package/templates/fe/skeleton/apps/__app__/src/redux/store.ts +8 -3
  116. package/templates/fe/skeleton/apps/app/src/app/[locale]/layout.tsx +4 -3
  117. package/templates/fe/skeleton/apps/app/src/features/layouts/AppLayout/index.tsx +1 -1
  118. package/templates/fe/skeleton/apps/app/src/features/pages/AppHomePage/index.tsx +2 -1
  119. package/templates/fe/skeleton/apps/app/src/features/pages/AppLoadingPage/index.tsx +2 -1
  120. package/templates/fe/skeleton/apps/app/src/features/pages/AppNotFoundPage/index.tsx +2 -1
  121. package/templates/fe/skeleton/apps/app/src/modules/i18n/index.ts +2 -1
  122. package/templates/fe/skeleton/apps/app/src/modules/i18n/request.ts +4 -1
  123. package/templates/fe/skeleton/apps/landing/src/app/[locale]/layout.tsx +4 -3
  124. package/templates/fe/skeleton/apps/landing/src/features/layouts/LandingLayout/index.tsx +2 -2
  125. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingLoadingPage/index.tsx +2 -1
  126. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingNotFoundPage/index.tsx +2 -1
  127. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingPage/index.tsx +2 -1
  128. package/templates/fe/skeleton/apps/landing/src/modules/i18n/index.ts +2 -1
  129. package/templates/fe/skeleton/apps/landing/src/modules/i18n/request.ts +4 -1
  130. package/templates/fe/skeleton/packages/__project__-i18n/src/index.ts +19 -1
  131. package/templates/fe/skeleton/packages/__project__-i18n/src/proxy.ts +1 -1
  132. package/templates/fe/skeleton/packages/__project__-i18n/src/routing.ts +5 -1
  133. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/layout.tsx +4 -3
  134. package/templates/fe/skeleton-lite/apps/web/src/features/layouts/AppLayout/index.tsx +2 -2
  135. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppHomePage/index.tsx +2 -1
  136. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppLoadingPage/index.tsx +2 -1
  137. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppNotFoundPage/index.tsx +2 -1
  138. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/request.ts +3 -1
  139. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/routing.ts +5 -1
  140. package/templates/fe/table/graphql/useMutateSwr.ts.tpl +2 -1
  141. package/templates/fe/table/graphql/useQuerySwr.ts.tpl +2 -1
  142. package/templates/fe/transport/graphql/clients/clients/auth.ts +1 -1
  143. package/templates/fe/transport/graphql/clients/clients/no-auth.ts +1 -1
  144. package/templates/fe/transport/graphql/clients/links/attach-access-token.ts +1 -1
  145. package/templates/fe/transport/graphql/clients/links/error.ts +1 -1
  146. package/templates/fe/transport/graphql/clients/links/http.ts +1 -1
  147. package/templates/fe/transport/graphql/clients/links/locale.ts +1 -1
  148. package/templates/fe/transport/graphql/clients/links/refresh-token.ts +1 -1
  149. package/templates/fe/transport/graphql/clients/links/retry.ts +1 -1
  150. package/templates/fe/transport/graphql/clients/links/timeout.ts +1 -1
  151. package/templates/fe/units/page/index.tsx.tpl +3 -2
  152. package/templates/fe/units/slot/SlotView.tsx.tpl +1 -1
@@ -1,11 +1,12 @@
1
1
  import { sql } from "@modules/platform/database"
2
+ import type { SqlText } from "@modules/platform/database"
2
3
 
3
4
  /**
4
5
  * Claims a delivery in one statement ($1 kind, $2 job key, $3 worker, $4 lease end, $5 payload, $6 instant). A new key inserts the row
5
6
  * with token 1; an existing key is claimed again only when the job failed or its lease expired, and then the token is bumped by the
6
7
  * store. A done job and a live claim match nothing, so no row comes back.
7
8
  */
8
- export const CLAIM_JOB = sql`INSERT INTO jobs (kind, job_key, status, fencing_token, claimed_by, lease_expires_at, payload, created_at, updated_at)
9
+ export const CLAIM_JOB: SqlText = sql`INSERT INTO jobs (kind, job_key, status, fencing_token, claimed_by, lease_expires_at, payload, created_at, updated_at)
9
10
  VALUES ($1, $2, 'running', 1, $3, $4, $5::jsonb, $6, $6)
10
11
  ON CONFLICT (job_key) DO UPDATE
11
12
  SET fencing_token = jobs.fencing_token + 1, claimed_by = $3, lease_expires_at = $4, status = 'running', error = NULL, updated_at = $6
@@ -15,19 +16,19 @@ export const CLAIM_JOB = sql`INSERT INTO jobs (kind, job_key, status, fencing_to
15
16
  /** The guarded writes wrap their UPDATE in a CTE: TypeORM returns a bare `UPDATE ... RETURNING` as `[rows, count]`, a SELECT as rows. */
16
17
 
17
18
  /** Records a step ($1 job id, $2 expected token, $3 step, $4 instant); no row comes back when the token is stale. */
18
- export const ADVANCE_JOB = sql`WITH changed AS (UPDATE jobs SET current_step = $3, updated_at = $4
19
+ export const ADVANCE_JOB: SqlText = sql`WITH changed AS (UPDATE jobs SET current_step = $3, updated_at = $4
19
20
  WHERE id = $1 AND fencing_token = $2 AND status = 'running'
20
21
  RETURNING id)
21
22
  SELECT id FROM changed`
22
23
 
23
24
  /** Completes the job ($1 job id, $2 expected token, $3 instant). */
24
- export const COMPLETE_JOB = sql`WITH changed AS (UPDATE jobs SET status = 'done', lease_expires_at = NULL, updated_at = $3
25
+ export const COMPLETE_JOB: SqlText = sql`WITH changed AS (UPDATE jobs SET status = 'done', lease_expires_at = NULL, updated_at = $3
25
26
  WHERE id = $1 AND fencing_token = $2 AND status = 'running'
26
27
  RETURNING id)
27
28
  SELECT id FROM changed`
28
29
 
29
30
  /** Fails the job ($1 job id, $2 expected token, $3 reason, $4 instant). */
30
- export const FAIL_JOB = sql`WITH changed AS (UPDATE jobs SET status = 'failed', error = $3, lease_expires_at = NULL, updated_at = $4
31
+ export const FAIL_JOB: SqlText = sql`WITH changed AS (UPDATE jobs SET status = 'failed', error = $3, lease_expires_at = NULL, updated_at = $4
31
32
  WHERE id = $1 AND fencing_token = $2 AND status = 'running'
32
33
  RETURNING id)
33
34
  SELECT id FROM changed`
@@ -1,8 +1,9 @@
1
+ import type { DatabaseConnectionOptions } from "@modules/platform/database"
1
2
  import { @@Name@@ProjectionEntity } from "../@@name@@.projection-entity"
2
3
  import { Create@@Name@@Projection@@epochMs13@@ } from "./migrations/@@epochMs13@@-create-@@name@@"
3
4
 
4
5
  /** The entities of the @@name@@ read model, for the connection that holds them. */
5
- export const @@nameCamel@@Entities = [@@Name@@ProjectionEntity]
6
+ export const @@nameCamel@@Entities: DatabaseConnectionOptions["entities"] = [@@Name@@ProjectionEntity]
6
7
 
7
8
  /** The migrations of the @@name@@ read model, in the order they run. */
8
- export const @@nameCamel@@Migrations = [Create@@Name@@Projection@@epochMs13@@]
9
+ export const @@nameCamel@@Migrations: DatabaseConnectionOptions["migrations"] = [Create@@Name@@Projection@@epochMs13@@]
@@ -1,7 +1,12 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import type { @@Name@@Options } from "./@@name@@.options"
3
3
 
4
- /** The configurable-module base of the @@name@@ projection; `isGlobal` is decided by the app root. */
5
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<@@Name@@Options>()
4
+ const built = new ConfigurableModuleBuilder<@@Name@@Options>()
6
5
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
7
6
  .build()
7
+ type Host = ConfigurableModuleHost<@@Name@@Options, "register", "create", { isGlobal: boolean }>
8
+
9
+ /** The configurable-module base of the @@name@@ projection; `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 { QueueOutboxEntity } from "./entities/queue-outbox.entity"
2
3
  import { CreateQueueOutbox@@epochMs13@@ } from "./migrations/@@epochMs13@@-create-queue-outbox"
3
4
 
4
5
  /** The entities of the queues, for every connection that enqueues jobs. */
5
- export const queueEntities = [QueueOutboxEntity]
6
+ export const queueEntities: DatabaseConnectionOptions["entities"] = [QueueOutboxEntity]
6
7
 
7
8
  /** The migrations of the queues, in the order they run. */
8
- export const queueMigrations = [CreateQueueOutbox@@epochMs13@@]
9
+ export const queueMigrations: DatabaseConnectionOptions["migrations"] = [CreateQueueOutbox@@epochMs13@@]
@@ -1,12 +1,13 @@
1
1
  import { sql } from "@modules/platform/database"
2
+ import type { SqlText } from "@modules/platform/database"
2
3
 
3
4
  /** Writes one job in the outbox ($1 queue, $2 payload, $3 instant, $4 correlation id). */
4
- export const INSERT_QUEUE_ROW = sql`INSERT INTO queue_outbox (queue, payload, created_at, correlation_id)
5
+ export const INSERT_QUEUE_ROW: SqlText = sql`INSERT INTO queue_outbox (queue, payload, created_at, correlation_id)
5
6
  VALUES ($1, $2, $3, $4)`
6
7
 
7
8
  /** Locks and reads the oldest rows that wait ($1 batch size); a second relay skips the rows this one holds. */
8
- export const SELECT_WAITING_ROWS = sql`SELECT id, queue, payload, correlation_id AS "correlationId" FROM queue_outbox
9
+ export const SELECT_WAITING_ROWS: SqlText = sql`SELECT id, queue, payload, correlation_id AS "correlationId" FROM queue_outbox
9
10
  WHERE sent_at IS NULL ORDER BY created_at, id LIMIT $1 FOR UPDATE SKIP LOCKED`
10
11
 
11
12
  /** Marks the rows as handed to BullMQ ($1 ids, $2 instant). */
12
- export const MARK_ROWS_SENT = sql`UPDATE queue_outbox SET sent_at = $2 WHERE id = ANY($1::uuid[])`
13
+ export const MARK_ROWS_SENT: SqlText = sql`UPDATE queue_outbox SET sent_at = $2 WHERE id = ANY($1::uuid[])`
@@ -1,10 +1,15 @@
1
- import { ConfigurableModuleBuilder } from "@nestjs/common"
1
+ import { ConfigurableModuleBuilder, type ConfigurableModuleHost } from "@nestjs/common"
2
2
  import { QUEUE_OPTIONS } from "./queue.decorators"
3
3
  import type { QueueRegistrationOptions } from "./queue.options"
4
4
 
5
- /** The configurable-module base of the queues; `isGlobal` is decided by the app root. */
6
- export const { ConfigurableModuleClass, OPTIONS_TYPE } = new ConfigurableModuleBuilder<QueueRegistrationOptions>({
5
+ const built = new ConfigurableModuleBuilder<QueueRegistrationOptions>({
7
6
  optionsInjectionToken: QUEUE_OPTIONS,
8
7
  })
9
8
  .setExtras({ isGlobal: false }, (definition, extras) => ({ ...definition, global: extras.isGlobal }))
10
9
  .build()
10
+ type Host = ConfigurableModuleHost<QueueRegistrationOptions, "register", "create", { isGlobal: boolean }>
11
+
12
+ /** The configurable-module base of the queues; `isGlobal` is decided by the app root. */
13
+ export const ConfigurableModuleClass: Host["ConfigurableModuleClass"] = built.ConfigurableModuleClass
14
+ /** The options of a synchronous registration, for the register signature. */
15
+ 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 { @@Queue@@Options } from "./@@queue@@.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Queue@@Options>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Queue@@Options, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@queue@@ module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Queue@@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
@@ -8,7 +8,7 @@ import { @@Action@@Command } from "../../application/@@action@@.command"
8
8
  @Injectable()
9
9
  /** The consumer door of the @@event@@ event in the @@reactor@@ reactor: it dispatches one command and forwards the event id. */
10
10
  export class @@Event@@Consumer implements EventConsumer<@@Event@@Event> {
11
- readonly event = @@Event@@Event
11
+ readonly event: typeof @@Event@@Event = @@Event@@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 { @@Reactor@@MessageOptions } from "./@@reactor@@-message.options"
3
3
 
4
+ const built = new ConfigurableModuleBuilder<@@Reactor@@MessageOptions>().setClassMethodName("register").build()
5
+ type Host = ConfigurableModuleHost<@@Reactor@@MessageOptions, "register", "create", {}>
6
+
4
7
  /** The configurable-module base of the @@reactor@@-message module. */
5
- export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } =
6
- new ConfigurableModuleBuilder<@@Reactor@@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 { @@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