@baseplate-dev/plugin-auth 2.0.1 → 2.0.3

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 (241) hide show
  1. package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts +88 -3
  2. package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts.map +1 -1
  3. package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts +176 -6
  4. package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts.map +1 -1
  5. package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts +88 -3
  6. package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts.map +1 -1
  7. package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts +176 -6
  8. package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts.map +1 -1
  9. package/dist/auth0/generators/react/react-auth0/generated/index.d.ts +176 -6
  10. package/dist/auth0/generators/react/react-auth0/generated/index.d.ts.map +1 -1
  11. package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts +88 -3
  12. package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts.map +1 -1
  13. package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts +88 -3
  14. package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts.map +1 -1
  15. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +88 -3
  16. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -1
  17. package/dist/local-auth/admin/common.d.ts +4 -0
  18. package/dist/local-auth/admin/common.d.ts.map +1 -0
  19. package/dist/local-auth/admin/common.js +30 -0
  20. package/dist/local-auth/admin/common.js.map +1 -0
  21. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +453 -0
  22. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +1 -0
  23. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +121 -0
  24. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +1 -0
  25. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +457 -0
  26. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +1 -0
  27. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js +9 -0
  28. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js.map +1 -0
  29. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +13 -0
  30. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +1 -0
  31. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +25 -0
  32. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +1 -0
  33. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +235 -0
  34. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +1 -0
  35. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +48 -0
  36. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +1 -0
  37. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +224 -0
  38. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +1 -0
  39. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +29 -0
  40. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +1 -0
  41. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts +2 -0
  42. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts.map +1 -0
  43. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js +2 -0
  44. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js.map +1 -0
  45. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +21 -0
  46. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +1 -0
  47. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.gql +7 -0
  48. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +59 -0
  49. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +1 -0
  50. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +145 -0
  51. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +452 -0
  52. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +1 -0
  53. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +107 -0
  54. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +1 -0
  55. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +457 -0
  56. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +1 -0
  57. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js +9 -0
  58. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js.map +1 -0
  59. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +13 -0
  60. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +1 -0
  61. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +25 -0
  62. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +1 -0
  63. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +235 -0
  64. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +1 -0
  65. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +48 -0
  66. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +1 -0
  67. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +442 -0
  68. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +1 -0
  69. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +31 -0
  70. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +1 -0
  71. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts +2 -0
  72. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts.map +1 -0
  73. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js +2 -0
  74. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js.map +1 -0
  75. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +21 -0
  76. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +1 -0
  77. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql +7 -0
  78. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +73 -0
  79. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +1 -0
  80. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +155 -0
  81. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +221 -0
  82. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +1 -0
  83. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +58 -0
  84. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +1 -0
  85. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts +2 -0
  86. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts.map +1 -0
  87. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js +2 -0
  88. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js.map +1 -0
  89. package/dist/local-auth/admin/node.d.ts +8 -0
  90. package/dist/local-auth/admin/node.d.ts.map +1 -0
  91. package/dist/local-auth/admin/node.js +60 -0
  92. package/dist/local-auth/admin/node.js.map +1 -0
  93. package/dist/local-auth/admin/schema/manage-role-action.d.ts +19 -0
  94. package/dist/local-auth/admin/schema/manage-role-action.d.ts.map +1 -0
  95. package/dist/local-auth/admin/schema/manage-role-action.js +6 -0
  96. package/dist/local-auth/admin/schema/manage-role-action.js.map +1 -0
  97. package/dist/local-auth/admin/schema/reset-password-action.d.ts +19 -0
  98. package/dist/local-auth/admin/schema/reset-password-action.d.ts.map +1 -0
  99. package/dist/local-auth/admin/schema/reset-password-action.js +6 -0
  100. package/dist/local-auth/admin/schema/reset-password-action.js.map +1 -0
  101. package/dist/local-auth/admin/schema/roles-column.d.ts +19 -0
  102. package/dist/local-auth/admin/schema/roles-column.d.ts.map +1 -0
  103. package/dist/local-auth/admin/schema/roles-column.js +6 -0
  104. package/dist/local-auth/admin/schema/roles-column.js.map +1 -0
  105. package/dist/local-auth/admin/web.d.ts +6 -0
  106. package/dist/local-auth/admin/web.d.ts.map +1 -0
  107. package/dist/local-auth/admin/web.js +43 -0
  108. package/dist/local-auth/admin/web.js.map +1 -0
  109. package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +1 -1
  110. package/dist/local-auth/core/components/local-auth-definition-editor.js +5 -2
  111. package/dist/local-auth/core/components/local-auth-definition-editor.js.map +1 -1
  112. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +5 -1
  113. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -1
  114. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +20 -5
  115. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -1
  116. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +4 -1
  117. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -1
  118. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +8 -2
  119. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -1
  120. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +1 -1
  121. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -1
  122. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +40 -1
  123. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -1
  124. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +47 -0
  125. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +31 -0
  126. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -1
  127. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +97 -1
  128. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -1
  129. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +133 -0
  130. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +2 -1
  131. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -1
  132. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +9 -3
  133. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -1
  134. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +26 -0
  135. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -1
  136. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +2 -0
  137. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -1
  138. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +2 -0
  139. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +1 -1
  140. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -1
  141. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +1 -0
  142. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +1 -1
  143. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +52 -0
  144. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -1
  145. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +28 -0
  146. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -1
  147. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts +2 -0
  148. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts.map +1 -0
  149. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js +23 -0
  150. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js.map +1 -0
  151. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts +26 -0
  152. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts +15 -0
  153. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts.map +1 -0
  154. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js +35 -0
  155. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js.map +1 -0
  156. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts +47 -0
  157. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +88 -3
  158. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -1
  159. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +264 -9
  160. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -1
  161. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +88 -3
  162. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -1
  163. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +352 -12
  164. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
  165. package/dist/local-auth/core/generators/react-session/generated/index.d.ts +176 -6
  166. package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +1 -1
  167. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +88 -3
  168. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -1
  169. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +176 -6
  170. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -1
  171. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +88 -3
  172. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -1
  173. package/dist/local-auth/core/node.d.ts.map +1 -1
  174. package/dist/local-auth/core/node.js +5 -1
  175. package/dist/local-auth/core/node.js.map +1 -1
  176. package/dist/local-auth/core/schema/plugin-definition.d.ts +3 -0
  177. package/dist/local-auth/core/schema/plugin-definition.d.ts.map +1 -1
  178. package/dist/local-auth/core/schema/plugin-definition.js +4 -0
  179. package/dist/local-auth/core/schema/plugin-definition.js.map +1 -1
  180. package/dist/local-auth/plugin.json +1 -1
  181. package/dist/web/assets/{__federation_expose_auth0CoreCommon-lV5QSzvf.js → __federation_expose_auth0CoreCommon-Dd4OxG3J.js} +3 -3
  182. package/dist/web/assets/{__federation_expose_auth0CoreCommon-lV5QSzvf.js.map → __federation_expose_auth0CoreCommon-Dd4OxG3J.js.map} +1 -1
  183. package/dist/web/assets/{__federation_expose_auth0CoreWeb-5F0rTNis.js → __federation_expose_auth0CoreWeb-C_de43BE.js} +5 -5
  184. package/dist/web/assets/{__federation_expose_auth0CoreWeb-5F0rTNis.js.map → __federation_expose_auth0CoreWeb-C_de43BE.js.map} +1 -1
  185. package/dist/web/assets/{__federation_expose_authCoreCommon-C5cVmNCH.js → __federation_expose_authCoreCommon-BAF30G9e.js} +3 -3
  186. package/dist/web/assets/{__federation_expose_authCoreCommon-C5cVmNCH.js.map → __federation_expose_authCoreCommon-BAF30G9e.js.map} +1 -1
  187. package/dist/web/assets/{__federation_expose_authCoreWeb-CJxY8hZC.js → __federation_expose_authCoreWeb-B26BFarY.js} +6 -6
  188. package/dist/web/assets/{__federation_expose_authCoreWeb-CJxY8hZC.js.map → __federation_expose_authCoreWeb-B26BFarY.js.map} +1 -1
  189. package/dist/web/assets/__federation_expose_local-authAdminCommon-DLbuTALX.js +64 -0
  190. package/dist/web/assets/__federation_expose_local-authAdminCommon-DLbuTALX.js.map +1 -0
  191. package/dist/web/assets/__federation_expose_local-authAdminWeb-bT8Js4V6.js +58 -0
  192. package/dist/web/assets/__federation_expose_local-authAdminWeb-bT8Js4V6.js.map +1 -0
  193. package/dist/web/assets/{__federation_expose_local-authCoreCommon-Dr_ngV2l.js → __federation_expose_local-authCoreCommon-D9tovFrj.js} +3 -3
  194. package/dist/web/assets/{__federation_expose_local-authCoreCommon-Dr_ngV2l.js.map → __federation_expose_local-authCoreCommon-D9tovFrj.js.map} +1 -1
  195. package/dist/web/assets/{__federation_expose_local-authCoreWeb-B5iBudnh.js → __federation_expose_local-authCoreWeb-DKVkRzEo.js} +24 -7
  196. package/dist/web/assets/__federation_expose_local-authCoreWeb-DKVkRzEo.js.map +1 -0
  197. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-l8knzO7I.js → __federation_expose_placeholder-authCoreCommon-D1fszuKq.js} +3 -3
  198. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-l8knzO7I.js.map → __federation_expose_placeholder-authCoreCommon-D1fszuKq.js.map} +1 -1
  199. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-DbI_bZsk.js → __federation_expose_placeholder-authCoreWeb-tw3UiMLM.js} +5 -5
  200. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-DbI_bZsk.js.map → __federation_expose_placeholder-authCoreWeb-tw3UiMLM.js.map} +1 -1
  201. package/dist/web/assets/{__federation_fn_import-DReOsou_.js → __federation_fn_import-B_QMlAIe.js} +2 -2
  202. package/dist/web/assets/{__federation_fn_import-DReOsou_.js.map → __federation_fn_import-B_QMlAIe.js.map} +1 -1
  203. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BlPKO2K7.js → web-DdrB9jrq.js} +74 -6
  204. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-DdrB9jrq.js.map +1 -0
  205. package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CGEZr0YI.js → project-builder-lib-BvG5Zcxb.js} +567 -184
  206. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BvG5Zcxb.js.map +1 -0
  207. package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-RO_rk4f0.js → ui-components-CjIA8Av2.js} +873 -624
  208. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-CjIA8Av2.js.map +1 -0
  209. package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BbU_EX7_.js → utils-LpAGNm5N.js} +2 -2
  210. package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BbU_EX7_.js.map → utils-LpAGNm5N.js.map} +1 -1
  211. package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNTPQj7N.js → react-router-CEcQRiV1.js} +2 -2
  212. package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNTPQj7N.js.map → react-router-CEcQRiV1.js.map} +1 -1
  213. package/dist/web/assets/{get-auth-plugin-definition-CQ6mWMZk.js → get-auth-plugin-definition-BrApugiB.js} +2 -2
  214. package/dist/web/assets/{get-auth-plugin-definition-CQ6mWMZk.js.map → get-auth-plugin-definition-BrApugiB.js.map} +1 -1
  215. package/dist/web/assets/{index-BkOJzK_m.js → index-DAcyTb_o.js} +5 -3
  216. package/dist/web/assets/{index-BkOJzK_m.js.map → index-DAcyTb_o.js.map} +1 -1
  217. package/dist/web/assets/{index.esm-UnRzlLlr.js → index.esm-BFQQfZNu.js} +2 -2
  218. package/dist/web/assets/{index.esm-UnRzlLlr.js.map → index.esm-BFQQfZNu.js.map} +1 -1
  219. package/dist/web/assets/{model-merger-BLEOsCIp.js → model-merger-boZDknXa.js} +11 -4
  220. package/dist/web/assets/model-merger-boZDknXa.js.map +1 -0
  221. package/dist/web/assets/{plugin-definition-PCHsX2lR.js → plugin-definition-B7A-hS1o.js} +2 -2
  222. package/dist/web/assets/{plugin-definition-PCHsX2lR.js.map → plugin-definition-B7A-hS1o.js.map} +1 -1
  223. package/dist/web/assets/{plugin-definition-ChUKIqUg.js → plugin-definition-BeK0C-OP.js} +11 -2
  224. package/dist/web/assets/plugin-definition-BeK0C-OP.js.map +1 -0
  225. package/dist/web/assets/{plugin-definition-DH4QyCfv.js → plugin-definition-CyqVivit.js} +2 -2
  226. package/dist/web/assets/{plugin-definition-DH4QyCfv.js.map → plugin-definition-CyqVivit.js.map} +1 -1
  227. package/dist/web/assets/{plugin-definition-C935Xf1h.js → plugin-definition-DfsGhMRb.js} +2 -2
  228. package/dist/web/assets/{plugin-definition-C935Xf1h.js.map → plugin-definition-DfsGhMRb.js.map} +1 -1
  229. package/dist/web/assets/{react-ecPihYHK.js → react-CKjL52W8.js} +2 -2
  230. package/dist/web/assets/{react-ecPihYHK.js.map → react-CKjL52W8.js.map} +1 -1
  231. package/dist/web/assets/remoteEntry.js +14 -8
  232. package/dist/web/assets/remoteEntry.js.map +1 -1
  233. package/dist/web/assets/{styles-I6mpdfRm.js → styles-CyTaudys.js} +3 -3
  234. package/dist/web/assets/{styles-I6mpdfRm.js.map → styles-CyTaudys.js.map} +1 -1
  235. package/package.json +12 -12
  236. package/dist/web/assets/__federation_expose_local-authCoreWeb-B5iBudnh.js.map +0 -1
  237. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BlPKO2K7.js.map +0 -1
  238. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CGEZr0YI.js.map +0 -1
  239. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-RO_rk4f0.js.map +0 -1
  240. package/dist/web/assets/model-merger-BLEOsCIp.js.map +0 -1
  241. package/dist/web/assets/plugin-definition-ChUKIqUg.js.map +0 -1
