@alwaysmeticulous/sdk-bundles-api 2.43.0 → 2.44.1

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/README.md CHANGED
@@ -1 +1,3 @@
1
- # Meticulous Common Types
1
+ # SDK to Bundles API
2
+
3
+ Any interface used in the API for communicating between the bundles and the SDK should live in here, unless they are also used in the backend API, or persisted to a database in which case they should live in the 'sdk-bundle-api' sub-folder of the 'api' package.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  export { RecordConfig, RecordSettings, RecordState } from "./record";
2
2
  export { MeticulousWindowConfig, NetworkResponseSanitizer, } from "./record/record-settings";
3
- export { ReplayUserInteractionsResult, ReplayUserInteractionsResultFull, ReplayUserInteractionsResultShort, BeforeUserEventOptions, } from "./replay/bundle-to-sdk/index";
4
- export { BootstrapReplayUserInteractionsFn, BootstrapReplayUserInteractionsOptions, OnReplayTimelineEventFn, ReplayUserInteractionsFn, ReplayUserInteractionsOptions, VirtualTimeOptions, InstallVirtualEventLoopOpts, SetupReplayNetworkStubbingFn, NetworkStubbingOptions, BrowserContextSeedingOptions, SetupBrowserContextSeedingFn, ScreenshottingOptions, } from "./replay/sdk-to-bundle";
5
- export { ReplayAndStoreResultsOptions, ReplayTarget, SnapshottedAssetsReplayTarget, URLReplayTarget, OriginalRecordedURLReplayTarget, ReplayExecutionOptions, ReplayOrchestratorScreenshottingOptions, ScreenshottingEnabledOptions, StoryboardOptions, GeneratedBy, GeneratedByNotebookRun, GeneratedByTestRun, GeneratedByReplayCommand, ScreenshotComparisonOptions, ScreenshotComparisonEnabledOptions, CompareScreenshotsTo, CompareScreenshotsToSpecificReplay, CompareScreenshotsToTestRun, DoNotCompareScreenshots, OutOfDateClientError, } from "./replay-orchestrator/sdk-to-bundle/execute-replay";
3
+ export { ReplayAndStoreResultsOptions, ReplayTarget, SnapshottedAssetsReplayTarget, URLReplayTarget, OriginalRecordedURLReplayTarget, ReplayExecutionOptions, ReplayOrchestratorScreenshottingOptions, ScreenshottingEnabledOptions, StoryboardOptions, GeneratedBy, GeneratedByNotebookRun, GeneratedByTestRun, GeneratedByReplayCommand, ScreenshotComparisonOptions, ScreenshotComparisonEnabledOptions, CompareScreenshotsTo, CompareScreenshotsToSpecificReplay, CompareScreenshotsToTestRun, DoNotCompareScreenshots, OutOfDateClientError, BeforeUserEventOptions, } from "./replay-orchestrator/sdk-to-bundle/execute-replay";
6
4
  export { ExecuteTestRunOptions } from "./replay-orchestrator/sdk-to-bundle/execute-test-run";
7
5
  export { ExecuteTestRunResult, TestRunExecution, RunningTestRunExecution, FinishedTestRunExecution, TestRunProgress, DetailedTestCaseResult, } from "./replay-orchestrator/bundle-to-sdk/execute-test-run";
8
6
  export { ReplayAndStoreResultsResult, ReplayExecution, BeforeUserEventResult, } from "./replay-orchestrator/bundle-to-sdk/execute-replay";
@@ -1,12 +1,15 @@
1
- import { ScreenshotDiffResult, TestCaseResult, TestRun } from "@alwaysmeticulous/api";
1
+ import { Project, ScreenshotDiffResult, TestCaseResult, TestRunStatus } from "@alwaysmeticulous/api";
2
2
  export interface ExecuteTestRunResult {
3
3
  testRun: FinishedTestRunExecution;
4
4
  testCaseResults: DetailedTestCaseResult[];
5
5
  }
6
- export type TestRunExecution = Pick<TestRun, "id" | "url" | "status" | "project"> & {
6
+ export interface TestRunExecution {
7
+ id: string;
8
+ status: TestRunStatus;
9
+ project: Project;
7
10
  progress: TestRunProgress;
8
11
  url: string;
9
- };
12
+ }
10
13
  export interface RunningTestRunExecution extends TestRunExecution {
11
14
  status: "Running";
12
15
  }
@@ -1,6 +1,5 @@
1
1
  import { ScreenshotDiffOptions } from "@alwaysmeticulous/api";
2
2
  import { LogLevelNumbers } from "loglevel";
3
- import { BeforeUserEventOptions } from "../../replay/bundle-to-sdk";
4
3
  import { BeforeUserEventResult } from "../bundle-to-sdk/execute-replay";
5
4
  export interface ReplayAndStoreResultsOptions {
6
5
  replayTarget: ReplayTarget;
@@ -37,6 +36,12 @@ export interface ReplayAndStoreResultsOptions {
37
36
  */
38
37
  maxSemanticVersionSupported: 1;
39
38
  }
39
+ export interface BeforeUserEventOptions {
40
+ /**
41
+ * The index of the next event in sessionData.userEvents.event_log
42
+ */
43
+ userEventIndex: number;
44
+ }
40
45
  /**
41
46
  * See {@link ReplayAndStoreResultsOptions.maxSemanticVersionSupported} for more details.
42
47
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/sdk-bundles-api",
3
- "version": "2.43.0",
3
+ "version": "2.44.1",
4
4
  "description": "Meticulous common types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -19,18 +19,14 @@
19
19
  "depcheck": "depcheck --ignore-patterns=dist"
20
20
  },
21
21
  "devDependencies": {
22
- "@alwaysmeticulous/api": "^2.42.0"
22
+ "@alwaysmeticulous/api": "^2.44.1"
23
23
  },
24
24
  "peerDependencies": {
25
- "loglevel": "^1.8.0",
26
- "puppeteer": "^19.7.5"
25
+ "loglevel": "^1.8.0"
27
26
  },
28
27
  "peerDependenciesMeta": {
29
28
  "loglevel": {
30
29
  "optional": true
31
- },
32
- "puppeteer": {
33
- "optional": true
34
30
  }
35
31
  },
36
32
  "author": {
@@ -50,5 +46,5 @@
50
46
  "bugs": {
51
47
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
52
48
  },
53
- "gitHead": "7664f4dfeed3b08e5523c0acb4d98d11eee4c9ff"
49
+ "gitHead": "1fd294cb699681672742e566ccc9ae0f4cb75b02"
54
50
  }
@@ -1,17 +0,0 @@
1
- /** Result of replaying user interactions */
2
- export type ReplayUserInteractionsResult = ReplayUserInteractionsResultFull | ReplayUserInteractionsResultShort;
3
- /** Returned when the recorded session has been fully replayed */
4
- export interface ReplayUserInteractionsResultFull {
5
- length: "full";
6
- }
7
- /** Returned when the recorded session has been cut short during replay */
8
- export interface ReplayUserInteractionsResultShort {
9
- length: "short";
10
- reason: "max events" | "max duration" | "full page navigation" | "error";
11
- }
12
- export interface BeforeUserEventOptions {
13
- /**
14
- * The index of the next event in sessionData.userEvents.event_log
15
- */
16
- userEventIndex: number;
17
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,73 +0,0 @@
1
- import { SessionData, SDKReplayTimelineEntry } from "@alwaysmeticulous/api";
2
- import type { LogLevelDesc } from "loglevel";
3
- import type { Page } from "puppeteer";
4
- import { BeforeUserEventOptions, ReplayUserInteractionsResult } from "../bundle-to-sdk";
5
- export interface ReplayUserInteractionsOptions {
6
- /**
7
- * A semantic version number for the SDK calling into the replay code.
8
- *
9
- * This version number is bumped on every API change, and allows the replay
10
- * code to detect if it's being called by an old version, and if so throw
11
- * and request the user updates to a newer version.
12
- */
13
- sdkSemanticVersion: number;
14
- page: Page;
15
- sessionData: unknown;
16
- moveBeforeClick: boolean;
17
- virtualTime?: VirtualTimeOptions;
18
- maxDurationMs?: number;
19
- maxEventCount?: number;
20
- sessionDurationMs: number;
21
- logLevel: LogLevelDesc;
22
- screenshots: ScreenshottingOptions;
23
- onTimelineEvent: OnReplayTimelineEventFn;
24
- /**
25
- * If present then will be called before executing each next user event,
26
- * and will wait for the completion of the returned promise before continuing.
27
- */
28
- onBeforeUserEvent?: OnBeforeUserEventFn;
29
- }
30
- export interface ScreenshottingOptions {
31
- screenshotsDirectory: string;
32
- takeIntermediateScreenshots: boolean;
33
- takeEndStateScreenshot: boolean;
34
- }
35
- /** Replay function for user interaction events */
36
- export type ReplayUserInteractionsFn = (options: ReplayUserInteractionsOptions) => Promise<ReplayUserInteractionsResult>;
37
- export interface BootstrapReplayUserInteractionsOptions {
38
- page: Page;
39
- logLevel: LogLevelDesc;
40
- }
41
- export type BootstrapReplayUserInteractionsFn = (options: BootstrapReplayUserInteractionsOptions) => Promise<ReplayUserInteractionsFn>;
42
- export type VirtualTimeOptions = {
43
- enabled: false;
44
- } | {
45
- enabled: true;
46
- };
47
- export type OnReplayTimelineEventFn = (entry: SDKReplayTimelineEntry) => void;
48
- export type OnBeforeUserEventFn = (options: BeforeUserEventOptions) => Promise<void>;
49
- export interface NetworkStubbingOptions {
50
- page: Page;
51
- logLevel: LogLevelDesc;
52
- sessionData: SessionData;
53
- startUrl: string;
54
- originalSessionStartUrl: string;
55
- onTimelineEvent: OnReplayTimelineEventFn;
56
- }
57
- export type SetupReplayNetworkStubbingFn = (options: NetworkStubbingOptions) => Promise<void>;
58
- export interface BrowserContextSeedingOptions {
59
- page: Page;
60
- sessionData: SessionData;
61
- startUrl: string;
62
- }
63
- export type SetupBrowserContextSeedingFn = (options: BrowserContextSeedingOptions) => Promise<void>;
64
- export interface InstallVirtualEventLoopOpts {
65
- /**
66
- * The start time of the original session in ms since unix epoch (Date.now()).
67
- *
68
- * This is used to ensure that the application code thinks it's running at the same
69
- * time as the original session during replay, to minimize differences vs the original
70
- * session.
71
- */
72
- sessionStartTime: number;
73
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });