@arkadiuminc/sdk 2.71.0 → 2.72.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.
@@ -2,6 +2,7 @@ import { default as defaultConfigJson } from '../../config.json';
2
2
  import { ABTestAssignment } from './ab-test-service';
3
3
  import { ArenaType } from '../features/host/arena-type';
4
4
  import { IHost } from '../features/host';
5
+ import { ApiEnv } from '../features/backend/backend.api';
5
6
 
6
7
  export declare type AdsConfig = {
7
8
  isEnabled: boolean;
@@ -12,8 +13,19 @@ export declare type AdsConfig = {
12
13
  export declare enum GameConfigProperty {
13
14
  hasGems = "hasGems",
14
15
  hasEagle = "hasEagle",
15
- slug = "slug"
16
+ slug = "slug",
17
+ gameServerSettings = "gameServerSettings"
16
18
  }
19
+ export declare type GameServerConnectionSettings = {
20
+ host: string;
21
+ port: string;
22
+ key: string;
23
+ secure: boolean;
24
+ };
25
+ export declare type GameServerSettings = Partial<Record<ApiEnv, GameServerConnectionSettings>>;
26
+ export declare type DefaultGameConfig = {
27
+ gameServerSettings?: GameServerSettings;
28
+ };
17
29
  declare type GamePlatformFilterEntry = {
18
30
  games?: string[];
19
31
  platformTypes?: ArenaType[];
@@ -24,6 +36,7 @@ declare type LifecycleEventConfig = {
24
36
  blacklists: LifecycleBlacklistEntry[];
25
37
  };
26
38
  export interface ConfigSchema {
39
+ version: string;
27
40
  host: {
28
41
  supportsSubscriptions: string[];
29
42
  };
@@ -36,6 +49,7 @@ export interface ConfigSchema {
36
49
  refreshInterval: number;
37
50
  };
38
51
  lifecycle: Record<string, LifecycleEventConfig>;
52
+ defaultGameConfig?: DefaultGameConfig;
39
53
  ads: {
40
54
  isEnabled: boolean;
41
55
  configs: Array<{
@@ -57,6 +71,9 @@ export { defaultConfigJson };
57
71
  export declare const schema: {
58
72
  type: string;
59
73
  properties: {
74
+ version: {
75
+ type: string;
76
+ };
60
77
  host: {
61
78
  type: string;
62
79
  properties: {
@@ -219,6 +236,37 @@ export declare const schema: {
219
236
  required: string[];
220
237
  additionalProperties: boolean;
221
238
  };
239
+ defaultGameConfig: {
240
+ type: string;
241
+ properties: {
242
+ gameServerSettings: {
243
+ type: string;
244
+ properties: {
245
+ [k: string]: {
246
+ type: string;
247
+ properties: {
248
+ host: {
249
+ type: string;
250
+ };
251
+ port: {
252
+ type: string;
253
+ };
254
+ key: {
255
+ type: string;
256
+ };
257
+ secure: {
258
+ type: string;
259
+ };
260
+ };
261
+ required: string[];
262
+ additionalProperties: boolean;
263
+ };
264
+ };
265
+ additionalProperties: boolean;
266
+ };
267
+ };
268
+ additionalProperties: boolean;
269
+ };
222
270
  };
223
271
  required: string[];
224
272
  additionalProperties: boolean;
@@ -237,12 +285,13 @@ export declare class ConfigService {
237
285
  private _host;
238
286
  private _gameConfig;
239
287
  private _abTestService;
288
+ private _env;
240
289
  private constructor();
241
290
  static get Instance(): ConfigService;
242
291
  subscribe(callback: ConfigChangeCallback): () => void;
243
292
  private notifyConfigChange;
244
293
  private loadBundledConfig;
245
- init(host?: IHost): Promise<void>;
294
+ init(host?: IHost, env?: ApiEnv): Promise<void>;
246
295
  loadConfig(): Promise<void>;
247
296
  get config(): ConfigSchema;
248
297
  getSupportsSubscriptionsHosts(): string[];
@@ -261,6 +310,8 @@ export declare class ConfigService {
261
310
  private isPlatformType;
262
311
  private isGame;
263
312
  resetGameConfig(): void;
264
- setGameConfig(gameConfig: any): void;
265
- getGameConfigProperty(property: GameConfigProperty, defaultValue?: any): any;
313
+ private getSdkDefaultGameConfig;
314
+ setGameConfig(gameConfig: Record<string, unknown> | null | undefined): void;
315
+ private resolveGameConfigPropertyValue;
316
+ getGameConfigProperty(propertyName: string | GameConfigProperty, defaultValue?: any): any;
266
317
  }
@@ -0,0 +1,7 @@
1
+ export declare class ConfigArena {
2
+ constructor();
3
+ getProperty(propertyName: string): Promise<any>;
4
+ }
5
+ export declare class ConfigGame {
6
+ getProperty(propertyName: string): Promise<any>;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -12,6 +12,7 @@ import { LeaderboardGame } from './api/features/leaderboard';
12
12
  import { TournamentsGame } from './api/features/tournaments';
13
13
  import { RecorderGame } from './api/features/recorder';
14
14
  import { ILogger } from './api/features/logger';
15
+ import { ConfigGame } from './api/features/config';
15
16
 
16
17
  export declare class ArkadiumGameSdk {
17
18
  version: string;
@@ -31,7 +32,8 @@ export declare class ArkadiumGameSdk {
31
32
  leaderboard: LeaderboardGame;
32
33
  tournaments: TournamentsGame;
33
34
  logger: ILogger;
34
- constructor({ rpcProvider, backendApi, host, lifecycle, ads, auth, analytics, timeoutTester, persistence, wallet, leaderboard, tournaments, recorder, logger }: {
35
+ config: ConfigGame;
36
+ constructor({ rpcProvider, backendApi, host, lifecycle, ads, auth, analytics, timeoutTester, persistence, wallet, leaderboard, tournaments, recorder, logger, config }: {
35
37
  rpcProvider: RpcProvider;
36
38
  backendApi: Backend;
37
39
  host: HostGame;
@@ -46,6 +48,7 @@ export declare class ArkadiumGameSdk {
46
48
  tournaments: TournamentsGame;
47
49
  recorder: RecorderGame;
48
50
  logger: ILogger;
51
+ config: ConfigGame;
49
52
  });
50
53
  initialize(env: ApiEnv, isGameSide: boolean): Promise<void>;
51
54
  getEnv(): ApiEnv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.71.0",
3
+ "version": "2.72.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",