@alwaysmeticulous/api 2.286.0 → 2.288.2

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.
@@ -0,0 +1,113 @@
1
+ import { HarRequest, HarResponse } from "./sdk-bundle-api/sdk-to-bundle/har-log";
2
+ /**
3
+ * Types for authoring custom checks. A custom check compares the snapshots
4
+ * captured during the base and head replays of a test run and returns a verdict
5
+ * plus a report that is surfaced in the Meticulous UI.
6
+ */
7
+ /**
8
+ * A piece of data captured at a point during a replay, to be compared by a
9
+ * custom check. A check may receive multiple snapshots sharing the same `type`,
10
+ * `sessionId` and `stageDuringSession`; it should align the base and head
11
+ * snapshots and base its verdict only on the differences (pre-existing issues
12
+ * are ignored, consistent with Meticulous's semantics).
13
+ */
14
+ export interface Snapshot<T = unknown> {
15
+ /** The snapshot kind, e.g. "network-requests" or a customer-defined type. */
16
+ type: string;
17
+ /** The recorded session the snapshot was captured during. */
18
+ sessionId: string;
19
+ /**
20
+ * Where in the session the snapshot was captured, identified by the screenshot
21
+ * taken at that point (e.g. "screenshot-after-event-2", "final-state").
22
+ */
23
+ stageDuringSession: string;
24
+ data: T;
25
+ }
26
+ /** The base and head snapshots passed to a custom check. */
27
+ export interface CustomCheckInput {
28
+ baseSnapshots: Snapshot[];
29
+ headSnapshots: Snapshot[];
30
+ }
31
+ /**
32
+ * - `pass`: no regression; the check is green and no report is surfaced.
33
+ * - `warn`: the check is green but its report is shown to the user.
34
+ * - `fail`: the check is red.
35
+ * - `execution-error`: the check failed to run.
36
+ */
37
+ export type CustomCheckVerdict = "pass" | "warn" | "fail" | "execution-error";
38
+ /**
39
+ * Maximum length of a custom check `summary`. The summary is rendered inline in
40
+ * the UI, so it is truncated to this many characters when displayed rather than
41
+ * relying on plugin authors to keep it short.
42
+ */
43
+ export declare const CUSTOM_CHECK_SUMMARY_MAX_LENGTH = 500;
44
+ /** The result a custom check returns after comparing the snapshots. */
45
+ export interface CustomCheckOutput {
46
+ verdict: CustomCheckVerdict;
47
+ /**
48
+ * A short summary shown inline in the UI, e.g. "+30mb inc bundle size".
49
+ * Truncated to {@link CUSTOM_CHECK_SUMMARY_MAX_LENGTH} characters when displayed.
50
+ */
51
+ summary?: string;
52
+ report: CustomCheckReport;
53
+ }
54
+ /** A report rendered in the UI when the check is opened. Markdown for now. */
55
+ export type CustomCheckReport = MarkdownReport;
56
+ export interface MarkdownReport {
57
+ type: "markdown";
58
+ markdown: string;
59
+ }
60
+ /**
61
+ * The contract a custom check implements: `execute` compares the base and head
62
+ * snapshots and returns a verdict and report.
63
+ */
64
+ export interface CustomCheck {
65
+ execute: (input: CustomCheckInput) => Promise<CustomCheckOutput>;
66
+ }
67
+ /**
68
+ * Manifest describing a custom check plugin to Meticulous. It sits alongside the
69
+ * built entrypoint and is loaded (without executing the check) so the check can
70
+ * be discovered ahead of time.
71
+ */
72
+ export interface CustomCheckPluginManifest {
73
+ /** Stable identifier for the check, e.g. "accessibility-check". */
74
+ id: string;
75
+ type: "custom-check";
76
+ /** Plugin version, e.g. "1.0.0". */
77
+ version: string;
78
+ configuration: {
79
+ /** Name shown in the UI, e.g. "Accessibility". */
80
+ displayName: string;
81
+ /** The snapshot types this check consumes, e.g. ["network-requests"]. */
82
+ handlesSnapshotTypes: string[];
83
+ /** Path to the built entrypoint, relative to the manifest, e.g. "./entrypoint.js". */
84
+ entryPoint: string;
85
+ };
86
+ }
87
+ /** A Meticulous plugin manifest. Only custom checks are supported today. */
88
+ export type PluginManifest = CustomCheckPluginManifest;
89
+ /**
90
+ * The snapshot `type` of the built-in network requests snapshot. Checks that
91
+ * consume it receive `Snapshot<NetworkRequestSnapshotData>` values.
92
+ */
93
+ export declare const NETWORK_REQUESTS_SNAPSHOT_TYPE = "network-requests";
94
+ /**
95
+ * `data` of a built-in "network-requests" snapshot: a single xhr/fetch request
96
+ * captured during the replay, with the stubbed response that was served.
97
+ *
98
+ * `requestBody`/`responseBody` may be truncated (large bodies are ellipsized
99
+ * with an MD5 of the remainder, so body changes are still detectable); url,
100
+ * method, status and headers are captured in full.
101
+ */
102
+ export interface NetworkRequestSnapshotData {
103
+ url: string;
104
+ method: string;
105
+ requestHeaders: HarRequest["headers"];
106
+ requestBody?: string;
107
+ /** Status of the response served, or null if the request was not matched. */
108
+ status: number | null;
109
+ responseHeaders: HarResponse["headers"];
110
+ responseBody?: string;
111
+ /** Whether the request was matched to a recorded request and stubbed. */
112
+ matched: boolean;
113
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aaa133b4-907a-5e85-b83c-765d117cdeec")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.NETWORK_REQUESTS_SNAPSHOT_TYPE = exports.CUSTOM_CHECK_SUMMARY_MAX_LENGTH = void 0;
6
+ /**
7
+ * Maximum length of a custom check `summary`. The summary is rendered inline in
8
+ * the UI, so it is truncated to this many characters when displayed rather than
9
+ * relying on plugin authors to keep it short.
10
+ */
11
+ exports.CUSTOM_CHECK_SUMMARY_MAX_LENGTH = 500;
12
+ /**
13
+ * The snapshot `type` of the built-in network requests snapshot. Checks that
14
+ * consume it receive `Snapshot<NetworkRequestSnapshotData>` values.
15
+ */
16
+ exports.NETWORK_REQUESTS_SNAPSHOT_TYPE = "network-requests";
17
+ //# sourceMappingURL=custom-checks.types.js.map
18
+ //# debugId=aaa133b4-907a-5e85-b83c-765d117cdeec
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-checks.types.js","sources":["../src/custom-checks.types.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAgDA;;;;GAIG;AACU,QAAA,+BAA+B,GAAG,GAAG,CAAC;AA4DnD;;;GAGG;AACU,QAAA,8BAA8B,GAAG,kBAAkB,CAAC","debugId":"aaa133b4-907a-5e85-b83c-765d117cdeec"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { TestRunChunkStatus } from "./replay/test-run-chunk.types";
7
7
  export * from "./sdk-bundle-api/sdk-to-bundle/test-run-environment";
8
8
  export { ReplayableEvent } from "./sdk-bundle-api/bidirectional/replayable-event";
9
9
  export { HarEntry, HarLog, HarRequest, HarResponse, } from "./sdk-bundle-api/sdk-to-bundle/har-log";
10
- export { Cookie, SessionData, UrlHistoryEvent, WindowData, ApplicationSpecificData, StorageEntry, EarlyRequest, SerializedIDBValidKey, IDBObjectStoreMetadata, IDBObjectStoreSnapshot, IDBObjectStoreWithEntries, IDBIndexSnapshot, CustomDataSingletonInternalKey, CustomDataSingletonInternalValues, CustomData, CustomUserEvent, SessionContext, ExpiringImage, CustomRecordingType, } from "./sdk-bundle-api/sdk-to-bundle/session-data";
10
+ export { Cookie, SessionData, UrlHistoryEvent, WindowData, ApplicationSpecificData, StorageEntry, EarlyRequest, SerializedIDBValidKey, IDBObjectStoreMetadata, IDBObjectStoreSnapshot, IDBObjectStoreWithEntries, IDBIndexSnapshot, CustomDataSingletonInternalKey, CustomDataSingletonInternalValues, CustomData, CustomUserEvent, SessionContext, ExpiringImage, CustomRecordingType, HttpSpanAttributes, SerializedBackendSpan, } from "./sdk-bundle-api/sdk-to-bundle/session-data";
11
11
  export { SequenceNumber, WebSocketConnectionData, WebSocketConnectionEvent, WebSocketConnectionCreatedEvent, WebSocketConnectionOpenedEvent, EncodedArrayBuffer, EncodedBlob, WebSocketConnectionMessageEvent, WebSocketConnectionErrorEvent, WebSocketConnectionClosedEvent, } from "./sdk-bundle-api/sdk-to-bundle/websocket-data";
12
12
  export * from "./sdk-bundle-api/sdk-to-bundle/event-source-data";
13
13
  export { StreamingFetchChunk, StreamingFetchResponseData, } from "./sdk-bundle-api/sdk-to-bundle/streaming-fetch-data";
@@ -21,3 +21,4 @@ export { AssetUploadMetadata } from "./sdk-bundle-api/sdk-to-bundle/asset-upload
21
21
  export { S3Location } from "./s3.types";
22
22
  export { CompanionAssetsInfo } from "./sdk-bundle-api/sdk-to-bundle/companion-assets";
23
23
  export { DeploymentArchiveType } from "./sdk-bundle-api/sdk-to-bundle/deployment-archive-type";
24
+ export { Snapshot, CustomCheckInput, CustomCheckVerdict, CustomCheckOutput, CustomCheckReport, MarkdownReport, CustomCheck, CustomCheckPluginManifest, PluginManifest, NetworkRequestSnapshotData, NETWORK_REQUESTS_SNAPSHOT_TYPE, CUSTOM_CHECK_SUMMARY_MAX_LENGTH, } from "./custom-checks.types";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4d355048-519b-539f-97e2-b08438b0f52c")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78889a89-65b0-5901-8866-651c405305a4")}catch(e){}}();
3
3
 
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.CustomDataSingletonInternalKey = exports.isPrAuthorRelevance = exports.SessionRelevance = void 0;
19
+ exports.CUSTOM_CHECK_SUMMARY_MAX_LENGTH = exports.NETWORK_REQUESTS_SNAPSHOT_TYPE = exports.CustomDataSingletonInternalKey = exports.isPrAuthorRelevance = exports.SessionRelevance = void 0;
20
20
  var test_run_types_1 = require("./replay/test-run.types");
