@baseplate-dev/plugin-auth 0.1.3 → 1.0.1

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 (233) hide show
  1. package/dist/auth/core/node.d.ts.map +1 -1
  2. package/dist/auth/core/node.js +6 -3
  3. package/dist/auth/core/node.js.map +1 -1
  4. package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts +13 -1
  5. package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts.map +1 -1
  6. package/dist/auth/generators/fastify/auth-module/auth-module.generator.js +20 -8
  7. package/dist/auth/generators/fastify/auth-module/auth-module.generator.js.map +1 -1
  8. package/dist/auth/generators/fastify/auth-module/generated/index.d.ts +88 -0
  9. package/dist/auth/generators/fastify/auth-module/generated/index.d.ts.map +1 -0
  10. package/dist/auth/generators/fastify/auth-module/generated/index.js +9 -0
  11. package/dist/auth/generators/fastify/auth-module/generated/index.js.map +1 -0
  12. package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts +16 -0
  13. package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts.map +1 -0
  14. package/dist/auth/generators/fastify/auth-module/generated/template-paths.js +26 -0
  15. package/dist/auth/generators/fastify/auth-module/generated/template-paths.js.map +1 -0
  16. package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.d.ts +10 -0
  17. package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.d.ts.map +1 -0
  18. package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.js +23 -0
  19. package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.js.map +1 -0
  20. package/dist/auth/generators/fastify/auth-module/generated/{ts-templates.d.ts → typed-templates.d.ts} +26 -41
  21. package/dist/auth/generators/fastify/auth-module/generated/typed-templates.d.ts.map +1 -0
  22. package/dist/auth/generators/fastify/auth-module/generated/typed-templates.js +68 -0
  23. package/dist/auth/generators/fastify/auth-module/generated/typed-templates.js.map +1 -0
  24. package/dist/auth/generators/fastify/auth-module/index.d.ts +2 -0
  25. package/dist/auth/generators/fastify/auth-module/index.d.ts.map +1 -0
  26. package/dist/auth/generators/fastify/auth-module/index.js +2 -0
  27. package/dist/auth/generators/fastify/auth-module/index.js.map +1 -0
  28. package/dist/auth/generators/fastify/auth-module/templates/{utils → module/utils}/cookie-signer.ts +6 -0
  29. package/dist/auth/generators/fastify/index.d.ts +1 -1
  30. package/dist/auth/generators/fastify/index.d.ts.map +1 -1
  31. package/dist/auth/generators/fastify/index.js +1 -1
  32. package/dist/auth/generators/fastify/index.js.map +1 -1
  33. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +14 -6
  34. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +1 -1
  35. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +11 -16
  36. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +1 -1
  37. package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +62 -0
  38. package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +1 -0
  39. package/dist/auth0/generators/fastify/auth0-module/generated/index.js +9 -0
  40. package/dist/auth0/generators/fastify/auth0-module/generated/index.js.map +1 -0
  41. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts +13 -0
  42. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts.map +1 -0
  43. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js +23 -0
  44. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js.map +1 -0
  45. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts +10 -0
  46. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts.map +1 -0
  47. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js +23 -0
  48. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js.map +1 -0
  49. package/dist/auth0/generators/fastify/auth0-module/generated/{ts-templates.d.ts → typed-templates.d.ts} +2 -2
  50. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts.map +1 -0
  51. package/dist/auth0/generators/fastify/auth0-module/generated/{ts-templates.js → typed-templates.js} +11 -8
  52. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js.map +1 -0
  53. package/dist/auth0/generators/fastify/auth0-module/index.d.ts +2 -0
  54. package/dist/auth0/generators/fastify/auth0-module/index.d.ts.map +1 -0
  55. package/dist/auth0/generators/fastify/auth0-module/index.js +2 -0
  56. package/dist/auth0/generators/fastify/auth0-module/index.js.map +1 -0
  57. package/dist/auth0/generators/fastify/index.d.ts +1 -1
  58. package/dist/auth0/generators/fastify/index.d.ts.map +1 -1
  59. package/dist/auth0/generators/fastify/index.js +1 -1
  60. package/dist/auth0/generators/fastify/index.js.map +1 -1
  61. package/dist/auth0/generators/react/auth0-apollo/index.d.ts +2 -0
  62. package/dist/auth0/generators/react/auth0-apollo/index.d.ts.map +1 -0
  63. package/dist/auth0/generators/react/auth0-apollo/index.js +2 -0
  64. package/dist/auth0/generators/react/auth0-apollo/index.js.map +1 -0
  65. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts +101 -8
  66. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts.map +1 -1
  67. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js +10 -11
  68. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +1 -1
  69. package/dist/auth0/generators/react/auth0-callback/generated/index.d.ts +290 -0
  70. package/dist/auth0/generators/react/auth0-callback/generated/index.d.ts.map +1 -0
  71. package/dist/auth0/generators/react/auth0-callback/generated/index.js +7 -0
  72. package/dist/auth0/generators/react/auth0-callback/generated/index.js.map +1 -0
  73. package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts +13 -0
  74. package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts.map +1 -0
  75. package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js +23 -0
  76. package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js.map +1 -0
  77. package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts +280 -0
  78. package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts.map +1 -0
  79. package/dist/auth0/generators/react/auth0-callback/generated/{ts-templates.js → typed-templates.js} +11 -9
  80. package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.js.map +1 -0
  81. package/dist/auth0/generators/react/auth0-callback/index.d.ts +2 -0
  82. package/dist/auth0/generators/react/auth0-callback/index.d.ts.map +1 -0
  83. package/dist/auth0/generators/react/auth0-callback/index.js +2 -0
  84. package/dist/auth0/generators/react/auth0-callback/index.js.map +1 -0
  85. package/dist/auth0/generators/react/auth0-callback/templates/{auth0-callback.page.tsx → routes/auth0-callback.page.tsx} +3 -3
  86. package/dist/auth0/generators/react/auth0-callback/templates/{signup.page.tsx → routes/signup.page.tsx} +3 -3
  87. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts +106 -12
  88. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts.map +1 -1
  89. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js +12 -16
  90. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js.map +1 -1
  91. package/dist/auth0/generators/react/auth0-components/generated/index.d.ts +151 -0
  92. package/dist/auth0/generators/react/auth0-components/generated/index.d.ts.map +1 -0
  93. package/dist/auth0/generators/react/auth0-components/generated/index.js +9 -0
  94. package/dist/auth0/generators/react/auth0-components/generated/index.js.map +1 -0
  95. package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts +12 -0
  96. package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts.map +1 -0
  97. package/dist/auth0/generators/react/auth0-components/generated/template-paths.js +22 -0
  98. package/dist/auth0/generators/react/auth0-components/generated/template-paths.js.map +1 -0
  99. package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts +10 -0
  100. package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts.map +1 -0
  101. package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js +25 -0
  102. package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js.map +1 -0
  103. package/dist/auth0/generators/react/auth0-components/generated/typed-templates.d.ts +132 -0
  104. package/dist/auth0/generators/react/auth0-components/generated/typed-templates.d.ts.map +1 -0
  105. package/dist/auth0/generators/react/auth0-components/generated/typed-templates.js +17 -0
  106. package/dist/auth0/generators/react/auth0-components/generated/typed-templates.js.map +1 -0
  107. package/dist/auth0/generators/react/auth0-components/index.d.ts +2 -0
  108. package/dist/auth0/generators/react/auth0-components/index.d.ts.map +1 -0
  109. package/dist/auth0/generators/react/auth0-components/index.js +2 -0
  110. package/dist/auth0/generators/react/auth0-components/index.js.map +1 -0
  111. package/dist/auth0/generators/react/auth0-components/templates/{RequireAuth.tsx → src/components/require-auth/require-auth.tsx} +4 -4
  112. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +10 -2
  113. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +1 -1
  114. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +13 -24
  115. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -1
  116. package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts +51 -0
  117. package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +1 -0
  118. package/dist/auth0/generators/react/auth0-hooks/generated/index.js +9 -0
  119. package/dist/auth0/generators/react/auth0-hooks/generated/index.js.map +1 -0
  120. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +16 -0
  121. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +1 -0
  122. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +26 -0
  123. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +1 -0
  124. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts +16 -0
  125. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts.map +1 -0
  126. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js +27 -0
  127. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js.map +1 -0
  128. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +44 -0
  129. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +1 -0
  130. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +67 -0
  131. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +1 -0
  132. package/dist/auth0/generators/react/auth0-hooks/index.d.ts +2 -0
  133. package/dist/auth0/generators/react/auth0-hooks/index.d.ts.map +1 -0
  134. package/dist/auth0/generators/react/auth0-hooks/index.js +2 -0
  135. package/dist/auth0/generators/react/auth0-hooks/index.js.map +1 -0
  136. package/dist/auth0/generators/react/index.d.ts +5 -5
  137. package/dist/auth0/generators/react/index.d.ts.map +1 -1
  138. package/dist/auth0/generators/react/index.js +5 -5
  139. package/dist/auth0/generators/react/index.js.map +1 -1
  140. package/dist/auth0/generators/react/react-auth0/index.d.ts +2 -0
  141. package/dist/auth0/generators/react/react-auth0/index.d.ts.map +1 -0
  142. package/dist/auth0/generators/react/react-auth0/index.js +2 -0
  143. package/dist/auth0/generators/react/react-auth0/index.js.map +1 -0
  144. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DCwCR5dZ.js → __federation_expose_auth0CoreCommon-BE50qa2_.js} +3 -3
  145. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DCwCR5dZ.js.map → __federation_expose_auth0CoreCommon-BE50qa2_.js.map} +1 -1
  146. package/dist/web/assets/{__federation_expose_auth0CoreWeb-BlCwYpTq.js → __federation_expose_auth0CoreWeb-AdDVCP7O.js} +7 -9
  147. package/dist/web/assets/__federation_expose_auth0CoreWeb-AdDVCP7O.js.map +1 -0
  148. package/dist/web/assets/__federation_expose_authCoreCommon-DKyLSPCa.js +36 -0
  149. package/dist/web/assets/__federation_expose_authCoreCommon-DKyLSPCa.js.map +1 -0
  150. package/dist/web/assets/__federation_expose_authCoreWeb-CfCyOvUk.js +442 -0
  151. package/dist/web/assets/__federation_expose_authCoreWeb-CfCyOvUk.js.map +1 -0
  152. package/dist/web/assets/{__federation_fn_import-dzKjrTzS.js → __federation_fn_import-CxP86CUK.js} +2 -2
  153. package/dist/web/assets/{__federation_fn_import-dzKjrTzS.js.map → __federation_fn_import-CxP86CUK.js.map} +1 -1
  154. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BXHJHUXP.js → web-BFCvL5ku.js} +5 -5
  155. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BFCvL5ku.js.map +1 -0
  156. package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-GtzVuDsM.js → project-builder-lib-BAwM_-SS.js} +150 -159
  157. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BAwM_-SS.js.map +1 -0
  158. package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-ChoqtPkg.js → ui-components-C3uzqK6u.js} +18156 -10210
  159. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-C3uzqK6u.js.map +1 -0
  160. package/dist/web/assets/{index-BxDOOHD-.js → index-scyXBD_d.js} +10 -4
  161. package/dist/web/assets/{index-BxDOOHD-.js.map → index-scyXBD_d.js.map} +1 -1
  162. package/dist/web/assets/{index.esm-BZEyAv4m.js → index.esm-DIgRm3lq.js} +3 -3
  163. package/dist/web/assets/{index.esm-BZEyAv4m.js.map → index.esm-DIgRm3lq.js.map} +1 -1
  164. package/dist/web/assets/{model-merger-CdV-7CWE.js → model-merger-gxuB007n.js} +33 -23
  165. package/dist/web/assets/model-merger-gxuB007n.js.map +1 -0
  166. package/dist/web/assets/plugin-definition-Bgi_XH0-.js +22 -0
  167. package/dist/web/assets/plugin-definition-Bgi_XH0-.js.map +1 -0
  168. package/dist/web/assets/plugin-definition-EtIvYJxn.js +34 -0
  169. package/dist/web/assets/plugin-definition-EtIvYJxn.js.map +1 -0
  170. package/dist/web/assets/{react-BfiX28GO.js → react-CAuz_DuX.js} +2 -2
  171. package/dist/web/assets/{react-BfiX28GO.js.map → react-CAuz_DuX.js.map} +1 -1
  172. package/dist/web/assets/remoteEntry.js +8 -2
  173. package/dist/web/assets/remoteEntry.js.map +1 -1
  174. package/dist/web/assets/{plugin-definition-C9Q-BrBQ.js → schema-BAfRBwYE.js} +16 -27
  175. package/dist/web/assets/schema-BAfRBwYE.js.map +1 -0
  176. package/dist/web/assets/styles-BpKIyKWd.js +8 -0
  177. package/dist/web/assets/styles-BpKIyKWd.js.map +1 -0
  178. package/manifest.json +1 -1
  179. package/package.json +18 -10
  180. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.d.ts.map +0 -1
  181. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js +0 -94
  182. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js.map +0 -1
  183. package/dist/auth/generators/fastify/auth-module/templates/management.ts +0 -22
  184. package/dist/auth/generators/fastify/auth-module/templates/schema/user-session-payload.object-type.ts +0 -23
  185. package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.mutations.ts +0 -22
  186. package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.queries.ts +0 -20
  187. package/dist/auth/generators/fastify/auth-module/templates/user-session.service.ts +0 -101
  188. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts +0 -3
  189. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts.map +0 -1
  190. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js +0 -12
  191. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js.map +0 -1
  192. package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.d.ts.map +0 -1
  193. package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.js.map +0 -1
  194. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts +0 -106
  195. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts.map +0 -1
  196. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.js.map +0 -1
  197. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts +0 -3
  198. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts.map +0 -1
  199. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js +0 -12
  200. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js.map +0 -1
  201. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts +0 -45
  202. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts.map +0 -1
  203. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js +0 -13
  204. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js.map +0 -1
  205. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts +0 -8
  206. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts.map +0 -1
  207. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js +0 -12
  208. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js.map +0 -1
  209. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts +0 -3
  210. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts.map +0 -1
  211. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js +0 -16
  212. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js.map +0 -1
  213. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts +0 -33
  214. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts.map +0 -1
  215. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js +0 -50
  216. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js.map +0 -1
  217. package/dist/web/assets/__federation_expose_auth0CoreWeb-BlCwYpTq.js.map +0 -1
  218. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BXHJHUXP.js.map +0 -1
  219. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-GtzVuDsM.js.map +0 -1
  220. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-ChoqtPkg.js.map +0 -1
  221. package/dist/web/assets/model-merger-CdV-7CWE.js.map +0 -1
  222. package/dist/web/assets/plugin-definition-C9Q-BrBQ.js.map +0 -1
  223. /package/dist/auth/generators/fastify/auth-module/templates/{user-session.constants.ts → module/constants/user-session.constants.ts} +0 -0
  224. /package/dist/auth/generators/fastify/auth-module/templates/{services → module/services}/user-session.service.ts +0 -0
  225. /package/dist/auth/generators/fastify/auth-module/templates/{utils → module/utils}/session-cookie.ts +0 -0
  226. /package/dist/auth/generators/fastify/auth-module/templates/{utils → module/utils}/verify-request-origin.ts +0 -0
  227. /package/dist/auth0/generators/fastify/auth0-module/templates/{management.ts → module/services/management.ts} +0 -0
  228. /package/dist/auth0/generators/fastify/auth0-module/templates/{user-session.service.ts → module/services/user-session.service.ts} +0 -0
  229. /package/dist/auth0/generators/react/auth0-hooks/templates/{useCurrentUser.gql → src/hooks/useCurrentUser.gql} +0 -0
  230. /package/dist/auth0/generators/react/auth0-hooks/templates/{useCurrentUser.ts → src/hooks/useCurrentUser.ts} +0 -0
  231. /package/dist/auth0/generators/react/auth0-hooks/templates/{useLogOut.ts → src/hooks/useLogOut.ts} +0 -0
  232. /package/dist/auth0/generators/react/auth0-hooks/templates/{useRequiredUserId.ts → src/hooks/useRequiredUserId.ts} +0 -0
  233. /package/dist/auth0/generators/react/auth0-hooks/templates/{useSession.ts → src/hooks/useSession.ts} +0 -0
