@intlayer/ai 7.5.2-canary.1 → 7.5.2

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 (89) hide show
  1. package/dist/assets/auditDictionaryMetadata/EXAMPLE_REQUEST.md +21 -0
  2. package/dist/assets/auditDictionaryMetadata/EXAMPLE_RESPONSE.md +1 -0
  3. package/dist/assets/auditDictionaryMetadata/PROMPT.md +0 -41
  4. package/dist/assets/translateJSON/PROMPT.md +25 -29
  5. package/dist/cjs/aiSdk.cjs +1 -1
  6. package/dist/cjs/aiSdk.cjs.map +1 -1
  7. package/dist/cjs/auditDictionaryMetadata/index.cjs +30 -15
  8. package/dist/cjs/auditDictionaryMetadata/index.cjs.map +1 -1
  9. package/dist/cjs/index.cjs +1 -1
  10. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/errors.cjs +30 -0
  11. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/errors.cjs.map +1 -0
  12. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/iso.cjs +41 -0
  13. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/iso.cjs.map +1 -0
  14. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/parse.cjs +31 -0
  15. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/parse.cjs.map +1 -0
  16. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/schemas.cjs +577 -0
  17. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/schemas.cjs.map +1 -0
  18. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/api.cjs +535 -0
  19. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/api.cjs.map +1 -0
  20. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/checks.cjs +376 -0
  21. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/checks.cjs.map +1 -0
  22. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/core.cjs +67 -0
  23. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/core.cjs.map +1 -0
  24. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/doc.cjs +35 -0
  25. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/doc.cjs.map +1 -0
  26. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/errors.cjs +66 -0
  27. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/errors.cjs.map +1 -0
  28. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.cjs +239 -0
  29. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.cjs.map +1 -0
  30. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/parse.cjs +123 -0
  31. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/parse.cjs.map +1 -0
  32. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/regexes.cjs +88 -0
  33. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/regexes.cjs.map +1 -0
  34. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/registries.cjs +54 -0
  35. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/registries.cjs.map +1 -0
  36. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/schemas.cjs +1048 -0
  37. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/schemas.cjs.map +1 -0
  38. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/to-json-schema.cjs +263 -0
  39. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/to-json-schema.cjs.map +1 -0
  40. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/util.cjs +350 -0
  41. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/util.cjs.map +1 -0
  42. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/versions.cjs +11 -0
  43. package/dist/cjs/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/versions.cjs.map +1 -0
  44. package/dist/cjs/translateJSON/index.cjs +29 -6
  45. package/dist/cjs/translateJSON/index.cjs.map +1 -1
  46. package/dist/esm/aiSdk.mjs +1 -1
  47. package/dist/esm/aiSdk.mjs.map +1 -1
  48. package/dist/esm/auditDictionaryMetadata/index.mjs +31 -16
  49. package/dist/esm/auditDictionaryMetadata/index.mjs.map +1 -1
  50. package/dist/esm/index.mjs +1 -1
  51. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/errors.mjs +30 -0
  52. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/errors.mjs.map +1 -0
  53. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/iso.mjs +38 -0
  54. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/iso.mjs.map +1 -0
  55. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/parse.mjs +20 -0
  56. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/parse.mjs.map +1 -0
  57. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/schemas.mjs +571 -0
  58. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/schemas.mjs.map +1 -0
  59. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/api.mjs +478 -0
  60. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/api.mjs.map +1 -0
  61. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/checks.mjs +361 -0
  62. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/checks.mjs.map +1 -0
  63. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/core.mjs +62 -0
  64. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/core.mjs.map +1 -0
  65. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/doc.mjs +34 -0
  66. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/doc.mjs.map +1 -0
  67. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/errors.mjs +63 -0
  68. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/errors.mjs.map +1 -0
  69. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.mjs +219 -0
  70. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.mjs.map +1 -0
  71. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/parse.mjs +110 -0
  72. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/parse.mjs.map +1 -0
  73. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/regexes.mjs +61 -0
  74. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/regexes.mjs.map +1 -0
  75. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/registries.mjs +53 -0
  76. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/registries.mjs.map +1 -0
  77. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/schemas.mjs +1002 -0
  78. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/schemas.mjs.map +1 -0
  79. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/to-json-schema.mjs +261 -0
  80. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/to-json-schema.mjs.map +1 -0
  81. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/util.mjs +317 -0
  82. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/util.mjs.map +1 -0
  83. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/versions.mjs +10 -0
  84. package/dist/esm/node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/versions.mjs.map +1 -0
  85. package/dist/esm/translateJSON/index.mjs +30 -7
  86. package/dist/esm/translateJSON/index.mjs.map +1 -1
  87. package/dist/types/translateJSON/index.d.ts +7 -7
  88. package/dist/types/translateJSON/index.d.ts.map +1 -1
  89. package/package.json +5 -5
