@starci/hfs 5.2.0 → 5.3.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 (215) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -1
  3. package/cache/hfs-family.d.mts +2 -3
  4. package/cache/hfs-family.mjs +4 -9
  5. package/cache/secret-records.d.mts +7 -0
  6. package/cache/secret-records.mjs +12 -0
  7. package/cache/session.mjs +4 -2
  8. package/codemod/account-doors.d.mts +36 -0
  9. package/codemod/account-doors.mjs +128 -0
  10. package/codemod/main.mjs +31 -1
  11. package/codemod/module-definition.d.mts +52 -0
  12. package/codemod/module-definition.mjs +242 -0
  13. package/codemod/quality-binding.d.mts +33 -0
  14. package/codemod/quality-binding.mjs +38 -0
  15. package/codemod/secrets-cache.d.mts +35 -0
  16. package/codemod/secrets-cache.mjs +70 -0
  17. package/codemod/sops-rules.d.mts +34 -0
  18. package/codemod/sops-rules.mjs +69 -0
  19. package/codemod/theme-tokens.mjs +48 -2
  20. package/lint/run.d.mts +6 -0
  21. package/lint/run.mjs +63 -10
  22. package/package.json +1 -1
  23. package/runtime/knowledge/hfs/canon-pins.yaml +43 -10
  24. package/runtime/knowledge/hfs/fe-stack.yaml +3 -3
  25. package/runtime/knowledge/hfs/rules.yaml +13 -9
  26. package/runtime/knowledge/hfs/slots.yaml +105 -12
  27. package/runtime/modules/kernel/failure-codes.yaml +5 -4
  28. package/runtime/scripts/hfs/architecture/config.d.mts +4 -0
  29. package/runtime/scripts/hfs/architecture/config.mjs +25 -1
  30. package/runtime/scripts/hfs/architecture/module-per-transport.d.mts +1 -1
  31. package/runtime/scripts/hfs/architecture/module-per-transport.mjs +6 -1
  32. package/runtime/scripts/hfs/architecture/root-packages.d.mts +26 -0
  33. package/runtime/scripts/hfs/architecture/root-packages.mjs +78 -0
  34. package/runtime/scripts/hfs/architecture/type-context.d.mts +4 -1
  35. package/runtime/scripts/hfs/architecture/type-context.mjs +30 -0
  36. package/runtime/scripts/hfs/architecture/typescript.d.mts +7 -1
  37. package/runtime/scripts/hfs/architecture/typescript.mjs +21 -1
  38. package/runtime/scripts/hfs/explicit-surface-rule.mjs +1 -1
  39. package/runtime/scripts/hfs/rules/database-access.mjs +39 -1
  40. package/runtime/scripts/hfs/rules/monorepo.d.mts +4 -0
  41. package/runtime/scripts/hfs/rules/monorepo.mjs +10 -5
  42. package/runtime/scripts/hfs/rules/secrets.mjs +11 -0
  43. package/runtime/scripts/hfs/secret-errors.d.mts +3 -0
  44. package/runtime/scripts/hfs/secret-errors.mjs +8 -0
  45. package/runtime/scripts/hfs/secret-init.d.mts +6 -0
  46. package/runtime/scripts/hfs/secret-init.mjs +23 -0
  47. package/runtime/scripts/hfs/secret-sops.mjs +9 -1
  48. package/runtime/scripts/hfs/secret-standard.d.mts +20 -0
  49. package/runtime/scripts/hfs/secret-standard.mjs +106 -0
  50. package/runtime/scripts/hfs/secret.mjs +5 -1
  51. package/runtime/scripts/hfs/view.d.mts +23 -0
  52. package/runtime/scripts/hfs/view.mjs +68 -0
  53. package/runtime/scripts/lib/declaration-surface.d.mts +4 -0
  54. package/runtime/scripts/lib/declaration-surface.mjs +55 -1
  55. package/runtime/scripts/lib/secret-records.d.mts +13 -0
  56. package/runtime/scripts/lib/secret-records.mjs +83 -0
  57. package/scaffold/add-inbox-lite.mjs +2 -2
  58. package/scaffold/add-queue-lite.mjs +1 -3
  59. package/scaffold/app.d.mts +2 -2
  60. package/scaffold/app.mjs +10 -12
  61. package/scaffold/lite-exports.mjs +1 -15
  62. package/scripts/sync-bundles.d.mts +8 -0
  63. package/stack/images/openclaw-runtime/Dockerfile +18 -0
  64. package/stack/images/openclaw-runtime/entrypoint.sh +23 -0
  65. package/stack/images/openclaw-runtime/openclaw-init.mjs +101 -0
  66. package/stack/images/openclaw-runtime/openclaw-relay.mjs +25 -0
  67. package/stack/local-up.mjs +3 -0
  68. package/stack/runtime-layers.d.mts +21 -0
  69. package/stack/runtime-layers.mjs +67 -0
  70. package/sync/hygiene.mjs +3 -1
  71. package/sync/index.d.mts +2 -0
  72. package/sync/index.mjs +33 -2
  73. package/templates/app/auth-doors.sql.partial +115 -0
  74. package/templates/app/ci-workflows/github/workflows/ci.yml +1 -1
  75. package/templates/app/ci-workflows-lite/github/workflows/ci.yml +1 -1
  76. package/templates/app/package-scripts/core.json +1 -1
  77. package/templates/app/package-scripts/package.json +1 -1
  78. package/templates/app/package-scripts-lite/package.json +1 -1
  79. package/templates/app/skeleton-lite/.starcistacks/application-stacks.yaml +9 -0
  80. package/templates/app/skeleton-lite/.starcistacks/dev/README.md +3 -1
  81. package/templates/app/skeleton-lite/.starcistacks/dev/infra/compose/compose.yaml +19 -1
  82. package/templates/app/skeleton-lite/.starcistacks/dev/runtime/env/KEYS.md +3 -0
  83. package/templates/app/skeleton-lite/.starcistacks/production/infra/swarm/stack.yaml +5 -0
  84. package/templates/app/skeleton-lite/.starcistacks/production/runtime/env/KEYS.md +4 -0
  85. package/templates/app/skeleton-lite/db/migrations/__timestamp___baseline.sql +24 -4
  86. package/templates/be/auth-lite/src/features/api/auth/application/auth.contracts.ts +33 -0
  87. package/templates/be/auth-lite/src/features/api/auth/application/confirm.command.ts +11 -0
  88. package/templates/be/auth-lite/src/features/api/auth/application/confirm.handler.ts +22 -0
  89. package/templates/be/auth-lite/src/features/api/auth/application/forgot.command.ts +11 -0
  90. package/templates/be/auth-lite/src/features/api/auth/application/forgot.handler.ts +22 -0
  91. package/templates/be/auth-lite/src/features/api/auth/application/resend.command.ts +11 -0
  92. package/templates/be/auth-lite/src/features/api/auth/application/resend.handler.ts +22 -0
  93. package/templates/be/auth-lite/src/features/api/auth/application/reset.command.ts +11 -0
  94. package/templates/be/auth-lite/src/features/api/auth/application/reset.handler.ts +22 -0
  95. package/templates/be/auth-lite/src/features/api/auth/application/signup.command.ts +11 -0
  96. package/templates/be/auth-lite/src/features/api/auth/application/signup.handler.ts +22 -0
  97. package/templates/be/auth-lite/src/features/api/auth/auth.module-definition.ts +3 -10
  98. package/templates/be/auth-lite/src/features/api/auth/auth.module.ts +6 -1
  99. package/templates/be/auth-lite/src/features/api/auth/transport/http/auth-http.module-definition.ts +3 -10
  100. package/templates/be/auth-lite/src/features/api/auth/transport/http/auth.controller.ts +56 -1
  101. package/templates/be/auth-lite/src/features/api/auth/transport/http/dto/forgot.request.ts +16 -0
  102. package/templates/be/auth-lite/src/features/api/auth/transport/http/dto/resend.request.ts +16 -0
  103. package/templates/be/auth-lite/src/features/api/auth/transport/http/dto/reset.request.ts +18 -0
  104. package/templates/be/auth-lite/src/features/api/auth/transport/http/dto/signup.request.ts +22 -0
  105. package/templates/be/auth-lite/src/features/api/auth/transport/http/dto/token.request.ts +11 -0
  106. package/templates/be/auth-lite/src/modules/domain/identity/account-directory.service.spec.ts +30 -30
  107. package/templates/be/auth-lite/src/modules/domain/identity/account-directory.service.ts +7 -16
  108. package/templates/be/auth-lite/src/modules/domain/identity/authenticator.service.spec.ts +113 -49
  109. package/templates/be/auth-lite/src/modules/domain/identity/authenticator.service.ts +42 -53
  110. package/templates/be/auth-lite/src/modules/domain/identity/identity-email.log-events.ts +6 -0
  111. package/templates/be/auth-lite/src/modules/domain/identity/identity-email.service.spec.ts +233 -0
  112. package/templates/be/auth-lite/src/modules/domain/identity/identity-email.service.ts +176 -0
  113. package/templates/be/auth-lite/src/modules/domain/identity/identity-sign-in.log-events.ts +6 -0
  114. package/templates/be/auth-lite/src/modules/domain/identity/persistence/account-doors.port.ts +98 -0
  115. package/templates/be/auth-lite/src/modules/domain/identity/persistence/entities/identity-email-token.entity.ts +34 -0
  116. package/templates/be/auth-lite/src/modules/domain/identity/persistence/entities/index.ts +3 -10
  117. package/templates/be/auth-lite/src/modules/domain/identity/sign-in.service.spec.ts +17 -0
  118. package/templates/be/auth-lite/src/modules/domain/identity/sign-in.service.ts +6 -0
  119. package/templates/be/auth-lite/src/tests/fixtures/builders/identity.builder.ts +29 -33
  120. package/templates/be/inbox/module-definition.ts.tpl +2 -9
  121. package/templates/be/inbox/platform/event-bus/event-bus.module-definition.ts.tpl +2 -11
  122. package/templates/be/inbox/platform/inbox/inbox.module-definition.ts.tpl +2 -9
  123. package/templates/be/patterns/api/feature.module-definition.ts.tpl +3 -9
  124. package/templates/be/patterns/api/graphql.module-definition.ts.tpl +3 -9
  125. package/templates/be/patterns/cli/group.module-definition.ts.tpl +2 -9
  126. package/templates/be/patterns/event-bus/platform/event-bus.module-definition.ts.tpl +3 -10
  127. package/templates/be/patterns/idempotency/platform/inbox/inbox.module-definition.ts.tpl +2 -9
  128. package/templates/be/patterns/jobs/job.module-definition.ts.tpl +2 -9
  129. package/templates/be/patterns/jobs/job.queue.module-definition.ts.tpl +3 -9
  130. package/templates/be/patterns/jobs/platform/jobs.module-definition.ts.tpl +3 -10
  131. package/templates/be/patterns/projections/projection.module-definition.ts.tpl +2 -9
  132. package/templates/be/patterns/queues/platform/queue.module-definition.ts.tpl +3 -10
  133. package/templates/be/patterns/queues/queue.module-definition.ts.tpl +2 -9
  134. package/templates/be/patterns/reactors/message.module-definition.ts.tpl +3 -9
  135. package/templates/be/patterns/reactors/reactor.module-definition.ts.tpl +2 -9
  136. package/templates/be/patterns/realtime/channel.graphql.module-definition.ts.tpl +3 -9
  137. package/templates/be/patterns/realtime/channel.sse.module-definition.ts.tpl +3 -9
  138. package/templates/be/patterns/realtime/channel.websocket.module-definition.ts.tpl +3 -9
  139. package/templates/be/patterns/saga/saga.message.module-definition.ts.tpl +3 -9
  140. package/templates/be/patterns/saga/saga.module-definition.ts.tpl +2 -9
  141. package/templates/be/patterns/webhooks/webhook.http.module-definition.ts.tpl +3 -9
  142. package/templates/be/platform/graphql/graphql.module-definition.ts +2 -9
  143. package/templates/be/skeleton/src/features/api/system-health/system-health.module-definition.ts +3 -9
  144. package/templates/be/skeleton/src/features/api/system-health/transport/http/system-health-http.module-definition.ts +3 -9
  145. package/templates/be/skeleton/src/features/cli/cli.module-definition.ts +2 -9
  146. package/templates/be/skeleton/src/features/cli/migrate/migrate.module-definition.ts +3 -9
  147. package/templates/be/skeleton/src/features/cli/seed/seed.module-definition.ts +2 -9
  148. package/templates/be/skeleton/src/modules/domain/identity/identity.module-definition.ts +2 -9
  149. package/templates/be/skeleton/src/modules/domain/liveness/liveness.module-definition.ts +2 -9
  150. package/templates/be/skeleton/src/modules/domain/note/note.module-definition.ts +2 -9
  151. package/templates/be/skeleton/src/modules/platform/clock/clock.module-definition.ts +2 -9
  152. package/templates/be/skeleton/src/modules/platform/cqrs/cqrs.contracts.ts +2 -0
  153. package/templates/be/skeleton/src/modules/platform/cqrs/cqrs.module-definition.ts +2 -9
  154. package/templates/be/skeleton/src/modules/platform/database/database.module-definition.ts +3 -13
  155. package/templates/be/skeleton/src/modules/platform/errors/errors.module-definition.ts +4 -11
  156. package/templates/be/skeleton/src/modules/platform/http/http.module-definition.ts +4 -9
  157. package/templates/be/skeleton/src/modules/platform/http-security/http-security.module-definition.ts +5 -11
  158. package/templates/be/skeleton/src/modules/platform/i18n/i18n.module-definition.ts +4 -11
  159. package/templates/be/skeleton/src/modules/platform/ids/ids.module-definition.ts +2 -9
  160. package/templates/be/skeleton/src/modules/platform/logging/logging.module-definition.ts +2 -9
  161. package/templates/be/skeleton/src/modules/platform/retry/retry.module-definition.ts +2 -9
  162. package/templates/be/skeleton-lite/apps/api/src/api.env.ts +4 -0
  163. package/templates/be/skeleton-lite/apps/api/src/api.options.ts +3 -0
  164. package/templates/be/skeleton-lite/apps/api/src/compose/integrations.ts +3 -1
  165. package/templates/be/skeleton-lite/src/modules/domain/identity/errors/identity.error.ts +6 -0
  166. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.module.ts +3 -0
  167. package/templates/be/skeleton-lite/src/modules/domain/identity/index.ts +1 -0
  168. package/templates/be/skeleton-lite/src/modules/domain/identity/messages/identity-mail.messages.ts +65 -0
  169. package/templates/be/skeleton-lite/src/modules/domain/identity/messages/identity.messages.ts +4 -0
  170. package/templates/be/skeleton-lite/src/modules/integrations/mail/index.ts +6 -0
  171. package/templates/be/skeleton-lite/src/modules/integrations/mail/mail.config.ts +33 -0
  172. package/templates/be/skeleton-lite/src/modules/integrations/mail/mail.decorators.ts +14 -0
  173. package/templates/be/skeleton-lite/src/modules/integrations/mail/mail.module-definition.ts +12 -0
  174. package/templates/be/skeleton-lite/src/modules/integrations/mail/mail.module.ts +27 -0
  175. package/templates/be/skeleton-lite/src/modules/integrations/mail/mail.options.ts +22 -0
  176. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/object-storage.module-definition.ts +2 -9
  177. package/templates/be/skeleton-lite/src/modules/integrations/passport/index.ts +1 -1
  178. package/templates/be/skeleton-lite/src/modules/platform/database/index.ts +1 -0
  179. package/templates/be/skeleton-lite/src/modules/platform/http-security/rate-limit.guard.spec.ts +11 -0
  180. package/templates/be/skeleton-lite/src/tests/fixtures/builders/api.builder.ts +11 -0
  181. package/templates/be/table/api/feature.module-definition.ts.tpl +3 -9
  182. package/templates/be/table/api/graphql.module-definition.ts.tpl +3 -9
  183. package/templates/be/table/module-definition.ts.tpl +2 -9
  184. package/templates/fe/auth-lite/apps/web/src/modules/auth/email-doors.ts +16 -0
  185. package/templates/fe/auth-lite/apps/web/src/modules/auth/index.ts +5 -0
  186. package/templates/fe/skeleton/packages/__project__-i18n/src/index.ts +30 -67
  187. package/templates/fe/skeleton/packages/__project__-i18n/src/proxy.ts +6 -21
  188. package/templates/fe/skeleton/packages/__project__-i18n/src/routing.ts +10 -16
  189. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/auth/confirm/page.tsx +9 -0
  190. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/auth/forgot/page.tsx +9 -0
  191. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/auth/resend/page.tsx +9 -0
  192. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/auth/reset/page.tsx +9 -0
  193. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/auth/signup/page.tsx +9 -0
  194. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/layout.tsx +5 -9
  195. package/templates/fe/skeleton-lite/apps/web/src/components/blocks/EmailDoorForm/component.tsx +51 -0
  196. package/templates/fe/skeleton-lite/apps/web/src/components/blocks/EmailDoorForm/index.tsx +84 -0
  197. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppConfirmPage/index.tsx +25 -0
  198. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppForgotPage/index.tsx +21 -0
  199. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppHomePage/component.tsx +11 -3
  200. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppHomePage/index.tsx +4 -1
  201. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppResendPage/index.tsx +21 -0
  202. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppResetPage/index.tsx +25 -0
  203. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppSignupPage/index.tsx +21 -0
  204. package/templates/fe/skeleton-lite/apps/web/src/hooks/emailAuth/emailAuth.shared.ts +12 -0
  205. package/templates/fe/skeleton-lite/apps/web/src/hooks/emailAuth/index.ts +2 -0
  206. package/templates/fe/skeleton-lite/apps/web/src/hooks/emailAuth/useEmailDoor.ts +32 -0
  207. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/index.ts +2 -2
  208. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/messages/en.json +50 -1
  209. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/messages/vi.json +50 -1
  210. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/request.ts +7 -30
  211. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/routing.ts +13 -14
  212. package/templates/fe/skeleton-lite/apps/web/src/modules/routes/index.ts +5 -0
  213. package/templates/fe/skeleton-lite/apps/web/src/proxy.ts +4 -17
  214. package/templates/be/auth-lite/src/modules/domain/identity/persistence/entities/auth-identity.entity.ts +0 -38
  215. package/templates/be/auth-lite/src/modules/domain/identity/persistence/entities/auth-user.entity.ts +0 -54
