@nsshunt/stsconfig 1.25.161 → 1.25.162

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.
@@ -13,7 +13,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
13
13
  return __privateGet(obj, member, getter);
14
14
  }
15
15
  });
16
- var _options, _httpAgent, _httpsAgent, _agentResetInterval, _requestCount, _SetupResetInterval, _GetAgentOptions, _url, _method, _headers, _data, _agentManager, _timeout;
16
+ var _options, _httpAgent, _httpsAgent, _agentResetInterval, _requestCount, _SetupResetInterval, _GetAgentOptions, _url, _method, _headers, _data, _agentManager, _timeout, _withCredentials;
17
17
  import * as fs from "node:fs";
18
18
  import * as dotenv from "dotenv";
19
19
  import http from "node:http";
@@ -1812,9 +1812,12 @@ class STSAxiosConfig {
1812
1812
  __privateAdd(this, _data);
1813
1813
  __privateAdd(this, _agentManager);
1814
1814
  __privateAdd(this, _timeout);
1815
+ __privateAdd(this, _withCredentials);
1815
1816
  __privateSet(this, _url, url);
1816
1817
  __privateSet(this, _method, method);
1817
- __privateSet(this, _headers, headers);
1818
+ if (headers !== void 0) {
1819
+ __privateSet(this, _headers, headers);
1820
+ }
1818
1821
  if (timeout !== void 0) {
1819
1822
  __privateSet(this, _timeout, timeout);
1820
1823
  }
@@ -1824,6 +1827,21 @@ class STSAxiosConfig {
1824
1827
  __privateSet(this, _data, data);
1825
1828
  return this;
1826
1829
  }
1830
+ // 'Content-Type': 'application/json'
1831
+ withHeaders(headers) {
1832
+ __privateSet(this, _headers, headers);
1833
+ return this;
1834
+ }
1835
+ withDefaultHeaders() {
1836
+ __privateSet(this, _headers, {
1837
+ "Content-Type": "application/json"
1838
+ });
1839
+ return this;
1840
+ }
1841
+ withCredentials() {
1842
+ __privateSet(this, _withCredentials, true);
1843
+ return this;
1844
+ }
1827
1845
  withTimeout(timeout) {
1828
1846
  __privateSet(this, _timeout, timeout);
1829
1847
  return this;
@@ -1835,9 +1853,11 @@ class STSAxiosConfig {
1835
1853
  get config() {
1836
1854
  const retVal = {
1837
1855
  url: __privateGet(this, _url),
1838
- method: __privateGet(this, _method),
1839
- headers: __privateGet(this, _headers)
1856
+ method: __privateGet(this, _method)
1840
1857
  };
1858
+ if (__privateGet(this, _headers)) {
1859
+ retVal.headers = __privateGet(this, _headers);
1860
+ }
1841
1861
  if (__privateGet(this, _agentManager) !== void 0) {
1842
1862
  if (__privateGet(this, _agentManager).IsHttps(__privateGet(this, _url))) {
1843
1863
  retVal.httpsAgent = __privateGet(this, _agentManager).GetAgent(__privateGet(this, _url));
@@ -1851,6 +1871,9 @@ class STSAxiosConfig {
1851
1871
  if (__privateGet(this, _timeout) !== void 0) {
1852
1872
  retVal.timeout = __privateGet(this, _timeout);
1853
1873
  }
1874
+ if (__privateGet(this, _withCredentials) !== void 0 && __privateGet(this, _withCredentials) === true) {
1875
+ retVal.withCredentials = true;
1876
+ }
1854
1877
  return retVal;
1855
1878
  }
1856
1879
  }
@@ -1860,6 +1883,7 @@ _headers = new WeakMap();
1860
1883
  _data = new WeakMap();
1861
1884
  _agentManager = new WeakMap();
1862
1885
  _timeout = new WeakMap();
1886
+ _withCredentials = new WeakMap();
1863
1887
  export {
1864
1888
  $ResetOptions,
1865
1889
  $ResetOptionsEx,