@baseplate-dev/plugin-auth 2.0.3 → 2.0.5

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 (180) hide show
  1. package/dist/auth0/constants/model-names.d.ts +4 -0
  2. package/dist/auth0/constants/model-names.d.ts.map +1 -0
  3. package/dist/auth0/constants/model-names.js +4 -0
  4. package/dist/auth0/constants/model-names.js.map +1 -0
  5. package/dist/auth0/core/common.d.ts.map +1 -1
  6. package/dist/auth0/core/common.js +3 -5
  7. package/dist/auth0/core/common.js.map +1 -1
  8. package/dist/auth0/core/components/auth0-definition-editor.d.ts.map +1 -1
  9. package/dist/auth0/core/components/auth0-definition-editor.js +11 -15
  10. package/dist/auth0/core/components/auth0-definition-editor.js.map +1 -1
  11. package/dist/auth0/core/node.d.ts.map +1 -1
  12. package/dist/auth0/core/node.js +2 -4
  13. package/dist/auth0/core/node.js.map +1 -1
  14. package/dist/auth0/core/schema/models.d.ts +2 -4
  15. package/dist/auth0/core/schema/models.d.ts.map +1 -1
  16. package/dist/auth0/core/schema/models.js +3 -2
  17. package/dist/auth0/core/schema/models.js.map +1 -1
  18. package/dist/auth0/core/schema/plugin-definition.d.ts +1 -18
  19. package/dist/auth0/core/schema/plugin-definition.d.ts.map +1 -1
  20. package/dist/auth0/core/schema/plugin-definition.js +2 -9
  21. package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
  22. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +0 -1
  23. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +1 -1
  24. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +3 -3
  25. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +1 -1
  26. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts.map +1 -1
  27. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -1
  28. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +1 -1
  29. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +1 -1
  30. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +1 -0
  31. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +1 -1
  32. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +1 -1
  33. package/dist/local-auth/admin/schema/manage-role-action.d.ts +3 -4
  34. package/dist/local-auth/admin/schema/manage-role-action.d.ts.map +1 -1
  35. package/dist/local-auth/admin/schema/reset-password-action.d.ts +3 -4
  36. package/dist/local-auth/admin/schema/reset-password-action.d.ts.map +1 -1
  37. package/dist/local-auth/admin/schema/roles-column.d.ts +3 -4
  38. package/dist/local-auth/admin/schema/roles-column.d.ts.map +1 -1
  39. package/dist/local-auth/admin/web.d.ts.map +1 -1
  40. package/dist/local-auth/admin/web.js +8 -13
  41. package/dist/local-auth/admin/web.js.map +1 -1
  42. package/dist/local-auth/constants/model-names.d.ts +19 -0
  43. package/dist/local-auth/constants/model-names.d.ts.map +1 -0
  44. package/dist/local-auth/constants/model-names.js +19 -0
  45. package/dist/local-auth/constants/model-names.js.map +1 -0
  46. package/dist/local-auth/core/common.d.ts.map +1 -1
  47. package/dist/local-auth/core/common.js +3 -5
  48. package/dist/local-auth/core/common.js.map +1 -1
  49. package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +1 -1
  50. package/dist/local-auth/core/components/local-auth-definition-editor.js +10 -16
  51. package/dist/local-auth/core/components/local-auth-definition-editor.js.map +1 -1
  52. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +1 -1
  53. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +0 -1
  54. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -1
  55. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +3 -3
  56. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -1
  57. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +1 -0
  58. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -1
  59. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +0 -2
  60. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -1
  61. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +5 -6
  62. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -1
  63. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +5 -5
  64. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +1 -1
  65. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +6 -6
  66. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js +1 -1
  67. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +1 -1
  68. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -1
  69. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js +4 -24
  70. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js.map +1 -1
  71. package/dist/local-auth/core/node.d.ts.map +1 -1
  72. package/dist/local-auth/core/node.js +0 -3
  73. package/dist/local-auth/core/node.js.map +1 -1
  74. package/dist/local-auth/core/schema/models.d.ts +2 -7
  75. package/dist/local-auth/core/schema/models.d.ts.map +1 -1
  76. package/dist/local-auth/core/schema/models.js +9 -8
  77. package/dist/local-auth/core/schema/models.js.map +1 -1
  78. package/dist/local-auth/core/schema/plugin-definition.d.ts +0 -28
  79. package/dist/local-auth/core/schema/plugin-definition.d.ts.map +1 -1
  80. package/dist/local-auth/core/schema/plugin-definition.js +1 -19
  81. package/dist/local-auth/core/schema/plugin-definition.js.map +1 -1
  82. package/dist/placeholder-auth/constants/model-names.d.ts +4 -0
  83. package/dist/placeholder-auth/constants/model-names.d.ts.map +1 -0
  84. package/dist/placeholder-auth/constants/model-names.js +4 -0
  85. package/dist/placeholder-auth/constants/model-names.js.map +1 -0
  86. package/dist/placeholder-auth/core/common.d.ts.map +1 -1
  87. package/dist/placeholder-auth/core/common.js +3 -5
  88. package/dist/placeholder-auth/core/common.js.map +1 -1
  89. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +1 -1
  90. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +12 -16
  91. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +1 -1
  92. package/dist/placeholder-auth/core/schema/models.d.ts +2 -4
  93. package/dist/placeholder-auth/core/schema/models.d.ts.map +1 -1
  94. package/dist/placeholder-auth/core/schema/models.js +3 -2
  95. package/dist/placeholder-auth/core/schema/models.js.map +1 -1
  96. package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +2 -18
  97. package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +1 -1
  98. package/dist/placeholder-auth/core/schema/plugin-definition.js +2 -9
  99. package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -1
  100. package/dist/web/assets/{__federation_expose_auth0CoreCommon-Dd4OxG3J.js → __federation_expose_auth0CoreCommon-zQL4xAil.js} +5 -11
  101. package/dist/web/assets/__federation_expose_auth0CoreCommon-zQL4xAil.js.map +1 -0
  102. package/dist/web/assets/{__federation_expose_auth0CoreWeb-C_de43BE.js → __federation_expose_auth0CoreWeb-BQJHnPPM.js} +26 -41
  103. package/dist/web/assets/__federation_expose_auth0CoreWeb-BQJHnPPM.js.map +1 -0
  104. package/dist/web/assets/{__federation_expose_authCoreCommon-BAF30G9e.js → __federation_expose_authCoreCommon-hEy5zrff.js} +3 -3
  105. package/dist/web/assets/{__federation_expose_authCoreCommon-BAF30G9e.js.map → __federation_expose_authCoreCommon-hEy5zrff.js.map} +1 -1
  106. package/dist/web/assets/{__federation_expose_authCoreWeb-B26BFarY.js → __federation_expose_authCoreWeb-UlIYc0cq.js} +6 -6
  107. package/dist/web/assets/{__federation_expose_authCoreWeb-B26BFarY.js.map → __federation_expose_authCoreWeb-UlIYc0cq.js.map} +1 -1
  108. package/dist/web/assets/{__federation_expose_local-authAdminCommon-DLbuTALX.js → __federation_expose_local-authAdminCommon-DyMAwXJ7.js} +2 -2
  109. package/dist/web/assets/{__federation_expose_local-authAdminCommon-DLbuTALX.js.map → __federation_expose_local-authAdminCommon-DyMAwXJ7.js.map} +1 -1
  110. package/dist/web/assets/{__federation_expose_local-authAdminWeb-bT8Js4V6.js → __federation_expose_local-authAdminWeb-B6PdHqzu.js} +7 -25
  111. package/dist/web/assets/__federation_expose_local-authAdminWeb-B6PdHqzu.js.map +1 -0
  112. package/dist/web/assets/__federation_expose_local-authCoreCommon-BtQr1I4Q.js +27 -0
  113. package/dist/web/assets/__federation_expose_local-authCoreCommon-BtQr1I4Q.js.map +1 -0
  114. package/dist/web/assets/{__federation_expose_local-authCoreWeb-DKVkRzEo.js → __federation_expose_local-authCoreWeb-DsK2Dfpr.js} +33 -87
  115. package/dist/web/assets/__federation_expose_local-authCoreWeb-DsK2Dfpr.js.map +1 -0
  116. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-BZy2rgIt.js +26 -0
  117. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-BZy2rgIt.js.map +1 -0
  118. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-tw3UiMLM.js → __federation_expose_placeholder-authCoreWeb-OEDsMJ_b.js} +28 -43
  119. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-OEDsMJ_b.js.map +1 -0
  120. package/dist/web/assets/{__federation_fn_import-B_QMlAIe.js → __federation_fn_import-v1QB_w7U.js} +2 -2
  121. package/dist/web/assets/{__federation_fn_import-B_QMlAIe.js.map → __federation_fn_import-v1QB_w7U.js.map} +1 -1
  122. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-DdrB9jrq.js → web-Cb2knzA_.js} +6 -6
  123. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-Cb2knzA_.js.map +1 -0
  124. package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-BvG5Zcxb.js → project-builder-lib-CJdJXC1f.js} +25 -98
  125. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CJdJXC1f.js.map +1 -0
  126. package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-CjIA8Av2.js → ui-components-CrL3nReP.js} +6 -6
  127. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-CrL3nReP.js.map +1 -0
  128. package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-LpAGNm5N.js → utils-CJgKqZu4.js} +173 -4
  129. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-CJgKqZu4.js.map +1 -0
  130. package/dist/web/assets/__federation_shared_@tanstack/{react-router-CEcQRiV1.js → react-router-DdszvTPE.js} +2 -2
  131. package/dist/web/assets/__federation_shared_@tanstack/{react-router-CEcQRiV1.js.map → react-router-DdszvTPE.js.map} +1 -1
  132. package/dist/web/assets/{__federation_shared_zod-BK7IELHt.js → __federation_shared_zod-BGUJlEOa.js} +213 -302
  133. package/dist/web/assets/__federation_shared_zod-BGUJlEOa.js.map +1 -0
  134. package/dist/web/assets/{get-auth-plugin-definition-BrApugiB.js → get-auth-plugin-definition-Qo_0oJFS.js} +2 -2
  135. package/dist/web/assets/{get-auth-plugin-definition-BrApugiB.js.map → get-auth-plugin-definition-Qo_0oJFS.js.map} +1 -1
  136. package/dist/web/assets/{index-DAcyTb_o.js → index-KXYo3x9T.js} +2 -2
  137. package/dist/web/assets/{index-DAcyTb_o.js.map → index-KXYo3x9T.js.map} +1 -1
  138. package/dist/web/assets/{index.esm-BFQQfZNu.js → index.esm-BsVb2e-m.js} +2 -2
  139. package/dist/web/assets/{index.esm-BFQQfZNu.js.map → index.esm-BsVb2e-m.js.map} +1 -1
  140. package/dist/web/assets/{model-merger-boZDknXa.js → model-merger-BeuqGz00.js} +35 -59
  141. package/dist/web/assets/model-merger-BeuqGz00.js.map +1 -0
  142. package/dist/web/assets/model-names-CEoSIalq.js +21 -0
  143. package/dist/web/assets/model-names-CEoSIalq.js.map +1 -0
  144. package/dist/web/assets/plugin-definition-C1FCvorP.js +16 -0
  145. package/dist/web/assets/plugin-definition-C1FCvorP.js.map +1 -0
  146. package/dist/web/assets/plugin-definition-CeI3VlQi.js +31 -0
  147. package/dist/web/assets/plugin-definition-CeI3VlQi.js.map +1 -0
  148. package/dist/web/assets/plugin-definition-CpmhXG71.js +16 -0
  149. package/dist/web/assets/plugin-definition-CpmhXG71.js.map +1 -0
  150. package/dist/web/assets/{plugin-definition-CyqVivit.js → plugin-definition-p6J3lSNe.js} +2 -2
  151. package/dist/web/assets/{plugin-definition-CyqVivit.js.map → plugin-definition-p6J3lSNe.js.map} +1 -1
  152. package/dist/web/assets/{react-CKjL52W8.js → react-BUJ02Ozg.js} +2 -2
  153. package/dist/web/assets/{react-CKjL52W8.js.map → react-BUJ02Ozg.js.map} +1 -1
  154. package/dist/web/assets/remoteEntry.js +20 -20
  155. package/dist/web/assets/{style-BhUCMIWI.css → style-Cu4lNOci.css} +0 -18
  156. package/dist/web/assets/{styles-CyTaudys.js → styles-DMYfkBXJ.js} +3 -3
  157. package/dist/web/assets/{styles-CyTaudys.js.map → styles-DMYfkBXJ.js.map} +1 -1
  158. package/dist/web/index.html +1 -1
  159. package/package.json +14 -14
  160. package/dist/web/assets/__federation_expose_auth0CoreCommon-Dd4OxG3J.js.map +0 -1
  161. package/dist/web/assets/__federation_expose_auth0CoreWeb-C_de43BE.js.map +0 -1
  162. package/dist/web/assets/__federation_expose_local-authAdminWeb-bT8Js4V6.js.map +0 -1
  163. package/dist/web/assets/__federation_expose_local-authCoreCommon-D9tovFrj.js +0 -32
  164. package/dist/web/assets/__federation_expose_local-authCoreCommon-D9tovFrj.js.map +0 -1
  165. package/dist/web/assets/__federation_expose_local-authCoreWeb-DKVkRzEo.js.map +0 -1
  166. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-D1fszuKq.js +0 -32
  167. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-D1fszuKq.js.map +0 -1
  168. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-tw3UiMLM.js.map +0 -1
  169. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-DdrB9jrq.js.map +0 -1
  170. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BvG5Zcxb.js.map +0 -1
  171. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-CjIA8Av2.js.map +0 -1
  172. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-LpAGNm5N.js.map +0 -1
  173. package/dist/web/assets/__federation_shared_zod-BK7IELHt.js.map +0 -1
  174. package/dist/web/assets/model-merger-boZDknXa.js.map +0 -1
  175. package/dist/web/assets/plugin-definition-B7A-hS1o.js +0 -19
  176. package/dist/web/assets/plugin-definition-B7A-hS1o.js.map +0 -1
  177. package/dist/web/assets/plugin-definition-BeK0C-OP.js +0 -49
  178. package/dist/web/assets/plugin-definition-BeK0C-OP.js.map +0 -1
  179. package/dist/web/assets/plugin-definition-DfsGhMRb.js +0 -19
  180. package/dist/web/assets/plugin-definition-DfsGhMRb.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  var util;