@@ -1,6 +1,6 @@
1
- import { c as createPluginSpec, i as isEqual, m as mapValues, a as createEntityType, z as zodPluginSymbol, Z as ZodRefWrapper, g as get$1, s as set$1, C as CASE_VALIDATORS, b as zRef, d as modelForeignRelationEntityType, e as modelLocalRelationEntityType, f as modelScalarFieldEntityType, h as zEnt, j as modelTransformerEntityType, k as createDefinitionEntityNameResolver, l as modelEntityType, n as ZodRef, o as modelEnumValueEntityType, p as featureEntityType, q as modelEnumEntityType, r as zRefBuilder, t as zRefId, u as modelUniqueConstraintEntityType, v as featuresSchema, M as ModelUtils, w as zPluginWrapper, x as omit, y as cloneDeep } from '../model-merger-CdV-7CWE.js';
2
- export { R as DefinitionDiffArrayIncludesField, P as DefinitionDiffKeyedArrayField, Q as DefinitionDiffReplacementField, E as DefinitionEntityType, F as FeatureUtils, A as ZodPluginWrapper, D as ZodRefBuilder, U as applyDefinitionDiff, L as applyModelMergerDiff, N as applyModelMergerResultInPlace, O as createAndApplyModelMergerResults, T as createDefinitionDiff, S as createDefinitionDiffConfig, B as createInitializedPluginSpec, J as createModelMergerResult, K as createModelMergerResults, G as featureNameSchema, H as featureSchema, I as modelMergerDefinitionDiffConfig } from '../model-merger-CdV-7CWE.js';
3
- import { importShared } from '../__federation_fn_import-dzKjrTzS.js';
1
+ import { c as createPluginSpec, i as isEqual, m as mapValues, a as createEntityType, z as zodPluginSymbol, Z as ZodRefWrapper, g as get$1, s as set$1, C as CASE_VALIDATORS, d as definitionSchema, b as zRef, e as modelForeignRelationEntityType, f as modelLocalRelationEntityType, h as modelScalarFieldEntityType, j as zEnt, k as modelTransformerEntityType, l as createDefinitionEntityNameResolver, n as modelEntityType, o as modelEnumValueEntityType, p as featureEntityType, q as modelEnumEntityType, r as zRefBuilder, t as zRefId, u as modelUniqueConstraintEntityType, v as createFeaturesSchema, M as ModelUtils, w as zPluginWrapper, x as omit, y as cloneDeep } from '../model-merger-gxuB007n.js';
2
+ export { S as DefinitionDiffArrayIncludesField, Q as DefinitionDiffKeyedArrayField, R as DefinitionDiffReplacementField, G as DefinitionEntityType, F as FeatureUtils, A as ZodPluginWrapper, E as ZodRef, D as ZodRefBuilder, V as applyDefinitionDiff, N as applyModelMergerDiff, O as applyModelMergerResultInPlace, P as createAndApplyModelMergerResults, U as createDefinitionDiff, T as createDefinitionDiffConfig, I as createFeatureSchema, B as createInitializedPluginSpec, K as createModelMergerResult, L as createModelMergerResults, H as featureNameSchema, J as modelMergerDefinitionDiffConfig } from '../model-merger-gxuB007n.js';
3
+ import { importShared } from '../__federation_fn_import-CxP86CUK.js';
4
4
 
