@baseplate-dev/plugin-auth 1.0.6 → 1.0.7

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 (1405) hide show
  1. package/CHANGELOG.md +720 -0
  2. package/LICENSE +114 -123
  3. package/README.md +3 -3
  4. package/dist/auth/core/common.d.ts +2 -5
  5. package/dist/auth/core/common.d.ts.map +1 -1
  6. package/dist/auth/core/common.js +15 -18
  7. package/dist/auth/core/common.js.map +1 -1
  8. package/dist/auth/core/components/auth-definition-editor.d.ts.map +1 -1
  9. package/dist/auth/core/components/auth-definition-editor.js +44 -30
  10. package/dist/auth/core/components/auth-definition-editor.js.map +1 -1
  11. package/dist/auth/core/components/role-editor-form/role-dialog.d.ts +12 -0
  12. package/dist/auth/core/components/role-editor-form/role-dialog.d.ts.map +1 -0
  13. package/dist/auth/core/components/role-editor-form/role-dialog.js +29 -0
  14. package/dist/auth/core/components/role-editor-form/role-dialog.js.map +1 -0
  15. package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts +10 -0
  16. package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts.map +1 -0
  17. package/dist/auth/core/components/role-editor-form/role-editor-form.js +52 -0
  18. package/dist/auth/core/components/role-editor-form/role-editor-form.js.map +1 -0
  19. package/dist/auth/core/node.d.ts +3 -3
  20. package/dist/auth/core/node.d.ts.map +1 -1
  21. package/dist/auth/core/node.js +28 -40
  22. package/dist/auth/core/node.js.map +1 -1
  23. package/dist/auth/core/schema/plugin-definition.d.ts +6 -74
  24. package/dist/auth/core/schema/plugin-definition.d.ts.map +1 -1
  25. package/dist/auth/core/schema/plugin-definition.js +5 -20
  26. package/dist/auth/core/schema/plugin-definition.js.map +1 -1
  27. package/dist/auth/core/schema/roles/constants.d.ts.map +1 -0
  28. package/dist/auth/core/schema/roles/constants.js.map +1 -0
  29. package/dist/auth/core/schema/roles/index.d.ts +3 -0
  30. package/dist/auth/core/schema/roles/index.d.ts.map +1 -0
  31. package/dist/auth/core/schema/roles/index.js +3 -0
  32. package/dist/auth/core/schema/roles/index.js.map +1 -0
  33. package/dist/auth/core/schema/roles/schema.d.ts +54 -0
  34. package/dist/auth/core/schema/roles/schema.d.ts.map +1 -0
  35. package/dist/auth/core/schema/roles/schema.js +37 -0
  36. package/dist/auth/core/schema/roles/schema.js.map +1 -0
  37. package/dist/auth/core/web.d.ts +3 -3
  38. package/dist/auth/core/web.d.ts.map +1 -1
  39. package/dist/auth/core/web.js +5 -6
  40. package/dist/auth/core/web.js.map +1 -1
  41. package/dist/auth/index.d.ts +1 -1
  42. package/dist/auth/index.d.ts.map +1 -1
  43. package/dist/auth/index.js +1 -1
  44. package/dist/auth/index.js.map +1 -1
  45. package/dist/auth/plugin.json +8 -0
  46. package/dist/auth/utils/get-auth-plugin-definition.d.ts +9 -0
  47. package/dist/auth/utils/get-auth-plugin-definition.d.ts.map +1 -0
  48. package/dist/auth/utils/get-auth-plugin-definition.js +10 -0
  49. package/dist/auth/utils/get-auth-plugin-definition.js.map +1 -0
  50. package/dist/auth/utils/index.d.ts +2 -0
  51. package/dist/auth/utils/index.d.ts.map +1 -0
  52. package/dist/auth/utils/index.js +2 -0
  53. package/dist/auth/utils/index.js.map +1 -0
  54. package/dist/better-auth/constants/model-names.d.ts +8 -0
  55. package/dist/better-auth/constants/model-names.d.ts.map +1 -0
  56. package/dist/better-auth/constants/model-names.js +8 -0
  57. package/dist/better-auth/constants/model-names.js.map +1 -0
  58. package/dist/better-auth/constants/packages.d.ts +4 -0
  59. package/dist/better-auth/constants/packages.d.ts.map +1 -0
  60. package/dist/better-auth/constants/packages.js +4 -0
  61. package/dist/better-auth/constants/packages.js.map +1 -0
  62. package/dist/better-auth/core/common.d.ts +6 -0
  63. package/dist/better-auth/core/common.d.ts.map +1 -0
  64. package/dist/better-auth/core/common.js +17 -0
  65. package/dist/better-auth/core/common.js.map +1 -0
  66. package/dist/better-auth/core/components/better-auth-definition-editor.d.ts +5 -0
  67. package/dist/better-auth/core/components/better-auth-definition-editor.d.ts.map +1 -0
  68. package/dist/better-auth/core/components/better-auth-definition-editor.js +50 -0
  69. package/dist/better-auth/core/components/better-auth-definition-editor.js.map +1 -0
  70. package/dist/better-auth/core/index.d.ts +2 -0
  71. package/dist/better-auth/core/index.d.ts.map +1 -0
  72. package/dist/better-auth/core/index.js +2 -0
  73. package/dist/better-auth/core/index.js.map +1 -0
  74. package/dist/better-auth/core/node.d.ts +5 -0
  75. package/dist/better-auth/core/node.d.ts.map +1 -0
  76. package/dist/better-auth/core/node.js +47 -0
  77. package/dist/better-auth/core/node.js.map +1 -0
  78. package/dist/better-auth/core/schema/models.d.ts +3 -0
  79. package/dist/better-auth/core/schema/models.d.ts.map +1 -0
  80. package/dist/better-auth/core/schema/models.js +278 -0
  81. package/dist/better-auth/core/schema/models.js.map +1 -0
  82. package/dist/better-auth/core/schema/plugin-definition.d.ts +5 -0
  83. package/dist/better-auth/core/schema/plugin-definition.d.ts.map +1 -0
  84. package/dist/better-auth/core/schema/plugin-definition.js +4 -0
  85. package/dist/better-auth/core/schema/plugin-definition.js.map +1 -0
  86. package/dist/better-auth/core/web.d.ts +6 -0
  87. package/dist/better-auth/core/web.d.ts.map +1 -0
  88. package/dist/better-auth/core/web.js +13 -0
  89. package/dist/better-auth/core/web.js.map +1 -0
  90. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts +85 -0
  91. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts.map +1 -0
  92. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js +75 -0
  93. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js.map +1 -0
  94. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts +142 -0
  95. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts.map +1 -0
  96. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.js +11 -0
  97. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.js.map +1 -0
  98. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.d.ts +16 -0
  99. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.d.ts.map +1 -0
  100. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.js +28 -0
  101. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.js.map +1 -0
  102. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts +73 -0
  103. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts.map +1 -0
  104. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js +84 -0
  105. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js.map +1 -0
  106. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts +30 -0
  107. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts.map +1 -0
  108. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js +37 -0
  109. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js.map +1 -0
  110. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts +65 -0
  111. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts.map +1 -0
  112. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js +72 -0
  113. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js.map +1 -0
  114. package/dist/better-auth/generators/fastify/better-auth-module/index.d.ts +4 -0
  115. package/dist/better-auth/generators/fastify/better-auth-module/index.d.ts.map +1 -0
  116. package/dist/better-auth/generators/fastify/better-auth-module/index.js +3 -0
  117. package/dist/better-auth/generators/fastify/better-auth-module/index.js.map +1 -0
  118. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/plugins/better-auth.plugin.ts +31 -0
  119. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/schema/user-session.queries.ts +22 -0
  120. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/auth.ts +62 -0
  121. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/user-session.service.ts +72 -0
  122. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/utils/headers.utils.ts +21 -0
  123. package/dist/better-auth/generators/fastify/index.d.ts +2 -0
  124. package/dist/better-auth/generators/fastify/index.d.ts.map +1 -0
  125. package/dist/better-auth/generators/fastify/index.js +2 -0
  126. package/dist/better-auth/generators/fastify/index.js.map +1 -0
  127. package/dist/better-auth/generators/index.d.ts.map +1 -0
  128. package/dist/better-auth/generators/index.js.map +1 -0
  129. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts +43 -0
  130. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts.map +1 -0
  131. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.js +37 -0
  132. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.js.map +1 -0
  133. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts +72 -0
  134. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts.map +1 -0
  135. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.js +11 -0
  136. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.js.map +1 -0
  137. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts +14 -0
  138. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts.map +1 -0
  139. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js +26 -0
  140. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js.map +1 -0
  141. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.d.ts +27 -0
  142. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.d.ts.map +1 -0
  143. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.js +43 -0
  144. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.js.map +1 -0
  145. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts +18 -0
  146. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
  147. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js +27 -0
  148. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js.map +1 -0
  149. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts +51 -0
  150. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts.map +1 -0
  151. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js +48 -0
  152. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js.map +1 -0
  153. package/dist/better-auth/generators/react/better-auth-hooks/index.d.ts +2 -0
  154. package/dist/better-auth/generators/react/better-auth-hooks/index.d.ts.map +1 -0
  155. package/dist/better-auth/generators/react/better-auth-hooks/index.js +2 -0
  156. package/dist/better-auth/generators/react/better-auth-hooks/index.js.map +1 -0
  157. package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-log-out.ts +16 -0
  158. package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-session.ts +29 -0
  159. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts +249 -0
  160. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts.map +1 -0
  161. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.js +26 -0
  162. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.js.map +1 -0
  163. package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts +724 -0
  164. package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts.map +1 -0
  165. package/dist/better-auth/generators/react/better-auth-pages/generated/index.js +9 -0
  166. package/dist/better-auth/generators/react/better-auth-pages/generated/index.js.map +1 -0
  167. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.d.ts +13 -0
  168. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.d.ts.map +1 -0
  169. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.js +25 -0
  170. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.js.map +1 -0
  171. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts +250 -0
  172. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts.map +1 -0
  173. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.js +44 -0
  174. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.js.map +1 -0
  175. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts +943 -0
  176. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts.map +1 -0
  177. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.js +35 -0
  178. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.js.map +1 -0
  179. package/dist/better-auth/generators/react/better-auth-pages/index.d.ts +2 -0
  180. package/dist/better-auth/generators/react/better-auth-pages/index.d.ts.map +1 -0
  181. package/dist/better-auth/generators/react/better-auth-pages/index.js +2 -0
  182. package/dist/better-auth/generators/react/better-auth-pages/index.js.map +1 -0
  183. package/dist/better-auth/generators/react/better-auth-pages/templates/routes/login.tsx +144 -0
  184. package/dist/better-auth/generators/react/better-auth-pages/templates/routes/register.tsx +160 -0
  185. package/dist/better-auth/generators/react/index.d.ts +4 -0
  186. package/dist/better-auth/generators/react/index.d.ts.map +1 -0
  187. package/dist/better-auth/generators/react/index.js +4 -0
  188. package/dist/better-auth/generators/react/index.js.map +1 -0
  189. package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts +515 -0
  190. package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts.map +1 -0
  191. package/dist/better-auth/generators/react/react-better-auth/generated/index.js +11 -0
  192. package/dist/better-auth/generators/react/react-better-auth/generated/index.js.map +1 -0
  193. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.d.ts +13 -0
  194. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.d.ts.map +1 -0
  195. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.js +25 -0
  196. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.js.map +1 -0
  197. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts +260 -0
  198. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts.map +1 -0
  199. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.js +51 -0
  200. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.js.map +1 -0
  201. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts +21 -0
  202. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts.map +1 -0
  203. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js +30 -0
  204. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js.map +1 -0
  205. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts +247 -0
  206. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts.map +1 -0
  207. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.js +33 -0
  208. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.js.map +1 -0
  209. package/dist/better-auth/generators/react/react-better-auth/index.d.ts +4 -0
  210. package/dist/better-auth/generators/react/react-better-auth/index.d.ts.map +1 -0
  211. package/dist/better-auth/generators/react/react-better-auth/index.js +3 -0
  212. package/dist/better-auth/generators/react/react-better-auth/index.js.map +1 -0
  213. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts +280 -0
  214. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts.map +1 -0
  215. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.js +74 -0
  216. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.js.map +1 -0
  217. package/dist/better-auth/generators/react/react-better-auth/templates/src/app/auth-loaded-gate.tsx +55 -0
  218. package/dist/better-auth/generators/react/react-better-auth/templates/src/services/auth-client.ts +13 -0
  219. package/dist/better-auth/index.d.ts +3 -0
  220. package/dist/better-auth/index.d.ts.map +1 -0
  221. package/dist/better-auth/index.js +2 -0
  222. package/dist/better-auth/index.js.map +1 -0
  223. package/dist/better-auth/plugin.json +9 -0
  224. package/dist/better-auth/static/icon.svg +10 -0
  225. package/dist/common/components/auth-config-tabs.d.ts +2 -0
  226. package/dist/common/components/auth-config-tabs.d.ts.map +1 -0
  227. package/dist/common/components/auth-config-tabs.js +21 -0
  228. package/dist/common/components/auth-config-tabs.js.map +1 -0
  229. package/dist/index.d.ts +2 -1
  230. package/dist/index.js +1 -1
  231. package/dist/local-auth/admin/common.d.ts +5 -0
  232. package/dist/local-auth/admin/common.d.ts.map +1 -0
  233. package/dist/local-auth/admin/common.js +29 -0
  234. package/dist/local-auth/admin/common.js.map +1 -0
  235. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +488 -0
  236. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +1 -0
  237. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +127 -0
  238. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +1 -0
  239. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +488 -0
  240. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +1 -0
  241. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js +9 -0
  242. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js.map +1 -0
  243. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +12 -0
  244. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +1 -0
  245. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +24 -0
  246. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +1 -0
  247. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +249 -0
  248. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +1 -0
  249. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +41 -0
  250. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +1 -0
  251. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +238 -0
  252. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +1 -0
  253. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +20 -0
  254. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +1 -0
  255. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts +2 -0
  256. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts.map +1 -0
  257. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js +2 -0
  258. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js.map +1 -0
  259. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +22 -0
  260. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +1 -0
  261. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +78 -0
  262. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +1 -0
  263. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +164 -0
  264. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +487 -0
  265. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +1 -0
  266. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +119 -0
  267. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +1 -0
  268. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +488 -0
  269. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +1 -0
  270. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js +9 -0
  271. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js.map +1 -0
  272. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +12 -0
  273. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +1 -0
  274. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +24 -0
  275. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +1 -0
  276. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +249 -0
  277. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +1 -0
  278. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +41 -0
  279. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +1 -0
  280. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +473 -0
  281. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +1 -0
  282. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +22 -0
  283. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +1 -0
  284. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts +2 -0
  285. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts.map +1 -0
  286. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js +2 -0
  287. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js.map +1 -0
  288. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +22 -0
  289. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +1 -0
  290. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +89 -0
  291. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +1 -0
  292. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +171 -0
  293. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +233 -0
  294. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +1 -0
  295. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +54 -0
  296. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +1 -0
  297. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts +2 -0
  298. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts.map +1 -0
  299. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js +2 -0
  300. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js.map +1 -0
  301. package/dist/local-auth/admin/node.d.ts +5 -0
  302. package/dist/local-auth/admin/node.d.ts.map +1 -0
  303. package/dist/local-auth/admin/node.js +57 -0
  304. package/dist/local-auth/admin/node.js.map +1 -0
  305. package/dist/local-auth/admin/schema/manage-role-action.d.ts +12 -0
  306. package/dist/local-auth/admin/schema/manage-role-action.d.ts.map +1 -0
  307. package/dist/local-auth/admin/schema/manage-role-action.js +6 -0
  308. package/dist/local-auth/admin/schema/manage-role-action.js.map +1 -0
  309. package/dist/local-auth/admin/schema/reset-password-action.d.ts +12 -0
  310. package/dist/local-auth/admin/schema/reset-password-action.d.ts.map +1 -0
  311. package/dist/local-auth/admin/schema/reset-password-action.js +6 -0
  312. package/dist/local-auth/admin/schema/reset-password-action.js.map +1 -0
  313. package/dist/local-auth/admin/schema/roles-column.d.ts +9 -0
  314. package/dist/local-auth/admin/schema/roles-column.d.ts.map +1 -0
  315. package/dist/local-auth/admin/schema/roles-column.js +6 -0
  316. package/dist/local-auth/admin/schema/roles-column.js.map +1 -0
  317. package/dist/local-auth/admin/web.d.ts +5 -0
  318. package/dist/local-auth/admin/web.d.ts.map +1 -0
  319. package/dist/local-auth/admin/web.js +39 -0
  320. package/dist/local-auth/admin/web.js.map +1 -0
  321. package/dist/local-auth/constants/model-names.d.ts +23 -0
  322. package/dist/local-auth/constants/model-names.d.ts.map +1 -0
  323. package/dist/local-auth/constants/model-names.js +23 -0
  324. package/dist/local-auth/constants/model-names.js.map +1 -0
  325. package/dist/local-auth/core/common.d.ts +6 -0
  326. package/dist/local-auth/core/common.d.ts.map +1 -0
  327. package/dist/local-auth/core/common.js +17 -0
  328. package/dist/local-auth/core/common.js.map +1 -0
  329. package/dist/local-auth/core/components/local-auth-definition-editor.d.ts +5 -0
  330. package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +1 -0
  331. package/dist/local-auth/core/components/local-auth-definition-editor.js +59 -0
  332. package/dist/local-auth/core/components/local-auth-definition-editor.js.map +1 -0
  333. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +14 -0
  334. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +1 -0
  335. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js +40 -0
  336. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js.map +1 -0
  337. package/dist/local-auth/core/generators/auth-apollo/index.d.ts.map +1 -0
  338. package/dist/local-auth/core/generators/auth-apollo/index.js.map +1 -0
  339. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +1 -0
  340. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js +20 -0
  341. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js.map +1 -0
  342. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.ts +18 -0
  343. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +136 -0
  344. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -0
  345. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +76 -0
  346. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -0
  347. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +359 -0
  348. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -0
  349. package/dist/local-auth/core/generators/auth-email-password/generated/index.js +11 -0
  350. package/dist/local-auth/core/generators/auth-email-password/generated/index.js.map +1 -0
  351. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +18 -0
  352. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -0
  353. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js +30 -0
  354. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -0
  355. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +110 -0
  356. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -0
  357. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +93 -0
  358. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -0
  359. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +45 -0
  360. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -0
  361. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js +46 -0
  362. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -0
  363. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +394 -0
  364. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -0
  365. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +141 -0
  366. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -0
  367. package/dist/local-auth/core/generators/auth-email-password/index.d.ts.map +1 -0
  368. package/dist/local-auth/core/generators/auth-email-password/index.js.map +1 -0
  369. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +17 -0
  370. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -0
  371. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +18 -0
  372. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -0
  373. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +21 -0
  374. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts +2 -0
  375. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts.map +1 -0
  376. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js +24 -0
  377. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js.map +1 -0
  378. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts +35 -0
  379. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts +2 -0
  380. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts.map +1 -0
  381. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js +38 -0
  382. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js.map +1 -0
  383. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts +54 -0
  384. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +1 -0
  385. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +72 -0
  386. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -0
  387. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +91 -0
  388. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +24 -0
  389. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts.map +1 -0
  390. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +87 -0
  391. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js.map +1 -0
  392. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +140 -0
  393. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +37 -0
  394. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts.map +1 -0
  395. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +161 -0
  396. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js.map +1 -0
  397. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +235 -0
  398. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +60 -0
  399. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -0
  400. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +207 -0
  401. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -0
  402. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +330 -0
  403. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +43 -0
  404. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts.map +1 -0
  405. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +48 -0
  406. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js.map +1 -0
  407. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +96 -0
  408. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts.map +1 -0
  409. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js +11 -0
  410. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js.map +1 -0
  411. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +14 -0
  412. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts.map +1 -0
  413. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +26 -0
  414. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js.map +1 -0
  415. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +41 -0
  416. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts.map +1 -0
  417. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +59 -0
  418. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js.map +1 -0
  419. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +60 -0
  420. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts.map +1 -0
  421. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +42 -0
  422. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js.map +1 -0
  423. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts +2 -0
  424. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts.map +1 -0
  425. package/dist/local-auth/core/generators/auth-email-templates/index.js +2 -0
  426. package/dist/local-auth/core/generators/auth-email-templates/index.js.map +1 -0
  427. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts +3 -0
  428. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts.map +1 -0
  429. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js +14 -0
  430. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js.map +1 -0
  431. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
  432. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts +3 -0
  433. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts.map +1 -0
  434. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js +12 -0
  435. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js.map +1 -0
  436. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
  437. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts +3 -0
  438. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts.map +1 -0
  439. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js +14 -0
  440. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js.map +1 -0
  441. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
  442. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +57 -0
  443. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +1 -0
  444. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js +32 -0
  445. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js.map +1 -0
  446. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts +93 -0
  447. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts.map +1 -0
  448. package/dist/local-auth/core/generators/auth-hooks/generated/index.js +11 -0
  449. package/dist/local-auth/core/generators/auth-hooks/generated/index.js.map +1 -0
  450. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts +14 -0
  451. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +1 -0
  452. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js +26 -0
  453. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js.map +1 -0
  454. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts +35 -0
  455. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +1 -0
  456. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js +45 -0
  457. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js.map +1 -0
  458. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +29 -0
  459. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
  460. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js +37 -0
  461. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +1 -0
  462. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts +71 -0
  463. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +1 -0
  464. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js +50 -0
  465. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js.map +1 -0
  466. package/dist/local-auth/core/generators/auth-hooks/index.d.ts +4 -0
  467. package/dist/local-auth/core/generators/auth-hooks/index.d.ts.map +1 -0
  468. package/dist/local-auth/core/generators/auth-hooks/index.js +3 -0
  469. package/dist/local-auth/core/generators/auth-hooks/index.js.map +1 -0
  470. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +3 -0
  471. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
  472. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +30 -0
  473. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
  474. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +33 -0
  475. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +15 -0
  476. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
  477. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +16 -0
  478. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -0
  479. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +32 -0
  480. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
  481. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +15 -0
  482. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
  483. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +16 -0
  484. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +117 -0
  485. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -0
  486. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +103 -0
  487. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -0
  488. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +281 -0
  489. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -0
  490. package/dist/local-auth/core/generators/auth-module/generated/index.js +11 -0
  491. package/dist/local-auth/core/generators/auth-module/generated/index.js.map +1 -0
  492. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +24 -0
  493. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -0
  494. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +36 -0
  495. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +1 -0
  496. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +102 -0
  497. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -0
  498. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +109 -0
  499. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +1 -0
  500. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts +30 -0
  501. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +1 -0
  502. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js +37 -0
  503. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js.map +1 -0
  504. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +269 -0
  505. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -0
  506. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +192 -0
  507. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -0
  508. package/dist/local-auth/core/generators/auth-module/index.d.ts.map +1 -0
  509. package/dist/local-auth/core/generators/auth-module/index.js.map +1 -0
  510. package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +1 -0
  511. package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +1 -0
  512. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts +6 -0
  513. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts.map +1 -0
  514. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js +17 -0
  515. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js.map +1 -0
  516. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.ts +21 -0
  517. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts +8 -0
  518. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts.map +1 -0
  519. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js +16 -0
  520. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js.map +1 -0
  521. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.ts +21 -0
  522. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts +2 -0
  523. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts.map +1 -0
  524. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js +23 -0
  525. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js.map +1 -0
  526. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts +26 -0
  527. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +1 -0
  528. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +19 -0
  529. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +1 -0
  530. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +25 -0
  531. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +1 -0
  532. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +18 -0
  533. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -0
  534. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +22 -0
  535. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +1 -0
  536. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +36 -0
  537. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -0
  538. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +43 -0
  539. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts +40 -0
  540. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts.map +1 -0
  541. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js +106 -0
  542. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js.map +1 -0
  543. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.ts +146 -0
  544. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts +15 -0
  545. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts.map +1 -0
  546. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js +35 -0
  547. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js.map +1 -0
  548. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts +47 -0
  549. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
  550. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +190 -0
  551. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +1 -0
  552. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +262 -0
  553. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +1 -0
  554. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +1 -0
  555. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +1 -0
  556. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js +38 -0
  557. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +1 -0
  558. package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +1 -0
  559. package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +1 -0
  560. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +263 -0
  561. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -0
  562. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +32 -0
  563. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -0
  564. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +1497 -0
  565. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -0
  566. package/dist/local-auth/core/generators/auth-routes/generated/index.js +11 -0
  567. package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +1 -0
  568. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +18 -0
  569. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -0
  570. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +28 -0
  571. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -0
  572. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +264 -0
  573. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -0
  574. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +62 -0
  575. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -0
  576. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +21 -0
  577. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts.map +1 -0
  578. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +30 -0
  579. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js.map +1 -0
  580. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +2206 -0
  581. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -0
  582. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +117 -0
  583. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -0
  584. package/dist/local-auth/core/generators/auth-routes/index.d.ts +4 -0
  585. package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +1 -0
  586. package/dist/local-auth/core/generators/auth-routes/index.js +3 -0
  587. package/dist/local-auth/core/generators/auth-routes/index.js.map +1 -0
  588. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts +10 -0
  589. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts.map +1 -0
  590. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js +11 -0
  591. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js.map +1 -0
  592. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.ts +12 -0
  593. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts +2 -0
  594. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts.map +1 -0
  595. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +60 -0
  596. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js.map +1 -0
  597. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +127 -0
  598. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +7 -0
  599. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -0
  600. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +85 -0
  601. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -0
  602. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +168 -0
  603. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +7 -0
  604. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -0
  605. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +82 -0
  606. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -0
  607. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +153 -0
  608. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts +7 -0
  609. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts.map +1 -0
  610. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +150 -0
  611. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js.map +1 -0
  612. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +283 -0
  613. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +2 -0
  614. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +1 -0
  615. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +1 -0
  616. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts +7 -0
  617. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts.map +1 -0
  618. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +106 -0
  619. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js.map +1 -0
  620. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +206 -0
  621. package/dist/local-auth/core/generators/index.d.ts +10 -0
  622. package/dist/local-auth/core/generators/index.d.ts.map +1 -0
  623. package/dist/local-auth/core/generators/index.js +10 -0
  624. package/dist/local-auth/core/generators/index.js.map +1 -0
  625. package/dist/local-auth/core/generators/react-auth/index.d.ts.map +1 -0
  626. package/dist/local-auth/core/generators/react-auth/index.js.map +1 -0
  627. package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts +9 -0
  628. package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts.map +1 -0
  629. package/dist/local-auth/core/generators/react-auth/react-auth.generator.js +31 -0
  630. package/dist/local-auth/core/generators/react-auth/react-auth.generator.js.map +1 -0
  631. package/dist/local-auth/core/generators/react-session/generated/index.d.ts +546 -0
  632. package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +1 -0
  633. package/dist/local-auth/core/generators/react-session/generated/index.js +11 -0
  634. package/dist/local-auth/core/generators/react-session/generated/index.js.map +1 -0
  635. package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts +13 -0
  636. package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts.map +1 -0
  637. package/dist/local-auth/core/generators/react-session/generated/template-paths.js +25 -0
  638. package/dist/local-auth/core/generators/react-session/generated/template-paths.js.map +1 -0
  639. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +271 -0
  640. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -0
  641. package/dist/local-auth/core/generators/react-session/generated/template-renderers.js +51 -0
  642. package/dist/local-auth/core/generators/react-session/generated/template-renderers.js.map +1 -0
  643. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts +21 -0
  644. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +1 -0
  645. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js +30 -0
  646. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js.map +1 -0
  647. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +525 -0
  648. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -0
  649. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js +35 -0
  650. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js.map +1 -0
  651. package/dist/local-auth/core/generators/react-session/index.d.ts.map +1 -0
  652. package/dist/local-auth/core/generators/react-session/index.js.map +1 -0
  653. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +290 -0
  654. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -0
  655. package/dist/local-auth/core/generators/react-session/react-session.generator.js +48 -0
  656. package/dist/local-auth/core/generators/react-session/react-session.generator.js.map +1 -0
  657. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +1 -0
  658. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js +72 -0
  659. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +1 -0
  660. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +99 -0
  661. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +58 -0
  662. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +1 -0
  663. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js +103 -0
  664. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js.map +1 -0
  665. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.ts +122 -0
  666. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +99 -0
  667. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +1 -0
  668. package/dist/local-auth/core/generators/seed-initial-user/generated/index.js +11 -0
  669. package/dist/local-auth/core/generators/seed-initial-user/generated/index.js.map +1 -0
  670. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts +12 -0
  671. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts.map +1 -0
  672. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js +24 -0
  673. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js.map +1 -0
  674. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +50 -0
  675. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +1 -0
  676. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js +46 -0
  677. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js.map +1 -0
  678. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.d.ts +18 -0
  679. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.d.ts.map +1 -0
  680. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.js +26 -0
  681. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.js.map +1 -0
  682. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +39 -0
  683. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +1 -0
  684. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js +21 -0
  685. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js.map +1 -0
  686. package/dist/local-auth/core/generators/seed-initial-user/index.d.ts +4 -0
  687. package/dist/local-auth/core/generators/seed-initial-user/index.d.ts.map +1 -0
  688. package/dist/local-auth/core/generators/seed-initial-user/index.js +3 -0
  689. package/dist/local-auth/core/generators/seed-initial-user/index.js.map +1 -0
  690. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +58 -0
  691. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +1 -0
  692. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +57 -0
  693. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +1 -0
  694. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts +3 -0
  695. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts.map +1 -0
  696. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js +32 -0
  697. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js.map +1 -0
  698. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.ts +43 -0
  699. package/dist/local-auth/core/index.d.ts.map +1 -0
  700. package/dist/local-auth/core/index.js.map +1 -0
  701. package/dist/local-auth/core/node.d.ts +5 -0
  702. package/dist/local-auth/core/node.d.ts.map +1 -0
  703. package/dist/local-auth/core/node.js +69 -0
  704. package/dist/local-auth/core/node.js.map +1 -0
  705. package/dist/local-auth/core/schema/models.d.ts +3 -0
  706. package/dist/local-auth/core/schema/models.d.ts.map +1 -0
  707. package/dist/local-auth/core/schema/models.js +266 -0
  708. package/dist/local-auth/core/schema/models.js.map +1 -0
  709. package/dist/local-auth/core/schema/plugin-definition.d.ts +9 -0
  710. package/dist/local-auth/core/schema/plugin-definition.d.ts.map +1 -0
  711. package/dist/local-auth/core/schema/plugin-definition.js +13 -0
  712. package/dist/local-auth/core/schema/plugin-definition.js.map +1 -0
  713. package/dist/local-auth/core/web.d.ts +6 -0
  714. package/dist/local-auth/core/web.d.ts.map +1 -0
  715. package/dist/local-auth/core/web.js +13 -0
  716. package/dist/local-auth/core/web.js.map +1 -0
  717. package/dist/local-auth/index.d.ts +2 -0
  718. package/dist/local-auth/index.d.ts.map +1 -0
  719. package/dist/local-auth/index.js +2 -0
  720. package/dist/local-auth/index.js.map +1 -0
  721. package/dist/local-auth/plugin.json +9 -0
  722. package/dist/local-auth/static/icon.svg +1 -0
  723. package/dist/placeholder-auth/constants/model-names.d.ts +4 -0
  724. package/dist/placeholder-auth/constants/model-names.d.ts.map +1 -0
  725. package/dist/placeholder-auth/constants/model-names.js +4 -0
  726. package/dist/placeholder-auth/constants/model-names.js.map +1 -0
  727. package/dist/placeholder-auth/core/common.d.ts +2 -5
  728. package/dist/placeholder-auth/core/common.d.ts.map +1 -1
  729. package/dist/placeholder-auth/core/common.js +11 -20
  730. package/dist/placeholder-auth/core/common.js.map +1 -1
  731. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +1 -1
  732. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +21 -29
  733. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +1 -1
  734. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +3 -12
  735. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +1 -1
  736. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +0 -2
  737. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts.map +1 -1
  738. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +0 -2
  739. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js.map +1 -1
  740. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts +1 -7
  741. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts.map +1 -1
  742. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js +2 -14
  743. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js.map +1 -1
  744. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +3 -1
  745. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +1 -1
  746. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +1 -1
  747. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +1 -1
  748. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +0 -15
  749. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +1 -1
  750. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +7 -32
  751. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +1 -1
  752. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +4 -6
  753. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +1 -1
  754. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js +1 -7
  755. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js.map +1 -1
  756. package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts +3 -1
  757. package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts.map +1 -1
  758. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +4 -0
  759. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts.map +1 -1
  760. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +2 -0
  761. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts.map +1 -1
  762. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +2 -0
  763. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts.map +1 -1
  764. package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts +1 -1
  765. package/dist/placeholder-auth/core/node.d.ts +3 -3
  766. package/dist/placeholder-auth/core/node.d.ts.map +1 -1
  767. package/dist/placeholder-auth/core/node.js +11 -17
  768. package/dist/placeholder-auth/core/node.js.map +1 -1
  769. package/dist/placeholder-auth/core/schema/models.d.ts +2 -5
  770. package/dist/placeholder-auth/core/schema/models.d.ts.map +1 -1
  771. package/dist/placeholder-auth/core/schema/models.js +31 -28
  772. package/dist/placeholder-auth/core/schema/models.js.map +1 -1
  773. package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +2 -79
  774. package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +1 -1
  775. package/dist/placeholder-auth/core/schema/plugin-definition.js +2 -15
  776. package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -1
  777. package/dist/placeholder-auth/core/web.d.ts +3 -3
  778. package/dist/placeholder-auth/core/web.d.ts.map +1 -1
  779. package/dist/placeholder-auth/core/web.js +5 -6
  780. package/dist/placeholder-auth/core/web.js.map +1 -1
  781. package/dist/placeholder-auth/plugin.json +10 -0
  782. package/dist/web/assets/__federation_expose_authCoreCommon-CnNoa4tF.js +30 -0
  783. package/dist/web/assets/__federation_expose_authCoreCommon-CnNoa4tF.js.map +1 -0
  784. package/dist/web/assets/__federation_expose_authCoreWeb-BL_U7yuj.js +433 -0
  785. package/dist/web/assets/__federation_expose_authCoreWeb-BL_U7yuj.js.map +1 -0
  786. package/dist/web/assets/__federation_expose_better-authCoreCommon-D-mTcxYO.js +20 -0
  787. package/dist/web/assets/__federation_expose_better-authCoreCommon-D-mTcxYO.js.map +1 -0
  788. package/dist/web/assets/__federation_expose_better-authCoreWeb-CXHL-Ghf.js +402 -0
  789. package/dist/web/assets/__federation_expose_better-authCoreWeb-CXHL-Ghf.js.map +1 -0
  790. package/dist/web/assets/__federation_expose_local-authAdminCommon-LIsARRNU.js +63 -0
  791. package/dist/web/assets/__federation_expose_local-authAdminCommon-LIsARRNU.js.map +1 -0
  792. package/dist/web/assets/__federation_expose_local-authAdminWeb-DyYUDLm9.js +41 -0
  793. package/dist/web/assets/__federation_expose_local-authAdminWeb-DyYUDLm9.js.map +1 -0
  794. package/dist/web/assets/__federation_expose_local-authCoreCommon-p_UbExc7.js +21 -0
  795. package/dist/web/assets/__federation_expose_local-authCoreCommon-p_UbExc7.js.map +1 -0
  796. package/dist/web/assets/__federation_expose_local-authCoreWeb-8TcUJFT6.js +432 -0
  797. package/dist/web/assets/__federation_expose_local-authCoreWeb-8TcUJFT6.js.map +1 -0
  798. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CtZXaDUc.js +23 -0
  799. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CtZXaDUc.js.map +1 -0
  800. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CZAKokTb.js +162 -0
  801. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CZAKokTb.js.map +1 -0
  802. package/dist/web/assets/__federation_fn_import-3DENgil8.js +421 -0
  803. package/dist/web/assets/__federation_fn_import-3DENgil8.js.map +1 -0
  804. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-B5bdbzFj.js +357 -0
  805. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-B5bdbzFj.js.map +1 -0
  806. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-DCA3vO4J.js +21478 -0
  807. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-DCA3vO4J.js.map +1 -0
  808. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BvL7RO9S.js +73599 -0
  809. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BvL7RO9S.js.map +1 -0
  810. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-0-N5BG4T.js +1822 -0
  811. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-0-N5BG4T.js.map +1 -0
  812. package/dist/web/assets/__federation_shared_@tanstack/react-router-DSniiJ6U.js +6565 -0
  813. package/dist/web/assets/__federation_shared_@tanstack/react-router-DSniiJ6U.js.map +1 -0
  814. package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js +8 -0
  815. package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js.map +1 -0
  816. package/dist/web/assets/__federation_shared_react-dom-B4vgf5Ln.js +251 -0
  817. package/dist/web/assets/__federation_shared_react-dom-B4vgf5Ln.js.map +1 -0
  818. package/dist/web/assets/__federation_shared_zod-Do7Aa1b5.js +13250 -0
  819. package/dist/web/assets/__federation_shared_zod-Do7Aa1b5.js.map +1 -0
  820. package/dist/web/assets/_commonjsHelpers-B85MJLTf.js +6 -0
  821. package/dist/web/assets/_commonjsHelpers-B85MJLTf.js.map +1 -0
  822. package/dist/web/assets/get-auth-plugin-definition-DHcbFujw.js +13 -0
  823. package/dist/web/assets/get-auth-plugin-definition-DHcbFujw.js.map +1 -0
  824. package/dist/web/assets/index-DQKNnI1w.js +103 -0
  825. package/dist/web/assets/index-DQKNnI1w.js.map +1 -0
  826. package/dist/web/assets/index-DUwCgkeV.js +570 -0
  827. package/dist/web/assets/index-DUwCgkeV.js.map +1 -0
  828. package/dist/web/assets/index.esm-Dpqxgpya.js +2676 -0
  829. package/dist/web/assets/index.esm-Dpqxgpya.js.map +1 -0
  830. package/dist/web/assets/isEqual-tnzoadW8.js +242 -0
  831. package/dist/web/assets/isEqual-tnzoadW8.js.map +1 -0
  832. package/dist/web/assets/jsx-runtime-XI9uIe3W.js +60 -0
  833. package/dist/web/assets/jsx-runtime-XI9uIe3W.js.map +1 -0
  834. package/dist/web/assets/mergeWith-VagwCqUi.js +76 -0
  835. package/dist/web/assets/mergeWith-VagwCqUi.js.map +1 -0
  836. package/dist/web/assets/model-names-DrcaRxt1.js +25 -0
  837. package/dist/web/assets/model-names-DrcaRxt1.js.map +1 -0
  838. package/dist/web/assets/model-utils-BFX3c3dn.js +694 -0
  839. package/dist/web/assets/model-utils-BFX3c3dn.js.map +1 -0
  840. package/dist/web/assets/plugin-definition-B86WQ7Ni.js +79 -0
  841. package/dist/web/assets/plugin-definition-B86WQ7Ni.js.map +1 -0
  842. package/dist/web/assets/plugin-definition-CEQb6mWV.js +20 -0
  843. package/dist/web/assets/plugin-definition-CEQb6mWV.js.map +1 -0
  844. package/dist/web/assets/plugin-definition-DrsKbcJc.js +31 -0
  845. package/dist/web/assets/plugin-definition-DrsKbcJc.js.map +1 -0
  846. package/dist/web/assets/plugin-definition-KEpaSB6p.js +16 -0
  847. package/dist/web/assets/plugin-definition-KEpaSB6p.js.map +1 -0
  848. package/dist/web/assets/react-hu8Hx0R4.js +47 -0
  849. package/dist/web/assets/react-hu8Hx0R4.js.map +1 -0
  850. package/dist/web/assets/registries-Tz_dluz3.js +1119 -0
  851. package/dist/web/assets/registries-Tz_dluz3.js.map +1 -0
  852. package/dist/web/assets/remoteEntry.js +26 -14
  853. package/dist/web/assets/remoteEntry.js.map +1 -1
  854. package/dist/web/assets/style-DiK_rD1L.css +120 -0
  855. package/dist/web/assets/styles-CpKtlIgU.js +69 -0
  856. package/dist/web/assets/styles-CpKtlIgU.js.map +1 -0
  857. package/dist/web/assets/with-selector-DTXBONcE.js +201 -0
  858. package/dist/web/assets/with-selector-DTXBONcE.js.map +1 -0
  859. package/dist/web/index.html +1 -1
  860. package/package.json +42 -36
  861. package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +0 -28
  862. package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +0 -1
  863. package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js +0 -43
  864. package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js.map +0 -1
  865. package/dist/auth/core/generators/auth-apollo/index.d.ts.map +0 -1
  866. package/dist/auth/core/generators/auth-apollo/index.js.map +0 -1
  867. package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +0 -1
  868. package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js +0 -15
  869. package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js.map +0 -1
  870. package/dist/auth/core/generators/auth-apollo/templates/session-error-link.ts +0 -16
  871. package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +0 -73
  872. package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +0 -1
  873. package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js +0 -40
  874. package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js.map +0 -1
  875. package/dist/auth/core/generators/auth-email-password/generated/index.d.ts +0 -124
  876. package/dist/auth/core/generators/auth-email-password/generated/index.d.ts.map +0 -1
  877. package/dist/auth/core/generators/auth-email-password/generated/index.js +0 -11
  878. package/dist/auth/core/generators/auth-email-password/generated/index.js.map +0 -1
  879. package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts +0 -14
  880. package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +0 -1
  881. package/dist/auth/core/generators/auth-email-password/generated/template-paths.js +0 -26
  882. package/dist/auth/core/generators/auth-email-password/generated/template-paths.js.map +0 -1
  883. package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts +0 -58
  884. package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +0 -1
  885. package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js +0 -55
  886. package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js.map +0 -1
  887. package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +0 -25
  888. package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +0 -1
  889. package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js +0 -32
  890. package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +0 -1
  891. package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts +0 -105
  892. package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +0 -1
  893. package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js +0 -58
  894. package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js.map +0 -1
  895. package/dist/auth/core/generators/auth-email-password/index.d.ts.map +0 -1
  896. package/dist/auth/core/generators/auth-email-password/index.js.map +0 -1
  897. package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +0 -2
  898. package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +0 -1
  899. package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +0 -3
  900. package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +0 -1
  901. package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +0 -3
  902. package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +0 -1
  903. package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +0 -33
  904. package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +0 -1
  905. package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +0 -44
  906. package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +0 -21
  907. package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +0 -1
  908. package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +0 -74
  909. package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +0 -1
  910. package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +0 -121
  911. package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +0 -61
  912. package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +0 -1
  913. package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js +0 -33
  914. package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js.map +0 -1
  915. package/dist/auth/core/generators/auth-hooks/generated/index.d.ts +0 -127
  916. package/dist/auth/core/generators/auth-hooks/generated/index.d.ts.map +0 -1
  917. package/dist/auth/core/generators/auth-hooks/generated/index.js +0 -11
  918. package/dist/auth/core/generators/auth-hooks/generated/index.js.map +0 -1
  919. package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts +0 -17
  920. package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +0 -1
  921. package/dist/auth/core/generators/auth-hooks/generated/template-paths.js +0 -27
  922. package/dist/auth/core/generators/auth-hooks/generated/template-paths.js.map +0 -1
  923. package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts +0 -47
  924. package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +0 -1
  925. package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js +0 -50
  926. package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js.map +0 -1
  927. package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +0 -16
  928. package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +0 -1
  929. package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js +0 -27
  930. package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +0 -1
  931. package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts +0 -131
  932. package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +0 -1
  933. package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js +0 -83
  934. package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js.map +0 -1
  935. package/dist/auth/core/generators/auth-hooks/index.d.ts +0 -2
  936. package/dist/auth/core/generators/auth-hooks/index.d.ts.map +0 -1
  937. package/dist/auth/core/generators/auth-hooks/index.js +0 -2
  938. package/dist/auth/core/generators/auth-hooks/index.js.map +0 -1
  939. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts +0 -18
  940. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
  941. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.gql +0 -10
  942. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js +0 -22
  943. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
  944. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts +0 -39
  945. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +0 -2
  946. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +0 -1
  947. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.gql +0 -5
  948. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +0 -27
  949. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +0 -1
  950. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +0 -29
  951. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +0 -8
  952. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +0 -1
  953. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +0 -12
  954. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +0 -1
  955. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +0 -16
  956. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +0 -1
  957. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +0 -15
  958. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +0 -1
  959. package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +0 -16
  960. package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts +0 -94
  961. package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts.map +0 -1
  962. package/dist/auth/core/generators/auth-module/auth-module.generator.js +0 -70
  963. package/dist/auth/core/generators/auth-module/auth-module.generator.js.map +0 -1
  964. package/dist/auth/core/generators/auth-module/generated/index.d.ts +0 -182
  965. package/dist/auth/core/generators/auth-module/generated/index.d.ts.map +0 -1
  966. package/dist/auth/core/generators/auth-module/generated/index.js +0 -11
  967. package/dist/auth/core/generators/auth-module/generated/index.js.map +0 -1
  968. package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts +0 -19
  969. package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts.map +0 -1
  970. package/dist/auth/core/generators/auth-module/generated/template-paths.js +0 -29
  971. package/dist/auth/core/generators/auth-module/generated/template-paths.js.map +0 -1
  972. package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts +0 -80
  973. package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts.map +0 -1
  974. package/dist/auth/core/generators/auth-module/generated/template-renderers.js +0 -79
  975. package/dist/auth/core/generators/auth-module/generated/template-renderers.js.map +0 -1
  976. package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts +0 -22
  977. package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +0 -1
  978. package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js +0 -31
  979. package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js.map +0 -1
  980. package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts +0 -134
  981. package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts.map +0 -1
  982. package/dist/auth/core/generators/auth-module/generated/typed-templates.js +0 -113
  983. package/dist/auth/core/generators/auth-module/generated/typed-templates.js.map +0 -1
  984. package/dist/auth/core/generators/auth-module/index.d.ts.map +0 -1
  985. package/dist/auth/core/generators/auth-module/index.js.map +0 -1
  986. package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +0 -1
  987. package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +0 -1
  988. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +0 -1
  989. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +0 -17
  990. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +0 -1
  991. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +0 -23
  992. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +0 -1
  993. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +0 -18
  994. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +0 -1
  995. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +0 -22
  996. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +0 -1
  997. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +0 -19
  998. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +0 -1
  999. package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +0 -23
  1000. package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +0 -1
  1001. package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js +0 -180
  1002. package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +0 -1
  1003. package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.ts +0 -250
  1004. package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +0 -1
  1005. package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +0 -1
  1006. package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +0 -1
  1007. package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js +0 -38
  1008. package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +0 -1
  1009. package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +0 -1
  1010. package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +0 -1
  1011. package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts +0 -176
  1012. package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +0 -1
  1013. package/dist/auth/core/generators/auth-routes/auth-routes.generator.js +0 -38
  1014. package/dist/auth/core/generators/auth-routes/auth-routes.generator.js.map +0 -1
  1015. package/dist/auth/core/generators/auth-routes/generated/index.d.ts +0 -495
  1016. package/dist/auth/core/generators/auth-routes/generated/index.d.ts.map +0 -1
  1017. package/dist/auth/core/generators/auth-routes/generated/index.js +0 -9
  1018. package/dist/auth/core/generators/auth-routes/generated/index.js.map +0 -1
  1019. package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts +0 -15
  1020. package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts.map +0 -1
  1021. package/dist/auth/core/generators/auth-routes/generated/template-paths.js +0 -25
  1022. package/dist/auth/core/generators/auth-routes/generated/template-paths.js.map +0 -1
  1023. package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts +0 -176
  1024. package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +0 -1
  1025. package/dist/auth/core/generators/auth-routes/generated/template-renderers.js +0 -55
  1026. package/dist/auth/core/generators/auth-routes/generated/template-renderers.js.map +0 -1
  1027. package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts +0 -638
  1028. package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +0 -1
  1029. package/dist/auth/core/generators/auth-routes/generated/typed-templates.js +0 -57
  1030. package/dist/auth/core/generators/auth-routes/generated/typed-templates.js.map +0 -1
  1031. package/dist/auth/core/generators/auth-routes/index.d.ts +0 -2
  1032. package/dist/auth/core/generators/auth-routes/index.d.ts.map +0 -1
  1033. package/dist/auth/core/generators/auth-routes/index.js +0 -2
  1034. package/dist/auth/core/generators/auth-routes/index.js.map +0 -1
  1035. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +0 -2
  1036. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +0 -1
  1037. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js +0 -85
  1038. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +0 -1
  1039. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +0 -161
  1040. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/queries.gql +0 -15
  1041. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +0 -2
  1042. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +0 -1
  1043. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js +0 -77
  1044. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +0 -1
  1045. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +0 -148
  1046. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +0 -2
  1047. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +0 -1
  1048. package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +0 -1
  1049. package/dist/auth/core/generators/index.d.ts +0 -8
  1050. package/dist/auth/core/generators/index.d.ts.map +0 -1
  1051. package/dist/auth/core/generators/index.js +0 -8
  1052. package/dist/auth/core/generators/index.js.map +0 -1
  1053. package/dist/auth/core/generators/react-auth/index.d.ts.map +0 -1
  1054. package/dist/auth/core/generators/react-auth/index.js.map +0 -1
  1055. package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts +0 -9
  1056. package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts.map +0 -1
  1057. package/dist/auth/core/generators/react-auth/react-auth.generator.js +0 -31
  1058. package/dist/auth/core/generators/react-auth/react-auth.generator.js.map +0 -1
  1059. package/dist/auth/core/generators/react-session/generated/index.d.ts +0 -74
  1060. package/dist/auth/core/generators/react-session/generated/index.d.ts.map +0 -1
  1061. package/dist/auth/core/generators/react-session/generated/index.js +0 -11
  1062. package/dist/auth/core/generators/react-session/generated/index.js.map +0 -1
  1063. package/dist/auth/core/generators/react-session/generated/template-paths.d.ts +0 -16
  1064. package/dist/auth/core/generators/react-session/generated/template-paths.d.ts.map +0 -1
  1065. package/dist/auth/core/generators/react-session/generated/template-paths.js +0 -26
  1066. package/dist/auth/core/generators/react-session/generated/template-paths.js.map +0 -1
  1067. package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts +0 -27
  1068. package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts.map +0 -1
  1069. package/dist/auth/core/generators/react-session/generated/template-renderers.js +0 -49
  1070. package/dist/auth/core/generators/react-session/generated/template-renderers.js.map +0 -1
  1071. package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts +0 -64
  1072. package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +0 -1
  1073. package/dist/auth/core/generators/react-session/generated/ts-import-providers.js +0 -42
  1074. package/dist/auth/core/generators/react-session/generated/ts-import-providers.js.map +0 -1
  1075. package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts +0 -46
  1076. package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts.map +0 -1
  1077. package/dist/auth/core/generators/react-session/generated/typed-templates.js +0 -82
  1078. package/dist/auth/core/generators/react-session/generated/typed-templates.js.map +0 -1
  1079. package/dist/auth/core/generators/react-session/index.d.ts.map +0 -1
  1080. package/dist/auth/core/generators/react-session/index.js.map +0 -1
  1081. package/dist/auth/core/generators/react-session/react-session.generator.d.ts +0 -58
  1082. package/dist/auth/core/generators/react-session/react-session.generator.d.ts.map +0 -1
  1083. package/dist/auth/core/generators/react-session/react-session.generator.js +0 -54
  1084. package/dist/auth/core/generators/react-session/react-session.generator.js.map +0 -1
  1085. package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts +0 -7
  1086. package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts.map +0 -1
  1087. package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.gql +0 -6
  1088. package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js +0 -25
  1089. package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js.map +0 -1
  1090. package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.tsx +0 -28
  1091. package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +0 -1
  1092. package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js +0 -18
  1093. package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +0 -1
  1094. package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +0 -45
  1095. package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts +0 -12
  1096. package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts.map +0 -1
  1097. package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js +0 -15
  1098. package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js.map +0 -1
  1099. package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts +0 -30
  1100. package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +0 -79
  1101. package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +0 -1
  1102. package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js +0 -133
  1103. package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js.map +0 -1
  1104. package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.ts +0 -153
  1105. package/dist/auth/core/index.d.ts.map +0 -1
  1106. package/dist/auth/core/index.js.map +0 -1
  1107. package/dist/auth/core/schema/models.d.ts +0 -9
  1108. package/dist/auth/core/schema/models.d.ts.map +0 -1
  1109. package/dist/auth/core/schema/models.js +0 -203
  1110. package/dist/auth/core/schema/models.js.map +0 -1
  1111. package/dist/auth/metadata.json +0 -8
  1112. package/dist/auth0/constants/packages.d.ts +0 -6
  1113. package/dist/auth0/constants/packages.d.ts.map +0 -1
  1114. package/dist/auth0/constants/packages.js +0 -6
  1115. package/dist/auth0/constants/packages.js.map +0 -1
  1116. package/dist/auth0/core/common.d.ts +0 -7
  1117. package/dist/auth0/core/common.d.ts.map +0 -1
  1118. package/dist/auth0/core/common.js +0 -28
  1119. package/dist/auth0/core/common.js.map +0 -1
  1120. package/dist/auth0/core/components/auth-definition-editor.d.ts +0 -5
  1121. package/dist/auth0/core/components/auth-definition-editor.d.ts.map +0 -1
  1122. package/dist/auth0/core/components/auth-definition-editor.js +0 -61
  1123. package/dist/auth0/core/components/auth-definition-editor.js.map +0 -1
  1124. package/dist/auth0/core/node.d.ts +0 -5
  1125. package/dist/auth0/core/node.d.ts.map +0 -1
  1126. package/dist/auth0/core/node.js +0 -49
  1127. package/dist/auth0/core/node.js.map +0 -1
  1128. package/dist/auth0/core/schema/migrations.d.ts +0 -3
  1129. package/dist/auth0/core/schema/migrations.d.ts.map +0 -1
  1130. package/dist/auth0/core/schema/migrations.js +0 -19
  1131. package/dist/auth0/core/schema/migrations.js.map +0 -1
  1132. package/dist/auth0/core/schema/models.d.ts +0 -6
  1133. package/dist/auth0/core/schema/models.d.ts.map +0 -1
  1134. package/dist/auth0/core/schema/models.js +0 -39
  1135. package/dist/auth0/core/schema/models.js.map +0 -1
  1136. package/dist/auth0/core/schema/plugin-definition.d.ts +0 -83
  1137. package/dist/auth0/core/schema/plugin-definition.d.ts.map +0 -1
  1138. package/dist/auth0/core/schema/plugin-definition.js +0 -17
  1139. package/dist/auth0/core/schema/plugin-definition.js.map +0 -1
  1140. package/dist/auth0/core/web.d.ts +0 -6
  1141. package/dist/auth0/core/web.d.ts.map +0 -1
  1142. package/dist/auth0/core/web.js +0 -14
  1143. package/dist/auth0/core/web.js.map +0 -1
  1144. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +0 -75
  1145. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +0 -1
  1146. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +0 -120
  1147. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +0 -1
  1148. package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +0 -105
  1149. package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +0 -1
  1150. package/dist/auth0/generators/fastify/auth0-module/generated/index.js +0 -11
  1151. package/dist/auth0/generators/fastify/auth0-module/generated/index.js.map +0 -1
  1152. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts +0 -13
  1153. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts.map +0 -1
  1154. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js +0 -23
  1155. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js.map +0 -1
  1156. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts +0 -55
  1157. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts.map +0 -1
  1158. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js +0 -52
  1159. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js.map +0 -1
  1160. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts +0 -10
  1161. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts.map +0 -1
  1162. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js +0 -23
  1163. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js.map +0 -1
  1164. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts +0 -43
  1165. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts.map +0 -1
  1166. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js +0 -28
  1167. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js.map +0 -1
  1168. package/dist/auth0/generators/fastify/auth0-module/index.d.ts +0 -2
  1169. package/dist/auth0/generators/fastify/auth0-module/index.d.ts.map +0 -1
  1170. package/dist/auth0/generators/fastify/auth0-module/index.js +0 -2
  1171. package/dist/auth0/generators/fastify/auth0-module/index.js.map +0 -1
  1172. package/dist/auth0/generators/fastify/auth0-module/templates/module/services/management.ts +0 -22
  1173. package/dist/auth0/generators/fastify/auth0-module/templates/module/services/user-session.service.ts +0 -101
  1174. package/dist/auth0/generators/fastify/index.d.ts +0 -2
  1175. package/dist/auth0/generators/fastify/index.d.ts.map +0 -1
  1176. package/dist/auth0/generators/fastify/index.js +0 -2
  1177. package/dist/auth0/generators/fastify/index.js.map +0 -1
  1178. package/dist/auth0/generators/index.d.ts.map +0 -1
  1179. package/dist/auth0/generators/index.js.map +0 -1
  1180. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts +0 -10
  1181. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts.map +0 -1
  1182. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js +0 -41
  1183. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js.map +0 -1
  1184. package/dist/auth0/generators/react/auth0-apollo/index.d.ts +0 -2
  1185. package/dist/auth0/generators/react/auth0-apollo/index.d.ts.map +0 -1
  1186. package/dist/auth0/generators/react/auth0-apollo/index.js +0 -2
  1187. package/dist/auth0/generators/react/auth0-apollo/index.js.map +0 -1
  1188. package/dist/auth0/generators/react/auth0-apollo/templates/auth-link.ts +0 -11
  1189. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +0 -40
  1190. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +0 -1
  1191. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +0 -40
  1192. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +0 -1
  1193. package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts +0 -72
  1194. package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +0 -1
  1195. package/dist/auth0/generators/react/auth0-hooks/generated/index.js +0 -11
  1196. package/dist/auth0/generators/react/auth0-hooks/generated/index.js.map +0 -1
  1197. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +0 -16
  1198. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +0 -1
  1199. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +0 -26
  1200. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +0 -1
  1201. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts +0 -29
  1202. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts.map +0 -1
  1203. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js +0 -47
  1204. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js.map +0 -1
  1205. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts +0 -16
  1206. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts.map +0 -1
  1207. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js +0 -27
  1208. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js.map +0 -1
  1209. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +0 -52
  1210. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +0 -1
  1211. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +0 -69
  1212. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +0 -1
  1213. package/dist/auth0/generators/react/auth0-hooks/index.d.ts +0 -2
  1214. package/dist/auth0/generators/react/auth0-hooks/index.d.ts.map +0 -1
  1215. package/dist/auth0/generators/react/auth0-hooks/index.js +0 -2
  1216. package/dist/auth0/generators/react/auth0-hooks/index.js.map +0 -1
  1217. package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.gql +0 -10
  1218. package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.ts +0 -29
  1219. package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-log-out.ts +0 -14
  1220. package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-session.ts +0 -23
  1221. package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts +0 -143
  1222. package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts.map +0 -1
  1223. package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js +0 -26
  1224. package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js.map +0 -1
  1225. package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts +0 -278
  1226. package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts.map +0 -1
  1227. package/dist/auth0/generators/react/auth0-pages/generated/index.js +0 -9
  1228. package/dist/auth0/generators/react/auth0-pages/generated/index.js.map +0 -1
  1229. package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts +0 -12
  1230. package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts.map +0 -1
  1231. package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js +0 -20
  1232. package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js.map +0 -1
  1233. package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts +0 -144
  1234. package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts.map +0 -1
  1235. package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js +0 -37
  1236. package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js.map +0 -1
  1237. package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts +0 -263
  1238. package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts.map +0 -1
  1239. package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.js +0 -18
  1240. package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.js.map +0 -1
  1241. package/dist/auth0/generators/react/auth0-pages/index.d.ts +0 -2
  1242. package/dist/auth0/generators/react/auth0-pages/index.d.ts.map +0 -1
  1243. package/dist/auth0/generators/react/auth0-pages/index.js +0 -2
  1244. package/dist/auth0/generators/react/auth0-pages/index.js.map +0 -1
  1245. package/dist/auth0/generators/react/auth0-pages/templates/routes/login.tsx +0 -31
  1246. package/dist/auth0/generators/react/index.d.ts +0 -5
  1247. package/dist/auth0/generators/react/index.d.ts.map +0 -1
  1248. package/dist/auth0/generators/react/index.js +0 -5
  1249. package/dist/auth0/generators/react/index.js.map +0 -1
  1250. package/dist/auth0/generators/react/react-auth0/generated/index.d.ts +0 -286
  1251. package/dist/auth0/generators/react/react-auth0/generated/index.d.ts.map +0 -1
  1252. package/dist/auth0/generators/react/react-auth0/generated/index.js +0 -9
  1253. package/dist/auth0/generators/react/react-auth0/generated/index.js.map +0 -1
  1254. package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts +0 -12
  1255. package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts.map +0 -1
  1256. package/dist/auth0/generators/react/react-auth0/generated/template-paths.js +0 -22
  1257. package/dist/auth0/generators/react/react-auth0/generated/template-paths.js.map +0 -1
  1258. package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts +0 -149
  1259. package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts.map +0 -1
  1260. package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js +0 -39
  1261. package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js.map +0 -1
  1262. package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts +0 -136
  1263. package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts.map +0 -1
  1264. package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js +0 -17
  1265. package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js.map +0 -1
  1266. package/dist/auth0/generators/react/react-auth0/index.d.ts +0 -2
  1267. package/dist/auth0/generators/react/react-auth0/index.d.ts.map +0 -1
  1268. package/dist/auth0/generators/react/react-auth0/index.js +0 -2
  1269. package/dist/auth0/generators/react/react-auth0/index.js.map +0 -1
  1270. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +0 -178
  1271. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +0 -1
  1272. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js +0 -107
  1273. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js.map +0 -1
  1274. package/dist/auth0/generators/react/react-auth0/templates/src/app/auth-loaded-gate.tsx +0 -78
  1275. package/dist/auth0/metadata.json +0 -8
  1276. package/dist/auth0/static/icon.svg +0 -7
  1277. package/dist/common/compiler/generator-creators.d.ts +0 -18
  1278. package/dist/common/compiler/generator-creators.d.ts.map +0 -1
  1279. package/dist/common/compiler/generator-creators.js +0 -34
  1280. package/dist/common/compiler/generator-creators.js.map +0 -1
  1281. package/dist/common/compiler/index.d.ts +0 -2
  1282. package/dist/common/compiler/index.d.ts.map +0 -1
  1283. package/dist/common/compiler/index.js +0 -2
  1284. package/dist/common/compiler/index.js.map +0 -1
  1285. package/dist/common/index.d.ts +0 -3
  1286. package/dist/common/index.d.ts.map +0 -1
  1287. package/dist/common/index.js +0 -3
  1288. package/dist/common/index.js.map +0 -1
  1289. package/dist/common/roles/components/index.d.ts +0 -2
  1290. package/dist/common/roles/components/index.d.ts.map +0 -1
  1291. package/dist/common/roles/components/index.js +0 -2
  1292. package/dist/common/roles/components/index.js.map +0 -1
  1293. package/dist/common/roles/components/role-editor-form/role-dialog.d.ts +0 -14
  1294. package/dist/common/roles/components/role-editor-form/role-dialog.d.ts.map +0 -1
  1295. package/dist/common/roles/components/role-editor-form/role-dialog.js +0 -29
  1296. package/dist/common/roles/components/role-editor-form/role-dialog.js.map +0 -1
  1297. package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts +0 -10
  1298. package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts.map +0 -1
  1299. package/dist/common/roles/components/role-editor-form/role-editor-form.js +0 -49
  1300. package/dist/common/roles/components/role-editor-form/role-editor-form.js.map +0 -1
  1301. package/dist/common/roles/constants.d.ts.map +0 -1
  1302. package/dist/common/roles/constants.js.map +0 -1
  1303. package/dist/common/roles/index.d.ts +0 -4
  1304. package/dist/common/roles/index.d.ts.map +0 -1
  1305. package/dist/common/roles/index.js +0 -4
  1306. package/dist/common/roles/index.js.map +0 -1
  1307. package/dist/common/roles/schema.d.ts +0 -84
  1308. package/dist/common/roles/schema.d.ts.map +0 -1
  1309. package/dist/common/roles/schema.js +0 -44
  1310. package/dist/common/roles/schema.js.map +0 -1
  1311. package/dist/index.js.map +0 -1
  1312. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts +0 -14
  1313. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
  1314. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.gql +0 -10
  1315. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js +0 -23
  1316. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
  1317. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts +0 -34
  1318. package/dist/placeholder-auth/metadata.json +0 -9
  1319. package/dist/web/assets/__federation_expose_auth0CoreCommon-CSWdt8d_.js +0 -56
  1320. package/dist/web/assets/__federation_expose_auth0CoreCommon-CSWdt8d_.js.map +0 -1
  1321. package/dist/web/assets/__federation_expose_auth0CoreWeb-DjVw47sM.js +0 -201
  1322. package/dist/web/assets/__federation_expose_auth0CoreWeb-DjVw47sM.js.map +0 -1
  1323. package/dist/web/assets/__federation_expose_authCoreCommon-CvHJZFIq.js +0 -36
  1324. package/dist/web/assets/__federation_expose_authCoreCommon-CvHJZFIq.js.map +0 -1
  1325. package/dist/web/assets/__federation_expose_authCoreWeb-CrFEmZp3.js +0 -401
  1326. package/dist/web/assets/__federation_expose_authCoreWeb-CrFEmZp3.js.map +0 -1
  1327. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js +0 -39
  1328. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js.map +0 -1
  1329. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CpxfTdxv.js +0 -197
  1330. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CpxfTdxv.js.map +0 -1
  1331. package/dist/web/assets/__federation_fn_import-CGvRdRVe.js +0 -421
  1332. package/dist/web/assets/__federation_fn_import-CGvRdRVe.js.map +0 -1
  1333. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-D1kBtwsm.js +0 -341
  1334. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-D1kBtwsm.js.map +0 -1
  1335. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B7442OYh.js +0 -10289
  1336. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B7442OYh.js.map +0 -1
  1337. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-X318M5Ml.js +0 -23637
  1338. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-X318M5Ml.js.map +0 -1
  1339. package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js +0 -250
  1340. package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js.map +0 -1
  1341. package/dist/web/assets/__federation_shared_react-uocnGSER.js +0 -7
  1342. package/dist/web/assets/__federation_shared_react-uocnGSER.js.map +0 -1
  1343. package/dist/web/assets/__federation_shared_zod-BK7IELHt.js +0 -4380
  1344. package/dist/web/assets/__federation_shared_zod-BK7IELHt.js.map +0 -1
  1345. package/dist/web/assets/index-B1hOKVPw.js +0 -574
  1346. package/dist/web/assets/index-B1hOKVPw.js.map +0 -1
  1347. package/dist/web/assets/index-ydDQKauE.js +0 -101
  1348. package/dist/web/assets/index-ydDQKauE.js.map +0 -1
  1349. package/dist/web/assets/index.esm-DYWXRkn-.js +0 -2627
  1350. package/dist/web/assets/index.esm-DYWXRkn-.js.map +0 -1
  1351. package/dist/web/assets/model-merger-BVBtbNAj.js +0 -1708
  1352. package/dist/web/assets/model-merger-BVBtbNAj.js.map +0 -1
  1353. package/dist/web/assets/plugin-definition-Bdhuga1j.js +0 -36
  1354. package/dist/web/assets/plugin-definition-Bdhuga1j.js.map +0 -1
  1355. package/dist/web/assets/plugin-definition-C9d7ykhX.js +0 -24
  1356. package/dist/web/assets/plugin-definition-C9d7ykhX.js.map +0 -1
  1357. package/dist/web/assets/plugin-definition-QzgXWr1I.js +0 -24
  1358. package/dist/web/assets/plugin-definition-QzgXWr1I.js.map +0 -1
  1359. package/dist/web/assets/react-B23vKoD0.js +0 -47
  1360. package/dist/web/assets/react-B23vKoD0.js.map +0 -1
  1361. package/dist/web/assets/role-editor-form-BkcoVwtU.js +0 -319
  1362. package/dist/web/assets/role-editor-form-BkcoVwtU.js.map +0 -1
  1363. package/dist/web/assets/style-ZUYizAnf.css +0 -93
  1364. package/dist/web/assets/styles-Dfjm_ApH.js +0 -201
  1365. package/dist/web/assets/styles-Dfjm_ApH.js.map +0 -1
  1366. package/dist/web-export.js.map +0 -1
  1367. package/manifest.json +0 -4
  1368. /package/dist/{common → auth/core/schema}/roles/constants.d.ts +0 -0
  1369. /package/dist/{common → auth/core/schema}/roles/constants.js +0 -0
  1370. /package/dist/{auth0 → better-auth}/generators/index.d.ts +0 -0
  1371. /package/dist/{auth0 → better-auth}/generators/index.js +0 -0
  1372. /package/dist/{auth0/generators/react/auth0-hooks → better-auth/generators/react/better-auth-hooks}/templates/src/hooks/use-required-user-id.ts +0 -0
  1373. /package/dist/{auth → local-auth}/core/generators/auth-apollo/index.d.ts +0 -0
  1374. /package/dist/{auth → local-auth}/core/generators/auth-apollo/index.js +0 -0
  1375. /package/dist/{auth → local-auth}/core/generators/auth-apollo/templates/session-error-link.d.ts +0 -0
  1376. /package/dist/{auth → local-auth}/core/generators/auth-email-password/index.d.ts +0 -0
  1377. /package/dist/{auth → local-auth}/core/generators/auth-email-password/index.js +0 -0
  1378. /package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts +0 -0
  1379. /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +0 -0
  1380. /package/dist/{auth → local-auth}/core/generators/auth-module/index.d.ts +0 -0
  1381. /package/dist/{auth → local-auth}/core/generators/auth-module/index.js +0 -0
  1382. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts +0 -0
  1383. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.js +0 -0
  1384. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.ts +0 -0
  1385. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts +0 -0
  1386. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts +0 -0
  1387. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts +0 -0
  1388. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/services/user-session.service.d.ts +0 -0
  1389. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +0 -0
  1390. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.js +0 -0
  1391. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.ts +0 -0
  1392. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/session-cookie.d.ts +0 -0
  1393. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/session-cookie.ts +0 -0
  1394. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts +0 -0
  1395. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.js +0 -0
  1396. /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.ts +0 -0
  1397. /package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/route.js +0 -0
  1398. /package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/route.tsx +0 -0
  1399. /package/dist/{auth → local-auth}/core/generators/react-auth/index.d.ts +0 -0
  1400. /package/dist/{auth → local-auth}/core/generators/react-auth/index.js +0 -0
  1401. /package/dist/{auth → local-auth}/core/generators/react-session/index.d.ts +0 -0
  1402. /package/dist/{auth → local-auth}/core/generators/react-session/index.js +0 -0
  1403. /package/dist/{auth → local-auth}/core/generators/react-session/templates/src/app/user-session-provider.d.ts +0 -0
  1404. /package/dist/{auth → local-auth}/core/index.d.ts +0 -0
  1405. /package/dist/{auth → local-auth}/core/index.js +0 -0
