@avsbhq/cli 3.8.1 → 3.9.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/LICENSE +21 -0
- package/README.md +17 -8
- package/dist/cli.js +1444 -759
- package/dist/types/avsb.d.ts +9 -5
- package/dist/types/variation-code.d.ts +1 -1
- package/package.json +3 -2
package/dist/types/avsb.d.ts
CHANGED
|
@@ -349,8 +349,8 @@ interface AvsbUtils {
|
|
|
349
349
|
|
|
350
350
|
// --- Experiment decisions ---
|
|
351
351
|
|
|
352
|
-
/** Why an experiment did or did not run for this visit. `variant` / `control` mean the visitor is IN the test. */
|
|
353
|
-
type AvsbDecisionStatus = 'variant' | 'control' | 'trigger-pending' | 'not-targeted' | 'audience-mismatch' | 'excluded' | 'traffic-holdout' | 'capped' | 'scheduled-off' | 'error'
|
|
352
|
+
/** Why an experiment did or did not run for this visit. `variant` / `control` mean the visitor is IN the test. `self-redirect` also means IN the test: the visitor is bucketed to a split-URL variant whose destination is the page they are already on, so the redirect was refused instead of looped. `late` means the page's reveal deadline had passed before the experiment could be applied, so it was skipped whole for this page load and nobody was exposed. `unsupported` means this build of the snippet does not carry a feature the experiment needs, so it was skipped whole and reported. `error` stays the genuine failure bucket. */
|
|
353
|
+
type AvsbDecisionStatus = 'variant' | 'control' | 'trigger-pending' | 'self-redirect' | 'not-targeted' | 'audience-mismatch' | 'excluded' | 'traffic-holdout' | 'capped' | 'scheduled-off' | 'late' | 'unsupported' | 'error'
|
|
354
354
|
|
|
355
355
|
/** One row of `avsb.getExperimentDecisions()`. The variation fields are present only when a variation was assigned. */
|
|
356
356
|
interface AvsbExperimentDecision {
|
|
@@ -374,8 +374,8 @@ interface AvsbApi {
|
|
|
374
374
|
setVisitorId(visitorId: string): boolean
|
|
375
375
|
/** The variation this visitor is assigned in the experiment, or null. Pass the numeric **Experiment ID** from the experiment details panel (a number or its string form); the value returned is that variation's numeric **Variation ID**. Internal UUIDs are not accepted. */
|
|
376
376
|
getVariation(experimentId: string | number): string | null
|
|
377
|
-
/** Force a variation, for QA, by the numeric **Experiment ID** and **Variation ID** shown in the experiment details panel. `{ track: false }` applies it without recording an exposure. */
|
|
378
|
-
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean }): boolean
|
|
377
|
+
/** Force a variation, for QA, by the numeric **Experiment ID** and **Variation ID** shown in the experiment details panel. It stays the visitor's variation on later page loads until `exitPreview()`; `{ persist: false }` forces it for this page only. `{ track: false }` applies it without recording an exposure. */
|
|
378
|
+
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean; persist?: boolean }): boolean
|
|
379
379
|
waitUntil: AvsbWaitUntilFn
|
|
380
380
|
utils: AvsbUtils
|
|
381
381
|
/** Subscribe to every experiment event. Returns an unsubscribe function. Absent in the preview bypass runtime. */
|
|
@@ -396,12 +396,16 @@ interface AvsbApi {
|
|
|
396
396
|
recs: AvsbRecsClient
|
|
397
397
|
/** Commerce events. Buffered until the commerce chunk loads. */
|
|
398
398
|
commerce: AvsbCommerceApi
|
|
399
|
-
/** Leave a shared preview link
|
|
399
|
+
/** Leave a shared preview link and undo every persisted `forceVariation`: clears both and reloads. */
|
|
400
400
|
exitPreview(): void
|
|
401
|
+
/** After a split-URL redirect in this tab: the referrer of the page the visitor was redirected FROM, captured before the redirect so your analytics can undo the self-referral. `''` means that visit was direct; `null` means no redirect has happened (or storage is unavailable). Same-origin only, so a destination on a different domain cannot read it. Optional: absent on snippet builds that predate it, so read it as `avsb.getOriginalReferrer?.()`. */
|
|
402
|
+
getOriginalReferrer?(): string | null
|
|
401
403
|
/** Re-run every experiment against the page as it is now. For app-driven navigation the History API never sees. */
|
|
402
404
|
refresh(): void
|
|
403
405
|
/** The snippet build running on this page, e.g. `1.1.0`. */
|
|
404
406
|
version: string
|
|
407
|
+
/** Which of the four snippet files this page is running: `full`, `visual`, `shop` or `core`. Optional: absent on snippet builds that predate named files, and until the first install stamp lands. A build that does not name its file always carries everything, so treat an absent value as `full`. */
|
|
408
|
+
buildVariant?: string
|
|
405
409
|
}
|
|
406
410
|
|
|
407
411
|
/** `window.avsb`. `q` is the install tag's early-call queue, drained by the runtime. */
|
|
@@ -38,7 +38,7 @@ interface AvsbCodeOptions {
|
|
|
38
38
|
/** Experiments running on this page, as the same numeric dashboard ids. */
|
|
39
39
|
getActiveExperiments(): Array<{ experimentId: string; variationId: string }>
|
|
40
40
|
/** Force a variation by the numeric **Experiment ID** and **Variation ID** from the experiment details panel. */
|
|
41
|
-
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean }): boolean
|
|
41
|
+
forceVariation(experimentId: string | number, variationId: string | number, options?: { track?: boolean; persist?: boolean }): boolean
|
|
42
42
|
/** Cancelled automatically on teardown, unlike `avsb.waitUntil`. */
|
|
43
43
|
waitUntil: AvsbWaitUntilFn
|
|
44
44
|
utils: AvsbUtils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avsbhq/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "CLI tool for local A/B experiment development with the A vs B platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"bin",
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"LICENSE"
|
|
22
23
|
],
|
|
23
24
|
"publishConfig": {
|
|
24
25
|
"access": "public"
|