@kitsy/cnos 1.8.3 → 1.8.4
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 +23 -2
- package/dist/build/index.js +28 -3
- package/dist/{chunk-SUMWGMRA.js → chunk-LDFKY65G.js} +1 -1
- package/dist/{chunk-7MUDEJSP.js → chunk-O2KTQ6PB.js} +1 -1
- package/dist/configure/index.cjs +1 -1
- package/dist/configure/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/runtime/index.cjs +1 -1
- package/dist/runtime/index.js +2 -2
- package/package.json +1 -1
package/dist/build/index.cjs
CHANGED
|
@@ -3712,7 +3712,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3712
3712
|
// package.json
|
|
3713
3713
|
var package_default = {
|
|
3714
3714
|
name: "@kitsy/cnos",
|
|
3715
|
-
version: "1.8.
|
|
3715
|
+
version: "1.8.4",
|
|
3716
3716
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3717
3717
|
type: "module",
|
|
3718
3718
|
main: "./dist/index.cjs",
|
|
@@ -4436,12 +4436,33 @@ async function resolveFrameworkEnv(options = {}, framework = "generic", envOptio
|
|
|
4436
4436
|
});
|
|
4437
4437
|
}
|
|
4438
4438
|
async function resolveServerProjection(options = {}) {
|
|
4439
|
+
const secretResolution = options.secretResolution ?? "lazy";
|
|
4439
4440
|
const runtime = await createCnos2({
|
|
4440
4441
|
...options,
|
|
4441
|
-
cacheMode: options.cacheMode ?? "build"
|
|
4442
|
+
cacheMode: options.cacheMode ?? "build",
|
|
4443
|
+
secretResolution
|
|
4442
4444
|
});
|
|
4445
|
+
validateServerProjectionSecretRefs(runtime);
|
|
4443
4446
|
return runtime.toServerProjection();
|
|
4444
4447
|
}
|
|
4448
|
+
function validateServerProjectionSecretRefs(runtime) {
|
|
4449
|
+
for (const entry of runtime.graph.entries.values()) {
|
|
4450
|
+
if (entry.namespace !== "secret" || !isSecretReference(entry.value)) {
|
|
4451
|
+
continue;
|
|
4452
|
+
}
|
|
4453
|
+
const vaultId = entry.value.vault ?? "default";
|
|
4454
|
+
const definition = runtime.manifest.vaults[vaultId];
|
|
4455
|
+
if (!definition) {
|
|
4456
|
+
throw new CnosManifestError(`Unknown vault "${vaultId}" for secret ref "${entry.key}"`);
|
|
4457
|
+
}
|
|
4458
|
+
if (entry.value.provider !== definition.provider) {
|
|
4459
|
+
throw new CnosManifestError(
|
|
4460
|
+
`Secret ref "${entry.key}" declares provider "${entry.value.provider}" but vault "${vaultId}" uses provider "${definition.provider}"`
|
|
4461
|
+
);
|
|
4462
|
+
}
|
|
4463
|
+
createSecretVaultProvider(vaultId, definition);
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4445
4466
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4446
4467
|
0 && (module.exports = {
|
|
4447
4468
|
resolveBrowserData,
|
package/dist/build/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCnos
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-O2KTQ6PB.js";
|
|
4
4
|
import "../chunk-JQLV4OQU.js";
|
|
5
5
|
import "../chunk-4AAA2RHV.js";
|
|
6
6
|
import "../chunk-UMVFSHP2.js";
|
|
7
7
|
import "../chunk-N5DX5QEB.js";
|
|
8
8
|
import "../chunk-36AR262B.js";
|
|
9
9
|
import "../chunk-EJT2VJTM.js";
|
|
10
|
-
import
|
|
10
|
+
import {
|
|
11
|
+
CnosManifestError,
|
|
12
|
+
createSecretVaultProvider,
|
|
13
|
+
isSecretReference
|
|
14
|
+
} from "../chunk-ZH5QZQ7C.js";
|
|
11
15
|
|
|
12
16
|
// src/build/index.ts
|
|
13
17
|
async function resolveBrowserData(options = {}) {
|
|
@@ -86,12 +90,33 @@ async function resolveFrameworkEnv(options = {}, framework = "generic", envOptio
|
|
|
86
90
|
});
|
|
87
91
|
}
|
|
88
92
|
async function resolveServerProjection(options = {}) {
|
|
93
|
+
const secretResolution = options.secretResolution ?? "lazy";
|
|
89
94
|
const runtime = await createCnos({
|
|
90
95
|
...options,
|
|
91
|
-
cacheMode: options.cacheMode ?? "build"
|
|
96
|
+
cacheMode: options.cacheMode ?? "build",
|
|
97
|
+
secretResolution
|
|
92
98
|
});
|
|
99
|
+
validateServerProjectionSecretRefs(runtime);
|
|
93
100
|
return runtime.toServerProjection();
|
|
94
101
|
}
|
|
102
|
+
function validateServerProjectionSecretRefs(runtime) {
|
|
103
|
+
for (const entry of runtime.graph.entries.values()) {
|
|
104
|
+
if (entry.namespace !== "secret" || !isSecretReference(entry.value)) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const vaultId = entry.value.vault ?? "default";
|
|
108
|
+
const definition = runtime.manifest.vaults[vaultId];
|
|
109
|
+
if (!definition) {
|
|
110
|
+
throw new CnosManifestError(`Unknown vault "${vaultId}" for secret ref "${entry.key}"`);
|
|
111
|
+
}
|
|
112
|
+
if (entry.value.provider !== definition.provider) {
|
|
113
|
+
throw new CnosManifestError(
|
|
114
|
+
`Secret ref "${entry.key}" declares provider "${entry.value.provider}" but vault "${vaultId}" uses provider "${definition.provider}"`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
createSecretVaultProvider(vaultId, definition);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
95
120
|
export {
|
|
96
121
|
resolveBrowserData,
|
|
97
122
|
resolveFrameworkEnv,
|
|
@@ -68,7 +68,7 @@ function setBootstrappedSecretHydrationRequired(value) {
|
|
|
68
68
|
// package.json
|
|
69
69
|
var package_default = {
|
|
70
70
|
name: "@kitsy/cnos",
|
|
71
|
-
version: "1.8.
|
|
71
|
+
version: "1.8.4",
|
|
72
72
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
73
73
|
type: "module",
|
|
74
74
|
main: "./dist/index.cjs",
|
package/dist/configure/index.cjs
CHANGED
|
@@ -3756,7 +3756,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3756
3756
|
// package.json
|
|
3757
3757
|
var package_default = {
|
|
3758
3758
|
name: "@kitsy/cnos",
|
|
3759
|
-
version: "1.8.
|
|
3759
|
+
version: "1.8.4",
|
|
3760
3760
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3761
3761
|
type: "module",
|
|
3762
3762
|
main: "./dist/index.cjs",
|
package/dist/configure/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3714,7 +3714,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3714
3714
|
// package.json
|
|
3715
3715
|
var package_default = {
|
|
3716
3716
|
name: "@kitsy/cnos",
|
|
3717
|
-
version: "1.8.
|
|
3717
|
+
version: "1.8.4",
|
|
3718
3718
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3719
3719
|
type: "module",
|
|
3720
3720
|
main: "./dist/index.cjs",
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runtime_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LDFKY65G.js";
|
|
4
4
|
import "./chunk-DL5G3QSZ.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-O2KTQ6PB.js";
|
|
6
6
|
import "./chunk-JQLV4OQU.js";
|
|
7
7
|
import "./chunk-4AAA2RHV.js";
|
|
8
8
|
import "./chunk-UMVFSHP2.js";
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -3711,7 +3711,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3711
3711
|
// package.json
|
|
3712
3712
|
var package_default = {
|
|
3713
3713
|
name: "@kitsy/cnos",
|
|
3714
|
-
version: "1.8.
|
|
3714
|
+
version: "1.8.4",
|
|
3715
3715
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3716
3716
|
type: "module",
|
|
3717
3717
|
main: "./dist/index.cjs",
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runtime_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-LDFKY65G.js";
|
|
4
4
|
import "../chunk-DL5G3QSZ.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-O2KTQ6PB.js";
|
|
6
6
|
import "../chunk-JQLV4OQU.js";
|
|
7
7
|
import "../chunk-4AAA2RHV.js";
|
|
8
8
|
import "../chunk-UMVFSHP2.js";
|