@jolibox/implement 1.1.10 → 1.1.11-beta.2
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/.rush/temp/package-deps_build.json +20 -17
- package/dist/common/ads/anti-cheating.d.ts +11 -1
- package/dist/common/ads/index.d.ts +4 -9
- package/dist/common/context/index.d.ts +4 -0
- package/dist/common/context/url-parse.d.ts +8 -1
- package/dist/index.js +3 -3
- package/dist/index.native.js +4 -4
- package/dist/native/api/index.d.ts +1 -0
- package/dist/native/api/navigate.d.ts +1 -0
- package/dist/native/bootstrap/bridge.d.ts +1 -1
- package/dist/native/bootstrap/retention.d.ts +1 -0
- package/dist/native/js-bridge/const.d.ts +1 -0
- package/dist/native/js-bridge/publish.d.ts +1 -0
- package/dist/native/js-bridge/subscribe.d.ts +2 -0
- package/dist/native/js-bridge/types.d.ts +4 -0
- package/dist/native/js-core/jolibox-js-core.d.ts +8 -3
- package/implement.build.log +2 -2
- package/package.json +3 -3
- package/src/common/ads/anti-cheating.ts +24 -1
- package/src/common/ads/index.ts +15 -16
- package/src/common/context/index.ts +20 -3
- package/src/common/context/url-parse.ts +21 -1
- package/src/native/api/ads.ts +7 -0
- package/src/native/api/index.ts +1 -0
- package/src/native/api/lifecycle.ts +16 -4
- package/src/native/api/navigate.ts +23 -0
- package/src/native/bootstrap/bridge.ts +10 -1
- package/src/native/bootstrap/index.ts +32 -2
- package/src/native/bootstrap/retention.ts +40 -0
- package/src/native/js-bridge/const.ts +2 -0
- package/src/native/js-bridge/js-bridge.ts +7 -2
- package/src/native/js-bridge/publish.ts +44 -0
- package/src/native/js-bridge/subscribe.ts +25 -1
- package/src/native/js-bridge/types.ts +10 -0
- package/src/native/js-core/jolibox-js-core.ts +29 -25
- package/src/native/types/global.d.ts +1 -0
- package/src/native/types/native-method-map.d.ts +12 -0
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"packages/implement/.eslintrc.js": "7a3d2747dc887655ca9e2d3ff621f7dfd98500b9",
|
|
5
5
|
"packages/implement/README.md": "5660cd88848b7a5428394cc34d881a35dd402188",
|
|
6
6
|
"packages/implement/esbuild.config.js": "86f1fd21722a2cb05216751578dcca66326e664a",
|
|
7
|
-
"packages/implement/package.json": "
|
|
7
|
+
"packages/implement/package.json": "2e1933b7c1e804b9256d20a06fcb330b024b0136",
|
|
8
8
|
"packages/implement/src/common/ads/ads-action-detection.ts": "5a7b9f85d7eab9e744f8a9fc7638063f43baa214",
|
|
9
|
-
"packages/implement/src/common/ads/anti-cheating.ts": "
|
|
9
|
+
"packages/implement/src/common/ads/anti-cheating.ts": "ef5223f92815b93cf5ad0637b12132ea1861d622",
|
|
10
10
|
"packages/implement/src/common/ads/channel-policy.ts": "c6d036be5cedf0c5d545fac271c6c8447ca55d8a",
|
|
11
|
-
"packages/implement/src/common/ads/index.ts": "
|
|
11
|
+
"packages/implement/src/common/ads/index.ts": "cd626a778a03dbd5f147eed02e7b10233d542315",
|
|
12
12
|
"packages/implement/src/common/api-factory/index.ts": "a2b60f027384e37492ddde550dd46f3fb3e14cfe",
|
|
13
13
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/any.test.ts": "6e225e09fce401b374221ad2e4fe33bc91df4152",
|
|
14
14
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/array.test.ts": "8a9cc32be03e952f1176a970fea033d597c176cb",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"packages/implement/src/common/api-factory/validator/index.ts": "204e86b97c854647d177805e3180d4cfd542b0f8",
|
|
31
31
|
"packages/implement/src/common/api-factory/validator/validate.ts": "5fee8175a9a05a69fe709c7e7899e5372d81efb1",
|
|
32
32
|
"packages/implement/src/common/can-i-use.ts": "9a28562870d92b82ce42ec656c8e9d868dd87528",
|
|
33
|
-
"packages/implement/src/common/context/index.ts": "
|
|
33
|
+
"packages/implement/src/common/context/index.ts": "1b269c1719578ec2a829a310a78e2a76e97a32eb",
|
|
34
34
|
"packages/implement/src/common/context/types.ts": "244ff65de52dcbce2457ffee427f5fa102987825",
|
|
35
|
-
"packages/implement/src/common/context/url-parse.ts": "
|
|
35
|
+
"packages/implement/src/common/context/url-parse.ts": "658ec3cf66ad796a9ad8dec13c417c904eb6f471",
|
|
36
36
|
"packages/implement/src/common/http/index.ts": "5087185d80e1e239262f849b3015eb9b810e2945",
|
|
37
37
|
"packages/implement/src/common/http/uuid.ts": "72e0bcc38976f6d25a55128843c6e3b0dbfd978e",
|
|
38
38
|
"packages/implement/src/common/http/xua.ts": "2ef571b8467fe5e8ecb470c26cb6da99b24be9a8",
|
|
@@ -64,29 +64,32 @@
|
|
|
64
64
|
"packages/implement/src/h5/report/task-tracker.ts": "9b55e81e5c20d459ff851f70689e9280e89c0e63",
|
|
65
65
|
"packages/implement/src/index.native.ts": "96cc46c8919ba2333600e9c3ee100f47c511a79a",
|
|
66
66
|
"packages/implement/src/index.ts": "d0ca7b5312b0a258ae8887e725440c70190442f7",
|
|
67
|
-
"packages/implement/src/native/api/ads.ts": "
|
|
67
|
+
"packages/implement/src/native/api/ads.ts": "845fc0e95c00444e3f96d7c73318b29840d3bbe2",
|
|
68
68
|
"packages/implement/src/native/api/base.ts": "c4c4d04519cdbc3a08226c620f6314ee3b151435",
|
|
69
69
|
"packages/implement/src/native/api/get-system-info.ts": "d0132211c53425eed4811721ac5d577781b118a7",
|
|
70
|
-
"packages/implement/src/native/api/index.ts": "
|
|
70
|
+
"packages/implement/src/native/api/index.ts": "39c85b6c6d93f91d9ecc4a96a38a39a425d5487a",
|
|
71
71
|
"packages/implement/src/native/api/keyboard.ts": "89703b1d8b0929cd0366fd663fee7690be705b38",
|
|
72
|
-
"packages/implement/src/native/api/lifecycle.ts": "
|
|
72
|
+
"packages/implement/src/native/api/lifecycle.ts": "7bb706370443627607563254a7cda00037c2aa3f",
|
|
73
73
|
"packages/implement/src/native/api/login.ts": "b957d3142462589395aeeee20e75ff6724ac6fbd",
|
|
74
|
+
"packages/implement/src/native/api/navigate.ts": "a342d956415883892ec29c9ad6a709ec99a7d85b",
|
|
74
75
|
"packages/implement/src/native/api/request.ts": "a749e8ac9bb0bada4bca3008ac0be976621dcaf4",
|
|
75
76
|
"packages/implement/src/native/api/storage.ts": "7f56694e3a7f47605512f9cee7fce48ac620c169",
|
|
76
77
|
"packages/implement/src/native/api/task.ts": "26e06a3d6bbeaed34fd704d096e712448296607e",
|
|
77
|
-
"packages/implement/src/native/bootstrap/bridge.ts": "
|
|
78
|
-
"packages/implement/src/native/bootstrap/index.ts": "
|
|
78
|
+
"packages/implement/src/native/bootstrap/bridge.ts": "4fe89e79d7fe43a1411388347c3cb3d6edc50376",
|
|
79
|
+
"packages/implement/src/native/bootstrap/index.ts": "e1c37962386a228ab41f691981199210dd3ec0c8",
|
|
79
80
|
"packages/implement/src/native/bootstrap/init-env.ts": "b7514d5d2db60da990575c1426243777aee57748",
|
|
80
|
-
"packages/implement/src/native/
|
|
81
|
+
"packages/implement/src/native/bootstrap/retention.ts": "305a7f5b8011f3030a6d608ac9d59f0e7f6d3b16",
|
|
82
|
+
"packages/implement/src/native/js-bridge/const.ts": "896b30d0d1996f42e1a1c391db5dc095190e166c",
|
|
81
83
|
"packages/implement/src/native/js-bridge/index.ts": "b65e1e20edcce8ce270381a9c7c79cc981761ad4",
|
|
82
84
|
"packages/implement/src/native/js-bridge/invoke.ts": "f7fd744c9491e4eb21b8d5ec6ef314a602a5adcb",
|
|
83
|
-
"packages/implement/src/native/js-bridge/js-bridge.ts": "
|
|
85
|
+
"packages/implement/src/native/js-bridge/js-bridge.ts": "d06223588faade35cfe56c6dfba94d59297772f0",
|
|
86
|
+
"packages/implement/src/native/js-bridge/publish.ts": "2e884a038141200a6104f7ce24c2666180ded4d5",
|
|
84
87
|
"packages/implement/src/native/js-bridge/report.ts": "056a4b6eea59219d1ea3af08a39fd35a4627abd2",
|
|
85
|
-
"packages/implement/src/native/js-bridge/subscribe.ts": "
|
|
86
|
-
"packages/implement/src/native/js-bridge/types.ts": "
|
|
88
|
+
"packages/implement/src/native/js-bridge/subscribe.ts": "24b9352959c6868ec10f45afa6cda9f930d2b3ac",
|
|
89
|
+
"packages/implement/src/native/js-bridge/types.ts": "df45a621d69ccef3a5ab9d023a0f4fc8d665d645",
|
|
87
90
|
"packages/implement/src/native/js-bridge/utils.ts": "9a444bd1dc499fcdb45561eb06396a04c4d538e1",
|
|
88
91
|
"packages/implement/src/native/js-core/index.ts": "d3fdbad44b2969e0d45d22e8c4da5b8f83782667",
|
|
89
|
-
"packages/implement/src/native/js-core/jolibox-js-core.ts": "
|
|
92
|
+
"packages/implement/src/native/js-core/jolibox-js-core.ts": "8f9e3cc8f09fed53d88f639cc840f61f37bf8b86",
|
|
90
93
|
"packages/implement/src/native/js-core/message-port.ts": "7199fe2e9a89617bfce7853562ac0fd37772bce2",
|
|
91
94
|
"packages/implement/src/native/js-core/utils.ts": "a3639631f50764a5498f17949d3b9204fcc86fbf",
|
|
92
95
|
"packages/implement/src/native/network/create-fetch.ts": "e677cf812494994762afc48ddb8a6eca70a1936d",
|
|
@@ -97,8 +100,8 @@
|
|
|
97
100
|
"packages/implement/src/native/report/errors/index.ts": "d2cd492f07c9b98bd8d469d4a5a84bb8520a3dd2",
|
|
98
101
|
"packages/implement/src/native/report/index.ts": "b30ccb9ef8e9124cbf156c6bdc3751465721383a",
|
|
99
102
|
"packages/implement/src/native/report/task-tracker.ts": "09f8bc1dd157fe9a2159c261278bd2a92930cee3",
|
|
100
|
-
"packages/implement/src/native/types/global.d.ts": "
|
|
101
|
-
"packages/implement/src/native/types/native-method-map.d.ts": "
|
|
103
|
+
"packages/implement/src/native/types/global.d.ts": "f4711617013586d0f3c7e2d9bec06f44a86bbc5d",
|
|
104
|
+
"packages/implement/src/native/types/native-method-map.d.ts": "0df87bcd0a5599739a3cfe65ec9e1c4e02f6618f",
|
|
102
105
|
"packages/implement/src/native/types/native-method.d.ts": "e4e22c921a5b54d4e10fe5ca18158d691fbfe3e7",
|
|
103
106
|
"packages/implement/tsconfig.json": "b150f4b2ef4eb9d98f92135d481fe530eb7145b5"
|
|
104
107
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IHttpClient } from '../http';
|
|
2
|
+
import type { Track } from '../report';
|
|
1
3
|
export type AdsDisplayPermission = 'BLOCK_INITIAL' | 'BANNED_FOR_SESSION' | 'NETWORK_NOT_OK' | 'WAITING_BANNED_RELEASE' | 'BANNED_FOR_TIME' | 'ALLOWED';
|
|
2
4
|
interface IAdsAntiCheatingConfig {
|
|
3
5
|
maxAllowedAdsForTime?: number;
|
|
@@ -8,6 +10,8 @@ interface IAdsAntiCheatingConfig {
|
|
|
8
10
|
bannedForSessionThreshold?: number;
|
|
9
11
|
}
|
|
10
12
|
export declare class AdsAntiCheating {
|
|
13
|
+
readonly track: Track;
|
|
14
|
+
readonly httpClient: IHttpClient;
|
|
11
15
|
readonly checkNetwork: () => boolean;
|
|
12
16
|
private maxAllowedAdsForTime;
|
|
13
17
|
private bannedForTimeThreshold;
|
|
@@ -21,7 +25,7 @@ export declare class AdsAntiCheating {
|
|
|
21
25
|
private _callAdsTimestampsForTime;
|
|
22
26
|
private callAdsTimestampsForSession;
|
|
23
27
|
private initTimestamp;
|
|
24
|
-
constructor(checkNetwork: () => boolean, config?: IAdsAntiCheatingConfig);
|
|
28
|
+
constructor(track: Track, httpClient: IHttpClient, checkNetwork: () => boolean, config?: IAdsAntiCheatingConfig);
|
|
25
29
|
/**
|
|
26
30
|
* Restore call ads timestamps for time from local storage
|
|
27
31
|
*/
|
|
@@ -57,5 +61,11 @@ export declare class AdsAntiCheating {
|
|
|
57
61
|
*/
|
|
58
62
|
private checkShouldBannedForTime;
|
|
59
63
|
checkAdsDisplayPermission: (type: 'reward' | 'interstitial') => AdsDisplayPermission;
|
|
64
|
+
/**
|
|
65
|
+
* Report an ad display permission issue.
|
|
66
|
+
* Report to both event tracking system and the business backend system.
|
|
67
|
+
* @param reason
|
|
68
|
+
*/
|
|
69
|
+
report(reason: AdsDisplayPermission): void;
|
|
60
70
|
}
|
|
61
71
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Track } from '../report';
|
|
2
1
|
import { EventEmitter } from '@jolibox/common';
|
|
2
|
+
import type { Track } from '../report';
|
|
3
|
+
import type { IHttpClient } from '../http';
|
|
3
4
|
declare global {
|
|
4
5
|
interface Window {
|
|
5
6
|
adsbygoogle: Array<unknown>;
|
|
@@ -192,11 +193,6 @@ export interface IAdUnitParams {
|
|
|
192
193
|
*/
|
|
193
194
|
style?: string;
|
|
194
195
|
}
|
|
195
|
-
interface HttpClient {
|
|
196
|
-
get<T>(url: string, options?: {
|
|
197
|
-
query?: Record<string, string>;
|
|
198
|
-
}): Promise<T>;
|
|
199
|
-
}
|
|
200
196
|
export declare const adEventEmitter: EventEmitter<{
|
|
201
197
|
isAdShowing: [boolean];
|
|
202
198
|
}, "isAdShowing">;
|
|
@@ -205,7 +201,7 @@ export declare const adEventEmitter: EventEmitter<{
|
|
|
205
201
|
*/
|
|
206
202
|
export declare class JoliboxAdsImpl {
|
|
207
203
|
readonly track: Track;
|
|
208
|
-
readonly httpClient:
|
|
204
|
+
readonly httpClient: IHttpClient;
|
|
209
205
|
readonly checkNetwork: () => boolean;
|
|
210
206
|
private configured;
|
|
211
207
|
config: IAdsInitParams;
|
|
@@ -218,7 +214,7 @@ export declare class JoliboxAdsImpl {
|
|
|
218
214
|
/**
|
|
219
215
|
* Internal constructor, should not be called directly
|
|
220
216
|
*/
|
|
221
|
-
constructor(track: Track, httpClient:
|
|
217
|
+
constructor(track: Track, httpClient: IHttpClient, checkNetwork: () => boolean);
|
|
222
218
|
/**
|
|
223
219
|
* Initialize the Ads SDK
|
|
224
220
|
* @param config
|
|
@@ -291,4 +287,3 @@ export declare class JoliboxAdsImpl {
|
|
|
291
287
|
*/
|
|
292
288
|
adUnit: (params: IAdUnitParams) => Promise<void>;
|
|
293
289
|
}
|
|
294
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DeviceInfo, HostInfo, HostUserInfo, SdkInfo } from './types';
|
|
2
2
|
import { Env } from '@jolibox/types';
|
|
3
|
+
import { QueryParams } from './url-parse';
|
|
3
4
|
type MPType = 'game' | 'miniApp';
|
|
4
5
|
export declare const context: {
|
|
5
6
|
readonly testMode: boolean;
|
|
@@ -17,6 +18,9 @@ export declare const context: {
|
|
|
17
18
|
readonly sessionId: string;
|
|
18
19
|
readonly channel: string | undefined;
|
|
19
20
|
readonly webviewId: number;
|
|
21
|
+
readonly shouldInterupt: boolean | undefined;
|
|
22
|
+
readonly from: number | undefined;
|
|
20
23
|
onEnvConfigChanged: (newConfig: Partial<Env>) => void;
|
|
24
|
+
encodeJoliSourceQuery: (newPayloadJson: QueryParams["payloadJson"]) => string;
|
|
21
25
|
};
|
|
22
26
|
export {};
|
|
@@ -10,15 +10,22 @@ interface PayloadJson {
|
|
|
10
10
|
joliboxEnv?: 'staging' | 'production';
|
|
11
11
|
sessionId?: string;
|
|
12
12
|
__mpType?: 'game' | 'miniApp';
|
|
13
|
+
__orientation?: 'HORIZONTAL' | 'VERTICAL';
|
|
14
|
+
__transparent?: boolean;
|
|
15
|
+
__entryPath?: string;
|
|
16
|
+
__showStatusBar?: boolean;
|
|
17
|
+
__shouldInterupt?: boolean;
|
|
18
|
+
__from?: number;
|
|
13
19
|
}
|
|
14
20
|
interface Signature {
|
|
15
21
|
headerSig?: string;
|
|
16
22
|
payloadSig?: string;
|
|
17
23
|
}
|
|
18
|
-
interface QueryParams {
|
|
24
|
+
export interface QueryParams {
|
|
19
25
|
headerJson: HeaderJson;
|
|
20
26
|
payloadJson: PayloadJson;
|
|
21
27
|
signature: Signature;
|
|
22
28
|
}
|
|
23
29
|
export declare const parseUrlQuery: (url: string) => QueryParams;
|
|
30
|
+
export declare const encodeJoliSourceQuery: (queryParams: QueryParams) => string;
|
|
24
31
|
export {};
|