@arkadiuminc/sdk 2.5.0 → 2.7.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/features/ads/__mocks__/display-ad.d.ts +8 -0
- package/dist/pkg/api/features/ads/__mocks__/video-ad.d.ts +19 -2
- package/dist/pkg/api/features/ads/ads.mocks.d.ts +1 -0
- package/dist/pkg/api/features/ads/index.d.ts +7 -0
- package/dist/pkg/api/features/ads/video-ad.d.ts +4 -0
- package/dist/pkg/api/features/nakama/nakama-provider.d.ts +3 -2
- package/dist/pkg/api/features/persistence/index.d.ts +14 -1
- package/dist/pkg/api/features/persistence/index.test.d.ts +1 -0
- package/package.json +3 -2
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
import { ApiEnv } from "../../backend/backend.api";
|
|
1
2
|
export declare class VideoAd {
|
|
2
3
|
static getInstance(): VideoAd;
|
|
4
|
+
protected _scriptLoaded: Promise<void>;
|
|
5
|
+
protected timer: any;
|
|
3
6
|
constructor();
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
preroll({ duration, env }: {
|
|
8
|
+
duration?: number | undefined;
|
|
9
|
+
env?: ApiEnv | undefined;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
interstitial({ duration, env }: {
|
|
12
|
+
duration?: number | undefined;
|
|
13
|
+
env?: ApiEnv | undefined;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
rewarded({ duration, env }: {
|
|
16
|
+
duration?: number | undefined;
|
|
17
|
+
env?: ApiEnv | undefined;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
protected render({ duration, env }: {
|
|
20
|
+
duration: any;
|
|
21
|
+
env: any;
|
|
22
|
+
}): Promise<void>;
|
|
6
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,9 @@ import { RpcProvider } from '../../core/rpc';
|
|
|
2
2
|
import { ApiEnv } from '../backend/backend.api';
|
|
3
3
|
import { Auth } from '../auth/';
|
|
4
4
|
export interface GameAdsContract {
|
|
5
|
+
showPrerollAd?(options: {
|
|
6
|
+
duration?: number;
|
|
7
|
+
}): Promise<void>;
|
|
5
8
|
showInterstitialAd(options: {
|
|
6
9
|
duration?: number;
|
|
7
10
|
}): Promise<void>;
|
|
@@ -28,7 +31,11 @@ export declare enum AdTypes {
|
|
|
28
31
|
export declare class GameAds implements GameAdsContract {
|
|
29
32
|
private interstitial;
|
|
30
33
|
private rewarded;
|
|
34
|
+
private preroll;
|
|
31
35
|
constructor(rpcProvider: RpcProvider, auth: Auth);
|
|
36
|
+
showPrerollAd({ duration }: {
|
|
37
|
+
duration?: number;
|
|
38
|
+
}): Promise<void>;
|
|
32
39
|
showInterstitialAd({ duration }?: {
|
|
33
40
|
duration?: number | undefined;
|
|
34
41
|
}): Promise<void>;
|
|
@@ -4,6 +4,10 @@ export declare class VideoAd {
|
|
|
4
4
|
protected _scriptLoaded: Promise<void>;
|
|
5
5
|
protected timer: any;
|
|
6
6
|
constructor();
|
|
7
|
+
preroll({ duration, env }: {
|
|
8
|
+
duration?: number | undefined;
|
|
9
|
+
env?: ApiEnv | undefined;
|
|
10
|
+
}): Promise<void>;
|
|
7
11
|
interstitial({ duration, env }: {
|
|
8
12
|
duration?: number | undefined;
|
|
9
13
|
env?: ApiEnv | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Client as NakamaApiClient, Session as NakamaSession } from '@heroiclabs/nakama-js';
|
|
2
2
|
import { ApiEnv, Backend } from '../backend/backend.api';
|
|
3
3
|
import { IHost } from '../host';
|
|
4
|
-
|
|
4
|
+
interface NakamaProviderContract {
|
|
5
5
|
isUserAuthorized(): Promise<boolean>;
|
|
6
6
|
getNakamaSession(): Promise<NakamaSession>;
|
|
7
7
|
getNakamaClient(): NakamaApiClient;
|
|
8
8
|
}
|
|
9
|
-
export declare class NakamaProvider implements
|
|
9
|
+
export declare class NakamaProvider implements NakamaProviderContract {
|
|
10
10
|
private backendApi;
|
|
11
11
|
private host;
|
|
12
12
|
private nakamaApiClient;
|
|
@@ -20,3 +20,4 @@ export declare class NakamaProvider implements UserNakamaReaderContract {
|
|
|
20
20
|
private refreshNakamaSessionIfNeeded;
|
|
21
21
|
private initNakamaSessionViaEagle;
|
|
22
22
|
}
|
|
23
|
+
export {};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
|
+
import { NakamaProvider } from '../nakama/nakama-provider';
|
|
3
|
+
import { IHost } from '../host';
|
|
4
|
+
declare type RemoteStorageValueType = string | object;
|
|
2
5
|
export interface IPersistence {
|
|
3
6
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
4
7
|
setLocalStorageItem(key: string, value: string): Promise<void>;
|
|
5
8
|
removeLocalStorageItem(key: string): Promise<void>;
|
|
6
9
|
getCookie(cookieName: string): Promise<string>;
|
|
10
|
+
getRemoteStorageItem?(key: string): Promise<RemoteStorageValueType | null>;
|
|
11
|
+
setRemoteStorageItem?(key: string, value: RemoteStorageValueType): Promise<void>;
|
|
12
|
+
removeRemoteStorageItem?(key: string): Promise<boolean>;
|
|
7
13
|
}
|
|
8
14
|
export declare class PersistenceArena implements IPersistence {
|
|
9
15
|
private ls;
|
|
@@ -18,12 +24,19 @@ export declare class PersistenceArena implements IPersistence {
|
|
|
18
24
|
}
|
|
19
25
|
export declare class PersistenceGame implements IPersistence {
|
|
20
26
|
private rpcProvider;
|
|
27
|
+
private nakamaProvider;
|
|
28
|
+
private host;
|
|
21
29
|
/**
|
|
22
30
|
* @internal
|
|
23
31
|
*/
|
|
24
|
-
constructor(rpcProvider: RpcProvider);
|
|
32
|
+
constructor(rpcProvider: RpcProvider, nakamaProvider: NakamaProvider, host: IHost);
|
|
25
33
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
26
34
|
setLocalStorageItem(key: string, value: string): Promise<void>;
|
|
27
35
|
removeLocalStorageItem(key: string): Promise<void>;
|
|
28
36
|
getCookie(cookieName: string): Promise<string>;
|
|
37
|
+
private getRemoteStorageCollection;
|
|
38
|
+
getRemoteStorageItem(key: string): Promise<RemoteStorageValueType | null>;
|
|
39
|
+
setRemoteStorageItem(key: string, value: RemoteStorageValueType): Promise<void>;
|
|
40
|
+
removeRemoteStorageItem(key: string): Promise<boolean>;
|
|
29
41
|
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkadiuminc/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/pkg/arkadium-sdk.umd.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"precommit": "lint-staged",
|
|
39
39
|
"release": "standard-version --skip.tag",
|
|
40
40
|
"ci-release": "standard-version && git push origin && git push origin $(git tag --sort=creatordate | tail -n 1)",
|
|
41
|
-
"test:coverage": "
|
|
41
|
+
"test:coverage": "vitest run --coverage",
|
|
42
42
|
"prepare": "husky"
|
|
43
43
|
},
|
|
44
44
|
"lint-staged": {
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"@commitlint/config-conventional": "^17.8.1",
|
|
68
68
|
"@types/jest": "^29.5.11",
|
|
69
69
|
"@types/node": "^18.0.6",
|
|
70
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
70
71
|
"colors": "^1.4.0",
|
|
71
72
|
"coveralls": "^3.1.1",
|
|
72
73
|
"cross-env": "^7.0.3",
|