@arkadiuminc/sdk 0.0.44 → 0.0.47
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/rpc.d.ts +1 -0
- package/dist/pkg/api/core/timeout-tester.d.ts +13 -0
- package/dist/pkg/api/features/ads/index.d.ts +4 -2
- package/dist/pkg/api/features/ads/index.test.d.ts +1 -0
- package/dist/pkg/api/features/ads/video-ad.d.ts +7 -3
- package/dist/pkg/api/version.d.ts +1 -1
- package/dist/pkg/arkadium-arena-sdk.d.ts +3 -1
- package/dist/pkg/arkadium-game-sdk.d.ts +3 -1
- package/package.json +10 -47
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RpcProvider } from './rpc';
|
|
2
|
+
export interface TimeoutTesterContract {
|
|
3
|
+
timeout(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare class TimeoutTester {
|
|
6
|
+
constructor(rpcProvider: RpcProvider);
|
|
7
|
+
timeout(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare class TimeoutTesterProxy {
|
|
10
|
+
private rpcProvider;
|
|
11
|
+
constructor(rpcProvider: RpcProvider);
|
|
12
|
+
timeout(): Promise<any>;
|
|
13
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
|
+
import { ApiEnv } from '../backend/backend.api';
|
|
3
|
+
import { UserStateApi } from '../user-state/user-state.api';
|
|
2
4
|
declare type InterstitialAdContract = {
|
|
3
5
|
show(options: {
|
|
4
6
|
duration?: number;
|
|
@@ -15,7 +17,7 @@ export declare class AdsApi {
|
|
|
15
17
|
interstitial: InterstitialAdContract;
|
|
16
18
|
rewarded: RewardAdContract;
|
|
17
19
|
constructor(interstitial: InterstitialAdContract, rewarded: RewardAdContract);
|
|
18
|
-
static getArenaApi(rpcProvider: RpcProvider): AdsApi;
|
|
19
|
-
static getGameApi(rpcProvider: RpcProvider): AdsApi;
|
|
20
|
+
static getArenaApi(rpcProvider: RpcProvider, userStateApi: UserStateApi): AdsApi;
|
|
21
|
+
static getGameApi(rpcProvider: RpcProvider, env: ApiEnv): AdsApi;
|
|
20
22
|
}
|
|
21
23
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { ApiEnv } from "../backend/backend.api";
|
|
1
2
|
export declare class VideoAd {
|
|
2
3
|
static getInstance(): VideoAd;
|
|
3
4
|
protected _scriptLoaded: Promise<void>;
|
|
4
5
|
constructor();
|
|
5
|
-
interstitial({ duration }: {
|
|
6
|
+
interstitial({ duration, env }: {
|
|
6
7
|
duration?: number | undefined;
|
|
8
|
+
env?: ApiEnv | undefined;
|
|
7
9
|
}): Promise<void>;
|
|
8
|
-
rewarded({ duration }: {
|
|
10
|
+
rewarded({ duration, env }: {
|
|
9
11
|
duration?: number | undefined;
|
|
12
|
+
env?: ApiEnv | undefined;
|
|
10
13
|
}): Promise<void>;
|
|
11
|
-
protected
|
|
14
|
+
protected render({ duration, env }: {
|
|
12
15
|
duration: any;
|
|
16
|
+
env: any;
|
|
13
17
|
}): Promise<void>;
|
|
14
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const __SDK_VERSION__ = "
|
|
1
|
+
export declare const __SDK_VERSION__ = "__GAME_SDK_VERSION__";
|
|
@@ -7,6 +7,7 @@ import { AdsApi } from './api/features/ads/';
|
|
|
7
7
|
import { UserStateApi } from './api/features/user-state/user-state.api';
|
|
8
8
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
9
9
|
import { Observable } from './api/utils/observable';
|
|
10
|
+
import { TimeoutTesterContract } from './api/core/timeout-tester';
|
|
10
11
|
export declare class ArkadiumGameSdk {
|
|
11
12
|
private rpcProvider;
|
|
12
13
|
backendApi: BackendApi;
|
|
@@ -16,10 +17,11 @@ export declare class ArkadiumGameSdk {
|
|
|
16
17
|
ads: AdsApi;
|
|
17
18
|
userStateApi: UserStateApi;
|
|
18
19
|
analytics: AnalyticsApiContract;
|
|
20
|
+
private timeoutTester;
|
|
19
21
|
private gamePingSender;
|
|
20
22
|
private gamePingListener;
|
|
21
23
|
$pingNotification: Observable<number>;
|
|
22
|
-
constructor(rpcProvider: RpcProvider, backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract);
|
|
24
|
+
constructor(rpcProvider: RpcProvider, backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract);
|
|
23
25
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
24
26
|
updateWinReference(target: any): void;
|
|
25
27
|
debugMode(enabled: boolean): void;
|
|
@@ -6,6 +6,7 @@ import { AdsApi } from './api/features/ads/';
|
|
|
6
6
|
import { UserStateApi } from './api/features/user-state/user-state.api';
|
|
7
7
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
8
8
|
import { RpcProvider } from './api/core/rpc';
|
|
9
|
+
import { TimeoutTesterContract } from './api/core/timeout-tester';
|
|
9
10
|
export declare class ArkadiumGameSdk {
|
|
10
11
|
private rpcProvider;
|
|
11
12
|
backendApi: BackendApi;
|
|
@@ -15,9 +16,10 @@ export declare class ArkadiumGameSdk {
|
|
|
15
16
|
ads: AdsApi;
|
|
16
17
|
userStateApi: UserStateApi;
|
|
17
18
|
analytics: AnalyticsApiContract;
|
|
19
|
+
private timeoutTester;
|
|
18
20
|
private arenaPingSender;
|
|
19
21
|
private arenaPingListener;
|
|
20
|
-
constructor(rpcProvider: RpcProvider, backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract);
|
|
22
|
+
constructor(rpcProvider: RpcProvider, backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract);
|
|
21
23
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
22
24
|
updateWinReference(target: any): void;
|
|
23
25
|
debugMode(enabled: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkadiuminc/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/pkg/arkadium-sdk.umd.js",
|
|
@@ -24,15 +24,12 @@
|
|
|
24
24
|
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
|
|
25
25
|
"prebuild": "rimraf dist",
|
|
26
26
|
"build:pkg": "vite build",
|
|
27
|
-
"build:game": "vite build --config vite.game.config.
|
|
28
|
-
"build:arena": "vite build --config vite.arena.config.
|
|
27
|
+
"build:game": "vite build --config vite.game.config.mjs",
|
|
28
|
+
"build:arena": "vite build --config vite.arena.config.mjs",
|
|
29
29
|
"build:docs": "typedoc --out docs --theme default src/arkadium-game-sdk.ts",
|
|
30
30
|
"build-fast": "npm run build:game && npm run build:arena",
|
|
31
31
|
"build": "npm run build:pkg && npm run build:game && npm run build:arena && npm run build:docs",
|
|
32
|
-
"
|
|
33
|
-
"test": "jest --coverage",
|
|
34
|
-
"test:watch": "jest --coverage --watch",
|
|
35
|
-
"test:prod": "npm run lint && npm run test -- --no-cache",
|
|
32
|
+
"test": "vitest",
|
|
36
33
|
"deploy-docs": "ts-node tools/gh-pages-publish",
|
|
37
34
|
"report-coverage": "cat ./coverage/lcov.info | coveralls",
|
|
38
35
|
"commit": "git-cz",
|
|
@@ -51,33 +48,6 @@
|
|
|
51
48
|
"path": "node_modules/cz-conventional-changelog"
|
|
52
49
|
}
|
|
53
50
|
},
|
|
54
|
-
"jest": {
|
|
55
|
-
"transform": {
|
|
56
|
-
".(ts|tsx)": "ts-jest"
|
|
57
|
-
},
|
|
58
|
-
"testEnvironment": "jsdom",
|
|
59
|
-
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
|
60
|
-
"moduleFileExtensions": [
|
|
61
|
-
"ts",
|
|
62
|
-
"tsx",
|
|
63
|
-
"js"
|
|
64
|
-
],
|
|
65
|
-
"coveragePathIgnorePatterns": [
|
|
66
|
-
"/node_modules/",
|
|
67
|
-
"/test/"
|
|
68
|
-
],
|
|
69
|
-
"coverageThreshold": {
|
|
70
|
-
"global": {
|
|
71
|
-
"branches": 90,
|
|
72
|
-
"functions": 95,
|
|
73
|
-
"lines": 95,
|
|
74
|
-
"statements": 95
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"collectCoverageFrom": [
|
|
78
|
-
"src/*.{js,ts}"
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
51
|
"prettier": {
|
|
82
52
|
"singleQuote": true
|
|
83
53
|
},
|
|
@@ -92,44 +62,37 @@
|
|
|
92
62
|
"@arkadium/eagle-virtual-items-api-client": "^0.0.27",
|
|
93
63
|
"@commitlint/cli": "^17.0.3",
|
|
94
64
|
"@commitlint/config-conventional": "^17.0.3",
|
|
95
|
-
"@rollup/plugin-commonjs": "~22.0.1",
|
|
96
|
-
"@rollup/plugin-json": "~4.1.0",
|
|
97
|
-
"@rollup/plugin-node-resolve": "~13.3.0",
|
|
98
65
|
"@types/jest": "^28.1.6",
|
|
99
66
|
"@types/node": "^18.0.6",
|
|
100
67
|
"colors": "^1.4.0",
|
|
101
68
|
"coveralls": "^3.1.1",
|
|
102
69
|
"cross-env": "^7.0.3",
|
|
103
70
|
"cz-conventional-changelog": "^3.3.0",
|
|
71
|
+
"happy-dom": "^14.0.0",
|
|
104
72
|
"husky": "^8.0.1",
|
|
105
|
-
"jest": "^28.1.3",
|
|
106
|
-
"jest-config": "^28.1.3",
|
|
107
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
108
73
|
"lint-staged": "^13.0.3",
|
|
109
74
|
"lodash.camelcase": "^4.3.0",
|
|
110
75
|
"prettier": "^2.7.1",
|
|
111
76
|
"prompt": "^1.3.0",
|
|
112
77
|
"replace-in-file": "^6.3.5",
|
|
113
78
|
"rimraf": "^3.0.2",
|
|
114
|
-
"rollup": "~2.77.0",
|
|
115
|
-
"rollup-plugin-sourcemaps": "~0.6.3",
|
|
116
|
-
"rollup-plugin-typescript2": "~0.32.1",
|
|
117
79
|
"semantic-release": "^19.0.3",
|
|
118
80
|
"semantic-release-ado": "^1.4.0",
|
|
119
81
|
"shelljs": "^0.8.5",
|
|
120
|
-
"ts-jest": "^28.0.7",
|
|
121
82
|
"ts-node": "^10.9.1",
|
|
122
83
|
"tslint": "^5.20.1",
|
|
123
84
|
"tslint-config-prettier": "^1.18.0",
|
|
124
85
|
"tslint-config-standard": "^8.0.1",
|
|
125
86
|
"typedoc": "~0.23.8",
|
|
126
87
|
"typescript": "~4.7.4",
|
|
127
|
-
"vite": "^
|
|
128
|
-
"vite-plugin-dts": "^3.
|
|
88
|
+
"vite": "^5.1.6",
|
|
89
|
+
"vite-plugin-dts": "^3.7.3",
|
|
90
|
+
"vitest": "^1.4.0"
|
|
129
91
|
},
|
|
130
92
|
"dependencies": {
|
|
93
|
+
"@microsoft/applicationinsights-web": "^3.0.4",
|
|
131
94
|
"jsonpack": "^1.1.5",
|
|
132
95
|
"nanoid": "^5.0.4",
|
|
133
|
-
"
|
|
96
|
+
"vite-plugin-string-replace": "^1.1.2"
|
|
134
97
|
}
|
|
135
98
|
}
|