@alwaysmeticulous/sdk-bundles-api 2.349.0 → 3.0.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
|
@@ -10,7 +10,7 @@ export { InProgressTestRun } from "./replay-orchestrator/bundle-to-sdk/execute-s
|
|
|
10
10
|
export { InProgressTestRunChunk, ExecuteTestRunChunkResult, TestRunChunkExecution, } from "./replay-orchestrator/bundle-to-sdk/execute-scheduled-test-run-chunk";
|
|
11
11
|
export { ReplayAndStoreResultsResult, ReplayExecution, BeforeUserEventResult, IndexedReplayableEvent, } from "./replay-orchestrator/bundle-to-sdk/execute-replay";
|
|
12
12
|
export { ScreenshotDiffData } from "./replay-orchestrator/bundle-to-sdk/execute-replay";
|
|
13
|
-
export { MeticulousPublicApi, FeatureFlagOverride, MeticulousPressureObserver, MeticulousPressureObserverConstructor, MeticulousPressureRecord, MeticulousPressureSource, MeticulousPressureState, RecordCustomSnapshotOptions, OnBeforeScreenshotListener, OnBeforeScreenshotListenerOptions, OnReplayCompletionListener, OnReplayCompletionListenerOptions, } from "./window-api/public-window-api";
|
|
13
|
+
export { MeticulousPublicApi, MeticulousPublicAgentSwarmReplayApi, FeatureFlagOverride, RecordFeatureFlagOptions, MeticulousPressureObserver, MeticulousPressureObserverConstructor, MeticulousPressureRecord, MeticulousPressureSource, MeticulousPressureState, RecordCustomSnapshotOptions, OnBeforeScreenshotListener, OnBeforeScreenshotListenerOptions, OnReplayCompletionListener, OnReplayCompletionListenerOptions, } from "./window-api/public-window-api";
|
|
14
14
|
export { MeticulousPrivateApi } from "./window-api/private-window-api";
|
|
15
15
|
export { CrawlExplorationMode, RunCrawlOptions, RunCrawlResult, } from "./crawler/sdk-to-bundle/run-crawl";
|
|
16
16
|
export { BackendRecorderConfig, BackendRecorderSpanRedactionHook, } from "./backend-recorder/sdk-to-bundle/init-backend-recorder";
|
|
@@ -111,6 +111,17 @@ export interface ReplayAndStoreResultsOptions {
|
|
|
111
111
|
chunkNumber: number;
|
|
112
112
|
chunkAttempt: number;
|
|
113
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Customer feature flag values this replay should force, keyed by flag name. Served to the
|
|
116
|
+
* application through `window.Meticulous.context.getFlagOverride` and `getAllFlagOverrides`.
|
|
117
|
+
* Absent or empty means no flag is overridden. Distinct from Meticulous's own engine
|
|
118
|
+
* feature flags.
|
|
119
|
+
*
|
|
120
|
+
* In cloud test runs this is only set on flag-variant replays, never on the ordinary
|
|
121
|
+
* golden-set pair: forcing flags there would churn screenshots against the value the
|
|
122
|
+
* session recorded.
|
|
123
|
+
*/
|
|
124
|
+
customerFeatureFlagOverrides?: Record<string, string | boolean>;
|
|
114
125
|
}
|
|
115
126
|
export interface PreNavigationResult {
|
|
116
127
|
cookies: Cookie[];
|
|
@@ -4,15 +4,37 @@ import type { HarResponse } from "@alwaysmeticulous/api";
|
|
|
4
4
|
*/
|
|
5
5
|
export type MeticulousPublicApi = MeticulousPublicApiCommon & ({
|
|
6
6
|
isRunningAsTest: true;
|
|
7
|
+
isRunningInAgentSwarm?: false;
|
|
7
8
|
replay: MeticulousPublicReplayApi;
|
|
9
|
+
} | {
|
|
10
|
+
isRunningAsTest: true;
|
|
11
|
+
isRunningInAgentSwarm: true;
|
|
12
|
+
replay: MeticulousPublicAgentSwarmReplayApi;
|
|
13
|
+
record: MeticulousPublicRecordApi;
|
|
8
14
|
} | {
|
|
9
15
|
isRunningAsTest: false;
|
|
16
|
+
isRunningInAgentSwarm?: false;
|
|
10
17
|
record: MeticulousPublicRecordApi;
|
|
11
18
|
});
|
|
12
19
|
export interface MeticulousPublicApiCommon {
|
|
13
20
|
isRunningAsTest?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* True when the app is being driven by a Meticulous Agent swarm browser,
|
|
23
|
+
* which records new sessions against a test deployment. `isRunningAsTest` is
|
|
24
|
+
* also true there, so apps that relax behaviour for Meticulous tests do the
|
|
25
|
+
* same for Agent swarm; check this flag only to tell the two apart.
|
|
26
|
+
*/
|
|
27
|
+
isRunningInAgentSwarm?: boolean;
|
|
14
28
|
context: MeticulousPublicContextApi;
|
|
15
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* The replay API exposed in Agent swarm, where no replay is running. Its
|
|
32
|
+
* methods are no-ops so code written for replays keeps working, and replay-only
|
|
33
|
+
* data such as the session being replayed is absent.
|
|
34
|
+
*/
|
|
35
|
+
export type MeticulousPublicAgentSwarmReplayApi = Omit<MeticulousPublicReplayApi, "isBenchmarkableReplay" | "native" | "commitUnderTest" | "sessionBeingReplayed" | "browser"> & {
|
|
36
|
+
isBenchmarkableReplay: false;
|
|
37
|
+
};
|
|
16
38
|
/**
|
|
17
39
|
* Options for {@link MeticulousPublicReplayApi.recordCustomSnapshot}.
|
|
18
40
|
*/
|
|
@@ -411,15 +433,33 @@ export type FeatureFlagOverride = {
|
|
|
411
433
|
overridden: true;
|
|
412
434
|
value: string | boolean;
|
|
413
435
|
};
|
|
436
|
+
export interface RecordFeatureFlagOptions {
|
|
437
|
+
/**
|
|
438
|
+
* Human-readable name to show for this flag in the Meticulous UI, e.g. `"New checkout flow"`
|
|
439
|
+
* for the key `"checkout-v3"`. Defaults to the flag's key. Meticulous still identifies the flag
|
|
440
|
+
* by its key everywhere else, including {@link MeticulousPublicContextApi.getFlagOverride}.
|
|
441
|
+
*
|
|
442
|
+
* Must be a non-empty string of at most 1000 characters. Otherwise the call records nothing and
|
|
443
|
+
* returns `{ success: false }`.
|
|
444
|
+
*/
|
|
445
|
+
label?: string;
|
|
446
|
+
}
|
|
414
447
|
export interface MeticulousPublicContextApi {
|
|
415
448
|
/**
|
|
416
449
|
* Record the value of a feature flag that your application actually used. If this
|
|
417
|
-
* method is called multiple times with the same
|
|
450
|
+
* method is called multiple times with the same key, the value (and label, if given) will be
|
|
451
|
+
* overwritten.
|
|
418
452
|
*
|
|
419
453
|
* If you also call {@link getFlagOverride} in the same resolver, record the value you
|
|
420
454
|
* returned after applying the override — not a later snapshot from your flag SDK.
|
|
455
|
+
*
|
|
456
|
+
* ```js
|
|
457
|
+
* window.Meticulous?.context?.recordFeatureFlag?.("checkout-v3", true, {
|
|
458
|
+
* label: "New checkout flow",
|
|
459
|
+
* });
|
|
460
|
+
* ```
|
|
421
461
|
*/
|
|
422
|
-
recordFeatureFlag(
|
|
462
|
+
recordFeatureFlag(key: string, value: string | boolean, options?: RecordFeatureFlagOptions): {
|
|
423
463
|
success: boolean;
|
|
424
464
|
};
|
|
425
465
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/sdk-bundles-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Meticulous common types",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@alwaysmeticulous/api": "
|
|
12
|
+
"@alwaysmeticulous/api": "3.0.0"
|
|
13
13
|
},
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "The Meticulous Team",
|