getta 1.0.12 → 1.0.14
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +14 -14
- package/dist/types/cjs/main.d.cts.map +1 -1
- package/dist/types/esm/main.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/main.ts +8 -4
package/package.json
CHANGED
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
|
|
|
@@ -385,8 +386,10 @@ export class Getta {
|
|
|
385
386
|
|
|
386
387
|
this._log?.(consts.RESPONSE_FROM_CACHE, {
|
|
387
388
|
context: {
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
fetchMethod: consts.GET_METHOD,
|
|
390
|
+
fetchResponseHeaders: newHeaders,
|
|
391
|
+
fetchUrl: endpoint,
|
|
392
|
+
logEntryName: 'FETCH_RESPONSE_FROM_CACHE',
|
|
390
393
|
...context,
|
|
391
394
|
},
|
|
392
395
|
});
|
|
@@ -461,10 +464,11 @@ export class Getta {
|
|
|
461
464
|
context: {
|
|
462
465
|
fetchMethod: method,
|
|
463
466
|
fetchRedirects: redirects,
|
|
464
|
-
fetchResponseHeaders: headers,
|
|
467
|
+
fetchResponseHeaders: Object.fromEntries(headers.entries()),
|
|
465
468
|
fetchResponseStatus: status,
|
|
466
469
|
fetchRetries: retries,
|
|
467
470
|
fetchUrl: endpoint,
|
|
471
|
+
logEntryName: 'FETCH_RESPONSE_RECEIVED',
|
|
468
472
|
...otherContext,
|
|
469
473
|
},
|
|
470
474
|
stats: { duration, endTime, startTime },
|