@@ -1,4380 +0,0 @@
1
- var util;
2
- (function (util) {
3
- util.assertEqual = (val) => val;
4
- function assertIs(_arg) { }
5
- util.assertIs = assertIs;
6
- function assertNever(_x) {
7
- throw new Error();
8
- }
9
- util.assertNever = assertNever;
10
- util.arrayToEnum = (items) => {
11
- const obj = {};
12
- for (const item of items) {
13
- obj[item] = item;
14
- }
15
- return obj;
16
- };
17
- util.getValidEnumValues = (obj) => {
18
- const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
19
- const filtered = {};
20
- for (const k of validKeys) {
21
- filtered[k] = obj[k];
22
- }
23
- return util.objectValues(filtered);
24
- };
25
- util.objectValues = (obj) => {
26
- return util.objectKeys(obj).map(function (e) {
27
- return obj[e];
28
- });
29
- };
30
- util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
31
- ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
32
- : (object) => {
33
- const keys = [];
34
- for (const key in object) {
35
- if (Object.prototype.hasOwnProperty.call(object, key)) {
36
- keys.push(key);
37
- }
38
- }
39
- return keys;
40
- };
41
- util.find = (arr, checker) => {
42
- for (const item of arr) {
43
- if (checker(item))
44
- return item;
45
- }
46
- return undefined;
47
- };
48
- util.isInteger = typeof Number.isInteger === "function"
49
- ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
50
- : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
51
- function joinValues(array, separator = " | ") {
52
- return array
53
- .map((val) => (typeof val === "string" ? `'${val}'` : val))
54
- .join(separator);
55
- }
56
- util.joinValues = joinValues;
57
- util.jsonStringifyReplacer = (_, value) => {
58
- if (typeof value === "bigint") {
59
- return value.toString();
60
- }
61
- return value;
62
- };
63
- })(util || (util = {}));
64
- var objectUtil;
65
- (function (objectUtil) {
66
- objectUtil.mergeShapes = (first, second) => {
67
- return {
68
- ...first,
69
- ...second, // second overwrites first
70
- };
71
- };
72
- })(objectUtil || (objectUtil = {}));
73
- const ZodParsedType = util.arrayToEnum([
74
- "string",
75
- "nan",
76
- "number",
77
- "integer",
78
- "float",
79
- "boolean",
80
- "date",
81
- "bigint",
82
- "symbol",
83
- "function",
84
- "undefined",
85
- "null",
86
- "array",
87
- "object",
88
- "unknown",
89
- "promise",
90
- "void",
91
- "never",
92
- "map",
93
- "set",
94
- ]);
95
- const getParsedType = (data) => {
96
- const t = typeof data;
97
- switch (t) {
98
- case "undefined":
99
- return ZodParsedType.undefined;
100
- case "string":
101
- return ZodParsedType.string;
102
- case "number":
103
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
104
- case "boolean":
105
- return ZodParsedType.boolean;
106
- case "function":
107
- return ZodParsedType.function;
108
- case "bigint":
109
- return ZodParsedType.bigint;
110
- case "symbol":
111
- return ZodParsedType.symbol;
112
- case "object":
113
- if (Array.isArray(data)) {
114
- return ZodParsedType.array;
115
- }
116
- if (data === null) {
117
- return ZodParsedType.null;
118
- }
119
- if (data.then &&
120
- typeof data.then === "function" &&
121
- data.catch &&
122
- typeof data.catch === "function") {
123
- return ZodParsedType.promise;
124
- }
125
- if (typeof Map !== "undefined" && data instanceof Map) {
126
- return ZodParsedType.map;
127
- }
128
- if (typeof Set !== "undefined" && data instanceof Set) {
129
- return ZodParsedType.set;
130
- }
131
- if (typeof Date !== "undefined" && data instanceof Date) {
132
- return ZodParsedType.date;
133
- }
134
- return ZodParsedType.object;
135
- default:
136
- return ZodParsedType.unknown;
137
- }
138
- };
139
-
140
- const ZodIssueCode = util.arrayToEnum([
141
- "invalid_type",
142
- "invalid_literal",
143
- "custom",
144
- "invalid_union",
145
- "invalid_union_discriminator",
146
- "invalid_enum_value",
147
- "unrecognized_keys",
148
- "invalid_arguments",
149
- "invalid_return_type",
150
- "invalid_date",
151
- "invalid_string",
152
- "too_small",
153
- "too_big",
154
- "invalid_intersection_types",
155
- "not_multiple_of",
156
- "not_finite",
157
- ]);
158
- const quotelessJson = (obj) => {
159
- const json = JSON.stringify(obj, null, 2);
160
- return json.replace(/"([^"]+)":/g, "$1:");
161
- };
162
- class ZodError extends Error {
163
- get errors() {
164
- return this.issues;
165
- }
166
- constructor(issues) {
167
- super();
168
- this.issues = [];
169
- this.addIssue = (sub) => {
170
- this.issues = [...this.issues, sub];
171
- };
172
- this.addIssues = (subs = []) => {
173
- this.issues = [...this.issues, ...subs];
174
- };
175
- const actualProto = new.target.prototype;
176
- if (Object.setPrototypeOf) {
177
- // eslint-disable-next-line ban/ban
178
- Object.setPrototypeOf(this, actualProto);
179
- }
180
- else {
181
- this.__proto__ = actualProto;
182
- }
183
- this.name = "ZodError";
184
- this.issues = issues;
185
- }
186
- format(_mapper) {
187
- const mapper = _mapper ||
188
- function (issue) {
189
- return issue.message;
190
- };
191
- const fieldErrors = { _errors: [] };
192
- const processError = (error) => {
193
- for (const issue of error.issues) {
194
- if (issue.code === "invalid_union") {
195
- issue.unionErrors.map(processError);
196
- }
197
- else if (issue.code === "invalid_return_type") {
198
- processError(issue.returnTypeError);
199
- }
200
- else if (issue.code === "invalid_arguments") {
201
- processError(issue.argumentsError);
202
- }
203
- else if (issue.path.length === 0) {
204
- fieldErrors._errors.push(mapper(issue));
205
- }
206
- else {
207
- let curr = fieldErrors;
208
- let i = 0;
209
- while (i < issue.path.length) {
210
- const el = issue.path[i];
211
- const terminal = i === issue.path.length - 1;
212
- if (!terminal) {
213
- curr[el] = curr[el] || { _errors: [] };
214
- // if (typeof el === "string") {
215
- // curr[el] = curr[el] || { _errors: [] };
216
- // } else if (typeof el === "number") {
217
- // const errorArray: any = [];
218
- // errorArray._errors = [];
219
- // curr[el] = curr[el] || errorArray;
220
- // }
221
- }
222
- else {
223
- curr[el] = curr[el] || { _errors: [] };
224
- curr[el]._errors.push(mapper(issue));
225
- }
226
- curr = curr[el];
227
- i++;
228
- }
229
- }
230
- }
231
- };
232
- processError(this);
233
- return fieldErrors;
234
- }
235
- static assert(value) {
236
- if (!(value instanceof ZodError)) {
237
- throw new Error(`Not a ZodError: ${value}`);
238
- }
239
- }
240
- toString() {
241
- return this.message;
242
- }
243
- get message() {
244
- return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
245
- }
246
- get isEmpty() {
247
- return this.issues.length === 0;
248
- }
249
- flatten(mapper = (issue) => issue.message) {
250
- const fieldErrors = {};
251
- const formErrors = [];
252
- for (const sub of this.issues) {
253
- if (sub.path.length > 0) {
254
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
255
- fieldErrors[sub.path[0]].push(mapper(sub));
256
- }
257
- else {
258
- formErrors.push(mapper(sub));
259
- }
260
- }
261
- return { formErrors, fieldErrors };
262
- }
263
- get formErrors() {
264
- return this.flatten();
265
- }
266
- }
267
- ZodError.create = (issues) => {
268
- const error = new ZodError(issues);
269
- return error;
270
- };
271
-
272
- const errorMap = (issue, _ctx) => {
273
- let message;
274
- switch (issue.code) {
275
- case ZodIssueCode.invalid_type:
276
- if (issue.received === ZodParsedType.undefined) {
277
- message = "Required";
278
- }
279
- else {
280
- message = `Expected ${issue.expected}, received ${issue.received}`;
281
- }
282
- break;
283
- case ZodIssueCode.invalid_literal:
284
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
285
- break;
286
- case ZodIssueCode.unrecognized_keys:
287
- message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
288
- break;
289
- case ZodIssueCode.invalid_union:
290
- message = `Invalid input`;
291
- break;
292
- case ZodIssueCode.invalid_union_discriminator:
293
- message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
294
- break;
295
- case ZodIssueCode.invalid_enum_value:
296
- message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
297
- break;
298
- case ZodIssueCode.invalid_arguments:
299
- message = `Invalid function arguments`;
300
- break;
301
- case ZodIssueCode.invalid_return_type:
302
- message = `Invalid function return type`;
303
- break;
304
- case ZodIssueCode.invalid_date:
305
- message = `Invalid date`;
306
- break;
307
- case ZodIssueCode.invalid_string:
308
- if (typeof issue.validation === "object") {
309
- if ("includes" in issue.validation) {
310
- message = `Invalid input: must include "${issue.validation.includes}"`;
311
- if (typeof issue.validation.position === "number") {
312
- message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
313
- }
314
- }
315
- else if ("startsWith" in issue.validation) {
316
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
317
- }
318
- else if ("endsWith" in issue.validation) {
319
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
320
- }
321
- else {
322
- util.assertNever(issue.validation);
323
- }
324
- }
325
- else if (issue.validation !== "regex") {
326
- message = `Invalid ${issue.validation}`;
327
- }
328
- else {
329
- message = "Invalid";
330
- }
331
- break;
332
- case ZodIssueCode.too_small:
333
- if (issue.type === "array")
334
- message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
335
- else if (issue.type === "string")
336
- message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
337
- else if (issue.type === "number")
338
- message = `Number must be ${issue.exact
339
- ? `exactly equal to `
340
- : issue.inclusive
341
- ? `greater than or equal to `
342
- : `greater than `}${issue.minimum}`;
343
- else if (issue.type === "date")
344
- message = `Date must be ${issue.exact
345
- ? `exactly equal to `
346
- : issue.inclusive
347
- ? `greater than or equal to `
348
- : `greater than `}${new Date(Number(issue.minimum))}`;
349
- else
350
- message = "Invalid input";
351
- break;
352
- case ZodIssueCode.too_big:
353
- if (issue.type === "array")
354
- message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
355
- else if (issue.type === "string")
356
- message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
357
- else if (issue.type === "number")
358
- message = `Number must be ${issue.exact
359
- ? `exactly`
360
- : issue.inclusive
361
- ? `less than or equal to`
362
- : `less than`} ${issue.maximum}`;
363
- else if (issue.type === "bigint")
364
- message = `BigInt must be ${issue.exact
365
- ? `exactly`
366
- : issue.inclusive
367
- ? `less than or equal to`
368
- : `less than`} ${issue.maximum}`;
369
- else if (issue.type === "date")
370
- message = `Date must be ${issue.exact
371
- ? `exactly`
372
- : issue.inclusive
373
- ? `smaller than or equal to`
374
- : `smaller than`} ${new Date(Number(issue.maximum))}`;
375
- else
376
- message = "Invalid input";
377
- break;
378
- case ZodIssueCode.custom:
379
- message = `Invalid input`;
380
- break;
381
- case ZodIssueCode.invalid_intersection_types:
382
- message = `Intersection results could not be merged`;
383
- break;
384
- case ZodIssueCode.not_multiple_of:
385
- message = `Number must be a multiple of ${issue.multipleOf}`;
386
- break;
387
- case ZodIssueCode.not_finite:
388
- message = "Number must be finite";
389
- break;
390
- default:
391
- message = _ctx.defaultError;
392
- util.assertNever(issue);
393
- }
394
- return { message };
395
- };
396
-
397
- let overrideErrorMap = errorMap;
398
- function setErrorMap(map) {
399
- overrideErrorMap = map;
400
- }
401
- function getErrorMap() {
402
- return overrideErrorMap;
403
- }
404
-
405
- const makeIssue = (params) => {
406
- const { data, path, errorMaps, issueData } = params;
407
- const fullPath = [...path, ...(issueData.path || [])];
408
- const fullIssue = {
409
- ...issueData,
410
- path: fullPath,
411
- };
412
- if (issueData.message !== undefined) {
413
- return {
414
- ...issueData,
415
- path: fullPath,
416
- message: issueData.message,
417
- };
418
- }
419
- let errorMessage = "";
420
- const maps = errorMaps
421
- .filter((m) => !!m)
422
- .slice()
423
- .reverse();
424
- for (const map of maps) {
425
- errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
426
- }
427
- return {
428
- ...issueData,
429
- path: fullPath,
430
- message: errorMessage,
431
- };
432
- };
433
- const EMPTY_PATH = [];
434
- function addIssueToContext(ctx, issueData) {
435
- const overrideMap = getErrorMap();
436
- const issue = makeIssue({
437
- issueData: issueData,
438
- data: ctx.data,
439
- path: ctx.path,
440
- errorMaps: [
441
- ctx.common.contextualErrorMap, // contextual error map is first priority
442
- ctx.schemaErrorMap, // then schema-bound map if available
443
- overrideMap, // then global override map
444
- overrideMap === errorMap ? undefined : errorMap, // then global default map
445
- ].filter((x) => !!x),
446
- });
447
- ctx.common.issues.push(issue);
448
- }
449
- class ParseStatus {
450
- constructor() {
451
- this.value = "valid";
452
- }
453
- dirty() {
454
- if (this.value === "valid")
455
- this.value = "dirty";
456
- }
457
- abort() {
458
- if (this.value !== "aborted")
459
- this.value = "aborted";
460
- }
461
- static mergeArray(status, results) {
462
- const arrayValue = [];
463
- for (const s of results) {
464
- if (s.status === "aborted")
465
- return INVALID;
466
- if (s.status === "dirty")
467
- status.dirty();
468
- arrayValue.push(s.value);
469
- }
470
- return { status: status.value, value: arrayValue };
471
- }
472
- static async mergeObjectAsync(status, pairs) {
473
- const syncPairs = [];
474
- for (const pair of pairs) {
475
- const key = await pair.key;
476
- const value = await pair.value;
477
- syncPairs.push({
478
- key,
479
- value,
480
- });
481
- }
482
- return ParseStatus.mergeObjectSync(status, syncPairs);
483
- }
484
- static mergeObjectSync(status, pairs) {
485
- const finalObject = {};
486
- for (const pair of pairs) {
487
- const { key, value } = pair;
488
- if (key.status === "aborted")
489
- return INVALID;
490
- if (value.status === "aborted")
491
- return INVALID;
492
- if (key.status === "dirty")
493
- status.dirty();
494
- if (value.status === "dirty")
495
- status.dirty();
496
- if (key.value !== "__proto__" &&
497
- (typeof value.value !== "undefined" || pair.alwaysSet)) {
498
- finalObject[key.value] = value.value;
499
- }
500
- }
501
- return { status: status.value, value: finalObject };
502
- }
503
- }
504
- const INVALID = Object.freeze({
505
- status: "aborted",
506
- });
507
- const DIRTY = (value) => ({ status: "dirty", value });
508
- const OK = (value) => ({ status: "valid", value });
509
- const isAborted = (x) => x.status === "aborted";
510
- const isDirty = (x) => x.status === "dirty";
511
- const isValid = (x) => x.status === "valid";
512
- const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
513
-
514
- /******************************************************************************
515
- Copyright (c) Microsoft Corporation.
516
-
517
- Permission to use, copy, modify, and/or distribute this software for any
518
- purpose with or without fee is hereby granted.
519
-
520
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
521
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
522
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
523
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
524
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
525
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
526
- PERFORMANCE OF THIS SOFTWARE.
527
- ***************************************************************************** */
528
-
529
- function __classPrivateFieldGet(receiver, state, kind, f) {
530
- if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
531
- return state.get(receiver);
532
- }
533
-
534
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
535
- if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
536
- return (state.set(receiver, value)), value;
537
- }
538
-
539
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
540
- var e = new Error(message);
541
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
542
- };
543
-
544
- var errorUtil;
545
- (function (errorUtil) {
546
- errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
547
- errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
548
- })(errorUtil || (errorUtil = {}));
549
-
550
- var _ZodEnum_cache, _ZodNativeEnum_cache;
551
- class ParseInputLazyPath {
552
- constructor(parent, value, path, key) {
553
- this._cachedPath = [];
554
- this.parent = parent;
555
- this.data = value;
556
- this._path = path;
557
- this._key = key;
558
- }
559
- get path() {
560
- if (!this._cachedPath.length) {
561
- if (this._key instanceof Array) {
562
- this._cachedPath.push(...this._path, ...this._key);
563
- }
564
- else {
565
- this._cachedPath.push(...this._path, this._key);
566
- }
567
- }
568
- return this._cachedPath;
569
- }
570
- }
571
- const handleResult = (ctx, result) => {
572
- if (isValid(result)) {
573
- return { success: true, data: result.value };
574
- }
575
- else {
576
- if (!ctx.common.issues.length) {
577
- throw new Error("Validation failed but no issues detected.");
578
- }
579
- return {
580
- success: false,
581
- get error() {
582
- if (this._error)
583
- return this._error;
584
- const error = new ZodError(ctx.common.issues);
585
- this._error = error;
586
- return this._error;
587
- },
588
- };
589
- }
590
- };
591
- function processCreateParams(params) {
592
- if (!params)
593
- return {};
594
- const { errorMap, invalid_type_error, required_error, description } = params;
595
- if (errorMap && (invalid_type_error || required_error)) {
596
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
597
- }
598
- if (errorMap)
599
- return { errorMap: errorMap, description };
600
- const customMap = (iss, ctx) => {
601
- var _a, _b;
602
- const { message } = params;
603
- if (iss.code === "invalid_enum_value") {
604
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
605
- }
606
- if (typeof ctx.data === "undefined") {
607
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
608
- }
609
- if (iss.code !== "invalid_type")
610
- return { message: ctx.defaultError };
611
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
612
- };
613
- return { errorMap: customMap, description };
614
- }
615
- class ZodType {
616
- get description() {
617
- return this._def.description;
618
- }
619
- _getType(input) {
620
- return getParsedType(input.data);
621
- }
622
- _getOrReturnCtx(input, ctx) {
623
- return (ctx || {
624
- common: input.parent.common,
625
- data: input.data,
626
- parsedType: getParsedType(input.data),
627
- schemaErrorMap: this._def.errorMap,
628
- path: input.path,
629
- parent: input.parent,
630
- });
631
- }
632
- _processInputParams(input) {
633
- return {
634
- status: new ParseStatus(),
635
- ctx: {
636
- common: input.parent.common,
637
- data: input.data,
638
- parsedType: getParsedType(input.data),
639
- schemaErrorMap: this._def.errorMap,
640
- path: input.path,
641
- parent: input.parent,
642
- },
643
- };
644
- }
645
- _parseSync(input) {
646
- const result = this._parse(input);
647
- if (isAsync(result)) {
648
- throw new Error("Synchronous parse encountered promise.");
649
- }
650
- return result;
651
- }
652
- _parseAsync(input) {
653
- const result = this._parse(input);
654
- return Promise.resolve(result);
655
- }
656
- parse(data, params) {
657
- const result = this.safeParse(data, params);
658
- if (result.success)
659
- return result.data;
660
- throw result.error;
661
- }
662
- safeParse(data, params) {
663
- var _a;
664
- const ctx = {
665
- common: {
666
- issues: [],
667
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
668
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
669
- },
670
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
671
- schemaErrorMap: this._def.errorMap,
672
- parent: null,
673
- data,
674
- parsedType: getParsedType(data),
675
- };
676
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
677
- return handleResult(ctx, result);
678
- }
679
- "~validate"(data) {
680
- var _a, _b;
681
- const ctx = {
682
- common: {
683
- issues: [],
684
- async: !!this["~standard"].async,
685
- },
686
- path: [],
687
- schemaErrorMap: this._def.errorMap,
688
- parent: null,
689
- data,
690
- parsedType: getParsedType(data),
691
- };
692
- if (!this["~standard"].async) {
693
- try {
694
- const result = this._parseSync({ data, path: [], parent: ctx });
695
- return isValid(result)
696
- ? {
697
- value: result.value,
698
- }
699
- : {
700
- issues: ctx.common.issues,
701
- };
702
- }
703
- catch (err) {
704
- if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
705
- this["~standard"].async = true;
706
- }
707
- ctx.common = {
708
- issues: [],
709
- async: true,
710
- };
711
- }
712
- }
713
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)
714
- ? {
715
- value: result.value,
716
- }
717
- : {
718
- issues: ctx.common.issues,
719
- });
720
- }
721
- async parseAsync(data, params) {
722
- const result = await this.safeParseAsync(data, params);
723
- if (result.success)
724
- return result.data;
725
- throw result.error;
726
- }
727
- async safeParseAsync(data, params) {
728
- const ctx = {
729
- common: {
730
- issues: [],
731
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
732
- async: true,
733
- },
734
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
735
- schemaErrorMap: this._def.errorMap,
736
- parent: null,
737
- data,
738
- parsedType: getParsedType(data),
739
- };
740
- const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
741
- const result = await (isAsync(maybeAsyncResult)
742
- ? maybeAsyncResult
743
- : Promise.resolve(maybeAsyncResult));
744
- return handleResult(ctx, result);
745
- }
746
- refine(check, message) {
747
- const getIssueProperties = (val) => {
748
- if (typeof message === "string" || typeof message === "undefined") {
749
- return { message };
750
- }
751
- else if (typeof message === "function") {
752
- return message(val);
753
- }
754
- else {
755
- return message;
756
- }
757
- };
758
- return this._refinement((val, ctx) => {
759
- const result = check(val);
760
- const setError = () => ctx.addIssue({
761
- code: ZodIssueCode.custom,
762
- ...getIssueProperties(val),
763
- });
764
- if (typeof Promise !== "undefined" && result instanceof Promise) {
765
- return result.then((data) => {
766
- if (!data) {
767
- setError();
768
- return false;
769
- }
770
- else {
771
- return true;
772
- }
773
- });
774
- }
775
- if (!result) {
776
- setError();
777
- return false;
778
- }
779
- else {
780
- return true;
781
- }
782
- });
783
- }
784
- refinement(check, refinementData) {
785
- return this._refinement((val, ctx) => {
786
- if (!check(val)) {
787
- ctx.addIssue(typeof refinementData === "function"
788
- ? refinementData(val, ctx)
789
- : refinementData);
790
- return false;
791
- }
792
- else {
793
- return true;
794
- }
795
- });
796
- }
797
- _refinement(refinement) {
798
- return new ZodEffects({
799
- schema: this,
800
- typeName: ZodFirstPartyTypeKind.ZodEffects,
801
- effect: { type: "refinement", refinement },
802
- });
803
- }
804
- superRefine(refinement) {
805
- return this._refinement(refinement);
806
- }
807
- constructor(def) {
808
- /** Alias of safeParseAsync */
809
- this.spa = this.safeParseAsync;
810
- this._def = def;
811
- this.parse = this.parse.bind(this);
812
- this.safeParse = this.safeParse.bind(this);
813
- this.parseAsync = this.parseAsync.bind(this);
814
- this.safeParseAsync = this.safeParseAsync.bind(this);
815
- this.spa = this.spa.bind(this);
816
- this.refine = this.refine.bind(this);
817
- this.refinement = this.refinement.bind(this);
818
- this.superRefine = this.superRefine.bind(this);
819
- this.optional = this.optional.bind(this);
820
- this.nullable = this.nullable.bind(this);
821
- this.nullish = this.nullish.bind(this);
822
- this.array = this.array.bind(this);
823
- this.promise = this.promise.bind(this);
824
- this.or = this.or.bind(this);
825
- this.and = this.and.bind(this);
826
- this.transform = this.transform.bind(this);
827
- this.brand = this.brand.bind(this);
828
- this.default = this.default.bind(this);
829
- this.catch = this.catch.bind(this);
830
- this.describe = this.describe.bind(this);
831
- this.pipe = this.pipe.bind(this);
832
- this.readonly = this.readonly.bind(this);
833
- this.isNullable = this.isNullable.bind(this);
834
- this.isOptional = this.isOptional.bind(this);
835
- this["~standard"] = {
836
- version: 1,
837
- vendor: "zod",
838
- validate: (data) => this["~validate"](data),
839
- };
840
- }
841
- optional() {
842
- return ZodOptional.create(this, this._def);
843
- }
844
- nullable() {
845
- return ZodNullable.create(this, this._def);
846
- }
847
- nullish() {
848
- return this.nullable().optional();
849
- }
850
- array() {
851
- return ZodArray.create(this);
852
- }
853
- promise() {
854
- return ZodPromise.create(this, this._def);
855
- }
856
- or(option) {
857
- return ZodUnion.create([this, option], this._def);
858
- }
859
- and(incoming) {
860
- return ZodIntersection.create(this, incoming, this._def);
861
- }
862
- transform(transform) {
863
- return new ZodEffects({
864
- ...processCreateParams(this._def),
865
- schema: this,
866
- typeName: ZodFirstPartyTypeKind.ZodEffects,
867
- effect: { type: "transform", transform },
868
- });
869
- }
870
- default(def) {
871
- const defaultValueFunc = typeof def === "function" ? def : () => def;
872
- return new ZodDefault({
873
- ...processCreateParams(this._def),
874
- innerType: this,
875
- defaultValue: defaultValueFunc,
876
- typeName: ZodFirstPartyTypeKind.ZodDefault,
877
- });
878
- }
879
- brand() {
880
- return new ZodBranded({
881
- typeName: ZodFirstPartyTypeKind.ZodBranded,
882
- type: this,
883
- ...processCreateParams(this._def),
884
- });
885
- }
886
- catch(def) {
887
- const catchValueFunc = typeof def === "function" ? def : () => def;
888
- return new ZodCatch({
889
- ...processCreateParams(this._def),
890
- innerType: this,
891
- catchValue: catchValueFunc,
892
- typeName: ZodFirstPartyTypeKind.ZodCatch,
893
- });
894
- }
895
- describe(description) {
896
- const This = this.constructor;
897
- return new This({
898
- ...this._def,
899
- description,
900
- });
901
- }
902
- pipe(target) {
903
- return ZodPipeline.create(this, target);
904
- }
905
- readonly() {
906
- return ZodReadonly.create(this);
907
- }
908
- isOptional() {
909
- return this.safeParse(undefined).success;
910
- }
911
- isNullable() {
912
- return this.safeParse(null).success;
913
- }
914
- }
915
- const cuidRegex = /^c[^\s-]{8,}$/i;
916
- const cuid2Regex = /^[0-9a-z]+$/;
917
- const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
918
- // const uuidRegex =
919
- // /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
920
- const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
921
- const nanoidRegex = /^[a-z0-9_-]{21}$/i;
922
- const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
923
- const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
924
- // from https://stackoverflow.com/a/46181/1550155
925
- // old version: too slow, didn't support unicode
926
- // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
927
- //old email regex
928
- // const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
929
- // eslint-disable-next-line
930
- // const emailRegex =
931
- // /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
932
- // const emailRegex =
933
- // /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
934
- // const emailRegex =
935
- // /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
936
- const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
937
- // const emailRegex =
938
- // /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
939
- // from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
940
- const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
941
- let emojiRegex;
942
- // faster, simpler, safer
943
- const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
944
- const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
945
- // const ipv6Regex =
946
- // /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
947
- const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
948
- const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
949
- // https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
950
- const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
951
- // https://base64.guru/standards/base64url
952
- const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
953
- // simple
954
- // const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
955
- // no leap year validation
956
- // const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
957
- // with leap year validation
958
- const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
959
- const dateRegex = new RegExp(`^${dateRegexSource}$`);
960
- function timeRegexSource(args) {
961
- // let regex = `\\d{2}:\\d{2}:\\d{2}`;
962
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
963
- if (args.precision) {
964
- regex = `${regex}\\.\\d{${args.precision}}`;
965
- }
966
- else if (args.precision == null) {
967
- regex = `${regex}(\\.\\d+)?`;
968
- }
969
- return regex;
970
- }
971
- function timeRegex(args) {
972
- return new RegExp(`^${timeRegexSource(args)}$`);
973
- }
974
- // Adapted from https://stackoverflow.com/a/3143231
975
- function datetimeRegex(args) {
976
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
977
- const opts = [];
978
- opts.push(args.local ? `Z?` : `Z`);
979
- if (args.offset)
980
- opts.push(`([+-]\\d{2}:?\\d{2})`);
981
- regex = `${regex}(${opts.join("|")})`;
982
- return new RegExp(`^${regex}$`);
983
- }
984
- function isValidIP(ip, version) {
985
- if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
986
- return true;
987
- }
988
- if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
989
- return true;
990
- }
991
- return false;
992
- }
993
- function isValidJWT(jwt, alg) {
994
- if (!jwtRegex.test(jwt))
995
- return false;
996
- try {
997
- const [header] = jwt.split(".");
998
- // Convert base64url to base64
999
- const base64 = header
1000
- .replace(/-/g, "+")
1001
- .replace(/_/g, "/")
1002
- .padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
1003
- const decoded = JSON.parse(atob(base64));
1004
- if (typeof decoded !== "object" || decoded === null)
1005
- return false;
1006
- if (!decoded.typ || !decoded.alg)
1007
- return false;
1008
- if (alg && decoded.alg !== alg)
1009
- return false;
1010
- return true;
1011
- }
1012
- catch (_a) {
1013
- return false;
1014
- }
1015
- }
1016
- function isValidCidr(ip, version) {
1017
- if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
1018
- return true;
1019
- }
1020
- if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
1021
- return true;
1022
- }
1023
- return false;
1024
- }
1025
- class ZodString extends ZodType {
1026
- _parse(input) {
1027
- if (this._def.coerce) {
1028
- input.data = String(input.data);
1029
- }
1030
- const parsedType = this._getType(input);
1031
- if (parsedType !== ZodParsedType.string) {
1032
- const ctx = this._getOrReturnCtx(input);
1033
- addIssueToContext(ctx, {
1034
- code: ZodIssueCode.invalid_type,
1035
- expected: ZodParsedType.string,
1036
- received: ctx.parsedType,
1037
- });
1038
- return INVALID;
1039
- }
1040
- const status = new ParseStatus();
1041
- let ctx = undefined;
1042
- for (const check of this._def.checks) {
1043
- if (check.kind === "min") {
1044
- if (input.data.length < check.value) {
1045
- ctx = this._getOrReturnCtx(input, ctx);
1046
- addIssueToContext(ctx, {
1047
- code: ZodIssueCode.too_small,
1048
- minimum: check.value,
1049
- type: "string",
1050
- inclusive: true,
1051
- exact: false,
1052
- message: check.message,
1053
- });
1054
- status.dirty();
1055
- }
1056
- }
1057
- else if (check.kind === "max") {
1058
- if (input.data.length > check.value) {
1059
- ctx = this._getOrReturnCtx(input, ctx);
1060
- addIssueToContext(ctx, {
1061
- code: ZodIssueCode.too_big,
1062
- maximum: check.value,
1063
- type: "string",
1064
- inclusive: true,
1065
- exact: false,
1066
- message: check.message,
1067
- });
1068
- status.dirty();
1069
- }
1070
- }
1071
- else if (check.kind === "length") {
1072
- const tooBig = input.data.length > check.value;
1073
- const tooSmall = input.data.length < check.value;
1074
- if (tooBig || tooSmall) {
1075
- ctx = this._getOrReturnCtx(input, ctx);
1076
- if (tooBig) {
1077
- addIssueToContext(ctx, {
1078
- code: ZodIssueCode.too_big,
1079
- maximum: check.value,
1080
- type: "string",
1081
- inclusive: true,
1082
- exact: true,
1083
- message: check.message,
1084
- });
1085
- }
1086
- else if (tooSmall) {
1087
- addIssueToContext(ctx, {
1088
- code: ZodIssueCode.too_small,
1089
- minimum: check.value,
1090
- type: "string",
1091
- inclusive: true,
1092
- exact: true,
1093
- message: check.message,
1094
- });
1095
- }
1096
- status.dirty();
1097
- }
1098
- }
1099
- else if (check.kind === "email") {
1100
- if (!emailRegex.test(input.data)) {
1101
- ctx = this._getOrReturnCtx(input, ctx);
1102
- addIssueToContext(ctx, {
1103
- validation: "email",
1104
- code: ZodIssueCode.invalid_string,
1105
- message: check.message,
1106
- });
1107
- status.dirty();
1108
- }
1109
- }
1110
- else if (check.kind === "emoji") {
1111
- if (!emojiRegex) {
1112
- emojiRegex = new RegExp(_emojiRegex, "u");
1113
- }
1114
- if (!emojiRegex.test(input.data)) {
1115
- ctx = this._getOrReturnCtx(input, ctx);
1116
- addIssueToContext(ctx, {
1117
- validation: "emoji",
1118
- code: ZodIssueCode.invalid_string,
1119
- message: check.message,
1120
- });
1121
- status.dirty();
1122
- }
1123
- }
1124
- else if (check.kind === "uuid") {
1125
- if (!uuidRegex.test(input.data)) {
1126
- ctx = this._getOrReturnCtx(input, ctx);
1127
- addIssueToContext(ctx, {
1128
- validation: "uuid",
1129
- code: ZodIssueCode.invalid_string,
1130
- message: check.message,
1131
- });
1132
- status.dirty();
1133
- }
1134
- }
1135
- else if (check.kind === "nanoid") {
1136
- if (!nanoidRegex.test(input.data)) {
1137
- ctx = this._getOrReturnCtx(input, ctx);
1138
- addIssueToContext(ctx, {
1139
- validation: "nanoid",
1140
- code: ZodIssueCode.invalid_string,
1141
- message: check.message,
1142
- });
1143
- status.dirty();
1144
- }
1145
- }
1146
- else if (check.kind === "cuid") {
1147
- if (!cuidRegex.test(input.data)) {
1148
- ctx = this._getOrReturnCtx(input, ctx);
1149
- addIssueToContext(ctx, {
1150
- validation: "cuid",
1151
- code: ZodIssueCode.invalid_string,
1152
- message: check.message,
1153
- });
1154
- status.dirty();
1155
- }
1156
- }
1157
- else if (check.kind === "cuid2") {
1158
- if (!cuid2Regex.test(input.data)) {
1159
- ctx = this._getOrReturnCtx(input, ctx);
1160
- addIssueToContext(ctx, {
1161
- validation: "cuid2",
1162
- code: ZodIssueCode.invalid_string,
1163
- message: check.message,
1164
- });
1165
- status.dirty();
1166
- }
1167
- }
1168
- else if (check.kind === "ulid") {
1169
- if (!ulidRegex.test(input.data)) {
1170
- ctx = this._getOrReturnCtx(input, ctx);
1171
- addIssueToContext(ctx, {
1172
- validation: "ulid",
1173
- code: ZodIssueCode.invalid_string,
1174
- message: check.message,
1175
- });
1176
- status.dirty();
1177
- }
1178
- }
1179
- else if (check.kind === "url") {
1180
- try {
1181
- new URL(input.data);
1182
- }
1183
- catch (_a) {
1184
- ctx = this._getOrReturnCtx(input, ctx);
1185
- addIssueToContext(ctx, {
1186
- validation: "url",
1187
- code: ZodIssueCode.invalid_string,
1188
- message: check.message,
1189
- });
1190
- status.dirty();
1191
- }
1192
- }
1193
- else if (check.kind === "regex") {
1194
- check.regex.lastIndex = 0;
1195
- const testResult = check.regex.test(input.data);
1196
- if (!testResult) {
1197
- ctx = this._getOrReturnCtx(input, ctx);
1198
- addIssueToContext(ctx, {
1199
- validation: "regex",
1200
- code: ZodIssueCode.invalid_string,
1201
- message: check.message,
1202
- });
1203
- status.dirty();
1204
- }
1205
- }
1206
- else if (check.kind === "trim") {
1207
- input.data = input.data.trim();
1208
- }
1209
- else if (check.kind === "includes") {
1210
- if (!input.data.includes(check.value, check.position)) {
1211
- ctx = this._getOrReturnCtx(input, ctx);
1212
- addIssueToContext(ctx, {
1213
- code: ZodIssueCode.invalid_string,
1214
- validation: { includes: check.value, position: check.position },
1215
- message: check.message,
1216
- });
1217
- status.dirty();
1218
- }
1219
- }
1220
- else if (check.kind === "toLowerCase") {
1221
- input.data = input.data.toLowerCase();
1222
- }
1223
- else if (check.kind === "toUpperCase") {
1224
- input.data = input.data.toUpperCase();
1225
- }
1226
- else if (check.kind === "startsWith") {
1227
- if (!input.data.startsWith(check.value)) {
1228
- ctx = this._getOrReturnCtx(input, ctx);
1229
- addIssueToContext(ctx, {
1230
- code: ZodIssueCode.invalid_string,
1231
- validation: { startsWith: check.value },
1232
- message: check.message,
1233
- });
1234
- status.dirty();
1235
- }
1236
- }
1237
- else if (check.kind === "endsWith") {
1238
- if (!input.data.endsWith(check.value)) {
1239
- ctx = this._getOrReturnCtx(input, ctx);
1240
- addIssueToContext(ctx, {
1241
- code: ZodIssueCode.invalid_string,
1242
- validation: { endsWith: check.value },
1243
- message: check.message,
1244
- });
1245
- status.dirty();
1246
- }
1247
- }
1248
- else if (check.kind === "datetime") {
1249
- const regex = datetimeRegex(check);
1250
- if (!regex.test(input.data)) {
1251
- ctx = this._getOrReturnCtx(input, ctx);
1252
- addIssueToContext(ctx, {
1253
- code: ZodIssueCode.invalid_string,
1254
- validation: "datetime",
1255
- message: check.message,
1256
- });
1257
- status.dirty();
1258
- }
1259
- }
1260
- else if (check.kind === "date") {
1261
- const regex = dateRegex;
1262
- if (!regex.test(input.data)) {
1263
- ctx = this._getOrReturnCtx(input, ctx);
1264
- addIssueToContext(ctx, {
1265
- code: ZodIssueCode.invalid_string,
1266
- validation: "date",
1267
- message: check.message,
1268
- });
1269
- status.dirty();
1270
- }
1271
- }
1272
- else if (check.kind === "time") {
1273
- const regex = timeRegex(check);
1274
- if (!regex.test(input.data)) {
1275
- ctx = this._getOrReturnCtx(input, ctx);
1276
- addIssueToContext(ctx, {
1277
- code: ZodIssueCode.invalid_string,
1278
- validation: "time",
1279
- message: check.message,
1280
- });
1281
- status.dirty();
1282
- }
1283
- }
1284
- else if (check.kind === "duration") {
1285
- if (!durationRegex.test(input.data)) {
1286
- ctx = this._getOrReturnCtx(input, ctx);
1287
- addIssueToContext(ctx, {
1288
- validation: "duration",
1289
- code: ZodIssueCode.invalid_string,
1290
- message: check.message,
1291
- });
1292
- status.dirty();
1293
- }
1294
- }
1295
- else if (check.kind === "ip") {
1296
- if (!isValidIP(input.data, check.version)) {
1297
- ctx = this._getOrReturnCtx(input, ctx);
1298
- addIssueToContext(ctx, {
1299
- validation: "ip",
1300
- code: ZodIssueCode.invalid_string,
1301
- message: check.message,
1302
- });
1303
- status.dirty();
1304
- }
1305
- }
1306
- else if (check.kind === "jwt") {
1307
- if (!isValidJWT(input.data, check.alg)) {
1308
- ctx = this._getOrReturnCtx(input, ctx);
1309
- addIssueToContext(ctx, {
1310
- validation: "jwt",
1311
- code: ZodIssueCode.invalid_string,
1312
- message: check.message,
1313
- });
1314
- status.dirty();
1315
- }
1316
- }
1317
- else if (check.kind === "cidr") {
1318
- if (!isValidCidr(input.data, check.version)) {
1319
- ctx = this._getOrReturnCtx(input, ctx);
1320
- addIssueToContext(ctx, {
1321
- validation: "cidr",
1322
- code: ZodIssueCode.invalid_string,
1323
- message: check.message,
1324
- });
1325
- status.dirty();
1326
- }
1327
- }
1328
- else if (check.kind === "base64") {
1329
- if (!base64Regex.test(input.data)) {
1330
- ctx = this._getOrReturnCtx(input, ctx);
1331
- addIssueToContext(ctx, {
1332
- validation: "base64",
1333
- code: ZodIssueCode.invalid_string,
1334
- message: check.message,
1335
- });
1336
- status.dirty();
1337
- }
1338
- }
1339
- else if (check.kind === "base64url") {
1340
- if (!base64urlRegex.test(input.data)) {
1341
- ctx = this._getOrReturnCtx(input, ctx);
1342
- addIssueToContext(ctx, {
1343
- validation: "base64url",
1344
- code: ZodIssueCode.invalid_string,
1345
- message: check.message,
1346
- });
1347
- status.dirty();
1348
- }
1349
- }
1350
- else {
1351
- util.assertNever(check);
1352
- }
1353
- }
1354
- return { status: status.value, value: input.data };
1355
- }
1356
- _regex(regex, validation, message) {
1357
- return this.refinement((data) => regex.test(data), {
1358
- validation,
1359
- code: ZodIssueCode.invalid_string,
1360
- ...errorUtil.errToObj(message),
1361
- });
1362
- }
1363
- _addCheck(check) {
1364
- return new ZodString({
1365
- ...this._def,
1366
- checks: [...this._def.checks, check],
1367
- });
1368
- }
1369
- email(message) {
1370
- return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
1371
- }
1372
- url(message) {
1373
- return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
1374
- }
1375
- emoji(message) {
1376
- return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
1377
- }
1378
- uuid(message) {
1379
- return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
1380
- }
1381
- nanoid(message) {
1382
- return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
1383
- }
1384
- cuid(message) {
1385
- return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1386
- }
1387
- cuid2(message) {
1388
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1389
- }
1390
- ulid(message) {
1391
- return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
1392
- }
1393
- base64(message) {
1394
- return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
1395
- }
1396
- base64url(message) {
1397
- // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
1398
- return this._addCheck({
1399
- kind: "base64url",
1400
- ...errorUtil.errToObj(message),
1401
- });
1402
- }
1403
- jwt(options) {
1404
- return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
1405
- }
1406
- ip(options) {
1407
- return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
1408
- }
1409
- cidr(options) {
1410
- return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
1411
- }
1412
- datetime(options) {
1413
- var _a, _b;
1414
- if (typeof options === "string") {
1415
- return this._addCheck({
1416
- kind: "datetime",
1417
- precision: null,
1418
- offset: false,
1419
- local: false,
1420
- message: options,
1421
- });
1422
- }
1423
- return this._addCheck({
1424
- kind: "datetime",
1425
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1426
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1427
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
1428
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
1429
- });
1430
- }
1431
- date(message) {
1432
- return this._addCheck({ kind: "date", message });
1433
- }
1434
- time(options) {
1435
- if (typeof options === "string") {
1436
- return this._addCheck({
1437
- kind: "time",
1438
- precision: null,
1439
- message: options,
1440
- });
1441
- }
1442
- return this._addCheck({
1443
- kind: "time",
1444
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1445
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
1446
- });
1447
- }
1448
- duration(message) {
1449
- return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
1450
- }
1451
- regex(regex, message) {
1452
- return this._addCheck({
1453
- kind: "regex",
1454
- regex: regex,
1455
- ...errorUtil.errToObj(message),
1456
- });
1457
- }
1458
- includes(value, options) {
1459
- return this._addCheck({
1460
- kind: "includes",
1461
- value: value,
1462
- position: options === null || options === void 0 ? void 0 : options.position,
1463
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
1464
- });
1465
- }
1466
- startsWith(value, message) {
1467
- return this._addCheck({
1468
- kind: "startsWith",
1469
- value: value,
1470
- ...errorUtil.errToObj(message),
1471
- });
1472
- }
1473
- endsWith(value, message) {
1474
- return this._addCheck({
1475
- kind: "endsWith",
1476
- value: value,
1477
- ...errorUtil.errToObj(message),
1478
- });
1479
- }
1480
- min(minLength, message) {
1481
- return this._addCheck({
1482
- kind: "min",
1483
- value: minLength,
1484
- ...errorUtil.errToObj(message),
1485
- });
1486
- }
1487
- max(maxLength, message) {
1488
- return this._addCheck({
1489
- kind: "max",
1490
- value: maxLength,
1491
- ...errorUtil.errToObj(message),
1492
- });
1493
- }
1494
- length(len, message) {
1495
- return this._addCheck({
1496
- kind: "length",
1497
- value: len,
1498
- ...errorUtil.errToObj(message),
1499
- });
1500
- }
1501
- /**
1502
- * Equivalent to `.min(1)`
1503
- */
1504
- nonempty(message) {
1505
- return this.min(1, errorUtil.errToObj(message));
1506
- }
1507
- trim() {
1508
- return new ZodString({
1509
- ...this._def,
1510
- checks: [...this._def.checks, { kind: "trim" }],
1511
- });
1512
- }
1513
- toLowerCase() {
1514
- return new ZodString({
1515
- ...this._def,
1516
- checks: [...this._def.checks, { kind: "toLowerCase" }],
1517
- });
1518
- }
1519
- toUpperCase() {
1520
- return new ZodString({
1521
- ...this._def,
1522
- checks: [...this._def.checks, { kind: "toUpperCase" }],
1523
- });
1524
- }
1525
- get isDatetime() {
1526
- return !!this._def.checks.find((ch) => ch.kind === "datetime");
1527
- }
1528
- get isDate() {
1529
- return !!this._def.checks.find((ch) => ch.kind === "date");
1530
- }
1531
- get isTime() {
1532
- return !!this._def.checks.find((ch) => ch.kind === "time");
1533
- }
1534
- get isDuration() {
1535
- return !!this._def.checks.find((ch) => ch.kind === "duration");
1536
- }
1537
- get isEmail() {
1538
- return !!this._def.checks.find((ch) => ch.kind === "email");
1539
- }
1540
- get isURL() {
1541
- return !!this._def.checks.find((ch) => ch.kind === "url");
1542
- }
1543
- get isEmoji() {
1544
- return !!this._def.checks.find((ch) => ch.kind === "emoji");
1545
- }
1546
- get isUUID() {
1547
- return !!this._def.checks.find((ch) => ch.kind === "uuid");
1548
- }
1549
- get isNANOID() {
1550
- return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1551
- }
1552
- get isCUID() {
1553
- return !!this._def.checks.find((ch) => ch.kind === "cuid");
1554
- }
1555
- get isCUID2() {
1556
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1557
- }
1558
- get isULID() {
1559
- return !!this._def.checks.find((ch) => ch.kind === "ulid");
1560
- }
1561
- get isIP() {
1562
- return !!this._def.checks.find((ch) => ch.kind === "ip");
1563
- }
1564
- get isCIDR() {
1565
- return !!this._def.checks.find((ch) => ch.kind === "cidr");
1566
- }
1567
- get isBase64() {
1568
- return !!this._def.checks.find((ch) => ch.kind === "base64");
1569
- }
1570
- get isBase64url() {
1571
- // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
1572
- return !!this._def.checks.find((ch) => ch.kind === "base64url");
1573
- }
1574
- get minLength() {
1575
- let min = null;
1576
- for (const ch of this._def.checks) {
1577
- if (ch.kind === "min") {
1578
- if (min === null || ch.value > min)
1579
- min = ch.value;
1580
- }
1581
- }
1582
- return min;
1583
- }
1584
- get maxLength() {
1585
- let max = null;
1586
- for (const ch of this._def.checks) {
1587
- if (ch.kind === "max") {
1588
- if (max === null || ch.value < max)
1589
- max = ch.value;
1590
- }
1591
- }
1592
- return max;
1593
- }
1594
- }
1595
- ZodString.create = (params) => {
1596
- var _a;
1597
- return new ZodString({
1598
- checks: [],
1599
- typeName: ZodFirstPartyTypeKind.ZodString,
1600
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1601
- ...processCreateParams(params),
1602
- });
1603
- };
1604
- // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
1605
- function floatSafeRemainder(val, step) {
1606
- const valDecCount = (val.toString().split(".")[1] || "").length;
1607
- const stepDecCount = (step.toString().split(".")[1] || "").length;
1608
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1609
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
1610
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
1611
- return (valInt % stepInt) / Math.pow(10, decCount);
1612
- }
1613
- class ZodNumber extends ZodType {
1614
- constructor() {
1615
- super(...arguments);
1616
- this.min = this.gte;
1617
- this.max = this.lte;
1618
- this.step = this.multipleOf;
1619
- }
1620
- _parse(input) {
1621
- if (this._def.coerce) {
1622
- input.data = Number(input.data);
1623
- }
1624
- const parsedType = this._getType(input);
1625
- if (parsedType !== ZodParsedType.number) {
1626
- const ctx = this._getOrReturnCtx(input);
1627
- addIssueToContext(ctx, {
1628
- code: ZodIssueCode.invalid_type,
1629
- expected: ZodParsedType.number,
1630
- received: ctx.parsedType,
1631
- });
1632
- return INVALID;
1633
- }
1634
- let ctx = undefined;
1635
- const status = new ParseStatus();
1636
- for (const check of this._def.checks) {
1637
- if (check.kind === "int") {
1638
- if (!util.isInteger(input.data)) {
1639
- ctx = this._getOrReturnCtx(input, ctx);
1640
- addIssueToContext(ctx, {
1641
- code: ZodIssueCode.invalid_type,
1642
- expected: "integer",
1643
- received: "float",
1644
- message: check.message,
1645
- });
1646
- status.dirty();
1647
- }
1648
- }
1649
- else if (check.kind === "min") {
1650
- const tooSmall = check.inclusive
1651
- ? input.data < check.value
1652
- : input.data <= check.value;
1653
- if (tooSmall) {
1654
- ctx = this._getOrReturnCtx(input, ctx);
1655
- addIssueToContext(ctx, {
1656
- code: ZodIssueCode.too_small,
1657
- minimum: check.value,
1658
- type: "number",
1659
- inclusive: check.inclusive,
1660
- exact: false,
1661
- message: check.message,
1662
- });
1663
- status.dirty();
1664
- }
1665
- }
1666
- else if (check.kind === "max") {
1667
- const tooBig = check.inclusive
1668
- ? input.data > check.value
1669
- : input.data >= check.value;
1670
- if (tooBig) {
1671
- ctx = this._getOrReturnCtx(input, ctx);
1672
- addIssueToContext(ctx, {
1673
- code: ZodIssueCode.too_big,
1674
- maximum: check.value,
1675
- type: "number",
1676
- inclusive: check.inclusive,
1677
- exact: false,
1678
- message: check.message,
1679
- });
1680
- status.dirty();
1681
- }
1682
- }
1683
- else if (check.kind === "multipleOf") {
1684
- if (floatSafeRemainder(input.data, check.value) !== 0) {
1685
- ctx = this._getOrReturnCtx(input, ctx);
1686
- addIssueToContext(ctx, {
1687
- code: ZodIssueCode.not_multiple_of,
1688
- multipleOf: check.value,
1689
- message: check.message,
1690
- });
1691
- status.dirty();
1692
- }
1693
- }
1694
- else if (check.kind === "finite") {
1695
- if (!Number.isFinite(input.data)) {
1696
- ctx = this._getOrReturnCtx(input, ctx);
1697
- addIssueToContext(ctx, {
1698
- code: ZodIssueCode.not_finite,
1699
- message: check.message,
1700
- });
1701
- status.dirty();
1702
- }
1703
- }
1704
- else {
1705
- util.assertNever(check);
1706
- }
1707
- }
1708
- return { status: status.value, value: input.data };
1709
- }
1710
- gte(value, message) {
1711
- return this.setLimit("min", value, true, errorUtil.toString(message));
1712
- }
1713
- gt(value, message) {
1714
- return this.setLimit("min", value, false, errorUtil.toString(message));
1715
- }
1716
- lte(value, message) {
1717
- return this.setLimit("max", value, true, errorUtil.toString(message));
1718
- }
1719
- lt(value, message) {
1720
- return this.setLimit("max", value, false, errorUtil.toString(message));
1721
- }
1722
- setLimit(kind, value, inclusive, message) {
1723
- return new ZodNumber({
1724
- ...this._def,
1725
- checks: [
1726
- ...this._def.checks,
1727
- {
1728
- kind,
1729
- value,
1730
- inclusive,
1731
- message: errorUtil.toString(message),
1732
- },
1733
- ],
1734
- });
1735
- }
1736
- _addCheck(check) {
1737
- return new ZodNumber({
1738
- ...this._def,
1739
- checks: [...this._def.checks, check],
1740
- });
1741
- }
1742
- int(message) {
1743
- return this._addCheck({
1744
- kind: "int",
1745
- message: errorUtil.toString(message),
1746
- });
1747
- }
1748
- positive(message) {
1749
- return this._addCheck({
1750
- kind: "min",
1751
- value: 0,
1752
- inclusive: false,
1753
- message: errorUtil.toString(message),
1754
- });
1755
- }
1756
- negative(message) {
1757
- return this._addCheck({
1758
- kind: "max",
1759
- value: 0,
1760
- inclusive: false,
1761
- message: errorUtil.toString(message),
1762
- });
1763
- }
1764
- nonpositive(message) {
1765
- return this._addCheck({
1766
- kind: "max",
1767
- value: 0,
1768
- inclusive: true,
1769
- message: errorUtil.toString(message),
1770
- });
1771
- }
1772
- nonnegative(message) {
1773
- return this._addCheck({
1774
- kind: "min",
1775
- value: 0,
1776
- inclusive: true,
1777
- message: errorUtil.toString(message),
1778
- });
1779
- }
1780
- multipleOf(value, message) {
1781
- return this._addCheck({
1782
- kind: "multipleOf",
1783
- value: value,
1784
- message: errorUtil.toString(message),
1785
- });
1786
- }
1787
- finite(message) {
1788
- return this._addCheck({
1789
- kind: "finite",
1790
- message: errorUtil.toString(message),
1791
- });
1792
- }
1793
- safe(message) {
1794
- return this._addCheck({
1795
- kind: "min",
1796
- inclusive: true,
1797
- value: Number.MIN_SAFE_INTEGER,
1798
- message: errorUtil.toString(message),
1799
- })._addCheck({
1800
- kind: "max",
1801
- inclusive: true,
1802
- value: Number.MAX_SAFE_INTEGER,
1803
- message: errorUtil.toString(message),
1804
- });
1805
- }
1806
- get minValue() {
1807
- let min = null;
1808
- for (const ch of this._def.checks) {
1809
- if (ch.kind === "min") {
1810
- if (min === null || ch.value > min)
1811
- min = ch.value;
1812
- }
1813
- }
1814
- return min;
1815
- }
1816
- get maxValue() {
1817
- let max = null;
1818
- for (const ch of this._def.checks) {
1819
- if (ch.kind === "max") {
1820
- if (max === null || ch.value < max)
1821
- max = ch.value;
1822
- }
1823
- }
1824
- return max;
1825
- }
1826
- get isInt() {
1827
- return !!this._def.checks.find((ch) => ch.kind === "int" ||
1828
- (ch.kind === "multipleOf" && util.isInteger(ch.value)));
1829
- }
1830
- get isFinite() {
1831
- let max = null, min = null;
1832
- for (const ch of this._def.checks) {
1833
- if (ch.kind === "finite" ||
1834
- ch.kind === "int" ||
1835
- ch.kind === "multipleOf") {
1836
- return true;
1837
- }
1838
- else if (ch.kind === "min") {
1839
- if (min === null || ch.value > min)
1840
- min = ch.value;
1841
- }
1842
- else if (ch.kind === "max") {
1843
- if (max === null || ch.value < max)
1844
- max = ch.value;
1845
- }
1846
- }
1847
- return Number.isFinite(min) && Number.isFinite(max);
1848
- }
1849
- }
1850
- ZodNumber.create = (params) => {
1851
- return new ZodNumber({
1852
- checks: [],
1853
- typeName: ZodFirstPartyTypeKind.ZodNumber,
1854
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1855
- ...processCreateParams(params),
1856
- });
1857
- };
1858
- class ZodBigInt extends ZodType {
1859
- constructor() {
1860
- super(...arguments);
1861
- this.min = this.gte;
1862
- this.max = this.lte;
1863
- }
1864
- _parse(input) {
1865
- if (this._def.coerce) {
1866
- try {
1867
- input.data = BigInt(input.data);
1868
- }
1869
- catch (_a) {
1870
- return this._getInvalidInput(input);
1871
- }
1872
- }
1873
- const parsedType = this._getType(input);
1874
- if (parsedType !== ZodParsedType.bigint) {
1875
- return this._getInvalidInput(input);
1876
- }
1877
- let ctx = undefined;
1878
- const status = new ParseStatus();
1879
- for (const check of this._def.checks) {
1880
- if (check.kind === "min") {
1881
- const tooSmall = check.inclusive
1882
- ? input.data < check.value
1883
- : input.data <= check.value;
1884
- if (tooSmall) {
1885
- ctx = this._getOrReturnCtx(input, ctx);
1886
- addIssueToContext(ctx, {
1887
- code: ZodIssueCode.too_small,
1888
- type: "bigint",
1889
- minimum: check.value,
1890
- inclusive: check.inclusive,
1891
- message: check.message,
1892
- });
1893
- status.dirty();
1894
- }
1895
- }
1896
- else if (check.kind === "max") {
1897
- const tooBig = check.inclusive
1898
- ? input.data > check.value
1899
- : input.data >= check.value;
1900
- if (tooBig) {
1901
- ctx = this._getOrReturnCtx(input, ctx);
1902
- addIssueToContext(ctx, {
1903
- code: ZodIssueCode.too_big,
1904
- type: "bigint",
1905
- maximum: check.value,
1906
- inclusive: check.inclusive,
1907
- message: check.message,
1908
- });
1909
- status.dirty();
1910
- }
1911
- }
1912
- else if (check.kind === "multipleOf") {
1913
- if (input.data % check.value !== BigInt(0)) {
1914
- ctx = this._getOrReturnCtx(input, ctx);
1915
- addIssueToContext(ctx, {
1916
- code: ZodIssueCode.not_multiple_of,
1917
- multipleOf: check.value,
1918
- message: check.message,
1919
- });
1920
- status.dirty();
1921
- }
1922
- }
1923
- else {
1924
- util.assertNever(check);
1925
- }
1926
- }
1927
- return { status: status.value, value: input.data };
1928
- }
1929
- _getInvalidInput(input) {
1930
- const ctx = this._getOrReturnCtx(input);
1931
- addIssueToContext(ctx, {
1932
- code: ZodIssueCode.invalid_type,
1933
- expected: ZodParsedType.bigint,
1934
- received: ctx.parsedType,
1935
- });
1936
- return INVALID;
1937
- }
1938
- gte(value, message) {
1939
- return this.setLimit("min", value, true, errorUtil.toString(message));
1940
- }
1941
- gt(value, message) {
1942
- return this.setLimit("min", value, false, errorUtil.toString(message));
1943
- }
1944
- lte(value, message) {
1945
- return this.setLimit("max", value, true, errorUtil.toString(message));
1946
- }
1947
- lt(value, message) {
1948
- return this.setLimit("max", value, false, errorUtil.toString(message));
1949
- }
1950
- setLimit(kind, value, inclusive, message) {
1951
- return new ZodBigInt({
1952
- ...this._def,
1953
- checks: [
1954
- ...this._def.checks,
1955
- {
1956
- kind,
1957
- value,
1958
- inclusive,
1959
- message: errorUtil.toString(message),
1960
- },
1961
- ],
1962
- });
1963
- }
1964
- _addCheck(check) {
1965
- return new ZodBigInt({
1966
- ...this._def,
1967
- checks: [...this._def.checks, check],
1968
- });
1969
- }
1970
- positive(message) {
1971
- return this._addCheck({
1972
- kind: "min",
1973
- value: BigInt(0),
1974
- inclusive: false,
1975
- message: errorUtil.toString(message),
1976
- });
1977
- }
1978
- negative(message) {
1979
- return this._addCheck({
1980
- kind: "max",
1981
- value: BigInt(0),
1982
- inclusive: false,
1983
- message: errorUtil.toString(message),
1984
- });
1985
- }
1986
- nonpositive(message) {
1987
- return this._addCheck({
1988
- kind: "max",
1989
- value: BigInt(0),
1990
- inclusive: true,
1991
- message: errorUtil.toString(message),
1992
- });
1993
- }
1994
- nonnegative(message) {
1995
- return this._addCheck({
1996
- kind: "min",
1997
- value: BigInt(0),
1998
- inclusive: true,
1999
- message: errorUtil.toString(message),
2000
- });
2001
- }
2002
- multipleOf(value, message) {
2003
- return this._addCheck({
2004
- kind: "multipleOf",
2005
- value,
2006
- message: errorUtil.toString(message),
2007
- });
2008
- }
2009
- get minValue() {
2010
- let min = null;
2011
- for (const ch of this._def.checks) {
2012
- if (ch.kind === "min") {
2013
- if (min === null || ch.value > min)
2014
- min = ch.value;
2015
- }
2016
- }
2017
- return min;
2018
- }
2019
- get maxValue() {
2020
- let max = null;
2021
- for (const ch of this._def.checks) {
2022
- if (ch.kind === "max") {
2023
- if (max === null || ch.value < max)
2024
- max = ch.value;
2025
- }
2026
- }
2027
- return max;
2028
- }
2029
- }
2030
- ZodBigInt.create = (params) => {
2031
- var _a;
2032
- return new ZodBigInt({
2033
- checks: [],
2034
- typeName: ZodFirstPartyTypeKind.ZodBigInt,
2035
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
2036
- ...processCreateParams(params),
2037
- });
2038
- };
2039
- class ZodBoolean extends ZodType {
2040
- _parse(input) {
2041
- if (this._def.coerce) {
2042
- input.data = Boolean(input.data);
2043
- }
2044
- const parsedType = this._getType(input);
2045
- if (parsedType !== ZodParsedType.boolean) {
2046
- const ctx = this._getOrReturnCtx(input);
2047
- addIssueToContext(ctx, {
2048
- code: ZodIssueCode.invalid_type,
2049
- expected: ZodParsedType.boolean,
2050
- received: ctx.parsedType,
2051
- });
2052
- return INVALID;
2053
- }
2054
- return OK(input.data);
2055
- }
2056
- }
2057
- ZodBoolean.create = (params) => {
2058
- return new ZodBoolean({
2059
- typeName: ZodFirstPartyTypeKind.ZodBoolean,
2060
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2061
- ...processCreateParams(params),
2062
- });
2063
- };
2064
- class ZodDate extends ZodType {
2065
- _parse(input) {
2066
- if (this._def.coerce) {
2067
- input.data = new Date(input.data);
2068
- }
2069
- const parsedType = this._getType(input);
2070
- if (parsedType !== ZodParsedType.date) {
2071
- const ctx = this._getOrReturnCtx(input);
2072
- addIssueToContext(ctx, {
2073
- code: ZodIssueCode.invalid_type,
2074
- expected: ZodParsedType.date,
2075
- received: ctx.parsedType,
2076
- });
2077
- return INVALID;
2078
- }
2079
- if (isNaN(input.data.getTime())) {
2080
- const ctx = this._getOrReturnCtx(input);
2081
- addIssueToContext(ctx, {
2082
- code: ZodIssueCode.invalid_date,
2083
- });
2084
- return INVALID;
2085
- }
2086
- const status = new ParseStatus();
2087
- let ctx = undefined;
2088
- for (const check of this._def.checks) {
2089
- if (check.kind === "min") {
2090
- if (input.data.getTime() < check.value) {
2091
- ctx = this._getOrReturnCtx(input, ctx);
2092
- addIssueToContext(ctx, {
2093
- code: ZodIssueCode.too_small,
2094
- message: check.message,
2095
- inclusive: true,
2096
- exact: false,
2097
- minimum: check.value,
2098
- type: "date",
2099
- });
2100
- status.dirty();
2101
- }
2102
- }
2103
- else if (check.kind === "max") {
2104
- if (input.data.getTime() > check.value) {
2105
- ctx = this._getOrReturnCtx(input, ctx);
2106
- addIssueToContext(ctx, {
2107
- code: ZodIssueCode.too_big,
2108
- message: check.message,
2109
- inclusive: true,
2110
- exact: false,
2111
- maximum: check.value,
2112
- type: "date",
2113
- });
2114
- status.dirty();
2115
- }
2116
- }
2117
- else {
2118
- util.assertNever(check);
2119
- }
2120
- }
2121
- return {
2122
- status: status.value,
2123
- value: new Date(input.data.getTime()),
2124
- };
2125
- }
2126
- _addCheck(check) {
2127
- return new ZodDate({
2128
- ...this._def,
2129
- checks: [...this._def.checks, check],
2130
- });
2131
- }
2132
- min(minDate, message) {
2133
- return this._addCheck({
2134
- kind: "min",
2135
- value: minDate.getTime(),
2136
- message: errorUtil.toString(message),
2137
- });
2138
- }
2139
- max(maxDate, message) {
2140
- return this._addCheck({
2141
- kind: "max",
2142
- value: maxDate.getTime(),
2143
- message: errorUtil.toString(message),
2144
- });
2145
- }
2146
- get minDate() {
2147
- let min = null;
2148
- for (const ch of this._def.checks) {
2149
- if (ch.kind === "min") {
2150
- if (min === null || ch.value > min)
2151
- min = ch.value;
2152
- }
2153
- }
2154
- return min != null ? new Date(min) : null;
2155
- }
2156
- get maxDate() {
2157
- let max = null;
2158
- for (const ch of this._def.checks) {
2159
- if (ch.kind === "max") {
2160
- if (max === null || ch.value < max)
2161
- max = ch.value;
2162
- }
2163
- }
2164
- return max != null ? new Date(max) : null;
2165
- }
2166
- }
2167
- ZodDate.create = (params) => {
2168
- return new ZodDate({
2169
- checks: [],
2170
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2171
- typeName: ZodFirstPartyTypeKind.ZodDate,
2172
- ...processCreateParams(params),
2173
- });
2174
- };
2175
- class ZodSymbol extends ZodType {
2176
- _parse(input) {
2177
- const parsedType = this._getType(input);
2178
- if (parsedType !== ZodParsedType.symbol) {
2179
- const ctx = this._getOrReturnCtx(input);
2180
- addIssueToContext(ctx, {
2181
- code: ZodIssueCode.invalid_type,
2182
- expected: ZodParsedType.symbol,
2183
- received: ctx.parsedType,
2184
- });
2185
- return INVALID;
2186
- }
2187
- return OK(input.data);
2188
- }
2189
- }
2190
- ZodSymbol.create = (params) => {
2191
- return new ZodSymbol({
2192
- typeName: ZodFirstPartyTypeKind.ZodSymbol,
2193
- ...processCreateParams(params),
2194
- });
2195
- };
2196
- class ZodUndefined extends ZodType {
2197
- _parse(input) {
2198
- const parsedType = this._getType(input);
2199
- if (parsedType !== ZodParsedType.undefined) {
2200
- const ctx = this._getOrReturnCtx(input);
2201
- addIssueToContext(ctx, {
2202
- code: ZodIssueCode.invalid_type,
2203
- expected: ZodParsedType.undefined,
2204
- received: ctx.parsedType,
2205
- });
2206
- return INVALID;
2207
- }
2208
- return OK(input.data);
2209
- }
2210
- }
2211
- ZodUndefined.create = (params) => {
2212
- return new ZodUndefined({
2213
- typeName: ZodFirstPartyTypeKind.ZodUndefined,
2214
- ...processCreateParams(params),
2215
- });
2216
- };
2217
- class ZodNull extends ZodType {
2218
- _parse(input) {
2219
- const parsedType = this._getType(input);
2220
- if (parsedType !== ZodParsedType.null) {
2221
- const ctx = this._getOrReturnCtx(input);
2222
- addIssueToContext(ctx, {
2223
- code: ZodIssueCode.invalid_type,
2224
- expected: ZodParsedType.null,
2225
- received: ctx.parsedType,
2226
- });
2227
- return INVALID;
2228
- }
2229
- return OK(input.data);
2230
- }
2231
- }
2232
- ZodNull.create = (params) => {
2233
- return new ZodNull({
2234
- typeName: ZodFirstPartyTypeKind.ZodNull,
2235
- ...processCreateParams(params),
2236
- });
2237
- };
2238
- class ZodAny extends ZodType {
2239
- constructor() {
2240
- super(...arguments);
2241
- // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
2242
- this._any = true;
2243
- }
2244
- _parse(input) {
2245
- return OK(input.data);
2246
- }
2247
- }
2248
- ZodAny.create = (params) => {
2249
- return new ZodAny({
2250
- typeName: ZodFirstPartyTypeKind.ZodAny,
2251
- ...processCreateParams(params),
2252
- });
2253
- };
2254
- class ZodUnknown extends ZodType {
2255
- constructor() {
2256
- super(...arguments);
2257
- // required
2258
- this._unknown = true;
2259
- }
2260
- _parse(input) {
2261
- return OK(input.data);
2262
- }
2263
- }
2264
- ZodUnknown.create = (params) => {
2265
- return new ZodUnknown({
2266
- typeName: ZodFirstPartyTypeKind.ZodUnknown,
2267
- ...processCreateParams(params),
2268
- });
2269
- };
2270
- class ZodNever extends ZodType {
2271
- _parse(input) {
2272
- const ctx = this._getOrReturnCtx(input);
2273
- addIssueToContext(ctx, {
2274
- code: ZodIssueCode.invalid_type,
2275
- expected: ZodParsedType.never,
2276
- received: ctx.parsedType,
2277
- });
2278
- return INVALID;
2279
- }
2280
- }
2281
- ZodNever.create = (params) => {
2282
- return new ZodNever({
2283
- typeName: ZodFirstPartyTypeKind.ZodNever,
2284
- ...processCreateParams(params),
2285
- });
2286
- };
2287
- class ZodVoid extends ZodType {
2288
- _parse(input) {
2289
- const parsedType = this._getType(input);
2290
- if (parsedType !== ZodParsedType.undefined) {
2291
- const ctx = this._getOrReturnCtx(input);
2292
- addIssueToContext(ctx, {
2293
- code: ZodIssueCode.invalid_type,
2294
- expected: ZodParsedType.void,
2295
- received: ctx.parsedType,
2296
- });
2297
- return INVALID;
2298
- }
2299
- return OK(input.data);
2300
- }
2301
- }
2302
- ZodVoid.create = (params) => {
2303
- return new ZodVoid({
2304
- typeName: ZodFirstPartyTypeKind.ZodVoid,
2305
- ...processCreateParams(params),
2306
- });
2307
- };
2308
- class ZodArray extends ZodType {
2309
- _parse(input) {
2310
- const { ctx, status } = this._processInputParams(input);
2311
- const def = this._def;
2312
- if (ctx.parsedType !== ZodParsedType.array) {
2313
- addIssueToContext(ctx, {
2314
- code: ZodIssueCode.invalid_type,
2315
- expected: ZodParsedType.array,
2316
- received: ctx.parsedType,
2317
- });
2318
- return INVALID;
2319
- }
2320
- if (def.exactLength !== null) {
2321
- const tooBig = ctx.data.length > def.exactLength.value;
2322
- const tooSmall = ctx.data.length < def.exactLength.value;
2323
- if (tooBig || tooSmall) {
2324
- addIssueToContext(ctx, {
2325
- code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
2326
- minimum: (tooSmall ? def.exactLength.value : undefined),
2327
- maximum: (tooBig ? def.exactLength.value : undefined),
2328
- type: "array",
2329
- inclusive: true,
2330
- exact: true,
2331
- message: def.exactLength.message,
2332
- });
2333
- status.dirty();
2334
- }
2335
- }
2336
- if (def.minLength !== null) {
2337
- if (ctx.data.length < def.minLength.value) {
2338
- addIssueToContext(ctx, {
2339
- code: ZodIssueCode.too_small,
2340
- minimum: def.minLength.value,
2341
- type: "array",
2342
- inclusive: true,
2343
- exact: false,
2344
- message: def.minLength.message,
2345
- });
2346
- status.dirty();
2347
- }
2348
- }
2349
- if (def.maxLength !== null) {
2350
- if (ctx.data.length > def.maxLength.value) {
2351
- addIssueToContext(ctx, {
2352
- code: ZodIssueCode.too_big,
2353
- maximum: def.maxLength.value,
2354
- type: "array",
2355
- inclusive: true,
2356
- exact: false,
2357
- message: def.maxLength.message,
2358
- });
2359
- status.dirty();
2360
- }
2361
- }
2362
- if (ctx.common.async) {
2363
- return Promise.all([...ctx.data].map((item, i) => {
2364
- return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2365
- })).then((result) => {
2366
- return ParseStatus.mergeArray(status, result);
2367
- });
2368
- }
2369
- const result = [...ctx.data].map((item, i) => {
2370
- return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2371
- });
2372
- return ParseStatus.mergeArray(status, result);
2373
- }
2374
- get element() {
2375
- return this._def.type;
2376
- }
2377
- min(minLength, message) {
2378
- return new ZodArray({
2379
- ...this._def,
2380
- minLength: { value: minLength, message: errorUtil.toString(message) },
2381
- });
2382
- }
2383
- max(maxLength, message) {
2384
- return new ZodArray({
2385
- ...this._def,
2386
- maxLength: { value: maxLength, message: errorUtil.toString(message) },
2387
- });
2388
- }
2389
- length(len, message) {
2390
- return new ZodArray({
2391
- ...this._def,
2392
- exactLength: { value: len, message: errorUtil.toString(message) },
2393
- });
2394
- }
2395
- nonempty(message) {
2396
- return this.min(1, message);
2397
- }
2398
- }
2399
- ZodArray.create = (schema, params) => {
2400
- return new ZodArray({
2401
- type: schema,
2402
- minLength: null,
2403
- maxLength: null,
2404
- exactLength: null,
2405
- typeName: ZodFirstPartyTypeKind.ZodArray,
2406
- ...processCreateParams(params),
2407
- });
2408
- };
2409
- function deepPartialify(schema) {
2410
- if (schema instanceof ZodObject) {
2411
- const newShape = {};
2412
- for (const key in schema.shape) {
2413
- const fieldSchema = schema.shape[key];
2414
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
2415
- }
2416
- return new ZodObject({
2417
- ...schema._def,
2418
- shape: () => newShape,
2419
- });
2420
- }
2421
- else if (schema instanceof ZodArray) {
2422
- return new ZodArray({
2423
- ...schema._def,
2424
- type: deepPartialify(schema.element),
2425
- });
2426
- }
2427
- else if (schema instanceof ZodOptional) {
2428
- return ZodOptional.create(deepPartialify(schema.unwrap()));
2429
- }
2430
- else if (schema instanceof ZodNullable) {
2431
- return ZodNullable.create(deepPartialify(schema.unwrap()));
2432
- }
2433
- else if (schema instanceof ZodTuple) {
2434
- return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
2435
- }
2436
- else {
2437
- return schema;
2438
- }
2439
- }
2440
- class ZodObject extends ZodType {
2441
- constructor() {
2442
- super(...arguments);
2443
- this._cached = null;
2444
- /**
2445
- * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
2446
- * If you want to pass through unknown properties, use `.passthrough()` instead.
2447
- */
2448
- this.nonstrict = this.passthrough;
2449
- // extend<
2450
- // Augmentation extends ZodRawShape,
2451
- // NewOutput extends util.flatten<{
2452
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2453
- // ? Augmentation[k]["_output"]
2454
- // : k extends keyof Output
2455
- // ? Output[k]
2456
- // : never;
2457
- // }>,
2458
- // NewInput extends util.flatten<{
2459
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2460
- // ? Augmentation[k]["_input"]
2461
- // : k extends keyof Input
2462
- // ? Input[k]
2463
- // : never;
2464
- // }>
2465
- // >(
2466
- // augmentation: Augmentation
2467
- // ): ZodObject<
2468
- // extendShape<T, Augmentation>,
2469
- // UnknownKeys,
2470
- // Catchall,
2471
- // NewOutput,
2472
- // NewInput
2473
- // > {
2474
- // return new ZodObject({
2475
- // ...this._def,
2476
- // shape: () => ({
2477
- // ...this._def.shape(),
2478
- // ...augmentation,
2479
- // }),
2480
- // }) as any;
2481
- // }
2482
- /**
2483
- * @deprecated Use `.extend` instead
2484
- * */
2485
- this.augment = this.extend;
2486
- }
2487
- _getCached() {
2488
- if (this._cached !== null)
2489
- return this._cached;
2490
- const shape = this._def.shape();
2491
- const keys = util.objectKeys(shape);
2492
- return (this._cached = { shape, keys });
2493
- }
2494
- _parse(input) {
2495
- const parsedType = this._getType(input);
2496
- if (parsedType !== ZodParsedType.object) {
2497
- const ctx = this._getOrReturnCtx(input);
2498
- addIssueToContext(ctx, {
2499
- code: ZodIssueCode.invalid_type,
2500
- expected: ZodParsedType.object,
2501
- received: ctx.parsedType,
2502
- });
2503
- return INVALID;
2504
- }
2505
- const { status, ctx } = this._processInputParams(input);
2506
- const { shape, keys: shapeKeys } = this._getCached();
2507
- const extraKeys = [];
2508
- if (!(this._def.catchall instanceof ZodNever &&
2509
- this._def.unknownKeys === "strip")) {
2510
- for (const key in ctx.data) {
2511
- if (!shapeKeys.includes(key)) {
2512
- extraKeys.push(key);
2513
- }
2514
- }
2515
- }
2516
- const pairs = [];
2517
- for (const key of shapeKeys) {
2518
- const keyValidator = shape[key];
2519
- const value = ctx.data[key];
2520
- pairs.push({
2521
- key: { status: "valid", value: key },
2522
- value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2523
- alwaysSet: key in ctx.data,
2524
- });
2525
- }
2526
- if (this._def.catchall instanceof ZodNever) {
2527
- const unknownKeys = this._def.unknownKeys;
2528
- if (unknownKeys === "passthrough") {
2529
- for (const key of extraKeys) {
2530
- pairs.push({
2531
- key: { status: "valid", value: key },
2532
- value: { status: "valid", value: ctx.data[key] },
2533
- });
2534
- }
2535
- }
2536
- else if (unknownKeys === "strict") {
2537
- if (extraKeys.length > 0) {
2538
- addIssueToContext(ctx, {
2539
- code: ZodIssueCode.unrecognized_keys,
2540
- keys: extraKeys,
2541
- });
2542
- status.dirty();
2543
- }
2544
- }
2545
- else if (unknownKeys === "strip") ;
2546
- else {
2547
- throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
2548
- }
2549
- }
2550
- else {
2551
- // run catchall validation
2552
- const catchall = this._def.catchall;
2553
- for (const key of extraKeys) {
2554
- const value = ctx.data[key];
2555
- pairs.push({
2556
- key: { status: "valid", value: key },
2557
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
2558
- ),
2559
- alwaysSet: key in ctx.data,
2560
- });
2561
- }
2562
- }
2563
- if (ctx.common.async) {
2564
- return Promise.resolve()
2565
- .then(async () => {
2566
- const syncPairs = [];
2567
- for (const pair of pairs) {
2568
- const key = await pair.key;
2569
- const value = await pair.value;
2570
- syncPairs.push({
2571
- key,
2572
- value,
2573
- alwaysSet: pair.alwaysSet,
2574
- });
2575
- }
2576
- return syncPairs;
2577
- })
2578
- .then((syncPairs) => {
2579
- return ParseStatus.mergeObjectSync(status, syncPairs);
2580
- });
2581
- }
2582
- else {
2583
- return ParseStatus.mergeObjectSync(status, pairs);
2584
- }
2585
- }
2586
- get shape() {
2587
- return this._def.shape();
2588
- }
2589
- strict(message) {
2590
- errorUtil.errToObj;
2591
- return new ZodObject({
2592
- ...this._def,
2593
- unknownKeys: "strict",
2594
- ...(message !== undefined
2595
- ? {
2596
- errorMap: (issue, ctx) => {
2597
- var _a, _b, _c, _d;
2598
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
2599
- if (issue.code === "unrecognized_keys")
2600
- return {
2601
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
2602
- };
2603
- return {
2604
- message: defaultError,
2605
- };
2606
- },
2607
- }
2608
- : {}),
2609
- });
2610
- }
2611
- strip() {
2612
- return new ZodObject({
2613
- ...this._def,
2614
- unknownKeys: "strip",
2615
- });
2616
- }
2617
- passthrough() {
2618
- return new ZodObject({
2619
- ...this._def,
2620
- unknownKeys: "passthrough",
2621
- });
2622
- }
2623
- // const AugmentFactory =
2624
- // <Def extends ZodObjectDef>(def: Def) =>
2625
- // <Augmentation extends ZodRawShape>(
2626
- // augmentation: Augmentation
2627
- // ): ZodObject<
2628
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2629
- // Def["unknownKeys"],
2630
- // Def["catchall"]
2631
- // > => {
2632
- // return new ZodObject({
2633
- // ...def,
2634
- // shape: () => ({
2635
- // ...def.shape(),
2636
- // ...augmentation,
2637
- // }),
2638
- // }) as any;
2639
- // };
2640
- extend(augmentation) {
2641
- return new ZodObject({
2642
- ...this._def,
2643
- shape: () => ({
2644
- ...this._def.shape(),
2645
- ...augmentation,
2646
- }),
2647
- });
2648
- }
2649
- /**
2650
- * Prior to zod@1.0.12 there was a bug in the
2651
- * inferred type of merged objects. Please
2652
- * upgrade if you are experiencing issues.
2653
- */
2654
- merge(merging) {
2655
- const merged = new ZodObject({
2656
- unknownKeys: merging._def.unknownKeys,
2657
- catchall: merging._def.catchall,
2658
- shape: () => ({
2659
- ...this._def.shape(),
2660
- ...merging._def.shape(),
2661
- }),
2662
- typeName: ZodFirstPartyTypeKind.ZodObject,
2663
- });
2664
- return merged;
2665
- }
2666
- // merge<
2667
- // Incoming extends AnyZodObject,
2668
- // Augmentation extends Incoming["shape"],
2669
- // NewOutput extends {
2670
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2671
- // ? Augmentation[k]["_output"]
2672
- // : k extends keyof Output
2673
- // ? Output[k]
2674
- // : never;
2675
- // },
2676
- // NewInput extends {
2677
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2678
- // ? Augmentation[k]["_input"]
2679
- // : k extends keyof Input
2680
- // ? Input[k]
2681
- // : never;
2682
- // }
2683
- // >(
2684
- // merging: Incoming
2685
- // ): ZodObject<
2686
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2687
- // Incoming["_def"]["unknownKeys"],
2688
- // Incoming["_def"]["catchall"],
2689
- // NewOutput,
2690
- // NewInput
2691
- // > {
2692
- // const merged: any = new ZodObject({
2693
- // unknownKeys: merging._def.unknownKeys,
2694
- // catchall: merging._def.catchall,
2695
- // shape: () =>
2696
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2697
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2698
- // }) as any;
2699
- // return merged;
2700
- // }
2701
- setKey(key, schema) {
2702
- return this.augment({ [key]: schema });
2703
- }
2704
- // merge<Incoming extends AnyZodObject>(
2705
- // merging: Incoming
2706
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2707
- // ZodObject<
2708
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2709
- // Incoming["_def"]["unknownKeys"],
2710
- // Incoming["_def"]["catchall"]
2711
- // > {
2712
- // // const mergedShape = objectUtil.mergeShapes(
2713
- // // this._def.shape(),
2714
- // // merging._def.shape()
2715
- // // );
2716
- // const merged: any = new ZodObject({
2717
- // unknownKeys: merging._def.unknownKeys,
2718
- // catchall: merging._def.catchall,
2719
- // shape: () =>
2720
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2721
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2722
- // }) as any;
2723
- // return merged;
2724
- // }
2725
- catchall(index) {
2726
- return new ZodObject({
2727
- ...this._def,
2728
- catchall: index,
2729
- });
2730
- }
2731
- pick(mask) {
2732
- const shape = {};
2733
- util.objectKeys(mask).forEach((key) => {
2734
- if (mask[key] && this.shape[key]) {
2735
- shape[key] = this.shape[key];
2736
- }
2737
- });
2738
- return new ZodObject({
2739
- ...this._def,
2740
- shape: () => shape,
2741
- });
2742
- }
2743
- omit(mask) {
2744
- const shape = {};
2745
- util.objectKeys(this.shape).forEach((key) => {
2746
- if (!mask[key]) {
2747
- shape[key] = this.shape[key];
2748
- }
2749
- });
2750
- return new ZodObject({
2751
- ...this._def,
2752
- shape: () => shape,
2753
- });
2754
- }
2755
- /**
2756
- * @deprecated
2757
- */
2758
- deepPartial() {
2759
- return deepPartialify(this);
2760
- }
2761
- partial(mask) {
2762
- const newShape = {};
2763
- util.objectKeys(this.shape).forEach((key) => {
2764
- const fieldSchema = this.shape[key];
2765
- if (mask && !mask[key]) {
2766
- newShape[key] = fieldSchema;
2767
- }
2768
- else {
2769
- newShape[key] = fieldSchema.optional();
2770
- }
2771
- });
2772
- return new ZodObject({
2773
- ...this._def,
2774
- shape: () => newShape,
2775
- });
2776
- }
2777
- required(mask) {
2778
- const newShape = {};
2779
- util.objectKeys(this.shape).forEach((key) => {
2780
- if (mask && !mask[key]) {
2781
- newShape[key] = this.shape[key];
2782
- }
2783
- else {
2784
- const fieldSchema = this.shape[key];
2785
- let newField = fieldSchema;
2786
- while (newField instanceof ZodOptional) {
2787
- newField = newField._def.innerType;
2788
- }
2789
- newShape[key] = newField;
2790
- }
2791
- });
2792
- return new ZodObject({
2793
- ...this._def,
2794
- shape: () => newShape,
2795
- });
2796
- }
2797
- keyof() {
2798
- return createZodEnum(util.objectKeys(this.shape));
2799
- }
2800
- }
2801
- ZodObject.create = (shape, params) => {
2802
- return new ZodObject({
2803
- shape: () => shape,
2804
- unknownKeys: "strip",
2805
- catchall: ZodNever.create(),
2806
- typeName: ZodFirstPartyTypeKind.ZodObject,
2807
- ...processCreateParams(params),
2808
- });
2809
- };
2810
- ZodObject.strictCreate = (shape, params) => {
2811
- return new ZodObject({
2812
- shape: () => shape,
2813
- unknownKeys: "strict",
2814
- catchall: ZodNever.create(),
2815
- typeName: ZodFirstPartyTypeKind.ZodObject,
2816
- ...processCreateParams(params),
2817
- });
2818
- };
2819
- ZodObject.lazycreate = (shape, params) => {
2820
- return new ZodObject({
2821
- shape,
2822
- unknownKeys: "strip",
2823
- catchall: ZodNever.create(),
2824
- typeName: ZodFirstPartyTypeKind.ZodObject,
2825
- ...processCreateParams(params),
2826
- });
2827
- };
2828
- class ZodUnion extends ZodType {
2829
- _parse(input) {
2830
- const { ctx } = this._processInputParams(input);
2831
- const options = this._def.options;
2832
- function handleResults(results) {
2833
- // return first issue-free validation if it exists
2834
- for (const result of results) {
2835
- if (result.result.status === "valid") {
2836
- return result.result;
2837
- }
2838
- }
2839
- for (const result of results) {
2840
- if (result.result.status === "dirty") {
2841
- // add issues from dirty option
2842
- ctx.common.issues.push(...result.ctx.common.issues);
2843
- return result.result;
2844
- }
2845
- }
2846
- // return invalid
2847
- const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
2848
- addIssueToContext(ctx, {
2849
- code: ZodIssueCode.invalid_union,
2850
- unionErrors,
2851
- });
2852
- return INVALID;
2853
- }
2854
- if (ctx.common.async) {
2855
- return Promise.all(options.map(async (option) => {
2856
- const childCtx = {
2857
- ...ctx,
2858
- common: {
2859
- ...ctx.common,
2860
- issues: [],
2861
- },
2862
- parent: null,
2863
- };
2864
- return {
2865
- result: await option._parseAsync({
2866
- data: ctx.data,
2867
- path: ctx.path,
2868
- parent: childCtx,
2869
- }),
2870
- ctx: childCtx,
2871
- };
2872
- })).then(handleResults);
2873
- }
2874
- else {
2875
- let dirty = undefined;
2876
- const issues = [];
2877
- for (const option of options) {
2878
- const childCtx = {
2879
- ...ctx,
2880
- common: {
2881
- ...ctx.common,
2882
- issues: [],
2883
- },
2884
- parent: null,
2885
- };
2886
- const result = option._parseSync({
2887
- data: ctx.data,
2888
- path: ctx.path,
2889
- parent: childCtx,
2890
- });
2891
- if (result.status === "valid") {
2892
- return result;
2893
- }
2894
- else if (result.status === "dirty" && !dirty) {
2895
- dirty = { result, ctx: childCtx };
2896
- }
2897
- if (childCtx.common.issues.length) {
2898
- issues.push(childCtx.common.issues);
2899
- }
2900
- }
2901
- if (dirty) {
2902
- ctx.common.issues.push(...dirty.ctx.common.issues);
2903
- return dirty.result;
2904
- }
2905
- const unionErrors = issues.map((issues) => new ZodError(issues));
2906
- addIssueToContext(ctx, {
2907
- code: ZodIssueCode.invalid_union,
2908
- unionErrors,
2909
- });
2910
- return INVALID;
2911
- }
2912
- }
2913
- get options() {
2914
- return this._def.options;
2915
- }
2916
- }
2917
- ZodUnion.create = (types, params) => {
2918
- return new ZodUnion({
2919
- options: types,
2920
- typeName: ZodFirstPartyTypeKind.ZodUnion,
2921
- ...processCreateParams(params),
2922
- });
2923
- };
2924
- /////////////////////////////////////////////////////
2925
- /////////////////////////////////////////////////////
2926
- ////////// //////////
2927
- ////////// ZodDiscriminatedUnion //////////
2928
- ////////// //////////
2929
- /////////////////////////////////////////////////////
2930
- /////////////////////////////////////////////////////
2931
- const getDiscriminator = (type) => {
2932
- if (type instanceof ZodLazy) {
2933
- return getDiscriminator(type.schema);
2934
- }
2935
- else if (type instanceof ZodEffects) {
2936
- return getDiscriminator(type.innerType());
2937
- }
2938
- else if (type instanceof ZodLiteral) {
2939
- return [type.value];
2940
- }
2941
- else if (type instanceof ZodEnum) {
2942
- return type.options;
2943
- }
2944
- else if (type instanceof ZodNativeEnum) {
2945
- // eslint-disable-next-line ban/ban
2946
- return util.objectValues(type.enum);
2947
- }
2948
- else if (type instanceof ZodDefault) {
2949
- return getDiscriminator(type._def.innerType);
2950
- }
2951
- else if (type instanceof ZodUndefined) {
2952
- return [undefined];
2953
- }
2954
- else if (type instanceof ZodNull) {
2955
- return [null];
2956
- }
2957
- else if (type instanceof ZodOptional) {
2958
- return [undefined, ...getDiscriminator(type.unwrap())];
2959
- }
2960
- else if (type instanceof ZodNullable) {
2961
- return [null, ...getDiscriminator(type.unwrap())];
2962
- }
2963
- else if (type instanceof ZodBranded) {
2964
- return getDiscriminator(type.unwrap());
2965
- }
2966
- else if (type instanceof ZodReadonly) {
2967
- return getDiscriminator(type.unwrap());
2968
- }
2969
- else if (type instanceof ZodCatch) {
2970
- return getDiscriminator(type._def.innerType);
2971
- }
2972
- else {
2973
- return [];
2974
- }
2975
- };
2976
- class ZodDiscriminatedUnion extends ZodType {
2977
- _parse(input) {
2978
- const { ctx } = this._processInputParams(input);
2979
- if (ctx.parsedType !== ZodParsedType.object) {
2980
- addIssueToContext(ctx, {
2981
- code: ZodIssueCode.invalid_type,
2982
- expected: ZodParsedType.object,
2983
- received: ctx.parsedType,
2984
- });
2985
- return INVALID;
2986
- }
2987
- const discriminator = this.discriminator;
2988
- const discriminatorValue = ctx.data[discriminator];
2989
- const option = this.optionsMap.get(discriminatorValue);
2990
- if (!option) {
2991
- addIssueToContext(ctx, {
2992
- code: ZodIssueCode.invalid_union_discriminator,
2993
- options: Array.from(this.optionsMap.keys()),
2994
- path: [discriminator],
2995
- });
2996
- return INVALID;
2997
- }
2998
- if (ctx.common.async) {
2999
- return option._parseAsync({
3000
- data: ctx.data,
3001
- path: ctx.path,
3002
- parent: ctx,
3003
- });
3004
- }
3005
- else {
3006
- return option._parseSync({
3007
- data: ctx.data,
3008
- path: ctx.path,
3009
- parent: ctx,
3010
- });
3011
- }
3012
- }
3013
- get discriminator() {
3014
- return this._def.discriminator;
3015
- }
3016
- get options() {
3017
- return this._def.options;
3018
- }
3019
- get optionsMap() {
3020
- return this._def.optionsMap;
3021
- }
3022
- /**
3023
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
3024
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
3025
- * have a different value for each object in the union.
3026
- * @param discriminator the name of the discriminator property
3027
- * @param types an array of object schemas
3028
- * @param params
3029
- */
3030
- static create(discriminator, options, params) {
3031
- // Get all the valid discriminator values
3032
- const optionsMap = new Map();
3033
- // try {
3034
- for (const type of options) {
3035
- const discriminatorValues = getDiscriminator(type.shape[discriminator]);
3036
- if (!discriminatorValues.length) {
3037
- throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
3038
- }
3039
- for (const value of discriminatorValues) {
3040
- if (optionsMap.has(value)) {
3041
- throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
3042
- }
3043
- optionsMap.set(value, type);
3044
- }
3045
- }
3046
- return new ZodDiscriminatedUnion({
3047
- typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
3048
- discriminator,
3049
- options,
3050
- optionsMap,
3051
- ...processCreateParams(params),
3052
- });
3053
- }
3054
- }
3055
- function mergeValues(a, b) {
3056
- const aType = getParsedType(a);
3057
- const bType = getParsedType(b);
3058
- if (a === b) {
3059
- return { valid: true, data: a };
3060
- }
3061
- else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
3062
- const bKeys = util.objectKeys(b);
3063
- const sharedKeys = util
3064
- .objectKeys(a)
3065
- .filter((key) => bKeys.indexOf(key) !== -1);
3066
- const newObj = { ...a, ...b };
3067
- for (const key of sharedKeys) {
3068
- const sharedValue = mergeValues(a[key], b[key]);
3069
- if (!sharedValue.valid) {
3070
- return { valid: false };
3071
- }
3072
- newObj[key] = sharedValue.data;
3073
- }
3074
- return { valid: true, data: newObj };
3075
- }
3076
- else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
3077
- if (a.length !== b.length) {
3078
- return { valid: false };
3079
- }
3080
- const newArray = [];
3081
- for (let index = 0; index < a.length; index++) {
3082
- const itemA = a[index];
3083
- const itemB = b[index];
3084
- const sharedValue = mergeValues(itemA, itemB);
3085
- if (!sharedValue.valid) {
3086
- return { valid: false };
3087
- }
3088
- newArray.push(sharedValue.data);
3089
- }
3090
- return { valid: true, data: newArray };
3091
- }
3092
- else if (aType === ZodParsedType.date &&
3093
- bType === ZodParsedType.date &&
3094
- +a === +b) {
3095
- return { valid: true, data: a };
3096
- }
3097
- else {
3098
- return { valid: false };
3099
- }
3100
- }
3101
- class ZodIntersection extends ZodType {
3102
- _parse(input) {
3103
- const { status, ctx } = this._processInputParams(input);
3104
- const handleParsed = (parsedLeft, parsedRight) => {
3105
- if (isAborted(parsedLeft) || isAborted(parsedRight)) {
3106
- return INVALID;
3107
- }
3108
- const merged = mergeValues(parsedLeft.value, parsedRight.value);
3109
- if (!merged.valid) {
3110
- addIssueToContext(ctx, {
3111
- code: ZodIssueCode.invalid_intersection_types,
3112
- });
3113
- return INVALID;
3114
- }
3115
- if (isDirty(parsedLeft) || isDirty(parsedRight)) {
3116
- status.dirty();
3117
- }
3118
- return { status: status.value, value: merged.data };
3119
- };
3120
- if (ctx.common.async) {
3121
- return Promise.all([
3122
- this._def.left._parseAsync({
3123
- data: ctx.data,
3124
- path: ctx.path,
3125
- parent: ctx,
3126
- }),
3127
- this._def.right._parseAsync({
3128
- data: ctx.data,
3129
- path: ctx.path,
3130
- parent: ctx,
3131
- }),
3132
- ]).then(([left, right]) => handleParsed(left, right));
3133
- }
3134
- else {
3135
- return handleParsed(this._def.left._parseSync({
3136
- data: ctx.data,
3137
- path: ctx.path,
3138
- parent: ctx,
3139
- }), this._def.right._parseSync({
3140
- data: ctx.data,
3141
- path: ctx.path,
3142
- parent: ctx,
3143
- }));
3144
- }
3145
- }
3146
- }
3147
- ZodIntersection.create = (left, right, params) => {
3148
- return new ZodIntersection({
3149
- left: left,
3150
- right: right,
3151
- typeName: ZodFirstPartyTypeKind.ZodIntersection,
3152
- ...processCreateParams(params),
3153
- });
3154
- };
3155
- class ZodTuple extends ZodType {
3156
- _parse(input) {
3157
- const { status, ctx } = this._processInputParams(input);
3158
- if (ctx.parsedType !== ZodParsedType.array) {
3159
- addIssueToContext(ctx, {
3160
- code: ZodIssueCode.invalid_type,
3161
- expected: ZodParsedType.array,
3162
- received: ctx.parsedType,
3163
- });
3164
- return INVALID;
3165
- }
3166
- if (ctx.data.length < this._def.items.length) {
3167
- addIssueToContext(ctx, {
3168
- code: ZodIssueCode.too_small,
3169
- minimum: this._def.items.length,
3170
- inclusive: true,
3171
- exact: false,
3172
- type: "array",
3173
- });
3174
- return INVALID;
3175
- }
3176
- const rest = this._def.rest;
3177
- if (!rest && ctx.data.length > this._def.items.length) {
3178
- addIssueToContext(ctx, {
3179
- code: ZodIssueCode.too_big,
3180
- maximum: this._def.items.length,
3181
- inclusive: true,
3182
- exact: false,
3183
- type: "array",
3184
- });
3185
- status.dirty();
3186
- }
3187
- const items = [...ctx.data]
3188
- .map((item, itemIndex) => {
3189
- const schema = this._def.items[itemIndex] || this._def.rest;
3190
- if (!schema)
3191
- return null;
3192
- return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
3193
- })
3194
- .filter((x) => !!x); // filter nulls
3195
- if (ctx.common.async) {
3196
- return Promise.all(items).then((results) => {
3197
- return ParseStatus.mergeArray(status, results);
3198
- });
3199
- }
3200
- else {
3201
- return ParseStatus.mergeArray(status, items);
3202
- }
3203
- }
3204
- get items() {
3205
- return this._def.items;
3206
- }
3207
- rest(rest) {
3208
- return new ZodTuple({
3209
- ...this._def,
3210
- rest,
3211
- });
3212
- }
3213
- }
3214
- ZodTuple.create = (schemas, params) => {
3215
- if (!Array.isArray(schemas)) {
3216
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
3217
- }
3218
- return new ZodTuple({
3219
- items: schemas,
3220
- typeName: ZodFirstPartyTypeKind.ZodTuple,
3221
- rest: null,
3222
- ...processCreateParams(params),
3223
- });
3224
- };
3225
- class ZodRecord extends ZodType {
3226
- get keySchema() {
3227
- return this._def.keyType;
3228
- }
3229
- get valueSchema() {
3230
- return this._def.valueType;
3231
- }
3232
- _parse(input) {
3233
- const { status, ctx } = this._processInputParams(input);
3234
- if (ctx.parsedType !== ZodParsedType.object) {
3235
- addIssueToContext(ctx, {
3236
- code: ZodIssueCode.invalid_type,
3237
- expected: ZodParsedType.object,
3238
- received: ctx.parsedType,
3239
- });
3240
- return INVALID;
3241
- }
3242
- const pairs = [];
3243
- const keyType = this._def.keyType;
3244
- const valueType = this._def.valueType;
3245
- for (const key in ctx.data) {
3246
- pairs.push({
3247
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
3248
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
3249
- alwaysSet: key in ctx.data,
3250
- });
3251
- }
3252
- if (ctx.common.async) {
3253
- return ParseStatus.mergeObjectAsync(status, pairs);
3254
- }
3255
- else {
3256
- return ParseStatus.mergeObjectSync(status, pairs);
3257
- }
3258
- }
3259
- get element() {
3260
- return this._def.valueType;
3261
- }
3262
- static create(first, second, third) {
3263
- if (second instanceof ZodType) {
3264
- return new ZodRecord({
3265
- keyType: first,
3266
- valueType: second,
3267
- typeName: ZodFirstPartyTypeKind.ZodRecord,
3268
- ...processCreateParams(third),
3269
- });
3270
- }
3271
- return new ZodRecord({
3272
- keyType: ZodString.create(),
3273
- valueType: first,
3274
- typeName: ZodFirstPartyTypeKind.ZodRecord,
3275
- ...processCreateParams(second),
3276
- });
3277
- }
3278
- }
3279
- class ZodMap extends ZodType {
3280
- get keySchema() {
3281
- return this._def.keyType;
3282
- }
3283
- get valueSchema() {
3284
- return this._def.valueType;
3285
- }
3286
- _parse(input) {
3287
- const { status, ctx } = this._processInputParams(input);
3288
- if (ctx.parsedType !== ZodParsedType.map) {
3289
- addIssueToContext(ctx, {
3290
- code: ZodIssueCode.invalid_type,
3291
- expected: ZodParsedType.map,
3292
- received: ctx.parsedType,
3293
- });
3294
- return INVALID;
3295
- }
3296
- const keyType = this._def.keyType;
3297
- const valueType = this._def.valueType;
3298
- const pairs = [...ctx.data.entries()].map(([key, value], index) => {
3299
- return {
3300
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
3301
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
3302
- };
3303
- });
3304
- if (ctx.common.async) {
3305
- const finalMap = new Map();
3306
- return Promise.resolve().then(async () => {
3307
- for (const pair of pairs) {
3308
- const key = await pair.key;
3309
- const value = await pair.value;
3310
- if (key.status === "aborted" || value.status === "aborted") {
3311
- return INVALID;
3312
- }
3313
- if (key.status === "dirty" || value.status === "dirty") {
3314
- status.dirty();
3315
- }
3316
- finalMap.set(key.value, value.value);
3317
- }
3318
- return { status: status.value, value: finalMap };
3319
- });
3320
- }
3321
- else {
3322
- const finalMap = new Map();
3323
- for (const pair of pairs) {
3324
- const key = pair.key;
3325
- const value = pair.value;
3326
- if (key.status === "aborted" || value.status === "aborted") {
3327
- return INVALID;
3328
- }
3329
- if (key.status === "dirty" || value.status === "dirty") {
3330
- status.dirty();
3331
- }
3332
- finalMap.set(key.value, value.value);
3333
- }
3334
- return { status: status.value, value: finalMap };
3335
- }
3336
- }
3337
- }
3338
- ZodMap.create = (keyType, valueType, params) => {
3339
- return new ZodMap({
3340
- valueType,
3341
- keyType,
3342
- typeName: ZodFirstPartyTypeKind.ZodMap,
3343
- ...processCreateParams(params),
3344
- });
3345
- };
3346
- class ZodSet extends ZodType {
3347
- _parse(input) {
3348
- const { status, ctx } = this._processInputParams(input);
3349
- if (ctx.parsedType !== ZodParsedType.set) {
3350
- addIssueToContext(ctx, {
3351
- code: ZodIssueCode.invalid_type,
3352
- expected: ZodParsedType.set,
3353
- received: ctx.parsedType,
3354
- });
3355
- return INVALID;
3356
- }
3357
- const def = this._def;
3358
- if (def.minSize !== null) {
3359
- if (ctx.data.size < def.minSize.value) {
3360
- addIssueToContext(ctx, {
3361
- code: ZodIssueCode.too_small,
3362
- minimum: def.minSize.value,
3363
- type: "set",
3364
- inclusive: true,
3365
- exact: false,
3366
- message: def.minSize.message,
3367
- });
3368
- status.dirty();
3369
- }
3370
- }
3371
- if (def.maxSize !== null) {
3372
- if (ctx.data.size > def.maxSize.value) {
3373
- addIssueToContext(ctx, {
3374
- code: ZodIssueCode.too_big,
3375
- maximum: def.maxSize.value,
3376
- type: "set",
3377
- inclusive: true,
3378
- exact: false,
3379
- message: def.maxSize.message,
3380
- });
3381
- status.dirty();
3382
- }
3383
- }
3384
- const valueType = this._def.valueType;
3385
- function finalizeSet(elements) {
3386
- const parsedSet = new Set();
3387
- for (const element of elements) {
3388
- if (element.status === "aborted")
3389
- return INVALID;
3390
- if (element.status === "dirty")
3391
- status.dirty();
3392
- parsedSet.add(element.value);
3393
- }
3394
- return { status: status.value, value: parsedSet };
3395
- }
3396
- const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
3397
- if (ctx.common.async) {
3398
- return Promise.all(elements).then((elements) => finalizeSet(elements));
3399
- }
3400
- else {
3401
- return finalizeSet(elements);
3402
- }
3403
- }
3404
- min(minSize, message) {
3405
- return new ZodSet({
3406
- ...this._def,
3407
- minSize: { value: minSize, message: errorUtil.toString(message) },
3408
- });
3409
- }
3410
- max(maxSize, message) {
3411
- return new ZodSet({
3412
- ...this._def,
3413
- maxSize: { value: maxSize, message: errorUtil.toString(message) },
3414
- });
3415
- }
3416
- size(size, message) {
3417
- return this.min(size, message).max(size, message);
3418
- }
3419
- nonempty(message) {
3420
- return this.min(1, message);
3421
- }
3422
- }
3423
- ZodSet.create = (valueType, params) => {
3424
- return new ZodSet({
3425
- valueType,
3426
- minSize: null,
3427
- maxSize: null,
3428
- typeName: ZodFirstPartyTypeKind.ZodSet,
3429
- ...processCreateParams(params),
3430
- });
3431
- };
3432
- class ZodFunction extends ZodType {
3433
- constructor() {
3434
- super(...arguments);
3435
- this.validate = this.implement;
3436
- }
3437
- _parse(input) {
3438
- const { ctx } = this._processInputParams(input);
3439
- if (ctx.parsedType !== ZodParsedType.function) {
3440
- addIssueToContext(ctx, {
3441
- code: ZodIssueCode.invalid_type,
3442
- expected: ZodParsedType.function,
3443
- received: ctx.parsedType,
3444
- });
3445
- return INVALID;
3446
- }
3447
- function makeArgsIssue(args, error) {
3448
- return makeIssue({
3449
- data: args,
3450
- path: ctx.path,
3451
- errorMaps: [
3452
- ctx.common.contextualErrorMap,
3453
- ctx.schemaErrorMap,
3454
- getErrorMap(),
3455
- errorMap,
3456
- ].filter((x) => !!x),
3457
- issueData: {
3458
- code: ZodIssueCode.invalid_arguments,
3459
- argumentsError: error,
3460
- },
3461
- });
3462
- }
3463
- function makeReturnsIssue(returns, error) {
3464
- return makeIssue({
3465
- data: returns,
3466
- path: ctx.path,
3467
- errorMaps: [
3468
- ctx.common.contextualErrorMap,
3469
- ctx.schemaErrorMap,
3470
- getErrorMap(),
3471
- errorMap,
3472
- ].filter((x) => !!x),
3473
- issueData: {
3474
- code: ZodIssueCode.invalid_return_type,
3475
- returnTypeError: error,
3476
- },
3477
- });
3478
- }
3479
- const params = { errorMap: ctx.common.contextualErrorMap };
3480
- const fn = ctx.data;
3481
- if (this._def.returns instanceof ZodPromise) {
3482
- // Would love a way to avoid disabling this rule, but we need
3483
- // an alias (using an arrow function was what caused 2651).
3484
- // eslint-disable-next-line @typescript-eslint/no-this-alias
3485
- const me = this;
3486
- return OK(async function (...args) {
3487
- const error = new ZodError([]);
3488
- const parsedArgs = await me._def.args
3489
- .parseAsync(args, params)
3490
- .catch((e) => {
3491
- error.addIssue(makeArgsIssue(args, e));
3492
- throw error;
3493
- });
3494
- const result = await Reflect.apply(fn, this, parsedArgs);
3495
- const parsedReturns = await me._def.returns._def.type
3496
- .parseAsync(result, params)
3497
- .catch((e) => {
3498
- error.addIssue(makeReturnsIssue(result, e));
3499
- throw error;
3500
- });
3501
- return parsedReturns;
3502
- });
3503
- }
3504
- else {
3505
- // Would love a way to avoid disabling this rule, but we need
3506
- // an alias (using an arrow function was what caused 2651).
3507
- // eslint-disable-next-line @typescript-eslint/no-this-alias
3508
- const me = this;
3509
- return OK(function (...args) {
3510
- const parsedArgs = me._def.args.safeParse(args, params);
3511
- if (!parsedArgs.success) {
3512
- throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3513
- }
3514
- const result = Reflect.apply(fn, this, parsedArgs.data);
3515
- const parsedReturns = me._def.returns.safeParse(result, params);
3516
- if (!parsedReturns.success) {
3517
- throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3518
- }
3519
- return parsedReturns.data;
3520
- });
3521
- }
3522
- }
3523
- parameters() {
3524
- return this._def.args;
3525
- }
3526
- returnType() {
3527
- return this._def.returns;
3528
- }
3529
- args(...items) {
3530
- return new ZodFunction({
3531
- ...this._def,
3532
- args: ZodTuple.create(items).rest(ZodUnknown.create()),
3533
- });
3534
- }
3535
- returns(returnType) {
3536
- return new ZodFunction({
3537
- ...this._def,
3538
- returns: returnType,
3539
- });
3540
- }
3541
- implement(func) {
3542
- const validatedFunc = this.parse(func);
3543
- return validatedFunc;
3544
- }
3545
- strictImplement(func) {
3546
- const validatedFunc = this.parse(func);
3547
- return validatedFunc;
3548
- }
3549
- static create(args, returns, params) {
3550
- return new ZodFunction({
3551
- args: (args
3552
- ? args
3553
- : ZodTuple.create([]).rest(ZodUnknown.create())),
3554
- returns: returns || ZodUnknown.create(),
3555
- typeName: ZodFirstPartyTypeKind.ZodFunction,
3556
- ...processCreateParams(params),
3557
- });
3558
- }
3559
- }
3560
- class ZodLazy extends ZodType {
3561
- get schema() {
3562
- return this._def.getter();
3563
- }
3564
- _parse(input) {
3565
- const { ctx } = this._processInputParams(input);
3566
- const lazySchema = this._def.getter();
3567
- return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
3568
- }
3569
- }
3570
- ZodLazy.create = (getter, params) => {
3571
- return new ZodLazy({
3572
- getter: getter,
3573
- typeName: ZodFirstPartyTypeKind.ZodLazy,
3574
- ...processCreateParams(params),
3575
- });
3576
- };
3577
- class ZodLiteral extends ZodType {
3578
- _parse(input) {
3579
- if (input.data !== this._def.value) {
3580
- const ctx = this._getOrReturnCtx(input);
3581
- addIssueToContext(ctx, {
3582
- received: ctx.data,
3583
- code: ZodIssueCode.invalid_literal,
3584
- expected: this._def.value,
3585
- });
3586
- return INVALID;
3587
- }
3588
- return { status: "valid", value: input.data };
3589
- }
3590
- get value() {
3591
- return this._def.value;
3592
- }
3593
- }
3594
- ZodLiteral.create = (value, params) => {
3595
- return new ZodLiteral({
3596
- value: value,
3597
- typeName: ZodFirstPartyTypeKind.ZodLiteral,
3598
- ...processCreateParams(params),
3599
- });
3600
- };
3601
- function createZodEnum(values, params) {
3602
- return new ZodEnum({
3603
- values,
3604
- typeName: ZodFirstPartyTypeKind.ZodEnum,
3605
- ...processCreateParams(params),
3606
- });
3607
- }
3608
- class ZodEnum extends ZodType {
3609
- constructor() {
3610
- super(...arguments);
3611
- _ZodEnum_cache.set(this, void 0);
3612
- }
3613
- _parse(input) {
3614
- if (typeof input.data !== "string") {
3615
- const ctx = this._getOrReturnCtx(input);
3616
- const expectedValues = this._def.values;
3617
- addIssueToContext(ctx, {
3618
- expected: util.joinValues(expectedValues),
3619
- received: ctx.parsedType,
3620
- code: ZodIssueCode.invalid_type,
3621
- });
3622
- return INVALID;
3623
- }
3624
- if (!__classPrivateFieldGet(this, _ZodEnum_cache)) {
3625
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values));
3626
- }
3627
- if (!__classPrivateFieldGet(this, _ZodEnum_cache).has(input.data)) {
3628
- const ctx = this._getOrReturnCtx(input);
3629
- const expectedValues = this._def.values;
3630
- addIssueToContext(ctx, {
3631
- received: ctx.data,
3632
- code: ZodIssueCode.invalid_enum_value,
3633
- options: expectedValues,
3634
- });
3635
- return INVALID;
3636
- }
3637
- return OK(input.data);
3638
- }
3639
- get options() {
3640
- return this._def.values;
3641
- }
3642
- get enum() {
3643
- const enumValues = {};
3644
- for (const val of this._def.values) {
3645
- enumValues[val] = val;
3646
- }
3647
- return enumValues;
3648
- }
3649
- get Values() {
3650
- const enumValues = {};
3651
- for (const val of this._def.values) {
3652
- enumValues[val] = val;
3653
- }
3654
- return enumValues;
3655
- }
3656
- get Enum() {
3657
- const enumValues = {};
3658
- for (const val of this._def.values) {
3659
- enumValues[val] = val;
3660
- }
3661
- return enumValues;
3662
- }
3663
- extract(values, newDef = this._def) {
3664
- return ZodEnum.create(values, {
3665
- ...this._def,
3666
- ...newDef,
3667
- });
3668
- }
3669
- exclude(values, newDef = this._def) {
3670
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
3671
- ...this._def,
3672
- ...newDef,
3673
- });
3674
- }
3675
- }
3676
- _ZodEnum_cache = new WeakMap();
3677
- ZodEnum.create = createZodEnum;
3678
- class ZodNativeEnum extends ZodType {
3679
- constructor() {
3680
- super(...arguments);
3681
- _ZodNativeEnum_cache.set(this, void 0);
3682
- }
3683
- _parse(input) {
3684
- const nativeEnumValues = util.getValidEnumValues(this._def.values);
3685
- const ctx = this._getOrReturnCtx(input);
3686
- if (ctx.parsedType !== ZodParsedType.string &&
3687
- ctx.parsedType !== ZodParsedType.number) {
3688
- const expectedValues = util.objectValues(nativeEnumValues);
3689
- addIssueToContext(ctx, {
3690
- expected: util.joinValues(expectedValues),
3691
- received: ctx.parsedType,
3692
- code: ZodIssueCode.invalid_type,
3693
- });
3694
- return INVALID;
3695
- }
3696
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache)) {
3697
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)));
3698
- }
3699
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache).has(input.data)) {
3700
- const expectedValues = util.objectValues(nativeEnumValues);
3701
- addIssueToContext(ctx, {
3702
- received: ctx.data,
3703
- code: ZodIssueCode.invalid_enum_value,
3704
- options: expectedValues,
3705
- });
3706
- return INVALID;
3707
- }
3708
- return OK(input.data);
3709
- }
3710
- get enum() {
3711
- return this._def.values;
3712
- }
3713
- }
3714
- _ZodNativeEnum_cache = new WeakMap();
3715
- ZodNativeEnum.create = (values, params) => {
3716
- return new ZodNativeEnum({
3717
- values: values,
3718
- typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
3719
- ...processCreateParams(params),
3720
- });
3721
- };
3722
- class ZodPromise extends ZodType {
3723
- unwrap() {
3724
- return this._def.type;
3725
- }
3726
- _parse(input) {
3727
- const { ctx } = this._processInputParams(input);
3728
- if (ctx.parsedType !== ZodParsedType.promise &&
3729
- ctx.common.async === false) {
3730
- addIssueToContext(ctx, {
3731
- code: ZodIssueCode.invalid_type,
3732
- expected: ZodParsedType.promise,
3733
- received: ctx.parsedType,
3734
- });
3735
- return INVALID;
3736
- }
3737
- const promisified = ctx.parsedType === ZodParsedType.promise
3738
- ? ctx.data
3739
- : Promise.resolve(ctx.data);
3740
- return OK(promisified.then((data) => {
3741
- return this._def.type.parseAsync(data, {
3742
- path: ctx.path,
3743
- errorMap: ctx.common.contextualErrorMap,
3744
- });
3745
- }));
3746
- }
3747
- }
3748
- ZodPromise.create = (schema, params) => {
3749
- return new ZodPromise({
3750
- type: schema,
3751
- typeName: ZodFirstPartyTypeKind.ZodPromise,
3752
- ...processCreateParams(params),
3753
- });
3754
- };
3755
- class ZodEffects extends ZodType {
3756
- innerType() {
3757
- return this._def.schema;
3758
- }
3759
- sourceType() {
3760
- return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
3761
- ? this._def.schema.sourceType()
3762
- : this._def.schema;
3763
- }
3764
- _parse(input) {
3765
- const { status, ctx } = this._processInputParams(input);
3766
- const effect = this._def.effect || null;
3767
- const checkCtx = {
3768
- addIssue: (arg) => {
3769
- addIssueToContext(ctx, arg);
3770
- if (arg.fatal) {
3771
- status.abort();
3772
- }
3773
- else {
3774
- status.dirty();
3775
- }
3776
- },
3777
- get path() {
3778
- return ctx.path;
3779
- },
3780
- };
3781
- checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3782
- if (effect.type === "preprocess") {
3783
- const processed = effect.transform(ctx.data, checkCtx);
3784
- if (ctx.common.async) {
3785
- return Promise.resolve(processed).then(async (processed) => {
3786
- if (status.value === "aborted")
3787
- return INVALID;
3788
- const result = await this._def.schema._parseAsync({
3789
- data: processed,
3790
- path: ctx.path,
3791
- parent: ctx,
3792
- });
3793
- if (result.status === "aborted")
3794
- return INVALID;
3795
- if (result.status === "dirty")
3796
- return DIRTY(result.value);
3797
- if (status.value === "dirty")
3798
- return DIRTY(result.value);
3799
- return result;
3800
- });
3801
- }
3802
- else {
3803
- if (status.value === "aborted")
3804
- return INVALID;
3805
- const result = this._def.schema._parseSync({
3806
- data: processed,
3807
- path: ctx.path,
3808
- parent: ctx,
3809
- });
3810
- if (result.status === "aborted")
3811
- return INVALID;
3812
- if (result.status === "dirty")
3813
- return DIRTY(result.value);
3814
- if (status.value === "dirty")
3815
- return DIRTY(result.value);
3816
- return result;
3817
- }
3818
- }
3819
- if (effect.type === "refinement") {
3820
- const executeRefinement = (acc) => {
3821
- const result = effect.refinement(acc, checkCtx);
3822
- if (ctx.common.async) {
3823
- return Promise.resolve(result);
3824
- }
3825
- if (result instanceof Promise) {
3826
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3827
- }
3828
- return acc;
3829
- };
3830
- if (ctx.common.async === false) {
3831
- const inner = this._def.schema._parseSync({
3832
- data: ctx.data,
3833
- path: ctx.path,
3834
- parent: ctx,
3835
- });
3836
- if (inner.status === "aborted")
3837
- return INVALID;
3838
- if (inner.status === "dirty")
3839
- status.dirty();
3840
- // return value is ignored
3841
- executeRefinement(inner.value);
3842
- return { status: status.value, value: inner.value };
3843
- }
3844
- else {
3845
- return this._def.schema
3846
- ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3847
- .then((inner) => {
3848
- if (inner.status === "aborted")
3849
- return INVALID;
3850
- if (inner.status === "dirty")
3851
- status.dirty();
3852
- return executeRefinement(inner.value).then(() => {
3853
- return { status: status.value, value: inner.value };
3854
- });
3855
- });
3856
- }
3857
- }
3858
- if (effect.type === "transform") {
3859
- if (ctx.common.async === false) {
3860
- const base = this._def.schema._parseSync({
3861
- data: ctx.data,
3862
- path: ctx.path,
3863
- parent: ctx,
3864
- });
3865
- if (!isValid(base))
3866
- return base;
3867
- const result = effect.transform(base.value, checkCtx);
3868
- if (result instanceof Promise) {
3869
- throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3870
- }
3871
- return { status: status.value, value: result };
3872
- }
3873
- else {
3874
- return this._def.schema
3875
- ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3876
- .then((base) => {
3877
- if (!isValid(base))
3878
- return base;
3879
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3880
- });
3881
- }
3882
- }
3883
- util.assertNever(effect);
3884
- }
3885
- }
3886
- ZodEffects.create = (schema, effect, params) => {
3887
- return new ZodEffects({
3888
- schema,
3889
- typeName: ZodFirstPartyTypeKind.ZodEffects,
3890
- effect,
3891
- ...processCreateParams(params),
3892
- });
3893
- };
3894
- ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3895
- return new ZodEffects({
3896
- schema,
3897
- effect: { type: "preprocess", transform: preprocess },
3898
- typeName: ZodFirstPartyTypeKind.ZodEffects,
3899
- ...processCreateParams(params),
3900
- });
3901
- };
3902
- class ZodOptional extends ZodType {
3903
- _parse(input) {
3904
- const parsedType = this._getType(input);
3905
- if (parsedType === ZodParsedType.undefined) {
3906
- return OK(undefined);
3907
- }
3908
- return this._def.innerType._parse(input);
3909
- }
3910
- unwrap() {
3911
- return this._def.innerType;
3912
- }
3913
- }
3914
- ZodOptional.create = (type, params) => {
3915
- return new ZodOptional({
3916
- innerType: type,
3917
- typeName: ZodFirstPartyTypeKind.ZodOptional,
3918
- ...processCreateParams(params),
3919
- });
3920
- };
3921
- class ZodNullable extends ZodType {
3922
- _parse(input) {
3923
- const parsedType = this._getType(input);
3924
- if (parsedType === ZodParsedType.null) {
3925
- return OK(null);
3926
- }
3927
- return this._def.innerType._parse(input);
3928
- }
3929
- unwrap() {
3930
- return this._def.innerType;
3931
- }
3932
- }
3933
- ZodNullable.create = (type, params) => {
3934
- return new ZodNullable({
3935
- innerType: type,
3936
- typeName: ZodFirstPartyTypeKind.ZodNullable,
3937
- ...processCreateParams(params),
3938
- });
3939
- };
3940
- class ZodDefault extends ZodType {
3941
- _parse(input) {
3942
- const { ctx } = this._processInputParams(input);
3943
- let data = ctx.data;
3944
- if (ctx.parsedType === ZodParsedType.undefined) {
3945
- data = this._def.defaultValue();
3946
- }
3947
- return this._def.innerType._parse({
3948
- data,
3949
- path: ctx.path,
3950
- parent: ctx,
3951
- });
3952
- }
3953
- removeDefault() {
3954
- return this._def.innerType;
3955
- }
3956
- }
3957
- ZodDefault.create = (type, params) => {
3958
- return new ZodDefault({
3959
- innerType: type,
3960
- typeName: ZodFirstPartyTypeKind.ZodDefault,
3961
- defaultValue: typeof params.default === "function"
3962
- ? params.default
3963
- : () => params.default,
3964
- ...processCreateParams(params),
3965
- });
3966
- };
3967
- class ZodCatch extends ZodType {
3968
- _parse(input) {
3969
- const { ctx } = this._processInputParams(input);
3970
- // newCtx is used to not collect issues from inner types in ctx
3971
- const newCtx = {
3972
- ...ctx,
3973
- common: {
3974
- ...ctx.common,
3975
- issues: [],
3976
- },
3977
- };
3978
- const result = this._def.innerType._parse({
3979
- data: newCtx.data,
3980
- path: newCtx.path,
3981
- parent: {
3982
- ...newCtx,
3983
- },
3984
- });
3985
- if (isAsync(result)) {
3986
- return result.then((result) => {
3987
- return {
3988
- status: "valid",
3989
- value: result.status === "valid"
3990
- ? result.value
3991
- : this._def.catchValue({
3992
- get error() {
3993
- return new ZodError(newCtx.common.issues);
3994
- },
3995
- input: newCtx.data,
3996
- }),
3997
- };
3998
- });
3999
- }
4000
- else {
4001
- return {
4002
- status: "valid",
4003
- value: result.status === "valid"
4004
- ? result.value
4005
- : this._def.catchValue({
4006
- get error() {
4007
- return new ZodError(newCtx.common.issues);
4008
- },
4009
- input: newCtx.data,
4010
- }),
4011
- };
4012
- }
4013
- }
4014
- removeCatch() {
4015
- return this._def.innerType;
4016
- }
4017
- }
4018
- ZodCatch.create = (type, params) => {
4019
- return new ZodCatch({
4020
- innerType: type,
4021
- typeName: ZodFirstPartyTypeKind.ZodCatch,
4022
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
4023
- ...processCreateParams(params),
4024
- });
4025
- };
4026
- class ZodNaN extends ZodType {
4027
- _parse(input) {
4028
- const parsedType = this._getType(input);
4029
- if (parsedType !== ZodParsedType.nan) {
4030
- const ctx = this._getOrReturnCtx(input);
4031
- addIssueToContext(ctx, {
4032
- code: ZodIssueCode.invalid_type,
4033
- expected: ZodParsedType.nan,
4034
- received: ctx.parsedType,
4035
- });
4036
- return INVALID;
4037
- }
4038
- return { status: "valid", value: input.data };
4039
- }
4040
- }
4041
- ZodNaN.create = (params) => {
4042
- return new ZodNaN({
4043
- typeName: ZodFirstPartyTypeKind.ZodNaN,
4044
- ...processCreateParams(params),
4045
- });
4046
- };
4047
- const BRAND = Symbol("zod_brand");
4048
- class ZodBranded extends ZodType {
4049
- _parse(input) {
4050
- const { ctx } = this._processInputParams(input);
4051
- const data = ctx.data;
4052
- return this._def.type._parse({
4053
- data,
4054
- path: ctx.path,
4055
- parent: ctx,
4056
- });
4057
- }
4058
- unwrap() {
4059
- return this._def.type;
4060
- }
4061
- }
4062
- class ZodPipeline extends ZodType {
4063
- _parse(input) {
4064
- const { status, ctx } = this._processInputParams(input);
4065
- if (ctx.common.async) {
4066
- const handleAsync = async () => {
4067
- const inResult = await this._def.in._parseAsync({
4068
- data: ctx.data,
4069
- path: ctx.path,
4070
- parent: ctx,
4071
- });
4072
- if (inResult.status === "aborted")
4073
- return INVALID;
4074
- if (inResult.status === "dirty") {
4075
- status.dirty();
4076
- return DIRTY(inResult.value);
4077
- }
4078
- else {
4079
- return this._def.out._parseAsync({
4080
- data: inResult.value,
4081
- path: ctx.path,
4082
- parent: ctx,
4083
- });
4084
- }
4085
- };
4086
- return handleAsync();
4087
- }
4088
- else {
4089
- const inResult = this._def.in._parseSync({
4090
- data: ctx.data,
4091
- path: ctx.path,
4092
- parent: ctx,
4093
- });
4094
- if (inResult.status === "aborted")
4095
- return INVALID;
4096
- if (inResult.status === "dirty") {
4097
- status.dirty();
4098
- return {
4099
- status: "dirty",
4100
- value: inResult.value,
4101
- };
4102
- }
4103
- else {
4104
- return this._def.out._parseSync({
4105
- data: inResult.value,
4106
- path: ctx.path,
4107
- parent: ctx,
4108
- });
4109
- }
4110
- }
4111
- }
4112
- static create(a, b) {
4113
- return new ZodPipeline({
4114
- in: a,
4115
- out: b,
4116
- typeName: ZodFirstPartyTypeKind.ZodPipeline,
4117
- });
4118
- }
4119
- }
4120
- class ZodReadonly extends ZodType {
4121
- _parse(input) {
4122
- const result = this._def.innerType._parse(input);
4123
- const freeze = (data) => {
4124
- if (isValid(data)) {
4125
- data.value = Object.freeze(data.value);
4126
- }
4127
- return data;
4128
- };
4129
- return isAsync(result)
4130
- ? result.then((data) => freeze(data))
4131
- : freeze(result);
4132
- }
4133
- unwrap() {
4134
- return this._def.innerType;
4135
- }
4136
- }
4137
- ZodReadonly.create = (type, params) => {
4138
- return new ZodReadonly({
4139
- innerType: type,
4140
- typeName: ZodFirstPartyTypeKind.ZodReadonly,
4141
- ...processCreateParams(params),
4142
- });
4143
- };
4144
- function custom(check, params = {},
4145
- /**
4146
- * @deprecated
4147
- *
4148
- * Pass `fatal` into the params object instead:
4149
- *
4150
- * ```ts
4151
- * z.string().custom((val) => val.length > 5, { fatal: false })
4152
- * ```
4153
- *
4154
- */
4155
- fatal) {
4156
- if (check)
4157
- return ZodAny.create().superRefine((data, ctx) => {
4158
- var _a, _b;
4159
- if (!check(data)) {
4160
- const p = typeof params === "function"
4161
- ? params(data)
4162
- : typeof params === "string"
4163
- ? { message: params }
4164
- : params;
4165
- const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
4166
- const p2 = typeof p === "string" ? { message: p } : p;
4167
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
4168
- }
4169
- });
4170
- return ZodAny.create();
4171
- }
4172
- const late = {
4173
- object: ZodObject.lazycreate,
4174
- };
4175
- var ZodFirstPartyTypeKind;
4176
- (function (ZodFirstPartyTypeKind) {
4177
- ZodFirstPartyTypeKind["ZodString"] = "ZodString";
4178
- ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
4179
- ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
4180
- ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
4181
- ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
4182
- ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
4183
- ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
4184
- ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
4185
- ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
4186
- ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
4187
- ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
4188
- ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
4189
- ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
4190
- ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
4191
- ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
4192
- ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
4193
- ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
4194
- ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
4195
- ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
4196
- ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
4197
- ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
4198
- ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
4199
- ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
4200
- ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
4201
- ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
4202
- ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
4203
- ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
4204
- ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
4205
- ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
4206
- ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
4207
- ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
4208
- ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
4209
- ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
4210
- ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
4211
- ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
4212
- ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
4213
- })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
4214
- const instanceOfType = (
4215
- // const instanceOfType = <T extends new (...args: any[]) => any>(
4216
- cls, params = {
4217
- message: `Input not instance of ${cls.name}`,
4218
- }) => custom((data) => data instanceof cls, params);
4219
- const stringType = ZodString.create;
4220
- const numberType = ZodNumber.create;
4221
- const nanType = ZodNaN.create;
4222
- const bigIntType = ZodBigInt.create;
4223
- const booleanType = ZodBoolean.create;
4224
- const dateType = ZodDate.create;
4225
- const symbolType = ZodSymbol.create;
4226
- const undefinedType = ZodUndefined.create;
4227
- const nullType = ZodNull.create;
4228
- const anyType = ZodAny.create;
4229
- const unknownType = ZodUnknown.create;
4230
- const neverType = ZodNever.create;
4231
- const voidType = ZodVoid.create;
4232
- const arrayType = ZodArray.create;
4233
- const objectType = ZodObject.create;
4234
- const strictObjectType = ZodObject.strictCreate;
4235
- const unionType = ZodUnion.create;
4236
- const discriminatedUnionType = ZodDiscriminatedUnion.create;
4237
- const intersectionType = ZodIntersection.create;
4238
- const tupleType = ZodTuple.create;
4239
- const recordType = ZodRecord.create;
4240
- const mapType = ZodMap.create;
4241
- const setType = ZodSet.create;
4242
- const functionType = ZodFunction.create;
4243
- const lazyType = ZodLazy.create;
4244
- const literalType = ZodLiteral.create;
4245
- const enumType = ZodEnum.create;
4246
- const nativeEnumType = ZodNativeEnum.create;
4247
- const promiseType = ZodPromise.create;
4248
- const effectsType = ZodEffects.create;
4249
- const optionalType = ZodOptional.create;
4250
- const nullableType = ZodNullable.create;
4251
- const preprocessType = ZodEffects.createWithPreprocess;
4252
- const pipelineType = ZodPipeline.create;
4253
- const ostring = () => stringType().optional();
4254
- const onumber = () => numberType().optional();
4255
- const oboolean = () => booleanType().optional();
4256
- const coerce = {
4257
- string: ((arg) => ZodString.create({ ...arg, coerce: true })),
4258
- number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
4259
- boolean: ((arg) => ZodBoolean.create({
4260
- ...arg,
4261
- coerce: true,
4262
- })),
4263
- bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
4264
- date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
4265
- };
4266
- const NEVER = INVALID;
4267
-
4268
- var z = /*#__PURE__*/Object.freeze({
4269
- __proto__: null,
4270
- defaultErrorMap: errorMap,
4271
- setErrorMap: setErrorMap,
4272
- getErrorMap: getErrorMap,
4273
- makeIssue: makeIssue,
4274
- EMPTY_PATH: EMPTY_PATH,
4275
- addIssueToContext: addIssueToContext,
4276
- ParseStatus: ParseStatus,
4277
- INVALID: INVALID,
4278
- DIRTY: DIRTY,
4279
- OK: OK,
4280
- isAborted: isAborted,
4281
- isDirty: isDirty,
4282
- isValid: isValid,
4283
- isAsync: isAsync,
4284
- get util () { return util; },
4285
- get objectUtil () { return objectUtil; },
4286
- ZodParsedType: ZodParsedType,
4287
- getParsedType: getParsedType,
4288
- ZodType: ZodType,
4289
- datetimeRegex: datetimeRegex,
4290
- ZodString: ZodString,
4291
- ZodNumber: ZodNumber,
4292
- ZodBigInt: ZodBigInt,
4293
- ZodBoolean: ZodBoolean,
4294
- ZodDate: ZodDate,
4295
- ZodSymbol: ZodSymbol,
4296
- ZodUndefined: ZodUndefined,
4297
- ZodNull: ZodNull,
4298
- ZodAny: ZodAny,
4299
- ZodUnknown: ZodUnknown,
4300
- ZodNever: ZodNever,
4301
- ZodVoid: ZodVoid,
4302
- ZodArray: ZodArray,
4303
- ZodObject: ZodObject,
4304
- ZodUnion: ZodUnion,
4305
- ZodDiscriminatedUnion: ZodDiscriminatedUnion,
4306
- ZodIntersection: ZodIntersection,
4307
- ZodTuple: ZodTuple,
4308
- ZodRecord: ZodRecord,
4309
- ZodMap: ZodMap,
4310
- ZodSet: ZodSet,
4311
- ZodFunction: ZodFunction,
4312
- ZodLazy: ZodLazy,
4313
- ZodLiteral: ZodLiteral,
4314
- ZodEnum: ZodEnum,
4315
- ZodNativeEnum: ZodNativeEnum,
4316
- ZodPromise: ZodPromise,
4317
- ZodEffects: ZodEffects,
4318
- ZodTransformer: ZodEffects,
4319
- ZodOptional: ZodOptional,
4320
- ZodNullable: ZodNullable,
4321
- ZodDefault: ZodDefault,
4322
- ZodCatch: ZodCatch,
4323
- ZodNaN: ZodNaN,
4324
- BRAND: BRAND,
4325
- ZodBranded: ZodBranded,
4326
- ZodPipeline: ZodPipeline,
4327
- ZodReadonly: ZodReadonly,
4328
- custom: custom,
4329
- Schema: ZodType,
4330
- ZodSchema: ZodType,
4331
- late: late,
4332
- get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },
4333
- coerce: coerce,
4334
- any: anyType,
4335
- array: arrayType,
4336
- bigint: bigIntType,
4337
- boolean: booleanType,
4338
- date: dateType,
4339
- discriminatedUnion: discriminatedUnionType,
4340
- effect: effectsType,
4341
- 'enum': enumType,
4342
- 'function': functionType,
4343
- 'instanceof': instanceOfType,
4344
- intersection: intersectionType,
4345
- lazy: lazyType,
4346
- literal: literalType,
4347
- map: mapType,
4348
- nan: nanType,
4349
- nativeEnum: nativeEnumType,
4350
- never: neverType,
4351
- 'null': nullType,
4352
- nullable: nullableType,
4353
- number: numberType,
4354
- object: objectType,
4355
- oboolean: oboolean,
4356
- onumber: onumber,
4357
- optional: optionalType,
4358
- ostring: ostring,
4359
- pipeline: pipelineType,
4360
- preprocess: preprocessType,
4361
- promise: promiseType,
4362
- record: recordType,
4363
- set: setType,
4364
- strictObject: strictObjectType,
4365
- string: stringType,
4366
- symbol: symbolType,
4367
- transformer: effectsType,
4368
- tuple: tupleType,
4369
- 'undefined': undefinedType,
4370
- union: unionType,
4371
- unknown: unknownType,
4372
- 'void': voidType,
4373
- NEVER: NEVER,
4374
- ZodIssueCode: ZodIssueCode,
4375
- quotelessJson: quotelessJson,
4376
- ZodError: ZodError
4377
- });
4378
-
4379
- export { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };
4380
- //# sourceMappingURL=__federation_shared_zod-BK7IELHt.js.map