From db0b72a4e0b75dc39e01bd191b94ea6214704ea4 Mon Sep 17 00:00:00 2001 From: Ole Zierau Date: Wed, 14 Aug 2024 10:07:46 +0200 Subject: [PATCH 1/2] notix: add ab test api --- src/ps-web-apis.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ps-web-apis.ts b/src/ps-web-apis.ts index 533b8de..9bb9dd9 100644 --- a/src/ps-web-apis.ts +++ b/src/ps-web-apis.ts @@ -174,6 +174,11 @@ export interface UtilsV1 { getRosettaEnvByKey: GetRosettaEnvByKey; registerIframeMessageListener: RegisterIframeMessageListener; } + +export interface AbV1 { + userInTestGroupForFeature: (key: string) => { canSeeFeature: boolean, testGroup: string }; +} + export interface WaitingRoomV1 { waitForCapacity: WaitForCapacity; } @@ -218,6 +223,10 @@ export function waitingRoomV1(): Promise { return requireApi("waiting_room:v1"); } +export function abV1(): Promise { + return requirePackage("ab:v1"); +} + export function CligV1(): Promise { return requirePackage("ppclig:v1"); } From 4b62614616aa68faa9161fd9acb837b5ca6eb055 Mon Sep 17 00:00:00 2001 From: Ole Zierau Date: Wed, 14 Aug 2024 10:28:16 +0200 Subject: [PATCH 2/2] notix: update type for testGroup --- src/ps-web-apis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ps-web-apis.ts b/src/ps-web-apis.ts index 9bb9dd9..230ddd5 100644 --- a/src/ps-web-apis.ts +++ b/src/ps-web-apis.ts @@ -176,7 +176,7 @@ export interface UtilsV1 { } export interface AbV1 { - userInTestGroupForFeature: (key: string) => { canSeeFeature: boolean, testGroup: string }; + userInTestGroupForFeature: (key: string) => { canSeeFeature: boolean, testGroup: "A" | "B" }; } export interface WaitingRoomV1 {