21
21
  Object.defineProperty(exports, "SessionRelevance", { enumerable: true, get: function () { return test_run_types_1.SessionRelevance; } });
22
22
  Object.defineProperty(exports, "isPrAuthorRelevance", { enumerable: true, get: function () { return test_run_types_1.isPrAuthorRelevance; } });
@@ -24,5 +24,8 @@ __exportStar(require("./sdk-bundle-api/sdk-to-bundle/test-run-environment"), exp
24
24
  var session_data_1 = require("./sdk-bundle-api/sdk-to-bundle/session-data");
25
25
  Object.defineProperty(exports, "CustomDataSingletonInternalKey", { enumerable: true, get: function () { return session_data_1.CustomDataSingletonInternalKey; } });
26
26
  __exportStar(require("./sdk-bundle-api/sdk-to-bundle/event-source-data"), exports);
27
+ var custom_checks_types_1 = require("./custom-checks.types");
28
+ Object.defineProperty(exports, "NETWORK_REQUESTS_SNAPSHOT_TYPE", { enumerable: true, get: function () { return custom_checks_types_1.NETWORK_REQUESTS_SNAPSHOT_TYPE; } });
29
+ Object.defineProperty(exports, "CUSTOM_CHECK_SUMMARY_MAX_LENGTH", { enumerable: true, get: function () { return custom_checks_types_1.CUSTOM_CHECK_SUMMARY_MAX_LENGTH; } });
27
30
  //# sourceMappingURL=index.js.map
28
- //# debugId=4d355048-519b-539f-97e2-b08438b0f52c
31
+ //# debugId=78889a89-65b0-5901-8866-651c405305a4
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,0DAaiC;AAZ/B,kHAAA,gBAAgB,OAAA;AAChB,qHAAA,mBAAmB,OAAA;AAsBrB,sFAAoE;AAQpE,4EAoBqD;AAPnD,8HAAA,8BAA8B,OAAA;AAoBhC,mFAAiE","debugId":"4d355048-519b-539f-97e2-b08438b0f52c"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,0DAaiC;AAZ/B,kHAAA,gBAAgB,OAAA;AAChB,qHAAA,mBAAmB,OAAA;AAsBrB,sFAAoE;AAQpE,4EAsBqD;AATnD,8HAAA,8BAA8B,OAAA;AAsBhC,mFAAiE;AA0DjE,6DAa+B;AAF7B,qIAAA,8BAA8B,OAAA;AAC9B,sIAAA,+BAA+B,OAAA","debugId":"78889a89-65b0-5901-8866-651c405305a4"}
@@ -82,6 +82,11 @@ export interface SessionData {
82
82
  * Only present on some recordings since ~Feb 2026.
83
83
  */
84
84
  initialNavigationResponse?: HarResponse;
85
+ /**
86
+ * Backend spans captured by the backend recorder.
87
+ * Only present on recordings since ~June 2026.
88
+ */
89
+ backendSpans?: SerializedBackendSpan[];
85
90
  }
