@replayio-app-building/netlify-recorder 0.42.0 → 0.43.0

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/index.d.ts CHANGED
@@ -72,6 +72,10 @@ interface NetworkCall {
72
72
  responseHeaders: Record<string, string>;
73
73
  responseBody?: string;
74
74
  timestamp: number;
75
+ /** Epoch ms when the fetch call started. */
76
+ startTime: number;
77
+ /** Epoch ms when the response was received. */
78
+ endTime: number;
75
79
  }
76
80
  interface EnvRead {
77
81
  key: string;
package/dist/index.js CHANGED
@@ -87,7 +87,9 @@ function ensureCaptureInterceptor() {
87
87
  calls
88
88
  );
89
89
  }
90
+ const startTime = Date.now();
90
91
  const response = await _realOriginalFetch(input, init);
92
+ const endTime = Date.now();
91
93
  const responseBody = await response.clone().text();
92
94
  const responseHeaders = {};
93
95
  response.headers.forEach((v, k) => {
@@ -101,7 +103,9 @@ function ensureCaptureInterceptor() {
101
103
  responseStatus: response.status,
102
104
  responseHeaders,
103
105
  responseBody,
104
- timestamp: Date.now()
106
+ timestamp: endTime,
107
+ startTime,
108
+ endTime
105
109
  });
106
110
  return response;
107
111
  };
@@ -154,7 +158,9 @@ function installNetworkInterceptor(mode, calls) {
154
158
  calls
155
159
  );
156
160
  }
161
+ const startTime = Date.now();
157
162
  const response = await originalFetch2(input, init);
163
+ const endTime = Date.now();
158
164
  const responseBody = await response.clone().text();
159
165
  const responseHeaders = {};
160
166
  response.headers.forEach((v, k) => {
@@ -168,7 +174,9 @@ function installNetworkInterceptor(mode, calls) {
168
174
  responseStatus: response.status,
169
175
  responseHeaders,
170
176
  responseBody,
171
- timestamp: Date.now()
177
+ timestamp: endTime,
178
+ startTime,
179
+ endTime
172
180
  });
173
181
  return response;
174
182
  };
@@ -280,7 +288,9 @@ async function handleNeonSqlRequest(originalFetch, input, init, url, method, req
280
288
  ...init,
281
289
  body: JSON.stringify({ queries: txBody })
282
290
  };
291
+ const startTime = Date.now();
283
292
  const response = await originalFetch(input, modifiedInit);
293
+ const endTime = Date.now();
284
294
  const rawBody = await response.clone().text();
285
295
  const responseHeaders = {};
286
296
  response.headers.forEach((v, k) => {
@@ -306,7 +316,9 @@ async function handleNeonSqlRequest(originalFetch, input, init, url, method, req
306
316
  responseStatus: response.status,
307
317
  responseHeaders,
308
318
  responseBody: recordedBody,
309
- timestamp: Date.now()
319
+ timestamp: endTime,
320
+ startTime,
321
+ endTime
310
322
  });
311
323
  return new Response(recordedBody, {
312
324
  status: response.status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio-app-building/netlify-recorder",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "description": "Capture and replay Netlify function executions as Replay recordings",
5
5
  "type": "module",
6
6
  "exports": {
@@ -29,7 +29,7 @@
29
29
  }
30
30
  },
31
31
  "devDependencies": {
32
- "@replayio/app-building": "^1.28.0",
32
+ "@replayio/app-building": "^1.29.0",
33
33
  "@types/node": "^25.6.0",
34
34
  "tsup": "^8.5.1",
35
35
  "typescript": "^5.7.3"