@rawnodes/logger 2.10.0 → 2.11.0
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/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -313,6 +313,12 @@ interface HttpErrorData {
|
|
|
313
313
|
url?: string;
|
|
314
314
|
/** HTTP method (GET, POST, etc.) */
|
|
315
315
|
method?: string;
|
|
316
|
+
/** Request query params */
|
|
317
|
+
params?: unknown;
|
|
318
|
+
/** Request body */
|
|
319
|
+
requestData?: unknown;
|
|
320
|
+
/** Request headers */
|
|
321
|
+
requestHeaders?: unknown;
|
|
316
322
|
/** Error code (e.g., ECONNREFUSED, ETIMEDOUT) */
|
|
317
323
|
code?: string;
|
|
318
324
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -313,6 +313,12 @@ interface HttpErrorData {
|
|
|
313
313
|
url?: string;
|
|
314
314
|
/** HTTP method (GET, POST, etc.) */
|
|
315
315
|
method?: string;
|
|
316
|
+
/** Request query params */
|
|
317
|
+
params?: unknown;
|
|
318
|
+
/** Request body */
|
|
319
|
+
requestData?: unknown;
|
|
320
|
+
/** Request headers */
|
|
321
|
+
requestHeaders?: unknown;
|
|
316
322
|
/** Error code (e.g., ECONNREFUSED, ETIMEDOUT) */
|
|
317
323
|
code?: string;
|
|
318
324
|
}
|
package/dist/index.js
CHANGED
|
@@ -1688,13 +1688,22 @@ function extractAxiosHttpData(error) {
|
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
1690
|
if (error.config) {
|
|
1691
|
-
const { url, baseURL, method } = error.config;
|
|
1691
|
+
const { url, baseURL, method, params, data, headers } = error.config;
|
|
1692
1692
|
if (url) {
|
|
1693
1693
|
httpData.url = baseURL && !url.startsWith("http") ? `${baseURL}${url}` : url;
|
|
1694
1694
|
}
|
|
1695
1695
|
if (method) {
|
|
1696
1696
|
httpData.method = method.toUpperCase();
|
|
1697
1697
|
}
|
|
1698
|
+
if (params !== void 0) {
|
|
1699
|
+
httpData.params = sanitizeResponseData(params);
|
|
1700
|
+
}
|
|
1701
|
+
if (data !== void 0) {
|
|
1702
|
+
httpData.requestData = sanitizeResponseData(data);
|
|
1703
|
+
}
|
|
1704
|
+
if (headers !== void 0) {
|
|
1705
|
+
httpData.requestHeaders = sanitizeResponseData(headers);
|
|
1706
|
+
}
|
|
1698
1707
|
}
|
|
1699
1708
|
return httpData;
|
|
1700
1709
|
}
|
|
@@ -1732,6 +1741,18 @@ function extractGenericHttpData(error) {
|
|
|
1732
1741
|
httpData.method = config.method.toUpperCase();
|
|
1733
1742
|
hasData = true;
|
|
1734
1743
|
}
|
|
1744
|
+
if (config.params !== void 0) {
|
|
1745
|
+
httpData.params = sanitizeResponseData(config.params);
|
|
1746
|
+
hasData = true;
|
|
1747
|
+
}
|
|
1748
|
+
if (config.data !== void 0) {
|
|
1749
|
+
httpData.requestData = sanitizeResponseData(config.data);
|
|
1750
|
+
hasData = true;
|
|
1751
|
+
}
|
|
1752
|
+
if (config.headers !== void 0) {
|
|
1753
|
+
httpData.requestHeaders = sanitizeResponseData(config.headers);
|
|
1754
|
+
hasData = true;
|
|
1755
|
+
}
|
|
1735
1756
|
}
|
|
1736
1757
|
return hasData ? httpData : void 0;
|
|
1737
1758
|
}
|