@frontegg/rest-api 3.1.76-alpha.9502349697 → 3.1.76-alpha.9762981322

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 +30 -108
  2. package/ContextHolder/index.js +57 -153
  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 +27 -126
  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 +57 -153
  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 -69
  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 -58
  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
@@ -5,138 +5,146 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.TeamsApi = void 0;
8
+ exports.addUser = addUser;
9
+ exports.changePassword = changePassword;
10
+ exports.createInviteUserLink = createInviteUserLink;
11
+ exports.deleteInviteUserLink = deleteInviteUserLink;
12
+ exports.deleteUser = deleteUser;
13
+ exports.getInviteLinkConfiguration = getInviteLinkConfiguration;
14
+ exports.getInviteUserLink = getInviteUserLink;
15
+ exports.getProfile = getProfile;
16
+ exports.getTemporaryUserConfiguration = getTemporaryUserConfiguration;
17
+ exports.loadAvailablePermissions = loadAvailablePermissions;
18
+ exports.loadAvailableRoles = loadAvailableRoles;
19
+ exports.loadStats = loadStats;
20
+ exports.loadUsers = loadUsers;
21
+ exports.resendActivationLink = resendActivationLink;
22
+ exports.resendInvitationLink = resendInvitationLink;
23
+ exports.resendInvitationLinkToAllTenants = resendInvitationLinkToAllTenants;
24
+ exports.setPermanentUser = setPermanentUser;
25
+ exports.updateInviteUserLink = updateInviteUserLink;
26
+ exports.updateProfile = updateProfile;
27
+ exports.updateProfileImage = updateProfileImage;
28
+ exports.updateUser = updateUser;
29
+ exports.updateUserExpirationTime = updateUserExpirationTime;
9
30
 
10
31
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
32
 
33
+ var _fetch = require("../fetch");
34
+
12
35
  var _constants = require("../constants");
13
36
 
