@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.
@@ -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.3",
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,
@@ -1,13 +1,17 @@
1
1
  import {
2
2
  createCnos
3
- } from "../chunk-7MUDEJSP.js";
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 "../chunk-ZH5QZQ7C.js";
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,
@@ -12,7 +12,7 @@ import {
12
12
  setBootstrappedSecretHydrationRequired,
13
13
  setSingletonReady,
14
14
  setSingletonRuntime
15
- } from "./chunk-7MUDEJSP.js";
15
+ } from "./chunk-O2KTQ6PB.js";
16
16
  import {
17
17
  createDefaultRuntimeProviders,
18
18
  createDerivedRuntimeSupport,
@@ -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.3",
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",
@@ -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.3",
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",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCnos,
3
3
  defaultPlugins
4
- } from "../chunk-7MUDEJSP.js";
4
+ } from "../chunk-O2KTQ6PB.js";
5
5
  import "../chunk-JQLV4OQU.js";
6
6
  import "../chunk-4AAA2RHV.js";
7
7
  import "../chunk-UMVFSHP2.js";
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.3",
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-SUMWGMRA.js";
3
+ } from "./chunk-LDFKY65G.js";
4
4
  import "./chunk-DL5G3QSZ.js";
5
- import "./chunk-7MUDEJSP.js";
5
+ import "./chunk-O2KTQ6PB.js";
6
6
  import "./chunk-JQLV4OQU.js";
7
7
  import "./chunk-4AAA2RHV.js";
8
8
  import "./chunk-UMVFSHP2.js";
@@ -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.3",
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",
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  runtime_default
3
- } from "../chunk-SUMWGMRA.js";
3
+ } from "../chunk-LDFKY65G.js";
4
4
  import "../chunk-DL5G3QSZ.js";
5
- import "../chunk-7MUDEJSP.js";
5
+ import "../chunk-O2KTQ6PB.js";
6
6
  import "../chunk-JQLV4OQU.js";
7
7
  import "../chunk-4AAA2RHV.js";
8
8
  import "../chunk-UMVFSHP2.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitsy/cnos",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Batteries-included CNOS runtime package wired with the official plugins.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",