@kitsy/cnos 1.10.0 → 1.11.0
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/build/index.cjs +331 -63
- package/dist/build/index.d.cts +1 -1
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +13 -15
- package/dist/{chunk-A5U7EZCJ.js → chunk-2DMCB3PK.js} +1 -1
- package/dist/{chunk-RTHKUGJV.js → chunk-5JGNRADB.js} +1 -1
- package/dist/{chunk-3EZGPQCE.js → chunk-DPC2BV3S.js} +1 -1
- package/dist/{chunk-FHXLOWAB.js → chunk-KJ57PF47.js} +1 -1
- package/dist/{chunk-CSA4L64V.js → chunk-NFGPS7VJ.js} +10 -10
- package/dist/{chunk-ESBHCFC6.js → chunk-NU25VFA2.js} +1 -1
- package/dist/{chunk-UGLATJJD.js → chunk-RNTTPI5S.js} +1 -1
- package/dist/{chunk-UKNL2Y4N.js → chunk-T3E57MSQ.js} +1 -1
- package/dist/{chunk-MQ4WG3K6.js → chunk-WPB4HB2K.js} +320 -49
- package/dist/{chunk-EIK7OUFP.js → chunk-XGK6DXQL.js} +157 -37
- package/dist/configure/index.cjs +329 -59
- package/dist/configure/index.d.cts +3 -3
- package/dist/configure/index.d.ts +3 -3
- package/dist/configure/index.js +8 -8
- package/dist/{core-Ud1o2MBn.d.cts → core-BW8SLnRx.d.cts} +34 -2
- package/dist/{core-Ud1o2MBn.d.ts → core-BW8SLnRx.d.ts} +34 -2
- package/dist/{envNaming-DxxqiGKN.d.cts → envNaming-1rk7BR0e.d.cts} +1 -1
- package/dist/{envNaming-CPwXl4I6.d.ts → envNaming-CjL28IeH.d.ts} +1 -1
- package/dist/index.cjs +480 -91
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -10
- package/dist/internal.cjs +89 -23
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +2 -2
- package/dist/plugin/basic-schema.cjs +4 -1
- package/dist/plugin/basic-schema.d.cts +1 -1
- package/dist/plugin/basic-schema.d.ts +1 -1
- package/dist/plugin/basic-schema.js +2 -2
- package/dist/plugin/cli-args.cjs +4 -1
- package/dist/plugin/cli-args.d.cts +1 -1
- package/dist/plugin/cli-args.d.ts +1 -1
- package/dist/plugin/cli-args.js +2 -2
- package/dist/plugin/dotenv.cjs +6 -3
- package/dist/plugin/dotenv.d.cts +2 -2
- package/dist/plugin/dotenv.d.ts +2 -2
- package/dist/plugin/dotenv.js +2 -2
- package/dist/plugin/env-export.cjs +5 -2
- package/dist/plugin/env-export.d.cts +2 -2
- package/dist/plugin/env-export.d.ts +2 -2
- package/dist/plugin/env-export.js +2 -2
- package/dist/plugin/filesystem.cjs +13 -10
- package/dist/plugin/filesystem.d.cts +1 -1
- package/dist/plugin/filesystem.d.ts +1 -1
- package/dist/plugin/filesystem.js +2 -2
- package/dist/plugin/process-env.cjs +4 -1
- package/dist/plugin/process-env.d.cts +2 -2
- package/dist/plugin/process-env.d.ts +2 -2
- package/dist/plugin/process-env.js +2 -2
- package/dist/runtime/index.cjs +480 -91
- package/dist/runtime/index.d.cts +13 -6
- package/dist/runtime/index.d.ts +13 -6
- package/dist/runtime/index.js +10 -10
- package/dist/{toPublicEnv-fUZMRUOz.d.cts → toPublicEnv-CZzpvhGg.d.cts} +1 -1
- package/dist/{toPublicEnv-C9wPSpRo.d.ts → toPublicEnv-CmydGcxg.d.ts} +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CnosSingleton, default as cnos, default } from './runtime/index.cjs';
|
|
2
|
-
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-
|
|
1
|
+
export { CnosSingleton, CnosSingletonProjectionOptions, default as cnos, default } from './runtime/index.cjs';
|
|
2
|
+
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-BW8SLnRx.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CnosSingleton, default as cnos, default } from './runtime/index.js';
|
|
2
|
-
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-
|
|
1
|
+
export { CnosSingleton, CnosSingletonProjectionOptions, default as cnos, default } from './runtime/index.js';
|
|
2
|
+
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-BW8SLnRx.js';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runtime_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XGK6DXQL.js";
|
|
4
|
+
import "./chunk-T3E57MSQ.js";
|
|
5
|
+
import "./chunk-NFGPS7VJ.js";
|
|
6
|
+
import "./chunk-5JGNRADB.js";
|
|
7
|
+
import "./chunk-NU25VFA2.js";
|
|
8
|
+
import "./chunk-RNTTPI5S.js";
|
|
9
|
+
import "./chunk-2DMCB3PK.js";
|
|
10
|
+
import "./chunk-KJ57PF47.js";
|
|
11
|
+
import "./chunk-DPC2BV3S.js";
|
|
12
|
+
import "./chunk-WPB4HB2K.js";
|
|
13
13
|
export {
|
|
14
14
|
runtime_default as cnos,
|
|
15
15
|
runtime_default as default
|
package/dist/internal.cjs
CHANGED
|
@@ -1295,11 +1295,19 @@ function normalizeVaults(vaults) {
|
|
|
1295
1295
|
throw new CnosManifestError(`Vault "${name}" requires a provider`);
|
|
1296
1296
|
}
|
|
1297
1297
|
const normalizedAuth = normalizeVaultAuth(name, provider, definition.auth);
|
|
1298
|
-
const normalizedMapping =
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1298
|
+
const normalizedMapping = normalizeVaultMapping(definition.mapping);
|
|
1299
|
+
const fallback = (definition.fallback ?? []).map((entry, index) => {
|
|
1300
|
+
const fallbackProvider = entry.provider?.trim();
|
|
1301
|
+
if (!fallbackProvider) {
|
|
1302
|
+
throw new CnosManifestError(`Vault "${name}" fallback ${index + 1} requires a provider`);
|
|
1303
|
+
}
|
|
1304
|
+
const fallbackMapping = normalizeVaultMapping(entry.mapping);
|
|
1305
|
+
return {
|
|
1306
|
+
provider: fallbackProvider,
|
|
1307
|
+
auth: normalizeVaultAuth(name, fallbackProvider, entry.auth),
|
|
1308
|
+
...Object.keys(fallbackMapping).length > 0 ? { mapping: fallbackMapping } : {}
|
|
1309
|
+
};
|
|
1310
|
+
});
|
|
1303
1311
|
return [
|
|
1304
1312
|
name,
|
|
1305
1313
|
{
|
|
@@ -1307,12 +1315,20 @@ function normalizeVaults(vaults) {
|
|
|
1307
1315
|
auth: normalizedAuth,
|
|
1308
1316
|
...Object.keys(normalizedMapping).length > 0 ? {
|
|
1309
1317
|
mapping: normalizedMapping
|
|
1310
|
-
} : {}
|
|
1318
|
+
} : {},
|
|
1319
|
+
...fallback.length > 0 ? { fallback } : {}
|
|
1311
1320
|
}
|
|
1312
1321
|
];
|
|
1313
1322
|
})
|
|
1314
1323
|
);
|
|
1315
1324
|
}
|
|
1325
|
+
function normalizeVaultMapping(mapping) {
|
|
1326
|
+
return Object.fromEntries(
|
|
1327
|
+
Object.entries(mapping ?? {}).filter(
|
|
1328
|
+
(entry) => typeof entry[0] === "string" && typeof entry[1] === "string"
|
|
1329
|
+
).map(([envVar, logicalRef]) => [envVar.trim(), logicalRef.trim()]).filter(([envVar, logicalRef]) => envVar.length > 0 && logicalRef.length > 0)
|
|
1330
|
+
);
|
|
1331
|
+
}
|
|
1316
1332
|
function normalizeAuthSources(value) {
|
|
1317
1333
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
1318
1334
|
return void 0;
|
|
@@ -1636,7 +1652,7 @@ function isObject(value) {
|
|
|
1636
1652
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1637
1653
|
}
|
|
1638
1654
|
function isSecretReference(value) {
|
|
1639
|
-
return isObject(value) && typeof value.provider === "string" && value.provider.trim().length > 0 && typeof value.ref === "string" && value.ref.trim().length > 0 && (value.vault === void 0 && true || typeof value.vault === "string" && value.vault.trim().length > 0) && Object.keys(value).every((key) => ["provider", "ref", "vault"].includes(key));
|
|
1655
|
+
return isObject(value) && (value.provider === void 0 || typeof value.provider === "string" && value.provider.trim().length > 0) && typeof value.ref === "string" && value.ref.trim().length > 0 && (value.vault === void 0 && true || typeof value.vault === "string" && value.vault.trim().length > 0) && Object.keys(value).every((key) => ["provider", "ref", "vault"].includes(key));
|
|
1640
1656
|
}
|
|
1641
1657
|
function resolveSecretStoreRoot(processEnv = process.env) {
|
|
1642
1658
|
return import_node_path11.default.resolve(expandHomePath(processEnv.CNOS_SECRET_HOME ?? "~/.cnos/secrets"));
|
|
@@ -2138,7 +2154,7 @@ var LocalSecretVaultProvider = class _LocalSecretVaultProvider {
|
|
|
2138
2154
|
};
|
|
2139
2155
|
|
|
2140
2156
|
// ../core/src/secrets/providers/registry.ts
|
|
2141
|
-
function createSecretVaultProvider(vaultId, definition, processEnv) {
|
|
2157
|
+
function createSecretVaultProvider(vaultId, definition, processEnv, factories = []) {
|
|
2142
2158
|
if (definition.provider === "local") {
|
|
2143
2159
|
return new LocalSecretVaultProvider(vaultId, definition, processEnv);
|
|
2144
2160
|
}
|
|
@@ -2148,9 +2164,16 @@ function createSecretVaultProvider(vaultId, definition, processEnv) {
|
|
|
2148
2164
|
if (definition.provider === "github-secrets") {
|
|
2149
2165
|
return new GithubSecretsVaultProvider(vaultId, definition, processEnv);
|
|
2150
2166
|
}
|
|
2167
|
+
const factory = factories.find((candidate) => candidate.provider === definition.provider);
|
|
2168
|
+
if (factory) {
|
|
2169
|
+
return factory.create(vaultId, definition, processEnv);
|
|
2170
|
+
}
|
|
2151
2171
|
throw new CnosManifestError(`Unsupported vault provider: ${definition.provider}`);
|
|
2152
2172
|
}
|
|
2153
2173
|
|
|
2174
|
+
// ../core/src/secrets/resolveAuth.ts
|
|
2175
|
+
var import_promises12 = require("fs/promises");
|
|
2176
|
+
|
|
2154
2177
|
// ../core/src/secrets/prompt.ts
|
|
2155
2178
|
var import_node_readline = __toESM(require("readline"), 1);
|
|
2156
2179
|
var import_node_stream = require("stream");
|
|
@@ -2191,6 +2214,23 @@ function toAuthError(vaultId, sources) {
|
|
|
2191
2214
|
`Cannot authenticate to vault "${vaultId}". Tried: ${sources.join(", ")}. Set ${getVaultPassphraseEnvVar(vaultId)} or run cnos vault auth ${vaultId}.`
|
|
2192
2215
|
);
|
|
2193
2216
|
}
|
|
2217
|
+
async function resolveTokenFromSource(source, processEnv) {
|
|
2218
|
+
if (source.startsWith("env:")) {
|
|
2219
|
+
return processEnv[source.slice(4)] || void 0;
|
|
2220
|
+
}
|
|
2221
|
+
if (source.startsWith("file:")) {
|
|
2222
|
+
try {
|
|
2223
|
+
const value = await (0, import_promises12.readFile)(expandHomePath(source.slice("file:".length)), "utf8");
|
|
2224
|
+
return value.trim() || void 0;
|
|
2225
|
+
} catch {
|
|
2226
|
+
return void 0;
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (source.startsWith("keychain:")) {
|
|
2230
|
+
return readKeychain(source.slice("keychain:".length));
|
|
2231
|
+
}
|
|
2232
|
+
return void 0;
|
|
2233
|
+
}
|
|
2194
2234
|
async function resolveVaultAuth(vaultId, definition, processEnv = process.env) {
|
|
2195
2235
|
const sessionKey = await resolveVaultSessionKey(vaultId, processEnv);
|
|
2196
2236
|
if (sessionKey) {
|
|
@@ -2206,6 +2246,32 @@ async function resolveVaultAuth(vaultId, definition, processEnv = process.env) {
|
|
|
2206
2246
|
...definition.auth?.config ? { config: definition.auth.config } : {}
|
|
2207
2247
|
};
|
|
2208
2248
|
}
|
|
2249
|
+
if (definition.auth?.method === "iam") {
|
|
2250
|
+
return {
|
|
2251
|
+
method: "iam",
|
|
2252
|
+
...definition.auth?.config ? { config: definition.auth.config } : {}
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
if (definition.auth?.method === "environment") {
|
|
2256
|
+
return {
|
|
2257
|
+
method: "environment",
|
|
2258
|
+
...definition.auth?.config ? { config: definition.auth.config } : {}
|
|
2259
|
+
};
|
|
2260
|
+
}
|
|
2261
|
+
const tokenSources = definition.auth?.token?.from ?? [];
|
|
2262
|
+
for (const source of tokenSources) {
|
|
2263
|
+
const token = await resolveTokenFromSource(source, processEnv);
|
|
2264
|
+
if (token) {
|
|
2265
|
+
return {
|
|
2266
|
+
token,
|
|
2267
|
+
method: "token",
|
|
2268
|
+
...definition.auth?.config ? { config: definition.auth.config } : {}
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
if (definition.auth?.method === "token") {
|
|
2273
|
+
throw toAuthError(vaultId, [getVaultSessionKeyEnvVar(vaultId), ...tokenSources]);
|
|
2274
|
+
}
|
|
2209
2275
|
const sources = definition.auth?.passphrase?.from ?? [getVaultPassphraseEnvVar(vaultId)];
|
|
2210
2276
|
for (const source of sources) {
|
|
2211
2277
|
if (source.startsWith("env:")) {
|
|
@@ -2254,7 +2320,7 @@ async function resolveVaultAuth(vaultId, definition, processEnv = process.env) {
|
|
|
2254
2320
|
var import_node_crypto3 = require("crypto");
|
|
2255
2321
|
|
|
2256
2322
|
// ../core/src/runtime/dump.ts
|
|
2257
|
-
var
|
|
2323
|
+
var import_promises13 = require("fs/promises");
|
|
2258
2324
|
var import_node_path13 = __toESM(require("path"), 1);
|
|
2259
2325
|
|
|
2260
2326
|
// ../core/src/utils/envNaming.ts
|
|
@@ -2656,7 +2722,7 @@ function generateCodegenContent(manifest, sourcePath, typeModuleImport = "./cnos
|
|
|
2656
2722
|
}
|
|
2657
2723
|
|
|
2658
2724
|
// src/codegen/writeOutput.ts
|
|
2659
|
-
var
|
|
2725
|
+
var import_promises14 = require("fs/promises");
|
|
2660
2726
|
var import_node_path14 = __toESM(require("path"), 1);
|
|
2661
2727
|
function stripTsExtension(filePath) {
|
|
2662
2728
|
return filePath.replace(/(\.d)?\.[cm]?tsx?$/i, "").replace(/\.[cm]?jsx?$/i, "");
|
|
@@ -2676,10 +2742,10 @@ async function writeCodegenOutput(options = {}) {
|
|
|
2676
2742
|
const outputRoot = loadedManifest.rootResolution.remote ? loadedManifest.consumerRoot : loadedManifest.repoRoot;
|
|
2677
2743
|
const paths = resolveCodegenPaths(outputRoot, options.out);
|
|
2678
2744
|
const generated = generateCodegenContent(loadedManifest.manifest, loadedManifest.manifestPath, paths.typeImportPath);
|
|
2679
|
-
await (0,
|
|
2680
|
-
await (0,
|
|
2681
|
-
await (0,
|
|
2682
|
-
await (0,
|
|
2745
|
+
await (0, import_promises14.mkdir)(import_node_path14.default.dirname(paths.typesPath), { recursive: true });
|
|
2746
|
+
await (0, import_promises14.mkdir)(import_node_path14.default.dirname(paths.runtimePath), { recursive: true });
|
|
2747
|
+
await (0, import_promises14.writeFile)(paths.typesPath, generated.typesContent, "utf8");
|
|
2748
|
+
await (0, import_promises14.writeFile)(paths.runtimePath, generated.runtimeContent, "utf8");
|
|
2683
2749
|
return {
|
|
2684
2750
|
manifestPath: loadedManifest.manifestPath,
|
|
2685
2751
|
typesPath: paths.typesPath,
|
|
@@ -2982,7 +3048,7 @@ function formatDriftReport(report) {
|
|
|
2982
3048
|
}
|
|
2983
3049
|
|
|
2984
3050
|
// src/migrate/applyManifest.ts
|
|
2985
|
-
var
|
|
3051
|
+
var import_promises15 = require("fs/promises");
|
|
2986
3052
|
function sortRecord(record) {
|
|
2987
3053
|
return Object.fromEntries(Object.entries(record).sort(([left], [right]) => left.localeCompare(right)));
|
|
2988
3054
|
}
|
|
@@ -3017,7 +3083,7 @@ async function applyManifestMappings(proposals, root) {
|
|
|
3017
3083
|
promote: Array.from(promoted).sort((left, right) => left.localeCompare(right))
|
|
3018
3084
|
};
|
|
3019
3085
|
}
|
|
3020
|
-
await (0,
|
|
3086
|
+
await (0, import_promises15.writeFile)(loadedManifest.manifestPath, stringifyYaml(rawManifest), "utf8");
|
|
3021
3087
|
return {
|
|
3022
3088
|
manifestPath: loadedManifest.manifestPath,
|
|
3023
3089
|
appliedMappings,
|
|
@@ -3052,7 +3118,7 @@ function proposeMapping(envVar) {
|
|
|
3052
3118
|
}
|
|
3053
3119
|
|
|
3054
3120
|
// src/migrate/rewriteSource.ts
|
|
3055
|
-
var
|
|
3121
|
+
var import_promises16 = require("fs/promises");
|
|
3056
3122
|
function importStatementFor(kind) {
|
|
3057
3123
|
return kind === "import-meta-env" ? "import cnos from '@kitsy/cnos/browser';" : "import cnos from '@kitsy/cnos';";
|
|
3058
3124
|
}
|
|
@@ -3073,7 +3139,7 @@ async function rewriteSourceFiles(usages, proposals) {
|
|
|
3073
3139
|
const backupFiles = [];
|
|
3074
3140
|
const skippedUsages = [];
|
|
3075
3141
|
for (const [filePath, fileUsages] of fileGroups.entries()) {
|
|
3076
|
-
const original = await (0,
|
|
3142
|
+
const original = await (0, import_promises16.readFile)(filePath, "utf8");
|
|
3077
3143
|
let nextSource = original;
|
|
3078
3144
|
let changed = false;
|
|
3079
3145
|
const importKinds = /* @__PURE__ */ new Set();
|
|
@@ -3100,7 +3166,7 @@ async function rewriteSourceFiles(usages, proposals) {
|
|
|
3100
3166
|
continue;
|
|
3101
3167
|
}
|
|
3102
3168
|
const backupPath = `${filePath}.bak`;
|
|
3103
|
-
await (0,
|
|
3169
|
+
await (0, import_promises16.copyFile)(filePath, backupPath);
|
|
3104
3170
|
backupFiles.push(backupPath);
|
|
3105
3171
|
for (const kind of Array.from(importKinds)) {
|
|
3106
3172
|
const importStatement = importStatementFor(kind);
|
|
@@ -3109,7 +3175,7 @@ async function rewriteSourceFiles(usages, proposals) {
|
|
|
3109
3175
|
${nextSource}`;
|
|
3110
3176
|
}
|
|
3111
3177
|
}
|
|
3112
|
-
await (0,
|
|
3178
|
+
await (0, import_promises16.writeFile)(filePath, nextSource, "utf8");
|
|
3113
3179
|
rewrittenFiles.push(filePath);
|
|
3114
3180
|
}
|
|
3115
3181
|
return {
|
|
@@ -3120,7 +3186,7 @@ ${nextSource}`;
|
|
|
3120
3186
|
}
|
|
3121
3187
|
|
|
3122
3188
|
// src/migrate/scanEnvUsage.ts
|
|
3123
|
-
var
|
|
3189
|
+
var import_promises17 = require("fs/promises");
|
|
3124
3190
|
var import_node_path15 = __toESM(require("path"), 1);
|
|
3125
3191
|
var SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".cts", ".mjs", ".cjs"]);
|
|
3126
3192
|
var PROCESS_ENV_DOT = /process\.env\.([A-Z][A-Z0-9_]*)/g;
|
|
@@ -3128,7 +3194,7 @@ var PROCESS_ENV_BRACKET = /process\.env\[['"]([A-Z][A-Z0-9_]*)['"]\]/g;
|
|
|
3128
3194
|
var IMPORT_META_ENV_DOT = /import\.meta\.env\.([A-Z][A-Z0-9_]*)/g;
|
|
3129
3195
|
var IMPORT_META_ENV_BRACKET = /import\.meta\.env\[['"]([A-Z][A-Z0-9_]*)['"]\]/g;
|
|
3130
3196
|
async function collectFiles(root) {
|
|
3131
|
-
const entries = await (0,
|
|
3197
|
+
const entries = await (0, import_promises17.readdir)(root, { withFileTypes: true });
|
|
3132
3198
|
const files = [];
|
|
3133
3199
|
for (const entry of entries) {
|
|
3134
3200
|
const filePath = import_node_path15.default.join(root, entry.name);
|
|
@@ -3165,7 +3231,7 @@ async function scanEnvUsage(scanRoot) {
|
|
|
3165
3231
|
const files = await collectFiles(scanRoot);
|
|
3166
3232
|
const usages = [];
|
|
3167
3233
|
for (const filePath of files) {
|
|
3168
|
-
const source = await (0,
|
|
3234
|
+
const source = await (0, import_promises17.readFile)(filePath, "utf8");
|
|
3169
3235
|
usages.push(...collectMatches(filePath, source, PROCESS_ENV_DOT, "process-env"));
|
|
3170
3236
|
usages.push(...collectMatches(filePath, source, PROCESS_ENV_BRACKET, "process-env"));
|
|
3171
3237
|
usages.push(...collectMatches(filePath, source, IMPORT_META_ENV_DOT, "import-meta-env"));
|
package/dist/internal.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as
|
|
2
|
-
export { l as RuntimeProvider,
|
|
1
|
+
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProviderFactory, t as SecretVaultProvider, u as ResolvedRoot, m as NamespaceName, v as RootResolution, w as SecretReference, g as CnosRuntime, x as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-BW8SLnRx.cjs';
|
|
2
|
+
export { l as RuntimeProvider, y as ValidationIssue, z as WorkspaceFile } from './core-BW8SLnRx.cjs';
|
|
3
3
|
|
|
4
4
|
declare class CnosError extends Error {
|
|
5
5
|
constructor(message: string);
|
|
@@ -36,7 +36,7 @@ declare function writeVaultSessionKey(vault: string, derivedKey: Buffer, process
|
|
|
36
36
|
declare function clearVaultSessionKey(vault: string, processEnv?: Record<string, string | undefined>): Promise<void>;
|
|
37
37
|
declare function clearAllVaultSessionKeys(processEnv?: Record<string, string | undefined>): Promise<void>;
|
|
38
38
|
|
|
39
|
-
declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined
|
|
39
|
+
declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined>, factories?: SecretVaultProviderFactory[]): SecretVaultProvider;
|
|
40
40
|
|
|
41
41
|
interface ParsedGitUri {
|
|
42
42
|
uri: string;
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as
|
|
2
|
-
export { l as RuntimeProvider,
|
|
1
|
+
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProviderFactory, t as SecretVaultProvider, u as ResolvedRoot, m as NamespaceName, v as RootResolution, w as SecretReference, g as CnosRuntime, x as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-BW8SLnRx.js';
|
|
2
|
+
export { l as RuntimeProvider, y as ValidationIssue, z as WorkspaceFile } from './core-BW8SLnRx.js';
|
|
3
3
|
|
|
4
4
|
declare class CnosError extends Error {
|
|
5
5
|
constructor(message: string);
|
|
@@ -36,7 +36,7 @@ declare function writeVaultSessionKey(vault: string, derivedKey: Buffer, process
|
|
|
36
36
|
declare function clearVaultSessionKey(vault: string, processEnv?: Record<string, string | undefined>): Promise<void>;
|
|
37
37
|
declare function clearAllVaultSessionKeys(processEnv?: Record<string, string | undefined>): Promise<void>;
|
|
38
38
|
|
|
39
|
-
declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined
|
|
39
|
+
declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined>, factories?: SecretVaultProviderFactory[]): SecretVaultProvider;
|
|
40
40
|
|
|
41
41
|
interface ParsedGitUri {
|
|
42
42
|
uri: string;
|
package/dist/internal.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
serializeRuntimeGraph,
|
|
12
12
|
serializeSecretPayload,
|
|
13
13
|
serializeServerProjection
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-T3E57MSQ.js";
|
|
15
15
|
import {
|
|
16
16
|
CnosAuthenticationError,
|
|
17
17
|
CnosSecurityError,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
writeLocalSecret,
|
|
65
65
|
writeRemoteRootCacheMetadata,
|
|
66
66
|
writeVaultSessionKey
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-WPB4HB2K.js";
|
|
68
68
|
|
|
69
69
|
// src/codegen/generateTypes.ts
|
|
70
70
|
function toPascalCase(value) {
|
|
@@ -270,6 +270,9 @@ var import_node_path11 = __toESM(require("path"), 1);
|
|
|
270
270
|
var import_promises9 = require("fs/promises");
|
|
271
271
|
var import_node_path10 = __toESM(require("path"), 1);
|
|
272
272
|
|
|
273
|
+
// ../core/src/secrets/resolveAuth.ts
|
|
274
|
+
var import_promises12 = require("fs/promises");
|
|
275
|
+
|
|
273
276
|
// ../core/src/secrets/prompt.ts
|
|
274
277
|
var import_node_readline = __toESM(require("readline"), 1);
|
|
275
278
|
var import_node_stream = require("stream");
|
|
@@ -278,7 +281,7 @@ var import_node_stream = require("stream");
|
|
|
278
281
|
var import_node_crypto3 = require("crypto");
|
|
279
282
|
|
|
280
283
|
// ../core/src/runtime/dump.ts
|
|
281
|
-
var
|
|
284
|
+
var import_promises13 = require("fs/promises");
|
|
282
285
|
var import_node_path13 = __toESM(require("path"), 1);
|
|
283
286
|
|
|
284
287
|
// ../../plugins/basic-schema/src/index.ts
|
package/dist/plugin/cli-args.cjs
CHANGED
|
@@ -112,6 +112,9 @@ var import_node_path11 = __toESM(require("path"), 1);
|
|
|
112
112
|
var import_promises9 = require("fs/promises");
|
|
113
113
|
var import_node_path10 = __toESM(require("path"), 1);
|
|
114
114
|
|
|
115
|
+
// ../core/src/secrets/resolveAuth.ts
|
|
116
|
+
var import_promises12 = require("fs/promises");
|
|
117
|
+
|
|
115
118
|
// ../core/src/secrets/prompt.ts
|
|
116
119
|
var import_node_readline = __toESM(require("readline"), 1);
|
|
117
120
|
var import_node_stream = require("stream");
|
|
@@ -120,7 +123,7 @@ var import_node_stream = require("stream");
|
|
|
120
123
|
var import_node_crypto3 = require("crypto");
|
|
121
124
|
|
|
122
125
|
// ../core/src/runtime/dump.ts
|
|
123
|
-
var
|
|
126
|
+
var import_promises13 = require("fs/promises");
|
|
124
127
|
var import_node_path13 = __toESM(require("path"), 1);
|
|
125
128
|
|
|
126
129
|
// ../../plugins/cli-args/src/index.ts
|
package/dist/plugin/cli-args.js
CHANGED
package/dist/plugin/dotenv.cjs
CHANGED
|
@@ -37,7 +37,7 @@ __export(dotenv_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(dotenv_exports);
|
|
38
38
|
|
|
39
39
|
// ../../plugins/dotenv/src/index.ts
|
|
40
|
-
var
|
|
40
|
+
var import_promises14 = require("fs/promises");
|
|
41
41
|
var import_node_path14 = __toESM(require("path"), 1);
|
|
42
42
|
|
|
43
43
|
// ../core/src/keychain/linux.ts
|
|
@@ -138,6 +138,9 @@ var import_node_path11 = __toESM(require("path"), 1);
|
|
|
138
138
|
var import_promises9 = require("fs/promises");
|
|
139
139
|
var import_node_path10 = __toESM(require("path"), 1);
|
|
140
140
|
|
|
141
|
+
// ../core/src/secrets/resolveAuth.ts
|
|
142
|
+
var import_promises12 = require("fs/promises");
|
|
143
|
+
|
|
141
144
|
// ../core/src/secrets/prompt.ts
|
|
142
145
|
var import_node_readline = __toESM(require("readline"), 1);
|
|
143
146
|
var import_node_stream = require("stream");
|
|
@@ -146,7 +149,7 @@ var import_node_stream = require("stream");
|
|
|
146
149
|
var import_node_crypto3 = require("crypto");
|
|
147
150
|
|
|
148
151
|
// ../core/src/runtime/dump.ts
|
|
149
|
-
var
|
|
152
|
+
var import_promises13 = require("fs/promises");
|
|
150
153
|
var import_node_path13 = __toESM(require("path"), 1);
|
|
151
154
|
|
|
152
155
|
// ../core/src/utils/envNaming.ts
|
|
@@ -267,7 +270,7 @@ function dotenvEntriesFromObject(values, mapping = {}, originFile, workspaceId =
|
|
|
267
270
|
}
|
|
268
271
|
async function readIfPresent(filePath) {
|
|
269
272
|
try {
|
|
270
|
-
return await (0,
|
|
273
|
+
return await (0, import_promises14.readFile)(filePath, "utf8");
|
|
271
274
|
} catch {
|
|
272
275
|
return void 0;
|
|
273
276
|
}
|
package/dist/plugin/dotenv.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../core-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../core-BW8SLnRx.cjs';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-1rk7BR0e.cjs';
|
|
3
3
|
|
|
4
4
|
declare function parseDotenv(document: string): Record<string, string>;
|
|
5
5
|
declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
|
package/dist/plugin/dotenv.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../core-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../core-BW8SLnRx.js';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-CjL28IeH.js';
|
|
3
3
|
|
|
4
4
|
declare function parseDotenv(document: string): Record<string, string>;
|
|
5
5
|
declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
|
package/dist/plugin/dotenv.js
CHANGED
|
@@ -150,9 +150,12 @@ function isObject(value) {
|
|
|
150
150
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
151
151
|
}
|
|
152
152
|
function isSecretReference(value) {
|
|
153
|
-
return isObject(value) && typeof value.provider === "string" && value.provider.trim().length > 0 && typeof value.ref === "string" && value.ref.trim().length > 0 && (value.vault === void 0 && true || typeof value.vault === "string" && value.vault.trim().length > 0) && Object.keys(value).every((key) => ["provider", "ref", "vault"].includes(key));
|
|
153
|
+
return isObject(value) && (value.provider === void 0 || typeof value.provider === "string" && value.provider.trim().length > 0) && typeof value.ref === "string" && value.ref.trim().length > 0 && (value.vault === void 0 && true || typeof value.vault === "string" && value.vault.trim().length > 0) && Object.keys(value).every((key) => ["provider", "ref", "vault"].includes(key));
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
// ../core/src/secrets/resolveAuth.ts
|
|
157
|
+
var import_promises12 = require("fs/promises");
|
|
158
|
+
|
|
156
159
|
// ../core/src/secrets/prompt.ts
|
|
157
160
|
var import_node_readline = __toESM(require("readline"), 1);
|
|
158
161
|
var import_node_stream = require("stream");
|
|
@@ -263,7 +266,7 @@ function toPublicEnv(graph, manifest, options = {}, helpers = {}) {
|
|
|
263
266
|
}
|
|
264
267
|
|
|
265
268
|
// ../core/src/runtime/dump.ts
|
|
266
|
-
var
|
|
269
|
+
var import_promises13 = require("fs/promises");
|
|
267
270
|
var import_node_path13 = __toESM(require("path"), 1);
|
|
268
271
|
|
|
269
272
|
// ../../plugins/env-export/src/index.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExporterPlugin } from '../core-
|
|
2
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { E as ExporterPlugin } from '../core-BW8SLnRx.cjs';
|
|
2
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CZzpvhGg.cjs';
|
|
3
3
|
|
|
4
4
|
declare function createEnvExportPlugin(): ExporterPlugin;
|
|
5
5
|
declare function createPublicEnvExportPlugin(): ExporterPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExporterPlugin } from '../core-
|
|
2
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { E as ExporterPlugin } from '../core-BW8SLnRx.js';
|
|
2
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CmydGcxg.js';
|
|
3
3
|
|
|
4
4
|
declare function createEnvExportPlugin(): ExporterPlugin;
|
|
5
5
|
declare function createPublicEnvExportPlugin(): ExporterPlugin;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createEnvExportPlugin,
|
|
3
3
|
createPublicEnvExportPlugin
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-5JGNRADB.js";
|
|
5
5
|
import {
|
|
6
6
|
toEnv,
|
|
7
7
|
toPublicEnv
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-WPB4HB2K.js";
|
|
9
9
|
export {
|
|
10
10
|
createEnvExportPlugin,
|
|
11
11
|
createPublicEnvExportPlugin,
|