14
- var _BaseApiClient = require("../BaseApiClient");
15
-
16
- class TeamsApi extends _BaseApiClient.BaseApiClient {
17
- constructor(appName) {
18
- super(appName);
19
-
20
- this.getProfile = async params => {
21
- return this.get(`${_constants.urls.identity.users.v2}/me`, params != null ? params : {
22
- addRoles: true
23
- });
24
- };
25
-
26
- this.updateProfile = async body => {
27
- return this.put(`${_constants.urls.identity.users.v2}/me`, body);
28
- };
29
-
30
- this.updateProfileImage = async body => {
31
- return this.put(`${_constants.urls.team.profile.v1}/me/image/v1`, body, {
32
- responseType: 'plain',
33
- contentType: undefined
34
- });
35
- };
36
-
37
- this.changePassword = async body => {
38
- return this.post(`${_constants.urls.identity.users.v1}/passwords/change`, body);
39
- };
40
-
41
- this.loadUsers = async params => {
42
- var _params$sort, _params$sort$0$id, _params$sort2, _params$sort2$, _params$sort3, _params$sort3$;
43
-
44
- const filters = (params.filter || []).reduce((p, n) => (0, _extends2.default)({}, p, {
45
- [n.id]: n.value
46
- }), {});
47
- const sorts = (_params$sort = params.sort) != null && _params$sort.length ? {
48
- sortBy: (_params$sort$0$id = (_params$sort2 = params.sort) == null ? void 0 : (_params$sort2$ = _params$sort2[0]) == null ? void 0 : _params$sort2$.id) != null ? _params$sort$0$id : 'name',
49
- sortDirection: (_params$sort3 = params.sort) != null && (_params$sort3$ = _params$sort3[0]) != null && _params$sort3$.desc ? 'desc' : 'asc'
50
- } : null;
51
- return this.get(_constants.urls.team.members.v1, (0, _extends2.default)({
52
- pageOffset: params.pageOffset,
53
- pageSize: params.pageSize
54
- }, filters, sorts));
55
- };
56
-
57
- this.addUser = async body => {
58
- return this.post(_constants.urls.identity.users.v2, (0, _extends2.default)({}, body, {
59
- provider: 'local'
60
- }));
61
- };
62
-
63
- this.deleteUser = async body => {
64
- return this.delete(`${_constants.urls.team.members.v1}/${body.userId}`);
65
- };
66
-
67
- this.updateUser = async body => {
68
- return this.put(_constants.urls.team.members.v1, body);
69
- };
70
-
71
- this.updateUserExpirationTime = async body => {
72
- const {
73
- userId,
74
- expirationInSeconds
75
- } = body;
76
- return this.put(`${_constants.urls.identity.users.temporary.v1}/${userId}`, {
77
- expirationInSeconds
78
- });
79
- };
80
-
81
- this.setPermanentUser = async userId => {
82
- return this.delete(`${_constants.urls.identity.users.temporary.v1}/${userId}`);
83
- };
84
-
85
- this.getTemporaryUserConfiguration = async () => {
86
- return this.get(_constants.urls.identity.users.temporary.configuration.v1);
87
- };
88
-
89
- this.createInviteUserLink = async body => {
90
- return this.post(_constants.urls.identity.tenants.invites.user.v1, (0, _extends2.default)({}, body));
91
- };
92
-
93
- this.updateInviteUserLink = async body => {
94
- return this.patch(_constants.urls.identity.tenants.invites.user.v1, (0, _extends2.default)({}, body));
95
- };
96
-
97
- this.deleteInviteUserLink = async () => {
98
- return this.delete(_constants.urls.identity.tenants.invites.user.v1);
99
- };
100
-
101
- this.getInviteUserLink = async () => {
102
- return this.get(_constants.urls.identity.tenants.invites.user.v1);
103
- };
104
-
105
- this.getInviteLinkConfiguration = async () => {
106
- return this.get(_constants.urls.identity.tenants.invites.configuration.v1);
107
- };
108
-
109
- this.loadAvailableRoles = async () => {
110
- return this.get(_constants.urls.team.roles.v1);
111
- };
112
-
113
- this.loadAvailablePermissions = async () => {
114
- return this.get(_constants.urls.identity.permissions.v1);
115
- };
116
-
117
- this.loadStats = async () => {
118
- return this.get(`${_constants.urls.team.stats.v1}/members`);
119
- };
120
-
121
- this.resendActivationLink = async body => {
122
- return this.post(`${_constants.urls.team.members.v1}/${body.userId}/resendActivationEmail`, {});
123
- };
124
-
125
- this.resendInvitationLink = async body => {
126
- return this.post(_constants.urls.identity.users.v2, (0, _extends2.default)({}, body, {
127
- provider: 'local'
128
- }));
129
- };
130
-
131
- this.resendInvitationLinkToAllTenants = async body => {
132
- return this.post(_constants.urls.identity.users.invitation.resendAll.v1, (0, _extends2.default)({}, body));
133
- };
134
- }
135
-
136
- }
137
-
138
- exports.TeamsApi = TeamsApi;
139
-
140
- var _default = new TeamsApi('default');
141
-
142
- exports.default = _default;
37
+ async function getProfile(params) {
38
+ return (0, _fetch.Get)(`${_constants.urls.identity.users.v2}/me`, params != null ? params : {
39
+ addRoles: true
40
+ });
41
+ }
42
+
43
+ async function updateProfile(body) {
44
+ return (0, _fetch.Put)(`${_constants.urls.identity.users.v2}/me`, body);
45
+ }
46
+
47
+ async function updateProfileImage(body) {
48
+ return (0, _fetch.Put)(`${_constants.urls.team.profile.v1}/me/image/v1`, body, {
49
+ responseType: 'plain',
50
+ contentType: undefined
51
+ });
52
+ }
53
+
54
+ async function changePassword(body) {
55
+ return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/passwords/change`, body);
56
+ }
57
+
58
+ async function loadUsers(params) {
59
+ var _params$sort, _params$sort$0$id, _params$sort2, _params$sort2$, _params$sort3, _params$sort3$;
60
+
61
+ const filters = (params.filter || []).reduce((p, n) => (0, _extends2.default)({}, p, {
62
+ [n.id]: n.value
63
+ }), {});
64
+ const sorts = (_params$sort = params.sort) != null && _params$sort.length ? {
65
+ sortBy: (_params$sort$0$id = (_params$sort2 = params.sort) == null ? void 0 : (_params$sort2$ = _params$sort2[0]) == null ? void 0 : _params$sort2$.id) != null ? _params$sort$0$id : 'name',
66
+ sortDirection: (_params$sort3 = params.sort) != null && (_params$sort3$ = _params$sort3[0]) != null && _params$sort3$.desc ? 'desc' : 'asc'
67
+ } : null;
68
+ return (0, _fetch.Get)(_constants.urls.team.members.v1, (0, _extends2.default)({
69
+ pageOffset: params.pageOffset,
70
+ pageSize: params.pageSize
71
+ }, filters, sorts));
72
+ }
73
+
74
+ async function addUser(body) {
75
+ return (0, _fetch.Post)(_constants.urls.identity.users.v2, (0, _extends2.default)({}, body, {
76
+ provider: 'local'
77
+ }));
78
+ }
79
+
80
+ async function deleteUser(body) {
81
+ return (0, _fetch.Delete)(`${_constants.urls.team.members.v1}/${body.userId}`);
82
+ }
83
+
84
+ async function updateUser(body) {
85
+ return (0, _fetch.Put)(_constants.urls.team.members.v1, body);
86
+ }
87
+
88
+ async function updateUserExpirationTime(body) {
89
+ const {
90
+ userId,
91
+ expirationInSeconds
92
+ } = body;
93
+ return (0, _fetch.Put)(`${_constants.urls.identity.users.temporary.v1}/${userId}`, {
94
+ expirationInSeconds
95
+ });
96
+ }
97
+
98
+ async function setPermanentUser(userId) {
99
+ return (0, _fetch.Delete)(`${_constants.urls.identity.users.temporary.v1}/${userId}`);
100
+ }
101
+
102
+ async function getTemporaryUserConfiguration() {
103
+ return (0, _fetch.Get)(_constants.urls.identity.users.temporary.configuration.v1);
104
+ }
105
+
106
+ async function createInviteUserLink(body) {
107
+ return (0, _fetch.Post)(_constants.urls.identity.tenants.invites.user.v1, (0, _extends2.default)({}, body));
108
+ }
109
+
110
+ async function updateInviteUserLink(body) {
111
+ return (0, _fetch.Patch)(_constants.urls.identity.tenants.invites.user.v1, (0, _extends2.default)({}, body));
112
+ }
113
+
114
+ async function deleteInviteUserLink() {
115
+ return (0, _fetch.Delete)(_constants.urls.identity.tenants.invites.user.v1);
116
+ }
117
+
118
+ async function getInviteUserLink() {
119
+ return (0, _fetch.Get)(_constants.urls.identity.tenants.invites.user.v1);
120
+ }
121
+
122
+ async function getInviteLinkConfiguration() {
123
+ return (0, _fetch.Get)(_constants.urls.identity.tenants.invites.configuration.v1);
124
+ }
125
+
126
+ async function loadAvailableRoles() {
127
+ return (0, _fetch.Get)(_constants.urls.team.roles.v1);
128
+ }
129
+
130
+ async function loadAvailablePermissions() {
131
+ return (0, _fetch.Get)(_constants.urls.identity.permissions.v1);
132
+ }
133
+
134
+ async function loadStats() {
135
+ return (0, _fetch.Get)(`${_constants.urls.team.stats.v1}/members`);
136
+ }
137
+
138
+ async function resendActivationLink(body) {
139
+ return (0, _fetch.Post)(`${_constants.urls.team.members.v1}/${body.userId}/resendActivationEmail`, {});
140
+ }
141
+
142
+ async function resendInvitationLink(body) {
143
+ return (0, _fetch.Post)(_constants.urls.identity.users.v2, (0, _extends2.default)({}, body, {
144
+ provider: 'local'
145
+ }));
146
+ }
147
+
148
+ async function resendInvitationLinkToAllTenants(body) {
149
+ return (0, _fetch.Post)(_constants.urls.identity.users.invitation.resendAll.v1, (0, _extends2.default)({}, body));
150
+ }
@@ -5,83 +5,78 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.TenantsApi = void 0;
8
+ exports.getHierarchyMetadata = getHierarchyMetadata;
9
+ exports.getParentTenants = getParentTenants;
10
+ exports.getParentTenantsById = getParentTenantsById;
11
+ exports.getSubTenants = getSubTenants;
12
+ exports.getSubTenantsAsTree = getSubTenantsAsTree;
13
+ exports.getTenants = getTenants;
14
+ exports.getTenantsUsersCount = getTenantsUsersCount;
15
+ exports.searchSubTenants = searchSubTenants;
16
+ exports.switchTenant = switchTenant;
9
17
 
10
18
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
19
 
20
+ var _fetch = require("../fetch");
21
+
12
22
  var _constants = require("../constants");
13
23
 
14
24
  var _utils = require("../auth/utils");
15
25
 
16
26
  var _ContextHolder = require("../ContextHolder");
17
27
 
18
- var _BaseApiClient = require("../BaseApiClient");
19
-
20
- class TenantsApi extends _BaseApiClient.BaseApiClient {
21
- constructor(appName) {
22
- super(appName);
23
-
24
- this.switchTenant = async body => {
25
- if (_ContextHolder.ContextHolder.for(this.appName).isSessionPerTenantEnabled()) {
26
- (0, _utils.setTabTenantInSessionStorage)(body.tenantId);
27
- }
28
-
29
- return this.put(`${_constants.urls.identity.users.v1}/tenant`, body);
30
- };
31
-
32
- this.getTenants = async () => {
33
- return this.get(`${_constants.urls.identity.users.v2}/me/tenants`);
34
- };
35
-
36
- this.getSubTenants = async options => {
37
- return this.get(_constants.urls.tenants.hierarchy.v1, undefined, {
38
- headers: this.extractHeadersFromOptions(options)
39
- });
40
- };
41
-
42
- this.getSubTenantsAsTree = async options => {
43
- return this.get(_constants.urls.tenants.hierarchy.tree.v1, undefined, {
44
- headers: this.extractHeadersFromOptions(options)
45
- });
46
- };
47
-
48
- this.getParentTenants = async options => {
49
- return this.get(_constants.urls.tenants.hierarchy.parents.v1, undefined, {
50
- headers: this.extractHeadersFromOptions(options)
51
- });
52
- };
53
-
54
- this.getParentTenantsById = async (tenantId, options) => {
55
- return this.get(`${_constants.urls.tenants.hierarchy.parents.v1}/${tenantId}`, undefined, {
56
- headers: this.extractHeadersFromOptions(options)
57
- });
58
- };
59
-
60
- this.getTenantsUsersCount = async (body, options) => {
61
- return this.post(`${_constants.urls.identity.tenants.users.v1}/count`, body, {
62
- headers: this.extractHeadersFromOptions(options)
63
- });
64
- };
65
-
66
- this.searchSubTenants = async (params, options) => {
67
- return this.get(_constants.urls.tenants.hierarchy.v2, params, {
68
- headers: this.extractHeadersFromOptions(options)
69
- });
70
- };
71
-
72
- this.getHierarchyMetadata = async (params, options) => {
73
- return this.get(_constants.urls.tenants.hierarchy.metadata.v2, (0, _extends2.default)({}, params, {
74
- _tenantIds: params._tenantIds.join(',')
75
- }), {
76
- headers: this.extractHeadersFromOptions(options)
77
- });
78
- };
28
+ async function switchTenant(body) {
29
+ if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
30
+ (0, _utils.setTabTenantInSessionStorage)(body.tenantId);
79
31
  }
80
32
 
33
+ return (0, _fetch.Put)(`${_constants.urls.identity.users.v1}/tenant`, body);
34
+ }
35
+
36
+ async function getTenants() {
37
+ return (0, _fetch.Get)(`${_constants.urls.identity.users.v2}/me/tenants`);
81
38
  }
82
39
 
83
- exports.TenantsApi = TenantsApi;
40
+ async function getSubTenants(options) {
41
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.v1, undefined, {
42
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
43
+ });
44
+ }
84
45
 
85
- var _default = new TenantsApi('default');
46
+ async function getSubTenantsAsTree(options) {
47
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.tree.v1, undefined, {
48
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
49
+ });
50
+ }
51
+
52
+ async function getParentTenants(options) {
53
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.parents.v1, undefined, {
54
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
55
+ });
56
+ }
57
+
58
+ async function getParentTenantsById(tenantId, options) {
59
+ return (0, _fetch.Get)(`${_constants.urls.tenants.hierarchy.parents.v1}/${tenantId}`, undefined, {
60
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
61
+ });
62
+ }
63
+
64
+ async function getTenantsUsersCount(body, options) {
65
+ return (0, _fetch.Post)(`${_constants.urls.identity.tenants.users.v1}/count`, body, {
66
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
67
+ });
68
+ }
69
+
70
+ async function searchSubTenants(params, options) {
71
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.v2, params, {
72
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
73
+ });
74
+ }
86
75
 
87
- exports.default = _default;
76
+ async function getHierarchyMetadata(params, options) {
77
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.metadata.v2, (0, _extends2.default)({}, params, {
78
+ _tenantIds: params._tenantIds.join(',')
79
+ }), {
80
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
81
+ });
82
+ }
@@ -3,45 +3,37 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.PhoneNumbersApi = void 0;
6
+ exports.createPhoneNumber = createPhoneNumber;
7
+ exports.deletePhoneNumber = deletePhoneNumber;
8
+ exports.getUserPhoneNumbers = getUserPhoneNumbers;
9
+ exports.preVerifyPhoneNumber = preVerifyPhoneNumber;
10
+ exports.verifyDeletePhoneNumber = verifyDeletePhoneNumber;
11
+ exports.verifyPhoneNumber = verifyPhoneNumber;
7
12
 
8
13
  var _constants = require("../constants");
9
14
 
10
- var _BaseApiClient = require("../BaseApiClient");
15
+ var _fetch = require("../fetch");
11
16
 
12
- class PhoneNumbersApi extends _BaseApiClient.BaseApiClient {
13
- constructor(appName) {
14
- super(appName);
15
-
16
- this.getUserPhoneNumbers = async queryParams => {
17
- return this.get(`${_constants.urls.identity.phoneNumbers.v1}`, queryParams);
18
- };
19
-
20
- this.createPhoneNumber = async body => {
21
- return this.post(`${_constants.urls.identity.phoneNumbers.v1}`, body);
22
- };
23
-
24
- this.deletePhoneNumber = async phoneId => {
25
- return this.delete(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}`);
26
- };
27
-
28
- this.preVerifyPhoneNumber = async body => {
29
- return this.post(`${_constants.urls.identity.phoneNumbers.v1}/preverify`, body);
30
- };
31
-
32
- this.verifyPhoneNumber = async body => {
33
- return this.post(`${_constants.urls.identity.phoneNumbers.v1}/verify`, body);
34
- };
17
+ async function getUserPhoneNumbers(queryParams) {
18
+ return (0, _fetch.Get)(`${_constants.urls.identity.phoneNumbers.v1}`, queryParams);
19
+ }
35
20
 
