@smplkit/sdk 3.0.90 → 3.0.92

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/index.d.cts CHANGED
@@ -2493,9 +2493,7 @@ declare class Config {
2493
2493
  _buildChain(configs?: Config[]): Promise<Array<{
2494
2494
  id: string | null;
2495
2495
  items: Record<string, unknown>;
2496
- environments: Record<string, {
2497
- values: Record<string, unknown>;
2498
- }>;
2496
+ environments: Record<string, Record<string, unknown>>;
2499
2497
  }>>;
2500
2498
  toString(): string;
2501
2499
  }
package/dist/index.d.ts CHANGED
@@ -2493,9 +2493,7 @@ declare class Config {
2493
2493
  _buildChain(configs?: Config[]): Promise<Array<{
2494
2494
  id: string | null;
2495
2495
  items: Record<string, unknown>;
2496
- environments: Record<string, {
2497
- values: Record<string, unknown>;
2498
- }>;
2496
+ environments: Record<string, Record<string, unknown>>;
2499
2497
  }>>;
2500
2498
  toString(): string;
2501
2499
  }
package/dist/index.js CHANGED
@@ -17093,7 +17093,7 @@ function resolveChain(chain, environment) {
17093
17093
  const config = chain[i];
17094
17094
  const baseValues = config.items ?? {};
17095
17095
  const envEntry = (config.environments ?? {})[environment];
17096
- const envValues = envEntry !== null && envEntry !== void 0 && typeof envEntry === "object" && !Array.isArray(envEntry) ? envEntry.values ?? {} : {};
17096
+ const envValues = envEntry !== null && envEntry !== void 0 && typeof envEntry === "object" && !Array.isArray(envEntry) ? envEntry : {};
17097
17097
  const configResolved = deepMerge(baseValues, envValues);
17098
17098
  accumulated = deepMerge(accumulated, configResolved);
17099
17099
  }
@@ -17168,9 +17168,7 @@ function convertEnvironments(value) {
17168
17168
  if (envData instanceof ConfigEnvironment) {
17169
17169
  out[envId] = envData;
17170
17170
  } else if (envData && typeof envData === "object" && !Array.isArray(envData)) {
17171
- const data = envData;
17172
- const rawValues = "values" in data ? data.values : data;
17173
- out[envId] = new ConfigEnvironment(rawValues ?? {});
17171
+ out[envId] = new ConfigEnvironment(envData);
17174
17172
  } else {
17175
17173
  out[envId] = new ConfigEnvironment();
17176
17174
  }
@@ -17180,16 +17178,12 @@ function convertEnvironments(value) {
17180
17178
  function environmentsToWire(environments) {
17181
17179
  const out = {};
17182
17180
  for (const [envId, env] of Object.entries(environments)) {
17183
- out[envId] = { values: env._valuesRaw };
17181
+ out[envId] = env.values;
17184
17182
  }
17185
17183
  return out;
17186
17184
  }
17187
17185
  function environmentsForResolver(environments) {
17188
- const out = {};
17189
- for (const [envId, env] of Object.entries(environments)) {
17190
- out[envId] = { values: env.values };
17191
- }
17192
- return out;
17186
+ return environmentsToWire(environments);
17193
17187
  }
17194
17188
  var Config = class {
17195
17189
  id;
@@ -17556,15 +17550,7 @@ function extractEnvironments(environments) {
17556
17550
  if (!environments) return {};
17557
17551
  const result = {};
17558
17552
  for (const [envName, envEntry] of Object.entries(environments)) {
17559
- if (envEntry && typeof envEntry === "object" && envEntry.values) {
17560
- const unwrapped = {};
17561
- for (const [key, item] of Object.entries(envEntry.values)) {
17562
- unwrapped[key] = item && typeof item === "object" && "value" in item ? item.value : item;
17563
- }
17564
- result[envName] = { values: unwrapped };
17565
- } else {
17566
- result[envName] = envEntry;
17567
- }
17553
+ result[envName] = { ...envEntry ?? {} };
17568
17554
  }
17569
17555
  return result;
17570
17556
  }