@mastra/schema-compat 1.2.6-alpha.0 → 1.2.6-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { toStandardSchema, standardSchemaToJSONSchema, isStandardSchemaWithJSON } from './chunk-M46NFEVC.js';
2
- export { JSON_SCHEMA_LIBRARY_OPTIONS, isStandardJSONSchema, isStandardSchema, isStandardSchemaWithJSON, standardSchemaToJSONSchema, toStandardSchema } from './chunk-M46NFEVC.js';
1
+ import { toStandardSchema, standardSchemaToJSONSchema, isStandardSchemaWithJSON } from './chunk-OA5IWMRF.js';
2
+ export { JSON_SCHEMA_LIBRARY_OPTIONS, isStandardJSONSchema, isStandardSchema, isStandardSchemaWithJSON, standardSchemaToJSONSchema, toStandardSchema } from './chunk-OA5IWMRF.js';
3
3
  import { zodToJsonSchema, ensureAllPropertiesRequired } from './chunk-7ZCSAPV3.js';
4
4
  export { ensureAllPropertiesRequired, prepareJsonSchemaForOpenAIStrictMode } from './chunk-7ZCSAPV3.js';
5
5
  import { require_json_schema_traverse } from './chunk-K7I3YXWP.js';
@@ -5127,7 +5127,13 @@ var SchemaCompatLayer3 = class {
5127
5127
  * Uses 'input' io mode so that fields with defaults are optional (appropriate for tool parameters).
5128
5128
  */
5129
5129
  toJSONSchema(zodSchema2) {
5130
- const target = this.getSchemaTarget() === "jsonSchema7" ? "draft-07" : this.getSchemaTarget();
5130
+ const SCHEMA_TARGET_TO_STANDARD = {
5131
+ jsonSchema7: "draft-07",
5132
+ "jsonSchema2019-09": "draft-2020-12",
5133
+ openApi3: "openapi-3.0"
5134
+ };
5135
+ const schemaTarget = this.getSchemaTarget();
5136
+ const target = (schemaTarget && SCHEMA_TARGET_TO_STANDARD[schemaTarget]) ?? schemaTarget;
5131
5137
  const standardSchema = toStandardSchema(zodSchema2);
5132
5138
  const jsonSchema2 = standardSchemaToJSONSchema(standardSchema, {
5133
5139
  target,