@nmshd/transport 2.1.3 → 2.1.4

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.
@@ -4,11 +4,11 @@ exports.buildInformation = void 0;
4
4
  const ts_serval_1 = require("@js-soft/ts-serval");
5
5
  const crypto_1 = require("@nmshd/crypto");
6
6
  exports.buildInformation = {
7
- version: "2.1.3",
8
- build: "62",
9
- date: "2023-11-13T12:38:14+00:00",
10
- commit: "c24f8b1360b20847ca808d5bae2ed63654d126c6",
11
- dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.3","@js-soft/ts-utils":"2.3.1","axios":"^1.6.1","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.4","qs":"^6.11.2","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^9.0.1"},
7
+ version: "2.1.4",
8
+ build: "63",
9
+ date: "2023-11-17T14:40:52+00:00",
10
+ commit: "09eb88033395f248a6df1c4b89ab9dc1c8c2c59b",
11
+ dependencies: {"@js-soft/docdb-access-abstractions":"1.0.2","@js-soft/logging-abstractions":"1.0.1","@js-soft/simple-logger":"1.0.4","@js-soft/ts-utils":"2.3.3","axios":"^1.6.2","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.4","qs":"^6.11.2","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^9.0.1"},
12
12
  libraries: {
13
13
  crypto: crypto_1.buildInformation,
14
14
  serval: ts_serval_1.buildInformation
@@ -15,11 +15,11 @@ exports.buildInformation = void 0;
15
15
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
16
16
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
17
17
  exports.buildInformation = {
18
- version: "2.1.3",
19
- build: "62",
20
- date: "2023-11-13T12:38:14+00:00",
21
- commit: "c24f8b1360b20847ca808d5bae2ed63654d126c6",
22
- dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.3","@js-soft/ts-utils":"2.3.1","axios":"^1.6.1","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.4","qs":"^6.11.2","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^9.0.1"},
18
+ version: "2.1.4",
19
+ build: "63",
20
+ date: "2023-11-17T14:40:52+00:00",
21
+ commit: "09eb88033395f248a6df1c4b89ab9dc1c8c2c59b",
22
+ dependencies: {"@js-soft/docdb-access-abstractions":"1.0.2","@js-soft/logging-abstractions":"1.0.1","@js-soft/simple-logger":"1.0.4","@js-soft/ts-utils":"2.3.3","axios":"^1.6.2","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.4","qs":"^6.11.2","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^9.0.1"},
23
23
  libraries: {
24
24
  crypto: crypto_1.buildInformation,
25
25
  serval: ts_serval_1.buildInformation
@@ -45920,7 +45920,7 @@ module.exports = TSServal;
45920
45920
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
45921
45921
 
45922
45922
  "use strict";
45923
- // Axios v1.6.1 Copyright (c) 2023 Matt Zabriskie and contributors
45923
+ // Axios v1.6.2 Copyright (c) 2023 Matt Zabriskie and contributors
45924
45924
 
45925
45925
 
45926
45926
  function bind(fn, thisArg) {
@@ -47882,51 +47882,42 @@ function settle(resolve, reject, response) {
47882
47882
 
47883
47883
  var cookies = platform.hasStandardBrowserEnv ?
47884
47884
 
47885
- // Standard browser envs support document.cookie
47886
- (function standardBrowserEnv() {
47887
- return {
47888
- write: function write(name, value, expires, path, domain, secure) {
47889
- const cookie = [];
47890
- cookie.push(name + '=' + encodeURIComponent(value));
47885
+ // Standard browser envs support document.cookie
47886
+ {
47887
+ write(name, value, expires, path, domain, secure) {
47888
+ const cookie = [name + '=' + encodeURIComponent(value)];
47891
47889
 
47892
- if (utils$1.isNumber(expires)) {
47893
- cookie.push('expires=' + new Date(expires).toGMTString());
47894
- }
47890
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
47895
47891
 
47896
- if (utils$1.isString(path)) {
47897
- cookie.push('path=' + path);
47898
- }
47892
+ utils$1.isString(path) && cookie.push('path=' + path);
47899
47893
 
47900
- if (utils$1.isString(domain)) {
47901
- cookie.push('domain=' + domain);
47902
- }
47894
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
47903
47895
 
47904
- if (secure === true) {
47905
- cookie.push('secure');
47906
- }
47896
+ secure === true && cookie.push('secure');
47907
47897
 
47908
- document.cookie = cookie.join('; ');
47909
- },
47898
+ document.cookie = cookie.join('; ');
47899
+ },
47910
47900
 
47911
- read: function read(name) {
47912
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
47913
- return (match ? decodeURIComponent(match[3]) : null);
47914
- },
47901
+ read(name) {
47902
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
47903
+ return (match ? decodeURIComponent(match[3]) : null);
47904
+ },
47915
47905
 
47916
- remove: function remove(name) {
47917
- this.write(name, '', Date.now() - 86400000);
47918
- }
47919
- };
47920
- })() :
47906
+ remove(name) {
47907
+ this.write(name, '', Date.now() - 86400000);
47908
+ }
47909
+ }
47921
47910
 
47922
- // Non standard browser env (web workers, react-native) lack needed support.
47923
- (function nonStandardBrowserEnv() {
47924
- return {
47925
- write: function write() {},
47926
- read: function read() { return null; },
47927
- remove: function remove() {}
47928
- };
47929
- })();
47911
+ :
47912
+
47913
+ // Non-standard browser env (web workers, react-native) lack needed support.
47914
+ {
47915
+ write() {},
47916
+ read() {
47917
+ return null;
47918
+ },
47919
+ remove() {}
47920
+ };
47930
47921
 
47931
47922
  /**
47932
47923
  * Determines whether the specified URL is absolute
@@ -47983,7 +47974,7 @@ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
47983
47974
  let originURL;
47984
47975
 
47985
47976
  /**
47986
- * Parse a URL to discover it's components
47977
+ * Parse a URL to discover its components
47987
47978
  *
47988
47979
  * @param {String} url The URL to be parsed
47989
47980
  * @returns {Object}
@@ -48128,7 +48119,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
48128
48119
  return new Promise(function dispatchXhrRequest(resolve, reject) {
48129
48120
  let requestData = config.data;
48130
48121
  const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
48131
- const responseType = config.responseType;
48122
+ let {responseType, withXSRFToken} = config;
48132
48123
  let onCanceled;
48133
48124
  function done() {
48134
48125
  if (config.cancelToken) {
@@ -48264,13 +48255,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
48264
48255
  // Add xsrf header
48265
48256
  // This is only done if running in a standard browser environment.
48266
48257
  // Specifically not if we're in a web worker, or react-native.
48267
- if (platform.hasStandardBrowserEnv) {
48268
- // Add xsrf header
48269
- // regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
48270
- const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
48258
+ if(platform.hasStandardBrowserEnv) {
48259
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
48260
+
48261
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
48262
+ // Add xsrf header
48263
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
48271
48264
 
48272
- if (xsrfValue) {
48273
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
48265
+ if (xsrfValue) {
48266
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
48267
+ }
48274
48268
  }
48275
48269
  }
48276
48270
 
@@ -48553,6 +48547,7 @@ function mergeConfig(config1, config2) {
48553
48547
  timeout: defaultToConfig2,
48554
48548
  timeoutMessage: defaultToConfig2,
48555
48549
  withCredentials: defaultToConfig2,
48550
+ withXSRFToken: defaultToConfig2,
48556
48551
  adapter: defaultToConfig2,
48557
48552
  responseType: defaultToConfig2,
48558
48553
  xsrfCookieName: defaultToConfig2,
@@ -48582,7 +48577,7 @@ function mergeConfig(config1, config2) {
48582
48577
  return config;
48583
48578
  }
48584
48579
 
48585
- const VERSION = "1.6.1";
48580
+ const VERSION = "1.6.2";
48586
48581
 
48587
48582
  const validators$1 = {};
48588
48583