ultraenv 1.0.1 → 1.0.2
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 +67 -1857
- package/dist/{chunk-GC7RXHLA.js → chunk-2MBSLURI.js} +16 -17
- package/dist/{chunk-IGFVP24Q.js → chunk-3AF476D7.js} +1 -1
- package/dist/{chunk-N5PAV4NM.js → chunk-5WUBB633.js} +17 -26
- package/dist/{chunk-2USZPWLZ.js → chunk-6NFA23AY.js} +28 -39
- package/dist/{chunk-AWN6ADV7.js → chunk-6X3BUE5S.js} +45 -54
- package/dist/{chunk-NBOABPHM.js → chunk-72UKVOO5.js} +24 -40
- package/dist/{chunk-JB7RKV3C.js → chunk-7AHG2IP4.js} +1 -7
- package/dist/{chunk-6KS56D6E.js → chunk-7VJ7LK2M.js} +1 -1
- package/dist/{chunk-CIFMBJ4H.js → chunk-BNUHE2ZI.js} +57 -21
- package/dist/{chunk-HFXQGJY3.js → chunk-CVJPO3QY.js} +13 -27
- package/dist/{chunk-IKPTKALB.js → chunk-F7YSINGU.js} +1 -3
- package/dist/{chunk-3VYXPTYV.js → chunk-FSKVYBEP.js} +1 -1
- package/dist/{chunk-4XUYMRK5.js → chunk-GJC64ZG7.js} +4 -3
- package/dist/{chunk-YMMP4VQL.js → chunk-H3QEGEZ6.js} +1 -1
- package/dist/{chunk-CHVO6NWI.js → chunk-LFIKYFPS.js} +2 -2
- package/dist/{chunk-3UV2QNJL.js → chunk-LJSCUOD4.js} +19 -21
- package/dist/{chunk-YVWLXFUT.js → chunk-LQZK6BBQ.js} +2 -2
- package/dist/{chunk-5G2DU52U.js → chunk-N7GOHQBF.js} +7 -1
- package/dist/{chunk-MSXMESFP.js → chunk-OBLMAUCF.js} +8 -14
- package/dist/{chunk-UEWYFN6A.js → chunk-RJTUAMK3.js} +16 -29
- package/dist/{chunk-MNVFG7H4.js → chunk-XPZC32UY.js} +16 -25
- package/dist/{chunk-WMHN5RW2.js → chunk-YLGJQOMM.js} +3 -9
- package/dist/{ci-check-sync-VBMSVWIV.js → ci-check-sync-UO5PARKO.js} +4 -4
- package/dist/{ci-scan-24MT5XGS.js → ci-scan-5D7QBN5X.js} +2 -5
- package/dist/{ci-setup-C2NKEFRD.js → ci-setup-J34DS6KD.js} +2 -2
- package/dist/{ci-validate-7AW24LSQ.js → ci-validate-LWP5NBDN.js} +4 -4
- package/dist/cli/index.cjs +470 -390
- package/dist/cli/index.js +130 -55
- package/dist/comparator-AIRTWBOL.js +13 -0
- package/dist/{config-O5YRQP5Z.js → config-67GDO3CW.js} +3 -3
- package/dist/{debug-PTPXAF3K.js → debug-6VCX3QSP.js} +6 -6
- package/dist/{declaration-LEME4AFZ.js → declaration-YGOVZOXG.js} +3 -3
- package/dist/{doctor-FZAUPKHS.js → doctor-FF7QOTP2.js} +7 -5
- package/dist/{envs-compare-5K3HESX5.js → envs-compare-P7GPKGQX.js} +4 -4
- package/dist/{envs-create-2XXHXMGA.js → envs-create-ISG4SECU.js} +4 -4
- package/dist/{envs-list-NQM5252B.js → envs-list-PUW67HOC.js} +5 -5
- package/dist/{envs-switch-6L2AQYID.js → envs-switch-P4YDJ6LG.js} +4 -4
- package/dist/{envs-validate-FL73Q76T.js → envs-validate-VNKBKYO3.js} +6 -9
- package/dist/{fs-VH7ATUS3.js → fs-7HKOZY5K.js} +2 -2
- package/dist/{generator-LFZBMZZS.js → generator-O23ATCIY.js} +4 -4
- package/dist/{help-3XJBXEHE.js → help-THFLI6YT.js} +108 -26
- package/dist/index.cjs +295 -381
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +81 -100
- package/dist/{init-Y7JQ2KYJ.js → init-KBLVTHQW.js} +15 -11
- package/dist/{install-hook-SKXIV6NV.js → install-hook-42F22BLY.js} +2 -2
- package/dist/{json-schema-I26YNQBH.js → json-schema-YULPWDKA.js} +3 -3
- package/dist/{key-manager-O3G55WPU.js → key-manager-WDWPX3IQ.js} +3 -3
- package/dist/middleware/express.cjs +1 -3
- package/dist/middleware/express.js +1 -1
- package/dist/middleware/fastify.cjs +1 -7
- package/dist/middleware/fastify.js +1 -1
- package/dist/{module-IDIZPP4M.js → module-FGH2V6N2.js} +3 -3
- package/dist/{protect-NCWPM6VC.js → protect-A4G7LQFJ.js} +26 -24
- package/dist/{scan-TRLY36TT.js → scan-4BXGHR33.js} +1 -1
- package/dist/schema/index.cjs +57 -21
- package/dist/schema/index.js +1 -1
- package/dist/{sync-TMHMTLH2.js → sync-MYLMDDY6.js} +23 -14
- package/dist/{typegen-SQOSXBWM.js → typegen-GLBRHWSK.js} +17 -23
- package/dist/{validate-IOAM5HWS.js → validate-J73ETKXD.js} +5 -5
- package/dist/{vault-decrypt-U6HJZNBV.js → vault-decrypt-V3GY5HES.js} +7 -7
- package/dist/{vault-diff-B3ZOQTWI.js → vault-diff-QVE6S6KP.js} +5 -5
- package/dist/{vault-encrypt-GUSLCSKS.js → vault-encrypt-WUBY3OVF.js} +7 -7
- package/dist/{vault-init-GUBOTOUL.js → vault-init-EWSAED44.js} +5 -5
- package/dist/{vault-rekey-DAHT7JCN.js → vault-rekey-VODMGCNA.js} +7 -7
- package/dist/{vault-status-GDLRU2OK.js → vault-status-YXDK6O7X.js} +4 -4
- package/dist/{vault-verify-CD76FJSF.js → vault-verify-SSXGTVBK.js} +7 -7
- package/package.json +1 -1
- package/dist/comparator-RDKX3OI7.js +0 -13
package/dist/schema/index.cjs
CHANGED
|
@@ -416,9 +416,7 @@ function resolveVariables(vars, schema, aliasMap) {
|
|
|
416
416
|
result[key] = vars[key];
|
|
417
417
|
continue;
|
|
418
418
|
}
|
|
419
|
-
const caseInsensitiveKey = Object.keys(vars).find(
|
|
420
|
-
(k) => k.toLowerCase() === key.toLowerCase()
|
|
421
|
-
);
|
|
419
|
+
const caseInsensitiveKey = Object.keys(vars).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
422
420
|
if (caseInsensitiveKey !== void 0 && vars[caseInsensitiveKey] !== void 0) {
|
|
423
421
|
result[key] = vars[caseInsensitiveKey];
|
|
424
422
|
continue;
|
|
@@ -431,9 +429,7 @@ function resolveVariables(vars, schema, aliasMap) {
|
|
|
431
429
|
foundAlias = true;
|
|
432
430
|
break;
|
|
433
431
|
}
|
|
434
|
-
const ciAlias = Object.keys(vars).find(
|
|
435
|
-
(k) => k.toLowerCase() === alias.toLowerCase()
|
|
436
|
-
);
|
|
432
|
+
const ciAlias = Object.keys(vars).find((k) => k.toLowerCase() === alias.toLowerCase());
|
|
437
433
|
if (ciAlias !== void 0 && vars[ciAlias] !== void 0) {
|
|
438
434
|
result[key] = vars[ciAlias];
|
|
439
435
|
foundAlias = true;
|
|
@@ -459,7 +455,10 @@ function validateValue(rawValue, builder) {
|
|
|
459
455
|
if (builder.meta.required) {
|
|
460
456
|
return { success: false, error: "Value is required" };
|
|
461
457
|
}
|
|
462
|
-
return {
|
|
458
|
+
return {
|
|
459
|
+
success: false,
|
|
460
|
+
error: "Value is undefined and optional (use defineEnv for proper handling)"
|
|
461
|
+
};
|
|
463
462
|
}
|
|
464
463
|
return builder._parse(rawValue);
|
|
465
464
|
}
|
|
@@ -1632,7 +1631,10 @@ function parseAndValidateEmail(raw, opts) {
|
|
|
1632
1631
|
return { success: false, error: "Email must not be empty" };
|
|
1633
1632
|
}
|
|
1634
1633
|
if (trimmed.length > maxLen) {
|
|
1635
|
-
return {
|
|
1634
|
+
return {
|
|
1635
|
+
success: false,
|
|
1636
|
+
error: `Email must be at most ${maxLen} characters, got ${trimmed.length}`
|
|
1637
|
+
};
|
|
1636
1638
|
}
|
|
1637
1639
|
if (!EMAIL_REGEX2.test(trimmed)) {
|
|
1638
1640
|
return { success: false, error: `"${trimmed}" is not a valid email address` };
|
|
@@ -1641,7 +1643,10 @@ function parseAndValidateEmail(raw, opts) {
|
|
|
1641
1643
|
const localPart = trimmed.slice(0, atIndex);
|
|
1642
1644
|
const domain = trimmed.slice(atIndex + 1);
|
|
1643
1645
|
if (localPart.length > maxLocal) {
|
|
1644
|
-
return {
|
|
1646
|
+
return {
|
|
1647
|
+
success: false,
|
|
1648
|
+
error: `Email local part must be at most ${maxLocal} characters, got ${localPart.length}`
|
|
1649
|
+
};
|
|
1645
1650
|
}
|
|
1646
1651
|
if (opts.allowPlusAddressing === false && localPart.includes("+")) {
|
|
1647
1652
|
return { success: false, error: "Plus addressing (+) is not allowed" };
|
|
@@ -1650,7 +1655,10 @@ function parseAndValidateEmail(raw, opts) {
|
|
|
1650
1655
|
const tld = domain.split(".").pop() ?? "";
|
|
1651
1656
|
const allowed = opts.allowedTlds.map((t2) => t2.toLowerCase());
|
|
1652
1657
|
if (!allowed.includes(tld.toLowerCase())) {
|
|
1653
|
-
return {
|
|
1658
|
+
return {
|
|
1659
|
+
success: false,
|
|
1660
|
+
error: `Email TLD must be one of: ${allowed.join(", ")}. Got ".${tld}"`
|
|
1661
|
+
};
|
|
1654
1662
|
}
|
|
1655
1663
|
}
|
|
1656
1664
|
if (opts.blockedDomains !== void 0) {
|
|
@@ -1685,7 +1693,10 @@ function parseAndValidateIp(raw, opts) {
|
|
|
1685
1693
|
}
|
|
1686
1694
|
if (version === "6" && !isV6) {
|
|
1687
1695
|
if (opts.allowMappedV4 === false && isMappedV4) {
|
|
1688
|
-
return {
|
|
1696
|
+
return {
|
|
1697
|
+
success: false,
|
|
1698
|
+
error: `"${trimmed}" is an IPv4-mapped IPv6 address, which is not allowed`
|
|
1699
|
+
};
|
|
1689
1700
|
}
|
|
1690
1701
|
return { success: false, error: `"${trimmed}" is not a valid IPv6 address` };
|
|
1691
1702
|
}
|
|
@@ -1693,7 +1704,10 @@ function parseAndValidateIp(raw, opts) {
|
|
|
1693
1704
|
return { success: false, error: `"${trimmed}" is not a valid IP address` };
|
|
1694
1705
|
}
|
|
1695
1706
|
if (version === "6" && isMappedV4 && opts.allowMappedV4 === false) {
|
|
1696
|
-
return {
|
|
1707
|
+
return {
|
|
1708
|
+
success: false,
|
|
1709
|
+
error: `"${trimmed}" is an IPv4-mapped IPv6 address, which is not allowed`
|
|
1710
|
+
};
|
|
1697
1711
|
}
|
|
1698
1712
|
return { success: true, value: trimmed };
|
|
1699
1713
|
}
|
|
@@ -2042,7 +2056,9 @@ function createBase64Schema(opts) {
|
|
|
2042
2056
|
var SEMVER_CORE = "(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)";
|
|
2043
2057
|
var SEMVER_PRERELEASE = "(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))";
|
|
2044
2058
|
var SEMVER_BUILD = "(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))";
|
|
2045
|
-
var STRICT_SEMVER_REGEX = new RegExp(
|
|
2059
|
+
var STRICT_SEMVER_REGEX = new RegExp(
|
|
2060
|
+
`^${SEMVER_CORE}(?:${SEMVER_PRERELEASE})?(?:${SEMVER_BUILD})?$`
|
|
2061
|
+
);
|
|
2046
2062
|
var LOOSE_SEMVER_REGEX = /^v?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
2047
2063
|
function parseAndValidateSemver(raw, opts) {
|
|
2048
2064
|
const trimmed = raw.trim();
|
|
@@ -2064,7 +2080,9 @@ function parseAndValidateSemver(raw, opts) {
|
|
|
2064
2080
|
};
|
|
2065
2081
|
}
|
|
2066
2082
|
if (!loose) {
|
|
2067
|
-
const match = content.match(
|
|
2083
|
+
const match = content.match(
|
|
2084
|
+
new RegExp(`^${SEMVER_CORE}(?:${SEMVER_PRERELEASE})?(?:${SEMVER_BUILD})?$`)
|
|
2085
|
+
);
|
|
2068
2086
|
if (match) {
|
|
2069
2087
|
const prerelease = match[4];
|
|
2070
2088
|
const build = match[5];
|
|
@@ -2168,7 +2186,14 @@ function parseAndValidateCron(raw, opts) {
|
|
|
2168
2186
|
}
|
|
2169
2187
|
const fields = trimmed.split(/\s+/);
|
|
2170
2188
|
if (opts.allowSeconds === true && fields.length === 6) {
|
|
2171
|
-
const ranges = [
|
|
2189
|
+
const ranges = [
|
|
2190
|
+
[0, 59],
|
|
2191
|
+
[0, 59],
|
|
2192
|
+
[0, 23],
|
|
2193
|
+
[1, 31],
|
|
2194
|
+
[1, 12],
|
|
2195
|
+
[0, 6]
|
|
2196
|
+
];
|
|
2172
2197
|
for (let i = 0; i < fields.length; i++) {
|
|
2173
2198
|
const range = ranges[i] ?? [0, 59];
|
|
2174
2199
|
const error = validateCronField(fields[i] ?? "", range[0] ?? 0, range[1] ?? 0);
|
|
@@ -2177,7 +2202,14 @@ function parseAndValidateCron(raw, opts) {
|
|
|
2177
2202
|
return { success: true, value: trimmed };
|
|
2178
2203
|
}
|
|
2179
2204
|
if (opts.allowYear === true && fields.length === 6) {
|
|
2180
|
-
const ranges = [
|
|
2205
|
+
const ranges = [
|
|
2206
|
+
[0, 59],
|
|
2207
|
+
[0, 23],
|
|
2208
|
+
[1, 31],
|
|
2209
|
+
[1, 12],
|
|
2210
|
+
[0, 6],
|
|
2211
|
+
[1970, 2099]
|
|
2212
|
+
];
|
|
2181
2213
|
for (let i = 0; i < fields.length; i++) {
|
|
2182
2214
|
const range = ranges[i] ?? [0, 59];
|
|
2183
2215
|
const error = validateCronField(fields[i] ?? "", range[0] ?? 0, range[1] ?? 0);
|
|
@@ -2186,7 +2218,13 @@ function parseAndValidateCron(raw, opts) {
|
|
|
2186
2218
|
return { success: true, value: trimmed };
|
|
2187
2219
|
}
|
|
2188
2220
|
if (fields.length === 5) {
|
|
2189
|
-
const ranges = [
|
|
2221
|
+
const ranges = [
|
|
2222
|
+
[0, 59],
|
|
2223
|
+
[0, 23],
|
|
2224
|
+
[1, 31],
|
|
2225
|
+
[1, 12],
|
|
2226
|
+
[0, 6]
|
|
2227
|
+
];
|
|
2190
2228
|
for (let i = 0; i < fields.length; i++) {
|
|
2191
2229
|
const range = ranges[i] ?? [0, 59];
|
|
2192
2230
|
const error = validateCronField(fields[i] ?? "", range[0] ?? 0, range[1] ?? 0);
|
|
@@ -3961,10 +3999,8 @@ function defineEnv(schema, vars, options) {
|
|
|
3961
3999
|
const messages = result.errors.map((e) => ` - ${e.field}: ${e.message}`).join("\n");
|
|
3962
4000
|
const unknownMsg = result.unknown.length > 0 ? `
|
|
3963
4001
|
Unknown variables: ${result.unknown.join(", ")}` : "";
|
|
3964
|
-
throw new Error(
|
|
3965
|
-
|
|
3966
|
-
${messages}${unknownMsg}`
|
|
3967
|
-
);
|
|
4002
|
+
throw new Error(`Environment validation failed:
|
|
4003
|
+
${messages}${unknownMsg}`);
|
|
3968
4004
|
}
|
|
3969
4005
|
return result.values;
|
|
3970
4006
|
}
|
package/dist/schema/index.js
CHANGED
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "./chunk-YN2KGTCB.js";
|
|
16
16
|
import {
|
|
17
17
|
exists
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-FSKVYBEP.js";
|
|
19
|
+
import "./chunk-N7GOHQBF.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/commands/sync.ts
|
|
22
22
|
import { resolve, join } from "path";
|
|
@@ -56,7 +56,11 @@ async function checkSync(envPath, examplePath, ctx) {
|
|
|
56
56
|
if (ctx.outputFormat === "json") {
|
|
57
57
|
writeJson({ inSync: false, error: ".env file not found" });
|
|
58
58
|
} else {
|
|
59
|
-
writeError(
|
|
59
|
+
writeError(
|
|
60
|
+
yellow(
|
|
61
|
+
' \u26A0 .env file not found. Run "ultraenv sync --mode generate" to create .env.example.'
|
|
62
|
+
)
|
|
63
|
+
);
|
|
60
64
|
}
|
|
61
65
|
return 1;
|
|
62
66
|
}
|
|
@@ -64,11 +68,13 @@ async function checkSync(envPath, examplePath, ctx) {
|
|
|
64
68
|
if (ctx.outputFormat === "json") {
|
|
65
69
|
writeJson({ inSync: false, error: ".env.example not found" });
|
|
66
70
|
} else {
|
|
67
|
-
writeError(
|
|
71
|
+
writeError(
|
|
72
|
+
yellow(' \u26A0 .env.example not found. Run "ultraenv sync --mode generate" to create it.')
|
|
73
|
+
);
|
|
68
74
|
}
|
|
69
75
|
return 1;
|
|
70
76
|
}
|
|
71
|
-
const { compareSync, formatSyncDiff } = await import("./comparator-
|
|
77
|
+
const { compareSync, formatSyncDiff } = await import("./comparator-AIRTWBOL.js");
|
|
72
78
|
const diff = await compareSync(envPath, examplePath);
|
|
73
79
|
if (ctx.outputFormat === "json") {
|
|
74
80
|
writeJson({
|
|
@@ -85,11 +91,14 @@ async function checkSync(envPath, examplePath, ctx) {
|
|
|
85
91
|
writeLine(formatSyncDiff(diff));
|
|
86
92
|
writeLine("");
|
|
87
93
|
if (!diff.inSync) {
|
|
88
|
-
const box = drawBox(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
const box = drawBox(
|
|
95
|
+
[
|
|
96
|
+
"Your .env is out of sync with .env.example.",
|
|
97
|
+
'Run "ultraenv sync --mode generate" to update .env.example',
|
|
98
|
+
'or "ultraenv sync --mode interactive" to review changes.'
|
|
99
|
+
],
|
|
100
|
+
{ title: "ACTION NEEDED", border: "rounded" }
|
|
101
|
+
);
|
|
93
102
|
writeLine(box);
|
|
94
103
|
writeLine("");
|
|
95
104
|
return 1;
|
|
@@ -104,7 +113,7 @@ async function generateSync(envPath, examplePath) {
|
|
|
104
113
|
writeError(yellow(" \u26A0 .env file not found. Create a .env file first."));
|
|
105
114
|
return 1;
|
|
106
115
|
}
|
|
107
|
-
const { generateExampleFile } = await import("./generator-
|
|
116
|
+
const { generateExampleFile } = await import("./generator-O23ATCIY.js");
|
|
108
117
|
await generateExampleFile(envPath, examplePath, {
|
|
109
118
|
includeDescriptions: true,
|
|
110
119
|
includeTypes: true,
|
|
@@ -117,7 +126,7 @@ async function generateSync(envPath, examplePath) {
|
|
|
117
126
|
return 0;
|
|
118
127
|
}
|
|
119
128
|
async function interactiveSync(envPath, examplePath) {
|
|
120
|
-
const { compareSync } = await import("./comparator-
|
|
129
|
+
const { compareSync } = await import("./comparator-AIRTWBOL.js");
|
|
121
130
|
const envExists = await exists(envPath);
|
|
122
131
|
if (!envExists) {
|
|
123
132
|
writeError(yellow(" \u26A0 .env file not found."));
|
|
@@ -144,14 +153,14 @@ async function interactiveSync(envPath, examplePath) {
|
|
|
144
153
|
}
|
|
145
154
|
writeLine("");
|
|
146
155
|
}
|
|
147
|
-
const { generateExampleFile } = await import("./generator-
|
|
156
|
+
const { generateExampleFile } = await import("./generator-O23ATCIY.js");
|
|
148
157
|
await generateExampleFile(envPath, examplePath);
|
|
149
158
|
writeLine(green(` \u2713 Updated ${examplePath}`));
|
|
150
159
|
writeLine("");
|
|
151
160
|
return 0;
|
|
152
161
|
}
|
|
153
162
|
async function watchSync(envPath, examplePath) {
|
|
154
|
-
const { generateExampleFile } = await import("./generator-
|
|
163
|
+
const { generateExampleFile } = await import("./generator-O23ATCIY.js");
|
|
155
164
|
writeLine(bold("\u{1F441}\uFE0F Watching for .env changes..."));
|
|
156
165
|
writeLine(cyan(" Press Ctrl+C to stop."));
|
|
157
166
|
writeLine("");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadWithResult
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XPZC32UY.js";
|
|
4
|
+
import "./chunk-CVJPO3QY.js";
|
|
5
5
|
import {
|
|
6
6
|
bold,
|
|
7
7
|
cyan,
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
writeError,
|
|
14
14
|
writeLine
|
|
15
15
|
} from "./chunk-YN2KGTCB.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FSKVYBEP.js";
|
|
17
17
|
import "./chunk-XC65ORJ5.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-N7GOHQBF.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/commands/typegen.ts
|
|
21
21
|
import { resolve } from "path";
|
|
@@ -26,8 +26,8 @@ async function run(args, ctx) {
|
|
|
26
26
|
const format = args.flags["--format"] ?? "declaration";
|
|
27
27
|
const outFlag = args.flags["--out"];
|
|
28
28
|
const defaultOutPaths = {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
declaration: "src/env.d.ts",
|
|
30
|
+
module: "src/env.ts",
|
|
31
31
|
"json-schema": "env.schema.json"
|
|
32
32
|
};
|
|
33
33
|
const outputPath = outFlag ? resolve(cwd, outFlag) : resolve(cwd, defaultOutPaths[format] ?? "src/env.d.ts");
|
|
@@ -38,30 +38,24 @@ async function run(args, ctx) {
|
|
|
38
38
|
const schema = ctx.config.schema?.definitions;
|
|
39
39
|
let content = "";
|
|
40
40
|
if (format === "declaration") {
|
|
41
|
-
const { generateDeclarationContent } = await import("./declaration-
|
|
42
|
-
content = generateDeclarationContent(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
);
|
|
41
|
+
const { generateDeclarationContent } = await import("./declaration-YGOVZOXG.js");
|
|
42
|
+
content = generateDeclarationContent(result.env, schema, {
|
|
43
|
+
interfaceName,
|
|
44
|
+
jsdoc: true,
|
|
45
|
+
indent: 4
|
|
46
|
+
});
|
|
47
47
|
} else if (format === "module") {
|
|
48
|
-
const { generateModuleContent } = await import("./module-
|
|
48
|
+
const { generateModuleContent } = await import("./module-FGH2V6N2.js");
|
|
49
49
|
if (!schema) {
|
|
50
50
|
writeError(yellow(" Warning: No schema defined. Generating empty module."));
|
|
51
51
|
writeError(yellow(" Add a schema to your .ultraenvrc.json for typed output."));
|
|
52
52
|
}
|
|
53
|
-
content = generateModuleContent(
|
|
54
|
-
schema ?? {},
|
|
55
|
-
{ interfaceName, jsdoc: true, indent: 2 }
|
|
56
|
-
);
|
|
53
|
+
content = generateModuleContent(schema ?? {}, { interfaceName, jsdoc: true, indent: 2 });
|
|
57
54
|
} else if (format === "json-schema") {
|
|
58
|
-
const { generateJsonSchemaContent } = await import("./json-schema-
|
|
59
|
-
content = generateJsonSchemaContent(
|
|
60
|
-
schema ?? {},
|
|
61
|
-
{ includeDescriptions: true, indent: 2 }
|
|
62
|
-
);
|
|
55
|
+
const { generateJsonSchemaContent } = await import("./json-schema-YULPWDKA.js");
|
|
56
|
+
content = generateJsonSchemaContent(schema ?? {}, { includeDescriptions: true, indent: 2 });
|
|
63
57
|
}
|
|
64
|
-
const { writeFile, ensureDir } = await import("./fs-
|
|
58
|
+
const { writeFile, ensureDir } = await import("./fs-7HKOZY5K.js");
|
|
65
59
|
await ensureDir(resolve(outputPath, ".."));
|
|
66
60
|
await writeFile(outputPath, content);
|
|
67
61
|
writeLine(green(` \u2713 Generated ${format} types`));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
drawTable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YLGJQOMM.js";
|
|
4
4
|
import {
|
|
5
5
|
loadWithResult
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XPZC32UY.js";
|
|
7
|
+
import "./chunk-CVJPO3QY.js";
|
|
8
8
|
import {
|
|
9
9
|
bold,
|
|
10
10
|
cyan,
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
writeJson,
|
|
18
18
|
writeLine
|
|
19
19
|
} from "./chunk-YN2KGTCB.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-FSKVYBEP.js";
|
|
21
21
|
import "./chunk-XC65ORJ5.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-N7GOHQBF.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/commands/validate.ts
|
|
25
25
|
import { resolve } from "path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readVaultFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-72UKVOO5.js";
|
|
4
4
|
import {
|
|
5
5
|
bold,
|
|
6
6
|
cyan,
|
|
@@ -15,18 +15,18 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
exists,
|
|
17
17
|
readFile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FSKVYBEP.js";
|
|
19
19
|
import {
|
|
20
20
|
parseKey
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RJTUAMK3.js";
|
|
22
22
|
import {
|
|
23
23
|
decryptValue,
|
|
24
24
|
isEncryptedValue
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-6NFA23AY.js";
|
|
26
26
|
import "./chunk-XC65ORJ5.js";
|
|
27
27
|
import {
|
|
28
28
|
getErrorMessage
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-N7GOHQBF.js";
|
|
30
30
|
|
|
31
31
|
// src/cli/commands/vault-decrypt.ts
|
|
32
32
|
import { resolve, join } from "path";
|
|
@@ -60,7 +60,7 @@ async function run(args, ctx) {
|
|
|
60
60
|
return 1;
|
|
61
61
|
}
|
|
62
62
|
const keysContent = await readFile(keysPath);
|
|
63
|
-
const { parseKeysFile } = await import("./key-manager-
|
|
63
|
+
const { parseKeysFile } = await import("./key-manager-WDWPX3IQ.js");
|
|
64
64
|
const keys = parseKeysFile(keysContent);
|
|
65
65
|
const envKey = keys.get(envName.toLowerCase());
|
|
66
66
|
if (!envKey) {
|
|
@@ -93,7 +93,7 @@ async function run(args, ctx) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
const outputPath = join(baseDir, `.env.${envName}`);
|
|
96
|
-
const { writeFile } = await import("./fs-
|
|
96
|
+
const { writeFile } = await import("./fs-7HKOZY5K.js");
|
|
97
97
|
await writeFile(outputPath, decryptedLines.join("\n"));
|
|
98
98
|
writeLine(green(` \u2713 Decrypted to ${outputPath}`));
|
|
99
99
|
writeLine(green(` \u2713 Variables: ${entry.varCount}`));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readVaultFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-72UKVOO5.js";
|
|
4
4
|
import {
|
|
5
5
|
maskValue
|
|
6
6
|
} from "./chunk-TE7HPLA6.js";
|
|
7
7
|
import {
|
|
8
8
|
parseEnvFile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CVJPO3QY.js";
|
|
10
10
|
import {
|
|
11
11
|
bold,
|
|
12
12
|
cyan,
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
exists,
|
|
23
23
|
readFile
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-FSKVYBEP.js";
|
|
25
25
|
import {
|
|
26
26
|
isEncryptedValue
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6NFA23AY.js";
|
|
28
28
|
import "./chunk-XC65ORJ5.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-N7GOHQBF.js";
|
|
30
30
|
|
|
31
31
|
// src/cli/commands/vault-diff.ts
|
|
32
32
|
import { resolve, join } from "path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readVaultFile,
|
|
3
3
|
writeVaultFile
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-72UKVOO5.js";
|
|
5
5
|
import {
|
|
6
6
|
parseEnvFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CVJPO3QY.js";
|
|
8
8
|
import {
|
|
9
9
|
bold,
|
|
10
10
|
cyan,
|
|
@@ -19,18 +19,18 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
exists,
|
|
21
21
|
readFile
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FSKVYBEP.js";
|
|
23
23
|
import {
|
|
24
24
|
parseKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RJTUAMK3.js";
|
|
26
26
|
import {
|
|
27
27
|
encryptValue,
|
|
28
28
|
isEncryptedValue
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6NFA23AY.js";
|
|
30
30
|
import "./chunk-XC65ORJ5.js";
|
|
31
31
|
import {
|
|
32
32
|
getErrorMessage
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-N7GOHQBF.js";
|
|
34
34
|
|
|
35
35
|
// src/cli/commands/vault-encrypt.ts
|
|
36
36
|
import { resolve, join } from "path";
|
|
@@ -58,7 +58,7 @@ async function run(args, ctx) {
|
|
|
58
58
|
return 1;
|
|
59
59
|
}
|
|
60
60
|
const keysContent = await readFile(keysPath);
|
|
61
|
-
const { parseKeysFile } = await import("./key-manager-
|
|
61
|
+
const { parseKeysFile } = await import("./key-manager-WDWPX3IQ.js");
|
|
62
62
|
const keys = parseKeysFile(keysContent);
|
|
63
63
|
const envKey = keys.get(envName.toLowerCase());
|
|
64
64
|
if (!envKey) {
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
exists,
|
|
17
17
|
writeFile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FSKVYBEP.js";
|
|
19
19
|
import {
|
|
20
20
|
formatKey,
|
|
21
21
|
generateKeysFile,
|
|
22
22
|
parseKey
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-RJTUAMK3.js";
|
|
24
|
+
import "./chunk-6NFA23AY.js";
|
|
25
25
|
import "./chunk-XC65ORJ5.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-N7GOHQBF.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/commands/vault-init.ts
|
|
29
29
|
import { resolve, join } from "path";
|
|
@@ -58,7 +58,7 @@ async function run(args, ctx) {
|
|
|
58
58
|
}
|
|
59
59
|
} else {
|
|
60
60
|
writeLine(cyan(" Generating encryption key..."));
|
|
61
|
-
const { generateMasterKey } = await import("./key-manager-
|
|
61
|
+
const { generateMasterKey } = await import("./key-manager-WDWPX3IQ.js");
|
|
62
62
|
const rawKey = generateMasterKey();
|
|
63
63
|
masterKeyFormatted = formatKey(rawKey);
|
|
64
64
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readVaultFile,
|
|
3
3
|
writeVaultFile
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-72UKVOO5.js";
|
|
5
5
|
import {
|
|
6
6
|
bold,
|
|
7
7
|
cyan,
|
|
@@ -16,22 +16,22 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
exists,
|
|
18
18
|
readFile
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FSKVYBEP.js";
|
|
20
20
|
import {
|
|
21
21
|
formatKey,
|
|
22
22
|
generateMasterKey,
|
|
23
23
|
maskKey,
|
|
24
24
|
parseKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RJTUAMK3.js";
|
|
26
26
|
import {
|
|
27
27
|
decryptValue,
|
|
28
28
|
encryptValue,
|
|
29
29
|
isEncryptedValue
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6NFA23AY.js";
|
|
31
31
|
import "./chunk-XC65ORJ5.js";
|
|
32
32
|
import {
|
|
33
33
|
getErrorMessage
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-N7GOHQBF.js";
|
|
35
35
|
|
|
36
36
|
// src/cli/commands/vault-rekey.ts
|
|
37
37
|
import { resolve, join } from "path";
|
|
@@ -56,7 +56,7 @@ async function run(args, ctx) {
|
|
|
56
56
|
return 1;
|
|
57
57
|
}
|
|
58
58
|
const keysContent = await readFile(keysPath);
|
|
59
|
-
const { parseKeysFile } = await import("./key-manager-
|
|
59
|
+
const { parseKeysFile } = await import("./key-manager-WDWPX3IQ.js");
|
|
60
60
|
const keys = parseKeysFile(keysContent);
|
|
61
61
|
const envKey = keys.get(envName.toLowerCase());
|
|
62
62
|
if (!envKey) {
|
|
@@ -112,7 +112,7 @@ async function run(args, ctx) {
|
|
|
112
112
|
}
|
|
113
113
|
return line;
|
|
114
114
|
});
|
|
115
|
-
const { writeFile } = await import("./fs-
|
|
115
|
+
const { writeFile } = await import("./fs-7HKOZY5K.js");
|
|
116
116
|
await writeFile(keysPath, updatedLines.join("\n"));
|
|
117
117
|
writeLine(yellow(` \u26A0 New key written to ${keysPath}`));
|
|
118
118
|
writeLine(yellow(` New key: ${maskKey(newFormatted)}`));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
drawTable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YLGJQOMM.js";
|
|
4
4
|
import {
|
|
5
5
|
readVaultFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-72UKVOO5.js";
|
|
7
7
|
import {
|
|
8
8
|
bold,
|
|
9
9
|
green,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from "./chunk-YN2KGTCB.js";
|
|
18
18
|
import {
|
|
19
19
|
exists
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-FSKVYBEP.js";
|
|
21
|
+
import "./chunk-N7GOHQBF.js";
|
|
22
22
|
|
|
23
23
|
// src/cli/commands/vault-status.ts
|
|
24
24
|
import { resolve, join } from "path";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computeIntegrity
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5WUBB633.js";
|
|
4
4
|
import {
|
|
5
5
|
readVaultFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-72UKVOO5.js";
|
|
7
7
|
import {
|
|
8
8
|
bold,
|
|
9
9
|
cyan,
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
exists,
|
|
20
20
|
readFile
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FSKVYBEP.js";
|
|
22
22
|
import {
|
|
23
23
|
parseKey
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-RJTUAMK3.js";
|
|
25
|
+
import "./chunk-6NFA23AY.js";
|
|
26
26
|
import "./chunk-XC65ORJ5.js";
|
|
27
27
|
import {
|
|
28
28
|
getErrorMessage
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-N7GOHQBF.js";
|
|
30
30
|
|
|
31
31
|
// src/cli/commands/vault-verify.ts
|
|
32
32
|
import { resolve, join } from "path";
|
|
@@ -59,7 +59,7 @@ async function run(args, ctx) {
|
|
|
59
59
|
return 1;
|
|
60
60
|
}
|
|
61
61
|
const keysContent = await readFile(keysPath);
|
|
62
|
-
const { parseKeysFile } = await import("./key-manager-
|
|
62
|
+
const { parseKeysFile } = await import("./key-manager-WDWPX3IQ.js");
|
|
63
63
|
const keys = parseKeysFile(keysContent);
|
|
64
64
|
const envKey = keys.get(envName.toLowerCase());
|
|
65
65
|
if (!envKey) {
|
package/package.json
CHANGED