@kitsy/cnos 1.5.0 → 1.6.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 +333 -117
- package/dist/build/index.d.cts +3 -2
- package/dist/build/index.d.ts +3 -2
- package/dist/build/index.js +13 -8
- package/dist/{chunk-HMM76UYZ.js → chunk-BMAD24KC.js} +1 -1
- package/dist/{chunk-ZTPSFXWP.js → chunk-JYWQFMW5.js} +1 -1
- package/dist/{chunk-FWJC4Y2D.js → chunk-MW4OVAT3.js} +1 -1
- package/dist/chunk-QU5CXL47.js +577 -0
- package/dist/{chunk-APIU4GTB.js → chunk-S7H2UULC.js} +315 -107
- package/dist/{chunk-WCHX2QFY.js → chunk-UJBQS7CJ.js} +1 -1
- package/dist/{chunk-RYGSG3GR.js → chunk-UOKVLCFL.js} +10 -10
- package/dist/{chunk-T6Y57KTT.js → chunk-UR7CHHNN.js} +1 -1
- package/dist/{chunk-J4K4JUJL.js → chunk-VGZREX5D.js} +1 -1
- package/dist/{chunk-EQSKV3DP.js → chunk-XSUP7JKH.js} +23 -1
- package/dist/configure/index.cjs +332 -122
- 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-Dvm_LP2D.d.ts → envNaming-B7Mztkcf.d.ts} +1 -1
- package/dist/{envNaming-S4B-dHUx.d.cts → envNaming-gMVnPOfe.d.cts} +1 -1
- package/dist/index.cjs +754 -143
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/internal.cjs +229 -103
- package/dist/internal.d.cts +16 -28
- package/dist/internal.d.ts +16 -28
- package/dist/internal.js +11 -3
- package/dist/plugin/basic-schema.cjs +22 -15
- 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 +27 -18
- 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 +35 -26
- 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 +34 -22
- 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 +42 -33
- 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 +24 -17
- 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/{plugin-B4xwySxw.d.cts → plugin-CKrBlWGI.d.cts} +52 -3
- package/dist/{plugin-B4xwySxw.d.ts → plugin-CKrBlWGI.d.ts} +52 -3
- package/dist/runtime/index.cjs +752 -143
- package/dist/runtime/index.d.cts +19 -1
- package/dist/runtime/index.d.ts +19 -1
- package/dist/runtime/index.js +10 -10
- package/dist/{toPublicEnv-ggmphZFs.d.cts → toPublicEnv-CmBsy53P.d.cts} +1 -1
- package/dist/{toPublicEnv-CvhGAfsB.d.ts → toPublicEnv-q6VwWxXZ.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-TO76YYS4.js +0 -189
|
@@ -1,27 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDotenvPlugin
|
|
3
|
+
} from "./chunk-BMAD24KC.js";
|
|
1
4
|
import {
|
|
2
5
|
createEnvExportPlugin,
|
|
3
6
|
createPublicEnvExportPlugin
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VGZREX5D.js";
|
|
5
8
|
import {
|
|
6
9
|
createFilesystemSecretsPlugin,
|
|
7
10
|
createFilesystemValuesPlugin
|
|
8
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UR7CHHNN.js";
|
|
9
12
|
import {
|
|
10
13
|
createProcessEnvPlugin
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UJBQS7CJ.js";
|
|
12
15
|
import {
|
|
13
16
|
createBasicSchemaPlugin
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MW4OVAT3.js";
|
|
15
18
|
import {
|
|
16
19
|
createCliArgsPlugin
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
createDotenvPlugin
|
|
20
|
-
} from "./chunk-HMM76UYZ.js";
|
|
20
|
+
} from "./chunk-JYWQFMW5.js";
|
|
21
21
|
import {
|
|
22
22
|
createCnos,
|
|
23
23
|
createProvenanceInspector
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-S7H2UULC.js";
|
|
25
25
|
|
|
26
26
|
// src/defaultPlugins.ts
|
|
27
27
|
function defaultPlugins() {
|
|
@@ -68,7 +68,7 @@ function setBootstrappedSecretHydrationRequired(value) {
|
|
|
68
68
|
// package.json
|
|
69
69
|
var package_default = {
|
|
70
70
|
name: "@kitsy/cnos",
|
|
71
|
-
version: "1.
|
|
71
|
+
version: "1.6.0",
|
|
72
72
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
73
73
|
type: "module",
|
|
74
74
|
main: "./dist/index.cjs",
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isSecretReference
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7H2UULC.js";
|
|
4
4
|
|
|
5
5
|
// src/runtime/bootstrap.ts
|
|
6
6
|
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
|
|
7
7
|
var CNOS_GRAPH_ENV_VAR = "__CNOS_GRAPH__";
|
|
8
|
+
var CNOS_PROJECTION_ENV_VAR = "__CNOS_PROJECTION__";
|
|
8
9
|
var CNOS_SECRET_PAYLOAD_ENV_VAR = "__CNOS_SECRET_PAYLOAD__";
|
|
9
10
|
var CNOS_SESSION_KEY_ENV_VAR = "__CNOS_SESSION_KEY__";
|
|
11
|
+
function serializeServerProjection(projection) {
|
|
12
|
+
return JSON.stringify(projection);
|
|
13
|
+
}
|
|
14
|
+
function deserializeServerProjection(source) {
|
|
15
|
+
const payload = JSON.parse(source);
|
|
16
|
+
if (!payload || payload.version !== 1 || typeof payload.workspace !== "string" || typeof payload.profile !== "string" || typeof payload.resolvedAt !== "string" || typeof payload.configHash !== "string" || !payload.values || typeof payload.values !== "object" || Array.isArray(payload.values) || !payload.secretRefs || typeof payload.secretRefs !== "object" || Array.isArray(payload.secretRefs) || !Array.isArray(payload.publicKeys) || !payload.meta || typeof payload.meta !== "object") {
|
|
17
|
+
throw new Error("Invalid CNOS server projection payload");
|
|
18
|
+
}
|
|
19
|
+
return payload;
|
|
20
|
+
}
|
|
10
21
|
function serializeRuntimeGraph(graph) {
|
|
11
22
|
const payload = {
|
|
12
23
|
entries: Array.from(graph.entries.values()),
|
|
@@ -89,17 +100,28 @@ function readRuntimeGraphFromEnv(processEnv = process.env) {
|
|
|
89
100
|
}
|
|
90
101
|
return graph;
|
|
91
102
|
}
|
|
103
|
+
function readServerProjectionFromEnv(processEnv = process.env) {
|
|
104
|
+
const serialized = processEnv[CNOS_PROJECTION_ENV_VAR];
|
|
105
|
+
if (!serialized) {
|
|
106
|
+
return void 0;
|
|
107
|
+
}
|
|
108
|
+
return deserializeServerProjection(serialized);
|
|
109
|
+
}
|
|
92
110
|
function graphRequiresSecretHydration(graph) {
|
|
93
111
|
return Array.from(graph.entries.values()).some((entry) => entry.namespace === "secret" && isSecretReference(entry.value));
|
|
94
112
|
}
|
|
95
113
|
|
|
96
114
|
export {
|
|
97
115
|
CNOS_GRAPH_ENV_VAR,
|
|
116
|
+
CNOS_PROJECTION_ENV_VAR,
|
|
98
117
|
CNOS_SECRET_PAYLOAD_ENV_VAR,
|
|
99
118
|
CNOS_SESSION_KEY_ENV_VAR,
|
|
119
|
+
serializeServerProjection,
|
|
120
|
+
deserializeServerProjection,
|
|
100
121
|
serializeRuntimeGraph,
|
|
101
122
|
deserializeRuntimeGraph,
|
|
102
123
|
serializeSecretPayload,
|
|
103
124
|
readRuntimeGraphFromEnv,
|
|
125
|
+
readServerProjectionFromEnv,
|
|
104
126
|
graphRequiresSecretHydration
|
|
105
127
|
};
|