@internxt/sdk 1.9.11 → 1.9.12
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.
|
@@ -209,7 +209,11 @@ var Payments = /** @class */ (function () {
|
|
|
209
209
|
* @private
|
|
210
210
|
*/
|
|
211
211
|
Payments.prototype.headers = function () {
|
|
212
|
-
|
|
212
|
+
var additionalHeaders = {};
|
|
213
|
+
if (this.appDetails.desktopHeader) {
|
|
214
|
+
additionalHeaders['x-internxt-desktop-header'] = this.appDetails.desktopHeader;
|
|
215
|
+
}
|
|
216
|
+
return (0, headers_1.headersWithToken)(this.appDetails.clientName, this.appDetails.clientVersion, this.apiSecurity.token, undefined, additionalHeaders);
|
|
213
217
|
};
|
|
214
218
|
return Payments;
|
|
215
219
|
}());
|
package/dist/network/index.d.ts
CHANGED
package/dist/network/index.js
CHANGED
|
@@ -305,10 +305,19 @@ var Network = /** @class */ (function () {
|
|
|
305
305
|
* @param auth
|
|
306
306
|
*/
|
|
307
307
|
Network.headersWithBasicAuth = function (appDetails, auth) {
|
|
308
|
-
|
|
308
|
+
var additionalHeaders = this.mapAdditionalHeaders(appDetails);
|
|
309
|
+
return (0, index_1.headersWithBasicAuth)(appDetails.clientName, appDetails.clientVersion, auth, undefined, additionalHeaders);
|
|
309
310
|
};
|
|
310
311
|
Network.headersWithAuthToken = function (appDetails, token) {
|
|
311
|
-
|
|
312
|
+
var additionalHeaders = this.mapAdditionalHeaders(appDetails);
|
|
313
|
+
return (0, index_1.headersWithAuthToken)(appDetails.clientName, appDetails.clientVersion, token, undefined, additionalHeaders);
|
|
314
|
+
};
|
|
315
|
+
Network.mapAdditionalHeaders = function (appDetails) {
|
|
316
|
+
var additionalHeaders = {};
|
|
317
|
+
if (appDetails.desktopHeader) {
|
|
318
|
+
additionalHeaders['x-internxt-desktop-header'] = appDetails.desktopHeader;
|
|
319
|
+
}
|
|
320
|
+
return additionalHeaders;
|
|
312
321
|
};
|
|
313
322
|
return Network;
|
|
314
323
|
}());
|
|
@@ -15,7 +15,7 @@ export declare function basicHeaders(clientName: string, clientVersion: string):
|
|
|
15
15
|
export declare function basicHeadersWithPassword(clientName: string, clientVersion: string, password: string): InternxtHeaders;
|
|
16
16
|
export declare function headersWithToken(clientName: string, clientVersion: string, token: Token, workspaceToken?: Token, customHeaders?: CustomHeaders): InternxtHeaders;
|
|
17
17
|
export declare function headersWithTokenAndPassword(clientName: string, clientVersion: string, token: Token, workspaceToken: Token | undefined, password: string): InternxtHeaders;
|
|
18
|
-
export declare function headersWithBasicAuth(clientName: string, clientVersion: string, auth: BasicAuth, workspaceToken?: Token): InternxtHeaders;
|
|
19
|
-
export declare function headersWithAuthToken(clientName: string, clientVersion: string, token: Token, workspaceToken?: Token): InternxtHeaders;
|
|
18
|
+
export declare function headersWithBasicAuth(clientName: string, clientVersion: string, auth: BasicAuth, workspaceToken?: Token, customHeaders?: CustomHeaders): InternxtHeaders;
|
|
19
|
+
export declare function headersWithAuthToken(clientName: string, clientVersion: string, token: Token, workspaceToken?: Token, customHeaders?: CustomHeaders): InternxtHeaders;
|
|
20
20
|
export declare function addResourcesTokenToHeaders(headers: InternxtHeaders, resourcesToken?: Token): InternxtHeaders;
|
|
21
21
|
export {};
|
|
@@ -48,7 +48,7 @@ function headersWithTokenAndPassword(clientName, clientVersion, token, workspace
|
|
|
48
48
|
return __assign(__assign({}, headers), extra);
|
|
49
49
|
}
|
|
50
50
|
exports.headersWithTokenAndPassword = headersWithTokenAndPassword;
|
|
51
|
-
function headersWithBasicAuth(clientName, clientVersion, auth, workspaceToken) {
|
|
51
|
+
function headersWithBasicAuth(clientName, clientVersion, auth, workspaceToken, customHeaders) {
|
|
52
52
|
var headers = basicHeaders(clientName, clientVersion);
|
|
53
53
|
var token = "".concat(auth.username, ":").concat(auth.password);
|
|
54
54
|
var encodedToken = Buffer.from(token).toString('base64');
|
|
@@ -58,16 +58,16 @@ function headersWithBasicAuth(clientName, clientVersion, auth, workspaceToken) {
|
|
|
58
58
|
if (workspaceToken !== undefined) {
|
|
59
59
|
extra['x-internxt-workspace'] = workspaceToken;
|
|
60
60
|
}
|
|
61
|
-
return __assign(__assign({}, headers), extra);
|
|
61
|
+
return __assign(__assign(__assign({}, headers), extra), customHeaders);
|
|
62
62
|
}
|
|
63
63
|
exports.headersWithBasicAuth = headersWithBasicAuth;
|
|
64
|
-
function headersWithAuthToken(clientName, clientVersion, token, workspaceToken) {
|
|
64
|
+
function headersWithAuthToken(clientName, clientVersion, token, workspaceToken, customHeaders) {
|
|
65
65
|
var headers = basicHeaders(clientName, clientVersion);
|
|
66
66
|
var extra = {};
|
|
67
67
|
if (workspaceToken !== undefined) {
|
|
68
68
|
extra['x-internxt-workspace'] = workspaceToken;
|
|
69
69
|
}
|
|
70
|
-
return __assign(__assign(__assign({}, headers), { 'x-token': token }), extra);
|
|
70
|
+
return __assign(__assign(__assign(__assign({}, headers), { 'x-token': token }), extra), customHeaders);
|
|
71
71
|
}
|
|
72
72
|
exports.headersWithAuthToken = headersWithAuthToken;
|
|
73
73
|
function addResourcesTokenToHeaders(headers, resourcesToken) {
|