@@ -1,9 +1,71 @@
1
- import { c as createPluginSpec, m as mapValues, a as createEntityType, d as definitionSchema, D as DefinitionReferenceMarker, g as get, R as REF_ANNOTATIONS_MARKER_SYMBOL, b as createDefinitionSchemaParserContext, s as set$1, e as modelForeignRelationEntityType, f as modelLocalRelationEntityType, h as modelScalarFieldEntityType, i as modelTransformerEntityType, j as modelEntityType, k as modelEnumValueEntityType, l as featureEntityType, n as modelEnumEntityType, o as modelUniqueConstraintEntityType, p as createFeaturesSchema, M as ModelUtils, q as omit, r as cloneDeep } from '../model-merger-BLEOsCIp.js';
2
- export { I as DefinitionDiffArrayIncludesField, G as DefinitionDiffKeyedArrayField, H as DefinitionDiffReplacementField, u as DefinitionEntityType, F as FeatureUtils, L as applyDefinitionDiff, B as applyModelMergerDiff, C as applyModelMergerResultInPlace, E as createAndApplyModelMergerResults, K as createDefinitionDiff, J as createDefinitionDiffConfig, w as createFeatureSchema, t as createInitializedPluginSpec, y as createModelMergerResult, A as createModelMergerResults, z as doesModelMergerResultsHaveChanges, v as featureNameSchema, x as modelMergerDefinitionDiffConfig } from '../model-merger-BLEOsCIp.js';
3
- import { importShared } from '../__federation_fn_import-DReOsou_.js';
1
+ import { c as createPluginSpec, m as mapValues, a as createEntityType, d as definitionSchema, D as DefinitionReferenceMarker, g as get, R as REF_ANNOTATIONS_MARKER_SYMBOL, b as createDefinitionSchemaParserContext, s as set$1, e as modelForeignRelationEntityType, f as modelLocalRelationEntityType, h as modelScalarFieldEntityType, i as modelTransformerEntityType, j as modelEntityType, k as modelEnumValueEntityType, l as featureEntityType, n as modelEnumEntityType, o as modelUniqueConstraintEntityType, p as createFeaturesSchema, M as ModelUtils, q as omit, r as cloneDeep } from '../model-merger-boZDknXa.js';
2
+ export { I as DefinitionDiffArrayIncludesField, G as DefinitionDiffKeyedArrayField, H as DefinitionDiffReplacementField, u as DefinitionEntityType, F as FeatureUtils, L as applyDefinitionDiff, B as applyModelMergerDiff, C as applyModelMergerResultInPlace, E as createAndApplyModelMergerResults, K as createDefinitionDiff, J as createDefinitionDiffConfig, w as createFeatureSchema, t as createInitializedPluginSpec, y as createModelMergerResult, A as createModelMergerResults, z as doesModelMergerResultsHaveChanges, v as featureNameSchema, x as modelMergerDefinitionDiffConfig } from '../model-merger-boZDknXa.js';
3
+ import { importShared } from '../__federation_fn_import-B_QMlAIe.js';
4
4
  import { i as isEqual } from '../isEqual-DAXqKRba.js';
5
5
  import { s as sortBy } from '../sortBy-BPH_zRB8.js';
6
6
 
