@burdenoff/website-sdk 2026.728.2 → 2026.728.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/index.mjs CHANGED
@@ -2484,6 +2484,7 @@ var GET_PLANS_QUERY = `
2484
2484
  features {
2485
2485
  id
2486
2486
  quotaId
2487
+ context
2487
2488
  quota {
2488
2489
  id
2489
2490
  name
@@ -2596,27 +2597,27 @@ function humanizeQuotaName(name) {
2596
2597
  const resource = parts.length >= 3 ? parts[parts.length - 2] : parts[parts.length - 1];
2597
2598
  return resource.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
2598
2599
  }
2599
- function transformQuotaToFeature(quota) {
2600
+ function transformFeatureToLabel(feature) {
2601
+ const quota = feature.quota;
2602
+ if (!quota) return "";
2600
2603
  const { name, limits } = quota;
2601
- if (!limits || typeof limits !== "object") {
2602
- return humanizeQuotaName(name);
2603
- }
2604
- const limitsObj = limits;
2605
- const value = limitsObj.value;
2606
- const unit = limitsObj.unit;
2607
- const type = limitsObj.type;
2608
- const description = limitsObj.description;
2609
- if (typeof description === "string" && description) {
2604
+ const featureContext = feature.context && typeof feature.context === "object" ? feature.context : null;
2605
+ const limitsObj = limits && typeof limits === "object" ? limits : null;
2606
+ const value = typeof featureContext?.quantity === "number" ? featureContext.quantity : typeof limitsObj?.value === "number" ? limitsObj.value : void 0;
2607
+ const unit = typeof featureContext?.unit === "string" && featureContext.unit || typeof limitsObj?.unit === "string" && limitsObj.unit || void 0;
2608
+ const description = typeof featureContext?.description === "string" && featureContext.description || typeof limitsObj?.description === "string" && limitsObj.description || void 0;
2609
+ const type = limitsObj?.type;
2610
+ if (description) {
2610
2611
  if (type === "number" && typeof value === "number") {
2611
2612
  return `${value.toLocaleString()} ${description}`;
2612
2613
  }
2613
2614
  return description;
2614
2615
  }
2615
- if (typeof unit === "string" && unit) {
2616
+ if (unit) {
2616
2617
  if (typeof value === "number") {
2617
2618
  return `${value.toLocaleString()} ${unit}`;
2618
2619
  }
2619
- return `${unit}`;
2620
+ return unit;
2620
2621
  }
2621
2622
  const label = humanizeQuotaName(name);
2622
2623
  if (type === "boolean") {
@@ -2635,7 +2636,7 @@ function extractDisplayFeatures(features, planName, fallbackFeatures) {
2635
2636
  return tierFeatures;
2636
2637
  }
2637
2638
  }
2638
- const quotaFeatures = features.filter((f) => f.quota).map((f) => transformQuotaToFeature(f.quota));
2639
+ const quotaFeatures = features.filter((f) => f.quota).map((f) => transformFeatureToLabel(f));
2639
2640
  if (quotaFeatures.length > 0) {
2640
2641
  return quotaFeatures;
2641
2642
  }