@@ -0,0 +1,66 @@
1
+ const require_core = require('./core.cjs');
2
+ const require_util = require('./util.cjs');
3
+
4
+ //#region ../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/errors.js
5
+ const initializer = (inst, def) => {
6
+ inst.name = "$ZodError";
7
+ Object.defineProperty(inst, "_zod", {
8
+ value: inst._zod,
9
+ enumerable: false
10
+ });
11
+ Object.defineProperty(inst, "issues", {
12
+ value: def,
13
+ enumerable: false
14
+ });
15
+ inst.message = JSON.stringify(def, require_util.jsonStringifyReplacer, 2);
16
+ Object.defineProperty(inst, "toString", {
17
+ value: () => inst.message,
18
+ enumerable: false
19
+ });
20
+ };
21
+ const $ZodError = require_core.$constructor("$ZodError", initializer);
22
+ const $ZodRealError = require_core.$constructor("$ZodError", initializer, { Parent: Error });
23
+ function flattenError(error, mapper = (issue) => issue.message) {
24
+ const fieldErrors = {};
25
+ const formErrors = [];
26
+ for (const sub of error.issues) if (sub.path.length > 0) {
27
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
28
+ fieldErrors[sub.path[0]].push(mapper(sub));
29
+ } else formErrors.push(mapper(sub));
30
+ return {
31
+ formErrors,
32
+ fieldErrors
33
+ };
34
+ }
35
+ function formatError(error, mapper = (issue) => issue.message) {
36
+ const fieldErrors = { _errors: [] };
37
+ const processError = (error$1) => {
38
+ for (const issue of error$1.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }));
39
+ else if (issue.code === "invalid_key") processError({ issues: issue.issues });
40
+ else if (issue.code === "invalid_element") processError({ issues: issue.issues });
41
+ else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
42
+ else {
43
+ let curr = fieldErrors;
44
+ let i = 0;
45
+ while (i < issue.path.length) {
46
+ const el = issue.path[i];
47
+ if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
48
+ else {
49
+ curr[el] = curr[el] || { _errors: [] };
50
+ curr[el]._errors.push(mapper(issue));
51
+ }
52
+ curr = curr[el];
53
+ i++;
54
+ }
55
+ }
56
+ };
57
+ processError(error);
58
+ return fieldErrors;
59
+ }
60
+
61
+ //#endregion
62
+ exports.$ZodError = $ZodError;
63
+ exports.$ZodRealError = $ZodRealError;
64
+ exports.flattenError = flattenError;
65
+ exports.formatError = formatError;
66
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.cjs","names":["$constructor","error"],"sources":["../../../../../../../../../../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/errors.js"],"sourcesContent":["import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,MAAM,eAAe,MAAM,QAAQ;AAC/B,MAAK,OAAO;AACZ,QAAO,eAAe,MAAM,QAAQ;EAChC,OAAO,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QAAI,EADa,MAAM,MAAM,KAAK,SAAS,GAEvC,MAAK,MAAM,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE;SAErC;AACD,UAAK,MAAM,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE;AACtC,UAAK,IAAI,QAAQ,KAAK,OAAO,MAAM,CAAC;;AAExC,WAAO,KAAK;AACZ;;;;AAKhB,cAAa,MAAM;AACnB,QAAO"}
@@ -0,0 +1,239 @@
1
+ const require_util = require('./util.cjs');
2
+ const require_to_json_schema = require('./to-json-schema.cjs');
3
+
4
+ //#region ../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.js
5
+ const formatMap = {
6
+ guid: "uuid",
7
+ url: "uri",
8
+ datetime: "date-time",
9
+ json_string: "json-string",
10
+ regex: ""
11
+ };
12
+ const stringProcessor = (schema, ctx, _json, _params) => {
13
+ const json = _json;
14
+ json.type = "string";
15
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
16
+ if (typeof minimum === "number") json.minLength = minimum;
17
+ if (typeof maximum === "number") json.maxLength = maximum;
18
+ if (format) {
19
+ json.format = formatMap[format] ?? format;
20
+ if (json.format === "") delete json.format;
21
+ }
22
+ if (contentEncoding) json.contentEncoding = contentEncoding;
23
+ if (patterns && patterns.size > 0) {
24
+ const regexes = [...patterns];
25
+ if (regexes.length === 1) json.pattern = regexes[0].source;
26
+ else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
27
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
28
+ pattern: regex.source
29
+ }))];
30
+ }
31
+ };
32
+ const numberProcessor = (schema, ctx, _json, _params) => {
33
+ const json = _json;
34
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
35
+ if (typeof format === "string" && format.includes("int")) json.type = "integer";
36
+ else json.type = "number";
37
+ if (typeof exclusiveMinimum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
38
+ json.minimum = exclusiveMinimum;
39
+ json.exclusiveMinimum = true;
40
+ } else json.exclusiveMinimum = exclusiveMinimum;
41
+ if (typeof minimum === "number") {
42
+ json.minimum = minimum;
43
+ if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") if (exclusiveMinimum >= minimum) delete json.minimum;
44
+ else delete json.exclusiveMinimum;
45
+ }
46
+ if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
47
+ json.maximum = exclusiveMaximum;
48
+ json.exclusiveMaximum = true;
49
+ } else json.exclusiveMaximum = exclusiveMaximum;
50
+ if (typeof maximum === "number") {
51
+ json.maximum = maximum;
52
+ if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") if (exclusiveMaximum <= maximum) delete json.maximum;
53
+ else delete json.exclusiveMaximum;
54
+ }
55
+ if (typeof multipleOf === "number") json.multipleOf = multipleOf;
56
+ };
57
+ const booleanProcessor = (_schema, _ctx, json, _params) => {
58
+ json.type = "boolean";
59
+ };
60
+ const neverProcessor = (_schema, _ctx, json, _params) => {
61
+ json.not = {};
62
+ };
63
+ const anyProcessor = (_schema, _ctx, _json, _params) => {};
64
+ const unknownProcessor = (_schema, _ctx, _json, _params) => {};
65
+ const enumProcessor = (schema, _ctx, json, _params) => {
66
+ const def = schema._zod.def;
67
+ const values = require_util.getEnumValues(def.entries);
68
+ if (values.every((v) => typeof v === "number")) json.type = "number";
69
+ if (values.every((v) => typeof v === "string")) json.type = "string";
70
+ json.enum = values;
71
+ };
72
+ const customProcessor = (_schema, ctx, _json, _params) => {
73
+ if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
74
+ };
75
+ const transformProcessor = (_schema, ctx, _json, _params) => {
76
+ if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
77
+ };
78
+ const arrayProcessor = (schema, ctx, _json, params) => {
79
+ const json = _json;
80
+ const def = schema._zod.def;
81
+ const { minimum, maximum } = schema._zod.bag;
82
+ if (typeof minimum === "number") json.minItems = minimum;
83
+ if (typeof maximum === "number") json.maxItems = maximum;
84
+ json.type = "array";
85
+ json.items = require_to_json_schema.process(def.element, ctx, {
86
+ ...params,
87
+ path: [...params.path, "items"]
88
+ });
89
+ };
90
+ const objectProcessor = (schema, ctx, _json, params) => {
91
+ const json = _json;
92
+ const def = schema._zod.def;
93
+ json.type = "object";
94
+ json.properties = {};
95
+ const shape = def.shape;
96
+ for (const key in shape) json.properties[key] = require_to_json_schema.process(shape[key], ctx, {
97
+ ...params,
98
+ path: [
99
+ ...params.path,
100
+ "properties",
101
+ key
102
+ ]
103
+ });
104
+ const allKeys = new Set(Object.keys(shape));
105
+ const requiredKeys = new Set([...allKeys].filter((key) => {
106
+ const v = def.shape[key]._zod;
107
+ if (ctx.io === "input") return v.optin === void 0;
108
+ else return v.optout === void 0;
109
+ }));
110
+ if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
111
+ if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
112
+ else if (!def.catchall) {
113
+ if (ctx.io === "output") json.additionalProperties = false;
114
+ } else if (def.catchall) json.additionalProperties = require_to_json_schema.process(def.catchall, ctx, {
115
+ ...params,
116
+ path: [...params.path, "additionalProperties"]
117
+ });
118
+ };
119
+ const unionProcessor = (schema, ctx, json, params) => {
120
+ const def = schema._zod.def;
121
+ const isExclusive = def.inclusive === false;
122
+ const options = def.options.map((x, i) => require_to_json_schema.process(x, ctx, {
123
+ ...params,
124
+ path: [
125
+ ...params.path,
126
+ isExclusive ? "oneOf" : "anyOf",
127
+ i
128
+ ]
129
+ }));
130
+ if (isExclusive) json.oneOf = options;
131
+ else json.anyOf = options;
132
+ };
133
+ const intersectionProcessor = (schema, ctx, json, params) => {
134
+ const def = schema._zod.def;
135
+ const a = require_to_json_schema.process(def.left, ctx, {
136
+ ...params,
137
+ path: [
138
+ ...params.path,
139
+ "allOf",
140
+ 0
141
+ ]
142
+ });
143
+ const b = require_to_json_schema.process(def.right, ctx, {
144
+ ...params,
145
+ path: [
146
+ ...params.path,
147
+ "allOf",
148
+ 1
149
+ ]
150
+ });
151
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
152
+ json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
153
+ };
154
+ const nullableProcessor = (schema, ctx, json, params) => {
155
+ const def = schema._zod.def;
156
+ const inner = require_to_json_schema.process(def.innerType, ctx, params);
157
+ const seen = ctx.seen.get(schema);
158
+ if (ctx.target === "openapi-3.0") {
159
+ seen.ref = def.innerType;
160
+ json.nullable = true;
161
+ } else json.anyOf = [inner, { type: "null" }];
162
+ };
163
+ const nonoptionalProcessor = (schema, ctx, _json, params) => {
164
+ const def = schema._zod.def;
165
+ require_to_json_schema.process(def.innerType, ctx, params);
166
+ const seen = ctx.seen.get(schema);
167
+ seen.ref = def.innerType;
168
+ };
169
+ const defaultProcessor = (schema, ctx, json, params) => {
170
+ const def = schema._zod.def;
171
+ require_to_json_schema.process(def.innerType, ctx, params);
172
+ const seen = ctx.seen.get(schema);
173
+ seen.ref = def.innerType;
174
+ json.default = JSON.parse(JSON.stringify(def.defaultValue));
175
+ };
176
+ const prefaultProcessor = (schema, ctx, json, params) => {
177
+ const def = schema._zod.def;
178
+ require_to_json_schema.process(def.innerType, ctx, params);
179
+ const seen = ctx.seen.get(schema);
180
+ seen.ref = def.innerType;
181
+ if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
182
+ };
183
+ const catchProcessor = (schema, ctx, json, params) => {
184
+ const def = schema._zod.def;
185
+ require_to_json_schema.process(def.innerType, ctx, params);
186
+ const seen = ctx.seen.get(schema);
187
+ seen.ref = def.innerType;
188
+ let catchValue;
189
+ try {
190
+ catchValue = def.catchValue(void 0);
191
+ } catch {
192
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
193
+ }
194
+ json.default = catchValue;
195
+ };
196
+ const pipeProcessor = (schema, ctx, _json, params) => {
197
+ const def = schema._zod.def;
198
+ const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
199
+ require_to_json_schema.process(innerType, ctx, params);
200
+ const seen = ctx.seen.get(schema);
201
+ seen.ref = innerType;
202
+ };
203
+ const readonlyProcessor = (schema, ctx, json, params) => {
204
+ const def = schema._zod.def;
205
+ require_to_json_schema.process(def.innerType, ctx, params);
206
+ const seen = ctx.seen.get(schema);
207
+ seen.ref = def.innerType;
208
+ json.readOnly = true;
209
+ };
210
+ const optionalProcessor = (schema, ctx, _json, params) => {
211
+ const def = schema._zod.def;
212
+ require_to_json_schema.process(def.innerType, ctx, params);
213
+ const seen = ctx.seen.get(schema);
214
+ seen.ref = def.innerType;
215
+ };
216
+
217
+ //#endregion
218
+ exports.anyProcessor = anyProcessor;
219
+ exports.arrayProcessor = arrayProcessor;
220
+ exports.booleanProcessor = booleanProcessor;
221
+ exports.catchProcessor = catchProcessor;
222
+ exports.customProcessor = customProcessor;
223
+ exports.defaultProcessor = defaultProcessor;
224
+ exports.enumProcessor = enumProcessor;
225
+ exports.intersectionProcessor = intersectionProcessor;
226
+ exports.neverProcessor = neverProcessor;
227
+ exports.nonoptionalProcessor = nonoptionalProcessor;
228
+ exports.nullableProcessor = nullableProcessor;
229
+ exports.numberProcessor = numberProcessor;
230
+ exports.objectProcessor = objectProcessor;
231
+ exports.optionalProcessor = optionalProcessor;
232
+ exports.pipeProcessor = pipeProcessor;
233
+ exports.prefaultProcessor = prefaultProcessor;
234
+ exports.readonlyProcessor = readonlyProcessor;
235
+ exports.stringProcessor = stringProcessor;
236
+ exports.transformProcessor = transformProcessor;
237
+ exports.unionProcessor = unionProcessor;
238
+ exports.unknownProcessor = unknownProcessor;
239
+ //# sourceMappingURL=json-schema-processors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema-processors.cjs","names":["getEnumValues","process"],"sources":["../../../../../../../../../../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.js"],"sourcesContent":["import { extractDefs, finalize, initializeContext, process, } from \"./to-json-schema.js\";\nimport { getEnumValues } from \"./util.js\";\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding } = schema._zod\n .bag;\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const regexes = [...patterns];\n if (regexes.length === 1)\n json.pattern = regexes[0].source;\n else if (regexes.length > 1) {\n json.allOf = [\n ...regexes.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;\n if (typeof format === \"string\" && format.includes(\"int\"))\n json.type = \"integer\";\n else\n json.type = \"number\";\n if (typeof exclusiveMinimum === \"number\") {\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n if (typeof minimum === \"number\") {\n json.minimum = minimum;\n if (typeof exclusiveMinimum === \"number\" && ctx.target !== \"draft-04\") {\n if (exclusiveMinimum >= minimum)\n delete json.minimum;\n else\n delete json.exclusiveMinimum;\n }\n }\n if (typeof exclusiveMaximum === \"number\") {\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n if (typeof maximum === \"number\") {\n json.maximum = maximum;\n if (typeof exclusiveMaximum === \"number\" && ctx.target !== \"draft-04\") {\n if (exclusiveMaximum <= maximum)\n delete json.maximum;\n else\n delete json.exclusiveMaximum;\n }\n }\n if (typeof multipleOf === \"number\")\n json.multipleOf = multipleOf;\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt cannot be represented in JSON Schema\");\n }\n};\nexport const symbolProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Symbols cannot be represented in JSON Schema\");\n }\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Undefined cannot be represented in JSON Schema\");\n }\n};\nexport const voidProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Void cannot be represented in JSON Schema\");\n }\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Date cannot be represented in JSON Schema\");\n }\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, _params) => {\n const def = schema._zod.def;\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Literal `undefined` cannot be represented in JSON Schema\");\n }\n else {\n // do not add to vals\n }\n }\n else if (typeof val === \"bigint\") {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt literals cannot be represented in JSON Schema\");\n }\n else {\n vals.push(Number(val));\n }\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"NaN cannot be represented in JSON Schema\");\n }\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const file = {\n type: \"string\",\n format: \"binary\",\n contentEncoding: \"binary\",\n };\n const { minimum, maximum, mime } = schema._zod.bag;\n if (minimum !== undefined)\n file.minLength = minimum;\n if (maximum !== undefined)\n file.maxLength = maximum;\n if (mime) {\n if (mime.length === 1) {\n file.contentMediaType = mime[0];\n Object.assign(_json, file);\n }\n else {\n _json.anyOf = mime.map((m) => {\n const mFile = { ...file, contentMediaType: m };\n return mFile;\n });\n }\n }\n else {\n Object.assign(_json, file);\n }\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Custom types cannot be represented in JSON Schema\");\n }\n};\nexport const functionProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Function types cannot be represented in JSON Schema\");\n }\n};\nexport const transformProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Transforms cannot be represented in JSON Schema\");\n }\n};\nexport const mapProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Map cannot be represented in JSON Schema\");\n }\n};\nexport const setProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Set cannot be represented in JSON Schema\");\n }\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = process(def.element, ctx, { ...params, path: [...params.path, \"items\"] });\n};\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n json.properties = {};\n const shape = def.shape;\n for (const key in shape) {\n json.properties[key] = process(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n });\n }\n // required keys\n const allKeys = new Set(Object.keys(shape));\n const requiredKeys = new Set([...allKeys].filter((key) => {\n const v = def.shape[key]._zod;\n if (ctx.io === \"input\") {\n return v.optin === undefined;\n }\n else {\n return v.optout === undefined;\n }\n }));\n if (requiredKeys.size > 0) {\n json.required = Array.from(requiredKeys);\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = process(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches)\n // This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = process(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = process(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? process(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (rest) {\n json.items = rest;\n }\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n json.minItems = prefixItems.length;\n if (!rest) {\n json.maxItems = prefixItems.length;\n }\n }\n else {\n json.items = prefixItems;\n if (rest) {\n json.additionalItems = rest;\n }\n }\n // length\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = process(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n }\n json.additionalProperties = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.default = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io === \"input\")\n json._prefault = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n throw new Error(\"Dynamic catch values are not supported in JSON Schema\");\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const innerType = ctx.io === \"input\" ? (def.in._zod.def.type === \"transform\" ? def.out : def.in) : def.out;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n process(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n schemas[key] = finalize(ctx, schema);\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n process(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,MAAM,YAAY;CACd,MAAM;CACN,KAAK;CACL,UAAU;CACV,aAAa;CACb,OAAO;CACV;AAED,MAAa,mBAAmB,QAAQ,KAAK,OAAO,YAAY;CAC5D,MAAM,OAAO;AACb,MAAK,OAAO;CACZ,MAAM,EAAE,SAAS,SAAS,QAAQ,UAAU,oBAAoB,OAAO,KAClE;AACL,KAAI,OAAO,YAAY,SACnB,MAAK,YAAY;AACrB,KAAI,OAAO,YAAY,SACnB,MAAK,YAAY;AAErB,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;CACnC,MAAM,OAAO,IAAI,KAAK,IAAI,OAAO;AACjC,MAAK,MAAM,IAAI;AACf,KAAI,IAAI,OAAO,QACX,MAAK,YAAY,KAAK,MAAM,KAAK,UAAU,IAAI,aAAa,CAAC;;AAErE,MAAa,kBAAkB,QAAQ,KAAK,MAAM,WAAW;CACzD,MAAM,MAAM,OAAO,KAAK;AACxB,gCAAQ,IAAI,WAAW,KAAK,OAAO;CACnC,MAAM,OAAO,IAAI,KAAK,IAAI,OAAO;AACjC,MAAK,MAAM,IAAI;CACf,IAAI;AACJ,KAAI;AACA,eAAa,IAAI,WAAW,OAAU;SAEpC;AACF,QAAM,IAAI,MAAM,wDAAwD;;AAE5E,MAAK,UAAU;;AAEnB,MAAa,iBAAiB,QAAQ,KAAK,OAAO,WAAW;CACzD,MAAM,MAAM,OAAO,KAAK;CACxB,MAAM,YAAY,IAAI,OAAO,UAAW,IAAI,GAAG,KAAK,IAAI,SAAS,cAAc,IAAI,MAAM,IAAI,KAAM,IAAI;AACvG,gCAAQ,WAAW,KAAK,OAAO;CAC/B,MAAM,OAAO,IAAI,KAAK,IAAI,OAAO;AACjC,MAAK,MAAM;;AAEf,MAAa,qBAAqB,QAAQ,KAAK,MAAM,WAAW;CAC5D,MAAM,MAAM,OAAO,KAAK;AACxB,gCAAQ,IAAI,WAAW,KAAK,OAAO;CACnC,MAAM,OAAO,IAAI,KAAK,IAAI,OAAO;AACjC,MAAK,MAAM,IAAI;AACf,MAAK,WAAW;;AAQpB,MAAa,qBAAqB,QAAQ,KAAK,OAAO,WAAW;CAC7D,MAAM,MAAM,OAAO,KAAK;AACxB,gCAAQ,IAAI,WAAW,KAAK,OAAO;CACnC,MAAM,OAAO,IAAI,KAAK,IAAI,OAAO;AACjC,MAAK,MAAM,IAAI"}
@@ -0,0 +1,123 @@
1
+ const require_core = require('./core.cjs');
2
+ const require_util = require('./util.cjs');
3
+ const require_errors = require('./errors.cjs');
4
+
5
+ //#region ../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/parse.js
6
+ const _parse = (_Err) => (schema, value, _ctx, _params) => {
7
+ const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
8
+ const result = schema._zod.run({
9
+ value,
10
+ issues: []
11
+ }, ctx);
12
+ if (result instanceof Promise) throw new require_core.$ZodAsyncError();
13
+ if (result.issues.length) {
14
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => require_util.finalizeIssue(iss, ctx, require_core.config())));
15
+ require_util.captureStackTrace(e, _params?.callee);
16
+ throw e;
17
+ }
18
+ return result.value;
19
+ };
20
+ const parse = /* @__PURE__ */ _parse(require_errors.$ZodRealError);
21
+ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
22
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
23
+ let result = schema._zod.run({
24
+ value,
25
+ issues: []
26
+ }, ctx);
27
+ if (result instanceof Promise) result = await result;
28
+ if (result.issues.length) {
29
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => require_util.finalizeIssue(iss, ctx, require_core.config())));
30
+ require_util.captureStackTrace(e, params?.callee);
31
+ throw e;
32
+ }
33
+ return result.value;
34
+ };
35
+ const parseAsync = /* @__PURE__ */ _parseAsync(require_errors.$ZodRealError);
36
+ const _safeParse = (_Err) => (schema, value, _ctx) => {
37
+ const ctx = _ctx ? {
38
+ ..._ctx,
39
+ async: false
40
+ } : { async: false };
41
+ const result = schema._zod.run({
42
+ value,
43
+ issues: []
44
+ }, ctx);
45
+ if (result instanceof Promise) throw new require_core.$ZodAsyncError();
46
+ return result.issues.length ? {
47
+ success: false,
48
+ error: new (_Err ?? require_errors.$ZodError)(result.issues.map((iss) => require_util.finalizeIssue(iss, ctx, require_core.config())))
49
+ } : {
50
+ success: true,
51
+ data: result.value
52
+ };
53
+ };
54
+ const safeParse = /* @__PURE__ */ _safeParse(require_errors.$ZodRealError);
55
+ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
56
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
57
+ let result = schema._zod.run({
58
+ value,
59
+ issues: []
60
+ }, ctx);
61
+ if (result instanceof Promise) result = await result;
62
+ return result.issues.length ? {
63
+ success: false,
64
+ error: new _Err(result.issues.map((iss) => require_util.finalizeIssue(iss, ctx, require_core.config())))
65
+ } : {
66
+ success: true,
67
+ data: result.value
68
+ };
69
+ };
70
+ const safeParseAsync = /* @__PURE__ */ _safeParseAsync(require_errors.$ZodRealError);
71
+ const _encode = (_Err) => (schema, value, _ctx) => {
72
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
73
+ return _parse(_Err)(schema, value, ctx);
74
+ };
75
+ const encode = /* @__PURE__ */ _encode(require_errors.$ZodRealError);
76
+ const _decode = (_Err) => (schema, value, _ctx) => {
77
+ return _parse(_Err)(schema, value, _ctx);
78
+ };
79
+ const decode = /* @__PURE__ */ _decode(require_errors.$ZodRealError);
80
+ const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
81
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
82
+ return _parseAsync(_Err)(schema, value, ctx);
83
+ };
84
+ const encodeAsync = /* @__PURE__ */ _encodeAsync(require_errors.$ZodRealError);
85
+ const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
86
+ return _parseAsync(_Err)(schema, value, _ctx);
87
+ };
88
+ const decodeAsync = /* @__PURE__ */ _decodeAsync(require_errors.$ZodRealError);
89
+ const _safeEncode = (_Err) => (schema, value, _ctx) => {
90
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
91
+ return _safeParse(_Err)(schema, value, ctx);
92
+ };
93
+ const safeEncode = /* @__PURE__ */ _safeEncode(require_errors.$ZodRealError);
94
+ const _safeDecode = (_Err) => (schema, value, _ctx) => {
95
+ return _safeParse(_Err)(schema, value, _ctx);
96
+ };
97
+ const safeDecode = /* @__PURE__ */ _safeDecode(require_errors.$ZodRealError);
98
+ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
99
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
100
+ return _safeParseAsync(_Err)(schema, value, ctx);
101
+ };
102
+ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(require_errors.$ZodRealError);
103
+ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
104
+ return _safeParseAsync(_Err)(schema, value, _ctx);
105
+ };
106
+ const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(require_errors.$ZodRealError);
107
+
108
+ //#endregion
109
+ exports._decode = _decode;
110
+ exports._decodeAsync = _decodeAsync;
111
+ exports._encode = _encode;
112
+ exports._encodeAsync = _encodeAsync;
113
+ exports._parse = _parse;
114
+ exports._parseAsync = _parseAsync;
115
+ exports._safeDecode = _safeDecode;
116
+ exports._safeDecodeAsync = _safeDecodeAsync;
117
+ exports._safeEncode = _safeEncode;
118
+ exports._safeEncodeAsync = _safeEncodeAsync;
119
+ exports._safeParse = _safeParse;
120
+ exports._safeParseAsync = _safeParseAsync;
121
+ exports.safeParse = safeParse;
122
+ exports.safeParseAsync = safeParseAsync;
123
+ //# sourceMappingURL=parse.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.cjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/parse.js"],"sourcesContent":["import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAGA,MAAa,UAAU,UAAU,QAAQ,OAAO,MAAM,YAAY;CAC9D,MAAM,MAAM,OAAO,OAAO,OAAO,MAAM,EAAE,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO,OAAO;CAC3E,MAAM,SAAS,OAAO,KAAK,IAAI;EAAE;EAAO,QAAQ,EAAE;EAAE,EAAE,IAAI;AAC1D,KAAI,kBAAkB,QAClB,OAAM,iCAAyB;AAEnC,KAAI,OAAO,OAAO,QAAQ;EACtB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IAAI;;AAE/C,MAAa,aAA4B,yDAAiC;AAC1E,MAAa,eAAe,UAAU,QAAQ,OAAO,SAAS;AAC1D,QAAO,WAAW,KAAK,CAAC,QAAQ,OAAO,KAAK;;AAEhD,MAAa,aAA4B,yDAAiC;AAC1E,MAAa,oBAAoB,SAAS,OAAO,QAAQ,OAAO,SAAS;CACrE,MAAM,MAAM,OAAO,OAAO,OAAO,MAAM,EAAE,WAAW,YAAY,CAAC,GAAG,EAAE,WAAW,YAAY;AAC7F,QAAO,gBAAgB,KAAK,CAAC,QAAQ,OAAO,IAAI;;AAEpD,MAAa,kBAAiC,8DAAsC;AACpF,MAAa,oBAAoB,SAAS,OAAO,QAAQ,OAAO,SAAS;AACrE,QAAO,gBAAgB,KAAK,CAAC,QAAQ,OAAO,KAAK;;AAErD,MAAa,kBAAiC,8DAAsC"}
@@ -0,0 +1,88 @@
1
+
2
+ //#region ../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/regexes.js
3
+ const cuid = /^[cC][^\s-]{8,}$/;
4
+ const cuid2 = /^[0-9a-z]+$/;
5
+ const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
6
+ const xid = /^[0-9a-vA-V]{20}$/;
7
+ const ksuid = /^[A-Za-z0-9]{27}$/;
8
+ const nanoid = /^[a-zA-Z0-9_-]{21}$/;
9
+ /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
10
+ const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
11
+ /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
12
+ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
13
+ /** Returns a regex for validating an RFC 9562/4122 UUID.
14
+ *
15
+ * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
16
+ const uuid = (version) => {
17
+ if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
18
+ return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
19
+ };
20
+ /** Practical email validation */
21
+ const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
22
+ const _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
23
+ function emoji() {
24
+ return new RegExp(_emoji, "u");
25
+ }
26
+ const ipv4 = /^(?:(?: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])$/;
27
+ const ipv6 = /^(([0-9a-fA-F]{1,4}:){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}|:))$/;
28
+ const cidrv4 = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/;
29
+ const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
30
+ const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
31
+ const base64url = /^[A-Za-z0-9_-]*$/;
32
+ const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
33
+ const dateSource = `(?:(?:\\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])))`;
34
+ const date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
35
+ function timeSource(args) {
36
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
37
+ return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
38
+ }
39
+ function time(args) {
40
+ return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`);
41
+ }
42
+ function datetime(args) {
43
+ const time$1 = timeSource({ precision: args.precision });
44
+ const opts = ["Z"];
45
+ if (args.local) opts.push("");
46
+ if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
47
+ const timeRegex = `${time$1}(?:${opts.join("|")})`;
48
+ return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`);
49
+ }
50
+ const string = (params) => {
51
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
52
+ return /* @__PURE__ */ new RegExp(`^${regex}$`);
53
+ };
54
+ const integer = /^-?\d+$/;
55
+ const number = /^-?\d+(?:\.\d+)?/;
56
+ const boolean = /^(?:true|false)$/i;
57
+ const lowercase = /^[^A-Z]*$/;
58
+ const uppercase = /^[^a-z]*$/;
59
+
60
+ //#endregion
61
+ exports.base64 = base64;
62
+ exports.base64url = base64url;
63
+ exports.boolean = boolean;
64
+ exports.cidrv4 = cidrv4;
65
+ exports.cidrv6 = cidrv6;
66
+ exports.cuid = cuid;
67
+ exports.cuid2 = cuid2;
68
+ exports.date = date;
69
+ exports.datetime = datetime;
70
+ exports.duration = duration;
71
+ exports.e164 = e164;
72
+ exports.email = email;
73
+ exports.emoji = emoji;
74
+ exports.guid = guid;
75
+ exports.integer = integer;
76
+ exports.ipv4 = ipv4;
77
+ exports.ipv6 = ipv6;
78
+ exports.ksuid = ksuid;
79
+ exports.lowercase = lowercase;
80
+ exports.nanoid = nanoid;
81
+ exports.number = number;
82
+ exports.string = string;
83
+ exports.time = time;
84
+ exports.ulid = ulid;
85
+ exports.uppercase = uppercase;
86
+ exports.uuid = uuid;
87
+ exports.xid = xid;
88
+ //# sourceMappingURL=regexes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regexes.cjs","names":["time"],"sources":["../../../../../../../../../../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/regexes.js"],"sourcesContent":["import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?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)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[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])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[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])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?: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])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){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}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((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])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\nexport const e164 = /^\\+(?:[0-9]){6,14}[0-9]$/;\n// const dateSource = `((\\\\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])))`;\nconst dateSource = `(?:(?:\\\\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])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n"],"x_google_ignoreList":[0],"mappings":";;AACA,MAAa,OAAO;AACpB,MAAa,QAAQ;AACrB,MAAa,OAAO;AACpB,MAAa,MAAM;AACnB,MAAa,QAAQ;AACrB,MAAa,SAAS;;AAEtB,MAAa,WAAW;;AAIxB,MAAa,OAAO;;;;AAIpB,MAAa,QAAQ,YAAY;AAC7B,KAAI,CAAC,QACD,QAAO;AACX,wBAAO,IAAI,OAAO,mCAAmC,QAAQ,yDAAyD;;;AAM1H,MAAa,QAAQ;AAUrB,MAAM,SAAS;AACf,SAAgB,QAAQ;AACpB,QAAO,IAAI,OAAO,QAAQ,IAAI;;AAElC,MAAa,OAAO;AACpB,MAAa,OAAO;AAKpB,MAAa,SAAS;AACtB,MAAa,SAAS;AAEtB,MAAa,SAAS;AACtB,MAAa,YAAY;AAMzB,MAAa,OAAO;AAEpB,MAAM,aAAa;AACnB,MAAa,uBAAqB,IAAI,OAAO,IAAI,WAAW,GAAG;AAC/D,SAAS,WAAW,MAAM;CACtB,MAAM,OAAO;AAQb,QAPc,OAAO,KAAK,cAAc,WAClC,KAAK,cAAc,KACf,GAAG,SACH,KAAK,cAAc,IAC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