getta 1.0.12 → 1.0.13

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.12",
4
+ "version": "1.0.13",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/getta",
package/src/main.ts CHANGED
@@ -245,6 +245,7 @@ export class Getta {
245
245
  fetchRequestHeaders: rest.headers,
246
246
  fetchRetries: retries,
247
247
  fetchUrl: endpoint,
248
+ logEntryName: 'FETCH_REQUEST_SENT',
248
249
  ...context,
249
250
  },
250
251
  stats: { startTime: context.startTime },
@@ -319,7 +320,7 @@ export class Getta {
319
320
  const endTime = this._performance.now();
320
321
 
321
322
  this._log?.(consts.REQUEST_FAILED, {
322
- context: { error, fetchUrl: endpoint, ...rest },
323
+ context: { error, fetchUrl: endpoint, logEntryName: 'FETCH_REQUEST_FAILED', ...rest },
323
324
  stats: { duration: startTime ? endTime - startTime : 0, endTime, startTime },
324
325
  });
325
326
 
@@ -461,10 +462,11 @@ export class Getta {
461
462
  context: {
462
463
  fetchMethod: method,
463
464
  fetchRedirects: redirects,
464
- fetchResponseHeaders: headers,
465
+ fetchResponseHeaders: Object.fromEntries(headers.entries()),
465
466
  fetchResponseStatus: status,
466
467
  fetchRetries: retries,
467
468
  fetchUrl: endpoint,
469
+ logEntryName: 'FETCH_RESPONSE_RECEIVED',
468
470
  ...otherContext,
469
471
  },
470
472
  stats: { duration, endTime, startTime },