@jolibox/ads 1.1.46 → 1.1.48
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/afg/index.d.ts +2 -3
- package/dist/afv/index.d.ts +2 -3
- package/dist/components/ads-request.d.ts +70 -0
- package/dist/index.js +901 -886
- package/package.json +3 -3
package/dist/afg/index.d.ts
CHANGED
|
@@ -9,14 +9,13 @@ export declare class JoliboxAdsForGame {
|
|
|
9
9
|
private providers;
|
|
10
10
|
private channelPolicy;
|
|
11
11
|
private adsActionDetection;
|
|
12
|
-
private
|
|
12
|
+
private requestContext;
|
|
13
|
+
private adsRequest;
|
|
13
14
|
private initialized;
|
|
14
15
|
private adsIsShowing;
|
|
15
16
|
private lastAdBreak?;
|
|
16
17
|
private initializedTimeStamp;
|
|
17
18
|
constructor(context?: IAdsContext<'GAME'>);
|
|
18
|
-
private getRequestContextData;
|
|
19
|
-
private getRequestBizParams;
|
|
20
19
|
init(_config?: IAdsInitParams): Promise<void>;
|
|
21
20
|
adConfig(params: IAdConfigParams): void;
|
|
22
21
|
adBreak(params: IAdBreakParams): Promise<void>;
|
package/dist/afv/index.d.ts
CHANGED
|
@@ -7,11 +7,10 @@ export declare class JoliboxAdsForVideo {
|
|
|
7
7
|
private context;
|
|
8
8
|
private contextInfo;
|
|
9
9
|
private providers;
|
|
10
|
-
private
|
|
10
|
+
private requestContext;
|
|
11
|
+
private adsRequest;
|
|
11
12
|
private initialized;
|
|
12
13
|
constructor(context?: IAdsContext<'DRAMA'>);
|
|
13
|
-
private getRequestContextData;
|
|
14
|
-
private getRequestBizParams;
|
|
15
14
|
init(): Promise<void>;
|
|
16
15
|
/**
|
|
17
16
|
* Destroy all providers and reset the initialized state.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { IAdsContext } from '../type/base';
|
|
2
|
+
import type { IAFGAdBreakServerParams } from '../afg/type';
|
|
3
|
+
import type { IAdBreakParams } from '../afg/ads-interface';
|
|
4
|
+
import { IAFVRequestAdServerParams } from '@/afv/type';
|
|
5
|
+
/**
|
|
6
|
+
* Class to manage the context of an ad request.
|
|
7
|
+
* It provides methods to get the context information, business parameters, and serialize ad tracking data.
|
|
8
|
+
* @class AdsRequestContext
|
|
9
|
+
*/
|
|
10
|
+
export declare class AdsRequestContext {
|
|
11
|
+
private context;
|
|
12
|
+
private adsTrackSerializer;
|
|
13
|
+
private contextInfo;
|
|
14
|
+
constructor(context: IAdsContext);
|
|
15
|
+
getRequestContextData(eventName: string): {
|
|
16
|
+
report: string;
|
|
17
|
+
osType: "IOS" | "ANDROID" | "PC";
|
|
18
|
+
runtimeType: "APP" | "WEB" | "MINI_APP";
|
|
19
|
+
sessionId: string;
|
|
20
|
+
deviceId: string;
|
|
21
|
+
adId: string;
|
|
22
|
+
deviceModel: string;
|
|
23
|
+
deviceBrand: string;
|
|
24
|
+
dimension: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
getRequestBizParams(): {
|
|
30
|
+
objectType: any;
|
|
31
|
+
objectId: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Class to cache the ads info request.
|
|
36
|
+
* @class AdsCache
|
|
37
|
+
*/
|
|
38
|
+
export declare class AdsRequest {
|
|
39
|
+
private context;
|
|
40
|
+
private contextInfo;
|
|
41
|
+
private requestContext;
|
|
42
|
+
private pendingAFGAdsInfo;
|
|
43
|
+
private pendingAFVAdsInfo;
|
|
44
|
+
constructor(context: IAdsContext, cacheInitial?: {
|
|
45
|
+
reward?: boolean;
|
|
46
|
+
interstitial?: boolean;
|
|
47
|
+
afv?: boolean;
|
|
48
|
+
});
|
|
49
|
+
private doFetchAdsInfo;
|
|
50
|
+
cacheRewardInfo: () => void;
|
|
51
|
+
cacheInterstitialInfo: (type: IAdBreakParams["type"]) => void;
|
|
52
|
+
cacheAFVInfo: () => void;
|
|
53
|
+
cacheNextAFGAdsInfo: (type: IAdBreakParams["type"]) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetches the ads info for Game.
|
|
56
|
+
* @param type - The type of ad break.
|
|
57
|
+
* @returns The AFG ads info.
|
|
58
|
+
*/
|
|
59
|
+
getAFGAdsInfo: (type: IAdBreakParams["type"]) => Promise<(IAFGAdBreakServerParams & {
|
|
60
|
+
seq: number;
|
|
61
|
+
})[] | null>;
|
|
62
|
+
/**
|
|
63
|
+
* Fetches the ads info for Drama.
|
|
64
|
+
* @param cache - Whether to use the cache or not. default is true.
|
|
65
|
+
* @returns The AFV ads info.
|
|
66
|
+
*/
|
|
67
|
+
getAFVAdsInfo: (cache?: boolean) => Promise<(IAFVRequestAdServerParams & {
|
|
68
|
+
seq: number;
|
|
69
|
+
})[] | null>;
|
|
70
|
+
}
|