subos-frontend 1.0.109 → 1.0.111
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.js +28 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -6
- package/dist/index.mjs.map +1 -1
- package/dist/types/api/client.d.ts +1 -0
- package/dist/types/api/client.d.ts.map +1 -1
- package/dist/types/components/subscription/ScheduledPlanNotification.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +10 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -176,9 +176,14 @@ var plansApi = {
|
|
|
176
176
|
var subscriptionApi = {
|
|
177
177
|
getActiveSubscription: async (externalId, options) => {
|
|
178
178
|
let endpoint = `${ENDPOINTS.SUBSCRIPTION}/${externalId}`;
|
|
179
|
+
const params = new URLSearchParams();
|
|
179
180
|
if (options == null ? void 0 : options.currency) {
|
|
180
|
-
const params = new URLSearchParams();
|
|
181
181
|
params.append("currency", options.currency);
|
|
182
|
+
}
|
|
183
|
+
if (options == null ? void 0 : options.billableMetric) {
|
|
184
|
+
params.append("billableMetric", typeof options.billableMetric === "string" ? options.billableMetric : "true");
|
|
185
|
+
}
|
|
186
|
+
if (params.toString()) {
|
|
182
187
|
endpoint += `?${params.toString()}`;
|
|
183
188
|
}
|
|
184
189
|
return apiRequest(endpoint, "GET", void 0, void 0, true);
|
|
@@ -425,7 +430,7 @@ var SubscriptionProvider = ({ children }) => {
|
|
|
425
430
|
setLoading(true);
|
|
426
431
|
setError(null);
|
|
427
432
|
try {
|
|
428
|
-
const response = await subscriptionApi.getActiveSubscription(externalId, { currency });
|
|
433
|
+
const response = await subscriptionApi.getActiveSubscription(externalId, { currency, billableMetric: "CANDIDATES" });
|
|
429
434
|
if (response.success && response.data) {
|
|
430
435
|
setSubscription(response.data);
|
|
431
436
|
} else {
|
|
@@ -1499,7 +1504,7 @@ var StarBorderIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.j
|
|
|
1499
1504
|
var UpgradeIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 10l7-7m0 0l7 7m-7-7v18" }) });
|
|
1500
1505
|
var CancelIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) });
|
|
1501
1506
|
var AddCardIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6m12-3h3a3 3 0 013 3v8a3 3 0 01-3 3H6a3 3 0 01-3-3v-8a3 3 0 013-3h3" }) });
|
|
1502
|
-
var WarningIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className,
|
|
1507
|
+
var WarningIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) });
|
|
1503
1508
|
var PlansGrid = ({
|
|
1504
1509
|
plans,
|
|
1505
1510
|
selectedPlan,
|
|
@@ -3032,12 +3037,29 @@ var ScheduledPlanNotification = ({
|
|
|
3032
3037
|
if (!(subscription == null ? void 0 : subscription.nextMembership)) {
|
|
3033
3038
|
return null;
|
|
3034
3039
|
}
|
|
3040
|
+
const formatInterval = (interval) => {
|
|
3041
|
+
return interval.charAt(0).toUpperCase() + interval.slice(1).toLowerCase();
|
|
3042
|
+
};
|
|
3043
|
+
const nextPlan = subscription.nextMembership.plan;
|
|
3044
|
+
const metrics = nextPlan.charges && nextPlan.charges.length > 0 ? `(${nextPlan.charges.map(
|
|
3045
|
+
(charge) => {
|
|
3046
|
+
var _a, _b;
|
|
3047
|
+
return `${charge.billableMetric.name}: ${((_b = (_a = charge.properties) == null ? void 0 : _a.units) == null ? void 0 : _b.toLocaleString()) || 0}`;
|
|
3048
|
+
}
|
|
3049
|
+
).join(", ")}) ` : "";
|
|
3035
3050
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md flex items-start gap-3 ${className}`, children: [
|
|
3036
3051
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-yellow-600 mt-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(WarningIcon, { className: "w-5 h-5" }) }),
|
|
3037
3052
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-yellow-800", children: [
|
|
3038
|
-
"Your subscription will change to
|
|
3039
|
-
|
|
3040
|
-
"
|
|
3053
|
+
"Your subscription will change to",
|
|
3054
|
+
" ",
|
|
3055
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-semibold", children: [
|
|
3056
|
+
nextPlan.name,
|
|
3057
|
+
" ",
|
|
3058
|
+
formatInterval(nextPlan.interval),
|
|
3059
|
+
" ",
|
|
3060
|
+
metrics
|
|
3061
|
+
] }),
|
|
3062
|
+
"plan on",
|
|
3041
3063
|
" ",
|
|
3042
3064
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: new Date(subscription.nextMembership.membershipDate).toLocaleDateString("en-US", {
|
|
3043
3065
|
year: "numeric",
|