7
+ function createAdminCrudActionCompilerImplementation() {
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ const actions = new Map();
10
+ return {
11
+ registerCompiler(action) {
12
+ if (actions.has(action.name)) {
13
+ throw new Error(`Admin CRUD action with name ${action.name} is already registered`);
14
+ }
15
+ actions.set(action.name, action);
16
+ },
17
+ getCompiler(name, builtInActions = []) {
18
+ const builtInAction = builtInActions.find((b) => b.name === name);
19
+ if (builtInAction) {
20
+ return builtInAction;
21
+ }
22
+ const action = actions.get(name);
23
+ if (!action) {
24
+ throw new Error(`Unable to find action with name ${name}`);
25
+ }
26
+ return action;
27
+ },
28
+ };
29
+ }
30
+ /**
31
+ * Spec for adding config component for plugin
32
+ */
33
+ const adminCrudActionCompilerSpec = createPluginSpec('core/admin-crud-action-compiler', { defaultInitializer: createAdminCrudActionCompilerImplementation });
34
+
35
+ function createAdminCrudColumnCompiler(input) {
36
+ return input;
37
+ }
38
+ function createAdminCrudColumnCompilerImplementation() {
39
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+ const columns = new Map();
41
+ return {
42
+ registerCompiler(column) {
43
+ if (columns.has(column.name)) {
44
+ throw new Error(`Admin CRUD column with name ${column.name} is already registered`);
45
+ }
46
+ columns.set(column.name, column);
47
+ },
48
+ getCompiler(type, builtInColumns = []) {
49
+ const builtInColumn = builtInColumns.find((b) => b.name === type);
50
+ if (builtInColumn) {
51
+ return builtInColumn;
52
+ }
53
+ const column = columns.get(type);
54
+ if (!column) {
55
+ throw new Error(`Unable to find column with type ${type}`);
56
+ }
57
+ return column;
58
+ },
59
+ getColumnCompilers() {
60
+ return columns;
61
+ },
62
+ };
63
+ }
64
+ /**
65
+ * Spec for adding column compilers
66
+ */
67
+ const adminCrudColumnCompilerSpec = createPluginSpec('core/admin-crud-column-compiler', { defaultInitializer: createAdminCrudColumnCompilerImplementation });
68
+
7
69
  function createAdminCrudInputCompilerImplementation() {
8
70
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
71
  const inputs = new Map();
@@ -254,45 +316,45 @@ function getManagedPluginsForPlugin(pluginStore, pluginKey) {
254
316
  .map((p) => p.metadata);
255
317
  }
256
318
 
257
- const {z: z$k} = await importShared('zod');
319
+ const {z: z$o} = await importShared('zod');
258
320
 
259
321
  // matches semver
260
- const versionSchema = z$k.string().regex(/^(\d+\.\d+\.\d+)$/);
261
- const pluginSpecSupportSchema = z$k.object({
262
- spec: z$k.string().min(1),
263
- version: z$k.string().min(1),
322
+ const versionSchema = z$o.string().regex(/^(\d+\.\d+\.\d+)$/);
323
+ const pluginSpecSupportSchema = z$o.object({
324
+ spec: z$o.string().min(1),
325
+ version: z$o.string().min(1),
264
326
  });
265
- const pluginSpecDependencySchema = z$k.object({
266
- spec: z$k.string(),
267
- version: z$k.string(),
327
+ const pluginSpecDependencySchema = z$o.object({
328
+ spec: z$o.string(),
329
+ version: z$o.string(),
268
330
  });
269
331
  /**
270
332
  * Schema for the plugin's metadata (plugin.json)
271
333
  */
272
- const pluginMetadataSchema = z$k.object({
334
+ const pluginMetadataSchema = z$o.object({
273
335
  /**
274
336
  * The name of the plugin - must be lowercase and contain only letters, numbers, and hyphens
275
337
  */
276
- name: z$k
338
+ name: z$o
277
339
  .string()
278
340
  .min(1)
279
341
  .regex(/^[a-z0-9-]+$/),
280
342
  /**
281
343
  * A list of directories with entrypoints in them. Defaults to ['.']
282
344
  */
283
- moduleDirectories: z$k.array(z$k.string()).optional(),
345
+ moduleDirectories: z$o.array(z$o.string()).optional(),
284
346
  /**
285
347
  * The display name of the plugin
286
348
  */
287
- displayName: z$k.string().min(1),
349
+ displayName: z$o.string().min(1),
288
350
  /**
289
351
  * The icon to display for the plugin as a pointer to the icon in the plugin's static folder
290
352
  */
291
- icon: z$k.string().optional(),
353
+ icon: z$o.string().optional(),
292
354
  /**
293
355
  * A description of the plugin
294
356
  */
295
- description: z$k.string(),
357
+ description: z$o.string(),
296
358
  /**
297
359
  * The fully qualified name of the plugin that manages this plugin,
298
360
  * e.g. "@baseplate-dev/plugin-auth:auth0" would be managed by the "@baseplate-dev/plugin-auth:auth" plugin.
@@ -300,7 +362,7 @@ const pluginMetadataSchema = z$k.object({
300
362
  * Managed plugins do not appear in the plugin list but are managed by the base plugin. If the base
301
363
  * plugin is disabled, the managed plugins will also be disabled.
302
364
  */
303
- managedBy: z$k.string().optional(),
365
+ managedBy: z$o.string().optional(),
304
366
  /**
305
367
  * The version of the plugin using semver
306
368
  */
@@ -308,16 +370,16 @@ const pluginMetadataSchema = z$k.object({
308
370
  /**
309
371
  * Configuration for the specs that the plugin exports/depends on
310
372
  */
311
- specs: z$k
373
+ specs: z$o
312
374
  .object({
313
375
  /**
314
376
  * The specs that the plugin exports
315
377
  */
316
- exports: z$k.array(pluginSpecSupportSchema).optional(),
378
+ exports: z$o.array(pluginSpecSupportSchema).optional(),
317
379
  /**
318
380
  * The specs that the plugin depends on
319
381
  */
320
- dependencies: z$k.array(pluginSpecDependencySchema).optional(),
382
+ dependencies: z$o.array(pluginSpecDependencySchema).optional(),
321
383
  })
322
384
  .optional(),
323
385
  /**
@@ -325,7 +387,7 @@ const pluginMetadataSchema = z$k.object({
325
387
  *
326
388
  * (It can be used once in the definition but cannot be added)
327
389
  */
328
- hidden: z$k.boolean().optional(),
390
+ hidden: z$o.boolean().optional(),
329
391
  });
330
392
 
331
393
  var NOTHING = Symbol.for("immer-nothing");
@@ -1771,30 +1833,30 @@ function createAppEntryType(name) {
1771
1833
 
1772
1834
  const {CASE_VALIDATORS: CASE_VALIDATORS$1} = await importShared('@baseplate-dev/utils');
1773
1835
 
1774
- const {z: z$j} = await importShared('zod');
1836
+ const {z: z$n} = await importShared('zod');
1775
1837
  const baseAppValidators = {
1776
- id: z$j.string().default(appEntityType.generateNewId()),
1838
+ id: z$n.string().default(appEntityType.generateNewId()),
1777
1839
  name: CASE_VALIDATORS$1.KEBAB_CASE,
1778
- type: z$j.string(),
1779
- packageLocation: z$j
1840
+ type: z$n.string(),
1841
+ packageLocation: z$n
1780
1842
  .string()
1781
1843
  .regex(/^(?!.*(?:\/|\.\.)\/)(?!^\.\.$)(?!^\.$)(?:[\w\-.]+\/?)+[\w\-.]*|^$/, {
1782
1844
  message: 'Invalid package location. Must be a valid subdirectory.',
1783
1845
  })
1784
1846
  .optional(),
1785
1847
  };
1786
- const baseAppSchema = z$j.object(baseAppValidators);
1848
+ const baseAppSchema = z$n.object(baseAppValidators);
1787
1849
 
1788
- const {z: z$i} = await importShared('zod');
1789
- const createBackendAppSchema = definitionSchema(() => z$i.object({
1850
+ const {z: z$m} = await importShared('zod');
1851
+ const createBackendAppSchema = definitionSchema(() => z$m.object({
1790
1852
  ...baseAppValidators,
1791
- type: z$i.literal('backend'),
1792
- enableStripe: z$i.boolean().optional(),
1793
- enableRedis: z$i.boolean().optional(),
1794
- enableBullQueue: z$i.boolean().optional(),
1795
- enablePostmark: z$i.boolean().optional(),
1796
- enableSubscriptions: z$i.boolean().optional(),
1797
- enableAxios: z$i.boolean().optional(),
1853
+ type: z$m.literal('backend'),
1854
+ enableStripe: z$m.boolean().optional(),
1855
+ enableRedis: z$m.boolean().optional(),
1856
+ enableBullQueue: z$m.boolean().optional(),
1857
+ enablePostmark: z$m.boolean().optional(),
1858
+ enableSubscriptions: z$m.boolean().optional(),
1859
+ enableAxios: z$m.boolean().optional(),
1798
1860
  }));
1799
1861
  const backendAppEntryType = createAppEntryType('backend');
1800
1862
 
@@ -2012,8 +2074,12 @@ class DefinitionRefBuilder {
2012
2074
  }
2013
2075
  // Resolve the name: if getNameResolver is provided, use it to build the name resolver; otherwise,
2014
2076
  // use the default name resolver.
2015
- const getNameResolver = entity.getNameResolver ?? ((value) => get(value, 'name'));
2077
+ const getNameResolver = entity.getNameResolver ??
2078
+ ((value) => get(value, 'name'));
2016
2079
  const nameResolver = getNameResolver(stripRefMarkers(this.data));
2080
+ if (!nameResolver) {
2081
+ throw new Error(`No name resolver found for entity ${entity.type.name} at ${path.join('.')}`);
2082
+ }
2017
2083
  // Base entity definition shared between regular entities and those with a name reference.
2018
2084
  const entityBase = {
2019
2085
  id,
@@ -2425,141 +2491,141 @@ const SCALAR_FIELD_TYPES = [
2425
2491
  'enum',
2426
2492
  ];
2427
2493
 
2428
- const {z: z$h} = await importShared('zod');
2429
- const oklchColor = z$h
2494
+ const {z: z$l} = await importShared('zod');
2495
+ const oklchColor = z$l
2430
2496
  .string()
2431
2497
  .regex(/^oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\s*\)$/, {
2432
2498
  message: 'OKLCH color must be of the format "oklch(l c h [/ a])" where l and c are between 0 and 1 and h is between 0 and 360 and a is between 0 and 100',
2433
2499
  });
2434
- const themeColorSchema = z$h.record(z$h.enum(THEME_COLOR_KEYS), oklchColor);
2435
- const paletteSchema = z$h
2500
+ const themeColorSchema = z$l.record(z$l.enum(THEME_COLOR_KEYS), oklchColor);
2501
+ const paletteSchema = z$l
2436
2502
  .object({
2437
- paletteName: z$h.string().min(1),
2503
+ paletteName: z$l.string().min(1),
2438
2504
  customBase: oklchColor.nullish(),
2439
- shades: z$h.record(z$h.enum(PALETTE_SHADES), oklchColor),
2505
+ shades: z$l.record(z$l.enum(PALETTE_SHADES), oklchColor),
2440
2506
  })
2441
2507
  .refine((data) => data.paletteName !== 'custom' || !!data.paletteName, {
2442
2508
  message: 'A custom base color is required if using a custom base palette',
2443
2509
  path: ['customBase'],
2444
2510
  });
2445
- const palettesSchema = z$h.object({
2511
+ const palettesSchema = z$l.object({
2446
2512
  base: paletteSchema,
2447
2513
  primary: paletteSchema,
2448
2514
  });
2449
- const createThemeSchema = definitionSchema(() => z$h.object({
2450
- palettes: z$h.object({
2515
+ const createThemeSchema = definitionSchema(() => z$l.object({
2516
+ palettes: z$l.object({
2451
2517
  base: paletteSchema,
2452
2518
  primary: paletteSchema,
2453
2519
  }),
2454
- colors: z$h.object({
2520
+ colors: z$l.object({
2455
2521
  light: themeColorSchema,
2456
2522
  dark: themeColorSchema,
2457
2523
  }),
2458
2524
  }));
2459
2525
 
2460
- const {z: z$g} = await importShared('zod');
2526
+ const {z: z$k} = await importShared('zod');
2461
2527
 
2462
2528
  const VALIDATORS = {
2463
- PASCAL_CASE_STRING: z$g
2529
+ PASCAL_CASE_STRING: z$k
2464
2530
  .string()
2465
2531
  .regex(/^[A-Z][a-zA-Z0-9]*$/, "Should be PascalCase, e.g. 'MyModel'"),
2466
- CAMEL_CASE_STRING: z$g
2532
+ CAMEL_CASE_STRING: z$k
2467
2533
  .string()
2468
2534
  .regex(/^[a-z][a-zA-Z0-9]*$/, "Should be camelCase, e.g. 'myField'"),
2469
- CONSTANT_CASE_STRING: z$g
2535
+ CONSTANT_CASE_STRING: z$k
2470
2536
  .string()
2471
2537
  .regex(/^[A-Z][A-Z0-9_]*$/, "Should be CONSTANT_CASE, e.g. 'MY_CONSTANT'"),
2472
- OPTIONAL_CONSTANT_CASE_STRING: z$g
2538
+ OPTIONAL_CONSTANT_CASE_STRING: z$k
2473
2539
  .string()
2474
2540
  .regex(/^[A-Z][A-Z0-9_]*$/, "Should be CONSTANT_CASE, e.g. 'MY_CONSTANT'")
2475
- .or(z$g.literal(''))
2541
+ .or(z$k.literal(''))
2476
2542
  .optional(),
2477
2543
  };
2478
2544
 
2479
- const {z: z$f} = await importShared('zod');
2480
- const createRoleArray = definitionSchema((ctx) => ctx.withDefault(z$f.array(ctx.withRef({
2545
+ const {z: z$j} = await importShared('zod');
2546
+ const createRoleArray = definitionSchema((ctx) => ctx.withDefault(z$j.array(ctx.withRef({
2481
2547
  type: authRoleEntityType,
2482
2548
  onDelete: 'DELETE',
2483
2549
  })), []));
2484
- const createModelGraphqlSchema = definitionSchema((ctx) => z$f.object({
2485
- objectType: ctx.withDefault(z$f.object({
2486
- enabled: ctx.withDefault(z$f.boolean(), false),
2487
- fields: ctx.withDefault(z$f.array(ctx.withRef({
2550
+ const createModelGraphqlSchema = definitionSchema((ctx) => z$j.object({
2551
+ objectType: ctx.withDefault(z$j.object({
2552
+ enabled: ctx.withDefault(z$j.boolean(), false),
2553
+ fields: ctx.withDefault(z$j.array(ctx.withRef({
2488
2554
  type: modelScalarFieldEntityType,
2489
2555
  onDelete: 'DELETE',
2490
2556
  parentPath: { context: 'model' },
2491
2557
  })), []),
2492
- localRelations: ctx.withDefault(z$f.array(ctx.withRef({
2558
+ localRelations: ctx.withDefault(z$j.array(ctx.withRef({
2493
2559
  type: modelLocalRelationEntityType,
2494
2560
  onDelete: 'DELETE',
2495
2561
  parentPath: { context: 'model' },
2496
2562
  })), []),
2497
- foreignRelations: ctx.withDefault(z$f.array(ctx.withRef({
2563
+ foreignRelations: ctx.withDefault(z$j.array(ctx.withRef({
2498
2564
  type: modelForeignRelationEntityType,
2499
2565
  onDelete: 'DELETE',
2500
2566
  parentPath: { context: 'model' },
2501
2567
  })), []),
2502
2568
  }), {}),
2503
- queries: ctx.withDefault(z$f.object({
2504
- get: ctx.withDefault(z$f.object({
2505
- enabled: ctx.withDefault(z$f.boolean(), false),
2569
+ queries: ctx.withDefault(z$j.object({
2570
+ get: ctx.withDefault(z$j.object({
2571
+ enabled: ctx.withDefault(z$j.boolean(), false),
2506
2572
  roles: createRoleArray(ctx),
2507
2573
  }), {}),
2508
- list: ctx.withDefault(z$f.object({
2509
- enabled: ctx.withDefault(z$f.boolean(), false),
2574
+ list: ctx.withDefault(z$j.object({
2575
+ enabled: ctx.withDefault(z$j.boolean(), false),
2510
2576
  roles: createRoleArray(ctx),
2511
2577
  }), {}),
2512
2578
  }), {}),
2513
- mutations: ctx.withDefault(z$f.object({
2514
- create: ctx.withDefault(z$f.object({
2515
- enabled: ctx.withDefault(z$f.boolean(), false),
2579
+ mutations: ctx.withDefault(z$j.object({
2580
+ create: ctx.withDefault(z$j.object({
2581
+ enabled: ctx.withDefault(z$j.boolean(), false),
2516
2582
  roles: createRoleArray(ctx),
2517
2583
  }), {}),
2518
- update: ctx.withDefault(z$f.object({
2519
- enabled: ctx.withDefault(z$f.boolean(), false),
2584
+ update: ctx.withDefault(z$j.object({
2585
+ enabled: ctx.withDefault(z$j.boolean(), false),
2520
2586
  roles: createRoleArray(ctx),
2521
2587
  }), {}),
2522
- delete: ctx.withDefault(z$f.object({
2523
- enabled: ctx.withDefault(z$f.boolean(), false),
2588
+ delete: ctx.withDefault(z$j.object({
2589
+ enabled: ctx.withDefault(z$j.boolean(), false),
2524
2590
  roles: createRoleArray(ctx),
2525
2591
  }), {}),
2526
2592
  }), {}),
2527
2593
  }));
2528
2594
 
2529
- const {z: z$e} = await importShared('zod');
2595
+ const {z: z$i} = await importShared('zod');
2530
2596
 
2531
2597
  const baseTransformerFields = {
2532
- id: z$e.string(),
2533
- type: z$e.string().min(1),
2598
+ id: z$i.string(),
2599
+ type: z$i.string().min(1),
2534
2600
  };
2535
- const baseTransformerSchema = z$e.object(baseTransformerFields);
2601
+ const baseTransformerSchema = z$i.object(baseTransformerFields);
2536
2602
  function createModelTransformerType(payload) {
2537
2603
  return payload;
2538
2604
  }
2539
2605
 
2540
- const {z: z$d} = await importShared('zod');
2541
- const createPasswordTransformerSchema = definitionSchema((ctx) => ctx.withEnt(z$d.object({
2606
+ const {z: z$h} = await importShared('zod');
2607
+ const createPasswordTransformerSchema = definitionSchema((ctx) => ctx.withEnt(z$h.object({
2542
2608
  ...baseTransformerFields,
2543
- type: z$d.literal('password'),
2609
+ type: z$h.literal('password'),
2544
2610
  }), {
2545
2611
  type: modelTransformerEntityType,
2546
2612
  parentPath: { context: 'model' },
2547
2613
  getNameResolver: () => 'password',
2548
2614
  }));
2549
- const createEmbeddedRelationTransformerSchema = definitionSchema((ctx) => ctx.withRefBuilder(ctx.withEnt(z$d.object({
2615
+ const createEmbeddedRelationTransformerSchema = definitionSchema((ctx) => ctx.withRefBuilder(ctx.withEnt(z$h.object({
2550
2616
  ...baseTransformerFields,
2551
2617
  foreignRelationRef: ctx.withRef({
2552
2618
  type: modelForeignRelationEntityType,
2553
2619
  onDelete: 'DELETE_PARENT',
2554
2620
  parentPath: { context: 'model' },
2555
2621
  }),
2556
- type: z$d.literal('embeddedRelation'),
2557
- embeddedFieldNames: z$d.array(ctx.withRef({
2622
+ type: z$h.literal('embeddedRelation'),
2623
+ embeddedFieldNames: z$h.array(ctx.withRef({
2558
2624
  type: modelScalarFieldEntityType,
2559
2625
  onDelete: 'RESTRICT',
2560
2626
  parentPath: { context: 'embeddedModel' },
2561
2627
  })),
2562
- embeddedTransformerNames: z$d
2628
+ embeddedTransformerNames: z$h
2563
2629
  .array(ctx.withRef({
2564
2630
  type: modelTransformerEntityType,
2565
2631
  onDelete: 'RESTRICT',
@@ -2639,46 +2705,46 @@ const createTransformerSchema = definitionSchema((ctx) => baseTransformerSchema.
2639
2705
  });
2640
2706
  }));
2641
2707
 
2642
- const {z: z$c} = await importShared('zod');
2643
- const createEnumValueSchema = definitionSchema((ctx) => ctx.withEnt(z$c.object({
2644
- id: z$c.string(),
2645
- name: z$c.string().min(1),
2646
- friendlyName: z$c.string().min(1),
2708
+ const {z: z$g} = await importShared('zod');
2709
+ const createEnumValueSchema = definitionSchema((ctx) => ctx.withEnt(z$g.object({
2710
+ id: z$g.string(),
2711
+ name: z$g.string().min(1),
2712
+ friendlyName: z$g.string().min(1),
2647
2713
  }), {
2648
2714
  type: modelEnumValueEntityType,
2649
2715
  parentPath: { context: 'enum' },
2650
2716
  }));
2651
- const createEnumBaseSchema = definitionSchema((ctx) => z$c.object({
2652
- id: z$c.string(),
2653
- name: z$c.string().min(1),
2717
+ const createEnumBaseSchema = definitionSchema((ctx) => z$g.object({
2718
+ id: z$g.string(),
2719
+ name: z$g.string().min(1),
2654
2720
  featureRef: ctx.withRef({
2655
2721
  type: featureEntityType,
2656
2722
  onDelete: 'RESTRICT',
2657
2723
  }),
2658
- values: z$c.array(createEnumValueSchema(ctx)),
2659
- isExposed: z$c.boolean(),
2724
+ values: z$g.array(createEnumValueSchema(ctx)),
2725
+ isExposed: z$g.boolean(),
2660
2726
  }));
2661
2727
  const createEnumSchema = definitionSchema((ctx) => ctx.withEnt(createEnumBaseSchema(ctx), {
2662
2728
  type: modelEnumEntityType,
2663
2729
  addContext: 'enum',
2664
2730
  }));
2665
2731
 
2666
- const {z: z$b} = await importShared('zod');
2732
+ const {z: z$f} = await importShared('zod');
2667
2733
  const createModelScalarFieldSchema = definitionSchema((ctx) => ctx
2668
- .withEnt(z$b.object({
2669
- id: z$b.string(),
2734
+ .withEnt(z$f.object({
2735
+ id: z$f.string(),
2670
2736
  name: VALIDATORS.CAMEL_CASE_STRING,
2671
- type: z$b.enum(SCALAR_FIELD_TYPES),
2672
- isOptional: z$b.boolean().default(false),
2673
- options: ctx.withRefBuilder(z$b
2737
+ type: z$f.enum(SCALAR_FIELD_TYPES),
2738
+ isOptional: z$f.boolean().default(false),
2739
+ options: ctx.withRefBuilder(z$f
2674
2740
  .object({
2675
2741
  // string options
2676
- default: z$b.string().default(''),
2742
+ default: z$f.string().default(''),
2677
2743
  // uuid options
2678
- genUuid: z$b.boolean().optional(),
2744
+ genUuid: z$f.boolean().optional(),
2679
2745
  // date options
2680
- updatedAt: z$b.boolean().optional(),
2681
- defaultToNow: z$b.boolean().optional(),
2746
+ updatedAt: z$f.boolean().optional(),
2747
+ defaultToNow: z$f.boolean().optional(),
2682
2748
  // enum options
2683
2749
  enumRef: ctx
2684
2750
  .withRef({
@@ -2686,7 +2752,7 @@ const createModelScalarFieldSchema = definitionSchema((ctx) => ctx
2686
2752
  onDelete: 'RESTRICT',
2687
2753
  })
2688
2754
  .optional(),
2689
- defaultEnumValueRef: z$b.string().optional(),
2755
+ defaultEnumValueRef: z$f.string().optional(),
2690
2756
  })
2691
2757
  .transform((val) => ({
2692
2758
  ...val,
@@ -2738,13 +2804,13 @@ const REFERENTIAL_ACTIONS = [
2738
2804
  'SetNull',
2739
2805
  'SetDefault',
2740
2806
  ];
2741
- const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$b.object({
2742
- id: z$b.string(),
2743
- foreignId: z$b
2807
+ const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$f.object({
2808
+ id: z$f.string(),
2809
+ foreignId: z$f
2744
2810
  .string()
2745
2811
  .default(() => modelForeignRelationEntityType.generateNewId()),
2746
2812
  name: VALIDATORS.CAMEL_CASE_STRING,
2747
- references: z$b.array(z$b.object({
2813
+ references: z$f.array(z$f.object({
2748
2814
  localRef: ctx.withRef({
2749
2815
  type: modelScalarFieldEntityType,
2750
2816
  onDelete: 'RESTRICT',
@@ -2756,10 +2822,10 @@ const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuil
2756
2822
  parentPath: { context: 'foreignModel' },
2757
2823
  }),
2758
2824
  })),
2759
- modelRef: z$b.string().min(1),
2825
+ modelRef: z$f.string().min(1),
2760
2826
  foreignRelationName: VALIDATORS.CAMEL_CASE_STRING,
2761
- onDelete: z$b.enum(REFERENTIAL_ACTIONS).default('Cascade'),
2762
- onUpdate: z$b.enum(REFERENTIAL_ACTIONS).default('Restrict'),
2827
+ onDelete: z$f.enum(REFERENTIAL_ACTIONS).default('Cascade'),
2828
+ onUpdate: z$f.enum(REFERENTIAL_ACTIONS).default('Restrict'),
2763
2829
  }), (builder) => {
2764
2830
  builder.addReference({
2765
2831
  type: modelEntityType,
@@ -2778,9 +2844,9 @@ const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuil
2778
2844
  parentPath: 'modelRef',
2779
2845
  });
2780
2846
  }));
2781
- const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(z$b.object({
2782
- id: z$b.string(),
2783
- fields: z$b.array(z$b.object({
2847
+ const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(z$f.object({
2848
+ id: z$f.string(),
2849
+ fields: z$f.array(z$f.object({
2784
2850
  fieldRef: ctx.withRef({
2785
2851
  type: modelScalarFieldEntityType,
2786
2852
  onDelete: 'RESTRICT',
@@ -2797,18 +2863,18 @@ const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(
2797
2863
  });
2798
2864
  },
2799
2865
  }));
2800
- const createModelServiceSchema = definitionSchema((ctx) => z$b.object({
2801
- create: z$b
2866
+ const createModelServiceSchema = definitionSchema((ctx) => z$f.object({
2867
+ create: z$f
2802
2868
  .object({
2803
- enabled: z$b.boolean().default(false),
2804
- fields: z$b
2869
+ enabled: z$f.boolean().default(false),
2870
+ fields: z$f
2805
2871
  .array(ctx.withRef({
2806
2872
  type: modelScalarFieldEntityType,
2807
2873
  onDelete: 'DELETE',
2808
2874
  parentPath: { context: 'model' },
2809
2875
  }))
2810
2876
  .optional(),
2811
- transformerNames: z$b
2877
+ transformerNames: z$f
2812
2878
  .array(ctx.withRef({
2813
2879
  type: modelTransformerEntityType,
2814
2880
  onDelete: 'DELETE',
@@ -2817,17 +2883,17 @@ const createModelServiceSchema = definitionSchema((ctx) => z$b.object({
2817
2883
  .optional(),
2818
2884
  })
2819
2885
  .default({ enabled: false }),
2820
- update: z$b
2886
+ update: z$f
2821
2887
  .object({
2822
- enabled: z$b.boolean().default(false),
2823
- fields: z$b
2888
+ enabled: z$f.boolean().default(false),
2889
+ fields: z$f
2824
2890
  .array(ctx.withRef({
2825
2891
  type: modelScalarFieldEntityType,
2826
2892
  onDelete: 'DELETE',
2827
2893
  parentPath: { context: 'model' },
2828
2894
  }))
2829
2895
  .optional(),
2830
- transformerNames: z$b
2896
+ transformerNames: z$f
2831
2897
  .array(ctx.withRef({
2832
2898
  type: modelTransformerEntityType,
2833
2899
  onDelete: 'DELETE',
@@ -2836,33 +2902,33 @@ const createModelServiceSchema = definitionSchema((ctx) => z$b.object({
2836
2902
  .optional(),
2837
2903
  })
2838
2904
  .default({ enabled: false }),
2839
- delete: z$b
2905
+ delete: z$f
2840
2906
  .object({
2841
- enabled: z$b.boolean().default(false),
2907
+ enabled: z$f.boolean().default(false),
2842
2908
  })
2843
2909
  .default({
2844
2910
  enabled: false,
2845
2911
  }),
2846
- transformers: z$b.array(createTransformerSchema(ctx)).default([]),
2912
+ transformers: z$f.array(createTransformerSchema(ctx)).default([]),
2847
2913
  }));
2848
- const createModelBaseSchema = definitionSchema((ctx) => z$b.object({
2849
- id: z$b.string(),
2914
+ const createModelBaseSchema = definitionSchema((ctx) => z$f.object({
2915
+ id: z$f.string(),
2850
2916
  name: VALIDATORS.PASCAL_CASE_STRING,
2851
2917
  featureRef: ctx.withRef({
2852
2918
  type: featureEntityType,
2853
2919
  onDelete: 'RESTRICT',
2854
2920
  }),
2855
- model: z$b.object({
2856
- fields: z$b.array(createModelScalarFieldSchema(ctx)),
2857
- relations: z$b.array(createModelRelationFieldSchema(ctx)).optional(),
2858
- primaryKeyFieldRefs: z$b
2921
+ model: z$f.object({
2922
+ fields: z$f.array(createModelScalarFieldSchema(ctx)),
2923
+ relations: z$f.array(createModelRelationFieldSchema(ctx)).optional(),
2924
+ primaryKeyFieldRefs: z$f
2859
2925
  .array(ctx.withRef({
2860
2926
  type: modelScalarFieldEntityType,
2861
2927
  onDelete: 'RESTRICT',
2862
2928
  parentPath: { context: 'model' },
2863
2929
  }))
2864
2930
  .min(1),
2865
- uniqueConstraints: z$b
2931
+ uniqueConstraints: z$f
2866
2932
  .array(createModelUniqueConstraintSchema(ctx))
2867
2933
  .optional(),
2868
2934
  }),
@@ -2872,7 +2938,7 @@ const createModelBaseSchema = definitionSchema((ctx) => z$b.object({
2872
2938
  delete: { enabled: false },
2873
2939
  transformers: [],
2874
2940
  }),
2875
- graphql: createModelGraphqlSchema(ctx).optional(),
2941
+ graphql: ctx.withDefault(createModelGraphqlSchema(ctx).optional(), {}),
2876
2942
  }));
2877
2943
  const createModelSchema = definitionSchema((ctx) => ctx.withEnt(createModelBaseSchema(ctx), {
2878
2944
  type: modelEntityType,
@@ -2882,21 +2948,212 @@ const createModelSchema = definitionSchema((ctx) => ctx.withEnt(createModelBaseS
2882
2948
  const adminSectionEntityType = createEntityType('admin-section', {
2883
2949
  parentType: appEntityType,
2884
2950
  });
2951
+ const adminCrudSectionColumnEntityType = createEntityType('admin-crud-section-column', {
2952
+ parentType: adminSectionEntityType,
2953
+ });
2885
2954
 
2886
- const {z: z$a} = await importShared('zod');
2887
- const createBaseAdminSectionValidators = definitionSchema((ctx) => z$a.object({
2888
- id: z$a.string().default(adminSectionEntityType.generateNewId()),
2889
- name: z$a.string().min(1),
2955
+ const {z: z$e} = await importShared('zod');
2956
+ const createBaseAdminSectionValidators = definitionSchema((ctx) => z$e.object({
2957
+ id: z$e.string().default(adminSectionEntityType.generateNewId()),
2958
+ name: z$e.string().min(1),
2890
2959
  featureRef: ctx.withRef({
2891
2960
  type: featureEntityType,
2892
2961
  onDelete: 'RESTRICT',
2893
2962
  }),
2894
- icon: z$a.string().optional(),
2895
- type: z$a.string().min(1),
2963
+ icon: z$e.string().optional(),
2964
+ type: z$e.string().min(1),
2965
+ }));
2966
+
2967
+ const {z: z$d} = await importShared('zod');
2968
+ const baseAdminCrudActionSchema = z$d.object({
2969
+ id: z$d
2970
+ .string()
2971
+ .min(1)
2972
+ .default(() => adminCrudActionEntityType.generateNewId()),
2973
+ type: z$d.string().min(1),
2974
+ position: z$d.enum(['inline', 'dropdown']).default('dropdown'),
2975
+ });
2976
+ function createAdminCrudActionType(payload) {
2977
+ return payload;
2978
+ }
2979
+ const adminCrudActionEntityType = createEntityType('admin-crud-action', {
2980
+ parentType: adminSectionEntityType,
2981
+ });
2982
+
2983
+ const {z: z$c} = await importShared('zod');
2984
+ const createAdminCrudEditActionSchema = definitionSchema(() => baseAdminCrudActionSchema.extend({
2985
+ type: z$c.literal('edit'),
2986
+ }));
2987
+ const adminCrudEditActionType = createAdminCrudActionType({
2988
+ name: 'edit',
2989
+ createSchema: createAdminCrudEditActionSchema,
2990
+ });
2991
+ const createAdminCrudDeleteActionSchema = definitionSchema(() => baseAdminCrudActionSchema.extend({
2992
+ type: z$c.literal('delete'),
2993
+ }));
2994
+ const adminCrudDeleteActionType = createAdminCrudActionType({
2995
+ name: 'delete',
2996
+ createSchema: createAdminCrudDeleteActionSchema,
2997
+ });
2998
+ const BUILT_IN_ADMIN_CRUD_ACTIONS = [
2999
+ adminCrudEditActionType,
3000
+ adminCrudDeleteActionType,
3001
+ ];
3002
+
3003
+ function createAdminCrudActionImplementation() {
3004
+ const adminCrudActions = new Map(BUILT_IN_ADMIN_CRUD_ACTIONS.map((action) => [action.name, action]));
3005
+ return {
3006
+ registerAdminCrudAction(action) {
3007
+ if (adminCrudActions.has(action.name)) {
3008
+ throw new Error(`Admin CRUD action with name ${action.name} is already registered`);
3009
+ }
3010
+ adminCrudActions.set(action.name, action);
3011
+ },
3012
+ getAdminCrudActions() {
3013
+ return adminCrudActions;
3014
+ },
3015
+ getAdminCrudAction(name) {
3016
+ const action = adminCrudActions.get(name);
3017
+ if (!action) {
3018
+ throw new Error(`Unable to find action with name ${name}`);
3019
+ }
3020
+ return action;
3021
+ },
3022
+ };
3023
+ }
3024
+ /**
3025
+ * Spec for adding admin CRUD actions
3026
+ */
3027
+ const adminCrudActionSpec = createPluginSpec('core/admin-crud-action', {
3028
+ defaultInitializer: createAdminCrudActionImplementation,
3029
+ });
3030
+
3031
+ const createAdminCrudActionSchema = definitionSchema((ctx) => ctx
3032
+ .withEnt(baseAdminCrudActionSchema.passthrough(), {
3033
+ type: adminCrudActionEntityType,
3034
+ parentPath: {
3035
+ context: 'admin-section',
3036
+ },
3037
+ getNameResolver: (value) => value.type,
3038
+ })
3039
+ .transform((data, parseCtx) => {
3040
+ const { type } = data;
3041
+ const crudAction = ctx.plugins
3042
+ .getPluginSpec(adminCrudActionSpec)
3043
+ .getAdminCrudAction(type);
3044
+ return crudAction
3045
+ .createSchema(ctx)
3046
+ .and(baseAdminCrudActionSchema)
3047
+ .parse(data, {
3048
+ path: parseCtx.path,
3049
+ });
3050
+ }));
3051
+
3052
+ const {z: z$b} = await importShared('zod');
3053
+ const baseAdminCrudColumnSchema = z$b.object({
3054
+ id: z$b
3055
+ .string()
3056
+ .min(1)
3057
+ .default(() => adminCrudColumnEntityType.generateNewId()),
3058
+ type: z$b.string().min(1),
3059
+ label: z$b.string().min(1),
3060
+ });
3061
+ function createAdminCrudColumnType(payload) {
3062
+ return payload;
3063
+ }
3064
+ const adminCrudColumnEntityType = createEntityType('admin-crud-column', {
3065
+ parentType: adminSectionEntityType,
3066
+ });
3067
+
3068
+ const {z: z$a} = await importShared('zod');
3069
+ // Text Column
3070
+ const createAdminCrudTextColumnSchema = definitionSchema((ctx) => baseAdminCrudColumnSchema.extend({
3071
+ type: z$a.literal('text'),
3072
+ modelFieldRef: ctx.withRef({
3073
+ type: modelScalarFieldEntityType,
3074
+ onDelete: 'RESTRICT',
3075
+ parentPath: { context: 'model' },
3076
+ }),
3077
+ }));
3078
+ const adminCrudTextColumnType = createAdminCrudColumnType({
3079
+ name: 'text',
3080
+ createSchema: createAdminCrudTextColumnSchema,
3081
+ });
3082
+ // Foreign Column
3083
+ const createAdminCrudForeignColumnSchema = definitionSchema((ctx) => baseAdminCrudColumnSchema.extend({
3084
+ type: z$a.literal('foreign'),
3085
+ localRelationRef: ctx.withRef({
3086
+ type: modelLocalRelationEntityType,
3087
+ onDelete: 'RESTRICT',
3088
+ parentPath: { context: 'model' },
3089
+ }),
3090
+ labelExpression: z$a.string().min(1),
3091
+ valueExpression: z$a.string().min(1),
3092
+ }));
3093
+ const adminCrudForeignColumnType = createAdminCrudColumnType({
3094
+ name: 'foreign',
3095
+ createSchema: createAdminCrudForeignColumnSchema,
3096
+ });
3097
+ const BUILT_IN_ADMIN_CRUD_COLUMNS = [
3098
+ adminCrudTextColumnType,
3099
+ adminCrudForeignColumnType,
3100
+ ];
3101
+
3102
+ function createAdminCrudColumnImplementation() {
3103
+ const adminCrudColumns = new Map(BUILT_IN_ADMIN_CRUD_COLUMNS.map((column) => [column.name, column]));
3104
+ return {
3105
+ registerAdminCrudColumn(column) {
3106
+ if (adminCrudColumns.has(column.name)) {
3107
+ throw new Error(`Admin CRUD column with name ${column.name} is already registered`);
3108
+ }
3109
+ adminCrudColumns.set(column.name, column);
3110
+ },
3111
+ getAdminCrudColumns() {
3112
+ return adminCrudColumns;
3113
+ },
3114
+ getAdminCrudColumn(name) {
3115
+ const column = adminCrudColumns.get(name);
3116
+ if (!column) {
3117
+ throw new Error(`Unable to find column with name ${name}`);
3118
+ }
3119
+ return column;
3120
+ },
3121
+ };
3122
+ }
3123
+ /**
3124
+ * Spec for adding admin CRUD columns
3125
+ */
3126
+ const adminCrudColumnSpec = createPluginSpec('core/admin-crud-column', {
3127
+ defaultInitializer: createAdminCrudColumnImplementation,
3128
+ });
3129
+
3130
+ const createAdminCrudColumnSchema = definitionSchema((ctx) => ctx
3131
+ .withEnt(baseAdminCrudColumnSchema.passthrough(), {
3132
+ type: adminCrudColumnEntityType,
3133
+ parentPath: {
3134
+ context: 'admin-section',
3135
+ },
3136
+ getNameResolver: (value) => value.type,
3137
+ })
3138
+ .transform((data, parseCtx) => {
3139
+ const { type } = data;
3140
+ const crudColumn = ctx.plugins
3141
+ .getPluginSpec(adminCrudColumnSpec)
3142
+ .getAdminCrudColumn(type);
3143
+ return crudColumn
3144
+ .createSchema(ctx)
3145
+ .and(baseAdminCrudColumnSchema)
3146
+ .parse(data, {
3147
+ path: parseCtx.path,
3148
+ });
2896
3149
  }));
2897
3150
 
2898
3151
  const {z: z$9} = await importShared('zod');
2899
3152
  const baseAdminCrudInputSchema = z$9.object({
3153
+ id: z$9
3154
+ .string()
3155
+ .min(1)
3156
+ .default(() => adminCrudInputEntityType.generateNewId()),
2900
3157
  type: z$9.string().min(1),
2901
3158
  label: z$9.string().min(1),
2902
3159
  });
@@ -2906,9 +3163,12 @@ function createAdminCrudInputType(payload) {
2906
3163
  const adminCrudEmbeddedFormEntityType = createEntityType('admin-crud-embedded-form', {
2907
3164
  parentType: adminSectionEntityType,
2908
3165
  });
3166
+ const adminCrudInputEntityType = createEntityType('admin-crud-input', {
3167
+ parentType: adminSectionEntityType,
3168
+ });
2909
3169
 
2910
3170
  const {z: z$8} = await importShared('zod');
2911
- const createAdminCrudTextInputSchema = definitionSchema((ctx) => z$8.object({
3171
+ const createAdminCrudTextInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.extend({
2912
3172
  type: z$8.literal('text'),
2913
3173
  label: z$8.string().min(1),
2914
3174
  modelFieldRef: ctx.withRef({
@@ -2922,7 +3182,7 @@ const adminCrudTextInputType = createAdminCrudInputType({
2922
3182
  name: 'text',
2923
3183
  createSchema: createAdminCrudTextInputSchema,
2924
3184
  });
2925
- const createAdminCrudForeignInputSchema = definitionSchema((ctx) => z$8.object({
3185
+ const createAdminCrudForeignInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.extend({
2926
3186
  type: z$8.literal('foreign'),
2927
3187
  label: z$8.string().min(1),
2928
3188
  localRelationRef: ctx.withRef({
@@ -2939,7 +3199,7 @@ const adminCrudForeignInputType = createAdminCrudInputType({
2939
3199
  name: 'foreign',
2940
3200
  createSchema: createAdminCrudForeignInputSchema,
2941
3201
  });
2942
- const createAdminCrudEnumInputSchema = definitionSchema((ctx) => z$8.object({
3202
+ const createAdminCrudEnumInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.extend({
2943
3203
  type: z$8.literal('enum'),
2944
3204
  label: z$8.string().min(1),
2945
3205
  modelFieldRef: ctx.withRef({
@@ -2952,7 +3212,7 @@ const adminCrudEnumInputType = createAdminCrudInputType({
2952
3212
  name: 'enum',
2953
3213
  createSchema: createAdminCrudEnumInputSchema,
2954
3214
  });
2955
- const createAdminCrudEmbeddedInputSchema = definitionSchema((ctx) => z$8.object({
3215
+ const createAdminCrudEmbeddedInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.extend({
2956
3216
  type: z$8.literal('embedded'),
2957
3217
  label: z$8.string().min(1),
2958
3218
  modelRelationRef: ctx.withRef({
@@ -2970,7 +3230,7 @@ const adminCrudEmbeddedInputType = createAdminCrudInputType({
2970
3230
  name: 'embedded',
2971
3231
  createSchema: createAdminCrudEmbeddedInputSchema,
2972
3232
  });
2973
- const createAdminCrudEmbeddedLocalInputSchema = definitionSchema((ctx) => z$8.object({
3233
+ const createAdminCrudEmbeddedLocalInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.extend({
2974
3234
  type: z$8.literal('embeddedLocal'),
2975
3235
  label: z$8.string().min(1),
2976
3236
  localRelationRef: ctx.withRef({
@@ -2988,7 +3248,7 @@ const adminCrudEmbeddedLocalInputType = createAdminCrudInputType({
2988
3248
  name: 'embeddedLocal',
2989
3249
  createSchema: createAdminCrudEmbeddedLocalInputSchema,
2990
3250
  });
2991
- const createAdminCrudPasswordInputSchema = definitionSchema(() => z$8.object({
3251
+ const createAdminCrudPasswordInputSchema = definitionSchema(() => baseAdminCrudInputSchema.extend({
2992
3252
  type: z$8.literal('password'),
2993
3253
  label: z$8.string().min(1),
2994
3254
  }));
@@ -3033,7 +3293,15 @@ const adminCrudInputSpec = createPluginSpec('core/admin-crud-input', {
3033
3293
  defaultInitializer: createAdminCrudInputImplementation,
3034
3294
  });
3035
3295
 
3036
- const createAdminCrudInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.passthrough().transform((data, parseCtx) => {
3296
+ const createAdminCrudInputSchema = definitionSchema((ctx) => ctx
3297
+ .withEnt(baseAdminCrudInputSchema.passthrough(), {
3298
+ type: adminCrudInputEntityType,
3299
+ parentPath: {
3300
+ context: 'admin-section',
3301
+ },
3302
+ getNameResolver: (value) => value.id ?? '',
3303
+ })
3304
+ .transform((data, parseCtx) => {
3037
3305
  const { type } = data;
3038
3306
  const crudInput = ctx.plugins
3039
3307
  .getPluginSpec(adminCrudInputSpec)
@@ -3047,35 +3315,6 @@ const createAdminCrudInputSchema = definitionSchema((ctx) => baseAdminCrudInputS
3047
3315
  }));
3048
3316
 
3049
3317
  const {z: z$7} = await importShared('zod');
3050
- // Table Columns
3051
- const createAdminCrudForeignDisplaySchema = definitionSchema((ctx) => z$7.object({
3052
- type: z$7.literal('foreign'),
3053
- localRelationRef: ctx.withRef({
3054
- type: modelLocalRelationEntityType,
3055
- onDelete: 'RESTRICT',
3056
- parentPath: { context: 'model' },
3057
- }),
3058
- labelExpression: z$7.string().min(1),
3059
- valueExpression: z$7.string().min(1),
3060
- }));
3061
- const createAdminCrudTextDisplaySchema = definitionSchema((ctx) => z$7.object({
3062
- type: z$7.literal('text'),
3063
- modelFieldRef: ctx.withRef({
3064
- type: modelScalarFieldEntityType,
3065
- onDelete: 'RESTRICT',
3066
- parentPath: { context: 'model' },
3067
- }),
3068
- }));
3069
- const createAdminCrudDisplaySchema = definitionSchema((ctx) => z$7.discriminatedUnion('type', [
3070
- createAdminCrudTextDisplaySchema(ctx),
3071
- createAdminCrudForeignDisplaySchema(ctx),
3072
- ]));
3073
- // TODO: Improve this to be more dynamic in the future
3074
- const adminCrudDisplayTypes = ['text', 'foreign'];
3075
- const createAdminCrudTableColumnSchema = definitionSchema((ctx) => z$7.object({
3076
- label: z$7.string().min(1),
3077
- display: createAdminCrudDisplaySchema(ctx),
3078
- }));
3079
3318
  // Embedded Crud
3080
3319
  const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z$7.object({
3081
3320
  id: z$7.string().min(1),
@@ -3099,10 +3338,8 @@ const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z$7.object({
3099
3338
  }),
3100
3339
  includeIdField: z$7.boolean().optional(),
3101
3340
  type: z$7.literal('list'),
3102
- // NOTE: These two fields need to be synced with crud section schema
3103
- // because the web app expects that (TODO)
3104
3341
  table: z$7.object({
3105
- columns: z$7.array(createAdminCrudTableColumnSchema(ctx)),
3342
+ columns: z$7.array(createAdminCrudColumnSchema(ctx)),
3106
3343
  }),
3107
3344
  form: z$7.object({
3108
3345
  fields: z$7.array(createAdminCrudInputSchema(ctx)),
@@ -3125,9 +3362,21 @@ const createAdminCrudSectionSchema = definitionSchema((ctx) => ctx.withRefBuilde
3125
3362
  type: modelEntityType,
3126
3363
  onDelete: 'RESTRICT',
3127
3364
  }),
3365
+ /* The field that will be used to display the name of the entity in the form */
3366
+ nameFieldRef: ctx.withRef({
3367
+ type: modelScalarFieldEntityType,
3368
+ onDelete: 'RESTRICT',
3369
+ parentPath: {
3370
+ context: 'model',
3371
+ },
3372
+ }),
3128
3373
  disableCreate: ctx.withDefault(z$7.boolean(), false),
3129
3374
  table: z$7.object({
3130
- columns: z$7.array(createAdminCrudTableColumnSchema(ctx)),
3375
+ columns: z$7.array(createAdminCrudColumnSchema(ctx)),
3376
+ actions: ctx.withDefault(z$7.array(createAdminCrudActionSchema(ctx)), [
3377
+ { type: 'edit', position: 'inline' },
3378
+ { type: 'delete', position: 'dropdown' },
3379
+ ]),
3131
3380
  }),
3132
3381
  form: z$7.object({
3133
3382
  fields: z$7.array(createAdminCrudInputSchema(ctx)),
@@ -3450,7 +3699,13 @@ const PluginUtils = {
3450
3699
  };
3451
3700
 
3452
3701
  const {z} = await importShared('zod');
3453
- const COMMON_SPEC_IMPLEMENTATIONS = [pluginConfigSpec, modelTransformerSpec, adminCrudInputSpec];
3702
+ const COMMON_SPEC_IMPLEMENTATIONS = [
3703
+ pluginConfigSpec,
3704
+ modelTransformerSpec,
3705
+ adminCrudInputSpec,
3706
+ adminCrudActionSpec,
3707
+ adminCrudColumnSpec,
3708
+ ];
3454
3709
  /**
3455
3710
  * Creates a plugin implementation store from the project definition and plugin store,
3456
3711
  * initializing the set of plugins enabled in the project definition.
@@ -8751,6 +9006,132 @@ const migration017RenameAuthPlugin = createSchemaMigration({
8751
9006
  },
8752
9007
  });
8753
9008
 
9009
+ const migration018CrudNameFieldRef = createSchemaMigration({
9010
+ version: 18,
9011
+ name: 'crudNameFieldRef',
9012
+ description: 'Add nameFieldRef to CRUD sections, defaulting to name, title, id, or first field',
9013
+ migrate: (config) => {
9014
+ if (!config.apps || !config.models) {
9015
+ return config;
9016
+ }
9017
+ const apps = config.apps.map((app) => {
9018
+ // Only process apps with adminApp and sections
9019
+ if (!app.adminApp?.sections) {
9020
+ return app;
9021
+ }
9022
+ const sections = app.adminApp.sections.map((section) => {
9023
+ // Only process CRUD sections without nameFieldRef
9024
+ if (section.type !== 'crud' || section.nameFieldRef) {
9025
+ return section;
9026
+ }
9027
+ // Find the model for this section
9028
+ const model = config.models?.find((m) => m.name === section.modelRef);
9029
+ if (!model?.model.fields || model.model.fields.length === 0) {
9030
+ throw new Error(`Model ${section.modelRef} has no fields`);
9031
+ }
9032
+ // Find field by priority: name, title, id, then first field
9033
+ let selectedField = model.model.fields.find((f) => f.name === 'name');
9034
+ selectedField ?? (selectedField = model.model.fields.find((f) => f.name === 'title'));
9035
+ selectedField ?? (selectedField = model.model.fields.find((f) => f.name === 'id'));
9036
+ selectedField ?? (selectedField = model.model.fields[0]);
9037
+ return {
9038
+ ...section,
9039
+ nameFieldRef: selectedField.name,
9040
+ };
9041
+ });
9042
+ return {
9043
+ ...app,
9044
+ adminApp: {
9045
+ ...app.adminApp,
9046
+ sections,
9047
+ },
9048
+ };
9049
+ });
9050
+ return {
9051
+ ...config,
9052
+ apps,
9053
+ };
9054
+ },
9055
+ });
9056
+
9057
+ function migrateColumn(oldColumn) {
9058
+ const { display, id, ...rest } = oldColumn;
9059
+ return {
9060
+ id: id?.replace('admin-crud-section-column', 'admin-crud-column'),
9061
+ ...rest,
9062
+ type: display.type,
9063
+ ...(display.modelFieldRef && { modelFieldRef: display.modelFieldRef }),
9064
+ ...(display.localRelationRef && {
9065
+ localRelationRef: display.localRelationRef,
9066
+ }),
9067
+ ...(display.labelExpression && {
9068
+ labelExpression: display.labelExpression,
9069
+ }),
9070
+ ...(display.valueExpression && {
9071
+ valueExpression: display.valueExpression,
9072
+ }),
9073
+ };
9074
+ }
9075
+ function migrateColumns(columns) {
9076
+ if (!columns || columns.length === 0) {
9077
+ return [];
9078
+ }
9079
+ return columns.map(migrateColumn);
9080
+ }
9081
+ const migration019ColumnTypeBased = createSchemaMigration({
9082
+ version: 19,
9083
+ name: 'columnTypeBased',
9084
+ description: 'Migrate admin CRUD columns from display-based to type-based structure',
9085
+ migrate: (config) => {
9086
+ if (!config.apps) {
9087
+ return config;
9088
+ }
9089
+ const apps = config.apps.map((app) => {
9090
+ // Only process apps with adminApp and sections
9091
+ if (!app.adminApp?.sections) {
9092
+ return app;
9093
+ }
9094
+ const sections = app.adminApp.sections.map((section) => {
9095
+ const updatedSection = { ...section };
9096
+ // Migrate main table columns
9097
+ if (section.table?.columns) {
9098
+ updatedSection.table = {
9099
+ ...section.table,
9100
+ columns: migrateColumns(section.table.columns),
9101
+ };
9102
+ }
9103
+ // Migrate embedded form table columns
9104
+ if (section.embeddedForms) {
9105
+ updatedSection.embeddedForms = section.embeddedForms.map((form) => {
9106
+ if (form.table?.columns) {
9107
+ return {
9108
+ ...form,
9109
+ table: {
9110
+ ...form.table,
9111
+ columns: migrateColumns(form.table.columns),
9112
+ },
9113
+ };
9114
+ }
9115
+ return form;
9116
+ });
9117
+ }
9118
+ return updatedSection;
9119
+ });
9120
+ return {
9121
+ ...app,
9122
+ adminApp: {
9123
+ ...app.adminApp,
9124
+ sections,
9125
+ },
9126
+ };
9127
+ });
9128
+ return {
9129
+ ...config,
9130
+ apps,
9131
+ };
9132
+ },
9133
+ });
9134
+
8754
9135
  const SCHEMA_MIGRATIONS = [
8755
9136
  migration005PrimaryUniqueRefs,
8756
9137
  migration006IndividualServiceControllers,
@@ -8765,6 +9146,8 @@ const SCHEMA_MIGRATIONS = [
8765
9146
  migration015NullParentRefs,
8766
9147
  migration016WebAdminConfig,
8767
9148
  migration017RenameAuthPlugin,
9149
+ migration018CrudNameFieldRef,
9150
+ migration019ColumnTypeBased,
8768
9151
  ];
8769
9152
  function isMigrateableProjectDefinition(projectDefinition) {
8770
9153
  return (typeof projectDefinition === 'object' &&
@@ -9903,5 +10286,5 @@ function generateDefaultTheme() {
9903
10286
  };
9904
10287
  }
9905
10288
 
9906
- export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DefinitionRefBuilder, EnumUtils, FIXED_COLOR_MAPPINGS, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PluginImplementationStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS, adminCrudDisplayTypes, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputSpec, adminSectionEntityType, appCompilerSpec, appEntityType, authConfigSpec, authModelConfigSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudInputSchema, baseAppSchema, baseAppValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminAppSchema, createAdminCrudDisplaySchema, createAdminCrudEmbeddedFormSchema, createAdminCrudEmbeddedInputSchema, createAdminCrudEmbeddedListSchema, createAdminCrudEmbeddedLocalInputSchema, createAdminCrudEmbeddedObjectSchema, createAdminCrudEnumInputSchema, createAdminCrudForeignDisplaySchema, createAdminCrudForeignInputSchema, createAdminCrudInputCompilerImplementation, createAdminCrudInputImplementation, createAdminCrudInputSchema, createAdminCrudInputType, createAdminCrudPasswordInputSchema, createAdminCrudSectionSchema, createAdminCrudTableColumnSchema, createAdminCrudTextDisplaySchema, createAdminCrudTextInputSchema, createAppCompiler, createAppCompilerPlugin, createAppEntryType, createAppSchema, createBackendAppSchema, createBaseAdminSectionValidators, createDefinitionEntityNameResolver, createDefinitionSchemaParserContext, createEmbeddedRelationTransformerSchema, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createFeaturesSchema, createModelBaseSchema, createModelGraphqlSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerCompilerImplementation, createModelTransformerImplementation, createModelTransformerType, createModelUniqueConstraintSchema, createPasswordTransformerSchema, createPlatformPluginExport, createPluginConfigImplementation, createPluginImplementationStore, createPluginImplementationStoreWithNewPlugins, createPluginSpec, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createSettingsSchema, createTemplateExtractorSchema, createTestProjectDefinition, createTestProjectDefinitionContainer, createTestProjectDefinitionInput, createThemeSchema, createTransformerSchema, createWebAdminSectionSchema, createWebAppSchema, createWebConfigImplementation, definitionSchema, deserializeSchemaWithTransformedReferences, extractDefinitionRefs, extractDefinitionRefsRecursive, featureEntityType, fixRefDeletions, generalSettingsSchema, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getLatestMigrationVersion, getManagedPluginsForPlugin, getPluginMetadataByKey, getPluginMetadataByKeyOrThrow, initializePlugins, isMigrateableProjectDefinition, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, oklchColor, paletteSchema, palettesSchema, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, pluginConfigSpec, pluginEntityType, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, undefinedIfEmpty, undefinedIfFalsy, webAppEntryType, webConfigSpec };
9907
- //# sourceMappingURL=project-builder-lib-CGEZr0YI.js.map
10289
+ export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_ACTIONS, BUILT_IN_ADMIN_CRUD_COLUMNS, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DefinitionRefBuilder, EnumUtils, FIXED_COLOR_MAPPINGS, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PluginImplementationStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS, adminCrudActionCompilerSpec, adminCrudActionEntityType, adminCrudActionSpec, adminCrudColumnCompilerSpec, adminCrudColumnEntityType, adminCrudColumnSpec, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputEntityType, adminCrudInputSpec, adminCrudSectionColumnEntityType, adminSectionEntityType, appCompilerSpec, appEntityType, authConfigSpec, authModelConfigSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudActionSchema, baseAdminCrudColumnSchema, baseAdminCrudInputSchema, baseAppSchema, baseAppValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminAppSchema, createAdminCrudActionCompilerImplementation, createAdminCrudActionImplementation, createAdminCrudActionSchema, createAdminCrudActionType, createAdminCrudColumnCompiler, createAdminCrudColumnCompilerImplementation, createAdminCrudColumnImplementation, createAdminCrudColumnSchema, createAdminCrudColumnType, createAdminCrudDeleteActionSchema, createAdminCrudEditActionSchema, createAdminCrudEmbeddedFormSchema, createAdminCrudEmbeddedInputSchema, createAdminCrudEmbeddedListSchema, createAdminCrudEmbeddedLocalInputSchema, createAdminCrudEmbeddedObjectSchema, createAdminCrudEnumInputSchema, createAdminCrudForeignColumnSchema, createAdminCrudForeignInputSchema, createAdminCrudInputCompilerImplementation, createAdminCrudInputImplementation, createAdminCrudInputSchema, createAdminCrudInputType, createAdminCrudPasswordInputSchema, createAdminCrudSectionSchema, createAdminCrudTextColumnSchema, createAdminCrudTextInputSchema, createAppCompiler, createAppCompilerPlugin, createAppEntryType, createAppSchema, createBackendAppSchema, createBaseAdminSectionValidators, createDefinitionEntityNameResolver, createDefinitionSchemaParserContext, createEmbeddedRelationTransformerSchema, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createFeaturesSchema, createModelBaseSchema, createModelGraphqlSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerCompilerImplementation, createModelTransformerImplementation, createModelTransformerType, createModelUniqueConstraintSchema, createPasswordTransformerSchema, createPlatformPluginExport, createPluginConfigImplementation, createPluginImplementationStore, createPluginImplementationStoreWithNewPlugins, createPluginSpec, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createSettingsSchema, createTemplateExtractorSchema, createTestProjectDefinition, createTestProjectDefinitionContainer, createTestProjectDefinitionInput, createThemeSchema, createTransformerSchema, createWebAdminSectionSchema, createWebAppSchema, createWebConfigImplementation, definitionSchema, deserializeSchemaWithTransformedReferences, extractDefinitionRefs, extractDefinitionRefsRecursive, featureEntityType, fixRefDeletions, generalSettingsSchema, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getLatestMigrationVersion, getManagedPluginsForPlugin, getPluginMetadataByKey, getPluginMetadataByKeyOrThrow, initializePlugins, isMigrateableProjectDefinition, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, oklchColor, paletteSchema, palettesSchema, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, pluginConfigSpec, pluginEntityType, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, undefinedIfEmpty, undefinedIfFalsy, webAppEntryType, webConfigSpec };
10290
+ //# sourceMappingURL=project-builder-lib-BvG5Zcxb.js.map