@e-n-v/env 0.0.5 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BooleanMap-DmFnCA-O.d.ts → BooleanMap-BPQuO3Ae.d.ts} +1 -3
- package/dist/{BooleanMap-B2eIP3tZ.d.cts → BooleanMap-CX_YrPCf.d.cts} +1 -3
- package/dist/EnvChannelOptions-BbKeuO-o.d.cts +366 -0
- package/dist/EnvChannelOptions-BbKeuO-o.d.ts +366 -0
- package/dist/{EnvSource-DA3ZGlES.js → EnvSource-WAGWqRVM.js} +6 -10
- package/dist/{EnvSource-BVnmdHku.cjs → EnvSource-s8F_M_6O.cjs} +21 -28
- package/dist/EnvVarSchema-CDZGmnex.cjs +15 -0
- package/dist/EnvVarSchema-Dr6q7jf6.js +10 -0
- package/dist/{ProcessEnvChannel-Do4-yiLI.d.ts → ProcessEnvChannel-CwhV7_EB.d.ts} +2 -4
- package/dist/{ProcessEnvChannel-D465c-dp.d.cts → ProcessEnvChannel-DWHPZePe.d.cts} +2 -4
- package/dist/{StringEnvVarSchema-B8MT7htU.d.ts → StringEnvVarSchema-D9Jr1Aws.d.cts} +5 -3
- package/dist/{StringEnvVarSchema-BF6C0nyT.d.cts → StringEnvVarSchema-D9Jr1Aws.d.ts} +5 -3
- package/dist/channels.cjs +3 -4
- package/dist/channels.d.cts +3 -4
- package/dist/channels.d.ts +3 -4
- package/dist/channels.js +2 -4
- package/dist/cli.cjs +10 -23
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +7 -13
- package/dist/core.cjs +13 -14
- package/dist/core.d.cts +147 -6
- package/dist/core.d.ts +147 -6
- package/dist/core.js +9 -11
- package/dist/{custom-Bt_wnxIu.js → custom-Bd-jLg80.js} +3 -12
- package/dist/{custom-D_Rqjm09.cjs → custom-Dyb9TnER.cjs} +48 -58
- package/dist/files.cjs +6 -6
- package/dist/files.d.cts +2 -2
- package/dist/files.d.ts +2 -2
- package/dist/files.js +2 -5
- package/dist/{parse-DwtLpVhC.d.ts → index-B2eNij2x.d.cts} +1 -2
- package/dist/{parse-BT1QSa5e.d.cts → index-BHTM8nxS.d.ts} +1 -2
- package/dist/{prompt-yKdccbtZ.d.ts → index-BKBW9Dxs.d.cts} +3 -4
- package/dist/{prompt-C5WudV9x.d.cts → index-CEyOIRdj.d.ts} +3 -4
- package/dist/{EnvModel-CrGclUpJ.d.cts → index-Cb0abjLf.d.ts} +59 -7
- package/dist/{EnvModel-D8rt0EJ6.d.ts → index-Cz3frUwZ.d.cts} +58 -6
- package/dist/index.cjs +33 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +15 -0
- package/dist/model.cjs +10 -11
- package/dist/model.d.cts +2 -35
- package/dist/model.d.ts +2 -35
- package/dist/model.js +2 -6
- package/dist/parse.cjs +14 -14
- package/dist/parse.d.cts +5 -8
- package/dist/parse.d.ts +5 -8
- package/dist/parse.js +4 -7
- package/dist/preprocessors-BKuIcZa1.d.ts +83 -0
- package/dist/preprocessors-DFVyF0c7.d.cts +83 -0
- package/dist/prompt.cjs +12 -15
- package/dist/prompt.d.cts +5 -10
- package/dist/prompt.d.ts +5 -10
- package/dist/prompt.js +3 -9
- package/dist/{redis-EcC7TX3K.cjs → redis-CyTF0SYT.cjs} +321 -253
- package/dist/{redis-CJOpRPjc.js → redis-D18f4ztf.js} +76 -37
- package/dist/{index-Dq_0aeAL.d.ts → redis-DsW-Vkwq.d.cts} +26 -6
- package/dist/{index-D8pslhp4.d.cts → redis-tRD4nAy_.d.ts} +26 -6
- package/dist/{resolveChannel-v9BDsw-M.js → resolveChannel-D1Fzl4TL.js} +59 -63
- package/dist/{resolveChannel-CjAuxy3p.cjs → resolveChannel-DxZNYdDe.cjs} +84 -92
- package/dist/{chunk-pbleEpgJ.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -16
- package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.js} +4 -4
- package/dist/{schema-jN4EtvEP.d.ts → schema-B-JLVS42.d.ts} +1 -3
- package/dist/{schema-DH4GiW9A.d.cts → schema-B1i83alz.d.cts} +1 -3
- package/dist/schema-CtP5lpU1.js +11 -0
- package/dist/schema-D9nJKipf.cjs +22 -0
- package/dist/schemas/zod.cjs +112 -359
- package/dist/schemas/zod.d.cts +117 -87
- package/dist/schemas/zod.d.ts +117 -87
- package/dist/schemas/zod.js +116 -377
- package/dist/schemas.cjs +152 -133
- package/dist/schemas.d.cts +2 -3
- package/dist/schemas.d.ts +2 -3
- package/dist/schemas.js +2 -6
- package/dist/{src-Cjo2XA4n.cjs → src-5GYFbR9n.cjs} +21 -25
- package/dist/{src-BBwjK5SK.js → src-8rEOvFG5.js} +11 -15
- package/dist/{src-Dtv7TlJx.js → src-CdzAzdq-.js} +100 -114
- package/dist/{src-CLTURaoo.js → src-Cg49gGJb.js} +18 -44
- package/dist/{src-DWYoqPX1.cjs → src-CttkcdpE.cjs} +114 -133
- package/dist/{src-XjL5cyPG.cjs → src-D5KzIEH_.cjs} +130 -107
- package/dist/src-DB0Har0j.cjs +1632 -0
- package/dist/{src-CVdUqK3q.js → src-DWc-WWjX.js} +107 -86
- package/dist/{src-B7FG1rak.js → src-DvUBRBe3.js} +205 -116
- package/dist/{src-meUnCASg.cjs → src-TZx_e95f.cjs} +87 -132
- package/dist/{vars-BNVI6k89.d.ts → vars-DtzGL5Nc.d.cts} +1 -4
- package/dist/{vars-CptZRPX5.d.cts → vars-obKYxaSu.d.ts} +1 -4
- package/dist/vars.cjs +175 -138
- package/dist/vars.d.cts +3 -7
- package/dist/vars.d.ts +3 -7
- package/dist/vars.js +21 -9
- package/package.json +9 -8
- package/dist/EnvChannelOptions-BPkWDrmr.d.cts +0 -108
- package/dist/EnvChannelOptions-CRwDLWjd.d.ts +0 -108
- package/dist/coerce-DNIuYAx4.js +0 -11028
- package/dist/coerce-b7UVodS9.cjs +0 -12365
- package/dist/model-Dic8IJsf.d.ts +0 -29
- package/dist/model-ft0WhSSS.d.cts +0 -29
- package/dist/root.cjs +0 -36
- package/dist/root.d.cts +0 -21
- package/dist/root.d.ts +0 -21
- package/dist/root.js +0 -21
- package/dist/src-DZmpNGrQ.cjs +0 -1411
- package/dist/validate-BxA3a-ns.d.cts +0 -203
- package/dist/validate-CyxrRacF.d.ts +0 -203
- package/dist/vars-CYOaskkK.cjs +0 -27
- package/dist/vars-DOW0LiiN.js +0 -22
- /package/dist/{EnvChannel-LMIRYvT1.d.cts → EnvChannel-CfSwa_25.d.cts} +0 -0
- /package/dist/{EnvChannel-w27PEm7x.d.ts → EnvChannel-CfSwa_25.d.ts} +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
+
const require_src = require("./src-TZx_e95f.cjs");
|
|
3
|
+
const require_EnvVarSchema = require("./EnvVarSchema-CDZGmnex.cjs");
|
|
4
|
+
let zod = require("zod");
|
|
5
|
+
let zod_v4_core = require("zod/v4/core");
|
|
6
|
+
zod_v4_core = require_rolldown_runtime.__toESM(zod_v4_core, 1);
|
|
4
7
|
//#region ../converters/src/converters/zod/ZodV3Converter.ts
|
|
5
8
|
/**
|
|
6
9
|
* Zod v3 schema converter implementation
|
|
@@ -121,8 +124,8 @@ function createV3ProcessFunction(schema, type) {
|
|
|
121
124
|
return (value) => {
|
|
122
125
|
try {
|
|
123
126
|
let processSchema = schema;
|
|
124
|
-
if (type === "number") processSchema =
|
|
125
|
-
else if (type === "boolean") processSchema =
|
|
127
|
+
if (typeof value === "string" && type === "number") processSchema = zod.z.coerce.number();
|
|
128
|
+
else if (typeof value === "string" && type === "boolean") processSchema = zod.z.string().transform((val) => {
|
|
126
129
|
const lower = val.toLowerCase().trim();
|
|
127
130
|
if ([
|
|
128
131
|
"true",
|
|
@@ -157,29 +160,35 @@ function convertFromZodV3Schema(schema) {
|
|
|
157
160
|
const type = resolveV3EnvVarType(peeled.schema);
|
|
158
161
|
const def = getV3Def(peeled.schema);
|
|
159
162
|
switch (type) {
|
|
160
|
-
case "boolean":
|
|
161
|
-
process
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
case "boolean": {
|
|
164
|
+
const process = createV3ProcessFunction(peeled.schema, "boolean");
|
|
165
|
+
return new require_src.BooleanEnvVarSchema({
|
|
166
|
+
process,
|
|
167
|
+
required: peeled.required,
|
|
168
|
+
default: typeof peeled.default === "boolean" ? peeled.default : void 0,
|
|
169
|
+
description: peeled.description
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
case "number": {
|
|
173
|
+
const process = createV3ProcessFunction(peeled.schema, "number");
|
|
174
|
+
return new require_src.NumberEnvVarSchema({
|
|
175
|
+
process,
|
|
176
|
+
required: peeled.required,
|
|
177
|
+
default: typeof peeled.default === "number" ? peeled.default : void 0,
|
|
178
|
+
description: peeled.description
|
|
179
|
+
});
|
|
180
|
+
}
|
|
172
181
|
case "enum": {
|
|
173
182
|
const values = extractV3EnumValues(def) || [];
|
|
183
|
+
const process = createV3ProcessFunction(peeled.schema, "enum");
|
|
174
184
|
return new require_src.EnumEnvVarSchema({
|
|
175
|
-
process
|
|
185
|
+
process,
|
|
176
186
|
values,
|
|
177
187
|
required: peeled.required,
|
|
178
188
|
default: typeof peeled.default === "string" ? peeled.default : void 0,
|
|
179
189
|
description: peeled.description
|
|
180
190
|
});
|
|
181
191
|
}
|
|
182
|
-
case "string":
|
|
183
192
|
default: {
|
|
184
193
|
const process = createV3ProcessFunction(peeled.schema, "string");
|
|
185
194
|
const defaultValue = typeof peeled.default === "string" ? peeled.default : void 0;
|
|
@@ -192,7 +201,6 @@ function convertFromZodV3Schema(schema) {
|
|
|
192
201
|
}
|
|
193
202
|
}
|
|
194
203
|
}
|
|
195
|
-
|
|
196
204
|
//#endregion
|
|
197
205
|
//#region ../converters/src/converters/zod/ZodV4Converter.ts
|
|
198
206
|
/**
|
|
@@ -335,10 +343,10 @@ function createV4ProcessFunction(schema, type, originalSchema) {
|
|
|
335
343
|
let processSchema = schema;
|
|
336
344
|
const def = getV4Def(schema);
|
|
337
345
|
const typeName = getV4TypeName(def);
|
|
338
|
-
if (typeName === "stringbool" || typeName === "pipe" && def.in && def.out && resolveV4EnvVarType(def.in) === "string" && resolveV4EnvVarType(def.out) === "boolean") processSchema = originalSchema;
|
|
339
|
-
else if (type === "number") processSchema =
|
|
340
|
-
else if (type === "boolean") processSchema =
|
|
341
|
-
const result =
|
|
346
|
+
if (typeof value === "string" && typeName === "stringbool" || typeof value === "string" && typeName === "pipe" && def.in && def.out && resolveV4EnvVarType(def.in) === "string" && resolveV4EnvVarType(def.out) === "boolean") processSchema = originalSchema;
|
|
347
|
+
else if (typeof value === "string" && type === "number") processSchema = zod.z.coerce.number();
|
|
348
|
+
else if (typeof value === "string" && type === "boolean") processSchema = zod.z.stringbool();
|
|
349
|
+
const result = zod_v4_core.safeParse(processSchema, value);
|
|
342
350
|
if (result.success) return result.data;
|
|
343
351
|
throw new Error(`Failed to parse value "${value}": ${result.error.issues.map((issue) => issue.message).join("; ")}`);
|
|
344
352
|
} catch (error) {
|
|
@@ -355,29 +363,35 @@ function convertFromZodV4Schema(schema) {
|
|
|
355
363
|
const type = resolveV4EnvVarType(peeled.schema);
|
|
356
364
|
const def = getV4Def(peeled.schema);
|
|
357
365
|
switch (type) {
|
|
358
|
-
case "boolean":
|
|
359
|
-
process
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
366
|
+
case "boolean": {
|
|
367
|
+
const process = createV4ProcessFunction(peeled.schema, "boolean", schema);
|
|
368
|
+
return new require_src.BooleanEnvVarSchema({
|
|
369
|
+
process,
|
|
370
|
+
required: peeled.required,
|
|
371
|
+
default: typeof peeled.default === "boolean" ? peeled.default : void 0,
|
|
372
|
+
description: peeled.description
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
case "number": {
|
|
376
|
+
const process = createV4ProcessFunction(peeled.schema, "number", schema);
|
|
377
|
+
return new require_src.NumberEnvVarSchema({
|
|
378
|
+
process,
|
|
379
|
+
required: peeled.required,
|
|
380
|
+
default: typeof peeled.default === "number" ? peeled.default : void 0,
|
|
381
|
+
description: peeled.description
|
|
382
|
+
});
|
|
383
|
+
}
|
|
370
384
|
case "enum": {
|
|
371
385
|
const values = extractV4EnumValues(def) || [];
|
|
386
|
+
const process = createV4ProcessFunction(peeled.schema, "enum", schema);
|
|
372
387
|
return new require_src.EnumEnvVarSchema({
|
|
373
|
-
process
|
|
388
|
+
process,
|
|
374
389
|
values,
|
|
375
390
|
required: peeled.required,
|
|
376
391
|
default: typeof peeled.default === "string" ? peeled.default : void 0,
|
|
377
392
|
description: peeled.description
|
|
378
393
|
});
|
|
379
394
|
}
|
|
380
|
-
case "string":
|
|
381
395
|
default: {
|
|
382
396
|
const process = createV4ProcessFunction(peeled.schema, "string", schema);
|
|
383
397
|
const defaultValue = typeof peeled.default === "string" ? peeled.default : void 0;
|
|
@@ -390,7 +404,6 @@ function convertFromZodV4Schema(schema) {
|
|
|
390
404
|
}
|
|
391
405
|
}
|
|
392
406
|
}
|
|
393
|
-
|
|
394
407
|
//#endregion
|
|
395
408
|
//#region ../converters/src/converters/joi/JoiConverter.ts
|
|
396
409
|
/**
|
|
@@ -502,11 +515,11 @@ function createJoiProcessFunction(schema, type) {
|
|
|
502
515
|
return (value) => {
|
|
503
516
|
try {
|
|
504
517
|
let processValue = value;
|
|
505
|
-
if (type === "number") {
|
|
518
|
+
if (typeof value === "string" && type === "number") {
|
|
506
519
|
const num = Number(value);
|
|
507
|
-
if (Number.
|
|
520
|
+
if (!Number.isFinite(num)) throw new Error(`Expected number, received "${value}"`);
|
|
508
521
|
processValue = num;
|
|
509
|
-
} else if (type === "boolean") {
|
|
522
|
+
} else if (typeof value === "string" && type === "boolean") {
|
|
510
523
|
const lower = value.toLowerCase().trim();
|
|
511
524
|
if ([
|
|
512
525
|
"true",
|
|
@@ -545,38 +558,46 @@ function convertFromJoiSchema(schema) {
|
|
|
545
558
|
const defaultValue = getJoiDefaultValue(schema);
|
|
546
559
|
const description = getJoiDescription(schema);
|
|
547
560
|
switch (type) {
|
|
548
|
-
case "boolean":
|
|
549
|
-
process
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
561
|
+
case "boolean": {
|
|
562
|
+
const process = createJoiProcessFunction(schema, "boolean");
|
|
563
|
+
return new require_src.BooleanEnvVarSchema({
|
|
564
|
+
process,
|
|
565
|
+
required,
|
|
566
|
+
default: typeof defaultValue === "boolean" ? defaultValue : void 0,
|
|
567
|
+
description
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
case "number": {
|
|
571
|
+
const process = createJoiProcessFunction(schema, "number");
|
|
572
|
+
return new require_src.NumberEnvVarSchema({
|
|
573
|
+
process,
|
|
574
|
+
required,
|
|
575
|
+
default: typeof defaultValue === "number" ? defaultValue : void 0,
|
|
576
|
+
description
|
|
577
|
+
});
|
|
578
|
+
}
|
|
560
579
|
case "enum": {
|
|
561
580
|
const values = getJoiValidValues(schema) || [];
|
|
581
|
+
const process = createJoiProcessFunction(schema, "enum");
|
|
562
582
|
return new require_src.EnumEnvVarSchema({
|
|
563
|
-
process
|
|
583
|
+
process,
|
|
564
584
|
values,
|
|
565
585
|
required,
|
|
566
586
|
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
567
587
|
description
|
|
568
588
|
});
|
|
569
589
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
590
|
+
default: {
|
|
591
|
+
const process = createJoiProcessFunction(schema, "string");
|
|
592
|
+
return new require_src.StringEnvVarSchema({
|
|
593
|
+
process,
|
|
594
|
+
required,
|
|
595
|
+
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
596
|
+
description
|
|
597
|
+
});
|
|
598
|
+
}
|
|
577
599
|
}
|
|
578
600
|
}
|
|
579
|
-
|
|
580
601
|
//#endregion
|
|
581
602
|
//#region ../converters/src/converters/superstruct/SuperstructConverter.ts
|
|
582
603
|
/**
|
|
@@ -610,31 +631,39 @@ function convertFromSuperstruct(schema) {
|
|
|
610
631
|
const values = extractEnumValues(schema);
|
|
611
632
|
if (!values || values.length === 0) return createStringEnvVarSchema(schema, required, defaultValue, description);
|
|
612
633
|
const readonlyValues = values;
|
|
634
|
+
const process = createSuperstructProcessFunction(schema, "enum");
|
|
613
635
|
return new require_src.EnumEnvVarSchema({
|
|
614
|
-
process
|
|
636
|
+
process,
|
|
615
637
|
values: readonlyValues,
|
|
616
638
|
required,
|
|
617
639
|
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
618
640
|
description
|
|
619
641
|
});
|
|
620
642
|
}
|
|
621
|
-
if (resolvedType === "boolean")
|
|
622
|
-
process
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
643
|
+
if (resolvedType === "boolean") {
|
|
644
|
+
const process = createSuperstructProcessFunction(schema, "boolean");
|
|
645
|
+
return new require_src.BooleanEnvVarSchema({
|
|
646
|
+
process,
|
|
647
|
+
required,
|
|
648
|
+
default: typeof defaultValue === "boolean" ? defaultValue : void 0,
|
|
649
|
+
description
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
if (resolvedType === "number") {
|
|
653
|
+
const process = createSuperstructProcessFunction(schema, "number");
|
|
654
|
+
return new require_src.NumberEnvVarSchema({
|
|
655
|
+
process,
|
|
656
|
+
required,
|
|
657
|
+
default: typeof defaultValue === "number" ? defaultValue : void 0,
|
|
658
|
+
description
|
|
659
|
+
});
|
|
660
|
+
}
|
|
633
661
|
return createStringEnvVarSchema(schema, required, defaultValue, description);
|
|
634
662
|
}
|
|
635
663
|
function createStringEnvVarSchema(schema, required, defaultValue, description) {
|
|
664
|
+
const process = createSuperstructProcessFunction(schema, "string");
|
|
636
665
|
return new require_src.StringEnvVarSchema({
|
|
637
|
-
process
|
|
666
|
+
process,
|
|
638
667
|
required,
|
|
639
668
|
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
640
669
|
description
|
|
@@ -689,9 +718,8 @@ function getStructDescription(schema) {
|
|
|
689
718
|
}
|
|
690
719
|
function createSuperstructProcessFunction(schema, type) {
|
|
691
720
|
return (value) => {
|
|
692
|
-
if (typeof value !== "string") throw new Error("Value must be a string");
|
|
693
721
|
let candidate = value;
|
|
694
|
-
if (type === "number") {
|
|
722
|
+
if (typeof value === "string" && type === "number") {
|
|
695
723
|
const trimmed = value.trim();
|
|
696
724
|
if (trimmed === "") candidate = void 0;
|
|
697
725
|
else {
|
|
@@ -699,7 +727,7 @@ function createSuperstructProcessFunction(schema, type) {
|
|
|
699
727
|
if (Number.isNaN(parsed) || !Number.isFinite(parsed)) throw new Error(`"${value}" is not a valid number`);
|
|
700
728
|
candidate = parsed;
|
|
701
729
|
}
|
|
702
|
-
} else if (type === "boolean") {
|
|
730
|
+
} else if (typeof value === "string" && type === "boolean") {
|
|
703
731
|
const trimmed = value.trim().toLowerCase();
|
|
704
732
|
if (trimmed === "") candidate = void 0;
|
|
705
733
|
else if ([
|
|
@@ -723,7 +751,6 @@ function createSuperstructProcessFunction(schema, type) {
|
|
|
723
751
|
return result;
|
|
724
752
|
};
|
|
725
753
|
}
|
|
726
|
-
|
|
727
754
|
//#endregion
|
|
728
755
|
//#region ../converters/src/converters.ts
|
|
729
756
|
/**
|
|
@@ -735,7 +762,6 @@ const converters = [
|
|
|
735
762
|
new JoiConverter(),
|
|
736
763
|
new SuperstructConverter()
|
|
737
764
|
];
|
|
738
|
-
|
|
739
765
|
//#endregion
|
|
740
766
|
//#region ../models/src/resolve.ts
|
|
741
767
|
/**
|
|
@@ -750,7 +776,7 @@ const converters = [
|
|
|
750
776
|
* @throws Error if no converter can handle the schema
|
|
751
777
|
*/
|
|
752
778
|
function resolveSchema(schema) {
|
|
753
|
-
if (
|
|
779
|
+
if (require_EnvVarSchema.isEnvVarSchema(schema)) return schema;
|
|
754
780
|
for (const converter of converters) if (converter.applies(schema)) return converter.convert(schema);
|
|
755
781
|
throw new Error(`No converter found for schema. Supported types: Zod v3, Zod v4, Joi, Superstruct, EnvVarSchema. Received: ${typeof schema}`);
|
|
756
782
|
}
|
|
@@ -777,7 +803,6 @@ function resolveSchemas(schemas) {
|
|
|
777
803
|
}
|
|
778
804
|
return resolved;
|
|
779
805
|
}
|
|
780
|
-
|
|
781
806
|
//#endregion
|
|
782
807
|
//#region ../models/src/EnvModel.ts
|
|
783
808
|
/**
|
|
@@ -817,7 +842,6 @@ var EnvModel = class {
|
|
|
817
842
|
return { ...config };
|
|
818
843
|
}
|
|
819
844
|
};
|
|
820
|
-
|
|
821
845
|
//#endregion
|
|
822
846
|
//#region ../models/src/model.ts
|
|
823
847
|
/**
|
|
@@ -845,29 +869,28 @@ var EnvModel = class {
|
|
|
845
869
|
function define(options) {
|
|
846
870
|
return new EnvModel(options);
|
|
847
871
|
}
|
|
848
|
-
|
|
849
872
|
//#endregion
|
|
850
|
-
Object.defineProperty(exports,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
873
|
+
Object.defineProperty(exports, "EnvModel", {
|
|
874
|
+
enumerable: true,
|
|
875
|
+
get: function() {
|
|
876
|
+
return EnvModel;
|
|
877
|
+
}
|
|
855
878
|
});
|
|
856
|
-
Object.defineProperty(exports,
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
879
|
+
Object.defineProperty(exports, "define", {
|
|
880
|
+
enumerable: true,
|
|
881
|
+
get: function() {
|
|
882
|
+
return define;
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
Object.defineProperty(exports, "resolveSchema", {
|
|
886
|
+
enumerable: true,
|
|
887
|
+
get: function() {
|
|
888
|
+
return resolveSchema;
|
|
889
|
+
}
|
|
861
890
|
});
|
|
862
|
-
Object.defineProperty(exports,
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
891
|
+
Object.defineProperty(exports, "resolveSchemas", {
|
|
892
|
+
enumerable: true,
|
|
893
|
+
get: function() {
|
|
894
|
+
return resolveSchemas;
|
|
895
|
+
}
|
|
867
896
|
});
|
|
868
|
-
Object.defineProperty(exports, 'resolveSchemas', {
|
|
869
|
-
enumerable: true,
|
|
870
|
-
get: function () {
|
|
871
|
-
return resolveSchemas;
|
|
872
|
-
}
|
|
873
|
-
});
|