@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.
Files changed (123) hide show
  1. package/BaseApiClient.d.ts +16 -0
  2. package/BaseApiClient.js +39 -0
  3. package/ContextHolder/index.d.ts +108 -27
  4. package/ContextHolder/index.js +155 -50
  5. package/FetchClient.d.ts +42 -0
  6. package/FetchClient.js +308 -0
  7. package/account-settings/index.d.ts +19 -7
  8. package/account-settings/index.js +23 -13
  9. package/applications/index.d.ts +49 -44
  10. package/applications/index.js +51 -37
  11. package/audits/index.d.ts +27 -15
  12. package/audits/index.js +27 -17
  13. package/auth/index.d.ts +817 -768
  14. package/auth/index.js +902 -721
  15. package/auth/secutiry-poilicy/index.d.ts +58 -102
  16. package/auth/secutiry-poilicy/index.js +122 -90
  17. package/auth/utils.d.ts +2 -2
  18. package/auth/utils.js +9 -8
  19. package/connectivity/index.d.ts +126 -27
  20. package/connectivity/index.js +147 -114
  21. package/directory/index.d.ts +31 -22
  22. package/directory/index.js +27 -15
  23. package/entitlements/index.d.ts +14 -8
  24. package/entitlements/index.js +12 -4
  25. package/feature-flags/index.d.ts +8 -2
  26. package/feature-flags/index.js +16 -8
  27. package/groups/index.d.ts +73 -49
  28. package/groups/index.js +64 -45
  29. package/impersonate/index.d.ts +15 -6
  30. package/impersonate/index.js +13 -5
  31. package/index.d.ts +154 -108
  32. package/index.js +109 -78
  33. package/interfaces.d.ts +10 -0
  34. package/metadata/index.d.ts +67 -7
  35. package/metadata/index.js +52 -32
  36. package/node/BaseApiClient.js +49 -0
  37. package/node/ContextHolder/index.js +155 -50
  38. package/node/FetchClient.js +326 -0
  39. package/node/account-settings/index.js +27 -16
  40. package/node/applications/index.js +51 -44
  41. package/node/audits/index.js +31 -20
  42. package/node/auth/index.js +768 -1035
  43. package/node/auth/secutiry-poilicy/index.js +125 -136
  44. package/node/auth/utils.js +9 -7
  45. package/node/connectivity/index.js +148 -187
  46. package/node/directory/index.js +29 -20
  47. package/node/entitlements/index.js +18 -5
  48. package/node/feature-flags/index.js +21 -9
  49. package/node/groups/index.js +65 -63
  50. package/node/impersonate/index.js +18 -5
  51. package/node/index.js +116 -71
  52. package/node/metadata/index.js +61 -52
  53. package/node/notifications/index.js +37 -27
  54. package/node/reports/index.js +78 -70
  55. package/node/roles/index.js +56 -51
  56. package/node/security-center/index.js +21 -9
  57. package/node/sub-tenants/index.js +90 -89
  58. package/node/subscriptions/index.js +69 -107
  59. package/node/subscriptions/invoices.js +25 -17
  60. package/node/subscriptions/managedSubscriptions.js +32 -27
  61. package/node/subscriptions/paymentMethods.js +27 -20
  62. package/node/subscriptions/paymentProviders.js +15 -6
  63. package/node/subscriptions/plans.js +17 -9
  64. package/node/subscriptions/providers/stripe/index.js +26 -21
  65. package/node/subscriptions/subscriptions.js +32 -27
  66. package/node/subscriptions/summaries.js +15 -6
  67. package/node/subscriptions/tenantConfiguration.js +17 -9
  68. package/node/subscriptions/vendorPublicConfigurations.js +15 -6
  69. package/node/teams/index.js +130 -138
  70. package/node/tenants/index.js +65 -60
  71. package/node/user-phone-numbers/index.js +32 -24
  72. package/node/users/index.js +58 -53
  73. package/node/vendor/index.js +17 -6
  74. package/notifications/index.d.ts +22 -16
  75. package/notifications/index.js +33 -22
  76. package/package.json +1 -1
  77. package/reports/index.d.ts +50 -44
  78. package/reports/index.js +75 -62
  79. package/roles/index.d.ts +44 -38
  80. package/roles/index.js +57 -41
  81. package/security-center/index.d.ts +14 -2
  82. package/security-center/index.js +15 -6
  83. package/sub-tenants/index.d.ts +57 -15
  84. package/sub-tenants/index.js +88 -68
  85. package/subscriptions/index.d.ts +56 -11
  86. package/subscriptions/index.js +58 -11
  87. package/subscriptions/invoices.d.ts +16 -13
  88. package/subscriptions/invoices.js +24 -14
  89. package/subscriptions/managedSubscriptions.d.ts +18 -15
  90. package/subscriptions/managedSubscriptions.js +33 -22
  91. package/subscriptions/paymentMethods.d.ts +16 -13
  92. package/subscriptions/paymentMethods.js +26 -17
  93. package/subscriptions/paymentProviders.d.ts +8 -5
  94. package/subscriptions/paymentProviders.js +11 -4
  95. package/subscriptions/plans.d.ts +11 -8
  96. package/subscriptions/plans.js +14 -6
  97. package/subscriptions/providers/stripe/index.d.ts +24 -21
  98. package/subscriptions/providers/stripe/index.js +27 -16
  99. package/subscriptions/subscriptions.d.ts +24 -21
  100. package/subscriptions/subscriptions.js +33 -22
  101. package/subscriptions/summaries.d.ts +7 -4
  102. package/subscriptions/summaries.js +10 -3
  103. package/subscriptions/tenantConfiguration.d.ts +6 -3
  104. package/subscriptions/tenantConfiguration.js +15 -7
  105. package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
  106. package/subscriptions/vendorPublicConfigurations.js +11 -4
  107. package/teams/index.d.ts +35 -131
  108. package/teams/index.js +122 -93
  109. package/tenants/index.d.ts +25 -37
  110. package/tenants/index.js +62 -46
  111. package/tenants/interfaces.d.ts +2 -0
  112. package/user-phone-numbers/index.d.ts +32 -26
  113. package/user-phone-numbers/index.js +32 -19
  114. package/users/index.d.ts +21 -15
  115. package/users/index.js +60 -44
  116. package/vendor/index.d.ts +12 -6
  117. package/vendor/index.js +11 -4
  118. package/fetch.d.ts +0 -24
  119. package/fetch.js +0 -265
  120. package/node/fetch.js +0 -306
  121. package/node/subscriptions/providers/index.js +0 -18
  122. package/subscriptions/providers/index.d.ts +0 -1
  123. 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.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");
