@frontegg/rest-api 3.1.74 → 3.1.76-alpha.9502349697
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/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +39 -0
- package/ContextHolder/index.d.ts +108 -27
- package/ContextHolder/index.js +155 -50
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +308 -0
- package/account-settings/index.d.ts +19 -7
- package/account-settings/index.js +23 -13
- package/applications/index.d.ts +49 -44
- package/applications/index.js +51 -37
- package/audits/index.d.ts +27 -15
- package/audits/index.js +27 -17
- package/auth/index.d.ts +817 -768
- package/auth/index.js +902 -721
- package/auth/secutiry-poilicy/index.d.ts +58 -102
- package/auth/secutiry-poilicy/index.js +122 -90
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +9 -8
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +147 -114
- package/directory/index.d.ts +31 -22
- package/directory/index.js +27 -15
- package/entitlements/index.d.ts +14 -8
- package/entitlements/index.js +12 -4
- package/feature-flags/index.d.ts +8 -2
- package/feature-flags/index.js +16 -8
- package/groups/index.d.ts +73 -49
- package/groups/index.js +64 -45
- package/impersonate/index.d.ts +15 -6
- package/impersonate/index.js +13 -5
- package/index.d.ts +154 -108
- package/index.js +109 -78
- package/interfaces.d.ts +10 -0
- package/metadata/index.d.ts +67 -7
- package/metadata/index.js +52 -32
- package/node/BaseApiClient.js +49 -0
- package/node/ContextHolder/index.js +155 -50
- package/node/FetchClient.js +326 -0
- package/node/account-settings/index.js +27 -16
- package/node/applications/index.js +51 -44
- package/node/audits/index.js +31 -20
- package/node/auth/index.js +768 -1035
- package/node/auth/secutiry-poilicy/index.js +125 -136
- package/node/auth/utils.js +9 -7
- package/node/connectivity/index.js +148 -187
- package/node/directory/index.js +29 -20
- package/node/entitlements/index.js +18 -5
- package/node/feature-flags/index.js +21 -9
- package/node/groups/index.js +65 -63
- package/node/impersonate/index.js +18 -5
- package/node/index.js +116 -71
- package/node/metadata/index.js +61 -52
- package/node/notifications/index.js +37 -27
- package/node/reports/index.js +78 -70
- package/node/roles/index.js +56 -51
- package/node/security-center/index.js +21 -9
- package/node/sub-tenants/index.js +90 -89
- package/node/subscriptions/index.js +69 -107
- package/node/subscriptions/invoices.js +25 -17
- package/node/subscriptions/managedSubscriptions.js +32 -27
- package/node/subscriptions/paymentMethods.js +27 -20
- package/node/subscriptions/paymentProviders.js +15 -6
- package/node/subscriptions/plans.js +17 -9
- package/node/subscriptions/providers/stripe/index.js +26 -21
- package/node/subscriptions/subscriptions.js +32 -27
- package/node/subscriptions/summaries.js +15 -6
- package/node/subscriptions/tenantConfiguration.js +17 -9
- package/node/subscriptions/vendorPublicConfigurations.js +15 -6
- package/node/teams/index.js +130 -138
- package/node/tenants/index.js +65 -60
- package/node/user-phone-numbers/index.js +32 -24
- package/node/users/index.js +58 -53
- package/node/vendor/index.js +17 -6
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +1 -1
- package/reports/index.d.ts +50 -44
- package/reports/index.js +75 -62
- package/roles/index.d.ts +44 -38
- package/roles/index.js +57 -41
- package/security-center/index.d.ts +14 -2
- package/security-center/index.js +15 -6
- package/sub-tenants/index.d.ts +57 -15
- package/sub-tenants/index.js +88 -68
- package/subscriptions/index.d.ts +56 -11
- package/subscriptions/index.js +58 -11
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +24 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +33 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +26 -17
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +11 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +14 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +27 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +33 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +10 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +15 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
- package/subscriptions/vendorPublicConfigurations.js +11 -4
- package/teams/index.d.ts +35 -131
- package/teams/index.js +122 -93
- package/tenants/index.d.ts +25 -37
- package/tenants/index.js +62 -46
- package/tenants/interfaces.d.ts +2 -0
- package/user-phone-numbers/index.d.ts +32 -26
- package/user-phone-numbers/index.js +32 -19
- package/users/index.d.ts +21 -15
- package/users/index.js +60 -44
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +11 -4
- package/fetch.d.ts +0 -24
- package/fetch.js +0 -265
- package/node/fetch.js +0 -306
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
|
@@ -3,148 +3,137 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.createDomainRestriction = createDomainRestriction;
|
|
8
|
-
exports.createIPRestriction = createIPRestriction;
|
|
9
|
-
exports.deleteDomainRestriction = deleteDomainRestriction;
|
|
10
|
-
exports.deleteIPRestriction = deleteIPRestriction;
|
|
11
|
-
exports.getCaptchaPolicy = getCaptchaPolicy;
|
|
12
|
-
exports.getDomainRestrictions = getDomainRestrictions;
|
|
13
|
-
exports.getDomainRestrictionsConfig = getDomainRestrictionsConfig;
|
|
14
|
-
exports.getGlobalSecurityPolicy = getGlobalSecurityPolicy;
|
|
15
|
-
exports.getIPRestrictions = getIPRestrictions;
|
|
16
|
-
exports.getIPRestrictionsConfig = getIPRestrictionsConfig;
|
|
17
|
-
exports.getLockoutPolicy = getLockoutPolicy;
|
|
18
|
-
exports.getMfaPolicy = getMfaPolicy;
|
|
19
|
-
exports.getPasswordConfigPolicy = getPasswordConfigPolicy;
|
|
20
|
-
exports.getPasswordHistoryPolicy = getPasswordHistoryPolicy;
|
|
21
|
-
exports.getVendorLockoutPolicy = getVendorLockoutPolicy;
|
|
22
|
-
exports.getVendorMfaPolicy = getVendorMfaPolicy;
|
|
23
|
-
exports.getVendorPasswordHistoryPolicy = getVendorPasswordHistoryPolicy;
|
|
24
|
-
exports.saveLockoutPolicy = saveLockoutPolicy;
|
|
25
|
-
exports.saveMfaPolicy = saveMfaPolicy;
|
|
26
|
-
exports.savePasswordHistoryPolicy = savePasswordHistoryPolicy;
|
|
27
|
-
exports.testCurrentIp = testCurrentIp;
|
|
28
|
-
exports.testCurrentIpInAllowList = testCurrentIpInAllowList;
|
|
29
|
-
exports.updateDomainRestrictionConfig = updateDomainRestrictionConfig;
|
|
30
|
-
exports.updateIPRestrictionConfig = updateIPRestrictionConfig;
|
|
31
|
-
|
|
32
|
-
var _fetch = require("../../fetch");
|
|
6
|
+
exports.default = exports.SecurityPolicyApi = void 0;
|
|
33
7
|
|
|
34
8
|
var _constants = require("../../constants");
|
|
35
9
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
10
|
+
var _BaseApiClient = require("../../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class SecurityPolicyApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(appName) {
|
|
14
|
+
super(appName);
|
|
15
|
+
|
|
16
|
+
this.getGlobalSecurityPolicy = async () => {
|
|
17
|
+
return this.get(_constants.urls.identity.configurations.v1);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getMfaPolicy = async () => {
|
|
21
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/mfa-policy`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.getVendorMfaPolicy = async () => {
|
|
25
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/mfa-policy/vendor`);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.saveMfaPolicy = async body => {
|
|
29
|
+
if (body.id) {
|
|
30
|
+
return this.patch(`${_constants.urls.identity.configurations.v1}/mfa-policy`, body);
|
|
31
|
+
} else {
|
|
32
|
+
return this.post(`${_constants.urls.identity.configurations.v1}/mfa-policy`, body);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
this.getLockoutPolicy = async () => {
|
|
37
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/lockout-policy`);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.getVendorLockoutPolicy = async () => {
|
|
41
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/lockout-policy/vendor`);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
this.saveLockoutPolicy = async body => {
|
|
45
|
+
if (body.id) {
|
|
46
|
+
return this.patch(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
|
|
47
|
+
} else {
|
|
48
|
+
return this.post(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
this.getCaptchaPolicy = async () => {
|
|
53
|
+
try {
|
|
54
|
+
return await this.get(`${_constants.urls.identity.configurations.v1}/captcha-policy/public`);
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
this.getPasswordHistoryPolicy = async () => {
|
|
61
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/password-history-policy`);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
this.getVendorPasswordHistoryPolicy = async () => {
|
|
65
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/password-history-policy/vendor`);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
this.savePasswordHistoryPolicy = async body => {
|
|
69
|
+
if (body.id) {
|
|
70
|
+
return this.patch(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
|
71
|
+
} else {
|
|
72
|
+
return this.post(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
this.getPasswordConfigPolicy = async () => {
|
|
77
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/password`);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
this.getDomainRestrictions = async () => {
|
|
81
|
+
return this.get(`${_constants.urls.identity.restrictions.emailDomain.v1}`);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
this.getDomainRestrictionsConfig = async () => {
|
|
85
|
+
return this.get(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
this.createDomainRestriction = async body => {
|
|
89
|
+
return this.post(`${_constants.urls.identity.restrictions.emailDomain.v1}`, body);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
this.updateDomainRestrictionConfig = async body => {
|
|
93
|
+
return this.post(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`, body);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
this.deleteDomainRestriction = async id => {
|
|
97
|
+
return this.delete(`${_constants.urls.identity.restrictions.emailDomain.v1}/${id}`);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
this.getIPRestrictions = async params => {
|
|
101
|
+
return this.get(`${_constants.urls.identity.restrictions.ip.v1}`, params);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
this.getIPRestrictionsConfig = async () => {
|
|
105
|
+
return this.get(`${_constants.urls.identity.restrictions.ip.v1}/config`);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
this.createIPRestriction = async body => {
|
|
109
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}`, body);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
this.bulkCreateIPRestriction = async body => {
|
|
113
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/bulk`, body);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
this.updateIPRestrictionConfig = async body => {
|
|
117
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/config`, body);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
this.deleteIPRestriction = async id => {
|
|
121
|
+
return this.delete(`${_constants.urls.identity.restrictions.ip.v1}/${id}`);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
this.testCurrentIp = async () => {
|
|
125
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/verify`);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
this.testCurrentIpInAllowList = async () => {
|
|
129
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/verify/allow`);
|
|
130
|
+
};
|
|
93
131
|
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async function getPasswordConfigPolicy() {
|
|
97
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password`);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async function getDomainRestrictions() {
|
|
101
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.emailDomain.v1}`);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async function getDomainRestrictionsConfig() {
|
|
105
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
async function createDomainRestriction(body) {
|
|
109
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.emailDomain.v1}`, body);
|
|
110
|
-
}
|
|
111
132
|
|
|
112
|
-
async function updateDomainRestrictionConfig(body) {
|
|
113
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`, body);
|
|
114
133
|
}
|
|
115
134
|
|
|
116
|
-
|
|
117
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.restrictions.emailDomain.v1}/${id}`);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
async function getIPRestrictions(params) {
|
|
121
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.ip.v1}`, params);
|
|
122
|
-
}
|
|
135
|
+
exports.SecurityPolicyApi = SecurityPolicyApi;
|
|
123
136
|
|
|
124
|
-
|
|
125
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.ip.v1}/config`);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
async function createIPRestriction(body) {
|
|
129
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}`, body);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
async function bulkCreateIPRestriction(body) {
|
|
133
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/bulk`, body);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
async function updateIPRestrictionConfig(body) {
|
|
137
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/config`, body);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async function deleteIPRestriction(id) {
|
|
141
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.restrictions.ip.v1}/${id}`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async function testCurrentIp() {
|
|
145
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/verify`);
|
|
146
|
-
}
|
|
137
|
+
var _default = new SecurityPolicyApi('default');
|
|
147
138
|
|
|
148
|
-
|
|
149
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/verify/allow`);
|
|
150
|
-
}
|
|
139
|
+
exports.default = _default;
|
package/node/auth/utils.js
CHANGED
|
@@ -39,20 +39,22 @@ function removeTabTenantFromSessionStorage() {
|
|
|
39
39
|
sessionStorage.removeItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function getTabTenantFromSessionStorage() {
|
|
43
|
-
if (!_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
42
|
+
function getTabTenantFromSessionStorage(appName) {
|
|
43
|
+
if (!_ContextHolder.ContextHolder.for(appName).isSessionPerTenantEnabled()) {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
return sessionStorage.getItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function getCurrentUserTenantsFunction() {
|
|
51
|
-
const
|
|
50
|
+
function getCurrentUserTenantsFunction(appName) {
|
|
51
|
+
const usersApi = new _users.UsersApi(appName);
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const [useCurrentUserTenantsV1] = _featureFlags.FeatureFlags.getFeatureFlags([_constants.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], appName);
|
|
54
|
+
|
|
55
|
+
if (_ContextHolder.ContextHolder.for(appName).isSessionPerTenantEnabled()) {
|
|
56
|
+
return usersApi.getCurrentUserTenantsV1;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
return useCurrentUserTenantsV1 ?
|
|
59
|
+
return useCurrentUserTenantsV1 ? usersApi.getCurrentUserTenantsV1 : usersApi.getCurrentUserTenantsV3;
|
|
58
60
|
}
|
|
@@ -5,204 +5,165 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.ConnectivityApi = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
|
|
12
12
|
var _constants = require("../constants");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
15
15
|
|
|
16
16
|
const _excluded = ["eventKey"],
|
|
17
17
|
_excluded2 = ["eventKey"];
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
class ConnectivityApi extends _BaseApiClient.BaseApiClient {
|
|
20
|
+
constructor(appName) {
|
|
21
|
+
super(appName);
|
|
22
|
+
|
|
23
|
+
this.getSlackConfiguration = () => {
|
|
24
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/slack`);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
this.getSlackScope = () => {
|
|
28
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/slack/applications`);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
this.getSlackChannels = () => {
|
|
32
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/slack/channels`);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
this.postSlackConfiguration = data => {
|
|
36
|
+
if (data.id) {
|
|
37
|
+
return this.patch(`${_constants.urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return this.post(`${_constants.urls.integrations.configurations.v1}/slack/subscriptions`, data);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
this.deleteSlackConfiguration = data => {
|
|
44
|
+
return this.delete(`${_constants.urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
this.postSlackCode = code => {
|
|
48
|
+
return this.post(`${_constants.urls.integrations.configurations.v1}/slack/applications/registrations`, {
|
|
49
|
+
code
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
this.getEmailConfiguration = () => {
|
|
54
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/emails`);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
this.postEmailConfiguration = _ref => {
|
|
58
|
+
let {
|
|
59
|
+
eventKey
|
|
60
|
+
} = _ref,
|
|
61
|
+
data = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
62
|
+
return this.post(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`, data);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
this.patchEmailConfiguration = ({
|
|
66
|
+
eventKey,
|
|
67
|
+
enabled
|
|
68
|
+
}) => {
|
|
69
|
+
return this.patch(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`, {
|
|
70
|
+
enabled
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
this.deleteEmailSubscriptions = (eventKey, subscriptionId) => {
|
|
75
|
+
return this.delete(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
this.putEmailSubscriptions = (subscriptionId, eventKey, data) => {
|
|
79
|
+
return this.put(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
this.deleteEmailConfiguration = eventKey => {
|
|
83
|
+
return this.delete(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
this.getSMSConfiguration = () => {
|
|
87
|
+
return this.get(`${_constants.urls.integrations.configurations.v2}/sms`);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
this.postSMSConfiguration = _ref2 => {
|
|
91
|
+
let {
|
|
92
|
+
eventKey
|
|
93
|
+
} = _ref2,
|
|
94
|
+
data = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
95
|
+
return this.post(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`, data);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
this.patchSMSConfiguration = ({
|
|
99
|
+
eventKey,
|
|
100
|
+
enabled
|
|
101
|
+
}) => {
|
|
102
|
+
return this.patch(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`, {
|
|
103
|
+
enabled
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
this.deleteSMSSubscriptions = (eventKey, subscriptionId) => {
|
|
108
|
+
return this.delete(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
this.putSMSSubscriptions = (subscriptionId, eventKey, data) => {
|
|
112
|
+
return this.put(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
this.deleteSMSConfiguration = eventKey => {
|
|
116
|
+
return this.delete(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
this.getWebhooksConfigurations = () => {
|
|
120
|
+
return this.get(_constants.urls.webhooks.v1);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
this.postWebhooksConfiguration = data => {
|
|
124
|
+
if (data._id) {
|
|
125
|
+
return this.patch(`${_constants.urls.webhooks.v1}/${data._id}`, data);
|
|
126
|
+
} else {
|
|
127
|
+
return this.post(`${_constants.urls.webhooks.v1}/custom`, data);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
this.deleteWebhooksConfiguration = id => {
|
|
132
|
+
return this.delete(`${_constants.urls.webhooks.v1}/${id}`);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
this.getWebhookLog = (id, offset = 0, limit = 10) => {
|
|
136
|
+
const query = new URLSearchParams({
|
|
137
|
+
id,
|
|
138
|
+
offset: `${offset}`,
|
|
139
|
+
limit: `${limit}`
|
|
140
|
+
});
|
|
141
|
+
return this.get(`${_constants.urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
this.postWebhookTest = data => {
|
|
145
|
+
return this.post(`${_constants.urls.webhooks.v1}/test`, data);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
this.postWebhookRetry = id => {
|
|
149
|
+
return this.post(`${_constants.urls.webhooks.v1}/logs/${id}/retries`);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
this.getCategories = () => {
|
|
153
|
+
return this.get(`${_constants.urls.events.configurations.v1}/categories`);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
this.getChannelMaps = channels => {
|
|
157
|
+
return this.get(_constants.urls.events.configurations.v1, {
|
|
158
|
+
channels
|
|
159
|
+
});
|
|
160
|
+
};
|
|
40
161
|
}
|
|
41
162
|
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
exports.postSlackConfiguration = postSlackConfiguration;
|
|
46
|
-
|
|
47
|
-
const deleteSlackConfiguration = data => {
|
|
48
|
-
return (0, _fetch.Delete)(`${_constants.urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
exports.deleteSlackConfiguration = deleteSlackConfiguration;
|
|
52
|
-
|
|
53
|
-
const postSlackCode = code => {
|
|
54
|
-
return (0, _fetch.Post)(`${_constants.urls.integrations.configurations.v1}/slack/applications/registrations`, {
|
|
55
|
-
code
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
exports.postSlackCode = postSlackCode;
|
|
60
|
-
|
|
61
|
-
const getEmailConfiguration = () => {
|
|
62
|
-
return (0, _fetch.Get)(`${_constants.urls.integrations.configurations.v1}/emails`);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
exports.getEmailConfiguration = getEmailConfiguration;
|
|
66
|
-
|
|
67
|
-
const postEmailConfiguration = _ref => {
|
|
68
|
-
let {
|
|
69
|
-
eventKey
|
|
70
|
-
} = _ref,
|
|
71
|
-
data = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
72
|
-
return (0, _fetch.Post)(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`, data);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
exports.postEmailConfiguration = postEmailConfiguration;
|
|
76
|
-
|
|
77
|
-
const patchEmailConfiguration = ({
|
|
78
|
-
eventKey,
|
|
79
|
-
enabled
|
|
80
|
-
}) => {
|
|
81
|
-
return (0, _fetch.Patch)(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`, {
|
|
82
|
-
enabled
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
exports.patchEmailConfiguration = patchEmailConfiguration;
|
|
87
|
-
|
|
88
|
-
const deleteEmailSubscriptions = (eventKey, subscriptionId) => {
|
|
89
|
-
return (0, _fetch.Delete)(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
exports.deleteEmailSubscriptions = deleteEmailSubscriptions;
|
|
93
|
-
|
|
94
|
-
const putEmailSubscriptions = (subscriptionId, eventKey, data) => {
|
|
95
|
-
return (0, _fetch.Put)(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
exports.putEmailSubscriptions = putEmailSubscriptions;
|
|
99
|
-
|
|
100
|
-
const deleteEmailConfiguration = eventKey => {
|
|
101
|
-
return (0, _fetch.Delete)(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
exports.deleteEmailConfiguration = deleteEmailConfiguration;
|
|
105
|
-
|
|
106
|
-
const getSMSConfiguration = () => {
|
|
107
|
-
return (0, _fetch.Get)(`${_constants.urls.integrations.configurations.v2}/sms`);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
exports.getSMSConfiguration = getSMSConfiguration;
|
|
111
|
-
|
|
112
|
-
const postSMSConfiguration = _ref2 => {
|
|
113
|
-
let {
|
|
114
|
-
eventKey
|
|
115
|
-
} = _ref2,
|
|
116
|
-
data = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
117
|
-
return (0, _fetch.Post)(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`, data);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
exports.postSMSConfiguration = postSMSConfiguration;
|
|
121
|
-
|
|
122
|
-
const patchSMSConfiguration = ({
|
|
123
|
-
eventKey,
|
|
124
|
-
enabled
|
|
125
|
-
}) => {
|
|
126
|
-
return (0, _fetch.Patch)(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`, {
|
|
127
|
-
enabled
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
exports.patchSMSConfiguration = patchSMSConfiguration;
|
|
132
|
-
|
|
133
|
-
const deleteSMSSubscriptions = (eventKey, subscriptionId) => {
|
|
134
|
-
return (0, _fetch.Delete)(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
exports.deleteSMSSubscriptions = deleteSMSSubscriptions;
|
|
138
|
-
|
|
139
|
-
const putSMSSubscriptions = (subscriptionId, eventKey, data) => {
|
|
140
|
-
return (0, _fetch.Put)(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
exports.putSMSSubscriptions = putSMSSubscriptions;
|
|
144
|
-
|
|
145
|
-
const deleteSMSConfiguration = eventKey => {
|
|
146
|
-
return (0, _fetch.Delete)(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
exports.deleteSMSConfiguration = deleteSMSConfiguration;
|
|
150
|
-
|
|
151
|
-
const getWebhooksConfigurations = () => {
|
|
152
|
-
return (0, _fetch.Get)(_constants.urls.webhooks.v1);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
exports.getWebhooksConfigurations = getWebhooksConfigurations;
|
|
156
|
-
|
|
157
|
-
const postWebhooksConfiguration = data => {
|
|
158
|
-
if (data._id) {
|
|
159
|
-
return (0, _fetch.Patch)(`${_constants.urls.webhooks.v1}/${data._id}`, data);
|
|
160
|
-
} else {
|
|
161
|
-
return (0, _fetch.Post)(`${_constants.urls.webhooks.v1}/custom`, data);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
exports.postWebhooksConfiguration = postWebhooksConfiguration;
|
|
166
|
-
|
|
167
|
-
const deleteWebhooksConfiguration = id => {
|
|
168
|
-
return (0, _fetch.Delete)(`${_constants.urls.webhooks.v1}/${id}`);
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
exports.deleteWebhooksConfiguration = deleteWebhooksConfiguration;
|
|
172
|
-
|
|
173
|
-
const getWebhookLog = (id, offset = 0, limit = 10) => {
|
|
174
|
-
const query = new URLSearchParams({
|
|
175
|
-
id,
|
|
176
|
-
offset: `${offset}`,
|
|
177
|
-
limit: `${limit}`
|
|
178
|
-
});
|
|
179
|
-
return (0, _fetch.Get)(`${_constants.urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
exports.getWebhookLog = getWebhookLog;
|
|
183
|
-
|
|
184
|
-
const postWebhookTest = data => {
|
|
185
|
-
return (0, _fetch.Post)(`${_constants.urls.webhooks.v1}/test`, data);
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
exports.postWebhookTest = postWebhookTest;
|
|
189
|
-
|
|
190
|
-
const postWebhookRetry = id => {
|
|
191
|
-
return (0, _fetch.Post)(`${_constants.urls.webhooks.v1}/logs/${id}/retries`);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
exports.postWebhookRetry = postWebhookRetry;
|
|
195
|
-
|
|
196
|
-
const getCategories = () => {
|
|
197
|
-
return (0, _fetch.Get)(`${_constants.urls.events.configurations.v1}/categories`);
|
|
198
|
-
};
|
|
163
|
+
}
|
|
199
164
|
|
|
200
|
-
exports.
|
|
165
|
+
exports.ConnectivityApi = ConnectivityApi;
|
|
201
166
|
|
|
202
|
-
|
|
203
|
-
return (0, _fetch.Get)(_constants.urls.events.configurations.v1, {
|
|
204
|
-
channels
|
|
205
|
-
});
|
|
206
|
-
};
|
|
167
|
+
var _default = new ConnectivityApi('default');
|
|
207
168
|
|
|
208
|
-
exports.
|
|
169
|
+
exports.default = _default;
|