@frontegg/rest-api 3.0.89 → 3.0.91

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.
@@ -2,10 +2,11 @@ import { FronteggFeatureFlags, IFeatureFlagsAttributes } from "./interfaces";
2
2
  export declare class FeatureFlags {
3
3
  private _flags;
4
4
  private static _instances;
5
- static getInstance(name?: string): any;
6
- static set(featureFlags?: FronteggFeatureFlags, name?: string): FeatureFlags;
7
- static getFeatureFlags(flags: string[]): boolean[];
8
- get flags(): Required<FronteggFeatureFlags>["flags"];
5
+ constructor();
6
+ static getInstance(name?: string): FeatureFlags;
7
+ static set(featureFlags?: IFeatureFlagsAttributes, name?: string): FeatureFlags;
8
+ static getFeatureFlags(flags: string[], name: string): boolean[];
9
+ get flags(): IFeatureFlagsAttributes;
9
10
  set(featureFlags?: FronteggFeatureFlags): void;
10
11
  }
11
12
  export declare function loadFeatureFlags(): Promise<IFeatureFlagsAttributes>;
@@ -6,7 +6,10 @@ const defaultFeatureFlags = {
6
6
  };
7
7
  export class FeatureFlags {
8
8
  constructor() {
9
- this._flags = defaultFeatureFlags.flags;
9
+ var _defaultFeatureFlags$;
10
+
11
+ this._flags = {};
12
+ this._flags = (_defaultFeatureFlags$ = defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$ : {};
10
13
  }
11
14
 
12
15
  static getInstance(name = "default") {
@@ -20,8 +23,8 @@ export class FeatureFlags {
20
23
  return featureFlagsInstance;
21
24
  }
22
25
 
23
- static getFeatureFlags(flags) {
24
- const featureFlagsInstance = this.getInstance();
26
+ static getFeatureFlags(flags, name) {
27
+ const featureFlagsInstance = this.getInstance(name);
25
28
  return flags.map(flag => (featureFlagsInstance == null ? void 0 : featureFlagsInstance._flags[flag]) === "on");
26
29
  }
27
30
 
@@ -32,9 +35,9 @@ export class FeatureFlags {
32
35
  }
33
36
 
34
37
  set(featureFlags) {
35
- var _defaultFeatureFlags$, _featureFlags$flags;
38
+ var _defaultFeatureFlags$2, _featureFlags$flags;
36
39
 
37
- this._flags = _extends({}, (_defaultFeatureFlags$ = defaultFeatureFlags == null ? void 0 : defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$ : {}, (_featureFlags$flags = featureFlags == null ? void 0 : featureFlags.flags) != null ? _featureFlags$flags : {});
40
+ this._flags = _extends({}, (_defaultFeatureFlags$2 = defaultFeatureFlags == null ? void 0 : defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$2 : {}, (_featureFlags$flags = featureFlags == null ? void 0 : featureFlags.flags) != null ? _featureFlags$flags : {});
38
41
  }
39
42
 
40
43
  }
package/index.d.ts CHANGED
@@ -16,6 +16,7 @@ import * as subTenants from "./sub-tenants";
16
16
  import * as featureFlags from "./feature-flags";
17
17
  import * as directory from "./directory";
18
18
  import * as impersonate from "./impersonate";
19
+ import * as groups from "./groups";
19
20
  import { ContextHolder, FronteggContext } from "./ContextHolder";
20
21
  export * from "./interfaces";
21
22
  export * from "./auth/interfaces";
@@ -37,6 +38,7 @@ export * from "./feature-flags/interfaces";
37
38
  export * from "./directory";
38
39
  export * from "./directory/interfaces";
39
40
  export * from "./impersonate/interfaces";
41
+ export * from "./groups/interfaces";
40
42
  import { AuthStrategyEnum, SocialLoginProviders, MachineToMachineAuthStrategy } from "./auth";
41
43
  import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from "./subscriptions";
42
44
  declare const api: {
@@ -56,6 +58,7 @@ declare const api: {
56
58
  featureFlags: typeof featureFlags;
57
59
  directory: typeof directory;
58
60
  impersonate: typeof impersonate;
61
+ groups: typeof groups;
59
62
  };
60
63
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, };
61
64
  declare const _default: {
@@ -85,6 +88,7 @@ declare const _default: {
85
88
  featureFlags: typeof featureFlags;
86
89
  directory: typeof directory;
87
90
  impersonate: typeof impersonate;
91
+ groups: typeof groups;
88
92
  };
89
93
  FronteggApiError: typeof FronteggApiError;
90
94
  AuthStrategyEnum: typeof auth.AuthStrategyEnum;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.89
1
+ /** @license Frontegg v3.0.91
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.
@@ -21,6 +21,7 @@ import * as subTenants from "./sub-tenants";
21
21
  import * as featureFlags from "./feature-flags";
22
22
  import * as directory from "./directory";
23
23
  import * as impersonate from "./impersonate";
24
+ import * as groups from "./groups";
24
25
  import { ContextHolder, FronteggContext } from "./ContextHolder";
25
26
  export * from "./interfaces";
26
27
  export * from "./auth/interfaces";
@@ -42,6 +43,7 @@ export * from "./feature-flags/interfaces";
42
43
  export * from "./directory";
43
44
  export * from "./directory/interfaces";
44
45
  export * from "./impersonate/interfaces";
46
+ export * from "./groups/interfaces";
45
47
  import { AuthStrategyEnum, SocialLoginProviders, MachineToMachineAuthStrategy } from "./auth";
46
48
  import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from "./subscriptions";
47
49
  const api = {
@@ -60,7 +62,8 @@ const api = {
60
62
  subTenants,
61
63
  featureFlags,
62
64
  directory,
63
- impersonate
65
+ impersonate,
66
+ groups
64
67
  };
65
68
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy };
66
69
  export default {
@@ -20,7 +20,10 @@ const defaultFeatureFlags = {
20
20
 
21
21
  class FeatureFlags {
22
22
  constructor() {
23
- this._flags = defaultFeatureFlags.flags;
23
+ var _defaultFeatureFlags$;
24
+
25
+ this._flags = {};
26
+ this._flags = (_defaultFeatureFlags$ = defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$ : {};
24
27
  }
25
28
 
26
29
  static getInstance(name = "default") {
@@ -34,8 +37,8 @@ class FeatureFlags {
34
37
  return featureFlagsInstance;
35
38
  }
36
39
 
37
- static getFeatureFlags(flags) {
38
- const featureFlagsInstance = this.getInstance();
40
+ static getFeatureFlags(flags, name) {
41
+ const featureFlagsInstance = this.getInstance(name);
39
42
  return flags.map(flag => (featureFlagsInstance == null ? void 0 : featureFlagsInstance._flags[flag]) === "on");
40
43
  }
41
44
 
@@ -46,9 +49,9 @@ class FeatureFlags {
46
49
  }
47
50
 
48
51
  set(featureFlags) {
49
- var _defaultFeatureFlags$, _featureFlags$flags;
52
+ var _defaultFeatureFlags$2, _featureFlags$flags;
50
53
 
51
- this._flags = (0, _extends2.default)({}, (_defaultFeatureFlags$ = defaultFeatureFlags == null ? void 0 : defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$ : {}, (_featureFlags$flags = featureFlags == null ? void 0 : featureFlags.flags) != null ? _featureFlags$flags : {});
54
+ this._flags = (0, _extends2.default)({}, (_defaultFeatureFlags$2 = defaultFeatureFlags == null ? void 0 : defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$2 : {}, (_featureFlags$flags = featureFlags == null ? void 0 : featureFlags.flags) != null ? _featureFlags$flags : {});
52
55
  }
53
56
 
54
57
  }
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.89
1
+ /** @license Frontegg v3.0.91
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.
@@ -146,6 +146,8 @@ Object.keys(directory).forEach(function (key) {
146
146
 
147
147
  var impersonate = _interopRequireWildcard(require("./impersonate"));
148
148
 
149
+ var groups = _interopRequireWildcard(require("./groups"));
150
+
149
151
  var _ContextHolder = require("./ContextHolder");
150
152
 
151
153
  var _interfaces = require("./interfaces");
@@ -400,6 +402,20 @@ Object.keys(_interfaces17).forEach(function (key) {
400
402
  });
401
403
  });
402
404
 
405
+ var _interfaces18 = require("./groups/interfaces");
406
+
407
+ Object.keys(_interfaces18).forEach(function (key) {
408
+ if (key === "default" || key === "__esModule") return;
409
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
410
+ if (key in exports && exports[key] === _interfaces18[key]) return;
411
+ Object.defineProperty(exports, key, {
412
+ enumerable: true,
413
+ get: function () {
414
+ return _interfaces18[key];
415
+ }
416
+ });
417
+ });
418
+
403
419
  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); }
404
420
 
405
421
  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; }
@@ -420,7 +436,8 @@ const api = {
420
436
  subTenants,
421
437
  featureFlags,
422
438
  directory,
423
- impersonate
439
+ impersonate,
440
+ groups
424
441
  };
425
442
  exports.api = api;
426
443
  var _default = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.89",
3
+ "version": "3.0.91",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {