@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.
- package/ContextHolder/index.d.ts +30 -108
- package/ContextHolder/index.js +57 -153
- package/account-settings/index.d.ts +7 -19
- package/account-settings/index.js +13 -23
- package/applications/index.d.ts +44 -49
- package/applications/index.js +37 -51
- package/audits/index.d.ts +15 -27
- package/audits/index.js +17 -27
- package/auth/index.d.ts +768 -817
- package/auth/index.js +721 -902
- package/auth/secutiry-poilicy/index.d.ts +102 -58
- package/auth/secutiry-poilicy/index.js +90 -122
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +8 -9
- package/connectivity/index.d.ts +27 -126
- package/connectivity/index.js +114 -147
- package/directory/index.d.ts +22 -31
- package/directory/index.js +15 -27
- package/entitlements/index.d.ts +8 -14
- package/entitlements/index.js +4 -12
- package/feature-flags/index.d.ts +2 -8
- package/feature-flags/index.js +8 -16
- package/fetch.d.ts +24 -0
- package/fetch.js +265 -0
- package/groups/index.d.ts +49 -73
- package/groups/index.js +45 -64
- package/impersonate/index.d.ts +6 -15
- package/impersonate/index.js +5 -13
- package/index.d.ts +108 -154
- package/index.js +78 -109
- package/interfaces.d.ts +0 -10
- package/metadata/index.d.ts +7 -67
- package/metadata/index.js +32 -52
- package/node/ContextHolder/index.js +57 -153
- package/node/account-settings/index.js +16 -27
- package/node/applications/index.js +44 -51
- package/node/audits/index.js +20 -31
- package/node/auth/index.js +1035 -768
- package/node/auth/secutiry-poilicy/index.js +136 -125
- package/node/auth/utils.js +7 -9
- package/node/connectivity/index.js +187 -148
- package/node/directory/index.js +20 -29
- package/node/entitlements/index.js +5 -18
- package/node/feature-flags/index.js +9 -21
- package/node/fetch.js +306 -0
- package/node/groups/index.js +63 -65
- package/node/impersonate/index.js +5 -18
- package/node/index.js +71 -116
- package/node/metadata/index.js +52 -61
- package/node/notifications/index.js +27 -37
- package/node/reports/index.js +70 -78
- package/node/roles/index.js +51 -56
- package/node/security-center/index.js +9 -21
- package/node/sub-tenants/index.js +89 -90
- package/node/subscriptions/index.js +107 -69
- package/node/subscriptions/invoices.js +17 -25
- package/node/subscriptions/managedSubscriptions.js +27 -32
- package/node/subscriptions/paymentMethods.js +20 -27
- package/node/subscriptions/paymentProviders.js +6 -15
- package/node/subscriptions/plans.js +9 -17
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +21 -26
- package/node/subscriptions/subscriptions.js +27 -32
- package/node/subscriptions/summaries.js +6 -15
- package/node/subscriptions/tenantConfiguration.js +9 -17
- package/node/subscriptions/vendorPublicConfigurations.js +6 -15
- package/node/teams/index.js +138 -130
- package/node/tenants/index.js +60 -65
- package/node/user-phone-numbers/index.js +24 -32
- package/node/users/index.js +53 -58
- package/node/vendor/index.js +6 -17
- package/notifications/index.d.ts +16 -22
- package/notifications/index.js +22 -33
- package/package.json +1 -1
- package/reports/index.d.ts +44 -50
- package/reports/index.js +62 -75
- package/roles/index.d.ts +38 -44
- package/roles/index.js +41 -57
- package/security-center/index.d.ts +2 -14
- package/security-center/index.js +6 -15
- package/sub-tenants/index.d.ts +15 -57
- package/sub-tenants/index.js +68 -88
- package/subscriptions/index.d.ts +11 -56
- package/subscriptions/index.js +11 -58
- package/subscriptions/invoices.d.ts +13 -16
- package/subscriptions/invoices.js +14 -24
- package/subscriptions/managedSubscriptions.d.ts +15 -18
- package/subscriptions/managedSubscriptions.js +22 -33
- package/subscriptions/paymentMethods.d.ts +13 -16
- package/subscriptions/paymentMethods.js +17 -26
- package/subscriptions/paymentProviders.d.ts +5 -8
- package/subscriptions/paymentProviders.js +4 -11
- package/subscriptions/plans.d.ts +8 -11
- package/subscriptions/plans.js +6 -14
- package/subscriptions/providers/index.d.ts +1 -0
- package/subscriptions/providers/index.js +1 -0
- package/subscriptions/providers/stripe/index.d.ts +21 -24
- package/subscriptions/providers/stripe/index.js +16 -27
- package/subscriptions/subscriptions.d.ts +21 -24
- package/subscriptions/subscriptions.js +22 -33
- package/subscriptions/summaries.d.ts +4 -7
- package/subscriptions/summaries.js +3 -10
- package/subscriptions/tenantConfiguration.d.ts +3 -6
- package/subscriptions/tenantConfiguration.js +7 -15
- package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
- package/subscriptions/vendorPublicConfigurations.js +4 -11
- package/teams/index.d.ts +131 -35
- package/teams/index.js +93 -122
- package/tenants/index.d.ts +37 -25
- package/tenants/index.js +46 -62
- package/user-phone-numbers/index.d.ts +26 -32
- package/user-phone-numbers/index.js +19 -32
- package/users/index.d.ts +15 -21
- package/users/index.js +44 -60
- package/vendor/index.d.ts +6 -12
- package/vendor/index.js +4 -11
- package/BaseApiClient.d.ts +0 -16
- package/BaseApiClient.js +0 -39
- package/FetchClient.d.ts +0 -42
- package/FetchClient.js +0 -308
- package/node/BaseApiClient.js +0 -49
- package/node/FetchClient.js +0 -326
package/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Frontegg v3.1.76-alpha.
|
|
1
|
+
/** @license Frontegg v3.1.76-alpha.9762981322
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
});
|
|
11
11
|
var _exportNames = {
|
|
12
12
|
api: true,
|
|
13
|
-
createApiClient: true,
|
|
14
13
|
AuthStrategyEnum: true,
|
|
15
14
|
MachineToMachineAuthStrategy: true,
|
|
16
15
|
SocialLoginProviders: true,
|
|
@@ -19,20 +18,19 @@ var _exportNames = {
|
|
|
19
18
|
removeTabTenantFromSessionStorage: true,
|
|
20
19
|
getCurrentUserTenantsFunction: true,
|
|
21
20
|
FRONTEGG_SEPARATE_TABS_BY_TENANT: true,
|
|
21
|
+
fetch: true,
|
|
22
22
|
ISubscriptionCancellationPolicy: true,
|
|
23
23
|
ISubscriptionStatus: true,
|
|
24
24
|
PaymentMethodType: true,
|
|
25
25
|
ProviderType: true,
|
|
26
26
|
FronteggApiError: true,
|
|
27
|
-
fetch: true,
|
|
28
|
-
FetchClient: true,
|
|
29
27
|
ContextHolder: true,
|
|
30
28
|
FronteggContext: true
|
|
31
29
|
};
|
|
32
30
|
Object.defineProperty(exports, "AuthStrategyEnum", {
|
|
33
31
|
enumerable: true,
|
|
34
32
|
get: function () {
|
|
35
|
-
return
|
|
33
|
+
return auth.AuthStrategyEnum;
|
|
36
34
|
}
|
|
37
35
|
});
|
|
38
36
|
Object.defineProperty(exports, "ContextHolder", {
|
|
@@ -44,13 +42,7 @@ Object.defineProperty(exports, "ContextHolder", {
|
|
|
44
42
|
Object.defineProperty(exports, "FRONTEGG_SEPARATE_TABS_BY_TENANT", {
|
|
45
43
|
enumerable: true,
|
|
46
44
|
get: function () {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(exports, "FetchClient", {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
get: function () {
|
|
53
|
-
return _FetchClient.FetchClient;
|
|
45
|
+
return auth.FRONTEGG_SEPARATE_TABS_BY_TENANT;
|
|
54
46
|
}
|
|
55
47
|
});
|
|
56
48
|
Object.defineProperty(exports, "FronteggApiError", {
|
|
@@ -68,122 +60,116 @@ Object.defineProperty(exports, "FronteggContext", {
|
|
|
68
60
|
Object.defineProperty(exports, "ISubscriptionCancellationPolicy", {
|
|
69
61
|
enumerable: true,
|
|
70
62
|
get: function () {
|
|
71
|
-
return
|
|
63
|
+
return subscriptions.ISubscriptionCancellationPolicy;
|
|
72
64
|
}
|
|
73
65
|
});
|
|
74
66
|
Object.defineProperty(exports, "ISubscriptionStatus", {
|
|
75
67
|
enumerable: true,
|
|
76
68
|
get: function () {
|
|
77
|
-
return
|
|
69
|
+
return subscriptions.ISubscriptionStatus;
|
|
78
70
|
}
|
|
79
71
|
});
|
|
80
72
|
Object.defineProperty(exports, "MachineToMachineAuthStrategy", {
|
|
81
73
|
enumerable: true,
|
|
82
74
|
get: function () {
|
|
83
|
-
return
|
|
75
|
+
return auth.MachineToMachineAuthStrategy;
|
|
84
76
|
}
|
|
85
77
|
});
|
|
86
78
|
Object.defineProperty(exports, "PaymentMethodType", {
|
|
87
79
|
enumerable: true,
|
|
88
80
|
get: function () {
|
|
89
|
-
return
|
|
81
|
+
return subscriptions.PaymentMethodType;
|
|
90
82
|
}
|
|
91
83
|
});
|
|
92
84
|
Object.defineProperty(exports, "ProviderType", {
|
|
93
85
|
enumerable: true,
|
|
94
86
|
get: function () {
|
|
95
|
-
return
|
|
87
|
+
return subscriptions.ProviderType;
|
|
96
88
|
}
|
|
97
89
|
});
|
|
98
90
|
Object.defineProperty(exports, "SocialLoginProviders", {
|
|
99
91
|
enumerable: true,
|
|
100
92
|
get: function () {
|
|
101
|
-
return
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
exports.default = exports.createApiClient = exports.api = void 0;
|
|
105
|
-
Object.defineProperty(exports, "fetch", {
|
|
106
|
-
enumerable: true,
|
|
107
|
-
get: function () {
|
|
108
|
-
return _FetchClient.default;
|
|
93
|
+
return auth.SocialLoginProviders;
|
|
109
94
|
}
|
|
110
95
|
});
|
|
96
|
+
exports.fetch = exports.default = exports.api = void 0;
|
|
111
97
|
Object.defineProperty(exports, "getCurrentUserTenantsFunction", {
|
|
112
98
|
enumerable: true,
|
|
113
99
|
get: function () {
|
|
114
|
-
return
|
|
100
|
+
return auth.getCurrentUserTenantsFunction;
|
|
115
101
|
}
|
|
116
102
|
});
|
|
117
103
|
Object.defineProperty(exports, "getTabTenantFromSessionStorage", {
|
|
118
104
|
enumerable: true,
|
|
119
105
|
get: function () {
|
|
120
|
-
return
|
|
106
|
+
return auth.getTabTenantFromSessionStorage;
|
|
121
107
|
}
|
|
122
108
|
});
|
|
123
109
|
Object.defineProperty(exports, "removeTabTenantFromSessionStorage", {
|
|
124
110
|
enumerable: true,
|
|
125
111
|
get: function () {
|
|
126
|
-
return
|
|
112
|
+
return auth.removeTabTenantFromSessionStorage;
|
|
127
113
|
}
|
|
128
114
|
});
|
|
129
115
|
Object.defineProperty(exports, "setTabTenantInSessionStorage", {
|
|
130
116
|
enumerable: true,
|
|
131
117
|
get: function () {
|
|
132
|
-
return
|
|
118
|
+
return auth.setTabTenantInSessionStorage;
|
|
133
119
|
}
|
|
134
120
|
});
|
|
135
121
|
|
|
136
|
-
var
|
|
122
|
+
var auth = _interopRequireWildcard(require("./auth"));
|
|
137
123
|
|
|
138
|
-
var
|
|
124
|
+
var teams = _interopRequireWildcard(require("./teams"));
|
|
139
125
|
|
|
140
|
-
var
|
|
126
|
+
var metadata = _interopRequireWildcard(require("./metadata"));
|
|
141
127
|
|
|
142
|
-
var
|
|
128
|
+
var reports = _interopRequireWildcard(require("./reports"));
|
|
143
129
|
|
|
144
|
-
var
|
|
130
|
+
var notifications = _interopRequireWildcard(require("./notifications"));
|
|
145
131
|
|
|
146
|
-
var
|
|
132
|
+
var audits = _interopRequireWildcard(require("./audits"));
|
|
147
133
|
|
|
148
|
-
var
|
|
134
|
+
var fetch = _interopRequireWildcard(require("./fetch"));
|
|
149
135
|
|
|
150
|
-
|
|
136
|
+
exports.fetch = fetch;
|
|
151
137
|
|
|
152
|
-
var
|
|
138
|
+
var connectivity = _interopRequireWildcard(require("./connectivity"));
|
|
153
139
|
|
|
154
|
-
var
|
|
140
|
+
var tenants = _interopRequireWildcard(require("./tenants"));
|
|
155
141
|
|
|
156
|
-
var
|
|
142
|
+
var accountSettings = _interopRequireWildcard(require("./account-settings"));
|
|
157
143
|
|
|
158
|
-
var
|
|
144
|
+
var roles = _interopRequireWildcard(require("./roles"));
|
|
159
145
|
|
|
160
|
-
var
|
|
146
|
+
var subscriptions = _interopRequireWildcard(require("./subscriptions"));
|
|
161
147
|
|
|
162
|
-
var
|
|
148
|
+
var applications = _interopRequireWildcard(require("./applications"));
|
|
163
149
|
|
|
164
|
-
var
|
|
150
|
+
var _error = require("./error");
|
|
165
151
|
|
|
166
|
-
var
|
|
152
|
+
var vendor = _interopRequireWildcard(require("./vendor"));
|
|
167
153
|
|
|
168
|
-
var
|
|
154
|
+
var subTenants = _interopRequireWildcard(require("./sub-tenants"));
|
|
169
155
|
|
|
170
|
-
var
|
|
156
|
+
var featureFlags = _interopRequireWildcard(require("./feature-flags"));
|
|
171
157
|
|
|
172
|
-
var
|
|
158
|
+
var directory = _interopRequireWildcard(require("./directory"));
|
|
173
159
|
|
|
174
|
-
var
|
|
160
|
+
var impersonate = _interopRequireWildcard(require("./impersonate"));
|
|
175
161
|
|
|
176
|
-
var
|
|
162
|
+
var groups = _interopRequireWildcard(require("./groups"));
|
|
177
163
|
|
|
178
|
-
var
|
|
164
|
+
var users = _interopRequireWildcard(require("./users"));
|
|
179
165
|
|
|
180
|
-
var
|
|
166
|
+
var entitlements = _interopRequireWildcard(require("./entitlements"));
|
|
181
167
|
|
|
182
|
-
var
|
|
168
|
+
var securityCenter = _interopRequireWildcard(require("./security-center"));
|
|
183
169
|
|
|
184
|
-
var
|
|
170
|
+
var userPhoneNumbers = _interopRequireWildcard(require("./user-phone-numbers"));
|
|
185
171
|
|
|
186
|
-
var
|
|
172
|
+
var _ContextHolder = require("./ContextHolder");
|
|
187
173
|
|
|
188
174
|
var _interfaces = require("./interfaces");
|
|
189
175
|
|
|
@@ -568,73 +554,42 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
568
554
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
569
555
|
|
|
570
556
|
const api = {
|
|
571
|
-
auth
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
applications: _applications.default
|
|
557
|
+
auth,
|
|
558
|
+
teams,
|
|
559
|
+
metadata,
|
|
560
|
+
reports,
|
|
561
|
+
connectivity,
|
|
562
|
+
notifications,
|
|
563
|
+
audits,
|
|
564
|
+
tenants,
|
|
565
|
+
accountSettings,
|
|
566
|
+
roles,
|
|
567
|
+
subscriptions,
|
|
568
|
+
vendor,
|
|
569
|
+
subTenants,
|
|
570
|
+
featureFlags,
|
|
571
|
+
directory,
|
|
572
|
+
impersonate,
|
|
573
|
+
groups,
|
|
574
|
+
users,
|
|
575
|
+
entitlements,
|
|
576
|
+
securityCenter,
|
|
577
|
+
userPhoneNumbers,
|
|
578
|
+
applications
|
|
594
579
|
};
|
|
595
580
|
exports.api = api;
|
|
596
|
-
|
|
597
|
-
const createApiClient = appName => ({
|
|
598
|
-
auth: new _auth.AuthenticationApi(appName),
|
|
599
|
-
securityPolicy: new _secutiryPoilicy.SecurityPolicyApi(appName),
|
|
600
|
-
teams: new _teams.TeamsApi(appName),
|
|
601
|
-
metadata: new _metadata.MetadataApi(appName),
|
|
602
|
-
reports: new _reports.ReportsApi(appName),
|
|
603
|
-
connectivity: new _connectivity.ConnectivityApi(appName),
|
|
604
|
-
notifications: new _notifications.NotificationsApi(appName),
|
|
605
|
-
audits: new _audits.AuditsApi(appName),
|
|
606
|
-
tenants: new _tenants.TenantsApi(appName),
|
|
607
|
-
accountSettings: new _accountSettings.AccountSettingsApi(appName),
|
|
608
|
-
roles: new _roles.RolesApi(appName),
|
|
609
|
-
subscriptions: new _subscriptions.SubscriptionsApi(appName),
|
|
610
|
-
vendor: new _vendor.VendorApi(appName),
|
|
611
|
-
subTenants: new _subTenants.SubTenantsApi(appName),
|
|
612
|
-
featureFlags: new _featureFlags.FeatureFlagsApi(appName),
|
|
613
|
-
directory: new _directory.DirectoryApi(appName),
|
|
614
|
-
impersonate: new _impersonate.ImpersonateApi(appName),
|
|
615
|
-
groups: new _groups.GroupsApi(appName),
|
|
616
|
-
users: new _users.UsersApi(appName),
|
|
617
|
-
entitlements: new _entitlements.EntitlementsApi(appName),
|
|
618
|
-
securityCenter: new _securityCenter.SecurityCenterApi(appName),
|
|
619
|
-
userPhoneNumbers: new _userPhoneNumbers.PhoneNumbersApi(appName),
|
|
620
|
-
applications: new _applications.ApplicationsApi(appName)
|
|
621
|
-
});
|
|
622
|
-
|
|
623
|
-
exports.createApiClient = createApiClient;
|
|
624
581
|
var _default = {
|
|
625
|
-
fetch
|
|
626
|
-
FetchClient: _FetchClient.FetchClient,
|
|
582
|
+
fetch,
|
|
627
583
|
ContextHolder: _ContextHolder.ContextHolder,
|
|
628
584
|
FronteggContext: _ContextHolder.FronteggContext,
|
|
629
585
|
api,
|
|
630
|
-
createApiClient,
|
|
631
586
|
FronteggApiError: _error.FronteggApiError,
|
|
632
|
-
AuthStrategyEnum:
|
|
633
|
-
MachineToMachineAuthStrategy:
|
|
634
|
-
SocialLoginProviders:
|
|
635
|
-
ISubscriptionCancellationPolicy:
|
|
636
|
-
ISubscriptionStatus:
|
|
637
|
-
PaymentMethodType:
|
|
638
|
-
ProviderType:
|
|
587
|
+
AuthStrategyEnum: auth.AuthStrategyEnum,
|
|
588
|
+
MachineToMachineAuthStrategy: auth.MachineToMachineAuthStrategy,
|
|
589
|
+
SocialLoginProviders: auth.SocialLoginProviders,
|
|
590
|
+
ISubscriptionCancellationPolicy: subscriptions.ISubscriptionCancellationPolicy,
|
|
591
|
+
ISubscriptionStatus: subscriptions.ISubscriptionStatus,
|
|
592
|
+
PaymentMethodType: subscriptions.PaymentMethodType,
|
|
593
|
+
ProviderType: subscriptions.ProviderType
|
|
639
594
|
};
|
|
640
595
|
exports.default = _default;
|
package/node/metadata/index.js
CHANGED
|
@@ -3,69 +3,60 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
constructor(appName) {
|
|
12
|
-
super(appName);
|
|
13
|
-
|
|
14
|
-
this.getMetadata = async body => {
|
|
15
|
-
var _data$rows, _data$rows2;
|
|
16
|
-
|
|
17
|
-
const data = await this.get('/metadata', body);
|
|
18
|
-
if (data != null && (_data$rows = data.rows) != null && _data$rows[0]) return data == null ? void 0 : (_data$rows2 = data.rows) == null ? void 0 : _data$rows2[0];
|
|
19
|
-
throw new Error(`metadata not found: ${body.entityName}`);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.getAdminBoxMetadata = async () => {
|
|
23
|
-
return this.get('/metadata/admin-box');
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
this.updateAdminBoxMetadata = async body => {
|
|
27
|
-
return this.post('/metadata/admin-box', body);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
this.getIpMetadata = async ip => {
|
|
31
|
-
const data = await this.get(`/metadata/ip/${ip}`);
|
|
32
|
-
if (data) return data;
|
|
33
|
-
throw new Error(`ip metadata not found`);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
this.getCurrentUserIpMetadata = async () => {
|
|
37
|
-
const data = await this.get(`/metadata/ipme`);
|
|
38
|
-
if (data) return data;
|
|
39
|
-
throw new Error(`ip metadata not found`);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
this.getNotificationsMetadata = async () => {
|
|
43
|
-
return this.getMetadata({
|
|
44
|
-
entityName: 'notifications'
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
this.getSamlMetadata = async () => {
|
|
49
|
-
return this.getMetadata({
|
|
50
|
-
entityName: 'saml'
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
this.getAuditsMetadata = async () => {
|
|
55
|
-
return this.getMetadata({
|
|
56
|
-
entityName: 'audits'
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
this.getIpAdressMetadata = async ip => {
|
|
61
|
-
return this.getIpMetadata(ip);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
6
|
+
exports.getAdminBoxMetadata = getAdminBoxMetadata;
|
|
7
|
+
exports.getAuditsMetadata = void 0;
|
|
8
|
+
exports.getCurrentUserIpMetadata = getCurrentUserIpMetadata;
|
|
9
|
+
exports.getSamlMetadata = exports.getNotificationsMetadata = exports.getIpAdressMetadata = void 0;
|
|
10
|
+
exports.updateAdminBoxMetadata = updateAdminBoxMetadata;
|
|
64
11
|
|
|
12
|
+
var _fetch = require("../fetch");
|
|
13
|
+
|
|
14
|
+
async function getMetadata(body) {
|
|
15
|
+
var _data$rows, _data$rows2;
|
|
16
|
+
|
|
17
|
+
const data = await (0, _fetch.Get)('/metadata', body);
|
|
18
|
+
if (data != null && (_data$rows = data.rows) != null && _data$rows[0]) return data == null ? void 0 : (_data$rows2 = data.rows) == null ? void 0 : _data$rows2[0];
|
|
19
|
+
throw new Error(`metadata not found: ${body.entityName}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function getAdminBoxMetadata() {
|
|
23
|
+
return (0, _fetch.Get)('/metadata/admin-box');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function updateAdminBoxMetadata(body) {
|
|
27
|
+
return (0, _fetch.Post)('/metadata/admin-box', body);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function getIpMetadata(ip) {
|
|
31
|
+
const data = await (0, _fetch.Get)(`/metadata/ip/${ip}`);
|
|
32
|
+
if (data) return data;
|
|
33
|
+
throw new Error(`ip metadata not found`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function getCurrentUserIpMetadata() {
|
|
37
|
+
const data = await (0, _fetch.Get)(`/metadata/ipme`);
|
|
38
|
+
if (data) return data;
|
|
39
|
+
throw new Error(`ip metadata not found`);
|
|
65
40
|
}
|
|
66
41
|
|
|
67
|
-
|
|
42
|
+
const getNotificationsMetadata = async () => getMetadata({
|
|
43
|
+
entityName: 'notifications'
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
exports.getNotificationsMetadata = getNotificationsMetadata;
|
|
47
|
+
|
|
48
|
+
const getSamlMetadata = async () => getMetadata({
|
|
49
|
+
entityName: 'saml'
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
exports.getSamlMetadata = getSamlMetadata;
|
|
53
|
+
|
|
54
|
+
const getAuditsMetadata = async () => getMetadata({
|
|
55
|
+
entityName: 'audits'
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
exports.getAuditsMetadata = getAuditsMetadata;
|
|
68
59
|
|
|
69
|
-
|
|
60
|
+
const getIpAdressMetadata = async ip => getIpMetadata(ip);
|
|
70
61
|
|
|
71
|
-
exports.
|
|
62
|
+
exports.getIpAdressMetadata = getIpAdressMetadata;
|
|
@@ -3,47 +3,37 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getNotifications = getNotifications;
|
|
7
|
+
exports.markAllAsRead = markAllAsRead;
|
|
8
|
+
exports.updateNotificationIsPinned = updateNotificationIsPinned;
|
|
9
|
+
exports.updateNotificationStatus = updateNotificationStatus;
|
|
7
10
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
-
|
|
12
|
-
class NotificationsApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
-
constructor(appName) {
|
|
14
|
-
super(appName);
|
|
15
|
-
|
|
16
|
-
this.getNotifications = async params => {
|
|
17
|
-
return this.get(_constants.urls.notifications.v1, {
|
|
18
|
-
params
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.updateNotificationStatus = async params => {
|
|
23
|
-
return this.put(`${_constants.urls.notifications.v1}/status`, {
|
|
24
|
-
params
|
|
25
|
-
});
|
|
26
|
-
};
|
|
11
|
+
var _fetch = require("../fetch");
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
notificationId,
|
|
31
|
-
pinStatus
|
|
32
|
-
} = params;
|
|
33
|
-
return this.put(`${_constants.urls.notifications.v1}/${pinStatus}`, {
|
|
34
|
-
notificationId
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
this.markAllAsRead = async () => {
|
|
39
|
-
return this.post(`${_constants.urls.notifications.v1}/status/mark-all-read`);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
13
|
+
var _constants = require("../constants");
|
|
42
14
|
|
|
15
|
+
async function getNotifications(params) {
|
|
16
|
+
return (0, _fetch.Get)(_constants.urls.notifications.v1, {
|
|
17
|
+
params
|
|
18
|
+
});
|
|
43
19
|
}
|
|
44
20
|
|
|
45
|
-
|
|
21
|
+
async function updateNotificationStatus(params) {
|
|
22
|
+
return (0, _fetch.Put)(`${_constants.urls.notifications.v1}/status`, {
|
|
23
|
+
params
|
|
24
|
+
});
|
|
25
|
+
}
|
|
46
26
|
|
|
47
|
-
|
|
27
|
+
async function updateNotificationIsPinned(params) {
|
|
28
|
+
const {
|
|
29
|
+
notificationId,
|
|
30
|
+
pinStatus
|
|
31
|
+
} = params;
|
|
32
|
+
return (0, _fetch.Put)(`${_constants.urls.notifications.v1}/${pinStatus}`, {
|
|
33
|
+
notificationId
|
|
34
|
+
});
|
|
35
|
+
}
|
|
48
36
|
|
|
49
|
-
|
|
37
|
+
async function markAllAsRead() {
|
|
38
|
+
return (0, _fetch.Post)(`${_constants.urls.notifications.v1}/status/mark-all-read`);
|
|
39
|
+
}
|
package/node/reports/index.js
CHANGED
|
@@ -5,100 +5,92 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.downloadReport = downloadReport;
|
|
9
|
+
exports.getReport = getReport;
|
|
10
|
+
exports.getReports = getReports;
|
|
11
|
+
exports.renderReport = renderReport;
|
|
12
|
+
exports.scheduleReport = scheduleReport;
|
|
13
|
+
exports.sendReport = sendReport;
|
|
9
14
|
|
|
10
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
16
|
|
|
12
17
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
13
18
|
|
|
14
|
-
var
|
|
19
|
+
var _fetch = require("../fetch");
|
|
15
20
|
|
|
16
|
-
var
|
|
21
|
+
var _constants = require("../constants");
|
|
17
22
|
|
|
18
23
|
const _excluded = ["dataFilters"],
|
|
19
24
|
_excluded2 = ["templateId", "dataFilters"],
|
|
20
25
|
_excluded3 = ["dataFilters"];
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.getReports = async body => {
|
|
27
|
-
return this.get(`${_constants.urls.reports.service.v2}/tenant-reports`, body);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
this.getReport = async body => {
|
|
31
|
-
return this.get(`${_constants.urls.reports.service.v2}/${body.id}/tenant-reports`);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
this.renderReport = async _ref => {
|
|
35
|
-
let {
|
|
36
|
-
dataFilters
|
|
37
|
-
} = _ref,
|
|
38
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
39
|
-
const html = await this.get(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
40
|
-
dataFilters: btoa(JSON.stringify(dataFilters || {})),
|
|
41
|
-
responseType: 'html'
|
|
42
|
-
}), {
|
|
43
|
-
responseType: 'plain'
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
html
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
this.scheduleReport = async _ref2 => {
|
|
51
|
-
let {
|
|
52
|
-
templateId,
|
|
53
|
-
dataFilters
|
|
54
|
-
} = _ref2,
|
|
55
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
56
|
-
return this.post(`${_constants.urls.reports.service.v2}/${templateId}/tenant-reports`, (0, _extends2.default)({}, body, {
|
|
57
|
-
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
58
|
-
}));
|
|
59
|
-
};
|
|
27
|
+
async function getReports(body) {
|
|
28
|
+
return (0, _fetch.Get)(`${_constants.urls.reports.service.v2}/tenant-reports`, body);
|
|
29
|
+
}
|
|
60
30
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = _ref3,
|
|
65
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
66
|
-
const blob = await this.get(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
67
|
-
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
68
|
-
}), {
|
|
69
|
-
responseType: 'blob'
|
|
70
|
-
});
|
|
71
|
-
let contentType = 'text/html';
|
|
72
|
-
let contentExt = 'html';
|
|
31
|
+
async function getReport(body) {
|
|
32
|
+
return (0, _fetch.Get)(`${_constants.urls.reports.service.v2}/${body.id}/tenant-reports`);
|
|
33
|
+
}
|
|
73
34
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
35
|
+
async function renderReport(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
dataFilters
|
|
38
|
+
} = _ref,
|
|
39
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
40
|
+
const html = await (0, _fetch.Get)(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
41
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {})),
|
|
42
|
+
responseType: 'html'
|
|
43
|
+
}), {
|
|
44
|
+
responseType: 'plain'
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
html
|
|
48
|
+
};
|
|
49
|
+
}
|
|
81
50
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
51
|
+
async function scheduleReport(_ref2) {
|
|
52
|
+
let {
|
|
53
|
+
templateId,
|
|
54
|
+
dataFilters
|
|
55
|
+
} = _ref2,
|
|
56
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
57
|
+
return (0, _fetch.Post)(`${_constants.urls.reports.service.v2}/${templateId}/tenant-reports`, (0, _extends2.default)({}, body, {
|
|
58
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
92
61
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
62
|
+
async function downloadReport(_ref3) {
|
|
63
|
+
let {
|
|
64
|
+
dataFilters
|
|
65
|
+
} = _ref3,
|
|
66
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
67
|
+
const blob = await (0, _fetch.Get)(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
68
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
69
|
+
}), {
|
|
70
|
+
responseType: 'blob'
|
|
71
|
+
});
|
|
72
|
+
let contentType = 'text/html';
|
|
73
|
+
let contentExt = 'html';
|
|
74
|
+
|
|
75
|
+
if (body.responseType === 'pdf') {
|
|
76
|
+
contentType = 'application/pdf';
|
|
77
|
+
contentExt = 'pdf';
|
|
78
|
+
} else if (body.responseType === 'image') {
|
|
79
|
+
contentType = 'image/jpeg';
|
|
80
|
+
contentExt = 'jpg';
|
|
96
81
|
}
|
|
97
82
|
|
|
83
|
+
const newBlob = new Blob([blob], {
|
|
84
|
+
type: contentType
|
|
85
|
+
});
|
|
86
|
+
const fileURL = URL.createObjectURL(newBlob);
|
|
87
|
+
const tempLink = document.createElement('a');
|
|
88
|
+
tempLink.href = fileURL;
|
|
89
|
+
tempLink.setAttribute('download', `report_${body.name || ''}.${contentExt}`);
|
|
90
|
+
tempLink.click();
|
|
91
|
+
setTimeout(tempLink.remove.bind(tempLink));
|
|
98
92
|
}
|
|
99
93
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
exports.default = _default;
|
|
94
|
+
async function sendReport(body) {
|
|
95
|
+
return (0, _fetch.Post)(`${_constants.urls.reports.trigger.v1}/tenant-reports`, body);
|
|
96
|
+
}
|