2
2
  (function (util) {
3
- util.assertEqual = (val) => val;
3
+ util.assertEqual = (_) => { };
4
4
  function assertIs(_arg) { }
5
5
  util.assertIs = assertIs;
6
6
  function assertNever(_x) {
@@ -47,11 +47,9 @@ var util;
47
47
  };
48
48
  util.isInteger = typeof Number.isInteger === "function"
49
49
  ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
50
- : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
50
+ : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
51
51
  function joinValues(array, separator = " | ") {
52
- return array
53
- .map((val) => (typeof val === "string" ? `'${val}'` : val))
54
- .join(separator);
52
+ return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
55
53
  }
56
54
  util.joinValues = joinValues;
57
55
  util.jsonStringifyReplacer = (_, value) => {
@@ -100,7 +98,7 @@ const getParsedType = (data) => {
100
98
  case "string":
101
99
  return ZodParsedType.string;
102
100
  case "number":
103
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
101
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
104
102
  case "boolean":
105
103
  return ZodParsedType.boolean;
106
104
  case "function":
@@ -116,10 +114,7 @@ const getParsedType = (data) => {
116
114
  if (data === null) {
117
115
  return ZodParsedType.null;
118
116
  }
119
- if (data.then &&
120
- typeof data.then === "function" &&
121
- data.catch &&
122
- typeof data.catch === "function") {
117
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
123
118
  return ZodParsedType.promise;
124
119
  }
125
120
  if (typeof Map !== "undefined" && data instanceof Map) {
@@ -251,8 +246,9 @@ class ZodError extends Error {
251
246
  const formErrors = [];
252
247
  for (const sub of this.issues) {
253
248
  if (sub.path.length > 0) {
254
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
255
- fieldErrors[sub.path[0]].push(mapper(sub));
249
+ const firstEl = sub.path[0];
250
+ fieldErrors[firstEl] = fieldErrors[firstEl] || [];
251
+ fieldErrors[firstEl].push(mapper(sub));
256
252
  }
257
253
  else {
258
254
  formErrors.push(mapper(sub));
@@ -335,17 +331,11 @@ const errorMap = (issue, _ctx) => {
335
331
  else if (issue.type === "string")
336
332
  message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
337
333
  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}`;
334
+ message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
335
+ else if (issue.type === "bigint")
336
+ message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
343
337
  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))}`;
338
+ message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
349
339
  else
350
340
  message = "Invalid input";
351
341
  break;
@@ -355,23 +345,11 @@ const errorMap = (issue, _ctx) => {
355
345
  else if (issue.type === "string")
356
346
  message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
357
347
  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}`;
348
+ message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
363
349
  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}`;
350
+ message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
369
351
  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))}`;
352
+ message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
375
353
  else
376
354
  message = "Invalid input";
377
355
  break;
@@ -493,8 +471,7 @@ class ParseStatus {
493
471
  status.dirty();
494
472
  if (value.status === "dirty")
495
473
  status.dirty();
496
- if (key.value !== "__proto__" &&
497
- (typeof value.value !== "undefined" || pair.alwaysSet)) {
474
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
498
475
  finalObject[key.value] = value.value;
499
476
  }
500
477
  }
@@ -511,43 +488,13 @@ const isDirty = (x) => x.status === "dirty";
511
488
  const isValid = (x) => x.status === "valid";
512
489
  const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
513
490
 
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
491
  var errorUtil;
545
492
  (function (errorUtil) {
546
493
  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;
494
+ // biome-ignore lint:
495
+ errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
548
496
  })(errorUtil || (errorUtil = {}));
549
497
 
550
- var _ZodEnum_cache, _ZodNativeEnum_cache;
551
498
  class ParseInputLazyPath {
552
499
  constructor(parent, value, path, key) {
553
500
  this._cachedPath = [];
@@ -558,7 +505,7 @@ class ParseInputLazyPath {
558
505
  }
559
506
  get path() {
560
507
  if (!this._cachedPath.length) {
561
- if (this._key instanceof Array) {
508
+ if (Array.isArray(this._key)) {
562
509
  this._cachedPath.push(...this._path, ...this._key);
563
510
  }
564
511
  else {
@@ -598,17 +545,16 @@ function processCreateParams(params) {
598
545
  if (errorMap)
599
546
  return { errorMap: errorMap, description };
600
547
  const customMap = (iss, ctx) => {
601
- var _a, _b;
602
548
  const { message } = params;
603
549
  if (iss.code === "invalid_enum_value") {
604
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
550
+ return { message: message ?? ctx.defaultError };
605
551
  }
606
552
  if (typeof ctx.data === "undefined") {
607
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
553
+ return { message: message ?? required_error ?? ctx.defaultError };
608
554
  }
609
555
  if (iss.code !== "invalid_type")
610
556
  return { message: ctx.defaultError };
611
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
557
+ return { message: message ?? invalid_type_error ?? ctx.defaultError };
612
558
  };
613
559
  return { errorMap: customMap, description };
614
560
  }
@@ -660,14 +606,13 @@ class ZodType {
660
606
  throw result.error;
661
607
  }
662
608
  safeParse(data, params) {
663
- var _a;
664
609
  const ctx = {
665
610
  common: {
666
611
  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,
612
+ async: params?.async ?? false,
613
+ contextualErrorMap: params?.errorMap,
669
614
  },
670
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
615
+ path: params?.path || [],
671
616
  schemaErrorMap: this._def.errorMap,
672
617
  parent: null,
673
618
  data,
@@ -677,7 +622,6 @@ class ZodType {
677
622
  return handleResult(ctx, result);
678
623
  }
679
624
  "~validate"(data) {
680
- var _a, _b;
681
625
  const ctx = {
682
626
  common: {
683
627
  issues: [],
@@ -701,7 +645,7 @@ class ZodType {
701
645
  };
702
646
  }
703
647
  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")) {
648
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
705
649
  this["~standard"].async = true;
706
650
  }
707
651
  ctx.common = {
@@ -728,19 +672,17 @@ class ZodType {
728
672
  const ctx = {
729
673
  common: {
730
674
  issues: [],
731
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
675
+ contextualErrorMap: params?.errorMap,
732
676
  async: true,
733
677
  },
734
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
678
+ path: params?.path || [],
735
679
  schemaErrorMap: this._def.errorMap,
736
680
  parent: null,
737
681
  data,
738
682
  parsedType: getParsedType(data),
739
683
  };
740
684
  const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
741
- const result = await (isAsync(maybeAsyncResult)
742
- ? maybeAsyncResult
743
- : Promise.resolve(maybeAsyncResult));
685
+ const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
744
686
  return handleResult(ctx, result);
745
687
  }
746
688
  refine(check, message) {
@@ -784,9 +726,7 @@ class ZodType {
784
726
  refinement(check, refinementData) {
785
727
  return this._refinement((val, ctx) => {
786
728
  if (!check(val)) {
787
- ctx.addIssue(typeof refinementData === "function"
788
- ? refinementData(val, ctx)
789
- : refinementData);
729
+ ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
790
730
  return false;
791
731
  }
792
732
  else {
@@ -958,15 +898,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
958
898
  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
899
  const dateRegex = new RegExp(`^${dateRegexSource}$`);
960
900
  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`;
901
+ let secondsRegexSource = `[0-5]\\d`;
963
902
  if (args.precision) {
964
- regex = `${regex}\\.\\d{${args.precision}}`;
903
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
965
904
  }
966
905
  else if (args.precision == null) {
967
- regex = `${regex}(\\.\\d+)?`;
906
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
968
907
  }
969
- return regex;
908
+ const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
909
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
970
910
  }
971
911
  function timeRegex(args) {
972
912
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -995,6 +935,8 @@ function isValidJWT(jwt, alg) {
995
935
  return false;
996
936
  try {
997
937
  const [header] = jwt.split(".");
938
+ if (!header)
939
+ return false;
998
940
  // Convert base64url to base64
999
941
  const base64 = header
1000
942
  .replace(/-/g, "+")
@@ -1003,13 +945,15 @@ function isValidJWT(jwt, alg) {
1003
945
  const decoded = JSON.parse(atob(base64));
1004
946
  if (typeof decoded !== "object" || decoded === null)
1005
947
  return false;
1006
- if (!decoded.typ || !decoded.alg)
948
+ if ("typ" in decoded && decoded?.typ !== "JWT")
949
+ return false;
950
+ if (!decoded.alg)
1007
951
  return false;
1008
952
  if (alg && decoded.alg !== alg)
1009
953
  return false;
1010
954
  return true;
1011
955
  }
1012
- catch (_a) {
956
+ catch {
1013
957
  return false;
1014
958
  }
1015
959
  }
@@ -1180,7 +1124,7 @@ class ZodString extends ZodType {
1180
1124
  try {
1181
1125
  new URL(input.data);
1182
1126
  }
1183
- catch (_a) {
1127
+ catch {
1184
1128
  ctx = this._getOrReturnCtx(input, ctx);
1185
1129
  addIssueToContext(ctx, {
1186
1130
  validation: "url",
@@ -1410,7 +1354,6 @@ class ZodString extends ZodType {
1410
1354
  return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
1411
1355
  }
1412
1356
  datetime(options) {
1413
- var _a, _b;
1414
1357
  if (typeof options === "string") {
1415
1358
  return this._addCheck({
1416
1359
  kind: "datetime",
@@ -1422,10 +1365,10 @@ class ZodString extends ZodType {
1422
1365
  }
1423
1366
  return this._addCheck({
1424
1367
  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),
1368
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
1369
+ offset: options?.offset ?? false,
1370
+ local: options?.local ?? false,
1371
+ ...errorUtil.errToObj(options?.message),
1429
1372
  });
1430
1373
  }
1431
1374
  date(message) {
@@ -1441,8 +1384,8 @@ class ZodString extends ZodType {
1441
1384
  }
1442
1385
  return this._addCheck({
1443
1386
  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),
1387
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
1388
+ ...errorUtil.errToObj(options?.message),
1446
1389
  });
1447
1390
  }
1448
1391
  duration(message) {
@@ -1459,8 +1402,8 @@ class ZodString extends ZodType {
1459
1402
  return this._addCheck({
1460
1403
  kind: "includes",
1461
1404
  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),
1405
+ position: options?.position,
1406
+ ...errorUtil.errToObj(options?.message),
1464
1407
  });
1465
1408
  }
1466
1409
  startsWith(value, message) {
@@ -1593,11 +1536,10 @@ class ZodString extends ZodType {
1593
1536
  }
1594
1537
  }
1595
1538
  ZodString.create = (params) => {
1596
- var _a;
1597
1539
  return new ZodString({
1598
1540
  checks: [],
1599
1541
  typeName: ZodFirstPartyTypeKind.ZodString,
1600
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1542
+ coerce: params?.coerce ?? false,
1601
1543
  ...processCreateParams(params),
1602
1544
  });
1603
1545
  };
@@ -1606,9 +1548,9 @@ function floatSafeRemainder(val, step) {
1606
1548
  const valDecCount = (val.toString().split(".")[1] || "").length;
1607
1549
  const stepDecCount = (step.toString().split(".")[1] || "").length;
1608
1550
  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);
1551
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1552
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1553
+ return (valInt % stepInt) / 10 ** decCount;
1612
1554
  }
1613
1555
  class ZodNumber extends ZodType {
1614
1556
  constructor() {
@@ -1647,9 +1589,7 @@ class ZodNumber extends ZodType {
1647
1589
  }
1648
1590
  }
1649
1591
  else if (check.kind === "min") {
1650
- const tooSmall = check.inclusive
1651
- ? input.data < check.value
1652
- : input.data <= check.value;
1592
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1653
1593
  if (tooSmall) {
1654
1594
  ctx = this._getOrReturnCtx(input, ctx);
1655
1595
  addIssueToContext(ctx, {
@@ -1664,9 +1604,7 @@ class ZodNumber extends ZodType {
1664
1604
  }
1665
1605
  }
1666
1606
  else if (check.kind === "max") {
1667
- const tooBig = check.inclusive
1668
- ? input.data > check.value
1669
- : input.data >= check.value;
1607
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1670
1608
  if (tooBig) {
1671
1609
  ctx = this._getOrReturnCtx(input, ctx);
1672
1610
  addIssueToContext(ctx, {
@@ -1824,15 +1762,13 @@ class ZodNumber extends ZodType {
1824
1762
  return max;
1825
1763
  }
1826
1764
  get isInt() {
1827
- return !!this._def.checks.find((ch) => ch.kind === "int" ||
1828
- (ch.kind === "multipleOf" && util.isInteger(ch.value)));
1765
+ return !!this._def.checks.find((ch) => ch.kind === "int" || (ch.kind === "multipleOf" && util.isInteger(ch.value)));
1829
1766
  }
1830
1767
  get isFinite() {
1831
- let max = null, min = null;
1768
+ let max = null;
1769
+ let min = null;
1832
1770
  for (const ch of this._def.checks) {
1833
- if (ch.kind === "finite" ||
1834
- ch.kind === "int" ||
1835
- ch.kind === "multipleOf") {
1771
+ if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1836
1772
  return true;
1837
1773
  }
1838
1774
  else if (ch.kind === "min") {
@@ -1851,7 +1787,7 @@ ZodNumber.create = (params) => {
1851
1787
  return new ZodNumber({
1852
1788
  checks: [],
1853
1789
  typeName: ZodFirstPartyTypeKind.ZodNumber,
1854
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1790
+ coerce: params?.coerce || false,
1855
1791
  ...processCreateParams(params),
1856
1792
  });
1857
1793
  };
@@ -1866,7 +1802,7 @@ class ZodBigInt extends ZodType {
1866
1802
  try {
1867
1803
  input.data = BigInt(input.data);
1868
1804
  }
1869
- catch (_a) {
1805
+ catch {
1870
1806
  return this._getInvalidInput(input);
1871
1807
  }
1872
1808
  }
@@ -1878,9 +1814,7 @@ class ZodBigInt extends ZodType {
1878
1814
  const status = new ParseStatus();
1879
1815
  for (const check of this._def.checks) {
1880
1816
  if (check.kind === "min") {
1881
- const tooSmall = check.inclusive
1882
- ? input.data < check.value
1883
- : input.data <= check.value;
1817
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1884
1818
  if (tooSmall) {
1885
1819
  ctx = this._getOrReturnCtx(input, ctx);
1886
1820
  addIssueToContext(ctx, {
@@ -1894,9 +1828,7 @@ class ZodBigInt extends ZodType {
1894
1828
  }
1895
1829
  }
1896
1830
  else if (check.kind === "max") {
1897
- const tooBig = check.inclusive
1898
- ? input.data > check.value
1899
- : input.data >= check.value;
1831
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1900
1832
  if (tooBig) {
1901
1833
  ctx = this._getOrReturnCtx(input, ctx);
1902
1834
  addIssueToContext(ctx, {
@@ -2028,11 +1960,10 @@ class ZodBigInt extends ZodType {
2028
1960
  }
2029
1961
  }
2030
1962
  ZodBigInt.create = (params) => {
2031
- var _a;
2032
1963
  return new ZodBigInt({
2033
1964
  checks: [],
2034
1965
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
2035
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1966
+ coerce: params?.coerce ?? false,
2036
1967
  ...processCreateParams(params),
2037
1968
  });
2038
1969
  };
@@ -2057,7 +1988,7 @@ class ZodBoolean extends ZodType {
2057
1988
  ZodBoolean.create = (params) => {
2058
1989
  return new ZodBoolean({
2059
1990
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
2060
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1991
+ coerce: params?.coerce || false,
2061
1992
  ...processCreateParams(params),
2062
1993
  });
2063
1994
  };
@@ -2076,7 +2007,7 @@ class ZodDate extends ZodType {
2076
2007
  });
2077
2008
  return INVALID;
2078
2009
  }
2079
- if (isNaN(input.data.getTime())) {
2010
+ if (Number.isNaN(input.data.getTime())) {
2080
2011
  const ctx = this._getOrReturnCtx(input);
2081
2012
  addIssueToContext(ctx, {
2082
2013
  code: ZodIssueCode.invalid_date,
@@ -2167,7 +2098,7 @@ class ZodDate extends ZodType {
2167
2098
  ZodDate.create = (params) => {
2168
2099
  return new ZodDate({
2169
2100
  checks: [],
2170
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2101
+ coerce: params?.coerce || false,
2171
2102
  typeName: ZodFirstPartyTypeKind.ZodDate,
2172
2103
  ...processCreateParams(params),
2173
2104
  });
@@ -2489,7 +2420,8 @@ class ZodObject extends ZodType {
2489
2420
  return this._cached;
2490
2421
  const shape = this._def.shape();
2491
2422
  const keys = util.objectKeys(shape);
2492
- return (this._cached = { shape, keys });
2423
+ this._cached = { shape, keys };
2424
+ return this._cached;
2493
2425
  }
2494
2426
  _parse(input) {
2495
2427
  const parsedType = this._getType(input);
@@ -2505,8 +2437,7 @@ class ZodObject extends ZodType {
2505
2437
  const { status, ctx } = this._processInputParams(input);
2506
2438
  const { shape, keys: shapeKeys } = this._getCached();
2507
2439
  const extraKeys = [];
2508
- if (!(this._def.catchall instanceof ZodNever &&
2509
- this._def.unknownKeys === "strip")) {
2440
+ if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
2510
2441
  for (const key in ctx.data) {
2511
2442
  if (!shapeKeys.includes(key)) {
2512
2443
  extraKeys.push(key);
@@ -2594,11 +2525,10 @@ class ZodObject extends ZodType {
2594
2525
  ...(message !== undefined
2595
2526
  ? {
2596
2527
  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;
2528
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2599
2529
  if (issue.code === "unrecognized_keys")
2600
2530
  return {
2601
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
2531
+ message: errorUtil.errToObj(message).message ?? defaultError,
2602
2532
  };
2603
2533
  return {
2604
2534
  message: defaultError,
@@ -2730,11 +2660,11 @@ class ZodObject extends ZodType {
2730
2660
  }
2731
2661
  pick(mask) {
2732
2662
  const shape = {};
2733
- util.objectKeys(mask).forEach((key) => {
2663
+ for (const key of util.objectKeys(mask)) {
2734
2664
  if (mask[key] && this.shape[key]) {
2735
2665
  shape[key] = this.shape[key];
2736
2666
  }
2737
- });
2667
+ }
2738
2668
  return new ZodObject({
2739
2669
  ...this._def,
2740
2670
  shape: () => shape,
@@ -2742,11 +2672,11 @@ class ZodObject extends ZodType {
2742
2672
  }
2743
2673
  omit(mask) {
2744
2674
  const shape = {};
2745
- util.objectKeys(this.shape).forEach((key) => {
2675
+ for (const key of util.objectKeys(this.shape)) {
2746
2676
  if (!mask[key]) {
2747
2677
  shape[key] = this.shape[key];
2748
2678
  }
2749
- });
2679
+ }
2750
2680
  return new ZodObject({
2751
2681
  ...this._def,
2752
2682
  shape: () => shape,
@@ -2760,7 +2690,7 @@ class ZodObject extends ZodType {
2760
2690
  }
2761
2691
  partial(mask) {
2762
2692
  const newShape = {};
2763
- util.objectKeys(this.shape).forEach((key) => {
2693
+ for (const key of util.objectKeys(this.shape)) {
2764
2694
  const fieldSchema = this.shape[key];
2765
2695
  if (mask && !mask[key]) {
2766
2696
  newShape[key] = fieldSchema;
@@ -2768,7 +2698,7 @@ class ZodObject extends ZodType {
2768
2698
  else {
2769
2699
  newShape[key] = fieldSchema.optional();
2770
2700
  }
2771
- });
2701
+ }
2772
2702
  return new ZodObject({
2773
2703
  ...this._def,
2774
2704
  shape: () => newShape,
@@ -2776,7 +2706,7 @@ class ZodObject extends ZodType {
2776
2706
  }
2777
2707
  required(mask) {
2778
2708
  const newShape = {};
2779
- util.objectKeys(this.shape).forEach((key) => {
2709
+ for (const key of util.objectKeys(this.shape)) {
2780
2710
  if (mask && !mask[key]) {
2781
2711
  newShape[key] = this.shape[key];
2782
2712
  }
@@ -2788,7 +2718,7 @@ class ZodObject extends ZodType {
2788
2718
  }
2789
2719
  newShape[key] = newField;
2790
2720
  }
2791
- });
2721
+ }
2792
2722
  return new ZodObject({
2793
2723
  ...this._def,
2794
2724
  shape: () => newShape,
@@ -3060,9 +2990,7 @@ function mergeValues(a, b) {
3060
2990
  }
3061
2991
  else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
3062
2992
  const bKeys = util.objectKeys(b);
3063
- const sharedKeys = util
3064
- .objectKeys(a)
3065
- .filter((key) => bKeys.indexOf(key) !== -1);
2993
+ const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
3066
2994
  const newObj = { ...a, ...b };
3067
2995
  for (const key of sharedKeys) {
3068
2996
  const sharedValue = mergeValues(a[key], b[key]);
@@ -3089,9 +3017,7 @@ function mergeValues(a, b) {
3089
3017
  }
3090
3018
  return { valid: true, data: newArray };
3091
3019
  }
3092
- else if (aType === ZodParsedType.date &&
3093
- bType === ZodParsedType.date &&
3094
- +a === +b) {
3020
+ else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
3095
3021
  return { valid: true, data: a };
3096
3022
  }
3097
3023
  else {
@@ -3152,6 +3078,7 @@ ZodIntersection.create = (left, right, params) => {
3152
3078
  ...processCreateParams(params),
3153
3079
  });
3154
3080
  };
3081
+ // type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
3155
3082
  class ZodTuple extends ZodType {
3156
3083
  _parse(input) {
3157
3084
  const { status, ctx } = this._processInputParams(input);
@@ -3448,12 +3375,7 @@ class ZodFunction extends ZodType {
3448
3375
  return makeIssue({
3449
3376
  data: args,
3450
3377
  path: ctx.path,
3451
- errorMaps: [
3452
- ctx.common.contextualErrorMap,
3453
- ctx.schemaErrorMap,
3454
- getErrorMap(),
3455
- errorMap,
3456
- ].filter((x) => !!x),
3378
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), errorMap].filter((x) => !!x),
3457
3379
  issueData: {
3458
3380
  code: ZodIssueCode.invalid_arguments,
3459
3381
  argumentsError: error,
@@ -3464,12 +3386,7 @@ class ZodFunction extends ZodType {
3464
3386
  return makeIssue({
3465
3387
  data: returns,
3466
3388
  path: ctx.path,
3467
- errorMaps: [
3468
- ctx.common.contextualErrorMap,
3469
- ctx.schemaErrorMap,
3470
- getErrorMap(),
3471
- errorMap,
3472
- ].filter((x) => !!x),
3389
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), errorMap].filter((x) => !!x),
3473
3390
  issueData: {
3474
3391
  code: ZodIssueCode.invalid_return_type,
3475
3392
  returnTypeError: error,
@@ -3485,9 +3402,7 @@ class ZodFunction extends ZodType {
3485
3402
  const me = this;
3486
3403
  return OK(async function (...args) {
3487
3404
  const error = new ZodError([]);
3488
- const parsedArgs = await me._def.args
3489
- .parseAsync(args, params)
3490
- .catch((e) => {
3405
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3491
3406
  error.addIssue(makeArgsIssue(args, e));
3492
3407
  throw error;
3493
3408
  });
@@ -3548,9 +3463,7 @@ class ZodFunction extends ZodType {
3548
3463
  }
3549
3464
  static create(args, returns, params) {
3550
3465
  return new ZodFunction({
3551
- args: (args
3552
- ? args
3553
- : ZodTuple.create([]).rest(ZodUnknown.create())),
3466
+ args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),
3554
3467
  returns: returns || ZodUnknown.create(),
3555
3468
  typeName: ZodFirstPartyTypeKind.ZodFunction,
3556
3469
  ...processCreateParams(params),
@@ -3606,10 +3519,6 @@ function createZodEnum(values, params) {
3606
3519
  });
3607
3520
  }
3608
3521
  class ZodEnum extends ZodType {
3609
- constructor() {
3610
- super(...arguments);
3611
- _ZodEnum_cache.set(this, void 0);
3612
- }
3613
3522
  _parse(input) {
3614
3523
  if (typeof input.data !== "string") {
3615
3524
  const ctx = this._getOrReturnCtx(input);
@@ -3621,10 +3530,10 @@ class ZodEnum extends ZodType {
3621
3530
  });
3622
3531
  return INVALID;
3623
3532
  }
3624
- if (!__classPrivateFieldGet(this, _ZodEnum_cache)) {
3625
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values));
3533
+ if (!this._cache) {
3534
+ this._cache = new Set(this._def.values);
3626
3535
  }
3627
- if (!__classPrivateFieldGet(this, _ZodEnum_cache).has(input.data)) {
3536
+ if (!this._cache.has(input.data)) {
3628
3537
  const ctx = this._getOrReturnCtx(input);
3629
3538
  const expectedValues = this._def.values;
3630
3539
  addIssueToContext(ctx, {
@@ -3673,18 +3582,12 @@ class ZodEnum extends ZodType {
3673
3582
  });
3674
3583
  }
3675
3584
  }
3676
- _ZodEnum_cache = new WeakMap();
3677
3585
  ZodEnum.create = createZodEnum;
3678
3586
  class ZodNativeEnum extends ZodType {
3679
- constructor() {
3680
- super(...arguments);
3681
- _ZodNativeEnum_cache.set(this, void 0);
3682
- }
3683
3587
  _parse(input) {
3684
3588
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
3685
3589
  const ctx = this._getOrReturnCtx(input);
3686
- if (ctx.parsedType !== ZodParsedType.string &&
3687
- ctx.parsedType !== ZodParsedType.number) {
3590
+ if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
3688
3591
  const expectedValues = util.objectValues(nativeEnumValues);
3689
3592
  addIssueToContext(ctx, {
3690
3593
  expected: util.joinValues(expectedValues),
@@ -3693,10 +3596,10 @@ class ZodNativeEnum extends ZodType {
3693
3596
  });
3694
3597
  return INVALID;
3695
3598
  }
3696
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache)) {
3697
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)));
3599
+ if (!this._cache) {
3600
+ this._cache = new Set(util.getValidEnumValues(this._def.values));
3698
3601
  }
3699
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache).has(input.data)) {
3602
+ if (!this._cache.has(input.data)) {
3700
3603
  const expectedValues = util.objectValues(nativeEnumValues);
3701
3604
  addIssueToContext(ctx, {
3702
3605
  received: ctx.data,
@@ -3711,7 +3614,6 @@ class ZodNativeEnum extends ZodType {
3711
3614
  return this._def.values;
3712
3615
  }
3713
3616
  }
3714
- _ZodNativeEnum_cache = new WeakMap();
3715
3617
  ZodNativeEnum.create = (values, params) => {
3716
3618
  return new ZodNativeEnum({
3717
3619
  values: values,
@@ -3725,8 +3627,7 @@ class ZodPromise extends ZodType {
3725
3627
  }
3726
3628
  _parse(input) {
3727
3629
  const { ctx } = this._processInputParams(input);
3728
- if (ctx.parsedType !== ZodParsedType.promise &&
3729
- ctx.common.async === false) {
3630
+ if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
3730
3631
  addIssueToContext(ctx, {
3731
3632
  code: ZodIssueCode.invalid_type,
3732
3633
  expected: ZodParsedType.promise,
@@ -3734,9 +3635,7 @@ class ZodPromise extends ZodType {
3734
3635
  });
3735
3636
  return INVALID;
3736
3637
  }
3737
- const promisified = ctx.parsedType === ZodParsedType.promise
3738
- ? ctx.data
3739
- : Promise.resolve(ctx.data);
3638
+ const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
3740
3639
  return OK(promisified.then((data) => {
3741
3640
  return this._def.type.parseAsync(data, {
3742
3641
  path: ctx.path,
@@ -3842,9 +3741,7 @@ class ZodEffects extends ZodType {
3842
3741
  return { status: status.value, value: inner.value };
3843
3742
  }
3844
3743
  else {
3845
- return this._def.schema
3846
- ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3847
- .then((inner) => {
3744
+ return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
3848
3745
  if (inner.status === "aborted")
3849
3746
  return INVALID;
3850
3747
  if (inner.status === "dirty")
@@ -3863,7 +3760,7 @@ class ZodEffects extends ZodType {
3863
3760
  parent: ctx,
3864
3761
  });
3865
3762
  if (!isValid(base))
3866
- return base;
3763
+ return INVALID;
3867
3764
  const result = effect.transform(base.value, checkCtx);
3868
3765
  if (result instanceof Promise) {
3869
3766
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
@@ -3871,12 +3768,13 @@ class ZodEffects extends ZodType {
3871
3768
  return { status: status.value, value: result };
3872
3769
  }
3873
3770
  else {
3874
- return this._def.schema
3875
- ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3876
- .then((base) => {
3771
+ return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3877
3772
  if (!isValid(base))
3878
- return base;
3879
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3773
+ return INVALID;
3774
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3775
+ status: status.value,
3776
+ value: result,
3777
+ }));
3880
3778
  });
3881
3779
  }
3882
3780
  }
@@ -3958,9 +3856,7 @@ ZodDefault.create = (type, params) => {
3958
3856
  return new ZodDefault({
3959
3857
  innerType: type,
3960
3858
  typeName: ZodFirstPartyTypeKind.ZodDefault,
3961
- defaultValue: typeof params.default === "function"
3962
- ? params.default
3963
- : () => params.default,
3859
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3964
3860
  ...processCreateParams(params),
3965
3861
  });
3966
3862
  };
@@ -4126,9 +4022,7 @@ class ZodReadonly extends ZodType {
4126
4022
  }
4127
4023
  return data;
4128
4024
  };
4129
- return isAsync(result)
4130
- ? result.then((data) => freeze(data))
4131
- : freeze(result);
4025
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
4132
4026
  }
4133
4027
  unwrap() {
4134
4028
  return this._def.innerType;
@@ -4141,7 +4035,19 @@ ZodReadonly.create = (type, params) => {
4141
4035
  ...processCreateParams(params),
4142
4036
  });
4143
4037
  };
4144
- function custom(check, params = {},
4038
+ ////////////////////////////////////////
4039
+ ////////////////////////////////////////
4040
+ ////////// //////////
4041
+ ////////// z.custom //////////
4042
+ ////////// //////////
4043
+ ////////////////////////////////////////
4044
+ ////////////////////////////////////////
4045
+ function cleanParams(params, data) {
4046
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
4047
+ const p2 = typeof p === "string" ? { message: p } : p;
4048
+ return p2;
4049
+ }
4050
+ function custom(check, _params = {},
4145
4051
  /**
4146
4052
  * @deprecated
4147
4053
  *
@@ -4155,17 +4061,22 @@ function custom(check, params = {},
4155
4061
  fatal) {
4156
4062
  if (check)
4157
4063
  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 });
4064
+ const r = check(data);
4065
+ if (r instanceof Promise) {
4066
+ return r.then((r) => {
4067
+ if (!r) {
4068
+ const params = cleanParams(_params, data);
4069
+ const _fatal = params.fatal ?? fatal ?? true;
4070
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
4071
+ }
4072
+ });
4073
+ }
4074
+ if (!r) {
4075
+ const params = cleanParams(_params, data);
4076
+ const _fatal = params.fatal ?? fatal ?? true;
4077
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
4168
4078
  }
4079
+ return;
4169
4080
  });
4170
4081
  return ZodAny.create();
4171
4082
  }
@@ -4265,116 +4176,116 @@ const coerce = {
4265
4176
  };
4266
4177
  const NEVER = INVALID;
4267
4178
 
4268
- var z = /*#__PURE__*/Object.freeze({
4179
+ const z = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
4269
4180
  __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,
4181
+ BRAND,
4182
+ DIRTY,
4183
+ EMPTY_PATH,
4184
+ INVALID,
4185
+ NEVER,
4186
+ OK,
4187
+ ParseStatus,
4329
4188
  Schema: ZodType,
4330
- ZodSchema: ZodType,
4331
- late: late,
4189
+ ZodAny,
4190
+ ZodArray,
4191
+ ZodBigInt,
4192
+ ZodBoolean,
4193
+ ZodBranded,
4194
+ ZodCatch,
4195
+ ZodDate,
4196
+ ZodDefault,
4197
+ ZodDiscriminatedUnion,
4198
+ ZodEffects,
4199
+ ZodEnum,
4200
+ ZodError,
4332
4201
  get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },
4333
- coerce: coerce,
4202
+ ZodFunction,
4203
+ ZodIntersection,
4204
+ ZodIssueCode,
4205
+ ZodLazy,
4206
+ ZodLiteral,
4207
+ ZodMap,
4208
+ ZodNaN,
4209
+ ZodNativeEnum,
4210
+ ZodNever,
4211
+ ZodNull,
4212
+ ZodNullable,
4213
+ ZodNumber,
4214
+ ZodObject,
4215
+ ZodOptional,
4216
+ ZodParsedType,
4217
+ ZodPipeline,
4218
+ ZodPromise,
4219
+ ZodReadonly,
4220
+ ZodRecord,
4221
+ ZodSchema: ZodType,
4222
+ ZodSet,
4223
+ ZodString,
4224
+ ZodSymbol,
4225
+ ZodTransformer: ZodEffects,
4226
+ ZodTuple,
4227
+ ZodType,
4228
+ ZodUndefined,
4229
+ ZodUnion,
4230
+ ZodUnknown,
4231
+ ZodVoid,
4232
+ addIssueToContext,
4334
4233
  any: anyType,
4335
4234
  array: arrayType,
4336
4235
  bigint: bigIntType,
4337
4236
  boolean: booleanType,
4237
+ coerce,
4238
+ custom,
4338
4239
  date: dateType,
4240
+ datetimeRegex,
4241
+ defaultErrorMap: errorMap,
4339
4242
  discriminatedUnion: discriminatedUnionType,
4340
4243
  effect: effectsType,
4341
- 'enum': enumType,
4342
- 'function': functionType,
4343
- 'instanceof': instanceOfType,
4244
+ enum: enumType,
4245
+ function: functionType,
4246
+ getErrorMap,
4247
+ getParsedType,
4248
+ instanceof: instanceOfType,
4344
4249
  intersection: intersectionType,
4250
+ isAborted,
4251
+ isAsync,
4252
+ isDirty,
4253
+ isValid,
4254
+ late,
4345
4255
  lazy: lazyType,
4346
4256
  literal: literalType,
4257
+ makeIssue,
4347
4258
  map: mapType,
4348
4259
  nan: nanType,
4349
4260
  nativeEnum: nativeEnumType,
4350
4261
  never: neverType,
4351
- 'null': nullType,
4262
+ null: nullType,
4352
4263
  nullable: nullableType,
4353
4264
  number: numberType,
4354
4265
  object: objectType,
4355
- oboolean: oboolean,
4356
- onumber: onumber,
4266
+ get objectUtil () { return objectUtil; },
4267
+ oboolean,
4268
+ onumber,
4357
4269
  optional: optionalType,
4358
- ostring: ostring,
4270
+ ostring,
4359
4271
  pipeline: pipelineType,
4360
4272
  preprocess: preprocessType,
4361
4273
  promise: promiseType,
4274
+ quotelessJson,
4362
4275
  record: recordType,
4363
4276
  set: setType,
4277
+ setErrorMap,
4364
4278
  strictObject: strictObjectType,
4365
4279
  string: stringType,
4366
4280
  symbol: symbolType,
4367
4281
  transformer: effectsType,
4368
4282
  tuple: tupleType,
4369
- 'undefined': undefinedType,
4283
+ undefined: undefinedType,
4370
4284
  union: unionType,
4371
4285
  unknown: unknownType,
4372
- 'void': voidType,
4373
- NEVER: NEVER,
4374
- ZodIssueCode: ZodIssueCode,
4375
- quotelessJson: quotelessJson,
4376
- ZodError: ZodError
4377
- });
4286
+ get util () { return util; },
4287
+ void: voidType
4288
+ }, Symbol.toStringTag, { value: 'Module' }));
4378
4289
 
4379
4290
  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
4291
+ //# sourceMappingURL=__federation_shared_zod-BGUJlEOa.js.map