@arkadiuminc/sdk 2.16.0 → 2.17.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/README.md CHANGED
@@ -32,7 +32,7 @@ main();
32
32
  ## Reference documents
33
33
 
34
34
  - Analytics
35
- - [App Insights](TODO)
35
+ - [App Insights](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23897655/AppInsights+game+integration)
36
36
  - [Standardized Spec for every game](https://arkadium.atlassian.net/wiki/spaces/DepartmentBusinessOperations/pages/23675756/Standardized+Spec+for+every+game+-+GA+AppInsights)
37
37
  - [AppInsight stamper](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23993424/AppInsight+stamper)
38
38
  - [Adaptive Sampling Implementation](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23897949/Adaptive+Sampling+Implementation)
@@ -104,13 +104,23 @@ export declare class AnalyticsApiProxy implements AnalyticsApiContract {
104
104
  */
105
105
  sendFirstRightAnswerEvent(dimensions?: DimensionsObject): void;
106
106
  /**
107
+ * @deprecated
107
108
  * User made first match (for match-3, mahjongg and other applicable games)
108
109
  */
109
110
  sendFirsMatchEvent(dimensions?: DimensionsObject): void;
110
111
  /**
112
+ * User made first match (for match-3, mahjongg and other applicable games)
113
+ */
114
+ sendFirstMatchEvent(dimensions?: DimensionsObject): void;
115
+ /**
116
+ * @deprecated
111
117
  * User made first shot (for shooters and other applicable games)
112
118
  */
113
119
  sendFirsShotEvent(dimensions?: DimensionsObject): void;
120
+ /**
121
+ * User made first shot (for shooters and other applicable games)
122
+ */
123
+ sendFirstShotEvent(dimensions?: DimensionsObject): void;
114
124
  /**
115
125
  * Users started new Round (Level). First round is Round 1 (not 0) (applicable for games with evergreen logic, not infinite games - before Nest changes to gameplay)
116
126
  */
@@ -1,4 +1,4 @@
1
- import { ApiEnv, Backend } from '../backend/backend.api';
1
+ import { Backend } from '../backend/backend.api';
2
2
  import { createStore } from '../../utils/observable';
3
3
  import { RpcProvider } from '../../core/rpc';
4
4
  import { IHost } from '../host';
@@ -19,7 +19,7 @@ interface UserProfileReaderContract {
19
19
  authStatus: ReturnType<typeof createStore<boolean>>;
20
20
  isUserAuthorized(): Promise<boolean>;
21
21
  getUserProfile(): Promise<UserProfile | null>;
22
- init(e: ApiEnv): Promise<void>;
22
+ init(): Promise<void>;
23
23
  }
24
24
  interface AuthUIManagerContract {
25
25
  openAuthRequest: ReturnType<typeof createStore<boolean>>;
@@ -30,7 +30,7 @@ export declare class Auth {
30
30
  private authUIManager;
31
31
  private authProblem;
32
32
  constructor(userProfileReader: UserProfileReaderContract, authUIManager: AuthUIManagerContract);
33
- init(env: ApiEnv): Promise<void>;
33
+ init(): Promise<void>;
34
34
  isUserAuthorized(): Promise<boolean>;
35
35
  getUserProfile(): Promise<UserProfile | null>;
36
36
  onAuthStatusChange(observer: any): () => void;
@@ -0,0 +1,22 @@
1
+ import { SessionStorage, SessionStorageInitParams } from '@arkadium/eagle-user-client';
2
+ import { ApiEnv, BackendEndpoints } from './backend.api';
3
+
4
+ export declare enum AARPUserEnv {
5
+ DEV = "https://eagle-user-api-dev.arkadiumhosted.com/",
6
+ PROD = "https://eagle-user-api-prod.arkadiumhosted.com/"
7
+ }
8
+ export declare enum AARPCloudSaveEnv {
9
+ DEV = "https://aarp-api-user-data-dev.arkadiumhosted.com/api/v1",
10
+ PROD = "https://aarp-api-user-data-live.arkadiumhosted.com/api/v1"
11
+ }
12
+ export declare class AARPBackendEndpoints implements BackendEndpoints {
13
+ getUserEndpoint(env: ApiEnv): any;
14
+ getPaymentsEndpoint(env: ApiEnv): string;
15
+ getCloudSaveEndpoint(env: ApiEnv): any;
16
+ }
17
+ /** @hidden */
18
+ export declare class AARPSessionStorage extends SessionStorage {
19
+ constructor(env: ApiEnv, params: SessionStorageInitParams);
20
+ getToken(): Promise<string>;
21
+ isAuthorised(): boolean;
22
+ }
@@ -1,28 +1,44 @@
1
1
  import { ApiGateway as UserApiGateway } from '@arkadium/eagle-user-client';
2
2
  import { UserGameDataApi } from '@arkadium/eagle-user-client/dist/types/api/v1/user-game-data.api';
3
+ import { IHost } from '../host';
3
4
 
4
5
  export declare enum ApiEnv {
5
6
  DEV = "DEV",
6
7
  PROD = "PROD",
7
8
  STAGING = "STAGING"
8
9
  }
9
- export declare enum PaymentsApiEnv {
10
- DEV = "https://arenacloud.cdn.arkadiumhosted.com/eagle-payment-api-dev/",
11
- PROD = "https://arenacloud.cdn.arkadiumhosted.com/eagle-payment-api-prod/"
10
+ export declare enum BackendType {
11
+ EAGLE = "EAGLE",
12
+ AARP = "AARP"
13
+ }
14
+ export interface BackendEndpoints {
15
+ getUserEndpoint: (env: ApiEnv) => string;
16
+ getPaymentsEndpoint: (env: ApiEnv) => string;
17
+ getCloudSaveEndpoint: (env: ApiEnv) => string;
12
18
  }
13
19
  /** @hidden */
14
20
  export declare type SessionStorageType = ReturnType<typeof UserApiGateway.prototype.getSessionStorage>;
15
21
  /** @hidden */
16
22
  export declare class Backend {
23
+ private host;
17
24
  user: Awaited<ReturnType<typeof UserApiGateway.prototype.getAuthApi>> | null;
18
25
  private userGateway;
19
26
  private userGameData;
20
27
  uiOpenRequest: import('../../utils/observable').Observable<boolean>;
21
28
  authStatus: import('../../utils/observable').Observable<boolean>;
29
+ private backendEndpoints;
30
+ private backendType;
31
+ private env;
32
+ constructor(host: IHost);
22
33
  addEventListener(event: number, cb: () => void): void;
23
34
  init(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
35
+ private setBackendEndpoints;
36
+ getUserEndpoint(): URL;
37
+ getPaymentsEndpoint(): URL | null;
38
+ getCloudSaveEndpoint(): URL;
39
+ getBackendType(): BackendType;
24
40
  getAuthToken(): Promise<string> | undefined;
25
- getSessionStorage(): import('@arkadium/eagle-user-client/dist/types/session-storage').SessionStorage | undefined;
41
+ getSessionStorage(): import('@arkadium/eagle-user-client').SessionStorage | undefined;
26
42
  checkAuth(): void;
27
43
  isUserAuthorized(): boolean;
28
44
  openAuthForm(): void;
@@ -8,7 +8,7 @@ export interface IHost {
8
8
  setDetails?(p: Partial<WebEnvironmentDetails>): Promise<void>;
9
9
  openPurchaseForm(r: PurchaseRequest): Promise<void>;
10
10
  onOpenPurchaseForm?(observer: any): any;
11
- getArenaName(): any;
11
+ getArenaName(): Promise<string>;
12
12
  }
13
13
  export declare type PurchaseRequest = {
14
14
  type: string;
@@ -42,7 +42,7 @@ export declare class HostArena implements IHost {
42
42
  openPurchaseForm(pr: PurchaseRequest): Promise<void>;
43
43
  onOpenPurchaseForm(observer: any): () => void;
44
44
  purchaseFormClosed(madePurchase: boolean): Promise<void>;
45
- getArenaName(): string;
45
+ getArenaName(): Promise<string>;
46
46
  }
47
47
  export declare class HostGame implements IHost {
48
48
  private rpcProvider;
@@ -9,7 +9,7 @@ export interface IPersistence {
9
9
  setLocalStorageItem(key: string, value: string): Promise<void>;
10
10
  removeLocalStorageItem(key: string): Promise<void>;
11
11
  getRemoteStorageItem?(key: string): Promise<RemoteStorageValueType | null>;
12
- setRemoteStorageItem?(key: string, value: RemoteStorageValueType): Promise<void>;
12
+ setRemoteStorageItem?(key: string, value: RemoteStorageValueType): Promise<boolean>;
13
13
  removeRemoteStorageItem?(key: string): Promise<boolean>;
14
14
  }
15
15
  /** @hidden */
@@ -42,7 +42,7 @@ export declare class PersistenceGame implements IPersistence {
42
42
  private getRemoteToLocalStorageKey;
43
43
  private isRemoteStorageBlacklisted;
44
44
  getRemoteStorageItem(key: string): Promise<RemoteStorageValueType | null>;
45
- setRemoteStorageItem(key: string, value: RemoteStorageValueType): Promise<void>;
45
+ setRemoteStorageItem(key: string, value: RemoteStorageValueType): Promise<boolean>;
46
46
  removeRemoteStorageItem(key: string): Promise<boolean>;
47
47
  }
48
48
  export {};
@@ -12,6 +12,7 @@ export declare class WalletGame implements Wallet {
12
12
  private virtualItemsApi;
13
13
  private virtualItemGateway;
14
14
  private currencySku;
15
+ private isInited;
15
16
  constructor(backendApi: Backend, lifecycle: GameLifecycleContract);
16
17
  init(env: ApiEnv): Promise<void>;
17
18
  /**
@@ -1,4 +1,4 @@
1
- import { ApiEnv, Backend, SessionStorageType } from './api/features/backend/backend.api';
1
+ import { ApiEnv, Backend } from './api/features/backend/backend.api';
2
2
  import { GameLifecycleContract } from './api/features/game-lifecycle/game-lifecycle.api';
3
3
  import { GameAdsContract } from './api/features/ads/';
4
4
  import { Auth } from './api/features/auth/';
@@ -15,7 +15,7 @@ export declare class ArkadiumGameSdk {
15
15
  private arenaPingSender;
16
16
  private arenaPingListener;
17
17
  private rpcProvider;
18
- backendApi: Backend;
18
+ private backendApi;
19
19
  host: HostGame;
20
20
  lifecycle: GameLifecycleContract;
21
21
  ads: GameAdsContract;
@@ -36,7 +36,7 @@ export declare class ArkadiumGameSdk {
36
36
  persistence: PersistenceGame;
37
37
  wallet: WalletGame;
38
38
  });
39
- initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
39
+ initialize(env: ApiEnv, isGameSide: boolean): Promise<void>;
40
40
  getEnv(): ApiEnv;
41
41
  updateWinReference(target: any): void;
42
42
  debugMode(enabled: boolean): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",
@@ -63,7 +63,7 @@
63
63
  "devDependencies": {
64
64
  "@arkadium/eagle-payments-api-client": "^0.0.35",
65
65
  "@arkadium/eagle-virtual-items-api-client": "^0.1.3",
66
- "@arkadium/eagle-user-client": "^0.0.90",
66
+ "@arkadium/eagle-user-client": "^0.0.93",
67
67
  "@commitlint/cli": "^17.8.1",
68
68
  "@commitlint/config-conventional": "^17.8.1",
69
69
  "@types/jest": "^29.5.11",