@arkadiuminc/sdk 2.26.4 → 2.29.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/ads/index.d.ts +1 -0
- package/dist/pkg/api/features/ads/video-ad.d.ts +4 -4
- package/dist/pkg/api/features/analytics/analytics.api.d.ts +3 -0
- package/dist/pkg/api/features/backend/aarp-session-storage.d.ts +2 -2
- package/dist/pkg/api/features/game-lifecycle/game-lifecycle.api.d.ts +9 -0
- package/dist/pkg/api/features/host/index.d.ts +1 -0
- package/dist/pkg/api/features/support-v1/game-state/game-state.api.d.ts +41 -0
- package/dist/pkg/api/features/support-v1/support-v1.d.ts +10 -0
- package/dist/pkg/api/interface.test.d.ts +1 -0
- package/dist/pkg/arkadium-arena-sdk.d.ts +3 -1
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ export declare class AdsArenaProvider implements AdsArena {
|
|
|
37
37
|
private preroll;
|
|
38
38
|
private banner;
|
|
39
39
|
constructor(rpcProvider: RpcProvider, auth: Auth, lifecycle: GameLifecycleArena);
|
|
40
|
+
setVideoAdsUrl(url: string): void;
|
|
40
41
|
setVideoAdsDomain(domain: string): void;
|
|
41
42
|
setDisplayAdsDomain(domain: string): void;
|
|
42
43
|
showPrerollAd({ duration }: {
|
|
@@ -2,11 +2,11 @@ import { ApiEnv } from '../backend/backend.api';
|
|
|
2
2
|
|
|
3
3
|
/** @hidden */
|
|
4
4
|
export declare class VideoAd {
|
|
5
|
-
static domain
|
|
6
|
-
static
|
|
5
|
+
private static domain;
|
|
6
|
+
private static url;
|
|
7
|
+
static getInstance(domain?: string, url?: string): VideoAd;
|
|
7
8
|
protected _scriptLoaded: Promise<void>;
|
|
8
|
-
|
|
9
|
-
constructor(domain: string);
|
|
9
|
+
constructor(domain: string, url: string);
|
|
10
10
|
preroll({ duration, env }: {
|
|
11
11
|
duration?: number | undefined;
|
|
12
12
|
env?: ApiEnv | undefined;
|
|
@@ -23,6 +23,7 @@ export interface AnalyticsApiContract {
|
|
|
23
23
|
sendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): Promise<void>;
|
|
24
24
|
sendPageView(pageName: string, dimensions: DimensionsObject): Promise<void>;
|
|
25
25
|
trackException(exception: Error): Promise<void>;
|
|
26
|
+
clearProviders(): void;
|
|
26
27
|
}
|
|
27
28
|
/** @hidden */
|
|
28
29
|
export declare class AnalyticsApi implements AnalyticsApiContract {
|
|
@@ -47,6 +48,7 @@ export declare class AnalyticsApi implements AnalyticsApiContract {
|
|
|
47
48
|
setFingerprintData(fingerprintData: FingerprintData): Promise<any>;
|
|
48
49
|
enableProvider(providerType: AnalyticsProviderType): void;
|
|
49
50
|
disableProvider(providerType: AnalyticsProviderType): void;
|
|
51
|
+
clearProviders(): void;
|
|
50
52
|
}
|
|
51
53
|
export declare class AnalyticsApiProxy implements AnalyticsApiContract {
|
|
52
54
|
private rpcProvider;
|
|
@@ -220,5 +222,6 @@ export declare class AnalyticsApiProxy implements AnalyticsApiContract {
|
|
|
220
222
|
*/
|
|
221
223
|
sendQuitConfirmedPageView(dimensions?: DimensionsObject): void;
|
|
222
224
|
sendGameSDKInitEvent(): void;
|
|
225
|
+
clearProviders(): void;
|
|
223
226
|
}
|
|
224
227
|
export {};
|
|
@@ -6,8 +6,8 @@ export declare enum AARPUserEnv {
|
|
|
6
6
|
PROD = "https://aarpcloud.cdn.arkadiumhosted.com/arenax-api-user/api/v1/"
|
|
7
7
|
}
|
|
8
8
|
export declare enum AARPCloudSaveEnv {
|
|
9
|
-
DEV = "https://aarp-api-user-data-dev
|
|
10
|
-
PROD = "https://aarp-api-user-data-live
|
|
9
|
+
DEV = "https://aarpcloud.cdn.arkadiumhosted.com/aarp-api-user-data-dev/api/v1",
|
|
10
|
+
PROD = "https://aarpcloud.cdn.arkadiumhosted.com/aarp-api-user-data-live/api/v1"
|
|
11
11
|
}
|
|
12
12
|
export declare class AARPBackendEndpoints implements BackendEndpoints {
|
|
13
13
|
getUserEndpoint(env: ApiEnv): any;
|
|
@@ -21,10 +21,19 @@ export declare class GameLifecycleArena {
|
|
|
21
21
|
onEvent(event: LifecycleEvent, payload?: any): void;
|
|
22
22
|
dispatchEvent(event: LifecycleEvent): Promise<void>;
|
|
23
23
|
subscribe(cb: LifecycleFn): void;
|
|
24
|
+
OnTestReady(): Promise<void>;
|
|
25
|
+
OnGameStart(): Promise<void>;
|
|
26
|
+
OnInteract(): Promise<void>;
|
|
27
|
+
OnChangeScore(score: number): Promise<void>;
|
|
28
|
+
OnGameEnd(): Promise<void>;
|
|
29
|
+
OnGamePause(): Promise<void>;
|
|
30
|
+
OnGameResume(): Promise<void>;
|
|
31
|
+
OnPauseReady(): Promise<void>;
|
|
24
32
|
}
|
|
25
33
|
export declare class GameLifecycleGame {
|
|
26
34
|
private rpcProvider;
|
|
27
35
|
private eventCallbacks;
|
|
36
|
+
private sentEvents;
|
|
28
37
|
LifecycleEvent: typeof LifecycleEvent;
|
|
29
38
|
constructor(rpcProvider: RpcProvider);
|
|
30
39
|
private onEvent;
|
|
@@ -37,6 +37,7 @@ export declare class HostArena implements IHost {
|
|
|
37
37
|
* @internal
|
|
38
38
|
*/
|
|
39
39
|
constructor(rpcProvider: RpcProvider, debugProvider: DebugProvider);
|
|
40
|
+
noOp(): Promise<void>;
|
|
40
41
|
getQueryParameter(key: string): Promise<string | null>;
|
|
41
42
|
getGameId(): Promise<string>;
|
|
42
43
|
setGameId(id: string): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Backend } from '../../backend/backend.api';
|
|
2
|
+
import { RpcProvider } from '../../../core/rpc';
|
|
3
|
+
import { IHost } from '../../host';
|
|
4
|
+
|
|
5
|
+
declare class SaveDataContract<T> {
|
|
6
|
+
__cloudMeta__: {
|
|
7
|
+
__version: number;
|
|
8
|
+
};
|
|
9
|
+
data: T | null;
|
|
10
|
+
clone<T>(p: Partial<SaveDataContract<T>>): SaveDataContract<T>;
|
|
11
|
+
}
|
|
12
|
+
interface Serializer {
|
|
13
|
+
pack(data: Record<any, any>): Promise<string>;
|
|
14
|
+
unpack(data: string): Promise<Record<any, any> | null>;
|
|
15
|
+
}
|
|
16
|
+
export declare class GameStateApi {
|
|
17
|
+
private backendApi;
|
|
18
|
+
private host;
|
|
19
|
+
private rpcProvider;
|
|
20
|
+
private ls;
|
|
21
|
+
private knownStates;
|
|
22
|
+
private serializer;
|
|
23
|
+
private useGameSerializer;
|
|
24
|
+
constructor(backendApi: Backend, host: IHost, rpcProvider: RpcProvider);
|
|
25
|
+
private getGameId;
|
|
26
|
+
private packData;
|
|
27
|
+
private unpackData;
|
|
28
|
+
private isUserAuthorized;
|
|
29
|
+
private getStorageKey;
|
|
30
|
+
useSerializer(value: boolean): void;
|
|
31
|
+
setSerializer(s: Serializer): void;
|
|
32
|
+
loadGameState<T>(key: string): Promise<{
|
|
33
|
+
cloud: SaveDataContract<T> | null;
|
|
34
|
+
local: SaveDataContract<T> | null;
|
|
35
|
+
}>;
|
|
36
|
+
private loadData;
|
|
37
|
+
private isStateOutdated;
|
|
38
|
+
saveGameState<T>(key: string, state: SaveDataContract<T>): Promise<void>;
|
|
39
|
+
private saveDataToStorage;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RpcProvider } from '../../core/rpc';
|
|
2
|
+
import { Backend } from '../backend/backend.api';
|
|
3
|
+
import { IHost } from '../host';
|
|
4
|
+
|
|
5
|
+
/** @hidden */
|
|
6
|
+
export declare class SupportV1 {
|
|
7
|
+
private rpcProvider;
|
|
8
|
+
private gameState;
|
|
9
|
+
constructor(rpcProvider: RpcProvider, bApi: Backend, host: IHost);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,6 +10,7 @@ import { PersistenceArena } from './api/features/persistence';
|
|
|
10
10
|
import { HostArena } from './api/features/host';
|
|
11
11
|
import { WalletArena } from './api/features/wallet';
|
|
12
12
|
import { DebugProviderArena } from './api/core/debug-provider';
|
|
13
|
+
import { SupportV1 } from './api/features/support-v1/support-v1';
|
|
13
14
|
|
|
14
15
|
import * as MockUserUtils from './api/utils/mockUser';
|
|
15
16
|
/** @hidden */
|
|
@@ -25,13 +26,14 @@ export declare class ArkadiumArenaSdk {
|
|
|
25
26
|
persistence: PersistenceArena;
|
|
26
27
|
private wallet;
|
|
27
28
|
debug: DebugProviderArena;
|
|
29
|
+
private supportV1;
|
|
28
30
|
private currentEnv;
|
|
29
31
|
private currentTarget;
|
|
30
32
|
private gamePingSender;
|
|
31
33
|
private gamePingListener;
|
|
32
34
|
$pingNotification: Observable<number>;
|
|
33
35
|
version: string;
|
|
34
|
-
constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostArena, lifecycle: GameLifecycleArena, ads: AdsArena, auth: AuthArena, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract, persistence: PersistenceArena, wallet: WalletArena, debug: DebugProviderArena);
|
|
36
|
+
constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostArena, lifecycle: GameLifecycleArena, ads: AdsArena, auth: AuthArena, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract, persistence: PersistenceArena, wallet: WalletArena, debug: DebugProviderArena, supportV1: SupportV1);
|
|
35
37
|
setEnv(e: ApiEnv): void;
|
|
36
38
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
37
39
|
private envDiscoverListener;
|