@open-mercato/cli 0.11.1-develop.8593.1.50784dae35 → 0.11.1-develop.8687.1.adb16f62b3

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 (327) hide show
  1. package/.turbo/turbo-build.log +6 -2
  2. package/AGENTS.md +2 -0
  3. package/dist/agentic/guides/architecture.md +2 -2
  4. package/dist/agentic/guides/extensions.md +7 -2
  5. package/dist/agentic/guides/framework-extension-points.md +1 -0
  6. package/dist/agentic/guides/infrastructure-providers.md +20 -0
  7. package/dist/agentic/guides/integrations.md +2 -2
  8. package/dist/agentic/guides/module-facts.json +11067 -7122
  9. package/dist/agentic/guides/module-facts.v2.json +11055 -7094
  10. package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
  11. package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
  12. package/dist/agentic/guides/modules/api_docs/index.md +1 -1
  13. package/dist/agentic/guides/modules/api_keys/index.md +1 -1
  14. package/dist/agentic/guides/modules/assisted_selling/acl-features.md +16 -0
  15. package/dist/agentic/guides/modules/assisted_selling/contribution-resolutions.md +21 -0
  16. package/dist/agentic/guides/modules/assisted_selling/domain-commands.md +11 -0
  17. package/dist/agentic/guides/modules/assisted_selling/entities.md +11 -0
  18. package/dist/agentic/guides/modules/assisted_selling/events.md +22 -0
  19. package/dist/agentic/guides/modules/assisted_selling/exact-override-targets.md +17 -0
  20. package/dist/agentic/guides/modules/assisted_selling/index.md +21 -0
  21. package/dist/agentic/guides/modules/assisted_selling/owned-contract-module-metadata.md +11 -0
  22. package/dist/agentic/guides/modules/assisted_selling/setup.md +11 -0
  23. package/dist/agentic/guides/modules/assisted_selling/umes-contributions.md +21 -0
  24. package/dist/agentic/guides/modules/assisted_selling/umes-hosts.md +23 -0
  25. package/dist/agentic/guides/modules/attachments/exact-override-targets.md +1 -1
  26. package/dist/agentic/guides/modules/attachments/index.md +1 -1
  27. package/dist/agentic/guides/modules/attachments/workers.md +1 -1
  28. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  29. package/dist/agentic/guides/modules/auth/index.md +1 -1
  30. package/dist/agentic/guides/modules/availability/index.md +1 -1
  31. package/dist/agentic/guides/modules/backups/di-registrations-rich.md +11 -0
  32. package/dist/agentic/guides/modules/backups/di-service-tokens.md +11 -0
  33. package/dist/agentic/guides/modules/backups/exact-override-targets.md +11 -0
  34. package/dist/agentic/guides/modules/backups/index.md +5 -2
  35. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  36. package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
  37. package/dist/agentic/guides/modules/cart/index.md +1 -1
  38. package/dist/agentic/guides/modules/catalog/acl-features.md +2 -1
  39. package/dist/agentic/guides/modules/catalog/active-extension-bindings.md +2 -0
  40. package/dist/agentic/guides/modules/catalog/backend-pages.md +1 -0
  41. package/dist/agentic/guides/modules/catalog/contribution-resolutions.md +5 -0
  42. package/dist/agentic/guides/modules/catalog/di-registrations-rich.md +8 -7
  43. package/dist/agentic/guides/modules/catalog/di-service-tokens.md +5 -4
  44. package/dist/agentic/guides/modules/catalog/domain-commands.md +2 -0
  45. package/dist/agentic/guides/modules/catalog/entities.md +1 -0
  46. package/dist/agentic/guides/modules/catalog/events.md +4 -1
  47. package/dist/agentic/guides/modules/catalog/exact-override-targets.md +13 -7
  48. package/dist/agentic/guides/modules/catalog/index.md +9 -9
  49. package/dist/agentic/guides/modules/catalog/umes-contributions.md +5 -0
  50. package/dist/agentic/guides/modules/catalog/umes-hosts.md +4 -0
  51. package/dist/agentic/guides/modules/catalog/workers.md +1 -0
  52. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  53. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  54. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  55. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  56. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  57. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  58. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  59. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  60. package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
  61. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  62. package/dist/agentic/guides/modules/communication_channels/exact-override-targets.md +1 -1
  63. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  64. package/dist/agentic/guides/modules/communication_channels/workers.md +1 -1
  65. package/dist/agentic/guides/modules/configs/index.md +1 -1
  66. package/dist/agentic/guides/modules/content/index.md +1 -1
  67. package/dist/agentic/guides/modules/currencies/active-extension-bindings.md +11 -0
  68. package/dist/agentic/guides/modules/currencies/di-registrations-rich.md +1 -1
  69. package/dist/agentic/guides/modules/currencies/di-service-tokens.md +1 -1
  70. package/dist/agentic/guides/modules/currencies/exact-override-targets.md +1 -1
  71. package/dist/agentic/guides/modules/currencies/index.md +3 -2
  72. package/dist/agentic/guides/modules/customer_accounts/active-extension-bindings.md +1 -1
  73. package/dist/agentic/guides/modules/customer_accounts/exact-override-targets.md +2 -0
  74. package/dist/agentic/guides/modules/customer_accounts/index.md +2 -2
  75. package/dist/agentic/guides/modules/customer_accounts/workers.md +2 -0
  76. package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
  77. package/dist/agentic/guides/modules/customers/active-extension-bindings.md +2 -1
  78. package/dist/agentic/guides/modules/customers/incoming-installed-contributions.md +1 -0
  79. package/dist/agentic/guides/modules/customers/index.md +3 -3
  80. package/dist/agentic/guides/modules/customers/umes-hosts.md +1 -0
  81. package/dist/agentic/guides/modules/dashboards/active-extension-bindings.md +0 -1
  82. package/dist/agentic/guides/modules/dashboards/cli-commands.md +1 -0
  83. package/dist/agentic/guides/modules/dashboards/exact-override-targets.md +1 -0
  84. package/dist/agentic/guides/modules/dashboards/index.md +2 -3
  85. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  86. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  87. package/dist/agentic/guides/modules/devices/index.md +1 -1
  88. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  89. package/dist/agentic/guides/modules/directory/index.md +1 -1
  90. package/dist/agentic/guides/modules/documents/index.md +1 -1
  91. package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
  92. package/dist/agentic/guides/modules/entities/index.md +1 -1
  93. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  94. package/dist/agentic/guides/modules/events/index.md +1 -1
  95. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  96. package/dist/agentic/guides/modules/forms/index.md +1 -1
  97. package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
  98. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  99. package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
  100. package/dist/agentic/guides/modules/generators/index.md +1 -1
  101. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  102. package/dist/agentic/guides/modules/integrations/di-registrations-rich.md +8 -8
  103. package/dist/agentic/guides/modules/integrations/di-service-tokens.md +4 -4
  104. package/dist/agentic/guides/modules/integrations/exact-override-targets.md +14 -12
  105. package/dist/agentic/guides/modules/integrations/index.md +2 -2
  106. package/dist/agentic/guides/modules/integrations/setup.md +1 -1
  107. package/dist/agentic/guides/modules/integrations/workers.md +3 -1
  108. package/dist/agentic/guides/modules/ledger/acl-features.md +16 -0
  109. package/dist/agentic/guides/modules/ledger/active-extension-bindings.md +11 -0
  110. package/dist/agentic/guides/modules/ledger/backend-pages.md +21 -0
  111. package/dist/agentic/guides/modules/ledger/domain-commands.md +22 -0
  112. package/dist/agentic/guides/modules/ledger/encryption.md +11 -0
  113. package/dist/agentic/guides/modules/ledger/entities.md +17 -0
  114. package/dist/agentic/guides/modules/ledger/events.md +19 -0
  115. package/dist/agentic/guides/modules/ledger/exact-override-targets.md +30 -0
  116. package/dist/agentic/guides/modules/ledger/index.md +22 -0
  117. package/dist/agentic/guides/modules/ledger/owned-contract-module-metadata.md +11 -0
  118. package/dist/agentic/guides/modules/ledger/setup.md +11 -0
  119. package/dist/agentic/guides/modules/ledger/umes-hosts.md +26 -0
  120. package/dist/agentic/guides/modules/messages/index.md +1 -1
  121. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  122. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  123. package/dist/agentic/guides/modules/payment_gateways/active-extension-bindings.md +1 -1
  124. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  125. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  126. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  127. package/dist/agentic/guides/modules/planner/index.md +1 -1
  128. package/dist/agentic/guides/modules/portal/index.md +1 -1
  129. package/dist/agentic/guides/modules/progress/index.md +1 -1
  130. package/dist/agentic/guides/modules/promotions/index.md +1 -1
  131. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  132. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  133. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  134. package/dist/agentic/guides/modules/resources/exact-override-targets.md +3 -3
  135. package/dist/agentic/guides/modules/resources/index.md +1 -1
  136. package/dist/agentic/guides/modules/resources/owned-contract-module-metadata.md +1 -1
  137. package/dist/agentic/guides/modules/resources/setup.md +1 -1
  138. package/dist/agentic/guides/modules/sales/contribution-resolutions.md +1 -0
  139. package/dist/agentic/guides/modules/sales/exact-override-targets.md +1 -0
  140. package/dist/agentic/guides/modules/sales/index.md +3 -3
  141. package/dist/agentic/guides/modules/sales/umes-contributions.md +1 -0
  142. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  143. package/dist/agentic/guides/modules/search/index.md +1 -1
  144. package/dist/agentic/guides/modules/security/index.md +1 -1
  145. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  146. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  147. package/dist/agentic/guides/modules/sso/index.md +1 -1
  148. package/dist/agentic/guides/modules/staff/contribution-resolutions.md +1 -1
  149. package/dist/agentic/guides/modules/staff/exact-override-targets.md +1 -1
  150. package/dist/agentic/guides/modules/staff/index.md +1 -1
  151. package/dist/agentic/guides/modules/staff/workers.md +1 -1
  152. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  153. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  154. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  155. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  156. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  157. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  158. package/dist/agentic/guides/modules/translations/index.md +1 -1
  159. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  160. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  161. package/dist/agentic/guides/modules/wms/index.md +1 -1
  162. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  163. package/dist/agentic/guides/reference-module-facts.json +811 -21
  164. package/dist/agentic/guides/reference-modules/example/active-extension-bindings.md +1 -0
  165. package/dist/agentic/guides/reference-modules/example/backend-pages.md +2 -0
  166. package/dist/agentic/guides/reference-modules/example/contribution-resolutions.md +3 -1
  167. package/dist/agentic/guides/reference-modules/example/di-registrations-rich.md +3 -3
  168. package/dist/agentic/guides/reference-modules/example/di-service-tokens.md +1 -1
  169. package/dist/agentic/guides/reference-modules/example/entities.md +2 -0
  170. package/dist/agentic/guides/reference-modules/example/events.md +2 -1
  171. package/dist/agentic/guides/reference-modules/example/exact-override-targets.md +25 -8
  172. package/dist/agentic/guides/reference-modules/example/index.md +7 -7
  173. package/dist/agentic/guides/reference-modules/example/notifications.md +1 -0
  174. package/dist/agentic/guides/reference-modules/example/setup.md +1 -1
  175. package/dist/agentic/guides/reference-modules/example/umes-contributions.md +3 -1
  176. package/dist/agentic/guides/reference-modules/example/umes-hosts.md +4 -0
  177. package/dist/agentic/guides/upstream/AGENTS.md +5 -4
  178. package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +37 -20
  179. package/dist/agentic/guides/upstream/manifest.json +3 -3
  180. package/dist/agentic/shared/AGENTS.md.template +12 -16
  181. package/dist/agentic/shared/ai/harness/README.md +4 -2
  182. package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
  183. package/dist/agentic/shared/ai/harness/cases.json +1420 -41
  184. package/dist/agentic/shared/ai/harness/cases.schema.json +4 -4
  185. package/dist/agentic/shared/ai/harness/design-system-inventory.json +640 -142
  186. package/dist/agentic/shared/ai/harness/source-link-inventory.json +223 -16
  187. package/dist/agentic/shared/ai/harness/validators.json +1 -1
  188. package/dist/agentic/shared/ai/skills/om-system-extension/SKILL.md +1 -1
  189. package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-branches.md +25 -0
  190. package/dist/agentic/shared/ai/skills/om-system-extension/references/mechanism-selector.md +1 -0
  191. package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +2 -0
  192. package/dist/agentic/shared/scripts/run-agent-harness-release.mjs +21 -1
  193. package/dist/lib/cache-provider-manifest.js +9 -0
  194. package/dist/lib/cache-provider-manifest.js.map +7 -0
  195. package/dist/lib/generate-watch-plan.js +4 -0
  196. package/dist/lib/generate-watch-plan.js.map +2 -2
  197. package/dist/lib/generate-watch-runner.js +1 -0
  198. package/dist/lib/generate-watch-runner.js.map +2 -2
  199. package/dist/lib/generate-watch-structure.js +2 -0
  200. package/dist/lib/generate-watch-structure.js.map +2 -2
  201. package/dist/lib/generators/ast/writers.js +5 -1
  202. package/dist/lib/generators/ast/writers.js.map +2 -2
  203. package/dist/lib/generators/cache-providers.js +80 -0
  204. package/dist/lib/generators/cache-providers.js.map +7 -0
  205. package/dist/lib/generators/form-section-ast.js +156 -0
  206. package/dist/lib/generators/form-section-ast.js.map +7 -0
  207. package/dist/lib/generators/form-section-extension-compiler.js +568 -0
  208. package/dist/lib/generators/form-section-extension-compiler.js.map +7 -0
  209. package/dist/lib/generators/form-section-extension-source.js +245 -0
  210. package/dist/lib/generators/form-section-extension-source.js.map +7 -0
  211. package/dist/lib/generators/form-section-runtime-revisions.js +184 -0
  212. package/dist/lib/generators/form-section-runtime-revisions.js.map +7 -0
  213. package/dist/lib/generators/form-sections.js +773 -0
  214. package/dist/lib/generators/form-sections.js.map +7 -0
  215. package/dist/lib/generators/index.js +2 -0
  216. package/dist/lib/generators/index.js.map +2 -2
  217. package/dist/lib/generators/module-entities.js +21 -2
  218. package/dist/lib/generators/module-entities.js.map +2 -2
  219. package/dist/lib/generators/module-extension-facts.js +2 -1
  220. package/dist/lib/generators/module-extension-facts.js.map +2 -2
  221. package/dist/lib/generators/module-facts.js +30 -1
  222. package/dist/lib/generators/module-facts.js.map +2 -2
  223. package/dist/lib/generators/module-override-targets.js +24 -2
  224. package/dist/lib/generators/module-override-targets.js.map +2 -2
  225. package/dist/lib/generators/module-registry.js +75 -3
  226. package/dist/lib/generators/module-registry.js.map +2 -2
  227. package/dist/lib/generators/openapi.js +27 -17
  228. package/dist/lib/generators/openapi.js.map +2 -2
  229. package/dist/lib/post-generate-invalidation.js +20 -1
  230. package/dist/lib/post-generate-invalidation.js.map +2 -2
  231. package/dist/lib/resolver.js +195 -1
  232. package/dist/lib/resolver.js.map +3 -3
  233. package/dist/lib/scaffold/field-dsl.js +393 -0
  234. package/dist/lib/scaffold/field-dsl.js.map +7 -0
  235. package/dist/lib/scaffold/index.js +412 -0
  236. package/dist/lib/scaffold/index.js.map +7 -0
  237. package/dist/lib/scaffold/targets.js +42 -0
  238. package/dist/lib/scaffold/targets.js.map +7 -0
  239. package/dist/lib/scaffold/templates/create-page.js +52 -0
  240. package/dist/lib/scaffold/templates/create-page.js.map +7 -0
  241. package/dist/lib/scaffold/templates/detail-page.js +186 -0
  242. package/dist/lib/scaffold/templates/detail-page.js.map +7 -0
  243. package/dist/lib/scaffold/templates/form-config.js +42 -0
  244. package/dist/lib/scaffold/templates/form-config.js.map +7 -0
  245. package/dist/lib/scaffold/templates/index.js +27 -0
  246. package/dist/lib/scaffold/templates/index.js.map +7 -0
  247. package/dist/lib/scaffold/templates/list-page.js +190 -0
  248. package/dist/lib/scaffold/templates/list-page.js.map +7 -0
  249. package/dist/lib/scaffold/templates/metas.js +47 -0
  250. package/dist/lib/scaffold/templates/metas.js.map +7 -0
  251. package/dist/lib/scaffold/templates/module-files.js +85 -0
  252. package/dist/lib/scaffold/templates/module-files.js.map +7 -0
  253. package/dist/lib/single-instance-strategy-guard.js +26 -3
  254. package/dist/lib/single-instance-strategy-guard.js.map +2 -2
  255. package/dist/lib/testing/integration-discovery.js +32 -3
  256. package/dist/lib/testing/integration-discovery.js.map +2 -2
  257. package/dist/lib/testing/integration.js +232 -8
  258. package/dist/lib/testing/integration.js.map +2 -2
  259. package/dist/mercato.js +40 -7
  260. package/dist/mercato.js.map +2 -2
  261. package/jest.config.cjs +2 -0
  262. package/package.json +7 -7
  263. package/src/__tests__/mercato.test.ts +18 -0
  264. package/src/__tests__/rotation-json-output.test.ts +52 -0
  265. package/src/lib/__tests__/agentic-workflows-ownership.test.ts +79 -0
  266. package/src/lib/__tests__/cache-provider-manifest.test.ts +76 -0
  267. package/src/lib/__tests__/generate-watch-plan.test.ts +3 -2
  268. package/src/lib/__tests__/generate-watch-runner.test.ts +13 -1
  269. package/src/lib/__tests__/generate-watch-structure.test.ts +34 -0
  270. package/src/lib/__tests__/post-generate-invalidation.test.ts +108 -0
  271. package/src/lib/__tests__/resolver.form-section-gates.test.ts +82 -0
  272. package/src/lib/__tests__/single-instance-strategy-guard.test.ts +129 -0
  273. package/src/lib/cache-provider-manifest.ts +8 -0
  274. package/src/lib/generate-watch-plan.ts +6 -3
  275. package/src/lib/generate-watch-runner.ts +1 -0
  276. package/src/lib/generate-watch-structure.ts +5 -1
  277. package/src/lib/generators/__tests__/cache-providers.test.ts +102 -0
  278. package/src/lib/generators/__tests__/derived-crud-route-collisions.test.ts +85 -0
  279. package/src/lib/generators/__tests__/form-section-outbox.test.ts +53 -0
  280. package/src/lib/generators/__tests__/form-sections.test.ts +896 -0
  281. package/src/lib/generators/__tests__/module-extension-facts.test.ts +1 -0
  282. package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +8 -6
  283. package/src/lib/generators/__tests__/module-facts.example-fact-coverage.test.ts +37 -13
  284. package/src/lib/generators/__tests__/module-facts.local-reference.test.ts +13 -0
  285. package/src/lib/generators/__tests__/module-override-targets.test.ts +2 -3
  286. package/src/lib/generators/__tests__/module-subset.test.ts +1 -1
  287. package/src/lib/generators/__tests__/openapi.test.ts +60 -13
  288. package/src/lib/generators/__tests__/structural-contracts.test.ts +2 -2
  289. package/src/lib/generators/ast/writers.ts +6 -1
  290. package/src/lib/generators/cache-providers.ts +111 -0
  291. package/src/lib/generators/form-section-ast.ts +166 -0
  292. package/src/lib/generators/form-section-extension-compiler.ts +632 -0
  293. package/src/lib/generators/form-section-extension-source.ts +308 -0
  294. package/src/lib/generators/form-section-runtime-revisions.ts +211 -0
  295. package/src/lib/generators/form-sections.ts +896 -0
  296. package/src/lib/generators/index.ts +1 -0
  297. package/src/lib/generators/module-entities.ts +22 -4
  298. package/src/lib/generators/module-extension-facts.ts +1 -0
  299. package/src/lib/generators/module-facts.ts +40 -0
  300. package/src/lib/generators/module-override-targets.ts +19 -0
  301. package/src/lib/generators/module-registry.ts +80 -4
  302. package/src/lib/generators/openapi.ts +31 -20
  303. package/src/lib/post-generate-invalidation.ts +28 -1
  304. package/src/lib/resolver.ts +218 -0
  305. package/src/lib/scaffold/__tests__/__snapshots__/scaffold-golden.test.ts.snap +1742 -0
  306. package/src/lib/scaffold/__tests__/helpers.ts +75 -0
  307. package/src/lib/scaffold/__tests__/scaffold-ds-contract.test.ts +248 -0
  308. package/src/lib/scaffold/__tests__/scaffold-golden.test.ts +267 -0
  309. package/src/lib/scaffold/__tests__/scaffold-runtime.test.tsx +193 -0
  310. package/src/lib/scaffold/field-dsl.ts +491 -0
  311. package/src/lib/scaffold/index.ts +531 -0
  312. package/src/lib/scaffold/targets.ts +68 -0
  313. package/src/lib/scaffold/templates/create-page.ts +52 -0
  314. package/src/lib/scaffold/templates/detail-page.ts +190 -0
  315. package/src/lib/scaffold/templates/form-config.ts +42 -0
  316. package/src/lib/scaffold/templates/index.ts +27 -0
  317. package/src/lib/scaffold/templates/list-page.ts +190 -0
  318. package/src/lib/scaffold/templates/metas.ts +48 -0
  319. package/src/lib/scaffold/templates/module-files.ts +87 -0
  320. package/src/lib/single-instance-strategy-guard.ts +51 -1
  321. package/src/lib/testing/__tests__/integration-app-only-playwright.test.ts +225 -0
  322. package/src/lib/testing/__tests__/integration-app-only.test.ts +320 -0
  323. package/src/lib/testing/__tests__/integration-discovery.test.ts +45 -1
  324. package/src/lib/testing/integration-discovery.ts +32 -2
  325. package/src/lib/testing/integration.ts +293 -11
  326. package/src/mercato.ts +39 -5
  327. package/dist/agentic/guides/modules/dashboards/incoming-installed-contributions.md +0 -11
