@djangocfg/monitor 2.1.261 → 2.1.263

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/client.cjs CHANGED
@@ -474,6 +474,9 @@ var _APIError = class _APIError extends Error {
474
474
  if (details.detail) {
475
475
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
476
476
  }
477
+ if (details.error) {
478
+ return String(details.error);
479
+ }
477
480
  if (details.message) {
478
481
  return String(details.message);
479
482
  }
@@ -925,6 +928,12 @@ var _APIClient = class _APIClient {
925
928
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
926
929
  headers["Content-Type"] = "application/json";
927
930
  }
931
+ if (!headers["Authorization"]) {
932
+ const token = this.getToken();
933
+ if (token) {
934
+ headers["Authorization"] = `Bearer ${token}`;
935
+ }
936
+ }
928
937
  if (this.logger) {
929
938
  this.logger.logRequest({
930
939
  method,
@@ -1364,7 +1373,7 @@ __name(sendBatch, "sendBatch");
1364
1373
  // src/client/utils/env.ts
1365
1374
  var isDevelopment = process.env.NODE_ENV === "development";
1366
1375
  var isProduction = !isDevelopment;
1367
- var MONITOR_VERSION = "2.1.261";
1376
+ var MONITOR_VERSION = "2.1.263";
1368
1377
 
1369
1378
  // src/client/constants.ts
1370
1379
  var MONITOR_INGEST_PATTERN = /cfg\/monitor\/ingest/;