@frontegg/redux-store 4.19.0 → 4.21.2
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/auth/index.js +5 -3
- package/auth/index.js.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/subscriptions/Billing/Information/saga.d.ts +1 -0
- package/subscriptions/Billing/Invoices/saga.d.ts +1 -0
- package/subscriptions/Billing/PaymentMethod/saga.d.ts +1 -0
- package/subscriptions/Billing/saga.d.ts +1 -0
- package/subscriptions/Checkout/saga.d.ts +4 -0
- package/subscriptions/Config/saga.d.ts +1 -0
- package/subscriptions/Plans/saga.d.ts +1 -0
- package/subscriptions/dummy.d.ts +5 -0
- package/subscriptions/index.d.ts +3 -2
- package/subscriptions/index.js +326 -6
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/saga.d.ts +1 -0
- package/toolkit/index.js +1 -1
- package/toolkit/index.js.map +1 -1
package/index.js
CHANGED
|
@@ -186,6 +186,7 @@ exports.subscriptionActions = subscriptions_index.subscriptionActions;
|
|
|
186
186
|
exports.subscriptionInitialState = subscriptions_index.subscriptionInitialState;
|
|
187
187
|
exports.subscriptionReducers = subscriptions_index.subscriptionReducers;
|
|
188
188
|
exports.subscriptionSagas = subscriptions_index.subscriptionSagas;
|
|
189
|
+
exports.subscriptionSagasMock = subscriptions_index.subscriptionSagasMock;
|
|
189
190
|
exports.subscriptions = subscriptions_index['default'];
|
|
190
191
|
exports.vendor = vendor_index['default'];
|
|
191
192
|
exports.actions = saga.actions;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
3
|
"libName": "FronteggReduxStore",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.21.2",
|
|
5
5
|
"author": "Frontegg LTD",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "export NODE_ENV='production' && rm -rf dist && mkdir dist && rollup -c ./rollup.config.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@frontegg/rest-api": "^2.10.
|
|
13
|
+
"@frontegg/rest-api": "^2.10.30",
|
|
14
14
|
"@reduxjs/toolkit": "^1.5.0",
|
|
15
15
|
"redux-saga": "^1.1.0",
|
|
16
16
|
"tslib": "^2.1.0",
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export declare function billingSagas(): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<void>>, void, unknown>;
|
|
2
|
+
export declare function billingSagasMock(): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<void>>, void, unknown>;
|
|
@@ -1 +1,5 @@
|
|
|
1
1
|
export declare function checkoutSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
2
|
+
/*********************************
|
|
3
|
+
* Preview Sagas
|
|
4
|
+
*********************************/
|
|
5
|
+
export declare function checkoutSagasMock(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IPlanResponse, ISubscriptionResponse, ISubscriptionInvoiceResponse, ISubscriptionPaymentMethodCardResponse } from '@frontegg/rest-api';
|
|
2
|
+
export declare const subscriptionResponseMock: ISubscriptionResponse;
|
|
3
|
+
export declare const planResponseMock: IPlanResponse[];
|
|
4
|
+
export declare const invoicesMock: ISubscriptionInvoiceResponse[];
|
|
5
|
+
export declare const paymentMethodsMock: ISubscriptionPaymentMethodCardResponse[];
|
package/subscriptions/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { subscriptionsStoreName as storeName } from '../constants';
|
|
2
2
|
import { actions, initialState, reducer } from './reducer';
|
|
3
|
-
import { sagas } from './saga';
|
|
3
|
+
import { sagas, mockSagas } from './saga';
|
|
4
4
|
export * from './interfaces';
|
|
5
|
-
export { sagas as subscriptionSagas, reducer as subscriptionReducers, actions as subscriptionActions, initialState as subscriptionInitialState, storeName as subscriptionsStoreName, };
|
|
5
|
+
export { sagas as subscriptionSagas, mockSagas as subscriptionSagasMock, reducer as subscriptionReducers, actions as subscriptionActions, initialState as subscriptionInitialState, storeName as subscriptionsStoreName, };
|
|
6
6
|
declare const _default: {
|
|
7
7
|
sagas: typeof sagas;
|
|
8
|
+
mockSagas: typeof mockSagas;
|
|
8
9
|
reducer: import("redux").Reducer<import("redux").CombinedState<{
|
|
9
10
|
config: import("./interfaces").PaymentProviderConfigState;
|
|
10
11
|
billing: import("redux").CombinedState<import("./interfaces").BillingState>;
|
package/subscriptions/index.js
CHANGED
|
@@ -398,6 +398,93 @@ function toSubscriptionStatus(status) {
|
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
+
var subscriptionResponseMock = {
|
|
402
|
+
id: 'sub_1JbhYVEwsu4qiqnnfMhYAdY6',
|
|
403
|
+
externalId: 'sub_1JbhYVEwsu4qiqnnfMhYAdY6',
|
|
404
|
+
startDate: '2021-09-20T08:08:51.000Z',
|
|
405
|
+
status: restApi.ISubscriptionStatus.ACTIVE,
|
|
406
|
+
cancellation: null,
|
|
407
|
+
currentPeriodStart: '2021-09-20T08:08:51.000Z',
|
|
408
|
+
currentPeriodEnd: '2021-10-20T08:08:51.000Z',
|
|
409
|
+
items: [
|
|
410
|
+
{
|
|
411
|
+
id: 'si_KGE0p5himocPXH',
|
|
412
|
+
externalId: 'prod_J60fUEvI7qV1eL',
|
|
413
|
+
planId: 'prod_J60fUEvI7qV1eL',
|
|
414
|
+
price: {
|
|
415
|
+
id: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
416
|
+
externalId: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
417
|
+
currency: 'usd',
|
|
418
|
+
amount: 10000,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
};
|
|
423
|
+
var planResponseMock = [
|
|
424
|
+
{
|
|
425
|
+
id: 'prod_J60fUEvI7qV1eL',
|
|
426
|
+
externalId: 'prod_J60fUEvI7qV1eL',
|
|
427
|
+
name: 'Premium',
|
|
428
|
+
description: '',
|
|
429
|
+
price: {
|
|
430
|
+
id: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
431
|
+
externalId: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
432
|
+
currency: 'usd',
|
|
433
|
+
amount: 10000,
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
id: 'prod_J60duauCpXfcur',
|
|
438
|
+
externalId: 'prod_J60duauCpXfcur',
|
|
439
|
+
name: 'Free',
|
|
440
|
+
description: 'Totally free plan. Nothing to pay.',
|
|
441
|
+
price: {
|
|
442
|
+
id: 'price_1ITocfEwsu4qiqnnnBHDx9fQ',
|
|
443
|
+
externalId: 'price_1ITocfEwsu4qiqnnnBHDx9fQ',
|
|
444
|
+
currency: 'usd',
|
|
445
|
+
amount: 0,
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
];
|
|
449
|
+
var invoicesMock = [
|
|
450
|
+
{
|
|
451
|
+
id: 'in_1JbhYWEwsu4qiqnnrUh6hsHa',
|
|
452
|
+
externalId: 'in_1JbhYWEwsu4qiqnnrUh6hsHa',
|
|
453
|
+
subscriptionId: 'sub_1JbhYVEwsu4qiqnnfMhYAdY6',
|
|
454
|
+
paymentDate: '2021-09-20T08:08:51.000Z',
|
|
455
|
+
totalAmount: 10000,
|
|
456
|
+
currency: 'usd',
|
|
457
|
+
paid: true,
|
|
458
|
+
receiptNumber: '',
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
id: 'in_1JbhYWEwsu4qiqnnrUh6hsHa',
|
|
462
|
+
externalId: 'in_1JbhYWEwsu4qiqnnrUh6hsHa',
|
|
463
|
+
subscriptionId: 'sub_1JbhYVEwsu4qiqnnfMhYAdY6',
|
|
464
|
+
paymentDate: '2021-08-20T08:08:51.000Z',
|
|
465
|
+
totalAmount: 10000,
|
|
466
|
+
currency: 'usd',
|
|
467
|
+
paid: true,
|
|
468
|
+
receiptNumber: '',
|
|
469
|
+
},
|
|
470
|
+
];
|
|
471
|
+
var paymentMethodsMock = [
|
|
472
|
+
{
|
|
473
|
+
id: 'id',
|
|
474
|
+
externalId: 'externalId',
|
|
475
|
+
type: restApi.PaymentMethodType.CARD,
|
|
476
|
+
isDefault: true,
|
|
477
|
+
last4: '4242',
|
|
478
|
+
expMonth: 11,
|
|
479
|
+
expYear: 25,
|
|
480
|
+
brand: 'visa',
|
|
481
|
+
billingDetails: {
|
|
482
|
+
name: 'Dummy',
|
|
483
|
+
email: 'dummy@email.com',
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
];
|
|
487
|
+
|
|
401
488
|
function subscriptionBillingInformationSagas() {
|
|
402
489
|
return tslib.__generator(this, function (_a) {
|
|
403
490
|
switch (_a.label) {
|
|
@@ -624,6 +711,54 @@ function checkoutEvent$2(_a) {
|
|
|
624
711
|
case 2: return [2 /*return*/];
|
|
625
712
|
}
|
|
626
713
|
});
|
|
714
|
+
}
|
|
715
|
+
/*********************************
|
|
716
|
+
* Preview Sagas
|
|
717
|
+
*********************************/
|
|
718
|
+
function loadBillingInformationMock() {
|
|
719
|
+
return tslib.__generator(this, function (_a) {
|
|
720
|
+
switch (_a.label) {
|
|
721
|
+
case 0: return [4 /*yield*/, effects.put(actions$5.setLoading(true))];
|
|
722
|
+
case 1:
|
|
723
|
+
_a.sent();
|
|
724
|
+
return [4 /*yield*/, loadSummariesMock()];
|
|
725
|
+
case 2:
|
|
726
|
+
_a.sent();
|
|
727
|
+
return [2 /*return*/];
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
function loadSummariesMock() {
|
|
732
|
+
var _a, _b;
|
|
733
|
+
return tslib.__generator(this, function (_c) {
|
|
734
|
+
switch (_c.label) {
|
|
735
|
+
case 0: return [4 /*yield*/, effects.put(actions$5.setLoading(true))];
|
|
736
|
+
case 1:
|
|
737
|
+
_c.sent();
|
|
738
|
+
return [4 /*yield*/, effects.delay(500)];
|
|
739
|
+
case 2:
|
|
740
|
+
_c.sent();
|
|
741
|
+
return [4 /*yield*/, effects.put(actions$5.setBillingInformation({
|
|
742
|
+
loading: false,
|
|
743
|
+
externallyManaged: false,
|
|
744
|
+
subscription: tslib.__assign(tslib.__assign({}, subscriptionResponseMock), { startDate: new Date(subscriptionResponseMock.startDate), currentPeriodStart: new Date(subscriptionResponseMock.currentPeriodStart), currentPeriodEnd: new Date(subscriptionResponseMock.currentPeriodEnd), status: toSubscriptionStatus(subscriptionResponseMock.status), cancellation: subscriptionResponseMock.cancellation && toSubscriptionCancellation(subscriptionResponseMock.cancellation), items: subscriptionResponseMock.items }),
|
|
745
|
+
plan: tslib.__assign(tslib.__assign({}, planResponseMock[0]), { price: toPrice((_a = planResponseMock[0].price) === null || _a === void 0 ? void 0 : _a.amount), currency: (_b = planResponseMock[0].price) === null || _b === void 0 ? void 0 : _b.currency, recurringInterval: 'month' }),
|
|
746
|
+
}))];
|
|
747
|
+
case 3:
|
|
748
|
+
_c.sent();
|
|
749
|
+
return [2 /*return*/];
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
function subscriptionBillingInformationSagasMock() {
|
|
754
|
+
return tslib.__generator(this, function (_a) {
|
|
755
|
+
switch (_a.label) {
|
|
756
|
+
case 0: return [4 /*yield*/, effects.takeEvery(actions$5.loadBillingInformation, loadBillingInformationMock)];
|
|
757
|
+
case 1:
|
|
758
|
+
_a.sent();
|
|
759
|
+
return [2 /*return*/];
|
|
760
|
+
}
|
|
761
|
+
});
|
|
627
762
|
}
|
|
628
763
|
|
|
629
764
|
function subscriptionsPaymentMethodSagas() {
|
|
@@ -766,6 +901,40 @@ function submitPaymentMethodSuccess() {
|
|
|
766
901
|
return [2 /*return*/];
|
|
767
902
|
}
|
|
768
903
|
});
|
|
904
|
+
}
|
|
905
|
+
/*********************************
|
|
906
|
+
* Preview Sagas
|
|
907
|
+
*********************************/
|
|
908
|
+
function loadPaymentMethodMock() {
|
|
909
|
+
var paymentMethod;
|
|
910
|
+
return tslib.__generator(this, function (_a) {
|
|
911
|
+
switch (_a.label) {
|
|
912
|
+
case 0: return [4 /*yield*/, effects.put(actions$4.setLoading(true))];
|
|
913
|
+
case 1:
|
|
914
|
+
_a.sent();
|
|
915
|
+
return [4 /*yield*/, effects.delay(500)];
|
|
916
|
+
case 2:
|
|
917
|
+
_a.sent();
|
|
918
|
+
paymentMethod = paymentMethodsMock[0];
|
|
919
|
+
return [4 /*yield*/, effects.put(actions$4.setState({
|
|
920
|
+
paymentMethod: paymentMethod,
|
|
921
|
+
loading: false,
|
|
922
|
+
}))];
|
|
923
|
+
case 3:
|
|
924
|
+
_a.sent();
|
|
925
|
+
return [2 /*return*/];
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
function subscriptionsPaymentMethodSagasMock() {
|
|
930
|
+
return tslib.__generator(this, function (_a) {
|
|
931
|
+
switch (_a.label) {
|
|
932
|
+
case 0: return [4 /*yield*/, effects.takeEvery(actions$4.loadPaymentMethod, loadPaymentMethodMock)];
|
|
933
|
+
case 1:
|
|
934
|
+
_a.sent();
|
|
935
|
+
return [2 /*return*/];
|
|
936
|
+
}
|
|
937
|
+
});
|
|
769
938
|
}
|
|
770
939
|
|
|
771
940
|
function subscriptionInvoicesSagas() {
|
|
@@ -900,6 +1069,40 @@ function checkoutEvent(_a) {
|
|
|
900
1069
|
case 2: return [2 /*return*/];
|
|
901
1070
|
}
|
|
902
1071
|
});
|
|
1072
|
+
}
|
|
1073
|
+
/*********************************
|
|
1074
|
+
* Preview Sagas
|
|
1075
|
+
*********************************/
|
|
1076
|
+
function loadInvoicesMock() {
|
|
1077
|
+
var selectPlanTitle;
|
|
1078
|
+
return tslib.__generator(this, function (_a) {
|
|
1079
|
+
switch (_a.label) {
|
|
1080
|
+
case 0: return [4 /*yield*/, effects.put(actions$3.setLoading(true))];
|
|
1081
|
+
case 1:
|
|
1082
|
+
_a.sent();
|
|
1083
|
+
return [4 /*yield*/, effects.delay(500)];
|
|
1084
|
+
case 2:
|
|
1085
|
+
_a.sent();
|
|
1086
|
+
selectPlanTitle = 'Premium';
|
|
1087
|
+
return [4 /*yield*/, effects.put(actions$3.setInvoices(invoicesMock.map(function (invoice) { return (tslib.__assign(tslib.__assign({}, invoice), { selectedPlan: selectPlanTitle, paymentDate: new Date(Date.parse(invoice.paymentDate)), totalAmount: +((invoice.totalAmount || 0) / 100).toFixed(2) })); })))];
|
|
1088
|
+
case 3:
|
|
1089
|
+
_a.sent();
|
|
1090
|
+
return [4 /*yield*/, effects.put(actions$3.setLoading(false))];
|
|
1091
|
+
case 4:
|
|
1092
|
+
_a.sent();
|
|
1093
|
+
return [2 /*return*/];
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
function subscriptionInvoicesSagasMock() {
|
|
1098
|
+
return tslib.__generator(this, function (_a) {
|
|
1099
|
+
switch (_a.label) {
|
|
1100
|
+
case 0: return [4 /*yield*/, effects.takeEvery(actions$3.loadInvoices, loadInvoicesMock)];
|
|
1101
|
+
case 1:
|
|
1102
|
+
_a.sent();
|
|
1103
|
+
return [2 /*return*/];
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
903
1106
|
}
|
|
904
1107
|
|
|
905
1108
|
function billingSagas() {
|
|
@@ -915,6 +1118,20 @@ function billingSagas() {
|
|
|
915
1118
|
return [2 /*return*/];
|
|
916
1119
|
}
|
|
917
1120
|
});
|
|
1121
|
+
}
|
|
1122
|
+
function billingSagasMock() {
|
|
1123
|
+
return tslib.__generator(this, function (_a) {
|
|
1124
|
+
switch (_a.label) {
|
|
1125
|
+
case 0: return [4 /*yield*/, effects.all([
|
|
1126
|
+
effects.call(subscriptionBillingInformationSagasMock),
|
|
1127
|
+
effects.call(subscriptionsPaymentMethodSagasMock),
|
|
1128
|
+
effects.call(subscriptionInvoicesSagasMock),
|
|
1129
|
+
])];
|
|
1130
|
+
case 1:
|
|
1131
|
+
_a.sent();
|
|
1132
|
+
return [2 /*return*/];
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
918
1135
|
}
|
|
919
1136
|
|
|
920
1137
|
function checkoutSagas() {
|
|
@@ -1114,6 +1331,25 @@ function errorCheckout(_a) {
|
|
|
1114
1331
|
return [2 /*return*/];
|
|
1115
1332
|
}
|
|
1116
1333
|
});
|
|
1334
|
+
}
|
|
1335
|
+
/*********************************
|
|
1336
|
+
* Preview Sagas
|
|
1337
|
+
*********************************/
|
|
1338
|
+
function checkoutSagasMock() {
|
|
1339
|
+
return tslib.__generator(this, function (_a) {
|
|
1340
|
+
switch (_a.label) {
|
|
1341
|
+
case 0: return [4 /*yield*/, effects.takeEvery(actions$2.checkoutPlan, checkoutPlan)];
|
|
1342
|
+
case 1:
|
|
1343
|
+
_a.sent();
|
|
1344
|
+
return [4 /*yield*/, effects.takeEvery(actions$2.resetCheckout, resetCheckout)];
|
|
1345
|
+
case 2:
|
|
1346
|
+
_a.sent();
|
|
1347
|
+
return [4 /*yield*/, effects.takeEvery(actions$2.cancelCheckout, cancelPlan)];
|
|
1348
|
+
case 3:
|
|
1349
|
+
_a.sent();
|
|
1350
|
+
return [2 /*return*/];
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1117
1353
|
}
|
|
1118
1354
|
|
|
1119
1355
|
function plansSagas() {
|
|
@@ -1165,8 +1401,49 @@ function loadPlans() {
|
|
|
1165
1401
|
case 8: return [2 /*return*/];
|
|
1166
1402
|
}
|
|
1167
1403
|
});
|
|
1404
|
+
}
|
|
1405
|
+
/*********************************
|
|
1406
|
+
* Preview Sagas
|
|
1407
|
+
*********************************/
|
|
1408
|
+
function loadPlansMock() {
|
|
1409
|
+
return tslib.__generator(this, function (_a) {
|
|
1410
|
+
switch (_a.label) {
|
|
1411
|
+
case 0: return [4 /*yield*/, effects.put(actions$7.setLoading(true))];
|
|
1412
|
+
case 1:
|
|
1413
|
+
_a.sent();
|
|
1414
|
+
return [4 /*yield*/, effects.delay(500)];
|
|
1415
|
+
case 2:
|
|
1416
|
+
_a.sent();
|
|
1417
|
+
return [4 /*yield*/, effects.put(actions$7.setPlans(planResponseMock.map(function (item) {
|
|
1418
|
+
var _a, _b;
|
|
1419
|
+
return (tslib.__assign(tslib.__assign({}, item), { price: +((((_a = item.price) === null || _a === void 0 ? void 0 : _a.amount) || 0) / 100).toFixed(2), currency: ((_b = item.price) === null || _b === void 0 ? void 0 : _b.currency) || 'usd', recurringInterval: 'month' }));
|
|
1420
|
+
})))];
|
|
1421
|
+
case 3:
|
|
1422
|
+
_a.sent();
|
|
1423
|
+
return [4 /*yield*/, effects.put(actions$7.setLoading(false))];
|
|
1424
|
+
case 4:
|
|
1425
|
+
_a.sent();
|
|
1426
|
+
return [2 /*return*/];
|
|
1427
|
+
}
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
function plansSagasMock() {
|
|
1431
|
+
return tslib.__generator(this, function (_a) {
|
|
1432
|
+
switch (_a.label) {
|
|
1433
|
+
case 0: return [4 /*yield*/, effects.takeEvery(actions$7.loadPlans, loadPlansMock)];
|
|
1434
|
+
case 1:
|
|
1435
|
+
_a.sent();
|
|
1436
|
+
return [2 /*return*/];
|
|
1437
|
+
}
|
|
1438
|
+
});
|
|
1168
1439
|
}
|
|
1169
1440
|
|
|
1441
|
+
exports.PaymentMethodType = void 0;
|
|
1442
|
+
(function (PaymentMethodType) {
|
|
1443
|
+
PaymentMethodType["UNKNWON"] = "unknown";
|
|
1444
|
+
PaymentMethodType["CARD"] = "card";
|
|
1445
|
+
})(exports.PaymentMethodType || (exports.PaymentMethodType = {}));
|
|
1446
|
+
|
|
1170
1447
|
function configSagas() {
|
|
1171
1448
|
return tslib.__generator(this, function (_a) {
|
|
1172
1449
|
switch (_a.label) {
|
|
@@ -1240,6 +1517,43 @@ function loadStripePaymentConfiguration() {
|
|
|
1240
1517
|
case 8: return [2 /*return*/];
|
|
1241
1518
|
}
|
|
1242
1519
|
});
|
|
1520
|
+
}
|
|
1521
|
+
/*********************************
|
|
1522
|
+
* Preview Sagas
|
|
1523
|
+
*********************************/
|
|
1524
|
+
function loadPaymentConfigurationMock() {
|
|
1525
|
+
return tslib.__generator(this, function (_a) {
|
|
1526
|
+
switch (_a.label) {
|
|
1527
|
+
case 0: return [4 /*yield*/, effects.put(actions$6.setLoading(true))];
|
|
1528
|
+
case 1:
|
|
1529
|
+
_a.sent();
|
|
1530
|
+
return [4 /*yield*/, effects.delay(500)];
|
|
1531
|
+
case 2:
|
|
1532
|
+
_a.sent();
|
|
1533
|
+
return [4 /*yield*/, effects.put(actions$6.setState({
|
|
1534
|
+
config: {
|
|
1535
|
+
paymentProvider: exports.PaymentProvider.STRIPE,
|
|
1536
|
+
apiKey: ''
|
|
1537
|
+
},
|
|
1538
|
+
}))];
|
|
1539
|
+
case 3:
|
|
1540
|
+
_a.sent();
|
|
1541
|
+
return [4 /*yield*/, effects.put(actions$6.setLoading(true))];
|
|
1542
|
+
case 4:
|
|
1543
|
+
_a.sent();
|
|
1544
|
+
return [2 /*return*/];
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
function configSagasMock() {
|
|
1549
|
+
return tslib.__generator(this, function (_a) {
|
|
1550
|
+
switch (_a.label) {
|
|
1551
|
+
case 0: return [4 /*yield*/, effects.takeEvery(actions$6.loadPaymentConfiguration, loadPaymentConfigurationMock)];
|
|
1552
|
+
case 1:
|
|
1553
|
+
_a.sent();
|
|
1554
|
+
return [2 /*return*/];
|
|
1555
|
+
}
|
|
1556
|
+
});
|
|
1243
1557
|
}
|
|
1244
1558
|
|
|
1245
1559
|
function sagas() {
|
|
@@ -1251,18 +1565,23 @@ function sagas() {
|
|
|
1251
1565
|
return [2 /*return*/];
|
|
1252
1566
|
}
|
|
1253
1567
|
});
|
|
1568
|
+
}
|
|
1569
|
+
function mockSagas() {
|
|
1570
|
+
return tslib.__generator(this, function (_a) {
|
|
1571
|
+
switch (_a.label) {
|
|
1572
|
+
case 0: return [4 /*yield*/, effects.all([effects.call(billingSagasMock), effects.call(checkoutSagasMock), effects.call(plansSagasMock), effects.call(configSagasMock)])];
|
|
1573
|
+
case 1:
|
|
1574
|
+
_a.sent();
|
|
1575
|
+
return [2 /*return*/];
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1254
1578
|
}
|
|
1255
1579
|
|
|
1256
|
-
exports.PaymentMethodType = void 0;
|
|
1257
|
-
(function (PaymentMethodType) {
|
|
1258
|
-
PaymentMethodType["UNKNWON"] = "unknown";
|
|
1259
|
-
PaymentMethodType["CARD"] = "card";
|
|
1260
|
-
})(exports.PaymentMethodType || (exports.PaymentMethodType = {}));
|
|
1261
|
-
|
|
1262
1580
|
// export store
|
|
1263
1581
|
// export store
|
|
1264
1582
|
var subscriptionsStore = {
|
|
1265
1583
|
sagas: sagas,
|
|
1584
|
+
mockSagas: mockSagas,
|
|
1266
1585
|
reducer: reducer,
|
|
1267
1586
|
actions: actions,
|
|
1268
1587
|
initialState: initialState,
|
|
@@ -1275,4 +1594,5 @@ exports.subscriptionActions = actions;
|
|
|
1275
1594
|
exports.subscriptionInitialState = initialState;
|
|
1276
1595
|
exports.subscriptionReducers = reducer;
|
|
1277
1596
|
exports.subscriptionSagas = sagas;
|
|
1597
|
+
exports.subscriptionSagasMock = mockSagas;
|
|
1278
1598
|
//# sourceMappingURL=index.js.map
|