@frontegg/redux-store 6.0.3-alpha.3 → 6.2.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/audits/AuditLogsState/index.js +11 -0
- package/audits/AuditLogsState/saga.js +3 -0
- package/audits/AuditsMetadataState/index.js +11 -0
- package/audits/AuditsMetadataState/saga.js +3 -0
- package/audits/backward-compatibility/saga.js +1 -0
- package/audits/index.js +4 -2
- package/auth/AcceptInvitationState/index.js +11 -0
- package/auth/AccountSettingsState/index.js +11 -0
- package/auth/AccountSettingsState/saga.js +3 -0
- package/auth/ActivateState/index.d.ts +12 -3
- package/auth/ActivateState/index.js +11 -0
- package/auth/ApiTokensState/index.js +11 -0
- package/auth/ApiTokensState/saga.js +3 -0
- package/auth/ForgotPasswordState/index.js +11 -0
- package/auth/LoginState/index.js +11 -0
- package/auth/LoginState/saga.js +24 -8
- package/auth/MfaState/index.d.ts +8 -2
- package/auth/MfaState/index.js +11 -0
- package/auth/MfaState/saga.js +3 -0
- package/auth/ProfileState/index.js +11 -0
- package/auth/ProfileState/saga.js +11 -4
- package/auth/ResetPhoneNumberState/index.js +11 -0
- package/auth/RolesState/index.js +11 -0
- package/auth/SSOState/index.js +12 -0
- package/auth/SSOState/saga.js +3 -0
- package/auth/SecurityPolicyState/index.js +11 -0
- package/auth/SecurityPolicyState/saga.js +4 -0
- package/auth/SessionsPolicyState/index.js +11 -0
- package/auth/SessionsState/index.d.ts +8 -0
- package/auth/SessionsState/index.js +11 -0
- package/auth/SessionsState/saga.js +3 -0
- package/auth/SignUp/index.js +11 -0
- package/auth/SocialLogins/index.d.ts +2 -8
- package/auth/SocialLogins/index.js +11 -0
- package/auth/TeamState/index.js +11 -0
- package/auth/TeamState/saga.js +3 -0
- package/auth/TenantsState/index.js +11 -0
- package/auth/TenantsState/saga.js +3 -0
- package/auth/dummy.js +2 -1
- package/auth/index.js +4 -2
- package/auth/interfaces.d.ts +1 -0
- package/auth/saga.js +7 -1
- package/connectivity/ConnectivityState/index.js +7 -0
- package/connectivity/index.js +4 -2
- package/connectivity/saga.js +40 -10
- package/helpers.js +2 -1
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +11 -0
- package/node/audits/AuditLogsState/saga.js +4 -0
- package/node/audits/AuditsMetadataState/index.js +11 -0
- package/node/audits/AuditsMetadataState/saga.js +4 -0
- package/node/audits/backward-compatibility/saga.js +1 -0
- package/node/audits/index.js +2 -0
- package/node/auth/AcceptInvitationState/index.js +11 -0
- package/node/auth/AccountSettingsState/index.js +11 -0
- package/node/auth/AccountSettingsState/saga.js +4 -0
- package/node/auth/ActivateState/index.js +11 -0
- package/node/auth/ApiTokensState/index.js +11 -0
- package/node/auth/ApiTokensState/saga.js +4 -0
- package/node/auth/ForgotPasswordState/index.js +11 -0
- package/node/auth/LoginState/index.js +11 -0
- package/node/auth/LoginState/saga.js +25 -8
- package/node/auth/MfaState/index.js +11 -0
- package/node/auth/MfaState/saga.js +4 -0
- package/node/auth/ProfileState/index.js +11 -0
- package/node/auth/ProfileState/saga.js +12 -4
- package/node/auth/ResetPhoneNumberState/index.js +11 -0
- package/node/auth/RolesState/index.js +11 -0
- package/node/auth/SSOState/index.js +12 -0
- package/node/auth/SSOState/saga.js +4 -0
- package/node/auth/SecurityPolicyState/index.js +11 -0
- package/node/auth/SecurityPolicyState/saga.js +4 -0
- package/node/auth/SessionsPolicyState/index.js +11 -0
- package/node/auth/SessionsState/index.js +11 -0
- package/node/auth/SessionsState/saga.js +4 -0
- package/node/auth/SignUp/index.js +11 -0
- package/node/auth/SocialLogins/index.js +11 -0
- package/node/auth/TeamState/index.js +11 -0
- package/node/auth/TeamState/saga.js +4 -0
- package/node/auth/TenantsState/index.js +11 -0
- package/node/auth/TenantsState/saga.js +4 -0
- package/node/auth/dummy.js +2 -1
- package/node/auth/index.js +2 -0
- package/node/auth/saga.js +7 -1
- package/node/connectivity/ConnectivityState/index.js +7 -0
- package/node/connectivity/index.js +2 -0
- package/node/connectivity/saga.js +40 -10
- package/node/helpers.js +2 -1
- package/node/index.js +1 -1
- package/node/subscriptions/Billing/Information/saga.js +4 -0
- package/node/subscriptions/Billing/Invoices/saga.js +4 -0
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -1
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +1 -0
- package/node/subscriptions/Billing/PaymentMethod/saga.js +4 -0
- package/node/subscriptions/Billing/Subscription/saga.js +6 -1
- package/node/subscriptions/Checkout/saga.js +8 -0
- package/node/subscriptions/Config/saga.js +4 -0
- package/node/subscriptions/Plans/saga.js +4 -0
- package/node/subscriptions/VendorPublicConfig/saga.js +4 -0
- package/node/subscriptions/dummy.js +15 -1
- package/node/subscriptions/index.js +2 -0
- package/node/toolkit/redux-types.js +5 -0
- package/node/vendor/VendorState/index.js +11 -0
- package/node/vendor/index.js +2 -0
- package/node/vendor/saga.js +4 -0
- package/package.json +1 -1
- package/subscriptions/Billing/Information/saga.js +3 -0
- package/subscriptions/Billing/Invoices/saga.js +4 -0
- package/subscriptions/Billing/PaymentMethod/index.js +2 -1
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -0
- package/subscriptions/Billing/PaymentMethod/saga.js +4 -0
- package/subscriptions/Billing/Subscription/saga.js +6 -1
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/saga.js +8 -0
- package/subscriptions/Config/saga.js +4 -0
- package/subscriptions/Plans/saga.js +4 -0
- package/subscriptions/VendorPublicConfig/saga.js +4 -0
- package/subscriptions/dummy.js +15 -1
- package/subscriptions/index.js +3 -1
- package/toolkit/index.d.ts +1 -1
- package/toolkit/redux-types.d.ts +3 -0
- package/toolkit/redux-types.js +1 -0
- package/toolkit/redux.d.ts +2 -1
- package/vendor/VendorState/index.js +11 -0
- package/vendor/index.js +4 -2
- package/vendor/saga.js +3 -0
|
@@ -32,5 +32,16 @@ const actions = {
|
|
|
32
32
|
payload
|
|
33
33
|
}))
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* To be used for actions types after dispatch, and should contains
|
|
37
|
+
* the reducers and actions as standalone function
|
|
38
|
+
*/
|
|
39
|
+
|
|
35
40
|
exports.profileActions = actions;
|
|
41
|
+
// noinspection JSUnusedLocalSymbols
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
45
|
+
* contains the same functions in reducers and actions
|
|
46
|
+
*/
|
|
36
47
|
const Matcher = {};
|
|
@@ -74,11 +74,15 @@ function base64ToFormData(base64, key = 'file') {
|
|
|
74
74
|
|
|
75
75
|
if (matchResult == null) {
|
|
76
76
|
return null;
|
|
77
|
-
}
|
|
77
|
+
} // Get the content type of the image
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const contentType = `image/${matchResult[1]}`; // get the real base64 content of the file
|
|
81
|
+
|
|
82
|
+
const data = matchResult[2]; // Convert it to a blob to upload
|
|
83
|
+
|
|
84
|
+
const blob = b64toBlob(data, contentType); // Create a FormData and append the file with "image" as parameter name
|
|
78
85
|
|
|
79
|
-
const contentType = `image/${matchResult[1]}`;
|
|
80
|
-
const data = matchResult[2];
|
|
81
|
-
const blob = b64toBlob(data, contentType);
|
|
82
86
|
const formDataToUpload = new FormData();
|
|
83
87
|
formDataToUpload.append(key, new File([blob], key, {
|
|
84
88
|
type: contentType
|
|
@@ -171,6 +175,10 @@ function* profileSagas() {
|
|
|
171
175
|
yield (0, _effects.takeEvery)(_reducer.actions.saveProfile, saveProfile);
|
|
172
176
|
yield (0, _effects.takeEvery)(_reducer.actions.changePassword, changePassword);
|
|
173
177
|
}
|
|
178
|
+
/*********************************
|
|
179
|
+
* Preview Sagas
|
|
180
|
+
*********************************/
|
|
181
|
+
|
|
174
182
|
|
|
175
183
|
function* loadProfileMock() {
|
|
176
184
|
yield (0, _effects.put)(_reducer.actions.setProfileState({
|
|
@@ -36,5 +36,16 @@ const actions = {
|
|
|
36
36
|
payload
|
|
37
37
|
}))
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* To be used for actions types after dispatch, and should contains
|
|
41
|
+
* the reducers and actions as standalone function
|
|
42
|
+
*/
|
|
43
|
+
|
|
39
44
|
exports.resetPhoneNumberActions = actions;
|
|
45
|
+
// noinspection JSUnusedLocalSymbols
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
49
|
+
* contains the same functions in reducers and actions
|
|
50
|
+
*/
|
|
40
51
|
const Matcher = {};
|
|
@@ -45,5 +45,16 @@ const actions = {
|
|
|
45
45
|
payload
|
|
46
46
|
}))
|
|
47
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* To be used for actions types after dispatch, and should contains
|
|
50
|
+
* the reducers and actions as standalone function
|
|
51
|
+
*/
|
|
52
|
+
|
|
48
53
|
exports.rolesActions = actions;
|
|
54
|
+
// noinspection JSUnusedLocalSymbols
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
58
|
+
* contains the same functions in reducers and actions
|
|
59
|
+
*/
|
|
49
60
|
const Matcher = {};
|
|
@@ -69,6 +69,7 @@ const actions = {
|
|
|
69
69
|
saveSSOConfigurations: (0, _toolkit.createAction)(`${_constants.authStoreName}/saveSSOConfigurations`, payload => ({
|
|
70
70
|
payload
|
|
71
71
|
})),
|
|
72
|
+
// NOTE: use withCallback in case of promise response
|
|
72
73
|
saveSSOConfigurationsFile: (0, _toolkit.createAction)(`${_constants.authStoreName}/saveSSOConfigurationsFile`, payload => ({
|
|
73
74
|
payload
|
|
74
75
|
})),
|
|
@@ -91,5 +92,16 @@ const actions = {
|
|
|
91
92
|
payload
|
|
92
93
|
}))
|
|
93
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* To be used for actions types after dispatch, and should contains
|
|
97
|
+
* the reducers and actions as standalone function
|
|
98
|
+
*/
|
|
99
|
+
|
|
94
100
|
exports.ssoActions = actions;
|
|
101
|
+
// noinspection JSUnusedLocalSymbols
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
105
|
+
* contains the same functions in reducers and actions
|
|
106
|
+
*/
|
|
95
107
|
const Matcher = {};
|
|
@@ -389,6 +389,10 @@ function* ssoSagas() {
|
|
|
389
389
|
yield (0, _effects.takeEvery)(_reducer.actions.createSamlGroup, createSamlGroupFunction);
|
|
390
390
|
yield (0, _effects.takeEvery)(_reducer.actions.oidcPostlogin, oidcPostloginFunction);
|
|
391
391
|
}
|
|
392
|
+
/*********************************
|
|
393
|
+
* Preview Sagas
|
|
394
|
+
*********************************/
|
|
395
|
+
|
|
392
396
|
|
|
393
397
|
function* loadSSOConfigurationsMock() {
|
|
394
398
|
yield (0, _effects.put)(_reducer.actions.setSSOState({
|
|
@@ -77,5 +77,16 @@ const actions = {
|
|
|
77
77
|
loadVendorPasswordConfig: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadVendorPasswordConfig`),
|
|
78
78
|
loadPublicAuthStrategiesPolicy: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadPublicAuthStrategiesPolicy`)
|
|
79
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* To be used for actions types after dispatch, and should contains
|
|
82
|
+
* the reducers and actions as standalone function
|
|
83
|
+
*/
|
|
84
|
+
|
|
80
85
|
exports.securityPolicyActions = actions;
|
|
86
|
+
// noinspection JSUnusedLocalSymbols
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
90
|
+
* contains the same functions in reducers and actions
|
|
91
|
+
*/
|
|
81
92
|
const Matcher = {};
|
|
@@ -316,6 +316,10 @@ function* securityPolicySagas() {
|
|
|
316
316
|
yield (0, _effects.takeEvery)(_reducer.actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
317
317
|
yield (0, _effects.takeEvery)(_reducer.actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
|
|
318
318
|
}
|
|
319
|
+
/*********************************
|
|
320
|
+
* Preview Sagas
|
|
321
|
+
*********************************/
|
|
322
|
+
|
|
319
323
|
|
|
320
324
|
function* loadPublicSecurityPolicyMock() {
|
|
321
325
|
yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPublicState({
|
|
@@ -29,5 +29,16 @@ const actions = {
|
|
|
29
29
|
payload
|
|
30
30
|
}))
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* To be used for actions types after dispatch, and should contains
|
|
34
|
+
* the reducers and actions as standalone function
|
|
35
|
+
*/
|
|
36
|
+
|
|
32
37
|
exports.sessionsPolicyActions = actions;
|
|
38
|
+
// noinspection JSUnusedLocalSymbols
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
42
|
+
* contains the same functions in reducers and actions
|
|
43
|
+
*/
|
|
33
44
|
const Matcher = {};
|
|
@@ -34,5 +34,16 @@ const actions = {
|
|
|
34
34
|
payload
|
|
35
35
|
}))
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* To be used for actions types after dispatch, and should contains
|
|
39
|
+
* the reducers and actions as standalone function
|
|
40
|
+
*/
|
|
41
|
+
|
|
37
42
|
exports.sessionsActions = actions;
|
|
43
|
+
// noinspection JSUnusedLocalSymbols
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
47
|
+
* contains the same functions in reducers and actions
|
|
48
|
+
*/
|
|
38
49
|
const Matcher = {};
|
|
@@ -122,6 +122,10 @@ function* sessionsSaga() {
|
|
|
122
122
|
yield (0, _effects.takeLatest)(_reducer.actions.loadCurrentUserSession, loadCurrentUserSession);
|
|
123
123
|
yield (0, _effects.takeEvery)(_reducer.actions.revokeUserSessions, revokeUserSessions);
|
|
124
124
|
}
|
|
125
|
+
/*********************************
|
|
126
|
+
* Preview Sagas
|
|
127
|
+
*********************************/
|
|
128
|
+
|
|
125
129
|
|
|
126
130
|
function* loadCurrentUserSessionsMock() {
|
|
127
131
|
yield (0, _effects.put)(_reducer.actions.setSessionsState({
|
|
@@ -34,5 +34,16 @@ const actions = {
|
|
|
34
34
|
})),
|
|
35
35
|
resetSignUpStateSoft: (0, _toolkit.createAction)(`${_constants.authStoreName}/resetSignUpStateSoft`)
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* To be used for actions types after dispatch, and should contains
|
|
39
|
+
* the reducers and actions as standalone function
|
|
40
|
+
*/
|
|
41
|
+
|
|
37
42
|
exports.signUpActions = actions;
|
|
43
|
+
// noinspection JSUnusedLocalSymbols
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
47
|
+
* contains the same functions in reducers and actions
|
|
48
|
+
*/
|
|
38
49
|
const Matcher = {};
|
|
@@ -34,5 +34,16 @@ const actions = {
|
|
|
34
34
|
payload
|
|
35
35
|
}))
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* To be used for actions types after dispatch, and should contains
|
|
39
|
+
* the reducers and actions as standalone function
|
|
40
|
+
*/
|
|
41
|
+
|
|
37
42
|
exports.socialLoginsActions = actions;
|
|
43
|
+
// noinspection JSUnusedLocalSymbols
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
47
|
+
* contains the same functions in reducers and actions
|
|
48
|
+
*/
|
|
38
49
|
const Matcher = {};
|
|
@@ -122,5 +122,16 @@ const actions = {
|
|
|
122
122
|
payload
|
|
123
123
|
}))
|
|
124
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* To be used for actions types after dispatch, and should contains
|
|
127
|
+
* the reducers and actions as standalone function
|
|
128
|
+
*/
|
|
129
|
+
|
|
125
130
|
exports.teamActions = actions;
|
|
131
|
+
// noinspection JSUnusedLocalSymbols
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
135
|
+
* contains the same functions in reducers and actions
|
|
136
|
+
*/
|
|
126
137
|
const Matcher = {};
|
|
@@ -822,6 +822,10 @@ function* teamSagas() {
|
|
|
822
822
|
yield (0, _effects.takeEvery)(_reducer.actions.openDeleteUserDialog, openDeleteUserDialog);
|
|
823
823
|
yield (0, _effects.takeEvery)(_reducer.actions.closeDeleteUserDialog, closeDeleteUserDialog);
|
|
824
824
|
}
|
|
825
|
+
/*********************************
|
|
826
|
+
* Preview Sagas
|
|
827
|
+
*********************************/
|
|
828
|
+
|
|
825
829
|
|
|
826
830
|
function* loadUsersMock({
|
|
827
831
|
payload
|
|
@@ -39,5 +39,16 @@ const actions = {
|
|
|
39
39
|
payload
|
|
40
40
|
}))
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* To be used for actions types after dispatch, and should contains
|
|
44
|
+
* the reducers and actions as standalone function
|
|
45
|
+
*/
|
|
46
|
+
|
|
42
47
|
exports.tenantsActions = actions;
|
|
48
|
+
// noinspection JSUnusedLocalSymbols
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
52
|
+
* contains the same functions in reducers and actions
|
|
53
|
+
*/
|
|
43
54
|
const Matcher = {};
|
|
@@ -132,6 +132,10 @@ function* tenantsSagas() {
|
|
|
132
132
|
yield (0, _effects.takeEvery)(_reducer.actions.switchTenant, switchTenant);
|
|
133
133
|
yield (0, _effects.takeEvery)(_reducer.actions.loadSubTenantsTree, loadSubTenantsTree);
|
|
134
134
|
}
|
|
135
|
+
/*********************************
|
|
136
|
+
* Preview Sagas
|
|
137
|
+
*********************************/
|
|
138
|
+
|
|
135
139
|
|
|
136
140
|
function* loadTenantsMock({}) {
|
|
137
141
|
yield (0, _effects.put)(_reducer.actions.setTenantsState({
|
package/node/auth/dummy.js
CHANGED
package/node/auth/index.js
CHANGED
package/node/auth/saga.js
CHANGED
|
@@ -51,5 +51,11 @@ function* sagas() {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function* mockSagas() {
|
|
54
|
-
yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagasMock),
|
|
54
|
+
yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagasMock), // call(activateSagas),
|
|
55
|
+
// call(acceptInvitationSagas),
|
|
56
|
+
// call(forgotPasswordSagas),
|
|
57
|
+
// call(socialLoginsSaga),
|
|
58
|
+
// call(signUpSaga),
|
|
59
|
+
(0, _effects.call)(_saga.ssoSagasMock), (0, _effects.call)(_saga3.profileSagasMock), (0, _effects.call)(_saga4.mfaSagasMock), (0, _effects.call)(_saga9.teamSagasMock), (0, _effects.call)(_saga12.apiTokensSagaMock), (0, _effects.call)(_saga13.securityPolicySagasMock), (0, _effects.call)(_saga18.sessionsSagaMock), (0, _effects.call)(_saga14.accountSettingsSagaMock), (0, _effects.call)(_saga15.tenantsSagasMock), (0, _effects.call)(_saga19.sessionsPolicySagaMock) // call(rolesSagas),
|
|
60
|
+
]);
|
|
55
61
|
}
|
|
@@ -24,6 +24,8 @@ const initialState = {
|
|
|
24
24
|
};
|
|
25
25
|
const reducers = {
|
|
26
26
|
initData: () => (0, _extends2.default)({}, initialState),
|
|
27
|
+
// Deprecated: use initData instead;
|
|
28
|
+
// cleanData: () => ({ ...initialState }),
|
|
27
29
|
setConnectivityState: (state, {
|
|
28
30
|
payload
|
|
29
31
|
}) => (0, _extends2.default)({}, state, payload),
|
|
@@ -104,4 +106,9 @@ const actions = {
|
|
|
104
106
|
}
|
|
105
107
|
}))
|
|
106
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* To be used for actions types after dispatch, and should contains
|
|
111
|
+
* the reducers and actions as standalone function
|
|
112
|
+
*/
|
|
113
|
+
|
|
107
114
|
exports.connectivityActions = actions;
|
|
@@ -144,7 +144,8 @@ function* checkNewStatus(platform, data) {
|
|
|
144
144
|
|
|
145
145
|
const newActive = _consts.channels2Platform[platform].isActive(data);
|
|
146
146
|
|
|
147
|
-
if (newActive === currPlatform.active) return;
|
|
147
|
+
if (newActive === currPlatform.active) return; //TODO: double check
|
|
148
|
+
|
|
148
149
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
149
150
|
list: list.map(elm => elm.key === platform ? (0, _extends2.default)({}, elm, {
|
|
150
151
|
active: newActive
|
|
@@ -166,6 +167,7 @@ function* postDataFunction({
|
|
|
166
167
|
try {
|
|
167
168
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
168
169
|
isSaving: true,
|
|
170
|
+
//@ts-ignore
|
|
169
171
|
processIds: platform === 'webhook' ? [data._id, ...processIds] : processIds
|
|
170
172
|
}));
|
|
171
173
|
|
|
@@ -266,7 +268,21 @@ function* postSlackData({
|
|
|
266
268
|
return acc;
|
|
267
269
|
}, []).map(function* (el) {
|
|
268
270
|
return yield (0, _effects.call)(_restApi.api.connectivity.deleteSlackConfiguration, el);
|
|
269
|
-
})
|
|
271
|
+
}) // clean the old data
|
|
272
|
+
// ...stateSlackSubscriptions
|
|
273
|
+
// // @ts-ignore
|
|
274
|
+
// .reduce((acc, curr) => {
|
|
275
|
+
// const el = slackSubscriptions.find(({ id }) => id === curr.id);
|
|
276
|
+
// if (!el) {
|
|
277
|
+
// return [...acc, curr];
|
|
278
|
+
// }
|
|
279
|
+
// return acc;
|
|
280
|
+
// }, [])
|
|
281
|
+
// // @ts-ignore
|
|
282
|
+
// .map(function* (el) {
|
|
283
|
+
// return yield call(api.connectivity.deleteSlackConfiguration, el as Required<ISlackSubscription>);
|
|
284
|
+
// }),
|
|
285
|
+
]);
|
|
270
286
|
}
|
|
271
287
|
|
|
272
288
|
function* postEmailSMSData({
|
|
@@ -284,7 +300,8 @@ function* postEmailSMSData({
|
|
|
284
300
|
let actionsResult = [];
|
|
285
301
|
|
|
286
302
|
try {
|
|
287
|
-
actionsResult = yield (0, _effects.all)([
|
|
303
|
+
actionsResult = yield (0, _effects.all)([// create new
|
|
304
|
+
...payload.reduce((acc, curr) => {
|
|
288
305
|
const state = stateData.find(({
|
|
289
306
|
eventKey
|
|
290
307
|
}) => eventKey === curr.eventKey);
|
|
@@ -296,7 +313,8 @@ function* postEmailSMSData({
|
|
|
296
313
|
return acc;
|
|
297
314
|
}, []).map(function* (data) {
|
|
298
315
|
return yield (0, _effects.call)(type === 'email' ? _restApi.api.connectivity.postEmailConfiguration : _restApi.api.connectivity.postSMSConfiguration, data);
|
|
299
|
-
}),
|
|
316
|
+
}), // update exists
|
|
317
|
+
...payload.reduce((acc, curr) => {
|
|
300
318
|
const state = stateData.find(({
|
|
301
319
|
eventKey
|
|
302
320
|
}) => eventKey === curr.eventKey);
|
|
@@ -323,7 +341,8 @@ function* postEmailSMSData({
|
|
|
323
341
|
}), yield (0, _effects.call)(type === 'email' ? _restApi.api.connectivity.putEmailSubscriptions : _restApi.api.connectivity.putSMSSubscriptions, id, eventKey, (0, _extends2.default)({}, body, {
|
|
324
342
|
enabled
|
|
325
343
|
}))]);
|
|
326
|
-
}),
|
|
344
|
+
}), // delete record with empty recipients
|
|
345
|
+
...payload.reduce((acc, curr) => {
|
|
327
346
|
const state = stateData.find(({
|
|
328
347
|
eventKey
|
|
329
348
|
}) => eventKey === curr.eventKey);
|
|
@@ -347,7 +366,8 @@ function* postEmailSMSData({
|
|
|
347
366
|
api: type
|
|
348
367
|
},
|
|
349
368
|
type: ''
|
|
350
|
-
});
|
|
369
|
+
}); // yield put(connectivityActions.postDataSuccess({ platform: type, data: newData }));
|
|
370
|
+
|
|
351
371
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
352
372
|
error: undefined,
|
|
353
373
|
isSaving: false,
|
|
@@ -356,6 +376,7 @@ function* postEmailSMSData({
|
|
|
356
376
|
}));
|
|
357
377
|
yield checkNewStatus(type, newData);
|
|
358
378
|
} else {
|
|
379
|
+
// yield put(connectivityActions.postDataSuccess({ platform: type, data: stateData }));
|
|
359
380
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
360
381
|
error: undefined,
|
|
361
382
|
isSaving: false,
|
|
@@ -370,7 +391,8 @@ function* postCodeFunction({
|
|
|
370
391
|
}) {
|
|
371
392
|
try {
|
|
372
393
|
yield _restApi.api.connectivity.postSlackCode(payload);
|
|
373
|
-
} catch {}
|
|
394
|
+
} catch {} // yield put(connectivityActions.postCodeSuccess());
|
|
395
|
+
|
|
374
396
|
|
|
375
397
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
376
398
|
error: undefined,
|
|
@@ -391,7 +413,8 @@ function* loadSlackPermissions() {
|
|
|
391
413
|
}));
|
|
392
414
|
const {
|
|
393
415
|
clientId
|
|
394
|
-
} = yield (0, _effects.call)(_restApi.api.connectivity.getSlackScope);
|
|
416
|
+
} = yield (0, _effects.call)(_restApi.api.connectivity.getSlackScope); // yield put(connectivityActions.loadScopeSuccess(clientId));
|
|
417
|
+
|
|
395
418
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
396
419
|
slackChannels: {
|
|
397
420
|
error: undefined,
|
|
@@ -401,6 +424,7 @@ function* loadSlackPermissions() {
|
|
|
401
424
|
}
|
|
402
425
|
}));
|
|
403
426
|
} catch {
|
|
427
|
+
// yield put(connectivityActions.loadScopeSuccess(null));
|
|
404
428
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
405
429
|
slackChannels: {
|
|
406
430
|
error: undefined,
|
|
@@ -463,6 +487,7 @@ function* postWebhookTestFunction({
|
|
|
463
487
|
} = yield (0, _effects.call)(_restApi.api.connectivity.postWebhookTest, payload);
|
|
464
488
|
|
|
465
489
|
if ([201, 200].includes(statusCode)) {
|
|
490
|
+
// yield put(connectivityActions.postWebhookTestSuccess('success', JSON.stringify(body, null, 2)));
|
|
466
491
|
const message = JSON.stringify(body, null, 2);
|
|
467
492
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
468
493
|
isTesting: false,
|
|
@@ -472,6 +497,7 @@ function* postWebhookTestFunction({
|
|
|
472
497
|
}
|
|
473
498
|
}));
|
|
474
499
|
} else {
|
|
500
|
+
// yield put(connectivityActions.postWebhookTestSuccess('failed', body.toString()));
|
|
475
501
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
476
502
|
isTesting: false,
|
|
477
503
|
testResult: {
|
|
@@ -480,6 +506,7 @@ function* postWebhookTestFunction({
|
|
|
480
506
|
}));
|
|
481
507
|
}
|
|
482
508
|
} catch (e) {
|
|
509
|
+
// yield put(connectivityActions.postWebhookTestSuccess('failed', e.toString()));
|
|
483
510
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
484
511
|
isTesting: false,
|
|
485
512
|
testResult: {
|
|
@@ -529,8 +556,11 @@ function* loadWebhookLogsFunction({
|
|
|
529
556
|
webhookLogs: (0, _extends2.default)({}, webhookLogs, {
|
|
530
557
|
isLoading: true
|
|
531
558
|
})
|
|
532
|
-
}));
|
|
533
|
-
|
|
559
|
+
})); //TODO: Fix types
|
|
560
|
+
//@ts-ignore
|
|
561
|
+
|
|
562
|
+
const data = yield (0, _effects.call)(_restApi.api.connectivity.getWebhookLog, id, offset, limit); // yield put(connectivityActions.loadWebhookLogsSuccess(data));
|
|
563
|
+
|
|
534
564
|
yield (0, _effects.put)(_reducer.actions.setConnectivityState({
|
|
535
565
|
error: undefined,
|
|
536
566
|
webhookLogs: (0, _extends2.default)({
|
package/node/helpers.js
CHANGED
|
@@ -30,7 +30,8 @@ function generateActionCreator(storeName) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
async function generateCodeChallenge(codeVerifier) {
|
|
33
|
-
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(codeVerifier));
|
|
33
|
+
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(codeVerifier)); // @ts-ignore
|
|
34
|
+
|
|
34
35
|
return btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
35
36
|
}
|
|
36
37
|
|
package/node/index.js
CHANGED
|
@@ -106,6 +106,10 @@ function* loadSummaries(tenantId, forceActive) {
|
|
|
106
106
|
yield (0, _effects.put)(_index.informationActions.setError(e.message));
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
/*********************************
|
|
110
|
+
* Preview Sagas
|
|
111
|
+
*********************************/
|
|
112
|
+
|
|
109
113
|
|
|
110
114
|
function* loadBillingInformationMock() {
|
|
111
115
|
yield loadSummariesMock();
|
|
@@ -47,5 +47,6 @@ const actions = (0, _extends2.default)({
|
|
|
47
47
|
updatePaymentMethodBillingDetails: (0, _toolkit.createAction)(`${name}/updateBillingDetails`, payload => ({
|
|
48
48
|
payload
|
|
49
49
|
}))
|
|
50
|
-
}, paymentActions);
|
|
50
|
+
}, paymentActions); //TODO: refactor to general code-style like export type ConnectivityActions = DispatchedActions;
|
|
51
|
+
|
|
51
52
|
exports.subscriptionsPaymentMethodActions = actions;
|
|
@@ -81,6 +81,10 @@ function* submitPaymentMethodError({
|
|
|
81
81
|
function* submitPaymentMethodSuccess() {
|
|
82
82
|
yield (0, _effects.put)(_index.subscriptionsPaymentMethodActions.loadPaymentMethod());
|
|
83
83
|
}
|
|
84
|
+
/*********************************
|
|
85
|
+
* Preview Sagas
|
|
86
|
+
*********************************/
|
|
87
|
+
|
|
84
88
|
|
|
85
89
|
function* loadPaymentMethodMock() {
|
|
86
90
|
yield (0, _effects.put)(_index.subscriptionsPaymentMethodActions.setLoading(true));
|
|
@@ -30,7 +30,8 @@ function* loadSubscriptionTenant() {
|
|
|
30
30
|
return (_state$auth = state.auth) == null ? void 0 : (_state$auth$user = _state$auth.user) == null ? void 0 : _state$auth$user.tenantId;
|
|
31
31
|
});
|
|
32
32
|
yield (0, _saga.loadSummaries)(tenantId);
|
|
33
|
-
}
|
|
33
|
+
} // @ts-ignore
|
|
34
|
+
|
|
34
35
|
|
|
35
36
|
function* loadSubscription() {
|
|
36
37
|
yield (0, _effects.put)(_index.subscriptionActions.setLoading(true));
|
|
@@ -114,6 +115,10 @@ function* renewSubscription() {
|
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
}
|
|
118
|
+
/*********************************
|
|
119
|
+
* Preview Sagas
|
|
120
|
+
*********************************/
|
|
121
|
+
|
|
117
122
|
|
|
118
123
|
function* loadMock() {
|
|
119
124
|
yield (0, _effects.put)(_index.subscriptionActions.setLoading(true));
|
|
@@ -50,6 +50,10 @@ function* resetCheckout() {
|
|
|
50
50
|
confirmed: false
|
|
51
51
|
}));
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Based on payment provider type
|
|
55
|
+
*/
|
|
56
|
+
|
|
53
57
|
|
|
54
58
|
function* submitCheckout() {
|
|
55
59
|
yield (0, _effects.put)(_index.checkoutActions.setState({
|
|
@@ -123,6 +127,10 @@ function* errorCheckout({
|
|
|
123
127
|
error: payload
|
|
124
128
|
}));
|
|
125
129
|
}
|
|
130
|
+
/*********************************
|
|
131
|
+
* Preview Sagas
|
|
132
|
+
*********************************/
|
|
133
|
+
|
|
126
134
|
|
|
127
135
|
function* checkoutSagasMock() {
|
|
128
136
|
yield (0, _effects.takeEvery)(_index.checkoutActions.resetCheckout, resetCheckout);
|
|
@@ -52,6 +52,10 @@ function* loadStripePaymentConfiguration() {
|
|
|
52
52
|
yield (0, _effects.put)(_index.configActions.setError(e.message));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
/*********************************
|
|
56
|
+
* Preview Sagas
|
|
57
|
+
*********************************/
|
|
58
|
+
|
|
55
59
|
|
|
56
60
|
function* loadPaymentConfigurationMock() {
|
|
57
61
|
yield (0, _effects.put)(_index.configActions.setLoading(true));
|
|
@@ -49,6 +49,10 @@ function* loadPlans() {
|
|
|
49
49
|
yield (0, _effects.put)(_index.plansActions.setError(e.message));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
/*********************************
|
|
53
|
+
* Preview Sagas
|
|
54
|
+
*********************************/
|
|
55
|
+
|
|
52
56
|
|
|
53
57
|
function* loadPlansMock() {
|
|
54
58
|
yield (0, _effects.put)(_index.plansActions.setLoading(true));
|
|
@@ -32,6 +32,10 @@ function* loadVendorPublicConfiguration() {
|
|
|
32
32
|
yield (0, _effects.put)(_index.vendorPublicConfigActions.setError(e.message));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
/*********************************
|
|
36
|
+
* Preview Sagas
|
|
37
|
+
*********************************/
|
|
38
|
+
|
|
35
39
|
|
|
36
40
|
function* loadVendorPublicConfigurationMock() {
|
|
37
41
|
yield (0, _effects.put)(_index.vendorPublicConfigActions.setLoading(true));
|