@kitsy/cnos 1.3.0 → 1.5.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/README.md +1 -1
- package/dist/build/index.cjs +153 -11
- package/dist/build/index.d.cts +11 -3
- package/dist/build/index.d.ts +11 -3
- package/dist/build/index.js +56 -9
- package/dist/{chunk-DRKDNY4I.js → chunk-APIU4GTB.js} +14 -4
- package/dist/{chunk-K6QYI2T4.js → chunk-EQSKV3DP.js} +1 -1
- package/dist/{chunk-JDII6O72.js → chunk-FWJC4Y2D.js} +1 -1
- package/dist/{chunk-QTKXPY3N.js → chunk-HMM76UYZ.js} +1 -1
- package/dist/{chunk-OOKFRWTN.js → chunk-J4K4JUJL.js} +1 -1
- package/dist/{chunk-EDCLLCNL.js → chunk-RYGSG3GR.js} +8 -8
- package/dist/{chunk-FC3IV6A7.js → chunk-T6Y57KTT.js} +20 -1
- package/dist/{chunk-E7SE6N26.js → chunk-TO76YYS4.js} +3 -3
- package/dist/chunk-WCHX2QFY.js +115 -0
- package/dist/{chunk-OWUZQ4OH.js → chunk-ZTPSFXWP.js} +1 -1
- package/dist/configure/index.cjs +102 -9
- 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/{envNaming-Dy3WYiGK.d.ts → envNaming-Dvm_LP2D.d.ts} +1 -1
- package/dist/{envNaming-D6k66myh.d.cts → envNaming-S4B-dHUx.d.cts} +1 -1
- package/dist/index.cjs +102 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/internal.cjs +14 -2
- package/dist/internal.d.cts +5 -4
- package/dist/internal.d.ts +5 -4
- package/dist/internal.js +10 -3
- 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.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.d.cts +2 -2
- package/dist/plugin/dotenv.d.ts +2 -2
- package/dist/plugin/dotenv.js +2 -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 +19 -0
- 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 +74 -7
- package/dist/plugin/process-env.d.cts +4 -3
- package/dist/plugin/process-env.d.ts +4 -3
- package/dist/plugin/process-env.js +6 -4
- package/dist/{plugin-CyNkf7Dm.d.cts → plugin-B4xwySxw.d.cts} +2 -1
- package/dist/{plugin-CyNkf7Dm.d.ts → plugin-B4xwySxw.d.ts} +2 -1
- package/dist/runtime/index.cjs +102 -9
- package/dist/runtime/index.d.cts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +10 -10
- package/dist/{toPublicEnv-D2PZkaN-.d.ts → toPublicEnv-CvhGAfsB.d.ts} +1 -1
- package/dist/{toPublicEnv-Cz72m6y0.d.cts → toPublicEnv-ggmphZFs.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-CDXJISGB.js +0 -49
package/dist/internal.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as LoadManifestOptions, k as LoadedManifest, N as NormalizedManifest, b as LogicalKey, l as VaultDefinition, g as CnosRuntime,
|
|
2
|
-
export {
|
|
1
|
+
import { j as LoadManifestOptions, k as LoadedManifest, N as NormalizedManifest, b as LogicalKey, l as NamespaceDefinition, m as VaultDefinition, i as NamespaceName, g as CnosRuntime, n as ValidationSummary, R as ResolvedGraph } from './plugin-B4xwySxw.cjs';
|
|
2
|
+
export { o as ValidationIssue, p as WorkspaceFile } from './plugin-B4xwySxw.cjs';
|
|
3
3
|
|
|
4
4
|
declare class CnosError extends Error {
|
|
5
5
|
constructor(message: string);
|
|
@@ -17,6 +17,7 @@ declare function writeKeychain(entry: string, value: string): Promise<void>;
|
|
|
17
17
|
declare function loadManifest(options?: LoadManifestOptions): Promise<LoadedManifest>;
|
|
18
18
|
|
|
19
19
|
type ProjectionTarget = 'public' | 'env';
|
|
20
|
+
declare function getNamespaceDefinition(manifest: NormalizedManifest, namespaceOrKey: string): NamespaceDefinition;
|
|
20
21
|
declare function ensureProjectionAllowed(manifest: NormalizedManifest, key: LogicalKey, target: ProjectionTarget): void;
|
|
21
22
|
|
|
22
23
|
interface SecretReference {
|
|
@@ -54,7 +55,7 @@ declare function createSecretVaultProvider(vaultId: string, definition: VaultDef
|
|
|
54
55
|
declare function flattenObject(value: Record<string, unknown>, prefix?: string): Record<string, unknown>;
|
|
55
56
|
|
|
56
57
|
declare function resolveManifestRoot(root?: string): Promise<string>;
|
|
57
|
-
declare function resolveConfigDocumentPath(workspaceRoot: string, namespace:
|
|
58
|
+
declare function resolveConfigDocumentPath(workspaceRoot: string, namespace: NamespaceName, configPath: string, profile?: string): string;
|
|
58
59
|
|
|
59
60
|
interface ResolvedVaultDefinition extends VaultDefinition {
|
|
60
61
|
name: string;
|
|
@@ -204,4 +205,4 @@ interface WatchTargetSet {
|
|
|
204
205
|
}
|
|
205
206
|
declare function watchFiles(runtime: CnosRuntime, root?: string): Promise<WatchTargetSet>;
|
|
206
207
|
|
|
207
|
-
export { CNOS_GRAPH_ENV_VAR, CNOS_SECRET_PAYLOAD_ENV_VAR, CNOS_SESSION_KEY_ENV_VAR, CnosAuthenticationError, CnosSecurityError, type ResolvedVaultDefinition, type SecretReference, ValidationSummary, VaultDefinition, applyManifestMappings, clearAllVaultSessionKeys, clearVaultSessionKey, compareSchemaToGraph, createSecretVault, createSecretVaultProvider, deleteLocalSecret, deriveVaultKey, deserializeRuntimeGraph, detectLegacyVaultFormat, diffGraphs, ensureProjectionAllowed, flattenObject, formatDriftReport, generateCodegenContent, getVaultPassphraseEnvVar, getVaultSessionKeyEnvVar, graphRequiresSecretHydration, isPassphraseEnvRef, isSecretReference, listLocalSecrets, listSecretVaults, loadManifest, parseYaml, proposeMapping, readKeychain, readLocalSecret, readRuntimeGraphFromEnv, readVaultMetadata, removeLocalVaultFiles, resolveCodegenPaths, resolveConfigDocumentPath, resolveConfiguredVaultPassphrase, resolveManifestRoot, resolveSecretPassphrase, resolveSecretStoreRoot, resolveSecretVaultFile, resolveVaultAccessKey, resolveVaultAuth, resolveVaultDefinition, rewriteSourceFiles, scanEnvUsage, serializeRuntimeGraph, serializeSecretPayload, stringifyYaml, validateRuntime, watchFiles, watchSchema, writeCodegenOutput, writeKeychain, writeLocalSecret, writeVaultSessionKey };
|
|
208
|
+
export { CNOS_GRAPH_ENV_VAR, CNOS_SECRET_PAYLOAD_ENV_VAR, CNOS_SESSION_KEY_ENV_VAR, CnosAuthenticationError, CnosSecurityError, type ResolvedVaultDefinition, type SecretReference, ValidationSummary, VaultDefinition, applyManifestMappings, clearAllVaultSessionKeys, clearVaultSessionKey, compareSchemaToGraph, createSecretVault, createSecretVaultProvider, deleteLocalSecret, deriveVaultKey, deserializeRuntimeGraph, detectLegacyVaultFormat, diffGraphs, ensureProjectionAllowed, flattenObject, formatDriftReport, generateCodegenContent, getNamespaceDefinition, getVaultPassphraseEnvVar, getVaultSessionKeyEnvVar, graphRequiresSecretHydration, isPassphraseEnvRef, isSecretReference, listLocalSecrets, listSecretVaults, loadManifest, parseYaml, proposeMapping, readKeychain, readLocalSecret, readRuntimeGraphFromEnv, readVaultMetadata, removeLocalVaultFiles, resolveCodegenPaths, resolveConfigDocumentPath, resolveConfiguredVaultPassphrase, resolveManifestRoot, resolveSecretPassphrase, resolveSecretStoreRoot, resolveSecretVaultFile, resolveVaultAccessKey, resolveVaultAuth, resolveVaultDefinition, rewriteSourceFiles, scanEnvUsage, serializeRuntimeGraph, serializeSecretPayload, stringifyYaml, validateRuntime, watchFiles, watchSchema, writeCodegenOutput, writeKeychain, writeLocalSecret, writeVaultSessionKey };
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as LoadManifestOptions, k as LoadedManifest, N as NormalizedManifest, b as LogicalKey, l as VaultDefinition, g as CnosRuntime,
|
|
2
|
-
export {
|
|
1
|
+
import { j as LoadManifestOptions, k as LoadedManifest, N as NormalizedManifest, b as LogicalKey, l as NamespaceDefinition, m as VaultDefinition, i as NamespaceName, g as CnosRuntime, n as ValidationSummary, R as ResolvedGraph } from './plugin-B4xwySxw.js';
|
|
2
|
+
export { o as ValidationIssue, p as WorkspaceFile } from './plugin-B4xwySxw.js';
|
|
3
3
|
|
|
4
4
|
declare class CnosError extends Error {
|
|
5
5
|
constructor(message: string);
|
|
@@ -17,6 +17,7 @@ declare function writeKeychain(entry: string, value: string): Promise<void>;
|
|
|
17
17
|
declare function loadManifest(options?: LoadManifestOptions): Promise<LoadedManifest>;
|
|
18
18
|
|
|
19
19
|
type ProjectionTarget = 'public' | 'env';
|
|
20
|
+
declare function getNamespaceDefinition(manifest: NormalizedManifest, namespaceOrKey: string): NamespaceDefinition;
|
|
20
21
|
declare function ensureProjectionAllowed(manifest: NormalizedManifest, key: LogicalKey, target: ProjectionTarget): void;
|
|
21
22
|
|
|
22
23
|
interface SecretReference {
|
|
@@ -54,7 +55,7 @@ declare function createSecretVaultProvider(vaultId: string, definition: VaultDef
|
|
|
54
55
|
declare function flattenObject(value: Record<string, unknown>, prefix?: string): Record<string, unknown>;
|
|
55
56
|
|
|
56
57
|
declare function resolveManifestRoot(root?: string): Promise<string>;
|
|
57
|
-
declare function resolveConfigDocumentPath(workspaceRoot: string, namespace:
|
|
58
|
+
declare function resolveConfigDocumentPath(workspaceRoot: string, namespace: NamespaceName, configPath: string, profile?: string): string;
|
|
58
59
|
|
|
59
60
|
interface ResolvedVaultDefinition extends VaultDefinition {
|
|
60
61
|
name: string;
|
|
@@ -204,4 +205,4 @@ interface WatchTargetSet {
|
|
|
204
205
|
}
|
|
205
206
|
declare function watchFiles(runtime: CnosRuntime, root?: string): Promise<WatchTargetSet>;
|
|
206
207
|
|
|
207
|
-
export { CNOS_GRAPH_ENV_VAR, CNOS_SECRET_PAYLOAD_ENV_VAR, CNOS_SESSION_KEY_ENV_VAR, CnosAuthenticationError, CnosSecurityError, type ResolvedVaultDefinition, type SecretReference, ValidationSummary, VaultDefinition, applyManifestMappings, clearAllVaultSessionKeys, clearVaultSessionKey, compareSchemaToGraph, createSecretVault, createSecretVaultProvider, deleteLocalSecret, deriveVaultKey, deserializeRuntimeGraph, detectLegacyVaultFormat, diffGraphs, ensureProjectionAllowed, flattenObject, formatDriftReport, generateCodegenContent, getVaultPassphraseEnvVar, getVaultSessionKeyEnvVar, graphRequiresSecretHydration, isPassphraseEnvRef, isSecretReference, listLocalSecrets, listSecretVaults, loadManifest, parseYaml, proposeMapping, readKeychain, readLocalSecret, readRuntimeGraphFromEnv, readVaultMetadata, removeLocalVaultFiles, resolveCodegenPaths, resolveConfigDocumentPath, resolveConfiguredVaultPassphrase, resolveManifestRoot, resolveSecretPassphrase, resolveSecretStoreRoot, resolveSecretVaultFile, resolveVaultAccessKey, resolveVaultAuth, resolveVaultDefinition, rewriteSourceFiles, scanEnvUsage, serializeRuntimeGraph, serializeSecretPayload, stringifyYaml, validateRuntime, watchFiles, watchSchema, writeCodegenOutput, writeKeychain, writeLocalSecret, writeVaultSessionKey };
|
|
208
|
+
export { CNOS_GRAPH_ENV_VAR, CNOS_SECRET_PAYLOAD_ENV_VAR, CNOS_SESSION_KEY_ENV_VAR, CnosAuthenticationError, CnosSecurityError, type ResolvedVaultDefinition, type SecretReference, ValidationSummary, VaultDefinition, applyManifestMappings, clearAllVaultSessionKeys, clearVaultSessionKey, compareSchemaToGraph, createSecretVault, createSecretVaultProvider, deleteLocalSecret, deriveVaultKey, deserializeRuntimeGraph, detectLegacyVaultFormat, diffGraphs, ensureProjectionAllowed, flattenObject, formatDriftReport, generateCodegenContent, getNamespaceDefinition, getVaultPassphraseEnvVar, getVaultSessionKeyEnvVar, graphRequiresSecretHydration, isPassphraseEnvRef, isSecretReference, listLocalSecrets, listSecretVaults, loadManifest, parseYaml, proposeMapping, readKeychain, readLocalSecret, readRuntimeGraphFromEnv, readVaultMetadata, removeLocalVaultFiles, resolveCodegenPaths, resolveConfigDocumentPath, resolveConfiguredVaultPassphrase, resolveManifestRoot, resolveSecretPassphrase, resolveSecretStoreRoot, resolveSecretVaultFile, resolveVaultAccessKey, resolveVaultAuth, resolveVaultDefinition, rewriteSourceFiles, scanEnvUsage, serializeRuntimeGraph, serializeSecretPayload, stringifyYaml, validateRuntime, watchFiles, watchSchema, writeCodegenOutput, writeKeychain, writeLocalSecret, writeVaultSessionKey };
|
package/dist/internal.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readRuntimeGraphFromEnv,
|
|
8
8
|
serializeRuntimeGraph,
|
|
9
9
|
serializeSecretPayload
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EQSKV3DP.js";
|
|
11
11
|
import {
|
|
12
12
|
CnosAuthenticationError,
|
|
13
13
|
CnosSecurityError,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
detectLegacyVaultFormat,
|
|
21
21
|
ensureProjectionAllowed,
|
|
22
22
|
flattenObject,
|
|
23
|
+
getNamespaceDefinition,
|
|
23
24
|
getVaultPassphraseEnvVar,
|
|
24
25
|
getVaultSessionKeyEnvVar,
|
|
25
26
|
isPassphraseEnvRef,
|
|
@@ -46,7 +47,7 @@ import {
|
|
|
46
47
|
writeKeychain,
|
|
47
48
|
writeLocalSecret,
|
|
48
49
|
writeVaultSessionKey
|
|
49
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-APIU4GTB.js";
|
|
50
51
|
|
|
51
52
|
// src/codegen/generateTypes.ts
|
|
52
53
|
function toPascalCase(value) {
|
|
@@ -279,6 +280,9 @@ function isSchemaDefault(entry) {
|
|
|
279
280
|
function shouldTrackKey(key) {
|
|
280
281
|
return key.startsWith("value.") || key.startsWith("secret.");
|
|
281
282
|
}
|
|
283
|
+
function isTransientRuntimeSource(entry) {
|
|
284
|
+
return entry.winner.sourceId === "process-env" || entry.winner.sourceId === "cli-args";
|
|
285
|
+
}
|
|
282
286
|
function compareSchemaToGraph(runtime) {
|
|
283
287
|
const schema = runtime.manifest.schema;
|
|
284
288
|
const missing = [];
|
|
@@ -318,7 +322,9 @@ function compareSchemaToGraph(runtime) {
|
|
|
318
322
|
});
|
|
319
323
|
}
|
|
320
324
|
}
|
|
321
|
-
const undeclared = Array.from(runtime.graph.entries.values()).filter(
|
|
325
|
+
const undeclared = Array.from(runtime.graph.entries.values()).filter(
|
|
326
|
+
(entry) => shouldTrackKey(entry.key) && !schema[entry.key] && !isSchemaDefault(entry) && !isTransientRuntimeSource(entry)
|
|
327
|
+
).map((entry) => {
|
|
322
328
|
const issue = {
|
|
323
329
|
key: entry.key,
|
|
324
330
|
value: entry.winner.value,
|
|
@@ -652,6 +658,7 @@ export {
|
|
|
652
658
|
flattenObject,
|
|
653
659
|
formatDriftReport,
|
|
654
660
|
generateCodegenContent,
|
|
661
|
+
getNamespaceDefinition,
|
|
655
662
|
getVaultPassphraseEnvVar,
|
|
656
663
|
getVaultSessionKeyEnvVar,
|
|
657
664
|
graphRequiresSecretHydration,
|
package/dist/plugin/cli-args.js
CHANGED
package/dist/plugin/dotenv.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-B4xwySxw.cjs';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-S4B-dHUx.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 '../plugin-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-B4xwySxw.js';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-Dvm_LP2D.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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExporterPlugin } from '../plugin-
|
|
2
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { E as ExporterPlugin } from '../plugin-B4xwySxw.cjs';
|
|
2
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-ggmphZFs.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 '../plugin-
|
|
2
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { E as ExporterPlugin } from '../plugin-B4xwySxw.js';
|
|
2
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CvhGAfsB.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-J4K4JUJL.js";
|
|
5
5
|
import {
|
|
6
6
|
toEnv,
|
|
7
7
|
toPublicEnv
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-APIU4GTB.js";
|
|
9
9
|
export {
|
|
10
10
|
createEnvExportPlugin,
|
|
11
11
|
createPublicEnvExportPlugin,
|
|
@@ -282,11 +282,30 @@ function createFilesystemValuesPlugin() {
|
|
|
282
282
|
sourceRoot,
|
|
283
283
|
context.profileActivation.values
|
|
284
284
|
);
|
|
285
|
+
const customNamespaces = Object.entries(context.manifest.namespaces).filter(
|
|
286
|
+
([namespace, definition]) => namespace !== "value" && namespace !== "secret" && definition.kind === "data" && !definition.sensitive
|
|
287
|
+
).map(([namespace]) => namespace);
|
|
285
288
|
const entries = [];
|
|
286
289
|
for (const file of files) {
|
|
287
290
|
const document = await (0, import_promises12.readFile)(file.absolutePath, "utf8");
|
|
288
291
|
entries.push(...filesystemValuesReader(file.relativePath, document, file.workspaceId));
|
|
289
292
|
}
|
|
293
|
+
for (const namespace of customNamespaces) {
|
|
294
|
+
const layers = [
|
|
295
|
+
namespace,
|
|
296
|
+
...context.profileChain.filter((profile) => profile !== "base").map((profile) => `profiles/${profile}/${namespace}`)
|
|
297
|
+
];
|
|
298
|
+
const namespaceFiles = await collectFilesystemLayerFiles(
|
|
299
|
+
context.manifestRoot,
|
|
300
|
+
context.workspace.workspaceRoots,
|
|
301
|
+
sourceRoot,
|
|
302
|
+
layers
|
|
303
|
+
);
|
|
304
|
+
for (const file of namespaceFiles) {
|
|
305
|
+
const document = await (0, import_promises12.readFile)(file.absolutePath, "utf8");
|
|
306
|
+
entries.push(...yamlObjectToEntries(document, file.relativePath, namespace, "filesystem-values", file.workspaceId));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
290
309
|
return entries;
|
|
291
310
|
}
|
|
292
311
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-B4xwySxw.cjs';
|
|
2
2
|
|
|
3
3
|
declare function filesystemSecretsReader(filePath: string, document: string, workspaceId?: string): ConfigEntry[];
|
|
4
4
|
declare function createFilesystemSecretsPlugin(): LoaderPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-B4xwySxw.js';
|
|
2
2
|
|
|
3
3
|
declare function filesystemSecretsReader(filePath: string, document: string, workspaceId?: string): ConfigEntry[];
|
|
4
4
|
declare function createFilesystemSecretsPlugin(): LoaderPlugin;
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
filesystemSecretsReader,
|
|
6
6
|
filesystemValuesReader,
|
|
7
7
|
yamlObjectToEntries
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-T6Y57KTT.js";
|
|
9
|
+
import "../chunk-APIU4GTB.js";
|
|
10
10
|
export {
|
|
11
11
|
collectFilesystemLayerFiles,
|
|
12
12
|
createFilesystemSecretsPlugin,
|
|
@@ -31,7 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var process_env_exports = {};
|
|
32
32
|
__export(process_env_exports, {
|
|
33
33
|
createProcessEnvPlugin: () => createProcessEnvPlugin,
|
|
34
|
-
processEnvEntriesFromObject: () => processEnvEntriesFromObject
|
|
34
|
+
processEnvEntriesFromObject: () => processEnvEntriesFromObject,
|
|
35
|
+
processNamespaceEntriesFromContext: () => processNamespaceEntriesFromContext
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(process_env_exports);
|
|
37
38
|
|
|
@@ -129,6 +130,11 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
129
130
|
|
|
130
131
|
// ../../plugins/process-env/src/index.ts
|
|
131
132
|
var PROCESS_ENV_PLUGIN_ID = "@kitsy/cnos/plugins/process-env";
|
|
133
|
+
var PROCESS_GRAPH_OMIT = /* @__PURE__ */ new Set([
|
|
134
|
+
"__CNOS_GRAPH__",
|
|
135
|
+
"__CNOS_SECRET_PAYLOAD__",
|
|
136
|
+
"__CNOS_SESSION_KEY__"
|
|
137
|
+
]);
|
|
132
138
|
function processEnvEntriesFromObject(env, mapping = {}, workspaceId = "default") {
|
|
133
139
|
return Object.entries(env).flatMap(([envVar, value]) => {
|
|
134
140
|
if (typeof value !== "string") {
|
|
@@ -153,22 +159,83 @@ function processEnvEntriesFromObject(env, mapping = {}, workspaceId = "default")
|
|
|
153
159
|
];
|
|
154
160
|
});
|
|
155
161
|
}
|
|
162
|
+
function processNamespaceEntriesFromContext(env, workspaceId = "default") {
|
|
163
|
+
const envEntries = Object.entries(env).filter((entry) => typeof entry[1] === "string").filter(([envVar]) => !PROCESS_GRAPH_OMIT.has(envVar)).map(([envVar, value]) => ({
|
|
164
|
+
key: `process.env.${envVar}`,
|
|
165
|
+
value,
|
|
166
|
+
namespace: "process",
|
|
167
|
+
sourceId: "process-runtime",
|
|
168
|
+
pluginId: PROCESS_ENV_PLUGIN_ID,
|
|
169
|
+
workspaceId,
|
|
170
|
+
origin: {
|
|
171
|
+
envVar
|
|
172
|
+
}
|
|
173
|
+
}));
|
|
174
|
+
const runtimeEntries = [
|
|
175
|
+
{
|
|
176
|
+
key: "process.cwd",
|
|
177
|
+
value: process.cwd(),
|
|
178
|
+
namespace: "process",
|
|
179
|
+
sourceId: "process-runtime",
|
|
180
|
+
pluginId: PROCESS_ENV_PLUGIN_ID,
|
|
181
|
+
workspaceId
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
key: "process.platform",
|
|
185
|
+
value: process.platform,
|
|
186
|
+
namespace: "process",
|
|
187
|
+
sourceId: "process-runtime",
|
|
188
|
+
pluginId: PROCESS_ENV_PLUGIN_ID,
|
|
189
|
+
workspaceId
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
key: "process.arch",
|
|
193
|
+
value: process.arch,
|
|
194
|
+
namespace: "process",
|
|
195
|
+
sourceId: "process-runtime",
|
|
196
|
+
pluginId: PROCESS_ENV_PLUGIN_ID,
|
|
197
|
+
workspaceId
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
key: "process.node.version",
|
|
201
|
+
value: process.version,
|
|
202
|
+
namespace: "process",
|
|
203
|
+
sourceId: "process-runtime",
|
|
204
|
+
pluginId: PROCESS_ENV_PLUGIN_ID,
|
|
205
|
+
workspaceId
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
key: "process.args.raw",
|
|
209
|
+
value: process.argv.slice(2),
|
|
210
|
+
namespace: "process",
|
|
211
|
+
sourceId: "process-runtime",
|
|
212
|
+
pluginId: PROCESS_ENV_PLUGIN_ID,
|
|
213
|
+
workspaceId
|
|
214
|
+
}
|
|
215
|
+
];
|
|
216
|
+
return [...runtimeEntries, ...envEntries];
|
|
217
|
+
}
|
|
156
218
|
function createProcessEnvPlugin() {
|
|
157
219
|
return {
|
|
158
220
|
id: "process-env",
|
|
159
221
|
kind: "loader",
|
|
160
222
|
async load(context) {
|
|
161
223
|
const config = context.manifestConfig;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
224
|
+
const env = context.processEnv ?? process.env;
|
|
225
|
+
return [
|
|
226
|
+
...processEnvEntriesFromObject(
|
|
227
|
+
env,
|
|
228
|
+
config.envMapping,
|
|
229
|
+
context.workspace.workspaceId
|
|
230
|
+
),
|
|
231
|
+
...processNamespaceEntriesFromContext(env, context.workspace.workspaceId)
|
|
232
|
+
];
|
|
167
233
|
}
|
|
168
234
|
};
|
|
169
235
|
}
|
|
170
236
|
// Annotate the CommonJS export names for ESM import in node:
|
|
171
237
|
0 && (module.exports = {
|
|
172
238
|
createProcessEnvPlugin,
|
|
173
|
-
processEnvEntriesFromObject
|
|
239
|
+
processEnvEntriesFromObject,
|
|
240
|
+
processNamespaceEntriesFromContext
|
|
174
241
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-B4xwySxw.cjs';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-S4B-dHUx.cjs';
|
|
3
3
|
|
|
4
4
|
declare function processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
|
|
5
|
+
declare function processNamespaceEntriesFromContext(env: Record<string, string | undefined>, workspaceId?: string): ConfigEntry[];
|
|
5
6
|
declare function createProcessEnvPlugin(): LoaderPlugin;
|
|
6
7
|
|
|
7
|
-
export { createProcessEnvPlugin, processEnvEntriesFromObject };
|
|
8
|
+
export { createProcessEnvPlugin, processEnvEntriesFromObject, processNamespaceEntriesFromContext };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-B4xwySxw.js';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-Dvm_LP2D.js';
|
|
3
3
|
|
|
4
4
|
declare function processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
|
|
5
|
+
declare function processNamespaceEntriesFromContext(env: Record<string, string | undefined>, workspaceId?: string): ConfigEntry[];
|
|
5
6
|
declare function createProcessEnvPlugin(): LoaderPlugin;
|
|
6
7
|
|
|
7
|
-
export { createProcessEnvPlugin, processEnvEntriesFromObject };
|
|
8
|
+
export { createProcessEnvPlugin, processEnvEntriesFromObject, processNamespaceEntriesFromContext };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProcessEnvPlugin,
|
|
3
|
-
processEnvEntriesFromObject
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
processEnvEntriesFromObject,
|
|
4
|
+
processNamespaceEntriesFromContext
|
|
5
|
+
} from "../chunk-WCHX2QFY.js";
|
|
6
|
+
import "../chunk-APIU4GTB.js";
|
|
6
7
|
export {
|
|
7
8
|
createProcessEnvPlugin,
|
|
8
|
-
processEnvEntriesFromObject
|
|
9
|
+
processEnvEntriesFromObject,
|
|
10
|
+
processNamespaceEntriesFromContext
|
|
9
11
|
};
|
|
@@ -295,6 +295,7 @@ interface CnosPlugin {
|
|
|
295
295
|
kind: CnosPluginKind;
|
|
296
296
|
}
|
|
297
297
|
interface LoaderContext {
|
|
298
|
+
manifest: NormalizedManifest;
|
|
298
299
|
manifestConfig: Record<string, unknown>;
|
|
299
300
|
profile: string;
|
|
300
301
|
profileChain: string[];
|
|
@@ -346,4 +347,4 @@ interface ExporterPlugin extends CnosPlugin {
|
|
|
346
347
|
export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
|
|
347
348
|
}
|
|
348
349
|
|
|
349
|
-
export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidatorPlugin as V, WorkspaceRoot as W, ConfigEntry as a, LogicalKey as b, ToPublicEnvOptions as c, DumpPlan as d, DumpOptions as e, DumpResult as f, CnosRuntime as g, CnosPlugin as h, NamespaceName as i, LoadManifestOptions as j, LoadedManifest as k,
|
|
350
|
+
export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidatorPlugin as V, WorkspaceRoot as W, ConfigEntry as a, LogicalKey as b, ToPublicEnvOptions as c, DumpPlan as d, DumpOptions as e, DumpResult as f, CnosRuntime as g, CnosPlugin as h, NamespaceName as i, LoadManifestOptions as j, LoadedManifest as k, NamespaceDefinition as l, VaultDefinition as m, ValidationSummary as n, ValidationIssue as o, WorkspaceFile as p };
|
|
@@ -295,6 +295,7 @@ interface CnosPlugin {
|
|
|
295
295
|
kind: CnosPluginKind;
|
|
296
296
|
}
|
|
297
297
|
interface LoaderContext {
|
|
298
|
+
manifest: NormalizedManifest;
|
|
298
299
|
manifestConfig: Record<string, unknown>;
|
|
299
300
|
profile: string;
|
|
300
301
|
profileChain: string[];
|
|
@@ -346,4 +347,4 @@ interface ExporterPlugin extends CnosPlugin {
|
|
|
346
347
|
export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
|
|
347
348
|
}
|
|
348
349
|
|
|
349
|
-
export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidatorPlugin as V, WorkspaceRoot as W, ConfigEntry as a, LogicalKey as b, ToPublicEnvOptions as c, DumpPlan as d, DumpOptions as e, DumpResult as f, CnosRuntime as g, CnosPlugin as h, NamespaceName as i, LoadManifestOptions as j, LoadedManifest as k,
|
|
350
|
+
export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidatorPlugin as V, WorkspaceRoot as W, ConfigEntry as a, LogicalKey as b, ToPublicEnvOptions as c, DumpPlan as d, DumpOptions as e, DumpResult as f, CnosRuntime as g, CnosPlugin as h, NamespaceName as i, LoadManifestOptions as j, LoadedManifest as k, NamespaceDefinition as l, VaultDefinition as m, ValidationSummary as n, ValidationIssue as o, WorkspaceFile as p };
|