getta 1.0.10 → 1.0.12

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "getta",
3
3
  "description": "An isomorphic rest client based on the Fetch API.",
4
- "version": "1.0.10",
4
+ "version": "1.0.12",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/getta",
package/src/main.ts CHANGED
@@ -239,7 +239,14 @@ export class Getta {
239
239
 
240
240
  if (!redirects && !retries) {
241
241
  this._log?.(consts.REQUEST_SENT, {
242
- context: { redirects, retries, url: endpoint, ...rest, ...context },
242
+ context: {
243
+ fetchMethod: rest.method,
244
+ fetchRedirets: redirects,
245
+ fetchRequestHeaders: rest.headers,
246
+ fetchRetries: retries,
247
+ fetchUrl: endpoint,
248
+ ...context,
249
+ },
243
250
  stats: { startTime: context.startTime },
244
251
  });
245
252
  }
@@ -312,7 +319,7 @@ export class Getta {
312
319
  const endTime = this._performance.now();
313
320
 
314
321
  this._log?.(consts.REQUEST_FAILED, {
315
- context: { error, url: endpoint, ...rest },
322
+ context: { error, fetchUrl: endpoint, ...rest },
316
323
  stats: { duration: startTime ? endTime - startTime : 0, endTime, startTime },
317
324
  });
318
325
 
@@ -452,12 +459,12 @@ export class Getta {
452
459
 
453
460
  this._log?.(consts.RESPONSE_RECEIVED, {
454
461
  context: {
455
- headers,
456
- method,
457
- redirects,
458
- retries,
459
- status,
460
- url: endpoint,
462
+ fetchMethod: method,
463
+ fetchRedirects: redirects,
464
+ fetchResponseHeaders: headers,
465
+ fetchResponseStatus: status,
466
+ fetchRetries: retries,
467
+ fetchUrl: endpoint,
461
468
  ...otherContext,
462
469
  },
463
470
  stats: { duration, endTime, startTime },