36
- this.verifyDeletePhoneNumber = async (phoneId, body) => {
37
- return this.post(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}/delete/verify`, body);
38
- };
39
- }
21
+ async function createPhoneNumber(body) {
22
+ return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}`, body);
23
+ }
40
24
 
25
+ async function deletePhoneNumber(phoneId) {
26
+ return (0, _fetch.Delete)(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}`);
41
27
  }
42
28
 
43
- exports.PhoneNumbersApi = PhoneNumbersApi;
29
+ async function preVerifyPhoneNumber(body) {
30
+ return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}/preverify`, body);
31
+ }
44
32
 
45
- var _default = new PhoneNumbersApi('default');
33
+ async function verifyPhoneNumber(body) {
34
+ return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}/verify`, body);
35
+ }
46
36
 
47
- exports.default = _default;
37
+ async function verifyDeletePhoneNumber(phoneId, body) {
38
+ return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}/delete/verify`, body);
39
+ }
@@ -5,75 +5,70 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.UsersApi = void 0;
8
+ exports.GetUserJwt = GetUserJwt;
9
+ exports.getCurrentUserTenantsV1 = getCurrentUserTenantsV1;
10
+ exports.getCurrentUserTenantsV3 = getCurrentUserTenantsV3;
11
+ exports.getUsersGroups = getUsersGroups;
12
+ exports.getUsersRoles = getUsersRoles;
13
+ exports.getUsersV2 = getUsersV2;
14
+ exports.getUsersV3 = getUsersV3;
15
+ exports.sendResetBreachedPasswordEmails = sendResetBreachedPasswordEmails;
16
+ exports.updateUserProfileV2 = updateUserProfileV2;
9
17
 
