@jolibox/ads 1.1.19-beta.6
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/README.md +1 -0
- package/dist/afg/adbreak-async-proxy.d.ts +36 -0
- package/dist/afg/ads-action-detection.d.ts +8 -0
- package/dist/afg/ads-interface.d.ts +199 -0
- package/dist/afg/adsense/index.d.ts +27 -0
- package/dist/afg/adsense/type.d.ts +14 -0
- package/dist/afg/channel-policy.d.ts +22 -0
- package/dist/afg/index.d.ts +21 -0
- package/dist/afg/okspin/index.d.ts +18 -0
- package/dist/afg/okspin/type.d.ts +13 -0
- package/dist/afg/type.d.ts +9 -0
- package/dist/afv/adrequest-async-proxy.d.ts +18 -0
- package/dist/afv/ads-interface.d.ts +23 -0
- package/dist/afv/ima/components/ads-overlay.d.ts +14 -0
- package/dist/afv/ima/ima-impl.d.ts +200 -0
- package/dist/afv/ima/index.d.ts +15 -0
- package/dist/afv/ima/type.d.ts +10 -0
- package/dist/afv/index.d.ts +16 -0
- package/dist/afv/okspin/index.d.ts +15 -0
- package/dist/afv/okspin/type.d.ts +13 -0
- package/dist/afv/type.d.ts +10 -0
- package/dist/components/common.d.ts +1 -0
- package/dist/components/hooks/use-interval.d.ts +1 -0
- package/dist/components/okspin/ads-overlay.d.ts +16 -0
- package/dist/components/okspin/confirm-popup.d.ts +5 -0
- package/dist/components/okspin/handle-bar.d.ts +14 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3662 -0
- package/dist/type/base.d.ts +64 -0
- package/dist/utils/track.d.ts +11 -0
- package/package.json +48 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { EPlatform, EventEmitter } from '@jolibox/common';
|
|
2
|
+
import type { TrackEvent } from '@jolibox/types';
|
|
3
|
+
export interface IGeneralError<T = any> {
|
|
4
|
+
code?: string;
|
|
5
|
+
errMsg: string;
|
|
6
|
+
data?: T;
|
|
7
|
+
extra?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface IResponse<T = undefined, E = undefined> {
|
|
10
|
+
code: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
data: T;
|
|
13
|
+
extra: E;
|
|
14
|
+
}
|
|
15
|
+
export declare class ResponseError<T = any> extends Error implements IGeneralError<T> {
|
|
16
|
+
name: string;
|
|
17
|
+
message: string;
|
|
18
|
+
errMsg: string;
|
|
19
|
+
code?: 'SUCCESS' | 'UNAUTHORIZED' | 'NETWORK_ERROR' | string;
|
|
20
|
+
data?: T;
|
|
21
|
+
extra?: any;
|
|
22
|
+
constructor(message: string);
|
|
23
|
+
}
|
|
24
|
+
export interface IHttpClient {
|
|
25
|
+
get<T>(path: string, { query, headers, timeout }: {
|
|
26
|
+
query?: Record<string, string>;
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
}): Promise<T>;
|
|
30
|
+
post<T extends any = any>(path: string, { data, query, headers, timeout }: {
|
|
31
|
+
data?: any;
|
|
32
|
+
query?: Record<string, string>;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
timeout?: number;
|
|
35
|
+
}): Promise<T>;
|
|
36
|
+
}
|
|
37
|
+
export interface Track {
|
|
38
|
+
(tag: TrackEvent, info: Record<string, unknown> | null): void;
|
|
39
|
+
debounce: (tag: TrackEvent, info: Record<string, unknown>) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface IAdsContext<T extends 'DRAMA' | 'GAME' = any> {
|
|
42
|
+
httpClient: IHttpClient;
|
|
43
|
+
checkNetwork: () => boolean;
|
|
44
|
+
track: Track;
|
|
45
|
+
eventEmitter?: EventEmitter<{
|
|
46
|
+
isAdShowing: [boolean];
|
|
47
|
+
}, 'isAdShowing'>;
|
|
48
|
+
getContextInfo: () => {
|
|
49
|
+
hostAppId?: string;
|
|
50
|
+
deviceId: string;
|
|
51
|
+
adId: string;
|
|
52
|
+
sessionId: string;
|
|
53
|
+
userId?: string;
|
|
54
|
+
objectType: T;
|
|
55
|
+
objectId: string;
|
|
56
|
+
testAdsMode: boolean;
|
|
57
|
+
channel: string;
|
|
58
|
+
deviceModel?: string;
|
|
59
|
+
deviceBrand?: string;
|
|
60
|
+
osType: 'IOS' | 'ANDROID' | 'PC';
|
|
61
|
+
runtimeType: 'APP' | 'WEB' | 'MINI_APP';
|
|
62
|
+
platform?: EPlatform;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IAdsContext } from '@/type/base';
|
|
2
|
+
import type { IDevice, IPage } from '@jolibox/common';
|
|
3
|
+
export declare class AdsTrackSerializer {
|
|
4
|
+
private context;
|
|
5
|
+
private placement;
|
|
6
|
+
private contextInfo;
|
|
7
|
+
constructor(context: IAdsContext, placement?: 'GAME' | 'DRAMA');
|
|
8
|
+
getLocation(): IPage;
|
|
9
|
+
getDevice(): IDevice;
|
|
10
|
+
serialize(eventName: string, extra: Record<string, string | number | boolean | null> | null): any[];
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jolibox/ads",
|
|
3
|
+
"description": "This project is for integrating Jolibox ads providers",
|
|
4
|
+
"version": "1.1.19-beta.6",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src/types"
|
|
12
|
+
],
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@jolibox/common": "1.1.19-beta.6",
|
|
16
|
+
"preact": "10.26.4",
|
|
17
|
+
"@preact/signals": "2.0.4",
|
|
18
|
+
"@emotion/css": "11.13.5",
|
|
19
|
+
"@jolibox/types": "1.1.19-beta.6"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@rollup/plugin-replace": "6.0.2",
|
|
23
|
+
"vite-plugin-node-polyfills": "0.23.0",
|
|
24
|
+
"@preact/preset-vite": "2.8.1",
|
|
25
|
+
"@types/react": "18.2.0",
|
|
26
|
+
"@types/react-dom": "18.2.0",
|
|
27
|
+
"typescript": "5.7.3",
|
|
28
|
+
"@types/jest": "28.1.1",
|
|
29
|
+
"rimraf": "6.0.1",
|
|
30
|
+
"esbuild": "0.24.2",
|
|
31
|
+
"esbuild-obfuscator-plugin": "0.0.5",
|
|
32
|
+
"@jolibox/eslint-config": "1.0.0",
|
|
33
|
+
"vite": "5.1.4",
|
|
34
|
+
"@types/node": "18.0.0",
|
|
35
|
+
"javascript-obfuscator": "4.1.1"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"clean": "rimraf ./dist",
|
|
39
|
+
"build": "npm run clean && vite build && tsc",
|
|
40
|
+
"build:esbuild": "npm run clean && npm run build:esm && tsc",
|
|
41
|
+
"build:esm": "BUILD_VERSION=$(node -p \"require('./package.json').version\") node esbuild.config.js --format=esm",
|
|
42
|
+
"build:iife": "BUILD_VERSION=$(node -p \"require('./package.json').version\") node esbuild.config.js --format=iife",
|
|
43
|
+
"build:cjs": "BUILD_VERSION=$(node -p \"require('./package.json').version\") node esbuild.config.js --format=cjs",
|
|
44
|
+
"dev": "vite --config example/vite.config.ts",
|
|
45
|
+
"test": "jest"
|
|
46
|
+
},
|
|
47
|
+
"readme": "# Jolibox JSSDK Interface\n"
|
|
48
|
+
}
|