@objectstack/cloud-connection 9.4.0 → 9.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/dist/index.cjs CHANGED
@@ -1741,12 +1741,14 @@ var RuntimeConfigPlugin = class {
1741
1741
  envRegistry = ctx.getService("env-registry");
1742
1742
  } catch {
1743
1743
  }
1744
- const featuresFor = (plan, base) => {
1745
- const derived = this.resolvePlanFeatures?.(plan);
1746
- return {
1747
- aiStudio: derived?.aiStudio ?? base.aiStudio,
1748
- autoPublishAiBuilds: derived?.autoPublishAiBuilds ?? base.autoPublishAiBuilds
1749
- };
1744
+ const featuresFor = (token, base) => {
1745
+ const derived = this.resolveFeatures?.(token);
1746
+ if (!derived) return { ...base };
1747
+ const out = { ...base };
1748
+ for (const [k, v] of Object.entries(derived)) {
1749
+ if (typeof v === "boolean") out[k] = v;
1750
+ }
1751
+ return out;
1750
1752
  };
1751
1753
  const handler = async (c) => {
1752
1754
  const rawHost = c.req.header("host") ?? "";
@@ -1779,8 +1781,8 @@ var RuntimeConfigPlugin = class {
1779
1781
  features: {
1780
1782
  installLocal: this.installLocal,
1781
1783
  marketplace: true,
1782
- aiStudio: features.aiStudio,
1783
- autoPublishAiBuilds: features.autoPublishAiBuilds
1784
+ // aiStudio + autoPublishAiBuilds + any distribution keys.
1785
+ ...features
1784
1786
  },
1785
1787
  branding: {
1786
1788
  productName: this.productName,
@@ -1790,20 +1792,13 @@ var RuntimeConfigPlugin = class {
1790
1792
  };
1791
1793
  rawApp.get("/api/v1/runtime/config", handler);
1792
1794
  rawApp.get("/api/v1/studio/runtime-config", handler);
1793
- ctx.logger?.info?.("[RuntimeConfigPlugin] mounted /api/v1/runtime/config", {
1794
- cloudUrl: this.cloudUrl || "(empty)",
1795
- installLocal: this.installLocal,
1796
- perHostEnvResolution: !!envRegistry
1797
- });
1798
1795
  });
1799
1796
  };
1800
- this.destroy = async () => {
1801
- };
1802
1797
  this.cloudUrl = config.controlPlaneUrl === "" ? "" : resolveCloudUrl(config.controlPlaneUrl) ?? "";
1803
1798
  this.installLocal = !!config.installLocal;
1804
1799
  this.aiStudio = config.aiStudio !== false;
1805
1800
  this.singleEnvironment = !!config.singleEnvironment;
1806
- this.resolvePlanFeatures = config.resolvePlanFeatures;
1801
+ this.resolveFeatures = config.resolveFeatures ?? config.resolvePlanFeatures;
1807
1802
  const envName = (typeof process !== "undefined" ? process.env?.OS_PRODUCT_NAME : void 0)?.trim();
1808
1803
  const envShort = (typeof process !== "undefined" ? process.env?.OS_PRODUCT_SHORT_NAME : void 0)?.trim();
1809
1804
  this.productName = (config.productName ?? envName ?? "ObjectOS").trim() || "ObjectOS";