10
18
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
19
 
12
- var _constants = require("../constants");
13
-
14
- var _BaseApiClient = require("../BaseApiClient");
15
-
16
- class UsersApi extends _BaseApiClient.BaseApiClient {
17
- constructor(appName) {
18
- super(appName);
19
-
20
- this.GetUserJwt = async body => {
21
- return this.post(`${_constants.urls.identity.users.v3}/me/token`, body);
22
- };
20
+ var _fetch = require("../fetch");
23
21
 
24
- this.getUsersV2 = async (queryParams, options) => {
25
- return this.get(_constants.urls.identity.users.v2, queryParams, {
26
- headers: this.extractHeadersFromOptions(options)
27
- });
28
- };
29
-
30
- this.getUsersV3 = async (queryParams, options) => {
31
- return this.get(_constants.urls.identity.users.v3, queryParams, {
32
- headers: this.extractHeadersFromOptions(options)
33
- });
34
- };
35
-
36
- this.getUsersRoles = async (queryParams, options) => {
37
- return this.get(_constants.urls.identity.users.roles.v3, (0, _extends2.default)({}, queryParams, {
38
- ids: queryParams.ids.join(',')
39
- }), {
40
- headers: this.extractHeadersFromOptions(options)
41
- });
42
- };
22
+ var _constants = require("../constants");
43
23
 
44
- this.getUsersGroups = async (queryParams, options) => {
45
- return this.get(_constants.urls.identity.users.groups.v3, (0, _extends2.default)({}, queryParams, {
46
- ids: queryParams.ids.join(',')
47
- }), {
48
- headers: this.extractHeadersFromOptions(options)
49
- });
50
- };
24
+ async function GetUserJwt(body) {
25
+ return (0, _fetch.Post)(`${_constants.urls.identity.users.v3}/me/token`, body);
26
+ }
51
27
 
52
- this.getCurrentUserTenantsV3 = async options => {
53
- return this.get(_constants.urls.identity.users.tenants.me.v3, undefined, {
54
- headers: this.extractHeadersFromOptions(options)
55
- });
56
- };
28
+ async function getUsersV2(queryParams, options) {
29
+ return (0, _fetch.Get)(_constants.urls.identity.users.v2, queryParams, {
30
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
31
+ });
32
+ }
57
33
 
58
- this.getCurrentUserTenantsV1 = async options => {
59
- return this.get(_constants.urls.identity.users.tenants.me.v1, undefined, {
60
- headers: this.extractHeadersFromOptions(options)
61
- });
62
- };
34
+ async function getUsersV3(queryParams, options) {
35
+ return (0, _fetch.Get)(_constants.urls.identity.users.v3, queryParams, {
36
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
37
+ });
38
+ }
63
39
 
64
- this.sendResetBreachedPasswordEmails = async () => {
65
- return this.post(_constants.urls.identity.users.passwords.resetBreachedPasswords.v1);
66
- };
40
+ async function getUsersRoles(queryParams, options) {
41
+ return (0, _fetch.Get)(_constants.urls.identity.users.roles.v3, (0, _extends2.default)({}, queryParams, {
42
+ ids: queryParams.ids.join(',')
43
+ }), {
44
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
45
+ });
46
+ }
67
47
 
68
- this.updateUserProfileV2 = async body => {
69
- return this.put(`${_constants.urls.identity.users.v2}/me`, body);
70
- };
71
- }
48
+ async function getUsersGroups(queryParams, options) {
49
+ return (0, _fetch.Get)(_constants.urls.identity.users.groups.v3, (0, _extends2.default)({}, queryParams, {
50
+ ids: queryParams.ids.join(",")
51
+ }), {
52
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
53
+ });
54
+ }
72
55
 
56
+ async function getCurrentUserTenantsV3(options) {
57
+ return (0, _fetch.Get)(_constants.urls.identity.users.tenants.me.v3, undefined, {
58
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
59
+ });
73
60
  }
74
61
 
75
- exports.UsersApi = UsersApi;
62
+ async function getCurrentUserTenantsV1(options) {
63
+ return (0, _fetch.Get)(_constants.urls.identity.users.tenants.me.v1, undefined, {
64
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
65
+ });
66
+ }
76
67
 
77
- var _default = new UsersApi('default');
68
+ async function sendResetBreachedPasswordEmails() {
69
+ return (0, _fetch.Post)(_constants.urls.identity.users.passwords.resetBreachedPasswords.v1);
70
+ }
78
71
 
79
- exports.default = _default;
72
+ async function updateUserProfileV2(body) {
73
+ return (0, _fetch.Put)(`${_constants.urls.identity.users.v2}/me`, body);
74
+ }
@@ -3,25 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.VendorApi = void 0;
6
+ exports.getVendorPublicInfo = getVendorPublicInfo;
7
7
 
8
- var _constants = require("../constants");
9
-
10
- var _BaseApiClient = require("../BaseApiClient");
11
-
12
- class VendorApi extends _BaseApiClient.BaseApiClient {
13
- constructor(appName) {
14
- super(appName);
8
+ var _fetch = require("../fetch");
15
9
 
16
- this.getVendorPublicInfo = async () => {
17
- return this.get(`${_constants.urls.vendor}/public`);
18
- };
19
- }
10
+ var _constants = require("../constants");
20
11
 
12
+ async function getVendorPublicInfo() {
13
+ return (0, _fetch.Get)(`${_constants.urls.vendor}/public`);
21
14
  }
22
15
 
23
- exports.VendorApi = VendorApi;
24
-
25
- var _default = new VendorApi('default');
26
-
27
- exports.default = _default;
16
+ ;