@frontegg/rest-api 3.0.104 → 3.0.106

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/constants.d.ts CHANGED
@@ -220,4 +220,7 @@ export declare const urls: {
220
220
  v1: string;
221
221
  temp: string;
222
222
  };
223
+ entitlements: {
224
+ v1: string;
225
+ };
223
226
  };
package/constants.js CHANGED
@@ -219,5 +219,8 @@ export const urls = {
219
219
  directory: {
220
220
  v1: '/directory/resources/v1/configurations/scim2',
221
221
  temp: '/directory/resources/scim/temp'
222
+ },
223
+ entitlements: {
224
+ v1: '/entitlements'
222
225
  }
223
226
  };
@@ -0,0 +1,7 @@
1
+ import { EntitlementsResponse } from './interfaces';
2
+ /**
3
+ * Load entitlements on/off values map by keys
4
+ *
5
+ * ``authorized user``
6
+ */
7
+ export declare function loadEntitlements(): Promise<EntitlementsResponse>;
@@ -0,0 +1,5 @@
1
+ import { urls } from '../constants';
2
+ import { Get } from '../fetch';
3
+ export async function loadEntitlements() {
4
+ return Get(urls.entitlements.v1);
5
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Load entitlements on/off values map by keys API response
3
+ */
4
+ export interface EntitlementsResponse {
5
+ [key: string]: boolean;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/entitlements/index.js",
5
+ "types": "./index.d.ts"
6
+ }
package/fetch.js CHANGED
@@ -39,10 +39,10 @@ async function prepareUrl(context, url, params) {
39
39
  }
40
40
 
41
41
  async function buildRequestHeaders(context, contentType) {
42
- var _context$tokenResolve, _ContextHolder$getReq;
42
+ var _context$tokenResolve;
43
43
 
44
44
  const authToken = await ((_context$tokenResolve = context == null ? void 0 : context.tokenResolver) != null ? _context$tokenResolve : ContextHolder.getAccessToken)();
45
- const requestSource = (_ContextHolder$getReq = ContextHolder.getRequestSource()) != null ? _ContextHolder$getReq : context == null ? void 0 : context.requestSource;
45
+ const requestSource = ContextHolder.getRequestSource();
46
46
  const headers = {};
47
47
 
48
48
  if (authToken) {
package/index.d.ts CHANGED
@@ -20,6 +20,7 @@ import * as directory from "./directory";
20
20
  import * as impersonate from "./impersonate";
21
21
  import * as groups from "./groups";
22
22
  import * as users from "./users";
23
+ import * as entitlements from "./entitlements";
23
24
  import { ContextHolder, FronteggContext } from "./ContextHolder";
24
25
  export * from "./interfaces";
25
26
  export * from "./auth/interfaces";
@@ -44,6 +45,7 @@ export * from "./impersonate/interfaces";
44
45
  export * from "./groups/interfaces";
45
46
  export * from "./groups/enums";
46
47
  export * from "./users/interfaces";
48
+ export * from "./entitlements/interfaces";
47
49
  declare const api: {
48
50
  auth: typeof auth;
49
51
  teams: typeof teams;
@@ -63,6 +65,7 @@ declare const api: {
63
65
  impersonate: typeof impersonate;
64
66
  groups: typeof groups;
65
67
  users: typeof users;
68
+ entitlements: typeof entitlements;
66
69
  };
67
70
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, };
68
71
  declare const _default: {
@@ -94,6 +97,7 @@ declare const _default: {
94
97
  impersonate: typeof impersonate;
95
98
  groups: typeof groups;
96
99
  users: typeof users;
100
+ entitlements: typeof entitlements;
97
101
  };
98
102
  FronteggApiError: typeof FronteggApiError;
99
103
  AuthStrategyEnum: typeof auth.AuthStrategyEnum;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.104
1
+ /** @license Frontegg v3.0.106
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.
@@ -25,6 +25,7 @@ import * as directory from "./directory";
25
25
  import * as impersonate from "./impersonate";
26
26
  import * as groups from "./groups";
27
27
  import * as users from "./users";
28
+ import * as entitlements from "./entitlements";
28
29
  import { ContextHolder, FronteggContext } from "./ContextHolder";
29
30
  export * from "./interfaces";
30
31
  export * from "./auth/interfaces";
@@ -49,6 +50,7 @@ export * from "./impersonate/interfaces";
49
50
  export * from "./groups/interfaces";
50
51
  export * from "./groups/enums";
51
52
  export * from "./users/interfaces";
53
+ export * from "./entitlements/interfaces";
52
54
  const api = {
53
55
  auth,
54
56
  teams,
@@ -67,7 +69,8 @@ const api = {
67
69
  directory,
68
70
  impersonate,
69
71
  groups,
70
- users
72
+ users,
73
+ entitlements
71
74
  };
72
75
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy };
73
76
  export default {
package/interfaces.d.ts CHANGED
@@ -49,7 +49,6 @@ export interface ContextOptions {
49
49
  auditsOptions?: {
50
50
  virtualScroll?: boolean;
51
51
  };
52
- requestSource?: RequestSource;
53
52
  }
54
53
  export interface QuerySort {
55
54
  id: string;
package/node/constants.js CHANGED
@@ -225,6 +225,9 @@ const urls = {
225
225
  directory: {
226
226
  v1: '/directory/resources/v1/configurations/scim2',
227
227
  temp: '/directory/resources/scim/temp'
228
+ },
229
+ entitlements: {
230
+ v1: '/entitlements'
228
231
  }
229
232
  };
230
233
  exports.urls = urls;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.loadEntitlements = loadEntitlements;
7
+
8
+ var _constants = require("../constants");
9
+
10
+ var _fetch = require("../fetch");
11
+
12
+ async function loadEntitlements() {
13
+ return (0, _fetch.Get)(_constants.urls.entitlements.v1);
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/node/fetch.js CHANGED
@@ -52,10 +52,12 @@ async function prepareUrl(context, url, params) {
52
52
  }
53
53
 
54
54
  async function buildRequestHeaders(context, contentType) {
55
- var _context$tokenResolve, _ContextHolder$getReq;
55
+ var _context$tokenResolve;
56
56
 
57
57
  const authToken = await ((_context$tokenResolve = context == null ? void 0 : context.tokenResolver) != null ? _context$tokenResolve : _ContextHolder.ContextHolder.getAccessToken)();
58
- const requestSource = (_ContextHolder$getReq = _ContextHolder.ContextHolder.getRequestSource()) != null ? _ContextHolder$getReq : context == null ? void 0 : context.requestSource;
58
+
59
+ const requestSource = _ContextHolder.ContextHolder.getRequestSource();
60
+
59
61
  const headers = {};
60
62
 
61
63
  if (authToken) {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.104
1
+ /** @license Frontegg v3.0.106
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.
@@ -150,6 +150,8 @@ var groups = _interopRequireWildcard(require("./groups"));
150
150
 
151
151
  var users = _interopRequireWildcard(require("./users"));
152
152
 
153
+ var entitlements = _interopRequireWildcard(require("./entitlements"));
154
+
153
155
  var _ContextHolder = require("./ContextHolder");
154
156
 
155
157
  var _interfaces = require("./interfaces");
@@ -446,6 +448,20 @@ Object.keys(_interfaces19).forEach(function (key) {
446
448
  });
447
449
  });
448
450
 
451
+ var _interfaces20 = require("./entitlements/interfaces");
452
+
453
+ Object.keys(_interfaces20).forEach(function (key) {
454
+ if (key === "default" || key === "__esModule") return;
455
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
456
+ if (key in exports && exports[key] === _interfaces20[key]) return;
457
+ Object.defineProperty(exports, key, {
458
+ enumerable: true,
459
+ get: function () {
460
+ return _interfaces20[key];
461
+ }
462
+ });
463
+ });
464
+
449
465
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
450
466
 
451
467
  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; }
@@ -468,7 +484,8 @@ const api = {
468
484
  directory,
469
485
  impersonate,
470
486
  groups,
471
- users
487
+ users,
488
+ entitlements
472
489
  };
473
490
  exports.api = api;
474
491
  var _default = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.104",
3
+ "version": "3.0.106",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {