@hey-api/openapi-ts 0.95.0 → 0.96.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -2
- package/dist/clients/angular/types.ts +1 -0
- package/dist/clients/core/serverSentEvents.ts +4 -5
- package/dist/clients/fetch/types.ts +1 -0
- package/dist/clients/ky/types.ts +1 -0
- package/dist/clients/next/client.ts +1 -1
- package/dist/clients/next/types.ts +1 -0
- package/dist/clients/ofetch/types.ts +1 -0
- package/dist/index.d.mts +542 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -4
- package/dist/{init-C3GzFcQR.mjs → init-D4xuNKgu.mjs} +983 -840
- package/dist/init-D4xuNKgu.mjs.map +1 -0
- package/dist/internal.mjs +2 -3
- package/dist/run.mjs +4 -9
- package/dist/run.mjs.map +1 -1
- package/dist/{src-BzTu1krN.mjs → src-DlsTSwMY.mjs} +33 -21
- package/dist/src-DlsTSwMY.mjs.map +1 -0
- package/package.json +18 -19
- package/dist/init-C3GzFcQR.mjs.map +0 -1
- package/dist/src-BzTu1krN.mjs.map +0 -1
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { StructureModel, detectInteractiveSession, fromRef, isNode, isRef, isSymbol, loadConfigFile, log, nodeBrand, ref, refs } from "@hey-api/codegen-core";
|
|
3
|
-
import { ConfigError, OperationPath, OperationStrategy, applyNaming, buildSymbolIn, childContext, createOperationKey, createSchemaProcessor, createSchemaWalker, deduplicateSchema, definePluginConfig, dependencyFactory, ensureDirSync, escapeComment, findTsConfigPath, getInput, getLogs, getParser, hasOperationDataRequired, hasParameterGroupObjectRequired, isEnvironment, mappers, operationPagination, operationResponsesMap, outputHeaderToPrefix, parseUrl, pathToJsonPointer, pathToName, refToName, requestValidatorLayers, resolveSource, resolveValidatorLayer, satisfies, statusCodeToGroup, toCase, valueToObject } from "@hey-api/shared";
|
|
3
|
+
import { ConfigError, OperationPath, OperationStrategy, applyNaming, buildSymbolIn, childContext, createOperationKey, createSchemaProcessor, createSchemaWalker, deduplicateSchema, definePluginConfig, dependencyFactory, ensureDirSync, escapeComment, findTsConfigPath, getInput, getLogs, getParser, hasOperationDataRequired, hasParameterGroupObjectRequired, isEnvironment, mappers, operationPagination, operationResponsesMap, outputHeaderToPrefix, parseUrl, pathToJsonPointer, pathToName, refToName, requestValidatorLayers, resolveSource, resolveValidatorLayer, satisfies, statusCodeToGroup, toCase, valueToObject, warnOnConflictingDuplicatePlugins } from "@hey-api/shared";
|
|
4
4
|
import colors from "ansi-colors";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import { parseTsconfig } from "get-tsconfig";
|
|
9
9
|
import ts from "typescript";
|
|
10
|
-
|
|
11
10
|
//#region \0rolldown/runtime.js
|
|
12
11
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
13
|
//#region src/config/expand.ts
|
|
16
14
|
function expandToJobs(configs) {
|
|
@@ -50,7 +48,6 @@ function expandToJobs(configs) {
|
|
|
50
48
|
}
|
|
51
49
|
return jobs;
|
|
52
50
|
}
|
|
53
|
-
|
|
54
51
|
//#endregion
|
|
55
52
|
//#region src/config/packages.ts
|
|
56
53
|
/**
|
|
@@ -80,7 +77,6 @@ const getProjectDependencies = (configFilePath) => {
|
|
|
80
77
|
}
|
|
81
78
|
return {};
|
|
82
79
|
};
|
|
83
|
-
|
|
84
80
|
//#endregion
|
|
85
81
|
//#region src/config/output/postprocess.ts
|
|
86
82
|
const postProcessors = {
|
|
@@ -129,7 +125,6 @@ const postProcessors = {
|
|
|
129
125
|
name: "Prettier"
|
|
130
126
|
}
|
|
131
127
|
};
|
|
132
|
-
|
|
133
128
|
//#endregion
|
|
134
129
|
//#region src/config/output/config.ts
|
|
135
130
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
@@ -240,13 +235,13 @@ function loadTsConfig(configPath) {
|
|
|
240
235
|
throw new Error(`Couldn't read tsconfig from path: ${configPath}`);
|
|
241
236
|
}
|
|
242
237
|
}
|
|
243
|
-
|
|
244
238
|
//#endregion
|
|
245
239
|
//#region src/plugins/@angular/common/httpRequests/config.ts
|
|
246
240
|
function resolveHttpRequests(config, context) {
|
|
247
241
|
let input = config.httpRequests;
|
|
248
242
|
if (typeof input === "string" || typeof input === "function") input = { strategy: input };
|
|
249
|
-
else if (typeof input === "boolean"
|
|
243
|
+
else if (typeof input === "boolean") input = { enabled: input };
|
|
244
|
+
else if (!input) input = {};
|
|
250
245
|
const strategy = input.strategy ?? "flat";
|
|
251
246
|
return context.valueToObject({
|
|
252
247
|
defaultValue: {
|
|
@@ -297,7 +292,6 @@ function resolveHttpRequests(config, context) {
|
|
|
297
292
|
value: input
|
|
298
293
|
});
|
|
299
294
|
}
|
|
300
|
-
|
|
301
295
|
//#endregion
|
|
302
296
|
//#region src/plugins/@angular/common/httpRequests/resolve.ts
|
|
303
297
|
function resolvePath$3(plugin) {
|
|
@@ -323,13 +317,13 @@ function resolveHttpRequestsStrategy(plugin) {
|
|
|
323
317
|
});
|
|
324
318
|
return plugin.config.httpRequests.strategy;
|
|
325
319
|
}
|
|
326
|
-
|
|
327
320
|
//#endregion
|
|
328
321
|
//#region src/plugins/@angular/common/httpResources/config.ts
|
|
329
322
|
function resolveHttpResources(config, context) {
|
|
330
323
|
let input = config.httpResources;
|
|
331
324
|
if (typeof input === "string" || typeof input === "function") input = { strategy: input };
|
|
332
|
-
else if (typeof input === "boolean"
|
|
325
|
+
else if (typeof input === "boolean") input = { enabled: input };
|
|
326
|
+
else if (!input) input = {};
|
|
333
327
|
const strategy = input.strategy ?? "flat";
|
|
334
328
|
return context.valueToObject({
|
|
335
329
|
defaultValue: {
|
|
@@ -380,7 +374,6 @@ function resolveHttpResources(config, context) {
|
|
|
380
374
|
value: input
|
|
381
375
|
});
|
|
382
376
|
}
|
|
383
|
-
|
|
384
377
|
//#endregion
|
|
385
378
|
//#region src/plugins/@angular/common/httpResources/resolve.ts
|
|
386
379
|
function resolvePath$2(plugin) {
|
|
@@ -406,14 +399,12 @@ function resolveHttpResourcesStrategy(plugin) {
|
|
|
406
399
|
});
|
|
407
400
|
return plugin.config.httpResources.strategy;
|
|
408
401
|
}
|
|
409
|
-
|
|
410
402
|
//#endregion
|
|
411
403
|
//#region src/config/utils.ts
|
|
412
404
|
function getTypedConfig(plugin) {
|
|
413
405
|
if ("context" in plugin) return plugin.context.config;
|
|
414
406
|
return plugin.config;
|
|
415
407
|
}
|
|
416
|
-
|
|
417
408
|
//#endregion
|
|
418
409
|
//#region src/plugins/@hey-api/client-core/utils.ts
|
|
419
410
|
function getClientBaseUrlKey(config) {
|
|
@@ -431,7 +422,6 @@ function getClientPlugin(config) {
|
|
|
431
422
|
name: ""
|
|
432
423
|
};
|
|
433
424
|
}
|
|
434
|
-
|
|
435
425
|
//#endregion
|
|
436
426
|
//#region src/ts-dsl/base.ts
|
|
437
427
|
var TsDsl = class {
|
|
@@ -535,7 +525,6 @@ var TsDsl = class {
|
|
|
535
525
|
}
|
|
536
526
|
};
|
|
537
527
|
var TypeTsDsl = class extends TsDsl {};
|
|
538
|
-
|
|
539
528
|
//#endregion
|
|
540
529
|
//#region src/ts-dsl/expr/id.ts
|
|
541
530
|
const Mixed$56 = TsDsl;
|
|
@@ -552,7 +541,6 @@ var IdTsDsl = class extends Mixed$56 {
|
|
|
552
541
|
return ts.factory.createIdentifier(this.name.toString());
|
|
553
542
|
}
|
|
554
543
|
};
|
|
555
|
-
|
|
556
544
|
//#endregion
|
|
557
545
|
//#region src/ts-dsl/layout/newline.ts
|
|
558
546
|
var NewlineTsDsl = class extends TsDsl {
|
|
@@ -564,7 +552,6 @@ var NewlineTsDsl = class extends TsDsl {
|
|
|
564
552
|
return this.$node(new IdTsDsl("\n"));
|
|
565
553
|
}
|
|
566
554
|
};
|
|
567
|
-
|
|
568
555
|
//#endregion
|
|
569
556
|
//#region src/ts-dsl/mixins/args.ts
|
|
570
557
|
/**
|
|
@@ -591,7 +578,6 @@ function ArgsMixin(Base) {
|
|
|
591
578
|
}
|
|
592
579
|
return Args;
|
|
593
580
|
}
|
|
594
|
-
|
|
595
581
|
//#endregion
|
|
596
582
|
//#region src/ts-dsl/expr/prefix.ts
|
|
597
583
|
const Mixed$55 = TsDsl;
|
|
@@ -648,7 +634,6 @@ var PrefixTsDsl = class extends Mixed$55 {
|
|
|
648
634
|
return missing;
|
|
649
635
|
}
|
|
650
636
|
};
|
|
651
|
-
|
|
652
637
|
//#endregion
|
|
653
638
|
//#region src/ts-dsl/utils/factories.ts
|
|
654
639
|
function createFactory(name) {
|
|
@@ -680,7 +665,6 @@ const f = {
|
|
|
680
665
|
},
|
|
681
666
|
typeofExpr: createFactory("typeofExpr")
|
|
682
667
|
};
|
|
683
|
-
|
|
684
668
|
//#endregion
|
|
685
669
|
//#region src/ts-dsl/mixins/as.ts
|
|
686
670
|
function AsMixin(Base) {
|
|
@@ -694,7 +678,6 @@ function AsMixin(Base) {
|
|
|
694
678
|
}
|
|
695
679
|
return As;
|
|
696
680
|
}
|
|
697
|
-
|
|
698
681
|
//#endregion
|
|
699
682
|
//#region src/ts-dsl/expr/literal.ts
|
|
700
683
|
const Mixed$54 = AsMixin(TsDsl);
|
|
@@ -720,181 +703,155 @@ var LiteralTsDsl = class extends Mixed$54 {
|
|
|
720
703
|
throw new Error(`Unsupported literal: ${String(this.value)}`);
|
|
721
704
|
}
|
|
722
705
|
};
|
|
723
|
-
|
|
724
|
-
//#endregion
|
|
725
|
-
//#region src/ts-dsl/utils/regexp.ts
|
|
726
|
-
/**
|
|
727
|
-
* Matches characters from the start as long as they're not allowed.
|
|
728
|
-
*/
|
|
729
|
-
const illegalStartCharactersRegExp = /^[^$_\p{ID_Start}]+/u;
|
|
730
|
-
/**
|
|
731
|
-
* Matches string if it contains only digits and optionally decimal point or
|
|
732
|
-
* leading minus sign.
|
|
733
|
-
*/
|
|
734
|
-
const numberRegExp = /^-?\d+(\.\d+)?$/;
|
|
735
|
-
/**
|
|
736
|
-
* Javascript identifier regexp pattern retrieved from
|
|
737
|
-
* {@link} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers
|
|
738
|
-
*/
|
|
739
|
-
const validTypescriptIdentifierRegExp = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
|
|
740
706
|
const regexp = {
|
|
741
|
-
illegalStartCharacters:
|
|
742
|
-
number:
|
|
743
|
-
typeScriptIdentifier:
|
|
707
|
+
illegalStartCharacters: /^[^$_\p{ID_Start}]+/u,
|
|
708
|
+
number: /^-?\d+(\.\d+)?$/,
|
|
709
|
+
typeScriptIdentifier: /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u
|
|
744
710
|
};
|
|
745
|
-
|
|
746
|
-
//#endregion
|
|
747
|
-
//#region src/ts-dsl/utils/keywords.ts
|
|
748
|
-
const browserGlobals = [
|
|
749
|
-
"AbortController",
|
|
750
|
-
"AbortSignal",
|
|
751
|
-
"Blob",
|
|
752
|
-
"CustomEvent",
|
|
753
|
-
"document",
|
|
754
|
-
"Event",
|
|
755
|
-
"EventTarget",
|
|
756
|
-
"fetch",
|
|
757
|
-
"File",
|
|
758
|
-
"FileList",
|
|
759
|
-
"FileReader",
|
|
760
|
-
"FormData",
|
|
761
|
-
"Headers",
|
|
762
|
-
"history",
|
|
763
|
-
"location",
|
|
764
|
-
"navigator",
|
|
765
|
-
"Request",
|
|
766
|
-
"Response",
|
|
767
|
-
"TextDecoder",
|
|
768
|
-
"TextEncoder",
|
|
769
|
-
"URL",
|
|
770
|
-
"URLSearchParams",
|
|
771
|
-
"window"
|
|
772
|
-
];
|
|
773
|
-
const javaScriptGlobals = [
|
|
774
|
-
"Array",
|
|
775
|
-
"ArrayBuffer",
|
|
776
|
-
"atob",
|
|
777
|
-
"BigInt",
|
|
778
|
-
"Boolean",
|
|
779
|
-
"btoa",
|
|
780
|
-
"clearInterval",
|
|
781
|
-
"clearTimeout",
|
|
782
|
-
"console",
|
|
783
|
-
"crypto",
|
|
784
|
-
"DataView",
|
|
785
|
-
"Date",
|
|
786
|
-
"Error",
|
|
787
|
-
"Function",
|
|
788
|
-
"globalThis",
|
|
789
|
-
"Infinity",
|
|
790
|
-
"Intl",
|
|
791
|
-
"JSON",
|
|
792
|
-
"Map",
|
|
793
|
-
"Math",
|
|
794
|
-
"NaN",
|
|
795
|
-
"Number",
|
|
796
|
-
"Object",
|
|
797
|
-
"performance",
|
|
798
|
-
"Promise",
|
|
799
|
-
"Proxy",
|
|
800
|
-
"queueMicrotask",
|
|
801
|
-
"Reflect",
|
|
802
|
-
"RegExp",
|
|
803
|
-
"Set",
|
|
804
|
-
"setInterval",
|
|
805
|
-
"setTimeout",
|
|
806
|
-
"String",
|
|
807
|
-
"structuredClone",
|
|
808
|
-
"Symbol",
|
|
809
|
-
"WeakMap",
|
|
810
|
-
"WeakSet"
|
|
811
|
-
];
|
|
812
|
-
const javaScriptKeywords = [
|
|
813
|
-
"arguments",
|
|
814
|
-
"async",
|
|
815
|
-
"await",
|
|
816
|
-
"break",
|
|
817
|
-
"case",
|
|
818
|
-
"catch",
|
|
819
|
-
"class",
|
|
820
|
-
"const",
|
|
821
|
-
"continue",
|
|
822
|
-
"debugger",
|
|
823
|
-
"default",
|
|
824
|
-
"delete",
|
|
825
|
-
"do",
|
|
826
|
-
"else",
|
|
827
|
-
"enum",
|
|
828
|
-
"eval",
|
|
829
|
-
"export",
|
|
830
|
-
"extends",
|
|
831
|
-
"false",
|
|
832
|
-
"finally",
|
|
833
|
-
"for",
|
|
834
|
-
"from",
|
|
835
|
-
"function",
|
|
836
|
-
"if",
|
|
837
|
-
"implements",
|
|
838
|
-
"import",
|
|
839
|
-
"in",
|
|
840
|
-
"instanceof",
|
|
841
|
-
"interface",
|
|
842
|
-
"let",
|
|
843
|
-
"new",
|
|
844
|
-
"null",
|
|
845
|
-
"package",
|
|
846
|
-
"private",
|
|
847
|
-
"protected",
|
|
848
|
-
"public",
|
|
849
|
-
"return",
|
|
850
|
-
"static",
|
|
851
|
-
"super",
|
|
852
|
-
"switch",
|
|
853
|
-
"this",
|
|
854
|
-
"throw",
|
|
855
|
-
"true",
|
|
856
|
-
"try",
|
|
857
|
-
"typeof",
|
|
858
|
-
"var",
|
|
859
|
-
"void",
|
|
860
|
-
"while",
|
|
861
|
-
"with",
|
|
862
|
-
"yield"
|
|
863
|
-
];
|
|
864
|
-
const nodeGlobals = [
|
|
865
|
-
"__dirname",
|
|
866
|
-
"__filename",
|
|
867
|
-
"Buffer",
|
|
868
|
-
"exports",
|
|
869
|
-
"global",
|
|
870
|
-
"module",
|
|
871
|
-
"process",
|
|
872
|
-
"require"
|
|
873
|
-
];
|
|
874
|
-
const typeScriptKeywords = [
|
|
875
|
-
"any",
|
|
876
|
-
"as",
|
|
877
|
-
"bigint",
|
|
878
|
-
"boolean",
|
|
879
|
-
"namespace",
|
|
880
|
-
"never",
|
|
881
|
-
"null",
|
|
882
|
-
"number",
|
|
883
|
-
"string",
|
|
884
|
-
"symbol",
|
|
885
|
-
"type",
|
|
886
|
-
"undefined",
|
|
887
|
-
"unknown",
|
|
888
|
-
"void"
|
|
889
|
-
];
|
|
890
711
|
const keywords = {
|
|
891
|
-
browserGlobals
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
712
|
+
browserGlobals: [
|
|
713
|
+
"AbortController",
|
|
714
|
+
"AbortSignal",
|
|
715
|
+
"Blob",
|
|
716
|
+
"CustomEvent",
|
|
717
|
+
"document",
|
|
718
|
+
"Event",
|
|
719
|
+
"EventTarget",
|
|
720
|
+
"fetch",
|
|
721
|
+
"File",
|
|
722
|
+
"FileList",
|
|
723
|
+
"FileReader",
|
|
724
|
+
"FormData",
|
|
725
|
+
"Headers",
|
|
726
|
+
"history",
|
|
727
|
+
"location",
|
|
728
|
+
"navigator",
|
|
729
|
+
"Request",
|
|
730
|
+
"Response",
|
|
731
|
+
"TextDecoder",
|
|
732
|
+
"TextEncoder",
|
|
733
|
+
"URL",
|
|
734
|
+
"URLSearchParams",
|
|
735
|
+
"window"
|
|
736
|
+
],
|
|
737
|
+
javaScriptGlobals: [
|
|
738
|
+
"Array",
|
|
739
|
+
"ArrayBuffer",
|
|
740
|
+
"atob",
|
|
741
|
+
"BigInt",
|
|
742
|
+
"Boolean",
|
|
743
|
+
"btoa",
|
|
744
|
+
"clearInterval",
|
|
745
|
+
"clearTimeout",
|
|
746
|
+
"console",
|
|
747
|
+
"crypto",
|
|
748
|
+
"DataView",
|
|
749
|
+
"Date",
|
|
750
|
+
"Error",
|
|
751
|
+
"Function",
|
|
752
|
+
"globalThis",
|
|
753
|
+
"Infinity",
|
|
754
|
+
"Intl",
|
|
755
|
+
"JSON",
|
|
756
|
+
"Map",
|
|
757
|
+
"Math",
|
|
758
|
+
"NaN",
|
|
759
|
+
"Number",
|
|
760
|
+
"Object",
|
|
761
|
+
"performance",
|
|
762
|
+
"Promise",
|
|
763
|
+
"Proxy",
|
|
764
|
+
"queueMicrotask",
|
|
765
|
+
"Reflect",
|
|
766
|
+
"RegExp",
|
|
767
|
+
"Set",
|
|
768
|
+
"setInterval",
|
|
769
|
+
"setTimeout",
|
|
770
|
+
"String",
|
|
771
|
+
"structuredClone",
|
|
772
|
+
"Symbol",
|
|
773
|
+
"WeakMap",
|
|
774
|
+
"WeakSet"
|
|
775
|
+
],
|
|
776
|
+
javaScriptKeywords: [
|
|
777
|
+
"arguments",
|
|
778
|
+
"async",
|
|
779
|
+
"await",
|
|
780
|
+
"break",
|
|
781
|
+
"case",
|
|
782
|
+
"catch",
|
|
783
|
+
"class",
|
|
784
|
+
"const",
|
|
785
|
+
"continue",
|
|
786
|
+
"debugger",
|
|
787
|
+
"default",
|
|
788
|
+
"delete",
|
|
789
|
+
"do",
|
|
790
|
+
"else",
|
|
791
|
+
"enum",
|
|
792
|
+
"eval",
|
|
793
|
+
"export",
|
|
794
|
+
"extends",
|
|
795
|
+
"false",
|
|
796
|
+
"finally",
|
|
797
|
+
"for",
|
|
798
|
+
"from",
|
|
799
|
+
"function",
|
|
800
|
+
"if",
|
|
801
|
+
"implements",
|
|
802
|
+
"import",
|
|
803
|
+
"in",
|
|
804
|
+
"instanceof",
|
|
805
|
+
"interface",
|
|
806
|
+
"let",
|
|
807
|
+
"new",
|
|
808
|
+
"null",
|
|
809
|
+
"package",
|
|
810
|
+
"private",
|
|
811
|
+
"protected",
|
|
812
|
+
"public",
|
|
813
|
+
"return",
|
|
814
|
+
"static",
|
|
815
|
+
"super",
|
|
816
|
+
"switch",
|
|
817
|
+
"this",
|
|
818
|
+
"throw",
|
|
819
|
+
"true",
|
|
820
|
+
"try",
|
|
821
|
+
"typeof",
|
|
822
|
+
"var",
|
|
823
|
+
"void",
|
|
824
|
+
"while",
|
|
825
|
+
"with",
|
|
826
|
+
"yield"
|
|
827
|
+
],
|
|
828
|
+
nodeGlobals: [
|
|
829
|
+
"__dirname",
|
|
830
|
+
"__filename",
|
|
831
|
+
"Buffer",
|
|
832
|
+
"exports",
|
|
833
|
+
"global",
|
|
834
|
+
"module",
|
|
835
|
+
"process",
|
|
836
|
+
"require"
|
|
837
|
+
],
|
|
838
|
+
typeScriptKeywords: [
|
|
839
|
+
"any",
|
|
840
|
+
"as",
|
|
841
|
+
"bigint",
|
|
842
|
+
"boolean",
|
|
843
|
+
"namespace",
|
|
844
|
+
"never",
|
|
845
|
+
"null",
|
|
846
|
+
"number",
|
|
847
|
+
"string",
|
|
848
|
+
"symbol",
|
|
849
|
+
"type",
|
|
850
|
+
"undefined",
|
|
851
|
+
"unknown",
|
|
852
|
+
"void"
|
|
853
|
+
]
|
|
896
854
|
};
|
|
897
|
-
|
|
898
855
|
//#endregion
|
|
899
856
|
//#region src/ts-dsl/utils/reserved.ts
|
|
900
857
|
var ReservedList = class {
|
|
@@ -919,23 +876,20 @@ var ReservedList = class {
|
|
|
919
876
|
this._set = new Set(vals);
|
|
920
877
|
}
|
|
921
878
|
};
|
|
922
|
-
const runtimeReserved = new ReservedList([
|
|
923
|
-
...keywords.browserGlobals,
|
|
924
|
-
...keywords.javaScriptGlobals,
|
|
925
|
-
...keywords.javaScriptKeywords,
|
|
926
|
-
...keywords.nodeGlobals,
|
|
927
|
-
...keywords.typeScriptKeywords
|
|
928
|
-
]);
|
|
929
|
-
const typeReserved = new ReservedList([...keywords.javaScriptKeywords, ...keywords.typeScriptKeywords]);
|
|
930
879
|
/**
|
|
931
880
|
* Reserved names for identifiers. These names will not be used
|
|
932
881
|
* for variables, functions, classes, or other identifiers in generated code.
|
|
933
882
|
*/
|
|
934
883
|
const reserved = {
|
|
935
|
-
runtime:
|
|
936
|
-
|
|
884
|
+
runtime: new ReservedList([
|
|
885
|
+
...keywords.browserGlobals,
|
|
886
|
+
...keywords.javaScriptGlobals,
|
|
887
|
+
...keywords.javaScriptKeywords,
|
|
888
|
+
...keywords.nodeGlobals,
|
|
889
|
+
...keywords.typeScriptKeywords
|
|
890
|
+
]),
|
|
891
|
+
type: new ReservedList([...keywords.javaScriptKeywords, ...keywords.typeScriptKeywords])
|
|
937
892
|
};
|
|
938
|
-
|
|
939
893
|
//#endregion
|
|
940
894
|
//#region src/ts-dsl/utils/name.ts
|
|
941
895
|
const safeAccessorName = (name) => {
|
|
@@ -984,7 +938,6 @@ const safeName = (name, reserved) => {
|
|
|
984
938
|
};
|
|
985
939
|
const safeRuntimeName = (name) => safeName(name, reserved.runtime);
|
|
986
940
|
const safeTypeName = (name) => safeName(name, reserved.type);
|
|
987
|
-
|
|
988
941
|
//#endregion
|
|
989
942
|
//#region src/ts-dsl/decl/decorator.ts
|
|
990
943
|
const Mixed$53 = ArgsMixin(TsDsl);
|
|
@@ -1006,7 +959,6 @@ var DecoratorTsDsl = class extends Mixed$53 {
|
|
|
1006
959
|
return ts.factory.createDecorator(args.length ? ts.factory.createCallExpression(target, void 0, args) : target);
|
|
1007
960
|
}
|
|
1008
961
|
};
|
|
1009
|
-
|
|
1010
962
|
//#endregion
|
|
1011
963
|
//#region src/ts-dsl/mixins/decorator.ts
|
|
1012
964
|
function DecoratorMixin(Base) {
|
|
@@ -1026,7 +978,6 @@ function DecoratorMixin(Base) {
|
|
|
1026
978
|
}
|
|
1027
979
|
return Decorator;
|
|
1028
980
|
}
|
|
1029
|
-
|
|
1030
981
|
//#endregion
|
|
1031
982
|
//#region src/ts-dsl/utils/context.ts
|
|
1032
983
|
function accessChainToNode(accessChain) {
|
|
@@ -1166,7 +1117,6 @@ var TsDslContext = class {
|
|
|
1166
1117
|
}
|
|
1167
1118
|
};
|
|
1168
1119
|
const ctx = new TsDslContext();
|
|
1169
|
-
|
|
1170
1120
|
//#endregion
|
|
1171
1121
|
//#region src/ts-dsl/layout/doc.ts
|
|
1172
1122
|
var DocTsDsl = class extends TsDsl {
|
|
@@ -1201,7 +1151,6 @@ var DocTsDsl = class extends TsDsl {
|
|
|
1201
1151
|
return this.$node(new IdTsDsl(""));
|
|
1202
1152
|
}
|
|
1203
1153
|
};
|
|
1204
|
-
|
|
1205
1154
|
//#endregion
|
|
1206
1155
|
//#region src/ts-dsl/mixins/doc.ts
|
|
1207
1156
|
function DocMixin(Base) {
|
|
@@ -1220,7 +1169,6 @@ function DocMixin(Base) {
|
|
|
1220
1169
|
}
|
|
1221
1170
|
return Doc;
|
|
1222
1171
|
}
|
|
1223
|
-
|
|
1224
1172
|
//#endregion
|
|
1225
1173
|
//#region src/ts-dsl/mixins/modifiers.ts
|
|
1226
1174
|
function modifierToKind(modifier) {
|
|
@@ -1403,7 +1351,6 @@ function StaticMixin(Base) {
|
|
|
1403
1351
|
}
|
|
1404
1352
|
return Static;
|
|
1405
1353
|
}
|
|
1406
|
-
|
|
1407
1354
|
//#endregion
|
|
1408
1355
|
//#region src/ts-dsl/type/param.ts
|
|
1409
1356
|
const Mixed$52 = TsDsl;
|
|
@@ -1437,7 +1384,6 @@ var TypeParamTsDsl = class extends Mixed$52 {
|
|
|
1437
1384
|
return ts.factory.createTypeParameterDeclaration(void 0, this.$node(this.name), this.$type(this.constraint), this.$type(this.defaultValue));
|
|
1438
1385
|
}
|
|
1439
1386
|
};
|
|
1440
|
-
|
|
1441
1387
|
//#endregion
|
|
1442
1388
|
//#region src/ts-dsl/mixins/type-params.ts
|
|
1443
1389
|
function TypeParamsMixin(Base) {
|
|
@@ -1465,7 +1411,6 @@ function TypeParamsMixin(Base) {
|
|
|
1465
1411
|
}
|
|
1466
1412
|
return TypeParams;
|
|
1467
1413
|
}
|
|
1468
|
-
|
|
1469
1414
|
//#endregion
|
|
1470
1415
|
//#region src/ts-dsl/mixins/optional.ts
|
|
1471
1416
|
function OptionalMixin(Base) {
|
|
@@ -1485,7 +1430,6 @@ function OptionalMixin(Base) {
|
|
|
1485
1430
|
}
|
|
1486
1431
|
return Optional;
|
|
1487
1432
|
}
|
|
1488
|
-
|
|
1489
1433
|
//#endregion
|
|
1490
1434
|
//#region src/ts-dsl/mixins/value.ts
|
|
1491
1435
|
function ValueMixin(Base) {
|
|
@@ -1505,7 +1449,6 @@ function ValueMixin(Base) {
|
|
|
1505
1449
|
}
|
|
1506
1450
|
return Value;
|
|
1507
1451
|
}
|
|
1508
|
-
|
|
1509
1452
|
//#endregion
|
|
1510
1453
|
//#region src/ts-dsl/token.ts
|
|
1511
1454
|
var TokenTsDsl = class extends TsDsl {
|
|
@@ -1559,7 +1502,6 @@ var TokenTsDsl = class extends TsDsl {
|
|
|
1559
1502
|
return !this.missingRequiredCalls().length;
|
|
1560
1503
|
}
|
|
1561
1504
|
};
|
|
1562
|
-
|
|
1563
1505
|
//#endregion
|
|
1564
1506
|
//#region src/ts-dsl/mixins/type-args.ts
|
|
1565
1507
|
function TypeArgsMixin(Base) {
|
|
@@ -1583,7 +1525,6 @@ function TypeArgsMixin(Base) {
|
|
|
1583
1525
|
}
|
|
1584
1526
|
return TypeArgs;
|
|
1585
1527
|
}
|
|
1586
|
-
|
|
1587
1528
|
//#endregion
|
|
1588
1529
|
//#region src/ts-dsl/mixins/type-expr.ts
|
|
1589
1530
|
function TypeExprMixin(Base) {
|
|
@@ -1615,7 +1556,6 @@ function TypeExprMixin(Base) {
|
|
|
1615
1556
|
}
|
|
1616
1557
|
return TypeExpr;
|
|
1617
1558
|
}
|
|
1618
|
-
|
|
1619
1559
|
//#endregion
|
|
1620
1560
|
//#region src/ts-dsl/type/attr.ts
|
|
1621
1561
|
const Mixed$51 = TypeExprMixin(TsDsl);
|
|
@@ -1670,7 +1610,6 @@ var TypeAttrTsDsl = class extends Mixed$51 {
|
|
|
1670
1610
|
return missing;
|
|
1671
1611
|
}
|
|
1672
1612
|
};
|
|
1673
|
-
|
|
1674
1613
|
//#endregion
|
|
1675
1614
|
//#region src/ts-dsl/type/expr.ts
|
|
1676
1615
|
const Mixed$50 = TypeArgsMixin(TypeExprMixin(TsDsl));
|
|
@@ -1715,7 +1654,6 @@ var TypeExprTsDsl = class extends Mixed$50 {
|
|
|
1715
1654
|
}
|
|
1716
1655
|
};
|
|
1717
1656
|
f.type.expr.set((...args) => new TypeExprTsDsl(...args));
|
|
1718
|
-
|
|
1719
1657
|
//#endregion
|
|
1720
1658
|
//#region src/ts-dsl/decl/field.ts
|
|
1721
1659
|
const Mixed$49 = DecoratorMixin(DocMixin(OptionalMixin(PrivateMixin(ProtectedMixin(PublicMixin(ReadonlyMixin(StaticMixin(ValueMixin(TsDsl)))))))));
|
|
@@ -1743,7 +1681,6 @@ var FieldTsDsl = class extends Mixed$49 {
|
|
|
1743
1681
|
return this.$docs(node);
|
|
1744
1682
|
}
|
|
1745
1683
|
};
|
|
1746
|
-
|
|
1747
1684
|
//#endregion
|
|
1748
1685
|
//#region src/ts-dsl/stmt/stmt.ts
|
|
1749
1686
|
const Mixed$48 = TsDsl;
|
|
@@ -1763,7 +1700,6 @@ var StmtTsDsl = class extends Mixed$48 {
|
|
|
1763
1700
|
return ts.isStatement(node) ? node : ts.factory.createExpressionStatement(node);
|
|
1764
1701
|
}
|
|
1765
1702
|
};
|
|
1766
|
-
|
|
1767
1703
|
//#endregion
|
|
1768
1704
|
//#region src/ts-dsl/mixins/do.ts
|
|
1769
1705
|
/**
|
|
@@ -1791,7 +1727,6 @@ function DoMixin(Base) {
|
|
|
1791
1727
|
}
|
|
1792
1728
|
return Do;
|
|
1793
1729
|
}
|
|
1794
|
-
|
|
1795
1730
|
//#endregion
|
|
1796
1731
|
//#region src/ts-dsl/decl/pattern.ts
|
|
1797
1732
|
const Mixed$47 = TsDsl;
|
|
@@ -1864,7 +1799,6 @@ var PatternTsDsl = class extends Mixed$47 {
|
|
|
1864
1799
|
return this._spread ? ts.factory.createBindingElement(this.$node(new TokenTsDsl().spread()), void 0, this.$node(new IdTsDsl(this._spread))) : void 0;
|
|
1865
1800
|
}
|
|
1866
1801
|
};
|
|
1867
|
-
|
|
1868
1802
|
//#endregion
|
|
1869
1803
|
//#region src/ts-dsl/mixins/pattern.ts
|
|
1870
1804
|
/**
|
|
@@ -1898,7 +1832,6 @@ function PatternMixin(Base) {
|
|
|
1898
1832
|
}
|
|
1899
1833
|
return Pattern;
|
|
1900
1834
|
}
|
|
1901
|
-
|
|
1902
1835
|
//#endregion
|
|
1903
1836
|
//#region src/ts-dsl/decl/param.ts
|
|
1904
1837
|
const Mixed$46 = DecoratorMixin(OptionalMixin(PatternMixin(ValueMixin(TsDsl))));
|
|
@@ -1942,7 +1875,6 @@ var ParamTsDsl = class extends Mixed$46 {
|
|
|
1942
1875
|
return missing;
|
|
1943
1876
|
}
|
|
1944
1877
|
};
|
|
1945
|
-
|
|
1946
1878
|
//#endregion
|
|
1947
1879
|
//#region src/ts-dsl/mixins/param.ts
|
|
1948
1880
|
function ParamMixin(Base) {
|
|
@@ -1967,7 +1899,6 @@ function ParamMixin(Base) {
|
|
|
1967
1899
|
}
|
|
1968
1900
|
return Param;
|
|
1969
1901
|
}
|
|
1970
|
-
|
|
1971
1902
|
//#endregion
|
|
1972
1903
|
//#region src/ts-dsl/mixins/layout.ts
|
|
1973
1904
|
function LayoutMixin(Base) {
|
|
@@ -1997,7 +1928,6 @@ function LayoutMixin(Base) {
|
|
|
1997
1928
|
}
|
|
1998
1929
|
return Layout;
|
|
1999
1930
|
}
|
|
2000
|
-
|
|
2001
1931
|
//#endregion
|
|
2002
1932
|
//#region src/ts-dsl/stmt/block.ts
|
|
2003
1933
|
const Mixed$45 = DoMixin(LayoutMixin(TsDsl));
|
|
@@ -2015,7 +1945,6 @@ var BlockTsDsl = class extends Mixed$45 {
|
|
|
2015
1945
|
return ts.factory.createBlock(statements, this.$multiline(statements.length));
|
|
2016
1946
|
}
|
|
2017
1947
|
};
|
|
2018
|
-
|
|
2019
1948
|
//#endregion
|
|
2020
1949
|
//#region src/ts-dsl/decl/init.ts
|
|
2021
1950
|
const Mixed$44 = DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(TsDsl)))))));
|
|
@@ -2038,7 +1967,6 @@ var InitTsDsl = class extends Mixed$44 {
|
|
|
2038
1967
|
return this.$docs(node);
|
|
2039
1968
|
}
|
|
2040
1969
|
};
|
|
2041
|
-
|
|
2042
1970
|
//#endregion
|
|
2043
1971
|
//#region src/ts-dsl/mixins/type-returns.ts
|
|
2044
1972
|
function TypeReturnsMixin(Base) {
|
|
@@ -2058,7 +1986,6 @@ function TypeReturnsMixin(Base) {
|
|
|
2058
1986
|
}
|
|
2059
1987
|
return TypeReturns;
|
|
2060
1988
|
}
|
|
2061
|
-
|
|
2062
1989
|
//#endregion
|
|
2063
1990
|
//#region src/ts-dsl/decl/method.ts
|
|
2064
1991
|
const Mixed$43 = AbstractMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(OptionalMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TypeParamsMixin(TypeReturnsMixin(TsDsl)))))))))))));
|
|
@@ -2085,7 +2012,6 @@ var MethodTsDsl = class extends Mixed$43 {
|
|
|
2085
2012
|
}
|
|
2086
2013
|
};
|
|
2087
2014
|
f.method.set((...args) => new MethodTsDsl(...args));
|
|
2088
|
-
|
|
2089
2015
|
//#endregion
|
|
2090
2016
|
//#region src/ts-dsl/decl/class.ts
|
|
2091
2017
|
const Mixed$42 = AbstractMixin(DecoratorMixin(DefaultMixin(DocMixin(ExportMixin(TypeParamsMixin(TsDsl))))));
|
|
@@ -2159,7 +2085,6 @@ var ClassTsDsl = class extends Mixed$42 {
|
|
|
2159
2085
|
return [ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [ts.factory.createExpressionWithTypeArguments(node, void 0)])];
|
|
2160
2086
|
}
|
|
2161
2087
|
};
|
|
2162
|
-
|
|
2163
2088
|
//#endregion
|
|
2164
2089
|
//#region src/ts-dsl/decl/member.ts
|
|
2165
2090
|
const Mixed$41 = DocMixin(TsDsl);
|
|
@@ -2186,7 +2111,6 @@ var EnumMemberTsDsl = class extends Mixed$41 {
|
|
|
2186
2111
|
return this.$docs(node);
|
|
2187
2112
|
}
|
|
2188
2113
|
};
|
|
2189
|
-
|
|
2190
2114
|
//#endregion
|
|
2191
2115
|
//#region src/ts-dsl/decl/enum.ts
|
|
2192
2116
|
const Mixed$40 = ConstMixin(DocMixin(ExportMixin(TsDsl)));
|
|
@@ -2226,7 +2150,6 @@ var EnumTsDsl = class extends Mixed$40 {
|
|
|
2226
2150
|
return this.$docs(node);
|
|
2227
2151
|
}
|
|
2228
2152
|
};
|
|
2229
|
-
|
|
2230
2153
|
//#endregion
|
|
2231
2154
|
//#region src/ts-dsl/decl/func.ts
|
|
2232
2155
|
const Mixed$39 = AbstractMixin(AsMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(ExportMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TypeParamsMixin(TypeReturnsMixin(TsDsl))))))))))))));
|
|
@@ -2300,7 +2223,6 @@ var ImplFuncTsDsl = class extends Mixed$39 {
|
|
|
2300
2223
|
}
|
|
2301
2224
|
};
|
|
2302
2225
|
const FuncTsDsl = ImplFuncTsDsl;
|
|
2303
|
-
|
|
2304
2226
|
//#endregion
|
|
2305
2227
|
//#region src/ts-dsl/decl/getter.ts
|
|
2306
2228
|
const Mixed$38 = AbstractMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TypeReturnsMixin(TsDsl)))))))))));
|
|
@@ -2326,7 +2248,6 @@ var GetterTsDsl = class extends Mixed$38 {
|
|
|
2326
2248
|
return this.$docs(node);
|
|
2327
2249
|
}
|
|
2328
2250
|
};
|
|
2329
|
-
|
|
2330
2251
|
//#endregion
|
|
2331
2252
|
//#region src/ts-dsl/decl/setter.ts
|
|
2332
2253
|
const Mixed$37 = AbstractMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TsDsl))))))))));
|
|
@@ -2352,7 +2273,6 @@ var SetterTsDsl = class extends Mixed$37 {
|
|
|
2352
2273
|
return this.$docs(node);
|
|
2353
2274
|
}
|
|
2354
2275
|
};
|
|
2355
|
-
|
|
2356
2276
|
//#endregion
|
|
2357
2277
|
//#region src/ts-dsl/mixins/expr.ts
|
|
2358
2278
|
function ExprMixin(Base) {
|
|
@@ -2375,7 +2295,6 @@ function ExprMixin(Base) {
|
|
|
2375
2295
|
}
|
|
2376
2296
|
return Expr;
|
|
2377
2297
|
}
|
|
2378
|
-
|
|
2379
2298
|
//#endregion
|
|
2380
2299
|
//#region src/ts-dsl/mixins/spread.ts
|
|
2381
2300
|
function SpreadMixin(Base) {
|
|
@@ -2389,7 +2308,6 @@ function SpreadMixin(Base) {
|
|
|
2389
2308
|
}
|
|
2390
2309
|
return Spread;
|
|
2391
2310
|
}
|
|
2392
|
-
|
|
2393
2311
|
//#endregion
|
|
2394
2312
|
//#region src/ts-dsl/expr/array.ts
|
|
2395
2313
|
const Mixed$36 = AsMixin(ExprMixin(LayoutMixin(SpreadMixin(TsDsl))));
|
|
@@ -2419,7 +2337,6 @@ var ArrayTsDsl = class extends Mixed$36 {
|
|
|
2419
2337
|
return ts.factory.createArrayLiteralExpression(this._elements.map((item) => this.$node(item)), this.$multiline(this._elements.length));
|
|
2420
2338
|
}
|
|
2421
2339
|
};
|
|
2422
|
-
|
|
2423
2340
|
//#endregion
|
|
2424
2341
|
//#region src/ts-dsl/expr/as.ts
|
|
2425
2342
|
const Mixed$35 = AsMixin(ExprMixin(TsDsl));
|
|
@@ -2442,7 +2359,6 @@ var AsTsDsl = class extends Mixed$35 {
|
|
|
2442
2359
|
}
|
|
2443
2360
|
};
|
|
2444
2361
|
f.as.set((...args) => new AsTsDsl(...args));
|
|
2445
|
-
|
|
2446
2362
|
//#endregion
|
|
2447
2363
|
//#region src/ts-dsl/expr/binary.ts
|
|
2448
2364
|
const Mixed$34 = AsMixin(ExprMixin(TsDsl));
|
|
@@ -2581,7 +2497,6 @@ var BinaryTsDsl = class extends Mixed$34 {
|
|
|
2581
2497
|
return token;
|
|
2582
2498
|
}
|
|
2583
2499
|
};
|
|
2584
|
-
|
|
2585
2500
|
//#endregion
|
|
2586
2501
|
//#region src/ts-dsl/mixins/operator.ts
|
|
2587
2502
|
function OperatorMixin(Base) {
|
|
@@ -2643,7 +2558,6 @@ function OperatorMixin(Base) {
|
|
|
2643
2558
|
}
|
|
2644
2559
|
return Operator;
|
|
2645
2560
|
}
|
|
2646
|
-
|
|
2647
2561
|
//#endregion
|
|
2648
2562
|
//#region src/ts-dsl/expr/attr.ts
|
|
2649
2563
|
const Mixed$33 = AsMixin(ExprMixin(OperatorMixin(OptionalMixin(SpreadMixin(TsDsl)))));
|
|
@@ -2683,7 +2597,6 @@ var AttrTsDsl = class extends Mixed$33 {
|
|
|
2683
2597
|
}
|
|
2684
2598
|
};
|
|
2685
2599
|
f.attr.set((...args) => new AttrTsDsl(...args));
|
|
2686
|
-
|
|
2687
2600
|
//#endregion
|
|
2688
2601
|
//#region src/ts-dsl/expr/await.ts
|
|
2689
2602
|
const Mixed$32 = ExprMixin(TsDsl);
|
|
@@ -2703,7 +2616,6 @@ var AwaitTsDsl = class extends Mixed$32 {
|
|
|
2703
2616
|
}
|
|
2704
2617
|
};
|
|
2705
2618
|
f.await.set((...args) => new AwaitTsDsl(...args));
|
|
2706
|
-
|
|
2707
2619
|
//#endregion
|
|
2708
2620
|
//#region src/ts-dsl/expr/call.ts
|
|
2709
2621
|
const Mixed$31 = ArgsMixin(AsMixin(ExprMixin(SpreadMixin(TypeArgsMixin(TsDsl)))));
|
|
@@ -2724,7 +2636,6 @@ var CallTsDsl = class extends Mixed$31 {
|
|
|
2724
2636
|
}
|
|
2725
2637
|
};
|
|
2726
2638
|
f.call.set((...args) => new CallTsDsl(...args));
|
|
2727
|
-
|
|
2728
2639
|
//#endregion
|
|
2729
2640
|
//#region src/ts-dsl/expr/expr.ts
|
|
2730
2641
|
const Mixed$30 = AsMixin(ExprMixin(OperatorMixin(SpreadMixin(TypeExprMixin(TsDsl)))));
|
|
@@ -2745,7 +2656,6 @@ var ExprTsDsl = class extends Mixed$30 {
|
|
|
2745
2656
|
return this.$node(this._exprInput);
|
|
2746
2657
|
}
|
|
2747
2658
|
};
|
|
2748
|
-
|
|
2749
2659
|
//#endregion
|
|
2750
2660
|
//#region src/ts-dsl/layout/hint.ts
|
|
2751
2661
|
var HintTsDsl = class extends TsDsl {
|
|
@@ -2777,7 +2687,6 @@ var HintTsDsl = class extends TsDsl {
|
|
|
2777
2687
|
return this.$node(new IdTsDsl(""));
|
|
2778
2688
|
}
|
|
2779
2689
|
};
|
|
2780
|
-
|
|
2781
2690
|
//#endregion
|
|
2782
2691
|
//#region src/ts-dsl/mixins/hint.ts
|
|
2783
2692
|
function HintMixin(Base) {
|
|
@@ -2796,7 +2705,6 @@ function HintMixin(Base) {
|
|
|
2796
2705
|
}
|
|
2797
2706
|
return Hint;
|
|
2798
2707
|
}
|
|
2799
|
-
|
|
2800
2708
|
//#endregion
|
|
2801
2709
|
//#region src/ts-dsl/expr/prop.ts
|
|
2802
2710
|
const Mixed$29 = DocMixin(TsDsl);
|
|
@@ -2863,7 +2771,6 @@ var ObjectPropTsDsl = class extends Mixed$29 {
|
|
|
2863
2771
|
return missing;
|
|
2864
2772
|
}
|
|
2865
2773
|
};
|
|
2866
|
-
|
|
2867
2774
|
//#endregion
|
|
2868
2775
|
//#region src/ts-dsl/expr/object.ts
|
|
2869
2776
|
const Mixed$28 = AsMixin(ExprMixin(HintMixin(LayoutMixin(TsDsl))));
|
|
@@ -2955,7 +2862,6 @@ var ObjectTsDsl = class extends Mixed$28 {
|
|
|
2955
2862
|
return this.$hint(node);
|
|
2956
2863
|
}
|
|
2957
2864
|
};
|
|
2958
|
-
|
|
2959
2865
|
//#endregion
|
|
2960
2866
|
//#region src/ts-dsl/expr/from-value.ts
|
|
2961
2867
|
const fromValue$1 = (input, options) => {
|
|
@@ -2977,7 +2883,6 @@ const fromValue$1 = (input, options) => {
|
|
|
2977
2883
|
}
|
|
2978
2884
|
throw new Error(`$.fromValue(): Unsupported input type ${String(input)}`);
|
|
2979
2885
|
};
|
|
2980
|
-
|
|
2981
2886
|
//#endregion
|
|
2982
2887
|
//#region src/ts-dsl/expr/new.ts
|
|
2983
2888
|
const Mixed$27 = ArgsMixin(AsMixin(ExprMixin(SpreadMixin(TypeArgsMixin(TsDsl)))));
|
|
@@ -2998,7 +2903,6 @@ var NewTsDsl = class extends Mixed$27 {
|
|
|
2998
2903
|
}
|
|
2999
2904
|
};
|
|
3000
2905
|
f.new.set((...args) => new NewTsDsl(...args));
|
|
3001
|
-
|
|
3002
2906
|
//#endregion
|
|
3003
2907
|
//#region src/ts-dsl/expr/postfix.ts
|
|
3004
2908
|
const Mixed$26 = TsDsl;
|
|
@@ -3055,7 +2959,6 @@ var PostfixTsDsl = class extends Mixed$26 {
|
|
|
3055
2959
|
return missing;
|
|
3056
2960
|
}
|
|
3057
2961
|
};
|
|
3058
|
-
|
|
3059
2962
|
//#endregion
|
|
3060
2963
|
//#region src/ts-dsl/expr/regexp.ts
|
|
3061
2964
|
const Mixed$25 = TsDsl;
|
|
@@ -3076,7 +2979,6 @@ var RegExpTsDsl = class extends Mixed$25 {
|
|
|
3076
2979
|
return ts.factory.createRegularExpressionLiteral(literal);
|
|
3077
2980
|
}
|
|
3078
2981
|
};
|
|
3079
|
-
|
|
3080
2982
|
//#endregion
|
|
3081
2983
|
//#region src/ts-dsl/expr/spread.ts
|
|
3082
2984
|
const Mixed$24 = TsDsl;
|
|
@@ -3096,7 +2998,6 @@ var SpreadTsDsl = class extends Mixed$24 {
|
|
|
3096
2998
|
}
|
|
3097
2999
|
};
|
|
3098
3000
|
f.spread.set((...args) => new SpreadTsDsl(...args));
|
|
3099
|
-
|
|
3100
3001
|
//#endregion
|
|
3101
3002
|
//#region src/ts-dsl/expr/template.ts
|
|
3102
3003
|
const Mixed$23 = TsDsl;
|
|
@@ -3147,7 +3048,6 @@ var TemplateTsDsl = class extends Mixed$23 {
|
|
|
3147
3048
|
return ts.factory.createTemplateExpression(head, spans);
|
|
3148
3049
|
}
|
|
3149
3050
|
};
|
|
3150
|
-
|
|
3151
3051
|
//#endregion
|
|
3152
3052
|
//#region src/ts-dsl/expr/ternary.ts
|
|
3153
3053
|
const Mixed$22 = TsDsl;
|
|
@@ -3199,7 +3099,6 @@ var TernaryTsDsl = class extends Mixed$22 {
|
|
|
3199
3099
|
return missing;
|
|
3200
3100
|
}
|
|
3201
3101
|
};
|
|
3202
|
-
|
|
3203
3102
|
//#endregion
|
|
3204
3103
|
//#region src/ts-dsl/expr/typeof.ts
|
|
3205
3104
|
const Mixed$21 = OperatorMixin(TsDsl);
|
|
@@ -3219,7 +3118,6 @@ var TypeOfExprTsDsl = class extends Mixed$21 {
|
|
|
3219
3118
|
}
|
|
3220
3119
|
};
|
|
3221
3120
|
f.typeofExpr.set((...args) => new TypeOfExprTsDsl(...args));
|
|
3222
|
-
|
|
3223
3121
|
//#endregion
|
|
3224
3122
|
//#region src/ts-dsl/layout/note.ts
|
|
3225
3123
|
var NoteTsDsl = class extends TsDsl {
|
|
@@ -3251,7 +3149,6 @@ var NoteTsDsl = class extends TsDsl {
|
|
|
3251
3149
|
return this.$node(new IdTsDsl(""));
|
|
3252
3150
|
}
|
|
3253
3151
|
};
|
|
3254
|
-
|
|
3255
3152
|
//#endregion
|
|
3256
3153
|
//#region src/ts-dsl/stmt/for.ts
|
|
3257
3154
|
const Mixed$20 = DoMixin(LayoutMixin(TsDsl));
|
|
@@ -3350,7 +3247,6 @@ var ImplForTsDsl = class extends Mixed$20 {
|
|
|
3350
3247
|
}
|
|
3351
3248
|
};
|
|
3352
3249
|
const ForTsDsl = ImplForTsDsl;
|
|
3353
|
-
|
|
3354
3250
|
//#endregion
|
|
3355
3251
|
//#region src/ts-dsl/stmt/if.ts
|
|
3356
3252
|
const Mixed$19 = DoMixin(TsDsl);
|
|
@@ -3402,7 +3298,6 @@ var IfTsDsl = class extends Mixed$19 {
|
|
|
3402
3298
|
return missing;
|
|
3403
3299
|
}
|
|
3404
3300
|
};
|
|
3405
|
-
|
|
3406
3301
|
//#endregion
|
|
3407
3302
|
//#region src/ts-dsl/stmt/return.ts
|
|
3408
3303
|
const Mixed$18 = TsDsl;
|
|
@@ -3422,7 +3317,6 @@ var ReturnTsDsl = class extends Mixed$18 {
|
|
|
3422
3317
|
}
|
|
3423
3318
|
};
|
|
3424
3319
|
f.return.set((...args) => new ReturnTsDsl(...args));
|
|
3425
|
-
|
|
3426
3320
|
//#endregion
|
|
3427
3321
|
//#region src/ts-dsl/stmt/throw.ts
|
|
3428
3322
|
const Mixed$17 = TsDsl;
|
|
@@ -3453,7 +3347,6 @@ var ThrowTsDsl = class extends Mixed$17 {
|
|
|
3453
3347
|
return ts.factory.createThrowStatement(args[0]);
|
|
3454
3348
|
}
|
|
3455
3349
|
};
|
|
3456
|
-
|
|
3457
3350
|
//#endregion
|
|
3458
3351
|
//#region src/ts-dsl/stmt/try.ts
|
|
3459
3352
|
const Mixed$16 = TsDsl;
|
|
@@ -3531,7 +3424,6 @@ var TryTsDsl = class extends Mixed$16 {
|
|
|
3531
3424
|
return missing;
|
|
3532
3425
|
}
|
|
3533
3426
|
};
|
|
3534
|
-
|
|
3535
3427
|
//#endregion
|
|
3536
3428
|
//#region src/ts-dsl/stmt/var.ts
|
|
3537
3429
|
const Mixed$15 = DefaultMixin(DocMixin(ExportMixin(HintMixin(PatternMixin(ValueMixin(TsDsl))))));
|
|
@@ -3587,7 +3479,6 @@ var VarTsDsl = class extends Mixed$15 {
|
|
|
3587
3479
|
return missing;
|
|
3588
3480
|
}
|
|
3589
3481
|
};
|
|
3590
|
-
|
|
3591
3482
|
//#endregion
|
|
3592
3483
|
//#region src/ts-dsl/type/alias.ts
|
|
3593
3484
|
const Mixed$14 = DocMixin(ExportMixin(TypeParamsMixin(TsDsl)));
|
|
@@ -3633,7 +3524,6 @@ var TypeAliasTsDsl = class extends Mixed$14 {
|
|
|
3633
3524
|
return missing;
|
|
3634
3525
|
}
|
|
3635
3526
|
};
|
|
3636
|
-
|
|
3637
3527
|
//#endregion
|
|
3638
3528
|
//#region src/ts-dsl/type/and.ts
|
|
3639
3529
|
const Mixed$13 = TsDsl;
|
|
@@ -3663,7 +3553,6 @@ var TypeAndTsDsl = class extends Mixed$13 {
|
|
|
3663
3553
|
return ts.factory.createIntersectionTypeNode(flat);
|
|
3664
3554
|
}
|
|
3665
3555
|
};
|
|
3666
|
-
|
|
3667
3556
|
//#endregion
|
|
3668
3557
|
//#region src/ts-dsl/type/literal.ts
|
|
3669
3558
|
const Mixed$12 = TsDsl;
|
|
@@ -3682,7 +3571,6 @@ var TypeLiteralTsDsl = class extends Mixed$12 {
|
|
|
3682
3571
|
return ts.factory.createLiteralTypeNode(this.$node(new LiteralTsDsl(this.value)));
|
|
3683
3572
|
}
|
|
3684
3573
|
};
|
|
3685
|
-
|
|
3686
3574
|
//#endregion
|
|
3687
3575
|
//#region src/ts-dsl/type/idx-sig.ts
|
|
3688
3576
|
const Mixed$11 = DocMixin(ReadonlyMixin(TsDsl));
|
|
@@ -3741,7 +3629,6 @@ var TypeIdxSigTsDsl = class extends Mixed$11 {
|
|
|
3741
3629
|
return missing;
|
|
3742
3630
|
}
|
|
3743
3631
|
};
|
|
3744
|
-
|
|
3745
3632
|
//#endregion
|
|
3746
3633
|
//#region src/ts-dsl/type/prop.ts
|
|
3747
3634
|
const Mixed$10 = DocMixin(OptionalMixin(ReadonlyMixin(TsDsl)));
|
|
@@ -3793,7 +3680,6 @@ var TypePropTsDsl = class extends Mixed$10 {
|
|
|
3793
3680
|
return missing;
|
|
3794
3681
|
}
|
|
3795
3682
|
};
|
|
3796
|
-
|
|
3797
3683
|
//#endregion
|
|
3798
3684
|
//#region src/ts-dsl/type/object.ts
|
|
3799
3685
|
const Mixed$9 = TsDsl;
|
|
@@ -3836,7 +3722,6 @@ var TypeObjectTsDsl = class extends Mixed$9 {
|
|
|
3836
3722
|
return ts.factory.createTypeLiteralNode(this.$node([...this._props.values()]));
|
|
3837
3723
|
}
|
|
3838
3724
|
};
|
|
3839
|
-
|
|
3840
3725
|
//#endregion
|
|
3841
3726
|
//#region src/ts-dsl/type/tuple.ts
|
|
3842
3727
|
const Mixed$8 = TsDsl;
|
|
@@ -3860,7 +3745,6 @@ var TypeTupleTsDsl = class extends Mixed$8 {
|
|
|
3860
3745
|
return ts.factory.createTupleTypeNode(this._elements.map((t) => this.$type(t)));
|
|
3861
3746
|
}
|
|
3862
3747
|
};
|
|
3863
|
-
|
|
3864
3748
|
//#endregion
|
|
3865
3749
|
//#region src/ts-dsl/type/from-value.ts
|
|
3866
3750
|
const fromValue = (input) => {
|
|
@@ -3878,7 +3762,6 @@ const fromValue = (input) => {
|
|
|
3878
3762
|
}
|
|
3879
3763
|
throw new Error(`$.type.fromValue(): Unsupported input type ${String(input)}`);
|
|
3880
3764
|
};
|
|
3881
|
-
|
|
3882
3765
|
//#endregion
|
|
3883
3766
|
//#region src/ts-dsl/type/func.ts
|
|
3884
3767
|
const Mixed$7 = DocMixin(ParamMixin(TypeParamsMixin(TypeReturnsMixin(TsDsl))));
|
|
@@ -3908,7 +3791,6 @@ var TypeFuncTsDsl = class extends Mixed$7 {
|
|
|
3908
3791
|
return missing;
|
|
3909
3792
|
}
|
|
3910
3793
|
};
|
|
3911
|
-
|
|
3912
3794
|
//#endregion
|
|
3913
3795
|
//#region src/ts-dsl/type/idx.ts
|
|
3914
3796
|
const Mixed$6 = TypeExprMixin(TsDsl);
|
|
@@ -3956,7 +3838,6 @@ var TypeIdxTsDsl = class extends Mixed$6 {
|
|
|
3956
3838
|
}
|
|
3957
3839
|
};
|
|
3958
3840
|
f.type.idx.set((...args) => new TypeIdxTsDsl(...args));
|
|
3959
|
-
|
|
3960
3841
|
//#endregion
|
|
3961
3842
|
//#region src/ts-dsl/type/mapped.ts
|
|
3962
3843
|
const Mixed$5 = TsDsl;
|
|
@@ -4029,7 +3910,6 @@ var TypeMappedTsDsl = class extends Mixed$5 {
|
|
|
4029
3910
|
return missing;
|
|
4030
3911
|
}
|
|
4031
3912
|
};
|
|
4032
|
-
|
|
4033
3913
|
//#endregion
|
|
4034
3914
|
//#region src/ts-dsl/type/operator.ts
|
|
4035
3915
|
const Mixed$4 = TsDsl;
|
|
@@ -4100,7 +3980,6 @@ var TypeOperatorTsDsl = class extends Mixed$4 {
|
|
|
4100
3980
|
}
|
|
4101
3981
|
};
|
|
4102
3982
|
f.type.operator.set((...args) => new TypeOperatorTsDsl(...args));
|
|
4103
|
-
|
|
4104
3983
|
//#endregion
|
|
4105
3984
|
//#region src/ts-dsl/type/or.ts
|
|
4106
3985
|
const Mixed$3 = TsDsl;
|
|
@@ -4130,7 +4009,6 @@ var TypeOrTsDsl = class extends Mixed$3 {
|
|
|
4130
4009
|
return ts.factory.createUnionTypeNode(flat);
|
|
4131
4010
|
}
|
|
4132
4011
|
};
|
|
4133
|
-
|
|
4134
4012
|
//#endregion
|
|
4135
4013
|
//#region src/ts-dsl/type/query.ts
|
|
4136
4014
|
const Mixed$2 = TypeExprMixin(TsDsl);
|
|
@@ -4152,7 +4030,6 @@ var TypeQueryTsDsl = class extends Mixed$2 {
|
|
|
4152
4030
|
}
|
|
4153
4031
|
};
|
|
4154
4032
|
f.type.query.set((...args) => new TypeQueryTsDsl(...args));
|
|
4155
|
-
|
|
4156
4033
|
//#endregion
|
|
4157
4034
|
//#region src/ts-dsl/type/template.ts
|
|
4158
4035
|
const Mixed$1 = TsDsl;
|
|
@@ -4201,7 +4078,6 @@ var TypeTemplateTsDsl = class extends Mixed$1 {
|
|
|
4201
4078
|
return ts.factory.createTemplateLiteralType(head, spans);
|
|
4202
4079
|
}
|
|
4203
4080
|
};
|
|
4204
|
-
|
|
4205
4081
|
//#endregion
|
|
4206
4082
|
//#region src/ts-dsl/type/tuple-member.ts
|
|
4207
4083
|
const Mixed = OptionalMixin(TsDsl);
|
|
@@ -4242,7 +4118,6 @@ var TypeTupleMemberTsDsl = class extends Mixed {
|
|
|
4242
4118
|
}
|
|
4243
4119
|
};
|
|
4244
4120
|
f.type.tupleMember.set((name) => new TypeTupleMemberTsDsl(name));
|
|
4245
|
-
|
|
4246
4121
|
//#endregion
|
|
4247
4122
|
//#region src/ts-dsl/utils/lazy.ts
|
|
4248
4123
|
var LazyTsDsl = class extends TsDsl {
|
|
@@ -4263,7 +4138,6 @@ var LazyTsDsl = class extends TsDsl {
|
|
|
4263
4138
|
return this.toResult().toAst();
|
|
4264
4139
|
}
|
|
4265
4140
|
};
|
|
4266
|
-
|
|
4267
4141
|
//#endregion
|
|
4268
4142
|
//#region src/ts-dsl/utils/render-utils.ts
|
|
4269
4143
|
const printer = ts.createPrinter({
|
|
@@ -4316,7 +4190,6 @@ function moduleSortKey({ file, fromFile, preferFileExtension, root }) {
|
|
|
4316
4190
|
modulePath
|
|
4317
4191
|
];
|
|
4318
4192
|
}
|
|
4319
|
-
|
|
4320
4193
|
//#endregion
|
|
4321
4194
|
//#region src/ts-dsl/utils/render.ts
|
|
4322
4195
|
function headerToLines(header) {
|
|
@@ -4498,7 +4371,6 @@ var TypeScriptRenderer = class TypeScriptRenderer {
|
|
|
4498
4371
|
});
|
|
4499
4372
|
}
|
|
4500
4373
|
};
|
|
4501
|
-
|
|
4502
4374
|
//#endregion
|
|
4503
4375
|
//#region src/ts-dsl/index.ts
|
|
4504
4376
|
const tsDsl = {
|
|
@@ -4578,7 +4450,6 @@ const tsDsl = {
|
|
|
4578
4450
|
var: (...args) => new VarTsDsl(...args)
|
|
4579
4451
|
};
|
|
4580
4452
|
const $ = Object.assign((...args) => new ExprTsDsl(...args), tsDsl);
|
|
4581
|
-
|
|
4582
4453
|
//#endregion
|
|
4583
4454
|
//#region src/plugins/@hey-api/sdk/shared/class.ts
|
|
4584
4455
|
const createRegistryClass = ({ plugin, sdkSymbol, symbol }) => {
|
|
@@ -4592,13 +4463,11 @@ const createClientClass = ({ plugin, symbol }) => {
|
|
|
4592
4463
|
const symbolClient = plugin.external("client.Client");
|
|
4593
4464
|
return $.class(symbol).field("client", (f) => f.protected().type(symbolClient)).newline().init((i) => i.param("args", (p) => p.optional(optionalClient).type($.type.object().prop("client", (p) => p.optional(optionalClient).type(symbolClient)))).do($("this").attr("client").assign($("args").attr("client").optional(optionalClient).$if(optionalClient, (a) => a.coalesce(symClient)))));
|
|
4594
4465
|
};
|
|
4595
|
-
|
|
4596
4466
|
//#endregion
|
|
4597
4467
|
//#region src/plugins/@hey-api/sdk/shared/constants.ts
|
|
4598
4468
|
const nuxtTypeComposable = "TComposable";
|
|
4599
4469
|
const nuxtTypeDefault = "DefaultT";
|
|
4600
4470
|
const nuxtTypeResponse = "ResT";
|
|
4601
|
-
|
|
4602
4471
|
//#endregion
|
|
4603
4472
|
//#region src/plugins/@hey-api/sdk/shared/auth.ts
|
|
4604
4473
|
const securitySchemeObjectToAuthObject = ({ securitySchemeObject }) => {
|
|
@@ -4644,7 +4513,6 @@ const operationAuth = ({ operation, plugin }) => {
|
|
|
4644
4513
|
}
|
|
4645
4514
|
return auth;
|
|
4646
4515
|
};
|
|
4647
|
-
|
|
4648
4516
|
//#endregion
|
|
4649
4517
|
//#region src/plugins/@hey-api/sdk/shared/signature.ts
|
|
4650
4518
|
/**
|
|
@@ -4751,7 +4619,6 @@ function getSignatureParameters({ operation }) {
|
|
|
4751
4619
|
parameters: signatureParameters
|
|
4752
4620
|
};
|
|
4753
4621
|
}
|
|
4754
|
-
|
|
4755
4622
|
//#endregion
|
|
4756
4623
|
//#region src/plugins/@hey-api/sdk/shared/validator.ts
|
|
4757
4624
|
function createRequestValidator({ plugin, ...args }) {
|
|
@@ -4772,7 +4639,6 @@ function createResponseValidator({ operation, plugin }) {
|
|
|
4772
4639
|
plugin: validator
|
|
4773
4640
|
});
|
|
4774
4641
|
}
|
|
4775
|
-
|
|
4776
4642
|
//#endregion
|
|
4777
4643
|
//#region src/plugins/@hey-api/sdk/shared/operation.ts
|
|
4778
4644
|
/** TODO: needs complete refactor */
|
|
@@ -4999,7 +4865,6 @@ function operationStatements({ isRequiredOptions, opParameters, operation, plugi
|
|
|
4999
4865
|
statements.push($.return(functionName.call(reqOptions).$if(isNuxtClient, (f) => f.generic(nuxtTypeComposable).generic($.type.or(symbolResponseType ?? "unknown", nuxtTypeDefault)).generic(symbolErrorType ?? "unknown").generic(nuxtTypeDefault), (f) => f.generic(symbolResponseType ?? "unknown").generic(symbolErrorType ?? "unknown").generic("ThrowOnError")).$if(plugin.config.responseStyle === "data", (f) => f.generic($.type.literal(plugin.config.responseStyle)))));
|
|
5000
4866
|
return statements;
|
|
5001
4867
|
}
|
|
5002
|
-
|
|
5003
4868
|
//#endregion
|
|
5004
4869
|
//#region src/plugins/@hey-api/sdk/v1/node.ts
|
|
5005
4870
|
const source$2 = globalThis.Symbol("@hey-api/sdk");
|
|
@@ -5192,7 +5057,6 @@ function toNode$2(model, plugin) {
|
|
|
5192
5057
|
nodes
|
|
5193
5058
|
};
|
|
5194
5059
|
}
|
|
5195
|
-
|
|
5196
5060
|
//#endregion
|
|
5197
5061
|
//#region src/plugins/shared/utils/operation.ts
|
|
5198
5062
|
function createOperationComment(operation) {
|
|
@@ -5227,7 +5091,6 @@ function hasOperationSse({ operation }) {
|
|
|
5227
5091
|
for (const statusCode in operation.responses) if (operation.responses[statusCode].mediaType === "text/event-stream") return true;
|
|
5228
5092
|
return false;
|
|
5229
5093
|
}
|
|
5230
|
-
|
|
5231
5094
|
//#endregion
|
|
5232
5095
|
//#region src/plugins/@angular/common/shared/node.ts
|
|
5233
5096
|
const source$1 = globalThis.Symbol("@angular/common");
|
|
@@ -5469,7 +5332,6 @@ function toHttpResourceNode(model, plugin) {
|
|
|
5469
5332
|
nodes
|
|
5470
5333
|
};
|
|
5471
5334
|
}
|
|
5472
|
-
|
|
5473
5335
|
//#endregion
|
|
5474
5336
|
//#region src/plugins/@angular/common/plugin.ts
|
|
5475
5337
|
const handler$13 = ({ plugin }) => {
|
|
@@ -5527,7 +5389,6 @@ const handler$13 = ({ plugin }) => {
|
|
|
5527
5389
|
for (const dep of uniqueDependencies.values()) plugin.node(dep);
|
|
5528
5390
|
for (const node of allNodes) plugin.node(node);
|
|
5529
5391
|
};
|
|
5530
|
-
|
|
5531
5392
|
//#endregion
|
|
5532
5393
|
//#region src/plugins/@angular/common/config.ts
|
|
5533
5394
|
const defaultConfig$26 = {
|
|
@@ -5543,18 +5404,13 @@ const defaultConfig$26 = {
|
|
|
5543
5404
|
plugin.config.httpResources = resolveHttpResources(plugin.config, context);
|
|
5544
5405
|
}
|
|
5545
5406
|
};
|
|
5546
|
-
|
|
5547
|
-
* Type helper for `@angular/common` plugin, returns {@link Plugin.Config} object
|
|
5548
|
-
*/
|
|
5549
|
-
const defineConfig$26 = definePluginConfig(defaultConfig$26);
|
|
5550
|
-
|
|
5407
|
+
definePluginConfig(defaultConfig$26);
|
|
5551
5408
|
//#endregion
|
|
5552
5409
|
//#region src/plugins/@faker-js/faker/api.ts
|
|
5553
5410
|
var Api$4 = class {
|
|
5554
5411
|
toNode(_schema) {}
|
|
5555
5412
|
toNodeRef(_schema) {}
|
|
5556
5413
|
};
|
|
5557
|
-
|
|
5558
5414
|
//#endregion
|
|
5559
5415
|
//#region src/plugins/@faker-js/faker/config.ts
|
|
5560
5416
|
const defaultConfig$25 = {
|
|
@@ -5578,11 +5434,7 @@ const defaultConfig$25 = {
|
|
|
5578
5434
|
},
|
|
5579
5435
|
tags: ["mocker"]
|
|
5580
5436
|
};
|
|
5581
|
-
|
|
5582
|
-
* Type helper for Faker plugin, returns {@link Plugin.Config} object
|
|
5583
|
-
*/
|
|
5584
|
-
const defineConfig$25 = definePluginConfig(defaultConfig$25);
|
|
5585
|
-
|
|
5437
|
+
definePluginConfig(defaultConfig$25);
|
|
5586
5438
|
//#endregion
|
|
5587
5439
|
//#region src/plugins/@hey-api/client-core/config.ts
|
|
5588
5440
|
const clientDefaultConfig = {
|
|
@@ -5594,7 +5446,6 @@ const clientDefaultMeta = {
|
|
|
5594
5446
|
dependencies: ["@hey-api/typescript"],
|
|
5595
5447
|
tags: ["client"]
|
|
5596
5448
|
};
|
|
5597
|
-
|
|
5598
5449
|
//#endregion
|
|
5599
5450
|
//#region src/generate/client.ts
|
|
5600
5451
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -5735,7 +5586,6 @@ function generateClientBundle({ header, module, outputPath, plugin, project }) {
|
|
|
5735
5586
|
ensureDirSync(dirPath);
|
|
5736
5587
|
for (const file of distFiles) fs.copyFileSync(path.resolve(clientDistPath, file), path.resolve(dirPath, file));
|
|
5737
5588
|
}
|
|
5738
|
-
|
|
5739
5589
|
//#endregion
|
|
5740
5590
|
//#region src/plugins/@hey-api/client-core/client.ts
|
|
5741
5591
|
const resolveBaseUrlString = ({ plugin }) => {
|
|
@@ -5773,7 +5623,6 @@ const createClient = ({ plugin }) => {
|
|
|
5773
5623
|
const statement = $.const(symbolClient).export().assign($(symbolCreateClient).$if(symbolCreateClientConfig, (c, s) => c.call($(s).call(...createConfigParameters)), (c) => c.call(...createConfigParameters)));
|
|
5774
5624
|
plugin.node(statement);
|
|
5775
5625
|
};
|
|
5776
|
-
|
|
5777
5626
|
//#endregion
|
|
5778
5627
|
//#region src/plugins/@hey-api/client-core/createClientConfig.ts
|
|
5779
5628
|
const createClientConfigType = ({ plugin }) => {
|
|
@@ -5802,14 +5651,12 @@ const createClientConfigType = ({ plugin }) => {
|
|
|
5802
5651
|
]).generic("T", (g) => g.extends(symbolDefaultClientOptions).default(symbolClientOptions)).type($.type.func().param("override", (p) => p.optional().type($.type(symbolConfig).generic($.type.and(symbolDefaultClientOptions, "T")))).returns($.type(symbolConfig).generic($.type.and($.type("Required").generic(symbolDefaultClientOptions), "T"))));
|
|
5803
5652
|
plugin.node(typeCreateClientConfig);
|
|
5804
5653
|
};
|
|
5805
|
-
|
|
5806
5654
|
//#endregion
|
|
5807
5655
|
//#region src/plugins/@hey-api/client-core/plugin.ts
|
|
5808
5656
|
const clientPluginHandler = ({ plugin }) => {
|
|
5809
5657
|
createClientConfigType({ plugin });
|
|
5810
5658
|
createClient({ plugin });
|
|
5811
5659
|
};
|
|
5812
|
-
|
|
5813
5660
|
//#endregion
|
|
5814
5661
|
//#region src/plugins/@hey-api/client-angular/config.ts
|
|
5815
5662
|
const defaultConfig$24 = {
|
|
@@ -5821,11 +5668,7 @@ const defaultConfig$24 = {
|
|
|
5821
5668
|
handler: clientPluginHandler,
|
|
5822
5669
|
name: "@hey-api/client-angular"
|
|
5823
5670
|
};
|
|
5824
|
-
|
|
5825
|
-
* Type helper for `@hey-api/client-angular` plugin, returns {@link Plugin.Config} object
|
|
5826
|
-
*/
|
|
5827
|
-
const defineConfig$24 = definePluginConfig(defaultConfig$24);
|
|
5828
|
-
|
|
5671
|
+
definePluginConfig(defaultConfig$24);
|
|
5829
5672
|
//#endregion
|
|
5830
5673
|
//#region src/plugins/@hey-api/client-axios/config.ts
|
|
5831
5674
|
const defaultConfig$23 = {
|
|
@@ -5837,11 +5680,7 @@ const defaultConfig$23 = {
|
|
|
5837
5680
|
handler: clientPluginHandler,
|
|
5838
5681
|
name: "@hey-api/client-axios"
|
|
5839
5682
|
};
|
|
5840
|
-
|
|
5841
|
-
* Type helper for `@hey-api/client-axios` plugin, returns {@link Plugin.Config} object
|
|
5842
|
-
*/
|
|
5843
|
-
const defineConfig$23 = definePluginConfig(defaultConfig$23);
|
|
5844
|
-
|
|
5683
|
+
definePluginConfig(defaultConfig$23);
|
|
5845
5684
|
//#endregion
|
|
5846
5685
|
//#region src/plugins/@hey-api/client-fetch/config.ts
|
|
5847
5686
|
const defaultConfig$22 = {
|
|
@@ -5853,11 +5692,7 @@ const defaultConfig$22 = {
|
|
|
5853
5692
|
handler: clientPluginHandler,
|
|
5854
5693
|
name: "@hey-api/client-fetch"
|
|
5855
5694
|
};
|
|
5856
|
-
|
|
5857
|
-
* Type helper for `@hey-api/client-fetch` plugin, returns {@link Plugin.Config} object
|
|
5858
|
-
*/
|
|
5859
|
-
const defineConfig$22 = definePluginConfig(defaultConfig$22);
|
|
5860
|
-
|
|
5695
|
+
definePluginConfig(defaultConfig$22);
|
|
5861
5696
|
//#endregion
|
|
5862
5697
|
//#region src/plugins/@hey-api/client-ky/config.ts
|
|
5863
5698
|
const defaultConfig$21 = {
|
|
@@ -5869,11 +5704,7 @@ const defaultConfig$21 = {
|
|
|
5869
5704
|
handler: clientPluginHandler,
|
|
5870
5705
|
name: "@hey-api/client-ky"
|
|
5871
5706
|
};
|
|
5872
|
-
|
|
5873
|
-
* Type helper for `@hey-api/client-ky` plugin, returns {@link Plugin.Config} object
|
|
5874
|
-
*/
|
|
5875
|
-
const defineConfig$21 = definePluginConfig(defaultConfig$21);
|
|
5876
|
-
|
|
5707
|
+
definePluginConfig(defaultConfig$21);
|
|
5877
5708
|
//#endregion
|
|
5878
5709
|
//#region src/plugins/@hey-api/client-next/config.ts
|
|
5879
5710
|
const defaultConfig$20 = {
|
|
@@ -5885,11 +5716,7 @@ const defaultConfig$20 = {
|
|
|
5885
5716
|
handler: clientPluginHandler,
|
|
5886
5717
|
name: "@hey-api/client-next"
|
|
5887
5718
|
};
|
|
5888
|
-
|
|
5889
|
-
* Type helper for `@hey-api/client-next` plugin, returns {@link Plugin.Config} object
|
|
5890
|
-
*/
|
|
5891
|
-
const defineConfig$20 = definePluginConfig(defaultConfig$20);
|
|
5892
|
-
|
|
5719
|
+
definePluginConfig(defaultConfig$20);
|
|
5893
5720
|
//#endregion
|
|
5894
5721
|
//#region src/plugins/@hey-api/client-nuxt/config.ts
|
|
5895
5722
|
const defaultConfig$19 = {
|
|
@@ -5898,11 +5725,7 @@ const defaultConfig$19 = {
|
|
|
5898
5725
|
handler: clientPluginHandler,
|
|
5899
5726
|
name: "@hey-api/client-nuxt"
|
|
5900
5727
|
};
|
|
5901
|
-
|
|
5902
|
-
* Type helper for `@hey-api/client-nuxt` plugin, returns {@link Plugin.Config} object
|
|
5903
|
-
*/
|
|
5904
|
-
const defineConfig$19 = definePluginConfig(defaultConfig$19);
|
|
5905
|
-
|
|
5728
|
+
definePluginConfig(defaultConfig$19);
|
|
5906
5729
|
//#endregion
|
|
5907
5730
|
//#region src/plugins/@hey-api/client-ofetch/config.ts
|
|
5908
5731
|
const defaultConfig$18 = {
|
|
@@ -5914,14 +5737,10 @@ const defaultConfig$18 = {
|
|
|
5914
5737
|
handler: clientPluginHandler,
|
|
5915
5738
|
name: "@hey-api/client-ofetch"
|
|
5916
5739
|
};
|
|
5917
|
-
|
|
5918
|
-
* Type helper for `@hey-api/client-ofetch` plugin, returns {@link Plugin.Config} object
|
|
5919
|
-
*/
|
|
5920
|
-
const defineConfig$18 = definePluginConfig(defaultConfig$18);
|
|
5921
|
-
|
|
5740
|
+
definePluginConfig(defaultConfig$18);
|
|
5922
5741
|
//#endregion
|
|
5923
5742
|
//#region src/plugins/@hey-api/schemas/plugin.ts
|
|
5924
|
-
|
|
5743
|
+
function stripSchema({ plugin, schema }) {
|
|
5925
5744
|
if (plugin.config.type === "form") {
|
|
5926
5745
|
if (schema.description) delete schema.description;
|
|
5927
5746
|
if (schema["x-enum-descriptions"]) delete schema["x-enum-descriptions"];
|
|
@@ -5929,18 +5748,15 @@ const stripSchema = ({ plugin, schema }) => {
|
|
|
5929
5748
|
if (schema["x-enumNames"]) delete schema["x-enumNames"];
|
|
5930
5749
|
if (schema.title) delete schema.title;
|
|
5931
5750
|
}
|
|
5932
|
-
}
|
|
5933
|
-
|
|
5751
|
+
}
|
|
5752
|
+
function schemaToJsonSchemaDraft_04({ context, plugin, schema: _schema }) {
|
|
5934
5753
|
if (Array.isArray(_schema)) return _schema.map((item) => schemaToJsonSchemaDraft_04({
|
|
5935
5754
|
context,
|
|
5936
5755
|
plugin,
|
|
5937
5756
|
schema: item
|
|
5938
5757
|
}));
|
|
5939
5758
|
const schema = structuredClone(_schema);
|
|
5940
|
-
if (schema.$ref)
|
|
5941
|
-
schema.$ref = decodeURI(schema.$ref);
|
|
5942
|
-
return schema;
|
|
5943
|
-
}
|
|
5759
|
+
if (schema.$ref) return schema;
|
|
5944
5760
|
stripSchema({
|
|
5945
5761
|
plugin,
|
|
5946
5762
|
schema
|
|
@@ -5969,18 +5785,15 @@ const schemaToJsonSchemaDraft_04 = ({ context, plugin, schema: _schema }) => {
|
|
|
5969
5785
|
});
|
|
5970
5786
|
}
|
|
5971
5787
|
return schema;
|
|
5972
|
-
}
|
|
5973
|
-
|
|
5788
|
+
}
|
|
5789
|
+
function schemaToJsonSchemaDraft_05({ context, plugin, schema: _schema }) {
|
|
5974
5790
|
if (Array.isArray(_schema)) return _schema.map((item) => schemaToJsonSchemaDraft_05({
|
|
5975
5791
|
context,
|
|
5976
5792
|
plugin,
|
|
5977
5793
|
schema: item
|
|
5978
5794
|
}));
|
|
5979
5795
|
const schema = structuredClone(_schema);
|
|
5980
|
-
if ("$ref" in schema)
|
|
5981
|
-
schema.$ref = decodeURI(schema.$ref);
|
|
5982
|
-
return schema;
|
|
5983
|
-
}
|
|
5796
|
+
if ("$ref" in schema) return schema;
|
|
5984
5797
|
stripSchema({
|
|
5985
5798
|
plugin,
|
|
5986
5799
|
schema
|
|
@@ -6019,8 +5832,8 @@ const schemaToJsonSchemaDraft_05 = ({ context, plugin, schema: _schema }) => {
|
|
|
6019
5832
|
});
|
|
6020
5833
|
}
|
|
6021
5834
|
return schema;
|
|
6022
|
-
}
|
|
6023
|
-
|
|
5835
|
+
}
|
|
5836
|
+
function schemaToJsonSchema2020_12({ context, plugin, schema: _schema }) {
|
|
6024
5837
|
if (Array.isArray(_schema)) return _schema.map((item) => schemaToJsonSchema2020_12({
|
|
6025
5838
|
context,
|
|
6026
5839
|
plugin,
|
|
@@ -6031,7 +5844,6 @@ const schemaToJsonSchema2020_12 = ({ context, plugin, schema: _schema }) => {
|
|
|
6031
5844
|
plugin,
|
|
6032
5845
|
schema
|
|
6033
5846
|
});
|
|
6034
|
-
if (schema.$ref) schema.$ref = decodeURI(schema.$ref);
|
|
6035
5847
|
if (schema.additionalProperties && typeof schema.additionalProperties !== "boolean") schema.additionalProperties = schemaToJsonSchema2020_12({
|
|
6036
5848
|
context,
|
|
6037
5849
|
plugin,
|
|
@@ -6071,15 +5883,15 @@ const schemaToJsonSchema2020_12 = ({ context, plugin, schema: _schema }) => {
|
|
|
6071
5883
|
});
|
|
6072
5884
|
}
|
|
6073
5885
|
return schema;
|
|
6074
|
-
}
|
|
6075
|
-
|
|
5886
|
+
}
|
|
5887
|
+
function schemaName({ name, plugin, schema }) {
|
|
6076
5888
|
let customName = "";
|
|
6077
5889
|
if (plugin.config.nameBuilder) if (typeof plugin.config.nameBuilder === "function") customName = plugin.config.nameBuilder(name, schema);
|
|
6078
5890
|
else customName = plugin.config.nameBuilder.replace("{{name}}", name);
|
|
6079
5891
|
if (!customName) customName = `${name}Schema`;
|
|
6080
5892
|
return customName;
|
|
6081
|
-
}
|
|
6082
|
-
|
|
5893
|
+
}
|
|
5894
|
+
function schemasV2_0_X({ context, plugin }) {
|
|
6083
5895
|
if (!context.spec.definitions) return;
|
|
6084
5896
|
for (const name in context.spec.definitions) {
|
|
6085
5897
|
const schema = context.spec.definitions[name];
|
|
@@ -6101,8 +5913,8 @@ const schemasV2_0_X = ({ context, plugin }) => {
|
|
|
6101
5913
|
const statement = $.const(symbol).export().assign($($.fromValue(obj, { layout: "pretty" })).as("const"));
|
|
6102
5914
|
plugin.node(statement);
|
|
6103
5915
|
}
|
|
6104
|
-
}
|
|
6105
|
-
|
|
5916
|
+
}
|
|
5917
|
+
function schemasV3_0_X({ context, plugin }) {
|
|
6106
5918
|
if (!context.spec.components) return;
|
|
6107
5919
|
for (const name in context.spec.components.schemas) {
|
|
6108
5920
|
const schema = context.spec.components.schemas[name];
|
|
@@ -6124,8 +5936,8 @@ const schemasV3_0_X = ({ context, plugin }) => {
|
|
|
6124
5936
|
const statement = $.const(symbol).export().assign($($.fromValue(obj, { layout: "pretty" })).as("const"));
|
|
6125
5937
|
plugin.node(statement);
|
|
6126
5938
|
}
|
|
6127
|
-
}
|
|
6128
|
-
|
|
5939
|
+
}
|
|
5940
|
+
function schemasV3_1_X({ context, plugin }) {
|
|
6129
5941
|
if (!context.spec.components) return;
|
|
6130
5942
|
for (const name in context.spec.components.schemas) {
|
|
6131
5943
|
const schema = context.spec.components.schemas[name];
|
|
@@ -6147,7 +5959,7 @@ const schemasV3_1_X = ({ context, plugin }) => {
|
|
|
6147
5959
|
const statement = $.const(symbol).export().assign($($.fromValue(obj, { layout: "pretty" })).as("const"));
|
|
6148
5960
|
plugin.node(statement);
|
|
6149
5961
|
}
|
|
6150
|
-
}
|
|
5962
|
+
}
|
|
6151
5963
|
const handler$12 = ({ plugin }) => {
|
|
6152
5964
|
if ("swagger" in plugin.context.spec) {
|
|
6153
5965
|
schemasV2_0_X({
|
|
@@ -6172,7 +5984,6 @@ const handler$12 = ({ plugin }) => {
|
|
|
6172
5984
|
}
|
|
6173
5985
|
throw new Error("Unsupported OpenAPI specification");
|
|
6174
5986
|
};
|
|
6175
|
-
|
|
6176
5987
|
//#endregion
|
|
6177
5988
|
//#region src/plugins/@hey-api/schemas/config.ts
|
|
6178
5989
|
const defaultConfig$17 = {
|
|
@@ -6184,11 +5995,7 @@ const defaultConfig$17 = {
|
|
|
6184
5995
|
handler: handler$12,
|
|
6185
5996
|
name: "@hey-api/schemas"
|
|
6186
5997
|
};
|
|
6187
|
-
|
|
6188
|
-
* Type helper for `@hey-api/schemas` plugin, returns {@link Plugin.Config} object
|
|
6189
|
-
*/
|
|
6190
|
-
const defineConfig$17 = definePluginConfig(defaultConfig$17);
|
|
6191
|
-
|
|
5998
|
+
definePluginConfig(defaultConfig$17);
|
|
6192
5999
|
//#endregion
|
|
6193
6000
|
//#region src/plugins/@hey-api/sdk/examples/config.ts
|
|
6194
6001
|
function resolveExamples(config, context) {
|
|
@@ -6201,7 +6008,6 @@ function resolveExamples(config, context) {
|
|
|
6201
6008
|
value: config.examples
|
|
6202
6009
|
});
|
|
6203
6010
|
}
|
|
6204
|
-
|
|
6205
6011
|
//#endregion
|
|
6206
6012
|
//#region src/plugins/@hey-api/sdk/operations/config.ts
|
|
6207
6013
|
function resolveOperations(config, context) {
|
|
@@ -6336,7 +6142,6 @@ function mapLegacyToConfig(config) {
|
|
|
6336
6142
|
strategy
|
|
6337
6143
|
};
|
|
6338
6144
|
}
|
|
6339
|
-
|
|
6340
6145
|
//#endregion
|
|
6341
6146
|
//#region src/plugins/@hey-api/sdk/operations/resolve.ts
|
|
6342
6147
|
function resolvePath$1(plugin) {
|
|
@@ -6362,7 +6167,6 @@ function resolveStrategy$1(plugin) {
|
|
|
6362
6167
|
});
|
|
6363
6168
|
return plugin.config.operations.strategy;
|
|
6364
6169
|
}
|
|
6365
|
-
|
|
6366
6170
|
//#endregion
|
|
6367
6171
|
//#region src/plugins/@hey-api/sdk/shared/typeOptions.ts
|
|
6368
6172
|
const createTypeOptions = ({ plugin }) => {
|
|
@@ -6397,7 +6201,6 @@ const createTypeOptions = ({ plugin }) => {
|
|
|
6397
6201
|
]).required(!plugin.config.client && !isInstance(plugin)).type(symbolClient)).prop("meta", (p) => p.doc(["You can pass arbitrary values through the `meta` object. This can be", "used to access values that aren't defined as part of the SDK function."]).optional().type($.type("Record").generics("string", "unknown")))));
|
|
6398
6202
|
plugin.node(typeOptions);
|
|
6399
6203
|
};
|
|
6400
|
-
|
|
6401
6204
|
//#endregion
|
|
6402
6205
|
//#region src/plugins/@hey-api/sdk/v1/plugin.ts
|
|
6403
6206
|
const handlerV1$3 = ({ plugin }) => {
|
|
@@ -6465,11 +6268,9 @@ const handlerV1$3 = ({ plugin }) => {
|
|
|
6465
6268
|
for (const dep of uniqueDependencies.values()) plugin.node(dep);
|
|
6466
6269
|
for (const node of allNodes) plugin.node(node);
|
|
6467
6270
|
};
|
|
6468
|
-
|
|
6469
6271
|
//#endregion
|
|
6470
6272
|
//#region src/plugins/@hey-api/sdk/plugin.ts
|
|
6471
6273
|
const handler$11 = (args) => handlerV1$3(args);
|
|
6472
|
-
|
|
6473
6274
|
//#endregion
|
|
6474
6275
|
//#region src/plugins/@hey-api/sdk/config.ts
|
|
6475
6276
|
const transformerInferWarn = "You set `transformer: true` but no transformer plugin was found in your plugins. Add a transformer plugin like `@hey-api/transformers` to enable this feature. The transformer option has been disabled.";
|
|
@@ -6529,27 +6330,22 @@ const defaultConfig$16 = {
|
|
|
6529
6330
|
plugin.config.operations = resolveOperations(plugin.config, context);
|
|
6530
6331
|
}
|
|
6531
6332
|
};
|
|
6532
|
-
|
|
6533
|
-
* Type helper for `@hey-api/sdk` plugin, returns {@link Plugin.Config} object
|
|
6534
|
-
*/
|
|
6535
|
-
const defineConfig$16 = definePluginConfig(defaultConfig$16);
|
|
6536
|
-
|
|
6333
|
+
definePluginConfig(defaultConfig$16);
|
|
6537
6334
|
//#endregion
|
|
6538
6335
|
//#region src/plugins/@hey-api/transformers/expressions.ts
|
|
6539
6336
|
const bigIntExpressions = ({ dataExpression, schema }) => {
|
|
6540
6337
|
if (schema.type !== "integer" || schema.format !== "int64") return;
|
|
6541
6338
|
const bigIntCallExpression = dataExpression !== void 0 ? $("BigInt").call($(dataExpression).attr("toString").call()) : void 0;
|
|
6542
6339
|
if (bigIntCallExpression) {
|
|
6543
|
-
if (typeof dataExpression === "string") return [bigIntCallExpression];
|
|
6340
|
+
if (typeof dataExpression === "string") return [$.return(bigIntCallExpression)];
|
|
6544
6341
|
if (dataExpression) return [$(dataExpression).assign(bigIntCallExpression)];
|
|
6545
6342
|
}
|
|
6546
6343
|
};
|
|
6547
6344
|
const dateExpressions = ({ dataExpression, schema }) => {
|
|
6548
6345
|
if (schema.type !== "string" || !(schema.format === "date" || schema.format === "date-time")) return;
|
|
6549
|
-
if (typeof dataExpression === "string") return [$.new("Date").arg(dataExpression)];
|
|
6346
|
+
if (typeof dataExpression === "string") return [$.return($.new("Date").arg(dataExpression))];
|
|
6550
6347
|
if (dataExpression) return [$(dataExpression).assign($.new("Date").arg(dataExpression))];
|
|
6551
6348
|
};
|
|
6552
|
-
|
|
6553
6349
|
//#endregion
|
|
6554
6350
|
//#region src/plugins/@hey-api/transformers/plugin.ts
|
|
6555
6351
|
const dataVariableName = "data";
|
|
@@ -6737,7 +6533,6 @@ const handler$10 = ({ plugin }) => {
|
|
|
6737
6533
|
plugin.node(value);
|
|
6738
6534
|
}, { order: "declarations" });
|
|
6739
6535
|
};
|
|
6740
|
-
|
|
6741
6536
|
//#endregion
|
|
6742
6537
|
//#region src/plugins/@hey-api/transformers/config.ts
|
|
6743
6538
|
const defaultConfig$15 = {
|
|
@@ -6758,11 +6553,7 @@ const defaultConfig$15 = {
|
|
|
6758
6553
|
},
|
|
6759
6554
|
tags: ["transformer"]
|
|
6760
6555
|
};
|
|
6761
|
-
|
|
6762
|
-
* Type helper for `@hey-api/transformers`, returns {@link Plugin.Config} object
|
|
6763
|
-
*/
|
|
6764
|
-
const defineConfig$15 = definePluginConfig(defaultConfig$15);
|
|
6765
|
-
|
|
6556
|
+
definePluginConfig(defaultConfig$15);
|
|
6766
6557
|
//#endregion
|
|
6767
6558
|
//#region src/plugins/shared/utils/schema.ts
|
|
6768
6559
|
const createSchemaComment = (schema) => {
|
|
@@ -6778,7 +6569,6 @@ const createSchemaComment = (schema) => {
|
|
|
6778
6569
|
}
|
|
6779
6570
|
return comments.length ? comments : void 0;
|
|
6780
6571
|
};
|
|
6781
|
-
|
|
6782
6572
|
//#endregion
|
|
6783
6573
|
//#region src/plugins/@hey-api/typescript/shared/export.ts
|
|
6784
6574
|
function resolveEnumKey({ baseName, duplicateAttempt, plugin }) {
|
|
@@ -6905,7 +6695,6 @@ function exportAst$3({ final, meta, naming, namingAnchor, path, plugin, schema,
|
|
|
6905
6695
|
const node = $.type.alias(symbol).export().$if(plugin.config.comments && createSchemaComment(schema), (t, v) => t.doc(v)).type(final.type);
|
|
6906
6696
|
plugin.node(node);
|
|
6907
6697
|
}
|
|
6908
|
-
|
|
6909
6698
|
//#endregion
|
|
6910
6699
|
//#region src/plugins/@hey-api/typescript/shared/meta.ts
|
|
6911
6700
|
/**
|
|
@@ -6941,10 +6730,9 @@ function inheritMeta$2(parent, children) {
|
|
|
6941
6730
|
readonly: parent.accessScope === "read"
|
|
6942
6731
|
});
|
|
6943
6732
|
}
|
|
6944
|
-
|
|
6945
6733
|
//#endregion
|
|
6946
6734
|
//#region src/plugins/@hey-api/typescript/v1/toAst/array.ts
|
|
6947
|
-
function baseNode$
|
|
6735
|
+
function baseNode$69(ctx) {
|
|
6948
6736
|
const { plugin, schema, walk } = ctx;
|
|
6949
6737
|
if (!schema.items) return $.type("Array").generic($.type(plugin.config.topType));
|
|
6950
6738
|
const dedupedSchema = deduplicateSchema({
|
|
@@ -6965,7 +6753,7 @@ function arrayResolver$4(ctx) {
|
|
|
6965
6753
|
function arrayToAst$3({ plugin, schema, walk, walkerCtx }) {
|
|
6966
6754
|
const ctx = {
|
|
6967
6755
|
$,
|
|
6968
|
-
nodes: { base: baseNode$
|
|
6756
|
+
nodes: { base: baseNode$69 },
|
|
6969
6757
|
plugin,
|
|
6970
6758
|
schema,
|
|
6971
6759
|
walk,
|
|
@@ -6974,10 +6762,9 @@ function arrayToAst$3({ plugin, schema, walk, walkerCtx }) {
|
|
|
6974
6762
|
const resolver = plugin.config["~resolvers"]?.array;
|
|
6975
6763
|
return resolver?.(ctx) ?? arrayResolver$4(ctx);
|
|
6976
6764
|
}
|
|
6977
|
-
|
|
6978
6765
|
//#endregion
|
|
6979
6766
|
//#region src/plugins/@hey-api/typescript/v1/toAst/boolean.ts
|
|
6980
|
-
function baseNode$
|
|
6767
|
+
function baseNode$68() {
|
|
6981
6768
|
return $.type("boolean");
|
|
6982
6769
|
}
|
|
6983
6770
|
function constNode$19(ctx) {
|
|
@@ -6993,7 +6780,7 @@ function booleanToAst$3({ plugin, schema }) {
|
|
|
6993
6780
|
const ctx = {
|
|
6994
6781
|
$,
|
|
6995
6782
|
nodes: {
|
|
6996
|
-
base: baseNode$
|
|
6783
|
+
base: baseNode$68,
|
|
6997
6784
|
const: constNode$19
|
|
6998
6785
|
},
|
|
6999
6786
|
plugin,
|
|
@@ -7002,7 +6789,6 @@ function booleanToAst$3({ plugin, schema }) {
|
|
|
7002
6789
|
const resolver = plugin.config["~resolvers"]?.boolean;
|
|
7003
6790
|
return resolver?.(ctx) ?? booleanResolver$4(ctx);
|
|
7004
6791
|
}
|
|
7005
|
-
|
|
7006
6792
|
//#endregion
|
|
7007
6793
|
//#region src/plugins/@hey-api/typescript/v1/toAst/enum.ts
|
|
7008
6794
|
function buildEnumData(plugin, schema) {
|
|
@@ -7039,7 +6825,7 @@ function itemsNode$4(ctx) {
|
|
|
7039
6825
|
isNullable
|
|
7040
6826
|
};
|
|
7041
6827
|
}
|
|
7042
|
-
function baseNode$
|
|
6828
|
+
function baseNode$67(ctx) {
|
|
7043
6829
|
const { schema } = ctx;
|
|
7044
6830
|
const items = schema.items ?? [];
|
|
7045
6831
|
if (!items.length) return $.type("never");
|
|
@@ -7054,7 +6840,7 @@ function enumToAst$3({ plugin, schema }) {
|
|
|
7054
6840
|
const ctx = {
|
|
7055
6841
|
$,
|
|
7056
6842
|
nodes: {
|
|
7057
|
-
base: baseNode$
|
|
6843
|
+
base: baseNode$67,
|
|
7058
6844
|
items: itemsNode$4
|
|
7059
6845
|
},
|
|
7060
6846
|
plugin,
|
|
@@ -7066,33 +6852,31 @@ function enumToAst$3({ plugin, schema }) {
|
|
|
7066
6852
|
type: resolver?.(ctx) ?? enumResolver$4(ctx)
|
|
7067
6853
|
};
|
|
7068
6854
|
}
|
|
7069
|
-
|
|
7070
6855
|
//#endregion
|
|
7071
6856
|
//#region src/plugins/@hey-api/typescript/v1/toAst/intersection.ts
|
|
7072
|
-
function baseNode$
|
|
6857
|
+
function baseNode$66(ctx) {
|
|
7073
6858
|
const { childResults } = ctx;
|
|
7074
6859
|
if (childResults.length === 1) return childResults[0].type;
|
|
7075
6860
|
return $.type.and(...childResults.map((r) => r.type));
|
|
7076
6861
|
}
|
|
7077
|
-
function intersectionResolver$
|
|
6862
|
+
function intersectionResolver$4(ctx) {
|
|
7078
6863
|
return ctx.nodes.base(ctx);
|
|
7079
6864
|
}
|
|
7080
|
-
function intersectionToAst({ childResults, parentSchema, plugin, schemas }) {
|
|
6865
|
+
function intersectionToAst$3({ childResults, parentSchema, plugin, schemas }) {
|
|
7081
6866
|
const ctx = {
|
|
7082
6867
|
$,
|
|
7083
6868
|
childResults,
|
|
7084
|
-
nodes: { base: baseNode$
|
|
6869
|
+
nodes: { base: baseNode$66 },
|
|
7085
6870
|
parentSchema,
|
|
7086
6871
|
plugin,
|
|
7087
6872
|
schemas
|
|
7088
6873
|
};
|
|
7089
6874
|
const resolver = plugin.config["~resolvers"]?.intersection;
|
|
7090
|
-
return resolver?.(ctx) ?? intersectionResolver$
|
|
6875
|
+
return resolver?.(ctx) ?? intersectionResolver$4(ctx);
|
|
7091
6876
|
}
|
|
7092
|
-
|
|
7093
6877
|
//#endregion
|
|
7094
6878
|
//#region src/plugins/@hey-api/typescript/v1/toAst/never.ts
|
|
7095
|
-
function baseNode$
|
|
6879
|
+
function baseNode$65() {
|
|
7096
6880
|
return $.type("never");
|
|
7097
6881
|
}
|
|
7098
6882
|
function neverResolver$4(ctx) {
|
|
@@ -7101,17 +6885,16 @@ function neverResolver$4(ctx) {
|
|
|
7101
6885
|
function neverToAst$3({ plugin, schema }) {
|
|
7102
6886
|
const ctx = {
|
|
7103
6887
|
$,
|
|
7104
|
-
nodes: { base: baseNode$
|
|
6888
|
+
nodes: { base: baseNode$65 },
|
|
7105
6889
|
plugin,
|
|
7106
6890
|
schema
|
|
7107
6891
|
};
|
|
7108
6892
|
const resolver = plugin.config["~resolvers"]?.never;
|
|
7109
6893
|
return resolver?.(ctx) ?? neverResolver$4(ctx);
|
|
7110
6894
|
}
|
|
7111
|
-
|
|
7112
6895
|
//#endregion
|
|
7113
6896
|
//#region src/plugins/@hey-api/typescript/v1/toAst/null.ts
|
|
7114
|
-
function baseNode$
|
|
6897
|
+
function baseNode$64() {
|
|
7115
6898
|
return $.type.literal(null);
|
|
7116
6899
|
}
|
|
7117
6900
|
function nullResolver$4(ctx) {
|
|
@@ -7120,21 +6903,20 @@ function nullResolver$4(ctx) {
|
|
|
7120
6903
|
function nullToAst$4({ plugin, schema }) {
|
|
7121
6904
|
const ctx = {
|
|
7122
6905
|
$,
|
|
7123
|
-
nodes: { base: baseNode$
|
|
6906
|
+
nodes: { base: baseNode$64 },
|
|
7124
6907
|
plugin,
|
|
7125
6908
|
schema
|
|
7126
6909
|
};
|
|
7127
6910
|
const resolver = plugin.config["~resolvers"]?.null;
|
|
7128
6911
|
return resolver?.(ctx) ?? nullResolver$4(ctx);
|
|
7129
6912
|
}
|
|
7130
|
-
|
|
7131
6913
|
//#endregion
|
|
7132
6914
|
//#region src/plugins/@hey-api/typescript/v1/toAst/number.ts
|
|
7133
6915
|
function constNode$18(ctx) {
|
|
7134
6916
|
const { schema } = ctx;
|
|
7135
6917
|
if (schema.const !== void 0) return $.type.fromValue(schema.const);
|
|
7136
6918
|
}
|
|
7137
|
-
function baseNode$
|
|
6919
|
+
function baseNode$63(ctx) {
|
|
7138
6920
|
const { plugin, schema } = ctx;
|
|
7139
6921
|
if (schema.type === "integer" && schema.format === "int64") {
|
|
7140
6922
|
if (plugin.getPlugin("@hey-api/transformers")?.config.bigInt) return $.type("bigint");
|
|
@@ -7150,7 +6932,7 @@ function numberToAst({ plugin, schema }) {
|
|
|
7150
6932
|
const ctx = {
|
|
7151
6933
|
$,
|
|
7152
6934
|
nodes: {
|
|
7153
|
-
base: baseNode$
|
|
6935
|
+
base: baseNode$63,
|
|
7154
6936
|
const: constNode$18
|
|
7155
6937
|
},
|
|
7156
6938
|
plugin,
|
|
@@ -7159,7 +6941,6 @@ function numberToAst({ plugin, schema }) {
|
|
|
7159
6941
|
const resolver = plugin.config["~resolvers"]?.number;
|
|
7160
6942
|
return resolver?.(ctx) ?? numberResolver$4(ctx);
|
|
7161
6943
|
}
|
|
7162
|
-
|
|
7163
6944
|
//#endregion
|
|
7164
6945
|
//#region src/plugins/@hey-api/typescript/v1/toAst/object.ts
|
|
7165
6946
|
function shapeNode$4(ctx) {
|
|
@@ -7177,7 +6958,7 @@ function shapeNode$4(ctx) {
|
|
|
7177
6958
|
}
|
|
7178
6959
|
return shape;
|
|
7179
6960
|
}
|
|
7180
|
-
function baseNode$
|
|
6961
|
+
function baseNode$62(ctx) {
|
|
7181
6962
|
const { schema, walk, walkerCtx } = ctx;
|
|
7182
6963
|
const shape = shapeNode$4(ctx);
|
|
7183
6964
|
const required = schema.required ?? [];
|
|
@@ -7229,7 +7010,7 @@ function objectToAst$4({ plugin, schema, walk, walkerCtx }) {
|
|
|
7229
7010
|
const ctx = {
|
|
7230
7011
|
$,
|
|
7231
7012
|
nodes: {
|
|
7232
|
-
base: baseNode$
|
|
7013
|
+
base: baseNode$62,
|
|
7233
7014
|
shape: shapeNode$4
|
|
7234
7015
|
},
|
|
7235
7016
|
plugin,
|
|
@@ -7240,7 +7021,6 @@ function objectToAst$4({ plugin, schema, walk, walkerCtx }) {
|
|
|
7240
7021
|
const resolver = plugin.config["~resolvers"]?.object;
|
|
7241
7022
|
return resolver?.(ctx) ?? objectResolver$4(ctx);
|
|
7242
7023
|
}
|
|
7243
|
-
|
|
7244
7024
|
//#endregion
|
|
7245
7025
|
//#region src/plugins/@hey-api/typescript/v1/toAst/string.ts
|
|
7246
7026
|
function constNode$17(ctx) {
|
|
@@ -7285,7 +7065,7 @@ function formatNode$4(ctx) {
|
|
|
7285
7065
|
return $.type(plugin.referenceSymbol(typeidQuery));
|
|
7286
7066
|
}
|
|
7287
7067
|
}
|
|
7288
|
-
function baseNode$
|
|
7068
|
+
function baseNode$61(ctx) {
|
|
7289
7069
|
return $.type("string");
|
|
7290
7070
|
}
|
|
7291
7071
|
function stringResolver$4(ctx) {
|
|
@@ -7301,7 +7081,7 @@ function stringToAst$1({ plugin, schema }) {
|
|
|
7301
7081
|
const ctx = {
|
|
7302
7082
|
$,
|
|
7303
7083
|
nodes: {
|
|
7304
|
-
base: baseNode$
|
|
7084
|
+
base: baseNode$61,
|
|
7305
7085
|
const: constNode$17,
|
|
7306
7086
|
format: formatNode$4
|
|
7307
7087
|
},
|
|
@@ -7311,10 +7091,9 @@ function stringToAst$1({ plugin, schema }) {
|
|
|
7311
7091
|
const resolver = plugin.config["~resolvers"]?.string;
|
|
7312
7092
|
return resolver?.(ctx) ?? stringResolver$4(ctx);
|
|
7313
7093
|
}
|
|
7314
|
-
|
|
7315
7094
|
//#endregion
|
|
7316
7095
|
//#region src/plugins/@hey-api/typescript/v1/toAst/tuple.ts
|
|
7317
|
-
function baseNode$
|
|
7096
|
+
function baseNode$60(ctx) {
|
|
7318
7097
|
const { plugin, schema, walk } = ctx;
|
|
7319
7098
|
const itemTypes = [];
|
|
7320
7099
|
if (schema.items) schema.items.forEach((item) => {
|
|
@@ -7341,7 +7120,7 @@ function tupleToAst$3({ plugin, schema, walk, walkerCtx }) {
|
|
|
7341
7120
|
const ctx = {
|
|
7342
7121
|
$,
|
|
7343
7122
|
nodes: {
|
|
7344
|
-
base: baseNode$
|
|
7123
|
+
base: baseNode$60,
|
|
7345
7124
|
const: constNode$16
|
|
7346
7125
|
},
|
|
7347
7126
|
plugin,
|
|
@@ -7352,10 +7131,9 @@ function tupleToAst$3({ plugin, schema, walk, walkerCtx }) {
|
|
|
7352
7131
|
const resolver = plugin.config["~resolvers"]?.tuple;
|
|
7353
7132
|
return resolver?.(ctx) ?? tupleResolver$4(ctx);
|
|
7354
7133
|
}
|
|
7355
|
-
|
|
7356
7134
|
//#endregion
|
|
7357
7135
|
//#region src/plugins/@hey-api/typescript/v1/toAst/undefined.ts
|
|
7358
|
-
function baseNode$
|
|
7136
|
+
function baseNode$59() {
|
|
7359
7137
|
return $.type("undefined");
|
|
7360
7138
|
}
|
|
7361
7139
|
function undefinedResolver$4(ctx) {
|
|
@@ -7364,40 +7142,38 @@ function undefinedResolver$4(ctx) {
|
|
|
7364
7142
|
function undefinedToAst$3({ plugin, schema }) {
|
|
7365
7143
|
const ctx = {
|
|
7366
7144
|
$,
|
|
7367
|
-
nodes: { base: baseNode$
|
|
7145
|
+
nodes: { base: baseNode$59 },
|
|
7368
7146
|
plugin,
|
|
7369
7147
|
schema
|
|
7370
7148
|
};
|
|
7371
7149
|
const resolver = plugin.config["~resolvers"]?.undefined;
|
|
7372
7150
|
return resolver?.(ctx) ?? undefinedResolver$4(ctx);
|
|
7373
7151
|
}
|
|
7374
|
-
|
|
7375
7152
|
//#endregion
|
|
7376
7153
|
//#region src/plugins/@hey-api/typescript/v1/toAst/union.ts
|
|
7377
|
-
function baseNode$
|
|
7154
|
+
function baseNode$58(ctx) {
|
|
7378
7155
|
const { childResults } = ctx;
|
|
7379
7156
|
if (childResults.length === 1) return childResults[0].type;
|
|
7380
7157
|
return $.type.or(...childResults.map((r) => r.type));
|
|
7381
7158
|
}
|
|
7382
|
-
function unionResolver$
|
|
7159
|
+
function unionResolver$4(ctx) {
|
|
7383
7160
|
return ctx.nodes.base(ctx);
|
|
7384
7161
|
}
|
|
7385
|
-
function unionToAst({ childResults, parentSchema, plugin, schemas }) {
|
|
7162
|
+
function unionToAst$3({ childResults, parentSchema, plugin, schemas }) {
|
|
7386
7163
|
const ctx = {
|
|
7387
7164
|
$,
|
|
7388
7165
|
childResults,
|
|
7389
|
-
nodes: { base: baseNode$
|
|
7166
|
+
nodes: { base: baseNode$58 },
|
|
7390
7167
|
parentSchema,
|
|
7391
7168
|
plugin,
|
|
7392
7169
|
schemas
|
|
7393
7170
|
};
|
|
7394
7171
|
const resolver = plugin.config["~resolvers"]?.union;
|
|
7395
|
-
return resolver?.(ctx) ?? unionResolver$
|
|
7172
|
+
return resolver?.(ctx) ?? unionResolver$4(ctx);
|
|
7396
7173
|
}
|
|
7397
|
-
|
|
7398
7174
|
//#endregion
|
|
7399
7175
|
//#region src/plugins/@hey-api/typescript/v1/toAst/unknown.ts
|
|
7400
|
-
function baseNode$
|
|
7176
|
+
function baseNode$57(ctx) {
|
|
7401
7177
|
return $.type(ctx.plugin.config.topType);
|
|
7402
7178
|
}
|
|
7403
7179
|
function unknownResolver$4(ctx) {
|
|
@@ -7406,17 +7182,16 @@ function unknownResolver$4(ctx) {
|
|
|
7406
7182
|
function unknownToAst$3({ plugin, schema }) {
|
|
7407
7183
|
const ctx = {
|
|
7408
7184
|
$,
|
|
7409
|
-
nodes: { base: baseNode$
|
|
7185
|
+
nodes: { base: baseNode$57 },
|
|
7410
7186
|
plugin,
|
|
7411
7187
|
schema
|
|
7412
7188
|
};
|
|
7413
7189
|
const resolver = plugin.config["~resolvers"]?.unknown;
|
|
7414
7190
|
return resolver?.(ctx) ?? unknownResolver$4(ctx);
|
|
7415
7191
|
}
|
|
7416
|
-
|
|
7417
7192
|
//#endregion
|
|
7418
7193
|
//#region src/plugins/@hey-api/typescript/v1/toAst/void.ts
|
|
7419
|
-
function baseNode$
|
|
7194
|
+
function baseNode$56() {
|
|
7420
7195
|
return $.type("void");
|
|
7421
7196
|
}
|
|
7422
7197
|
function voidResolver$4(ctx) {
|
|
@@ -7425,14 +7200,13 @@ function voidResolver$4(ctx) {
|
|
|
7425
7200
|
function voidToAst$3({ plugin, schema }) {
|
|
7426
7201
|
const ctx = {
|
|
7427
7202
|
$,
|
|
7428
|
-
nodes: { base: baseNode$
|
|
7203
|
+
nodes: { base: baseNode$56 },
|
|
7429
7204
|
plugin,
|
|
7430
7205
|
schema
|
|
7431
7206
|
};
|
|
7432
7207
|
const resolver = plugin.config["~resolvers"]?.void;
|
|
7433
7208
|
return resolver?.(ctx) ?? voidResolver$4(ctx);
|
|
7434
7209
|
}
|
|
7435
|
-
|
|
7436
7210
|
//#endregion
|
|
7437
7211
|
//#region src/plugins/@hey-api/typescript/v1/walker.ts
|
|
7438
7212
|
function createVisitor$4(config = {}) {
|
|
@@ -7515,7 +7289,7 @@ function createVisitor$4(config = {}) {
|
|
|
7515
7289
|
}
|
|
7516
7290
|
},
|
|
7517
7291
|
intersection(items, schemas, parentSchema, ctx) {
|
|
7518
|
-
const type = intersectionToAst({
|
|
7292
|
+
const type = intersectionToAst$3({
|
|
7519
7293
|
childResults: items,
|
|
7520
7294
|
parentSchema,
|
|
7521
7295
|
plugin: ctx.plugin,
|
|
@@ -7622,7 +7396,7 @@ function createVisitor$4(config = {}) {
|
|
|
7622
7396
|
};
|
|
7623
7397
|
},
|
|
7624
7398
|
union(items, schemas, parentSchema, ctx) {
|
|
7625
|
-
const type = unionToAst({
|
|
7399
|
+
const type = unionToAst$3({
|
|
7626
7400
|
childResults: items,
|
|
7627
7401
|
parentSchema,
|
|
7628
7402
|
plugin: ctx.plugin,
|
|
@@ -7655,7 +7429,6 @@ function createVisitor$4(config = {}) {
|
|
|
7655
7429
|
}
|
|
7656
7430
|
};
|
|
7657
7431
|
}
|
|
7658
|
-
|
|
7659
7432
|
//#endregion
|
|
7660
7433
|
//#region src/plugins/@hey-api/typescript/v1/processor.ts
|
|
7661
7434
|
function createProcessor$4(plugin) {
|
|
@@ -7702,7 +7475,6 @@ function createProcessor$4(plugin) {
|
|
|
7702
7475
|
}
|
|
7703
7476
|
return { process };
|
|
7704
7477
|
}
|
|
7705
|
-
|
|
7706
7478
|
//#endregion
|
|
7707
7479
|
//#region src/plugins/@hey-api/typescript/api.ts
|
|
7708
7480
|
var Api$3 = class {
|
|
@@ -7722,7 +7494,6 @@ var Api$3 = class {
|
|
|
7722
7494
|
return result.type;
|
|
7723
7495
|
}
|
|
7724
7496
|
};
|
|
7725
|
-
|
|
7726
7497
|
//#endregion
|
|
7727
7498
|
//#region src/plugins/@hey-api/typescript/shared/clientOptions.ts
|
|
7728
7499
|
const serverToBaseUrlType = ({ server }) => {
|
|
@@ -7749,7 +7520,6 @@ const createClientOptions = ({ nodeIndex, plugin, servers }) => {
|
|
|
7749
7520
|
const node = $.type.alias(symbol).export().type($.type.object().prop(getClientBaseUrlKey(getTypedConfig(plugin)), (p) => p.type($.type.or(...types))));
|
|
7750
7521
|
plugin.node(node, nodeIndex);
|
|
7751
7522
|
};
|
|
7752
|
-
|
|
7753
7523
|
//#endregion
|
|
7754
7524
|
//#region src/plugins/@hey-api/typescript/shared/operation.ts
|
|
7755
7525
|
const irParametersToIrSchema = ({ parameters }) => {
|
|
@@ -7938,7 +7708,6 @@ const operationToType = ({ operation, path, plugin, tags }) => {
|
|
|
7938
7708
|
}
|
|
7939
7709
|
}
|
|
7940
7710
|
};
|
|
7941
|
-
|
|
7942
7711
|
//#endregion
|
|
7943
7712
|
//#region src/plugins/@hey-api/typescript/shared/webhook.ts
|
|
7944
7713
|
function webhookToType({ operation, path, plugin, tags }) {
|
|
@@ -8001,7 +7770,6 @@ function webhookToType({ operation, path, plugin, tags }) {
|
|
|
8001
7770
|
plugin.node(node);
|
|
8002
7771
|
return symbol;
|
|
8003
7772
|
}
|
|
8004
|
-
|
|
8005
7773
|
//#endregion
|
|
8006
7774
|
//#region src/plugins/@hey-api/typescript/v1/plugin.ts
|
|
8007
7775
|
const handlerV1$2 = ({ plugin }) => {
|
|
@@ -8093,11 +7861,9 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
8093
7861
|
plugin.node(node, nodeWebhooksIndex);
|
|
8094
7862
|
}
|
|
8095
7863
|
};
|
|
8096
|
-
|
|
8097
7864
|
//#endregion
|
|
8098
7865
|
//#region src/plugins/@hey-api/typescript/plugin.ts
|
|
8099
7866
|
const handler$9 = (args) => handlerV1$2(args);
|
|
8100
|
-
|
|
8101
7867
|
//#endregion
|
|
8102
7868
|
//#region src/plugins/@hey-api/typescript/config.ts
|
|
8103
7869
|
const defaultConfig$14 = {
|
|
@@ -8184,11 +7950,7 @@ const defaultConfig$14 = {
|
|
|
8184
7950
|
});
|
|
8185
7951
|
}
|
|
8186
7952
|
};
|
|
8187
|
-
|
|
8188
|
-
* Type helper for `@hey-api/typescript` plugin, returns {@link Plugin.Config} object
|
|
8189
|
-
*/
|
|
8190
|
-
const defineConfig$14 = definePluginConfig(defaultConfig$14);
|
|
8191
|
-
|
|
7953
|
+
definePluginConfig(defaultConfig$14);
|
|
8192
7954
|
//#endregion
|
|
8193
7955
|
//#region src/plugins/@pinia/colada/meta.ts
|
|
8194
7956
|
const handleMeta$1 = (plugin, operation, configPath) => {
|
|
@@ -8198,7 +7960,6 @@ const handleMeta$1 = (plugin, operation, configPath) => {
|
|
|
8198
7960
|
if (!Object.keys(metaObject).length) return;
|
|
8199
7961
|
return $.fromValue(metaObject);
|
|
8200
7962
|
};
|
|
8201
|
-
|
|
8202
7963
|
//#endregion
|
|
8203
7964
|
//#region src/plugins/@pinia/colada/useType.ts
|
|
8204
7965
|
const useTypeData$1 = ({ operation, plugin }) => {
|
|
@@ -8230,7 +7991,6 @@ const useTypeResponse$1 = ({ operation, plugin }) => {
|
|
|
8230
7991
|
});
|
|
8231
7992
|
return $.type(symbolResponseType ?? "unknown");
|
|
8232
7993
|
};
|
|
8233
|
-
|
|
8234
7994
|
//#endregion
|
|
8235
7995
|
//#region src/plugins/@pinia/colada/utils.ts
|
|
8236
7996
|
const getPublicTypeData = ({ isNuxtClient, operation, plugin }) => {
|
|
@@ -8240,7 +8000,6 @@ const getPublicTypeData = ({ isNuxtClient, operation, plugin }) => {
|
|
|
8240
8000
|
});
|
|
8241
8001
|
return isNuxtClient ? $.type("Omit").generic(typeData).generic("composable") : typeData;
|
|
8242
8002
|
};
|
|
8243
|
-
|
|
8244
8003
|
//#endregion
|
|
8245
8004
|
//#region src/plugins/@pinia/colada/mutationOptions.ts
|
|
8246
8005
|
const createMutationOptions$1 = ({ operation, plugin }) => {
|
|
@@ -8272,7 +8031,6 @@ const createMutationOptions$1 = ({ operation, plugin }) => {
|
|
|
8272
8031
|
}))).do($.return(mutationOpts)));
|
|
8273
8032
|
plugin.node(statement);
|
|
8274
8033
|
};
|
|
8275
|
-
|
|
8276
8034
|
//#endregion
|
|
8277
8035
|
//#region src/plugins/@pinia/colada/queryKey.ts
|
|
8278
8036
|
const TOptionsType$1 = "TOptions";
|
|
@@ -8338,7 +8096,6 @@ const queryKeyStatement$1 = ({ operation, plugin, symbol }) => {
|
|
|
8338
8096
|
plugin
|
|
8339
8097
|
}).return()));
|
|
8340
8098
|
};
|
|
8341
|
-
|
|
8342
8099
|
//#endregion
|
|
8343
8100
|
//#region src/plugins/@pinia/colada/queryOptions.ts
|
|
8344
8101
|
const optionsParamName$2 = "options";
|
|
@@ -8408,7 +8165,6 @@ const createQueryOptions$1 = ({ operation, plugin }) => {
|
|
|
8408
8165
|
})));
|
|
8409
8166
|
plugin.node(statement);
|
|
8410
8167
|
};
|
|
8411
|
-
|
|
8412
8168
|
//#endregion
|
|
8413
8169
|
//#region src/plugins/@pinia/colada/v0/plugin.ts
|
|
8414
8170
|
const handlerV0 = ({ plugin }) => {
|
|
@@ -8444,11 +8200,9 @@ const handlerV0 = ({ plugin }) => {
|
|
|
8444
8200
|
}
|
|
8445
8201
|
}, { order: "declarations" });
|
|
8446
8202
|
};
|
|
8447
|
-
|
|
8448
8203
|
//#endregion
|
|
8449
8204
|
//#region src/plugins/@pinia/colada/plugin.ts
|
|
8450
8205
|
const handler$8 = (args) => handlerV0(args);
|
|
8451
|
-
|
|
8452
8206
|
//#endregion
|
|
8453
8207
|
//#region src/plugins/@pinia/colada/config.ts
|
|
8454
8208
|
const defaultConfig$13 = {
|
|
@@ -8491,11 +8245,7 @@ const defaultConfig$13 = {
|
|
|
8491
8245
|
});
|
|
8492
8246
|
}
|
|
8493
8247
|
};
|
|
8494
|
-
|
|
8495
|
-
* Type helper for `@pinia/colada` plugin, returns {@link Plugin.Config} object
|
|
8496
|
-
*/
|
|
8497
|
-
const defineConfig$13 = definePluginConfig(defaultConfig$13);
|
|
8498
|
-
|
|
8248
|
+
definePluginConfig(defaultConfig$13);
|
|
8499
8249
|
//#endregion
|
|
8500
8250
|
//#region src/plugins/@tanstack/query-core/shared/useType.ts
|
|
8501
8251
|
const useTypeData = ({ operation, plugin }) => {
|
|
@@ -8527,7 +8277,6 @@ const useTypeResponse = ({ operation, plugin }) => {
|
|
|
8527
8277
|
});
|
|
8528
8278
|
return $.type(symbolResponseType ?? "unknown");
|
|
8529
8279
|
};
|
|
8530
|
-
|
|
8531
8280
|
//#endregion
|
|
8532
8281
|
//#region src/plugins/@tanstack/query-core/queryKey.ts
|
|
8533
8282
|
const TOptionsType = "TOptions";
|
|
@@ -8589,7 +8338,6 @@ const queryKeyStatement = ({ isInfinite, operation, plugin, symbol, typeQueryKey
|
|
|
8589
8338
|
plugin
|
|
8590
8339
|
}).return()));
|
|
8591
8340
|
};
|
|
8592
|
-
|
|
8593
8341
|
//#endregion
|
|
8594
8342
|
//#region src/plugins/@tanstack/query-core/shared/meta.ts
|
|
8595
8343
|
const handleMeta = (plugin, operation, configPath) => {
|
|
@@ -8599,7 +8347,6 @@ const handleMeta = (plugin, operation, configPath) => {
|
|
|
8599
8347
|
if (!Object.keys(metaObject).length) return;
|
|
8600
8348
|
return $.fromValue(metaObject);
|
|
8601
8349
|
};
|
|
8602
|
-
|
|
8603
8350
|
//#endregion
|
|
8604
8351
|
//#region src/plugins/@tanstack/query-core/v5/infiniteQueryOptions.ts
|
|
8605
8352
|
const createInfiniteParamsFunction = ({ plugin }) => {
|
|
@@ -8682,7 +8429,6 @@ const createInfiniteQueryOptions = ({ operation, plugin }) => {
|
|
|
8682
8429
|
}), $.type(symbolInfiniteDataType).generic(typeResponse), typeQueryKey, $.type.or(type, typePageObjectParam)))));
|
|
8683
8430
|
plugin.node(statement);
|
|
8684
8431
|
};
|
|
8685
|
-
|
|
8686
8432
|
//#endregion
|
|
8687
8433
|
//#region src/plugins/@tanstack/query-core/v5/mutationOptions.ts
|
|
8688
8434
|
const createMutationOptions = ({ operation, plugin }) => {
|
|
@@ -8719,7 +8465,6 @@ const createMutationOptions = ({ operation, plugin }) => {
|
|
|
8719
8465
|
const statement = $.const(symbolMutationOptions).export(plugin.config.mutationOptions.exported).$if(plugin.config.comments && createOperationComment(operation), (c, v) => c.doc(v)).assign($.func().param("options", (p) => p.optional().type($.type("Partial").generic(typeData))).returns(mutationType).do($.const(mutationOptionsFn).type(mutationType).assign($.object().pretty().prop("mutationFn", $.func().async().param(fnOptions).do(...statements)).$if(handleMeta(plugin, operation, "mutationOptions"), (c, v) => c.prop("meta", v))), $(mutationOptionsFn).return()));
|
|
8720
8466
|
plugin.node(statement);
|
|
8721
8467
|
};
|
|
8722
|
-
|
|
8723
8468
|
//#endregion
|
|
8724
8469
|
//#region src/plugins/@tanstack/query-core/v5/queryOptions.ts
|
|
8725
8470
|
const optionsParamName$1 = "options";
|
|
@@ -8775,7 +8520,6 @@ const createQueryOptions = ({ operation, plugin }) => {
|
|
|
8775
8520
|
}), typeResponse, $(symbolQueryKey).returnType()).return()));
|
|
8776
8521
|
plugin.node(statement);
|
|
8777
8522
|
};
|
|
8778
|
-
|
|
8779
8523
|
//#endregion
|
|
8780
8524
|
//#region src/plugins/@tanstack/query-core/v5/useMutation.ts
|
|
8781
8525
|
const mutationOptionsParamName = "mutationOptions";
|
|
@@ -8807,7 +8551,6 @@ const createUseMutation = ({ operation, plugin }) => {
|
|
|
8807
8551
|
const statement = $.const(symbolUseMutationFn).export().$if(plugin.config.comments && createOperationComment(operation), (c, v) => c.doc(v)).assign(func);
|
|
8808
8552
|
plugin.node(statement);
|
|
8809
8553
|
};
|
|
8810
|
-
|
|
8811
8554
|
//#endregion
|
|
8812
8555
|
//#region src/plugins/@tanstack/query-core/v5/useQuery.ts
|
|
8813
8556
|
const optionsParamName = "options";
|
|
@@ -8834,7 +8577,6 @@ const createUseQuery = ({ operation, plugin }) => {
|
|
|
8834
8577
|
const statement = $.const(symbolUseQueryFn).export().$if(plugin.config.comments && createOperationComment(operation), (c, v) => c.doc(v)).assign($.func().param(optionsParamName, (p) => p.required(isRequiredOptions).type(typeData)).do($(symbolUseQuery).call($(symbolQueryOptionsFn).call(optionsParamName)).return()));
|
|
8835
8578
|
plugin.node(statement);
|
|
8836
8579
|
};
|
|
8837
|
-
|
|
8838
8580
|
//#endregion
|
|
8839
8581
|
//#region src/plugins/@tanstack/query-core/v5/plugin.ts
|
|
8840
8582
|
const handlerV5 = ({ plugin }) => {
|
|
@@ -8887,11 +8629,9 @@ const handlerV5 = ({ plugin }) => {
|
|
|
8887
8629
|
}
|
|
8888
8630
|
}, { order: "declarations" });
|
|
8889
8631
|
};
|
|
8890
|
-
|
|
8891
8632
|
//#endregion
|
|
8892
8633
|
//#region src/plugins/@tanstack/query-core/plugin.ts
|
|
8893
8634
|
const handler$7 = (args) => handlerV5(args);
|
|
8894
|
-
|
|
8895
8635
|
//#endregion
|
|
8896
8636
|
//#region src/plugins/@tanstack/angular-query-experimental/config.ts
|
|
8897
8637
|
const defaultConfig$12 = {
|
|
@@ -8955,11 +8695,7 @@ const defaultConfig$12 = {
|
|
|
8955
8695
|
});
|
|
8956
8696
|
}
|
|
8957
8697
|
};
|
|
8958
|
-
|
|
8959
|
-
* Type helper for `@tanstack/angular-query-experimental` plugin, returns {@link Plugin.Config} object
|
|
8960
|
-
*/
|
|
8961
|
-
const defineConfig$12 = definePluginConfig(defaultConfig$12);
|
|
8962
|
-
|
|
8698
|
+
definePluginConfig(defaultConfig$12);
|
|
8963
8699
|
//#endregion
|
|
8964
8700
|
//#region src/plugins/@tanstack/preact-query/config.ts
|
|
8965
8701
|
const defaultConfig$11 = {
|
|
@@ -9081,11 +8817,7 @@ const defaultConfig$11 = {
|
|
|
9081
8817
|
}
|
|
9082
8818
|
}
|
|
9083
8819
|
};
|
|
9084
|
-
|
|
9085
|
-
* Type helper for `@tanstack/preact-query` plugin, returns {@link Plugin.Config} object
|
|
9086
|
-
*/
|
|
9087
|
-
const defineConfig$11 = definePluginConfig(defaultConfig$11);
|
|
9088
|
-
|
|
8820
|
+
definePluginConfig(defaultConfig$11);
|
|
9089
8821
|
//#endregion
|
|
9090
8822
|
//#region src/plugins/@tanstack/react-query/config.ts
|
|
9091
8823
|
const defaultConfig$10 = {
|
|
@@ -9207,11 +8939,7 @@ const defaultConfig$10 = {
|
|
|
9207
8939
|
}
|
|
9208
8940
|
}
|
|
9209
8941
|
};
|
|
9210
|
-
|
|
9211
|
-
* Type helper for `@tanstack/react-query` plugin, returns {@link Plugin.Config} object
|
|
9212
|
-
*/
|
|
9213
|
-
const defineConfig$10 = definePluginConfig(defaultConfig$10);
|
|
9214
|
-
|
|
8942
|
+
definePluginConfig(defaultConfig$10);
|
|
9215
8943
|
//#endregion
|
|
9216
8944
|
//#region src/plugins/@tanstack/solid-query/config.ts
|
|
9217
8945
|
const defaultConfig$9 = {
|
|
@@ -9275,11 +9003,7 @@ const defaultConfig$9 = {
|
|
|
9275
9003
|
});
|
|
9276
9004
|
}
|
|
9277
9005
|
};
|
|
9278
|
-
|
|
9279
|
-
* Type helper for `@tanstack/solid-query` plugin, returns {@link Plugin.Config} object
|
|
9280
|
-
*/
|
|
9281
|
-
const defineConfig$9 = definePluginConfig(defaultConfig$9);
|
|
9282
|
-
|
|
9006
|
+
definePluginConfig(defaultConfig$9);
|
|
9283
9007
|
//#endregion
|
|
9284
9008
|
//#region src/plugins/@tanstack/svelte-query/config.ts
|
|
9285
9009
|
const defaultConfig$8 = {
|
|
@@ -9343,11 +9067,7 @@ const defaultConfig$8 = {
|
|
|
9343
9067
|
});
|
|
9344
9068
|
}
|
|
9345
9069
|
};
|
|
9346
|
-
|
|
9347
|
-
* Type helper for `@tanstack/svelte-query` plugin, returns {@link Plugin.Config} object
|
|
9348
|
-
*/
|
|
9349
|
-
const defineConfig$8 = definePluginConfig(defaultConfig$8);
|
|
9350
|
-
|
|
9070
|
+
definePluginConfig(defaultConfig$8);
|
|
9351
9071
|
//#endregion
|
|
9352
9072
|
//#region src/plugins/@tanstack/vue-query/config.ts
|
|
9353
9073
|
const defaultConfig$7 = {
|
|
@@ -9411,11 +9131,7 @@ const defaultConfig$7 = {
|
|
|
9411
9131
|
});
|
|
9412
9132
|
}
|
|
9413
9133
|
};
|
|
9414
|
-
|
|
9415
|
-
* Type helper for `@tanstack/vue-query` plugin, returns {@link Plugin.Config} object
|
|
9416
|
-
*/
|
|
9417
|
-
const defineConfig$7 = definePluginConfig(defaultConfig$7);
|
|
9418
|
-
|
|
9134
|
+
definePluginConfig(defaultConfig$7);
|
|
9419
9135
|
//#endregion
|
|
9420
9136
|
//#region src/plugins/arktype/v2/api.ts
|
|
9421
9137
|
function createRequestValidatorV2({ operation, plugin }) {
|
|
@@ -9442,7 +9158,6 @@ function createResponseValidatorV2({ operation, plugin }) {
|
|
|
9442
9158
|
const dataParameterName = "data";
|
|
9443
9159
|
return $.func().async().param(dataParameterName).do($(symbol).attr("parseAsync").call(dataParameterName).await().return());
|
|
9444
9160
|
}
|
|
9445
|
-
|
|
9446
9161
|
//#endregion
|
|
9447
9162
|
//#region src/plugins/arktype/api.ts
|
|
9448
9163
|
var Api$2 = class {
|
|
@@ -9453,7 +9168,6 @@ var Api$2 = class {
|
|
|
9453
9168
|
return createResponseValidatorV2(args);
|
|
9454
9169
|
}
|
|
9455
9170
|
};
|
|
9456
|
-
|
|
9457
9171
|
//#endregion
|
|
9458
9172
|
//#region src/plugins/arktype/constants.ts
|
|
9459
9173
|
const identifiers$2 = {
|
|
@@ -9557,7 +9271,6 @@ const identifiers$2 = {
|
|
|
9557
9271
|
toJsonSchema: "toJsonSchema"
|
|
9558
9272
|
}
|
|
9559
9273
|
};
|
|
9560
|
-
|
|
9561
9274
|
//#endregion
|
|
9562
9275
|
//#region src/plugins/arktype/shared/export.ts
|
|
9563
9276
|
function exportAst$2({ ast, plugin, schema, symbol, typeInferSymbol }) {
|
|
@@ -9569,7 +9282,6 @@ function exportAst$2({ ast, plugin, schema, symbol, typeInferSymbol }) {
|
|
|
9569
9282
|
plugin.node(inferType);
|
|
9570
9283
|
}
|
|
9571
9284
|
}
|
|
9572
|
-
|
|
9573
9285
|
//#endregion
|
|
9574
9286
|
//#region src/plugins/arktype/v2/toAst/null.ts
|
|
9575
9287
|
const nullToAst$3 = (_args) => {
|
|
@@ -9577,7 +9289,6 @@ const nullToAst$3 = (_args) => {
|
|
|
9577
9289
|
result.def = identifiers$2.primitives.null;
|
|
9578
9290
|
return result;
|
|
9579
9291
|
};
|
|
9580
|
-
|
|
9581
9292
|
//#endregion
|
|
9582
9293
|
//#region src/plugins/arktype/v2/toAst/object.ts
|
|
9583
9294
|
function objectToAst$3({ plugin, schema, state }) {
|
|
@@ -9623,7 +9334,6 @@ function objectToAst$3({ plugin, schema, state }) {
|
|
|
9623
9334
|
};
|
|
9624
9335
|
return result;
|
|
9625
9336
|
}
|
|
9626
|
-
|
|
9627
9337
|
//#endregion
|
|
9628
9338
|
//#region src/plugins/arktype/v2/toAst/string.ts
|
|
9629
9339
|
const stringToAst = ({ schema }) => {
|
|
@@ -9664,7 +9374,6 @@ const stringToAst = ({ schema }) => {
|
|
|
9664
9374
|
result.def = def;
|
|
9665
9375
|
return result;
|
|
9666
9376
|
};
|
|
9667
|
-
|
|
9668
9377
|
//#endregion
|
|
9669
9378
|
//#region src/plugins/arktype/v2/toAst/index.ts
|
|
9670
9379
|
function irSchemaWithTypeToAst({ schema, ...args }) {
|
|
@@ -9688,7 +9397,6 @@ function irSchemaWithTypeToAst({ schema, ...args }) {
|
|
|
9688
9397
|
hasLazyExpression: false
|
|
9689
9398
|
};
|
|
9690
9399
|
}
|
|
9691
|
-
|
|
9692
9400
|
//#endregion
|
|
9693
9401
|
//#region src/plugins/arktype/v2/plugin.ts
|
|
9694
9402
|
function irSchemaToAst({ plugin, schema, schemaExtractor, state }) {
|
|
@@ -9820,11 +9528,9 @@ const handlerV2$1 = ({ plugin }) => {
|
|
|
9820
9528
|
}
|
|
9821
9529
|
});
|
|
9822
9530
|
};
|
|
9823
|
-
|
|
9824
9531
|
//#endregion
|
|
9825
9532
|
//#region src/plugins/arktype/plugin.ts
|
|
9826
9533
|
const handler$6 = (args) => handlerV2$1(args);
|
|
9827
|
-
|
|
9828
9534
|
//#endregion
|
|
9829
9535
|
//#region src/plugins/arktype/config.ts
|
|
9830
9536
|
const defaultConfig$6 = {
|
|
@@ -10003,11 +9709,7 @@ const defaultConfig$6 = {
|
|
|
10003
9709
|
},
|
|
10004
9710
|
tags: ["validator"]
|
|
10005
9711
|
};
|
|
10006
|
-
|
|
10007
|
-
* Type helper for Arktype plugin, returns {@link Plugin.Config} object
|
|
10008
|
-
*/
|
|
10009
|
-
const defineConfig$6 = definePluginConfig(defaultConfig$6);
|
|
10010
|
-
|
|
9712
|
+
definePluginConfig(defaultConfig$6);
|
|
10011
9713
|
//#endregion
|
|
10012
9714
|
//#region src/plugins/fastify/plugin.ts
|
|
10013
9715
|
const operationToRouteHandler = ({ operation, plugin }) => {
|
|
@@ -10091,7 +9793,6 @@ const handler$5 = ({ plugin }) => {
|
|
|
10091
9793
|
const node = $.type.alias(symbolRouteHandlers).export().type(type);
|
|
10092
9794
|
plugin.node(node);
|
|
10093
9795
|
};
|
|
10094
|
-
|
|
10095
9796
|
//#endregion
|
|
10096
9797
|
//#region src/plugins/fastify/config.ts
|
|
10097
9798
|
const defaultConfig$5 = {
|
|
@@ -10100,11 +9801,7 @@ const defaultConfig$5 = {
|
|
|
10100
9801
|
handler: handler$5,
|
|
10101
9802
|
name: "fastify"
|
|
10102
9803
|
};
|
|
10103
|
-
|
|
10104
|
-
* Type helper for `fastify` plugin, returns {@link Plugin.Config} object
|
|
10105
|
-
*/
|
|
10106
|
-
const defineConfig$5 = definePluginConfig(defaultConfig$5);
|
|
10107
|
-
|
|
9804
|
+
definePluginConfig(defaultConfig$5);
|
|
10108
9805
|
//#endregion
|
|
10109
9806
|
//#region src/plugins/nestjs/plugin.ts
|
|
10110
9807
|
const operationToMethod = ({ operation, plugin }) => {
|
|
@@ -10175,7 +9872,6 @@ const handler$4 = ({ plugin }) => {
|
|
|
10175
9872
|
typeName: `${toCase(tag, "PascalCase")}ControllerMethods`
|
|
10176
9873
|
});
|
|
10177
9874
|
};
|
|
10178
|
-
|
|
10179
9875
|
//#endregion
|
|
10180
9876
|
//#region src/plugins/nestjs/config.ts
|
|
10181
9877
|
const defaultConfig$4 = {
|
|
@@ -10184,11 +9880,7 @@ const defaultConfig$4 = {
|
|
|
10184
9880
|
handler: handler$4,
|
|
10185
9881
|
name: "nestjs"
|
|
10186
9882
|
};
|
|
10187
|
-
|
|
10188
|
-
* Type helper for `nestjs` plugin, returns {@link Plugin.Config} object
|
|
10189
|
-
*/
|
|
10190
|
-
const defineConfig$4 = definePluginConfig(defaultConfig$4);
|
|
10191
|
-
|
|
9883
|
+
definePluginConfig(defaultConfig$4);
|
|
10192
9884
|
//#endregion
|
|
10193
9885
|
//#region src/plugins/orpc/contracts/config.ts
|
|
10194
9886
|
function resolveContracts(config, context) {
|
|
@@ -10238,7 +9930,6 @@ function normalizeConfig(input, context) {
|
|
|
10238
9930
|
value: input
|
|
10239
9931
|
});
|
|
10240
9932
|
}
|
|
10241
|
-
|
|
10242
9933
|
//#endregion
|
|
10243
9934
|
//#region src/plugins/orpc/shared/operation.ts
|
|
10244
9935
|
function hasInput(operation) {
|
|
@@ -10264,7 +9955,6 @@ function getSuccessResponse(operation) {
|
|
|
10264
9955
|
function getTags(operation, defaultTag) {
|
|
10265
9956
|
return operation.tags && operation.tags.length ? [...operation.tags] : [defaultTag];
|
|
10266
9957
|
}
|
|
10267
|
-
|
|
10268
9958
|
//#endregion
|
|
10269
9959
|
//#region src/plugins/orpc/contracts/node.ts
|
|
10270
9960
|
const source = globalThis.Symbol("orpc");
|
|
@@ -10394,7 +10084,6 @@ function toNode$1(model, plugin) {
|
|
|
10394
10084
|
symbols
|
|
10395
10085
|
};
|
|
10396
10086
|
}
|
|
10397
|
-
|
|
10398
10087
|
//#endregion
|
|
10399
10088
|
//#region src/plugins/orpc/contracts/resolve.ts
|
|
10400
10089
|
function resolvePath(plugin) {
|
|
@@ -10420,7 +10109,6 @@ function resolveStrategy(plugin) {
|
|
|
10420
10109
|
});
|
|
10421
10110
|
return plugin.config.contracts.strategy;
|
|
10422
10111
|
}
|
|
10423
|
-
|
|
10424
10112
|
//#endregion
|
|
10425
10113
|
//#region src/plugins/orpc/v1/plugin.ts
|
|
10426
10114
|
const handlerV1$1 = ({ plugin }) => {
|
|
@@ -10449,11 +10137,9 @@ const handlerV1$1 = ({ plugin }) => {
|
|
|
10449
10137
|
}
|
|
10450
10138
|
for (const node of allNodes) plugin.node(node);
|
|
10451
10139
|
};
|
|
10452
|
-
|
|
10453
10140
|
//#endregion
|
|
10454
10141
|
//#region src/plugins/orpc/plugin.ts
|
|
10455
10142
|
const handler$3 = (args) => handlerV1$1(args);
|
|
10456
|
-
|
|
10457
10143
|
//#endregion
|
|
10458
10144
|
//#region src/plugins/orpc/config.ts
|
|
10459
10145
|
const validatorInferWarn = "You set `validator: true` but no validator plugin was found in your plugins. Add a validator plugin like `zod` to enable this feature. The validator option has been disabled.";
|
|
@@ -10487,11 +10173,7 @@ const defaultConfig$3 = {
|
|
|
10487
10173
|
plugin.config.contracts = resolveContracts(plugin.config, context);
|
|
10488
10174
|
}
|
|
10489
10175
|
};
|
|
10490
|
-
|
|
10491
|
-
* Type helper for oRPC plugin, returns {@link Plugin.Config} object
|
|
10492
|
-
*/
|
|
10493
|
-
const defineConfig$3 = definePluginConfig(defaultConfig$3);
|
|
10494
|
-
|
|
10176
|
+
definePluginConfig(defaultConfig$3);
|
|
10495
10177
|
//#endregion
|
|
10496
10178
|
//#region src/plugins/swr/v2/useSwr.ts
|
|
10497
10179
|
const createUseSwr = ({ operation, plugin }) => {
|
|
@@ -10509,7 +10191,6 @@ const createUseSwr = ({ operation, plugin }) => {
|
|
|
10509
10191
|
const statement = $.const(symbolUseQueryFn).export().$if(plugin.config.comments && createOperationComment(operation), (c, v) => c.doc(v)).assign($.func().do($(symbolUseSwr).call($.literal(operation.path), $.func().async().do(...statements)).return()));
|
|
10510
10192
|
plugin.node(statement);
|
|
10511
10193
|
};
|
|
10512
|
-
|
|
10513
10194
|
//#endregion
|
|
10514
10195
|
//#region src/plugins/swr/v2/plugin.ts
|
|
10515
10196
|
const handlerV2 = ({ plugin }) => {
|
|
@@ -10527,11 +10208,9 @@ const handlerV2 = ({ plugin }) => {
|
|
|
10527
10208
|
}
|
|
10528
10209
|
}, { order: "declarations" });
|
|
10529
10210
|
};
|
|
10530
|
-
|
|
10531
10211
|
//#endregion
|
|
10532
10212
|
//#region src/plugins/swr/plugin.ts
|
|
10533
10213
|
const handler$2 = (args) => handlerV2(args);
|
|
10534
|
-
|
|
10535
10214
|
//#endregion
|
|
10536
10215
|
//#region src/plugins/swr/config.ts
|
|
10537
10216
|
const defaultConfig$2 = {
|
|
@@ -10623,11 +10302,7 @@ const defaultConfig$2 = {
|
|
|
10623
10302
|
}
|
|
10624
10303
|
}
|
|
10625
10304
|
};
|
|
10626
|
-
|
|
10627
|
-
* Type helper for `swr` plugin, returns {@link Plugin.Config} object
|
|
10628
|
-
*/
|
|
10629
|
-
const defineConfig$2 = definePluginConfig(defaultConfig$2);
|
|
10630
|
-
|
|
10305
|
+
definePluginConfig(defaultConfig$2);
|
|
10631
10306
|
//#endregion
|
|
10632
10307
|
//#region src/plugins/valibot/v1/constants.ts
|
|
10633
10308
|
const identifiers$1 = {
|
|
@@ -10866,7 +10541,6 @@ const identifiers$1 = {
|
|
|
10866
10541
|
types: { GenericSchema: "GenericSchema" },
|
|
10867
10542
|
utils: {}
|
|
10868
10543
|
};
|
|
10869
|
-
|
|
10870
10544
|
//#endregion
|
|
10871
10545
|
//#region src/plugins/valibot/shared/pipes.ts
|
|
10872
10546
|
function push(target, result) {
|
|
@@ -10896,7 +10570,6 @@ const pipes = {
|
|
|
10896
10570
|
function pipesToNode(pipes, plugin) {
|
|
10897
10571
|
return toNode(pipes, plugin);
|
|
10898
10572
|
}
|
|
10899
|
-
|
|
10900
10573
|
//#endregion
|
|
10901
10574
|
//#region src/plugins/valibot/shared/export.ts
|
|
10902
10575
|
function exportAst$1({ final, meta, naming, namingAnchor, path, plugin, schema, tags }) {
|
|
@@ -10919,7 +10592,6 @@ function exportAst$1({ final, meta, naming, namingAnchor, path, plugin, schema,
|
|
|
10919
10592
|
plugin.node(statement);
|
|
10920
10593
|
return symbol;
|
|
10921
10594
|
}
|
|
10922
|
-
|
|
10923
10595
|
//#endregion
|
|
10924
10596
|
//#region src/plugins/valibot/shared/operation-schema.ts
|
|
10925
10597
|
function buildOperationSchema$1(operation) {
|
|
@@ -10966,7 +10638,6 @@ function buildOperationSchema$1(operation) {
|
|
|
10966
10638
|
schema
|
|
10967
10639
|
};
|
|
10968
10640
|
}
|
|
10969
|
-
|
|
10970
10641
|
//#endregion
|
|
10971
10642
|
//#region src/plugins/valibot/shared/validator.ts
|
|
10972
10643
|
function getDefaultRequestValidatorLayers$1(operation) {
|
|
@@ -10994,7 +10665,6 @@ function getDefaultRequestValidatorLayers$1(operation) {
|
|
|
10994
10665
|
}
|
|
10995
10666
|
};
|
|
10996
10667
|
}
|
|
10997
|
-
|
|
10998
10668
|
//#endregion
|
|
10999
10669
|
//#region src/plugins/valibot/v1/api.ts
|
|
11000
10670
|
function emptyNode$3(ctx) {
|
|
@@ -11146,7 +10816,6 @@ function createResponseValidatorV1({ operation, plugin }) {
|
|
|
11146
10816
|
}
|
|
11147
10817
|
});
|
|
11148
10818
|
}
|
|
11149
|
-
|
|
11150
10819
|
//#endregion
|
|
11151
10820
|
//#region src/plugins/valibot/api.ts
|
|
11152
10821
|
var Api$1 = class {
|
|
@@ -11164,7 +10833,6 @@ var Api$1 = class {
|
|
|
11164
10833
|
return createResponseValidatorV1(args);
|
|
11165
10834
|
}
|
|
11166
10835
|
};
|
|
11167
|
-
|
|
11168
10836
|
//#endregion
|
|
11169
10837
|
//#region src/plugins/valibot/shared/operation.ts
|
|
11170
10838
|
function irOperationToAst$1({ operation, path, plugin, processor, tags }) {
|
|
@@ -11242,7 +10910,6 @@ function irOperationToAst$1({ operation, path, plugin, processor, tags }) {
|
|
|
11242
10910
|
}
|
|
11243
10911
|
}
|
|
11244
10912
|
}
|
|
11245
|
-
|
|
11246
10913
|
//#endregion
|
|
11247
10914
|
//#region src/plugins/valibot/shared/webhook.ts
|
|
11248
10915
|
function irWebhookToAst$1({ operation, path, plugin, processor, tags }) {
|
|
@@ -11263,7 +10930,6 @@ function irWebhookToAst$1({ operation, path, plugin, processor, tags }) {
|
|
|
11263
10930
|
});
|
|
11264
10931
|
}
|
|
11265
10932
|
}
|
|
11266
|
-
|
|
11267
10933
|
//#endregion
|
|
11268
10934
|
//#region src/plugins/shared/utils/coerce.ts
|
|
11269
10935
|
const shouldCoerceToBigInt = (format) => format === "int64" || format === "uint64";
|
|
@@ -11276,7 +10942,6 @@ const maybeBigInt = (value, format) => {
|
|
|
11276
10942
|
if (typeof value === "number") return $("BigInt").call($.fromValue(value));
|
|
11277
10943
|
return $.fromValue(value);
|
|
11278
10944
|
};
|
|
11279
|
-
|
|
11280
10945
|
//#endregion
|
|
11281
10946
|
//#region src/plugins/valibot/shared/meta.ts
|
|
11282
10947
|
/**
|
|
@@ -11320,10 +10985,9 @@ function inheritMeta$1(parent, children) {
|
|
|
11320
10985
|
readonly: parent.accessScope === "read"
|
|
11321
10986
|
});
|
|
11322
10987
|
}
|
|
11323
|
-
|
|
11324
10988
|
//#endregion
|
|
11325
10989
|
//#region src/plugins/valibot/v1/toAst/unknown.ts
|
|
11326
|
-
function baseNode$
|
|
10990
|
+
function baseNode$55(ctx) {
|
|
11327
10991
|
const { symbols } = ctx;
|
|
11328
10992
|
const { v } = symbols;
|
|
11329
10993
|
return $(v).attr(identifiers$1.schemas.unknown).call();
|
|
@@ -11336,7 +11000,7 @@ function unknownResolver$3(ctx) {
|
|
|
11336
11000
|
function unknownToPipes({ plugin, schema }) {
|
|
11337
11001
|
const ctx = {
|
|
11338
11002
|
$,
|
|
11339
|
-
nodes: { base: baseNode$
|
|
11003
|
+
nodes: { base: baseNode$55 },
|
|
11340
11004
|
pipes: {
|
|
11341
11005
|
...pipes,
|
|
11342
11006
|
current: []
|
|
@@ -11349,10 +11013,9 @@ function unknownToPipes({ plugin, schema }) {
|
|
|
11349
11013
|
const node = resolver?.(ctx) ?? unknownResolver$3(ctx);
|
|
11350
11014
|
return ctx.pipes.toNode(node, plugin);
|
|
11351
11015
|
}
|
|
11352
|
-
|
|
11353
11016
|
//#endregion
|
|
11354
11017
|
//#region src/plugins/valibot/v1/toAst/array.ts
|
|
11355
|
-
function baseNode$
|
|
11018
|
+
function baseNode$54(ctx) {
|
|
11356
11019
|
const { plugin, symbols } = ctx;
|
|
11357
11020
|
const { v } = symbols;
|
|
11358
11021
|
const arrayFn = $(v).attr(identifiers$1.schemas.array);
|
|
@@ -11417,7 +11080,7 @@ function arrayToPipes(ctx) {
|
|
|
11417
11080
|
$,
|
|
11418
11081
|
applyModifiers: ctx.applyModifiers,
|
|
11419
11082
|
nodes: {
|
|
11420
|
-
base: baseNode$
|
|
11083
|
+
base: baseNode$54,
|
|
11421
11084
|
length: lengthNode$7,
|
|
11422
11085
|
maxLength: maxLengthNode$7,
|
|
11423
11086
|
minLength: minLengthNode$7
|
|
@@ -11439,10 +11102,9 @@ function arrayToPipes(ctx) {
|
|
|
11439
11102
|
pipes: [resolverCtx.pipes.toNode(node, plugin)]
|
|
11440
11103
|
};
|
|
11441
11104
|
}
|
|
11442
|
-
|
|
11443
11105
|
//#endregion
|
|
11444
11106
|
//#region src/plugins/valibot/v1/toAst/boolean.ts
|
|
11445
|
-
function baseNode$
|
|
11107
|
+
function baseNode$53(ctx) {
|
|
11446
11108
|
const { symbols } = ctx;
|
|
11447
11109
|
const { v } = symbols;
|
|
11448
11110
|
return $(v).attr(identifiers$1.schemas.boolean).call();
|
|
@@ -11464,7 +11126,7 @@ function booleanToPipes({ plugin, schema }) {
|
|
|
11464
11126
|
const ctx = {
|
|
11465
11127
|
$,
|
|
11466
11128
|
nodes: {
|
|
11467
|
-
base: baseNode$
|
|
11129
|
+
base: baseNode$53,
|
|
11468
11130
|
const: constNode$15
|
|
11469
11131
|
},
|
|
11470
11132
|
pipes: {
|
|
@@ -11479,7 +11141,6 @@ function booleanToPipes({ plugin, schema }) {
|
|
|
11479
11141
|
const node = resolver?.(ctx) ?? booleanResolver$3(ctx);
|
|
11480
11142
|
return ctx.pipes.toNode(node, plugin);
|
|
11481
11143
|
}
|
|
11482
|
-
|
|
11483
11144
|
//#endregion
|
|
11484
11145
|
//#region src/plugins/valibot/v1/toAst/enum.ts
|
|
11485
11146
|
function itemsNode$3(ctx) {
|
|
@@ -11493,7 +11154,7 @@ function itemsNode$3(ctx) {
|
|
|
11493
11154
|
isNullable
|
|
11494
11155
|
};
|
|
11495
11156
|
}
|
|
11496
|
-
function baseNode$
|
|
11157
|
+
function baseNode$52(ctx) {
|
|
11497
11158
|
const { symbols } = ctx;
|
|
11498
11159
|
const { v } = symbols;
|
|
11499
11160
|
const { enumMembers } = ctx.nodes.items(ctx);
|
|
@@ -11511,7 +11172,7 @@ function enumToPipes({ plugin, schema }) {
|
|
|
11511
11172
|
const { enumMembers, isNullable } = itemsNode$3({
|
|
11512
11173
|
$,
|
|
11513
11174
|
nodes: {
|
|
11514
|
-
base: baseNode$
|
|
11175
|
+
base: baseNode$52,
|
|
11515
11176
|
items: itemsNode$3
|
|
11516
11177
|
},
|
|
11517
11178
|
pipes: {
|
|
@@ -11529,7 +11190,7 @@ function enumToPipes({ plugin, schema }) {
|
|
|
11529
11190
|
const ctx = {
|
|
11530
11191
|
$,
|
|
11531
11192
|
nodes: {
|
|
11532
|
-
base: baseNode$
|
|
11193
|
+
base: baseNode$52,
|
|
11533
11194
|
items: itemsNode$3
|
|
11534
11195
|
},
|
|
11535
11196
|
pipes: {
|
|
@@ -11547,10 +11208,9 @@ function enumToPipes({ plugin, schema }) {
|
|
|
11547
11208
|
pipe: ctx.pipes.toNode(node, plugin)
|
|
11548
11209
|
};
|
|
11549
11210
|
}
|
|
11550
|
-
|
|
11551
11211
|
//#endregion
|
|
11552
11212
|
//#region src/plugins/valibot/v1/toAst/intersection.ts
|
|
11553
|
-
function baseNode$
|
|
11213
|
+
function baseNode$51(ctx) {
|
|
11554
11214
|
const { applyModifiers, childResults, plugin, symbols } = ctx;
|
|
11555
11215
|
const { v } = symbols;
|
|
11556
11216
|
if (!childResults.length) return $(v).attr(identifiers$1.schemas.any).call();
|
|
@@ -11558,7 +11218,7 @@ function baseNode$45(ctx) {
|
|
|
11558
11218
|
const itemNodes = childResults.map((item) => pipesToNode(item.pipes, plugin));
|
|
11559
11219
|
return $(v).attr(identifiers$1.schemas.intersect).call($.array(...itemNodes));
|
|
11560
11220
|
}
|
|
11561
|
-
function intersectionResolver(ctx) {
|
|
11221
|
+
function intersectionResolver$3(ctx) {
|
|
11562
11222
|
const base = ctx.nodes.base(ctx);
|
|
11563
11223
|
if (base) ctx.pipes.push(ctx.pipes.current, base);
|
|
11564
11224
|
return ctx.pipes.current;
|
|
@@ -11569,7 +11229,7 @@ function intersectionToPipes(ctx) {
|
|
|
11569
11229
|
$,
|
|
11570
11230
|
applyModifiers,
|
|
11571
11231
|
childResults,
|
|
11572
|
-
nodes: { base: baseNode$
|
|
11232
|
+
nodes: { base: baseNode$51 },
|
|
11573
11233
|
parentSchema,
|
|
11574
11234
|
pipes: {
|
|
11575
11235
|
...pipes,
|
|
@@ -11580,16 +11240,15 @@ function intersectionToPipes(ctx) {
|
|
|
11580
11240
|
symbols: { v: plugin.external("valibot.v") }
|
|
11581
11241
|
};
|
|
11582
11242
|
const resolver = plugin.config["~resolvers"]?.intersection;
|
|
11583
|
-
const node = resolver?.(resolverCtx) ?? intersectionResolver(resolverCtx);
|
|
11243
|
+
const node = resolver?.(resolverCtx) ?? intersectionResolver$3(resolverCtx);
|
|
11584
11244
|
return {
|
|
11585
11245
|
childResults,
|
|
11586
11246
|
pipes: [resolverCtx.pipes.toNode(node, plugin)]
|
|
11587
11247
|
};
|
|
11588
11248
|
}
|
|
11589
|
-
|
|
11590
11249
|
//#endregion
|
|
11591
11250
|
//#region src/plugins/valibot/v1/toAst/never.ts
|
|
11592
|
-
function baseNode$
|
|
11251
|
+
function baseNode$50(ctx) {
|
|
11593
11252
|
const { symbols } = ctx;
|
|
11594
11253
|
const { v } = symbols;
|
|
11595
11254
|
return $(v).attr(identifiers$1.schemas.never).call();
|
|
@@ -11602,7 +11261,7 @@ function neverResolver$3(ctx) {
|
|
|
11602
11261
|
function neverToPipes({ plugin, schema }) {
|
|
11603
11262
|
const ctx = {
|
|
11604
11263
|
$,
|
|
11605
|
-
nodes: { base: baseNode$
|
|
11264
|
+
nodes: { base: baseNode$50 },
|
|
11606
11265
|
pipes: {
|
|
11607
11266
|
...pipes,
|
|
11608
11267
|
current: []
|
|
@@ -11615,10 +11274,9 @@ function neverToPipes({ plugin, schema }) {
|
|
|
11615
11274
|
const node = resolver?.(ctx) ?? neverResolver$3(ctx);
|
|
11616
11275
|
return ctx.pipes.toNode(node, plugin);
|
|
11617
11276
|
}
|
|
11618
|
-
|
|
11619
11277
|
//#endregion
|
|
11620
11278
|
//#region src/plugins/valibot/v1/toAst/null.ts
|
|
11621
|
-
function baseNode$
|
|
11279
|
+
function baseNode$49(ctx) {
|
|
11622
11280
|
const { symbols } = ctx;
|
|
11623
11281
|
const { v } = symbols;
|
|
11624
11282
|
return $(v).attr(identifiers$1.schemas.null).call();
|
|
@@ -11631,7 +11289,7 @@ function nullResolver$3(ctx) {
|
|
|
11631
11289
|
function nullToPipes({ plugin, schema }) {
|
|
11632
11290
|
const ctx = {
|
|
11633
11291
|
$,
|
|
11634
|
-
nodes: { base: baseNode$
|
|
11292
|
+
nodes: { base: baseNode$49 },
|
|
11635
11293
|
pipes: {
|
|
11636
11294
|
...pipes,
|
|
11637
11295
|
current: []
|
|
@@ -11644,7 +11302,6 @@ function nullToPipes({ plugin, schema }) {
|
|
|
11644
11302
|
const node = resolver?.(ctx) ?? nullResolver$3(ctx);
|
|
11645
11303
|
return ctx.pipes.toNode(node, plugin);
|
|
11646
11304
|
}
|
|
11647
|
-
|
|
11648
11305
|
//#endregion
|
|
11649
11306
|
//#region src/plugins/shared/utils/formats.ts
|
|
11650
11307
|
const rangeErrors = (format, range) => ({
|
|
@@ -11672,10 +11329,9 @@ const getIntegerLimit = (format) => {
|
|
|
11672
11329
|
...errors
|
|
11673
11330
|
};
|
|
11674
11331
|
};
|
|
11675
|
-
|
|
11676
11332
|
//#endregion
|
|
11677
11333
|
//#region src/plugins/valibot/v1/toAst/number.ts
|
|
11678
|
-
function baseNode$
|
|
11334
|
+
function baseNode$48(ctx) {
|
|
11679
11335
|
const { schema, symbols } = ctx;
|
|
11680
11336
|
const { v } = symbols;
|
|
11681
11337
|
if (ctx.utils.shouldCoerceToBigInt(schema.format)) return [$(v).attr(identifiers$1.schemas.union).call($.array($(v).attr(identifiers$1.schemas.number).call(), $(v).attr(identifiers$1.schemas.string).call(), $(v).attr(identifiers$1.schemas.bigInt).call())), $(v).attr(identifiers$1.actions.transform).call($.func().param("x").do($("BigInt").call("x").return()))];
|
|
@@ -11721,7 +11377,7 @@ function numberToPipes({ plugin, schema }) {
|
|
|
11721
11377
|
const ctx = {
|
|
11722
11378
|
$,
|
|
11723
11379
|
nodes: {
|
|
11724
|
-
base: baseNode$
|
|
11380
|
+
base: baseNode$48,
|
|
11725
11381
|
const: constNode$14,
|
|
11726
11382
|
max: maxNode$3,
|
|
11727
11383
|
min: minNode$3
|
|
@@ -11743,7 +11399,6 @@ function numberToPipes({ plugin, schema }) {
|
|
|
11743
11399
|
const node = resolver?.(ctx) ?? numberResolver$3(ctx);
|
|
11744
11400
|
return ctx.pipes.toNode(node, plugin);
|
|
11745
11401
|
}
|
|
11746
|
-
|
|
11747
11402
|
//#endregion
|
|
11748
11403
|
//#region src/plugins/valibot/v1/toAst/object.ts
|
|
11749
11404
|
function additionalPropertiesNode$3(ctx) {
|
|
@@ -11754,7 +11409,7 @@ function additionalPropertiesNode$3(ctx) {
|
|
|
11754
11409
|
ctx._childResults.push(additionalResult);
|
|
11755
11410
|
return pipes.toNode(additionalResult.pipes, ctx.plugin);
|
|
11756
11411
|
}
|
|
11757
|
-
function baseNode$
|
|
11412
|
+
function baseNode$47(ctx) {
|
|
11758
11413
|
const { v } = ctx.symbols;
|
|
11759
11414
|
const additional = ctx.nodes.additionalProperties(ctx);
|
|
11760
11415
|
const shape = ctx.nodes.shape(ctx);
|
|
@@ -11790,7 +11445,7 @@ function objectToPipes(ctx) {
|
|
|
11790
11445
|
applyModifiers,
|
|
11791
11446
|
nodes: {
|
|
11792
11447
|
additionalProperties: additionalPropertiesNode$3,
|
|
11793
|
-
base: baseNode$
|
|
11448
|
+
base: baseNode$47,
|
|
11794
11449
|
shape: shapeNode$3
|
|
11795
11450
|
},
|
|
11796
11451
|
pipes: {
|
|
@@ -11810,10 +11465,9 @@ function objectToPipes(ctx) {
|
|
|
11810
11465
|
pipes: [resolverCtx.pipes.toNode(node, plugin)]
|
|
11811
11466
|
};
|
|
11812
11467
|
}
|
|
11813
|
-
|
|
11814
11468
|
//#endregion
|
|
11815
11469
|
//#region src/plugins/valibot/v1/toAst/string.ts
|
|
11816
|
-
function baseNode$
|
|
11470
|
+
function baseNode$46(ctx) {
|
|
11817
11471
|
const { v } = ctx.symbols;
|
|
11818
11472
|
return $(v).attr(identifiers$1.schemas.string).call();
|
|
11819
11473
|
}
|
|
@@ -11892,7 +11546,7 @@ function stringToPipes({ plugin, schema }) {
|
|
|
11892
11546
|
const ctx = {
|
|
11893
11547
|
$,
|
|
11894
11548
|
nodes: {
|
|
11895
|
-
base: baseNode$
|
|
11549
|
+
base: baseNode$46,
|
|
11896
11550
|
const: constNode$13,
|
|
11897
11551
|
format: formatNode$3,
|
|
11898
11552
|
length: lengthNode$6,
|
|
@@ -11912,10 +11566,9 @@ function stringToPipes({ plugin, schema }) {
|
|
|
11912
11566
|
const node = resolver?.(ctx) ?? stringResolver$3(ctx);
|
|
11913
11567
|
return ctx.pipes.toNode(node, plugin);
|
|
11914
11568
|
}
|
|
11915
|
-
|
|
11916
11569
|
//#endregion
|
|
11917
11570
|
//#region src/plugins/valibot/v1/toAst/tuple.ts
|
|
11918
|
-
function baseNode$
|
|
11571
|
+
function baseNode$45(ctx) {
|
|
11919
11572
|
const { applyModifiers, pipes, plugin, schema, symbols, walk, walkerCtx } = ctx;
|
|
11920
11573
|
if (!schema.items) return unknownToPipes({ plugin });
|
|
11921
11574
|
const { v } = symbols;
|
|
@@ -11954,7 +11607,7 @@ function tupleToPipes(ctx) {
|
|
|
11954
11607
|
$,
|
|
11955
11608
|
applyModifiers: ctx.applyModifiers,
|
|
11956
11609
|
nodes: {
|
|
11957
|
-
base: baseNode$
|
|
11610
|
+
base: baseNode$45,
|
|
11958
11611
|
const: constNode$12
|
|
11959
11612
|
},
|
|
11960
11613
|
pipes: {
|
|
@@ -11974,10 +11627,9 @@ function tupleToPipes(ctx) {
|
|
|
11974
11627
|
pipes: [resolverCtx.pipes.toNode(node, plugin)]
|
|
11975
11628
|
};
|
|
11976
11629
|
}
|
|
11977
|
-
|
|
11978
11630
|
//#endregion
|
|
11979
11631
|
//#region src/plugins/valibot/v1/toAst/undefined.ts
|
|
11980
|
-
function baseNode$
|
|
11632
|
+
function baseNode$44(ctx) {
|
|
11981
11633
|
const { symbols } = ctx;
|
|
11982
11634
|
const { v } = symbols;
|
|
11983
11635
|
return $(v).attr(identifiers$1.schemas.undefined).call();
|
|
@@ -11990,7 +11642,7 @@ function undefinedResolver$3(ctx) {
|
|
|
11990
11642
|
function undefinedToPipes({ plugin, schema }) {
|
|
11991
11643
|
const ctx = {
|
|
11992
11644
|
$,
|
|
11993
|
-
nodes: { base: baseNode$
|
|
11645
|
+
nodes: { base: baseNode$44 },
|
|
11994
11646
|
pipes: {
|
|
11995
11647
|
...pipes,
|
|
11996
11648
|
current: []
|
|
@@ -12003,11 +11655,25 @@ function undefinedToPipes({ plugin, schema }) {
|
|
|
12003
11655
|
const node = resolver?.(ctx) ?? undefinedResolver$3(ctx);
|
|
12004
11656
|
return ctx.pipes.toNode(node, plugin);
|
|
12005
11657
|
}
|
|
12006
|
-
|
|
11658
|
+
//#endregion
|
|
11659
|
+
//#region src/plugins/valibot/shared/discriminated-union.ts
|
|
11660
|
+
function hasIntersectionDiscriminatorBranches({ items, parentSchema, schemas }) {
|
|
11661
|
+
const discriminatorKey = parentSchema.discriminator?.propertyName;
|
|
11662
|
+
if (!discriminatorKey) return false;
|
|
11663
|
+
for (let index = 0; index < schemas.length; index++) {
|
|
11664
|
+
const schema = schemas[index];
|
|
11665
|
+
if (schema.type === "null" || schema.const === null) continue;
|
|
11666
|
+
if (schema.logicalOperator !== "and" || !schema.items || schema.items.length !== 2) continue;
|
|
11667
|
+
const item = items[index];
|
|
11668
|
+
const discriminatedValue = schema.items[0].properties?.[discriminatorKey]?.const;
|
|
11669
|
+
if (item.meta.hasLazy || discriminatedValue !== void 0) return true;
|
|
11670
|
+
}
|
|
11671
|
+
return false;
|
|
11672
|
+
}
|
|
12007
11673
|
//#endregion
|
|
12008
11674
|
//#region src/plugins/valibot/v1/toAst/union.ts
|
|
12009
|
-
function baseNode$
|
|
12010
|
-
const { childResults, plugin, schemas, symbols } = ctx;
|
|
11675
|
+
function baseNode$43(ctx) {
|
|
11676
|
+
const { childResults, parentSchema, plugin, schemas, symbols } = ctx;
|
|
12011
11677
|
const { v } = symbols;
|
|
12012
11678
|
const nonNullItems = [];
|
|
12013
11679
|
childResults.forEach((item, index) => {
|
|
@@ -12017,9 +11683,16 @@ function baseNode$37(ctx) {
|
|
|
12017
11683
|
if (!nonNullItems.length) return $(v).attr(identifiers$1.schemas.null).call();
|
|
12018
11684
|
if (nonNullItems.length === 1) return nonNullItems[0].pipes;
|
|
12019
11685
|
const itemNodes = nonNullItems.map((i) => pipesToNode(i.pipes, plugin));
|
|
11686
|
+
const hasIntersectionBranch = hasIntersectionDiscriminatorBranches({
|
|
11687
|
+
items: childResults,
|
|
11688
|
+
parentSchema,
|
|
11689
|
+
schemas
|
|
11690
|
+
});
|
|
11691
|
+
const discriminatorKey = parentSchema.discriminator?.propertyName;
|
|
11692
|
+
if (discriminatorKey && !hasIntersectionBranch) return $(v).attr(identifiers$1.schemas.variant).call($.literal(discriminatorKey), $.array(...itemNodes));
|
|
12020
11693
|
return $(v).attr(identifiers$1.schemas.union).call($.array(...itemNodes));
|
|
12021
11694
|
}
|
|
12022
|
-
function unionResolver(ctx) {
|
|
11695
|
+
function unionResolver$3(ctx) {
|
|
12023
11696
|
const base = ctx.nodes.base(ctx);
|
|
12024
11697
|
if (base) ctx.pipes.push(ctx.pipes.current, base);
|
|
12025
11698
|
return ctx.pipes.current;
|
|
@@ -12030,7 +11703,7 @@ function unionToPipes(ctx) {
|
|
|
12030
11703
|
$,
|
|
12031
11704
|
applyModifiers,
|
|
12032
11705
|
childResults,
|
|
12033
|
-
nodes: { base: baseNode$
|
|
11706
|
+
nodes: { base: baseNode$43 },
|
|
12034
11707
|
parentSchema,
|
|
12035
11708
|
pipes: {
|
|
12036
11709
|
...pipes,
|
|
@@ -12042,16 +11715,15 @@ function unionToPipes(ctx) {
|
|
|
12042
11715
|
symbols: { v: plugin.external("valibot.v") }
|
|
12043
11716
|
};
|
|
12044
11717
|
const resolver = plugin.config["~resolvers"]?.union;
|
|
12045
|
-
const node = resolver?.(resolverCtx) ?? unionResolver(resolverCtx);
|
|
11718
|
+
const node = resolver?.(resolverCtx) ?? unionResolver$3(resolverCtx);
|
|
12046
11719
|
return {
|
|
12047
11720
|
childResults,
|
|
12048
11721
|
pipes: [resolverCtx.pipes.toNode(node, plugin)]
|
|
12049
11722
|
};
|
|
12050
11723
|
}
|
|
12051
|
-
|
|
12052
11724
|
//#endregion
|
|
12053
11725
|
//#region src/plugins/valibot/v1/toAst/void.ts
|
|
12054
|
-
function baseNode$
|
|
11726
|
+
function baseNode$42(ctx) {
|
|
12055
11727
|
const { symbols } = ctx;
|
|
12056
11728
|
const { v } = symbols;
|
|
12057
11729
|
return $(v).attr(identifiers$1.schemas.void).call();
|
|
@@ -12064,7 +11736,7 @@ function voidResolver$3(ctx) {
|
|
|
12064
11736
|
function voidToPipes({ plugin, schema }) {
|
|
12065
11737
|
const ctx = {
|
|
12066
11738
|
$,
|
|
12067
|
-
nodes: { base: baseNode$
|
|
11739
|
+
nodes: { base: baseNode$42 },
|
|
12068
11740
|
pipes: {
|
|
12069
11741
|
...pipes,
|
|
12070
11742
|
current: []
|
|
@@ -12077,10 +11749,9 @@ function voidToPipes({ plugin, schema }) {
|
|
|
12077
11749
|
const node = resolver?.(ctx) ?? voidResolver$3(ctx);
|
|
12078
11750
|
return ctx.pipes.toNode(node, plugin);
|
|
12079
11751
|
}
|
|
12080
|
-
|
|
12081
11752
|
//#endregion
|
|
12082
11753
|
//#region src/plugins/valibot/v1/walker.ts
|
|
12083
|
-
function getDefaultValue(meta) {
|
|
11754
|
+
function getDefaultValue$3(meta) {
|
|
12084
11755
|
return meta.format ? maybeBigInt(meta.default, meta.format) : $.fromValue(meta.default);
|
|
12085
11756
|
}
|
|
12086
11757
|
function createVisitor$3(config = {}) {
|
|
@@ -12091,14 +11762,14 @@ function createVisitor$3(config = {}) {
|
|
|
12091
11762
|
const v = ctx.plugin.external("valibot.v");
|
|
12092
11763
|
const pipes = [...result.pipes];
|
|
12093
11764
|
if (result.meta.readonly) pipes.push($(v).attr(identifiers$1.actions.readonly).call());
|
|
12094
|
-
const
|
|
12095
|
-
const needsOptional = optional ||
|
|
11765
|
+
const needsDefault = result.meta.default !== void 0;
|
|
11766
|
+
const needsOptional = optional || needsDefault;
|
|
12096
11767
|
const needsNullable = result.meta.nullable;
|
|
12097
11768
|
const innerNode = pipesToNode(pipes, ctx.plugin);
|
|
12098
11769
|
let finalPipes;
|
|
12099
|
-
if (needsOptional && needsNullable) if (
|
|
11770
|
+
if (needsOptional && needsNullable) if (needsDefault) finalPipes = [$(v).attr(identifiers$1.schemas.nullish).call(innerNode, getDefaultValue$3(result.meta))];
|
|
12100
11771
|
else finalPipes = [$(v).attr(identifiers$1.schemas.nullish).call(innerNode)];
|
|
12101
|
-
else if (needsOptional) if (
|
|
11772
|
+
else if (needsOptional) if (needsDefault) finalPipes = [$(v).attr(identifiers$1.schemas.optional).call(innerNode, getDefaultValue$3(result.meta))];
|
|
12102
11773
|
else finalPipes = [$(v).attr(identifiers$1.schemas.optional).call(innerNode)];
|
|
12103
11774
|
else if (needsNullable) finalPipes = [$(v).attr(identifiers$1.schemas.nullable).call(innerNode)];
|
|
12104
11775
|
else finalPipes = pipes;
|
|
@@ -12359,7 +12030,6 @@ function createVisitor$3(config = {}) {
|
|
|
12359
12030
|
}
|
|
12360
12031
|
};
|
|
12361
12032
|
}
|
|
12362
|
-
|
|
12363
12033
|
//#endregion
|
|
12364
12034
|
//#region src/plugins/valibot/v1/processor.ts
|
|
12365
12035
|
function createProcessor$3(plugin) {
|
|
@@ -12406,7 +12076,6 @@ function createProcessor$3(plugin) {
|
|
|
12406
12076
|
}
|
|
12407
12077
|
return { process };
|
|
12408
12078
|
}
|
|
12409
|
-
|
|
12410
12079
|
//#endregion
|
|
12411
12080
|
//#region src/plugins/valibot/v1/plugin.ts
|
|
12412
12081
|
const handlerV1 = ({ plugin }) => {
|
|
@@ -12477,11 +12146,9 @@ const handlerV1 = ({ plugin }) => {
|
|
|
12477
12146
|
}
|
|
12478
12147
|
});
|
|
12479
12148
|
};
|
|
12480
|
-
|
|
12481
12149
|
//#endregion
|
|
12482
12150
|
//#region src/plugins/valibot/plugin.ts
|
|
12483
12151
|
const handler$1 = (args) => handlerV1(args);
|
|
12484
|
-
|
|
12485
12152
|
//#endregion
|
|
12486
12153
|
//#region src/plugins/valibot/config.ts
|
|
12487
12154
|
const defaultConfig$1 = {
|
|
@@ -12581,11 +12248,7 @@ const defaultConfig$1 = {
|
|
|
12581
12248
|
},
|
|
12582
12249
|
tags: ["validator"]
|
|
12583
12250
|
};
|
|
12584
|
-
|
|
12585
|
-
* Type helper for Valibot plugin, returns {@link Plugin.Config} object
|
|
12586
|
-
*/
|
|
12587
|
-
const defineConfig$1 = definePluginConfig(defaultConfig$1);
|
|
12588
|
-
|
|
12251
|
+
definePluginConfig(defaultConfig$1);
|
|
12589
12252
|
//#endregion
|
|
12590
12253
|
//#region src/plugins/zod/constants.ts
|
|
12591
12254
|
const identifiers = {
|
|
@@ -12604,13 +12267,16 @@ const identifiers = {
|
|
|
12604
12267
|
datetime: "datetime",
|
|
12605
12268
|
default: "default",
|
|
12606
12269
|
describe: "describe",
|
|
12270
|
+
discriminatedUnion: "discriminatedUnion",
|
|
12607
12271
|
email: "email",
|
|
12608
12272
|
enum: "enum",
|
|
12273
|
+
extend: "extend",
|
|
12609
12274
|
globalRegistry: "globalRegistry",
|
|
12610
12275
|
gt: "gt",
|
|
12611
12276
|
gte: "gte",
|
|
12612
12277
|
guid: "guid",
|
|
12613
12278
|
infer: "infer",
|
|
12279
|
+
input: "input",
|
|
12614
12280
|
int: "int",
|
|
12615
12281
|
intersection: "intersection",
|
|
12616
12282
|
ip: "ip",
|
|
@@ -12635,6 +12301,7 @@ const identifiers = {
|
|
|
12635
12301
|
number: "number",
|
|
12636
12302
|
object: "object",
|
|
12637
12303
|
optional: "optional",
|
|
12304
|
+
output: "output",
|
|
12638
12305
|
parseAsync: "parseAsync",
|
|
12639
12306
|
readonly: "readonly",
|
|
12640
12307
|
record: "record",
|
|
@@ -12650,7 +12317,6 @@ const identifiers = {
|
|
|
12650
12317
|
uuid: "uuid",
|
|
12651
12318
|
void: "void"
|
|
12652
12319
|
};
|
|
12653
|
-
|
|
12654
12320
|
//#endregion
|
|
12655
12321
|
//#region src/plugins/zod/shared/export.ts
|
|
12656
12322
|
function exportAst({ final, meta, naming, namingAnchor, path, plugin, schema, tags }) {
|
|
@@ -12669,6 +12335,8 @@ function exportAst({ final, meta, naming, namingAnchor, path, plugin, schema, ta
|
|
|
12669
12335
|
plugin,
|
|
12670
12336
|
schema
|
|
12671
12337
|
}));
|
|
12338
|
+
const statement = $.const(symbol).export().$if(plugin.config.comments && createSchemaComment(schema), (c, v) => c.doc(v)).$if(final.typeName, (c) => c.type($.type(z).attr(final.typeName))).assign(final.expression);
|
|
12339
|
+
plugin.node(statement);
|
|
12672
12340
|
const typeInferSymbol = naming.types.infer.enabled ? plugin.registerSymbol(buildSymbolIn({
|
|
12673
12341
|
meta: {
|
|
12674
12342
|
category: "type",
|
|
@@ -12683,15 +12351,48 @@ function exportAst({ final, meta, naming, namingAnchor, path, plugin, schema, ta
|
|
|
12683
12351
|
plugin,
|
|
12684
12352
|
schema
|
|
12685
12353
|
})) : void 0;
|
|
12686
|
-
const statement = $.const(symbol).export().$if(plugin.config.comments && createSchemaComment(schema), (c, v) => c.doc(v)).$if(final.typeName, (c) => c.type($.type(z).attr(final.typeName))).assign(final.expression);
|
|
12687
|
-
plugin.node(statement);
|
|
12688
12354
|
if (typeInferSymbol) {
|
|
12689
12355
|
const inferType = $.type.alias(typeInferSymbol).export().type($.type(z).attr(identifiers.infer).generic($(symbol).typeofType()));
|
|
12690
12356
|
plugin.node(inferType);
|
|
12691
12357
|
}
|
|
12358
|
+
const typeInputSymbol = naming.types.input.enabled ? plugin.registerSymbol(buildSymbolIn({
|
|
12359
|
+
meta: {
|
|
12360
|
+
category: "type",
|
|
12361
|
+
path,
|
|
12362
|
+
tags,
|
|
12363
|
+
tool: "zod",
|
|
12364
|
+
variant: "input",
|
|
12365
|
+
...meta
|
|
12366
|
+
},
|
|
12367
|
+
name,
|
|
12368
|
+
naming: naming.types.input,
|
|
12369
|
+
plugin,
|
|
12370
|
+
schema
|
|
12371
|
+
})) : void 0;
|
|
12372
|
+
if (typeInputSymbol) {
|
|
12373
|
+
const inputType = $.type.alias(typeInputSymbol).export().type($.type(z).attr(identifiers.input).generic($(symbol).typeofType()));
|
|
12374
|
+
plugin.node(inputType);
|
|
12375
|
+
}
|
|
12376
|
+
const typeOutputSymbol = naming.types.output.enabled ? plugin.registerSymbol(buildSymbolIn({
|
|
12377
|
+
meta: {
|
|
12378
|
+
category: "type",
|
|
12379
|
+
path,
|
|
12380
|
+
tags,
|
|
12381
|
+
tool: "zod",
|
|
12382
|
+
variant: "output",
|
|
12383
|
+
...meta
|
|
12384
|
+
},
|
|
12385
|
+
name,
|
|
12386
|
+
naming: naming.types.output,
|
|
12387
|
+
plugin,
|
|
12388
|
+
schema
|
|
12389
|
+
})) : void 0;
|
|
12390
|
+
if (typeOutputSymbol) {
|
|
12391
|
+
const outputType = $.type.alias(typeOutputSymbol).export().type($.type(z).attr(identifiers.output).generic($(symbol).typeofType()));
|
|
12392
|
+
plugin.node(outputType);
|
|
12393
|
+
}
|
|
12692
12394
|
return symbol;
|
|
12693
12395
|
}
|
|
12694
|
-
|
|
12695
12396
|
//#endregion
|
|
12696
12397
|
//#region src/plugins/zod/shared/operation-schema.ts
|
|
12697
12398
|
function buildOperationSchema(operation) {
|
|
@@ -12738,7 +12439,6 @@ function buildOperationSchema(operation) {
|
|
|
12738
12439
|
schema
|
|
12739
12440
|
};
|
|
12740
12441
|
}
|
|
12741
|
-
|
|
12742
12442
|
//#endregion
|
|
12743
12443
|
//#region src/plugins/zod/shared/validator.ts
|
|
12744
12444
|
function getDefaultRequestValidatorLayers(operation) {
|
|
@@ -12766,7 +12466,6 @@ function getDefaultRequestValidatorLayers(operation) {
|
|
|
12766
12466
|
}
|
|
12767
12467
|
};
|
|
12768
12468
|
}
|
|
12769
|
-
|
|
12770
12469
|
//#endregion
|
|
12771
12470
|
//#region src/plugins/zod/mini/api.ts
|
|
12772
12471
|
function emptyNode$2(ctx) {
|
|
@@ -12912,7 +12611,6 @@ function createResponseValidatorMini({ operation, plugin }) {
|
|
|
12912
12611
|
}
|
|
12913
12612
|
});
|
|
12914
12613
|
}
|
|
12915
|
-
|
|
12916
12614
|
//#endregion
|
|
12917
12615
|
//#region src/plugins/zod/v3/api.ts
|
|
12918
12616
|
function emptyNode$1(ctx) {
|
|
@@ -13057,7 +12755,6 @@ function createResponseValidatorV3({ operation, plugin }) {
|
|
|
13057
12755
|
}
|
|
13058
12756
|
});
|
|
13059
12757
|
}
|
|
13060
|
-
|
|
13061
12758
|
//#endregion
|
|
13062
12759
|
//#region src/plugins/zod/v4/api.ts
|
|
13063
12760
|
function emptyNode(ctx) {
|
|
@@ -13202,7 +12899,6 @@ function createResponseValidatorV4({ operation, plugin }) {
|
|
|
13202
12899
|
}
|
|
13203
12900
|
});
|
|
13204
12901
|
}
|
|
13205
|
-
|
|
13206
12902
|
//#endregion
|
|
13207
12903
|
//#region src/plugins/zod/api.ts
|
|
13208
12904
|
var Api = class {
|
|
@@ -13233,7 +12929,6 @@ var Api = class {
|
|
|
13233
12929
|
}
|
|
13234
12930
|
}
|
|
13235
12931
|
};
|
|
13236
|
-
|
|
13237
12932
|
//#endregion
|
|
13238
12933
|
//#region src/plugins/zod/shared/module.ts
|
|
13239
12934
|
function getZodModule({ plugin }) {
|
|
@@ -13253,7 +12948,6 @@ function getZodModule({ plugin }) {
|
|
|
13253
12948
|
case "mini": return "zod/mini";
|
|
13254
12949
|
}
|
|
13255
12950
|
}
|
|
13256
|
-
|
|
13257
12951
|
//#endregion
|
|
13258
12952
|
//#region src/plugins/zod/shared/operation.ts
|
|
13259
12953
|
function irOperationToAst({ operation, path, plugin, processor, tags }) {
|
|
@@ -13331,7 +13025,6 @@ function irOperationToAst({ operation, path, plugin, processor, tags }) {
|
|
|
13331
13025
|
}
|
|
13332
13026
|
}
|
|
13333
13027
|
}
|
|
13334
|
-
|
|
13335
13028
|
//#endregion
|
|
13336
13029
|
//#region src/plugins/zod/shared/webhook.ts
|
|
13337
13030
|
function irWebhookToAst({ operation, path, plugin, processor, tags }) {
|
|
@@ -13352,7 +13045,6 @@ function irWebhookToAst({ operation, path, plugin, processor, tags }) {
|
|
|
13352
13045
|
});
|
|
13353
13046
|
}
|
|
13354
13047
|
}
|
|
13355
|
-
|
|
13356
13048
|
//#endregion
|
|
13357
13049
|
//#region src/plugins/zod/shared/meta.ts
|
|
13358
13050
|
/**
|
|
@@ -13400,10 +13092,9 @@ function inheritMeta(parent, children) {
|
|
|
13400
13092
|
readonly: parent.accessScope === "read"
|
|
13401
13093
|
});
|
|
13402
13094
|
}
|
|
13403
|
-
|
|
13404
13095
|
//#endregion
|
|
13405
13096
|
//#region src/plugins/zod/mini/toAst/unknown.ts
|
|
13406
|
-
function baseNode$
|
|
13097
|
+
function baseNode$41(ctx) {
|
|
13407
13098
|
const { symbols } = ctx;
|
|
13408
13099
|
const { z } = symbols;
|
|
13409
13100
|
return $(z).attr(identifiers.unknown).call();
|
|
@@ -13418,7 +13109,7 @@ function unknownToAst$2({ plugin, schema }) {
|
|
|
13418
13109
|
const ctx = {
|
|
13419
13110
|
$,
|
|
13420
13111
|
chain: { current: $(z) },
|
|
13421
|
-
nodes: { base: baseNode$
|
|
13112
|
+
nodes: { base: baseNode$41 },
|
|
13422
13113
|
plugin,
|
|
13423
13114
|
schema,
|
|
13424
13115
|
symbols: { z }
|
|
@@ -13426,10 +13117,9 @@ function unknownToAst$2({ plugin, schema }) {
|
|
|
13426
13117
|
const resolver = plugin.config["~resolvers"]?.unknown;
|
|
13427
13118
|
return resolver?.(ctx) ?? unknownResolver$2(ctx);
|
|
13428
13119
|
}
|
|
13429
|
-
|
|
13430
13120
|
//#endregion
|
|
13431
13121
|
//#region src/plugins/zod/mini/toAst/array.ts
|
|
13432
|
-
function baseNode$
|
|
13122
|
+
function baseNode$40(ctx) {
|
|
13433
13123
|
const { applyModifiers, childResults, plugin, schema, symbols } = ctx;
|
|
13434
13124
|
const { z } = symbols;
|
|
13435
13125
|
const arrayFn = $(z).attr(identifiers.array);
|
|
@@ -13500,7 +13190,7 @@ function arrayToAst$2({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
13500
13190
|
chain: { current: $(z) },
|
|
13501
13191
|
childResults,
|
|
13502
13192
|
nodes: {
|
|
13503
|
-
base: baseNode$
|
|
13193
|
+
base: baseNode$40,
|
|
13504
13194
|
length: lengthNode$5,
|
|
13505
13195
|
maxLength: maxLengthNode$5,
|
|
13506
13196
|
minLength: minLengthNode$5
|
|
@@ -13517,10 +13207,9 @@ function arrayToAst$2({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
13517
13207
|
expression: resolver?.(ctx) ?? arrayResolver$2(ctx)
|
|
13518
13208
|
};
|
|
13519
13209
|
}
|
|
13520
|
-
|
|
13521
13210
|
//#endregion
|
|
13522
13211
|
//#region src/plugins/zod/mini/toAst/boolean.ts
|
|
13523
|
-
function baseNode$
|
|
13212
|
+
function baseNode$39(ctx) {
|
|
13524
13213
|
const { symbols } = ctx;
|
|
13525
13214
|
const { z } = symbols;
|
|
13526
13215
|
return $(z).attr(identifiers.boolean).call();
|
|
@@ -13547,7 +13236,7 @@ function booleanToAst$2({ plugin, schema }) {
|
|
|
13547
13236
|
$,
|
|
13548
13237
|
chain: { current: $(z) },
|
|
13549
13238
|
nodes: {
|
|
13550
|
-
base: baseNode$
|
|
13239
|
+
base: baseNode$39,
|
|
13551
13240
|
const: constNode$11
|
|
13552
13241
|
},
|
|
13553
13242
|
plugin,
|
|
@@ -13557,7 +13246,6 @@ function booleanToAst$2({ plugin, schema }) {
|
|
|
13557
13246
|
const resolver = plugin.config["~resolvers"]?.boolean;
|
|
13558
13247
|
return resolver?.(ctx) ?? booleanResolver$2(ctx);
|
|
13559
13248
|
}
|
|
13560
|
-
|
|
13561
13249
|
//#endregion
|
|
13562
13250
|
//#region src/plugins/zod/mini/toAst/enum.ts
|
|
13563
13251
|
function itemsNode$2(ctx) {
|
|
@@ -13587,7 +13275,7 @@ function itemsNode$2(ctx) {
|
|
|
13587
13275
|
literalMembers
|
|
13588
13276
|
};
|
|
13589
13277
|
}
|
|
13590
|
-
function baseNode$
|
|
13278
|
+
function baseNode$38(ctx) {
|
|
13591
13279
|
const { symbols } = ctx;
|
|
13592
13280
|
const { z } = symbols;
|
|
13593
13281
|
const { allStrings, enumMembers, literalMembers } = ctx.nodes.items(ctx);
|
|
@@ -13608,7 +13296,7 @@ function enumToAst$2({ plugin, schema }) {
|
|
|
13608
13296
|
$,
|
|
13609
13297
|
chain: { current: $(z) },
|
|
13610
13298
|
nodes: {
|
|
13611
|
-
base: baseNode$
|
|
13299
|
+
base: baseNode$38,
|
|
13612
13300
|
items: itemsNode$2
|
|
13613
13301
|
},
|
|
13614
13302
|
plugin,
|
|
@@ -13623,10 +13311,45 @@ function enumToAst$2({ plugin, schema }) {
|
|
|
13623
13311
|
const resolver = plugin.config["~resolvers"]?.enum;
|
|
13624
13312
|
return resolver?.(ctx) ?? enumResolver$2(ctx);
|
|
13625
13313
|
}
|
|
13626
|
-
|
|
13314
|
+
//#endregion
|
|
13315
|
+
//#region src/plugins/zod/mini/toAst/intersection.ts
|
|
13316
|
+
function baseNode$37(ctx) {
|
|
13317
|
+
const { childResults, symbols } = ctx;
|
|
13318
|
+
const { z } = symbols;
|
|
13319
|
+
if (!childResults.length) return $(z).attr(identifiers.never).call();
|
|
13320
|
+
let expression = childResults[0].expression;
|
|
13321
|
+
childResults.slice(1).forEach((item) => {
|
|
13322
|
+
expression = $(z).attr(identifiers.intersection).call(expression, item.meta.hasLazy ? $(z).attr(identifiers.lazy).call($.func().do(item.expression.return())) : item.expression);
|
|
13323
|
+
});
|
|
13324
|
+
return expression;
|
|
13325
|
+
}
|
|
13326
|
+
function intersectionResolver$2(ctx) {
|
|
13327
|
+
const baseResult = ctx.nodes.base(ctx);
|
|
13328
|
+
ctx.chain.current = baseResult;
|
|
13329
|
+
return ctx.chain.current;
|
|
13330
|
+
}
|
|
13331
|
+
function intersectionToAst$2({ childResults, parentSchema, plugin, schemas }) {
|
|
13332
|
+
const z = plugin.external("zod.z");
|
|
13333
|
+
const ctx = {
|
|
13334
|
+
$,
|
|
13335
|
+
chain: { current: $(z) },
|
|
13336
|
+
childResults,
|
|
13337
|
+
nodes: { base: baseNode$37 },
|
|
13338
|
+
parentSchema,
|
|
13339
|
+
plugin,
|
|
13340
|
+
schema: parentSchema,
|
|
13341
|
+
schemas,
|
|
13342
|
+
symbols: { z }
|
|
13343
|
+
};
|
|
13344
|
+
const resolver = plugin.config["~resolvers"]?.intersection;
|
|
13345
|
+
return {
|
|
13346
|
+
childResults,
|
|
13347
|
+
expression: resolver?.(ctx) ?? intersectionResolver$2(ctx)
|
|
13348
|
+
};
|
|
13349
|
+
}
|
|
13627
13350
|
//#endregion
|
|
13628
13351
|
//#region src/plugins/zod/mini/toAst/never.ts
|
|
13629
|
-
function baseNode$
|
|
13352
|
+
function baseNode$36(ctx) {
|
|
13630
13353
|
const { symbols } = ctx;
|
|
13631
13354
|
const { z } = symbols;
|
|
13632
13355
|
return $(z).attr(identifiers.never).call();
|
|
@@ -13641,7 +13364,7 @@ function neverToAst$2({ plugin, schema }) {
|
|
|
13641
13364
|
const ctx = {
|
|
13642
13365
|
$,
|
|
13643
13366
|
chain: { current: $(z) },
|
|
13644
|
-
nodes: { base: baseNode$
|
|
13367
|
+
nodes: { base: baseNode$36 },
|
|
13645
13368
|
plugin,
|
|
13646
13369
|
schema,
|
|
13647
13370
|
symbols: { z }
|
|
@@ -13649,10 +13372,9 @@ function neverToAst$2({ plugin, schema }) {
|
|
|
13649
13372
|
const resolver = plugin.config["~resolvers"]?.never;
|
|
13650
13373
|
return resolver?.(ctx) ?? neverResolver$2(ctx);
|
|
13651
13374
|
}
|
|
13652
|
-
|
|
13653
13375
|
//#endregion
|
|
13654
13376
|
//#region src/plugins/zod/mini/toAst/null.ts
|
|
13655
|
-
function baseNode$
|
|
13377
|
+
function baseNode$35(ctx) {
|
|
13656
13378
|
const { symbols } = ctx;
|
|
13657
13379
|
const { z } = symbols;
|
|
13658
13380
|
return $(z).attr(identifiers.null).call();
|
|
@@ -13667,7 +13389,7 @@ function nullToAst$2({ plugin, schema }) {
|
|
|
13667
13389
|
const ctx = {
|
|
13668
13390
|
$,
|
|
13669
13391
|
chain: { current: $(z) },
|
|
13670
|
-
nodes: { base: baseNode$
|
|
13392
|
+
nodes: { base: baseNode$35 },
|
|
13671
13393
|
plugin,
|
|
13672
13394
|
schema,
|
|
13673
13395
|
symbols: { z }
|
|
@@ -13675,10 +13397,9 @@ function nullToAst$2({ plugin, schema }) {
|
|
|
13675
13397
|
const resolver = plugin.config["~resolvers"]?.null;
|
|
13676
13398
|
return resolver?.(ctx) ?? nullResolver$2(ctx);
|
|
13677
13399
|
}
|
|
13678
|
-
|
|
13679
13400
|
//#endregion
|
|
13680
13401
|
//#region src/plugins/zod/mini/toAst/number.ts
|
|
13681
|
-
function baseNode$
|
|
13402
|
+
function baseNode$34(ctx) {
|
|
13682
13403
|
const { schema, symbols } = ctx;
|
|
13683
13404
|
const { z } = symbols;
|
|
13684
13405
|
if (ctx.utils.shouldCoerceToBigInt(schema.format)) return $(z).attr(identifiers.coerce).attr(identifiers.bigint).call();
|
|
@@ -13730,7 +13451,7 @@ function numberToNode$2({ plugin, schema }) {
|
|
|
13730
13451
|
$,
|
|
13731
13452
|
chain: { current: $(z) },
|
|
13732
13453
|
nodes: {
|
|
13733
|
-
base: baseNode$
|
|
13454
|
+
base: baseNode$34,
|
|
13734
13455
|
const: constNode$10,
|
|
13735
13456
|
max: maxNode$2,
|
|
13736
13457
|
min: minNode$2
|
|
@@ -13747,7 +13468,6 @@ function numberToNode$2({ plugin, schema }) {
|
|
|
13747
13468
|
const resolver = plugin.config["~resolvers"]?.number;
|
|
13748
13469
|
return resolver?.(ctx) ?? numberResolver$2(ctx);
|
|
13749
13470
|
}
|
|
13750
|
-
|
|
13751
13471
|
//#endregion
|
|
13752
13472
|
//#region src/plugins/zod/mini/toAst/object.ts
|
|
13753
13473
|
function additionalPropertiesNode$2(ctx) {
|
|
@@ -13757,7 +13477,7 @@ function additionalPropertiesNode$2(ctx) {
|
|
|
13757
13477
|
_childResults.push(additionalResult);
|
|
13758
13478
|
return applyModifiers(additionalResult, {}).expression;
|
|
13759
13479
|
}
|
|
13760
|
-
function baseNode$
|
|
13480
|
+
function baseNode$33(ctx) {
|
|
13761
13481
|
const { nodes, symbols } = ctx;
|
|
13762
13482
|
const { z } = symbols;
|
|
13763
13483
|
const additional = nodes.additionalProperties(ctx);
|
|
@@ -13792,7 +13512,7 @@ function objectToAst$2(options) {
|
|
|
13792
13512
|
chain: { current: $(z) },
|
|
13793
13513
|
nodes: {
|
|
13794
13514
|
additionalProperties: additionalPropertiesNode$2,
|
|
13795
|
-
base: baseNode$
|
|
13515
|
+
base: baseNode$33,
|
|
13796
13516
|
shape: shapeNode$2
|
|
13797
13517
|
},
|
|
13798
13518
|
plugin,
|
|
@@ -13807,10 +13527,9 @@ function objectToAst$2(options) {
|
|
|
13807
13527
|
expression: resolver?.(ctx) ?? objectResolver$2(ctx)
|
|
13808
13528
|
};
|
|
13809
13529
|
}
|
|
13810
|
-
|
|
13811
13530
|
//#endregion
|
|
13812
13531
|
//#region src/plugins/zod/mini/toAst/string.ts
|
|
13813
|
-
function baseNode$
|
|
13532
|
+
function baseNode$32(ctx) {
|
|
13814
13533
|
const { z } = ctx.symbols;
|
|
13815
13534
|
return $(z).attr(identifiers.string).call();
|
|
13816
13535
|
}
|
|
@@ -13893,7 +13612,7 @@ function stringToNode$2({ plugin, schema }) {
|
|
|
13893
13612
|
$,
|
|
13894
13613
|
chain: { current: $(z) },
|
|
13895
13614
|
nodes: {
|
|
13896
|
-
base: baseNode$
|
|
13615
|
+
base: baseNode$32,
|
|
13897
13616
|
const: constNode$9,
|
|
13898
13617
|
format: formatNode$2,
|
|
13899
13618
|
length: lengthNode$4,
|
|
@@ -13908,10 +13627,9 @@ function stringToNode$2({ plugin, schema }) {
|
|
|
13908
13627
|
const resolver = plugin.config["~resolvers"]?.string;
|
|
13909
13628
|
return resolver?.(ctx) ?? stringResolver$2(ctx);
|
|
13910
13629
|
}
|
|
13911
|
-
|
|
13912
13630
|
//#endregion
|
|
13913
13631
|
//#region src/plugins/zod/mini/toAst/tuple.ts
|
|
13914
|
-
function baseNode$
|
|
13632
|
+
function baseNode$31(ctx) {
|
|
13915
13633
|
const { applyModifiers, childResults, symbols } = ctx;
|
|
13916
13634
|
const { z } = symbols;
|
|
13917
13635
|
const tupleFn = $(z).attr(identifiers.tuple);
|
|
@@ -13949,7 +13667,7 @@ function tupleToAst$2({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
13949
13667
|
chain: { current: $(z) },
|
|
13950
13668
|
childResults,
|
|
13951
13669
|
nodes: {
|
|
13952
|
-
base: baseNode$
|
|
13670
|
+
base: baseNode$31,
|
|
13953
13671
|
const: constNode$8
|
|
13954
13672
|
},
|
|
13955
13673
|
plugin,
|
|
@@ -13964,10 +13682,9 @@ function tupleToAst$2({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
13964
13682
|
expression: resolver?.(ctx) ?? tupleResolver$2(ctx)
|
|
13965
13683
|
};
|
|
13966
13684
|
}
|
|
13967
|
-
|
|
13968
13685
|
//#endregion
|
|
13969
13686
|
//#region src/plugins/zod/mini/toAst/undefined.ts
|
|
13970
|
-
function baseNode$
|
|
13687
|
+
function baseNode$30(ctx) {
|
|
13971
13688
|
const { symbols } = ctx;
|
|
13972
13689
|
const { z } = symbols;
|
|
13973
13690
|
return $(z).attr(identifiers.undefined).call();
|
|
@@ -13982,7 +13699,7 @@ function undefinedToAst$2({ plugin, schema }) {
|
|
|
13982
13699
|
const ctx = {
|
|
13983
13700
|
$,
|
|
13984
13701
|
chain: { current: $(z) },
|
|
13985
|
-
nodes: { base: baseNode$
|
|
13702
|
+
nodes: { base: baseNode$30 },
|
|
13986
13703
|
plugin,
|
|
13987
13704
|
schema,
|
|
13988
13705
|
symbols: { z }
|
|
@@ -13990,10 +13707,93 @@ function undefinedToAst$2({ plugin, schema }) {
|
|
|
13990
13707
|
const resolver = plugin.config["~resolvers"]?.undefined;
|
|
13991
13708
|
return resolver?.(ctx) ?? undefinedResolver$2(ctx);
|
|
13992
13709
|
}
|
|
13993
|
-
|
|
13710
|
+
//#endregion
|
|
13711
|
+
//#region src/plugins/zod/shared/discriminated-union.ts
|
|
13712
|
+
function tryBuildDiscriminatedUnion({ items, parentSchema, plugin, schemas }) {
|
|
13713
|
+
const discriminatorKey = parentSchema.discriminator?.propertyName;
|
|
13714
|
+
if (!discriminatorKey) return null;
|
|
13715
|
+
const members = [];
|
|
13716
|
+
for (let index = 0; index < schemas.length; index++) {
|
|
13717
|
+
const schema = schemas[index];
|
|
13718
|
+
if (schema.type === "null" || schema.const === null) continue;
|
|
13719
|
+
if (schema.logicalOperator !== "and" || !schema.items || schema.items.length !== 2) return null;
|
|
13720
|
+
const refPart = schema.items[1];
|
|
13721
|
+
const discriminatedValue = schema.items[0].properties?.[discriminatorKey]?.const;
|
|
13722
|
+
if (discriminatedValue === void 0 || items[index].meta.hasLazy) return null;
|
|
13723
|
+
let refExpression;
|
|
13724
|
+
if (refPart.symbolRef) refExpression = $(refPart.symbolRef);
|
|
13725
|
+
else if (refPart.$ref) {
|
|
13726
|
+
const query = {
|
|
13727
|
+
category: "schema",
|
|
13728
|
+
resource: "definition",
|
|
13729
|
+
resourceId: refPart.$ref,
|
|
13730
|
+
tool: "zod"
|
|
13731
|
+
};
|
|
13732
|
+
refExpression = $(plugin.referenceSymbol(query));
|
|
13733
|
+
} else return null;
|
|
13734
|
+
members.push({
|
|
13735
|
+
discriminatedValue,
|
|
13736
|
+
refExpression
|
|
13737
|
+
});
|
|
13738
|
+
}
|
|
13739
|
+
if (!members.length) return null;
|
|
13740
|
+
return {
|
|
13741
|
+
discriminatorKey,
|
|
13742
|
+
members
|
|
13743
|
+
};
|
|
13744
|
+
}
|
|
13745
|
+
//#endregion
|
|
13746
|
+
//#region src/plugins/zod/mini/toAst/union.ts
|
|
13747
|
+
function baseNode$29(ctx) {
|
|
13748
|
+
const { childResults, parentSchema, plugin, schemas, symbols } = ctx;
|
|
13749
|
+
const { z } = symbols;
|
|
13750
|
+
if (!childResults.length) return $(z).attr(identifiers.null).call();
|
|
13751
|
+
const nonNullItems = [];
|
|
13752
|
+
childResults.forEach((result, index) => {
|
|
13753
|
+
const schema = schemas[index];
|
|
13754
|
+
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(result);
|
|
13755
|
+
});
|
|
13756
|
+
if (!nonNullItems.length) return $(z).attr(identifiers.null).call();
|
|
13757
|
+
if (nonNullItems.length === 1) return nonNullItems[0].expression;
|
|
13758
|
+
const discriminatedExpression = tryBuildDiscriminatedUnion({
|
|
13759
|
+
items: childResults,
|
|
13760
|
+
parentSchema,
|
|
13761
|
+
plugin,
|
|
13762
|
+
schemas
|
|
13763
|
+
});
|
|
13764
|
+
if (discriminatedExpression) {
|
|
13765
|
+
const unionMembers = discriminatedExpression.members.map((member) => $(z).attr(identifiers.extend).call(member.refExpression, $.object().prop(discriminatedExpression.discriminatorKey, $(z).attr(identifiers.literal).call($.fromValue(member.discriminatedValue)))));
|
|
13766
|
+
return $(z).attr(identifiers.discriminatedUnion).call($.literal(discriminatedExpression.discriminatorKey), $.array().pretty().elements(...unionMembers));
|
|
13767
|
+
}
|
|
13768
|
+
return $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
13769
|
+
}
|
|
13770
|
+
function unionResolver$2(ctx) {
|
|
13771
|
+
const baseResult = ctx.nodes.base(ctx);
|
|
13772
|
+
ctx.chain.current = baseResult;
|
|
13773
|
+
return ctx.chain.current;
|
|
13774
|
+
}
|
|
13775
|
+
function unionToAst$2({ childResults, parentSchema, plugin, schemas }) {
|
|
13776
|
+
const z = plugin.external("zod.z");
|
|
13777
|
+
const ctx = {
|
|
13778
|
+
$,
|
|
13779
|
+
chain: { current: $(z) },
|
|
13780
|
+
childResults,
|
|
13781
|
+
nodes: { base: baseNode$29 },
|
|
13782
|
+
parentSchema,
|
|
13783
|
+
plugin,
|
|
13784
|
+
schema: parentSchema,
|
|
13785
|
+
schemas,
|
|
13786
|
+
symbols: { z }
|
|
13787
|
+
};
|
|
13788
|
+
const resolver = plugin.config["~resolvers"]?.union;
|
|
13789
|
+
return {
|
|
13790
|
+
childResults,
|
|
13791
|
+
expression: resolver?.(ctx) ?? unionResolver$2(ctx)
|
|
13792
|
+
};
|
|
13793
|
+
}
|
|
13994
13794
|
//#endregion
|
|
13995
13795
|
//#region src/plugins/zod/mini/toAst/void.ts
|
|
13996
|
-
function baseNode$
|
|
13796
|
+
function baseNode$28(ctx) {
|
|
13997
13797
|
const { symbols } = ctx;
|
|
13998
13798
|
const { z } = symbols;
|
|
13999
13799
|
return $(z).attr(identifiers.void).call();
|
|
@@ -14008,7 +13808,7 @@ function voidToAst$2({ plugin, schema }) {
|
|
|
14008
13808
|
const ctx = {
|
|
14009
13809
|
$,
|
|
14010
13810
|
chain: { current: $(z) },
|
|
14011
|
-
nodes: { base: baseNode$
|
|
13811
|
+
nodes: { base: baseNode$28 },
|
|
14012
13812
|
plugin,
|
|
14013
13813
|
schema,
|
|
14014
13814
|
symbols: { z }
|
|
@@ -14016,9 +13816,11 @@ function voidToAst$2({ plugin, schema }) {
|
|
|
14016
13816
|
const resolver = plugin.config["~resolvers"]?.void;
|
|
14017
13817
|
return resolver?.(ctx) ?? voidResolver$2(ctx);
|
|
14018
13818
|
}
|
|
14019
|
-
|
|
14020
13819
|
//#endregion
|
|
14021
13820
|
//#region src/plugins/zod/mini/walker.ts
|
|
13821
|
+
function getDefaultValue$2(meta) {
|
|
13822
|
+
return meta.format ? maybeBigInt(meta.default, meta.format) : $.fromValue(meta.default);
|
|
13823
|
+
}
|
|
14022
13824
|
function createVisitor$2(config = {}) {
|
|
14023
13825
|
const { schemaExtractor } = config;
|
|
14024
13826
|
return {
|
|
@@ -14027,12 +13829,12 @@ function createVisitor$2(config = {}) {
|
|
|
14027
13829
|
const z = ctx.plugin.external("zod.z");
|
|
14028
13830
|
let expression = result.expression;
|
|
14029
13831
|
if (result.meta.readonly) expression = $(z).attr(identifiers.readonly).call(expression);
|
|
14030
|
-
const
|
|
13832
|
+
const needsDefault = result.meta.default !== void 0;
|
|
14031
13833
|
const needsNullable = result.meta.nullable;
|
|
14032
13834
|
if (optional && needsNullable) expression = $(z).attr(identifiers.nullish).call(expression);
|
|
14033
13835
|
else if (optional) expression = $(z).attr(identifiers.optional).call(expression);
|
|
14034
13836
|
else if (needsNullable) expression = $(z).attr(identifiers.nullable).call(expression);
|
|
14035
|
-
if (
|
|
13837
|
+
if (needsDefault) expression = $(z).attr(identifiers._default).call(expression, getDefaultValue$2(result.meta));
|
|
14036
13838
|
return { expression };
|
|
14037
13839
|
},
|
|
14038
13840
|
array(schema, ctx, walk) {
|
|
@@ -14104,11 +13906,12 @@ function createVisitor$2(config = {}) {
|
|
|
14104
13906
|
};
|
|
14105
13907
|
},
|
|
14106
13908
|
intersection(items, schemas, parentSchema, ctx) {
|
|
14107
|
-
const z = ctx.plugin.external("zod.z");
|
|
14108
13909
|
const hasAnyLazy = items.some((item) => item.meta.hasLazy);
|
|
14109
|
-
|
|
14110
|
-
|
|
14111
|
-
|
|
13910
|
+
const { expression } = intersectionToAst$2({
|
|
13911
|
+
childResults: items,
|
|
13912
|
+
parentSchema,
|
|
13913
|
+
plugin: ctx.plugin,
|
|
13914
|
+
schemas
|
|
14112
13915
|
});
|
|
14113
13916
|
return {
|
|
14114
13917
|
expression,
|
|
@@ -14262,18 +14065,14 @@ function createVisitor$2(config = {}) {
|
|
|
14262
14065
|
};
|
|
14263
14066
|
},
|
|
14264
14067
|
union(items, schemas, parentSchema, ctx) {
|
|
14265
|
-
const z = ctx.plugin.external("zod.z");
|
|
14266
14068
|
const hasAnyLazy = items.some((item) => item.meta.hasLazy);
|
|
14267
14069
|
const hasNull = schemas.some((s) => s.type === "null") || items.some((i) => i.meta.nullable);
|
|
14268
|
-
const
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14070
|
+
const { expression } = unionToAst$2({
|
|
14071
|
+
childResults: items,
|
|
14072
|
+
parentSchema,
|
|
14073
|
+
plugin: ctx.plugin,
|
|
14074
|
+
schemas
|
|
14272
14075
|
});
|
|
14273
|
-
let expression;
|
|
14274
|
-
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
14275
|
-
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
14276
|
-
else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
14277
14076
|
return {
|
|
14278
14077
|
expression,
|
|
14279
14078
|
meta: {
|
|
@@ -14314,7 +14113,6 @@ function createVisitor$2(config = {}) {
|
|
|
14314
14113
|
}
|
|
14315
14114
|
};
|
|
14316
14115
|
}
|
|
14317
|
-
|
|
14318
14116
|
//#endregion
|
|
14319
14117
|
//#region src/plugins/zod/mini/processor.ts
|
|
14320
14118
|
function createProcessor$2(plugin) {
|
|
@@ -14361,7 +14159,6 @@ function createProcessor$2(plugin) {
|
|
|
14361
14159
|
}
|
|
14362
14160
|
return { process };
|
|
14363
14161
|
}
|
|
14364
|
-
|
|
14365
14162
|
//#endregion
|
|
14366
14163
|
//#region src/plugins/zod/mini/plugin.ts
|
|
14367
14164
|
const handlerMini = ({ plugin }) => {
|
|
@@ -14433,10 +14230,9 @@ const handlerMini = ({ plugin }) => {
|
|
|
14433
14230
|
}
|
|
14434
14231
|
});
|
|
14435
14232
|
};
|
|
14436
|
-
|
|
14437
14233
|
//#endregion
|
|
14438
14234
|
//#region src/plugins/zod/v3/toAst/unknown.ts
|
|
14439
|
-
function baseNode$
|
|
14235
|
+
function baseNode$27(ctx) {
|
|
14440
14236
|
const { symbols } = ctx;
|
|
14441
14237
|
const { z } = symbols;
|
|
14442
14238
|
return $(z).attr(identifiers.unknown).call();
|
|
@@ -14451,7 +14247,7 @@ function unknownToAst$1({ plugin, schema }) {
|
|
|
14451
14247
|
const ctx = {
|
|
14452
14248
|
$,
|
|
14453
14249
|
chain: { current: $(z) },
|
|
14454
|
-
nodes: { base: baseNode$
|
|
14250
|
+
nodes: { base: baseNode$27 },
|
|
14455
14251
|
plugin,
|
|
14456
14252
|
schema,
|
|
14457
14253
|
symbols: { z }
|
|
@@ -14459,10 +14255,9 @@ function unknownToAst$1({ plugin, schema }) {
|
|
|
14459
14255
|
const resolver = plugin.config["~resolvers"]?.unknown;
|
|
14460
14256
|
return resolver?.(ctx) ?? unknownResolver$1(ctx);
|
|
14461
14257
|
}
|
|
14462
|
-
|
|
14463
14258
|
//#endregion
|
|
14464
14259
|
//#region src/plugins/zod/v3/toAst/array.ts
|
|
14465
|
-
function baseNode$
|
|
14260
|
+
function baseNode$26(ctx) {
|
|
14466
14261
|
const { applyModifiers, childResults, plugin, schema, symbols } = ctx;
|
|
14467
14262
|
const { z } = symbols;
|
|
14468
14263
|
const arrayFn = $(z).attr(identifiers.array);
|
|
@@ -14538,7 +14333,7 @@ function arrayToAst$1({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
14538
14333
|
chain: { current: $(z) },
|
|
14539
14334
|
childResults,
|
|
14540
14335
|
nodes: {
|
|
14541
|
-
base: baseNode$
|
|
14336
|
+
base: baseNode$26,
|
|
14542
14337
|
length: lengthNode$3,
|
|
14543
14338
|
maxLength: maxLengthNode$3,
|
|
14544
14339
|
minLength: minLengthNode$3
|
|
@@ -14555,10 +14350,9 @@ function arrayToAst$1({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
14555
14350
|
expression: resolver?.(ctx) ?? arrayResolver$1(ctx)
|
|
14556
14351
|
};
|
|
14557
14352
|
}
|
|
14558
|
-
|
|
14559
14353
|
//#endregion
|
|
14560
14354
|
//#region src/plugins/zod/v3/toAst/boolean.ts
|
|
14561
|
-
function baseNode$
|
|
14355
|
+
function baseNode$25(ctx) {
|
|
14562
14356
|
const { symbols } = ctx;
|
|
14563
14357
|
const { z } = symbols;
|
|
14564
14358
|
return $(z).attr(identifiers.boolean).call();
|
|
@@ -14585,7 +14379,7 @@ function booleanToAst$1({ plugin, schema }) {
|
|
|
14585
14379
|
$,
|
|
14586
14380
|
chain: { current: $(z) },
|
|
14587
14381
|
nodes: {
|
|
14588
|
-
base: baseNode$
|
|
14382
|
+
base: baseNode$25,
|
|
14589
14383
|
const: constNode$7
|
|
14590
14384
|
},
|
|
14591
14385
|
plugin,
|
|
@@ -14595,7 +14389,6 @@ function booleanToAst$1({ plugin, schema }) {
|
|
|
14595
14389
|
const resolver = plugin.config["~resolvers"]?.boolean;
|
|
14596
14390
|
return resolver?.(ctx) ?? booleanResolver$1(ctx);
|
|
14597
14391
|
}
|
|
14598
|
-
|
|
14599
14392
|
//#endregion
|
|
14600
14393
|
//#region src/plugins/zod/v3/toAst/enum.ts
|
|
14601
14394
|
function itemsNode$1(ctx) {
|
|
@@ -14625,7 +14418,7 @@ function itemsNode$1(ctx) {
|
|
|
14625
14418
|
literalMembers
|
|
14626
14419
|
};
|
|
14627
14420
|
}
|
|
14628
|
-
function baseNode$
|
|
14421
|
+
function baseNode$24(ctx) {
|
|
14629
14422
|
const { symbols } = ctx;
|
|
14630
14423
|
const { z } = symbols;
|
|
14631
14424
|
const { allStrings, enumMembers, literalMembers } = ctx.nodes.items(ctx);
|
|
@@ -14646,7 +14439,7 @@ function enumToAst$1({ plugin, schema }) {
|
|
|
14646
14439
|
$,
|
|
14647
14440
|
chain: { current: $(z) },
|
|
14648
14441
|
nodes: {
|
|
14649
|
-
base: baseNode$
|
|
14442
|
+
base: baseNode$24,
|
|
14650
14443
|
items: itemsNode$1
|
|
14651
14444
|
},
|
|
14652
14445
|
plugin,
|
|
@@ -14656,10 +14449,47 @@ function enumToAst$1({ plugin, schema }) {
|
|
|
14656
14449
|
const resolver = plugin.config["~resolvers"]?.enum;
|
|
14657
14450
|
return resolver?.(ctx) ?? enumResolver$1(ctx);
|
|
14658
14451
|
}
|
|
14659
|
-
|
|
14452
|
+
//#endregion
|
|
14453
|
+
//#region src/plugins/zod/v3/toAst/intersection.ts
|
|
14454
|
+
function baseNode$23(ctx) {
|
|
14455
|
+
const { childResults, schemas, symbols } = ctx;
|
|
14456
|
+
const { z } = symbols;
|
|
14457
|
+
if (!childResults.length) return $(z).attr(identifiers.never).call();
|
|
14458
|
+
const firstSchema = schemas[0];
|
|
14459
|
+
if (firstSchema?.logicalOperator === "or" || firstSchema?.type && firstSchema.type !== "object") return $(z).attr(identifiers.intersection).call(...childResults.map((result) => result.expression));
|
|
14460
|
+
let expression = childResults[0].expression;
|
|
14461
|
+
childResults.slice(1).forEach((item) => {
|
|
14462
|
+
expression = expression.attr(identifiers.and).call(item.meta.hasLazy && !item.meta.isLazy ? $(z).attr(identifiers.lazy).call($.func().do(item.expression.return())) : item.expression);
|
|
14463
|
+
});
|
|
14464
|
+
return expression;
|
|
14465
|
+
}
|
|
14466
|
+
function intersectionResolver$1(ctx) {
|
|
14467
|
+
const baseResult = ctx.nodes.base(ctx);
|
|
14468
|
+
ctx.chain.current = baseResult;
|
|
14469
|
+
return ctx.chain.current;
|
|
14470
|
+
}
|
|
14471
|
+
function intersectionToAst$1({ childResults, parentSchema, plugin, schemas }) {
|
|
14472
|
+
const z = plugin.external("zod.z");
|
|
14473
|
+
const ctx = {
|
|
14474
|
+
$,
|
|
14475
|
+
chain: { current: $(z) },
|
|
14476
|
+
childResults,
|
|
14477
|
+
nodes: { base: baseNode$23 },
|
|
14478
|
+
parentSchema,
|
|
14479
|
+
plugin,
|
|
14480
|
+
schema: parentSchema,
|
|
14481
|
+
schemas,
|
|
14482
|
+
symbols: { z }
|
|
14483
|
+
};
|
|
14484
|
+
const resolver = plugin.config["~resolvers"]?.intersection;
|
|
14485
|
+
return {
|
|
14486
|
+
childResults,
|
|
14487
|
+
expression: resolver?.(ctx) ?? intersectionResolver$1(ctx)
|
|
14488
|
+
};
|
|
14489
|
+
}
|
|
14660
14490
|
//#endregion
|
|
14661
14491
|
//#region src/plugins/zod/v3/toAst/never.ts
|
|
14662
|
-
function baseNode$
|
|
14492
|
+
function baseNode$22(ctx) {
|
|
14663
14493
|
const { symbols } = ctx;
|
|
14664
14494
|
const { z } = symbols;
|
|
14665
14495
|
return $(z).attr(identifiers.never).call();
|
|
@@ -14674,7 +14504,7 @@ function neverToAst$1({ plugin, schema }) {
|
|
|
14674
14504
|
const ctx = {
|
|
14675
14505
|
$,
|
|
14676
14506
|
chain: { current: $(z) },
|
|
14677
|
-
nodes: { base: baseNode$
|
|
14507
|
+
nodes: { base: baseNode$22 },
|
|
14678
14508
|
plugin,
|
|
14679
14509
|
schema,
|
|
14680
14510
|
symbols: { z }
|
|
@@ -14682,10 +14512,9 @@ function neverToAst$1({ plugin, schema }) {
|
|
|
14682
14512
|
const resolver = plugin.config["~resolvers"]?.never;
|
|
14683
14513
|
return resolver?.(ctx) ?? neverResolver$1(ctx);
|
|
14684
14514
|
}
|
|
14685
|
-
|
|
14686
14515
|
//#endregion
|
|
14687
14516
|
//#region src/plugins/zod/v3/toAst/null.ts
|
|
14688
|
-
function baseNode$
|
|
14517
|
+
function baseNode$21(ctx) {
|
|
14689
14518
|
const { symbols } = ctx;
|
|
14690
14519
|
const { z } = symbols;
|
|
14691
14520
|
return $(z).attr(identifiers.null).call();
|
|
@@ -14700,7 +14529,7 @@ function nullToAst$1({ plugin, schema }) {
|
|
|
14700
14529
|
const ctx = {
|
|
14701
14530
|
$,
|
|
14702
14531
|
chain: { current: $(z) },
|
|
14703
|
-
nodes: { base: baseNode$
|
|
14532
|
+
nodes: { base: baseNode$21 },
|
|
14704
14533
|
plugin,
|
|
14705
14534
|
schema,
|
|
14706
14535
|
symbols: { z }
|
|
@@ -14708,10 +14537,9 @@ function nullToAst$1({ plugin, schema }) {
|
|
|
14708
14537
|
const resolver = plugin.config["~resolvers"]?.null;
|
|
14709
14538
|
return resolver?.(ctx) ?? nullResolver$1(ctx);
|
|
14710
14539
|
}
|
|
14711
|
-
|
|
14712
14540
|
//#endregion
|
|
14713
14541
|
//#region src/plugins/zod/v3/toAst/number.ts
|
|
14714
|
-
function baseNode$
|
|
14542
|
+
function baseNode$20(ctx) {
|
|
14715
14543
|
const { schema, symbols } = ctx;
|
|
14716
14544
|
const { z } = symbols;
|
|
14717
14545
|
if (ctx.utils.shouldCoerceToBigInt(schema.format)) return $(z).attr(identifiers.coerce).attr(identifiers.bigint).call();
|
|
@@ -14759,7 +14587,7 @@ function numberToNode$1({ plugin, schema }) {
|
|
|
14759
14587
|
$,
|
|
14760
14588
|
chain: { current: $(z) },
|
|
14761
14589
|
nodes: {
|
|
14762
|
-
base: baseNode$
|
|
14590
|
+
base: baseNode$20,
|
|
14763
14591
|
const: constNode$6,
|
|
14764
14592
|
max: maxNode$1,
|
|
14765
14593
|
min: minNode$1
|
|
@@ -14776,7 +14604,6 @@ function numberToNode$1({ plugin, schema }) {
|
|
|
14776
14604
|
const resolver = plugin.config["~resolvers"]?.number;
|
|
14777
14605
|
return resolver?.(ctx) ?? numberResolver$1(ctx);
|
|
14778
14606
|
}
|
|
14779
|
-
|
|
14780
14607
|
//#endregion
|
|
14781
14608
|
//#region src/plugins/zod/v3/toAst/object.ts
|
|
14782
14609
|
function additionalPropertiesNode$1(ctx) {
|
|
@@ -14786,7 +14613,7 @@ function additionalPropertiesNode$1(ctx) {
|
|
|
14786
14613
|
ctx._childResults.push(additionalResult);
|
|
14787
14614
|
return applyModifiers(additionalResult, {}).expression;
|
|
14788
14615
|
}
|
|
14789
|
-
function baseNode$
|
|
14616
|
+
function baseNode$19(ctx) {
|
|
14790
14617
|
const { nodes, symbols } = ctx;
|
|
14791
14618
|
const { z } = symbols;
|
|
14792
14619
|
const additional = nodes.additionalProperties(ctx);
|
|
@@ -14821,7 +14648,7 @@ function objectToAst$1(options) {
|
|
|
14821
14648
|
chain: { current: $(z) },
|
|
14822
14649
|
nodes: {
|
|
14823
14650
|
additionalProperties: additionalPropertiesNode$1,
|
|
14824
|
-
base: baseNode$
|
|
14651
|
+
base: baseNode$19,
|
|
14825
14652
|
shape: shapeNode$1
|
|
14826
14653
|
},
|
|
14827
14654
|
plugin,
|
|
@@ -14836,10 +14663,9 @@ function objectToAst$1(options) {
|
|
|
14836
14663
|
expression: resolver?.(ctx) ?? objectResolver$1(ctx)
|
|
14837
14664
|
};
|
|
14838
14665
|
}
|
|
14839
|
-
|
|
14840
14666
|
//#endregion
|
|
14841
14667
|
//#region src/plugins/zod/v3/toAst/string.ts
|
|
14842
|
-
function baseNode$
|
|
14668
|
+
function baseNode$18(ctx) {
|
|
14843
14669
|
const { z } = ctx.symbols;
|
|
14844
14670
|
return $(z).attr(identifiers.string).call();
|
|
14845
14671
|
}
|
|
@@ -14914,7 +14740,7 @@ function stringToNode$1({ plugin, schema }) {
|
|
|
14914
14740
|
$,
|
|
14915
14741
|
chain: { current: $(z) },
|
|
14916
14742
|
nodes: {
|
|
14917
|
-
base: baseNode$
|
|
14743
|
+
base: baseNode$18,
|
|
14918
14744
|
const: constNode$5,
|
|
14919
14745
|
format: formatNode$1,
|
|
14920
14746
|
length: lengthNode$2,
|
|
@@ -14929,10 +14755,9 @@ function stringToNode$1({ plugin, schema }) {
|
|
|
14929
14755
|
const resolver = plugin.config["~resolvers"]?.string;
|
|
14930
14756
|
return resolver?.(ctx) ?? stringResolver$1(ctx);
|
|
14931
14757
|
}
|
|
14932
|
-
|
|
14933
14758
|
//#endregion
|
|
14934
14759
|
//#region src/plugins/zod/v3/toAst/tuple.ts
|
|
14935
|
-
function baseNode$
|
|
14760
|
+
function baseNode$17(ctx) {
|
|
14936
14761
|
const { applyModifiers, childResults, symbols } = ctx;
|
|
14937
14762
|
const { z } = symbols;
|
|
14938
14763
|
const tupleFn = $(z).attr(identifiers.tuple);
|
|
@@ -14970,7 +14795,7 @@ function tupleToAst$1({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
14970
14795
|
chain: { current: $(z) },
|
|
14971
14796
|
childResults,
|
|
14972
14797
|
nodes: {
|
|
14973
|
-
base: baseNode$
|
|
14798
|
+
base: baseNode$17,
|
|
14974
14799
|
const: constNode$4
|
|
14975
14800
|
},
|
|
14976
14801
|
plugin,
|
|
@@ -14985,10 +14810,9 @@ function tupleToAst$1({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
14985
14810
|
expression: resolver?.(ctx) ?? tupleResolver$1(ctx)
|
|
14986
14811
|
};
|
|
14987
14812
|
}
|
|
14988
|
-
|
|
14989
14813
|
//#endregion
|
|
14990
14814
|
//#region src/plugins/zod/v3/toAst/undefined.ts
|
|
14991
|
-
function baseNode$
|
|
14815
|
+
function baseNode$16(ctx) {
|
|
14992
14816
|
const { symbols } = ctx;
|
|
14993
14817
|
const { z } = symbols;
|
|
14994
14818
|
return $(z).attr(identifiers.undefined).call();
|
|
@@ -15003,7 +14827,7 @@ function undefinedToAst$1({ plugin, schema }) {
|
|
|
15003
14827
|
const ctx = {
|
|
15004
14828
|
$,
|
|
15005
14829
|
chain: { current: $(z) },
|
|
15006
|
-
nodes: { base: baseNode$
|
|
14830
|
+
nodes: { base: baseNode$16 },
|
|
15007
14831
|
plugin,
|
|
15008
14832
|
schema,
|
|
15009
14833
|
symbols: { z }
|
|
@@ -15011,10 +14835,58 @@ function undefinedToAst$1({ plugin, schema }) {
|
|
|
15011
14835
|
const resolver = plugin.config["~resolvers"]?.undefined;
|
|
15012
14836
|
return resolver?.(ctx) ?? undefinedResolver$1(ctx);
|
|
15013
14837
|
}
|
|
15014
|
-
|
|
14838
|
+
//#endregion
|
|
14839
|
+
//#region src/plugins/zod/v3/toAst/union.ts
|
|
14840
|
+
function baseNode$15(ctx) {
|
|
14841
|
+
const { childResults, parentSchema, plugin, schemas, symbols } = ctx;
|
|
14842
|
+
const { z } = symbols;
|
|
14843
|
+
if (!childResults.length) return $(z).attr(identifiers.null).call();
|
|
14844
|
+
const nonNullItems = [];
|
|
14845
|
+
childResults.forEach((result, index) => {
|
|
14846
|
+
const schema = schemas[index];
|
|
14847
|
+
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(result);
|
|
14848
|
+
});
|
|
14849
|
+
if (!nonNullItems.length) return $(z).attr(identifiers.null).call();
|
|
14850
|
+
if (nonNullItems.length === 1) return nonNullItems[0].expression;
|
|
14851
|
+
const discriminatedExpression = tryBuildDiscriminatedUnion({
|
|
14852
|
+
items: childResults,
|
|
14853
|
+
parentSchema,
|
|
14854
|
+
plugin,
|
|
14855
|
+
schemas
|
|
14856
|
+
});
|
|
14857
|
+
if (discriminatedExpression) {
|
|
14858
|
+
const unionMembers = discriminatedExpression.members.map((member) => member.refExpression.attr(identifiers.extend).call($.object().prop(discriminatedExpression.discriminatorKey, $(z).attr(identifiers.literal).call($.fromValue(member.discriminatedValue)))));
|
|
14859
|
+
return $(z).attr(identifiers.discriminatedUnion).call($.literal(discriminatedExpression.discriminatorKey), $.array().pretty().elements(...unionMembers));
|
|
14860
|
+
}
|
|
14861
|
+
return $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
14862
|
+
}
|
|
14863
|
+
function unionResolver$1(ctx) {
|
|
14864
|
+
const baseResult = ctx.nodes.base(ctx);
|
|
14865
|
+
ctx.chain.current = baseResult;
|
|
14866
|
+
return ctx.chain.current;
|
|
14867
|
+
}
|
|
14868
|
+
function unionToAst$1({ childResults, parentSchema, plugin, schemas }) {
|
|
14869
|
+
const z = plugin.external("zod.z");
|
|
14870
|
+
const ctx = {
|
|
14871
|
+
$,
|
|
14872
|
+
chain: { current: $(z) },
|
|
14873
|
+
childResults,
|
|
14874
|
+
nodes: { base: baseNode$15 },
|
|
14875
|
+
parentSchema,
|
|
14876
|
+
plugin,
|
|
14877
|
+
schema: parentSchema,
|
|
14878
|
+
schemas,
|
|
14879
|
+
symbols: { z }
|
|
14880
|
+
};
|
|
14881
|
+
const resolver = plugin.config["~resolvers"]?.union;
|
|
14882
|
+
return {
|
|
14883
|
+
childResults,
|
|
14884
|
+
expression: resolver?.(ctx) ?? unionResolver$1(ctx)
|
|
14885
|
+
};
|
|
14886
|
+
}
|
|
15015
14887
|
//#endregion
|
|
15016
14888
|
//#region src/plugins/zod/v3/toAst/void.ts
|
|
15017
|
-
function baseNode$
|
|
14889
|
+
function baseNode$14(ctx) {
|
|
15018
14890
|
const { symbols } = ctx;
|
|
15019
14891
|
const { z } = symbols;
|
|
15020
14892
|
return $(z).attr(identifiers.void).call();
|
|
@@ -15029,7 +14901,7 @@ function voidToAst$1({ plugin, schema }) {
|
|
|
15029
14901
|
const ctx = {
|
|
15030
14902
|
$,
|
|
15031
14903
|
chain: { current: $(z) },
|
|
15032
|
-
nodes: { base: baseNode$
|
|
14904
|
+
nodes: { base: baseNode$14 },
|
|
15033
14905
|
plugin,
|
|
15034
14906
|
schema,
|
|
15035
14907
|
symbols: { z }
|
|
@@ -15037,9 +14909,11 @@ function voidToAst$1({ plugin, schema }) {
|
|
|
15037
14909
|
const resolver = plugin.config["~resolvers"]?.void;
|
|
15038
14910
|
return resolver?.(ctx) ?? voidResolver$1(ctx);
|
|
15039
14911
|
}
|
|
15040
|
-
|
|
15041
14912
|
//#endregion
|
|
15042
14913
|
//#region src/plugins/zod/v3/walker.ts
|
|
14914
|
+
function getDefaultValue$1(meta) {
|
|
14915
|
+
return meta.format ? maybeBigInt(meta.default, meta.format) : $.fromValue(meta.default);
|
|
14916
|
+
}
|
|
15043
14917
|
function createVisitor$1(config = {}) {
|
|
15044
14918
|
const { schemaExtractor } = config;
|
|
15045
14919
|
return {
|
|
@@ -15047,12 +14921,12 @@ function createVisitor$1(config = {}) {
|
|
|
15047
14921
|
const { optional } = options;
|
|
15048
14922
|
let expression = result.expression;
|
|
15049
14923
|
if (result.meta.readonly) expression = expression.attr(identifiers.readonly).call();
|
|
15050
|
-
const
|
|
14924
|
+
const needsDefault = result.meta.default !== void 0;
|
|
15051
14925
|
const needsNullable = result.meta.nullable;
|
|
15052
14926
|
if (optional && needsNullable) expression = expression.attr(identifiers.nullish).call();
|
|
15053
14927
|
else if (optional) expression = expression.attr(identifiers.optional).call();
|
|
15054
14928
|
else if (needsNullable) expression = expression.attr(identifiers.nullable).call();
|
|
15055
|
-
if (
|
|
14929
|
+
if (needsDefault) expression = expression.attr(identifiers.default).call(getDefaultValue$1(result.meta));
|
|
15056
14930
|
return {
|
|
15057
14931
|
expression,
|
|
15058
14932
|
typeName: result.meta.hasLazy ? result.meta.isObject ? identifiers.AnyZodObject : identifiers.ZodTypeAny : void 0
|
|
@@ -15127,17 +15001,13 @@ function createVisitor$1(config = {}) {
|
|
|
15127
15001
|
};
|
|
15128
15002
|
},
|
|
15129
15003
|
intersection(items, schemas, parentSchema, ctx) {
|
|
15130
|
-
const z = ctx.plugin.external("zod.z");
|
|
15131
15004
|
const hasAnyLazy = items.some((item) => item.meta.hasLazy);
|
|
15132
|
-
const
|
|
15133
|
-
|
|
15134
|
-
|
|
15135
|
-
|
|
15136
|
-
|
|
15137
|
-
|
|
15138
|
-
expression = expression.attr(identifiers.and).call(item.meta.hasLazy && !item.meta.isLazy ? $(z).attr(identifiers.lazy).call($.func().do(item.expression.return())) : item.expression);
|
|
15139
|
-
});
|
|
15140
|
-
}
|
|
15005
|
+
const { expression } = intersectionToAst$1({
|
|
15006
|
+
childResults: items,
|
|
15007
|
+
parentSchema,
|
|
15008
|
+
plugin: ctx.plugin,
|
|
15009
|
+
schemas
|
|
15010
|
+
});
|
|
15141
15011
|
return {
|
|
15142
15012
|
expression,
|
|
15143
15013
|
meta: {
|
|
@@ -15281,18 +15151,14 @@ function createVisitor$1(config = {}) {
|
|
|
15281
15151
|
};
|
|
15282
15152
|
},
|
|
15283
15153
|
union(items, schemas, parentSchema, ctx) {
|
|
15284
|
-
const z = ctx.plugin.external("zod.z");
|
|
15285
15154
|
const hasAnyLazy = items.some((item) => item.meta.hasLazy);
|
|
15286
15155
|
const hasNull = schemas.some((s) => s.type === "null") || items.some((i) => i.meta.nullable);
|
|
15287
|
-
const
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
|
|
15156
|
+
const { expression } = unionToAst$1({
|
|
15157
|
+
childResults: items,
|
|
15158
|
+
parentSchema,
|
|
15159
|
+
plugin: ctx.plugin,
|
|
15160
|
+
schemas
|
|
15291
15161
|
});
|
|
15292
|
-
let expression;
|
|
15293
|
-
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
15294
|
-
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
15295
|
-
else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
15296
15162
|
return {
|
|
15297
15163
|
expression,
|
|
15298
15164
|
meta: {
|
|
@@ -15333,7 +15199,6 @@ function createVisitor$1(config = {}) {
|
|
|
15333
15199
|
}
|
|
15334
15200
|
};
|
|
15335
15201
|
}
|
|
15336
|
-
|
|
15337
15202
|
//#endregion
|
|
15338
15203
|
//#region src/plugins/zod/v3/processor.ts
|
|
15339
15204
|
function createProcessor$1(plugin) {
|
|
@@ -15380,7 +15245,6 @@ function createProcessor$1(plugin) {
|
|
|
15380
15245
|
}
|
|
15381
15246
|
return { process };
|
|
15382
15247
|
}
|
|
15383
|
-
|
|
15384
15248
|
//#endregion
|
|
15385
15249
|
//#region src/plugins/zod/v3/plugin.ts
|
|
15386
15250
|
const handlerV3 = ({ plugin }) => {
|
|
@@ -15451,10 +15315,9 @@ const handlerV3 = ({ plugin }) => {
|
|
|
15451
15315
|
}
|
|
15452
15316
|
});
|
|
15453
15317
|
};
|
|
15454
|
-
|
|
15455
15318
|
//#endregion
|
|
15456
15319
|
//#region src/plugins/zod/v4/toAst/unknown.ts
|
|
15457
|
-
function baseNode$
|
|
15320
|
+
function baseNode$13(ctx) {
|
|
15458
15321
|
const { symbols } = ctx;
|
|
15459
15322
|
const { z } = symbols;
|
|
15460
15323
|
return $(z).attr(identifiers.unknown).call();
|
|
@@ -15469,7 +15332,7 @@ function unknownToAst({ plugin, schema }) {
|
|
|
15469
15332
|
const ctx = {
|
|
15470
15333
|
$,
|
|
15471
15334
|
chain: { current: $(z) },
|
|
15472
|
-
nodes: { base: baseNode$
|
|
15335
|
+
nodes: { base: baseNode$13 },
|
|
15473
15336
|
plugin,
|
|
15474
15337
|
schema,
|
|
15475
15338
|
symbols: { z }
|
|
@@ -15477,10 +15340,9 @@ function unknownToAst({ plugin, schema }) {
|
|
|
15477
15340
|
const resolver = plugin.config["~resolvers"]?.unknown;
|
|
15478
15341
|
return resolver?.(ctx) ?? unknownResolver(ctx);
|
|
15479
15342
|
}
|
|
15480
|
-
|
|
15481
15343
|
//#endregion
|
|
15482
15344
|
//#region src/plugins/zod/v4/toAst/array.ts
|
|
15483
|
-
function baseNode$
|
|
15345
|
+
function baseNode$12(ctx) {
|
|
15484
15346
|
const { applyModifiers, childResults, plugin, schema, symbols } = ctx;
|
|
15485
15347
|
const { z } = symbols;
|
|
15486
15348
|
const arrayFn = $(z).attr(identifiers.array);
|
|
@@ -15556,7 +15418,7 @@ function arrayToAst({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
15556
15418
|
chain: { current: $(z) },
|
|
15557
15419
|
childResults,
|
|
15558
15420
|
nodes: {
|
|
15559
|
-
base: baseNode$
|
|
15421
|
+
base: baseNode$12,
|
|
15560
15422
|
length: lengthNode$1,
|
|
15561
15423
|
maxLength: maxLengthNode$1,
|
|
15562
15424
|
minLength: minLengthNode$1
|
|
@@ -15573,10 +15435,9 @@ function arrayToAst({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
15573
15435
|
expression: resolver?.(ctx) ?? arrayResolver(ctx)
|
|
15574
15436
|
};
|
|
15575
15437
|
}
|
|
15576
|
-
|
|
15577
15438
|
//#endregion
|
|
15578
15439
|
//#region src/plugins/zod/v4/toAst/boolean.ts
|
|
15579
|
-
function baseNode$
|
|
15440
|
+
function baseNode$11(ctx) {
|
|
15580
15441
|
const { symbols } = ctx;
|
|
15581
15442
|
const { z } = symbols;
|
|
15582
15443
|
return $(z).attr(identifiers.boolean).call();
|
|
@@ -15603,7 +15464,7 @@ function booleanToAst({ plugin, schema }) {
|
|
|
15603
15464
|
$,
|
|
15604
15465
|
chain: { current: $(z) },
|
|
15605
15466
|
nodes: {
|
|
15606
|
-
base: baseNode$
|
|
15467
|
+
base: baseNode$11,
|
|
15607
15468
|
const: constNode$3
|
|
15608
15469
|
},
|
|
15609
15470
|
plugin,
|
|
@@ -15613,7 +15474,6 @@ function booleanToAst({ plugin, schema }) {
|
|
|
15613
15474
|
const resolver = plugin.config["~resolvers"]?.boolean;
|
|
15614
15475
|
return resolver?.(ctx) ?? booleanResolver(ctx);
|
|
15615
15476
|
}
|
|
15616
|
-
|
|
15617
15477
|
//#endregion
|
|
15618
15478
|
//#region src/plugins/zod/v4/toAst/enum.ts
|
|
15619
15479
|
function itemsNode(ctx) {
|
|
@@ -15643,7 +15503,7 @@ function itemsNode(ctx) {
|
|
|
15643
15503
|
literalMembers
|
|
15644
15504
|
};
|
|
15645
15505
|
}
|
|
15646
|
-
function baseNode$
|
|
15506
|
+
function baseNode$10(ctx) {
|
|
15647
15507
|
const { symbols } = ctx;
|
|
15648
15508
|
const { z } = symbols;
|
|
15649
15509
|
const { allStrings, enumMembers, literalMembers } = ctx.nodes.items(ctx);
|
|
@@ -15664,7 +15524,7 @@ function enumToAst({ plugin, schema }) {
|
|
|
15664
15524
|
$,
|
|
15665
15525
|
chain: { current: $(z) },
|
|
15666
15526
|
nodes: {
|
|
15667
|
-
base: baseNode$
|
|
15527
|
+
base: baseNode$10,
|
|
15668
15528
|
items: itemsNode
|
|
15669
15529
|
},
|
|
15670
15530
|
plugin,
|
|
@@ -15679,10 +15539,47 @@ function enumToAst({ plugin, schema }) {
|
|
|
15679
15539
|
const resolver = plugin.config["~resolvers"]?.enum;
|
|
15680
15540
|
return resolver?.(ctx) ?? enumResolver(ctx);
|
|
15681
15541
|
}
|
|
15682
|
-
|
|
15542
|
+
//#endregion
|
|
15543
|
+
//#region src/plugins/zod/v4/toAst/intersection.ts
|
|
15544
|
+
function baseNode$9(ctx) {
|
|
15545
|
+
const { childResults, schemas, symbols } = ctx;
|
|
15546
|
+
const { z } = symbols;
|
|
15547
|
+
if (!childResults.length) return $(z).attr(identifiers.never).call();
|
|
15548
|
+
const firstSchema = schemas[0];
|
|
15549
|
+
if (firstSchema?.logicalOperator === "or" || firstSchema?.type && firstSchema.type !== "object") return $(z).attr(identifiers.intersection).call(...childResults.map((result) => result.expression));
|
|
15550
|
+
let expression = childResults[0].expression;
|
|
15551
|
+
childResults.slice(1).forEach((item) => {
|
|
15552
|
+
expression = expression.attr(identifiers.and).call(item.meta.hasLazy ? $(z).attr(identifiers.lazy).call($.func().do(item.expression.return())) : item.expression);
|
|
15553
|
+
});
|
|
15554
|
+
return expression;
|
|
15555
|
+
}
|
|
15556
|
+
function intersectionResolver(ctx) {
|
|
15557
|
+
const baseResult = ctx.nodes.base(ctx);
|
|
15558
|
+
ctx.chain.current = baseResult;
|
|
15559
|
+
return ctx.chain.current;
|
|
15560
|
+
}
|
|
15561
|
+
function intersectionToAst({ childResults, parentSchema, plugin, schemas }) {
|
|
15562
|
+
const z = plugin.external("zod.z");
|
|
15563
|
+
const ctx = {
|
|
15564
|
+
$,
|
|
15565
|
+
chain: { current: $(z) },
|
|
15566
|
+
childResults,
|
|
15567
|
+
nodes: { base: baseNode$9 },
|
|
15568
|
+
parentSchema,
|
|
15569
|
+
plugin,
|
|
15570
|
+
schema: parentSchema,
|
|
15571
|
+
schemas,
|
|
15572
|
+
symbols: { z }
|
|
15573
|
+
};
|
|
15574
|
+
const resolver = plugin.config["~resolvers"]?.intersection;
|
|
15575
|
+
return {
|
|
15576
|
+
childResults,
|
|
15577
|
+
expression: resolver?.(ctx) ?? intersectionResolver(ctx)
|
|
15578
|
+
};
|
|
15579
|
+
}
|
|
15683
15580
|
//#endregion
|
|
15684
15581
|
//#region src/plugins/zod/v4/toAst/never.ts
|
|
15685
|
-
function baseNode$
|
|
15582
|
+
function baseNode$8(ctx) {
|
|
15686
15583
|
const { symbols } = ctx;
|
|
15687
15584
|
const { z } = symbols;
|
|
15688
15585
|
return $(z).attr(identifiers.never).call();
|
|
@@ -15697,7 +15594,7 @@ function neverToAst({ plugin, schema }) {
|
|
|
15697
15594
|
const ctx = {
|
|
15698
15595
|
$,
|
|
15699
15596
|
chain: { current: $(z) },
|
|
15700
|
-
nodes: { base: baseNode$
|
|
15597
|
+
nodes: { base: baseNode$8 },
|
|
15701
15598
|
plugin,
|
|
15702
15599
|
schema,
|
|
15703
15600
|
symbols: { z }
|
|
@@ -15705,10 +15602,9 @@ function neverToAst({ plugin, schema }) {
|
|
|
15705
15602
|
const resolver = plugin.config["~resolvers"]?.never;
|
|
15706
15603
|
return resolver?.(ctx) ?? neverResolver(ctx);
|
|
15707
15604
|
}
|
|
15708
|
-
|
|
15709
15605
|
//#endregion
|
|
15710
15606
|
//#region src/plugins/zod/v4/toAst/null.ts
|
|
15711
|
-
function baseNode$
|
|
15607
|
+
function baseNode$7(ctx) {
|
|
15712
15608
|
const { symbols } = ctx;
|
|
15713
15609
|
const { z } = symbols;
|
|
15714
15610
|
return $(z).attr(identifiers.null).call();
|
|
@@ -15723,7 +15619,7 @@ function nullToAst({ plugin, schema }) {
|
|
|
15723
15619
|
const ctx = {
|
|
15724
15620
|
$,
|
|
15725
15621
|
chain: { current: $(z) },
|
|
15726
|
-
nodes: { base: baseNode$
|
|
15622
|
+
nodes: { base: baseNode$7 },
|
|
15727
15623
|
plugin,
|
|
15728
15624
|
schema,
|
|
15729
15625
|
symbols: { z }
|
|
@@ -15731,10 +15627,9 @@ function nullToAst({ plugin, schema }) {
|
|
|
15731
15627
|
const resolver = plugin.config["~resolvers"]?.null;
|
|
15732
15628
|
return resolver?.(ctx) ?? nullResolver(ctx);
|
|
15733
15629
|
}
|
|
15734
|
-
|
|
15735
15630
|
//#endregion
|
|
15736
15631
|
//#region src/plugins/zod/v4/toAst/number.ts
|
|
15737
|
-
function baseNode$
|
|
15632
|
+
function baseNode$6(ctx) {
|
|
15738
15633
|
const { schema, symbols } = ctx;
|
|
15739
15634
|
const { z } = symbols;
|
|
15740
15635
|
if (ctx.utils.shouldCoerceToBigInt(schema.format)) return $(z).attr(identifiers.coerce).attr(identifiers.bigint).call();
|
|
@@ -15782,7 +15677,7 @@ function numberToNode({ plugin, schema }) {
|
|
|
15782
15677
|
$,
|
|
15783
15678
|
chain: { current: $(z) },
|
|
15784
15679
|
nodes: {
|
|
15785
|
-
base: baseNode$
|
|
15680
|
+
base: baseNode$6,
|
|
15786
15681
|
const: constNode$2,
|
|
15787
15682
|
max: maxNode,
|
|
15788
15683
|
min: minNode
|
|
@@ -15799,7 +15694,6 @@ function numberToNode({ plugin, schema }) {
|
|
|
15799
15694
|
const resolver = plugin.config["~resolvers"]?.number;
|
|
15800
15695
|
return resolver?.(ctx) ?? numberResolver(ctx);
|
|
15801
15696
|
}
|
|
15802
|
-
|
|
15803
15697
|
//#endregion
|
|
15804
15698
|
//#region src/plugins/zod/v4/toAst/object.ts
|
|
15805
15699
|
function additionalPropertiesNode(ctx) {
|
|
@@ -15809,7 +15703,7 @@ function additionalPropertiesNode(ctx) {
|
|
|
15809
15703
|
_childResults.push(additionalResult);
|
|
15810
15704
|
return applyModifiers(additionalResult, {}).expression;
|
|
15811
15705
|
}
|
|
15812
|
-
function baseNode$
|
|
15706
|
+
function baseNode$5(ctx) {
|
|
15813
15707
|
const { nodes, symbols } = ctx;
|
|
15814
15708
|
const { z } = symbols;
|
|
15815
15709
|
const additional = nodes.additionalProperties(ctx);
|
|
@@ -15844,7 +15738,7 @@ function objectToAst(options) {
|
|
|
15844
15738
|
chain: { current: $(z) },
|
|
15845
15739
|
nodes: {
|
|
15846
15740
|
additionalProperties: additionalPropertiesNode,
|
|
15847
|
-
base: baseNode$
|
|
15741
|
+
base: baseNode$5,
|
|
15848
15742
|
shape: shapeNode
|
|
15849
15743
|
},
|
|
15850
15744
|
plugin,
|
|
@@ -15859,10 +15753,9 @@ function objectToAst(options) {
|
|
|
15859
15753
|
expression: resolver?.(ctx) ?? objectResolver(ctx)
|
|
15860
15754
|
};
|
|
15861
15755
|
}
|
|
15862
|
-
|
|
15863
15756
|
//#endregion
|
|
15864
15757
|
//#region src/plugins/zod/v4/toAst/string.ts
|
|
15865
|
-
function baseNode$
|
|
15758
|
+
function baseNode$4(ctx) {
|
|
15866
15759
|
const { z } = ctx.symbols;
|
|
15867
15760
|
return $(z).attr(identifiers.string).call();
|
|
15868
15761
|
}
|
|
@@ -15939,7 +15832,7 @@ function stringToNode({ plugin, schema }) {
|
|
|
15939
15832
|
$,
|
|
15940
15833
|
chain: { current: $(z) },
|
|
15941
15834
|
nodes: {
|
|
15942
|
-
base: baseNode$
|
|
15835
|
+
base: baseNode$4,
|
|
15943
15836
|
const: constNode$1,
|
|
15944
15837
|
format: formatNode,
|
|
15945
15838
|
length: lengthNode,
|
|
@@ -15954,10 +15847,9 @@ function stringToNode({ plugin, schema }) {
|
|
|
15954
15847
|
const resolver = plugin.config["~resolvers"]?.string;
|
|
15955
15848
|
return resolver?.(ctx) ?? stringResolver(ctx);
|
|
15956
15849
|
}
|
|
15957
|
-
|
|
15958
15850
|
//#endregion
|
|
15959
15851
|
//#region src/plugins/zod/v4/toAst/tuple.ts
|
|
15960
|
-
function baseNode$
|
|
15852
|
+
function baseNode$3(ctx) {
|
|
15961
15853
|
const { applyModifiers, childResults, symbols } = ctx;
|
|
15962
15854
|
const { z } = symbols;
|
|
15963
15855
|
const tupleFn = $(z).attr(identifiers.tuple);
|
|
@@ -15995,7 +15887,7 @@ function tupleToAst({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
15995
15887
|
chain: { current: $(z) },
|
|
15996
15888
|
childResults,
|
|
15997
15889
|
nodes: {
|
|
15998
|
-
base: baseNode$
|
|
15890
|
+
base: baseNode$3,
|
|
15999
15891
|
const: constNode
|
|
16000
15892
|
},
|
|
16001
15893
|
plugin,
|
|
@@ -16010,10 +15902,9 @@ function tupleToAst({ applyModifiers, plugin, schema, walk, walkerCtx }) {
|
|
|
16010
15902
|
expression: resolver?.(ctx) ?? tupleResolver(ctx)
|
|
16011
15903
|
};
|
|
16012
15904
|
}
|
|
16013
|
-
|
|
16014
15905
|
//#endregion
|
|
16015
15906
|
//#region src/plugins/zod/v4/toAst/undefined.ts
|
|
16016
|
-
function baseNode$
|
|
15907
|
+
function baseNode$2(ctx) {
|
|
16017
15908
|
const { symbols } = ctx;
|
|
16018
15909
|
const { z } = symbols;
|
|
16019
15910
|
return $(z).attr(identifiers.undefined).call();
|
|
@@ -16028,7 +15919,7 @@ function undefinedToAst({ plugin, schema }) {
|
|
|
16028
15919
|
const ctx = {
|
|
16029
15920
|
$,
|
|
16030
15921
|
chain: { current: $(z) },
|
|
16031
|
-
nodes: { base: baseNode$
|
|
15922
|
+
nodes: { base: baseNode$2 },
|
|
16032
15923
|
plugin,
|
|
16033
15924
|
schema,
|
|
16034
15925
|
symbols: { z }
|
|
@@ -16036,7 +15927,58 @@ function undefinedToAst({ plugin, schema }) {
|
|
|
16036
15927
|
const resolver = plugin.config["~resolvers"]?.undefined;
|
|
16037
15928
|
return resolver?.(ctx) ?? undefinedResolver(ctx);
|
|
16038
15929
|
}
|
|
16039
|
-
|
|
15930
|
+
//#endregion
|
|
15931
|
+
//#region src/plugins/zod/v4/toAst/union.ts
|
|
15932
|
+
function baseNode$1(ctx) {
|
|
15933
|
+
const { childResults, parentSchema, plugin, schemas, symbols } = ctx;
|
|
15934
|
+
const { z } = symbols;
|
|
15935
|
+
if (!childResults.length) return $(z).attr(identifiers.null).call();
|
|
15936
|
+
const nonNullItems = [];
|
|
15937
|
+
childResults.forEach((result, index) => {
|
|
15938
|
+
const schema = schemas[index];
|
|
15939
|
+
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(result);
|
|
15940
|
+
});
|
|
15941
|
+
let expression;
|
|
15942
|
+
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
15943
|
+
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
15944
|
+
else {
|
|
15945
|
+
const discriminatedExpression = tryBuildDiscriminatedUnion({
|
|
15946
|
+
items: childResults,
|
|
15947
|
+
parentSchema,
|
|
15948
|
+
plugin,
|
|
15949
|
+
schemas
|
|
15950
|
+
});
|
|
15951
|
+
if (discriminatedExpression) {
|
|
15952
|
+
const unionMembers = discriminatedExpression.members.map((member) => member.refExpression.attr(identifiers.extend).call($.object().prop(discriminatedExpression.discriminatorKey, $(z).attr(identifiers.literal).call($.fromValue(member.discriminatedValue)))));
|
|
15953
|
+
expression = $(z).attr(identifiers.discriminatedUnion).call($.literal(discriminatedExpression.discriminatorKey), $.array().pretty().elements(...unionMembers));
|
|
15954
|
+
} else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
15955
|
+
}
|
|
15956
|
+
return expression;
|
|
15957
|
+
}
|
|
15958
|
+
function unionResolver(ctx) {
|
|
15959
|
+
const baseResult = ctx.nodes.base(ctx);
|
|
15960
|
+
ctx.chain.current = baseResult;
|
|
15961
|
+
return ctx.chain.current;
|
|
15962
|
+
}
|
|
15963
|
+
function unionToAst({ childResults, parentSchema, plugin, schemas }) {
|
|
15964
|
+
const z = plugin.external("zod.z");
|
|
15965
|
+
const ctx = {
|
|
15966
|
+
$,
|
|
15967
|
+
chain: { current: $(z) },
|
|
15968
|
+
childResults,
|
|
15969
|
+
nodes: { base: baseNode$1 },
|
|
15970
|
+
parentSchema,
|
|
15971
|
+
plugin,
|
|
15972
|
+
schema: parentSchema,
|
|
15973
|
+
schemas,
|
|
15974
|
+
symbols: { z }
|
|
15975
|
+
};
|
|
15976
|
+
const resolver = plugin.config["~resolvers"]?.union;
|
|
15977
|
+
return {
|
|
15978
|
+
childResults,
|
|
15979
|
+
expression: resolver?.(ctx) ?? unionResolver(ctx)
|
|
15980
|
+
};
|
|
15981
|
+
}
|
|
16040
15982
|
//#endregion
|
|
16041
15983
|
//#region src/plugins/zod/v4/toAst/void.ts
|
|
16042
15984
|
function baseNode(ctx) {
|
|
@@ -16062,9 +16004,11 @@ function voidToAst({ plugin, schema }) {
|
|
|
16062
16004
|
const resolver = plugin.config["~resolvers"]?.void;
|
|
16063
16005
|
return resolver?.(ctx) ?? voidResolver(ctx);
|
|
16064
16006
|
}
|
|
16065
|
-
|
|
16066
16007
|
//#endregion
|
|
16067
16008
|
//#region src/plugins/zod/v4/walker.ts
|
|
16009
|
+
function getDefaultValue(meta) {
|
|
16010
|
+
return meta.format ? maybeBigInt(meta.default, meta.format) : $.fromValue(meta.default);
|
|
16011
|
+
}
|
|
16068
16012
|
function createVisitor(config = {}) {
|
|
16069
16013
|
const { schemaExtractor } = config;
|
|
16070
16014
|
return {
|
|
@@ -16072,12 +16016,12 @@ function createVisitor(config = {}) {
|
|
|
16072
16016
|
const { optional } = options;
|
|
16073
16017
|
let expression = result.expression;
|
|
16074
16018
|
if (result.meta.readonly) expression = expression.attr(identifiers.readonly).call();
|
|
16075
|
-
const
|
|
16019
|
+
const needsDefault = result.meta.default !== void 0;
|
|
16076
16020
|
const needsNullable = result.meta.nullable;
|
|
16077
16021
|
if (optional && needsNullable) expression = expression.attr(identifiers.nullish).call();
|
|
16078
16022
|
else if (optional) expression = expression.attr(identifiers.optional).call();
|
|
16079
16023
|
else if (needsNullable) expression = expression.attr(identifiers.nullable).call();
|
|
16080
|
-
if (
|
|
16024
|
+
if (needsDefault) expression = expression.attr(identifiers.default).call(getDefaultValue(result.meta));
|
|
16081
16025
|
return { expression };
|
|
16082
16026
|
},
|
|
16083
16027
|
array(schema, ctx, walk) {
|
|
@@ -16149,17 +16093,13 @@ function createVisitor(config = {}) {
|
|
|
16149
16093
|
};
|
|
16150
16094
|
},
|
|
16151
16095
|
intersection(items, schemas, parentSchema, ctx) {
|
|
16152
|
-
const z = ctx.plugin.external("zod.z");
|
|
16153
16096
|
const hasAnyLazy = items.some((item) => item.meta.hasLazy);
|
|
16154
|
-
const
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
expression = expression.attr(identifiers.and).call(item.meta.hasLazy ? $(z).attr(identifiers.lazy).call($.func().do(item.expression.return())) : item.expression);
|
|
16161
|
-
});
|
|
16162
|
-
}
|
|
16097
|
+
const { expression } = intersectionToAst({
|
|
16098
|
+
childResults: items,
|
|
16099
|
+
parentSchema,
|
|
16100
|
+
plugin: ctx.plugin,
|
|
16101
|
+
schemas
|
|
16102
|
+
});
|
|
16163
16103
|
return {
|
|
16164
16104
|
expression,
|
|
16165
16105
|
meta: {
|
|
@@ -16312,18 +16252,14 @@ function createVisitor(config = {}) {
|
|
|
16312
16252
|
};
|
|
16313
16253
|
},
|
|
16314
16254
|
union(items, schemas, parentSchema, ctx) {
|
|
16315
|
-
const z = ctx.plugin.external("zod.z");
|
|
16316
16255
|
const hasAnyLazy = items.some((item) => item.meta.hasLazy);
|
|
16317
16256
|
const hasNull = schemas.some((s) => s.type === "null") || items.some((i) => i.meta.nullable);
|
|
16318
|
-
const
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16257
|
+
const { expression } = unionToAst({
|
|
16258
|
+
childResults: items,
|
|
16259
|
+
parentSchema,
|
|
16260
|
+
plugin: ctx.plugin,
|
|
16261
|
+
schemas
|
|
16322
16262
|
});
|
|
16323
|
-
let expression;
|
|
16324
|
-
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
16325
|
-
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
16326
|
-
else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
16327
16263
|
return {
|
|
16328
16264
|
expression,
|
|
16329
16265
|
meta: {
|
|
@@ -16364,7 +16300,6 @@ function createVisitor(config = {}) {
|
|
|
16364
16300
|
}
|
|
16365
16301
|
};
|
|
16366
16302
|
}
|
|
16367
|
-
|
|
16368
16303
|
//#endregion
|
|
16369
16304
|
//#region src/plugins/zod/v4/processor.ts
|
|
16370
16305
|
function createProcessor(plugin) {
|
|
@@ -16411,7 +16346,6 @@ function createProcessor(plugin) {
|
|
|
16411
16346
|
}
|
|
16412
16347
|
return { process };
|
|
16413
16348
|
}
|
|
16414
|
-
|
|
16415
16349
|
//#endregion
|
|
16416
16350
|
//#region src/plugins/zod/v4/plugin.ts
|
|
16417
16351
|
const handlerV4 = ({ plugin }) => {
|
|
@@ -16483,7 +16417,6 @@ const handlerV4 = ({ plugin }) => {
|
|
|
16483
16417
|
}
|
|
16484
16418
|
});
|
|
16485
16419
|
};
|
|
16486
|
-
|
|
16487
16420
|
//#endregion
|
|
16488
16421
|
//#region src/plugins/zod/plugin.ts
|
|
16489
16422
|
const handler = (args) => {
|
|
@@ -16494,7 +16427,6 @@ const handler = (args) => {
|
|
|
16494
16427
|
default: return handlerV4(args);
|
|
16495
16428
|
}
|
|
16496
16429
|
};
|
|
16497
|
-
|
|
16498
16430
|
//#endregion
|
|
16499
16431
|
//#region src/plugins/zod/config.ts
|
|
16500
16432
|
const defaultConfig = {
|
|
@@ -16535,10 +16467,20 @@ const defaultConfig = {
|
|
|
16535
16467
|
value: plugin.config.dates
|
|
16536
16468
|
});
|
|
16537
16469
|
plugin.config.types = context.valueToObject({
|
|
16538
|
-
defaultValue: {
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16470
|
+
defaultValue: {
|
|
16471
|
+
infer: {
|
|
16472
|
+
case: "PascalCase",
|
|
16473
|
+
enabled: false
|
|
16474
|
+
},
|
|
16475
|
+
input: {
|
|
16476
|
+
case: "PascalCase",
|
|
16477
|
+
enabled: false
|
|
16478
|
+
},
|
|
16479
|
+
output: {
|
|
16480
|
+
case: "PascalCase",
|
|
16481
|
+
enabled: false
|
|
16482
|
+
}
|
|
16483
|
+
},
|
|
16542
16484
|
mappers: { object: (fields, defaultValue) => ({
|
|
16543
16485
|
...fields,
|
|
16544
16486
|
infer: context.valueToObject({
|
|
@@ -16548,6 +16490,22 @@ const defaultConfig = {
|
|
|
16548
16490
|
},
|
|
16549
16491
|
mappers,
|
|
16550
16492
|
value: fields.infer
|
|
16493
|
+
}),
|
|
16494
|
+
input: context.valueToObject({
|
|
16495
|
+
defaultValue: {
|
|
16496
|
+
...defaultValue.input,
|
|
16497
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16498
|
+
},
|
|
16499
|
+
mappers,
|
|
16500
|
+
value: fields.input
|
|
16501
|
+
}),
|
|
16502
|
+
output: context.valueToObject({
|
|
16503
|
+
defaultValue: {
|
|
16504
|
+
...defaultValue.output,
|
|
16505
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16506
|
+
},
|
|
16507
|
+
mappers,
|
|
16508
|
+
value: fields.output
|
|
16551
16509
|
})
|
|
16552
16510
|
}) },
|
|
16553
16511
|
value: plugin.config.types
|
|
@@ -16562,6 +16520,14 @@ const defaultConfig = {
|
|
|
16562
16520
|
infer: {
|
|
16563
16521
|
...plugin.config.types.infer,
|
|
16564
16522
|
name: "{{name}}ZodType"
|
|
16523
|
+
},
|
|
16524
|
+
input: {
|
|
16525
|
+
...plugin.config.types.input,
|
|
16526
|
+
name: "{{name}}ZodInput"
|
|
16527
|
+
},
|
|
16528
|
+
output: {
|
|
16529
|
+
...plugin.config.types.output,
|
|
16530
|
+
name: "{{name}}ZodOutput"
|
|
16565
16531
|
}
|
|
16566
16532
|
}
|
|
16567
16533
|
},
|
|
@@ -16580,6 +16546,22 @@ const defaultConfig = {
|
|
|
16580
16546
|
},
|
|
16581
16547
|
mappers,
|
|
16582
16548
|
value: fields.infer
|
|
16549
|
+
}),
|
|
16550
|
+
input: context.valueToObject({
|
|
16551
|
+
defaultValue: {
|
|
16552
|
+
...defaultValue.input,
|
|
16553
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16554
|
+
},
|
|
16555
|
+
mappers,
|
|
16556
|
+
value: fields.input
|
|
16557
|
+
}),
|
|
16558
|
+
output: context.valueToObject({
|
|
16559
|
+
defaultValue: {
|
|
16560
|
+
...defaultValue.output,
|
|
16561
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16562
|
+
},
|
|
16563
|
+
mappers,
|
|
16564
|
+
value: fields.output
|
|
16583
16565
|
})
|
|
16584
16566
|
}) },
|
|
16585
16567
|
value: fields.types
|
|
@@ -16599,6 +16581,14 @@ const defaultConfig = {
|
|
|
16599
16581
|
infer: {
|
|
16600
16582
|
...plugin.config.types.infer,
|
|
16601
16583
|
name: "{{name}}BodyZodType"
|
|
16584
|
+
},
|
|
16585
|
+
input: {
|
|
16586
|
+
...plugin.config.types.input,
|
|
16587
|
+
name: "{{name}}BodyZodInput"
|
|
16588
|
+
},
|
|
16589
|
+
output: {
|
|
16590
|
+
...plugin.config.types.output,
|
|
16591
|
+
name: "{{name}}BodyZodOutput"
|
|
16602
16592
|
}
|
|
16603
16593
|
}
|
|
16604
16594
|
},
|
|
@@ -16613,6 +16603,14 @@ const defaultConfig = {
|
|
|
16613
16603
|
infer: {
|
|
16614
16604
|
...plugin.config.types.infer,
|
|
16615
16605
|
name: "{{name}}HeadersZodType"
|
|
16606
|
+
},
|
|
16607
|
+
input: {
|
|
16608
|
+
...plugin.config.types.input,
|
|
16609
|
+
name: "{{name}}HeadersZodInput"
|
|
16610
|
+
},
|
|
16611
|
+
output: {
|
|
16612
|
+
...plugin.config.types.output,
|
|
16613
|
+
name: "{{name}}HeadersZodOutput"
|
|
16616
16614
|
}
|
|
16617
16615
|
}
|
|
16618
16616
|
},
|
|
@@ -16626,6 +16624,14 @@ const defaultConfig = {
|
|
|
16626
16624
|
infer: {
|
|
16627
16625
|
...plugin.config.types.infer,
|
|
16628
16626
|
name: "{{name}}PathZodType"
|
|
16627
|
+
},
|
|
16628
|
+
input: {
|
|
16629
|
+
...plugin.config.types.input,
|
|
16630
|
+
name: "{{name}}PathZodInput"
|
|
16631
|
+
},
|
|
16632
|
+
output: {
|
|
16633
|
+
...plugin.config.types.output,
|
|
16634
|
+
name: "{{name}}PathZodOutput"
|
|
16629
16635
|
}
|
|
16630
16636
|
}
|
|
16631
16637
|
},
|
|
@@ -16638,6 +16644,14 @@ const defaultConfig = {
|
|
|
16638
16644
|
infer: {
|
|
16639
16645
|
...plugin.config.types.infer,
|
|
16640
16646
|
name: "{{name}}QueryZodType"
|
|
16647
|
+
},
|
|
16648
|
+
input: {
|
|
16649
|
+
...plugin.config.types.input,
|
|
16650
|
+
name: "{{name}}QueryZodInput"
|
|
16651
|
+
},
|
|
16652
|
+
output: {
|
|
16653
|
+
...plugin.config.types.output,
|
|
16654
|
+
name: "{{name}}QueryZodOutput"
|
|
16641
16655
|
}
|
|
16642
16656
|
}
|
|
16643
16657
|
},
|
|
@@ -16647,6 +16661,14 @@ const defaultConfig = {
|
|
|
16647
16661
|
infer: {
|
|
16648
16662
|
...plugin.config.types.infer,
|
|
16649
16663
|
name: "{{name}}DataZodType"
|
|
16664
|
+
},
|
|
16665
|
+
input: {
|
|
16666
|
+
...plugin.config.types.input,
|
|
16667
|
+
name: "{{name}}DataZodInput"
|
|
16668
|
+
},
|
|
16669
|
+
output: {
|
|
16670
|
+
...plugin.config.types.output,
|
|
16671
|
+
name: "{{name}}DataZodOutput"
|
|
16650
16672
|
}
|
|
16651
16673
|
}
|
|
16652
16674
|
},
|
|
@@ -16671,6 +16693,22 @@ const defaultConfig = {
|
|
|
16671
16693
|
},
|
|
16672
16694
|
mappers,
|
|
16673
16695
|
value: fields.infer
|
|
16696
|
+
}),
|
|
16697
|
+
input: context.valueToObject({
|
|
16698
|
+
defaultValue: {
|
|
16699
|
+
...defaultValue.input,
|
|
16700
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16701
|
+
},
|
|
16702
|
+
mappers,
|
|
16703
|
+
value: fields.input
|
|
16704
|
+
}),
|
|
16705
|
+
output: context.valueToObject({
|
|
16706
|
+
defaultValue: {
|
|
16707
|
+
...defaultValue.output,
|
|
16708
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16709
|
+
},
|
|
16710
|
+
mappers,
|
|
16711
|
+
value: fields.output
|
|
16674
16712
|
})
|
|
16675
16713
|
}) },
|
|
16676
16714
|
value: fields.types
|
|
@@ -16696,6 +16734,22 @@ const defaultConfig = {
|
|
|
16696
16734
|
},
|
|
16697
16735
|
mappers,
|
|
16698
16736
|
value: fields.infer
|
|
16737
|
+
}),
|
|
16738
|
+
input: context.valueToObject({
|
|
16739
|
+
defaultValue: {
|
|
16740
|
+
...defaultValue.input,
|
|
16741
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16742
|
+
},
|
|
16743
|
+
mappers,
|
|
16744
|
+
value: fields.input
|
|
16745
|
+
}),
|
|
16746
|
+
output: context.valueToObject({
|
|
16747
|
+
defaultValue: {
|
|
16748
|
+
...defaultValue.output,
|
|
16749
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16750
|
+
},
|
|
16751
|
+
mappers,
|
|
16752
|
+
value: fields.output
|
|
16699
16753
|
})
|
|
16700
16754
|
}) },
|
|
16701
16755
|
value: fields.types
|
|
@@ -16721,6 +16775,22 @@ const defaultConfig = {
|
|
|
16721
16775
|
},
|
|
16722
16776
|
mappers,
|
|
16723
16777
|
value: fields.infer
|
|
16778
|
+
}),
|
|
16779
|
+
input: context.valueToObject({
|
|
16780
|
+
defaultValue: {
|
|
16781
|
+
...defaultValue.input,
|
|
16782
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16783
|
+
},
|
|
16784
|
+
mappers,
|
|
16785
|
+
value: fields.input
|
|
16786
|
+
}),
|
|
16787
|
+
output: context.valueToObject({
|
|
16788
|
+
defaultValue: {
|
|
16789
|
+
...defaultValue.output,
|
|
16790
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16791
|
+
},
|
|
16792
|
+
mappers,
|
|
16793
|
+
value: fields.output
|
|
16724
16794
|
})
|
|
16725
16795
|
}) },
|
|
16726
16796
|
value: fields.types
|
|
@@ -16746,6 +16816,22 @@ const defaultConfig = {
|
|
|
16746
16816
|
},
|
|
16747
16817
|
mappers,
|
|
16748
16818
|
value: fields.infer
|
|
16819
|
+
}),
|
|
16820
|
+
input: context.valueToObject({
|
|
16821
|
+
defaultValue: {
|
|
16822
|
+
...defaultValue.input,
|
|
16823
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16824
|
+
},
|
|
16825
|
+
mappers,
|
|
16826
|
+
value: fields.input
|
|
16827
|
+
}),
|
|
16828
|
+
output: context.valueToObject({
|
|
16829
|
+
defaultValue: {
|
|
16830
|
+
...defaultValue.output,
|
|
16831
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16832
|
+
},
|
|
16833
|
+
mappers,
|
|
16834
|
+
value: fields.output
|
|
16749
16835
|
})
|
|
16750
16836
|
}) },
|
|
16751
16837
|
value: fields.types
|
|
@@ -16766,6 +16852,22 @@ const defaultConfig = {
|
|
|
16766
16852
|
},
|
|
16767
16853
|
mappers,
|
|
16768
16854
|
value: fields.infer
|
|
16855
|
+
}),
|
|
16856
|
+
input: context.valueToObject({
|
|
16857
|
+
defaultValue: {
|
|
16858
|
+
...defaultValue.input,
|
|
16859
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16860
|
+
},
|
|
16861
|
+
mappers,
|
|
16862
|
+
value: fields.input
|
|
16863
|
+
}),
|
|
16864
|
+
output: context.valueToObject({
|
|
16865
|
+
defaultValue: {
|
|
16866
|
+
...defaultValue.output,
|
|
16867
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16868
|
+
},
|
|
16869
|
+
mappers,
|
|
16870
|
+
value: fields.output
|
|
16769
16871
|
})
|
|
16770
16872
|
}) },
|
|
16771
16873
|
value: fields.types
|
|
@@ -16784,6 +16886,14 @@ const defaultConfig = {
|
|
|
16784
16886
|
infer: {
|
|
16785
16887
|
...plugin.config.types.infer,
|
|
16786
16888
|
name: "{{name}}ResponseZodType"
|
|
16889
|
+
},
|
|
16890
|
+
input: {
|
|
16891
|
+
...plugin.config.types.input,
|
|
16892
|
+
name: "{{name}}ResponseZodInput"
|
|
16893
|
+
},
|
|
16894
|
+
output: {
|
|
16895
|
+
...plugin.config.types.output,
|
|
16896
|
+
name: "{{name}}ResponseZodOutput"
|
|
16787
16897
|
}
|
|
16788
16898
|
}
|
|
16789
16899
|
},
|
|
@@ -16802,6 +16912,22 @@ const defaultConfig = {
|
|
|
16802
16912
|
},
|
|
16803
16913
|
mappers,
|
|
16804
16914
|
value: fields.infer
|
|
16915
|
+
}),
|
|
16916
|
+
input: context.valueToObject({
|
|
16917
|
+
defaultValue: {
|
|
16918
|
+
...defaultValue.input,
|
|
16919
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16920
|
+
},
|
|
16921
|
+
mappers,
|
|
16922
|
+
value: fields.input
|
|
16923
|
+
}),
|
|
16924
|
+
output: context.valueToObject({
|
|
16925
|
+
defaultValue: {
|
|
16926
|
+
...defaultValue.output,
|
|
16927
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16928
|
+
},
|
|
16929
|
+
mappers,
|
|
16930
|
+
value: fields.output
|
|
16805
16931
|
})
|
|
16806
16932
|
}) },
|
|
16807
16933
|
value: fields.types
|
|
@@ -16820,6 +16946,14 @@ const defaultConfig = {
|
|
|
16820
16946
|
infer: {
|
|
16821
16947
|
...plugin.config.types.infer,
|
|
16822
16948
|
name: "{{name}}WebhookRequestZodType"
|
|
16949
|
+
},
|
|
16950
|
+
input: {
|
|
16951
|
+
...plugin.config.types.input,
|
|
16952
|
+
name: "{{name}}WebhookRequestZodInput"
|
|
16953
|
+
},
|
|
16954
|
+
output: {
|
|
16955
|
+
...plugin.config.types.output,
|
|
16956
|
+
name: "{{name}}WebhookRequestZodOutput"
|
|
16823
16957
|
}
|
|
16824
16958
|
}
|
|
16825
16959
|
},
|
|
@@ -16838,6 +16972,22 @@ const defaultConfig = {
|
|
|
16838
16972
|
},
|
|
16839
16973
|
mappers,
|
|
16840
16974
|
value: fields.infer
|
|
16975
|
+
}),
|
|
16976
|
+
input: context.valueToObject({
|
|
16977
|
+
defaultValue: {
|
|
16978
|
+
...defaultValue.input,
|
|
16979
|
+
enabled: fields.input !== void 0 ? Boolean(fields.input) : defaultValue.input.enabled
|
|
16980
|
+
},
|
|
16981
|
+
mappers,
|
|
16982
|
+
value: fields.input
|
|
16983
|
+
}),
|
|
16984
|
+
output: context.valueToObject({
|
|
16985
|
+
defaultValue: {
|
|
16986
|
+
...defaultValue.output,
|
|
16987
|
+
enabled: fields.output !== void 0 ? Boolean(fields.output) : defaultValue.output.enabled
|
|
16988
|
+
},
|
|
16989
|
+
mappers,
|
|
16990
|
+
value: fields.output
|
|
16841
16991
|
})
|
|
16842
16992
|
}) },
|
|
16843
16993
|
value: fields.types
|
|
@@ -16849,11 +16999,7 @@ const defaultConfig = {
|
|
|
16849
16999
|
},
|
|
16850
17000
|
tags: ["validator"]
|
|
16851
17001
|
};
|
|
16852
|
-
|
|
16853
|
-
* Type helper for Zod plugin, returns {@link Plugin.Config} object
|
|
16854
|
-
*/
|
|
16855
|
-
const defineConfig = definePluginConfig(defaultConfig);
|
|
16856
|
-
|
|
17002
|
+
definePluginConfig(defaultConfig);
|
|
16857
17003
|
//#endregion
|
|
16858
17004
|
//#region src/plugins/config.ts
|
|
16859
17005
|
const defaultPluginConfigs = {
|
|
@@ -16885,7 +17031,6 @@ const defaultPluginConfigs = {
|
|
|
16885
17031
|
valibot: defaultConfig$1,
|
|
16886
17032
|
zod: defaultConfig
|
|
16887
17033
|
};
|
|
16888
|
-
|
|
16889
17034
|
//#endregion
|
|
16890
17035
|
//#region src/config/plugins.ts
|
|
16891
17036
|
/**
|
|
@@ -16954,6 +17099,7 @@ function getPlugins({ dependencies, userConfig }) {
|
|
|
16954
17099
|
if (userConfig.plugins.length === 1 && isPluginClient(userConfig.plugins[0])) definedPlugins = [...defaultPlugins, ...userConfig.plugins];
|
|
16955
17100
|
else definedPlugins = userConfig.plugins;
|
|
16956
17101
|
}
|
|
17102
|
+
warnOnConflictingDuplicatePlugins(definedPlugins);
|
|
16957
17103
|
return getPluginsConfig({
|
|
16958
17104
|
dependencies,
|
|
16959
17105
|
userPlugins: definedPlugins.map((plugin) => {
|
|
@@ -16969,7 +17115,6 @@ function getPlugins({ dependencies, userConfig }) {
|
|
|
16969
17115
|
userPluginsConfig
|
|
16970
17116
|
});
|
|
16971
17117
|
}
|
|
16972
|
-
|
|
16973
17118
|
//#endregion
|
|
16974
17119
|
//#region src/config/resolve.ts
|
|
16975
17120
|
function resolveConfig(validated, dependencies) {
|
|
@@ -17012,7 +17157,6 @@ function resolveConfig(validated, dependencies) {
|
|
|
17012
17157
|
index: validated.job.index
|
|
17013
17158
|
};
|
|
17014
17159
|
}
|
|
17015
|
-
|
|
17016
17160
|
//#endregion
|
|
17017
17161
|
//#region src/config/validate.ts
|
|
17018
17162
|
function validateJobs(jobs) {
|
|
@@ -17027,7 +17171,6 @@ function validateJobs(jobs) {
|
|
|
17027
17171
|
};
|
|
17028
17172
|
});
|
|
17029
17173
|
}
|
|
17030
|
-
|
|
17031
17174
|
//#endregion
|
|
17032
17175
|
//#region src/config/init.ts
|
|
17033
17176
|
/**
|
|
@@ -17062,7 +17205,7 @@ async function resolveJobs({ logger, userConfigs }) {
|
|
|
17062
17205
|
results: resolvedJobs
|
|
17063
17206
|
};
|
|
17064
17207
|
}
|
|
17065
|
-
|
|
17066
17208
|
//#endregion
|
|
17067
17209
|
export { postProcessors as _, clientDefaultConfig as a, TypeScriptRenderer as c, reserved as d, keywords as f, getTypedConfig as g, getClientPlugin as h, generateClientBundle as i, TsDslContext as l, TsDsl as m, defaultPlugins as n, clientDefaultMeta as o, regexp as p, clientPluginHandler as r, $ as s, resolveJobs as t, ctx as u };
|
|
17068
|
-
|
|
17210
|
+
|
|
17211
|
+
//# sourceMappingURL=init-D4xuNKgu.mjs.map
|