@robosystems/core 0.5.1 → 0.5.3

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.
@@ -19,7 +19,11 @@ export function ServiceOfferingsProvider({ children, }) {
19
19
  setError(null);
20
20
  const response = await SDK.getServiceOfferings();
21
21
  if (response.data) {
22
- // Transform the API response to match our expected structure
22
+ // Typed, not `as any`. The previous cast is what let graph tiers be
23
+ // read as `monthly_price`/`monthly_credits` — fields the endpoint has
24
+ // never returned for tiers — so every graphPlans entry carried an
25
+ // undefined price. Keep this typed so a field rename fails the build
26
+ // instead of silently producing undefined at runtime.
23
27
  const apiData = response.data;
24
28
  // Transform repository_subscriptions.repositories array into repositoryPlans object
25
29
  const repositoryPlans = {};
@@ -44,17 +48,24 @@ export function ServiceOfferingsProvider({ children, }) {
44
48
  const graphPlans = {};
45
49
  if ((_b = apiData.graph_subscriptions) === null || _b === void 0 ? void 0 : _b.tiers) {
46
50
  apiData.graph_subscriptions.tiers.forEach((tier) => {
47
- var _a, _b;
48
51
  // Skip trial tier for selection
49
52
  if (tier.name === 'trial')
50
53
  return;
51
54
  graphPlans[tier.name] = {
52
55
  name: tier.name,
53
56
  displayName: tier.display_name,
54
- monthlyPrice: tier.monthly_price,
55
- monthlyCredits: tier.monthly_credits,
57
+ // Graph tiers are per-graph and use the *_per_graph fields.
58
+ // Repository plans above legitimately use monthly_price /
59
+ // monthly_credits — the two shapes differ, and copying the
60
+ // repository mapping here is what introduced the bug.
61
+ monthlyPrice: tier.monthly_price_per_graph,
62
+ monthlyCredits: tier.monthly_credits_per_graph,
56
63
  features: tier.features || [],
57
- creditMultiplier: ((_b = (_a = apiData.graph_subscriptions) === null || _a === void 0 ? void 0 : _a.tier_multipliers) === null || _b === void 0 ? void 0 : _b[tier.name]) || 1,
64
+ // The endpoint serves no per-tier credit multiplier, so this has
65
+ // always resolved to 1. Kept as a constant rather than reading a
66
+ // field that does not exist; retained in the public type so
67
+ // consumers don't break.
68
+ creditMultiplier: 1,
58
69
  instanceStorageLimitGb: tier.instance_storage_limit_gb,
59
70
  };
60
71
  });
@@ -63,7 +74,9 @@ export function ServiceOfferingsProvider({ children, }) {
63
74
  billingEnabled: (_c = apiData.billing_enabled) !== null && _c !== void 0 ? _c : true,
64
75
  repositoryPlans,
65
76
  graphPlans,
66
- features: apiData.features,
77
+ // `features` is intentionally unset: the endpoint returns no
78
+ // top-level features object, so this only ever assigned undefined.
79
+ // The optional field stays on the public type for compatibility.
67
80
  };
68
81
  setOfferings(offerings);
69
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosystems/core",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Shared RoboSystems frontend core library (auth, contexts, task monitoring, UI components) for the RoboSystems Next.js apps",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -30,5 +30,5 @@ export function LandingFooter({ tagline, productLinks, contactModal: ContactModa
30
30
  return (_jsx("li", { children: _jsx(Link, Object.assign({ href: cfg.url }, (isCurrent
31
31
  ? {}
32
32
  : { target: '_blank', rel: 'noopener noreferrer' }), { className: linkClass, children: cfg.displayName })) }, app));
33
- }) })] }), _jsxs("div", { children: [_jsx("h3", { className: headingClass, children: "Company" }), _jsxs("ul", { className: "space-y-2 text-sm", children: [_jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/research` }, companyLinkProps, { className: linkClass, children: "Research" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/blog` }, companyLinkProps, { className: linkClass, children: "Blog" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/privacy` }, companyLinkProps, { className: linkClass, children: "Privacy" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/terms` }, companyLinkProps, { className: linkClass, children: "Terms" })) }), ContactModal && (_jsx("li", { children: _jsx("button", { onClick: () => setShowContact(true), className: linkClass, children: "Contact" }) }))] })] })] }), _jsx("div", { className: "mt-8 border-t border-gray-800 pt-8 text-center text-sm text-gray-400", children: _jsxs("p", { children: ["\u00A9 ", new Date().getFullYear(), " RFS LLC. All rights reserved."] }) })] }), ContactModal && (_jsx(ContactModal, { isOpen: showContact, onClose: () => setShowContact(false) }))] }));
33
+ }) })] }), _jsxs("div", { children: [_jsx("h3", { className: headingClass, children: "Company" }), _jsxs("ul", { className: "space-y-2 text-sm", children: [_jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/research` }, companyLinkProps, { className: linkClass, children: "Research" })) }), _jsx("li", { children: _jsx(Link, { href: "https://holon.robosystems.ai", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "Holon Viewer" }) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/blog` }, companyLinkProps, { className: linkClass, children: "Blog" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/privacy` }, companyLinkProps, { className: linkClass, children: "Privacy" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/terms` }, companyLinkProps, { className: linkClass, children: "Terms" })) }), ContactModal && (_jsx("li", { children: _jsx("button", { onClick: () => setShowContact(true), className: linkClass, children: "Contact" }) }))] })] })] }), _jsx("div", { className: "mt-8 border-t border-gray-800 pt-8 text-center text-sm text-gray-400", children: _jsxs("p", { children: ["\u00A9 ", new Date().getFullYear(), " RFS LLC. All rights reserved."] }) })] }), ContactModal && (_jsx(ContactModal, { isOpen: showContact, onClose: () => setShowContact(false) }))] }));
34
34
  }