@frontegg/rest-api 3.1.74-alpha.9437937621 → 3.1.74

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.
Files changed (122) hide show
  1. package/ContextHolder/index.d.ts +27 -108
  2. package/ContextHolder/index.js +50 -155
  3. package/account-settings/index.d.ts +7 -19
  4. package/account-settings/index.js +13 -23
  5. package/applications/index.d.ts +44 -49
  6. package/applications/index.js +37 -51
  7. package/audits/index.d.ts +15 -27
  8. package/audits/index.js +17 -27
  9. package/auth/index.d.ts +768 -817
  10. package/auth/index.js +721 -902
  11. package/auth/secutiry-poilicy/index.d.ts +102 -58
  12. package/auth/secutiry-poilicy/index.js +90 -122
  13. package/auth/utils.d.ts +2 -2
  14. package/auth/utils.js +8 -9
  15. package/connectivity/index.d.ts +26 -125
  16. package/connectivity/index.js +114 -147
  17. package/directory/index.d.ts +22 -31
  18. package/directory/index.js +15 -27
  19. package/entitlements/index.d.ts +8 -14
  20. package/entitlements/index.js +4 -12
  21. package/feature-flags/index.d.ts +2 -8
  22. package/feature-flags/index.js +8 -16
  23. package/fetch.d.ts +24 -0
  24. package/fetch.js +265 -0
  25. package/groups/index.d.ts +49 -73
  26. package/groups/index.js +45 -64
  27. package/impersonate/index.d.ts +6 -15
  28. package/impersonate/index.js +5 -13
  29. package/index.d.ts +108 -154
  30. package/index.js +78 -109
  31. package/interfaces.d.ts +0 -10
  32. package/metadata/index.d.ts +7 -67
  33. package/metadata/index.js +32 -52
  34. package/node/ContextHolder/index.js +50 -155
  35. package/node/account-settings/index.js +16 -27
  36. package/node/applications/index.js +44 -51
  37. package/node/audits/index.js +20 -31
  38. package/node/auth/index.js +1035 -768
  39. package/node/auth/secutiry-poilicy/index.js +136 -125
  40. package/node/auth/utils.js +7 -9
  41. package/node/connectivity/index.js +187 -148
  42. package/node/directory/index.js +20 -29
  43. package/node/entitlements/index.js +5 -18
  44. package/node/feature-flags/index.js +9 -21
  45. package/node/fetch.js +306 -0
  46. package/node/groups/index.js +63 -65
  47. package/node/impersonate/index.js +5 -18
  48. package/node/index.js +71 -116
  49. package/node/metadata/index.js +52 -61
  50. package/node/notifications/index.js +27 -37
  51. package/node/reports/index.js +70 -78
  52. package/node/roles/index.js +51 -56
  53. package/node/security-center/index.js +9 -21
  54. package/node/sub-tenants/index.js +89 -90
  55. package/node/subscriptions/index.js +107 -79
  56. package/node/subscriptions/invoices.js +17 -25
  57. package/node/subscriptions/managedSubscriptions.js +27 -32
  58. package/node/subscriptions/paymentMethods.js +20 -27
  59. package/node/subscriptions/paymentProviders.js +6 -15
  60. package/node/subscriptions/plans.js +9 -17
  61. package/node/subscriptions/providers/index.js +18 -0
  62. package/node/subscriptions/providers/stripe/index.js +21 -26
  63. package/node/subscriptions/subscriptions.js +27 -32
  64. package/node/subscriptions/summaries.js +6 -15
  65. package/node/subscriptions/tenantConfiguration.js +9 -17
  66. package/node/subscriptions/vendorPublicConfigurations.js +6 -15
  67. package/node/teams/index.js +138 -130
  68. package/node/tenants/index.js +60 -65
  69. package/node/user-phone-numbers/index.js +24 -32
  70. package/node/users/index.js +53 -58
  71. package/node/vendor/index.js +6 -17
  72. package/notifications/index.d.ts +16 -22
  73. package/notifications/index.js +22 -33
  74. package/package.json +1 -1
  75. package/reports/index.d.ts +44 -50
  76. package/reports/index.js +62 -75
  77. package/roles/index.d.ts +38 -44
  78. package/roles/index.js +41 -57
  79. package/security-center/index.d.ts +2 -14
  80. package/security-center/index.js +6 -15
  81. package/sub-tenants/index.d.ts +15 -57
  82. package/sub-tenants/index.js +68 -88
  83. package/subscriptions/index.d.ts +11 -56
  84. package/subscriptions/index.js +11 -68
  85. package/subscriptions/invoices.d.ts +13 -16
  86. package/subscriptions/invoices.js +14 -24
  87. package/subscriptions/managedSubscriptions.d.ts +15 -18
  88. package/subscriptions/managedSubscriptions.js +22 -33
  89. package/subscriptions/paymentMethods.d.ts +13 -16
  90. package/subscriptions/paymentMethods.js +17 -26
  91. package/subscriptions/paymentProviders.d.ts +5 -8
  92. package/subscriptions/paymentProviders.js +4 -11
  93. package/subscriptions/plans.d.ts +8 -11
  94. package/subscriptions/plans.js +6 -14
  95. package/subscriptions/providers/index.d.ts +1 -0
  96. package/subscriptions/providers/index.js +1 -0
  97. package/subscriptions/providers/stripe/index.d.ts +21 -24
  98. package/subscriptions/providers/stripe/index.js +16 -27
  99. package/subscriptions/subscriptions.d.ts +21 -24
  100. package/subscriptions/subscriptions.js +22 -33
  101. package/subscriptions/summaries.d.ts +4 -7
  102. package/subscriptions/summaries.js +3 -10
  103. package/subscriptions/tenantConfiguration.d.ts +3 -6
  104. package/subscriptions/tenantConfiguration.js +7 -15
  105. package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
  106. package/subscriptions/vendorPublicConfigurations.js +4 -11
  107. package/teams/index.d.ts +131 -35
  108. package/teams/index.js +93 -122
  109. package/tenants/index.d.ts +37 -25
  110. package/tenants/index.js +46 -62
  111. package/user-phone-numbers/index.d.ts +26 -32
  112. package/user-phone-numbers/index.js +19 -32
  113. package/users/index.d.ts +15 -21
  114. package/users/index.js +44 -60
  115. package/vendor/index.d.ts +6 -12
  116. package/vendor/index.js +4 -11
  117. package/BaseApiClient.d.ts +0 -16
  118. package/BaseApiClient.js +0 -39
  119. package/FetchClient.d.ts +0 -42
  120. package/FetchClient.js +0 -308
  121. package/node/BaseApiClient.js +0 -49
  122. package/node/FetchClient.js +0 -326
