@edx/frontend-app-subscription-manage 1.3.1 → 1.4.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/app.js +2 -2
- package/dist/app.js.map +1 -1
- package/dist/components/ActiveSubscription/ActiveSubscription.d.ts +7 -0
- package/dist/components/ActiveSubscription/ActiveSubscription.js +24 -0
- package/dist/components/ActiveSubscription/ActiveSubscription.js.map +1 -0
- package/dist/components/BecomeSubscriber/BecomeSubscriber.d.ts +7 -0
- package/dist/components/BecomeSubscriber/BecomeSubscriber.js +19 -0
- package/dist/components/BecomeSubscriber/BecomeSubscriber.js.map +1 -0
- package/dist/components/CancelConfirmation/CancelConfirmation.d.ts +12 -0
- package/dist/components/CancelConfirmation/CancelConfirmation.js +21 -0
- package/dist/components/CancelConfirmation/CancelConfirmation.js.map +1 -0
- package/dist/components/CancelSuccess/CancelSuccess.d.ts +7 -0
- package/dist/components/CancelSuccess/CancelSuccess.js +17 -0
- package/dist/components/CancelSuccess/CancelSuccess.js.map +1 -0
- package/dist/components/CanceledSubscription/CanceledSubscription.d.ts +13 -0
- package/dist/components/CanceledSubscription/CanceledSubscription.js +27 -0
- package/dist/components/CanceledSubscription/CanceledSubscription.js.map +1 -0
- package/dist/components/EnrolledCoursesList/EnrolledCoursesList.d.ts +8 -0
- package/dist/components/EnrolledCoursesList/EnrolledCoursesList.js +20 -0
- package/dist/components/EnrolledCoursesList/EnrolledCoursesList.js.map +1 -0
- package/dist/components/HelpFooter/HelpFooter.d.ts +3 -0
- package/dist/components/HelpFooter/HelpFooter.js +12 -0
- package/dist/components/HelpFooter/HelpFooter.js.map +1 -0
- package/dist/components/OrderHistoryHeader/OrderHistoryHeader.d.ts +3 -0
- package/dist/components/OrderHistoryHeader/OrderHistoryHeader.js +9 -0
- package/dist/components/OrderHistoryHeader/OrderHistoryHeader.js.map +1 -0
- package/dist/components/PaymentHistory/PaymentHistory.d.ts +10 -0
- package/dist/components/PaymentHistory/PaymentHistory.js +23 -0
- package/dist/components/PaymentHistory/PaymentHistory.js.map +1 -0
- package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.d.ts +17 -0
- package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.js +63 -0
- package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.js.map +1 -0
- package/dist/components/ResubscribeCard/ResubscribeCard.d.ts +9 -0
- package/dist/components/ResubscribeCard/ResubscribeCard.js +25 -0
- package/dist/components/ResubscribeCard/ResubscribeCard.js.map +1 -0
- package/dist/components/SubscriptionTabs/SubscriptionTabs.d.ts +8 -0
- package/dist/components/SubscriptionTabs/SubscriptionTabs.js +9 -0
- package/dist/components/SubscriptionTabs/SubscriptionTabs.js.map +1 -0
- package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.d.ts +9 -0
- package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.js +135 -0
- package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.js.map +1 -0
- package/dist/components/messages.d.ts +473 -0
- package/dist/components/messages.js +482 -0
- package/dist/components/messages.js.map +1 -0
- package/dist/constants.d.ts +14 -56
- package/dist/constants.js +23 -272
- package/dist/constants.js.map +1 -1
- package/dist/data/hooks/keys.d.ts +8 -13
- package/dist/data/hooks/keys.js +8 -13
- package/dist/data/hooks/keys.js.map +1 -1
- package/dist/data/hooks/useManageQueries.d.ts +37 -0
- package/dist/data/hooks/useManageQueries.js +206 -0
- package/dist/data/hooks/useManageQueries.js.map +1 -0
- package/dist/data/services/subs/urls.d.ts +2 -2
- package/dist/data/services/subs/urls.js.map +1 -1
- package/dist/data/services/subscription/cancelSubscription.d.ts +6 -0
- package/dist/data/services/subscription/cancelSubscription.js +31 -0
- package/dist/data/services/subscription/cancelSubscription.js.map +1 -0
- package/dist/data/services/subscription/getBillingPlans.d.ts +3 -0
- package/dist/{utils/fetchBillingPlans.js → data/services/subscription/getBillingPlans.js} +10 -21
- package/dist/data/services/subscription/getBillingPlans.js.map +1 -0
- package/dist/data/services/subscription/getIsCurrentUserSubscriber.d.ts +3 -0
- package/dist/data/services/subscription/getIsCurrentUserSubscriber.js +35 -0
- package/dist/data/services/subscription/getIsCurrentUserSubscriber.js.map +1 -0
- package/dist/data/services/subscription/getPaymentHistory.d.ts +6 -0
- package/dist/data/services/subscription/getPaymentHistory.js +65 -0
- package/dist/data/services/subscription/getPaymentHistory.js.map +1 -0
- package/dist/data/services/subscription/getSubscriptionEnrollments.d.ts +7 -0
- package/dist/data/services/subscription/getSubscriptionEnrollments.js +98 -0
- package/dist/data/services/subscription/getSubscriptionEnrollments.js.map +1 -0
- package/dist/data/services/subscription/getSubscriptionPaymentMethod.d.ts +8 -0
- package/dist/data/services/subscription/getSubscriptionPaymentMethod.js +42 -0
- package/dist/data/services/subscription/getSubscriptionPaymentMethod.js.map +1 -0
- package/dist/data/services/subscription/reactivateSubscription.d.ts +6 -0
- package/dist/data/services/subscription/reactivateSubscription.js +30 -0
- package/dist/data/services/subscription/reactivateSubscription.js.map +1 -0
- package/dist/data/services/subscription/updateSubscriptionPaymentMethod.d.ts +10 -0
- package/dist/data/services/subscription/updateSubscriptionPaymentMethod.js +31 -0
- package/dist/data/services/subscription/updateSubscriptionPaymentMethod.js.map +1 -0
- package/dist/icons/ExternalLinkIcon.d.ts +6 -0
- package/dist/icons/ExternalLinkIcon.js +18 -0
- package/dist/icons/ExternalLinkIcon.js.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/manageSubscriptionPage/CancelSubscriptionPage.d.ts +3 -0
- package/dist/manageSubscriptionPage/CancelSubscriptionPage.js +53 -0
- package/dist/manageSubscriptionPage/CancelSubscriptionPage.js.map +1 -0
- package/dist/manageSubscriptionPage/CancelSuccessPage.d.ts +3 -0
- package/dist/manageSubscriptionPage/CancelSuccessPage.js +24 -0
- package/dist/manageSubscriptionPage/CancelSuccessPage.js.map +1 -0
- package/dist/manageSubscriptionPage/ManageSubscriptionPage.d.ts +3 -0
- package/dist/manageSubscriptionPage/ManageSubscriptionPage.js +87 -0
- package/dist/manageSubscriptionPage/ManageSubscriptionPage.js.map +1 -0
- package/dist/messages.js +2 -2
- package/dist/messages.js.map +1 -1
- package/dist/routes.d.ts +9 -2
- package/dist/routes.js +26 -6
- package/dist/routes.js.map +1 -1
- package/dist/style.scss +1 -14
- package/dist/styles/components/manageSubscription.scss +454 -0
- package/dist/types.d.ts +57 -201
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/billingDetails.d.ts +3 -20
- package/dist/utils/billingDetails.js +4 -25
- package/dist/utils/billingDetails.js.map +1 -1
- package/dist/utils/edxSession.d.ts +18 -0
- package/dist/utils/edxSession.js +72 -0
- package/dist/utils/edxSession.js.map +1 -0
- package/dist/utils/formatDate.d.ts +16 -0
- package/dist/utils/formatDate.js +69 -0
- package/dist/utils/formatDate.js.map +1 -0
- package/dist/utils/graphqlClient.d.ts +9 -10
- package/dist/utils/graphqlClient.js +22 -11
- package/dist/utils/graphqlClient.js.map +1 -1
- package/dist/utils/invoiceAmount.d.ts +22 -0
- package/dist/utils/invoiceAmount.js +59 -0
- package/dist/utils/invoiceAmount.js.map +1 -0
- package/dist/utils/queries.d.ts +38 -33
- package/dist/utils/queries.js +83 -123
- package/dist/utils/queries.js.map +1 -1
- package/dist/utils/subscriptionView.d.ts +15 -0
- package/dist/utils/subscriptionView.js +50 -0
- package/dist/utils/subscriptionView.js.map +1 -0
- package/dist/utils/urls.d.ts +13 -0
- package/dist/utils/urls.js +52 -0
- package/dist/utils/urls.js.map +1 -0
- package/package.json +7 -2
- package/dist/checkoutPage/CheckoutPage.d.ts +0 -3
- package/dist/checkoutPage/CheckoutPage.js +0 -30
- package/dist/checkoutPage/CheckoutPage.js.map +0 -1
- package/dist/components/BrandMarks/BrandMarks.d.ts +0 -3
- package/dist/components/BrandMarks/BrandMarks.js +0 -9
- package/dist/components/BrandMarks/BrandMarks.js.map +0 -1
- package/dist/components/CartSummary/CartSummary.d.ts +0 -21
- package/dist/components/CartSummary/CartSummary.js +0 -30
- package/dist/components/CartSummary/CartSummary.js.map +0 -1
- package/dist/components/CartSummary/Messages.d.ts +0 -73
- package/dist/components/CartSummary/Messages.js +0 -76
- package/dist/components/CartSummary/Messages.js.map +0 -1
- package/dist/components/Checkout/Checkout.d.ts +0 -4
- package/dist/components/Checkout/Checkout.js +0 -40
- package/dist/components/Checkout/Checkout.js.map +0 -1
- package/dist/components/CheckoutGate/CheckoutGate.d.ts +0 -7
- package/dist/components/CheckoutGate/CheckoutGate.js +0 -35
- package/dist/components/CheckoutGate/CheckoutGate.js.map +0 -1
- package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.d.ts +0 -9
- package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js +0 -31
- package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js.map +0 -1
- package/dist/components/CourseEnrollmentCard/Messages.d.ts +0 -33
- package/dist/components/CourseEnrollmentCard/Messages.js +0 -35
- package/dist/components/CourseEnrollmentCard/Messages.js.map +0 -1
- package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.d.ts +0 -13
- package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.js +0 -11
- package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.js.map +0 -1
- package/dist/components/EnrollmentSummary/EnrollmentSummary.d.ts +0 -15
- package/dist/components/EnrollmentSummary/EnrollmentSummary.js +0 -21
- package/dist/components/EnrollmentSummary/EnrollmentSummary.js.map +0 -1
- package/dist/components/EnrollmentSummary/Messages.d.ts +0 -33
- package/dist/components/EnrollmentSummary/Messages.js +0 -35
- package/dist/components/EnrollmentSummary/Messages.js.map +0 -1
- package/dist/components/PaymentFields/PaymentFields.d.ts +0 -9
- package/dist/components/PaymentFields/PaymentFields.js +0 -7
- package/dist/components/PaymentFields/PaymentFields.js.map +0 -1
- package/dist/components/PaymentForm/Messages.d.ts +0 -88
- package/dist/components/PaymentForm/Messages.js +0 -95
- package/dist/components/PaymentForm/Messages.js.map +0 -1
- package/dist/components/PaymentForm/PaymentForm.d.ts +0 -21
- package/dist/components/PaymentForm/PaymentForm.js +0 -69
- package/dist/components/PaymentForm/PaymentForm.js.map +0 -1
- package/dist/components/StatusScreens/Messages.d.ts +0 -103
- package/dist/components/StatusScreens/Messages.js +0 -108
- package/dist/components/StatusScreens/Messages.js.map +0 -1
- package/dist/components/StatusScreens/StatusScreens.d.ts +0 -23
- package/dist/components/StatusScreens/StatusScreens.js +0 -25
- package/dist/components/StatusScreens/StatusScreens.js.map +0 -1
- package/dist/data/hooks/useCheckout.d.ts +0 -57
- package/dist/data/hooks/useCheckout.js +0 -249
- package/dist/data/hooks/useCheckout.js.map +0 -1
- package/dist/data/hooks/useCheckoutGate.d.ts +0 -15
- package/dist/data/hooks/useCheckoutGate.js +0 -39
- package/dist/data/hooks/useCheckoutGate.js.map +0 -1
- package/dist/data/hooks/useCheckoutMutations.d.ts +0 -16
- package/dist/data/hooks/useCheckoutMutations.js +0 -131
- package/dist/data/hooks/useCheckoutMutations.js.map +0 -1
- package/dist/data/hooks/useCheckoutQueries.d.ts +0 -30
- package/dist/data/hooks/useCheckoutQueries.js +0 -97
- package/dist/data/hooks/useCheckoutQueries.js.map +0 -1
- package/dist/styles/components/brandMarks.scss +0 -54
- package/dist/styles/components/cartSummary.scss +0 -18
- package/dist/styles/components/checkout.scss +0 -29
- package/dist/styles/components/checkoutStepper.scss +0 -9
- package/dist/styles/components/courseEnrollmentCard.scss +0 -38
- package/dist/styles/components/edxUnlimitedBanner.scss +0 -138
- package/dist/styles/components/enrollmentSummary.scss +0 -13
- package/dist/styles/components/paymentFields.scss +0 -15
- package/dist/styles/components/paymentForm.scss +0 -105
- package/dist/styles/components/statusScreens.scss +0 -29
- package/dist/styles/components/successScreen.scss +0 -0
- package/dist/utils/auth.d.ts +0 -7
- package/dist/utils/auth.js +0 -28
- package/dist/utils/auth.js.map +0 -1
- package/dist/utils/bootstrapApi.d.ts +0 -20
- package/dist/utils/bootstrapApi.js +0 -142
- package/dist/utils/bootstrapApi.js.map +0 -1
- package/dist/utils/cartApi.d.ts +0 -16
- package/dist/utils/cartApi.js +0 -118
- package/dist/utils/cartApi.js.map +0 -1
- package/dist/utils/checkout.d.ts +0 -6
- package/dist/utils/checkout.js +0 -28
- package/dist/utils/checkout.js.map +0 -1
- package/dist/utils/fetchActiveSubscriptions.d.ts +0 -4
- package/dist/utils/fetchActiveSubscriptions.js +0 -36
- package/dist/utils/fetchActiveSubscriptions.js.map +0 -1
- package/dist/utils/fetchBillingPlans.d.ts +0 -2
- package/dist/utils/fetchBillingPlans.js.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -17
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/provision.d.ts +0 -25
- package/dist/utils/provision.js +0 -95
- package/dist/utils/provision.js.map +0 -1
- package/dist/utils/stripe.d.ts +0 -7
- package/dist/utils/stripe.js +0 -43
- package/dist/utils/stripe.js.map +0 -1
package/dist/constants.js
CHANGED
|
@@ -1,276 +1,27 @@
|
|
|
1
1
|
export const appId = 'org.openedx.frontend.app.subscription.manage';
|
|
2
2
|
export const subscriptionManageRole = 'org.openedx.frontend.role.subscription.manage';
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
STRIPE_FAIL: 'STRIPE_FAIL',
|
|
14
|
-
SUBSCRIPTION_CREATED: 'SUBSCRIPTION_CREATED',
|
|
15
|
-
};
|
|
16
|
-
export const TERMINAL_STATES = [
|
|
17
|
-
STATUS.SUBSCRIPTION_CREATED,
|
|
18
|
-
STATUS.SANCTION_BLOCK,
|
|
19
|
-
STATUS.STRIPE_FAIL,
|
|
20
|
-
];
|
|
21
|
-
export const STATUS_LABELS = {
|
|
22
|
-
IN_CART: 'Cart created',
|
|
23
|
-
CONFIRM: 'Order confirmed',
|
|
24
|
-
SANCTION_STARTED: 'Checking sanctions…',
|
|
25
|
-
SANCTION_PASSED: 'Sanctions passed — setting up your account…',
|
|
26
|
-
SANCTION_BLOCK: 'Order blocked',
|
|
27
|
-
STRIPE_STARTED: 'Setting up your subscription…',
|
|
28
|
-
STRIPE_CONFIRMATION_REQUIRED: 'Card verification required',
|
|
29
|
-
STRIPE_SUBSCRIBED: 'Card verified — finalizing…',
|
|
30
|
-
STRIPE_FAIL: 'Payment failed',
|
|
31
|
-
SUBSCRIPTION_CREATED: 'Subscription created',
|
|
32
|
-
};
|
|
33
|
-
export const isTerminalStatus = (status) => TERMINAL_STATES.includes(status);
|
|
34
|
-
/** UI phase derived from the raw bpStatus code + cart readiness. */
|
|
35
|
-
export function phaseFor(status, ready) {
|
|
36
|
-
if (status === STATUS.SUBSCRIPTION_CREATED)
|
|
37
|
-
return 'success';
|
|
38
|
-
if (status === STATUS.SANCTION_BLOCK)
|
|
39
|
-
return 'blocked';
|
|
40
|
-
if (status === STATUS.STRIPE_FAIL)
|
|
41
|
-
return 'failed';
|
|
42
|
-
if (status && status !== STATUS.IN_CART)
|
|
43
|
-
return 'processing';
|
|
44
|
-
return ready ? 'ready' : 'init';
|
|
45
|
-
}
|
|
46
|
-
// --- Dev defaults (match the local test harness) -----------------------------
|
|
47
|
-
export const DEFAULTS = {
|
|
48
|
-
apiUrl: '/api/graphql',
|
|
49
|
-
confirmIntentUrl: '/api/stripe/confirm-pi',
|
|
50
|
-
customerUid: '019d2bde-f769-743d-88f9-8bf0d1a7a002',
|
|
51
|
-
salableUid: '019d2ce7-05bc-7dd6-b141-e32df9ac86c1',
|
|
52
|
-
billingPlanUid: '019d2ce7-05c0-7188-81b0-8eb747b41b0f',
|
|
53
|
-
};
|
|
54
|
-
export const LS_KEYS = { biId: 'twou.cartBiId', uid: 'twou.cartUid' };
|
|
55
|
-
// ─── Checkout gate feature flags (dev controls) ───────────────────────────────
|
|
56
|
-
// Set to false during development to bypass the country gate check.
|
|
57
|
-
// Should be true in production. Subscriber access is enforced outside this app.
|
|
58
|
-
/** When false, the country check is skipped — all countries can access checkout. */
|
|
59
|
-
export const GATE_CHECK_COUNTRY = true;
|
|
60
|
-
/**
|
|
61
|
-
* ISO 3166-1 alpha-2 country codes that are permitted to complete checkout.
|
|
62
|
-
* Add or remove codes here to open or restrict access by country.
|
|
63
|
-
* e.g. ['US', 'CA', 'GB'] to allow US, Canada, and UK.
|
|
64
|
-
*/
|
|
65
|
-
export const ALLOWED_CHECKOUT_COUNTRIES = ['US', 'CA'];
|
|
66
|
-
/**
|
|
67
|
-
* ISO 3166-1 alpha-2 country codes that require the extra billing-consent checkbox.
|
|
68
|
-
* Add or remove codes here to control which residents see the second checkbox.
|
|
69
|
-
*/
|
|
3
|
+
/** Sibling checkout MFE route role (externalRoutes). */
|
|
4
|
+
export const subscriptionCheckoutRole = 'org.openedx.frontend.role.subscription.checkout';
|
|
5
|
+
/** Sibling search MFE route role (externalRoutes). */
|
|
6
|
+
export const subscriptionSearchRole = 'org.openedx.frontend.role.subscription.search';
|
|
7
|
+
export const MANAGE_PAGE_PATH = 'manage-subscription';
|
|
8
|
+
/** Default help center URL when not overridden in app config. */
|
|
9
|
+
export const DEFAULT_LEARNER_HELP_CENTER_URL = 'https://support.edx.org/hc/en-us';
|
|
10
|
+
/** Default marketing page for "Learn about edX Subscription". */
|
|
11
|
+
export const DEFAULT_SUBSCRIPTION_LEARN_MORE_URL = 'https://www.edx.org/edx-subscription';
|
|
12
|
+
/** Countries that require the extra renew consent checkbox (ISO alpha-2). */
|
|
70
13
|
export const COUNTRIES_REQUIRING_EXTRA_CONFIRM = ['GB', 'CA'];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
['BH', 'Bahrain'],
|
|
85
|
-
['BD', 'Bangladesh'],
|
|
86
|
-
['BB', 'Barbados'],
|
|
87
|
-
['BY', 'Belarus'],
|
|
88
|
-
['BE', 'Belgium'],
|
|
89
|
-
['BZ', 'Belize'],
|
|
90
|
-
['BJ', 'Benin'],
|
|
91
|
-
['BT', 'Bhutan'],
|
|
92
|
-
['BO', 'Bolivia'],
|
|
93
|
-
['BA', 'Bosnia and Herzegovina'],
|
|
94
|
-
['BW', 'Botswana'],
|
|
95
|
-
['BR', 'Brazil'],
|
|
96
|
-
['BN', 'Brunei'],
|
|
97
|
-
['BG', 'Bulgaria'],
|
|
98
|
-
['BF', 'Burkina Faso'],
|
|
99
|
-
['BI', 'Burundi'],
|
|
100
|
-
['CV', 'Cabo Verde'],
|
|
101
|
-
['KH', 'Cambodia'],
|
|
102
|
-
['CM', 'Cameroon'],
|
|
103
|
-
['CA', 'Canada'],
|
|
104
|
-
['CF', 'Central African Republic'],
|
|
105
|
-
['TD', 'Chad'],
|
|
106
|
-
['CL', 'Chile'],
|
|
107
|
-
['CN', 'China'],
|
|
108
|
-
['CO', 'Colombia'],
|
|
109
|
-
['KM', 'Comoros'],
|
|
110
|
-
['CG', 'Congo (Congo-Brazzaville)'],
|
|
111
|
-
['CR', 'Costa Rica'],
|
|
112
|
-
['HR', 'Croatia'],
|
|
113
|
-
['CU', 'Cuba'],
|
|
114
|
-
['CY', 'Cyprus'],
|
|
115
|
-
['CZ', 'Czechia (Czech Republic)'],
|
|
116
|
-
['CD', 'Democratic Republic of the Congo'],
|
|
117
|
-
['DK', 'Denmark'],
|
|
118
|
-
['DJ', 'Djibouti'],
|
|
119
|
-
['DM', 'Dominica'],
|
|
120
|
-
['DO', 'Dominican Republic'],
|
|
121
|
-
['EC', 'Ecuador'],
|
|
122
|
-
['EG', 'Egypt'],
|
|
123
|
-
['SV', 'El Salvador'],
|
|
124
|
-
['GQ', 'Equatorial Guinea'],
|
|
125
|
-
['ER', 'Eritrea'],
|
|
126
|
-
['EE', 'Estonia'],
|
|
127
|
-
['SZ', 'Eswatini'],
|
|
128
|
-
['ET', 'Ethiopia'],
|
|
129
|
-
['FJ', 'Fiji'],
|
|
130
|
-
['FI', 'Finland'],
|
|
131
|
-
['FR', 'France'],
|
|
132
|
-
['GA', 'Gabon'],
|
|
133
|
-
['GM', 'Gambia'],
|
|
134
|
-
['GE', 'Georgia'],
|
|
135
|
-
['DE', 'Germany'],
|
|
136
|
-
['GH', 'Ghana'],
|
|
137
|
-
['GR', 'Greece'],
|
|
138
|
-
['GD', 'Grenada'],
|
|
139
|
-
['GT', 'Guatemala'],
|
|
140
|
-
['GN', 'Guinea'],
|
|
141
|
-
['GW', 'Guinea-Bissau'],
|
|
142
|
-
['GY', 'Guyana'],
|
|
143
|
-
['HT', 'Haiti'],
|
|
144
|
-
['VA', 'Holy See (Vatican City)'],
|
|
145
|
-
['HN', 'Honduras'],
|
|
146
|
-
['HU', 'Hungary'],
|
|
147
|
-
['IS', 'Iceland'],
|
|
148
|
-
['IN', 'India'],
|
|
149
|
-
['ID', 'Indonesia'],
|
|
150
|
-
['IR', 'Iran'],
|
|
151
|
-
['IQ', 'Iraq'],
|
|
152
|
-
['IE', 'Ireland'],
|
|
153
|
-
['IL', 'Israel'],
|
|
154
|
-
['IT', 'Italy'],
|
|
155
|
-
['CI', "Ivory Coast (Côte d'Ivoire)"],
|
|
156
|
-
['JM', 'Jamaica'],
|
|
157
|
-
['JP', 'Japan'],
|
|
158
|
-
['JO', 'Jordan'],
|
|
159
|
-
['KZ', 'Kazakhstan'],
|
|
160
|
-
['KE', 'Kenya'],
|
|
161
|
-
['KI', 'Kiribati'],
|
|
162
|
-
['KW', 'Kuwait'],
|
|
163
|
-
['KG', 'Kyrgyzstan'],
|
|
164
|
-
['LA', 'Laos'],
|
|
165
|
-
['LV', 'Latvia'],
|
|
166
|
-
['LB', 'Lebanon'],
|
|
167
|
-
['LS', 'Lesotho'],
|
|
168
|
-
['LR', 'Liberia'],
|
|
169
|
-
['LY', 'Libya'],
|
|
170
|
-
['LI', 'Liechtenstein'],
|
|
171
|
-
['LT', 'Lithuania'],
|
|
172
|
-
['LU', 'Luxembourg'],
|
|
173
|
-
['MG', 'Madagascar'],
|
|
174
|
-
['MW', 'Malawi'],
|
|
175
|
-
['MY', 'Malaysia'],
|
|
176
|
-
['MV', 'Maldives'],
|
|
177
|
-
['ML', 'Mali'],
|
|
178
|
-
['MT', 'Malta'],
|
|
179
|
-
['MH', 'Marshall Islands'],
|
|
180
|
-
['MR', 'Mauritania'],
|
|
181
|
-
['MU', 'Mauritius'],
|
|
182
|
-
['MX', 'Mexico'],
|
|
183
|
-
['FM', 'Micronesia'],
|
|
184
|
-
['MD', 'Moldova'],
|
|
185
|
-
['MC', 'Monaco'],
|
|
186
|
-
['MN', 'Mongolia'],
|
|
187
|
-
['ME', 'Montenegro'],
|
|
188
|
-
['MA', 'Morocco'],
|
|
189
|
-
['MZ', 'Mozambique'],
|
|
190
|
-
['MM', 'Myanmar (Burma)'],
|
|
191
|
-
['NA', 'Namibia'],
|
|
192
|
-
['NR', 'Nauru'],
|
|
193
|
-
['NP', 'Nepal'],
|
|
194
|
-
['NL', 'Netherlands'],
|
|
195
|
-
['NZ', 'New Zealand'],
|
|
196
|
-
['NI', 'Nicaragua'],
|
|
197
|
-
['NE', 'Niger'],
|
|
198
|
-
['NG', 'Nigeria'],
|
|
199
|
-
['KP', 'North Korea'],
|
|
200
|
-
['MK', 'North Macedonia'],
|
|
201
|
-
['NO', 'Norway'],
|
|
202
|
-
['OM', 'Oman'],
|
|
203
|
-
['PK', 'Pakistan'],
|
|
204
|
-
['PW', 'Palau'],
|
|
205
|
-
['PS', 'Palestine State'],
|
|
206
|
-
['PA', 'Panama'],
|
|
207
|
-
['PG', 'Papua New Guinea'],
|
|
208
|
-
['PY', 'Paraguay'],
|
|
209
|
-
['PE', 'Peru'],
|
|
210
|
-
['PH', 'Philippines'],
|
|
211
|
-
['PL', 'Poland'],
|
|
212
|
-
['PT', 'Portugal'],
|
|
213
|
-
['QA', 'Qatar'],
|
|
214
|
-
['RO', 'Romania'],
|
|
215
|
-
['RU', 'Russia'],
|
|
216
|
-
['RW', 'Rwanda'],
|
|
217
|
-
['KN', 'Saint Kitts and Nevis'],
|
|
218
|
-
['LC', 'Saint Lucia'],
|
|
219
|
-
['VC', 'Saint Vincent and the Grenadines'],
|
|
220
|
-
['WS', 'Samoa'],
|
|
221
|
-
['SM', 'San Marino'],
|
|
222
|
-
['ST', 'Sao Tome and Principe'],
|
|
223
|
-
['SA', 'Saudi Arabia'],
|
|
224
|
-
['SN', 'Senegal'],
|
|
225
|
-
['RS', 'Serbia'],
|
|
226
|
-
['SC', 'Seychelles'],
|
|
227
|
-
['SL', 'Sierra Leone'],
|
|
228
|
-
['SG', 'Singapore'],
|
|
229
|
-
['SK', 'Slovakia'],
|
|
230
|
-
['SI', 'Slovenia'],
|
|
231
|
-
['SB', 'Solomon Islands'],
|
|
232
|
-
['SO', 'Somalia'],
|
|
233
|
-
['ZA', 'South Africa'],
|
|
234
|
-
['KR', 'South Korea'],
|
|
235
|
-
['SS', 'South Sudan'],
|
|
236
|
-
['ES', 'Spain'],
|
|
237
|
-
['LK', 'Sri Lanka'],
|
|
238
|
-
['SD', 'Sudan'],
|
|
239
|
-
['SR', 'Suriname'],
|
|
240
|
-
['SE', 'Sweden'],
|
|
241
|
-
['CH', 'Switzerland'],
|
|
242
|
-
['SY', 'Syria'],
|
|
243
|
-
['TJ', 'Tajikistan'],
|
|
244
|
-
['TZ', 'Tanzania'],
|
|
245
|
-
['TH', 'Thailand'],
|
|
246
|
-
['TL', 'Timor-Leste'],
|
|
247
|
-
['TG', 'Togo'],
|
|
248
|
-
['TO', 'Tonga'],
|
|
249
|
-
['TT', 'Trinidad and Tobago'],
|
|
250
|
-
['TN', 'Tunisia'],
|
|
251
|
-
['TR', 'Turkey'],
|
|
252
|
-
['TM', 'Turkmenistan'],
|
|
253
|
-
['TV', 'Tuvalu'],
|
|
254
|
-
['UG', 'Uganda'],
|
|
255
|
-
['UA', 'Ukraine'],
|
|
256
|
-
['AE', 'United Arab Emirates'],
|
|
257
|
-
['GB', 'United Kingdom'],
|
|
258
|
-
['US', 'United States'],
|
|
259
|
-
['UY', 'Uruguay'],
|
|
260
|
-
['UZ', 'Uzbekistan'],
|
|
261
|
-
['VU', 'Vanuatu'],
|
|
262
|
-
['VE', 'Venezuela'],
|
|
263
|
-
['VN', 'Vietnam'],
|
|
264
|
-
['YE', 'Yemen'],
|
|
265
|
-
['ZM', 'Zambia'],
|
|
266
|
-
['ZW', 'Zimbabwe'],
|
|
267
|
-
];
|
|
268
|
-
// --- Stripe Element presentation ---------------------------------------------
|
|
269
|
-
// A div that hosts a Stripe Element but reads like a Paragon input.
|
|
270
|
-
export const STRIPE_FIELD_STYLE = {
|
|
271
|
-
height: 'auto', minHeight: '2.875rem', display: 'flex', alignItems: 'center',
|
|
272
|
-
};
|
|
273
|
-
export const STRIPE_ELEMENT_OPTS = {
|
|
274
|
-
style: { base: { fontSize: '16px', color: '#1a1a1a', '::placeholder': { color: '#8f8f8f' } } },
|
|
275
|
-
};
|
|
14
|
+
/** Active / trial statuses that map to the manage (active) view. */
|
|
15
|
+
export const ACTIVE_SUBSCRIPTION_STATUSES = new Set([
|
|
16
|
+
'ACTIVE',
|
|
17
|
+
'TRIAL_ACTIVE',
|
|
18
|
+
'TRIALING',
|
|
19
|
+
]);
|
|
20
|
+
/** Canceled statuses that may still have access until period end. */
|
|
21
|
+
export const CANCELED_SUBSCRIPTION_STATUSES = new Set([
|
|
22
|
+
'CANCELED',
|
|
23
|
+
'CANCELLED',
|
|
24
|
+
'CANCEL_AT_PERIOD_END',
|
|
25
|
+
'PENDING_CANCEL',
|
|
26
|
+
]);
|
|
276
27
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings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C,IAAI,EAAE,cAAc,CAAC;IACtB,CAAC,IAAI,EAAE,QAAQ,CAAC;IAChB,CAAC,IAAI,EAAE,QAAQ,CAAC;IAChB,CAAC,IAAI,EAAE,SAAS,CAAC;IACjB,CAAC,IAAI,EAAE,sBAAsB,CAAC;IAC9B,CAAC,IAAI,EAAE,gBAAgB,CAAC;IACxB,CAAC,IAAI,EAAE,eAAe,CAAC;IACvB,CAAC,IAAI,EAAE,SAAS,CAAC;IACjB,CAAC,IAAI,EAAE,YAAY,CAAC;IACpB,CAAC,IAAI,EAAE,SAAS,CAAC;IACjB,CAAC,IAAI,EAAE,WAAW,CAAC;IACnB,CAAC,IAAI,EAAE,SAAS,CAAC;IACjB,CAAC,IAAI,EAAE,OAAO,CAAC;IACf,CAAC,IAAI,EAAE,QAAQ,CAAC;IAChB,CAAC,IAAI,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,gFAAgF;AAChF,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ;CAC7E,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;CAC/F,CAAC","sourcesContent":["import type { CSSProperties } from 'react';\n\nexport const appId = 'org.openedx.frontend.app.subscription.manage';\nexport const subscriptionManageRole = 'org.openedx.frontend.role.subscription.manage';\n\n// --- Cart BI state machine ---------------------------------------------------\nexport const STATUS = {\n IN_CART: 'IN_CART',\n CONFIRM: 'CONFIRM',\n SANCTION_STARTED: 'SANCTION_STARTED',\n SANCTION_PASSED: 'SANCTION_PASSED',\n SANCTION_BLOCK: 'SANCTION_BLOCK',\n STRIPE_STARTED: 'STRIPE_STARTED',\n STRIPE_SUBSCRIBED: 'STRIPE_SUBSCRIBED',\n STRIPE_CONFIRMATION_REQUIRED: 'STRIPE_CONFIRMATION_REQUIRED',\n STRIPE_FAIL: 'STRIPE_FAIL',\n SUBSCRIPTION_CREATED: 'SUBSCRIPTION_CREATED',\n} as const;\n\nexport type Status = typeof STATUS[keyof typeof STATUS];\n\nexport type Phase = 'init' | 'ready' | 'processing' | 'threeds' | 'success' | 'blocked' | 'failed';\n\nexport const TERMINAL_STATES: Status[] = [\n STATUS.SUBSCRIPTION_CREATED,\n STATUS.SANCTION_BLOCK,\n STATUS.STRIPE_FAIL,\n];\n\nexport const STATUS_LABELS: Record<string, string> = {\n IN_CART: 'Cart created',\n CONFIRM: 'Order confirmed',\n SANCTION_STARTED: 'Checking sanctions…',\n SANCTION_PASSED: 'Sanctions passed — setting up your account…',\n SANCTION_BLOCK: 'Order blocked',\n STRIPE_STARTED: 'Setting up your subscription…',\n STRIPE_CONFIRMATION_REQUIRED: 'Card verification required',\n STRIPE_SUBSCRIBED: 'Card verified — finalizing…',\n STRIPE_FAIL: 'Payment failed',\n SUBSCRIPTION_CREATED: 'Subscription created',\n};\n\nexport const isTerminalStatus = (status: Status | null | undefined): boolean =>\n TERMINAL_STATES.includes(status as Status);\n\n/** UI phase derived from the raw bpStatus code + cart readiness. */\nexport function phaseFor(status: Status | null, ready: boolean): Phase {\n if (status === STATUS.SUBSCRIPTION_CREATED) return 'success';\n if (status === STATUS.SANCTION_BLOCK) return 'blocked';\n if (status === STATUS.STRIPE_FAIL) return 'failed';\n if (status && status !== STATUS.IN_CART) return 'processing';\n return ready ? 'ready' : 'init';\n}\n\n// --- Dev defaults (match the local test harness) -----------------------------\nexport const DEFAULTS = {\n apiUrl: '/api/graphql',\n confirmIntentUrl: '/api/stripe/confirm-pi',\n customerUid: '019d2bde-f769-743d-88f9-8bf0d1a7a002',\n salableUid: '019d2ce7-05bc-7dd6-b141-e32df9ac86c1',\n billingPlanUid: '019d2ce7-05c0-7188-81b0-8eb747b41b0f',\n};\n\nexport const LS_KEYS = { biId: 'twou.cartBiId', uid: 'twou.cartUid' };\n\n// ─── Checkout gate feature flags (dev controls) ───────────────────────────────\n// Set to false during development to bypass the country gate check.\n// Should be true in production. Subscriber access is enforced outside this app.\n\n/** When false, the country check is skipped — all countries can access checkout. */\nexport const GATE_CHECK_COUNTRY = true;\n\n/**\n * ISO 3166-1 alpha-2 country codes that are permitted to complete checkout.\n * Add or remove codes here to open or restrict access by country.\n * e.g. ['US', 'CA', 'GB'] to allow US, Canada, and UK.\n */\nexport const ALLOWED_CHECKOUT_COUNTRIES: readonly string[] = ['US', 'CA'];\n\n/**\n * ISO 3166-1 alpha-2 country codes that require the extra billing-consent checkbox.\n * Add or remove codes here to control which residents see the second checkbox.\n */\nexport const COUNTRIES_REQUIRING_EXTRA_CONFIRM: readonly string[] = ['GB', 'CA'];\n\nexport const COUNTRIES: readonly (readonly [string, string])[] = [\n ['AF', 'Afghanistan'],\n ['AL', 'Albania'],\n ['DZ', 'Algeria'],\n ['AD', 'Andorra'],\n ['AO', 'Angola'],\n ['AG', 'Antigua and Barbuda'],\n ['AR', 'Argentina'],\n ['AM', 'Armenia'],\n ['AU', 'Australia'],\n ['AT', 'Austria'],\n ['AZ', 'Azerbaijan'],\n ['BS', 'Bahamas'],\n ['BH', 'Bahrain'],\n ['BD', 'Bangladesh'],\n ['BB', 'Barbados'],\n ['BY', 'Belarus'],\n ['BE', 'Belgium'],\n ['BZ', 'Belize'],\n ['BJ', 'Benin'],\n ['BT', 'Bhutan'],\n ['BO', 'Bolivia'],\n ['BA', 'Bosnia and Herzegovina'],\n ['BW', 'Botswana'],\n ['BR', 'Brazil'],\n ['BN', 'Brunei'],\n ['BG', 'Bulgaria'],\n ['BF', 'Burkina Faso'],\n ['BI', 'Burundi'],\n ['CV', 'Cabo Verde'],\n ['KH', 'Cambodia'],\n ['CM', 'Cameroon'],\n ['CA', 'Canada'],\n ['CF', 'Central African Republic'],\n ['TD', 'Chad'],\n ['CL', 'Chile'],\n ['CN', 'China'],\n ['CO', 'Colombia'],\n ['KM', 'Comoros'],\n ['CG', 'Congo (Congo-Brazzaville)'],\n ['CR', 'Costa Rica'],\n ['HR', 'Croatia'],\n ['CU', 'Cuba'],\n ['CY', 'Cyprus'],\n ['CZ', 'Czechia (Czech Republic)'],\n ['CD', 'Democratic Republic of the Congo'],\n ['DK', 'Denmark'],\n ['DJ', 'Djibouti'],\n ['DM', 'Dominica'],\n ['DO', 'Dominican Republic'],\n ['EC', 'Ecuador'],\n ['EG', 'Egypt'],\n ['SV', 'El Salvador'],\n ['GQ', 'Equatorial Guinea'],\n ['ER', 'Eritrea'],\n ['EE', 'Estonia'],\n ['SZ', 'Eswatini'],\n ['ET', 'Ethiopia'],\n ['FJ', 'Fiji'],\n ['FI', 'Finland'],\n ['FR', 'France'],\n ['GA', 'Gabon'],\n ['GM', 'Gambia'],\n ['GE', 'Georgia'],\n ['DE', 'Germany'],\n ['GH', 'Ghana'],\n ['GR', 'Greece'],\n ['GD', 'Grenada'],\n ['GT', 'Guatemala'],\n ['GN', 'Guinea'],\n ['GW', 'Guinea-Bissau'],\n ['GY', 'Guyana'],\n ['HT', 'Haiti'],\n ['VA', 'Holy See (Vatican City)'],\n ['HN', 'Honduras'],\n ['HU', 'Hungary'],\n ['IS', 'Iceland'],\n ['IN', 'India'],\n ['ID', 'Indonesia'],\n ['IR', 'Iran'],\n ['IQ', 'Iraq'],\n ['IE', 'Ireland'],\n ['IL', 'Israel'],\n ['IT', 'Italy'],\n ['CI', \"Ivory Coast (Côte d'Ivoire)\"],\n ['JM', 'Jamaica'],\n ['JP', 'Japan'],\n ['JO', 'Jordan'],\n ['KZ', 'Kazakhstan'],\n ['KE', 'Kenya'],\n ['KI', 'Kiribati'],\n ['KW', 'Kuwait'],\n ['KG', 'Kyrgyzstan'],\n ['LA', 'Laos'],\n ['LV', 'Latvia'],\n ['LB', 'Lebanon'],\n ['LS', 'Lesotho'],\n ['LR', 'Liberia'],\n ['LY', 'Libya'],\n ['LI', 'Liechtenstein'],\n ['LT', 'Lithuania'],\n ['LU', 'Luxembourg'],\n ['MG', 'Madagascar'],\n ['MW', 'Malawi'],\n ['MY', 'Malaysia'],\n ['MV', 'Maldives'],\n ['ML', 'Mali'],\n ['MT', 'Malta'],\n ['MH', 'Marshall Islands'],\n ['MR', 'Mauritania'],\n ['MU', 'Mauritius'],\n ['MX', 'Mexico'],\n ['FM', 'Micronesia'],\n ['MD', 'Moldova'],\n ['MC', 'Monaco'],\n ['MN', 'Mongolia'],\n ['ME', 'Montenegro'],\n ['MA', 'Morocco'],\n ['MZ', 'Mozambique'],\n ['MM', 'Myanmar (Burma)'],\n ['NA', 'Namibia'],\n ['NR', 'Nauru'],\n ['NP', 'Nepal'],\n ['NL', 'Netherlands'],\n ['NZ', 'New Zealand'],\n ['NI', 'Nicaragua'],\n ['NE', 'Niger'],\n ['NG', 'Nigeria'],\n ['KP', 'North Korea'],\n ['MK', 'North Macedonia'],\n ['NO', 'Norway'],\n ['OM', 'Oman'],\n ['PK', 'Pakistan'],\n ['PW', 'Palau'],\n ['PS', 'Palestine State'],\n ['PA', 'Panama'],\n ['PG', 'Papua New Guinea'],\n ['PY', 'Paraguay'],\n ['PE', 'Peru'],\n ['PH', 'Philippines'],\n ['PL', 'Poland'],\n ['PT', 'Portugal'],\n ['QA', 'Qatar'],\n ['RO', 'Romania'],\n ['RU', 'Russia'],\n ['RW', 'Rwanda'],\n ['KN', 'Saint Kitts and Nevis'],\n ['LC', 'Saint Lucia'],\n ['VC', 'Saint Vincent and the Grenadines'],\n ['WS', 'Samoa'],\n ['SM', 'San Marino'],\n ['ST', 'Sao Tome and Principe'],\n ['SA', 'Saudi Arabia'],\n ['SN', 'Senegal'],\n ['RS', 'Serbia'],\n ['SC', 'Seychelles'],\n ['SL', 'Sierra Leone'],\n ['SG', 'Singapore'],\n ['SK', 'Slovakia'],\n ['SI', 'Slovenia'],\n ['SB', 'Solomon Islands'],\n ['SO', 'Somalia'],\n ['ZA', 'South Africa'],\n ['KR', 'South Korea'],\n ['SS', 'South Sudan'],\n ['ES', 'Spain'],\n ['LK', 'Sri Lanka'],\n ['SD', 'Sudan'],\n ['SR', 'Suriname'],\n ['SE', 'Sweden'],\n ['CH', 'Switzerland'],\n ['SY', 'Syria'],\n ['TJ', 'Tajikistan'],\n ['TZ', 'Tanzania'],\n ['TH', 'Thailand'],\n ['TL', 'Timor-Leste'],\n ['TG', 'Togo'],\n ['TO', 'Tonga'],\n ['TT', 'Trinidad and Tobago'],\n ['TN', 'Tunisia'],\n ['TR', 'Turkey'],\n ['TM', 'Turkmenistan'],\n ['TV', 'Tuvalu'],\n ['UG', 'Uganda'],\n ['UA', 'Ukraine'],\n ['AE', 'United Arab Emirates'],\n ['GB', 'United Kingdom'],\n ['US', 'United States'],\n ['UY', 'Uruguay'],\n ['UZ', 'Uzbekistan'],\n ['VU', 'Vanuatu'],\n ['VE', 'Venezuela'],\n ['VN', 'Vietnam'],\n ['YE', 'Yemen'],\n ['ZM', 'Zambia'],\n ['ZW', 'Zimbabwe'],\n];\n\n// --- Stripe Element presentation ---------------------------------------------\n// A div that hosts a Stripe Element but reads like a Paragon input.\nexport const STRIPE_FIELD_STYLE: CSSProperties = {\n height: 'auto', minHeight: '2.875rem', display: 'flex', alignItems: 'center',\n};\nexport const STRIPE_ELEMENT_OPTS = {\n style: { base: { fontSize: '16px', color: '#1a1a1a', '::placeholder': { color: '#8f8f8f' } } },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,8CAA8C,CAAC;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAEtF,wDAAwD;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,iDAAiD,CAAC;AAE1F,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD,iEAAiE;AACjE,MAAM,CAAC,MAAM,+BAA+B,GAAG,kCAAkC,CAAC;AAElF,iEAAiE;AACjE,MAAM,CAAC,MAAM,mCAAmC,GAAG,sCAAsC,CAAC;AAE1F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iCAAiC,GAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAEjF,oEAAoE;AACpE,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC;IAClD,QAAQ;IACR,cAAc;IACd,UAAU;CACX,CAAC,CAAC;AAEH,qEAAqE;AACrE,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,CAAC;IACpD,UAAU;IACV,WAAW;IACX,sBAAsB;IACtB,gBAAgB;CACjB,CAAC,CAAC","sourcesContent":["export const appId = 'org.openedx.frontend.app.subscription.manage';\nexport const subscriptionManageRole = 'org.openedx.frontend.role.subscription.manage';\n\n/** Sibling checkout MFE route role (externalRoutes). */\nexport const subscriptionCheckoutRole = 'org.openedx.frontend.role.subscription.checkout';\n\n/** Sibling search MFE route role (externalRoutes). */\nexport const subscriptionSearchRole = 'org.openedx.frontend.role.subscription.search';\n\nexport const MANAGE_PAGE_PATH = 'manage-subscription';\n\n/** Default help center URL when not overridden in app config. */\nexport const DEFAULT_LEARNER_HELP_CENTER_URL = 'https://support.edx.org/hc/en-us';\n\n/** Default marketing page for \"Learn about edX Subscription\". */\nexport const DEFAULT_SUBSCRIPTION_LEARN_MORE_URL = 'https://www.edx.org/edx-subscription';\n\n/** Countries that require the extra renew consent checkbox (ISO alpha-2). */\nexport const COUNTRIES_REQUIRING_EXTRA_CONFIRM: readonly string[] = ['GB', 'CA'];\n\n/** Active / trial statuses that map to the manage (active) view. */\nexport const ACTIVE_SUBSCRIPTION_STATUSES = new Set([\n 'ACTIVE',\n 'TRIAL_ACTIVE',\n 'TRIALING',\n]);\n\n/** Canceled statuses that may still have access until period end. */\nexport const CANCELED_SUBSCRIPTION_STATUSES = new Set([\n 'CANCELED',\n 'CANCELLED',\n 'CANCEL_AT_PERIOD_END',\n 'PENDING_CANCEL',\n]);\n"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
customer: (userEmail: string) => readonly ["checkout", "customer", string];
|
|
10
|
-
salable: (maId: string) => readonly ["checkout", "salable", string];
|
|
11
|
-
billingPlans: () => readonly ["checkout", "billingPlans"];
|
|
12
|
-
viaxSession: () => readonly ["checkout", "viaxSession"];
|
|
13
|
-
courseDetail: (courseKey: string) => readonly ["checkout", "courseDetail", string];
|
|
1
|
+
export declare const manageKeys: {
|
|
2
|
+
all: readonly ["manage"];
|
|
3
|
+
viaxSession: () => readonly ["manage", "viaxSession"];
|
|
4
|
+
isSubscriber: () => readonly ["manage", "isCurrentUserSubscriber"];
|
|
5
|
+
billingPlans: () => readonly ["manage", "billingPlans"];
|
|
6
|
+
enrollments: (subscriptionBiId: string) => readonly ["manage", "enrollments", string];
|
|
7
|
+
paymentHistory: (subscriptionBiId: string) => readonly ["manage", "paymentHistory", string];
|
|
8
|
+
paymentMethod: (subscriptionBiId: string) => readonly ["manage", "paymentMethod", string];
|
|
14
9
|
};
|
package/dist/data/hooks/keys.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
customer: (userEmail) => ['checkout', 'customer', userEmail],
|
|
10
|
-
salable: (maId) => ['checkout', 'salable', maId],
|
|
11
|
-
billingPlans: () => ['checkout', 'billingPlans'],
|
|
12
|
-
viaxSession: () => ['checkout', 'viaxSession'],
|
|
13
|
-
courseDetail: (courseKey) => ['checkout', 'courseDetail', courseKey],
|
|
1
|
+
export const manageKeys = {
|
|
2
|
+
all: ['manage'],
|
|
3
|
+
viaxSession: () => [...manageKeys.all, 'viaxSession'],
|
|
4
|
+
isSubscriber: () => [...manageKeys.all, 'isCurrentUserSubscriber'],
|
|
5
|
+
billingPlans: () => [...manageKeys.all, 'billingPlans'],
|
|
6
|
+
enrollments: (subscriptionBiId) => [...manageKeys.all, 'enrollments', subscriptionBiId],
|
|
7
|
+
paymentHistory: (subscriptionBiId) => [...manageKeys.all, 'paymentHistory', subscriptionBiId],
|
|
8
|
+
paymentMethod: (subscriptionBiId) => [...manageKeys.all, 'paymentMethod', subscriptionBiId],
|
|
14
9
|
};
|
|
15
10
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/data/hooks/keys.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/data/hooks/keys.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,CAAC,QAAQ,CAAU;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,aAAa,CAAU;IAC9D,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAU;IAC3E,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,cAAc,CAAU;IAChE,WAAW,EAAE,CAAC,gBAAwB,EAAE,EAAE,CACxC,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,gBAAgB,CACpD;IACD,cAAc,EAAE,CAAC,gBAAwB,EAAE,EAAE,CAC3C,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,gBAAgB,EAAE,gBAAgB,CACvD;IACD,aAAa,EAAE,CAAC,gBAAwB,EAAE,EAAE,CAC1C,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,eAAe,EAAE,gBAAgB,CACtD;CACF,CAAC","sourcesContent":["export const manageKeys = {\n all: ['manage'] as const,\n viaxSession: () => [...manageKeys.all, 'viaxSession'] as const,\n isSubscriber: () => [...manageKeys.all, 'isCurrentUserSubscriber'] as const,\n billingPlans: () => [...manageKeys.all, 'billingPlans'] as const,\n enrollments: (subscriptionBiId: string) => (\n [...manageKeys.all, 'enrollments', subscriptionBiId] as const\n ),\n paymentHistory: (subscriptionBiId: string) => (\n [...manageKeys.all, 'paymentHistory', subscriptionBiId] as const\n ),\n paymentMethod: (subscriptionBiId: string) => (\n [...manageKeys.all, 'paymentMethod', subscriptionBiId] as const\n ),\n};\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks for Viax session, subscriber status, enrollments, and cancel mutation.
|
|
3
|
+
*/
|
|
4
|
+
import { type UseMutationResult, type UseQueryResult } from '@tanstack/react-query';
|
|
5
|
+
import type { CurrentUserSubscriberResult, PaymentHistoryItem, SubscriptionEnrollment, BillingPlansResult } from '../../types';
|
|
6
|
+
import { type ViaxGqlClient } from '../../utils/graphqlClient';
|
|
7
|
+
import { fetchEdxSession } from '../../utils/edxSession';
|
|
8
|
+
import { type SubscriptionPaymentMethod } from '../services/subscription/getSubscriptionPaymentMethod';
|
|
9
|
+
import { type UpdatePaymentMethodArgs } from '../services/subscription/updateSubscriptionPaymentMethod';
|
|
10
|
+
export declare function useViaxClient(): ViaxGqlClient | null;
|
|
11
|
+
/** Exchange edX session cookies for a Viax token. */
|
|
12
|
+
export declare function useViaxSessionQuery(): UseQueryResult<Awaited<ReturnType<typeof fetchEdxSession>>>;
|
|
13
|
+
/**
|
|
14
|
+
* Applies the Viax token from the session query onto the GraphQL client.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useViaxSession(client: ViaxGqlClient | null): {
|
|
17
|
+
sessionReady: boolean;
|
|
18
|
+
isSessionLoading: boolean;
|
|
19
|
+
isSessionError: boolean;
|
|
20
|
+
sessionError: Error | null;
|
|
21
|
+
};
|
|
22
|
+
/** Current user's subscription context. */
|
|
23
|
+
export declare function useIsSubscriberQuery(client: ViaxGqlClient | null, sessionReady: boolean): UseQueryResult<CurrentUserSubscriberResult | null>;
|
|
24
|
+
/** Available monthly / annual billing plans for price display. */
|
|
25
|
+
export declare function useBillingPlansQuery(client: ViaxGqlClient | null, sessionReady: boolean): UseQueryResult<BillingPlansResult>;
|
|
26
|
+
/** Enrollments for cancel confirmation. */
|
|
27
|
+
export declare function useSubscriptionEnrollmentsQuery(client: ViaxGqlClient | null, sessionReady: boolean, subscriptionBiIds: string | string[] | null | undefined): UseQueryResult<SubscriptionEnrollment[]>;
|
|
28
|
+
/** Invoices for the Payment history tab. */
|
|
29
|
+
export declare function usePaymentHistoryQuery(client: ViaxGqlClient | null, sessionReady: boolean, subscriptionBiId: string | null | undefined): UseQueryResult<PaymentHistoryItem[]>;
|
|
30
|
+
/** Stripe payment method on file for renew / manage display. */
|
|
31
|
+
export declare function useSubscriptionPaymentMethodQuery(client: ViaxGqlClient | null, sessionReady: boolean, subscriptionBiId: string | null | undefined, enabled?: boolean): UseQueryResult<SubscriptionPaymentMethod | null>;
|
|
32
|
+
/** Cancel subscription mutation; invalidates subscriber query on success. */
|
|
33
|
+
export declare function useCancelSubscriptionMutation(client: ViaxGqlClient | null): UseMutationResult<Record<string, unknown> | null, Error, string>;
|
|
34
|
+
/** Undo pending cancellation before period end; refreshes subscriber view on success. */
|
|
35
|
+
export declare function useReactivateSubscriptionMutation(client: ViaxGqlClient | null): UseMutationResult<Record<string, unknown> | null, Error, string>;
|
|
36
|
+
/** Update default Stripe payment method on the subscription. */
|
|
37
|
+
export declare function useUpdatePaymentMethodMutation(client: ViaxGqlClient | null): UseMutationResult<Record<string, unknown> | null, Error, UpdatePaymentMethodArgs>;
|