@frontegg/rest-api 3.1.74 → 3.1.76-alpha.9502349697
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +39 -0
- package/ContextHolder/index.d.ts +108 -27
- package/ContextHolder/index.js +155 -50
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +308 -0
- package/account-settings/index.d.ts +19 -7
- package/account-settings/index.js +23 -13
- package/applications/index.d.ts +49 -44
- package/applications/index.js +51 -37
- package/audits/index.d.ts +27 -15
- package/audits/index.js +27 -17
- package/auth/index.d.ts +817 -768
- package/auth/index.js +902 -721
- package/auth/secutiry-poilicy/index.d.ts +58 -102
- package/auth/secutiry-poilicy/index.js +122 -90
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +9 -8
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +147 -114
- package/directory/index.d.ts +31 -22
- package/directory/index.js +27 -15
- package/entitlements/index.d.ts +14 -8
- package/entitlements/index.js +12 -4
- package/feature-flags/index.d.ts +8 -2
- package/feature-flags/index.js +16 -8
- package/groups/index.d.ts +73 -49
- package/groups/index.js +64 -45
- package/impersonate/index.d.ts +15 -6
- package/impersonate/index.js +13 -5
- package/index.d.ts +154 -108
- package/index.js +109 -78
- package/interfaces.d.ts +10 -0
- package/metadata/index.d.ts +67 -7
- package/metadata/index.js +52 -32
- package/node/BaseApiClient.js +49 -0
- package/node/ContextHolder/index.js +155 -50
- package/node/FetchClient.js +326 -0
- package/node/account-settings/index.js +27 -16
- package/node/applications/index.js +51 -44
- package/node/audits/index.js +31 -20
- package/node/auth/index.js +768 -1035
- package/node/auth/secutiry-poilicy/index.js +125 -136
- package/node/auth/utils.js +9 -7
- package/node/connectivity/index.js +148 -187
- package/node/directory/index.js +29 -20
- package/node/entitlements/index.js +18 -5
- package/node/feature-flags/index.js +21 -9
- package/node/groups/index.js +65 -63
- package/node/impersonate/index.js +18 -5
- package/node/index.js +116 -71
- package/node/metadata/index.js +61 -52
- package/node/notifications/index.js +37 -27
- package/node/reports/index.js +78 -70
- package/node/roles/index.js +56 -51
- package/node/security-center/index.js +21 -9
- package/node/sub-tenants/index.js +90 -89
- package/node/subscriptions/index.js +69 -107
- package/node/subscriptions/invoices.js +25 -17
- package/node/subscriptions/managedSubscriptions.js +32 -27
- package/node/subscriptions/paymentMethods.js +27 -20
- package/node/subscriptions/paymentProviders.js +15 -6
- package/node/subscriptions/plans.js +17 -9
- package/node/subscriptions/providers/stripe/index.js +26 -21
- package/node/subscriptions/subscriptions.js +32 -27
- package/node/subscriptions/summaries.js +15 -6
- package/node/subscriptions/tenantConfiguration.js +17 -9
- package/node/subscriptions/vendorPublicConfigurations.js +15 -6
- package/node/teams/index.js +130 -138
- package/node/tenants/index.js +65 -60
- package/node/user-phone-numbers/index.js +32 -24
- package/node/users/index.js +58 -53
- package/node/vendor/index.js +17 -6
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +1 -1
- package/reports/index.d.ts +50 -44
- package/reports/index.js +75 -62
- package/roles/index.d.ts +44 -38
- package/roles/index.js +57 -41
- package/security-center/index.d.ts +14 -2
- package/security-center/index.js +15 -6
- package/sub-tenants/index.d.ts +57 -15
- package/sub-tenants/index.js +88 -68
- package/subscriptions/index.d.ts +56 -11
- package/subscriptions/index.js +58 -11
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +24 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +33 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +26 -17
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +11 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +14 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +27 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +33 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +10 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +15 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
- package/subscriptions/vendorPublicConfigurations.js +11 -4
- package/teams/index.d.ts +35 -131
- package/teams/index.js +122 -93
- package/tenants/index.d.ts +25 -37
- package/tenants/index.js +62 -46
- package/tenants/interfaces.d.ts +2 -0
- package/user-phone-numbers/index.d.ts +32 -26
- package/user-phone-numbers/index.js +32 -19
- package/users/index.d.ts +21 -15
- package/users/index.js +60 -44
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +11 -4
- package/fetch.d.ts +0 -24
- package/fetch.js +0 -265
- package/node/fetch.js +0 -306
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
|
@@ -3,32 +3,37 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.createStripePaymentMethodSetupIntentSecret = createStripePaymentMethodSetupIntentSecret;
|
|
8
|
-
exports.createSubscription = createSubscription;
|
|
9
|
-
exports.getStripeCustomer = getStripeCustomer;
|
|
10
|
-
exports.getStripePaymentProviderConfiguration = getStripePaymentProviderConfiguration;
|
|
11
|
-
|
|
12
|
-
var _fetch = require("../../../fetch");
|
|
6
|
+
exports.StripeProviderApi = void 0;
|
|
13
7
|
|
|
14
8
|
var _constants = require("../../../constants");
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
return (0, _fetch.Post)(_constants.urls.subscriptions.billing.paymentProviders.stripe.subscriptions.v1, request);
|
|
18
|
-
}
|
|
10
|
+
var _BaseApiClient = require("../../../BaseApiClient");
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
class StripeProviderApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
23
15
|
|
|
24
|
-
async
|
|
25
|
-
|
|
26
|
-
}
|
|
16
|
+
this.createSubscription = async request => {
|
|
17
|
+
return this.post(_constants.urls.subscriptions.billing.paymentProviders.stripe.subscriptions.v1, request);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getStripeCustomer = async tenantId => {
|
|
21
|
+
return this.get(`${_constants.urls.subscriptions.billing.paymentProviders.stripe.customers.v1}/${tenantId}`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.createStripeCustomer = async request => {
|
|
25
|
+
return this.post(_constants.urls.subscriptions.billing.paymentProviders.stripe.customers.v1, request);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.getStripePaymentProviderConfiguration = async () => {
|
|
29
|
+
return this.get(_constants.urls.subscriptions.billing.paymentProviders.stripe.publicConfigurations.v1);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
this.createStripePaymentMethodSetupIntentSecret = async request => {
|
|
33
|
+
return this.post(_constants.urls.subscriptions.billing.paymentProviders.stripe.setupIntents.v1, request);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
27
36
|
|
|
28
|
-
async function getStripePaymentProviderConfiguration() {
|
|
29
|
-
return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.paymentProviders.stripe.publicConfigurations.v1}`);
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
return (0, _fetch.Post)(`${_constants.urls.subscriptions.billing.paymentProviders.stripe.setupIntents.v1}`, request);
|
|
34
|
-
}
|
|
39
|
+
exports.StripeProviderApi = StripeProviderApi;
|
|
@@ -3,38 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getSubscription = getSubscription;
|
|
8
|
-
exports.getSubscriptions = getSubscriptions;
|
|
9
|
-
exports.renewSubscription = renewSubscription;
|
|
10
|
-
exports.updateSubscription = updateSubscription;
|
|
11
|
-
|
|
12
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.SubscriptionApi = void 0;
|
|
13
7
|
|
|
14
8
|
var _constants = require("../constants");
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
return (0, _fetch.Get)(_constants.urls.subscriptions.billing.subscriptions.v1);
|
|
18
|
-
}
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
class SubscriptionApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
23
15
|
|
|
24
|
-
async
|
|
25
|
-
|
|
26
|
-
}
|
|
16
|
+
this.getSubscriptions = async () => {
|
|
17
|
+
return this.get(_constants.urls.subscriptions.billing.subscriptions.v1);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getSubscription = async subscriptionId => {
|
|
21
|
+
return this.get(`${_constants.urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.cancelSubscription = async subscriptionId => {
|
|
25
|
+
return this.put(`${_constants.urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/cancellations/`, {});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.renewSubscription = async subscriptionId => {
|
|
29
|
+
return this.put(`${_constants.urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
this.updateSubscription = async (subscriptionId, {
|
|
33
|
+
paymentMethodId,
|
|
34
|
+
planId
|
|
35
|
+
}) => {
|
|
36
|
+
return this.put(`${_constants.urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`, {
|
|
37
|
+
paymentMethodId,
|
|
38
|
+
planId
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
27
42
|
|
|
28
|
-
async function renewSubscription(subscriptionId) {
|
|
29
|
-
return (0, _fetch.Put)(`${_constants.urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
30
43
|
}
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
paymentMethodId,
|
|
34
|
-
planId
|
|
35
|
-
}) {
|
|
36
|
-
return (0, _fetch.Put)(`${_constants.urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`, {
|
|
37
|
-
paymentMethodId,
|
|
38
|
-
planId
|
|
39
|
-
});
|
|
40
|
-
}
|
|
45
|
+
exports.SubscriptionApi = SubscriptionApi;
|
|
@@ -3,12 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.SummariesApi = void 0;
|
|
9
7
|
|
|
10
8
|
var _constants = require("../constants");
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class SummariesApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
this.getSubscriptionSummaries = async tenantId => {
|
|
17
|
+
return this.get(`${_constants.urls.subscriptions.billing.summaries.v1}/${tenantId}`);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.SummariesApi = SummariesApi;
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getTenantConfiguration = getTenantConfiguration;
|
|
8
|
-
|
|
9
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.SubscriptionTenantConfigApi = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../constants");
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class SubscriptionTenantConfigApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
this.getTenantConfiguration = async tenantId => {
|
|
17
|
+
return this.get(`${_constants.urls.subscriptions.billing.tenantConfiguration.v1}/${tenantId}`);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.createTenantConfiguration = async request => {
|
|
21
|
+
return this.post(_constants.urls.subscriptions.billing.tenantConfiguration.v1, request);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
return (0, _fetch.Post)(`${_constants.urls.subscriptions.billing.tenantConfiguration.v1}`, request);
|
|
19
|
-
}
|
|
27
|
+
exports.SubscriptionTenantConfigApi = SubscriptionTenantConfigApi;
|
|
@@ -3,12 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.VendorPublicConfigApi = void 0;
|
|
9
7
|
|
|
10
8
|
var _constants = require("../constants");
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class VendorPublicConfigApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
this.getVendorPublicConfigurations = async () => {
|
|
17
|
+
return this.get(_constants.urls.subscriptions.billing.configurations.vendorPublicConfigurations.v1);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.VendorPublicConfigApi = VendorPublicConfigApi;
|
package/node/teams/index.js
CHANGED
|
@@ -5,146 +5,138 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
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;
|
|
8
|
+
exports.default = exports.TeamsApi = void 0;
|
|
30
9
|
|
|
31
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
32
11
|
|
|
33
|
-
var _fetch = require("../fetch");
|
|
34
|
-
|
|
35
12
|
var _constants = require("../constants");
|
|
36
13
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
async
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
async
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
async
|
|
149
|
-
|
|
150
|
-
|
|
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;
|
package/node/tenants/index.js
CHANGED
|
@@ -5,78 +5,83 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
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;
|
|
8
|
+
exports.default = exports.TenantsApi = void 0;
|
|
17
9
|
|
|
18
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
19
11
|
|
|
20
|
-
var _fetch = require("../fetch");
|
|
21
|
-
|
|
22
12
|
var _constants = require("../constants");
|
|
23
13
|
|
|
24
14
|
var _utils = require("../auth/utils");
|
|
25
15
|
|
|
26
16
|
var _ContextHolder = require("../ContextHolder");
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
};
|
|
31
79
|
}
|
|
32
80
|
|
|
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`);
|
|
38
81
|
}
|
|
39
82
|
|
|
40
|
-
|
|
41
|
-
return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.v1, undefined, {
|
|
42
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
43
|
-
});
|
|
44
|
-
}
|
|
83
|
+
exports.TenantsApi = TenantsApi;
|
|
45
84
|
|
|
46
|
-
|
|
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
|
-
}
|
|
85
|
+
var _default = new TenantsApi('default');
|
|
75
86
|
|
|
76
|
-
|
|
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
|
-
}
|
|
87
|
+
exports.default = _default;
|