@arkadiuminc/sdk 2.71.0 → 2.72.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.
@@ -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[];
@@ -36,6 +48,7 @@ export interface ConfigSchema {
36
48
  refreshInterval: number;
37
49
  };
38
50
  lifecycle: Record<string, LifecycleEventConfig>;
51
+ defaultGameConfig?: DefaultGameConfig;
39
52
  ads: {
40
53
  isEnabled: boolean;
41
54
  configs: Array<{
@@ -219,6 +232,37 @@ export declare const schema: {
219
232
  required: string[];
220
233
  additionalProperties: boolean;
221
234
  };
235
+ defaultGameConfig: {
236
+ type: string;
237
+ properties: {
238
+ gameServerSettings: {
239
+ type: string;
240
+ properties: {
241
+ [k: string]: {
242
+ type: string;
243
+ properties: {
244
+ host: {
245
+ type: string;
246
+ };
247
+ port: {
248
+ type: string;
249
+ };
250
+ key: {
251
+ type: string;
252
+ };
253
+ secure: {
254
+ type: string;
255
+ };
256
+ };
257
+ required: string[];
258
+ additionalProperties: boolean;
259
+ };
260
+ };
261
+ additionalProperties: boolean;
262
+ };
263
+ };
264
+ additionalProperties: boolean;
265
+ };
222
266
  };
223
267
  required: string[];
224
268
  additionalProperties: boolean;
@@ -237,12 +281,13 @@ export declare class ConfigService {
237
281
  private _host;
238
282
  private _gameConfig;
239
283
  private _abTestService;
284
+ private _env;
240
285
  private constructor();
241
286
  static get Instance(): ConfigService;
242
287
  subscribe(callback: ConfigChangeCallback): () => void;
243
288
  private notifyConfigChange;
244
289
  private loadBundledConfig;
245
- init(host?: IHost): Promise<void>;
290
+ init(host?: IHost, env?: ApiEnv): Promise<void>;
246
291
  loadConfig(): Promise<void>;
247
292
  get config(): ConfigSchema;
248
293
  getSupportsSubscriptionsHosts(): string[];
@@ -261,6 +306,8 @@ export declare class ConfigService {
261
306
  private isPlatformType;
262
307
  private isGame;
263
308
  resetGameConfig(): void;
264
- setGameConfig(gameConfig: any): void;
265
- getGameConfigProperty(property: GameConfigProperty, defaultValue?: any): any;
309
+ private getSdkDefaultGameConfig;
310
+ setGameConfig(gameConfig: Record<string, unknown> | null | undefined): void;
311
+ private resolveGameConfigPropertyValue;
312
+ getGameConfigProperty(propertyName: string | GameConfigProperty, defaultValue?: any): any;
266
313
  }
@@ -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.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",