@trigger.dev/schema-to-json 4.5.16 → 4.6.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/commonjs/index.js +61 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/index.js +61 -12
- package/dist/esm/index.js.map +1 -1
- package/package.json +6 -4
package/dist/commonjs/index.js
CHANGED
|
@@ -37,7 +37,7 @@ exports.schemaToJsonSchema = schemaToJsonSchema;
|
|
|
37
37
|
exports.canConvertSchema = canConvertSchema;
|
|
38
38
|
exports.isZodSchema = isZodSchema;
|
|
39
39
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
40
|
-
const z4 = __importStar(require("zod/v4"));
|
|
40
|
+
const z4 = __importStar(require("zod/v4/core"));
|
|
41
41
|
const yup_to_json_schema_1 = require("@sodaru/yup-to-json-schema");
|
|
42
42
|
const effect_1 = require("effect");
|
|
43
43
|
/**
|
|
@@ -53,8 +53,19 @@ const effect_1 = require("effect");
|
|
|
53
53
|
* @returns The conversion result or undefined if conversion is not possible
|
|
54
54
|
*/
|
|
55
55
|
function schemaToJsonSchema(schema, options) {
|
|
56
|
+
if (schema === null || (typeof schema !== "object" && typeof schema !== "function")) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
56
59
|
const parser = schema;
|
|
57
|
-
|
|
60
|
+
if (isZodSchema(parser)) {
|
|
61
|
+
const jsonSchema = convertZodSchema(parser, options);
|
|
62
|
+
if (jsonSchema) {
|
|
63
|
+
return {
|
|
64
|
+
jsonSchema: jsonSchema,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Check if schema has a built-in toJsonSchema method (e.g., ArkType)
|
|
58
69
|
if (typeof parser.toJsonSchema === "function") {
|
|
59
70
|
try {
|
|
60
71
|
const jsonSchema = parser.toJsonSchema();
|
|
@@ -66,14 +77,6 @@ function schemaToJsonSchema(schema, options) {
|
|
|
66
77
|
// If toJsonSchema fails, continue to other checks
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
|
-
if (isZodSchema(parser)) {
|
|
70
|
-
const jsonSchema = convertZodSchema(parser, options);
|
|
71
|
-
if (jsonSchema) {
|
|
72
|
-
return {
|
|
73
|
-
jsonSchema: jsonSchema,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
80
|
// Check if it's a TypeBox schema (has Static and Kind symbols)
|
|
78
81
|
if (parser[Symbol.for("TypeBox.Kind")] !== undefined) {
|
|
79
82
|
// TypeBox schemas are already JSON Schema compliant
|
|
@@ -112,10 +115,15 @@ function isZodSchema(schema) {
|
|
|
112
115
|
return isZod3Schema(schema) || isZod4Schema(schema);
|
|
113
116
|
}
|
|
114
117
|
function isZod3Schema(schema) {
|
|
115
|
-
return
|
|
118
|
+
return (typeof schema === "object" &&
|
|
119
|
+
schema !== null &&
|
|
120
|
+
"_def" in schema &&
|
|
121
|
+
"parse" in schema &&
|
|
122
|
+
"parseAsync" in schema &&
|
|
123
|
+
"safeParse" in schema);
|
|
116
124
|
}
|
|
117
125
|
function isZod4Schema(schema) {
|
|
118
|
-
return "_zod" in schema;
|
|
126
|
+
return typeof schema === "object" && schema !== null && "_zod" in schema;
|
|
119
127
|
}
|
|
120
128
|
function convertZodSchema(schema, options) {
|
|
121
129
|
if (isZod4Schema(schema)) {
|
|
@@ -138,8 +146,49 @@ function convertZod4Schema(schema, options) {
|
|
|
138
146
|
target: "draft-7",
|
|
139
147
|
io: "output",
|
|
140
148
|
reused: useReferences ? "ref" : "inline",
|
|
149
|
+
override: ({ zodSchema, jsonSchema }) => {
|
|
150
|
+
const def = zodSchema._zod.def;
|
|
151
|
+
if (def.type === "undefined") {
|
|
152
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
153
|
+
}
|
|
154
|
+
if (def.type === "object" && jsonSchema.required) {
|
|
155
|
+
// Early Zod 4 permalinks do not propagate optional output through unions.
|
|
156
|
+
const required = jsonSchema.required.filter((key) => {
|
|
157
|
+
const field = def.shape[key];
|
|
158
|
+
return !field || field._zod.optout === "optional" || !hasOptionalOutput(field);
|
|
159
|
+
});
|
|
160
|
+
if (required.length > 0) {
|
|
161
|
+
jsonSchema.required = required;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
delete jsonSchema.required;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
141
168
|
});
|
|
142
169
|
}
|
|
170
|
+
function hasOptionalOutput(schema, seen = new Set()) {
|
|
171
|
+
if (schema._zod.optout === "optional")
|
|
172
|
+
return true;
|
|
173
|
+
if (seen.has(schema))
|
|
174
|
+
return false;
|
|
175
|
+
seen.add(schema);
|
|
176
|
+
const def = schema._zod.def;
|
|
177
|
+
switch (def.type) {
|
|
178
|
+
case "union":
|
|
179
|
+
return def.options.some((option) => hasOptionalOutput(option, seen));
|
|
180
|
+
case "nullable":
|
|
181
|
+
case "readonly":
|
|
182
|
+
case "catch":
|
|
183
|
+
return hasOptionalOutput(def.innerType, seen);
|
|
184
|
+
case "lazy":
|
|
185
|
+
return hasOptionalOutput(def.getter(), seen);
|
|
186
|
+
case "pipe":
|
|
187
|
+
return hasOptionalOutput(def.out, seen);
|
|
188
|
+
default:
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
143
192
|
function isYupSchema(schema) {
|
|
144
193
|
return "spec" in schema && "_typeCheck" in schema;
|
|
145
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAAqD;AACrD,MAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAAqD;AACrD,MAAY,EAAE,wCAAoB;AAClC,mEAA2D;AAC3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AAO,MAAM,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClG,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAW;IACtC,IAAI,CAAC;QACH,OAAO,mBAAgB,CAAC,IAAI,CAAC,MAAM,CAAe,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
2
|
-
import * as z4 from "zod/v4";
|
|
2
|
+
import * as z4 from "zod/v4/core";
|
|
3
3
|
import { convertSchema } from "@sodaru/yup-to-json-schema";
|
|
4
4
|
import { JSONSchema as EffectJSONSchema } from "effect";
|
|
5
5
|
/**
|
|
@@ -15,8 +15,19 @@ import { JSONSchema as EffectJSONSchema } from "effect";
|
|
|
15
15
|
* @returns The conversion result or undefined if conversion is not possible
|
|
16
16
|
*/
|
|
17
17
|
export function schemaToJsonSchema(schema, options) {
|
|
18
|
+
if (schema === null || (typeof schema !== "object" && typeof schema !== "function")) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
18
21
|
const parser = schema;
|
|
19
|
-
|
|
22
|
+
if (isZodSchema(parser)) {
|
|
23
|
+
const jsonSchema = convertZodSchema(parser, options);
|
|
24
|
+
if (jsonSchema) {
|
|
25
|
+
return {
|
|
26
|
+
jsonSchema: jsonSchema,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Check if schema has a built-in toJsonSchema method (e.g., ArkType)
|
|
20
31
|
if (typeof parser.toJsonSchema === "function") {
|
|
21
32
|
try {
|
|
22
33
|
const jsonSchema = parser.toJsonSchema();
|
|
@@ -28,14 +39,6 @@ export function schemaToJsonSchema(schema, options) {
|
|
|
28
39
|
// If toJsonSchema fails, continue to other checks
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
|
-
if (isZodSchema(parser)) {
|
|
32
|
-
const jsonSchema = convertZodSchema(parser, options);
|
|
33
|
-
if (jsonSchema) {
|
|
34
|
-
return {
|
|
35
|
-
jsonSchema: jsonSchema,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
42
|
// Check if it's a TypeBox schema (has Static and Kind symbols)
|
|
40
43
|
if (parser[Symbol.for("TypeBox.Kind")] !== undefined) {
|
|
41
44
|
// TypeBox schemas are already JSON Schema compliant
|
|
@@ -74,10 +77,15 @@ export function isZodSchema(schema) {
|
|
|
74
77
|
return isZod3Schema(schema) || isZod4Schema(schema);
|
|
75
78
|
}
|
|
76
79
|
function isZod3Schema(schema) {
|
|
77
|
-
return
|
|
80
|
+
return (typeof schema === "object" &&
|
|
81
|
+
schema !== null &&
|
|
82
|
+
"_def" in schema &&
|
|
83
|
+
"parse" in schema &&
|
|
84
|
+
"parseAsync" in schema &&
|
|
85
|
+
"safeParse" in schema);
|
|
78
86
|
}
|
|
79
87
|
function isZod4Schema(schema) {
|
|
80
|
-
return "_zod" in schema;
|
|
88
|
+
return typeof schema === "object" && schema !== null && "_zod" in schema;
|
|
81
89
|
}
|
|
82
90
|
function convertZodSchema(schema, options) {
|
|
83
91
|
if (isZod4Schema(schema)) {
|
|
@@ -100,8 +108,49 @@ function convertZod4Schema(schema, options) {
|
|
|
100
108
|
target: "draft-7",
|
|
101
109
|
io: "output",
|
|
102
110
|
reused: useReferences ? "ref" : "inline",
|
|
111
|
+
override: ({ zodSchema, jsonSchema }) => {
|
|
112
|
+
const def = zodSchema._zod.def;
|
|
113
|
+
if (def.type === "undefined") {
|
|
114
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
115
|
+
}
|
|
116
|
+
if (def.type === "object" && jsonSchema.required) {
|
|
117
|
+
// Early Zod 4 permalinks do not propagate optional output through unions.
|
|
118
|
+
const required = jsonSchema.required.filter((key) => {
|
|
119
|
+
const field = def.shape[key];
|
|
120
|
+
return !field || field._zod.optout === "optional" || !hasOptionalOutput(field);
|
|
121
|
+
});
|
|
122
|
+
if (required.length > 0) {
|
|
123
|
+
jsonSchema.required = required;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
delete jsonSchema.required;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
103
130
|
});
|
|
104
131
|
}
|
|
132
|
+
function hasOptionalOutput(schema, seen = new Set()) {
|
|
133
|
+
if (schema._zod.optout === "optional")
|
|
134
|
+
return true;
|
|
135
|
+
if (seen.has(schema))
|
|
136
|
+
return false;
|
|
137
|
+
seen.add(schema);
|
|
138
|
+
const def = schema._zod.def;
|
|
139
|
+
switch (def.type) {
|
|
140
|
+
case "union":
|
|
141
|
+
return def.options.some((option) => hasOptionalOutput(option, seen));
|
|
142
|
+
case "nullable":
|
|
143
|
+
case "readonly":
|
|
144
|
+
case "catch":
|
|
145
|
+
return hasOptionalOutput(def.innerType, seen);
|
|
146
|
+
case "lazy":
|
|
147
|
+
return hasOptionalOutput(def.getter(), seen);
|
|
148
|
+
case "pipe":
|
|
149
|
+
return hasOptionalOutput(def.out, seen);
|
|
150
|
+
default:
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
105
154
|
function isYupSchema(schema) {
|
|
106
155
|
return "spec" in schema && "_typeCheck" in schema;
|
|
107
156
|
}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO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AC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,MAAW;IACjC,OAAO,KAAK,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClG,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAW;IACtC,IAAI,CAAC;QACH,OAAO,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAe,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/schema-to-json",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"description": "Convert various schema validation libraries to JSON Schema",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"zod-to-json-schema": "^3.
|
|
34
|
+
"zod-to-json-schema": "^3.25.0",
|
|
35
35
|
"@sodaru/yup-to-json-schema": "^2",
|
|
36
|
-
"zod": "3.25.
|
|
36
|
+
"zod": "^3.25.56 || ^4.0.0",
|
|
37
37
|
"effect": "^3",
|
|
38
|
-
"@trigger.dev/core": "4.
|
|
38
|
+
"@trigger.dev/core": "4.6.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"arktype": "^2.0.0",
|
|
@@ -45,10 +45,12 @@
|
|
|
45
45
|
"@sinclair/typebox": "^0.34.3",
|
|
46
46
|
"valibot": "^1.1.0",
|
|
47
47
|
"yup": "^1.7.0",
|
|
48
|
+
"zod-v3-floor": "npm:zod@3.25.56",
|
|
48
49
|
"rimraf": "6.0.1",
|
|
49
50
|
"@arethetypeswrong/cli": "^0.18.5"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
53
|
+
"zod": "^3.25.56 || ^4.0.0",
|
|
52
54
|
"arktype": ">=2.0.0",
|
|
53
55
|
"runtypes": ">=5.0.0",
|
|
54
56
|
"superstruct": ">=0.14.2",
|