@nsshunt/stsconfig 1.25.164 → 1.25.166

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.
@@ -1804,7 +1804,6 @@ _requestCount = new WeakMap();
1804
1804
  _SetupResetInterval = new WeakMap();
1805
1805
  _GetAgentOptions = new WeakMap();
1806
1806
  class STSAxiosConfig {
1807
- //#cookies?: string[];
1808
1807
  constructor(url, method, headers, timeout) {
1809
1808
  __privateAdd(this, _url);
1810
1809
  __privateAdd(this, _method);
@@ -1823,13 +1822,13 @@ class STSAxiosConfig {
1823
1822
  __privateSet(this, _timeout, timeout);
1824
1823
  }
1825
1824
  }
1826
- /* these go into the headers
1827
- // 'Cookie': cookiesToSend.join('; ')
1828
- withCookies(cookies: string[]) {
1829
- this.#cookies = cookies;
1830
- return this;
1825
+ withCookies(cookies) {
1826
+ if (!__privateGet(this, _headers)) {
1827
+ __privateSet(this, _headers, {});
1828
+ }
1829
+ __privateGet(this, _headers)["Cookie"] = cookies.join("; ");
1830
+ return this;
1831
1831
  }
1832
- */
1833
1832
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1834
1833
  withData(data) {
1835
1834
  __privateSet(this, _data, data);
@@ -1837,10 +1836,11 @@ class STSAxiosConfig {
1837
1836
  }
1838
1837
  // 'Content-Type': 'application/json'
1839
1838
  withAuthHeaders(accesssToken, stsUserId) {
1840
- __privateSet(this, _headers, {
1841
- "Content-Type": "application/json",
1842
- "Authorization": "Bearer " + accesssToken
1843
- });
1839
+ if (!__privateGet(this, _headers)) {
1840
+ __privateSet(this, _headers, {});
1841
+ }
1842
+ __privateGet(this, _headers)["Content-Type"] = "application/json";
1843
+ __privateGet(this, _headers)["Authorization"] = "Bearer " + accesssToken;
1844
1844
  if (stsUserId) {
1845
1845
  __privateGet(this, _headers)["x-sts_user_id"] = stsUserId;
1846
1846
  }
@@ -1851,9 +1851,10 @@ class STSAxiosConfig {
1851
1851
  return this;
1852
1852
  }
1853
1853
  withDefaultHeaders() {
1854
- __privateSet(this, _headers, {
1855
- "Content-Type": "application/json"
1856
- });
1854
+ if (!__privateGet(this, _headers)) {
1855
+ __privateSet(this, _headers, {});
1856
+ }
1857
+ __privateGet(this, _headers)["Content-Type"] = "application/json";
1857
1858
  return this;
1858
1859
  }
1859
1860
  withCredentials() {