@@ -1,54 +0,0 @@
1
- // Managed by starci app sync (slot be.identity.sign-in); do not edit: run "npx starci app sync --execute".
2
- import { Column, Entity, PrimaryColumn } from "typeorm"
3
-
4
- @Entity({ schema: "auth", name: "users" })
5
- /** One person who can sign in, mapped from auth.users of db/bootstrap.sql (the GoTrue column set; only the columns sign-in reads or writes). */
6
- export class AuthUserEntity {
7
- /** The account id. */
8
- @PrimaryColumn({ name: "id", type: "uuid" })
9
- id!: string
10
-
11
- /** The audience the row carries. */
12
- @Column({ name: "aud", type: "varchar", length: 255, nullable: true })
13
- aud!: string | null
14
-
15
- /** The database role the row carries. */
16
- @Column({ name: "role", type: "varchar", length: 255, nullable: true })
17
- role!: string | null
18
-
19
- /** The sign-in address, lower-cased. */
20
- @Column({ name: "email", type: "varchar", length: 255, nullable: true })
21
- email!: string | null
22
-
23
- /** The bcrypt hash of the password, or null for an account that signs in with Google only. */
24
- @Column({ name: "encrypted_password", type: "varchar", length: 255, nullable: true })
25
- encryptedPassword!: string | null
26
-
27
- /** When the mailbox was confirmed, or null. */
28
- @Column({ name: "email_confirmed_at", type: "timestamptz", nullable: true })
29
- emailConfirmedAt!: Date | null
30
-
31
- /** The last sign-in, or null. */
32
- @Column({ name: "last_sign_in_at", type: "timestamptz", nullable: true })
33
- lastSignInAt!: Date | null
34
-
35
- /** Until when the account is banned, or null. */
36
- @Column({ name: "banned_until", type: "timestamptz", nullable: true })
37
- bannedUntil!: Date | null
38
-
39
- /** When the account was deleted, or null. */
40
- @Column({ name: "deleted_at", type: "timestamptz", nullable: true })
41
- deletedAt!: Date | null
42
-
43
- /** True for an anonymous account, which never signs in with an address. */
44
- @Column({ name: "is_anonymous", type: "boolean" })
45
- isAnonymous!: boolean
46
-
47
- /** When the account was created. */
48
- @Column({ name: "created_at", type: "timestamptz", nullable: true })
49
- createdAt!: Date | null
50
-
51
- /** When the account last changed. */
52
- @Column({ name: "updated_at", type: "timestamptz", nullable: true })
53
- updatedAt!: Date | null
54
- }