@trigger.dev/schema-to-json 0.0.0-prerelease-20260911153544 → 0.0.0-prerelease-windows-bundle-fix-20260928100448
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 +2 -84
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/zod4.d.ts +11 -0
- package/dist/commonjs/zod4.js +138 -0
- package/dist/commonjs/zod4.js.map +1 -0
- package/dist/esm/index.js +1 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/zod4.d.ts +11 -0
- package/dist/esm/zod4.js +102 -0
- package/dist/esm/zod4.js.map +1 -0
- package/package.json +2 -2
package/dist/commonjs/index.js
CHANGED
|
@@ -1,45 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.schemaToJsonSchema = schemaToJsonSchema;
|
|
37
4
|
exports.canConvertSchema = canConvertSchema;
|
|
38
5
|
exports.isZodSchema = isZodSchema;
|
|
39
6
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
40
|
-
const z4 = __importStar(require("zod/v4/core"));
|
|
41
7
|
const yup_to_json_schema_1 = require("@sodaru/yup-to-json-schema");
|
|
42
8
|
const effect_1 = require("effect");
|
|
9
|
+
const zod4_js_1 = require("./zod4.js");
|
|
43
10
|
/**
|
|
44
11
|
* Convert a schema from various validation libraries to JSON Schema
|
|
45
12
|
*
|
|
@@ -127,7 +94,7 @@ function isZod4Schema(schema) {
|
|
|
127
94
|
}
|
|
128
95
|
function convertZodSchema(schema, options) {
|
|
129
96
|
if (isZod4Schema(schema)) {
|
|
130
|
-
return convertZod4Schema(schema, options);
|
|
97
|
+
return (0, zod4_js_1.convertZod4Schema)(schema, options);
|
|
131
98
|
}
|
|
132
99
|
if (isZod3Schema(schema)) {
|
|
133
100
|
return convertZod3Schema(schema, options);
|
|
@@ -140,55 +107,6 @@ function convertZod3Schema(schema, options) {
|
|
|
140
107
|
$refStrategy: useReferences ? "root" : "none",
|
|
141
108
|
});
|
|
142
109
|
}
|
|
143
|
-
function convertZod4Schema(schema, options) {
|
|
144
|
-
const useReferences = options?.useReferences ?? false;
|
|
145
|
-
return z4.toJSONSchema(schema, {
|
|
146
|
-
target: "draft-7",
|
|
147
|
-
io: "output",
|
|
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
|
-
},
|
|
168
|
-
});
|
|
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
|
-
}
|
|
192
110
|
function isYupSchema(schema) {
|
|
193
111
|
return "spec" in schema && "_typeCheck" in schema;
|
|
194
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAEA,2DAAqD;AACrD,mEAA2D;AAC3D,mCAAwD;AACxD,uCAA8C;AAsB9C;;;;;;;;;;;GAWG;AACH,4BACE,MAAc,EACd,OAA2B;IAE3B,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,UAAU,CAAC,EAAE,CAAC;QACpF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAG,MAAa,CAAC;IAE7B,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAErD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO;gBACL,UAAU,EAAE,UAAU;aACvB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,qEAAqE;IACrE,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;YAEzC,OAAO;gBACL,UAAU;aACX,CAAC;QACJ,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,kDAAkD;QACpD,CAAC;IACH,CAAC;IAED,+DAA+D;IAC/D,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QACrD,oDAAoD;QACpD,OAAO;YACL,UAAU,EAAE,MAAM;SACnB,CAAC;IACJ,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,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CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAW,EAAE,OAA2B;IACjE,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,KAAK,CAAC;IAEtD,OAAO,IAAA,oCAAe,EAAC,MAAM,EAAE;QAC7B,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;KAC9C,CAAe,CAAC;AACnB,CAAC;AAED,SAAS,WAAW,CAAC,MAAW;IAC9B,OAAO,MAAM,IAAI,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AACpD,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAW;IACnC,IAAI,CAAC;QACH,OAAO,IAAA,kCAAa,EAAC,MAAM,CAAe,CAAC;IAC7C,CAAC;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,mBAAgB,CAAC,IAAI,CAAC,MAAM,CAAe,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSONSchema } from "@trigger.dev/core/v3";
|
|
2
|
+
import type { ConversionOptions } from "./index.js";
|
|
3
|
+
type Zod4Converter = {
|
|
4
|
+
version: {
|
|
5
|
+
major: number;
|
|
6
|
+
minor: number;
|
|
7
|
+
};
|
|
8
|
+
toJSONSchema: (schema: any, options: any) => unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare function convertZod4Schema(schema: any, options?: ConversionOptions, converter?: Zod4Converter): JSONSchema | undefined;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.convertZod4Schema = convertZod4Schema;
|
|
37
|
+
const z4 = __importStar(require("zod/v4/core"));
|
|
38
|
+
function convertZod4Schema(schema, options, converter = z4) {
|
|
39
|
+
const useReferences = options?.useReferences ?? false;
|
|
40
|
+
const supportsUnrepresentableHandler = converter.version.major > 4 || (converter.version.major === 4 && converter.version.minor >= 5);
|
|
41
|
+
return converter.toJSONSchema(schema, {
|
|
42
|
+
target: "draft-7",
|
|
43
|
+
io: "output",
|
|
44
|
+
reused: useReferences ? "ref" : "inline",
|
|
45
|
+
unrepresentable: supportsUnrepresentableHandler
|
|
46
|
+
? ({ zodSchema }) => zodSchema._zod.def.type === "date" ? { type: "string", format: "date-time" } : "throw"
|
|
47
|
+
: "any",
|
|
48
|
+
override: ({ zodSchema, jsonSchema }) => {
|
|
49
|
+
const def = zodSchema._zod.def;
|
|
50
|
+
if (!supportsUnrepresentableHandler) {
|
|
51
|
+
enforceLegacyUnrepresentableTypes(def, jsonSchema);
|
|
52
|
+
}
|
|
53
|
+
if (def.type === "date") {
|
|
54
|
+
jsonSchema.type = "string";
|
|
55
|
+
jsonSchema.format = "date-time";
|
|
56
|
+
}
|
|
57
|
+
if (def.type === "undefined") {
|
|
58
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
59
|
+
}
|
|
60
|
+
if (def.type === "object" && jsonSchema.required) {
|
|
61
|
+
const required = jsonSchema.required.filter((key) => {
|
|
62
|
+
const field = def.shape[key];
|
|
63
|
+
return !field || field._zod.optout === "optional" || !hasOptionalOutput(field);
|
|
64
|
+
});
|
|
65
|
+
if (required.length > 0) {
|
|
66
|
+
jsonSchema.required = required;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
delete jsonSchema.required;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function enforceLegacyUnrepresentableTypes(def, jsonSchema) {
|
|
76
|
+
switch (def.type) {
|
|
77
|
+
case "bigint":
|
|
78
|
+
throw new Error("BigInt cannot be represented in JSON Schema");
|
|
79
|
+
case "symbol":
|
|
80
|
+
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
81
|
+
case "void":
|
|
82
|
+
throw new Error("Void cannot be represented in JSON Schema");
|
|
83
|
+
case "map":
|
|
84
|
+
throw new Error("Map cannot be represented in JSON Schema");
|
|
85
|
+
case "set":
|
|
86
|
+
throw new Error("Set cannot be represented in JSON Schema");
|
|
87
|
+
case "transform":
|
|
88
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
89
|
+
case "nan":
|
|
90
|
+
throw new Error("NaN cannot be represented in JSON Schema");
|
|
91
|
+
case "custom":
|
|
92
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
93
|
+
case "function":
|
|
94
|
+
throw new Error("Function types cannot be represented in JSON Schema");
|
|
95
|
+
case "literal": {
|
|
96
|
+
if (def.values.some((value) => value === undefined)) {
|
|
97
|
+
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
98
|
+
}
|
|
99
|
+
if (def.values.some((value) => typeof value === "bigint")) {
|
|
100
|
+
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
case "catch": {
|
|
105
|
+
if ("default" in jsonSchema)
|
|
106
|
+
return;
|
|
107
|
+
try {
|
|
108
|
+
def.catchValue(undefined);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function hasOptionalOutput(schema, seen = new Set()) {
|
|
117
|
+
if (schema._zod.optout === "optional")
|
|
118
|
+
return true;
|
|
119
|
+
if (seen.has(schema))
|
|
120
|
+
return false;
|
|
121
|
+
seen.add(schema);
|
|
122
|
+
const def = schema._zod.def;
|
|
123
|
+
switch (def.type) {
|
|
124
|
+
case "union":
|
|
125
|
+
return def.options.some((option) => hasOptionalOutput(option, seen));
|
|
126
|
+
case "nullable":
|
|
127
|
+
case "readonly":
|
|
128
|
+
case "catch":
|
|
129
|
+
return hasOptionalOutput(def.innerType, seen);
|
|
130
|
+
case "lazy":
|
|
131
|
+
return hasOptionalOutput(def.getter(), seen);
|
|
132
|
+
case "pipe":
|
|
133
|
+
return hasOptionalOutput(def.out, seen);
|
|
134
|
+
default:
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=zod4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod4.js","sourceRoot":"","sources":["../../src/zod4.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAY,EAAE,wCAAoB;AAQlC,2BACE,MAAW,EACX,OAA2B,EAC3B,SAAS,GAAkB,EAAE;IAE7B,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,KAAK,CAAC;IACtD,MAAM,8BAA8B,GAClC,SAAS,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IAEjG,OAAO,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE;QACpC,MAAM,EAAE,SAAS;QACjB,EAAE,EAAE,QAAQ;QACZ,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;QACxC,eAAe,EAAE,8BAA8B;YAC7C,CAAC,CAAC,CAAC,EAAE,SAAS,EAA+B,EAAE,EAAE,CAC7C,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO;YAC1F,CA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AC;YAC3E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAmB,EAAE,IAAI,GAAG,IAAI,GAAG,EAAe;IAC3E,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEjB,MAAM,GAAG,GAAI,MAAuB,CAAC,IAAI,CAAC,GAAG,CAAC;IAC9C,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QACvE,KAAK,UAAU,CAAC;QAChB,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAChD,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/C,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC1C;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
2
|
-
import * as z4 from "zod/v4/core";
|
|
3
2
|
import { convertSchema } from "@sodaru/yup-to-json-schema";
|
|
4
3
|
import { JSONSchema as EffectJSONSchema } from "effect";
|
|
4
|
+
import { convertZod4Schema } from "./zod4.js";
|
|
5
5
|
/**
|
|
6
6
|
* Convert a schema from various validation libraries to JSON Schema
|
|
7
7
|
*
|
|
@@ -102,55 +102,6 @@ function convertZod3Schema(schema, options) {
|
|
|
102
102
|
$refStrategy: useReferences ? "root" : "none",
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
function convertZod4Schema(schema, options) {
|
|
106
|
-
const useReferences = options?.useReferences ?? false;
|
|
107
|
-
return z4.toJSONSchema(schema, {
|
|
108
|
-
target: "draft-7",
|
|
109
|
-
io: "output",
|
|
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
|
-
},
|
|
130
|
-
});
|
|
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
|
-
}
|
|
154
105
|
function isYupSchema(schema) {
|
|
155
106
|
return "spec" in schema && "_typeCheck" in schema;
|
|
156
107
|
}
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAsB9C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,OAA2B;IAE3B,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,UAAU,CAAC,EAAE,CAAC;QACpF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAG,MAAa,CAAC;IAE7B,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAErD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO;gBACL,UAAU,EAAE,UAAU;aACvB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,qEAAqE;IACrE,IAAI,OAAO,MAAM,CAAC,YAAY,K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I,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSONSchema } from "@trigger.dev/core/v3";
|
|
2
|
+
import type { ConversionOptions } from "./index.js";
|
|
3
|
+
type Zod4Converter = {
|
|
4
|
+
version: {
|
|
5
|
+
major: number;
|
|
6
|
+
minor: number;
|
|
7
|
+
};
|
|
8
|
+
toJSONSchema: (schema: any, options: any) => unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare function convertZod4Schema(schema: any, options?: ConversionOptions, converter?: Zod4Converter): JSONSchema | undefined;
|
|
11
|
+
export {};
|
package/dist/esm/zod4.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as z4 from "zod/v4/core";
|
|
2
|
+
export function convertZod4Schema(schema, options, converter = z4) {
|
|
3
|
+
const useReferences = options?.useReferences ?? false;
|
|
4
|
+
const supportsUnrepresentableHandler = converter.version.major > 4 || (converter.version.major === 4 && converter.version.minor >= 5);
|
|
5
|
+
return converter.toJSONSchema(schema, {
|
|
6
|
+
target: "draft-7",
|
|
7
|
+
io: "output",
|
|
8
|
+
reused: useReferences ? "ref" : "inline",
|
|
9
|
+
unrepresentable: supportsUnrepresentableHandler
|
|
10
|
+
? ({ zodSchema }) => zodSchema._zod.def.type === "date" ? { type: "string", format: "date-time" } : "throw"
|
|
11
|
+
: "any",
|
|
12
|
+
override: ({ zodSchema, jsonSchema }) => {
|
|
13
|
+
const def = zodSchema._zod.def;
|
|
14
|
+
if (!supportsUnrepresentableHandler) {
|
|
15
|
+
enforceLegacyUnrepresentableTypes(def, jsonSchema);
|
|
16
|
+
}
|
|
17
|
+
if (def.type === "date") {
|
|
18
|
+
jsonSchema.type = "string";
|
|
19
|
+
jsonSchema.format = "date-time";
|
|
20
|
+
}
|
|
21
|
+
if (def.type === "undefined") {
|
|
22
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
23
|
+
}
|
|
24
|
+
if (def.type === "object" && jsonSchema.required) {
|
|
25
|
+
const required = jsonSchema.required.filter((key) => {
|
|
26
|
+
const field = def.shape[key];
|
|
27
|
+
return !field || field._zod.optout === "optional" || !hasOptionalOutput(field);
|
|
28
|
+
});
|
|
29
|
+
if (required.length > 0) {
|
|
30
|
+
jsonSchema.required = required;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
delete jsonSchema.required;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function enforceLegacyUnrepresentableTypes(def, jsonSchema) {
|
|
40
|
+
switch (def.type) {
|
|
41
|
+
case "bigint":
|
|
42
|
+
throw new Error("BigInt cannot be represented in JSON Schema");
|
|
43
|
+
case "symbol":
|
|
44
|
+
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
45
|
+
case "void":
|
|
46
|
+
throw new Error("Void cannot be represented in JSON Schema");
|
|
47
|
+
case "map":
|
|
48
|
+
throw new Error("Map cannot be represented in JSON Schema");
|
|
49
|
+
case "set":
|
|
50
|
+
throw new Error("Set cannot be represented in JSON Schema");
|
|
51
|
+
case "transform":
|
|
52
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
53
|
+
case "nan":
|
|
54
|
+
throw new Error("NaN cannot be represented in JSON Schema");
|
|
55
|
+
case "custom":
|
|
56
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
57
|
+
case "function":
|
|
58
|
+
throw new Error("Function types cannot be represented in JSON Schema");
|
|
59
|
+
case "literal": {
|
|
60
|
+
if (def.values.some((value) => value === undefined)) {
|
|
61
|
+
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
62
|
+
}
|
|
63
|
+
if (def.values.some((value) => typeof value === "bigint")) {
|
|
64
|
+
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
case "catch": {
|
|
69
|
+
if ("default" in jsonSchema)
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
def.catchValue(undefined);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function hasOptionalOutput(schema, seen = new Set()) {
|
|
81
|
+
if (schema._zod.optout === "optional")
|
|
82
|
+
return true;
|
|
83
|
+
if (seen.has(schema))
|
|
84
|
+
return false;
|
|
85
|
+
seen.add(schema);
|
|
86
|
+
const def = schema._zod.def;
|
|
87
|
+
switch (def.type) {
|
|
88
|
+
case "union":
|
|
89
|
+
return def.options.some((option) => hasOptionalOutput(option, seen));
|
|
90
|
+
case "nullable":
|
|
91
|
+
case "readonly":
|
|
92
|
+
case "catch":
|
|
93
|
+
return hasOptionalOutput(def.innerType, seen);
|
|
94
|
+
case "lazy":
|
|
95
|
+
return hasOptionalOutput(def.getter(), seen);
|
|
96
|
+
case "pipe":
|
|
97
|
+
return hasOptionalOutput(def.out, seen);
|
|
98
|
+
default:
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=zod4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod4.js","sourceRoot":"","sources":["../../src/zod4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAQlC,MAAM,UAAU,iBAAiB,CAC/B,MAAW,EACX,OAA2B,EAC3B,SAAS,GAAkB,EAAE;IAE7B,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,KAAK,CAAC;IACtD,MAAM,8BAA8B,GAClC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AiB,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAChD,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/C,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC1C;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/schema-to-json",
|
|
3
|
-
"version": "0.0.0-prerelease-
|
|
3
|
+
"version": "0.0.0-prerelease-windows-bundle-fix-20260928100448",
|
|
4
4
|
"description": "Convert various schema validation libraries to JSON Schema",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@sodaru/yup-to-json-schema": "^2",
|
|
36
36
|
"zod": "^3.25.56 || ^4.0.0",
|
|
37
37
|
"effect": "^3",
|
|
38
|
-
"@trigger.dev/core": "0.0.0-prerelease-
|
|
38
|
+
"@trigger.dev/core": "0.0.0-prerelease-windows-bundle-fix-20260928100448"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"arktype": "^2.0.0",
|