@arkadiuminc/sdk 2.11.0 → 2.12.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/dist/pkg/api/core/timeout-tester.d.ts +1 -0
- package/dist/pkg/api/features/ads/__mocks__/video-ad.d.ts +2 -1
- package/dist/pkg/api/features/ads/index.d.ts +1 -0
- package/dist/pkg/api/features/ads/video-ad.d.ts +2 -1
- package/dist/pkg/api/features/analytics/analytics.api.d.ts +1 -0
- package/dist/pkg/api/features/analytics/providers/AnalyticsProvider.d.ts +3 -2
- package/dist/pkg/api/features/analytics/providers/AppInsightsProvider.d.ts +3 -2
- package/dist/pkg/api/features/analytics/providers/ConsoleProvider.d.ts +3 -2
- package/dist/pkg/api/features/analytics/providers/GoogleTagManagerProvider.d.ts +3 -2
- package/dist/pkg/api/features/auth/index.d.ts +1 -0
- package/dist/pkg/api/features/backend/backend.api.d.ts +4 -3
- package/dist/pkg/api/features/game-lifecycle/game-lifecycle.api.d.ts +1 -0
- package/dist/pkg/api/features/host/index.d.ts +1 -0
- package/dist/pkg/api/features/persistence/index.d.ts +11 -2
- package/dist/pkg/arkadium-arena-sdk.d.ts +1 -0
- package/dist/pkg/arkadium-game-sdk.d.ts +2 -4
- package/dist/pkg/loader.d.ts +1 -0
- package/dist/pkg/ping.module.d.ts +2 -1
- package/package.json +1 -2
- package/dist/pkg/api/features/nakama/nakama-provider.d.ts +0 -50
- package/dist/pkg/api/features/nakama/nakama-provider.test.d.ts +0 -1
|
@@ -2,6 +2,7 @@ import { RpcProvider } from '../../core/rpc';
|
|
|
2
2
|
import { AnalyticsProviderType, IAnalyticConfig } from './defs';
|
|
3
3
|
import { DimensionsObject, Dimension } from './dimensions';
|
|
4
4
|
import { IHost } from '../host';
|
|
5
|
+
|
|
5
6
|
interface EnvironmentVersion {
|
|
6
7
|
GameKey: string;
|
|
7
8
|
GameVersion: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DimensionsObject } from
|
|
1
|
+
import { DimensionsObject } from '../dimensions';
|
|
2
2
|
import { IAnalyticConfig } from '../defs';
|
|
3
|
+
|
|
3
4
|
declare type EventArr = [string, string, DimensionsObject];
|
|
4
5
|
declare type PageViewArr = [string, DimensionsObject];
|
|
5
6
|
export declare abstract class AnalyticsProvider {
|
|
@@ -14,6 +15,6 @@ export declare abstract class AnalyticsProvider {
|
|
|
14
15
|
sendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
15
16
|
sendPageView(pageName: string, dimensions: DimensionsObject): void;
|
|
16
17
|
trackException(exception: Error): void;
|
|
17
|
-
getProviderType(): import(
|
|
18
|
+
getProviderType(): import('../defs').AnalyticsProviderType;
|
|
18
19
|
}
|
|
19
20
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DimensionsObject } from
|
|
2
|
-
import { AnalyticsProvider } from
|
|
1
|
+
import { DimensionsObject } from '../dimensions';
|
|
2
|
+
import { AnalyticsProvider } from './AnalyticsProvider';
|
|
3
|
+
|
|
3
4
|
declare global {
|
|
4
5
|
interface Window {
|
|
5
6
|
Microsoft: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DimensionsObject } from
|
|
2
|
-
import { AnalyticsProvider } from
|
|
1
|
+
import { DimensionsObject } from '../dimensions';
|
|
2
|
+
import { AnalyticsProvider } from './AnalyticsProvider';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* based on game-core-monorepo/packages/engine/src/Analytics/Provider/ConsoleAnalytic.ts
|
|
5
6
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DimensionsObject, Dimension } from
|
|
2
|
-
import { AnalyticsProvider } from
|
|
1
|
+
import { DimensionsObject, Dimension } from '../dimensions';
|
|
2
|
+
import { AnalyticsProvider } from './AnalyticsProvider';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* based on game-core-monorepo/packages/engine/src/Analytics/Provider/GoogleAnalytic.ts
|
|
5
6
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
+
|
|
3
4
|
export declare enum ApiEnv {
|
|
4
5
|
DEV = "DEV",
|
|
5
6
|
PROD = "PROD",
|
|
@@ -14,12 +15,12 @@ export declare class Backend {
|
|
|
14
15
|
user: Awaited<ReturnType<typeof UserApiGateway.prototype.getAuthApi>> | null;
|
|
15
16
|
private userGateway;
|
|
16
17
|
userGameData: UserGameDataApi | null;
|
|
17
|
-
uiOpenRequest: import(
|
|
18
|
-
authStatus: import(
|
|
18
|
+
uiOpenRequest: import('../../utils/observable').Observable<boolean>;
|
|
19
|
+
authStatus: import('../../utils/observable').Observable<boolean>;
|
|
19
20
|
addEventListener(event: number, cb: () => void): void;
|
|
20
21
|
init(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
21
22
|
getAuthToken(): Promise<string> | undefined;
|
|
22
|
-
getSessionStorage(): import(
|
|
23
|
+
getSessionStorage(): import('@arkadium/eagle-user-client/dist/types/session-storage').SessionStorage | undefined;
|
|
23
24
|
checkAuth(): void;
|
|
24
25
|
isUserAuthorized(): boolean;
|
|
25
26
|
openAuthForm(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
|
-
import { NakamaProvider } from '../nakama/nakama-provider';
|
|
3
2
|
import { IHost } from '../host';
|
|
3
|
+
|
|
4
4
|
declare type RemoteStorageValueType = string | object;
|
|
5
5
|
export interface IPersistence {
|
|
6
6
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
@@ -29,15 +29,24 @@ export declare class PersistenceGame implements IPersistence {
|
|
|
29
29
|
/**
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
|
-
constructor(rpcProvider: RpcProvider,
|
|
32
|
+
constructor(rpcProvider: RpcProvider, host: IHost);
|
|
33
33
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
34
34
|
setLocalStorageItem(key: string, value: string): Promise<void>;
|
|
35
35
|
removeLocalStorageItem(key: string): Promise<void>;
|
|
36
36
|
getCookie(cookieName: string): Promise<string>;
|
|
37
37
|
private getRemoteStorageCollection;
|
|
38
38
|
private isRemoteStorageBlacklisted;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated The method should not be used
|
|
41
|
+
*/
|
|
39
42
|
getRemoteStorageItem(key: string): Promise<RemoteStorageValueType | null>;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated The method should not be used
|
|
45
|
+
*/
|
|
40
46
|
setRemoteStorageItem(key: string, value: RemoteStorageValueType): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated The method should not be used
|
|
49
|
+
*/
|
|
41
50
|
removeRemoteStorageItem(key: string): Promise<boolean>;
|
|
42
51
|
}
|
|
43
52
|
export {};
|
|
@@ -8,6 +8,7 @@ import { Observable } from './api/utils/observable';
|
|
|
8
8
|
import { TimeoutTesterContract } from './api/core/timeout-tester';
|
|
9
9
|
import { PersistenceArena } from './api/features/persistence';
|
|
10
10
|
import { HostArena } from './api/features/host';
|
|
11
|
+
|
|
11
12
|
export declare class ArkadiumGameSdk {
|
|
12
13
|
private rpcProvider;
|
|
13
14
|
backendApi: Backend;
|
|
@@ -2,12 +2,12 @@ import { ApiEnv, Backend, SessionStorageType } from './api/features/backend/back
|
|
|
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/';
|
|
5
|
-
import { NakamaProvider } from './api/features/nakama/nakama-provider';
|
|
6
5
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
7
6
|
import { RpcProvider } from './api/core/rpc';
|
|
8
7
|
import { TimeoutTesterContract } from './api/core/timeout-tester';
|
|
9
8
|
import { PersistenceGame } from './api/features/persistence';
|
|
10
9
|
import { HostGame } from './api/features/host';
|
|
10
|
+
|
|
11
11
|
export declare class ArkadiumGameSdk {
|
|
12
12
|
version: string;
|
|
13
13
|
private currentEnv;
|
|
@@ -19,18 +19,16 @@ export declare class ArkadiumGameSdk {
|
|
|
19
19
|
lifecycle: GameLifecycleContract;
|
|
20
20
|
ads: GameAdsContract;
|
|
21
21
|
auth: Auth;
|
|
22
|
-
private nakamaProvider;
|
|
23
22
|
analytics: AnalyticsApiContract;
|
|
24
23
|
private timeoutTester;
|
|
25
24
|
persistence: PersistenceGame;
|
|
26
|
-
constructor({ rpcProvider, backendApi, host, lifecycle, ads, auth,
|
|
25
|
+
constructor({ rpcProvider, backendApi, host, lifecycle, ads, auth, analytics, timeoutTester, persistence }: {
|
|
27
26
|
rpcProvider: RpcProvider;
|
|
28
27
|
backendApi: Backend;
|
|
29
28
|
host: HostGame;
|
|
30
29
|
lifecycle: GameLifecycleContract;
|
|
31
30
|
ads: GameAdsContract;
|
|
32
31
|
auth: Auth;
|
|
33
|
-
nakamaProvider?: NakamaProvider;
|
|
34
32
|
analytics: AnalyticsApiContract;
|
|
35
33
|
timeoutTester: TimeoutTesterContract;
|
|
36
34
|
persistence: PersistenceGame;
|
package/dist/pkg/loader.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RpcProvider } from './api/core/rpc';
|
|
2
|
+
|
|
2
3
|
export declare class PingModule {
|
|
3
4
|
constructor(rpcProvider: RpcProvider);
|
|
4
|
-
$ping: import(
|
|
5
|
+
$ping: import('./api/utils/observable').Observable<number>;
|
|
5
6
|
ping(): boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare class PingModuleProxy {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkadiuminc/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/pkg/arkadium-sdk.umd.js",
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
"vitest": "^1.4.0"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@heroiclabs/nakama-js": "^2.8.0",
|
|
99
98
|
"@microsoft/applicationinsights-web": "^3.0.4",
|
|
100
99
|
"jsonpack": "^1.1.5",
|
|
101
100
|
"nanoid": "^5.0.4",
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Client as NakamaApiClient, Session as NakamaSession } from '@heroiclabs/nakama-js';
|
|
2
|
-
import { ApiEnv, Backend } from '../backend/backend.api';
|
|
3
|
-
import { IHost } from '../host';
|
|
4
|
-
import { AnalyticsApiProxy } from '../analytics/analytics.api';
|
|
5
|
-
import { Auth } from '../auth';
|
|
6
|
-
interface NakamaProviderContract {
|
|
7
|
-
isUserAuthorized(): boolean;
|
|
8
|
-
getNakamaSession(): Promise<NakamaSession>;
|
|
9
|
-
getNakamaClient(): NakamaApiClient;
|
|
10
|
-
}
|
|
11
|
-
export declare class NakamaProvider implements NakamaProviderContract {
|
|
12
|
-
private backendApi;
|
|
13
|
-
private host;
|
|
14
|
-
private analytics;
|
|
15
|
-
private auth;
|
|
16
|
-
private nakamaApiClient;
|
|
17
|
-
private userSession?;
|
|
18
|
-
private userSessionDeferred?;
|
|
19
|
-
private wasEagleSubscribed;
|
|
20
|
-
private env;
|
|
21
|
-
private gameId;
|
|
22
|
-
constructor(backendApi: Backend, host: IHost, analytics: AnalyticsApiProxy, auth: Auth);
|
|
23
|
-
init(env: ApiEnv): void;
|
|
24
|
-
private getGameId;
|
|
25
|
-
isUserAuthorized(): boolean;
|
|
26
|
-
getNakamaClient(): NakamaApiClient;
|
|
27
|
-
/**
|
|
28
|
-
* this method authenticates the user if no session exists or if it is unsuited to proceed
|
|
29
|
-
*/
|
|
30
|
-
getNakamaSession(): Promise<NakamaSession>;
|
|
31
|
-
private getClientAndSession;
|
|
32
|
-
private isNakamaUserLinkedToEagle;
|
|
33
|
-
private getNakamaVars;
|
|
34
|
-
private initNakamaSession;
|
|
35
|
-
private initNakamaSessionViaFingerprint;
|
|
36
|
-
private initNakamaSessionViaEagle;
|
|
37
|
-
private onAuthBootstrap;
|
|
38
|
-
/**
|
|
39
|
-
* this method is called when the user is logged in
|
|
40
|
-
* CAUTION: this method is called from eagle login status change, therefore it can't throw
|
|
41
|
-
*/
|
|
42
|
-
private onEagleLogIn;
|
|
43
|
-
/**
|
|
44
|
-
* this method is called when the user is logged out
|
|
45
|
-
* CAUTION: this method is called from eagle login status change, therefore it can't throw
|
|
46
|
-
*/
|
|
47
|
-
private onEagleLogOut;
|
|
48
|
-
private getAccount;
|
|
49
|
-
}
|
|
50
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|