6
+ exports.default = exports.SecurityPolicyApi = void 0;
33
7
 
34
8
  var _constants = require("../../constants");
35
9
 
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);
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
- 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
- }
135
+ exports.SecurityPolicyApi = SecurityPolicyApi;
123
136
 
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
- }
137
+ var _default = new SecurityPolicyApi('default');
147
138
 
148
- async function testCurrentIpInAllowList() {
149
- return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/verify/allow`);
150
- }
139
+ exports.default = _default;
@@ -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 [useCurrentUserTenantsV1] = _featureFlags.FeatureFlags.getFeatureFlags([_constants.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], _ContextHolder.ContextHolder.getAppName() || '');
50
+ function getCurrentUserTenantsFunction(appName) {
51
+ const usersApi = new _users.UsersApi(appName);
52
52
 
53
- if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
54
- return _users.getCurrentUserTenantsV1;
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 ? _users.getCurrentUserTenantsV1 : _users.getCurrentUserTenantsV3;
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.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;
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 _fetch = require("../fetch");
14
+ var _BaseApiClient = require("../BaseApiClient");
15
15
 
16
16
  const _excluded = ["eventKey"],
17
17
  _excluded2 = ["eventKey"];
18
18
 
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);
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
- 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
- };
163
+ }
199
164
 
200
- exports.getCategories = getCategories;
165
+ exports.ConnectivityApi = ConnectivityApi;
201
166
 
202
- const getChannelMaps = channels => {
203
- return (0, _fetch.Get)(_constants.urls.events.configurations.v1, {
204
- channels
205
- });
206
- };
167
+ var _default = new ConnectivityApi('default');
207
168
 
208
- exports.getChannelMaps = getChannelMaps;
169
+ exports.default = _default;