@frontegg/rest-api 6.0.1-alpha.4 → 7.28.0-alpha.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/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +30 -0
- package/ContextHolder/index.d.ts +160 -0
- package/ContextHolder/index.js +278 -0
- package/ContextHolder/package.json +6 -0
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +260 -0
- package/account-settings/index.d.ts +21 -7
- package/account-settings/index.js +25 -6
- package/account-settings/interfaces.d.ts +9 -2
- package/applications/index.d.ts +51 -0
- package/applications/index.js +55 -0
- package/applications/interfaces.d.ts +49 -0
- package/applications/interfaces.js +5 -0
- package/applications/package.json +6 -0
- package/audits/index.d.ts +27 -15
- package/audits/index.js +29 -16
- package/audits/interfaces.d.ts +3 -2
- package/auth/constants.d.ts +5 -0
- package/auth/constants.js +5 -0
- package/auth/enums.d.ts +8 -1
- package/auth/enums.js +9 -4
- package/auth/index.d.ts +833 -428
- package/auth/index.js +768 -385
- package/auth/interfaces.d.ts +341 -39
- package/auth/interfaces.js +19 -9
- package/auth/secutiry-poilicy/index.d.ts +60 -41
- package/auth/secutiry-poilicy/index.js +99 -45
- package/auth/secutiry-poilicy/interfaces.d.ts +62 -2
- package/auth/secutiry-poilicy/interfaces.js +5 -1
- package/auth/utils.d.ts +10 -0
- package/auth/utils.js +35 -0
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +120 -114
- package/constants.d.ts +115 -0
- package/constants.js +122 -5
- package/directory/index.d.ts +32 -0
- package/directory/index.js +30 -0
- package/directory/interfaces.d.ts +30 -0
- package/directory/interfaces.js +7 -0
- package/directory/package.json +6 -0
- package/entitlements/index.d.ts +15 -0
- package/entitlements/index.js +20 -0
- package/entitlements/interfaces.d.ts +13 -0
- package/entitlements/interfaces.js +11 -0
- package/entitlements/package.json +6 -0
- package/error.js +0 -2
- package/feature-flags/index.d.ts +18 -0
- package/feature-flags/index.js +44 -0
- package/feature-flags/interfaces.d.ts +5 -0
- package/feature-flags/interfaces.js +1 -0
- package/feature-flags/package.json +6 -0
- package/groups/enums.d.ts +9 -0
- package/groups/enums.js +11 -0
- package/groups/index.d.ts +73 -0
- package/groups/index.js +62 -0
- package/groups/interfaces.d.ts +64 -0
- package/groups/interfaces.js +1 -0
- package/groups/package.json +6 -0
- package/impersonate/index.d.ts +17 -0
- package/impersonate/index.js +23 -0
- package/impersonate/interfaces.d.ts +12 -0
- package/impersonate/interfaces.js +1 -0
- package/impersonate/package.json +6 -0
- package/index.d.ts +148 -53
- package/index.js +103 -31
- package/interfaces.d.ts +82 -1
- package/interfaces.js +28 -1
- package/jwt.js +19 -20
- package/metadata/index.d.ts +68 -5
- package/metadata/index.js +53 -23
- package/metadata/interfaces.d.ts +10 -2
- package/node/BaseApiClient.js +37 -0
- package/node/ContextHolder/index.js +286 -0
- package/node/FetchClient.js +268 -0
- package/node/account-settings/index.js +26 -11
- package/node/applications/index.js +62 -0
- package/node/applications/interfaces.js +12 -0
- package/node/audits/index.js +32 -27
- package/node/auth/constants.js +13 -0
- package/node/auth/enums.js +11 -5
- package/node/auth/index.js +807 -644
- package/node/auth/interfaces.js +27 -13
- package/node/auth/secutiry-poilicy/index.js +100 -66
- package/node/auth/secutiry-poilicy/interfaces.js +8 -1
- package/node/auth/utils.js +44 -0
- package/node/connectivity/index.js +123 -197
- package/node/constants.js +124 -6
- package/node/directory/index.js +37 -0
- package/node/directory/interfaces.js +14 -0
- package/node/entitlements/index.js +27 -0
- package/node/entitlements/interfaces.js +18 -0
- package/node/error.js +0 -4
- package/node/feature-flags/index.js +54 -0
- package/node/feature-flags/interfaces.js +5 -0
- package/node/groups/enums.js +19 -0
- package/node/groups/index.js +70 -0
- package/node/groups/interfaces.js +5 -0
- package/node/impersonate/index.js +29 -0
- package/node/impersonate/interfaces.js +5 -0
- package/node/index.js +324 -94
- package/node/interfaces.js +34 -1
- package/node/jwt.js +19 -25
- package/node/metadata/index.js +57 -38
- package/node/notifications/index.js +34 -31
- package/node/reports/index.js +79 -83
- package/node/roles/index.js +55 -60
- package/node/roles/interfaces.js +9 -1
- package/node/routers.js +52 -6
- package/node/security-center/index.js +26 -0
- package/node/security-center/interfaces.js +74 -0
- package/node/sub-tenants/index.js +82 -29
- package/node/sub-tenants/interfaces.js +9 -1
- package/node/subscriptions/enums.js +13 -9
- package/node/subscriptions/index.js +64 -109
- package/node/subscriptions/interfaces.js +0 -2
- package/node/subscriptions/invoices.js +20 -21
- package/node/subscriptions/managedSubscriptions.js +28 -33
- package/node/subscriptions/paymentMethods.js +23 -27
- package/node/subscriptions/paymentProviders.js +11 -8
- package/node/subscriptions/plans.js +13 -12
- package/node/subscriptions/providers/stripe/index.js +22 -27
- package/node/subscriptions/subscriptions.js +28 -33
- package/node/subscriptions/summaries.js +11 -8
- package/node/subscriptions/tenantConfiguration.js +13 -12
- package/node/subscriptions/vendorPublicConfigurations.js +17 -0
- package/node/teams/index.js +108 -121
- package/node/teams/interfaces.js +8 -1
- package/node/tenants/index.js +63 -21
- package/node/tenants/interfaces.js +18 -1
- package/node/user-phone-numbers/index.js +38 -0
- package/node/user-phone-numbers/interfaces.js +5 -0
- package/node/users/index.js +64 -0
- package/node/users/interfaces.js +27 -0
- package/node/velo/index.js +75 -0
- package/node/velo/interfaces.js +5 -0
- package/node/vendor/index.js +16 -8
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +4 -2
- package/reports/index.d.ts +50 -44
- package/reports/index.js +77 -68
- package/reports/interfaces.d.ts +2 -2
- package/roles/index.d.ts +45 -34
- package/roles/index.js +52 -41
- package/roles/interfaces.d.ts +25 -9
- package/roles/interfaces.js +6 -1
- package/routers.d.ts +6 -1
- package/routers.js +45 -2
- package/security-center/index.d.ts +15 -0
- package/security-center/index.js +19 -0
- package/security-center/interfaces.d.ts +115 -0
- package/security-center/interfaces.js +63 -0
- package/security-center/package.json +6 -0
- package/sub-tenants/index.d.ts +57 -8
- package/sub-tenants/index.js +84 -19
- package/sub-tenants/interfaces.d.ts +68 -10
- package/sub-tenants/interfaces.js +6 -1
- package/subscriptions/enums.d.ts +7 -0
- package/subscriptions/enums.js +10 -8
- package/subscriptions/index.d.ts +55 -9
- package/subscriptions/index.js +56 -9
- package/subscriptions/interfaces.d.ts +7 -3
- package/subscriptions/interfaces.js +1 -1
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +19 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +27 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +22 -18
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +9 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +11 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +21 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +27 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +8 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +12 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -0
- package/subscriptions/vendorPublicConfigurations.js +10 -0
- package/teams/index.d.ts +38 -115
- package/teams/index.js +105 -79
- package/teams/interfaces.d.ts +47 -42
- package/teams/interfaces.js +5 -1
- package/tenants/index.d.ts +25 -26
- package/tenants/index.js +61 -12
- package/tenants/interfaces.d.ts +85 -0
- package/tenants/interfaces.js +14 -1
- package/user-phone-numbers/index.d.ts +32 -0
- package/user-phone-numbers/index.js +31 -0
- package/user-phone-numbers/interfaces.d.ts +32 -0
- package/user-phone-numbers/interfaces.js +1 -0
- package/user-phone-numbers/package.json +6 -0
- package/users/index.d.ts +24 -0
- package/users/index.js +55 -0
- package/users/interfaces.d.ts +144 -0
- package/users/interfaces.js +18 -0
- package/users/package.json +6 -0
- package/velo/index.d.ts +46 -0
- package/velo/index.js +68 -0
- package/velo/interfaces.d.ts +108 -0
- package/velo/interfaces.js +1 -0
- package/velo/package.json +6 -0
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +15 -4
- package/ContextHolder.d.ts +0 -29
- package/ContextHolder.js +0 -80
- package/fetch.d.ts +0 -19
- package/fetch.js +0 -203
- package/node/ContextHolder.js +0 -90
- package/node/fetch.js +0 -234
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
package/node/auth/interfaces.js
CHANGED
|
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
SecondaryAuthStrategy: true
|
|
7
|
+
SecondaryAuthStrategy: true,
|
|
8
|
+
WebAuthnDeviceType: true,
|
|
9
|
+
MFAStrategyEnum: true,
|
|
10
|
+
LOAD_AUTHORIZATION_FF: true
|
|
8
11
|
};
|
|
9
|
-
exports.SecondaryAuthStrategy = void 0;
|
|
10
|
-
|
|
12
|
+
exports.WebAuthnDeviceType = exports.SecondaryAuthStrategy = exports.MFAStrategyEnum = exports.LOAD_AUTHORIZATION_FF = void 0;
|
|
11
13
|
var _interfaces = require("./secutiry-poilicy/interfaces");
|
|
12
|
-
|
|
13
14
|
Object.keys(_interfaces).forEach(function (key) {
|
|
14
15
|
if (key === "default" || key === "__esModule") return;
|
|
15
16
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -21,18 +22,31 @@ Object.keys(_interfaces).forEach(function (key) {
|
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
});
|
|
24
|
-
|
|
25
|
-
;
|
|
26
|
-
;
|
|
27
|
-
;
|
|
28
|
-
;
|
|
29
|
-
;
|
|
30
|
-
;
|
|
25
|
+
// SmsCode is for speedy login, SmsCodeV2 is for login with SMS
|
|
31
26
|
let SecondaryAuthStrategy;
|
|
32
27
|
exports.SecondaryAuthStrategy = SecondaryAuthStrategy;
|
|
33
|
-
|
|
34
28
|
(function (SecondaryAuthStrategy) {
|
|
35
29
|
SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
|
|
36
30
|
SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
|
|
37
31
|
SecondaryAuthStrategy["SmsCode"] = "SmsCode";
|
|
38
|
-
|
|
32
|
+
SecondaryAuthStrategy["SmsCodeV2"] = "SmsCodeV2";
|
|
33
|
+
SecondaryAuthStrategy["Passkeys"] = "Passkeys";
|
|
34
|
+
})(SecondaryAuthStrategy || (exports.SecondaryAuthStrategy = SecondaryAuthStrategy = {}));
|
|
35
|
+
// WebAuthn
|
|
36
|
+
let WebAuthnDeviceType;
|
|
37
|
+
exports.WebAuthnDeviceType = WebAuthnDeviceType;
|
|
38
|
+
(function (WebAuthnDeviceType) {
|
|
39
|
+
WebAuthnDeviceType["Platform"] = "Platform";
|
|
40
|
+
WebAuthnDeviceType["CrossPlatform"] = "CrossPlatform";
|
|
41
|
+
})(WebAuthnDeviceType || (exports.WebAuthnDeviceType = WebAuthnDeviceType = {}));
|
|
42
|
+
let MFAStrategyEnum;
|
|
43
|
+
exports.MFAStrategyEnum = MFAStrategyEnum;
|
|
44
|
+
(function (MFAStrategyEnum) {
|
|
45
|
+
MFAStrategyEnum["AuthenticatorApp"] = "AuthenticatorApp";
|
|
46
|
+
MFAStrategyEnum["WebAuthnPlatform"] = "WebAuthnPlatform";
|
|
47
|
+
MFAStrategyEnum["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
|
|
48
|
+
MFAStrategyEnum["SMS"] = "SMS";
|
|
49
|
+
MFAStrategyEnum["EmailCode"] = "EmailCode";
|
|
50
|
+
})(MFAStrategyEnum || (exports.MFAStrategyEnum = MFAStrategyEnum = {}));
|
|
51
|
+
const LOAD_AUTHORIZATION_FF = 'admin_portal_should_load_authorization';
|
|
52
|
+
exports.LOAD_AUTHORIZATION_FF = LOAD_AUTHORIZATION_FF;
|
|
@@ -3,73 +3,107 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getGlobalSecurityPolicy = getGlobalSecurityPolicy;
|
|
8
|
-
exports.getLockoutPolicy = getLockoutPolicy;
|
|
9
|
-
exports.getMfaPolicy = getMfaPolicy;
|
|
10
|
-
exports.getPasswordConfigPolicy = getPasswordConfigPolicy;
|
|
11
|
-
exports.getPasswordHistoryPolicy = getPasswordHistoryPolicy;
|
|
12
|
-
exports.getVendorMfaPolicy = getVendorMfaPolicy;
|
|
13
|
-
exports.saveLockoutPolicy = saveLockoutPolicy;
|
|
14
|
-
exports.saveMfaPolicy = saveMfaPolicy;
|
|
15
|
-
exports.savePasswordHistoryPolicy = savePasswordHistoryPolicy;
|
|
16
|
-
|
|
17
|
-
var _fetch = require("../../fetch");
|
|
18
|
-
|
|
6
|
+
exports.default = exports.SecurityPolicyApi = void 0;
|
|
19
7
|
var _constants = require("../../constants");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
8
|
+
var _BaseApiClient = require("../../BaseApiClient");
|
|
9
|
+
class SecurityPolicyApi extends _BaseApiClient.BaseApiClient {
|
|
10
|
+
constructor(appName) {
|
|
11
|
+
super(appName);
|
|
12
|
+
this.getGlobalSecurityPolicy = async () => {
|
|
13
|
+
return this.get(_constants.urls.identity.configurations.v1);
|
|
14
|
+
};
|
|
15
|
+
this.getMfaPolicy = async () => {
|
|
16
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/mfa-policy`);
|
|
17
|
+
};
|
|
18
|
+
this.getVendorMfaPolicy = async () => {
|
|
19
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/mfa-policy/vendor`);
|
|
20
|
+
};
|
|
21
|
+
this.saveMfaPolicy = async body => {
|
|
22
|
+
if (body.id) {
|
|
23
|
+
return this.patch(`${_constants.urls.identity.configurations.v1}/mfa-policy`, body);
|
|
24
|
+
} else {
|
|
25
|
+
return this.post(`${_constants.urls.identity.configurations.v1}/mfa-policy`, body);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.getLockoutPolicy = async () => {
|
|
29
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/lockout-policy`);
|
|
30
|
+
};
|
|
31
|
+
this.getVendorLockoutPolicy = async () => {
|
|
32
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/lockout-policy/vendor`);
|
|
33
|
+
};
|
|
34
|
+
this.saveLockoutPolicy = async body => {
|
|
35
|
+
if (body.id) {
|
|
36
|
+
return this.patch(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
|
|
37
|
+
} else {
|
|
38
|
+
return this.post(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
this.getCaptchaPolicy = async () => {
|
|
42
|
+
try {
|
|
43
|
+
return await this.get(`${_constants.urls.identity.configurations.v1}/captcha-policy/public`);
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
this.getPasswordHistoryPolicy = async () => {
|
|
49
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/password-history-policy`);
|
|
50
|
+
};
|
|
51
|
+
this.getVendorPasswordHistoryPolicy = async () => {
|
|
52
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/password-history-policy/vendor`);
|
|
53
|
+
};
|
|
54
|
+
this.savePasswordHistoryPolicy = async body => {
|
|
55
|
+
if (body.id) {
|
|
56
|
+
return this.patch(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
|
57
|
+
} else {
|
|
58
|
+
return this.post(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
this.getPasswordConfigPolicy = async () => {
|
|
62
|
+
return this.get(`${_constants.urls.identity.configurations.v1}/password`);
|
|
63
|
+
};
|
|
64
|
+
this.getDomainRestrictions = async () => {
|
|
65
|
+
return this.get(`${_constants.urls.identity.restrictions.emailDomain.v1}`);
|
|
66
|
+
};
|
|
67
|
+
this.getDomainRestrictionsConfig = async () => {
|
|
68
|
+
return this.get(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`);
|
|
69
|
+
};
|
|
70
|
+
this.createDomainRestriction = async body => {
|
|
71
|
+
return this.post(`${_constants.urls.identity.restrictions.emailDomain.v1}`, body);
|
|
72
|
+
};
|
|
73
|
+
this.updateDomainRestrictionConfig = async body => {
|
|
74
|
+
return this.post(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`, body);
|
|
75
|
+
};
|
|
76
|
+
this.deleteDomainRestriction = async id => {
|
|
77
|
+
return this.delete(`${_constants.urls.identity.restrictions.emailDomain.v1}/${id}`);
|
|
78
|
+
};
|
|
79
|
+
this.getIPRestrictions = async params => {
|
|
80
|
+
return this.get(`${_constants.urls.identity.restrictions.ip.v1}`, params);
|
|
81
|
+
};
|
|
82
|
+
this.getIPRestrictionsConfig = async () => {
|
|
83
|
+
return this.get(`${_constants.urls.identity.restrictions.ip.v1}/config`);
|
|
84
|
+
};
|
|
85
|
+
this.createIPRestriction = async body => {
|
|
86
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}`, body);
|
|
87
|
+
};
|
|
88
|
+
this.bulkCreateIPRestriction = async body => {
|
|
89
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/bulk`, body);
|
|
90
|
+
};
|
|
91
|
+
this.updateIPRestrictionConfig = async body => {
|
|
92
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/config`, body);
|
|
93
|
+
};
|
|
94
|
+
this.deleteIPRestriction = async id => {
|
|
95
|
+
return this.delete(`${_constants.urls.identity.restrictions.ip.v1}/${id}`);
|
|
96
|
+
};
|
|
97
|
+
this.testCurrentIp = async () => {
|
|
98
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/verify`);
|
|
99
|
+
};
|
|
100
|
+
this.testCurrentIpInAllowList = async () => {
|
|
101
|
+
return this.post(`${_constants.urls.identity.restrictions.ip.v1}/verify/allow`);
|
|
102
|
+
};
|
|
50
103
|
}
|
|
51
|
-
}
|
|
52
104
|
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
return await (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/captcha-policy/public`);
|
|
56
|
-
} catch {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
105
|
+
/** Get global secure access configuration */
|
|
59
106
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async function savePasswordHistoryPolicy(body) {
|
|
66
|
-
if (body.id) {
|
|
67
|
-
return (0, _fetch.Patch)(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
|
68
|
-
} else {
|
|
69
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async function getPasswordConfigPolicy() {
|
|
74
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password`);
|
|
75
|
-
}
|
|
107
|
+
exports.SecurityPolicyApi = SecurityPolicyApi;
|
|
108
|
+
var _default = new SecurityPolicyApi('default');
|
|
109
|
+
exports.default = _default;
|
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.RestrictionType = void 0;
|
|
7
|
+
let RestrictionType;
|
|
8
|
+
exports.RestrictionType = RestrictionType;
|
|
9
|
+
(function (RestrictionType) {
|
|
10
|
+
RestrictionType["ALLOW"] = "ALLOW";
|
|
11
|
+
RestrictionType["BLOCK"] = "BLOCK";
|
|
12
|
+
})(RestrictionType || (exports.RestrictionType = RestrictionType = {}));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.executeConditionalPromise = executeConditionalPromise;
|
|
7
|
+
exports.getCurrentUserTenantsFunction = getCurrentUserTenantsFunction;
|
|
8
|
+
exports.getTabTenantFromSessionStorage = getTabTenantFromSessionStorage;
|
|
9
|
+
exports.removeTabTenantFromSessionStorage = removeTabTenantFromSessionStorage;
|
|
10
|
+
exports.setTabTenantInSessionStorage = setTabTenantInSessionStorage;
|
|
11
|
+
var _ContextHolder = require("../ContextHolder");
|
|
12
|
+
var _constants = require("./constants");
|
|
13
|
+
var _featureFlags = require("../feature-flags");
|
|
14
|
+
var _users = require("../users");
|
|
15
|
+
async function executeConditionalPromise({
|
|
16
|
+
shouldLoad,
|
|
17
|
+
action
|
|
18
|
+
}) {
|
|
19
|
+
if (!shouldLoad) return;
|
|
20
|
+
return await action();
|
|
21
|
+
}
|
|
22
|
+
function setTabTenantInSessionStorage(tenantId) {
|
|
23
|
+
if (!tenantId) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
sessionStorage.setItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT, tenantId);
|
|
27
|
+
}
|
|
28
|
+
function removeTabTenantFromSessionStorage() {
|
|
29
|
+
sessionStorage.removeItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
30
|
+
}
|
|
31
|
+
function getTabTenantFromSessionStorage(appName) {
|
|
32
|
+
if (!_ContextHolder.ContextHolder.for(appName).isSessionPerTenantEnabled()) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return sessionStorage.getItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
36
|
+
}
|
|
37
|
+
function getCurrentUserTenantsFunction(appName) {
|
|
38
|
+
const usersApi = new _users.UsersApi(appName);
|
|
39
|
+
const [useCurrentUserTenantsV1] = _featureFlags.FeatureFlags.getFeatureFlags([_constants.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], appName);
|
|
40
|
+
if (_ContextHolder.ContextHolder.for(appName).isSessionPerTenantEnabled()) {
|
|
41
|
+
return usersApi.getCurrentUserTenantsV1;
|
|
42
|
+
}
|
|
43
|
+
return useCurrentUserTenantsV1 ? usersApi.getCurrentUserTenantsV1 : usersApi.getCurrentUserTenantsV3;
|
|
44
|
+
}
|
|
@@ -1,208 +1,134 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
7
|
+
exports.default = exports.ConnectivityApi = void 0;
|
|
10
8
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
-
|
|
12
9
|
var _constants = require("../constants");
|
|
13
|
-
|
|
14
|
-
var _fetch = require("../fetch");
|
|
15
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
16
11
|
const _excluded = ["eventKey"],
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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);
|
|
12
|
+
_excluded2 = ["eventKey"];
|
|
13
|
+
class ConnectivityApi extends _BaseApiClient.BaseApiClient {
|
|
14
|
+
constructor(appName) {
|
|
15
|
+
super(appName);
|
|
16
|
+
this.getSlackConfiguration = () => {
|
|
17
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/slack`);
|
|
18
|
+
};
|
|
19
|
+
this.getSlackScope = () => {
|
|
20
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/slack/applications`);
|
|
21
|
+
};
|
|
22
|
+
this.getSlackChannels = () => {
|
|
23
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/slack/channels`);
|
|
24
|
+
};
|
|
25
|
+
this.postSlackConfiguration = data => {
|
|
26
|
+
if (data.id) {
|
|
27
|
+
return this.patch(`${_constants.urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
28
|
+
}
|
|
29
|
+
return this.post(`${_constants.urls.integrations.configurations.v1}/slack/subscriptions`, data);
|
|
30
|
+
};
|
|
31
|
+
this.deleteSlackConfiguration = data => {
|
|
32
|
+
return this.delete(`${_constants.urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
33
|
+
};
|
|
34
|
+
this.postSlackCode = code => {
|
|
35
|
+
return this.post(`${_constants.urls.integrations.configurations.v1}/slack/applications/registrations`, {
|
|
36
|
+
code
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
this.getEmailConfiguration = () => {
|
|
40
|
+
return this.get(`${_constants.urls.integrations.configurations.v1}/emails`);
|
|
41
|
+
};
|
|
42
|
+
this.postEmailConfiguration = _ref => {
|
|
43
|
+
let {
|
|
44
|
+
eventKey
|
|
45
|
+
} = _ref,
|
|
46
|
+
data = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
47
|
+
return this.post(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`, data);
|
|
48
|
+
};
|
|
49
|
+
this.patchEmailConfiguration = ({
|
|
50
|
+
eventKey,
|
|
51
|
+
enabled
|
|
52
|
+
}) => {
|
|
53
|
+
return this.patch(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`, {
|
|
54
|
+
enabled
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
this.deleteEmailSubscriptions = (eventKey, subscriptionId) => {
|
|
58
|
+
return this.delete(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
59
|
+
};
|
|
60
|
+
this.putEmailSubscriptions = (subscriptionId, eventKey, data) => {
|
|
61
|
+
return this.put(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
62
|
+
};
|
|
63
|
+
this.deleteEmailConfiguration = eventKey => {
|
|
64
|
+
return this.delete(`${_constants.urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
65
|
+
};
|
|
66
|
+
this.getSMSConfiguration = () => {
|
|
67
|
+
return this.get(`${_constants.urls.integrations.configurations.v2}/sms`);
|
|
68
|
+
};
|
|
69
|
+
this.postSMSConfiguration = _ref2 => {
|
|
70
|
+
let {
|
|
71
|
+
eventKey
|
|
72
|
+
} = _ref2,
|
|
73
|
+
data = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
74
|
+
return this.post(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`, data);
|
|
75
|
+
};
|
|
76
|
+
this.patchSMSConfiguration = ({
|
|
77
|
+
eventKey,
|
|
78
|
+
enabled
|
|
79
|
+
}) => {
|
|
80
|
+
return this.patch(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`, {
|
|
81
|
+
enabled
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
this.deleteSMSSubscriptions = (eventKey, subscriptionId) => {
|
|
85
|
+
return this.delete(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
86
|
+
};
|
|
87
|
+
this.putSMSSubscriptions = (subscriptionId, eventKey, data) => {
|
|
88
|
+
return this.put(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
89
|
+
};
|
|
90
|
+
this.deleteSMSConfiguration = eventKey => {
|
|
91
|
+
return this.delete(`${_constants.urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
92
|
+
};
|
|
93
|
+
this.getWebhooksConfigurations = () => {
|
|
94
|
+
return this.get(_constants.urls.webhooks.v1);
|
|
95
|
+
};
|
|
96
|
+
this.postWebhooksConfiguration = data => {
|
|
97
|
+
if (data._id) {
|
|
98
|
+
return this.patch(`${_constants.urls.webhooks.v1}/${data._id}`, data);
|
|
99
|
+
} else {
|
|
100
|
+
return this.post(`${_constants.urls.webhooks.v1}/custom`, data);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
this.deleteWebhooksConfiguration = id => {
|
|
104
|
+
return this.delete(`${_constants.urls.webhooks.v1}/${id}`);
|
|
105
|
+
};
|
|
106
|
+
this.getWebhookLog = (id, offset = 0, limit = 10) => {
|
|
107
|
+
const query = new URLSearchParams({
|
|
108
|
+
id,
|
|
109
|
+
offset: `${offset}`,
|
|
110
|
+
limit: `${limit}`
|
|
111
|
+
});
|
|
112
|
+
return this.get(`${_constants.urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
113
|
+
};
|
|
114
|
+
this.postWebhookTest = data => {
|
|
115
|
+
return this.post(`${_constants.urls.webhooks.v1}/test`, data);
|
|
116
|
+
};
|
|
117
|
+
this.postWebhookRetry = id => {
|
|
118
|
+
return this.post(`${_constants.urls.webhooks.v1}/logs/${id}/retries`);
|
|
119
|
+
};
|
|
120
|
+
this.getCategories = () => {
|
|
121
|
+
return this.get(`${_constants.urls.events.configurations.v1}/categories`);
|
|
122
|
+
};
|
|
123
|
+
this.getChannelMaps = channels => {
|
|
124
|
+
return this.get(_constants.urls.events.configurations.v1, {
|
|
125
|
+
channels
|
|
126
|
+
});
|
|
127
|
+
};
|
|
162
128
|
}
|
|
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
|
-
};
|
|
199
|
-
|
|
200
|
-
exports.getCategories = getCategories;
|
|
201
|
-
|
|
202
|
-
const getChannelMaps = channels => {
|
|
203
|
-
return (0, _fetch.Get)(_constants.urls.events.configurations.v1, {
|
|
204
|
-
channels
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
129
|
|
|
208
|
-
|
|
130
|
+
/** Get Slack configuration */
|
|
131
|
+
}
|
|
132
|
+
exports.ConnectivityApi = ConnectivityApi;
|
|
133
|
+
var _default = new ConnectivityApi('default');
|
|
134
|
+
exports.default = _default;
|