@alwaysmeticulous/api 2.110.0 → 2.114.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
@@ -5,7 +5,7 @@ export { TestCase, TestCaseReplayOptions, TestRunStatus, TestCaseResult, TestCas
5
5
  export { TestRunEnvironment, TestRunGitHubContext, TestRunGitHubPullRequestContext, TestRunGitHubPushContext, TestRunGitHubWorkflowDispatchContext, TestRunGitLabContext, TestRunGitLabMergeRequestContext, TestRunGitLabPushContext, } from "./sdk-bundle-api/sdk-to-bundle/test-run-environment";
6
6
  export { ReplayableEvent } from "./sdk-bundle-api/bidirectional/replayable-event";
7
7
  export { HarEntry, HarLog, HarRequest, HarResponse, } from "./sdk-bundle-api/sdk-to-bundle/har-log";
8
- export { Cookie, SessionData, UrlHistoryEvent, WindowData, ApplicationSpecificData, StorageEntry, EarlyRequest, } from "./sdk-bundle-api/sdk-to-bundle/session-data";
8
+ export { Cookie, SessionData, UrlHistoryEvent, WindowData, ApplicationSpecificData, StorageEntry, EarlyRequest, SequenceNumber, WebSocketConnectionData, WebSocketConnectionEvent, } from "./sdk-bundle-api/sdk-to-bundle/session-data";
9
9
  export { Replay } from "./replay/replay.types";
10
10
  export { ScreenshotAssertionsOptions, ScreenshotAssertionsEnabledOptions, ScreenshottingEnabledOptions, StoryboardOptions, ScreenshotDiffOptions, ElementToIgnore, CSSSelectorToIgnore, } from "./sdk-bundle-api/sdk-to-bundle/screenshotting-options";
11
11
  export { NetworkStubbingMode, StubAllRequests, StubNonSSRRequests, NoStubbing, CustomStubbing, RequestFilter, } from "./sdk-bundle-api/sdk-to-bundle/network-stubbing";
@@ -25,7 +25,14 @@ export interface RequestFilter {
25
25
  * Any JS regex that passes https://github.com/tjenkinson/redos-detector is supported.
26
26
  */
27
27
  urlRegex: string;
28
+ /** Defaults to `{ fetch: true, xhr: true, webSockets: true }` */
29
+ connectionTypes?: ConnectionTypesFilter;
28
30
  }
29
31
  export interface NoStubbing {
30
32
  type: "no-stubbing";
31
33
  }
34
+ export interface ConnectionTypesFilter {
35
+ fetch: boolean;
36
+ xhr: boolean;
37
+ webSockets: boolean;
38
+ }
@@ -26,6 +26,10 @@ export interface SessionData {
26
26
  state: StorageEntry[];
27
27
  };
28
28
  };
29
+ /**
30
+ * Only present on recordings since ~March 2024
31
+ */
32
+ webSocketData?: WebSocketConnectionData[];
29
33
  cookies: Cookie[];
30
34
  urlHistory: UrlHistoryEvent[];
31
35
  rrwebEvents: unknown[];
@@ -87,3 +91,22 @@ export interface EarlyRequest {
87
91
  startTime: number;
88
92
  duration: number;
89
93
  }
94
+ export type SequenceNumber = number;
95
+ export interface WebSocketConnectionData {
96
+ id: SequenceNumber;
97
+ url: string;
98
+ events: WebSocketConnectionEvent[];
99
+ }
100
+ export interface WebSocketConnectionEvent {
101
+ /**
102
+ * The time in milliseconds since the start of the session.
103
+ *
104
+ * During simulations, we consider the "created" event to have been replayed whenever the browser calls
105
+ * `new WebSocket()` and all other events are replayed at a time relative to the "created" event's timestamp.
106
+ *
107
+ * E.g. the "opened" event is replayed at ("opened".timestamp - "created".timestamp) milliseconds after the browser calls `new WebSocket()`.
108
+ */
109
+ timestamp: number;
110
+ type: "created" | "opened" | "message-sent" | "message-received" | "closed" | "error";
111
+ data?: string;
112
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/api",
3
- "version": "2.110.0",
3
+ "version": "2.114.0",
4
4
  "description": "Meticulous API types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
37
37
  },
38
- "gitHead": "40503f160d772a272af67e2a615c2cea990b8c9d"
38
+ "gitHead": "ec71e1186c70d923c01f0b0d79c042443e027b06"
39
39
  }