@power-plant/schema 0.0.35 → 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-dvxktFml.mjs → helpers-BxWdDZn4.mjs} +17 -3
- package/dist/helpers-BxWdDZn4.mjs.map +1 -0
- package/dist/{helpers-BQD6GZyX.cjs → helpers-CQS3qnsv.cjs} +21 -1
- package/dist/index.cjs +16 -87
- package/dist/index.d.cts +13 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +13 -2
- package/dist/index.mjs +15 -88
- package/dist/{types-CyvYSCHO.d.mts → types-CEGqfUA4.d.cts} +80 -4
- 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 +3 -3
- package/dist/constants-COGt3eeW.mjs.map +0 -1
- package/dist/helpers-dvxktFml.mjs.map +0 -1
- package/dist/types-CyvYSCHO.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";
|
|
@@ -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
|
|
@@ -924,5 +938,5 @@ function traverseSchema(schema, callback) {
|
|
|
924
938
|
}
|
|
925
939
|
|
|
926
940
|
//#endregion
|
|
927
|
-
export {
|
|
928
|
-
//# 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");
|
|
@@ -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
|
|
@@ -974,6 +988,12 @@ Object.defineProperty(exports, 'getProperty', {
|
|
|
974
988
|
return getProperty;
|
|
975
989
|
}
|
|
976
990
|
});
|
|
991
|
+
Object.defineProperty(exports, 'hasJsonSchemaConstructorFlag', {
|
|
992
|
+
enumerable: true,
|
|
993
|
+
get: function () {
|
|
994
|
+
return hasJsonSchemaConstructorFlag;
|
|
995
|
+
}
|
|
996
|
+
});
|
|
977
997
|
Object.defineProperty(exports, 'isFileReference', {
|
|
978
998
|
enumerable: true,
|
|
979
999
|
get: function () {
|
package/dist/index.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
|
const require_storage = require('./storage-B8aDmNpv.cjs');
|
|
6
6
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
7
7
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
@@ -14,14 +14,12 @@ let _stryke_json = require("@stryke/json");
|
|
|
14
14
|
let _stryke_path_append = require("@stryke/path/append");
|
|
15
15
|
let _stryke_path_find = require("@stryke/path/find");
|
|
16
16
|
let _stryke_path_join = require("@stryke/path/join");
|
|
17
|
-
let _stryke_resolve_bundle = require("@stryke/resolve/bundle");
|
|
18
17
|
let _stryke_resolve_constants = require("@stryke/resolve/constants");
|
|
19
18
|
let _stryke_resolve_load = require("@stryke/resolve/load");
|
|
20
19
|
let _stryke_resolve_resolve = require("@stryke/resolve/resolve");
|
|
21
20
|
let _stryke_string_format_list = require("@stryke/string-format/list");
|
|
22
21
|
let _stryke_zod = require("@stryke/zod");
|
|
23
22
|
let _valibot_to_json_schema = require("@valibot/to-json-schema");
|
|
24
|
-
let esbuild = require("esbuild");
|
|
25
23
|
let ts_json_schema_generator_dist_factory_generator_js = require("ts-json-schema-generator/dist/factory/generator.js");
|
|
26
24
|
let ts_json_schema_generator_dist_src_Config_js = require("ts-json-schema-generator/dist/src/Config.js");
|
|
27
25
|
let typescript = require("typescript");
|
|
@@ -132,9 +130,6 @@ function assertSchemasDoNotContradict(base, override, label = "schema") {
|
|
|
132
130
|
//#endregion
|
|
133
131
|
//#region src/extract.ts
|
|
134
132
|
const SCHEMA_BUNDLE_BASE_URI = "https://power-plant.invalid/";
|
|
135
|
-
function normalizePath(filePath) {
|
|
136
|
-
return filePath.replaceAll("\\", "/");
|
|
137
|
-
}
|
|
138
133
|
function isWrappedSchemaConfig(input) {
|
|
139
134
|
if (!(0, _stryke_type_checks_is_set_object.isSetObject)(input) || !("schema" in input)) return false;
|
|
140
135
|
if ("hash" in input || "variant" in input || "source" in input) return false;
|
|
@@ -488,13 +483,6 @@ function getTsCompilerOptions(config) {
|
|
|
488
483
|
types: ["node"]
|
|
489
484
|
};
|
|
490
485
|
}
|
|
491
|
-
/**
|
|
492
|
-
* Rewrites type-only imports/exports so esbuild still walks them while
|
|
493
|
-
* collecting the original TypeScript sources for schema generation.
|
|
494
|
-
*/
|
|
495
|
-
function rewriteTypeOnlyImports(source) {
|
|
496
|
-
return source.replace(/\bimport\s+type\s+/g, "import ").replace(/\bexport\s+type\s+\*\s+from/g, "export * from").replace(/\bexport\s+type\s+\{/g, "export {");
|
|
497
|
-
}
|
|
498
486
|
function getScriptKind(fileName) {
|
|
499
487
|
switch ((0, _stryke_path_find.findFileExtensionSafe)(fileName)?.toLowerCase()) {
|
|
500
488
|
case "tsx": return typescript.default.ScriptKind.TSX;
|
|
@@ -506,87 +494,25 @@ function getScriptKind(fileName) {
|
|
|
506
494
|
}
|
|
507
495
|
}
|
|
508
496
|
/**
|
|
509
|
-
* Uses esbuild (with `@stryke/resolve` path resolution) to walk the module
|
|
510
|
-
* graph, capturing original TypeScript sources before types are erased.
|
|
511
|
-
*/
|
|
512
|
-
async function bundleTypeScriptSources(filePath, options) {
|
|
513
|
-
const cwd = options.cwd || process.cwd();
|
|
514
|
-
const sources = /* @__PURE__ */ new Map();
|
|
515
|
-
const result = await (0, esbuild.build)({
|
|
516
|
-
absWorkingDir: cwd,
|
|
517
|
-
entryPoints: [filePath],
|
|
518
|
-
bundle: true,
|
|
519
|
-
write: false,
|
|
520
|
-
platform: "node",
|
|
521
|
-
format: "esm",
|
|
522
|
-
logLevel: "silent",
|
|
523
|
-
packages: "external",
|
|
524
|
-
plugins: [{
|
|
525
|
-
name: "power-plant-capture-ts-sources",
|
|
526
|
-
setup(buildApi) {
|
|
527
|
-
buildApi.onLoad({ filter: /.*/ }, async (args) => {
|
|
528
|
-
if (/[/\\]node_modules[/\\]/.test(args.path)) return null;
|
|
529
|
-
try {
|
|
530
|
-
const original = await (0, _stryke_resolve_resolve.resolve)(args.path, {
|
|
531
|
-
skipBundle: true,
|
|
532
|
-
cwd,
|
|
533
|
-
fs: options.fs
|
|
534
|
-
});
|
|
535
|
-
sources.set(normalizePath(args.path), original);
|
|
536
|
-
const extension = (0, _stryke_path_find.findFileExtensionSafe)(args.path);
|
|
537
|
-
const loader = extension === "tsx" || extension === "jsx" ? extension : extension === "js" || extension === "cjs" || extension === "mjs" ? "js" : "ts";
|
|
538
|
-
return {
|
|
539
|
-
contents: rewriteTypeOnlyImports(original),
|
|
540
|
-
loader
|
|
541
|
-
};
|
|
542
|
-
} catch {
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
}, (0, _stryke_resolve_bundle.plugin)({
|
|
548
|
-
originalInput: filePath,
|
|
549
|
-
cwd,
|
|
550
|
-
fs: options.fs ?? {}
|
|
551
|
-
})]
|
|
552
|
-
});
|
|
553
|
-
if (result.errors.length > 0) throw new Error(`Failed to bundle TypeScript sources for "${filePath}": ${result.errors.map((error) => error.text).join(", ")}`);
|
|
554
|
-
if (sources.size === 0) {
|
|
555
|
-
const fallback = await (0, _stryke_resolve_resolve.resolve)(filePath, {
|
|
556
|
-
skipBundle: true,
|
|
557
|
-
cwd,
|
|
558
|
-
fs: options.fs
|
|
559
|
-
});
|
|
560
|
-
sources.set(normalizePath(filePath), fallback);
|
|
561
|
-
}
|
|
562
|
-
return {
|
|
563
|
-
entryFileName: filePath,
|
|
564
|
-
sources
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
497
|
* Builds a TypeScript program from original sources collected during the
|
|
569
498
|
* esbuild graph walk so type information remains intact for schema generation.
|
|
570
499
|
*/
|
|
571
|
-
function createProgramFromSources(
|
|
500
|
+
function createProgramFromSources(filePath, source, config) {
|
|
572
501
|
const compilerOptions = getTsCompilerOptions(config);
|
|
573
502
|
const host = typescript.default.createCompilerHost(compilerOptions, true);
|
|
574
|
-
const normalizedSources = new Map([...sources.entries()].map(([key, value]) => [normalizePath(key), value]));
|
|
575
|
-
const getContent = (name) => normalizedSources.get(normalizePath(name)) ?? normalizedSources.get(name);
|
|
576
503
|
const baseFileExists = host.fileExists.bind(host);
|
|
577
504
|
const baseReadFile = host.readFile.bind(host);
|
|
578
505
|
const baseGetSourceFile = host.getSourceFile.bind(host);
|
|
579
|
-
host.fileExists = (name) =>
|
|
580
|
-
host.readFile = (name) =>
|
|
506
|
+
host.fileExists = (name) => filePath === name || baseFileExists(name);
|
|
507
|
+
host.readFile = (name) => filePath === name ? source : baseReadFile(name);
|
|
581
508
|
host.getSourceFile = (name, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => {
|
|
582
|
-
|
|
583
|
-
if (content !== void 0) {
|
|
509
|
+
if (filePath === name) {
|
|
584
510
|
const scriptTarget = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.languageVersion : languageVersionOrOptions;
|
|
585
|
-
return typescript.default.createSourceFile(name,
|
|
511
|
+
return typescript.default.createSourceFile(name, source, scriptTarget ?? compilerOptions.target ?? typescript.default.ScriptTarget.ES2022, true, getScriptKind(name));
|
|
586
512
|
}
|
|
587
513
|
return baseGetSourceFile(name, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
588
514
|
};
|
|
589
|
-
const program = typescript.default.createProgram([
|
|
515
|
+
const program = typescript.default.createProgram([filePath], compilerOptions, host);
|
|
590
516
|
if (!config.skipTypeCheck) {
|
|
591
517
|
const diagnostics = typescript.default.getPreEmitDiagnostics(program);
|
|
592
518
|
if (diagnostics.length) throw new Error(`Type check error: ${diagnostics.map((diagnostic) => diagnostic.messageText.toString()).join("\n")}`);
|
|
@@ -612,10 +538,11 @@ async function extractTSType(input, options = {}) {
|
|
|
612
538
|
const filePath = resolvedPath || fileReference.file;
|
|
613
539
|
try {
|
|
614
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");
|
|
615
|
-
const
|
|
541
|
+
const bundled = await (0, _stryke_resolve_resolve.resolve)(filePath, {
|
|
616
542
|
cwd: options.cwd || process.cwd(),
|
|
617
543
|
fs: options.fs
|
|
618
544
|
});
|
|
545
|
+
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}"`);
|
|
619
546
|
const config = {
|
|
620
547
|
...ts_json_schema_generator_dist_src_Config_js.DEFAULT_CONFIG,
|
|
621
548
|
expose: "all",
|
|
@@ -624,12 +551,12 @@ async function extractTSType(input, options = {}) {
|
|
|
624
551
|
fullDescription: true,
|
|
625
552
|
...options,
|
|
626
553
|
tsconfig,
|
|
627
|
-
path:
|
|
554
|
+
path: filePath,
|
|
628
555
|
type: exportName,
|
|
629
|
-
skipTypeCheck: true
|
|
556
|
+
skipTypeCheck: true,
|
|
557
|
+
functions: "schema"
|
|
630
558
|
};
|
|
631
|
-
const tsProgram = createProgramFromSources(
|
|
632
|
-
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}" (${sources.size} source file(s))`);
|
|
559
|
+
const tsProgram = createProgramFromSources(filePath, bundled, config);
|
|
633
560
|
return (0, ts_json_schema_generator_dist_factory_generator_js.createGenerator)({
|
|
634
561
|
...config,
|
|
635
562
|
tsProgram
|
|
@@ -766,6 +693,7 @@ async function extract(input, options = {}) {
|
|
|
766
693
|
}
|
|
767
694
|
|
|
768
695
|
//#endregion
|
|
696
|
+
exports.JSON_SCHEMA_CONSTRUCTOR_KEY = require_constants.JSON_SCHEMA_CONSTRUCTOR_KEY;
|
|
769
697
|
exports.JSON_SCHEMA_METADATA_KEYS = require_constants.JSON_SCHEMA_METADATA_KEYS;
|
|
770
698
|
exports.JSON_SCHEMA_PRIMITIVE_TYPES = require_constants.JSON_SCHEMA_PRIMITIVE_TYPES;
|
|
771
699
|
exports.JSON_SCHEMA_TYPES = require_constants.JSON_SCHEMA_TYPES;
|
|
@@ -794,6 +722,7 @@ exports.getPrimarySchemaType = require_helpers.getPrimarySchemaType;
|
|
|
794
722
|
exports.getProperties = require_helpers.getProperties;
|
|
795
723
|
exports.getPropertiesList = require_helpers.getPropertiesList;
|
|
796
724
|
exports.getProperty = require_helpers.getProperty;
|
|
725
|
+
exports.hasJsonSchemaConstructorFlag = require_helpers.hasJsonSchemaConstructorFlag;
|
|
797
726
|
exports.isFileReference = require_helpers.isFileReference;
|
|
798
727
|
exports.isJsonSchema = require_helpers.isJsonSchema;
|
|
799
728
|
exports.isJsonSchemaAllOf = require_helpers.isJsonSchemaAllOf;
|
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";
|
|
@@ -566,6 +566,17 @@ declare function isStandardSchema(input: unknown): input is StandardSchemaV1;
|
|
|
566
566
|
* @returns True if the input is a Valibot BaseSchema, false otherwise.
|
|
567
567
|
*/
|
|
568
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;
|
|
569
580
|
/**
|
|
570
581
|
* Type guard for JSON Schema types.
|
|
571
582
|
*
|
|
@@ -661,5 +672,5 @@ declare function isSchemaWithSource(input: unknown): input is ExtractedSchemaEnv
|
|
|
661
672
|
*/
|
|
662
673
|
declare function isSchemaObject(input: unknown): input is SchemaEnvelope<JsonSchemaObject>;
|
|
663
674
|
//#endregion
|
|
664
|
-
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, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, 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 };
|
|
665
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;;;;;;;;;iBAqHc,6BACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBCuCc,iBAAiB,QAAQ,aAAa;;;;iBAgMtC,YACd,SAAS,qBACT,OAAO;;;;;;;iBAgDO,kBAAkB,kBAAkB;;;;;;;;iBAoCpC,uBACd,OAAO,qBACN;;;;;;;iBA0Ba,eAAe,OAAO,eAAe;;;;;;;;;iBAsB/B,cACpB,OAAO,oBACP,UAAU,sBACT,QAAQ;;;;;;;;;iBAmCK,cACd,SAAS,qBACT,OAAO,qBACN;;;;;;;;;;;;iBAiLmB,cACpB,OAAO,oBACP,UAAS,wBAAwB,SAAS,qBACzC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+FW,wBAAwB,aAC5C,OAAO,cACP,UAAS,2BAA2B,SACnC,QAAQ,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0Ib,QAAQ,aAC5B,OAAO,aAAa,QACpB,UAAS,2BAA2B,SACnC,QAAQ,iBAAiB;;;KCt/BhB,oBAAoB;EAC9B;EACA;EACA;;;;;;;;;;;;iBAac,cAAc,OAAO,iBAAiB,aAAa;;;;;;;;;;;iBAmBnD,oBACd,OAAO,iBAAiB,aACvB;;;;;;;;;;iBAkBa,cACd,KAAK,iBAAiB,mBACrB,eAAe;;;;;;;;;;iBA6BF,kBAAkB,KAAK,iBAAiB,mBAAgB;;;;;;;;;;iBAaxD,YAAY,gBAAgB,kBAC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d,iBACC,SAAS;;;;;;;iBAUI,oBACd,iBACC,SAAS;;;;;;;iBAUI,mBAAmB,iBAAiB,SAAS;;;;;;;iBA2C7C,mBAAmB,iBAAiB,SAAS;;;;;;;iBA4B7C,gBAAgB,iBAAiB,SAAS;;;;;;;iBA8B1C,mBAAmB,iBAAiB,SAAS;;;;;;;iBAyB7C,kBAAkB,iBAAiB,SAAS;;;;;;;iBA8B5C,sBACd,iBACC,SAAS;;;;;;;iBAoBI,2BACd,iBACC,SAAS;;;;;;;iBAsEI,kBAAkB,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";
|
|
@@ -566,6 +566,17 @@ declare function isStandardSchema(input: unknown): input is StandardSchemaV1;
|
|
|
566
566
|
* @returns True if the input is a Valibot BaseSchema, false otherwise.
|
|
567
567
|
*/
|
|
568
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;
|
|
569
580
|
/**
|
|
570
581
|
* Type guard for JSON Schema types.
|
|
571
582
|
*
|
|
@@ -661,5 +672,5 @@ declare function isSchemaWithSource(input: unknown): input is ExtractedSchemaEnv
|
|
|
661
672
|
*/
|
|
662
673
|
declare function isSchemaObject(input: unknown): input is SchemaEnvelope<JsonSchemaObject>;
|
|
663
674
|
//#endregion
|
|
664
|
-
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, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, 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 };
|
|
665
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";
|
|
@@ -12,14 +12,12 @@ import { isStandardJsonSchema } from "@stryke/json";
|
|
|
12
12
|
import { appendPath } from "@stryke/path/append";
|
|
13
13
|
import { findFileExtensionSafe, findFilePath } from "@stryke/path/find";
|
|
14
14
|
import { joinPaths } from "@stryke/path/join";
|
|
15
|
-
import { plugin } from "@stryke/resolve/bundle";
|
|
16
15
|
import { VALID_OBJECT_SOURCE_EXTENSIONS } from "@stryke/resolve/constants";
|
|
17
16
|
import { loadSafe } from "@stryke/resolve/load";
|
|
18
17
|
import { resolve } from "@stryke/resolve/resolve";
|
|
19
18
|
import { list } from "@stryke/string-format/list";
|
|
20
19
|
import { extractJsonSchema as extractJsonSchema$1, isZod3Type } from "@stryke/zod";
|
|
21
20
|
import { toJsonSchema } from "@valibot/to-json-schema";
|
|
22
|
-
import { build } from "esbuild";
|
|
23
21
|
import { createGenerator } from "ts-json-schema-generator/dist/factory/generator.js";
|
|
24
22
|
import { DEFAULT_CONFIG } from "ts-json-schema-generator/dist/src/Config.js";
|
|
25
23
|
import ts from "typescript";
|
|
@@ -129,9 +127,6 @@ function assertSchemasDoNotContradict(base, override, label = "schema") {
|
|
|
129
127
|
//#endregion
|
|
130
128
|
//#region src/extract.ts
|
|
131
129
|
const SCHEMA_BUNDLE_BASE_URI = "https://power-plant.invalid/";
|
|
132
|
-
function normalizePath(filePath) {
|
|
133
|
-
return filePath.replaceAll("\\", "/");
|
|
134
|
-
}
|
|
135
130
|
function isWrappedSchemaConfig(input) {
|
|
136
131
|
if (!isSetObject(input) || !("schema" in input)) return false;
|
|
137
132
|
if ("hash" in input || "variant" in input || "source" in input) return false;
|
|
@@ -485,13 +480,6 @@ function getTsCompilerOptions(config) {
|
|
|
485
480
|
types: ["node"]
|
|
486
481
|
};
|
|
487
482
|
}
|
|
488
|
-
/**
|
|
489
|
-
* Rewrites type-only imports/exports so esbuild still walks them while
|
|
490
|
-
* collecting the original TypeScript sources for schema generation.
|
|
491
|
-
*/
|
|
492
|
-
function rewriteTypeOnlyImports(source) {
|
|
493
|
-
return source.replace(/\bimport\s+type\s+/g, "import ").replace(/\bexport\s+type\s+\*\s+from/g, "export * from").replace(/\bexport\s+type\s+\{/g, "export {");
|
|
494
|
-
}
|
|
495
483
|
function getScriptKind(fileName) {
|
|
496
484
|
switch (findFileExtensionSafe(fileName)?.toLowerCase()) {
|
|
497
485
|
case "tsx": return ts.ScriptKind.TSX;
|
|
@@ -503,87 +491,25 @@ function getScriptKind(fileName) {
|
|
|
503
491
|
}
|
|
504
492
|
}
|
|
505
493
|
/**
|
|
506
|
-
* Uses esbuild (with `@stryke/resolve` path resolution) to walk the module
|
|
507
|
-
* graph, capturing original TypeScript sources before types are erased.
|
|
508
|
-
*/
|
|
509
|
-
async function bundleTypeScriptSources(filePath, options) {
|
|
510
|
-
const cwd = options.cwd || process.cwd();
|
|
511
|
-
const sources = /* @__PURE__ */ new Map();
|
|
512
|
-
const result = await build({
|
|
513
|
-
absWorkingDir: cwd,
|
|
514
|
-
entryPoints: [filePath],
|
|
515
|
-
bundle: true,
|
|
516
|
-
write: false,
|
|
517
|
-
platform: "node",
|
|
518
|
-
format: "esm",
|
|
519
|
-
logLevel: "silent",
|
|
520
|
-
packages: "external",
|
|
521
|
-
plugins: [{
|
|
522
|
-
name: "power-plant-capture-ts-sources",
|
|
523
|
-
setup(buildApi) {
|
|
524
|
-
buildApi.onLoad({ filter: /.*/ }, async (args) => {
|
|
525
|
-
if (/[/\\]node_modules[/\\]/.test(args.path)) return null;
|
|
526
|
-
try {
|
|
527
|
-
const original = await resolve(args.path, {
|
|
528
|
-
skipBundle: true,
|
|
529
|
-
cwd,
|
|
530
|
-
fs: options.fs
|
|
531
|
-
});
|
|
532
|
-
sources.set(normalizePath(args.path), original);
|
|
533
|
-
const extension = findFileExtensionSafe(args.path);
|
|
534
|
-
const loader = extension === "tsx" || extension === "jsx" ? extension : extension === "js" || extension === "cjs" || extension === "mjs" ? "js" : "ts";
|
|
535
|
-
return {
|
|
536
|
-
contents: rewriteTypeOnlyImports(original),
|
|
537
|
-
loader
|
|
538
|
-
};
|
|
539
|
-
} catch {
|
|
540
|
-
return null;
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}, plugin({
|
|
545
|
-
originalInput: filePath,
|
|
546
|
-
cwd,
|
|
547
|
-
fs: options.fs ?? {}
|
|
548
|
-
})]
|
|
549
|
-
});
|
|
550
|
-
if (result.errors.length > 0) throw new Error(`Failed to bundle TypeScript sources for "${filePath}": ${result.errors.map((error) => error.text).join(", ")}`);
|
|
551
|
-
if (sources.size === 0) {
|
|
552
|
-
const fallback = await resolve(filePath, {
|
|
553
|
-
skipBundle: true,
|
|
554
|
-
cwd,
|
|
555
|
-
fs: options.fs
|
|
556
|
-
});
|
|
557
|
-
sources.set(normalizePath(filePath), fallback);
|
|
558
|
-
}
|
|
559
|
-
return {
|
|
560
|
-
entryFileName: filePath,
|
|
561
|
-
sources
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
/**
|
|
565
494
|
* Builds a TypeScript program from original sources collected during the
|
|
566
495
|
* esbuild graph walk so type information remains intact for schema generation.
|
|
567
496
|
*/
|
|
568
|
-
function createProgramFromSources(
|
|
497
|
+
function createProgramFromSources(filePath, source, config) {
|
|
569
498
|
const compilerOptions = getTsCompilerOptions(config);
|
|
570
499
|
const host = ts.createCompilerHost(compilerOptions, true);
|
|
571
|
-
const normalizedSources = new Map([...sources.entries()].map(([key, value]) => [normalizePath(key), value]));
|
|
572
|
-
const getContent = (name) => normalizedSources.get(normalizePath(name)) ?? normalizedSources.get(name);
|
|
573
500
|
const baseFileExists = host.fileExists.bind(host);
|
|
574
501
|
const baseReadFile = host.readFile.bind(host);
|
|
575
502
|
const baseGetSourceFile = host.getSourceFile.bind(host);
|
|
576
|
-
host.fileExists = (name) =>
|
|
577
|
-
host.readFile = (name) =>
|
|
503
|
+
host.fileExists = (name) => filePath === name || baseFileExists(name);
|
|
504
|
+
host.readFile = (name) => filePath === name ? source : baseReadFile(name);
|
|
578
505
|
host.getSourceFile = (name, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => {
|
|
579
|
-
|
|
580
|
-
if (content !== void 0) {
|
|
506
|
+
if (filePath === name) {
|
|
581
507
|
const scriptTarget = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.languageVersion : languageVersionOrOptions;
|
|
582
|
-
return ts.createSourceFile(name,
|
|
508
|
+
return ts.createSourceFile(name, source, scriptTarget ?? compilerOptions.target ?? ts.ScriptTarget.ES2022, true, getScriptKind(name));
|
|
583
509
|
}
|
|
584
510
|
return baseGetSourceFile(name, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
585
511
|
};
|
|
586
|
-
const program = ts.createProgram([
|
|
512
|
+
const program = ts.createProgram([filePath], compilerOptions, host);
|
|
587
513
|
if (!config.skipTypeCheck) {
|
|
588
514
|
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
589
515
|
if (diagnostics.length) throw new Error(`Type check error: ${diagnostics.map((diagnostic) => diagnostic.messageText.toString()).join("\n")}`);
|
|
@@ -609,10 +535,11 @@ async function extractTSType(input, options = {}) {
|
|
|
609
535
|
const filePath = resolvedPath || fileReference.file;
|
|
610
536
|
try {
|
|
611
537
|
const tsconfig = options.tsconfig ? appendPath(options.tsconfig, options.cwd || process.cwd()) : joinPaths(options.cwd || process.cwd(), "tsconfig.json");
|
|
612
|
-
const
|
|
538
|
+
const bundled = await resolve(filePath, {
|
|
613
539
|
cwd: options.cwd || process.cwd(),
|
|
614
540
|
fs: options.fs
|
|
615
541
|
});
|
|
542
|
+
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}"`);
|
|
616
543
|
const config = {
|
|
617
544
|
...DEFAULT_CONFIG,
|
|
618
545
|
expose: "all",
|
|
@@ -621,12 +548,12 @@ async function extractTSType(input, options = {}) {
|
|
|
621
548
|
fullDescription: true,
|
|
622
549
|
...options,
|
|
623
550
|
tsconfig,
|
|
624
|
-
path:
|
|
551
|
+
path: filePath,
|
|
625
552
|
type: exportName,
|
|
626
|
-
skipTypeCheck: true
|
|
553
|
+
skipTypeCheck: true,
|
|
554
|
+
functions: "schema"
|
|
627
555
|
};
|
|
628
|
-
const tsProgram = createProgramFromSources(
|
|
629
|
-
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}" (${sources.size} source file(s))`);
|
|
556
|
+
const tsProgram = createProgramFromSources(filePath, bundled, config);
|
|
630
557
|
return createGenerator({
|
|
631
558
|
...config,
|
|
632
559
|
tsProgram
|
|
@@ -763,5 +690,5 @@ async function extract(input, options = {}) {
|
|
|
763
690
|
}
|
|
764
691
|
|
|
765
692
|
//#endregion
|
|
766
|
-
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, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, 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 };
|
|
767
694
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Config } from "ts-json-schema-generator/dist/src/Config.js";
|
|
2
|
-
import { BaseIssue, BaseSchema } from "valibot";
|
|
3
1
|
import { StandardJSONSchemaV1 } from "@standard-schema/spec";
|
|
4
2
|
import { InferLoadOptions, LoadReference } from "@stryke/resolve/types";
|
|
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,y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iB;;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": [
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"defu": "^6.1.7",
|
|
138
138
|
"esbuild": "^0.28.1",
|
|
139
139
|
"normalize-path": "^3.0.0",
|
|
140
|
-
"ts-json-schema-generator": "
|
|
140
|
+
"ts-json-schema-generator": "2.9.0",
|
|
141
141
|
"typescript": "^6.0.3",
|
|
142
142
|
"unstorage": "^1.17.5",
|
|
143
143
|
"untyped": "^1.5.2"
|
|
@@ -158,5 +158,5 @@
|
|
|
158
158
|
"zod": { "optional": true }
|
|
159
159
|
},
|
|
160
160
|
"publishConfig": { "access": "public" },
|
|
161
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "4ea16814f8097e10d7604cb61abb8ae824fe42db"
|
|
162
162
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-COGt3eeW.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-dvxktFml.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-CyvYSCHO.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,wBAAsB;;;;;cAiBtB,8BAA4B;;;;;;;;KClE7B,kCACF;;;;;;KAOE,yBAAyB;;;;KAKzB;;;;KAaA;;;;KAKA,yBACV,0BAA0B;;;;KAKhB;;;;;;UA6BK;;;;;;;EAOf;;;;;;;EAQA;;;;;;;EAWA,cAAc;;;;;;;EAQd;;;;;;EAOA;;;;;;;;;EAUA,QAAQ,eAAe;;;;;;;;EASvB;;;;;;;EAQA;;;;EAKA;;;;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;;;;;;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