86
91
  export interface WindowData {
87
92
  startUrl: string;
@@ -299,4 +304,66 @@ export interface ExpiringImage {
299
304
  compressionStrategy: string;
300
305
  data: string;
301
306
  }
307
+ export interface HttpSpanAttributes {
308
+ "http.request.method"?: string;
309
+ "http.request.method_original"?: string;
310
+ "http.response.status_code"?: number;
311
+ "http.route"?: string;
312
+ "url.full"?: string;
313
+ "url.path"?: string;
314
+ "url.query"?: string;
315
+ "url.scheme"?: string;
316
+ "server.address"?: string;
317
+ "server.port"?: number;
318
+ "client.address"?: string;
319
+ "network.peer.address"?: string;
320
+ "network.peer.port"?: number;
321
+ "network.protocol.version"?: string;
322
+ "user_agent.original"?: string;
323
+ "user_agent.synthetic.type"?: string;
324
+ "error.type"?: string;
325
+ "http.url"?: string;
326
+ "http.method"?: string;
327
+ "http.target"?: string;
328
+ "http.host"?: string;
329
+ "http.scheme"?: string;
330
+ "http.status_code"?: number;
331
+ "http.status_text"?: string;
332
+ "http.flavor"?: string;
333
+ "http.user_agent"?: string;
334
+ "http.client_ip"?: string;
335
+ "http.server_name"?: string;
336
+ "http.request_content_length"?: number;
337
+ "http.request_content_length_uncompressed"?: number;
338
+ "http.response_content_length"?: number;
339
+ "http.response_content_length_uncompressed"?: number;
340
+ "http.error_name"?: string;
341
+ "http.error_message"?: string;
342
+ "net.host.ip"?: string;
343
+ "net.host.name"?: string;
344
+ "net.host.port"?: number;
345
+ "net.peer.ip"?: string;
346
+ "net.peer.name"?: string;
347
+ "net.peer.port"?: number;
348
+ "net.transport"?: string;
349
+ "http.request.body"?: string;
350
+ "http.request.body.truncated"?: boolean;
351
+ "http.response.body"?: string;
352
+ "http.response.body.truncated"?: boolean;
353
+ "meticulous.frontend_session_id"?: string;
354
+ [key: `http.request.header.${string}`]: string[] | undefined;
355
+ [key: `http.response.header.${string}`]: string[] | undefined;
356
+ }
357
+ export interface SerializedBackendSpan {
358
+ name: string;
359
+ traceId: string;
360
+ spanId: string;
361
+ parentSpanId: string | undefined;
362
+ kind: number;
363
+ status: unknown;
364
+ startTimeMs: number;
365
+ endTimeMs: number;
366
+ durationMs: number;
367
+ attributes: HttpSpanAttributes;
368
+ }
302
369
  export {};
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2fe6ab73-e5d4-5417-a556-ffa00d358dcf")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d349248b-6184-531e-9ac2-79dee320d54c")}catch(e){}}();
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.CustomDataSingletonInternalKey = void 0;
@@ -37,4 +37,4 @@ var CustomDataSingletonInternalKey;
37
37
  CustomDataSingletonInternalKey["CustomObjectTooLargeToSerialize"] = "met-custom-object-too-large-to-serialize";