5
5
  function createAdminCrudInputCompilerImplementation() {
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1473,27 +1473,27 @@ function createPluginConfigImplementation() {
1473
1473
  const schemas = new Map();
1474
1474
  const migrationsMap = new Map();
1475
1475
  return {
1476
- registerSchema(pluginId, schema) {
1477
- if (schemas.has(pluginId)) {
1478
- throw new Error(`Schema for plugin ${pluginId} is already registered`);
1476
+ registerSchema(pluginKey, schema) {
1477
+ if (schemas.has(pluginKey)) {
1478
+ throw new Error(`Schema for plugin ${pluginKey} is already registered`);
1479
1479
  }
1480
- schemas.set(pluginId, schema);
1480
+ schemas.set(pluginKey, schema);
1481
1481
  },
1482
- registerMigrations(pluginId, migrations) {
1483
- if (migrationsMap.has(pluginId)) {
1484
- throw new Error(`Migrations for plugin ${pluginId} are already registered`);
1482
+ registerMigrations(pluginKey, migrations) {
1483
+ if (migrationsMap.has(pluginKey)) {
1484
+ throw new Error(`Migrations for plugin ${pluginKey} are already registered`);
1485
1485
  }
1486
1486
  const sortedMigrations = sortAndValidateMigrations(migrations);
1487
- migrationsMap.set(pluginId, sortedMigrations);
1487
+ migrationsMap.set(pluginKey, sortedMigrations);
1488
1488
  },
1489
- getSchema(pluginId) {
1490
- return schemas.get(pluginId);
1489
+ getSchema(pluginKey) {
1490
+ return schemas.get(pluginKey);
1491
1491
  },
1492
- getMigrations(pluginId) {
1493
- return migrationsMap.get(pluginId);
1492
+ getMigrations(pluginKey) {
1493
+ return migrationsMap.get(pluginKey);
1494
1494
  },
1495
- getLastMigrationVersion(pluginId) {
1496
- const migrations = migrationsMap.get(pluginId);
1495
+ getLastMigrationVersion(pluginKey) {
1496
+ const migrations = migrationsMap.get(pluginKey);
1497
1497
  return migrations?.[migrations.length - 1]?.version;
1498
1498
  },
1499
1499
  };
@@ -1518,7 +1518,7 @@ function runPluginMigrations(projectDefinition, pluginImplementationStore) {
1518
1518
  setAutoFreeze(false);
1519
1519
  return produce(projectDefinition, (draft) => {
1520
1520
  for (const pluginDefinition of draft.plugins ?? []) {
1521
- const pluginMigrations = pluginConfigService.getMigrations(pluginEntityType.toUid(pluginDefinition.id));
1521
+ const pluginMigrations = pluginConfigService.getMigrations(pluginEntityType.keyFromId(pluginDefinition.id));
1522
1522
  const currentSchemaVersion = pluginDefinition.configSchemaVersion ?? -1;
1523
1523
  if (!pluginMigrations)
1524
1524
  continue;
@@ -2568,7 +2568,7 @@ const palettesSchema = z$i.object({
2568
2568
  base: paletteSchema,
2569
2569
  primary: paletteSchema,
2570
2570
  });
2571
- const themeSchema = z$i.object({
2571
+ const createThemeSchema = definitionSchema(() => z$i.object({
2572
2572
  palettes: z$i.object({
2573
2573
  base: paletteSchema,
2574
2574
  primary: paletteSchema,
@@ -2577,7 +2577,7 @@ const themeSchema = z$i.object({
2577
2577
  light: themeColorSchema,
2578
2578
  dark: themeColorSchema,
2579
2579
  }),
2580
- });
2580
+ }));
2581
2581
 
2582
2582
  const {z: z$h} = await importShared('zod');
2583
2583
 
@@ -2605,7 +2605,7 @@ const roleArray = z$g
2605
2605
  onDelete: 'DELETE',
2606
2606
  }))
2607
2607
  .optional();
2608
- const modelGraphqlSchema = z$g.object({
2608
+ const createModelGraphqlSchema = definitionSchema(() => z$g.object({
2609
2609
  objectType: z$g
2610
2610
  .object({
2611
2611
  enabled: z$g.boolean().default(false),
@@ -2689,7 +2689,7 @@ const modelGraphqlSchema = z$g.object({
2689
2689
  }),
2690
2690
  })
2691
2691
  .default({}),
2692
- });
2692
+ }));
2693
2693
 
2694
2694
  const {z: z$f} = await importShared('zod');
2695
2695
 
@@ -2705,15 +2705,15 @@ function createModelTransformerType(payload) {
2705
2705
  }
2706
2706
 
2707
2707
  const {z: z$e} = await importShared('zod');
2708
- const passwordTransformerSchema = zEnt(z$e.object({
2708
+ const createPasswordTransformerSchema = definitionSchema(() => zEnt(z$e.object({
2709
2709
  ...baseTransformerFields,
2710
2710
  type: z$e.literal('password'),
2711
2711
  }), {
2712
2712
  type: modelTransformerEntityType,
2713
2713
  parentPath: { context: 'model' },
2714
2714
  getNameResolver: () => 'password',
2715
- });
2716
- const embeddedRelationTransformerSchema = zEnt(z$e.object({
2715
+ }));
2716
+ const createEmbeddedRelationTransformerSchema = definitionSchema(() => zEnt(z$e.object({
2717
2717
  ...baseTransformerFields,
2718
2718
  foreignRelationRef: zRef(z$e.string().min(1), {
2719
2719
  type: modelForeignRelationEntityType,
@@ -2746,16 +2746,16 @@ const embeddedRelationTransformerSchema = zEnt(z$e.object({
2746
2746
  }),
2747
2747
  }).refBuilder((builder) => {
2748
2748
  builder.addPathToContext('modelRef', modelEntityType, 'embeddedModel');
2749
- });
2749
+ }));
2750
2750
  const BUILT_IN_TRANSFORMERS = [
2751
2751
  createModelTransformerType({
2752
2752
  name: 'password',
2753
- schema: passwordTransformerSchema,
2753
+ schema: createPasswordTransformerSchema,
2754
2754
  getName: () => 'Password',
2755
2755
  }),
2756
2756
  createModelTransformerType({
2757
2757
  name: 'embeddedRelation',
2758
- schema: embeddedRelationTransformerSchema,
2758
+ schema: createEmbeddedRelationTransformerSchema,
2759
2759
  getName: (definitionContainer, definition) => definitionContainer.nameFromId(definition.foreignRelationRef),
2760
2760
  }),
2761
2761
  ];
@@ -2771,10 +2771,6 @@ function createModelTransformerImplementation() {
2771
2771
  if (transformers[transformer.name]) {
2772
2772
  throw new Error(`Model transformer with name ${transformer.name} is already registered`);
2773
2773
  }
2774
- // check transformer schema is a zEnt
2775
- if (!(transformer.schema instanceof ZodRef)) {
2776
- throw new TypeError(`Model transformer schema for ${transformer.name} is not a zEnt`);
2777
- }
2778
2774
  transformers[transformer.name] =
2779
2775
  transformer;
2780
2776
  },
@@ -2797,38 +2793,38 @@ const modelTransformerSpec = createPluginSpec('core/model-transformer', {
2797
2793
  defaultInitializer: createModelTransformerImplementation,
2798
2794
  });
2799
2795
 
2800
- const transformerSchema = zWithPlugins((plugins, data) => {
2796
+ const createTransformerSchema = definitionSchema((ctx) => zWithPlugins((plugins, data) => {
2801
2797
  const { type } = baseTransformerSchema.parse(data);
2802
2798
  const transformer = plugins
2803
2799
  .getPluginSpec(modelTransformerSpec)
2804
2800
  .getModelTransformer(type);
2805
- return transformer.schema;
2806
- });
2801
+ return transformer.schema(ctx);
2802
+ }));
2807
2803
 
2808
2804
  const {z: z$d} = await importShared('zod');
2809
- const enumValueSchema = zEnt(z$d.object({
2805
+ const createEnumValueSchema = definitionSchema(() => zEnt(z$d.object({
2810
2806
  name: z$d.string().min(1),
2811
2807
  friendlyName: z$d.string().min(1),
2812
2808
  }), {
2813
2809
  type: modelEnumValueEntityType,
2814
2810
  parentPath: { context: 'enum' },
2815
- });
2816
- const enumBaseSchema = z$d.object({
2811
+ }));
2812
+ const createEnumBaseSchema = definitionSchema((ctx) => z$d.object({
2817
2813
  name: z$d.string().min(1),
2818
2814
  featureRef: zRef(z$d.string().min(1), {
2819
2815
  type: featureEntityType,
2820
2816
  onDelete: 'RESTRICT',
2821
2817
  }),
2822
- values: z$d.array(enumValueSchema),
2818
+ values: z$d.array(createEnumValueSchema(ctx)),
2823
2819
  isExposed: z$d.boolean(),
2824
- });
2825
- const enumSchema = zEnt(enumBaseSchema, {
2820
+ }));
2821
+ const createEnumSchema = definitionSchema((ctx) => zEnt(createEnumBaseSchema(ctx), {
2826
2822
  type: modelEnumEntityType,
2827
2823
  addContext: 'enum',
2828
- });
2824
+ }));
2829
2825
 
2830
2826
  const {z: z$c} = await importShared('zod');
2831
- const modelScalarFieldSchema = zEnt(z$c.object({
2827
+ const createModelScalarFieldSchema = definitionSchema(() => zEnt(z$c.object({
2832
2828
  name: VALIDATORS.CAMEL_CASE_STRING,
2833
2829
  type: z$c.enum(SCALAR_FIELD_TYPES),
2834
2830
  isOptional: z$c.boolean().default(false),
@@ -2890,7 +2886,7 @@ const modelScalarFieldSchema = zEnt(z$c.object({
2890
2886
  };
2891
2887
  }
2892
2888
  return value;
2893
- });
2889
+ }));
2894
2890
  const REFERENTIAL_ACTIONS = [
2895
2891
  'Cascade',
2896
2892
  'Restrict',
@@ -2898,7 +2894,7 @@ const REFERENTIAL_ACTIONS = [
2898
2894
  'SetNull',
2899
2895
  'SetDefault',
2900
2896
  ];
2901
- const modelRelationFieldSchema = zRefBuilder(z$c.object({
2897
+ const createModelRelationFieldSchema = definitionSchema(() => zRefBuilder(z$c.object({
2902
2898
  id: zRefId,
2903
2899
  foreignId: z$c
2904
2900
  .string()
@@ -2937,8 +2933,8 @@ const modelRelationFieldSchema = zRefBuilder(z$c.object({
2937
2933
  getNameResolver: (entity) => entity.foreignRelationName,
2938
2934
  parentPath: 'modelRef',
2939
2935
  });
2940
- });
2941
- const modelUniqueConstraintSchema = zEnt(z$c.object({
2936
+ }));
2937
+ const createModelUniqueConstraintSchema = definitionSchema(() => zEnt(z$c.object({
2942
2938
  fields: z$c.array(z$c.object({
2943
2939
  fieldRef: zRef(z$c.string().min(1), {
2944
2940
  type: modelScalarFieldEntityType,
@@ -2955,8 +2951,8 @@ const modelUniqueConstraintSchema = zEnt(z$c.object({
2955
2951
  resolveName: (entityNames) => entityNames.fields.join('_'),
2956
2952
  });
2957
2953
  },
2958
- });
2959
- const modelServiceSchema = z$c.object({
2954
+ }));
2955
+ const createModelServiceSchema = definitionSchema((ctx) => z$c.object({
2960
2956
  create: z$c
2961
2957
  .object({
2962
2958
  enabled: z$c.boolean().default(false),
@@ -3002,9 +2998,9 @@ const modelServiceSchema = z$c.object({
3002
2998
  .default({
3003
2999
  enabled: false,
3004
3000
  }),
3005
- transformers: z$c.array(transformerSchema).default([]),
3006
- });
3007
- const modelBaseSchema = z$c.object({
3001
+ transformers: z$c.array(createTransformerSchema(ctx)).default([]),
3002
+ }));
3003
+ const createModelBaseSchema = definitionSchema((ctx) => z$c.object({
3008
3004
  id: zRefId,
3009
3005
  name: VALIDATORS.PASCAL_CASE_STRING,
3010
3006
  featureRef: zRef(z$c.string().min(1), {
@@ -3012,8 +3008,8 @@ const modelBaseSchema = z$c.object({
3012
3008
  onDelete: 'RESTRICT',
3013
3009
  }),
3014
3010
  model: z$c.object({
3015
- fields: z$c.array(modelScalarFieldSchema),
3016
- relations: z$c.array(modelRelationFieldSchema).optional(),
3011
+ fields: z$c.array(createModelScalarFieldSchema(ctx)),
3012
+ relations: z$c.array(createModelRelationFieldSchema(ctx)).optional(),
3017
3013
  primaryKeyFieldRefs: z$c
3018
3014
  .array(zRef(z$c.string(), {
3019
3015
  type: modelScalarFieldEntityType,
@@ -3021,20 +3017,22 @@ const modelBaseSchema = z$c.object({
3021
3017
  parentPath: { context: 'model' },
3022
3018
  }))
3023
3019
  .min(1),
3024
- uniqueConstraints: z$c.array(modelUniqueConstraintSchema).optional(),
3020
+ uniqueConstraints: z$c
3021
+ .array(createModelUniqueConstraintSchema(ctx))
3022
+ .optional(),
3025
3023
  }),
3026
- service: modelServiceSchema.default({
3024
+ service: createModelServiceSchema(ctx).default({
3027
3025
  create: { enabled: false },
3028
3026
  update: { enabled: false },
3029
3027
  delete: { enabled: false },
3030
3028
  transformers: [],
3031
3029
  }),
3032
- graphql: modelGraphqlSchema.optional(),
3033
- });
3034
- const modelSchema = zEnt(modelBaseSchema, {
3030
+ graphql: createModelGraphqlSchema(ctx).optional(),
3031
+ }));
3032
+ const createModelSchema = definitionSchema((ctx) => zEnt(createModelBaseSchema(ctx), {
3035
3033
  type: modelEntityType,
3036
3034
  addContext: 'model',
3037
- });
3035
+ }));
3038
3036
 
3039
3037
  const adminSectionEntityType = createEntityType('admin-section', {
3040
3038
  parentType: appEntityType,
@@ -3065,7 +3063,7 @@ const adminCrudEmbeddedFormEntityType = createEntityType('admin-crud-embedded-fo
3065
3063
  });
3066
3064
 
3067
3065
  const {z: z$9} = await importShared('zod');
3068
- const adminCrudTextInputSchema = z$9.object({
3066
+ const createAdminCrudTextInputSchema = definitionSchema(() => z$9.object({
3069
3067
  type: z$9.literal('text'),
3070
3068
  label: z$9.string().min(1),
3071
3069
  modelFieldRef: zRef(z$9.string(), {
@@ -3074,12 +3072,12 @@ const adminCrudTextInputSchema = z$9.object({
3074
3072
  parentPath: { context: 'model' },
3075
3073
  }),
3076
3074
  validation: z$9.string().optional(),
3077
- });
3075
+ }));
3078
3076
  const adminCrudTextInputType = createAdminCrudInputType({
3079
3077
  name: 'text',
3080
- schema: adminCrudTextInputSchema,
3078
+ schema: createAdminCrudTextInputSchema,
3081
3079
  });
3082
- const adminCrudForeignInputSchema = z$9.object({
3080
+ const createAdminCrudForeignInputSchema = definitionSchema(() => z$9.object({
3083
3081
  type: z$9.literal('foreign'),
3084
3082
  label: z$9.string().min(1),
3085
3083
  localRelationRef: zRef(z$9.string(), {
@@ -3091,12 +3089,12 @@ const adminCrudForeignInputSchema = z$9.object({
3091
3089
  valueExpression: z$9.string().min(1),
3092
3090
  defaultLabel: z$9.string().optional(),
3093
3091
  nullLabel: z$9.string().optional(),
3094
- });
3092
+ }));
3095
3093
  const adminCrudForeignInputType = createAdminCrudInputType({
3096
3094
  name: 'foreign',
3097
- schema: adminCrudForeignInputSchema,
3095
+ schema: createAdminCrudForeignInputSchema,
3098
3096
  });
3099
- const adminCrudEnumInputSchema = z$9.object({
3097
+ const createAdminCrudEnumInputSchema = definitionSchema(() => z$9.object({
3100
3098
  type: z$9.literal('enum'),
3101
3099
  label: z$9.string().min(1),
3102
3100
  modelFieldRef: zRef(z$9.string(), {
@@ -3104,12 +3102,12 @@ const adminCrudEnumInputSchema = z$9.object({
3104
3102
  onDelete: 'RESTRICT',
3105
3103
  parentPath: { context: 'model' },
3106
3104
  }),
3107
- });
3105
+ }));
3108
3106
  const adminCrudEnumInputType = createAdminCrudInputType({
3109
3107
  name: 'enum',
3110
- schema: adminCrudEnumInputSchema,
3108
+ schema: createAdminCrudEnumInputSchema,
3111
3109
  });
3112
- const adminCrudEmbeddedInputSchema = z$9.object({
3110
+ const createAdminCrudEmbeddedInputSchema = definitionSchema(() => z$9.object({
3113
3111
  type: z$9.literal('embedded'),
3114
3112
  label: z$9.string().min(1),
3115
3113
  modelRelationRef: zRef(z$9.string(), {
@@ -3122,12 +3120,12 @@ const adminCrudEmbeddedInputSchema = z$9.object({
3122
3120
  parentPath: { context: 'admin-section' },
3123
3121
  onDelete: 'RESTRICT',
3124
3122
  }),
3125
- });
3123
+ }));
3126
3124
  const adminCrudEmbeddedInputType = createAdminCrudInputType({
3127
3125
  name: 'embedded',
3128
- schema: adminCrudEmbeddedInputSchema,
3126
+ schema: createAdminCrudEmbeddedInputSchema,
3129
3127
  });
3130
- const adminCrudEmbeddedLocalInputSchema = z$9.object({
3128
+ const createAdminCrudEmbeddedLocalInputSchema = definitionSchema(() => z$9.object({
3131
3129
  type: z$9.literal('embeddedLocal'),
3132
3130
  label: z$9.string().min(1),
3133
3131
  localRelationRef: zRef(z$9.string(), {
@@ -3140,18 +3138,18 @@ const adminCrudEmbeddedLocalInputSchema = z$9.object({
3140
3138
  parentPath: { context: 'admin-section' },
3141
3139
  onDelete: 'RESTRICT',
3142
3140
  }),
3143
- });
3141
+ }));
3144
3142
  const adminCrudEmbeddedLocalInputType = createAdminCrudInputType({
3145
3143
  name: 'embeddedLocal',
3146
- schema: adminCrudEmbeddedLocalInputSchema,
3144
+ schema: createAdminCrudEmbeddedLocalInputSchema,
3147
3145
  });
3148
- const adminCrudPasswordInputSchema = z$9.object({
3146
+ const createAdminCrudPasswordInputSchema = definitionSchema(() => z$9.object({
3149
3147
  type: z$9.literal('password'),
3150
3148
  label: z$9.string().min(1),
3151
- });
3149
+ }));
3152
3150
  const adminCrudPasswordInputType = createAdminCrudInputType({
3153
3151
  name: 'password',
3154
- schema: adminCrudPasswordInputSchema,
3152
+ schema: createAdminCrudPasswordInputSchema,
3155
3153
  });
3156
3154
  const BUILT_IN_ADMIN_CRUD_INPUTS = [
3157
3155
  adminCrudTextInputType,
@@ -3190,17 +3188,17 @@ const adminCrudInputSpec = createPluginSpec('core/admin-crud-input', {
3190
3188
  defaultInitializer: createAdminCrudInputImplementation,
3191
3189
  });
3192
3190
 
3193
- const adminCrudInputSchema = zWithPlugins((plugins, data) => {
3191
+ const createAdminCrudInputSchema = definitionSchema((ctx) => zWithPlugins((plugins, data) => {
3194
3192
  const { type } = baseAdminCrudInputSchema.parse(data);
3195
3193
  const input = plugins
3196
3194
  .getPluginSpec(adminCrudInputSpec)
3197
3195
  .getAdminCrudInput(type);
3198
- return input.schema;
3199
- });
3196
+ return input.schema(ctx);
3197
+ }));
3200
3198
 
3201
3199
  const {z: z$8} = await importShared('zod');
3202
3200
  // Table Columns
3203
- const adminCrudForeignDisplaySchema = z$8.object({
3201
+ const createAdminCrudForeignDisplaySchema = definitionSchema(() => z$8.object({
3204
3202
  type: z$8.literal('foreign'),
3205
3203
  localRelationRef: zRef(z$8.string(), {
3206
3204
  type: modelLocalRelationEntityType,
@@ -3209,31 +3207,27 @@ const adminCrudForeignDisplaySchema = z$8.object({
3209
3207
  }),
3210
3208
  labelExpression: z$8.string().min(1),
3211
3209
  valueExpression: z$8.string().min(1),
3212
- });
3213
- const adminCrudTextDisplaySchema = z$8.object({
3210
+ }));
3211
+ const createAdminCrudTextDisplaySchema = definitionSchema(() => z$8.object({
3214
3212
  type: z$8.literal('text'),
3215
3213
  modelFieldRef: zRef(z$8.string(), {
3216
3214
  type: modelScalarFieldEntityType,
3217
3215
  onDelete: 'RESTRICT',
3218
3216
  parentPath: { context: 'model' },
3219
3217
  }),
3220
- });
3221
- const adminCrudDisplaySchema = z$8.discriminatedUnion('type', [
3222
- adminCrudTextDisplaySchema,
3223
- adminCrudForeignDisplaySchema,
3224
- ]);
3225
- function primitiveMapToKeys(map) {
3226
- return [...map.keys()]
3227
- .map((m) => m?.valueOf())
3228
- .filter((x) => x !== undefined);
3229
- }
3230
- const adminCrudDisplayTypes = primitiveMapToKeys(adminCrudDisplaySchema.optionsMap);
3231
- const adminCrudTableColumnSchema = z$8.object({
3218
+ }));
3219
+ const createAdminCrudDisplaySchema = definitionSchema((ctx) => z$8.discriminatedUnion('type', [
3220
+ createAdminCrudTextDisplaySchema(ctx),
3221
+ createAdminCrudForeignDisplaySchema(ctx),
3222
+ ]));
3223
+ // TODO: Improve this to be more dynamic in the future
3224
+ const adminCrudDisplayTypes = ['text', 'foreign'];
3225
+ const createAdminCrudTableColumnSchema = definitionSchema((ctx) => z$8.object({
3232
3226
  label: z$8.string().min(1),
3233
- display: adminCrudDisplaySchema,
3234
- });
3227
+ display: createAdminCrudDisplaySchema(ctx),
3228
+ }));
3235
3229
  // Embedded Crud
3236
- const adminCrudEmbeddedObjectSchema = z$8.object({
3230
+ const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z$8.object({
3237
3231
  id: z$8.string().min(1),
3238
3232
  name: z$8.string().min(1),
3239
3233
  modelRef: zRef(z$8.string().min(1), {
@@ -3243,10 +3237,10 @@ const adminCrudEmbeddedObjectSchema = z$8.object({
3243
3237
  includeIdField: z$8.boolean().optional(),
3244
3238
  type: z$8.literal('object'),
3245
3239
  form: z$8.object({
3246
- fields: z$8.array(adminCrudInputSchema),
3240
+ fields: z$8.array(createAdminCrudInputSchema(ctx)),
3247
3241
  }),
3248
- });
3249
- const adminCrudEmbeddedListSchema = z$8.object({
3242
+ }));
3243
+ const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z$8.object({
3250
3244
  id: z$8.string().min(1),
3251
3245
  name: z$8.string().min(1),
3252
3246
  modelRef: zRef(z$8.string().min(1), {
@@ -3258,24 +3252,24 @@ const adminCrudEmbeddedListSchema = z$8.object({
3258
3252
  // NOTE: These two fields need to be synced with crud section schema
3259
3253
  // because the web app expects that (TODO)
3260
3254
  table: z$8.object({
3261
- columns: z$8.array(adminCrudTableColumnSchema),
3255
+ columns: z$8.array(createAdminCrudTableColumnSchema(ctx)),
3262
3256
  }),
3263
3257
  form: z$8.object({
3264
- fields: z$8.array(adminCrudInputSchema),
3258
+ fields: z$8.array(createAdminCrudInputSchema(ctx)),
3265
3259
  }),
3266
- });
3267
- const adminCrudEmbeddedFormSchema = zRefBuilder(z$8.discriminatedUnion('type', [
3268
- adminCrudEmbeddedObjectSchema,
3269
- adminCrudEmbeddedListSchema,
3260
+ }));
3261
+ const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => zRefBuilder(z$8.discriminatedUnion('type', [
3262
+ createAdminCrudEmbeddedObjectSchema(ctx),
3263
+ createAdminCrudEmbeddedListSchema(ctx),
3270
3264
  ]), (builder) => {
3271
3265
  builder.addEntity({
3272
3266
  type: adminCrudEmbeddedFormEntityType,
3273
3267
  parentPath: { context: 'admin-section' },
3274
3268
  });
3275
3269
  builder.addPathToContext('modelRef', modelEntityType, 'model');
3276
- });
3270
+ }));
3277
3271
  // Admin Section
3278
- const adminCrudSectionSchema = zRefBuilder(z$8.object({
3272
+ const createAdminCrudSectionSchema = definitionSchema((ctx) => zRefBuilder(z$8.object({
3279
3273
  ...baseAdminSectionValidators,
3280
3274
  type: z$8.literal('crud'),
3281
3275
  modelRef: zRef(z$8.string().min(1), {
@@ -3284,25 +3278,25 @@ const adminCrudSectionSchema = zRefBuilder(z$8.object({
3284
3278
  }),
3285
3279
  disableCreate: z$8.boolean().optional(),
3286
3280
  table: z$8.object({
3287
- columns: z$8.array(adminCrudTableColumnSchema),
3281
+ columns: z$8.array(createAdminCrudTableColumnSchema(ctx)),
3288
3282
  }),
3289
3283
  form: z$8.object({
3290
- fields: z$8.array(adminCrudInputSchema),
3284
+ fields: z$8.array(createAdminCrudInputSchema(ctx)),
3291
3285
  }),
3292
- embeddedForms: z$8.array(adminCrudEmbeddedFormSchema).optional(),
3286
+ embeddedForms: z$8.array(createAdminCrudEmbeddedFormSchema(ctx)).optional(),
3293
3287
  }), (builder) => {
3294
3288
  builder.addPathToContext('modelRef', modelEntityType, 'model');
3295
- });
3289
+ }));
3296
3290
 
3297
3291
  const {z: z$7} = await importShared('zod');
3298
- const adminSectionSchema = zRefBuilder(adminCrudSectionSchema, (builder) => {
3292
+ const createAdminSectionSchema = definitionSchema((ctx) => zRefBuilder(createAdminCrudSectionSchema(ctx), (builder) => {
3299
3293
  builder.addEntity({
3300
3294
  type: adminSectionEntityType,
3301
3295
  parentPath: { context: 'app' },
3302
3296
  addContext: 'admin-section',
3303
3297
  });
3304
- });
3305
- const adminAppSchema = z$7.object({
3298
+ }));
3299
+ const createAdminAppSchema = definitionSchema((ctx) => z$7.object({
3306
3300
  ...baseAppValidators,
3307
3301
  type: z$7.literal('admin'),
3308
3302
  allowedRoles: z$7
@@ -3311,12 +3305,12 @@ const adminAppSchema = z$7.object({
3311
3305
  onDelete: 'DELETE',
3312
3306
  }))
3313
3307
  .optional(),
3314
- sections: z$7.array(adminSectionSchema).optional(),
3315
- });
3308
+ sections: z$7.array(createAdminSectionSchema(ctx)).optional(),
3309
+ }));
3316
3310
  const adminAppEntryType = createAppEntryType('admin');
3317
3311
 
3318
3312
  const {z: z$6} = await importShared('zod');
3319
- const backendAppSchema = z$6.object({
3313
+ const createBackendAppSchema = definitionSchema(() => z$6.object({
3320
3314
  ...baseAppValidators,
3321
3315
  type: z$6.literal('backend'),
3322
3316
  enableStripe: z$6.boolean().optional(),
@@ -3325,11 +3319,11 @@ const backendAppSchema = z$6.object({
3325
3319
  enablePostmark: z$6.boolean().optional(),
3326
3320
  enableSubscriptions: z$6.boolean().optional(),
3327
3321
  enableAxios: z$6.boolean().optional(),
3328
- });
3322
+ }));
3329
3323
  const backendAppEntryType = createAppEntryType('backend');
3330
3324
 
3331
3325
  const {z: z$5} = await importShared('zod');
3332
- const webAppSchema = z$5.object({
3326
+ const createWebAppSchema = definitionSchema(() => z$5.object({
3333
3327
  ...baseAppValidators,
3334
3328
  type: z$5.literal('web'),
3335
3329
  includeAuth: z$5.boolean().optional(),
@@ -3343,41 +3337,38 @@ const webAppSchema = z$5.object({
3343
3337
  .optional(),
3344
3338
  includeUploadComponents: z$5.boolean().optional(),
3345
3339
  enableSubscriptions: z$5.boolean().optional(),
3346
- });
3340
+ }));
3347
3341
  const webAppEntryType = createAppEntryType('web');
3348
3342
 
3349
- function definitionSchema(creator) {
3350
- return (options) => creator(options);
3351
- }
3352
-
3353
3343
  const {z: z$4} = await importShared('zod');
3354
- const basePluginDefinitionSchema = zEnt(z$4.object({
3344
+ const basePluginDefinitionSchema = z$4.object({
3345
+ id: z$4.string().min(1),
3355
3346
  packageName: z$4.string(),
3356
3347
  name: z$4.string(),
3357
3348
  version: z$4.string(),
3358
3349
  config: z$4.unknown(),
3359
3350
  configSchemaVersion: z$4.number().optional(),
3360
- }), {
3361
- type: pluginEntityType,
3362
3351
  });
3363
- const pluginWithConfigSchema = zWithPlugins((plugins, data) => {
3364
- const parsedBasePluginSchema = basePluginDefinitionSchema.parse(data);
3365
- const pluginId = pluginEntityType.toUid(parsedBasePluginSchema.id);
3352
+ const createPluginWithConfigSchema = definitionSchema(() => zWithPlugins((plugins, data) => {
3353
+ const parsedBasePlugin = basePluginDefinitionSchema.parse(data);
3354
+ const pluginKey = pluginEntityType.keyFromId(parsedBasePlugin.id);
3366
3355
  const configSchema = plugins
3367
3356
  .getPluginSpec(pluginConfigSpec)
3368
- .getSchema(pluginId);
3357
+ .getSchema(pluginKey);
3358
+ const pluginDefinitionWithEnt = zEnt(basePluginDefinitionSchema, {
3359
+ type: pluginEntityType,
3360
+ });
3369
3361
  if (!configSchema) {
3370
- return basePluginDefinitionSchema;
3362
+ return pluginDefinitionWithEnt;
3371
3363
  }
3372
- return basePluginDefinitionSchema.and(z$4.object({
3364
+ return pluginDefinitionWithEnt.and(z$4.object({
3373
3365
  config: configSchema,
3374
3366
  }));
3375
- });
3376
- const pluginsSchema = z$4.array(pluginWithConfigSchema);
3367
+ }));
3368
+ const createPluginsSchema = definitionSchema((ctx) => z$4.array(createPluginWithConfigSchema(ctx)));
3377
3369
 
3378
3370
  const {z: z$3} = await importShared('zod');
3379
-
3380
- const templateExtractorSchema = z$3.object({
3371
+ const createTemplateExtractorSchema = definitionSchema(() => z$3.object({
3381
3372
  /**
3382
3373
  * Whether to write template extractor metadata when writing files to the project.
3383
3374
  *
@@ -3392,7 +3383,7 @@ const templateExtractorSchema = z$3.object({
3392
3383
  * The list is delimited by a newline and can include a * to match any number of characters.
3393
3384
  */
3394
3385
  fileIdRegexWhitelist: z$3.string().default(''),
3395
- });
3386
+ }));
3396
3387
 
3397
3388
  const {z: z$2} = await importShared('zod');
3398
3389
  const generalSettingsSchema = z$2.object({
@@ -3416,32 +3407,32 @@ const generalSettingsSchema = z$2.object({
3416
3407
  .int()
3417
3408
  .refine((portOffset) => portOffset % 1000 === 0, 'Port offset must be a multiple of 1000, e.g. 1000, 2000, 3000, etc.'),
3418
3409
  });
3419
- const createSettingsSchema = definitionSchema(() => z$2.object({
3410
+ const createSettingsSchema = definitionSchema((ctx) => z$2.object({
3420
3411
  general: generalSettingsSchema,
3421
- templateExtractor: templateExtractorSchema.optional(),
3422
- theme: themeSchema.optional(),
3412
+ templateExtractor: createTemplateExtractorSchema(ctx).optional(),
3413
+ theme: createThemeSchema(ctx).optional(),
3423
3414
  }));
3424
3415
 
3425
3416
  const {z: z$1} = await importShared('zod');
3426
- const appSchema = zRefBuilder(z$1.discriminatedUnion('type', [
3427
- backendAppSchema,
3428
- webAppSchema,
3429
- adminAppSchema,
3417
+ const createAppSchema = definitionSchema((ctx) => zRefBuilder(z$1.discriminatedUnion('type', [
3418
+ createBackendAppSchema(ctx),
3419
+ createWebAppSchema(ctx),
3420
+ createAdminAppSchema(ctx),
3430
3421
  ]), (builder) => {
3431
3422
  builder.addEntity({
3432
3423
  type: appEntityType,
3433
3424
  addContext: 'app',
3434
3425
  });
3435
- });
3426
+ }));
3436
3427
  const createProjectDefinitionSchema = definitionSchema((ctx) => z$1.object({
3437
3428
  cliVersion: z$1.string().nullish(),
3438
- apps: z$1.array(appSchema).default([]),
3439
- features: featuresSchema,
3440
- models: z$1.array(modelSchema).default([]),
3441
- enums: z$1.array(enumSchema).optional(),
3429
+ apps: z$1.array(createAppSchema(ctx)).default([]),
3430
+ features: createFeaturesSchema(ctx),
3431
+ models: z$1.array(createModelSchema(ctx)).default([]),
3432
+ enums: z$1.array(createEnumSchema(ctx)).optional(),
3442
3433
  isInitialized: z$1.boolean().default(false),
3443
3434
  schemaVersion: z$1.number(),
3444
- plugins: pluginsSchema.optional(),
3435
+ plugins: createPluginsSchema(ctx).optional(),
3445
3436
  settings: createSettingsSchema(ctx),
3446
3437
  }));
3447
3438
 
@@ -3556,7 +3547,7 @@ function getTransformName(definitionContainer, transformer, pluginStore) {
3556
3547
  const ModelTransformerUtils = { getTransformer, getTransformName };
3557
3548
 
3558
3549
  function byId(projectDefinition, id) {
3559
- const pluginEntityId = pluginEntityType.fromUid(id);
3550
+ const pluginEntityId = pluginEntityType.idFromKey(id);
3560
3551
  const plugin = projectDefinition.plugins?.find((m) => m.id === pluginEntityId);
3561
3552
  return plugin ?? null;
3562
3553
  }
@@ -3573,7 +3564,7 @@ function configByIdOrThrow(projectDefinition, id) {
3573
3564
  }
3574
3565
  function setPluginConfig(projectDefinition, plugin, pluginConfig, pluginImplementationStore) {
3575
3566
  const plugins = projectDefinition.plugins ?? [];
3576
- const pluginEntityId = pluginEntityType.fromUid(plugin.id);
3567
+ const pluginEntityId = pluginEntityType.idFromKey(plugin.id);
3577
3568
  const pluginConfigService = pluginImplementationStore.getPluginSpec(pluginConfigSpec);
3578
3569
  const lastMigrationVersion = pluginConfigService.getLastMigrationVersion(plugin.id);
3579
3570
  projectDefinition.plugins = plugins.some((p) => p.id === pluginEntityId)
@@ -8642,7 +8633,7 @@ const migration011PluginId = createSchemaMigration({
8642
8633
  version: 11,
8643
8634
  name: 'pluginId',
8644
8635
  description: 'Convert plugin ids to use the plugin entity type',
8645
- migrate: (config) => transformJsonPath(config, 'plugins.*.id', (id) => pluginEntityType.fromUid(id)),
8636
+ migrate: (config) => transformJsonPath(config, 'plugins.*.id', (id) => pluginEntityType.idFromKey(id)),
8646
8637
  });
8647
8638
 
8648
8639
  const migration012MigrateAuthConfig = createSchemaMigration({
@@ -9897,5 +9888,5 @@ function generateDefaultTheme() {
9897
9888
  };
9898
9889
  }
9899
9890
 
9900
- export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, 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, ZodRef, ZodRefWrapper, ZodWithPlugins, adminAppEntryType, adminAppSchema, adminCrudDisplaySchema, adminCrudDisplayTypes, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedFormSchema, adminCrudEmbeddedInputSchema, adminCrudEmbeddedInputType, adminCrudEmbeddedListSchema, adminCrudEmbeddedLocalInputSchema, adminCrudEmbeddedLocalInputType, adminCrudEmbeddedObjectSchema, adminCrudEnumInputSchema, adminCrudForeignDisplaySchema, adminCrudForeignInputSchema, adminCrudInputCompilerSpec, adminCrudInputSchema, adminCrudInputSpec, adminCrudPasswordInputSchema, adminCrudSectionSchema, adminCrudTableColumnSchema, adminCrudTextDisplaySchema, adminCrudTextInputSchema, adminSectionEntityType, adminSectionSchema, appCompilerSpec, appEntityType, appSchema, authConfigSpec, authRoleEntityType, backendAppEntryType, backendAppSchema, baseAdminCrudInputSchema, baseAdminSectionValidators, baseAppSchema, baseAppValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminCrudInputCompilerImplementation, createAdminCrudInputImplementation, createAdminCrudInputType, createAppCompiler, createAppCompilerPlugin, createAppEntryType, createDefinitionEntityNameResolver, createEntityType, createModelTransformerCompilerImplementation, createModelTransformerImplementation, createModelTransformerType, createPlatformPluginExport, createPluginConfigImplementation, createPluginImplementationStore, createPluginSpec, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createSettingsSchema, createTestProjectDefinition, createTestProjectDefinitionContainer, createTestProjectDefinitionInput, createWebConfigImplementation, definitionSchema, deserializeSchemaWithReferences, embeddedRelationTransformerSchema, enumBaseSchema, enumSchema, enumValueSchema, featureEntityType, featuresSchema, fixRefDeletions, generalSettingsSchema, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getLatestMigrationVersion, initializePlugins, isMigrateableProjectDefinition, modelBaseSchema, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelGraphqlSchema, modelLocalRelationEntityType, modelRelationFieldSchema, modelScalarFieldEntityType, modelScalarFieldSchema, modelSchema, modelServiceSchema, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, modelUniqueConstraintSchema, oklchColor, paletteSchema, palettesSchema, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, passwordTransformerSchema, pluginConfigSpec, pluginEntityType, pluginManifestJsonSchema, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, pluginWithConfigSchema, pluginsSchema, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, stripEmptyGeneratorChildren, stripUndefinedValues, templateExtractorSchema, themeColorSchema, themeSchema, transformerSchema, undefinedIfEmpty, undefinedIfFalsy, webAppEntryType, webAppSchema, webConfigSpec, zEnt, zPluginWrapper, zRef, zRefBuilder, zRefId, zWithPlugins };
9901
- //# sourceMappingURL=project-builder-lib-GtzVuDsM.js.map
9891
+ export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, 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, ZodRefWrapper, ZodWithPlugins, adminAppEntryType, adminCrudDisplayTypes, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputSpec, adminSectionEntityType, appCompilerSpec, appEntityType, authConfigSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudInputSchema, baseAdminSectionValidators, 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, createAdminSectionSchema, createAppCompiler, createAppCompilerPlugin, createAppEntryType, createAppSchema, createBackendAppSchema, createDefinitionEntityNameResolver, createEmbeddedRelationTransformerSchema, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createFeaturesSchema, createModelBaseSchema, createModelGraphqlSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerCompilerImplementation, createModelTransformerImplementation, createModelTransformerType, createModelUniqueConstraintSchema, createPasswordTransformerSchema, createPlatformPluginExport, createPluginConfigImplementation, createPluginImplementationStore, createPluginSpec, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createSettingsSchema, createTemplateExtractorSchema, createTestProjectDefinition, createTestProjectDefinitionContainer, createTestProjectDefinitionInput, createThemeSchema, createTransformerSchema, createWebAppSchema, createWebConfigImplementation, definitionSchema, deserializeSchemaWithReferences, featureEntityType, fixRefDeletions, generalSettingsSchema, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getLatestMigrationVersion, initializePlugins, isMigrateableProjectDefinition, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, oklchColor, paletteSchema, palettesSchema, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, pluginConfigSpec, pluginEntityType, pluginManifestJsonSchema, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, undefinedIfEmpty, undefinedIfFalsy, webAppEntryType, webConfigSpec, zEnt, zPluginWrapper, zRef, zRefBuilder, zRefId, zWithPlugins };
9892
+ //# sourceMappingURL=project-builder-lib-BAwM_-SS.js.map