@frontegg/rest-api 3.0.108 → 3.0.110
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.js +1 -1
- package/fetch.d.ts +1 -1
- package/fetch.js +7 -7
- package/index.js +1 -1
- package/interfaces.d.ts +2 -2
- package/node/constants.js +1 -1
- package/node/fetch.js +8 -8
- package/node/index.js +1 -1
- package/package.json +1 -1
package/constants.js
CHANGED
package/fetch.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface RequestOptions {
|
|
|
10
10
|
credentials?: RequestCredentials;
|
|
11
11
|
}
|
|
12
12
|
export declare function getBaseUrl(context: ContextOptions, url: string, withFronteggPrefix?: boolean): string;
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function getMetadataHeaders(context: ContextOptions): Record<string, string>;
|
|
14
14
|
export declare const Get: (url: string, params?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
15
15
|
export declare const Post: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
16
16
|
export declare const Patch: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
package/fetch.js
CHANGED
|
@@ -39,17 +39,17 @@ async function prepareUrl(context, url, params) {
|
|
|
39
39
|
return finalUrl;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function
|
|
43
|
-
var _context$
|
|
42
|
+
export function getMetadataHeaders(context) {
|
|
43
|
+
var _context$metadataHead, _context$metadataHead2;
|
|
44
44
|
|
|
45
45
|
const headers = {};
|
|
46
46
|
|
|
47
|
-
if (context != null && (_context$
|
|
48
|
-
headers[fronteggHeaders.fronteggSdkVersion] = context.
|
|
47
|
+
if (context != null && (_context$metadataHead = context.metadataHeaders) != null && _context$metadataHead.fronteggSdkVersion) {
|
|
48
|
+
headers[fronteggHeaders.fronteggSdkVersion] = context.metadataHeaders.fronteggSdkVersion;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
if (context != null && (_context$
|
|
52
|
-
headers[fronteggHeaders.frameWork] = context.
|
|
51
|
+
if (context != null && (_context$metadataHead2 = context.metadataHeaders) != null && _context$metadataHead2.framework) {
|
|
52
|
+
headers[fronteggHeaders.frameWork] = context.metadataHeaders.framework;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
return headers;
|
|
@@ -58,7 +58,7 @@ export function getMetaDataHeaders(context) {
|
|
|
58
58
|
async function buildRequestHeaders(context, contentType) {
|
|
59
59
|
var _context$tokenResolve;
|
|
60
60
|
|
|
61
|
-
const headers =
|
|
61
|
+
const headers = getMetadataHeaders(context);
|
|
62
62
|
const authToken = await ((_context$tokenResolve = context == null ? void 0 : context.tokenResolver) != null ? _context$tokenResolve : ContextHolder.getAccessToken)();
|
|
63
63
|
const requestSource = ContextHolder.getRequestSource();
|
|
64
64
|
|
package/index.js
CHANGED
package/interfaces.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare enum FronteggFrameworks {
|
|
|
50
50
|
Android = "android",
|
|
51
51
|
Vanillajs = "vanillajs"
|
|
52
52
|
}
|
|
53
|
-
export interface
|
|
53
|
+
export interface MetadataHeaders {
|
|
54
54
|
framework?: FronteggFrameworks;
|
|
55
55
|
fronteggSdkVersion?: string;
|
|
56
56
|
}
|
|
@@ -72,7 +72,7 @@ export interface ContextOptions {
|
|
|
72
72
|
auditsOptions?: {
|
|
73
73
|
virtualScroll?: boolean;
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
metadataHeaders?: MetadataHeaders;
|
|
76
76
|
}
|
|
77
77
|
export interface QuerySort {
|
|
78
78
|
id: string;
|
package/node/constants.js
CHANGED
package/node/fetch.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.extractHeadersFromOptions = exports.Put = exports.PostDownload = exports.Post = exports.Patch = exports.Get = exports.Delete = void 0;
|
|
9
9
|
exports.getBaseUrl = getBaseUrl;
|
|
10
|
-
exports.
|
|
10
|
+
exports.getMetadataHeaders = getMetadataHeaders;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -54,17 +54,17 @@ async function prepareUrl(context, url, params) {
|
|
|
54
54
|
return finalUrl;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function
|
|
58
|
-
var _context$
|
|
57
|
+
function getMetadataHeaders(context) {
|
|
58
|
+
var _context$metadataHead, _context$metadataHead2;
|
|
59
59
|
|
|
60
60
|
const headers = {};
|
|
61
61
|
|
|
62
|
-
if (context != null && (_context$
|
|
63
|
-
headers[_interfaces.fronteggHeaders.fronteggSdkVersion] = context.
|
|
62
|
+
if (context != null && (_context$metadataHead = context.metadataHeaders) != null && _context$metadataHead.fronteggSdkVersion) {
|
|
63
|
+
headers[_interfaces.fronteggHeaders.fronteggSdkVersion] = context.metadataHeaders.fronteggSdkVersion;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
if (context != null && (_context$
|
|
67
|
-
headers[_interfaces.fronteggHeaders.frameWork] = context.
|
|
66
|
+
if (context != null && (_context$metadataHead2 = context.metadataHeaders) != null && _context$metadataHead2.framework) {
|
|
67
|
+
headers[_interfaces.fronteggHeaders.frameWork] = context.metadataHeaders.framework;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
return headers;
|
|
@@ -73,7 +73,7 @@ function getMetaDataHeaders(context) {
|
|
|
73
73
|
async function buildRequestHeaders(context, contentType) {
|
|
74
74
|
var _context$tokenResolve;
|
|
75
75
|
|
|
76
|
-
const headers =
|
|
76
|
+
const headers = getMetadataHeaders(context);
|
|
77
77
|
const authToken = await ((_context$tokenResolve = context == null ? void 0 : context.tokenResolver) != null ? _context$tokenResolve : _ContextHolder.ContextHolder.getAccessToken)();
|
|
78
78
|
|
|
79
79
|
const requestSource = _ContextHolder.ContextHolder.getRequestSource();
|
package/node/index.js
CHANGED