@power-plant/schema 0.0.34 → 0.0.36
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/codegen.cjs +1 -1
- package/dist/codegen.d.cts +1 -1
- package/dist/codegen.d.mts +1 -1
- package/dist/codegen.mjs +1 -1
- package/dist/{constants-COGt3eeW.mjs → constants-BlppSDwG.mjs} +11 -2
- package/dist/constants-BlppSDwG.mjs.map +1 -0
- package/dist/{constants-B7xonHLD.cjs → constants-CEmLvTDd.cjs} +15 -0
- package/dist/{helpers-reqtcaa8.mjs → helpers-BxWdDZn4.mjs} +26 -5
- package/dist/helpers-BxWdDZn4.mjs.map +1 -0
- package/dist/{helpers-sXsSapgI.cjs → helpers-CQS3qnsv.cjs} +48 -3
- package/dist/index.cjs +102 -10
- package/dist/index.d.cts +24 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +24 -3
- package/dist/index.mjs +97 -12
- package/dist/{types-CjF4wIDK.d.mts → types-CEGqfUA4.d.cts} +79 -3
- package/dist/types-CEGqfUA4.d.cts.map +1 -0
- package/dist/{types-hfHmxKG0.d.cts → types-OH3Npqz2.d.mts} +80 -4
- package/dist/types-OH3Npqz2.d.mts.map +1 -0
- package/dist/valibot.cjs +1 -1
- package/dist/valibot.d.cts +1 -1
- package/dist/valibot.d.mts +1 -1
- package/dist/valibot.mjs +1 -1
- package/dist/zod.cjs +2 -2
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.mts +1 -1
- package/dist/zod.mjs +2 -2
- package/package.json +5 -3
- package/dist/constants-COGt3eeW.mjs.map +0 -1
- package/dist/helpers-reqtcaa8.mjs.map +0 -1
- package/dist/types-CjF4wIDK.d.mts.map +0 -1
- package/dist/types-hfHmxKG0.d.cts.map +0 -1
package/dist/codegen.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_helpers = require('./helpers-
|
|
2
|
+
const require_helpers = require('./helpers-CQS3qnsv.cjs');
|
|
3
3
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
4
4
|
let _stryke_type_checks = require("@stryke/type-checks");
|
|
5
5
|
let _stryke_string_format_list = require("@stryke/string-format/list");
|
package/dist/codegen.d.cts
CHANGED
package/dist/codegen.d.mts
CHANGED
package/dist/codegen.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as isJsonSchemaObject, O as isJsonSchemaLiteral, V as isJsonSchemaString, a as getPropertiesList, c as isSchemaNullable, d as merge, g as isJsonSchema, st as getPrimarySchemaType } from "./helpers-BxWdDZn4.mjs";
|
|
2
2
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
3
3
|
import { isInteger, isObject, isSetArray, isString } from "@stryke/type-checks";
|
|
4
4
|
import { list } from "@stryke/string-format/list";
|
|
@@ -46,6 +46,15 @@ const JSON_SCHEMA_METADATA_KEYS = [
|
|
|
46
46
|
"writeOnly"
|
|
47
47
|
];
|
|
48
48
|
/**
|
|
49
|
+
* Own-property key set to `true` on constructor function schemas.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* Must be read with `Object.hasOwn(schema, JSON_SCHEMA_CONSTRUCTOR_KEY)` (or
|
|
53
|
+
* `hasJsonSchemaConstructorFlag`) — never via `schema.constructor`, which
|
|
54
|
+
* resolves `Object.prototype.constructor`.
|
|
55
|
+
*/
|
|
56
|
+
const JSON_SCHEMA_CONSTRUCTOR_KEY = "constructor";
|
|
57
|
+
/**
|
|
49
58
|
* Keywords whose values are a flat record of named JSON Schema fragments.
|
|
50
59
|
* Each child schema is merged recursively with its counterpart.
|
|
51
60
|
*/
|
|
@@ -83,5 +92,5 @@ const SCHEMA_ARRAY_CONCAT_KEYWORDS = /* @__PURE__ */ new Set([
|
|
|
83
92
|
]);
|
|
84
93
|
|
|
85
94
|
//#endregion
|
|
86
|
-
export {
|
|
87
|
-
//# sourceMappingURL=constants-
|
|
95
|
+
export { JsonSchemaTypeNames as a, SCHEMA_SINGLE_KEYWORDS as c, JSON_SCHEMA_TYPES as i, JSON_SCHEMA_METADATA_KEYS as n, SCHEMA_ARRAY_CONCAT_KEYWORDS as o, JSON_SCHEMA_PRIMITIVE_TYPES as r, SCHEMA_RECORD_KEYWORDS as s, JSON_SCHEMA_CONSTRUCTOR_KEY as t };
|
|
96
|
+
//# sourceMappingURL=constants-BlppSDwG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-BlppSDwG.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -47,6 +47,15 @@ const JSON_SCHEMA_METADATA_KEYS = [
|
|
|
47
47
|
"writeOnly"
|
|
48
48
|
];
|
|
49
49
|
/**
|
|
50
|
+
* Own-property key set to `true` on constructor function schemas.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Must be read with `Object.hasOwn(schema, JSON_SCHEMA_CONSTRUCTOR_KEY)` (or
|
|
54
|
+
* `hasJsonSchemaConstructorFlag`) — never via `schema.constructor`, which
|
|
55
|
+
* resolves `Object.prototype.constructor`.
|
|
56
|
+
*/
|
|
57
|
+
const JSON_SCHEMA_CONSTRUCTOR_KEY = "constructor";
|
|
58
|
+
/**
|
|
50
59
|
* Keywords whose values are a flat record of named JSON Schema fragments.
|
|
51
60
|
* Each child schema is merged recursively with its counterpart.
|
|
52
61
|
*/
|
|
@@ -84,6 +93,12 @@ const SCHEMA_ARRAY_CONCAT_KEYWORDS = /* @__PURE__ */ new Set([
|
|
|
84
93
|
]);
|
|
85
94
|
|
|
86
95
|
//#endregion
|
|
96
|
+
Object.defineProperty(exports, 'JSON_SCHEMA_CONSTRUCTOR_KEY', {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return JSON_SCHEMA_CONSTRUCTOR_KEY;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
87
102
|
Object.defineProperty(exports, 'JSON_SCHEMA_METADATA_KEYS', {
|
|
88
103
|
enumerable: true,
|
|
89
104
|
get: function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as SCHEMA_SINGLE_KEYWORDS, i as JSON_SCHEMA_TYPES, n as JSON_SCHEMA_METADATA_KEYS, o as SCHEMA_ARRAY_CONCAT_KEYWORDS, r as JSON_SCHEMA_PRIMITIVE_TYPES, s as SCHEMA_RECORD_KEYWORDS, t as JSON_SCHEMA_CONSTRUCTOR_KEY } from "./constants-BlppSDwG.mjs";
|
|
2
2
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
3
3
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
4
4
|
import { isBoolean, isFunction, isSetObject as isSetObject$1, isSetString as isSetString$1, isString } from "@stryke/type-checks";
|
|
@@ -187,7 +187,7 @@ function isJsonSchemaKeywords(input) {
|
|
|
187
187
|
function isJsonSchemaAny(input) {
|
|
188
188
|
if (!isSetObject$1(input)) return false;
|
|
189
189
|
const schema = input;
|
|
190
|
-
return hasValidJsonSchemaKeywords(schema) && isOptionalString(schema.$ref) && (!schema.type || Array.isArray(schema.type) && schema.type.every((t) => JSON_SCHEMA_PRIMITIVE_TYPES.includes(t)));
|
|
190
|
+
return hasValidJsonSchemaKeywords(schema) && isOptionalString(schema.$ref) && (!schema.type || isSetString$1(schema.type) && JSON_SCHEMA_PRIMITIVE_TYPE_SET.has(schema.type) || Array.isArray(schema.type) && schema.type.every((t) => JSON_SCHEMA_PRIMITIVE_TYPES.includes(t)));
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Type guard for JSON Schema array types.
|
|
@@ -529,6 +529,20 @@ function isValibotSchema(input) {
|
|
|
529
529
|
return schema.kind === "schema" && isSetString$1(schema.type) && isBoolean(schema.async) && isFunction(schema.reference) && isSetString$1(schema.expects) && isFunction(schema["~run"]);
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
|
+
* Returns true when `input` is a function schema that represents a constructor.
|
|
533
|
+
*
|
|
534
|
+
* @remarks
|
|
535
|
+
* Uses `Object.hasOwn` on {@link JSON_SCHEMA_CONSTRUCTOR_KEY}. Do not read
|
|
536
|
+
* `schema.constructor` — that returns `Object.prototype.constructor`.
|
|
537
|
+
*
|
|
538
|
+
* @param input - A JSON Schema (or unknown value) to inspect.
|
|
539
|
+
* @returns True when the schema has an own `"constructor": true` flag.
|
|
540
|
+
*/
|
|
541
|
+
function hasJsonSchemaConstructorFlag(input) {
|
|
542
|
+
if (!isSetObject$1(input)) return false;
|
|
543
|
+
return Object.hasOwn(input, "constructor") && input["constructor"] === true;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
532
546
|
* Type guard for JSON Schema types.
|
|
533
547
|
*
|
|
534
548
|
* @remarks
|
|
@@ -588,7 +602,8 @@ function isUntypedSchema(input) {
|
|
|
588
602
|
* @returns True if the input is an untyped schema and not a JSON Schema.
|
|
589
603
|
*/
|
|
590
604
|
function isUntypedSchemaStrict(input) {
|
|
591
|
-
|
|
605
|
+
if (!isUntypedSchema(input) || isJsonSchema(input)) return false;
|
|
606
|
+
return !("type" in input);
|
|
592
607
|
}
|
|
593
608
|
/**
|
|
594
609
|
* Type guard for untyped input objects.
|
|
@@ -599,6 +614,8 @@ function isUntypedSchemaStrict(input) {
|
|
|
599
614
|
* @param input - The value to check.
|
|
600
615
|
* @returns True if the input is an untyped input object, false otherwise.
|
|
601
616
|
*/
|
|
617
|
+
/** @deprecated Use {@link isUntypedConfig} */
|
|
618
|
+
const isUntypedInput = isUntypedConfig;
|
|
602
619
|
function isUntypedConfig(input) {
|
|
603
620
|
if (!isSetObject$1(input)) return false;
|
|
604
621
|
const inputObject = input;
|
|
@@ -616,6 +633,8 @@ function isUntypedConfig(input) {
|
|
|
616
633
|
* @param input - The value to check.
|
|
617
634
|
* @returns True if the input is an untyped input object and not JSON Schema.
|
|
618
635
|
*/
|
|
636
|
+
/** @deprecated Use {@link isUntypedConfigStrict} */
|
|
637
|
+
const isUntypedInputStrict = isUntypedConfigStrict;
|
|
619
638
|
function isUntypedConfigStrict(input) {
|
|
620
639
|
if (!isUntypedConfig(input) || isJsonSchema(input)) return false;
|
|
621
640
|
const inputObject = input;
|
|
@@ -874,6 +893,8 @@ function isPropertyOptional(parent, propertyName) {
|
|
|
874
893
|
function isValidSchemaConfigFile(fileName) {
|
|
875
894
|
return VALID_OBJECT_SOURCE_EXTENSIONS.includes(findFileExtensionSafe(fileName));
|
|
876
895
|
}
|
|
896
|
+
/** @deprecated Use {@link isValidSchemaConfigFile} */
|
|
897
|
+
const isValidSchemaInputFile = isValidSchemaConfigFile;
|
|
877
898
|
/**
|
|
878
899
|
* Traverses a JSON Schema and applies a callback function to each schema fragment.
|
|
879
900
|
*
|
|
@@ -917,5 +938,5 @@ function traverseSchema(schema, callback) {
|
|
|
917
938
|
}
|
|
918
939
|
|
|
919
940
|
//#endregion
|
|
920
|
-
export {
|
|
921
|
-
//# sourceMappingURL=helpers-
|
|
941
|
+
export { isUntypedConfig as $, isJsonSchemaNativeEnum as A, isJsonSchemaSet as B, isJsonSchemaDate as C, isJsonSchemaKeywords as D, isJsonSchemaInteger as E, isJsonSchemaObject as F, isJsonSchemaUnion as G, isJsonSchemaTuple as H, isJsonSchemaPrimitiveType as I, isSchema as J, isJsonSchemaUnknown as K, isJsonSchemaPrimitiveUnion as L, isJsonSchemaNull as M, isJsonSchemaNullable as N, isJsonSchemaLiteral as O, isJsonSchemaNumber as P, isStandardSchema as Q, isJsonSchemaRecord as R, isJsonSchemaBoolean as S, isJsonSchemaEnum as T, isJsonSchemaType as U, isJsonSchemaString as V, isJsonSchemaUndefined as W, isSchemaOf as X, isSchemaObject as Y, isSchemaWithSource as Z, isJsonSchemaAllOf as _, getPropertiesList as a, isValibotSchema as at, isJsonSchemaArray as b, isSchemaNullable as c, readSchemaTypes as ct, merge as d, isUntypedConfigStrict as et, mergeMetadata as f, isJsonSchema as g, isFileReference as h, getProperties as i, isUntypedSchemaStrict as it, isJsonSchemaNever as j, isJsonSchemaMap as k, isValidSchemaConfigFile as l, hasJsonSchemaConstructorFlag as m, getJsonSchema as n, isUntypedInputStrict as nt, getProperty as o, applyJsonSchemaMetadata as ot, traverseSchema as p, isNullOnlyJsonSchema as q, getJsonSchemaObject as r, isUntypedSchema as rt, isPropertyOptional as s, getPrimarySchemaType as st, addProperty as t, isUntypedInput as tt, isValidSchemaInputFile as u, isJsonSchemaAny as v, isJsonSchemaDecimal as w, isJsonSchemaBigint as x, isJsonSchemaAnyOf as y, isJsonSchemaRef as z };
|
|
942
|
+
//# sourceMappingURL=helpers-BxWdDZn4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers-BxWdDZn4.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
2
|
-
const require_constants = require('./constants-
|
|
2
|
+
const require_constants = require('./constants-CEmLvTDd.cjs');
|
|
3
3
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
4
4
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
5
5
|
let _stryke_type_checks = require("@stryke/type-checks");
|
|
@@ -189,7 +189,7 @@ function isJsonSchemaKeywords(input) {
|
|
|
189
189
|
function isJsonSchemaAny(input) {
|
|
190
190
|
if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
|
|
191
191
|
const schema = input;
|
|
192
|
-
return hasValidJsonSchemaKeywords(schema) && isOptionalString(schema.$ref) && (!schema.type || Array.isArray(schema.type) && schema.type.every((t) => require_constants.JSON_SCHEMA_PRIMITIVE_TYPES.includes(t)));
|
|
192
|
+
return hasValidJsonSchemaKeywords(schema) && isOptionalString(schema.$ref) && (!schema.type || (0, _stryke_type_checks.isSetString)(schema.type) && JSON_SCHEMA_PRIMITIVE_TYPE_SET.has(schema.type) || Array.isArray(schema.type) && schema.type.every((t) => require_constants.JSON_SCHEMA_PRIMITIVE_TYPES.includes(t)));
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
195
|
* Type guard for JSON Schema array types.
|
|
@@ -531,6 +531,20 @@ function isValibotSchema(input) {
|
|
|
531
531
|
return schema.kind === "schema" && (0, _stryke_type_checks.isSetString)(schema.type) && (0, _stryke_type_checks.isBoolean)(schema.async) && (0, _stryke_type_checks.isFunction)(schema.reference) && (0, _stryke_type_checks.isSetString)(schema.expects) && (0, _stryke_type_checks.isFunction)(schema["~run"]);
|
|
532
532
|
}
|
|
533
533
|
/**
|
|
534
|
+
* Returns true when `input` is a function schema that represents a constructor.
|
|
535
|
+
*
|
|
536
|
+
* @remarks
|
|
537
|
+
* Uses `Object.hasOwn` on {@link JSON_SCHEMA_CONSTRUCTOR_KEY}. Do not read
|
|
538
|
+
* `schema.constructor` — that returns `Object.prototype.constructor`.
|
|
539
|
+
*
|
|
540
|
+
* @param input - A JSON Schema (or unknown value) to inspect.
|
|
541
|
+
* @returns True when the schema has an own `"constructor": true` flag.
|
|
542
|
+
*/
|
|
543
|
+
function hasJsonSchemaConstructorFlag(input) {
|
|
544
|
+
if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
|
|
545
|
+
return Object.hasOwn(input, "constructor") && input["constructor"] === true;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
534
548
|
* Type guard for JSON Schema types.
|
|
535
549
|
*
|
|
536
550
|
* @remarks
|
|
@@ -590,7 +604,8 @@ function isUntypedSchema(input) {
|
|
|
590
604
|
* @returns True if the input is an untyped schema and not a JSON Schema.
|
|
591
605
|
*/
|
|
592
606
|
function isUntypedSchemaStrict(input) {
|
|
593
|
-
|
|
607
|
+
if (!isUntypedSchema(input) || isJsonSchema(input)) return false;
|
|
608
|
+
return !("type" in input);
|
|
594
609
|
}
|
|
595
610
|
/**
|
|
596
611
|
* Type guard for untyped input objects.
|
|
@@ -601,6 +616,8 @@ function isUntypedSchemaStrict(input) {
|
|
|
601
616
|
* @param input - The value to check.
|
|
602
617
|
* @returns True if the input is an untyped input object, false otherwise.
|
|
603
618
|
*/
|
|
619
|
+
/** @deprecated Use {@link isUntypedConfig} */
|
|
620
|
+
const isUntypedInput = isUntypedConfig;
|
|
604
621
|
function isUntypedConfig(input) {
|
|
605
622
|
if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
|
|
606
623
|
const inputObject = input;
|
|
@@ -618,6 +635,8 @@ function isUntypedConfig(input) {
|
|
|
618
635
|
* @param input - The value to check.
|
|
619
636
|
* @returns True if the input is an untyped input object and not JSON Schema.
|
|
620
637
|
*/
|
|
638
|
+
/** @deprecated Use {@link isUntypedConfigStrict} */
|
|
639
|
+
const isUntypedInputStrict = isUntypedConfigStrict;
|
|
621
640
|
function isUntypedConfigStrict(input) {
|
|
622
641
|
if (!isUntypedConfig(input) || isJsonSchema(input)) return false;
|
|
623
642
|
const inputObject = input;
|
|
@@ -876,6 +895,8 @@ function isPropertyOptional(parent, propertyName) {
|
|
|
876
895
|
function isValidSchemaConfigFile(fileName) {
|
|
877
896
|
return _stryke_resolve_constants.VALID_OBJECT_SOURCE_EXTENSIONS.includes((0, _stryke_path_find.findFileExtensionSafe)(fileName));
|
|
878
897
|
}
|
|
898
|
+
/** @deprecated Use {@link isValidSchemaConfigFile} */
|
|
899
|
+
const isValidSchemaInputFile = isValidSchemaConfigFile;
|
|
879
900
|
/**
|
|
880
901
|
* Traverses a JSON Schema and applies a callback function to each schema fragment.
|
|
881
902
|
*
|
|
@@ -967,6 +988,12 @@ Object.defineProperty(exports, 'getProperty', {
|
|
|
967
988
|
return getProperty;
|
|
968
989
|
}
|
|
969
990
|
});
|
|
991
|
+
Object.defineProperty(exports, 'hasJsonSchemaConstructorFlag', {
|
|
992
|
+
enumerable: true,
|
|
993
|
+
get: function () {
|
|
994
|
+
return hasJsonSchemaConstructorFlag;
|
|
995
|
+
}
|
|
996
|
+
});
|
|
970
997
|
Object.defineProperty(exports, 'isFileReference', {
|
|
971
998
|
enumerable: true,
|
|
972
999
|
get: function () {
|
|
@@ -1219,6 +1246,18 @@ Object.defineProperty(exports, 'isUntypedConfigStrict', {
|
|
|
1219
1246
|
return isUntypedConfigStrict;
|
|
1220
1247
|
}
|
|
1221
1248
|
});
|
|
1249
|
+
Object.defineProperty(exports, 'isUntypedInput', {
|
|
1250
|
+
enumerable: true,
|
|
1251
|
+
get: function () {
|
|
1252
|
+
return isUntypedInput;
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
Object.defineProperty(exports, 'isUntypedInputStrict', {
|
|
1256
|
+
enumerable: true,
|
|
1257
|
+
get: function () {
|
|
1258
|
+
return isUntypedInputStrict;
|
|
1259
|
+
}
|
|
1260
|
+
});
|
|
1222
1261
|
Object.defineProperty(exports, 'isUntypedSchema', {
|
|
1223
1262
|
enumerable: true,
|
|
1224
1263
|
get: function () {
|
|
@@ -1243,6 +1282,12 @@ Object.defineProperty(exports, 'isValidSchemaConfigFile', {
|
|
|
1243
1282
|
return isValidSchemaConfigFile;
|
|
1244
1283
|
}
|
|
1245
1284
|
});
|
|
1285
|
+
Object.defineProperty(exports, 'isValidSchemaInputFile', {
|
|
1286
|
+
enumerable: true,
|
|
1287
|
+
get: function () {
|
|
1288
|
+
return isValidSchemaInputFile;
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1246
1291
|
Object.defineProperty(exports, 'merge', {
|
|
1247
1292
|
enumerable: true,
|
|
1248
1293
|
get: function () {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
3
|
+
const require_constants = require('./constants-CEmLvTDd.cjs');
|
|
4
|
+
const require_helpers = require('./helpers-CQS3qnsv.cjs');
|
|
4
5
|
const require_storage = require('./storage-B8aDmNpv.cjs');
|
|
5
6
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
6
7
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
@@ -15,10 +16,14 @@ let _stryke_path_find = require("@stryke/path/find");
|
|
|
15
16
|
let _stryke_path_join = require("@stryke/path/join");
|
|
16
17
|
let _stryke_resolve_constants = require("@stryke/resolve/constants");
|
|
17
18
|
let _stryke_resolve_load = require("@stryke/resolve/load");
|
|
19
|
+
let _stryke_resolve_resolve = require("@stryke/resolve/resolve");
|
|
18
20
|
let _stryke_string_format_list = require("@stryke/string-format/list");
|
|
19
21
|
let _stryke_zod = require("@stryke/zod");
|
|
20
22
|
let _valibot_to_json_schema = require("@valibot/to-json-schema");
|
|
21
23
|
let ts_json_schema_generator_dist_factory_generator_js = require("ts-json-schema-generator/dist/factory/generator.js");
|
|
24
|
+
let ts_json_schema_generator_dist_src_Config_js = require("ts-json-schema-generator/dist/src/Config.js");
|
|
25
|
+
let typescript = require("typescript");
|
|
26
|
+
typescript = require_rolldown_runtime.__toESM(typescript, 1);
|
|
22
27
|
|
|
23
28
|
//#region src/compatibility.ts
|
|
24
29
|
const METADATA_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -447,8 +452,79 @@ function extractSource(variant, input) {
|
|
|
447
452
|
};
|
|
448
453
|
throw new Error(`Failed to extract source information from the provided input. The input must be a Zod schema, a Standard JSON Schema, a JSON Schema object, an untyped schema, or a reflected Deepkit Type object.`);
|
|
449
454
|
}
|
|
455
|
+
function getTsCompilerOptions(config) {
|
|
456
|
+
if (config.tsconfig) {
|
|
457
|
+
const raw = typescript.default.sys.readFile(config.tsconfig);
|
|
458
|
+
if (!raw) throw new Error(`Cannot read config file "${config.tsconfig}"`);
|
|
459
|
+
const parsedConfig = typescript.default.parseConfigFileTextToJson(config.tsconfig, raw);
|
|
460
|
+
if (parsedConfig.error) throw new Error(parsedConfig.error.messageText.toString());
|
|
461
|
+
if (!parsedConfig.config) throw new Error(`Invalid parsed config file "${config.tsconfig}"`);
|
|
462
|
+
const parseResult = typescript.default.parseJsonConfigFileContent(parsedConfig.config, typescript.default.sys, (0, _stryke_path_find.findFilePath)(config.tsconfig), {}, config.tsconfig);
|
|
463
|
+
parseResult.options.noEmit = true;
|
|
464
|
+
delete parseResult.options.out;
|
|
465
|
+
delete parseResult.options.outDir;
|
|
466
|
+
delete parseResult.options.outFile;
|
|
467
|
+
delete parseResult.options.declaration;
|
|
468
|
+
delete parseResult.options.declarationDir;
|
|
469
|
+
delete parseResult.options.declarationMap;
|
|
470
|
+
return parseResult.options;
|
|
471
|
+
}
|
|
472
|
+
return {
|
|
473
|
+
noEmit: true,
|
|
474
|
+
emitDecoratorMetadata: true,
|
|
475
|
+
experimentalDecorators: true,
|
|
476
|
+
target: typescript.default.ScriptTarget.ES2022,
|
|
477
|
+
module: typescript.default.ModuleKind.ESNext,
|
|
478
|
+
moduleResolution: typescript.default.ModuleResolutionKind.Bundler,
|
|
479
|
+
strictNullChecks: false,
|
|
480
|
+
skipLibCheck: true,
|
|
481
|
+
skipDefaultLibCheck: true,
|
|
482
|
+
esModuleInterop: true,
|
|
483
|
+
types: ["node"]
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function getScriptKind(fileName) {
|
|
487
|
+
switch ((0, _stryke_path_find.findFileExtensionSafe)(fileName)?.toLowerCase()) {
|
|
488
|
+
case "tsx": return typescript.default.ScriptKind.TSX;
|
|
489
|
+
case "jsx": return typescript.default.ScriptKind.JSX;
|
|
490
|
+
case "js":
|
|
491
|
+
case "cjs":
|
|
492
|
+
case "mjs": return typescript.default.ScriptKind.JS;
|
|
493
|
+
default: return typescript.default.ScriptKind.TS;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
450
496
|
/**
|
|
451
|
-
*
|
|
497
|
+
* Builds a TypeScript program from original sources collected during the
|
|
498
|
+
* esbuild graph walk so type information remains intact for schema generation.
|
|
499
|
+
*/
|
|
500
|
+
function createProgramFromSources(filePath, source, config) {
|
|
501
|
+
const compilerOptions = getTsCompilerOptions(config);
|
|
502
|
+
const host = typescript.default.createCompilerHost(compilerOptions, true);
|
|
503
|
+
const baseFileExists = host.fileExists.bind(host);
|
|
504
|
+
const baseReadFile = host.readFile.bind(host);
|
|
505
|
+
const baseGetSourceFile = host.getSourceFile.bind(host);
|
|
506
|
+
host.fileExists = (name) => filePath === name || baseFileExists(name);
|
|
507
|
+
host.readFile = (name) => filePath === name ? source : baseReadFile(name);
|
|
508
|
+
host.getSourceFile = (name, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => {
|
|
509
|
+
if (filePath === name) {
|
|
510
|
+
const scriptTarget = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.languageVersion : languageVersionOrOptions;
|
|
511
|
+
return typescript.default.createSourceFile(name, source, scriptTarget ?? compilerOptions.target ?? typescript.default.ScriptTarget.ES2022, true, getScriptKind(name));
|
|
512
|
+
}
|
|
513
|
+
return baseGetSourceFile(name, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
514
|
+
};
|
|
515
|
+
const program = typescript.default.createProgram([filePath], compilerOptions, host);
|
|
516
|
+
if (!config.skipTypeCheck) {
|
|
517
|
+
const diagnostics = typescript.default.getPreEmitDiagnostics(program);
|
|
518
|
+
if (diagnostics.length) throw new Error(`Type check error: ${diagnostics.map((diagnostic) => diagnostic.messageText.toString()).join("\n")}`);
|
|
519
|
+
}
|
|
520
|
+
return program;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Resolves a type definition to a JSON Schema. First bundles the TypeScript
|
|
524
|
+
* module graph for {@link FileReference.file} with esbuild (preserving original
|
|
525
|
+
* sources), then feeds that program to
|
|
526
|
+
* [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator)
|
|
527
|
+
* using the referenced export name as the target type when one is provided.
|
|
452
528
|
*
|
|
453
529
|
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
454
530
|
* @param options - Optional overrides reserved for API compatibility.
|
|
@@ -461,19 +537,30 @@ async function extractTSType(input, options = {}) {
|
|
|
461
537
|
const resolvedPath = await (0, _stryke_fs_resolve.resolveSafe)(fileReference.file, { fs: options.fs });
|
|
462
538
|
const filePath = resolvedPath || fileReference.file;
|
|
463
539
|
try {
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
540
|
+
const tsconfig = options.tsconfig ? (0, _stryke_path_append.appendPath)(options.tsconfig, options.cwd || process.cwd()) : (0, _stryke_path_join.joinPaths)(options.cwd || process.cwd(), "tsconfig.json");
|
|
541
|
+
const bundled = await (0, _stryke_resolve_resolve.resolve)(filePath, {
|
|
542
|
+
cwd: options.cwd || process.cwd(),
|
|
543
|
+
fs: options.fs
|
|
544
|
+
});
|
|
545
|
+
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}"`);
|
|
546
|
+
const config = {
|
|
547
|
+
...ts_json_schema_generator_dist_src_Config_js.DEFAULT_CONFIG,
|
|
467
548
|
expose: "all",
|
|
468
549
|
jsDoc: "extended",
|
|
469
550
|
markdownDescription: true,
|
|
470
551
|
fullDescription: true,
|
|
471
|
-
skipTypeCheck: true,
|
|
472
552
|
...options,
|
|
473
|
-
tsconfig
|
|
553
|
+
tsconfig,
|
|
554
|
+
path: filePath,
|
|
555
|
+
type: exportName,
|
|
556
|
+
skipTypeCheck: true,
|
|
557
|
+
functions: "schema"
|
|
474
558
|
};
|
|
475
|
-
|
|
476
|
-
return (0, ts_json_schema_generator_dist_factory_generator_js.createGenerator)(
|
|
559
|
+
const tsProgram = createProgramFromSources(filePath, bundled, config);
|
|
560
|
+
return (0, ts_json_schema_generator_dist_factory_generator_js.createGenerator)({
|
|
561
|
+
...config,
|
|
562
|
+
tsProgram
|
|
563
|
+
}).createSchema(exportName);
|
|
477
564
|
} catch (error) {
|
|
478
565
|
throw new Error(`Failed to generate a JSON schema for "${fileReference.file}"${resolvedPath && resolvedPath !== fileReference.file ? ` (resolved: ${resolvedPath})` : ""} using the type "${exportName}". Error: ${error.message}`);
|
|
479
566
|
}
|
|
@@ -606,6 +693,7 @@ async function extract(input, options = {}) {
|
|
|
606
693
|
}
|
|
607
694
|
|
|
608
695
|
//#endregion
|
|
696
|
+
exports.JSON_SCHEMA_CONSTRUCTOR_KEY = require_constants.JSON_SCHEMA_CONSTRUCTOR_KEY;
|
|
609
697
|
exports.JSON_SCHEMA_METADATA_KEYS = require_constants.JSON_SCHEMA_METADATA_KEYS;
|
|
610
698
|
exports.JSON_SCHEMA_PRIMITIVE_TYPES = require_constants.JSON_SCHEMA_PRIMITIVE_TYPES;
|
|
611
699
|
exports.JSON_SCHEMA_TYPES = require_constants.JSON_SCHEMA_TYPES;
|
|
@@ -634,6 +722,7 @@ exports.getPrimarySchemaType = require_helpers.getPrimarySchemaType;
|
|
|
634
722
|
exports.getProperties = require_helpers.getProperties;
|
|
635
723
|
exports.getPropertiesList = require_helpers.getPropertiesList;
|
|
636
724
|
exports.getProperty = require_helpers.getProperty;
|
|
725
|
+
exports.hasJsonSchemaConstructorFlag = require_helpers.hasJsonSchemaConstructorFlag;
|
|
637
726
|
exports.isFileReference = require_helpers.isFileReference;
|
|
638
727
|
exports.isJsonSchema = require_helpers.isJsonSchema;
|
|
639
728
|
exports.isJsonSchemaAllOf = require_helpers.isJsonSchemaAllOf;
|
|
@@ -676,10 +765,13 @@ exports.isSchemaWithSource = require_helpers.isSchemaWithSource;
|
|
|
676
765
|
exports.isStandardSchema = require_helpers.isStandardSchema;
|
|
677
766
|
exports.isUntypedConfig = require_helpers.isUntypedConfig;
|
|
678
767
|
exports.isUntypedConfigStrict = require_helpers.isUntypedConfigStrict;
|
|
768
|
+
exports.isUntypedInput = require_helpers.isUntypedInput;
|
|
769
|
+
exports.isUntypedInputStrict = require_helpers.isUntypedInputStrict;
|
|
679
770
|
exports.isUntypedSchema = require_helpers.isUntypedSchema;
|
|
680
771
|
exports.isUntypedSchemaStrict = require_helpers.isUntypedSchemaStrict;
|
|
681
772
|
exports.isValibotSchema = require_helpers.isValibotSchema;
|
|
682
773
|
exports.isValidSchemaConfigFile = require_helpers.isValidSchemaConfigFile;
|
|
774
|
+
exports.isValidSchemaInputFile = require_helpers.isValidSchemaInputFile;
|
|
683
775
|
exports.mapStorageToFileSystem = require_storage.mapStorageToFileSystem;
|
|
684
776
|
exports.merge = require_helpers.merge;
|
|
685
777
|
exports.mergeMetadata = require_helpers.mergeMetadata;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as SchemaSourceConfig, A as JsonSchemaNumber, B as JsonSchemaSet, C as JsonSchemaLogicKeywords, D as JsonSchemaNever, E as JsonSchemaNativeEnum, F as JsonSchemaPrimitiveUnion, G as JsonSchemaUndefined, H as JsonSchemaStringFormat, I as JsonSchemaRecord, J as SchemaConfig, K as JsonSchemaUnion, L as JsonSchemaRecordPropertyNames, M as JsonSchemaObject, N as JsonSchemaOf, O as JsonSchemaNull, P as JsonSchemaPrimitiveType, Q as SchemaSource, R as JsonSchemaRef, S as JsonSchemaLiteral, T as JsonSchemaMetadataKeywords, U as JsonSchemaTuple, V as JsonSchemaString, W as JsonSchemaType, X as SchemaEnvelope, Y as SchemaConfigVariant, Z as SchemaEnvelopeOf, _ as JsonSchemaFunctionParameter, a as JsonSchema, at as UntypedSchemaSource, b as JsonSchemaKeywords, c as JsonSchemaAnyOf, ct as Zod3SchemaSource, d as JsonSchemaBoolean, dt as JSON_SCHEMA_PRIMITIVE_TYPES, et as SchemaSourceVariant, f as JsonSchemaConditionalKeywords, ft as JSON_SCHEMA_TYPES, g as JsonSchemaEnum, gt as SCHEMA_SINGLE_KEYWORDS, h as JsonSchemaDecimalFormat, ht as SCHEMA_RECORD_KEYWORDS, i as InferExtractOptions, it as UntypedSchema, j as JsonSchemaNumberFormat, k as JsonSchemaNullable, l as JsonSchemaArray, lt as JSON_SCHEMA_CONSTRUCTOR_KEY, m as JsonSchemaDecimal, mt as SCHEMA_ARRAY_CONCAT_KEYWORDS, n as BaseSchemaSource, nt as StandardSchemaSchemaSource, o as JsonSchemaAllOf, ot as ValibotSchema, p as JsonSchemaDate, pt as JsonSchemaTypeNames, q as JsonSchemaUnknown, r as ExtractedSchemaEnvelope, rt as UntypedConfigObject, s as JsonSchemaAny, st as ValibotSchemaSource, t as BaseExtractOptions, tt as SpecOf, u as JsonSchemaBigint, ut as JSON_SCHEMA_METADATA_KEYS, v as JsonSchemaInteger, w as JsonSchemaMap, x as JsonSchemaLike, y as JsonSchemaIntegerFormat, z as JsonSchemaSchemaSource } from "./types-CEGqfUA4.cjs";
|
|
2
2
|
import { n as createStoragePromises, r as normalizeKey, t as mapStorageToFileSystem } from "./index-ldf5lukz.cjs";
|
|
3
3
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
import { InferLoadOptions } from "@stryke/resolve/types";
|
|
@@ -84,7 +84,11 @@ declare function extractSchema(input: SchemaSourceConfig, variant?: SchemaConfig
|
|
|
84
84
|
*/
|
|
85
85
|
declare function extractSource(variant: SchemaSourceVariant, input: SchemaSourceConfig): SchemaSource;
|
|
86
86
|
/**
|
|
87
|
-
* Resolves a type definition to a JSON Schema.
|
|
87
|
+
* Resolves a type definition to a JSON Schema. First bundles the TypeScript
|
|
88
|
+
* module graph for {@link FileReference.file} with esbuild (preserving original
|
|
89
|
+
* sources), then feeds that program to
|
|
90
|
+
* [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator)
|
|
91
|
+
* using the referenced export name as the target type when one is provided.
|
|
88
92
|
*
|
|
89
93
|
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
90
94
|
* @param options - Optional overrides reserved for API compatibility.
|
|
@@ -289,6 +293,8 @@ declare function isPropertyOptional(parent: JsonSchemaObject, propertyName: stri
|
|
|
289
293
|
* @returns `true` if the file name has a valid schema input extension, otherwise `false`.
|
|
290
294
|
*/
|
|
291
295
|
declare function isValidSchemaConfigFile(fileName: string): boolean;
|
|
296
|
+
/** @deprecated Use {@link isValidSchemaConfigFile} */
|
|
297
|
+
declare const isValidSchemaInputFile: typeof isValidSchemaConfigFile;
|
|
292
298
|
/**
|
|
293
299
|
* Traverses a JSON Schema and applies a callback function to each schema fragment.
|
|
294
300
|
*
|
|
@@ -560,6 +566,17 @@ declare function isStandardSchema(input: unknown): input is StandardSchemaV1;
|
|
|
560
566
|
* @returns True if the input is a Valibot BaseSchema, false otherwise.
|
|
561
567
|
*/
|
|
562
568
|
declare function isValibotSchema(input: unknown): input is BaseSchema<any, any, any>;
|
|
569
|
+
/**
|
|
570
|
+
* Returns true when `input` is a function schema that represents a constructor.
|
|
571
|
+
*
|
|
572
|
+
* @remarks
|
|
573
|
+
* Uses `Object.hasOwn` on {@link JSON_SCHEMA_CONSTRUCTOR_KEY}. Do not read
|
|
574
|
+
* `schema.constructor` — that returns `Object.prototype.constructor`.
|
|
575
|
+
*
|
|
576
|
+
* @param input - A JSON Schema (or unknown value) to inspect.
|
|
577
|
+
* @returns True when the schema has an own `"constructor": true` flag.
|
|
578
|
+
*/
|
|
579
|
+
declare function hasJsonSchemaConstructorFlag(input: unknown): boolean;
|
|
563
580
|
/**
|
|
564
581
|
* Type guard for JSON Schema types.
|
|
565
582
|
*
|
|
@@ -610,6 +627,8 @@ declare function isUntypedSchemaStrict(input: unknown): input is Schema;
|
|
|
610
627
|
* @param input - The value to check.
|
|
611
628
|
* @returns True if the input is an untyped input object, false otherwise.
|
|
612
629
|
*/
|
|
630
|
+
/** @deprecated Use {@link isUntypedConfig} */
|
|
631
|
+
declare const isUntypedInput: typeof isUntypedConfig;
|
|
613
632
|
declare function isUntypedConfig(input: unknown): input is InputObject;
|
|
614
633
|
/**
|
|
615
634
|
* Strict type guard for untyped input objects.
|
|
@@ -621,6 +640,8 @@ declare function isUntypedConfig(input: unknown): input is InputObject;
|
|
|
621
640
|
* @param input - The value to check.
|
|
622
641
|
* @returns True if the input is an untyped input object and not JSON Schema.
|
|
623
642
|
*/
|
|
643
|
+
/** @deprecated Use {@link isUntypedConfigStrict} */
|
|
644
|
+
declare const isUntypedInputStrict: typeof isUntypedConfigStrict;
|
|
624
645
|
declare function isUntypedConfigStrict(input: unknown): input is InputObject;
|
|
625
646
|
/**
|
|
626
647
|
* Type guard for Powerlines Schema objects.
|
|
@@ -651,5 +672,5 @@ declare function isSchemaWithSource(input: unknown): input is ExtractedSchemaEnv
|
|
|
651
672
|
*/
|
|
652
673
|
declare function isSchemaObject(input: unknown): input is SchemaEnvelope<JsonSchemaObject>;
|
|
653
674
|
//#endregion
|
|
654
|
-
export { type BaseExtractOptions, type BaseSchemaSource, type ExtractedSchemaEnvelope, GetPropertyResult, type InferExtractOptions, JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, type JsonSchema, type JsonSchemaAllOf, type JsonSchemaAny, type JsonSchemaAnyOf, type JsonSchemaArray, type JsonSchemaBigint, type JsonSchemaBoolean, type JsonSchemaConditionalKeywords, type JsonSchemaDate, type JsonSchemaDecimal, type JsonSchemaDecimalFormat, type JsonSchemaEnum, type JsonSchemaInteger, type JsonSchemaIntegerFormat, type JsonSchemaKeywords, type JsonSchemaLike, type JsonSchemaLiteral, type JsonSchemaLogicKeywords, type JsonSchemaMap, type JsonSchemaMetadataKeywords, type JsonSchemaNativeEnum, type JsonSchemaNever, type JsonSchemaNull, type JsonSchemaNullable, type JsonSchemaNumber, type JsonSchemaNumberFormat, type JsonSchemaObject, type JsonSchemaOf, type JsonSchemaPrimitiveType, type JsonSchemaPrimitiveUnion, type JsonSchemaRecord, type JsonSchemaRecordPropertyNames, type JsonSchemaRef, type JsonSchemaSchemaSource, type JsonSchemaSet, type JsonSchemaString, type JsonSchemaStringFormat, type JsonSchemaTuple, type JsonSchemaType, JsonSchemaTypeNames, type JsonSchemaUndefined, type JsonSchemaUnion, type JsonSchemaUnknown, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, type SchemaConfig, type SchemaConfigVariant, type SchemaEnvelope, type SchemaEnvelopeOf, type SchemaSource, type SchemaSourceConfig, type SchemaSourceVariant, type SpecOf, type StandardSchemaSchemaSource, type UntypedConfigObject, type UntypedSchema, type UntypedSchemaSource, type ValibotSchema, type ValibotSchemaSource, type Zod3SchemaSource, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createStoragePromises, extract, extractHash, extractJsonSchema, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema };
|
|
675
|
+
export { type BaseExtractOptions, type BaseSchemaSource, type ExtractedSchemaEnvelope, GetPropertyResult, type InferExtractOptions, JSON_SCHEMA_CONSTRUCTOR_KEY, JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, type JsonSchema, type JsonSchemaAllOf, type JsonSchemaAny, type JsonSchemaAnyOf, type JsonSchemaArray, type JsonSchemaBigint, type JsonSchemaBoolean, type JsonSchemaConditionalKeywords, type JsonSchemaDate, type JsonSchemaDecimal, type JsonSchemaDecimalFormat, type JsonSchemaEnum, type JsonSchemaFunctionParameter, type JsonSchemaInteger, type JsonSchemaIntegerFormat, type JsonSchemaKeywords, type JsonSchemaLike, type JsonSchemaLiteral, type JsonSchemaLogicKeywords, type JsonSchemaMap, type JsonSchemaMetadataKeywords, type JsonSchemaNativeEnum, type JsonSchemaNever, type JsonSchemaNull, type JsonSchemaNullable, type JsonSchemaNumber, type JsonSchemaNumberFormat, type JsonSchemaObject, type JsonSchemaOf, type JsonSchemaPrimitiveType, type JsonSchemaPrimitiveUnion, type JsonSchemaRecord, type JsonSchemaRecordPropertyNames, type JsonSchemaRef, type JsonSchemaSchemaSource, type JsonSchemaSet, type JsonSchemaString, type JsonSchemaStringFormat, type JsonSchemaTuple, type JsonSchemaType, JsonSchemaTypeNames, type JsonSchemaUndefined, type JsonSchemaUnion, type JsonSchemaUnknown, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, type SchemaConfig, type SchemaConfigVariant, type SchemaEnvelope, type SchemaEnvelopeOf, type SchemaSource, type SchemaSourceConfig, type SchemaSourceVariant, type SpecOf, type StandardSchemaSchemaSource, type UntypedConfigObject, type UntypedSchema, type UntypedSchemaSource, type ValibotSchema, type ValibotSchemaSource, type Zod3SchemaSource, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createStoragePromises, extract, extractHash, extractJsonSchema, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, hasJsonSchemaConstructorFlag, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema };
|
|
655
676
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/compatibility.ts","../src/extract.ts","../src/helpers.ts","../src/metadata.ts","../src/type-checks.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAwGgB,yBACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBAqHc,6BACd,MAAM,YACN,UAAU,YACV;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/compatibility.ts","../src/extract.ts","../src/helpers.ts","../src/metadata.ts","../src/type-checks.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAwGgB,yBACd,MAAM,YACN,UAAU,YACV;;;;;;;;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iBAAiB,SAAS;;;;;;;iBAmB5C,oBACd,iBACC,SAAS;;;;;;;iBAUI,kBAAkB,iBAAiB,SAAS;;;;;;;iBAkB5C,gBAAgB,iBAAiB,SAAS;;;;;;;iBAgB1C,iBAAiB,iBAAiB,SAAS;;;;;;;iBAqB3C,gBACd,iBACC,SAAS;;;;;;;;;;;iBA2BI,6BAA6B;;;;;;;;;;iBAoB7B,aAAa,iBAAiB,SAAS;;;;;;;;;;iBAsCvC,qBAAqB,iBAAiB,SAAS;;;;;;;;;;iBAa/C,gBAAgB,iBAAiB,SAAS;;;;;;;;;;;iBAyD1C,sBAAsB,iBAAiB,SAAS;;;;;;;;;;;cAmBnD,uBAAc;iBAEX,gBAAgB,iBAAiB,SAAS;;;;;;;;;;;;cA2B7C,6BAAoB;iBAEjB,sBACd,iBACC,SAAS;;;;;;;iBAuBI,SAAS,iBAAiB,SAAS;;;;;;;iBAkBnC,WAAW,OACzB,iBACC,SAAS,iBAAiB;;;;;;;iBAUb,mBAAmB,iBAAiB,SAAS;;;;;;;iBAiB7C,eACd,iBACC,SAAS,eAAe"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as SchemaSourceConfig, A as JsonSchemaNumber, B as JsonSchemaSet, C as JsonSchemaLogicKeywords, D as JsonSchemaNever, E as JsonSchemaNativeEnum, F as JsonSchemaPrimitiveUnion, G as JsonSchemaUndefined, H as JsonSchemaStringFormat, I as JsonSchemaRecord, J as SchemaConfig, K as JsonSchemaUnion, L as JsonSchemaRecordPropertyNames, M as JsonSchemaObject, N as JsonSchemaOf, O as JsonSchemaNull, P as JsonSchemaPrimitiveType, Q as SchemaSource, R as JsonSchemaRef, S as JsonSchemaLiteral, T as JsonSchemaMetadataKeywords, U as JsonSchemaTuple, V as JsonSchemaString, W as JsonSchemaType, X as SchemaEnvelope, Y as SchemaConfigVariant, Z as SchemaEnvelopeOf, _ as JsonSchemaFunctionParameter, a as JsonSchema, at as UntypedSchemaSource, b as JsonSchemaKeywords, c as JsonSchemaAnyOf, ct as Zod3SchemaSource, d as JsonSchemaBoolean, dt as JSON_SCHEMA_PRIMITIVE_TYPES, et as SchemaSourceVariant, f as JsonSchemaConditionalKeywords, ft as JSON_SCHEMA_TYPES, g as JsonSchemaEnum, gt as SCHEMA_SINGLE_KEYWORDS, h as JsonSchemaDecimalFormat, ht as SCHEMA_RECORD_KEYWORDS, i as InferExtractOptions, it as UntypedSchema, j as JsonSchemaNumberFormat, k as JsonSchemaNullable, l as JsonSchemaArray, lt as JSON_SCHEMA_CONSTRUCTOR_KEY, m as JsonSchemaDecimal, mt as SCHEMA_ARRAY_CONCAT_KEYWORDS, n as BaseSchemaSource, nt as StandardSchemaSchemaSource, o as JsonSchemaAllOf, ot as ValibotSchema, p as JsonSchemaDate, pt as JsonSchemaTypeNames, q as JsonSchemaUnknown, r as ExtractedSchemaEnvelope, rt as UntypedConfigObject, s as JsonSchemaAny, st as ValibotSchemaSource, t as BaseExtractOptions, tt as SpecOf, u as JsonSchemaBigint, ut as JSON_SCHEMA_METADATA_KEYS, v as JsonSchemaInteger, w as JsonSchemaMap, x as JsonSchemaLike, y as JsonSchemaIntegerFormat, z as JsonSchemaSchemaSource } from "./types-OH3Npqz2.mjs";
|
|
2
2
|
import { n as createStoragePromises, r as normalizeKey, t as mapStorageToFileSystem } from "./index-C7q4X7Bo.mjs";
|
|
3
3
|
import { BaseSchema } from "valibot";
|
|
4
4
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
@@ -84,7 +84,11 @@ declare function extractSchema(input: SchemaSourceConfig, variant?: SchemaConfig
|
|
|
84
84
|
*/
|
|
85
85
|
declare function extractSource(variant: SchemaSourceVariant, input: SchemaSourceConfig): SchemaSource;
|
|
86
86
|
/**
|
|
87
|
-
* Resolves a type definition to a JSON Schema.
|
|
87
|
+
* Resolves a type definition to a JSON Schema. First bundles the TypeScript
|
|
88
|
+
* module graph for {@link FileReference.file} with esbuild (preserving original
|
|
89
|
+
* sources), then feeds that program to
|
|
90
|
+
* [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator)
|
|
91
|
+
* using the referenced export name as the target type when one is provided.
|
|
88
92
|
*
|
|
89
93
|
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
90
94
|
* @param options - Optional overrides reserved for API compatibility.
|
|
@@ -289,6 +293,8 @@ declare function isPropertyOptional(parent: JsonSchemaObject, propertyName: stri
|
|
|
289
293
|
* @returns `true` if the file name has a valid schema input extension, otherwise `false`.
|
|
290
294
|
*/
|
|
291
295
|
declare function isValidSchemaConfigFile(fileName: string): boolean;
|
|
296
|
+
/** @deprecated Use {@link isValidSchemaConfigFile} */
|
|
297
|
+
declare const isValidSchemaInputFile: typeof isValidSchemaConfigFile;
|
|
292
298
|
/**
|
|
293
299
|
* Traverses a JSON Schema and applies a callback function to each schema fragment.
|
|
294
300
|
*
|
|
@@ -560,6 +566,17 @@ declare function isStandardSchema(input: unknown): input is StandardSchemaV1;
|
|
|
560
566
|
* @returns True if the input is a Valibot BaseSchema, false otherwise.
|
|
561
567
|
*/
|
|
562
568
|
declare function isValibotSchema(input: unknown): input is BaseSchema<any, any, any>;
|
|
569
|
+
/**
|
|
570
|
+
* Returns true when `input` is a function schema that represents a constructor.
|
|
571
|
+
*
|
|
572
|
+
* @remarks
|
|
573
|
+
* Uses `Object.hasOwn` on {@link JSON_SCHEMA_CONSTRUCTOR_KEY}. Do not read
|
|
574
|
+
* `schema.constructor` — that returns `Object.prototype.constructor`.
|
|
575
|
+
*
|
|
576
|
+
* @param input - A JSON Schema (or unknown value) to inspect.
|
|
577
|
+
* @returns True when the schema has an own `"constructor": true` flag.
|
|
578
|
+
*/
|
|
579
|
+
declare function hasJsonSchemaConstructorFlag(input: unknown): boolean;
|
|
563
580
|
/**
|
|
564
581
|
* Type guard for JSON Schema types.
|
|
565
582
|
*
|
|
@@ -610,6 +627,8 @@ declare function isUntypedSchemaStrict(input: unknown): input is Schema;
|
|
|
610
627
|
* @param input - The value to check.
|
|
611
628
|
* @returns True if the input is an untyped input object, false otherwise.
|
|
612
629
|
*/
|
|
630
|
+
/** @deprecated Use {@link isUntypedConfig} */
|
|
631
|
+
declare const isUntypedInput: typeof isUntypedConfig;
|
|
613
632
|
declare function isUntypedConfig(input: unknown): input is InputObject;
|
|
614
633
|
/**
|
|
615
634
|
* Strict type guard for untyped input objects.
|
|
@@ -621,6 +640,8 @@ declare function isUntypedConfig(input: unknown): input is InputObject;
|
|
|
621
640
|
* @param input - The value to check.
|
|
622
641
|
* @returns True if the input is an untyped input object and not JSON Schema.
|
|
623
642
|
*/
|
|
643
|
+
/** @deprecated Use {@link isUntypedConfigStrict} */
|
|
644
|
+
declare const isUntypedInputStrict: typeof isUntypedConfigStrict;
|
|
624
645
|
declare function isUntypedConfigStrict(input: unknown): input is InputObject;
|
|
625
646
|
/**
|
|
626
647
|
* Type guard for Powerlines Schema objects.
|
|
@@ -651,5 +672,5 @@ declare function isSchemaWithSource(input: unknown): input is ExtractedSchemaEnv
|
|
|
651
672
|
*/
|
|
652
673
|
declare function isSchemaObject(input: unknown): input is SchemaEnvelope<JsonSchemaObject>;
|
|
653
674
|
//#endregion
|
|
654
|
-
export { type BaseExtractOptions, type BaseSchemaSource, type ExtractedSchemaEnvelope, GetPropertyResult, type InferExtractOptions, JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, type JsonSchema, type JsonSchemaAllOf, type JsonSchemaAny, type JsonSchemaAnyOf, type JsonSchemaArray, type JsonSchemaBigint, type JsonSchemaBoolean, type JsonSchemaConditionalKeywords, type JsonSchemaDate, type JsonSchemaDecimal, type JsonSchemaDecimalFormat, type JsonSchemaEnum, type JsonSchemaInteger, type JsonSchemaIntegerFormat, type JsonSchemaKeywords, type JsonSchemaLike, type JsonSchemaLiteral, type JsonSchemaLogicKeywords, type JsonSchemaMap, type JsonSchemaMetadataKeywords, type JsonSchemaNativeEnum, type JsonSchemaNever, type JsonSchemaNull, type JsonSchemaNullable, type JsonSchemaNumber, type JsonSchemaNumberFormat, type JsonSchemaObject, type JsonSchemaOf, type JsonSchemaPrimitiveType, type JsonSchemaPrimitiveUnion, type JsonSchemaRecord, type JsonSchemaRecordPropertyNames, type JsonSchemaRef, type JsonSchemaSchemaSource, type JsonSchemaSet, type JsonSchemaString, type JsonSchemaStringFormat, type JsonSchemaTuple, type JsonSchemaType, JsonSchemaTypeNames, type JsonSchemaUndefined, type JsonSchemaUnion, type JsonSchemaUnknown, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, type SchemaConfig, type SchemaConfigVariant, type SchemaEnvelope, type SchemaEnvelopeOf, type SchemaSource, type SchemaSourceConfig, type SchemaSourceVariant, type SpecOf, type StandardSchemaSchemaSource, type UntypedConfigObject, type UntypedSchema, type UntypedSchemaSource, type ValibotSchema, type ValibotSchemaSource, type Zod3SchemaSource, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createStoragePromises, extract, extractHash, extractJsonSchema, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema };
|
|
675
|
+
export { type BaseExtractOptions, type BaseSchemaSource, type ExtractedSchemaEnvelope, GetPropertyResult, type InferExtractOptions, JSON_SCHEMA_CONSTRUCTOR_KEY, JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, type JsonSchema, type JsonSchemaAllOf, type JsonSchemaAny, type JsonSchemaAnyOf, type JsonSchemaArray, type JsonSchemaBigint, type JsonSchemaBoolean, type JsonSchemaConditionalKeywords, type JsonSchemaDate, type JsonSchemaDecimal, type JsonSchemaDecimalFormat, type JsonSchemaEnum, type JsonSchemaFunctionParameter, type JsonSchemaInteger, type JsonSchemaIntegerFormat, type JsonSchemaKeywords, type JsonSchemaLike, type JsonSchemaLiteral, type JsonSchemaLogicKeywords, type JsonSchemaMap, type JsonSchemaMetadataKeywords, type JsonSchemaNativeEnum, type JsonSchemaNever, type JsonSchemaNull, type JsonSchemaNullable, type JsonSchemaNumber, type JsonSchemaNumberFormat, type JsonSchemaObject, type JsonSchemaOf, type JsonSchemaPrimitiveType, type JsonSchemaPrimitiveUnion, type JsonSchemaRecord, type JsonSchemaRecordPropertyNames, type JsonSchemaRef, type JsonSchemaSchemaSource, type JsonSchemaSet, type JsonSchemaString, type JsonSchemaStringFormat, type JsonSchemaTuple, type JsonSchemaType, JsonSchemaTypeNames, type JsonSchemaUndefined, type JsonSchemaUnion, type JsonSchemaUnknown, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, type SchemaConfig, type SchemaConfigVariant, type SchemaEnvelope, type SchemaEnvelopeOf, type SchemaSource, type SchemaSourceConfig, type SchemaSourceVariant, type SpecOf, type StandardSchemaSchemaSource, type UntypedConfigObject, type UntypedSchema, type UntypedSchemaSource, type ValibotSchema, type ValibotSchemaSource, type Zod3SchemaSource, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createStoragePromises, extract, extractHash, extractJsonSchema, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, hasJsonSchemaConstructorFlag, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema };
|
|
655
676
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { $ as
|
|
1
|
+
import { a as JsonSchemaTypeNames, c as SCHEMA_SINGLE_KEYWORDS, i as JSON_SCHEMA_TYPES, n as JSON_SCHEMA_METADATA_KEYS, o as SCHEMA_ARRAY_CONCAT_KEYWORDS, r as JSON_SCHEMA_PRIMITIVE_TYPES, s as SCHEMA_RECORD_KEYWORDS, t as JSON_SCHEMA_CONSTRUCTOR_KEY } from "./constants-BlppSDwG.mjs";
|
|
2
|
+
import { $ as isUntypedConfig, A as isJsonSchemaNativeEnum, B as isJsonSchemaSet, C as isJsonSchemaDate, D as isJsonSchemaKeywords, E as isJsonSchemaInteger, F as isJsonSchemaObject, G as isJsonSchemaUnion, H as isJsonSchemaTuple, I as isJsonSchemaPrimitiveType, J as isSchema, K as isJsonSchemaUnknown, L as isJsonSchemaPrimitiveUnion, M as isJsonSchemaNull, N as isJsonSchemaNullable, O as isJsonSchemaLiteral, P as isJsonSchemaNumber, Q as isStandardSchema, R as isJsonSchemaRecord, S as isJsonSchemaBoolean, T as isJsonSchemaEnum, U as isJsonSchemaType, V as isJsonSchemaString, W as isJsonSchemaUndefined, X as isSchemaOf, Y as isSchemaObject, Z as isSchemaWithSource, _ as isJsonSchemaAllOf, a as getPropertiesList, at as isValibotSchema, b as isJsonSchemaArray, c as isSchemaNullable, ct as readSchemaTypes, d as merge, et as isUntypedConfigStrict, f as mergeMetadata, g as isJsonSchema, h as isFileReference, i as getProperties, it as isUntypedSchemaStrict, j as isJsonSchemaNever, k as isJsonSchemaMap, l as isValidSchemaConfigFile, m as hasJsonSchemaConstructorFlag, n as getJsonSchema, nt as isUntypedInputStrict, o as getProperty, ot as applyJsonSchemaMetadata, p as traverseSchema, q as isNullOnlyJsonSchema, r as getJsonSchemaObject, rt as isUntypedSchema, s as isPropertyOptional, st as getPrimarySchemaType, t as addProperty, tt as isUntypedInput, u as isValidSchemaInputFile, v as isJsonSchemaAny, w as isJsonSchemaDecimal, x as isJsonSchemaBigint, y as isJsonSchemaAnyOf, z as isJsonSchemaRef } from "./helpers-BxWdDZn4.mjs";
|
|
3
3
|
import { n as createStoragePromises, r as normalizeKey, t as mapStorageToFileSystem } from "./storage-C3BT2Xh-.mjs";
|
|
4
4
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
5
5
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
@@ -10,14 +10,17 @@ import { murmurhash } from "@stryke/hash";
|
|
|
10
10
|
import { deepClone } from "@stryke/helpers/deep-clone";
|
|
11
11
|
import { isStandardJsonSchema } from "@stryke/json";
|
|
12
12
|
import { appendPath } from "@stryke/path/append";
|
|
13
|
-
import { findFileExtensionSafe } from "@stryke/path/find";
|
|
13
|
+
import { findFileExtensionSafe, findFilePath } from "@stryke/path/find";
|
|
14
14
|
import { joinPaths } from "@stryke/path/join";
|
|
15
15
|
import { VALID_OBJECT_SOURCE_EXTENSIONS } from "@stryke/resolve/constants";
|
|
16
16
|
import { loadSafe } from "@stryke/resolve/load";
|
|
17
|
+
import { resolve } from "@stryke/resolve/resolve";
|
|
17
18
|
import { list } from "@stryke/string-format/list";
|
|
18
19
|
import { extractJsonSchema as extractJsonSchema$1, isZod3Type } from "@stryke/zod";
|
|
19
20
|
import { toJsonSchema } from "@valibot/to-json-schema";
|
|
20
21
|
import { createGenerator } from "ts-json-schema-generator/dist/factory/generator.js";
|
|
22
|
+
import { DEFAULT_CONFIG } from "ts-json-schema-generator/dist/src/Config.js";
|
|
23
|
+
import ts from "typescript";
|
|
21
24
|
|
|
22
25
|
//#region src/compatibility.ts
|
|
23
26
|
const METADATA_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -446,8 +449,79 @@ function extractSource(variant, input) {
|
|
|
446
449
|
};
|
|
447
450
|
throw new Error(`Failed to extract source information from the provided input. The input must be a Zod schema, a Standard JSON Schema, a JSON Schema object, an untyped schema, or a reflected Deepkit Type object.`);
|
|
448
451
|
}
|
|
452
|
+
function getTsCompilerOptions(config) {
|
|
453
|
+
if (config.tsconfig) {
|
|
454
|
+
const raw = ts.sys.readFile(config.tsconfig);
|
|
455
|
+
if (!raw) throw new Error(`Cannot read config file "${config.tsconfig}"`);
|
|
456
|
+
const parsedConfig = ts.parseConfigFileTextToJson(config.tsconfig, raw);
|
|
457
|
+
if (parsedConfig.error) throw new Error(parsedConfig.error.messageText.toString());
|
|
458
|
+
if (!parsedConfig.config) throw new Error(`Invalid parsed config file "${config.tsconfig}"`);
|
|
459
|
+
const parseResult = ts.parseJsonConfigFileContent(parsedConfig.config, ts.sys, findFilePath(config.tsconfig), {}, config.tsconfig);
|
|
460
|
+
parseResult.options.noEmit = true;
|
|
461
|
+
delete parseResult.options.out;
|
|
462
|
+
delete parseResult.options.outDir;
|
|
463
|
+
delete parseResult.options.outFile;
|
|
464
|
+
delete parseResult.options.declaration;
|
|
465
|
+
delete parseResult.options.declarationDir;
|
|
466
|
+
delete parseResult.options.declarationMap;
|
|
467
|
+
return parseResult.options;
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
noEmit: true,
|
|
471
|
+
emitDecoratorMetadata: true,
|
|
472
|
+
experimentalDecorators: true,
|
|
473
|
+
target: ts.ScriptTarget.ES2022,
|
|
474
|
+
module: ts.ModuleKind.ESNext,
|
|
475
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
476
|
+
strictNullChecks: false,
|
|
477
|
+
skipLibCheck: true,
|
|
478
|
+
skipDefaultLibCheck: true,
|
|
479
|
+
esModuleInterop: true,
|
|
480
|
+
types: ["node"]
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
function getScriptKind(fileName) {
|
|
484
|
+
switch (findFileExtensionSafe(fileName)?.toLowerCase()) {
|
|
485
|
+
case "tsx": return ts.ScriptKind.TSX;
|
|
486
|
+
case "jsx": return ts.ScriptKind.JSX;
|
|
487
|
+
case "js":
|
|
488
|
+
case "cjs":
|
|
489
|
+
case "mjs": return ts.ScriptKind.JS;
|
|
490
|
+
default: return ts.ScriptKind.TS;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
449
493
|
/**
|
|
450
|
-
*
|
|
494
|
+
* Builds a TypeScript program from original sources collected during the
|
|
495
|
+
* esbuild graph walk so type information remains intact for schema generation.
|
|
496
|
+
*/
|
|
497
|
+
function createProgramFromSources(filePath, source, config) {
|
|
498
|
+
const compilerOptions = getTsCompilerOptions(config);
|
|
499
|
+
const host = ts.createCompilerHost(compilerOptions, true);
|
|
500
|
+
const baseFileExists = host.fileExists.bind(host);
|
|
501
|
+
const baseReadFile = host.readFile.bind(host);
|
|
502
|
+
const baseGetSourceFile = host.getSourceFile.bind(host);
|
|
503
|
+
host.fileExists = (name) => filePath === name || baseFileExists(name);
|
|
504
|
+
host.readFile = (name) => filePath === name ? source : baseReadFile(name);
|
|
505
|
+
host.getSourceFile = (name, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => {
|
|
506
|
+
if (filePath === name) {
|
|
507
|
+
const scriptTarget = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.languageVersion : languageVersionOrOptions;
|
|
508
|
+
return ts.createSourceFile(name, source, scriptTarget ?? compilerOptions.target ?? ts.ScriptTarget.ES2022, true, getScriptKind(name));
|
|
509
|
+
}
|
|
510
|
+
return baseGetSourceFile(name, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
511
|
+
};
|
|
512
|
+
const program = ts.createProgram([filePath], compilerOptions, host);
|
|
513
|
+
if (!config.skipTypeCheck) {
|
|
514
|
+
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
515
|
+
if (diagnostics.length) throw new Error(`Type check error: ${diagnostics.map((diagnostic) => diagnostic.messageText.toString()).join("\n")}`);
|
|
516
|
+
}
|
|
517
|
+
return program;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Resolves a type definition to a JSON Schema. First bundles the TypeScript
|
|
521
|
+
* module graph for {@link FileReference.file} with esbuild (preserving original
|
|
522
|
+
* sources), then feeds that program to
|
|
523
|
+
* [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator)
|
|
524
|
+
* using the referenced export name as the target type when one is provided.
|
|
451
525
|
*
|
|
452
526
|
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
453
527
|
* @param options - Optional overrides reserved for API compatibility.
|
|
@@ -460,19 +534,30 @@ async function extractTSType(input, options = {}) {
|
|
|
460
534
|
const resolvedPath = await resolveSafe(fileReference.file, { fs: options.fs });
|
|
461
535
|
const filePath = resolvedPath || fileReference.file;
|
|
462
536
|
try {
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
537
|
+
const tsconfig = options.tsconfig ? appendPath(options.tsconfig, options.cwd || process.cwd()) : joinPaths(options.cwd || process.cwd(), "tsconfig.json");
|
|
538
|
+
const bundled = await resolve(filePath, {
|
|
539
|
+
cwd: options.cwd || process.cwd(),
|
|
540
|
+
fs: options.fs
|
|
541
|
+
});
|
|
542
|
+
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}"`);
|
|
543
|
+
const config = {
|
|
544
|
+
...DEFAULT_CONFIG,
|
|
466
545
|
expose: "all",
|
|
467
546
|
jsDoc: "extended",
|
|
468
547
|
markdownDescription: true,
|
|
469
548
|
fullDescription: true,
|
|
470
|
-
skipTypeCheck: true,
|
|
471
549
|
...options,
|
|
472
|
-
tsconfig
|
|
550
|
+
tsconfig,
|
|
551
|
+
path: filePath,
|
|
552
|
+
type: exportName,
|
|
553
|
+
skipTypeCheck: true,
|
|
554
|
+
functions: "schema"
|
|
473
555
|
};
|
|
474
|
-
|
|
475
|
-
return createGenerator(
|
|
556
|
+
const tsProgram = createProgramFromSources(filePath, bundled, config);
|
|
557
|
+
return createGenerator({
|
|
558
|
+
...config,
|
|
559
|
+
tsProgram
|
|
560
|
+
}).createSchema(exportName);
|
|
476
561
|
} catch (error) {
|
|
477
562
|
throw new Error(`Failed to generate a JSON schema for "${fileReference.file}"${resolvedPath && resolvedPath !== fileReference.file ? ` (resolved: ${resolvedPath})` : ""} using the type "${exportName}". Error: ${error.message}`);
|
|
478
563
|
}
|
|
@@ -605,5 +690,5 @@ async function extract(input, options = {}) {
|
|
|
605
690
|
}
|
|
606
691
|
|
|
607
692
|
//#endregion
|
|
608
|
-
export { JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, JsonSchemaTypeNames, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createStoragePromises, extract, extractHash, extractJsonSchema, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema };
|
|
693
|
+
export { JSON_SCHEMA_CONSTRUCTOR_KEY, JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, JsonSchemaTypeNames, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createStoragePromises, extract, extractHash, extractJsonSchema, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, hasJsonSchemaConstructorFlag, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema };
|
|
609
694
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseIssue, BaseSchema } from "valibot";
|
|
2
1
|
import { StandardJSONSchemaV1 } from "@standard-schema/spec";
|
|
3
2
|
import { InferLoadOptions, LoadReference } from "@stryke/resolve/types";
|
|
4
3
|
import { Config } from "ts-json-schema-generator/dist/src/Config.js";
|
|
5
4
|
import { Storage } from "unstorage";
|
|
6
5
|
import { InputObject, Schema } from "untyped";
|
|
6
|
+
import { BaseIssue, BaseSchema } from "valibot";
|
|
7
7
|
import * as z3 from "zod/v3";
|
|
8
8
|
//#region src/constants.d.ts
|
|
9
9
|
declare const JsonSchemaTypeNames: {
|
|
@@ -18,6 +18,15 @@ declare const JsonSchemaTypeNames: {
|
|
|
18
18
|
declare const JSON_SCHEMA_PRIMITIVE_TYPES: ("string" | "number" | "boolean" | "null" | "integer")[];
|
|
19
19
|
declare const JSON_SCHEMA_TYPES: ("string" | "number" | "boolean" | "object" | "null" | "array" | "integer")[];
|
|
20
20
|
declare const JSON_SCHEMA_METADATA_KEYS: ("$id" | "$schema" | "$vocabulary" | "$comment" | "$anchor" | "$defs" | "$dynamicRef" | "$dynamicAnchor" | "name" | "version" | "title" | "description" | "docs" | "examples" | "alias" | "tags" | "deprecated" | "hidden" | "ignore" | "internal" | "runtime" | "readOnly" | "writeOnly")[];
|
|
21
|
+
/**
|
|
22
|
+
* Own-property key set to `true` on constructor function schemas.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* Must be read with `Object.hasOwn(schema, JSON_SCHEMA_CONSTRUCTOR_KEY)` (or
|
|
26
|
+
* `hasJsonSchemaConstructorFlag`) — never via `schema.constructor`, which
|
|
27
|
+
* resolves `Object.prototype.constructor`.
|
|
28
|
+
*/
|
|
29
|
+
declare const JSON_SCHEMA_CONSTRUCTOR_KEY: "constructor";
|
|
21
30
|
/**
|
|
22
31
|
* Keywords whose values are a flat record of named JSON Schema fragments.
|
|
23
32
|
* Each child schema is merged recursively with its counterpart.
|
|
@@ -63,6 +72,36 @@ type JsonSchemaNumberFormat = JsonSchemaDecimalFormat | JsonSchemaIntegerFormat;
|
|
|
63
72
|
* Semantic format names for JSON Schema string types.
|
|
64
73
|
*/
|
|
65
74
|
type JsonSchemaStringFormat = "binary" | "date" | "time" | "date-time" | "iso-time" | "iso-date-time" | "duration" | "uri" | "uri-reference" | "uri-template" | "url" | "email" | "hostname" | "ipv4" | "ipv6" | "regex" | "uuid" | "json-pointer" | "json-pointer-uri-fragment" | "relative-json-pointer" | "byte" | "password";
|
|
75
|
+
/**
|
|
76
|
+
* A single function parameter entry emitted when `function` is true.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* Power Plant extension used with `ts-json-schema-generator` `functions: "schema"` mode.
|
|
80
|
+
* Boolean flags are omitted when false. Defaults live on `schema.default`.
|
|
81
|
+
*/
|
|
82
|
+
interface JsonSchemaFunctionParameter {
|
|
83
|
+
/**
|
|
84
|
+
* Parameter name. Binding-pattern parameters use synthetic names (`$0`, `$1`, ...).
|
|
85
|
+
* Rest parameter names omit the `...` prefix.
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/**
|
|
89
|
+
* JSON Schema for the parameter value.
|
|
90
|
+
*/
|
|
91
|
+
schema: JsonSchema;
|
|
92
|
+
/**
|
|
93
|
+
* True when the parameter is declared with `?`.
|
|
94
|
+
*/
|
|
95
|
+
optional?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* True when the parameter is a rest parameter (`...args`).
|
|
98
|
+
*/
|
|
99
|
+
rest?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* True when the parameter is a `this` parameter.
|
|
102
|
+
*/
|
|
103
|
+
this?: boolean;
|
|
104
|
+
}
|
|
66
105
|
/**
|
|
67
106
|
* Metadata and annotation keywords shared across JSON Schema shapes.
|
|
68
107
|
*
|
|
@@ -127,6 +166,43 @@ interface JsonSchemaMetadataKeywords {
|
|
|
127
166
|
* @see https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-8.2.7
|
|
128
167
|
*/
|
|
129
168
|
$dynamicAnchor?: string;
|
|
169
|
+
/**
|
|
170
|
+
* An indicator specifying if the schema is a function or not.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* This is an internal property used by Power Plant - it is not part of the JSON Schema specification.
|
|
174
|
+
* When true, `parameters` describes the function arguments in declaration order and `returns`
|
|
175
|
+
* describes the return value (omitted for `void` / `undefined` / `never`).
|
|
176
|
+
*
|
|
177
|
+
* Constructor schemas also emit an own-property `"constructor": true` on the wire (see
|
|
178
|
+
* `JSON_SCHEMA_CONSTRUCTOR_KEY`). That key is intentionally omitted from this interface
|
|
179
|
+
* because a TypeScript `constructor` property collides with `Object.prototype.constructor` and
|
|
180
|
+
* breaks assignability across the schema union. Read it with `hasJsonSchemaConstructorFlag`.
|
|
181
|
+
*/
|
|
182
|
+
function?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* When true, the function is asynchronous (`async` and/or returns `Promise<T>`).
|
|
185
|
+
*
|
|
186
|
+
* @remarks
|
|
187
|
+
* This is an internal property used by Power Plant - it is not part of the JSON Schema specification.
|
|
188
|
+
* When set, `returns` describes the unwrapped `T` from `Promise<T>` (one layer).
|
|
189
|
+
*/
|
|
190
|
+
async?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Ordered function parameters when `function` is true.
|
|
193
|
+
*
|
|
194
|
+
* @remarks
|
|
195
|
+
* Always present for function schemas (may be an empty array). Each entry wraps a parameter
|
|
196
|
+
* schema with metadata such as `name`, `optional`, `rest`, and `this`.
|
|
197
|
+
*/
|
|
198
|
+
parameters?: JsonSchemaFunctionParameter[];
|
|
199
|
+
/**
|
|
200
|
+
* Return-value schema when `function` is true.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* Omitted for `void`, `undefined`, and `never` return types.
|
|
204
|
+
*/
|
|
205
|
+
returns?: JsonSchema;
|
|
130
206
|
/**
|
|
131
207
|
* A name for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable name or description for the schema. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
|
|
132
208
|
*/
|
|
@@ -1346,5 +1422,5 @@ declare module "zod" {
|
|
|
1346
1422
|
}
|
|
1347
1423
|
}
|
|
1348
1424
|
//#endregion
|
|
1349
|
-
export {
|
|
1350
|
-
//# sourceMappingURL=types-
|
|
1425
|
+
export { SchemaSourceConfig as $, JsonSchemaNumber as A, JsonSchemaSet as B, JsonSchemaLogicKeywords as C, JsonSchemaNever as D, JsonSchemaNativeEnum as E, JsonSchemaPrimitiveUnion as F, JsonSchemaUndefined as G, JsonSchemaStringFormat as H, JsonSchemaRecord as I, SchemaConfig as J, JsonSchemaUnion as K, JsonSchemaRecordPropertyNames as L, JsonSchemaObject as M, JsonSchemaOf as N, JsonSchemaNull as O, JsonSchemaPrimitiveType as P, SchemaSource as Q, JsonSchemaRef as R, JsonSchemaLiteral as S, JsonSchemaMetadataKeywords as T, JsonSchemaTuple as U, JsonSchemaString as V, JsonSchemaType as W, SchemaEnvelope as X, SchemaConfigVariant as Y, SchemaEnvelopeOf as Z, JsonSchemaFunctionParameter as _, JsonSchema as a, UntypedSchemaSource as at, JsonSchemaKeywords as b, JsonSchemaAnyOf as c, Zod3SchemaSource as ct, JsonSchemaBoolean as d, JSON_SCHEMA_PRIMITIVE_TYPES as dt, SchemaSourceVariant as et, JsonSchemaConditionalKeywords as f, JSON_SCHEMA_TYPES as ft, JsonSchemaEnum as g, SCHEMA_SINGLE_KEYWORDS as gt, JsonSchemaDecimalFormat as h, SCHEMA_RECORD_KEYWORDS as ht, InferExtractOptions as i, UntypedSchema as it, JsonSchemaNumberFormat as j, JsonSchemaNullable as k, JsonSchemaArray as l, JSON_SCHEMA_CONSTRUCTOR_KEY as lt, JsonSchemaDecimal as m, SCHEMA_ARRAY_CONCAT_KEYWORDS as mt, BaseSchemaSource as n, StandardSchemaSchemaSource as nt, JsonSchemaAllOf as o, ValibotSchema as ot, JsonSchemaDate as p, JsonSchemaTypeNames as pt, JsonSchemaUnknown as q, ExtractedSchemaEnvelope as r, UntypedConfigObject as rt, JsonSchemaAny as s, ValibotSchemaSource as st, BaseExtractOptions as t, SpecOf as tt, JsonSchemaBigint as u, JSON_SCHEMA_METADATA_KEYS as ut, JsonSchemaInteger as v, JsonSchemaMap as w, JsonSchemaLike as x, JsonSchemaIntegerFormat as y, JsonSchemaSchemaSource as z };
|
|
1426
|
+
//# sourceMappingURL=types-CEGqfUA4.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CEGqfUA4.d.cts","names":[],"sources":["../src/constants.ts","../src/types.ts"],"mappings":";;;;;;;;cAoBa;;;;;;;;;cAUA;cAQA;cAMA;;;;;;;;;cAkCA;;;;;cAMA,wBAAsB;;;;;cAYtB,wBAAsB;;;;;cAiBtB,8BAA4B;;;;;;;;KC5E7B,kCACF;;;;;;KAOE,yBAAyB;;;;KAKzB;;;;KAaA;;;;KAKA,yBACV,0BAA0B;;;;KAKhB;;;;;;;;UA+BK;;;;;EAKf;;;;EAKA,QAAQ;;;;EAKR;;;;EAKA;;;;EAKA;;;;;;;UAQe;;;;;;;EAOf;;;;;;;EAQA;;;;;;;EAWA,cAAc;;;;;;;EAQd;;;;;;EAOA;;;;;;;;;EAUA,QAAQ,eAAe;;;;;;;;EASvB;;;;;;;EAQA;;;;;;;;;;;;;;EAeA;;;;;;;;EASA;;;;;;;;EASA,aAAa;;;;;;;EAQb,UAAU;;;;EAKV;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;IACc;IAAe;IAAsB;;;;;EAMnD;;;;EAKA;;;;EAKA;IAGM;IAAkB;IAAgB;;;;;EAKxC;;;;EAKA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;;UASe;;;;;;;;;EASf,QAAQ;;;;;;;;;EAUR,QAAQ;;;;;;;;;EAUR,QAAQ;;;;;;;;;EAUR,MAAM;;;;;;;;UASS;;;;;;;;;EASf,KAAK;;;;;;;;;EAUL,OAAO;;;;;;;;;EAUP,OAA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U,iBACvC,UAAU,gBACP,KAAK,iBAAiB,kBAGxB;;;;UAKa,eAAe,oBAAoB,aAAa;;;;EAI/D;;;;EAKA,SAAS;;;;EAKT,QAAQ;;;;;;;;;KAUE,iBAAiB,SAAS,eAAe,aAAa;;;;UAKjD,iBAAiB;;EAEhC;;EAGA,SAAS;;EAGT,QAAQ,mBAAmB;;;;;UAMZ,uBACf,qBACQ,iBAAiB;;EAEzB;;EAGA,QAAQ,aAAa;;;;;UAMN,2BACf,qBACQ,iBAAiB;;EAEzB;;EAGA,QAAQ,qBAAqB;;;;;UAMd,iBAAiB,qBAAqB,iBAAiB;;EAEtE;;EAGA,QAAQ,GAAG,QAAQ;;;;;UAMJ,oBACf,qBACQ,iBAAiB;;EAEzB;;EAGA,QAAQ,sBAAsB;;;;;UAMf,oBACf,qBACQ,iBAAiB;;EAEzB;;EAGA,QAAQ,cAAc;;;;;KAMZ,aAAa,eACrB,uBAAuB,SACvB,2BAA2B,SAC3B,iBAAiB,SACjB,oBAAoB,SACpB,oBAAoB;;;;UAKP,wBACf,qBACQ,iBAAiB;;;;EAIzB,QAAQ,aAAa;;;YAIX;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;MACc;MAAe;MAAsB;;IACnD;IACA;IACA;IACA;IACA;KACC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Config } from "ts-json-schema-generator/dist/src/Config.js";
|
|
2
|
+
import { BaseIssue, BaseSchema } from "valibot";
|
|
1
3
|
import { StandardJSONSchemaV1 } from "@standard-schema/spec";
|
|
2
4
|
import { InferLoadOptions, LoadReference } from "@stryke/resolve/types";
|
|
3
|
-
import { Config } from "ts-json-schema-generator/dist/src/Config.js";
|
|
4
5
|
import { Storage } from "unstorage";
|
|
5
6
|
import { InputObject, Schema } from "untyped";
|
|
6
|
-
import { BaseIssue, BaseSchema } from "valibot";
|
|
7
7
|
import * as z3 from "zod/v3";
|
|
8
8
|
//#region src/constants.d.ts
|
|
9
9
|
declare const JsonSchemaTypeNames: {
|
|
@@ -18,6 +18,15 @@ declare const JsonSchemaTypeNames: {
|
|
|
18
18
|
declare const JSON_SCHEMA_PRIMITIVE_TYPES: ("string" | "number" | "boolean" | "null" | "integer")[];
|
|
19
19
|
declare const JSON_SCHEMA_TYPES: ("string" | "number" | "boolean" | "object" | "null" | "array" | "integer")[];
|
|
20
20
|
declare const JSON_SCHEMA_METADATA_KEYS: ("$id" | "$schema" | "$vocabulary" | "$comment" | "$anchor" | "$defs" | "$dynamicRef" | "$dynamicAnchor" | "name" | "version" | "title" | "description" | "docs" | "examples" | "alias" | "tags" | "deprecated" | "hidden" | "ignore" | "internal" | "runtime" | "readOnly" | "writeOnly")[];
|
|
21
|
+
/**
|
|
22
|
+
* Own-property key set to `true` on constructor function schemas.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* Must be read with `Object.hasOwn(schema, JSON_SCHEMA_CONSTRUCTOR_KEY)` (or
|
|
26
|
+
* `hasJsonSchemaConstructorFlag`) — never via `schema.constructor`, which
|
|
27
|
+
* resolves `Object.prototype.constructor`.
|
|
28
|
+
*/
|
|
29
|
+
declare const JSON_SCHEMA_CONSTRUCTOR_KEY: "constructor";
|
|
21
30
|
/**
|
|
22
31
|
* Keywords whose values are a flat record of named JSON Schema fragments.
|
|
23
32
|
* Each child schema is merged recursively with its counterpart.
|
|
@@ -63,6 +72,36 @@ type JsonSchemaNumberFormat = JsonSchemaDecimalFormat | JsonSchemaIntegerFormat;
|
|
|
63
72
|
* Semantic format names for JSON Schema string types.
|
|
64
73
|
*/
|
|
65
74
|
type JsonSchemaStringFormat = "binary" | "date" | "time" | "date-time" | "iso-time" | "iso-date-time" | "duration" | "uri" | "uri-reference" | "uri-template" | "url" | "email" | "hostname" | "ipv4" | "ipv6" | "regex" | "uuid" | "json-pointer" | "json-pointer-uri-fragment" | "relative-json-pointer" | "byte" | "password";
|
|
75
|
+
/**
|
|
76
|
+
* A single function parameter entry emitted when `function` is true.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* Power Plant extension used with `ts-json-schema-generator` `functions: "schema"` mode.
|
|
80
|
+
* Boolean flags are omitted when false. Defaults live on `schema.default`.
|
|
81
|
+
*/
|
|
82
|
+
interface JsonSchemaFunctionParameter {
|
|
83
|
+
/**
|
|
84
|
+
* Parameter name. Binding-pattern parameters use synthetic names (`$0`, `$1`, ...).
|
|
85
|
+
* Rest parameter names omit the `...` prefix.
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/**
|
|
89
|
+
* JSON Schema for the parameter value.
|
|
90
|
+
*/
|
|
91
|
+
schema: JsonSchema;
|
|
92
|
+
/**
|
|
93
|
+
* True when the parameter is declared with `?`.
|
|
94
|
+
*/
|
|
95
|
+
optional?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* True when the parameter is a rest parameter (`...args`).
|
|
98
|
+
*/
|
|
99
|
+
rest?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* True when the parameter is a `this` parameter.
|
|
102
|
+
*/
|
|
103
|
+
this?: boolean;
|
|
104
|
+
}
|
|
66
105
|
/**
|
|
67
106
|
* Metadata and annotation keywords shared across JSON Schema shapes.
|
|
68
107
|
*
|
|
@@ -127,6 +166,43 @@ interface JsonSchemaMetadataKeywords {
|
|
|
127
166
|
* @see https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-8.2.7
|
|
128
167
|
*/
|
|
129
168
|
$dynamicAnchor?: string;
|
|
169
|
+
/**
|
|
170
|
+
* An indicator specifying if the schema is a function or not.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* This is an internal property used by Power Plant - it is not part of the JSON Schema specification.
|
|
174
|
+
* When true, `parameters` describes the function arguments in declaration order and `returns`
|
|
175
|
+
* describes the return value (omitted for `void` / `undefined` / `never`).
|
|
176
|
+
*
|
|
177
|
+
* Constructor schemas also emit an own-property `"constructor": true` on the wire (see
|
|
178
|
+
* `JSON_SCHEMA_CONSTRUCTOR_KEY`). That key is intentionally omitted from this interface
|
|
179
|
+
* because a TypeScript `constructor` property collides with `Object.prototype.constructor` and
|
|
180
|
+
* breaks assignability across the schema union. Read it with `hasJsonSchemaConstructorFlag`.
|
|
181
|
+
*/
|
|
182
|
+
function?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* When true, the function is asynchronous (`async` and/or returns `Promise<T>`).
|
|
185
|
+
*
|
|
186
|
+
* @remarks
|
|
187
|
+
* This is an internal property used by Power Plant - it is not part of the JSON Schema specification.
|
|
188
|
+
* When set, `returns` describes the unwrapped `T` from `Promise<T>` (one layer).
|
|
189
|
+
*/
|
|
190
|
+
async?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Ordered function parameters when `function` is true.
|
|
193
|
+
*
|
|
194
|
+
* @remarks
|
|
195
|
+
* Always present for function schemas (may be an empty array). Each entry wraps a parameter
|
|
196
|
+
* schema with metadata such as `name`, `optional`, `rest`, and `this`.
|
|
197
|
+
*/
|
|
198
|
+
parameters?: JsonSchemaFunctionParameter[];
|
|
199
|
+
/**
|
|
200
|
+
* Return-value schema when `function` is true.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* Omitted for `void`, `undefined`, and `never` return types.
|
|
204
|
+
*/
|
|
205
|
+
returns?: JsonSchema;
|
|
130
206
|
/**
|
|
131
207
|
* A name for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable name or description for the schema. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
|
|
132
208
|
*/
|
|
@@ -1346,5 +1422,5 @@ declare module "zod" {
|
|
|
1346
1422
|
}
|
|
1347
1423
|
}
|
|
1348
1424
|
//#endregion
|
|
1349
|
-
export {
|
|
1350
|
-
//# sourceMappingURL=types-
|
|
1425
|
+
export { SchemaSourceConfig as $, JsonSchemaNumber as A, JsonSchemaSet as B, JsonSchemaLogicKeywords as C, JsonSchemaNever as D, JsonSchemaNativeEnum as E, JsonSchemaPrimitiveUnion as F, JsonSchemaUndefined as G, JsonSchemaStringFormat as H, JsonSchemaRecord as I, SchemaConfig as J, JsonSchemaUnion as K, JsonSchemaRecordPropertyNames as L, JsonSchemaObject as M, JsonSchemaOf as N, JsonSchemaNull as O, JsonSchemaPrimitiveType as P, SchemaSource as Q, JsonSchemaRef as R, JsonSchemaLiteral as S, JsonSchemaMetadataKeywords as T, JsonSchemaTuple as U, JsonSchemaString as V, JsonSchemaType as W, SchemaEnvelope as X, SchemaConfigVariant as Y, SchemaEnvelopeOf as Z, JsonSchemaFunctionParameter as _, JsonSchema as a, UntypedSchemaSource as at, JsonSchemaKeywords as b, JsonSchemaAnyOf as c, Zod3SchemaSource as ct, JsonSchemaBoolean as d, JSON_SCHEMA_PRIMITIVE_TYPES as dt, SchemaSourceVariant as et, JsonSchemaConditionalKeywords as f, JSON_SCHEMA_TYPES as ft, JsonSchemaEnum as g, SCHEMA_SINGLE_KEYWORDS as gt, JsonSchemaDecimalFormat as h, SCHEMA_RECORD_KEYWORDS as ht, InferExtractOptions as i, UntypedSchema as it, JsonSchemaNumberFormat as j, JsonSchemaNullable as k, JsonSchemaArray as l, JSON_SCHEMA_CONSTRUCTOR_KEY as lt, JsonSchemaDecimal as m, SCHEMA_ARRAY_CONCAT_KEYWORDS as mt, BaseSchemaSource as n, StandardSchemaSchemaSource as nt, JsonSchemaAllOf as o, ValibotSchema as ot, JsonSchemaDate as p, JsonSchemaTypeNames as pt, JsonSchemaUnknown as q, ExtractedSchemaEnvelope as r, UntypedConfigObject as rt, JsonSchemaAny as s, ValibotSchemaSource as st, BaseExtractOptions as t, SpecOf as tt, JsonSchemaBigint as u, JSON_SCHEMA_METADATA_KEYS as ut, JsonSchemaInteger as v, JsonSchemaMap as w, JsonSchemaLike as x, JsonSchemaIntegerFormat as y, JsonSchemaSchemaSource as z };
|
|
1426
|
+
//# sourceMappingURL=types-OH3Npqz2.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-OH3Npqz2.d.mts","names":[],"sources":["../src/constants.ts","../src/types.ts"],"mappings":""}
|
package/dist/valibot.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
3
|
-
const require_constants = require('./constants-
|
|
3
|
+
const require_constants = require('./constants-CEmLvTDd.cjs');
|
|
4
4
|
let valibot = require("valibot");
|
|
5
5
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
6
6
|
|
package/dist/valibot.d.cts
CHANGED
package/dist/valibot.d.mts
CHANGED
package/dist/valibot.mjs
CHANGED
package/dist/zod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
3
|
-
const require_constants = require('./constants-
|
|
4
|
-
const require_helpers = require('./helpers-
|
|
3
|
+
const require_constants = require('./constants-CEmLvTDd.cjs');
|
|
4
|
+
const require_helpers = require('./helpers-CQS3qnsv.cjs');
|
|
5
5
|
let _stryke_helpers_deep_clone = require("@stryke/helpers/deep-clone");
|
|
6
6
|
let zod_mini = require("zod/mini");
|
|
7
7
|
zod_mini = require_rolldown_runtime.__toESM(zod_mini, 1);
|
package/dist/zod.d.cts
CHANGED
package/dist/zod.d.mts
CHANGED
package/dist/zod.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { i as JSON_SCHEMA_TYPES } from "./constants-BlppSDwG.mjs";
|
|
2
|
+
import { n as getJsonSchema, p as traverseSchema, v as isJsonSchemaAny } from "./helpers-BxWdDZn4.mjs";
|
|
3
3
|
import { deepClone } from "@stryke/helpers/deep-clone";
|
|
4
4
|
import * as z from "zod/mini";
|
|
5
5
|
import * as z4 from "zod/v4";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Power Plant utility package to help managing schemas.",
|
|
6
6
|
"keywords": [
|
|
@@ -135,7 +135,9 @@
|
|
|
135
135
|
"@stryke/zod": "^0.3.42",
|
|
136
136
|
"@valibot/to-json-schema": "^1.7.1",
|
|
137
137
|
"defu": "^6.1.7",
|
|
138
|
-
"
|
|
138
|
+
"esbuild": "^0.28.1",
|
|
139
|
+
"normalize-path": "^3.0.0",
|
|
140
|
+
"ts-json-schema-generator": "2.9.0",
|
|
139
141
|
"typescript": "^6.0.3",
|
|
140
142
|
"unstorage": "^1.17.5",
|
|
141
143
|
"untyped": "^1.5.2"
|
|
@@ -156,5 +158,5 @@
|
|
|
156
158
|
"zod": { "optional": true }
|
|
157
159
|
},
|
|
158
160
|
"publishConfig": { "access": "public" },
|
|
159
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "4ea16814f8097e10d7604cb61abb8ae824fe42db"
|
|
160
162
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-COGt3eeW.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-reqtcaa8.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-CjF4wIDK.d.mts","names":[],"sources":["../src/constants.ts","../src/types.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-hfHmxKG0.d.cts","names":[],"sources":["../src/constants.ts","../src/types.ts"],"mappings":";;;;;;;;cAoBa;;;;;;;;;cAUA;cAQA;cAMA;;;;;cA8BA,wBAAsB;;;;;cAYtB,wBAA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