@@ -0,0 +1,186 @@
1
+ const detailPageTemplate = `"use client"
2
+
3
+ import * as React from 'react'
4
+ import { useRouter } from 'next/navigation'
5
+ import { Page, PageBody } from '@open-mercato/ui/backend/Page'
6
+ import { CrudForm } from '@open-mercato/ui/backend/CrudForm'
7
+ import { FormHeader } from '@open-mercato/ui/backend/forms/FormHeader'
8
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@open-mercato/ui/primitives/tabs'
9
+ import { LoadingMessage, ErrorMessage } from '@open-mercato/ui/backend/detail'
10
+ import { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'
11
+ import { updateCrud, deleteCrud } from '@open-mercato/ui/backend/utils/crud'
12
+ import { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'
13
+ import { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'
14
+ import { flash } from '@open-mercato/ui/backend/FlashMessages'
15
+ import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
16
+ import { useT } from '@open-mercato/shared/lib/i18n/context'
17
+ import { getTelemetryRuntime } from '@open-mercato/shared/lib/telemetry/runtime'
18
+ import { {{entityCamel}}UpdateSchema, type {{entityPascal}}UpdateInput } from '../../../data/validators'
19
+ {{statusImports}}import {
20
+ {{entityUpperSnake}}_ENTITY_ID,
21
+ create{{entityPascal}}FormFields,
22
+ create{{entityPascal}}FormGroups,
23
+ } from '../../../components/formConfig'
24
+
25
+ type {{entityPascal}}Record = {
26
+ id: string
27
+ updatedAt?: string | null
28
+ {{rowTypeFields}}
29
+ }
30
+
31
+ type {{entityPascal}}ListResponse = {
32
+ items: {{entityPascal}}Record[]
33
+ }
34
+
35
+ export default function {{entityPascal}}DetailPage({ params }: { params?: { id?: string } }) {
36
+ const t = useT()
37
+ const router = useRouter()
38
+ const id = typeof params?.id === 'string' ? params.id : null
39
+ const { confirm, ConfirmDialogElement } = useConfirmDialog()
40
+ const { runMutation, retryLastMutation } = useGuardedMutation({ contextId: '{{moduleId}}.detail' })
41
+ const [record, setRecord] = React.useState<{{entityPascal}}Record | null>(null)
42
+ const [isLoading, setIsLoading] = React.useState(true)
43
+ const [loadError, setLoadError] = React.useState<string | null>(null)
44
+ const [reloadToken, setReloadToken] = React.useState(0)
45
+
46
+ React.useEffect(() => {
47
+ let cancelled = false
48
+ async function load() {
49
+ if (!id) {
50
+ setLoadError(t('{{moduleId}}.detail.notFound', '{{entityTitle}} not found'))
51
+ setIsLoading(false)
52
+ return
53
+ }
54
+ setIsLoading(true)
55
+ setLoadError(null)
56
+ try {
57
+ const query = new URLSearchParams({ ids: id, pageSize: '1' })
58
+ const call = await apiCall<{{entityPascal}}ListResponse>('/api/{{moduleId}}?' + query.toString())
59
+ if (cancelled) return
60
+ if (!call.ok) {
61
+ setLoadError(t('{{moduleId}}.detail.loadError', 'Failed to load {{entityLower}}'))
62
+ return
63
+ }
64
+ const item = call.result?.items?.[0] ?? null
65
+ if (!item) {
66
+ setLoadError(t('{{moduleId}}.detail.notFound', '{{entityTitle}} not found'))
67
+ return
68
+ }
69
+ setRecord(item)
70
+ } catch (error) {
71
+ if (cancelled) return
72
+ getTelemetryRuntime()?.reportError(error, { module: '{{moduleId}}', code: '{{moduleId}}.detail_load_failed' })
73
+ setLoadError(t('{{moduleId}}.detail.loadError', 'Failed to load {{entityLower}}'))
74
+ } finally {
75
+ if (!cancelled) setIsLoading(false)
76
+ }
77
+ }
78
+ void load()
79
+ return () => { cancelled = true }
80
+ }, [id, reloadToken, t])
81
+
82
+ const fields = React.useMemo(() => create{{entityPascal}}FormFields(t), [t])
83
+ const groups = React.useMemo(() => create{{entityPascal}}FormGroups(t), [t])
84
+
85
+ // updatedAt MUST stay in initialValues: CrudForm auto-derives the
86
+ // x-om-ext-optimistic-lock-expected-updated-at header from it on submit AND delete.
87
+ const initialValues = React.useMemo<Partial<{{entityPascal}}UpdateInput> | undefined>(() => {
88
+ if (!record) return undefined
89
+ return {
90
+ id: record.id,
91
+ updatedAt: record.updatedAt ?? undefined,
92
+ {{initialValueLines}}
93
+ }
94
+ }, [record])
95
+
96
+ const handleDelete = React.useCallback(async () => {
97
+ if (!record) return
98
+ const confirmed = await confirm({
99
+ title: t('{{moduleId}}.delete.confirmTitle', 'Delete {{entityLower}}?'),
100
+ description: t('{{moduleId}}.delete.confirmDescription', 'This action cannot be undone.'),
101
+ variant: 'destructive',
102
+ })
103
+ if (!confirmed) return
104
+ try {
105
+ await runMutation({
106
+ operation: () =>
107
+ withScopedApiRequestHeaders(
108
+ buildOptimisticLockHeader(record.updatedAt ?? undefined),
109
+ () => deleteCrud('{{moduleId}}', record.id),
110
+ ),
111
+ context: {
112
+ formId: '{{moduleId}}.detail',
113
+ resourceKind: '{{moduleId}}.{{entitySnake}}',
114
+ resourceId: record.id,
115
+ retryLastMutation,
116
+ },
117
+ mutationPayload: { id: record.id },
118
+ })
119
+ flash(t('{{moduleId}}.delete.success', '{{entityTitle}} deleted'), 'success')
120
+ router.push('/backend/{{moduleId}}')
121
+ } catch {
122
+ flash(t('{{moduleId}}.delete.error', 'Failed to delete {{entityLower}}'), 'error')
123
+ }
124
+ }, [confirm, record, retryLastMutation, router, runMutation, t])
125
+
126
+ if (isLoading) {
127
+ return (
128
+ <Page>
129
+ <PageBody>
130
+ <LoadingMessage label={t('{{moduleId}}.detail.loading', 'Loading {{entityLower}}')} />
131
+ </PageBody>
132
+ </Page>
133
+ )
134
+ }
135
+
136
+ if (loadError || !record) {
137
+ return (
138
+ <Page>
139
+ <PageBody>
140
+ <ErrorMessage label={loadError ?? t('{{moduleId}}.detail.notFound', '{{entityTitle}} not found')} />
141
+ </PageBody>
142
+ </Page>
143
+ )
144
+ }
145
+
146
+ return (
147
+ <Page>
148
+ <PageBody>
149
+ <FormHeader
150
+ mode="detail"
151
+ backHref="/backend/{{moduleId}}"
152
+ title={{{detailTitleExpr}}}
153
+ {{statusBadgeProp}} onDelete={() => { void handleDelete() }}
154
+ deleteLabel={t('{{moduleId}}.detail.actions.delete', 'Delete')}
155
+ />
156
+ <Tabs defaultValue="overview" variant="underline" className="mt-4">
157
+ <TabsList aria-label={t('{{moduleId}}.detail.tabs.label', '{{entityTitle}} sections')}>
158
+ <TabsTrigger value="overview">{t('{{moduleId}}.detail.tabs.overview', 'Overview')}</TabsTrigger>
159
+ {/* Extension point: add related-entity tabs here (activity, attachments, ...). */}
160
+ </TabsList>
161
+ <TabsContent value="overview">
162
+ <CrudForm<{{entityPascal}}UpdateInput>
163
+ schema={{{entityCamel}}UpdateSchema}
164
+ fields={fields}
165
+ groups={groups}
166
+ initialValues={initialValues}
167
+ entityIds={[{{entityUpperSnake}}_ENTITY_ID]}
168
+ submitLabel={t('{{moduleId}}.form.submit', 'Save')}
169
+ onSubmit={async (values) => {
170
+ await updateCrud('{{moduleId}}', values)
171
+ flash(t('{{moduleId}}.detail.updateSuccess', '{{entityTitle}} updated'), 'success')
172
+ setReloadToken((token) => token + 1)
173
+ }}
174
+ />
175
+ </TabsContent>
176
+ </Tabs>
177
+ </PageBody>
178
+ {ConfirmDialogElement}
179
+ </Page>
180
+ )
181
+ }
182
+ `;
183
+ export {
184
+ detailPageTemplate
185
+ };
186
+ //# sourceMappingURL=detail-page.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/scaffold/templates/detail-page.ts"],
4
+ "sourcesContent": ["/**\n * Detail page template (lineage: om-ds-guardian page-templates.md \u00A7Detail Page,\n * upgraded to the shipped primitives: FormHeader mode=\"detail\" + Tabs\n * variant=\"underline\", optimistic locking via initialValues.updatedAt).\n *\n * Deliberately stays on public primitives \u2014 the customers module's\n * DetailTabsLayout is module-internal and MUST NOT be copied here.\n */\nexport const detailPageTemplate = `\"use client\"\n\nimport * as React from 'react'\nimport { useRouter } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm } from '@open-mercato/ui/backend/CrudForm'\nimport { FormHeader } from '@open-mercato/ui/backend/forms/FormHeader'\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@open-mercato/ui/primitives/tabs'\nimport { LoadingMessage, ErrorMessage } from '@open-mercato/ui/backend/detail'\nimport { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'\nimport { updateCrud, deleteCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { getTelemetryRuntime } from '@open-mercato/shared/lib/telemetry/runtime'\nimport { {{entityCamel}}UpdateSchema, type {{entityPascal}}UpdateInput } from '../../../data/validators'\n{{statusImports}}import {\n {{entityUpperSnake}}_ENTITY_ID,\n create{{entityPascal}}FormFields,\n create{{entityPascal}}FormGroups,\n} from '../../../components/formConfig'\n\ntype {{entityPascal}}Record = {\n id: string\n updatedAt?: string | null\n{{rowTypeFields}}\n}\n\ntype {{entityPascal}}ListResponse = {\n items: {{entityPascal}}Record[]\n}\n\nexport default function {{entityPascal}}DetailPage({ params }: { params?: { id?: string } }) {\n const t = useT()\n const router = useRouter()\n const id = typeof params?.id === 'string' ? params.id : null\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n const { runMutation, retryLastMutation } = useGuardedMutation({ contextId: '{{moduleId}}.detail' })\n const [record, setRecord] = React.useState<{{entityPascal}}Record | null>(null)\n const [isLoading, setIsLoading] = React.useState(true)\n const [loadError, setLoadError] = React.useState<string | null>(null)\n const [reloadToken, setReloadToken] = React.useState(0)\n\n React.useEffect(() => {\n let cancelled = false\n async function load() {\n if (!id) {\n setLoadError(t('{{moduleId}}.detail.notFound', '{{entityTitle}} not found'))\n setIsLoading(false)\n return\n }\n setIsLoading(true)\n setLoadError(null)\n try {\n const query = new URLSearchParams({ ids: id, pageSize: '1' })\n const call = await apiCall<{{entityPascal}}ListResponse>('/api/{{moduleId}}?' + query.toString())\n if (cancelled) return\n if (!call.ok) {\n setLoadError(t('{{moduleId}}.detail.loadError', 'Failed to load {{entityLower}}'))\n return\n }\n const item = call.result?.items?.[0] ?? null\n if (!item) {\n setLoadError(t('{{moduleId}}.detail.notFound', '{{entityTitle}} not found'))\n return\n }\n setRecord(item)\n } catch (error) {\n if (cancelled) return\n getTelemetryRuntime()?.reportError(error, { module: '{{moduleId}}', code: '{{moduleId}}.detail_load_failed' })\n setLoadError(t('{{moduleId}}.detail.loadError', 'Failed to load {{entityLower}}'))\n } finally {\n if (!cancelled) setIsLoading(false)\n }\n }\n void load()\n return () => { cancelled = true }\n }, [id, reloadToken, t])\n\n const fields = React.useMemo(() => create{{entityPascal}}FormFields(t), [t])\n const groups = React.useMemo(() => create{{entityPascal}}FormGroups(t), [t])\n\n // updatedAt MUST stay in initialValues: CrudForm auto-derives the\n // x-om-ext-optimistic-lock-expected-updated-at header from it on submit AND delete.\n const initialValues = React.useMemo<Partial<{{entityPascal}}UpdateInput> | undefined>(() => {\n if (!record) return undefined\n return {\n id: record.id,\n updatedAt: record.updatedAt ?? undefined,\n{{initialValueLines}}\n }\n }, [record])\n\n const handleDelete = React.useCallback(async () => {\n if (!record) return\n const confirmed = await confirm({\n title: t('{{moduleId}}.delete.confirmTitle', 'Delete {{entityLower}}?'),\n description: t('{{moduleId}}.delete.confirmDescription', 'This action cannot be undone.'),\n variant: 'destructive',\n })\n if (!confirmed) return\n try {\n await runMutation({\n operation: () =>\n withScopedApiRequestHeaders(\n buildOptimisticLockHeader(record.updatedAt ?? undefined),\n () => deleteCrud('{{moduleId}}', record.id),\n ),\n context: {\n formId: '{{moduleId}}.detail',\n resourceKind: '{{moduleId}}.{{entitySnake}}',\n resourceId: record.id,\n retryLastMutation,\n },\n mutationPayload: { id: record.id },\n })\n flash(t('{{moduleId}}.delete.success', '{{entityTitle}} deleted'), 'success')\n router.push('/backend/{{moduleId}}')\n } catch {\n flash(t('{{moduleId}}.delete.error', 'Failed to delete {{entityLower}}'), 'error')\n }\n }, [confirm, record, retryLastMutation, router, runMutation, t])\n\n if (isLoading) {\n return (\n <Page>\n <PageBody>\n <LoadingMessage label={t('{{moduleId}}.detail.loading', 'Loading {{entityLower}}')} />\n </PageBody>\n </Page>\n )\n }\n\n if (loadError || !record) {\n return (\n <Page>\n <PageBody>\n <ErrorMessage label={loadError ?? t('{{moduleId}}.detail.notFound', '{{entityTitle}} not found')} />\n </PageBody>\n </Page>\n )\n }\n\n return (\n <Page>\n <PageBody>\n <FormHeader\n mode=\"detail\"\n backHref=\"/backend/{{moduleId}}\"\n title={{{detailTitleExpr}}}\n{{statusBadgeProp}} onDelete={() => { void handleDelete() }}\n deleteLabel={t('{{moduleId}}.detail.actions.delete', 'Delete')}\n />\n <Tabs defaultValue=\"overview\" variant=\"underline\" className=\"mt-4\">\n <TabsList aria-label={t('{{moduleId}}.detail.tabs.label', '{{entityTitle}} sections')}>\n <TabsTrigger value=\"overview\">{t('{{moduleId}}.detail.tabs.overview', 'Overview')}</TabsTrigger>\n {/* Extension point: add related-entity tabs here (activity, attachments, ...). */}\n </TabsList>\n <TabsContent value=\"overview\">\n <CrudForm<{{entityPascal}}UpdateInput>\n schema={{{entityCamel}}UpdateSchema}\n fields={fields}\n groups={groups}\n initialValues={initialValues}\n entityIds={[{{entityUpperSnake}}_ENTITY_ID]}\n submitLabel={t('{{moduleId}}.form.submit', 'Save')}\n onSubmit={async (values) => {\n await updateCrud('{{moduleId}}', values)\n flash(t('{{moduleId}}.detail.updateSuccess', '{{entityTitle}} updated'), 'success')\n setReloadToken((token) => token + 1)\n }}\n />\n </TabsContent>\n </Tabs>\n </PageBody>\n {ConfirmDialogElement}\n </Page>\n )\n}\n`\n"],
5
+ "mappings": "AAQO,MAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ const formConfigTemplate = `import { z } from 'zod'
2
+ import type { CrudField, CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'
3
+ import type { TranslateFn } from '@open-mercato/shared/lib/i18n/context'
4
+ import { {{entityCamel}}CreateSchema } from '../data/validators'
5
+
6
+ /** Entity id used to load custom-field sets once the module declares \`ce.ts\`. */
7
+ export const {{entityUpperSnake}}_ENTITY_ID = '{{moduleId}}:{{entitySnake}}'
8
+
9
+ export type {{entityPascal}}FormValues = z.infer<typeof {{entityCamel}}CreateSchema>
10
+
11
+ export function create{{entityPascal}}FormSchema() {
12
+ return {{entityCamel}}CreateSchema
13
+ }
14
+
15
+ export function create{{entityPascal}}FormFields(t: TranslateFn): CrudField[] {
16
+ return [
17
+ {{crudFields}}
18
+ ]
19
+ }
20
+
21
+ export function create{{entityPascal}}FormGroups(t: TranslateFn): CrudFormGroup[] {
22
+ return [
23
+ {
24
+ id: 'details',
25
+ title: t('{{moduleId}}.form.groups.details', 'Details'),
26
+ column: 1,
27
+ fields: [{{fieldIdList}}],
28
+ },
29
+ // Custom-field sets registered for {{entityUpperSnake}}_ENTITY_ID render here.
30
+ {
31
+ id: 'attributes',
32
+ title: t('{{moduleId}}.form.groups.attributes', 'Attributes'),
33
+ column: 2,
34
+ kind: 'customFields',
35
+ },
36
+ ]
37
+ }
38
+ `;
39
+ export {
40
+ formConfigTemplate
41
+ };
42
+ //# sourceMappingURL=form-config.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/scaffold/templates/form-config.ts"],
4
+ "sourcesContent": ["/**\n * components/formConfig.ts template (customers formConfig pattern: zod schema +\n * CrudField[] + groups from one place so create/detail can never disagree).\n */\nexport const formConfigTemplate = `import { z } from 'zod'\nimport type { CrudField, CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'\nimport type { TranslateFn } from '@open-mercato/shared/lib/i18n/context'\nimport { {{entityCamel}}CreateSchema } from '../data/validators'\n\n/** Entity id used to load custom-field sets once the module declares \\`ce.ts\\`. */\nexport const {{entityUpperSnake}}_ENTITY_ID = '{{moduleId}}:{{entitySnake}}'\n\nexport type {{entityPascal}}FormValues = z.infer<typeof {{entityCamel}}CreateSchema>\n\nexport function create{{entityPascal}}FormSchema() {\n return {{entityCamel}}CreateSchema\n}\n\nexport function create{{entityPascal}}FormFields(t: TranslateFn): CrudField[] {\n return [\n{{crudFields}}\n ]\n}\n\nexport function create{{entityPascal}}FormGroups(t: TranslateFn): CrudFormGroup[] {\n return [\n {\n id: 'details',\n title: t('{{moduleId}}.form.groups.details', 'Details'),\n column: 1,\n fields: [{{fieldIdList}}],\n },\n // Custom-field sets registered for {{entityUpperSnake}}_ENTITY_ID render here.\n {\n id: 'attributes',\n title: t('{{moduleId}}.form.groups.attributes', 'Attributes'),\n column: 2,\n kind: 'customFields',\n },\n ]\n}\n`\n"],
5
+ "mappings": "AAIO,MAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ import { listPageTemplate } from "./list-page.js";
2
+ import { createPageTemplate } from "./create-page.js";
3
+ import { detailPageTemplate } from "./detail-page.js";
4
+ import { listMetaTemplate, createMetaTemplate, detailMetaTemplate } from "./metas.js";
5
+ import { formConfigTemplate } from "./form-config.js";
6
+ import {
7
+ validatorsTemplate,
8
+ statusMapTemplate,
9
+ aclTemplate,
10
+ setupTemplate,
11
+ moduleIndexTemplate
12
+ } from "./module-files.js";
13
+ export {
14
+ aclTemplate,
15
+ createMetaTemplate,
16
+ createPageTemplate,
17
+ detailMetaTemplate,
18
+ detailPageTemplate,
19
+ formConfigTemplate,
20
+ listMetaTemplate,
21
+ listPageTemplate,
22
+ moduleIndexTemplate,
23
+ setupTemplate,
24
+ statusMapTemplate,
25
+ validatorsTemplate
26
+ };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/scaffold/templates/index.ts"],
4
+ "sourcesContent": ["/**\n * Executable template source of truth for `mercato module scaffold --with-ui`\n * (spec: .ai/specs/2026-07-05-ds-module-ui-scaffold.md \u00A7Template source of truth).\n *\n * Templates are embedded as TypeScript string constants (not loose `.tpl`\n * assets) because `packages/cli/build.mjs` bundles `src/**\\/*.ts` only \u2014 this\n * way the templates ship inside the published `@open-mercato/cli` dist with no\n * extra copy step, and standalone apps get byte-identical templates versioned\n * with the CLI. Interpolation is `{{placeholder}}` substitution only \u2014 no\n * template engine (see `renderTemplate` in `../index.ts`).\n *\n * These templates are pinned by `__tests__/scaffold-golden.test.ts` (golden\n * files) and `__tests__/scaffold-ds-contract.test.ts` (DS lint + guardian\n * checklist): a template edit can never ship invisibly.\n */\nexport { listPageTemplate } from './list-page'\nexport { createPageTemplate } from './create-page'\nexport { detailPageTemplate } from './detail-page'\nexport { listMetaTemplate, createMetaTemplate, detailMetaTemplate } from './metas'\nexport { formConfigTemplate } from './form-config'\nexport {\n validatorsTemplate,\n statusMapTemplate,\n aclTemplate,\n setupTemplate,\n moduleIndexTemplate,\n} from './module-files'\n"],
5
+ "mappings": "AAeA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB,oBAAoB,0BAA0B;AACzE,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
+ "names": []
7
+ }
@@ -0,0 +1,190 @@
1
+ const listPageTemplate = `"use client"
2
+
3
+ import * as React from 'react'
4
+ import Link from 'next/link'
5
+ import { useRouter } from 'next/navigation'
6
+ import { Page, PageBody } from '@open-mercato/ui/backend/Page'
7
+ import { DataTable, type DataTableExportFormat } from '@open-mercato/ui/backend/DataTable'
8
+ import type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'
9
+ import { Button } from '@open-mercato/ui/primitives/button'
10
+ import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
11
+ import { RowActions } from '@open-mercato/ui/backend/RowActions'
12
+ import { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'
13
+ import { buildCrudExportUrl, deleteCrud } from '@open-mercato/ui/backend/utils/crud'
14
+ import { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'
15
+ import { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'
16
+ import { flash } from '@open-mercato/ui/backend/FlashMessages'
17
+ import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
18
+ import { useT } from '@open-mercato/shared/lib/i18n/context'
19
+ import { getTelemetryRuntime } from '@open-mercato/shared/lib/telemetry/runtime'
20
+ {{dateImport}}{{filterTypeImport}}{{statusImports}}
21
+ type {{entityPascal}}Row = {
22
+ id: string
23
+ updatedAt?: string | null
24
+ {{rowTypeFields}}
25
+ }
26
+
27
+ type {{entityPascal}}ListResponse = {
28
+ items: {{entityPascal}}Row[]
29
+ total: number
30
+ totalPages: number
31
+ totalIsCapped?: boolean
32
+ }
33
+
34
+ // DS guardrail: keep pageSize at or below 100.
35
+ const PAGE_SIZE = 25
36
+
37
+ export default function {{entityPascal}}ListPage() {
38
+ const t = useT()
39
+ const router = useRouter()
40
+ const { confirm, ConfirmDialogElement } = useConfirmDialog()
41
+ const { runMutation, retryLastMutation } = useGuardedMutation({ contextId: '{{moduleId}}.list' })
42
+ const [rows, setRows] = React.useState<{{entityPascal}}Row[]>([])
43
+ const [isLoading, setIsLoading] = React.useState(true)
44
+ const [loadError, setLoadError] = React.useState<string | null>(null)
45
+ const [page, setPage] = React.useState(1)
46
+ const [total, setTotal] = React.useState(0)
47
+ const [totalPages, setTotalPages] = React.useState(1)
48
+ const [totalIsCapped, setTotalIsCapped] = React.useState(false)
49
+ const [search, setSearch] = React.useState('')
50
+ {{filterStateLine}} const [reloadToken, setReloadToken] = React.useState(0)
51
+
52
+ const listParams = React.useMemo(() => {
53
+ const params: Record<string, string | number> = { page, pageSize: PAGE_SIZE }
54
+ if (search) params.search = search
55
+ {{filterParamLines}} return params
56
+ }, {{listParamsDeps}})
57
+
58
+ React.useEffect(() => {
59
+ let cancelled = false
60
+ async function load() {
61
+ setIsLoading(true)
62
+ setLoadError(null)
63
+ try {
64
+ const query = new URLSearchParams()
65
+ for (const [key, value] of Object.entries(listParams)) query.set(key, String(value))
66
+ const fallback: {{entityPascal}}ListResponse = { items: [], total: 0, totalPages: 1 }
67
+ const call = await apiCall<{{entityPascal}}ListResponse>('/api/{{moduleId}}?' + query.toString(), undefined, { fallback })
68
+ if (cancelled) return
69
+ if (!call.ok) {
70
+ setLoadError(t('{{moduleId}}.list.loadError', 'Failed to load {{moduleTitleLower}}'))
71
+ flash(t('{{moduleId}}.list.loadError', 'Failed to load {{moduleTitleLower}}'), 'error')
72
+ return
73
+ }
74
+ const result = call.result ?? fallback
75
+ setRows(result.items)
76
+ setTotal(result.total)
77
+ setTotalPages(result.totalPages)
78
+ setTotalIsCapped(result.totalIsCapped === true)
79
+ } catch (error) {
80
+ if (cancelled) return
81
+ getTelemetryRuntime()?.reportError(error, { module: '{{moduleId}}', code: '{{moduleId}}.list_load_failed' })
82
+ setLoadError(t('{{moduleId}}.list.loadError', 'Failed to load {{moduleTitleLower}}'))
83
+ } finally {
84
+ if (!cancelled) setIsLoading(false)
85
+ }
86
+ }
87
+ void load()
88
+ return () => { cancelled = true }
89
+ }, [listParams, reloadToken, t])
90
+
91
+ const handleDelete = React.useCallback(async (row: {{entityPascal}}Row) => {
92
+ const confirmed = await confirm({
93
+ title: t('{{moduleId}}.delete.confirmTitle', 'Delete {{entityLower}}?'),
94
+ description: t('{{moduleId}}.delete.confirmDescription', 'This action cannot be undone.'),
95
+ variant: 'destructive',
96
+ })
97
+ if (!confirmed) return
98
+ try {
99
+ // Optimistic locking is ON by default: derive the expected-updated-at
100
+ // header from the row the user acted on.
101
+ await runMutation({
102
+ operation: () =>
103
+ withScopedApiRequestHeaders(
104
+ buildOptimisticLockHeader(row.updatedAt ?? undefined),
105
+ () => deleteCrud('{{moduleId}}', row.id),
106
+ ),
107
+ context: {
108
+ formId: '{{moduleId}}.list',
109
+ resourceKind: '{{moduleId}}.{{entitySnake}}',
110
+ resourceId: row.id,
111
+ retryLastMutation,
112
+ },
113
+ mutationPayload: { id: row.id },
114
+ })
115
+ flash(t('{{moduleId}}.delete.success', '{{entityTitle}} deleted'), 'success')
116
+ setReloadToken((token) => token + 1)
117
+ } catch {
118
+ flash(t('{{moduleId}}.delete.error', 'Failed to delete {{entityLower}}'), 'error')
119
+ }
120
+ }, [confirm, retryLastMutation, runMutation, t])
121
+
122
+ const columns = React.useMemo<ColumnDef<{{entityPascal}}Row>[]>(() => [
123
+ {{columnsBlock}}
124
+ ], [t])
125
+
126
+ {{filtersMemo}} const exporter = React.useMemo(() => ({
127
+ getUrl: (format: DataTableExportFormat) => buildCrudExportUrl('{{moduleId}}', { ...listParams, exportScope: 'view' }, format),
128
+ filename: (format: DataTableExportFormat) => '{{moduleId}}.' + format,
129
+ }), [listParams])
130
+
131
+ return (
132
+ <Page>
133
+ <PageBody>
134
+ <DataTable<{{entityPascal}}Row>
135
+ title={t('{{moduleId}}.list.title', '{{moduleTitle}}')}
136
+ actions={(
137
+ <Button asChild>
138
+ <Link href="/backend/{{moduleId}}/create">{t('{{moduleId}}.list.actions.create', 'Create {{entityLower}}')}</Link>
139
+ </Button>
140
+ )}
141
+ columns={columns}
142
+ data={rows}
143
+ isLoading={isLoading}
144
+ error={loadError}
145
+ searchValue={search}
146
+ onSearchChange={(value) => { setSearch(value); setPage(1) }}
147
+ searchPlaceholder={t('{{moduleId}}.list.searchPlaceholder', 'Search {{moduleTitleLower}}')}
148
+ {{filterProps}} exporter={exporter}
149
+ extensionTableId="{{moduleId}}.list"
150
+ onRowClick={(row) => router.push('/backend/{{moduleId}}/' + row.id)}
151
+ rowActions={(row) => (
152
+ <RowActions
153
+ items={[
154
+ {
155
+ id: 'edit',
156
+ label: t('{{moduleId}}.list.actions.edit', 'Edit'),
157
+ onSelect: () => { router.push('/backend/{{moduleId}}/' + row.id) },
158
+ },
159
+ {
160
+ id: 'delete',
161
+ label: t('{{moduleId}}.list.actions.delete', 'Delete'),
162
+ destructive: true,
163
+ onSelect: () => { void handleDelete(row) },
164
+ },
165
+ ]}
166
+ />
167
+ )}
168
+ emptyState={(
169
+ <EmptyState
170
+ title={t('{{moduleId}}.list.empty.title', 'No {{moduleTitleLower}} yet')}
171
+ description={t('{{moduleId}}.list.empty.description', 'Create your first {{entityLower}} to get started.')}
172
+ actions={(
173
+ <Button asChild>
174
+ <Link href="/backend/{{moduleId}}/create">{t('{{moduleId}}.list.actions.create', 'Create {{entityLower}}')}</Link>
175
+ </Button>
176
+ )}
177
+ />
178
+ )}
179
+ pagination={{ page, pageSize: PAGE_SIZE, total, totalPages, totalIsCapped, onPageChange: setPage }}
180
+ />
181
+ </PageBody>
182
+ {ConfirmDialogElement}
183
+ </Page>
184
+ )
185
+ }
186
+ `;
187
+ export {
188
+ listPageTemplate
189
+ };
190
+ //# sourceMappingURL=list-page.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/scaffold/templates/list-page.ts"],
4
+ "sourcesContent": ["/**\n * List page template (lineage: om-ds-guardian page-templates.md \u00A7List Page,\n * trimmed from packages/core/src/modules/customers/backend/customers/people/page.tsx).\n */\nexport const listPageTemplate = `\"use client\"\n\nimport * as React from 'react'\nimport Link from 'next/link'\nimport { useRouter } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { DataTable, type DataTableExportFormat } from '@open-mercato/ui/backend/DataTable'\nimport type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { EmptyState } from '@open-mercato/ui/primitives/empty-state'\nimport { RowActions } from '@open-mercato/ui/backend/RowActions'\nimport { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'\nimport { buildCrudExportUrl, deleteCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { getTelemetryRuntime } from '@open-mercato/shared/lib/telemetry/runtime'\n{{dateImport}}{{filterTypeImport}}{{statusImports}}\ntype {{entityPascal}}Row = {\n id: string\n updatedAt?: string | null\n{{rowTypeFields}}\n}\n\ntype {{entityPascal}}ListResponse = {\n items: {{entityPascal}}Row[]\n total: number\n totalPages: number\n totalIsCapped?: boolean\n}\n\n// DS guardrail: keep pageSize at or below 100.\nconst PAGE_SIZE = 25\n\nexport default function {{entityPascal}}ListPage() {\n const t = useT()\n const router = useRouter()\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n const { runMutation, retryLastMutation } = useGuardedMutation({ contextId: '{{moduleId}}.list' })\n const [rows, setRows] = React.useState<{{entityPascal}}Row[]>([])\n const [isLoading, setIsLoading] = React.useState(true)\n const [loadError, setLoadError] = React.useState<string | null>(null)\n const [page, setPage] = React.useState(1)\n const [total, setTotal] = React.useState(0)\n const [totalPages, setTotalPages] = React.useState(1)\n const [totalIsCapped, setTotalIsCapped] = React.useState(false)\n const [search, setSearch] = React.useState('')\n{{filterStateLine}} const [reloadToken, setReloadToken] = React.useState(0)\n\n const listParams = React.useMemo(() => {\n const params: Record<string, string | number> = { page, pageSize: PAGE_SIZE }\n if (search) params.search = search\n{{filterParamLines}} return params\n }, {{listParamsDeps}})\n\n React.useEffect(() => {\n let cancelled = false\n async function load() {\n setIsLoading(true)\n setLoadError(null)\n try {\n const query = new URLSearchParams()\n for (const [key, value] of Object.entries(listParams)) query.set(key, String(value))\n const fallback: {{entityPascal}}ListResponse = { items: [], total: 0, totalPages: 1 }\n const call = await apiCall<{{entityPascal}}ListResponse>('/api/{{moduleId}}?' + query.toString(), undefined, { fallback })\n if (cancelled) return\n if (!call.ok) {\n setLoadError(t('{{moduleId}}.list.loadError', 'Failed to load {{moduleTitleLower}}'))\n flash(t('{{moduleId}}.list.loadError', 'Failed to load {{moduleTitleLower}}'), 'error')\n return\n }\n const result = call.result ?? fallback\n setRows(result.items)\n setTotal(result.total)\n setTotalPages(result.totalPages)\n setTotalIsCapped(result.totalIsCapped === true)\n } catch (error) {\n if (cancelled) return\n getTelemetryRuntime()?.reportError(error, { module: '{{moduleId}}', code: '{{moduleId}}.list_load_failed' })\n setLoadError(t('{{moduleId}}.list.loadError', 'Failed to load {{moduleTitleLower}}'))\n } finally {\n if (!cancelled) setIsLoading(false)\n }\n }\n void load()\n return () => { cancelled = true }\n }, [listParams, reloadToken, t])\n\n const handleDelete = React.useCallback(async (row: {{entityPascal}}Row) => {\n const confirmed = await confirm({\n title: t('{{moduleId}}.delete.confirmTitle', 'Delete {{entityLower}}?'),\n description: t('{{moduleId}}.delete.confirmDescription', 'This action cannot be undone.'),\n variant: 'destructive',\n })\n if (!confirmed) return\n try {\n // Optimistic locking is ON by default: derive the expected-updated-at\n // header from the row the user acted on.\n await runMutation({\n operation: () =>\n withScopedApiRequestHeaders(\n buildOptimisticLockHeader(row.updatedAt ?? undefined),\n () => deleteCrud('{{moduleId}}', row.id),\n ),\n context: {\n formId: '{{moduleId}}.list',\n resourceKind: '{{moduleId}}.{{entitySnake}}',\n resourceId: row.id,\n retryLastMutation,\n },\n mutationPayload: { id: row.id },\n })\n flash(t('{{moduleId}}.delete.success', '{{entityTitle}} deleted'), 'success')\n setReloadToken((token) => token + 1)\n } catch {\n flash(t('{{moduleId}}.delete.error', 'Failed to delete {{entityLower}}'), 'error')\n }\n }, [confirm, retryLastMutation, runMutation, t])\n\n const columns = React.useMemo<ColumnDef<{{entityPascal}}Row>[]>(() => [\n{{columnsBlock}}\n ], [t])\n\n{{filtersMemo}} const exporter = React.useMemo(() => ({\n getUrl: (format: DataTableExportFormat) => buildCrudExportUrl('{{moduleId}}', { ...listParams, exportScope: 'view' }, format),\n filename: (format: DataTableExportFormat) => '{{moduleId}}.' + format,\n }), [listParams])\n\n return (\n <Page>\n <PageBody>\n <DataTable<{{entityPascal}}Row>\n title={t('{{moduleId}}.list.title', '{{moduleTitle}}')}\n actions={(\n <Button asChild>\n <Link href=\"/backend/{{moduleId}}/create\">{t('{{moduleId}}.list.actions.create', 'Create {{entityLower}}')}</Link>\n </Button>\n )}\n columns={columns}\n data={rows}\n isLoading={isLoading}\n error={loadError}\n searchValue={search}\n onSearchChange={(value) => { setSearch(value); setPage(1) }}\n searchPlaceholder={t('{{moduleId}}.list.searchPlaceholder', 'Search {{moduleTitleLower}}')}\n{{filterProps}} exporter={exporter}\n extensionTableId=\"{{moduleId}}.list\"\n onRowClick={(row) => router.push('/backend/{{moduleId}}/' + row.id)}\n rowActions={(row) => (\n <RowActions\n items={[\n {\n id: 'edit',\n label: t('{{moduleId}}.list.actions.edit', 'Edit'),\n onSelect: () => { router.push('/backend/{{moduleId}}/' + row.id) },\n },\n {\n id: 'delete',\n label: t('{{moduleId}}.list.actions.delete', 'Delete'),\n destructive: true,\n onSelect: () => { void handleDelete(row) },\n },\n ]}\n />\n )}\n emptyState={(\n <EmptyState\n title={t('{{moduleId}}.list.empty.title', 'No {{moduleTitleLower}} yet')}\n description={t('{{moduleId}}.list.empty.description', 'Create your first {{entityLower}} to get started.')}\n actions={(\n <Button asChild>\n <Link href=\"/backend/{{moduleId}}/create\">{t('{{moduleId}}.list.actions.create', 'Create {{entityLower}}')}</Link>\n </Button>\n )}\n />\n )}\n pagination={{ page, pageSize: PAGE_SIZE, total, totalPages, totalIsCapped, onPageChange: setPage }}\n />\n </PageBody>\n {ConfirmDialogElement}\n </Page>\n )\n}\n`\n"],
5
+ "mappings": "AAIO,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,47 @@
1
+ const listMetaTemplate = `export const metadata = {
2
+ requireAuth: true,
3
+ requireFeatures: ['{{featuresPrefix}}.view'],
4
+ pageTitle: '{{moduleTitle}}',
5
+ pageTitleKey: '{{moduleId}}.nav.title',
6
+ pageGroup: '{{moduleTitle}}',
7
+ pageGroupKey: '{{moduleId}}.nav.group',
8
+ pageOrder: 100,
9
+ icon: 'list',
10
+ breadcrumb: [{ label: '{{moduleTitle}}', labelKey: '{{moduleId}}.nav.title' }],
11
+ }
12
+ `;
13
+ const createMetaTemplate = `export const metadata = {
14
+ requireAuth: true,
15
+ requireFeatures: ['{{featuresPrefix}}.create'],
16
+ pageTitle: 'Create {{entityLower}}',
17
+ pageTitleKey: '{{moduleId}}.create.title',
18
+ pageGroup: '{{moduleTitle}}',
19
+ pageGroupKey: '{{moduleId}}.nav.group',
20
+ pageOrder: 101,
21
+ icon: 'plus',
22
+ breadcrumb: [
23
+ { label: '{{moduleTitle}}', labelKey: '{{moduleId}}.nav.title', href: '/backend/{{moduleId}}' },
24
+ { label: 'Create', labelKey: '{{moduleId}}.create.title' },
25
+ ],
26
+ }
27
+ `;
28
+ const detailMetaTemplate = `export const metadata = {
29
+ requireAuth: true,
30
+ requireFeatures: ['{{featuresPrefix}}.view'],
31
+ pageTitle: '{{entityTitle}} details',
32
+ pageTitleKey: '{{moduleId}}.detail.title',
33
+ pageGroup: '{{moduleTitle}}',
34
+ pageGroupKey: '{{moduleId}}.nav.group',
35
+ navHidden: true,
36
+ breadcrumb: [
37
+ { label: '{{moduleTitle}}', labelKey: '{{moduleId}}.nav.title', href: '/backend/{{moduleId}}' },
38
+ { label: 'Details', labelKey: '{{moduleId}}.detail.title' },
39
+ ],
40
+ }
41
+ `;
42
+ export {
43
+ createMetaTemplate,
44
+ detailMetaTemplate,
45
+ listMetaTemplate
46
+ };
47
+ //# sourceMappingURL=metas.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/scaffold/templates/metas.ts"],
4
+ "sourcesContent": ["/**\n * page.meta.ts templates \u2014 nav + RBAC contract copied from\n * packages/core/src/modules/customers/backend/customers/people/page.meta.ts.\n */\n\nexport const listMetaTemplate = `export const metadata = {\n requireAuth: true,\n requireFeatures: ['{{featuresPrefix}}.view'],\n pageTitle: '{{moduleTitle}}',\n pageTitleKey: '{{moduleId}}.nav.title',\n pageGroup: '{{moduleTitle}}',\n pageGroupKey: '{{moduleId}}.nav.group',\n pageOrder: 100,\n icon: 'list',\n breadcrumb: [{ label: '{{moduleTitle}}', labelKey: '{{moduleId}}.nav.title' }],\n}\n`\n\nexport const createMetaTemplate = `export const metadata = {\n requireAuth: true,\n requireFeatures: ['{{featuresPrefix}}.create'],\n pageTitle: 'Create {{entityLower}}',\n pageTitleKey: '{{moduleId}}.create.title',\n pageGroup: '{{moduleTitle}}',\n pageGroupKey: '{{moduleId}}.nav.group',\n pageOrder: 101,\n icon: 'plus',\n breadcrumb: [\n { label: '{{moduleTitle}}', labelKey: '{{moduleId}}.nav.title', href: '/backend/{{moduleId}}' },\n { label: 'Create', labelKey: '{{moduleId}}.create.title' },\n ],\n}\n`\n\nexport const detailMetaTemplate = `export const metadata = {\n requireAuth: true,\n requireFeatures: ['{{featuresPrefix}}.view'],\n pageTitle: '{{entityTitle}} details',\n pageTitleKey: '{{moduleId}}.detail.title',\n pageGroup: '{{moduleTitle}}',\n pageGroupKey: '{{moduleId}}.nav.group',\n navHidden: true,\n breadcrumb: [\n { label: '{{moduleTitle}}', labelKey: '{{moduleId}}.nav.title', href: '/backend/{{moduleId}}' },\n { label: 'Details', labelKey: '{{moduleId}}.detail.title' },\n ],\n}\n`\n"],
5
+ "mappings": "AAKO,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAazB,MAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB3B,MAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }