@xapps-platform/marketplace-ui 0.1.16 → 0.1.17
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/MarketplaceContext.d.ts.map +1 -1
- package/dist/httpMarketplaceClient.d.ts +25 -0
- package/dist/httpMarketplaceClient.d.ts.map +1 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/index.css +2 -7
- package/dist/index.css.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +459 -89
- package/dist/index.js.map +4 -4
- package/dist/marketplace.css +9 -2
- package/dist/pages/CatalogPage.d.ts.map +1 -1
- package/dist/pages/MonetizationPage.d.ts.map +1 -1
- package/dist/pages/PublisherDetailPage.d.ts.map +1 -1
- package/dist/pages/RequestDetailPage.d.ts.map +1 -1
- package/dist/pages/RequestsPage.d.ts.map +1 -1
- package/dist/pages/XappDetailPage.d.ts.map +1 -1
- package/dist/utils/installationPolicy.d.ts +7 -0
- package/dist/utils/installationPolicy.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -128,7 +128,9 @@ function buildMarketplaceXmsCatalog(locale) {
|
|
|
128
128
|
"xapp.cancelled_at_label": "Anulat la",
|
|
129
129
|
"xapp.virtual_currency_label": "Moned\u0103 virtual\u0103",
|
|
130
130
|
"xapp.current_balances_label": "Solduri acum",
|
|
131
|
+
"xapp.current_credits_label": "Credite acum",
|
|
131
132
|
"xapp.credits_remaining_label": "Sold",
|
|
133
|
+
"xapp.credit_balance_label": "Credite",
|
|
132
134
|
"xapp.add_on_unlocks_label": "Unlock-uri suplimentare",
|
|
133
135
|
"xapp.subscription_refresh_action": "Actualizeaz\u0103 starea",
|
|
134
136
|
"xapp.subscription_refreshing": "Se actualizeaz\u0103...",
|
|
@@ -184,7 +186,9 @@ function buildMarketplaceXmsCatalog(locale) {
|
|
|
184
186
|
"xapp.cancelled_at_label": "Cancelled at",
|
|
185
187
|
"xapp.virtual_currency_label": "Currency",
|
|
186
188
|
"xapp.current_balances_label": "Balances now",
|
|
189
|
+
"xapp.current_credits_label": "Credits now",
|
|
187
190
|
"xapp.credits_remaining_label": "Balance",
|
|
191
|
+
"xapp.credit_balance_label": "Credits",
|
|
188
192
|
"xapp.add_on_unlocks_label": "Add-on unlocks",
|
|
189
193
|
"xapp.subscription_refresh_action": "Refresh status",
|
|
190
194
|
"xapp.subscription_refreshing": "Refreshing...",
|
|
@@ -505,7 +509,9 @@ var MARKETPLACE_CATALOGS = {
|
|
|
505
509
|
"xapp.lifecycle_preview_hint": "Subscription state is being previewed for the selected time.",
|
|
506
510
|
"xapp.virtual_currency_label": "Currency",
|
|
507
511
|
"xapp.current_balances_label": "Balances now",
|
|
512
|
+
"xapp.current_credits_label": "Credits now",
|
|
508
513
|
"xapp.credits_remaining_label": "Balance",
|
|
514
|
+
"xapp.credit_balance_label": "Credits",
|
|
509
515
|
"xapp.available_label": "Available",
|
|
510
516
|
"xapp.ready_to_use": "{count} ready to use",
|
|
511
517
|
"xapp.source_label": "Source",
|
|
@@ -837,7 +843,9 @@ var MARKETPLACE_CATALOGS = {
|
|
|
837
843
|
"xapp.lifecycle_preview_hint": "Ciclul de via\u021B\u0103 al abonamentului este previzualizat pentru momentul selectat.",
|
|
838
844
|
"xapp.virtual_currency_label": "Moned\u0103 virtual\u0103",
|
|
839
845
|
"xapp.current_balances_label": "Solduri curente",
|
|
846
|
+
"xapp.current_credits_label": "Credite acum",
|
|
840
847
|
"xapp.credits_remaining_label": "Sold",
|
|
848
|
+
"xapp.credit_balance_label": "Credite",
|
|
841
849
|
"xapp.available_label": "Disponibile",
|
|
842
850
|
"xapp.ready_to_use": "{count} gata de utilizare",
|
|
843
851
|
"xapp.source_label": "Surs\u0103",
|
|
@@ -951,7 +959,8 @@ function applyMarketplaceThemeToDocument(theme) {
|
|
|
951
959
|
["radiusMd", ["--cx-radius-md", "--mx-radius-md"]],
|
|
952
960
|
["radius", ["--cx-radius", "--cx-radius-lg", "--mx-radius-md", "--mx-radius-lg"]],
|
|
953
961
|
["radiusLg", ["--cx-radius-lg", "--mx-radius-lg"]],
|
|
954
|
-
["fontFamily", ["--mx-font-family"]]
|
|
962
|
+
["fontFamily", ["--xapps-font-family", "--mx-font-family"]],
|
|
963
|
+
["displayFont", ["--xapps-display-font", "--mx-display-font"]]
|
|
955
964
|
];
|
|
956
965
|
for (const [key, cssVars] of map) {
|
|
957
966
|
const rawValue = theme[key];
|
|
@@ -1128,6 +1137,13 @@ function buildTokenSearch(token, search) {
|
|
|
1128
1137
|
return out ? `?${out}` : "";
|
|
1129
1138
|
}
|
|
1130
1139
|
|
|
1140
|
+
// src/utils/installationPolicy.ts
|
|
1141
|
+
function shouldHideMarketplaceVersions(input) {
|
|
1142
|
+
const installationPolicyResolved = input.installationPolicyResolved !== false;
|
|
1143
|
+
if (!installationPolicyResolved) return false;
|
|
1144
|
+
return input.installationPolicy?.mode === "auto_available" && input.installationPolicy?.update_mode === "auto_update_compatible";
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1131
1147
|
// src/utils/readers.ts
|
|
1132
1148
|
function isRecord(value) {
|
|
1133
1149
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -1250,6 +1266,11 @@ function CatalogPage() {
|
|
|
1250
1266
|
const mutationControlsReady = installationPolicyResolved || !host.subjectId || !canMutate;
|
|
1251
1267
|
const autoUpdateMode = mutationControlsReady && (env?.installationPolicy ?? host.installationPolicy)?.update_mode === "auto_update_compatible" && Boolean(host.subjectId);
|
|
1252
1268
|
const autoAvailableMode = mutationControlsReady && (env?.installationPolicy ?? host.installationPolicy)?.mode === "auto_available" && Boolean(host.subjectId);
|
|
1269
|
+
const hideVersions = shouldHideMarketplaceVersions({
|
|
1270
|
+
installationPolicy: env?.installationPolicy ?? host.installationPolicy ?? null,
|
|
1271
|
+
installationPolicyResolved,
|
|
1272
|
+
subjectId: host.subjectId
|
|
1273
|
+
});
|
|
1253
1274
|
const loc = useLocation();
|
|
1254
1275
|
const token = useQueryToken();
|
|
1255
1276
|
const tokenSearch = buildTokenSearch(token, loc.search);
|
|
@@ -1546,7 +1567,7 @@ function CatalogPage() {
|
|
|
1546
1567
|
/* @__PURE__ */ jsx6("span", { className: "mx-card-installed-badge-dot" }),
|
|
1547
1568
|
t("common.added", void 0, "Added")
|
|
1548
1569
|
] }),
|
|
1549
|
-
x.latest_version?.version && /* @__PURE__ */ jsxs3("div", { className: "mx-card-version", children: [
|
|
1570
|
+
!hideVersions && x.latest_version?.version && /* @__PURE__ */ jsxs3("div", { className: "mx-card-version", children: [
|
|
1550
1571
|
"v",
|
|
1551
1572
|
x.latest_version.version
|
|
1552
1573
|
] })
|
|
@@ -2276,7 +2297,9 @@ var XMS_COPY_CATALOG = {
|
|
|
2276
2297
|
managementDestinationHintOwnerLabel: "Advanced subscription management is handled by the app owner.",
|
|
2277
2298
|
openManagementDestinationActionLabel: "Open management",
|
|
2278
2299
|
virtualCurrencyLabel: "Currency",
|
|
2300
|
+
currentCreditsLabel: "Credits now",
|
|
2279
2301
|
creditsRemainingLabel: "Balance",
|
|
2302
|
+
creditBalanceLabel: "Credits",
|
|
2280
2303
|
addOnUnlocksLabel: "Add-on unlocks",
|
|
2281
2304
|
coverageActiveLabel: "Still covered",
|
|
2282
2305
|
coverageInactiveLabel: "Not covered",
|
|
@@ -2294,6 +2317,7 @@ var XMS_COPY_CATALOG = {
|
|
|
2294
2317
|
historyAuditTitle: "Detailed history",
|
|
2295
2318
|
historyAuditSubtitle: "Recent records grouped by subscriptions, balances, purchases, and invoices.",
|
|
2296
2319
|
historyBalanceSummaryTitle: "Balances now",
|
|
2320
|
+
historyCreditSummaryTitle: "Credits now",
|
|
2297
2321
|
historyBalanceSummarySubtitle: "Latest visible wallet balances grouped by virtual currency for this app.",
|
|
2298
2322
|
noHistoryAvailableLabel: "No monetization history is available for this app yet.",
|
|
2299
2323
|
historyGenericLabel: "History",
|
|
@@ -2454,7 +2478,9 @@ var XMS_COPY_CATALOG = {
|
|
|
2454
2478
|
managementDestinationHintOwnerLabel: "Administrarea avansat\u0103 a abonamentului este gestionat\u0103 de proprietarul aplica\u021Biei.",
|
|
2455
2479
|
openManagementDestinationActionLabel: "Deschide administrarea",
|
|
2456
2480
|
virtualCurrencyLabel: "Moned\u0103 virtual\u0103",
|
|
2481
|
+
currentCreditsLabel: "Credite acum",
|
|
2457
2482
|
creditsRemainingLabel: "Sold",
|
|
2483
|
+
creditBalanceLabel: "Credite",
|
|
2458
2484
|
addOnUnlocksLabel: "Unlock-uri suplimentare",
|
|
2459
2485
|
coverageActiveLabel: "\xCEnc\u0103 activ",
|
|
2460
2486
|
coverageInactiveLabel: "Neacoperit",
|
|
@@ -2472,6 +2498,7 @@ var XMS_COPY_CATALOG = {
|
|
|
2472
2498
|
historyAuditTitle: "Istoric detaliat",
|
|
2473
2499
|
historyAuditSubtitle: "\xCEnregistr\u0103ri recente grupate dup\u0103 abonamente, solduri, cump\u0103r\u0103ri \u0219i facturi.",
|
|
2474
2500
|
historyBalanceSummaryTitle: "Solduri acum",
|
|
2501
|
+
historyCreditSummaryTitle: "Credite acum",
|
|
2475
2502
|
historyBalanceSummarySubtitle: "Cele mai recente solduri vizibile din portofel, grupate dup\u0103 moneda virtual\u0103 pentru aceast\u0103 aplica\u021Bie.",
|
|
2476
2503
|
noHistoryAvailableLabel: "Nu exist\u0103 \xEEnc\u0103 istoric de monetizare disponibil pentru aceast\u0103 aplica\u021Bie.",
|
|
2477
2504
|
historyGenericLabel: "Istoric",
|
|
@@ -2569,6 +2596,9 @@ function readVirtualCurrencyDefinition(value) {
|
|
|
2569
2596
|
if (!code && !name) return null;
|
|
2570
2597
|
return record;
|
|
2571
2598
|
}
|
|
2599
|
+
function hasNamedVirtualCurrency(value) {
|
|
2600
|
+
return Boolean(readVirtualCurrencyDefinition(value));
|
|
2601
|
+
}
|
|
2572
2602
|
function formatVirtualCurrencyLabel(value, options) {
|
|
2573
2603
|
const record = readVirtualCurrencyDefinition(value);
|
|
2574
2604
|
if (!record) return "";
|
|
@@ -2735,14 +2765,27 @@ function flattenXappMonetizationPaywallPackages(paywall) {
|
|
|
2735
2765
|
out.push({
|
|
2736
2766
|
offeringId: readString4(packageRecord.offering_id),
|
|
2737
2767
|
offeringSlug: readString4(packageRecord.offering_slug),
|
|
2738
|
-
offeringTitle:
|
|
2768
|
+
offeringTitle: readLocalizedText(
|
|
2769
|
+
packageRecord.offering_title,
|
|
2770
|
+
readString4(packageRecord.offering_slug) || buildXmsSurfaceCopy().offeringFallbackLabel
|
|
2771
|
+
),
|
|
2739
2772
|
offeringPlacement: readString4(packageRecord.offering_placement) || null,
|
|
2740
2773
|
packageId: readString4(packageRecord.id),
|
|
2741
2774
|
packageSlug: readString4(packageRecord.slug),
|
|
2742
|
-
packageTitle:
|
|
2775
|
+
packageTitle: readLocalizedText(
|
|
2776
|
+
packageRecord.title,
|
|
2777
|
+
readLocalizedText(
|
|
2778
|
+
packageRecord.product?.title,
|
|
2779
|
+
readString4(packageRecord.slug) || buildXmsSurfaceCopy().packageFallbackLabel
|
|
2780
|
+
)
|
|
2781
|
+
),
|
|
2743
2782
|
packageKind: readString4(packageRecord.package_kind) || "standard",
|
|
2744
2783
|
productId: readString4(packageRecord.product?.id),
|
|
2745
2784
|
productSlug: readString4(packageRecord.product?.slug),
|
|
2785
|
+
productTitle: readLocalizedText(
|
|
2786
|
+
packageRecord.product?.title,
|
|
2787
|
+
readString4(packageRecord.product?.slug)
|
|
2788
|
+
),
|
|
2746
2789
|
productFamily: readString4(
|
|
2747
2790
|
packageRecord.product?.product_family
|
|
2748
2791
|
),
|
|
@@ -2860,7 +2903,10 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2860
2903
|
display: grid;
|
|
2861
2904
|
gap: 16px;
|
|
2862
2905
|
color: var(--xapps-text-primary, #0f172a);
|
|
2863
|
-
font-family: var(
|
|
2906
|
+
font-family: var(
|
|
2907
|
+
--xapps-font-family,
|
|
2908
|
+
var(--mx-font-family, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif)
|
|
2909
|
+
);
|
|
2864
2910
|
}
|
|
2865
2911
|
.xapps-xms-plans__header {
|
|
2866
2912
|
display: grid;
|
|
@@ -2868,7 +2914,8 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2868
2914
|
}
|
|
2869
2915
|
.xapps-xms-plans__title {
|
|
2870
2916
|
margin: 0;
|
|
2871
|
-
font: 700 1.05rem/1.15
|
|
2917
|
+
font: 700 1.05rem/1.15
|
|
2918
|
+
var(--xapps-display-font, var(--mx-display-font, var(--mx-font-family, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif)));
|
|
2872
2919
|
letter-spacing: -0.01em;
|
|
2873
2920
|
}
|
|
2874
2921
|
.xapps-xms-plans__subtitle {
|
|
@@ -2895,7 +2942,8 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2895
2942
|
}
|
|
2896
2943
|
.xapps-xms-plans__section-title {
|
|
2897
2944
|
margin: 0;
|
|
2898
|
-
font: 700 0.98rem/1.1
|
|
2945
|
+
font: 700 0.98rem/1.1
|
|
2946
|
+
var(--xapps-display-font, var(--mx-display-font, var(--mx-font-family, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif)));
|
|
2899
2947
|
letter-spacing: -0.01em;
|
|
2900
2948
|
}
|
|
2901
2949
|
.xapps-xms-plans__meta {
|
|
@@ -2930,15 +2978,34 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2930
2978
|
.xapps-xms-plans__notice {
|
|
2931
2979
|
padding: 10px 12px;
|
|
2932
2980
|
border-radius: 12px;
|
|
2933
|
-
|
|
2934
|
-
|
|
2981
|
+
border: 1px solid
|
|
2982
|
+
var(
|
|
2983
|
+
--xapps-paywall-notice-border,
|
|
2984
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 18%, var(--xapps-border-color, transparent))
|
|
2985
|
+
);
|
|
2986
|
+
background: var(
|
|
2987
|
+
--xapps-paywall-notice-bg,
|
|
2988
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 8%, var(--xapps-surface-bg, #ffffff))
|
|
2989
|
+
);
|
|
2990
|
+
color: var(
|
|
2991
|
+
--xapps-paywall-notice-text,
|
|
2992
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 82%, var(--xapps-text-primary, #0f172a))
|
|
2993
|
+
);
|
|
2935
2994
|
font-size: 13px;
|
|
2936
2995
|
}
|
|
2937
2996
|
.xapps-xms-plans__error {
|
|
2938
2997
|
padding: 10px 12px;
|
|
2939
2998
|
border-radius: 12px;
|
|
2940
|
-
|
|
2941
|
-
|
|
2999
|
+
border: 1px solid
|
|
3000
|
+
var(
|
|
3001
|
+
--xapps-paywall-danger-border,
|
|
3002
|
+
color-mix(in srgb, var(--xapps-danger, #dc2626) 18%, var(--xapps-border-color, transparent))
|
|
3003
|
+
);
|
|
3004
|
+
background: var(
|
|
3005
|
+
--xapps-paywall-danger-bg,
|
|
3006
|
+
color-mix(in srgb, var(--xapps-danger, #dc2626) 8%, var(--xapps-surface-bg, #ffffff))
|
|
3007
|
+
);
|
|
3008
|
+
color: var(--xapps-paywall-danger-text, var(--xapps-danger, #b91c1c));
|
|
2942
3009
|
font-size: 13px;
|
|
2943
3010
|
}
|
|
2944
3011
|
.xapps-xms-plans__packages {
|
|
@@ -2954,12 +3021,24 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2954
3021
|
background: color-mix(in srgb, var(--xapps-surface-bg, #ffffff) 94%, var(--xapps-surface-subtle, #f8fafc));
|
|
2955
3022
|
}
|
|
2956
3023
|
.xapps-xms-plans__package.is-selected {
|
|
2957
|
-
border-color:
|
|
2958
|
-
|
|
3024
|
+
border-color: var(
|
|
3025
|
+
--xapps-paywall-selected-border,
|
|
3026
|
+
color-mix(in srgb, var(--xapps-accent, #2563eb) 34%, var(--xapps-border-color, transparent))
|
|
3027
|
+
);
|
|
3028
|
+
box-shadow: var(
|
|
3029
|
+
--xapps-paywall-selected-shadow,
|
|
3030
|
+
inset 0 0 0 1px color-mix(in srgb, var(--xapps-accent, #2563eb) 12%, transparent)
|
|
3031
|
+
);
|
|
2959
3032
|
}
|
|
2960
3033
|
.xapps-xms-plans__package.is-default {
|
|
2961
|
-
border-color:
|
|
2962
|
-
|
|
3034
|
+
border-color: var(
|
|
3035
|
+
--xapps-paywall-default-border,
|
|
3036
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 28%, var(--xapps-border-color, transparent))
|
|
3037
|
+
);
|
|
3038
|
+
box-shadow: var(
|
|
3039
|
+
--xapps-paywall-default-shadow,
|
|
3040
|
+
inset 0 0 0 1px color-mix(in srgb, var(--xapps-accent, #0f766e) 10%, transparent)
|
|
3041
|
+
);
|
|
2963
3042
|
}
|
|
2964
3043
|
.xapps-xms-plans__package-head {
|
|
2965
3044
|
display: flex;
|
|
@@ -2969,7 +3048,8 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2969
3048
|
}
|
|
2970
3049
|
.xapps-xms-plans__package-title {
|
|
2971
3050
|
margin: 0;
|
|
2972
|
-
font: 700 0.98rem/1.15
|
|
3051
|
+
font: 700 0.98rem/1.15
|
|
3052
|
+
var(--xapps-display-font, var(--mx-display-font, var(--mx-font-family, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif)));
|
|
2973
3053
|
letter-spacing: -0.01em;
|
|
2974
3054
|
}
|
|
2975
3055
|
.xapps-xms-plans__package-description {
|
|
@@ -2984,11 +3064,21 @@ var monetizationPlansSurfaceStyles = `
|
|
|
2984
3064
|
white-space: nowrap;
|
|
2985
3065
|
padding: 6px 10px;
|
|
2986
3066
|
border-radius: 999px;
|
|
2987
|
-
background:
|
|
2988
|
-
|
|
3067
|
+
background: var(
|
|
3068
|
+
--xapps-paywall-money-bg,
|
|
3069
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 7%, var(--xapps-surface-bg, #ffffff))
|
|
3070
|
+
);
|
|
3071
|
+
color: var(
|
|
3072
|
+
--xapps-paywall-money-text,
|
|
3073
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 28%, var(--xapps-text-primary, #1e293b))
|
|
3074
|
+
);
|
|
2989
3075
|
font-size: 12px;
|
|
2990
3076
|
font-weight: 700;
|
|
2991
|
-
border: 1px solid
|
|
3077
|
+
border: 1px solid
|
|
3078
|
+
var(
|
|
3079
|
+
--xapps-paywall-primary-border,
|
|
3080
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 14%, var(--xapps-border-color, transparent))
|
|
3081
|
+
);
|
|
2992
3082
|
}
|
|
2993
3083
|
.xapps-xms-plans__badges,
|
|
2994
3084
|
.xapps-xms-plans__signals {
|
|
@@ -3006,13 +3096,25 @@ var monetizationPlansSurfaceStyles = `
|
|
|
3006
3096
|
font-size: 12px;
|
|
3007
3097
|
}
|
|
3008
3098
|
.xapps-xms-plans__badge {
|
|
3009
|
-
background:
|
|
3010
|
-
|
|
3099
|
+
background: var(
|
|
3100
|
+
--xapps-paywall-badge-bg,
|
|
3101
|
+
color-mix(in srgb, var(--xapps-accent, #2563eb) 8%, var(--xapps-surface-bg, #ffffff))
|
|
3102
|
+
);
|
|
3103
|
+
color: var(
|
|
3104
|
+
--xapps-paywall-badge-text,
|
|
3105
|
+
color-mix(in srgb, var(--xapps-accent, #2563eb) 66%, var(--xapps-text-primary, #1d4ed8))
|
|
3106
|
+
);
|
|
3011
3107
|
font-weight: 700;
|
|
3012
3108
|
}
|
|
3013
3109
|
.xapps-xms-plans__signal {
|
|
3014
|
-
background:
|
|
3015
|
-
|
|
3110
|
+
background: var(
|
|
3111
|
+
--xapps-paywall-signal-bg,
|
|
3112
|
+
color-mix(in srgb, var(--xapps-text-primary, #0f172a) 4%, var(--xapps-surface-bg, #ffffff))
|
|
3113
|
+
);
|
|
3114
|
+
color: var(
|
|
3115
|
+
--xapps-paywall-signal-text,
|
|
3116
|
+
color-mix(in srgb, var(--xapps-text-primary, #0f172a) 42%, var(--xapps-text-secondary, #64748b))
|
|
3117
|
+
);
|
|
3016
3118
|
}
|
|
3017
3119
|
.xapps-xms-plans__action {
|
|
3018
3120
|
justify-self: start;
|
|
@@ -3025,7 +3127,7 @@ var monetizationPlansSurfaceStyles = `
|
|
|
3025
3127
|
color-mix(in srgb, var(--xapps-accent, #0f766e) 94%, white),
|
|
3026
3128
|
color-mix(in srgb, var(--xapps-accent-strong, var(--xapps-accent, #155e75)) 94%, black)
|
|
3027
3129
|
);
|
|
3028
|
-
color: #f8fafc;
|
|
3130
|
+
color: var(--xapps-paywall-action-text, #f8fafc);
|
|
3029
3131
|
font-weight: 700;
|
|
3030
3132
|
cursor: pointer;
|
|
3031
3133
|
box-shadow: 0 10px 22px color-mix(in srgb, var(--xapps-accent, #0f766e) 18%, transparent);
|
|
@@ -3036,7 +3138,7 @@ var monetizationPlansSurfaceStyles = `
|
|
|
3036
3138
|
}
|
|
3037
3139
|
.xapps-xms-plans__action:hover,
|
|
3038
3140
|
.xapps-xms-plans__action:focus-visible {
|
|
3039
|
-
color: #f8fafc;
|
|
3141
|
+
color: var(--xapps-paywall-action-text, #f8fafc);
|
|
3040
3142
|
filter: saturate(1.04) brightness(1.01);
|
|
3041
3143
|
box-shadow: 0 14px 28px color-mix(in srgb, var(--xapps-accent, #0f766e) 24%, transparent);
|
|
3042
3144
|
}
|
|
@@ -3067,19 +3169,40 @@ var monetizationPlansSurfaceStyles = `
|
|
|
3067
3169
|
}
|
|
3068
3170
|
.xapps-xms-plans__surface-action:hover,
|
|
3069
3171
|
.xapps-xms-plans__surface-action:focus-visible {
|
|
3070
|
-
border-color:
|
|
3071
|
-
|
|
3072
|
-
|
|
3172
|
+
border-color: var(
|
|
3173
|
+
--xapps-paywall-primary-border,
|
|
3174
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 28%, var(--xapps-border-color, transparent))
|
|
3175
|
+
);
|
|
3176
|
+
background: var(
|
|
3177
|
+
--xapps-paywall-primary-bg,
|
|
3178
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 7%, var(--xapps-surface-bg, #ffffff))
|
|
3179
|
+
);
|
|
3180
|
+
color: var(
|
|
3181
|
+
--xapps-paywall-primary-text,
|
|
3182
|
+
color-mix(in srgb, var(--xapps-accent, #0f766e) 24%, var(--xapps-text-primary, #0f172a))
|
|
3183
|
+
);
|
|
3073
3184
|
}
|
|
3074
3185
|
.xapps-xms-plans__surface-action[data-variant="danger"] {
|
|
3075
|
-
border-color:
|
|
3076
|
-
|
|
3186
|
+
border-color: var(
|
|
3187
|
+
--xapps-paywall-danger-border,
|
|
3188
|
+
color-mix(in srgb, var(--xapps-danger, #dc2626) 22%, var(--xapps-border-color, transparent))
|
|
3189
|
+
);
|
|
3190
|
+
color: var(--xapps-paywall-danger-text, var(--xapps-danger, #b91c1c));
|
|
3077
3191
|
}
|
|
3078
3192
|
.xapps-xms-plans__surface-action[data-variant="danger"]:hover,
|
|
3079
3193
|
.xapps-xms-plans__surface-action[data-variant="danger"]:focus-visible {
|
|
3080
|
-
border-color:
|
|
3081
|
-
|
|
3082
|
-
|
|
3194
|
+
border-color: var(
|
|
3195
|
+
--xapps-paywall-danger-border,
|
|
3196
|
+
color-mix(in srgb, var(--xapps-danger, #dc2626) 34%, var(--xapps-border-color, transparent))
|
|
3197
|
+
);
|
|
3198
|
+
background: var(
|
|
3199
|
+
--xapps-paywall-danger-bg,
|
|
3200
|
+
color-mix(in srgb, var(--xapps-danger, #dc2626) 8%, var(--xapps-surface-bg, #ffffff))
|
|
3201
|
+
);
|
|
3202
|
+
color: var(
|
|
3203
|
+
--xapps-paywall-danger-text,
|
|
3204
|
+
color-mix(in srgb, var(--xapps-danger, #dc2626) 72%, var(--xapps-text-primary, #991b1b))
|
|
3205
|
+
);
|
|
3083
3206
|
}
|
|
3084
3207
|
.xapps-xms-plans__surface-action[disabled] {
|
|
3085
3208
|
cursor: not-allowed;
|
|
@@ -3143,7 +3266,8 @@ var monetizationPlansSurfaceStyles = `
|
|
|
3143
3266
|
}
|
|
3144
3267
|
.xapps-xms-plans__history-title {
|
|
3145
3268
|
margin: 0;
|
|
3146
|
-
font: 700 0.92rem/1.1
|
|
3269
|
+
font: 700 0.92rem/1.1
|
|
3270
|
+
var(--xapps-display-font, var(--mx-display-font, var(--mx-font-family, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif)));
|
|
3147
3271
|
}
|
|
3148
3272
|
.xapps-xms-plans__history-count {
|
|
3149
3273
|
color: #64748b;
|
|
@@ -3248,7 +3372,7 @@ function summarizeVirtualCurrencyBalances(input) {
|
|
|
3248
3372
|
upsertBalance({
|
|
3249
3373
|
amount: item.balance_remaining,
|
|
3250
3374
|
virtualCurrency: item.virtual_currency,
|
|
3251
|
-
fallbackUnit:
|
|
3375
|
+
fallbackUnit: "credits",
|
|
3252
3376
|
fallbackKey: item.product_slug || item.id
|
|
3253
3377
|
});
|
|
3254
3378
|
}
|
|
@@ -3273,7 +3397,8 @@ function summarizeVirtualCurrencyBalances(input) {
|
|
|
3273
3397
|
virtualCurrency: item.virtualCurrency,
|
|
3274
3398
|
fallbackUnit: item.fallbackUnit
|
|
3275
3399
|
}) || amount,
|
|
3276
|
-
accountCount: item.accountCount
|
|
3400
|
+
accountCount: item.accountCount,
|
|
3401
|
+
hasNamedCurrency: hasNamedVirtualCurrency(item.virtualCurrency)
|
|
3277
3402
|
};
|
|
3278
3403
|
}).sort((left, right) => {
|
|
3279
3404
|
const amountDiff = readNumber(right.amount) - readNumber(left.amount);
|
|
@@ -3283,7 +3408,8 @@ function summarizeVirtualCurrencyBalances(input) {
|
|
|
3283
3408
|
return {
|
|
3284
3409
|
balances,
|
|
3285
3410
|
totalAccounts: walletAccounts.length,
|
|
3286
|
-
totalCurrencies: balances.length
|
|
3411
|
+
totalCurrencies: balances.length,
|
|
3412
|
+
totalNamedCurrencies: balances.filter((item) => item.hasNamedCurrency).length
|
|
3287
3413
|
};
|
|
3288
3414
|
}
|
|
3289
3415
|
function readHistoryTitle(item, keys, fallback) {
|
|
@@ -3557,9 +3683,10 @@ function buildMonetizationHistoryBalanceSummaryHtml(input) {
|
|
|
3557
3683
|
const copy = buildXmsSurfaceCopy({ locale });
|
|
3558
3684
|
const summary = summarizeVirtualCurrencyBalances(history);
|
|
3559
3685
|
if (!summary.balances.length) return "";
|
|
3686
|
+
const summaryTitle = summary.totalNamedCurrencies > 0 ? copy.historyBalanceSummaryTitle : copy.historyCreditSummaryTitle;
|
|
3560
3687
|
return `
|
|
3561
3688
|
<section class="xapps-xms-plans__card">
|
|
3562
|
-
<h4 class="xapps-xms-plans__section-title">${escapeHtml(
|
|
3689
|
+
<h4 class="xapps-xms-plans__section-title">${escapeHtml(summaryTitle)}</h4>
|
|
3563
3690
|
<div class="xapps-xms-plans__subtitle">${escapeHtml(copy.historyBalanceSummarySubtitle)}</div>
|
|
3564
3691
|
<div class="xapps-xms-plans__badges">
|
|
3565
3692
|
${summary.balances.map(
|
|
@@ -4010,24 +4137,17 @@ function MonetizationPage() {
|
|
|
4010
4137
|
try {
|
|
4011
4138
|
const next = await Promise.all(
|
|
4012
4139
|
deduped.map(async (item) => {
|
|
4013
|
-
const [detail, state
|
|
4140
|
+
const [detail, state] = await Promise.all([
|
|
4014
4141
|
client.getCatalogXapp(item.xappId, {
|
|
4015
4142
|
installationId: item.installationId || null
|
|
4016
4143
|
}),
|
|
4017
4144
|
client.getMyXappMonetization(item.xappId, {
|
|
4018
4145
|
installationId: item.installationId || null,
|
|
4019
4146
|
locale
|
|
4020
|
-
})
|
|
4021
|
-
typeof client.getMyXappMonetizationHistory === "function" ? client.getMyXappMonetizationHistory(item.xappId, {
|
|
4022
|
-
installationId: item.installationId || null,
|
|
4023
|
-
limit: 20
|
|
4024
|
-
}) : Promise.resolve(null)
|
|
4147
|
+
})
|
|
4025
4148
|
]);
|
|
4026
4149
|
if (!xappIdFilter && !isMonetizationCandidate(detail)) return null;
|
|
4027
4150
|
const summary = summarizeXappMonetizationSnapshot(state);
|
|
4028
|
-
const balanceSummary = summarizeVirtualCurrencyBalances(history).balances.map(
|
|
4029
|
-
(entry) => entry.amountLabel
|
|
4030
|
-
);
|
|
4031
4151
|
const detailRecord = asRecord(detail);
|
|
4032
4152
|
const accessProjection = asRecord(asRecord(state).access_projection);
|
|
4033
4153
|
const virtualCurrencyLabel = formatVirtualCurrencyLabel2(
|
|
@@ -4040,6 +4160,8 @@ function MonetizationPage() {
|
|
|
4040
4160
|
accessProjection.credits_remaining,
|
|
4041
4161
|
accessProjection.virtual_currency
|
|
4042
4162
|
) || summary.wallet.creditsRemaining || "0";
|
|
4163
|
+
const hasLiveBalance = Boolean(readString(accessProjection.credits_remaining));
|
|
4164
|
+
const hasNamedCurrency = Boolean(virtualCurrencyLabel);
|
|
4043
4165
|
const title = resolveMarketplaceText(asRecord(detailRecord.manifest).title, locale) || readFirstString(asRecord(detailRecord.xapp).name) || item.xappId;
|
|
4044
4166
|
const subtitle = resolveMarketplaceText(asRecord(detailRecord.manifest).summary, locale) || resolveMarketplaceText(asRecord(detailRecord.manifest).description, locale) || t(
|
|
4045
4167
|
"activity.monetization_card_subtitle",
|
|
@@ -4081,12 +4203,12 @@ function MonetizationPage() {
|
|
|
4081
4203
|
),
|
|
4082
4204
|
renewsAt: summary.currentSubscription.renewsAt || t("activity.monetization_not_scheduled", void 0, "Not scheduled"),
|
|
4083
4205
|
virtualCurrencyLabel,
|
|
4206
|
+
balanceTitle: hasNamedCurrency ? t("activity.monetization_credits_label", void 0, "Balance") : t("xapp.credit_balance_label", void 0, "Credits"),
|
|
4084
4207
|
creditsRemaining: creditsRemainingLabel,
|
|
4085
4208
|
balanceState: summary.wallet.balanceStateLabel || t("activity.monetization_balance_unknown", void 0, "unknown"),
|
|
4086
|
-
balanceSummary,
|
|
4087
4209
|
hasSubscription: summary.currentSubscription.present,
|
|
4088
|
-
hasNamedCurrency
|
|
4089
|
-
hasBalance: Boolean(
|
|
4210
|
+
hasNamedCurrency,
|
|
4211
|
+
hasBalance: Boolean(hasLiveBalance || creditsRemainingLabel)
|
|
4090
4212
|
};
|
|
4091
4213
|
})
|
|
4092
4214
|
);
|
|
@@ -4340,7 +4462,7 @@ function MonetizationPage() {
|
|
|
4340
4462
|
children: item.subscriptionStatus
|
|
4341
4463
|
}
|
|
4342
4464
|
),
|
|
4343
|
-
/* @__PURE__ */ jsx9("span", { className: "mx-tag", children: item.virtualCurrencyLabel || t("
|
|
4465
|
+
/* @__PURE__ */ jsx9("span", { className: "mx-tag", children: item.virtualCurrencyLabel || t("xapp.credit_balance_label", void 0, "Credits") })
|
|
4344
4466
|
] })
|
|
4345
4467
|
] }),
|
|
4346
4468
|
/* @__PURE__ */ jsxs5("div", { className: "mx-record-actions mx-record-actions-monetization", children: [
|
|
@@ -4386,7 +4508,7 @@ function MonetizationPage() {
|
|
|
4386
4508
|
/* @__PURE__ */ jsx9("div", { className: "mx-record-value", children: item.subscriptionStatus })
|
|
4387
4509
|
] }),
|
|
4388
4510
|
/* @__PURE__ */ jsxs5("div", { className: "mx-record-field", children: [
|
|
4389
|
-
/* @__PURE__ */ jsx9("div", { className: "mx-record-label", children:
|
|
4511
|
+
/* @__PURE__ */ jsx9("div", { className: "mx-record-label", children: item.balanceTitle }),
|
|
4390
4512
|
/* @__PURE__ */ jsx9("div", { className: "mx-record-value is-strong", children: item.creditsRemaining })
|
|
4391
4513
|
] }),
|
|
4392
4514
|
/* @__PURE__ */ jsxs5("div", { className: "mx-record-field", children: [
|
|
@@ -4395,10 +4517,10 @@ function MonetizationPage() {
|
|
|
4395
4517
|
] })
|
|
4396
4518
|
] }),
|
|
4397
4519
|
/* @__PURE__ */ jsxs5("div", { className: "mx-monetization-card-secondary", children: [
|
|
4398
|
-
/* @__PURE__ */ jsxs5("div", { className: "mx-monetization-card-secondary-row", children: [
|
|
4520
|
+
item.hasNamedCurrency ? /* @__PURE__ */ jsxs5("div", { className: "mx-monetization-card-secondary-row", children: [
|
|
4399
4521
|
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-label", children: t("xapp.virtual_currency_label", void 0, "Currency") }),
|
|
4400
|
-
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-value", children: item.virtualCurrencyLabel
|
|
4401
|
-
] }),
|
|
4522
|
+
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-value", children: item.virtualCurrencyLabel })
|
|
4523
|
+
] }) : null,
|
|
4402
4524
|
/* @__PURE__ */ jsxs5("div", { className: "mx-monetization-card-secondary-row", children: [
|
|
4403
4525
|
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-label", children: t("activity.monetization_coverage_label", void 0, "Renewal state") }),
|
|
4404
4526
|
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-value", children: item.subscriptionCoverage })
|
|
@@ -4411,11 +4533,7 @@ function MonetizationPage() {
|
|
|
4411
4533
|
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-label", children: t("activity.monetization_source_label", void 0, "Origin") }),
|
|
4412
4534
|
/* @__PURE__ */ jsx9("span", { className: "mx-monetization-card-secondary-value", children: item.sourceLabel })
|
|
4413
4535
|
] })
|
|
4414
|
-
] })
|
|
4415
|
-
item.balanceSummary.length > 0 ? /* @__PURE__ */ jsxs5("div", { className: "mx-monetization-card-balance-strip", children: [
|
|
4416
|
-
/* @__PURE__ */ jsx9("div", { className: "mx-record-label", children: t("activity.monetization_balances_label", void 0, "Balances") }),
|
|
4417
|
-
/* @__PURE__ */ jsx9("div", { className: "mx-tag-list", children: item.balanceSummary.map((entry) => /* @__PURE__ */ jsx9("span", { className: "mx-tag", children: entry }, `${item.xappId}:${entry}`)) })
|
|
4418
|
-
] }) : null
|
|
4536
|
+
] })
|
|
4419
4537
|
] }) }, item.xappId)) }) : null
|
|
4420
4538
|
] });
|
|
4421
4539
|
}
|
|
@@ -5636,6 +5754,11 @@ function RequestDetailPage() {
|
|
|
5636
5754
|
const isTerminal = status === "COMPLETED" || status === "FAILED";
|
|
5637
5755
|
const effectiveXappId = readFirstString(requestRecord.xapp_id, xappIdFilter);
|
|
5638
5756
|
const effectiveXappTitle = resolveMarketplaceText(manifestRecord.title, locale) || readFirstString(requestRecord.xapp_name);
|
|
5757
|
+
const hideVersions = shouldHideMarketplaceVersions({
|
|
5758
|
+
installationPolicy: env?.installationPolicy ?? host.installationPolicy ?? null,
|
|
5759
|
+
installationPolicyResolved: env?.installationPolicyResolved,
|
|
5760
|
+
subjectId: host.subjectId
|
|
5761
|
+
});
|
|
5639
5762
|
const xappCrumbLabel = effectiveXappTitle || effectiveXappId;
|
|
5640
5763
|
const isEmbedded = typeof window !== "undefined" && window.location.pathname.startsWith("/embed");
|
|
5641
5764
|
const marketplaceTo = {
|
|
@@ -6106,7 +6229,7 @@ function RequestDetailPage() {
|
|
|
6106
6229
|
/* @__PURE__ */ jsx13("h2", { className: "mx-title mx-request-section-title", children: title }),
|
|
6107
6230
|
/* @__PURE__ */ jsxs9("div", { className: "mx-request-meta-row", children: [
|
|
6108
6231
|
/* @__PURE__ */ jsx13("span", { children: effectiveXappTitle || "\u2014" }),
|
|
6109
|
-
readString(requestRecord.xapp_version) && /* @__PURE__ */ jsxs9(Fragment7, { children: [
|
|
6232
|
+
!hideVersions && readString(requestRecord.xapp_version) && /* @__PURE__ */ jsxs9(Fragment7, { children: [
|
|
6110
6233
|
/* @__PURE__ */ jsx13("span", { children: "\xB7" }),
|
|
6111
6234
|
/* @__PURE__ */ jsxs9("span", { children: [
|
|
6112
6235
|
"v",
|
|
@@ -6519,6 +6642,11 @@ function RequestsPage() {
|
|
|
6519
6642
|
const [error, setError] = useState7(null);
|
|
6520
6643
|
const [busy, setBusy] = useState7(true);
|
|
6521
6644
|
const [xappTitle, setXappTitle] = useState7("");
|
|
6645
|
+
const hideVersions = shouldHideMarketplaceVersions({
|
|
6646
|
+
installationPolicy: env?.installationPolicy ?? host.installationPolicy ?? null,
|
|
6647
|
+
installationPolicyResolved: env?.installationPolicyResolved,
|
|
6648
|
+
subjectId: host.subjectId
|
|
6649
|
+
});
|
|
6522
6650
|
async function refresh(page = 1) {
|
|
6523
6651
|
setError(null);
|
|
6524
6652
|
setBusy(true);
|
|
@@ -6685,7 +6813,7 @@ function RequestsPage() {
|
|
|
6685
6813
|
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsxs10("tr", { children: [
|
|
6686
6814
|
/* @__PURE__ */ jsx14("th", { scope: "col", children: t("common.id", void 0, "ID") }),
|
|
6687
6815
|
/* @__PURE__ */ jsx14("th", { scope: "col", children: t("common.tool", void 0, "Tool") }),
|
|
6688
|
-
/* @__PURE__ */ jsx14("th", { scope: "col", children: t("common.version", void 0, "Version") }),
|
|
6816
|
+
!hideVersions && /* @__PURE__ */ jsx14("th", { scope: "col", children: t("common.version", void 0, "Version") }),
|
|
6689
6817
|
/* @__PURE__ */ jsx14("th", { scope: "col", children: t("common.status", void 0, "Status") }),
|
|
6690
6818
|
/* @__PURE__ */ jsx14("th", { scope: "col", children: t("common.created", void 0, "Created") })
|
|
6691
6819
|
] }) }),
|
|
@@ -6745,7 +6873,7 @@ function RequestsPage() {
|
|
|
6745
6873
|
) })
|
|
6746
6874
|
] })
|
|
6747
6875
|
] }),
|
|
6748
|
-
/* @__PURE__ */ jsx14(
|
|
6876
|
+
!hideVersions && /* @__PURE__ */ jsx14(
|
|
6749
6877
|
"td",
|
|
6750
6878
|
{
|
|
6751
6879
|
className: "mx-cell-muted",
|
|
@@ -7149,6 +7277,11 @@ function XappDetailPageContent(props) {
|
|
|
7149
7277
|
const installationPolicyResolved = env?.installationPolicyResolved !== false;
|
|
7150
7278
|
const mutationControlsReady = installationPolicyResolved || !hasSubject || !canMutate;
|
|
7151
7279
|
const installationPolicy = env?.installationPolicy ?? host.installationPolicy ?? null;
|
|
7280
|
+
const hideVersions = shouldHideMarketplaceVersions({
|
|
7281
|
+
installationPolicy,
|
|
7282
|
+
installationPolicyResolved,
|
|
7283
|
+
subjectId: host.subjectId
|
|
7284
|
+
});
|
|
7152
7285
|
const [data, setData] = useState8(null);
|
|
7153
7286
|
const [monetization, setMonetization] = useState8(null);
|
|
7154
7287
|
const [monetizationHistory, setMonetizationHistory] = useState8(
|
|
@@ -7560,6 +7693,25 @@ function XappDetailPageContent(props) {
|
|
|
7560
7693
|
() => selectedPaywall ? flattenXappMonetizationPaywallPackages(selectedPaywall) : [],
|
|
7561
7694
|
[selectedPaywall]
|
|
7562
7695
|
);
|
|
7696
|
+
const resolvePaywallPackageLabel = useMemo9(() => {
|
|
7697
|
+
const labels = /* @__PURE__ */ new Map();
|
|
7698
|
+
for (const item of selectedPaywallPackageRecords) {
|
|
7699
|
+
const productMetadata = item.productMetadata && typeof item.productMetadata === "object" ? item.productMetadata : {};
|
|
7700
|
+
const label = readString6(item.packageTitle) || readString6(item.productTitle) || readString6(item.productSlug);
|
|
7701
|
+
if (!label) continue;
|
|
7702
|
+
for (const candidate of [
|
|
7703
|
+
item.packageSlug,
|
|
7704
|
+
item.productSlug,
|
|
7705
|
+
productMetadata.access_tier,
|
|
7706
|
+
item.packageId,
|
|
7707
|
+
item.productId
|
|
7708
|
+
]) {
|
|
7709
|
+
const key = readString6(candidate).trim().toLowerCase();
|
|
7710
|
+
if (key && !labels.has(key)) labels.set(key, label);
|
|
7711
|
+
}
|
|
7712
|
+
}
|
|
7713
|
+
return (value) => labels.get(readString6(value).trim().toLowerCase()) || "";
|
|
7714
|
+
}, [selectedPaywallPackageRecords]);
|
|
7563
7715
|
useEffect10(() => {
|
|
7564
7716
|
if (focusedSection !== "plans" || !plansSectionRef.current) return;
|
|
7565
7717
|
if (typeof plansSectionRef.current.scrollIntoView === "function") {
|
|
@@ -7848,7 +8000,9 @@ function XappDetailPageContent(props) {
|
|
|
7848
8000
|
const status = readString6(item.status).trim().toLowerCase();
|
|
7849
8001
|
return status === "active" || status === "grace_period";
|
|
7850
8002
|
});
|
|
7851
|
-
const additiveUnlockLabels = activeAdditiveEntitlements.map(
|
|
8003
|
+
const additiveUnlockLabels = activeAdditiveEntitlements.map(
|
|
8004
|
+
(item) => resolvePaywallPackageLabel(item.tier) || resolvePaywallPackageLabel(item.product_slug) || readString6(item.tier) || readString6(item.product_slug)
|
|
8005
|
+
).filter(Boolean).reduce((labels, label) => {
|
|
7852
8006
|
if (!labels.includes(label)) labels.push(label);
|
|
7853
8007
|
return labels;
|
|
7854
8008
|
}, []);
|
|
@@ -7867,6 +8021,7 @@ function XappDetailPageContent(props) {
|
|
|
7867
8021
|
true
|
|
7868
8022
|
);
|
|
7869
8023
|
const currentTier = readString6(monetizationSubscription?.tier) || readString6(monetizationAccess?.tier);
|
|
8024
|
+
const currentTierLabel = resolvePaywallPackageLabel(currentTier) || currentTier;
|
|
7870
8025
|
const balanceState = readString6(monetizationAccess?.balance_state);
|
|
7871
8026
|
const subscriptionStatus = subscriptionLifecycle.statusLabel;
|
|
7872
8027
|
const subscriptionCoverage = subscriptionLifecycle.coverageLabel;
|
|
@@ -7878,7 +8033,8 @@ function XappDetailPageContent(props) {
|
|
|
7878
8033
|
const cancelledAt = formatDateTime2(subscriptionLifecycle.cancelledAt, locale);
|
|
7879
8034
|
const expiresAt = formatDateTime2(subscriptionLifecycle.expiresAt, locale);
|
|
7880
8035
|
const lifecyclePreviewAt = lifecyclePreviewEnabled ? formatDateTime2(routePreviewAt, locale) : "";
|
|
7881
|
-
const
|
|
8036
|
+
const usageCreditAvailableCount = usageCreditSummary ? Math.max(0, usageCreditSummary.available_count) : null;
|
|
8037
|
+
const creditsRemaining = usageCreditAvailableCount != null ? String(usageCreditAvailableCount) : readString6(monetizationAccess?.credits_remaining);
|
|
7882
8038
|
const accessVirtualCurrencyLabel = formatVirtualCurrencyLabel3(
|
|
7883
8039
|
monetizationAccess?.virtual_currency,
|
|
7884
8040
|
{
|
|
@@ -7886,27 +8042,18 @@ function XappDetailPageContent(props) {
|
|
|
7886
8042
|
}
|
|
7887
8043
|
);
|
|
7888
8044
|
const creditsRemainingLabel = formatVirtualCurrencyAmount2(
|
|
7889
|
-
|
|
8045
|
+
creditsRemaining,
|
|
7890
8046
|
monetizationAccess?.virtual_currency
|
|
7891
8047
|
);
|
|
7892
|
-
const
|
|
7893
|
-
|
|
7894
|
-
const summarized = summarizeVirtualCurrencyBalances({
|
|
7895
|
-
history: historySource
|
|
7896
|
-
}).balances;
|
|
7897
|
-
if (summarized.length > 0) {
|
|
7898
|
-
return summarized.map((item) => item.amountLabel).filter(Boolean);
|
|
7899
|
-
}
|
|
7900
|
-
if (creditsRemainingLabel) return [creditsRemainingLabel];
|
|
7901
|
-
return [];
|
|
7902
|
-
}, [creditsRemainingLabel, monetizationHistory]);
|
|
8048
|
+
const hasNamedAccessCurrency = Boolean(accessVirtualCurrencyLabel);
|
|
8049
|
+
const currentCreditBalanceLabel = hasNamedAccessCurrency ? t("xapp.credits_remaining_label", void 0, "Balance") : t("xapp.credit_balance_label", void 0, "Credits");
|
|
7903
8050
|
const accessState = resolveMarketplaceDefaultAccessState({
|
|
7904
8051
|
projection: monetizationAccessProjection,
|
|
7905
8052
|
hasCatalogMonetization,
|
|
7906
8053
|
availableLabel: t("xapp.access_state_available", void 0, "available")
|
|
7907
8054
|
});
|
|
7908
8055
|
const hasMonetizationState = Boolean(
|
|
7909
|
-
|
|
8056
|
+
currentTierLabel || accessState || subscriptionStatus || subscriptionCoverage || subscriptionReason || overdueSince || expiryBoundaryAt || renewsAt || currentPeriodEndsAt || cancelledAt || expiresAt || lifecyclePreviewAt || accessVirtualCurrencyLabel || creditsRemaining || additiveUnlockLabels.length > 0
|
|
7910
8057
|
);
|
|
7911
8058
|
const manifestScreenshots = Array.isArray(manifest?.screenshots) ? manifest.screenshots.map((shot) => readString6(shot)).filter(Boolean) : [];
|
|
7912
8059
|
const manifestTags = Array.isArray(manifest?.tags) ? manifest.tags.map((tag) => readString6(tag)).filter(Boolean) : [];
|
|
@@ -7920,9 +8067,9 @@ function XappDetailPageContent(props) {
|
|
|
7920
8067
|
}
|
|
7921
8068
|
const currentAccessCard = hasMonetizationState ? /* @__PURE__ */ jsxs11("div", { className: "mx-sidebar-card", children: [
|
|
7922
8069
|
/* @__PURE__ */ jsx15("h3", { className: "mx-section-title mx-detail-sidebar-title", children: t("xapp.current_access_title", void 0, "Current access") }),
|
|
7923
|
-
|
|
8070
|
+
currentTierLabel ? /* @__PURE__ */ jsxs11("div", { className: "mx-meta-item", children: [
|
|
7924
8071
|
/* @__PURE__ */ jsx15("span", { className: "mx-meta-label", children: t("xapp.current_plan_label", void 0, "Current plan") }),
|
|
7925
|
-
/* @__PURE__ */ jsx15("span", { className: "mx-meta-value", children:
|
|
8072
|
+
/* @__PURE__ */ jsx15("span", { className: "mx-meta-value", children: currentTierLabel })
|
|
7926
8073
|
] }) : null,
|
|
7927
8074
|
accessState ? /* @__PURE__ */ jsxs11("div", { className: "mx-meta-item", children: [
|
|
7928
8075
|
/* @__PURE__ */ jsx15("span", { className: "mx-meta-label", children: t("xapp.access_state_label", void 0, "Access state") }),
|
|
@@ -7972,12 +8119,8 @@ function XappDetailPageContent(props) {
|
|
|
7972
8119
|
/* @__PURE__ */ jsx15("span", { className: "mx-meta-label", children: t("xapp.virtual_currency_label", void 0, "Currency") }),
|
|
7973
8120
|
/* @__PURE__ */ jsx15("span", { className: "mx-meta-value", children: accessVirtualCurrencyLabel })
|
|
7974
8121
|
] }) : null,
|
|
7975
|
-
currentBalanceSummary.length > 0 ? /* @__PURE__ */ jsxs11("div", { className: "mx-meta-item mx-meta-item-top", children: [
|
|
7976
|
-
/* @__PURE__ */ jsx15("span", { className: "mx-meta-label", children: t("xapp.current_balances_label", void 0, "Balances now") }),
|
|
7977
|
-
/* @__PURE__ */ jsx15("div", { className: "mx-meta-value mx-meta-stack-sm", children: currentBalanceSummary.map((label, index) => /* @__PURE__ */ jsx15("div", { children: label }, `${label}:${index}`)) })
|
|
7978
|
-
] }) : null,
|
|
7979
8122
|
creditsRemaining ? /* @__PURE__ */ jsxs11("div", { className: "mx-meta-item", children: [
|
|
7980
|
-
/* @__PURE__ */ jsx15("span", { className: "mx-meta-label", children:
|
|
8123
|
+
/* @__PURE__ */ jsx15("span", { className: "mx-meta-label", children: currentCreditBalanceLabel }),
|
|
7981
8124
|
/* @__PURE__ */ jsx15("span", { className: "mx-meta-value", children: creditsRemainingLabel || creditsRemaining })
|
|
7982
8125
|
] }) : null,
|
|
7983
8126
|
additiveUnlockLabels.length > 0 ? /* @__PURE__ */ jsxs11("div", { className: "mx-meta-item mx-meta-item-top", children: [
|
|
@@ -8167,7 +8310,11 @@ function XappDetailPageContent(props) {
|
|
|
8167
8310
|
}
|
|
8168
8311
|
) : plansCard || /* @__PURE__ */ jsx15("div", { className: "mx-sidebar-card mx-detail-empty mx-plans-route-empty", children: /* @__PURE__ */ jsxs11("div", { className: "mx-empty-catalog", children: [
|
|
8169
8312
|
/* @__PURE__ */ jsx15("div", { className: "mx-empty-catalog-icon", children: "\u25CE" }),
|
|
8170
|
-
/* @__PURE__ */ jsx15("div", { className: "mx-empty-catalog-title", children: t(
|
|
8313
|
+
/* @__PURE__ */ jsx15("div", { className: "mx-empty-catalog-title", children: t(
|
|
8314
|
+
"xapp.no_plans_available",
|
|
8315
|
+
void 0,
|
|
8316
|
+
"No plans are currently available."
|
|
8317
|
+
) }),
|
|
8171
8318
|
/* @__PURE__ */ jsx15("div", { className: "mx-empty-catalog-desc", children: t(
|
|
8172
8319
|
"xapp.no_plans_available_desc",
|
|
8173
8320
|
void 0,
|
|
@@ -8257,7 +8404,7 @@ function XappDetailPageContent(props) {
|
|
|
8257
8404
|
description ? /* @__PURE__ */ jsx15("p", { className: "mx-detail-subtitle", children: description }) : null,
|
|
8258
8405
|
/* @__PURE__ */ jsxs11("div", { className: "mx-detail-meta-row", children: [
|
|
8259
8406
|
/* @__PURE__ */ jsx15("div", { className: "mx-card-slug", children: xappId }),
|
|
8260
|
-
readString6(versionRecord?.version) && /* @__PURE__ */ jsxs11("div", { className: "mx-card-version mx-detail-version-pill", children: [
|
|
8407
|
+
!hideVersions && readString6(versionRecord?.version) && /* @__PURE__ */ jsxs11("div", { className: "mx-card-version mx-detail-version-pill", children: [
|
|
8261
8408
|
"v",
|
|
8262
8409
|
readString6(versionRecord?.version)
|
|
8263
8410
|
] }),
|
|
@@ -10039,7 +10186,7 @@ function useQueryToken11() {
|
|
|
10039
10186
|
}
|
|
10040
10187
|
function PublisherDetailPage() {
|
|
10041
10188
|
const { publisherSlug = "" } = useParams4();
|
|
10042
|
-
const { client, host } = useMarketplace();
|
|
10189
|
+
const { client, host, env } = useMarketplace();
|
|
10043
10190
|
const { locale, t } = useMarketplaceI18n();
|
|
10044
10191
|
const loc = useLocation11();
|
|
10045
10192
|
const token = useQueryToken11();
|
|
@@ -10050,6 +10197,11 @@ function PublisherDetailPage() {
|
|
|
10050
10197
|
const [items, setItems] = useState11([]);
|
|
10051
10198
|
const [q, setQ] = useState11("");
|
|
10052
10199
|
const installationsByXappId = host.getInstallationsByXappId();
|
|
10200
|
+
const hideVersions = shouldHideMarketplaceVersions({
|
|
10201
|
+
installationPolicy: env?.installationPolicy ?? host.installationPolicy ?? null,
|
|
10202
|
+
installationPolicyResolved: env?.installationPolicyResolved,
|
|
10203
|
+
subjectId: host.subjectId
|
|
10204
|
+
});
|
|
10053
10205
|
async function refresh() {
|
|
10054
10206
|
if (!publisherSlug) return;
|
|
10055
10207
|
setBusy(true);
|
|
@@ -10202,7 +10354,7 @@ function PublisherDetailPage() {
|
|
|
10202
10354
|
/* @__PURE__ */ jsx18("span", { className: "mx-card-installed-badge-dot" }),
|
|
10203
10355
|
t("common.added", void 0, "Added")
|
|
10204
10356
|
] }),
|
|
10205
|
-
x.latest_version?.version && /* @__PURE__ */ jsxs14("div", { className: "mx-card-version", children: [
|
|
10357
|
+
!hideVersions && x.latest_version?.version && /* @__PURE__ */ jsxs14("div", { className: "mx-card-version", children: [
|
|
10206
10358
|
"v",
|
|
10207
10359
|
x.latest_version.version
|
|
10208
10360
|
] })
|
|
@@ -10246,6 +10398,223 @@ function MarketplaceApp() {
|
|
|
10246
10398
|
/* @__PURE__ */ jsx19(Route, { path: "*", element: /* @__PURE__ */ jsx19(CatalogPage, {}) })
|
|
10247
10399
|
] });
|
|
10248
10400
|
}
|
|
10401
|
+
|
|
10402
|
+
// src/httpMarketplaceClient.ts
|
|
10403
|
+
function readString7(value) {
|
|
10404
|
+
return typeof value === "string" ? value.trim() : "";
|
|
10405
|
+
}
|
|
10406
|
+
function encodeSegment(value) {
|
|
10407
|
+
return encodeURIComponent(String(value || "").trim());
|
|
10408
|
+
}
|
|
10409
|
+
function appendQuery(path, query) {
|
|
10410
|
+
const params = new URLSearchParams();
|
|
10411
|
+
for (const [key, rawValue] of Object.entries(query)) {
|
|
10412
|
+
if (rawValue === null || rawValue === void 0) continue;
|
|
10413
|
+
const value = typeof rawValue === "string" ? rawValue.trim() : typeof rawValue === "number" || typeof rawValue === "boolean" ? String(rawValue) : "";
|
|
10414
|
+
if (!value) continue;
|
|
10415
|
+
params.set(key, value);
|
|
10416
|
+
}
|
|
10417
|
+
const suffix = params.toString();
|
|
10418
|
+
if (!suffix) return path;
|
|
10419
|
+
return path.includes("?") ? `${path}&${suffix}` : `${path}?${suffix}`;
|
|
10420
|
+
}
|
|
10421
|
+
function resolveDefaultLocale(input) {
|
|
10422
|
+
if (typeof input === "function") {
|
|
10423
|
+
return readString7(input()) || null;
|
|
10424
|
+
}
|
|
10425
|
+
return readString7(input) || null;
|
|
10426
|
+
}
|
|
10427
|
+
function createHttpMarketplaceClient(options) {
|
|
10428
|
+
const { getJson, postJson, routes } = options;
|
|
10429
|
+
const supportsSubjectIdQuery = routes.supportsSubjectIdQuery === true;
|
|
10430
|
+
const addSubjectId = (subjectId) => supportsSubjectIdQuery ? { subjectId: readString7(subjectId) || void 0 } : {};
|
|
10431
|
+
return {
|
|
10432
|
+
async listCatalogXapps() {
|
|
10433
|
+
return getJson(routes.catalogListPath);
|
|
10434
|
+
},
|
|
10435
|
+
async getCatalogXapp(xappId, input) {
|
|
10436
|
+
return getJson(
|
|
10437
|
+
appendQuery(`${routes.catalogXappBasePath}/${encodeSegment(xappId)}`, {
|
|
10438
|
+
installationId: readString7(input?.installationId) || void 0
|
|
10439
|
+
})
|
|
10440
|
+
);
|
|
10441
|
+
},
|
|
10442
|
+
async getMyXappMonetization(xappId, input) {
|
|
10443
|
+
const locale = readString7(input?.locale) || resolveDefaultLocale(options.defaultLocale);
|
|
10444
|
+
return getJson(
|
|
10445
|
+
appendQuery(`${routes.myXappsBasePath}/${encodeSegment(xappId)}/monetization`, {
|
|
10446
|
+
...addSubjectId(input?.subjectId),
|
|
10447
|
+
installationId: readString7(input?.installationId) || void 0,
|
|
10448
|
+
locale: locale || void 0,
|
|
10449
|
+
previewAt: readString7(input?.previewAt) || void 0
|
|
10450
|
+
})
|
|
10451
|
+
);
|
|
10452
|
+
},
|
|
10453
|
+
async cancelMyXappSubscriptionContract(input) {
|
|
10454
|
+
return postJson(
|
|
10455
|
+
appendQuery(
|
|
10456
|
+
`${routes.myXappsBasePath}/${encodeSegment(input.xappId)}/monetization/subscription-contracts/${encodeSegment(input.contractId)}/cancel`,
|
|
10457
|
+
{
|
|
10458
|
+
...addSubjectId(input?.subjectId),
|
|
10459
|
+
installationId: readString7(input?.installationId) || void 0
|
|
10460
|
+
}
|
|
10461
|
+
),
|
|
10462
|
+
{}
|
|
10463
|
+
);
|
|
10464
|
+
},
|
|
10465
|
+
async refreshMyXappSubscriptionContractState(input) {
|
|
10466
|
+
return postJson(
|
|
10467
|
+
appendQuery(
|
|
10468
|
+
`${routes.myXappsBasePath}/${encodeSegment(input.xappId)}/monetization/subscription-contracts/${encodeSegment(input.contractId)}/refresh-state`,
|
|
10469
|
+
{
|
|
10470
|
+
...addSubjectId(input?.subjectId),
|
|
10471
|
+
installationId: readString7(input?.installationId) || void 0
|
|
10472
|
+
}
|
|
10473
|
+
),
|
|
10474
|
+
{}
|
|
10475
|
+
);
|
|
10476
|
+
},
|
|
10477
|
+
async getMyXappMonetizationHistory(xappId, input) {
|
|
10478
|
+
return getJson(
|
|
10479
|
+
appendQuery(`${routes.myXappsBasePath}/${encodeSegment(xappId)}/monetization/history`, {
|
|
10480
|
+
...addSubjectId(input?.subjectId),
|
|
10481
|
+
installationId: readString7(input?.installationId) || void 0,
|
|
10482
|
+
limit: typeof input?.limit === "number" && Number.isFinite(input.limit) && input.limit > 0 ? input.limit : void 0
|
|
10483
|
+
})
|
|
10484
|
+
);
|
|
10485
|
+
},
|
|
10486
|
+
async listMyMonetizedXapps(input) {
|
|
10487
|
+
return getJson(
|
|
10488
|
+
appendQuery(routes.myMonetizedXappsPath, {
|
|
10489
|
+
...addSubjectId(input?.subjectId),
|
|
10490
|
+
currentOnly: typeof input?.currentOnly === "boolean" ? String(input.currentOnly) : void 0
|
|
10491
|
+
})
|
|
10492
|
+
);
|
|
10493
|
+
},
|
|
10494
|
+
async prepareMyXappPurchaseIntent(input) {
|
|
10495
|
+
return postJson(
|
|
10496
|
+
`${routes.myXappsBasePath}/${encodeSegment(input.xappId)}/monetization/purchase-intents/prepare`,
|
|
10497
|
+
{
|
|
10498
|
+
offering_id: input.offeringId,
|
|
10499
|
+
package_id: input.packageId,
|
|
10500
|
+
price_id: input.priceId,
|
|
10501
|
+
...supportsSubjectIdQuery && readString7(input.subjectId) ? { subject_id: readString7(input.subjectId) } : {},
|
|
10502
|
+
...readString7(input.installationId) ? { installation_id: readString7(input.installationId) } : {}
|
|
10503
|
+
}
|
|
10504
|
+
);
|
|
10505
|
+
},
|
|
10506
|
+
async createMyXappPurchasePaymentSession(input) {
|
|
10507
|
+
return postJson(
|
|
10508
|
+
`${routes.myXappsBasePath}/${encodeSegment(input.xappId)}/monetization/purchase-intents/${encodeSegment(input.intentId)}/payment-session`,
|
|
10509
|
+
{
|
|
10510
|
+
return_url: input.returnUrl,
|
|
10511
|
+
...readString7(input.cancelUrl) ? { cancel_url: readString7(input.cancelUrl) } : {},
|
|
10512
|
+
...readString7(input.pageUrl) ? { page_url: readString7(input.pageUrl) } : {},
|
|
10513
|
+
...readString7(input.xappsResume) ? { xapps_resume: readString7(input.xappsResume) } : {},
|
|
10514
|
+
...readString7(input.locale) ? { locale: readString7(input.locale) } : {}
|
|
10515
|
+
}
|
|
10516
|
+
);
|
|
10517
|
+
},
|
|
10518
|
+
async finalizeMyXappPurchasePaymentSession(input) {
|
|
10519
|
+
return postJson(
|
|
10520
|
+
`${routes.myXappsBasePath}/${encodeSegment(input.xappId)}/monetization/purchase-intents/${encodeSegment(input.intentId)}/payment-session/finalize`,
|
|
10521
|
+
{}
|
|
10522
|
+
);
|
|
10523
|
+
},
|
|
10524
|
+
async listMyRequests(input) {
|
|
10525
|
+
return getJson(
|
|
10526
|
+
appendQuery(routes.myRequestsPath, {
|
|
10527
|
+
xappId: readString7(input?.xappId) || void 0,
|
|
10528
|
+
toolName: readString7(input?.toolName) || void 0,
|
|
10529
|
+
page: typeof input?.page === "number" && Number.isFinite(input.page) ? input.page : void 0,
|
|
10530
|
+
pageSize: typeof input?.pageSize === "number" && Number.isFinite(input.pageSize) ? input.pageSize : void 0
|
|
10531
|
+
})
|
|
10532
|
+
);
|
|
10533
|
+
},
|
|
10534
|
+
async getMyRequest(id) {
|
|
10535
|
+
return getJson(`${routes.myRequestsPath}/${encodeSegment(id)}`);
|
|
10536
|
+
},
|
|
10537
|
+
async reconcileMyRequestPayment(input) {
|
|
10538
|
+
return postJson(`${routes.myRequestsPath}/${encodeSegment(input.requestId)}/payment/reconcile`, {
|
|
10539
|
+
...readString7(input.paymentSessionId) ? { payment_session_id: readString7(input.paymentSessionId) } : {},
|
|
10540
|
+
...readString7(input.returnUrl) ? { return_url: readString7(input.returnUrl) } : {},
|
|
10541
|
+
...readString7(input.cancelUrl) ? { cancel_url: readString7(input.cancelUrl) } : {},
|
|
10542
|
+
...readString7(input.xappsResume) ? { xapps_resume: readString7(input.xappsResume) } : {}
|
|
10543
|
+
});
|
|
10544
|
+
},
|
|
10545
|
+
async listMyPaymentSessions(input) {
|
|
10546
|
+
return getJson(
|
|
10547
|
+
appendQuery(routes.myPaymentSessionsPath, {
|
|
10548
|
+
paymentSessionId: readString7(input?.paymentSessionId) || void 0,
|
|
10549
|
+
xappId: readString7(input?.xappId) || void 0,
|
|
10550
|
+
installationId: readString7(input?.installationId) || void 0,
|
|
10551
|
+
toolName: readString7(input?.toolName) || void 0,
|
|
10552
|
+
status: readString7(input?.status) || void 0,
|
|
10553
|
+
issuer: readString7(input?.issuer) || void 0,
|
|
10554
|
+
createdFrom: readString7(input?.createdFrom) || void 0,
|
|
10555
|
+
createdTo: readString7(input?.createdTo) || void 0,
|
|
10556
|
+
limit: typeof input?.limit === "number" && Number.isFinite(input.limit) ? input.limit : void 0
|
|
10557
|
+
})
|
|
10558
|
+
);
|
|
10559
|
+
},
|
|
10560
|
+
async getMyPaymentSession(id) {
|
|
10561
|
+
return getJson(`${routes.myPaymentSessionsPath}/${encodeSegment(id)}`);
|
|
10562
|
+
},
|
|
10563
|
+
async listMyInvoices(input) {
|
|
10564
|
+
return getJson(
|
|
10565
|
+
appendQuery(routes.myInvoicesPath, {
|
|
10566
|
+
requestId: readString7(input?.requestId) || void 0,
|
|
10567
|
+
paymentSessionId: readString7(input?.paymentSessionId) || void 0,
|
|
10568
|
+
xappId: readString7(input?.xappId) || void 0,
|
|
10569
|
+
installationId: readString7(input?.installationId) || void 0,
|
|
10570
|
+
status: readString7(input?.status) || void 0,
|
|
10571
|
+
ownerScope: readString7(input?.ownerScope) || void 0,
|
|
10572
|
+
search: readString7(input?.search) || void 0,
|
|
10573
|
+
createdFrom: readString7(input?.createdFrom) || void 0,
|
|
10574
|
+
createdTo: readString7(input?.createdTo) || void 0,
|
|
10575
|
+
page: typeof input?.page === "number" && Number.isFinite(input.page) ? input.page : void 0,
|
|
10576
|
+
pageSize: typeof input?.pageSize === "number" && Number.isFinite(input.pageSize) ? input.pageSize : void 0
|
|
10577
|
+
})
|
|
10578
|
+
);
|
|
10579
|
+
},
|
|
10580
|
+
async getMyInvoiceHistory(id) {
|
|
10581
|
+
return getJson(`${routes.myInvoicesPath}/${encodeSegment(id)}/history`);
|
|
10582
|
+
},
|
|
10583
|
+
async listMyNotifications(input) {
|
|
10584
|
+
return getJson(
|
|
10585
|
+
appendQuery(routes.myNotificationsPath, {
|
|
10586
|
+
notificationId: readString7(input?.notificationId) || void 0,
|
|
10587
|
+
status: readString7(input?.status) || void 0,
|
|
10588
|
+
trigger: readString7(input?.trigger) || void 0,
|
|
10589
|
+
xappId: readString7(input?.xappId) || void 0,
|
|
10590
|
+
installationId: readString7(input?.installationId) || void 0,
|
|
10591
|
+
unread: typeof input?.unread === "boolean" ? String(input.unread) : void 0,
|
|
10592
|
+
limit: typeof input?.limit === "number" && Number.isFinite(input.limit) ? input.limit : void 0
|
|
10593
|
+
})
|
|
10594
|
+
);
|
|
10595
|
+
},
|
|
10596
|
+
async markMyNotificationRead(notificationId) {
|
|
10597
|
+
return postJson(`${routes.myNotificationsPath}/${encodeSegment(notificationId)}/read`, {});
|
|
10598
|
+
},
|
|
10599
|
+
async markAllMyNotificationsRead() {
|
|
10600
|
+
return postJson(`${routes.myNotificationsPath}/read-all`, {});
|
|
10601
|
+
},
|
|
10602
|
+
async getWidgetToken(installationId, widgetId) {
|
|
10603
|
+
if (typeof options.getWidgetToken === "function") {
|
|
10604
|
+
return options.getWidgetToken(installationId, widgetId);
|
|
10605
|
+
}
|
|
10606
|
+
if (!routes.widgetTokenPath) {
|
|
10607
|
+
throw new Error("Widget token path is not configured");
|
|
10608
|
+
}
|
|
10609
|
+
return getJson(
|
|
10610
|
+
appendQuery(routes.widgetTokenPath, {
|
|
10611
|
+
installationId,
|
|
10612
|
+
widgetId
|
|
10613
|
+
})
|
|
10614
|
+
);
|
|
10615
|
+
}
|
|
10616
|
+
};
|
|
10617
|
+
}
|
|
10249
10618
|
export {
|
|
10250
10619
|
CatalogPage,
|
|
10251
10620
|
InvoicesPage,
|
|
@@ -10259,6 +10628,7 @@ export {
|
|
|
10259
10628
|
WidgetView,
|
|
10260
10629
|
XappDetailPage,
|
|
10261
10630
|
XappPlansPage,
|
|
10631
|
+
createHttpMarketplaceClient,
|
|
10262
10632
|
resolveMarketplaceText,
|
|
10263
10633
|
resolvePaymentLockStateFromGuardSummary,
|
|
10264
10634
|
useMarketplace,
|