@mastra/deployer 1.80.0-alpha.3 → 1.80.0-alpha.4
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.
- package/dist/{analyze-jJAydlIl.cjs → analyze-DkUevkqw.cjs} +19 -33
- package/dist/analyze-DkUevkqw.cjs.map +1 -0
- package/dist/{analyze-DhTwbIGn.js → analyze-N_10x6cl.js} +18 -32
- package/dist/analyze-N_10x6cl.js.map +1 -0
- package/dist/arktype-aI7TBD0R-CA70n59_.cjs +7 -0
- package/dist/{arktype-aI7TBD0R-LEyxmA2b.cjs.map → arktype-aI7TBD0R-CA70n59_.cjs.map} +1 -1
- package/dist/arktype-aI7TBD0R-cDMJgbIj.js +7 -0
- package/dist/{arktype-aI7TBD0R-CrIkuKY8.js.map → arktype-aI7TBD0R-cDMJgbIj.js.map} +1 -1
- package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
- package/dist/build/analyze.cjs +1 -1
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +1 -1
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +6 -6
- package/dist/build/index.js +6 -6
- package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
- package/dist/{build-ClcuWPJW.cjs → build-28_5Hdpz.cjs} +16 -25
- package/dist/build-28_5Hdpz.cjs.map +1 -0
- package/dist/{build-Ch38BMkf.js → build-C9-UsBG6.js} +15 -24
- package/dist/build-C9-UsBG6.js.map +1 -0
- package/dist/bundler/index.cjs +8 -11
- package/dist/bundler/index.cjs.map +1 -1
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +7 -10
- package/dist/bundler/index.js.map +1 -1
- package/dist/{bundler-Xbu98oe6.js → bundler-D3Ky7WCf.js} +15 -27
- package/dist/{bundler-Xbu98oe6.js.map → bundler-D3Ky7WCf.js.map} +1 -1
- package/dist/{bundler-3xwX-u2Y.cjs → bundler-D_3GyN0N.cjs} +16 -28
- package/dist/{bundler-3xwX-u2Y.cjs.map → bundler-D_3GyN0N.cjs.map} +1 -1
- package/dist/{bundlerOptions-lxkzE0Jg.js → bundlerOptions-BtDsaIgs.js} +9 -15
- package/dist/{bundlerOptions-lxkzE0Jg.js.map → bundlerOptions-BtDsaIgs.js.map} +1 -1
- package/dist/{bundlerOptions-DVHKdYsv.cjs → bundlerOptions-Dgt4ZEo1.cjs} +10 -16
- package/dist/{bundlerOptions-DVHKdYsv.cjs.map → bundlerOptions-Dgt4ZEo1.cjs.map} +1 -1
- package/dist/{core-75DLMtZL.js → core-DM6JYCRs.js} +7 -13
- package/dist/{core-75DLMtZL.js.map → core-DM6JYCRs.js.map} +1 -1
- package/dist/{core-XnTfh3E_.cjs → core-Dw6oRE58.cjs} +7 -13
- package/dist/{core-XnTfh3E_.cjs.map → core-Dw6oRE58.cjs.map} +1 -1
- package/dist/{dist-IbfljCaD.cjs → dist-4VwpGp6C.cjs} +2 -3
- package/dist/{dist-IbfljCaD.cjs.map → dist-4VwpGp6C.cjs.map} +1 -1
- package/dist/{dist-CQdaZ_Cj.js → dist-CId9bb_J.js} +2 -3
- package/dist/{dist-CQdaZ_Cj.js.map → dist-CId9bb_J.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-deployment-mastra-server.md +2 -0
- package/dist/docs/references/docs-deployment-monorepo.md +2 -0
- package/dist/docs/references/reference-deployer.md +6 -3
- package/dist/effect-QlVUlMFu-AhgmGdMj.cjs +13 -0
- package/dist/{effect-QlVUlMFu-D_Bo06-a.cjs.map → effect-QlVUlMFu-AhgmGdMj.cjs.map} +1 -1
- package/dist/effect-QlVUlMFu-BUdj03Tb.js +13 -0
- package/dist/{effect-QlVUlMFu-CgfR_0ad.js.map → effect-QlVUlMFu-BUdj03Tb.js.map} +1 -1
- package/dist/{esm-ClsnEB2d.js → esm-CTYQPwZr.js} +45 -89
- package/dist/{esm-ClsnEB2d.js.map → esm-CTYQPwZr.js.map} +1 -1
- package/dist/{esm-D74qc_jV.cjs → esm-DCHnJS63.cjs} +45 -89
- package/dist/{esm-D74qc_jV.cjs.map → esm-DCHnJS63.cjs.map} +1 -1
- package/dist/{index-CLddUTqr-CgjYL5XV.cjs → index-CLddUTqr-CeV0aeBL.cjs} +9 -11
- package/dist/{index-CLddUTqr-CgjYL5XV.cjs.map → index-CLddUTqr-CeV0aeBL.cjs.map} +1 -1
- package/dist/{index-CLddUTqr-73bY0Z8P.js → index-CLddUTqr-FaVhUOQu.js} +9 -11
- package/dist/{index-CLddUTqr-73bY0Z8P.js.map → index-CLddUTqr-FaVhUOQu.js.map} +1 -1
- package/dist/index.cjs +5 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/{rolldown-runtime-Gi87jfEt.cjs → rolldown-runtime-Bc0pwXKd.cjs} +1 -2
- package/dist/server/index.cjs +27 -49
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +26 -48
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.cjs +1 -1
- package/dist/services/index.js +1 -1
- package/dist/{services-DahfG_xq.js → services-BJQJLQs9.js} +5 -9
- package/dist/{services-DahfG_xq.js.map → services-BJQJLQs9.js.map} +1 -1
- package/dist/{services-CCa8HFrE.cjs → services-Dqx1iouv.cjs} +6 -10
- package/dist/{services-CCa8HFrE.cjs.map → services-Dqx1iouv.cjs.map} +1 -1
- package/dist/sury-CWZTCd75-CEZXDAeW.cjs +13 -0
- package/dist/{sury-CWZTCd75-BmWsp9y9.cjs.map → sury-CWZTCd75-CEZXDAeW.cjs.map} +1 -1
- package/dist/sury-CWZTCd75-DOXpSi96.js +13 -0
- package/dist/{sury-CWZTCd75-DiZVb8bZ.js.map → sury-CWZTCd75-DOXpSi96.js.map} +1 -1
- package/dist/typebox-Dei93FPO-BOIkUnIO.js +7 -0
- package/dist/{typebox-Dei93FPO-CwpAqpd5.js.map → typebox-Dei93FPO-BOIkUnIO.js.map} +1 -1
- package/dist/typebox-Dei93FPO-Br8qsfny.cjs +7 -0
- package/dist/{typebox-Dei93FPO-Dv_TSG2I.cjs.map → typebox-Dei93FPO-Br8qsfny.cjs.map} +1 -1
- package/dist/{utils-Bl3Lm7SI.js → utils-C8gwr-ur.js} +2 -3
- package/dist/{utils-Bl3Lm7SI.js.map → utils-C8gwr-ur.js.map} +1 -1
- package/dist/{utils-C-gJcJAo.cjs → utils-CDNA_ewa.cjs} +2 -3
- package/dist/{utils-C-gJcJAo.cjs.map → utils-CDNA_ewa.cjs.map} +1 -1
- package/dist/valibot--1zFm7rT-B84p7SXG.cjs +13 -0
- package/dist/{valibot--1zFm7rT-YckVXzoz.cjs.map → valibot--1zFm7rT-B84p7SXG.cjs.map} +1 -1
- package/dist/valibot--1zFm7rT-BD4syL2V.js +13 -0
- package/dist/{valibot--1zFm7rT-BfSX2bry.js.map → valibot--1zFm7rT-BD4syL2V.js.map} +1 -1
- package/dist/validator/custom-resolver.cjs +2 -3
- package/dist/validator/custom-resolver.js +2 -3
- package/dist/validator/loader.cjs +1 -2
- package/dist/validator/loader.js +1 -2
- package/dist/validator/validate.d.ts.map +1 -1
- package/dist/zod-Bwrt9trS-0iZO7FLc.js +22 -0
- package/dist/{zod-Bwrt9trS-CO1V3tYt.js.map → zod-Bwrt9trS-0iZO7FLc.js.map} +1 -1
- package/dist/{zod-Bwrt9trS-CdR6J7TM.cjs → zod-Bwrt9trS-BoI5Bg-K.cjs} +5 -6
- package/dist/{zod-Bwrt9trS-CdR6J7TM.cjs.map → zod-Bwrt9trS-BoI5Bg-K.cjs.map} +1 -1
- package/package.json +27 -27
- package/dist/analyze-DhTwbIGn.js.map +0 -1
- package/dist/analyze-jJAydlIl.cjs.map +0 -1
- package/dist/arktype-aI7TBD0R-CrIkuKY8.js +0 -8
- package/dist/arktype-aI7TBD0R-LEyxmA2b.cjs +0 -8
- package/dist/build-Ch38BMkf.js.map +0 -1
- package/dist/build-ClcuWPJW.cjs.map +0 -1
- package/dist/effect-QlVUlMFu-CgfR_0ad.js +0 -14
- package/dist/effect-QlVUlMFu-D_Bo06-a.cjs +0 -14
- package/dist/sury-CWZTCd75-BmWsp9y9.cjs +0 -14
- package/dist/sury-CWZTCd75-DiZVb8bZ.js +0 -14
- package/dist/typebox-Dei93FPO-CwpAqpd5.js +0 -8
- package/dist/typebox-Dei93FPO-Dv_TSG2I.cjs +0 -8
- package/dist/valibot--1zFm7rT-BfSX2bry.js +0 -14
- package/dist/valibot--1zFm7rT-YckVXzoz.cjs +0 -14
- package/dist/zod-Bwrt9trS-CO1V3tYt.js +0 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/7a4480ae30573bca6c79fe2b0696ad0f7216b0ae992d31a770d2f560d22d2f98/node_modules/@valibot/to-json-schema/dist/index.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Adds an error message to the errors array.
|
|
4
4
|
*
|
|
@@ -680,7 +680,6 @@ function toJsonSchema(schema, config) {
|
|
|
680
680
|
if (context.referenceMap.size) jsonSchema.$defs = context.definitions;
|
|
681
681
|
return jsonSchema;
|
|
682
682
|
}
|
|
683
|
-
//#endregion
|
|
684
683
|
exports.toJsonSchema = toJsonSchema;
|
|
685
684
|
|
|
686
|
-
//# sourceMappingURL=dist-
|
|
685
|
+
//# sourceMappingURL=dist-4VwpGp6C.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-IbfljCaD.cjs","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/da8e5dfe6d777e6c5fbea87a5fac738e4a893332a460d7e4b8ed7828a422fa0c/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/utils/ReferenceMap.ts\n/**\n* Schema reference map with collision-free reference ID allocation.\n*/\nvar ReferenceMap = class extends Map {\n\t/**\n\t* Creates an empty schema reference map.\n\t*/\n\tconstructor() {\n\t\tsuper();\n\t\tthis.count = 0;\n\t\tthis.usedIds = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Adds a schema reference and reserves its ID.\n\t*\n\t* @param schema The Valibot schema.\n\t* @param referenceId The reference ID.\n\t*\n\t* @returns The reference map.\n\t*/\n\tset(schema, referenceId) {\n\t\tthis.usedIds.add(referenceId);\n\t\treturn super.set(schema, referenceId);\n\t}\n\t/**\n\t* Creates a reference ID that is not yet used.\n\t*\n\t* @param definitions The JSON Schema definitions.\n\t*\n\t* @returns The unused reference ID.\n\t*/\n\tcreateId(definitions) {\n\t\twhile (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;\n\t\treturn `${this.count++}`;\n\t}\n};\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Returns the stricter lower bound.\n*\n* @param current The current lower bound.\n* @param value The new lower bound.\n*\n* @returns The stricter lower bound.\n*/\nfunction getLowerBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value > current) return value;\n\treturn current;\n}\n/**\n* Returns the stricter upper bound.\n*\n* @param current The current upper bound.\n* @param value The new upper bound.\n*\n* @returns The stricter upper bound.\n*/\nfunction getUpperBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value < current) return value;\n\treturn current;\n}\n/**\n* Returns the combined not restriction.\n*\n* @param current The current not restriction.\n* @param value The new not restriction.\n*\n* @returns The combined not restriction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getNotRestriction(current, value) {\n\treturn current !== void 0 ? { anyOf: [current, value] } : value;\n}\n/**\n* Intersects allowed values with an existing enum restriction.\n*\n* @param jsonSchema The JSON Schema object.\n* @param values The allowed values.\n*/\nfunction intersectEnum(jsonSchema, values) {\n\tlet enumValues = jsonSchema.enum ?? values;\n\tif (jsonSchema.enum) {\n\t\tconst valueSet = new Set(values);\n\t\tenumValues = enumValues.filter((value) => valueSet.has(value));\n\t}\n\tif (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];\n\telse {\n\t\tdelete jsonSchema.enum;\n\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});\n\t}\n}\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"ksuid\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"gt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"lt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tfor (const key of Object.keys(valibotAction.metadata)) if (key !== \"title\" && key !== \"description\" && key !== \"examples\" && key !== \"__proto__\") jsonSchema[key] = valibotAction.metadata[key];\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === \"openapi-3.0\" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") intersectEnum(jsonSchema, [valibotAction.requirement]);\n\t\t\telse if (\"const\" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with a different \"const\" restriction.`);\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tintersectEnum(jsonSchema, valibotAction.requirement);\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\n/**\n* Returns the JSON Pointer reference for a definition key.\n*\n* @param referenceId The unescaped definition key.\n*\n* @returns The encoded JSON Pointer fragment.\n*/\nfunction getDefinitionRef(referenceId) {\n\treturn `#/$defs/${referenceId.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n}\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (!isJsonConstValue(valibotSchema.literal)) {\n\t\t\t\terrors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\tcase \"picklist\": {\n\t\t\tconst options = valibotSchema.options;\n\t\t\tif (!options.every((option) => typeof option === \"string\" || typeof option === \"number\" && Number.isFinite(option))) {\n\t\t\t\terrors = addError(errors, `An option of the \"${valibotSchema.type}\" schema is not JSON compatible.`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = options;\n\t\t\tif (options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = context.referenceMap.createId(context.definitions);\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GACJ,QAAQ,KAAK,OAAO;GACpB;EACD,SAAS,MAAM,IAAI,MAAM,OAAO;CACjC;AACD;;;;;;;;AAWA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,aAAa,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU;AAC9G;;;;;;;;AAWA,SAAS,iBAAiB,QAAQ;CACjC,OAAO,OAAO,MAAM,gBAAgB;AACrC;;;;AAOA,IAAI,eAAe,cAAc,IAAI;;;;CAIpC,cAAc;EACb,MAAM;EACN,KAAK,QAAQ;EACb,KAAK,0BAA0B,IAAI,IAAI;CACxC;;;;;;;;;CASA,IAAI,QAAQ,aAAa;EACxB,KAA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C1D,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"dist-4VwpGp6C.cjs","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/7a4480ae30573bca6c79fe2b0696ad0f7216b0ae992d31a770d2f560d22d2f98/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/utils/ReferenceMap.ts\n/**\n* Schema reference map with collision-free reference ID allocation.\n*/\nvar ReferenceMap = class extends Map {\n\t/**\n\t* Creates an empty schema reference map.\n\t*/\n\tconstructor() {\n\t\tsuper();\n\t\tthis.count = 0;\n\t\tthis.usedIds = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Adds a schema reference and reserves its ID.\n\t*\n\t* @param schema The Valibot schema.\n\t* @param referenceId The reference ID.\n\t*\n\t* @returns The reference map.\n\t*/\n\tset(schema, referenceId) {\n\t\tthis.usedIds.add(referenceId);\n\t\treturn super.set(schema, referenceId);\n\t}\n\t/**\n\t* Creates a reference ID that is not yet used.\n\t*\n\t* @param definitions The JSON Schema definitions.\n\t*\n\t* @returns The unused reference ID.\n\t*/\n\tcreateId(definitions) {\n\t\twhile (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;\n\t\treturn `${this.count++}`;\n\t}\n};\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Returns the stricter lower bound.\n*\n* @param current The current lower bound.\n* @param value The new lower bound.\n*\n* @returns The stricter lower bound.\n*/\nfunction getLowerBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value > current) return value;\n\treturn current;\n}\n/**\n* Returns the stricter upper bound.\n*\n* @param current The current upper bound.\n* @param value The new upper bound.\n*\n* @returns The stricter upper bound.\n*/\nfunction getUpperBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value < current) return value;\n\treturn current;\n}\n/**\n* Returns the combined not restriction.\n*\n* @param current The current not restriction.\n* @param value The new not restriction.\n*\n* @returns The combined not restriction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getNotRestriction(current, value) {\n\treturn current !== void 0 ? { anyOf: [current, value] } : value;\n}\n/**\n* Intersects allowed values with an existing enum restriction.\n*\n* @param jsonSchema The JSON Schema object.\n* @param values The allowed values.\n*/\nfunction intersectEnum(jsonSchema, values) {\n\tlet enumValues = jsonSchema.enum ?? values;\n\tif (jsonSchema.enum) {\n\t\tconst valueSet = new Set(values);\n\t\tenumValues = enumValues.filter((value) => valueSet.has(value));\n\t}\n\tif (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];\n\telse {\n\t\tdelete jsonSchema.enum;\n\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});\n\t}\n}\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"ksuid\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"gt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"lt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tfor (const key of Object.keys(valibotAction.metadata)) if (key !== \"title\" && key !== \"description\" && key !== \"examples\" && key !== \"__proto__\") jsonSchema[key] = valibotAction.metadata[key];\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === \"openapi-3.0\" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") intersectEnum(jsonSchema, [valibotAction.requirement]);\n\t\t\telse if (\"const\" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with a different \"const\" restriction.`);\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tintersectEnum(jsonSchema, valibotAction.requirement);\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\n/**\n* Returns the JSON Pointer reference for a definition key.\n*\n* @param referenceId The unescaped definition key.\n*\n* @returns The encoded JSON Pointer fragment.\n*/\nfunction getDefinitionRef(referenceId) {\n\treturn `#/$defs/${referenceId.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n}\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (!isJsonConstValue(valibotSchema.literal)) {\n\t\t\t\terrors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\tcase \"picklist\": {\n\t\t\tconst options = valibotSchema.options;\n\t\t\tif (!options.every((option) => typeof option === \"string\" || typeof option === \"number\" && Number.isFinite(option))) {\n\t\t\t\terrors = addError(errors, `An option of the \"${valibotSchema.type}\" schema is not JSON compatible.`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = options;\n\t\t\tif (options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = context.referenceMap.createId(context.definitions);\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GACJ,QAAQ,KAAK,OAAO;GACpB;EACD,SAAS,MAAM,IAAI,MAAM,OAAO;CACjC;AACD;;;;;;;;AAWA,SAAS,iBAAiB,OAAO;CAChC,OAA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,KAAK,MAAM,OAAO,aAAa,QAAQ,YAAY,OAAO,cAAc,CAAC,GAAG,YAAY,MAAM,QAAQ,SAAS,IAAI;CACpH;CACA,MAAM,aAAa,cAAc,CAAC,GAAG,QAAQ,QAAQ,OAAO;CAC5D,MAAM,SAAS,QAAQ,UAAU;CACjC,IAAI,WAAW,iBAAiB,WAAW,UAAU;MAChD,IAAI,WAAW,YAAY,WAAW,UAAU;CACrD,IAAI,QAAQ,aAAa,MAAM,WAAW,QAAQ,QAAQ;CAC1D,OAAO;AACR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/7a4480ae30573bca6c79fe2b0696ad0f7216b0ae992d31a770d2f560d22d2f98/node_modules/@valibot/to-json-schema/dist/index.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Adds an error message to the errors array.
|
|
4
4
|
*
|
|
@@ -680,7 +680,6 @@ function toJsonSchema(schema, config) {
|
|
|
680
680
|
if (context.referenceMap.size) jsonSchema.$defs = context.definitions;
|
|
681
681
|
return jsonSchema;
|
|
682
682
|
}
|
|
683
|
-
//#endregion
|
|
684
683
|
export { toJsonSchema };
|
|
685
684
|
|
|
686
|
-
//# sourceMappingURL=dist-
|
|
685
|
+
//# sourceMappingURL=dist-CId9bb_J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-CQdaZ_Cj.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/da8e5dfe6d777e6c5fbea87a5fac738e4a893332a460d7e4b8ed7828a422fa0c/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/utils/ReferenceMap.ts\n/**\n* Schema reference map with collision-free reference ID allocation.\n*/\nvar ReferenceMap = class extends Map {\n\t/**\n\t* Creates an empty schema reference map.\n\t*/\n\tconstructor() {\n\t\tsuper();\n\t\tthis.count = 0;\n\t\tthis.usedIds = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Adds a schema reference and reserves its ID.\n\t*\n\t* @param schema The Valibot schema.\n\t* @param referenceId The reference ID.\n\t*\n\t* @returns The reference map.\n\t*/\n\tset(schema, referenceId) {\n\t\tthis.usedIds.add(referenceId);\n\t\treturn super.set(schema, referenceId);\n\t}\n\t/**\n\t* Creates a reference ID that is not yet used.\n\t*\n\t* @param definitions The JSON Schema definitions.\n\t*\n\t* @returns The unused reference ID.\n\t*/\n\tcreateId(definitions) {\n\t\twhile (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;\n\t\treturn `${this.count++}`;\n\t}\n};\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Returns the stricter lower bound.\n*\n* @param current The current lower bound.\n* @param value The new lower bound.\n*\n* @returns The stricter lower bound.\n*/\nfunction getLowerBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value > current) return value;\n\treturn current;\n}\n/**\n* Returns the stricter upper bound.\n*\n* @param current The current upper bound.\n* @param value The new upper bound.\n*\n* @returns The stricter upper bound.\n*/\nfunction getUpperBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value < current) return value;\n\treturn current;\n}\n/**\n* Returns the combined not restriction.\n*\n* @param current The current not restriction.\n* @param value The new not restriction.\n*\n* @returns The combined not restriction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getNotRestriction(current, value) {\n\treturn current !== void 0 ? { anyOf: [current, value] } : value;\n}\n/**\n* Intersects allowed values with an existing enum restriction.\n*\n* @param jsonSchema The JSON Schema object.\n* @param values The allowed values.\n*/\nfunction intersectEnum(jsonSchema, values) {\n\tlet enumValues = jsonSchema.enum ?? values;\n\tif (jsonSchema.enum) {\n\t\tconst valueSet = new Set(values);\n\t\tenumValues = enumValues.filter((value) => valueSet.has(value));\n\t}\n\tif (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];\n\telse {\n\t\tdelete jsonSchema.enum;\n\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});\n\t}\n}\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"ksuid\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"gt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"lt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tfor (const key of Object.keys(valibotAction.metadata)) if (key !== \"title\" && key !== \"description\" && key !== \"examples\" && key !== \"__proto__\") jsonSchema[key] = valibotAction.metadata[key];\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === \"openapi-3.0\" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") intersectEnum(jsonSchema, [valibotAction.requirement]);\n\t\t\telse if (\"const\" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with a different \"const\" restriction.`);\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tintersectEnum(jsonSchema, valibotAction.requirement);\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\n/**\n* Returns the JSON Pointer reference for a definition key.\n*\n* @param referenceId The unescaped definition key.\n*\n* @returns The encoded JSON Pointer fragment.\n*/\nfunction getDefinitionRef(referenceId) {\n\treturn `#/$defs/${referenceId.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n}\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (!isJsonConstValue(valibotSchema.literal)) {\n\t\t\t\terrors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\tcase \"picklist\": {\n\t\t\tconst options = valibotSchema.options;\n\t\t\tif (!options.every((option) => typeof option === \"string\" || typeof option === \"number\" && Number.isFinite(option))) {\n\t\t\t\terrors = addError(errors, `An option of the \"${valibotSchema.type}\" schema is not JSON compatible.`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = options;\n\t\t\tif (options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = context.referenceMap.createId(context.definitions);\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GACJ,QAAQ,KAAK,OAAO;GACpB;EACD,SAAS,MAAM,IAAI,MAAM,OAAO;CACjC;AACD;;;;;;;;AAWA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,aAAa,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU;AAC9G;;;;;;;;AAWA,SAAS,iBAAiB,QAAQ;CACjC,OAAO,OAAO,MAAM,gBAAgB;AACrC;;;;AAOA,IAAI,eAAe,cAAc,IAAI;;;;CAIpC,cAAc;EACb,MAAM;EACN,KAAK,QAAQ;EACb,KAAK,0BAA0B,IAAI,IAAI;CACxC;;;;;;;;;CASA,IAAI,QAAQ,aAAa;EACxB,KAAK,QAAQ,IAAI,WAAW;EAC5B,OAAO,MAAM,IAAI,QAAQ,WAAW;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[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/7a4480ae30573bca6c79fe2b0696ad0f7216b0ae992d31a770d2f560d22d2f98/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/utils/ReferenceMap.ts\n/**\n* Schema reference map with collision-free reference ID allocation.\n*/\nvar ReferenceMap = class extends Map {\n\t/**\n\t* Creates an empty schema reference map.\n\t*/\n\tconstructor() {\n\t\tsuper();\n\t\tthis.count = 0;\n\t\tthis.usedIds = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Adds a schema reference and reserves its ID.\n\t*\n\t* @param schema The Valibot schema.\n\t* @param referenceId The reference ID.\n\t*\n\t* @returns The reference map.\n\t*/\n\tset(schema, referenceId) {\n\t\tthis.usedIds.add(referenceId);\n\t\treturn super.set(schema, referenceId);\n\t}\n\t/**\n\t* Creates a reference ID that is not yet used.\n\t*\n\t* @param definitions The JSON Schema definitions.\n\t*\n\t* @returns The unused reference ID.\n\t*/\n\tcreateId(definitions) {\n\t\twhile (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;\n\t\treturn `${this.count++}`;\n\t}\n};\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Returns the stricter lower bound.\n*\n* @param current The current lower bound.\n* @param value The new lower bound.\n*\n* @returns The stricter lower bound.\n*/\nfunction getLowerBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value > current) return value;\n\treturn current;\n}\n/**\n* Returns the stricter upper bound.\n*\n* @param current The current upper bound.\n* @param value The new upper bound.\n*\n* @returns The stricter upper bound.\n*/\nfunction getUpperBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value < current) return value;\n\treturn current;\n}\n/**\n* Returns the combined not restriction.\n*\n* @param current The current not restriction.\n* @param value The new not restriction.\n*\n* @returns The combined not restriction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getNotRestriction(current, value) {\n\treturn current !== void 0 ? { anyOf: [current, value] } : value;\n}\n/**\n* Intersects allowed values with an existing enum restriction.\n*\n* @param jsonSchema The JSON Schema object.\n* @param values The allowed values.\n*/\nfunction intersectEnum(jsonSchema, values) {\n\tlet enumValues = jsonSchema.enum ?? values;\n\tif (jsonSchema.enum) {\n\t\tconst valueSet = new Set(values);\n\t\tenumValues = enumValues.filter((value) => valueSet.has(value));\n\t}\n\tif (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];\n\telse {\n\t\tdelete jsonSchema.enum;\n\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});\n\t}\n}\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"ksuid\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"gt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"lt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tfor (const key of Object.keys(valibotAction.metadata)) if (key !== \"title\" && key !== \"description\" && key !== \"examples\" && key !== \"__proto__\") jsonSchema[key] = valibotAction.metadata[key];\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === \"openapi-3.0\" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") intersectEnum(jsonSchema, [valibotAction.requirement]);\n\t\t\telse if (\"const\" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with a different \"const\" restriction.`);\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tintersectEnum(jsonSchema, valibotAction.requirement);\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\n/**\n* Returns the JSON Pointer reference for a definition key.\n*\n* @param referenceId The unescaped definition key.\n*\n* @returns The encoded JSON Pointer fragment.\n*/\nfunction getDefinitionRef(referenceId) {\n\treturn `#/$defs/${referenceId.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n}\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (!isJsonConstValue(valibotSchema.literal)) {\n\t\t\t\terrors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\tcase \"picklist\": {\n\t\t\tconst options = valibotSchema.options;\n\t\t\tif (!options.every((option) => typeof option === \"string\" || typeof option === \"number\" && Number.isFinite(option))) {\n\t\t\t\terrors = addError(errors, `An option of the \"${valibotSchema.type}\" schema is not JSON compatible.`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = options;\n\t\t\tif (options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = context.referenceMap.createId(context.definitions);\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GACJ,QAAQ,KAAK,OAAO;GACpB;EACD,SAAS,MAAM,IAAI,MAAM,OAAO;CACjC;AACD;;;;;;;;AAWA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,aAAa,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,O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AAY,MAAM,QAAQ,SAAS,IAAI;CACpH;CACA,MAAM,aAAa,cAAc,CAAC,GAAG,QAAQ,QAAQ,OAAO;CAC5D,MAAM,SAAS,QAAQ,UAAU;CACjC,IAAI,WAAW,iBAAiB,WAAW,UAAU;MAChD,IAAI,WAAW,YAAY,WAAW,UAAU;CACrD,IAAI,QAAQ,aAAa,MAAM,WAAW,QAAQ,QAAQ;CAC1D,OAAO;AACR"}
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-deployer
|
|
|
3
3
|
description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/deployer"
|
|
6
|
-
version: "1.80.0-alpha.
|
|
6
|
+
version: "1.80.0-alpha.4"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -85,6 +85,8 @@ export const mastra = new Mastra({
|
|
|
85
85
|
The value of each option can come from a variable, import, or function call. The option itself must remain a direct property. Don't hide build-time options behind a factory call or an object spread:
|
|
86
86
|
|
|
87
87
|
```typescript
|
|
88
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
89
|
+
|
|
88
90
|
const options = {
|
|
89
91
|
bundler: {
|
|
90
92
|
externals: ['sharp'],
|
|
@@ -92,6 +92,8 @@ When your Mastra application imports from other workspace packages, Mastra handl
|
|
|
92
92
|
For most setups, this works without configuration. If you encounter issues with workspace package imports, add the package to [`transpilePackages`](https://mastra.ai/reference/configuration):
|
|
93
93
|
|
|
94
94
|
```typescript
|
|
95
|
+
import { Mastra } from '@mastra/core'
|
|
96
|
+
|
|
95
97
|
export const mastra = new Mastra({
|
|
96
98
|
bundler: {
|
|
97
99
|
transpilePackages: ['@my-org/utils'],
|
|
@@ -23,7 +23,10 @@ class CustomDeployer extends Deployer {
|
|
|
23
23
|
await this.prepare(outputDirectory)
|
|
24
24
|
|
|
25
25
|
// Bundle the application
|
|
26
|
-
await this._bundle('server.ts', 'mastra.ts',
|
|
26
|
+
await this._bundle('server.ts', 'mastra.ts', {
|
|
27
|
+
projectRoot: process.cwd(),
|
|
28
|
+
outputDirectory,
|
|
29
|
+
})
|
|
27
30
|
|
|
28
31
|
// Custom deployment logic
|
|
29
32
|
}
|
|
@@ -54,9 +57,9 @@ The Deployer class inherits the following key methods from the Bundler class:
|
|
|
54
57
|
|
|
55
58
|
**prepare** (`(outputDirectory: string) => Promise<void>`): Prepares the output directory by cleaning it and creating necessary subdirectories.
|
|
56
59
|
|
|
57
|
-
**writePackageJson** (`(outputDirectory: string, dependencies: Map<string, string>) => Promise<void>`): Generates a package.json file in the output directory with the specified dependencies.
|
|
60
|
+
**writePackageJson** (`(outputDirectory: string, dependencies: Map<string, string | ExternalDependencyInfo>, resolutions?: Record<string, string>) => Promise<void>`): Generates a package.json file in the output directory with the specified dependencies. When resolutions is non-empty, it is written to the resolutions field.
|
|
58
61
|
|
|
59
|
-
**\_bundle** (`(serverFile: string, mastraEntryFile: string, outputDirectory: string, bundleLocation?: string) => Promise<void>`): Bundles the application using the specified server and Mastra entry files.
|
|
62
|
+
**\_bundle** (`(serverFile: string, mastraEntryFile: string, options: { projectRoot: string; outputDirectory: string; enableEsmShim?: boolean; alias?: Record<string, string> }, toolsPaths?: (string | string[])[], bundleLocation?: string) => Promise<void>`): Bundles the application using the specified server and Mastra entry files. bundleLocation defaults to the bundler output directory inside options.outputDirectory.
|
|
60
63
|
|
|
61
64
|
## Core concepts
|
|
62
65
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_index_CLddUTqr = require("./index-CLddUTqr-CeV0aeBL.cjs");
|
|
2
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.7/40b278604ed4c7b1ed4ec3230f494f37aaa93a9e03a609e7c6039a8f944503ff/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js
|
|
3
|
+
async function getToJsonSchemaFn() {
|
|
4
|
+
try {
|
|
5
|
+
const { JSONSchema } = await import("effect");
|
|
6
|
+
return (schema) => JSONSchema.make(schema);
|
|
7
|
+
} catch {
|
|
8
|
+
throw new require_index_CLddUTqr.MissingDependencyError("effect");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.default = getToJsonSchemaFn;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=effect-QlVUlMFu-AhgmGdMj.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect-QlVUlMFu-
|
|
1
|
+
{"version":3,"file":"effect-QlVUlMFu-AhgmGdMj.cjs","names":["MissingDependencyError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.7/40b278604ed4c7b1ed4ec3230f494f37aaa93a9e03a609e7c6039a8f944503ff/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,QAAQ,WAAW,WAAW,KAAK,MAAM;CAC3C,QAAQ;EACN,MAAM,IAAIA,uBAAAA,uBAAuB,QAAQ;CAC3C;AACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as MissingDependencyError } from "./index-CLddUTqr-FaVhUOQu.js";
|
|
2
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.7/40b278604ed4c7b1ed4ec3230f494f37aaa93a9e03a609e7c6039a8f944503ff/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js
|
|
3
|
+
async function getToJsonSchemaFn() {
|
|
4
|
+
try {
|
|
5
|
+
const { JSONSchema } = await import("effect");
|
|
6
|
+
return (schema) => JSONSchema.make(schema);
|
|
7
|
+
} catch {
|
|
8
|
+
throw new MissingDependencyError("effect");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { getToJsonSchemaFn as default };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=effect-QlVUlMFu-BUdj03Tb.js.map
|