38
38
  })(CustomDataSingletonInternalKey || (exports.CustomDataSingletonInternalKey = CustomDataSingletonInternalKey = {}));
39
39
  //# sourceMappingURL=session-data.js.map
40
- //# debugId=2fe6ab73-e5d4-5417-a556-ffa00d358dcf
40
+ //# debugId=d349248b-6184-531e-9ac2-79dee320d54c
@@ -1 +1 @@
1
- {"version":3,"file":"session-data.js","sources":["../../../src/sdk-bundle-api/sdk-to-bundle/session-data.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AA2QA,IAAY,8BAmCX;AAnCD,WAAY,8BAA8B;IACxC;;;OAGG;IACH,gGAA8D,CAAA;IAE9D;;;;;OAKG;IACH,oEAAkC,CAAA;IAElC;;;;;OAKG;IACH,6DAA2B,CAAA;IAE3B;;;OAGG;IACH,8DAA4B,CAAA;IAE5B;;;;OAIG;IACH,8GAA4E,CAAA;AAC9E,CAAC,EAnCW,8BAA8B,8CAA9B,8BAA8B,QAmCzC","debugId":"2fe6ab73-e5d4-5417-a556-ffa00d358dcf"}
1
+ {"version":3,"file":"session-data.js","sources":["../../../src/sdk-bundle-api/sdk-to-bundle/session-data.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAiRA,IAAY,8BAmCX;AAnCD,WAAY,8BAA8B;IACxC;;;OAGG;IACH,gGAA8D,CAAA;IAE9D;;;;;OAKG;IACH,oEAAkC,CAAA;IAElC;;;;;OAKG;IACH,6DAA2B,CAAA;IAE3B;;;OAGG;IACH,8DAA4B,CAAA;IAE5B;;;;OAIG;IACH,8GAA4E,CAAA;AAC9E,CAAC,EAnCW,8BAA8B,8CAA9B,8BAA8B,QAmCzC","debugId":"d349248b-6184-531e-9ac2-79dee320d54c"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/api",
3
- "version": "2.286.0",
3
+ "version": "2.288.2",
4
4
  "description": "Meticulous API types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",