@jolibox/implement 1.1.4-beta.9 → 1.1.5
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 +33 -33
- package/dist/{h5 → common}/ads/ads-action-detection.d.ts +3 -1
- package/dist/{h5 → common}/ads/anti-cheating.d.ts +2 -2
- package/dist/common/ads/channel-policy.d.ts +26 -0
- package/dist/{h5 → common}/ads/index.d.ts +12 -3
- package/dist/common/context/index.d.ts +2 -0
- package/dist/common/http/uuid.d.ts +2 -2
- package/dist/common/http/xua.d.ts +0 -15
- package/dist/common/report/base-tracker.d.ts +10 -1
- package/dist/common/report/errors/index.d.ts +2 -2
- package/dist/common/report/task-track/index.d.ts +3 -0
- package/dist/common/report/types.d.ts +2 -55
- package/dist/h5/api/index.d.ts +1 -0
- package/dist/h5/http/index.d.ts +3 -3
- package/dist/h5/report/index.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -5033
- package/dist/index.native.js +3 -3750
- package/dist/native/api/keyboard.d.ts +9 -3
- package/dist/native/network/index.d.ts +0 -3
- package/esbuild.config.js +1 -1
- package/implement.build.log +2 -2
- package/package.json +3 -3
- package/src/{h5 → common}/ads/ads-action-detection.ts +4 -4
- package/src/{h5 → common}/ads/anti-cheating.ts +2 -4
- package/src/common/ads/channel-policy.ts +52 -0
- package/src/{h5 → common}/ads/index.ts +39 -45
- package/src/common/api-factory/index.ts +3 -3
- package/src/common/context/index.ts +20 -11
- package/src/common/http/uuid.ts +2 -10
- package/src/common/http/xua.ts +2 -69
- package/src/common/report/base-tracker.ts +40 -44
- package/src/common/report/errors/index.ts +3 -3
- package/src/common/report/errors/report/listeners.ts +0 -2
- package/src/common/report/task-track/index.ts +63 -14
- package/src/common/report/track.ts +2 -2
- package/src/common/report/types.ts +2 -64
- package/src/h5/api/ads.ts +24 -0
- package/src/h5/api/get-system-info.ts +5 -1
- package/src/h5/api/index.ts +1 -0
- package/src/h5/http/index.ts +24 -28
- package/src/h5/http/utils/__tests__/xua.test.ts +1 -1
- package/src/h5/http/utils/session.ts +1 -1
- package/src/h5/report/errors/index.ts +1 -1
- package/src/h5/report/event-tracker.ts +1 -1
- package/src/h5/report/index.ts +5 -4
- package/src/index.ts +0 -1
- package/src/native/api/ads.ts +32 -8
- package/src/native/api/get-system-info.ts +5 -2
- package/src/native/api/keyboard.ts +13 -13
- package/src/native/bootstrap/index.ts +0 -1
- package/src/native/network/index.ts +11 -4
- package/src/native/report/index.ts +4 -4
- package/src/native/types/native-method-map.d.ts +11 -0
- package/dist/common/report/errors/error-types.d.ts +0 -122
- package/src/common/report/errors/error-types.ts +0 -206
- package/src/h5/http/utils/__tests__/uuid.test.ts +0 -16
- /package/dist/h5/{http/utils/__tests__/uuid.test.d.ts → api/ads.d.ts} +0 -0
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
"packages/implement/.rush/temp/shrinkwrap-deps.json": "455e6ae3ec587dee276871042f8e2f0747c69b80",
|
|
4
4
|
"packages/implement/.eslintrc.js": "7a3d2747dc887655ca9e2d3ff621f7dfd98500b9",
|
|
5
5
|
"packages/implement/README.md": "5660cd88848b7a5428394cc34d881a35dd402188",
|
|
6
|
-
"packages/implement/esbuild.config.js": "
|
|
7
|
-
"packages/implement/package.json": "
|
|
8
|
-
"packages/implement/src/common/
|
|
6
|
+
"packages/implement/esbuild.config.js": "889e44fb2f426aae078b59a42fcfb9c2f28ebd89",
|
|
7
|
+
"packages/implement/package.json": "6eab147d85e15ef5d0529143a6ceacf8194fc3fe",
|
|
8
|
+
"packages/implement/src/common/ads/ads-action-detection.ts": "5a7b9f85d7eab9e744f8a9fc7638063f43baa214",
|
|
9
|
+
"packages/implement/src/common/ads/anti-cheating.ts": "62e1b5d24aa246849a17ac8cde6cfdc66e577cab",
|
|
10
|
+
"packages/implement/src/common/ads/channel-policy.ts": "c6d036be5cedf0c5d545fac271c6c8447ca55d8a",
|
|
11
|
+
"packages/implement/src/common/ads/index.ts": "926b053fbf348cbc74aa918dbde532e50faf936f",
|
|
12
|
+
"packages/implement/src/common/api-factory/index.ts": "a2b60f027384e37492ddde550dd46f3fb3e14cfe",
|
|
9
13
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/any.test.ts": "6e225e09fce401b374221ad2e4fe33bc91df4152",
|
|
10
14
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/array.test.ts": "8a9cc32be03e952f1176a970fea033d597c176cb",
|
|
11
15
|
"packages/implement/src/common/api-factory/validator/__tests__/validate/arraybuffer.test.ts": "be353282c36f813ef1301044572446dc9ea8cd3c",
|
|
@@ -26,55 +30,51 @@
|
|
|
26
30
|
"packages/implement/src/common/api-factory/validator/index.ts": "204e86b97c854647d177805e3180d4cfd542b0f8",
|
|
27
31
|
"packages/implement/src/common/api-factory/validator/validate.ts": "5fee8175a9a05a69fe709c7e7899e5372d81efb1",
|
|
28
32
|
"packages/implement/src/common/can-i-use.ts": "9a28562870d92b82ce42ec656c8e9d868dd87528",
|
|
29
|
-
"packages/implement/src/common/context/index.ts": "
|
|
33
|
+
"packages/implement/src/common/context/index.ts": "3cfc0661d3dc28c5c8cbb61cce26ee15ad9dca9d",
|
|
30
34
|
"packages/implement/src/common/context/types.ts": "244ff65de52dcbce2457ffee427f5fa102987825",
|
|
31
35
|
"packages/implement/src/common/context/url-parse.ts": "567bb6ee4124e0320431bd3c30fcae9759c99fa9",
|
|
32
36
|
"packages/implement/src/common/http/index.ts": "5087185d80e1e239262f849b3015eb9b810e2945",
|
|
33
|
-
"packages/implement/src/common/http/uuid.ts": "
|
|
34
|
-
"packages/implement/src/common/http/xua.ts": "
|
|
35
|
-
"packages/implement/src/common/report/base-tracker.ts": "
|
|
37
|
+
"packages/implement/src/common/http/uuid.ts": "72e0bcc38976f6d25a55128843c6e3b0dbfd978e",
|
|
38
|
+
"packages/implement/src/common/http/xua.ts": "2ef571b8467fe5e8ecb470c26cb6da99b24be9a8",
|
|
39
|
+
"packages/implement/src/common/report/base-tracker.ts": "816cfde9160f260ad8703e5d65b1383ef09ce5a1",
|
|
36
40
|
"packages/implement/src/common/report/create-trace.ts": "38f54dbbf2e3aa55553395dbe2bb93dbdb9e07df",
|
|
37
|
-
"packages/implement/src/common/report/errors/
|
|
38
|
-
"packages/implement/src/common/report/errors/index.ts": "1211eb614498dbf1022704e1d5b379e907625819",
|
|
41
|
+
"packages/implement/src/common/report/errors/index.ts": "346132103c1f6b2a7c1324bea0c78896b5c6fca8",
|
|
39
42
|
"packages/implement/src/common/report/errors/report/index.ts": "bee6f5f324ebddcc423c3549916a0eee04e880cf",
|
|
40
|
-
"packages/implement/src/common/report/errors/report/listeners.ts": "
|
|
43
|
+
"packages/implement/src/common/report/errors/report/listeners.ts": "7aa3ec847f4c7e22304abe9efad62226dbced36f",
|
|
41
44
|
"packages/implement/src/common/report/index.ts": "6d94d6985cb79a460ab9e2e84fa1b77b5db2b25a",
|
|
42
|
-
"packages/implement/src/common/report/task-track/index.ts": "
|
|
43
|
-
"packages/implement/src/common/report/track.ts": "
|
|
44
|
-
"packages/implement/src/common/report/types.ts": "
|
|
45
|
-
"packages/implement/src/h5/
|
|
46
|
-
"packages/implement/src/h5/ads/anti-cheating.ts": "9e7ce7d02b897865337e1e1ce9282c9d6dc36303",
|
|
47
|
-
"packages/implement/src/h5/ads/index.ts": "e12fc0158593d38ebfb35476615f7cf48631da66",
|
|
45
|
+
"packages/implement/src/common/report/task-track/index.ts": "056d4ce9121648e94aa177e8e6b261adb455d244",
|
|
46
|
+
"packages/implement/src/common/report/track.ts": "1c71050f8caadfe7065f0db5a4a0708c264c21b4",
|
|
47
|
+
"packages/implement/src/common/report/types.ts": "fd127bfd31586f1d712152ef60a4e9175f8bfe8f",
|
|
48
|
+
"packages/implement/src/h5/api/ads.ts": "7a40ea4d3937a1d193e5bd1abd88f5f2cdd28f78",
|
|
48
49
|
"packages/implement/src/h5/api/base.ts": "ead2c3cdcbe174b0e725c31a3885c7985bd8f667",
|
|
49
|
-
"packages/implement/src/h5/api/get-system-info.ts": "
|
|
50
|
-
"packages/implement/src/h5/api/index.ts": "
|
|
50
|
+
"packages/implement/src/h5/api/get-system-info.ts": "c7a866b5b06695774a7fd94df73156c4e15658a8",
|
|
51
|
+
"packages/implement/src/h5/api/index.ts": "81b815f5ac8e1bd3e3f019f94c28bd5522a36193",
|
|
51
52
|
"packages/implement/src/h5/api/lifecycle.ts": "3bc23344a0975fd67ddea22bae580af401284067",
|
|
52
53
|
"packages/implement/src/h5/api/storage.ts": "f6943bad6f8ee86213c78c8b51921ad509bbe357",
|
|
53
54
|
"packages/implement/src/h5/api/task.ts": "8bb87ad8874f6a3833901977b9b5659838c9aacf",
|
|
54
55
|
"packages/implement/src/h5/bootstrap/index.ts": "d20a81443849cdc2dbdce28c64f98e8ce0a4f36f",
|
|
55
|
-
"packages/implement/src/h5/http/index.ts": "
|
|
56
|
-
"packages/implement/src/h5/http/utils/__tests__/
|
|
57
|
-
"packages/implement/src/h5/http/utils/__tests__/xua.test.ts": "a35b3a9b6fe4e9ffb7aff20e2f2cc5f8147b6e44",
|
|
56
|
+
"packages/implement/src/h5/http/index.ts": "3ac24e79abe82f2ac2223d6c70aada6fce0240af",
|
|
57
|
+
"packages/implement/src/h5/http/utils/__tests__/xua.test.ts": "c92a065460d421b9e0723b4d6e74b1c5eed58102",
|
|
58
58
|
"packages/implement/src/h5/http/utils/index.ts": "05f4d94be09b9bfdcbb1365b31a5559e44a74991",
|
|
59
|
-
"packages/implement/src/h5/http/utils/session.ts": "
|
|
60
|
-
"packages/implement/src/h5/report/errors/index.ts": "
|
|
61
|
-
"packages/implement/src/h5/report/event-tracker.ts": "
|
|
62
|
-
"packages/implement/src/h5/report/index.ts": "
|
|
59
|
+
"packages/implement/src/h5/http/utils/session.ts": "4762a6a56762484f91ca5f2a456ab2cff3107659",
|
|
60
|
+
"packages/implement/src/h5/report/errors/index.ts": "22ef4184d6a6d272a5fefc1453a4a6d78ae8f2ff",
|
|
61
|
+
"packages/implement/src/h5/report/event-tracker.ts": "eb52379559e584a5b3f7a5241a3555b667b18c8c",
|
|
62
|
+
"packages/implement/src/h5/report/index.ts": "7154000726a72f477183d069eea5de87d12ceb7d",
|
|
63
63
|
"packages/implement/src/h5/report/task-tracker.ts": "184708c10b610b305f4f87af1639d9005486218e",
|
|
64
64
|
"packages/implement/src/index.native.ts": "39f7832965ef86a4bae707db859f64e9eb50b8af",
|
|
65
|
-
"packages/implement/src/index.ts": "
|
|
66
|
-
"packages/implement/src/native/api/ads.ts": "
|
|
65
|
+
"packages/implement/src/index.ts": "28aedcd4086e5bc32597b371d02384a90308f805",
|
|
66
|
+
"packages/implement/src/native/api/ads.ts": "bec8c772e1f881dc49030082e48b32af0c7db0fb",
|
|
67
67
|
"packages/implement/src/native/api/base.ts": "c4c4d04519cdbc3a08226c620f6314ee3b151435",
|
|
68
|
-
"packages/implement/src/native/api/get-system-info.ts": "
|
|
68
|
+
"packages/implement/src/native/api/get-system-info.ts": "d0132211c53425eed4811721ac5d577781b118a7",
|
|
69
69
|
"packages/implement/src/native/api/index.ts": "137dbcbeda2533a09d417d2b6c5d8dea992df9a6",
|
|
70
|
-
"packages/implement/src/native/api/keyboard.ts": "
|
|
70
|
+
"packages/implement/src/native/api/keyboard.ts": "89703b1d8b0929cd0366fd663fee7690be705b38",
|
|
71
71
|
"packages/implement/src/native/api/lifecycle.ts": "1e4b012bdfdfc9eaddf41cb08885c0e4b0addbf3",
|
|
72
72
|
"packages/implement/src/native/api/login.ts": "48d4ff177bf356cd6dcbc7f0756d3be0c392979c",
|
|
73
73
|
"packages/implement/src/native/api/request.ts": "a749e8ac9bb0bada4bca3008ac0be976621dcaf4",
|
|
74
74
|
"packages/implement/src/native/api/storage.ts": "7f56694e3a7f47605512f9cee7fce48ac620c169",
|
|
75
75
|
"packages/implement/src/native/api/task.ts": "26e06a3d6bbeaed34fd704d096e712448296607e",
|
|
76
76
|
"packages/implement/src/native/bootstrap/bridge.ts": "3dfce00262f240342d7e29ae155ce8c1732a02cd",
|
|
77
|
-
"packages/implement/src/native/bootstrap/index.ts": "
|
|
77
|
+
"packages/implement/src/native/bootstrap/index.ts": "e1ac709ac8e2f79bad35417d778007cebd268bfa",
|
|
78
78
|
"packages/implement/src/native/js-bridge/const.ts": "96156a123e89d20b51d59865e21f216ea5a30821",
|
|
79
79
|
"packages/implement/src/native/js-bridge/index.ts": "b65e1e20edcce8ce270381a9c7c79cc981761ad4",
|
|
80
80
|
"packages/implement/src/native/js-bridge/invoke.ts": "755402c39f887769242b3a3cee7c51c8eb0d9f11",
|
|
@@ -88,15 +88,15 @@
|
|
|
88
88
|
"packages/implement/src/native/js-core/message-port.ts": "7199fe2e9a89617bfce7853562ac0fd37772bce2",
|
|
89
89
|
"packages/implement/src/native/js-core/utils.ts": "a3639631f50764a5498f17949d3b9204fcc86fbf",
|
|
90
90
|
"packages/implement/src/native/network/create-fetch.ts": "e677cf812494994762afc48ddb8a6eca70a1936d",
|
|
91
|
-
"packages/implement/src/native/network/index.ts": "
|
|
91
|
+
"packages/implement/src/native/network/index.ts": "f57653dfa388545cbe7fb0a3f1eb9603c6208f45",
|
|
92
92
|
"packages/implement/src/native/network/report.ts": "705e9614faeb0611c9c57ced998885bdc3a02d11",
|
|
93
93
|
"packages/implement/src/native/network/types.ts": "4e8eb72bf0b0b26a5298ce42d96855d27769be51",
|
|
94
94
|
"packages/implement/src/native/network/utils.ts": "cc94ff34d8cda8e8a2a4731185c1d57c7dd04b92",
|
|
95
95
|
"packages/implement/src/native/report/errors/index.ts": "d2cd492f07c9b98bd8d469d4a5a84bb8520a3dd2",
|
|
96
|
-
"packages/implement/src/native/report/index.ts": "
|
|
96
|
+
"packages/implement/src/native/report/index.ts": "b30ccb9ef8e9124cbf156c6bdc3751465721383a",
|
|
97
97
|
"packages/implement/src/native/report/task-tracker.ts": "09f8bc1dd157fe9a2159c261278bd2a92930cee3",
|
|
98
98
|
"packages/implement/src/native/types/global.d.ts": "065076bbecdd9a0ffe7a71c19475356a6f816cee",
|
|
99
|
-
"packages/implement/src/native/types/native-method-map.d.ts": "
|
|
99
|
+
"packages/implement/src/native/types/native-method-map.d.ts": "5095851df53e1a63403f5d6135cbe2902bc9e6b0",
|
|
100
100
|
"packages/implement/src/native/types/native-method.d.ts": "e4e22c921a5b54d4e10fe5ca18158d691fbfe3e7",
|
|
101
101
|
"packages/implement/src/utils/index.ts": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
102
102
|
"packages/implement/tsconfig.json": "b150f4b2ef4eb9d98f92135d481fe530eb7145b5"
|
|
@@ -8,6 +8,7 @@ interface IAdsAntiCheatingConfig {
|
|
|
8
8
|
bannedForSessionThreshold?: number;
|
|
9
9
|
}
|
|
10
10
|
export declare class AdsAntiCheating {
|
|
11
|
+
readonly checkNetwork: () => boolean;
|
|
11
12
|
private maxAllowedAdsForTime;
|
|
12
13
|
private bannedForTimeThreshold;
|
|
13
14
|
private bannedReleaseTime;
|
|
@@ -20,8 +21,7 @@ export declare class AdsAntiCheating {
|
|
|
20
21
|
private _callAdsTimestampsForTime;
|
|
21
22
|
private callAdsTimestampsForSession;
|
|
22
23
|
private initTimestamp;
|
|
23
|
-
|
|
24
|
-
constructor(config?: IAdsAntiCheatingConfig);
|
|
24
|
+
constructor(checkNetwork: () => boolean, config?: IAdsAntiCheatingConfig);
|
|
25
25
|
/**
|
|
26
26
|
* Restore call ads timestamps for time from local storage
|
|
27
27
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface IChannelPolicy {
|
|
2
|
+
/**
|
|
3
|
+
* The rate at which interstitial ads should be shown.
|
|
4
|
+
* A value of 1 means always bypass interstitials call, while a value of 0 means always forbid calling interstitials.
|
|
5
|
+
* A value between 0 and 1 means the interstitial call will be bypassed with a probability of `rate`.
|
|
6
|
+
*/
|
|
7
|
+
interstitialRate?: number;
|
|
8
|
+
}
|
|
9
|
+
interface HttpClient {
|
|
10
|
+
get<T>(url: string, options?: {
|
|
11
|
+
query?: Record<string, string>;
|
|
12
|
+
}): Promise<T>;
|
|
13
|
+
}
|
|
14
|
+
export declare class ChannelPolicy {
|
|
15
|
+
readonly httpClient: HttpClient;
|
|
16
|
+
private configs;
|
|
17
|
+
private firstRun;
|
|
18
|
+
constructor(httpClient: HttpClient);
|
|
19
|
+
private init;
|
|
20
|
+
/**
|
|
21
|
+
* Should bypass calling interstitial based on the channel policy.
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
shouldBypassCallingInterstitial(): boolean;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Track } from '../report';
|
|
1
2
|
declare global {
|
|
2
3
|
interface Window {
|
|
3
4
|
adsbygoogle: Array<unknown>;
|
|
@@ -190,22 +191,30 @@ export interface IAdUnitParams {
|
|
|
190
191
|
*/
|
|
191
192
|
style?: string;
|
|
192
193
|
}
|
|
194
|
+
interface HttpClient {
|
|
195
|
+
get<T>(url: string, options?: {
|
|
196
|
+
query?: Record<string, string>;
|
|
197
|
+
}): Promise<T>;
|
|
198
|
+
}
|
|
193
199
|
/**
|
|
194
200
|
* Jolibox Ads SDK
|
|
195
201
|
*/
|
|
196
202
|
export declare class JoliboxAdsImpl {
|
|
203
|
+
readonly track: Track;
|
|
204
|
+
readonly httpClient: HttpClient;
|
|
205
|
+
readonly checkNetwork: () => boolean;
|
|
197
206
|
private configured;
|
|
198
207
|
config: IAdsInitParams;
|
|
199
208
|
clientId?: string;
|
|
200
209
|
channelId?: string;
|
|
201
210
|
unitId?: string;
|
|
202
|
-
private httpClient;
|
|
203
211
|
private antiCheating;
|
|
204
212
|
private adsActionDetection;
|
|
213
|
+
private channelPolicy;
|
|
205
214
|
/**
|
|
206
215
|
* Internal constructor, should not be called directly
|
|
207
216
|
*/
|
|
208
|
-
constructor();
|
|
217
|
+
constructor(track: Track, httpClient: HttpClient, checkNetwork: () => boolean);
|
|
209
218
|
/**
|
|
210
219
|
* Initialize the Ads SDK
|
|
211
220
|
* @param config
|
|
@@ -272,4 +281,4 @@ export declare class JoliboxAdsImpl {
|
|
|
272
281
|
*/
|
|
273
282
|
adUnit: (params: IAdUnitParams) => Promise<void>;
|
|
274
283
|
}
|
|
275
|
-
export
|
|
284
|
+
export {};
|
|
@@ -4,6 +4,7 @@ export declare const context: {
|
|
|
4
4
|
readonly testMode: boolean;
|
|
5
5
|
readonly testAdsMode: boolean;
|
|
6
6
|
readonly joliboxEnv: string;
|
|
7
|
+
readonly joliSource: string | null;
|
|
7
8
|
readonly mpId: string;
|
|
8
9
|
readonly mpVersion: string;
|
|
9
10
|
readonly platform: Env["platform"];
|
|
@@ -12,5 +13,6 @@ export declare const context: {
|
|
|
12
13
|
readonly hostInfo: HostInfo;
|
|
13
14
|
readonly hostUserInfo: HostUserInfo;
|
|
14
15
|
readonly sessionId: string;
|
|
16
|
+
readonly channel: string | undefined;
|
|
15
17
|
onEnvConfigChanged: (newConfig: Partial<Env>) => void;
|
|
16
18
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { uuidv4, isValidUUIDV4 } from '@jolibox/common';
|
|
2
|
+
export { uuidv4, isValidUUIDV4 };
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
export declare const platform: {
|
|
2
|
-
isiOS: boolean;
|
|
3
|
-
iosVersion: () => number[];
|
|
4
|
-
isAndroid: boolean;
|
|
5
|
-
isMac: boolean;
|
|
6
|
-
isFacebook: boolean;
|
|
7
|
-
isPC: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const getPlatform: () => "Android" | "Mac" | "iOS" | "Facebook" | "PC";
|
|
10
1
|
export declare const getAppVersion: () => string;
|
|
11
|
-
export declare const DEVICE_ID = "device_id";
|
|
12
|
-
export declare const ADVERTISING_ID = "advertising_id";
|
|
13
|
-
export declare const getStorage: (cookieKey: string) => string;
|
|
14
|
-
export declare const getDeviceId: () => string;
|
|
15
|
-
export declare const getAdvertisingId: () => string;
|
|
16
|
-
export declare const getUtmSource: () => string;
|
|
17
2
|
export declare const xUserAgent: () => string;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { IDevice, IPage, IEvent, EProject } from '
|
|
1
|
+
import { IDevice, IPage, IEvent, EProject } from '@jolibox/common';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for event tracker, all the event tracker should inherit from this class
|
|
4
|
+
* Send event to oss reporter
|
|
5
|
+
* @abstract
|
|
6
|
+
*/
|
|
2
7
|
export declare abstract class EventTracker {
|
|
3
8
|
deviceInfo: IDevice | null;
|
|
4
9
|
abstract doReport(event: unknown[]): void;
|
|
5
10
|
abstract doReport<T extends Record<string, unknown>>(event: unknown[], extra: T): void;
|
|
6
11
|
abstract doReport<T extends Record<string, unknown>>(event: unknown[], extra?: T): void;
|
|
7
12
|
private pastTrackings;
|
|
13
|
+
private samplesConfig;
|
|
8
14
|
private pushPastTracking;
|
|
15
|
+
constructor();
|
|
9
16
|
get networkIsOk(): boolean;
|
|
17
|
+
private fetchSamplesConfig;
|
|
18
|
+
private checkIsSampled;
|
|
10
19
|
getDevice(): IDevice;
|
|
11
20
|
getLocation(): IPage;
|
|
12
21
|
trackEvent(event: IEvent, project: EProject, extraInfo?: Record<string, unknown>): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './report';
|
|
2
|
-
import { APIError,
|
|
2
|
+
import { APIError, UserValidateError } from '@jolibox/common';
|
|
3
3
|
export declare function formatErrorCode(method: string, code?: number): string;
|
|
4
4
|
export declare const createAPIError: (error: {
|
|
5
5
|
code: number;
|
|
@@ -9,5 +9,5 @@ export declare const createAPIError: (error: {
|
|
|
9
9
|
errNo?: number;
|
|
10
10
|
errMsg?: string;
|
|
11
11
|
}) => APIError;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const createUserValidateAPIError: (msg: string) => UserValidateError;
|
|
13
13
|
export { errorReportEmitter, ErrorData } from './report';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PerformanceType, TrackEvent } from '@jolibox/types';
|
|
2
|
+
import { EProject } from '@jolibox/common';
|
|
2
3
|
export interface Track {
|
|
3
4
|
(tag: TrackEvent, info: Record<string, unknown> | null): void;
|
|
4
5
|
debounce: (tag: TrackEvent, info: Record<string, unknown>) => void;
|
|
5
6
|
}
|
|
6
7
|
export interface TrackPerformance {
|
|
7
|
-
(type: PerformanceType, duration: number): void;
|
|
8
|
+
(type: PerformanceType, duration: number, extra?: Record<string, unknown>): void;
|
|
8
9
|
debounce: (type: PerformanceType, duration: number) => void;
|
|
9
10
|
}
|
|
10
11
|
export type ReportHandler = (event: string, data: {
|
|
@@ -19,57 +20,3 @@ export interface CommonReportConfig {
|
|
|
19
20
|
mp_version: string;
|
|
20
21
|
trace_id?: number;
|
|
21
22
|
}
|
|
22
|
-
export declare enum EventType {
|
|
23
|
-
System = 1000,// used for web sdk
|
|
24
|
-
ErrorTrace = 1001,// used for web sdk
|
|
25
|
-
UserDefined = 1002
|
|
26
|
-
}
|
|
27
|
-
export interface IPage {
|
|
28
|
-
name: string;
|
|
29
|
-
params: Record<string, string | boolean | number | null> | null;
|
|
30
|
-
}
|
|
31
|
-
export interface IEvent {
|
|
32
|
-
name: string;
|
|
33
|
-
type: EventType;
|
|
34
|
-
location: IPage | null;
|
|
35
|
-
target: IPage | null;
|
|
36
|
-
extra: Record<string, string | boolean | number | null> | null;
|
|
37
|
-
timestamp: number;
|
|
38
|
-
userId: string | null;
|
|
39
|
-
}
|
|
40
|
-
export declare enum EProject {
|
|
41
|
-
MiniGame = "mini-game",
|
|
42
|
-
MiniDrama = "mini-drama",
|
|
43
|
-
App = "app",
|
|
44
|
-
WebSDK = "web-sdk",
|
|
45
|
-
AppSDK = "app-sdk"
|
|
46
|
-
}
|
|
47
|
-
export declare enum EPlatform {
|
|
48
|
-
App = 0,
|
|
49
|
-
H5 = 1,
|
|
50
|
-
Weapp = 2,
|
|
51
|
-
Alipay = 3,
|
|
52
|
-
Gcash = 4,
|
|
53
|
-
Dana = 5,
|
|
54
|
-
Umma = 6,
|
|
55
|
-
WebSDK = 1000,
|
|
56
|
-
AppSDK = 1001,
|
|
57
|
-
Other = 9999
|
|
58
|
-
}
|
|
59
|
-
export interface IDevice {
|
|
60
|
-
platform: EPlatform;
|
|
61
|
-
os: string;
|
|
62
|
-
appVersion: string;
|
|
63
|
-
appId: string;
|
|
64
|
-
model: string;
|
|
65
|
-
brand: string;
|
|
66
|
-
uuid: string;
|
|
67
|
-
jsSdkVersion: string | null;
|
|
68
|
-
extra: Record<string, string | boolean | number | null> | null;
|
|
69
|
-
}
|
|
70
|
-
export interface IEventPackage {
|
|
71
|
-
protocolVersion: string;
|
|
72
|
-
events: IEvent[];
|
|
73
|
-
device: IDevice;
|
|
74
|
-
project: EProject;
|
|
75
|
-
}
|
package/dist/h5/api/index.d.ts
CHANGED
package/dist/h5/http/index.d.ts
CHANGED
|
@@ -12,18 +12,18 @@ export declare class JoliboxHttpClient implements IHttpClient {
|
|
|
12
12
|
private xua;
|
|
13
13
|
private getJoliSource;
|
|
14
14
|
constructor(config?: IHttpClientInitParams);
|
|
15
|
-
get<T>(path: string,
|
|
15
|
+
get<T>(path: string, configs?: {
|
|
16
16
|
query?: Record<string, string>;
|
|
17
17
|
headers?: Record<string, string>;
|
|
18
18
|
timeout?: number;
|
|
19
19
|
}): Promise<T>;
|
|
20
|
-
post<T = any>(path: string,
|
|
20
|
+
post<T = any>(path: string, configs?: {
|
|
21
21
|
data?: any;
|
|
22
22
|
query?: Record<string, string>;
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
timeout?: number;
|
|
25
25
|
}): Promise<T>;
|
|
26
|
-
put<T>(path: string,
|
|
26
|
+
put<T>(path: string, configs?: {
|
|
27
27
|
data?: any;
|
|
28
28
|
query?: Record<string, string>;
|
|
29
29
|
headers?: Record<string, string>;
|
|
@@ -2,7 +2,7 @@ import './errors';
|
|
|
2
2
|
import { EventEmitter } from '@jolibox/common';
|
|
3
3
|
import { H5TaskTracker } from './task-tracker';
|
|
4
4
|
export * from '../../common/report/types';
|
|
5
|
-
declare const track: import("
|
|
5
|
+
declare const track: import("@/common/report").Track, trackPerformance: import("@/common/report").TrackPerformance;
|
|
6
6
|
export { track, trackPerformance };
|
|
7
7
|
export declare const h5TaskEmitter: EventEmitter<{
|
|
8
8
|
visible: [boolean];
|
package/dist/index.d.ts
CHANGED