@nsshunt/stsconfig 1.25.163 → 1.25.165
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/dist/stsconfig.mjs +16 -14
- package/dist/stsconfig.mjs.map +1 -1
- package/dist/stsconfig.umd.js +16 -14
- package/dist/stsconfig.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/stsAxiosConfig.d.ts +1 -0
- package/types/stsAxiosConfig.d.ts.map +1 -1
package/dist/stsconfig.mjs
CHANGED
|
@@ -1804,13 +1804,6 @@ _requestCount = new WeakMap();
|
|
|
1804
1804
|
_SetupResetInterval = new WeakMap();
|
|
1805
1805
|
_GetAgentOptions = new WeakMap();
|
|
1806
1806
|
class STSAxiosConfig {
|
|
1807
|
-
/*
|
|
1808
|
-
headers = {
|
|
1809
|
-
'Content-Type': 'application/json',
|
|
1810
|
-
'Authorization': 'Bearer ' + accesss_token,
|
|
1811
|
-
'x-sts_user_id': DUMMY_USER
|
|
1812
|
-
}
|
|
1813
|
-
*/
|
|
1814
1807
|
constructor(url, method, headers, timeout) {
|
|
1815
1808
|
__privateAdd(this, _url);
|
|
1816
1809
|
__privateAdd(this, _method);
|
|
@@ -1829,6 +1822,13 @@ class STSAxiosConfig {
|
|
|
1829
1822
|
__privateSet(this, _timeout, timeout);
|
|
1830
1823
|
}
|
|
1831
1824
|
}
|
|
1825
|
+
withCookies(cookies) {
|
|
1826
|
+
if (!__privateGet(this, _headers)) {
|
|
1827
|
+
__privateSet(this, _headers, {});
|
|
1828
|
+
}
|
|
1829
|
+
__privateGet(this, _headers)["Cookie"] = cookies.join("; ");
|
|
1830
|
+
return this;
|
|
1831
|
+
}
|
|
1832
1832
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1833
1833
|
withData(data) {
|
|
1834
1834
|
__privateSet(this, _data, data);
|
|
@@ -1836,10 +1836,11 @@ class STSAxiosConfig {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
// 'Content-Type': 'application/json'
|
|
1838
1838
|
withAuthHeaders(accesssToken, stsUserId) {
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
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;
|
|
1843
1844
|
if (stsUserId) {
|
|
1844
1845
|
__privateGet(this, _headers)["x-sts_user_id"] = stsUserId;
|
|
1845
1846
|
}
|
|
@@ -1850,9 +1851,10 @@ class STSAxiosConfig {
|
|
|
1850
1851
|
return this;
|
|
1851
1852
|
}
|
|
1852
1853
|
withDefaultHeaders() {
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
}
|
|
1854
|
+
if (!__privateGet(this, _headers)) {
|
|
1855
|
+
__privateSet(this, _headers, {});
|
|
1856
|
+
}
|
|
1857
|
+
__privateGet(this, _headers)["Content-Type"] = "application/json";
|
|
1856
1858
|
return this;
|
|
1857
1859
|
}
|
|
1858
1860
|
withCredentials() {
|