@@ -3,137 +3,148 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.SecurityPolicyApi = void 0;
6
+ exports.bulkCreateIPRestriction = bulkCreateIPRestriction;
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");
7
33
 
8
34
  var _constants = require("../../constants");
9
35
 
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
- };
36
+ async function getGlobalSecurityPolicy() {
37
+ return (0, _fetch.Get)(_constants.urls.identity.configurations.v1);
38
+ }
39
+
40
+ async function getMfaPolicy() {
41
+ return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/mfa-policy`);
42
+ }
43
+
44
+ async function getVendorMfaPolicy() {
45
+ return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/mfa-policy/vendor`);
46
+ }
47
+
48
+ async function saveMfaPolicy(body) {
49
+ if (body.id) {
50
+ return (0, _fetch.Patch)(`${_constants.urls.identity.configurations.v1}/mfa-policy`, body);
51
+ } else {
52
+ return (0, _fetch.Post)(`${_constants.urls.identity.configurations.v1}/mfa-policy`, body);
53
+ }
54
+ }
55
+
56
+ async function getLockoutPolicy() {
57
+ return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/lockout-policy`);
58
+ }
59
+
60
+ async function getVendorLockoutPolicy() {
61
+ return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/lockout-policy/vendor`);
62
+ }
63
+
64
+ async function saveLockoutPolicy(body) {
65
+ if (body.id) {
66
+ return (0, _fetch.Patch)(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
67
+ } else {
68
+ return (0, _fetch.Post)(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
69
+ }
70
+ }
71
+
72
+ async function getCaptchaPolicy() {
73
+ try {
74
+ return await (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/captcha-policy/public`);
75
+ } catch {
76
+ return null;
77
+ }
78
+ }
79
+
80
+ async function getPasswordHistoryPolicy() {
81
+ return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password-history-policy`);
82
+ }
83
+
84
+ async function getVendorPasswordHistoryPolicy() {
85
+ return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password-history-policy/vendor`);
86
+ }
87
+
88
+ async function savePasswordHistoryPolicy(body) {
89
+ if (body.id) {
90
+ return (0, _fetch.Patch)(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
91
+ } else {
92
+ return (0, _fetch.Post)(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
131
93
  }
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
+ }
132
111
 
112
+ async function updateDomainRestrictionConfig(body) {
113
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`, body);
133
114
  }
134
115
 
135
- exports.SecurityPolicyApi = SecurityPolicyApi;
116
+ async function deleteDomainRestriction(id) {
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
+ }
136
123
 
137
- var _default = new SecurityPolicyApi('default');
124
+ async function getIPRestrictionsConfig() {
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
+ }
138
147
 
139
- exports.default = _default;
148
+ async function testCurrentIpInAllowList() {
149
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/verify/allow`);
150
+ }
@@ -39,22 +39,20 @@ function removeTabTenantFromSessionStorage() {
39
39
  sessionStorage.removeItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
40
40
  }
41
41
 
42
- function getTabTenantFromSessionStorage(appName) {
43
- if (!_ContextHolder.ContextHolder.for(appName).isSessionPerTenantEnabled()) {
42
+ function getTabTenantFromSessionStorage() {
43
+ if (!_ContextHolder.ContextHolder.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(appName) {
51
- const usersApi = new _users.UsersApi(appName);
50
+ function getCurrentUserTenantsFunction() {
51
+ const [useCurrentUserTenantsV1] = _featureFlags.FeatureFlags.getFeatureFlags([_constants.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], _ContextHolder.ContextHolder.getAppName() || '');
52
52
 
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;
53
+ if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
54
+ return _users.getCurrentUserTenantsV1;
57
55
  }
58
56
 
59
- return useCurrentUserTenantsV1 ? usersApi.getCurrentUserTenantsV1 : usersApi.getCurrentUserTenantsV3;
57
+ return useCurrentUserTenantsV1 ? _users.getCurrentUserTenantsV1 : _users.getCurrentUserTenantsV3;
60
58
  }
@@ -5,165 +5,204 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.ConnectivityApi = void 0;
8
+ exports.putSMSSubscriptions = exports.putEmailSubscriptions = exports.postWebhooksConfiguration = exports.postWebhookTest = exports.postWebhookRetry = exports.postSlackConfiguration = exports.postSlackCode = exports.postSMSConfiguration = exports.postEmailConfiguration = exports.patchSMSConfiguration = exports.patchEmailConfiguration = exports.getWebhooksConfigurations = exports.getWebhookLog = exports.getSlackScope = exports.getSlackConfiguration = exports.getSlackChannels = exports.getSMSConfiguration = exports.getEmailConfiguration = exports.getChannelMaps = exports.getCategories = exports.deleteWebhooksConfiguration = exports.deleteSlackConfiguration = exports.deleteSMSSubscriptions = exports.deleteSMSConfiguration = exports.deleteEmailSubscriptions = exports.deleteEmailConfiguration = 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 _BaseApiClient = require("../BaseApiClient");
14
+ var _fetch = require("../fetch");
15
15
 
16
16
  const _excluded = ["eventKey"],
17
17
  _excluded2 = ["eventKey"];
18
18
 
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
- };
19
+ const getSlackConfiguration = () => {
20
+ return (0, _fetch.Get)(`${_constants.urls.integrations.configurations.v1}/slack`);
21
+ };
22
+
23
+ exports.getSlackConfiguration = getSlackConfiguration;
24
+
25
+ const getSlackScope = () => {
26
+ return (0, _fetch.Get)(`${_constants.urls.integrations.configurations.v1}/slack/applications`);
27
+ };
28
+
29
+ exports.getSlackScope = getSlackScope;
30
+
31
+ const getSlackChannels = () => {
32
+ return (0, _fetch.Get)(`${_constants.urls.integrations.configurations.v1}/slack/channels`);
33
+ };
34
+
35
+ exports.getSlackChannels = getSlackChannels;
36
+
37
+ const postSlackConfiguration = data => {
38
+ if (data.id) {
39
+ return (0, _fetch.Patch)(`${_constants.urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
161
40
  }
162
41
 
163
- }
42
+ return (0, _fetch.Post)(`${_constants.urls.integrations.configurations.v1}/slack/subscriptions`, data);
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
+ };
164
199
 
165
- exports.ConnectivityApi = ConnectivityApi;
200
+ exports.getCategories = getCategories;
166
201
 
167
- var _default = new ConnectivityApi('default');
202
+ const getChannelMaps = channels => {
203
+ return (0, _fetch.Get)(_constants.urls.events.configurations.v1, {
204
+ channels
205
+ });
206
+ };
168
207
 
169
- exports.default = _default;
208
+ exports.getChannelMaps = getChannelMaps;