@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.mjs CHANGED
@@ -451,6 +451,9 @@ var _APIError = class _APIError extends Error {
451
451
  if (details.detail) {
452
452
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
453
453
  }
454
+ if (details.error) {
455
+ return String(details.error);
456
+ }
454
457
  if (details.message) {
455
458
  return String(details.message);
456
459
  }
@@ -902,6 +905,12 @@ var _APIClient = class _APIClient {
902
905
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
903
906
  headers["Content-Type"] = "application/json";
904
907
  }
908
+ if (!headers["Authorization"]) {
909
+ const token = this.getToken();
910
+ if (token) {
911
+ headers["Authorization"] = `Bearer ${token}`;
912
+ }
913
+ }
905
914
  if (this.logger) {
906
915
  this.logger.logRequest({
907
916
  method,
@@ -1341,7 +1350,7 @@ __name(sendBatch, "sendBatch");
1341
1350
  // src/client/utils/env.ts
1342
1351
  var isDevelopment = process.env.NODE_ENV === "development";
1343
1352
  var isProduction = !isDevelopment;
1344
- var MONITOR_VERSION = "2.1.261";
1353
+ var MONITOR_VERSION = "2.1.263";
1345
1354
 
1346
1355
  // src/client/constants.ts
1347
1356
  var MONITOR_INGEST_PATTERN = /cfg\/monitor\/ingest/;