@arkadiuminc/sdk 2.16.1 → 2.18.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.
- package/dist/pkg/api/features/auth/index.d.ts +8 -5
- package/dist/pkg/api/features/backend/aarp-session-storage.d.ts +22 -0
- package/dist/pkg/api/features/backend/backend.api.d.ts +20 -4
- package/dist/pkg/api/features/host/index.d.ts +2 -2
- package/dist/pkg/api/features/persistence/index.d.ts +2 -2
- package/dist/pkg/api/features/wallet/index.d.ts +1 -0
- package/dist/pkg/arkadium-game-sdk.d.ts +3 -3
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
@@ -11,15 +11,18 @@ interface UserProfile {
|
|
|
11
11
|
uid: string;
|
|
12
12
|
username: string;
|
|
13
13
|
avatar: Image;
|
|
14
|
-
avatarFrame
|
|
15
|
-
avatarBackground
|
|
14
|
+
avatarFrame?: Image;
|
|
15
|
+
avatarBackground?: string;
|
|
16
16
|
isUserSubscriber: boolean;
|
|
17
|
+
aarpMembershipStatus?: boolean;
|
|
18
|
+
coins?: number;
|
|
19
|
+
level?: number;
|
|
17
20
|
}
|
|
18
21
|
interface UserProfileReaderContract {
|
|
19
22
|
authStatus: ReturnType<typeof createStore<boolean>>;
|
|
20
23
|
isUserAuthorized(): Promise<boolean>;
|
|
21
24
|
getUserProfile(): Promise<UserProfile | null>;
|
|
22
|
-
init(
|
|
25
|
+
init(): Promise<void>;
|
|
23
26
|
}
|
|
24
27
|
interface AuthUIManagerContract {
|
|
25
28
|
openAuthRequest: ReturnType<typeof createStore<boolean>>;
|
|
@@ -30,7 +33,7 @@ export declare class Auth {
|
|
|
30
33
|
private authUIManager;
|
|
31
34
|
private authProblem;
|
|
32
35
|
constructor(userProfileReader: UserProfileReaderContract, authUIManager: AuthUIManagerContract);
|
|
33
|
-
init(
|
|
36
|
+
init(): Promise<void>;
|
|
34
37
|
isUserAuthorized(): Promise<boolean>;
|
|
35
38
|
getUserProfile(): Promise<UserProfile | null>;
|
|
36
39
|
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://aarpcloud.cdn.arkadiumhosted.com/arenax-api-user-dev/api/v1/",
|
|
6
|
+
PROD = "https://aarpcloud.cdn.arkadiumhosted.com/arenax-api-user/api/v1/"
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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():
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
3
|
+
"version": "2.18.1",
|
|
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.
|
|
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",
|