@jolibox/implement 1.1.11-beta.1 → 1.1.11-beta.10
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 +13 -12
- package/.rush/temp/shrinkwrap-deps.json +1 -1
- package/dist/common/ads/anti-cheating.d.ts +24 -51
- package/dist/common/ads/anti-cheating.test.d.ts +1 -0
- package/dist/common/ads/index.d.ts +4 -9
- package/dist/common/context/url-parse.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.native.js +110 -4
- package/implement.build.log +2 -2
- package/package.json +4 -3
- package/src/common/ads/anti-cheating.test.ts +79 -0
- package/src/common/ads/anti-cheating.ts +228 -139
- package/src/common/ads/index.ts +33 -20
- package/src/common/context/index.ts +4 -5
- package/src/common/context/url-parse.ts +9 -6
- package/src/native/api/ads.ts +7 -0
- package/src/native/api/navigate.ts +42 -4
- package/src/native/bootstrap/index.ts +6 -6
- package/src/native/js-core/jolibox-js-core.ts +1 -1
- package/src/native/types/native-method-map.d.ts +17 -0
- package/src/native/ui/retention.ts +152 -0
- package/src/native/bootstrap/retention.ts +0 -40
- /package/dist/native/{bootstrap → ui}/retention.d.ts +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"packages/implement/.rush/temp/shrinkwrap-deps.json": "
|
|
3
|
+
"packages/implement/.rush/temp/shrinkwrap-deps.json": "a4ab156a0df4607a7c45edb42b1d654b1ff20880",
|
|
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": "a0969dd4a31b6a0db5a889127f23024488e1d8e8",
|
|
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.test.ts": "433eb603b97fd7609f26af1522f309596a790829",
|
|
10
|
+
"packages/implement/src/common/ads/anti-cheating.ts": "888c94ef55ca03849a79b3e0425850a097192816",
|
|
10
11
|
"packages/implement/src/common/ads/channel-policy.ts": "c6d036be5cedf0c5d545fac271c6c8447ca55d8a",
|
|
11
|
-
"packages/implement/src/common/ads/index.ts": "
|
|
12
|
+
"packages/implement/src/common/ads/index.ts": "e3d5b617f7a156583d50905d325c7ed13ecba6fb",
|
|
12
13
|
"packages/implement/src/common/api-factory/index.ts": "a2b60f027384e37492ddde550dd46f3fb3e14cfe",
|
|
13
14
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/any.test.ts": "6e225e09fce401b374221ad2e4fe33bc91df4152",
|
|
14
15
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/array.test.ts": "8a9cc32be03e952f1176a970fea033d597c176cb",
|
|
@@ -30,9 +31,9 @@
|
|
|
30
31
|
"packages/implement/src/common/api-factory/validator/index.ts": "204e86b97c854647d177805e3180d4cfd542b0f8",
|
|
31
32
|
"packages/implement/src/common/api-factory/validator/validate.ts": "5fee8175a9a05a69fe709c7e7899e5372d81efb1",
|
|
32
33
|
"packages/implement/src/common/can-i-use.ts": "9a28562870d92b82ce42ec656c8e9d868dd87528",
|
|
33
|
-
"packages/implement/src/common/context/index.ts": "
|
|
34
|
+
"packages/implement/src/common/context/index.ts": "23ae64c4735dfa7cf4093a620c368bc320fe9de0",
|
|
34
35
|
"packages/implement/src/common/context/types.ts": "244ff65de52dcbce2457ffee427f5fa102987825",
|
|
35
|
-
"packages/implement/src/common/context/url-parse.ts": "
|
|
36
|
+
"packages/implement/src/common/context/url-parse.ts": "bc25ab4dec5a92f02a8bf99a8e8da4e74f50aba3",
|
|
36
37
|
"packages/implement/src/common/http/index.ts": "5087185d80e1e239262f849b3015eb9b810e2945",
|
|
37
38
|
"packages/implement/src/common/http/uuid.ts": "72e0bcc38976f6d25a55128843c6e3b0dbfd978e",
|
|
38
39
|
"packages/implement/src/common/http/xua.ts": "2ef571b8467fe5e8ecb470c26cb6da99b24be9a8",
|
|
@@ -64,21 +65,20 @@
|
|
|
64
65
|
"packages/implement/src/h5/report/task-tracker.ts": "9b55e81e5c20d459ff851f70689e9280e89c0e63",
|
|
65
66
|
"packages/implement/src/index.native.ts": "96cc46c8919ba2333600e9c3ee100f47c511a79a",
|
|
66
67
|
"packages/implement/src/index.ts": "d0ca7b5312b0a258ae8887e725440c70190442f7",
|
|
67
|
-
"packages/implement/src/native/api/ads.ts": "
|
|
68
|
+
"packages/implement/src/native/api/ads.ts": "845fc0e95c00444e3f96d7c73318b29840d3bbe2",
|
|
68
69
|
"packages/implement/src/native/api/base.ts": "c4c4d04519cdbc3a08226c620f6314ee3b151435",
|
|
69
70
|
"packages/implement/src/native/api/get-system-info.ts": "d0132211c53425eed4811721ac5d577781b118a7",
|
|
70
71
|
"packages/implement/src/native/api/index.ts": "39c85b6c6d93f91d9ecc4a96a38a39a425d5487a",
|
|
71
72
|
"packages/implement/src/native/api/keyboard.ts": "89703b1d8b0929cd0366fd663fee7690be705b38",
|
|
72
73
|
"packages/implement/src/native/api/lifecycle.ts": "7bb706370443627607563254a7cda00037c2aa3f",
|
|
73
74
|
"packages/implement/src/native/api/login.ts": "b957d3142462589395aeeee20e75ff6724ac6fbd",
|
|
74
|
-
"packages/implement/src/native/api/navigate.ts": "
|
|
75
|
+
"packages/implement/src/native/api/navigate.ts": "9a3150581f500135e9707da2c17943762dc5d901",
|
|
75
76
|
"packages/implement/src/native/api/request.ts": "a749e8ac9bb0bada4bca3008ac0be976621dcaf4",
|
|
76
77
|
"packages/implement/src/native/api/storage.ts": "7f56694e3a7f47605512f9cee7fce48ac620c169",
|
|
77
78
|
"packages/implement/src/native/api/task.ts": "26e06a3d6bbeaed34fd704d096e712448296607e",
|
|
78
79
|
"packages/implement/src/native/bootstrap/bridge.ts": "4fe89e79d7fe43a1411388347c3cb3d6edc50376",
|
|
79
|
-
"packages/implement/src/native/bootstrap/index.ts": "
|
|
80
|
+
"packages/implement/src/native/bootstrap/index.ts": "907a868a05052ec1e3f1859af1ecb7695febf288",
|
|
80
81
|
"packages/implement/src/native/bootstrap/init-env.ts": "b7514d5d2db60da990575c1426243777aee57748",
|
|
81
|
-
"packages/implement/src/native/bootstrap/retention.ts": "305a7f5b8011f3030a6d608ac9d59f0e7f6d3b16",
|
|
82
82
|
"packages/implement/src/native/js-bridge/const.ts": "896b30d0d1996f42e1a1c391db5dc095190e166c",
|
|
83
83
|
"packages/implement/src/native/js-bridge/index.ts": "b65e1e20edcce8ce270381a9c7c79cc981761ad4",
|
|
84
84
|
"packages/implement/src/native/js-bridge/invoke.ts": "f7fd744c9491e4eb21b8d5ec6ef314a602a5adcb",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"packages/implement/src/native/js-bridge/types.ts": "df45a621d69ccef3a5ab9d023a0f4fc8d665d645",
|
|
90
90
|
"packages/implement/src/native/js-bridge/utils.ts": "9a444bd1dc499fcdb45561eb06396a04c4d538e1",
|
|
91
91
|
"packages/implement/src/native/js-core/index.ts": "d3fdbad44b2969e0d45d22e8c4da5b8f83782667",
|
|
92
|
-
"packages/implement/src/native/js-core/jolibox-js-core.ts": "
|
|
92
|
+
"packages/implement/src/native/js-core/jolibox-js-core.ts": "78c6b8b3e744f7023f2ec98eb7df544bd9485bb6",
|
|
93
93
|
"packages/implement/src/native/js-core/message-port.ts": "7199fe2e9a89617bfce7853562ac0fd37772bce2",
|
|
94
94
|
"packages/implement/src/native/js-core/utils.ts": "a3639631f50764a5498f17949d3b9204fcc86fbf",
|
|
95
95
|
"packages/implement/src/native/network/create-fetch.ts": "e677cf812494994762afc48ddb8a6eca70a1936d",
|
|
@@ -101,8 +101,9 @@
|
|
|
101
101
|
"packages/implement/src/native/report/index.ts": "b30ccb9ef8e9124cbf156c6bdc3751465721383a",
|
|
102
102
|
"packages/implement/src/native/report/task-tracker.ts": "09f8bc1dd157fe9a2159c261278bd2a92930cee3",
|
|
103
103
|
"packages/implement/src/native/types/global.d.ts": "f4711617013586d0f3c7e2d9bec06f44a86bbc5d",
|
|
104
|
-
"packages/implement/src/native/types/native-method-map.d.ts": "
|
|
104
|
+
"packages/implement/src/native/types/native-method-map.d.ts": "0e7d37d4b4d204c7dd5bb50119f20f9bf8e7106f",
|
|
105
105
|
"packages/implement/src/native/types/native-method.d.ts": "e4e22c921a5b54d4e10fe5ca18158d691fbfe3e7",
|
|
106
|
+
"packages/implement/src/native/ui/retention.ts": "d95410ef87d0cab600a99d54c5f5159f2d727529",
|
|
106
107
|
"packages/implement/tsconfig.json": "b150f4b2ef4eb9d98f92135d481fe530eb7145b5"
|
|
107
108
|
},
|
|
108
109
|
"arguments": "npm run clean && npm run build:esm && tsc "
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"../../packages/implement": "../../packages/implement:
|
|
2
|
+
"../../packages/implement": "../../packages/implement:FJYeACHmWWCrPS8ZA4qR/Kdb5fcP059aU6dHHDR6Y3U=:",
|
|
3
3
|
"/@esbuild/aix-ppc64/0.24.2": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==",
|
|
4
4
|
"/@esbuild/android-arm/0.24.2": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==",
|
|
5
5
|
"/@esbuild/android-arm64/0.24.2": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==",
|
|
@@ -1,61 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { IHttpClient } from '../http';
|
|
2
|
+
import type { Track } from '../report';
|
|
3
|
+
export type AdsDisplayPermission = 'BLOCK_INITIAL' | 'BANNED_FOR_SESSION' | 'HOLDING_HIGH_FREQ' | 'NETWORK_NOT_OK' | 'WAITING_BANNED_RELEASE' | 'BANNED_FOR_TIME' | 'ALLOWED';
|
|
4
|
+
export interface IAdsAntiCheatingConfig {
|
|
3
5
|
maxAllowedAdsForTime?: number;
|
|
4
|
-
|
|
6
|
+
banForTimeThreshold?: number;
|
|
5
7
|
bannedReleaseTime?: number;
|
|
6
8
|
initialThreshold?: number;
|
|
7
9
|
maxAllowedAdsForSession?: number;
|
|
8
|
-
|
|
10
|
+
banForSessionThreshold?: number;
|
|
11
|
+
highFreqThreshold?: number;
|
|
9
12
|
}
|
|
10
13
|
export declare class AdsAntiCheating {
|
|
14
|
+
readonly track: Track;
|
|
15
|
+
readonly httpClient: IHttpClient;
|
|
11
16
|
readonly checkNetwork: () => boolean;
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
private initTimestamp;
|
|
24
|
-
constructor(checkNetwork: () => boolean, config?: IAdsAntiCheatingConfig);
|
|
17
|
+
private checkShouldBanInitial;
|
|
18
|
+
private checkShouldBanHighFreq;
|
|
19
|
+
private checkShouldBanForTime;
|
|
20
|
+
private checkShouldBanForSession;
|
|
21
|
+
constructor(track: Track, httpClient: IHttpClient, checkNetwork: () => boolean, config?: IAdsAntiCheatingConfig);
|
|
22
|
+
checkAdsDisplayPermission: (type: 'reward' | 'interstitial') => {
|
|
23
|
+
reason: AdsDisplayPermission;
|
|
24
|
+
info?: {
|
|
25
|
+
count: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
29
|
+
* Report an ad display permission issue.
|
|
30
|
+
* Report to both event tracking system and the business backend system.
|
|
31
|
+
* @param reason
|
|
27
32
|
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get call ads timestamps for time
|
|
31
|
-
*/
|
|
32
|
-
private get callAdsTimestampsForTime();
|
|
33
|
-
/**
|
|
34
|
-
* Set call ads timestamps for time, this will also save to local storage
|
|
35
|
-
*/
|
|
36
|
-
private set callAdsTimestampsForTime(value);
|
|
37
|
-
/**
|
|
38
|
-
* Set a timeout to release the banned for time status
|
|
39
|
-
*/
|
|
40
|
-
private setReleaseBannedForTime;
|
|
41
|
-
/**
|
|
42
|
-
* Check if we should ban for initial call. By default, if user makes a call less than 2 seconds after the first call, block.
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
private checkShouldBannedInitial;
|
|
46
|
-
/**
|
|
47
|
-
* Check if we should ban this user for the whole session. By default, if user makes more than 200 calls in 10 minutes, ban for the session.
|
|
48
|
-
* @param type
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
private checkShouldBannedForSession;
|
|
52
|
-
/**
|
|
53
|
-
* Check if we should ban this user for a period of time. By default, if user makes more than 8 calls in 1 minute, ban for 1 minute.
|
|
54
|
-
* After 1 minute, user can make calls again.
|
|
55
|
-
* @param type
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
private checkShouldBannedForTime;
|
|
59
|
-
checkAdsDisplayPermission: (type: 'reward' | 'interstitial') => AdsDisplayPermission;
|
|
33
|
+
report(reason: AdsDisplayPermission, count?: number): void;
|
|
60
34
|
}
|
|
61
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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 {};
|
|
@@ -27,5 +27,5 @@ export interface QueryParams {
|
|
|
27
27
|
signature: Signature;
|
|
28
28
|
}
|
|
29
29
|
export declare const parseUrlQuery: (url: string) => QueryParams;
|
|
30
|
-
export declare const encodeJoliSourceQuery: (
|
|
30
|
+
export declare const encodeJoliSourceQuery: (payloadJson: PayloadJson, originJoliSource: string) => string;
|
|
31
31
|
export {};
|