@alwaysmeticulous/sdk-bundles-api 2.53.0 → 2.60.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.
@@ -1,6 +1,7 @@
1
1
  import { ScreenshotDiffOptions } from "@alwaysmeticulous/api";
2
2
  import { LogLevelNumbers } from "loglevel";
3
3
  import { BeforeUserEventResult } from "../bundle-to-sdk/execute-replay";
4
+ import { NetworkStubbingMode } from "./network-stubbing";
4
5
  export interface ReplayAndStoreResultsOptions {
5
6
  chromeExecutablePath?: string;
6
7
  replayTarget: ReplayTarget;
@@ -36,6 +37,12 @@ export interface ReplayAndStoreResultsOptions {
36
37
  * that all clients bump the version number passed when they upgrade to the types.
37
38
  */
38
39
  maxSemanticVersionSupported: 1;
40
+ /**
41
+ * The version of the environment in which a replay is executed. This should be bumped
42
+ * whenever the environment changes in a way that affects the replay, e.g. the version of
43
+ * Chromium, or the version of Puppeteer.
44
+ */
45
+ logicalEnvironmentVersion?: number;
39
46
  }
40
47
  export interface BeforeUserEventOptions {
41
48
  /**
@@ -109,6 +116,12 @@ export interface ReplayExecutionOptions {
109
116
  bypassCSP: boolean;
110
117
  shiftTime: boolean;
111
118
  networkStubbing: boolean;
119
+ /**
120
+ * Defaults to {@link StubAllRequests}
121
+ *
122
+ * networkStubbing must be true if networkStubbingMode is set.
123
+ */
124
+ networkStubbingMode?: NetworkStubbingMode;
112
125
  skipPauses: boolean;
113
126
  moveBeforeClick: boolean;
114
127
  disableRemoteFonts: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ExecuteTestRunOptions } from "./execute-test-run";
2
- export type ExecuteScheduledTestRunOptions = Pick<ExecuteTestRunOptions, "chromeExecutablePath" | "apiToken" | "parallelTasks" | "maxRetriesOnFailure" | "rerunTestsNTimes" | "logLevel"> & {
2
+ export type ExecuteScheduledTestRunOptions = Pick<ExecuteTestRunOptions, "chromeExecutablePath" | "apiToken" | "parallelTasks" | "maxRetriesOnFailure" | "rerunTestsNTimes" | "logLevel" | "logicalEnvironmentVersion"> & {
3
3
  /**
4
4
  * The ID of the scheduled test run to execute.
5
5
  */
@@ -58,4 +58,10 @@ export interface ExecuteTestRunOptions {
58
58
  * that all clients bump the version number passed when they upgrade to the types.
59
59
  */
60
60
  maxSemanticVersionSupported: 1;
61
+ /**
62
+ * The version of the environment in which a replay is executed. This should be bumped
63
+ * whenever the environment changes in a way that affects the replay, e.g. the version of
64
+ * Chromium, or the version of Puppeteer.
65
+ */
66
+ logicalEnvironmentVersion?: number;
61
67
  }
@@ -0,0 +1,31 @@
1
+ export type NetworkStubbingMode = StubAllRequests | StubNonSSRRequests | CustomStubbing;
2
+ /**
3
+ * The default mode. Stubs all requests, apart from ones for _next/static/ files.
4
+ */
5
+ export interface StubAllRequests {
6
+ type: "stub-all-requests";
7
+ }
8
+ /**
9
+ * Stubs all requests apart from NextJS 13 /app dir requests to render server components, and requests for _next/static/ files.
10
+ *
11
+ * Used for NextJs 13 /app directory & server components.
12
+ */
13
+ export interface StubNonSSRRequests {
14
+ type: "stub-non-ssr-requests";
15
+ }
16
+ export interface CustomStubbing {
17
+ type: "custom-stubbing";
18
+ requestsToNotStub: RequestFilter[];
19
+ }
20
+ export interface RequestFilter {
21
+ /**
22
+ * If defined will filter to only match requests to a URL matching the
23
+ * specified regex.
24
+ *
25
+ * Any JS regex that passes https://github.com/tjenkinson/redos-detector is supported.
26
+ */
27
+ urlRegex: string;
28
+ }
29
+ export interface NoStubbing {
30
+ type: "no-stubbing";
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/sdk-bundles-api",
3
- "version": "2.53.0",
3
+ "version": "2.60.0",
4
4
  "description": "Meticulous common types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "depcheck": "depcheck --ignore-patterns=dist"
20
20
  },
21
21
  "devDependencies": {
22
- "@alwaysmeticulous/api": "^2.53.0"
22
+ "@alwaysmeticulous/api": "^2.56.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "loglevel": "^1.8.0"
@@ -46,5 +46,5 @@
46
46
  "bugs": {
47
47
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
48
48
  },
49
- "gitHead": "ab27f3ab8a2190402938ac64f0a8847e130bd9f3"
49
+ "gitHead": "79db2c64a95e1e13360fc94610cd717bbb9baded"
50
50
  }