@arkadiuminc/sdk 2.69.2 → 2.70.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.
@@ -0,0 +1,28 @@
1
+ export declare type ABTestGroup = {
2
+ weight: number;
3
+ value: unknown;
4
+ };
5
+ export declare type ABTestDefinition = {
6
+ ABTest: string;
7
+ enabled?: boolean;
8
+ groups: ABTestGroup[];
9
+ };
10
+ export declare type ABTestAssignment = {
11
+ name: string;
12
+ group: number;
13
+ };
14
+ export declare class ABTestService {
15
+ private static _instance;
16
+ private _assignments;
17
+ private constructor();
18
+ static get Instance(): ABTestService;
19
+ resolveConfig<T>(config: T): T;
20
+ getAssignments(): ABTestAssignment[];
21
+ setAssignments(assignments: ABTestAssignment[]): void;
22
+ appendToAbVariations(existing: string | undefined): string | undefined;
23
+ resetAssignments(): void;
24
+ private getOrAssignGroup;
25
+ private getStorage;
26
+ private readStoredGroup;
27
+ private storeGroup;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ import { ABTestAssignment } from './ab-test-service';
1
2
  import { ArenaType } from '../features/host/arena-type';
2
3
  import { IHost } from '../features/host';
3
4
 
@@ -12,10 +13,12 @@ export declare enum GameConfigProperty {
12
13
  hasEagle = "hasEagle",
13
14
  slug = "slug"
14
15
  }
15
- declare type LifecycleBlacklistEntry = {
16
+ declare type GamePlatformFilterEntry = {
16
17
  games?: string[];
17
18
  platformTypes?: ArenaType[];
18
19
  };
20
+ declare type LifecycleBlacklistEntry = GamePlatformFilterEntry;
21
+ export declare type AdBlockerDetectionEntry = GamePlatformFilterEntry;
19
22
  declare type LifecycleEventConfig = {
20
23
  blacklists: LifecycleBlacklistEntry[];
21
24
  };
@@ -46,6 +49,7 @@ export interface ConfigSchema {
46
49
  cooldown: number;
47
50
  };
48
51
  }>;
52
+ adBlockerDetection: AdBlockerDetectionEntry[];
49
53
  };
50
54
  }
51
55
  export declare const defaultConfig: ConfigSchema;
@@ -185,6 +189,31 @@ export declare const schema: {
185
189
  additionalProperties: boolean;
186
190
  };
187
191
  };
192
+ adBlockerDetection: {
193
+ type: string;
194
+ items: {
195
+ type: string;
196
+ properties: {
197
+ games: {
198
+ type: string;
199
+ items: {
200
+ type: string;
201
+ };
202
+ };
203
+ platformTypes: {
204
+ type: string;
205
+ items: {
206
+ type: string;
207
+ enum: ArenaType[];
208
+ };
209
+ };
210
+ };
211
+ anyOf: {
212
+ required: string[];
213
+ }[];
214
+ additionalProperties: boolean;
215
+ };
216
+ };
188
217
  };
189
218
  required: string[];
190
219
  additionalProperties: boolean;
@@ -206,6 +235,7 @@ export declare class ConfigService {
206
235
  private _platformType;
207
236
  private _host;
208
237
  private _gameConfig;
238
+ private _abTestService;
209
239
  private constructor();
210
240
  static get Instance(): ConfigService;
211
241
  subscribe(callback: ConfigChangeCallback): () => void;
@@ -213,6 +243,10 @@ export declare class ConfigService {
213
243
  init(host?: IHost): Promise<void>;
214
244
  loadConfig(): Promise<void>;
215
245
  get config(): ConfigSchema;
246
+ getAbTestAssignments(): ABTestAssignment[];
247
+ appendAbTestToAbVariations(existing: string | undefined): string | undefined;
248
+ isAdBlockerDetectionEnabled(): boolean;
249
+ private matchesGamePlatformFilter;
216
250
  dispose(): void;
217
251
  getConfigForProperty(property: string): any;
218
252
  private tokenize;
@@ -0,0 +1 @@
1
+ export declare function showAdBlockerPopup(): Promise<void>;
@@ -8,7 +8,7 @@ export interface IHost {
8
8
  getQueryParameter(key: string): Promise<string | null>;
9
9
  getGameId(): Promise<string>;
10
10
  getGameIdSync?(): string;
11
- getGameSlugSync?(): string;
11
+ getGameSlug?(): string;
12
12
  setGameId(id: string): void;
13
13
  getDetails(): Promise<WebEnvironmentDetails>;
14
14
  setDetails?(p: Partial<WebEnvironmentDetails>): Promise<void>;
@@ -60,7 +60,7 @@ export declare class HostArena implements IHost {
60
60
  getGameId(): Promise<string>;
61
61
  getGameIdSync(): string;
62
62
  setGameId(id: string): Promise<void>;
63
- getGameSlugSync(): string;
63
+ getGameSlug(): string;
64
64
  getDetails(): Promise<WebEnvironmentDetails>;
65
65
  setDetails(p: Partial<WebEnvironmentDetails>): Promise<void>;
66
66
  openPurchaseForm(pr: PurchaseRequest): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.69.2",
3
+ "version": "2.70.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",