@frontegg/rest-api 3.0.24 → 3.0.25

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
@@ -181,4 +181,7 @@ export declare const urls: {
181
181
  oauth: {
182
182
  v1: string;
183
183
  };
184
+ featureFlags: {
185
+ v1: string;
186
+ };
184
187
  };
package/constants.js CHANGED
@@ -180,5 +180,8 @@ export const urls = {
180
180
  },
181
181
  oauth: {
182
182
  v1: '/oauth'
183
+ },
184
+ featureFlags: {
185
+ v1: '/flags'
183
186
  }
184
187
  };
@@ -0,0 +1,2 @@
1
+ import { IFeatureFlagsAttributes } from "./interfaces";
2
+ export declare function loadFeatureFlags(): Promise<IFeatureFlagsAttributes>;
@@ -0,0 +1,5 @@
1
+ import { urls } from "../constants";
2
+ import { Get } from "../fetch";
3
+ export async function loadFeatureFlags() {
4
+ return Get(urls.featureFlags.v1);
5
+ }
@@ -0,0 +1,2 @@
1
+ export declare type IFeatureFlagsAttribute = 'on' | 'off';
2
+ export declare type IFeatureFlagsAttributes = Record<string, IFeatureFlagsAttribute>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/feature-flags/index.js",
5
+ "types": "./index.d.ts"
6
+ }
package/index.d.ts CHANGED
@@ -13,6 +13,7 @@ import * as subscriptions from './subscriptions';
13
13
  import { FronteggApiError } from './error';
14
14
  import * as vendor from './vendor';
15
15
  import * as subTenants from './sub-tenants';
16
+ import * as featureFlags from './feature-flags';
16
17
  import { ContextHolder, FronteggContext } from './ContextHolder';
17
18
  export * from './interfaces';
18
19
  export * from './auth/interfaces';
@@ -29,6 +30,8 @@ export * from './subscriptions/interfaces';
29
30
  export * from './vendor/interfaces';
30
31
  export * from './sub-tenants/interfaces';
31
32
  export * from './routers';
33
+ export * from './feature-flags';
34
+ export * from './feature-flags/interfaces';
32
35
  import { AuthStrategyEnum, SocialLoginProviders } from './auth';
33
36
  import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from './subscriptions';
34
37
  declare const api: {
@@ -45,6 +48,7 @@ declare const api: {
45
48
  subscriptions: typeof subscriptions;
46
49
  vendor: typeof vendor;
47
50
  subTenants: typeof subTenants;
51
+ featureFlags: typeof featureFlags;
48
52
  };
49
53
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, };
50
54
  declare const _default: {
@@ -71,6 +75,7 @@ declare const _default: {
71
75
  subscriptions: typeof subscriptions;
72
76
  vendor: typeof vendor;
73
77
  subTenants: typeof subTenants;
78
+ featureFlags: typeof featureFlags;
74
79
  };
75
80
  FronteggApiError: typeof FronteggApiError;
76
81
  AuthStrategyEnum: typeof auth.AuthStrategyEnum;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.24
1
+ /** @license Frontegg v3.0.25
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.
@@ -18,6 +18,7 @@ import * as subscriptions from './subscriptions';
18
18
  import { FronteggApiError } from './error';
19
19
  import * as vendor from './vendor';
20
20
  import * as subTenants from './sub-tenants';
21
+ import * as featureFlags from './feature-flags';
21
22
  import { ContextHolder, FronteggContext } from './ContextHolder';
22
23
  export * from './interfaces';
23
24
  export * from './auth/interfaces';
@@ -34,6 +35,8 @@ export * from './subscriptions/interfaces';
34
35
  export * from './vendor/interfaces';
35
36
  export * from './sub-tenants/interfaces';
36
37
  export * from './routers';
38
+ export * from './feature-flags';
39
+ export * from './feature-flags/interfaces';
37
40
  import { AuthStrategyEnum, SocialLoginProviders } from './auth';
38
41
  import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from './subscriptions';
39
42
  const api = {
@@ -49,7 +52,8 @@ const api = {
49
52
  roles,
50
53
  subscriptions,
51
54
  vendor,
52
- subTenants
55
+ subTenants,
56
+ featureFlags
53
57
  };
54
58
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType };
55
59
  export default {
package/node/constants.js CHANGED
@@ -186,6 +186,9 @@ const urls = {
186
186
  },
187
187
  oauth: {
188
188
  v1: '/oauth'
189
+ },
190
+ featureFlags: {
191
+ v1: '/flags'
189
192
  }
190
193
  };
191
194
  exports.urls = urls;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.loadFeatureFlags = loadFeatureFlags;
7
+
8
+ var _constants = require("../constants");
9
+
10
+ var _fetch = require("../fetch");
11
+
12
+ async function loadFeatureFlags() {
13
+ return (0, _fetch.Get)(_constants.urls.featureFlags.v1);
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.24
1
+ /** @license Frontegg v3.0.25
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.
@@ -109,6 +109,20 @@ var vendor = _interopRequireWildcard(require("./vendor"));
109
109
 
110
110
  var subTenants = _interopRequireWildcard(require("./sub-tenants"));
111
111
 
112
+ var featureFlags = _interopRequireWildcard(require("./feature-flags"));
113
+
114
+ Object.keys(featureFlags).forEach(function (key) {
115
+ if (key === "default" || key === "__esModule") return;
116
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
117
+ if (key in exports && exports[key] === featureFlags[key]) return;
118
+ Object.defineProperty(exports, key, {
119
+ enumerable: true,
120
+ get: function () {
121
+ return featureFlags[key];
122
+ }
123
+ });
124
+ });
125
+
112
126
  var _ContextHolder = require("./ContextHolder");
113
127
 
114
128
  var _interfaces = require("./interfaces");
@@ -321,6 +335,20 @@ Object.keys(_routers).forEach(function (key) {
321
335
  });
322
336
  });
323
337
 
338
+ var _interfaces15 = require("./feature-flags/interfaces");
339
+
340
+ Object.keys(_interfaces15).forEach(function (key) {
341
+ if (key === "default" || key === "__esModule") return;
342
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
343
+ if (key in exports && exports[key] === _interfaces15[key]) return;
344
+ Object.defineProperty(exports, key, {
345
+ enumerable: true,
346
+ get: function () {
347
+ return _interfaces15[key];
348
+ }
349
+ });
350
+ });
351
+
324
352
  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); }
325
353
 
326
354
  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; }
@@ -338,7 +366,8 @@ const api = {
338
366
  roles,
339
367
  subscriptions,
340
368
  vendor,
341
- subTenants
369
+ subTenants,
370
+ featureFlags
342
371
  };
343
372
  exports.api = api;
344
373
  var _default = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.24",
3
+ "version": "3.0.25",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {