@jolibox/implement 1.1.52-beta.1 → 1.1.52
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 +4 -6
- package/dist/common/context/index.d.ts +1 -0
- package/dist/index.js +9 -9
- package/dist/index.native.js +15 -15
- package/implement.build.log +2 -2
- package/package.json +6 -6
- package/src/common/context/index.ts +3 -0
- package/src/common/rewards/registers/utils/coins/index.ts +12 -7
- package/src/h5/api/ads.ts +13 -5
- package/CHANGELOG.json +0 -11
- package/CHANGELOG.md +0 -9
- package/implementation.build.log +0 -9
package/implement.build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Invoking: npm run clean && npm run build:esm && tsc
|
|
2
2
|
|
|
3
|
-
> @jolibox/implement@1.1.52
|
|
3
|
+
> @jolibox/implement@1.1.52 clean
|
|
4
4
|
> rimraf ./dist
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> @jolibox/implement@1.1.52
|
|
7
|
+
> @jolibox/implement@1.1.52 build:esm
|
|
8
8
|
> BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jolibox/implement",
|
|
3
3
|
"description": "This project is Jolibox JS-SDk implement for Native && H5",
|
|
4
|
-
"version": "1.1.52
|
|
4
|
+
"version": "1.1.52",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jolibox/common": "1.1.52
|
|
10
|
-
"@jolibox/types": "1.1.52
|
|
11
|
-
"@jolibox/native-bridge": "1.1.52
|
|
12
|
-
"@jolibox/ads": "1.1.52
|
|
9
|
+
"@jolibox/common": "1.1.52",
|
|
10
|
+
"@jolibox/types": "1.1.52",
|
|
11
|
+
"@jolibox/native-bridge": "1.1.52",
|
|
12
|
+
"@jolibox/ads": "1.1.52",
|
|
13
13
|
"localforage": "1.10.0",
|
|
14
14
|
"@jolibox/ui": "1.0.0",
|
|
15
15
|
"web-vitals": "4.2.4"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@types/jest": "28.1.1",
|
|
20
20
|
"rimraf": "6.0.1",
|
|
21
21
|
"esbuild": "0.24.2",
|
|
22
|
-
"@jolibox/eslint-config": "1.0.
|
|
22
|
+
"@jolibox/eslint-config": "1.0.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"clean": "rimraf ./dist",
|
|
@@ -162,6 +162,9 @@ const wrapContext = () => {
|
|
|
162
162
|
navigationBarHeight: rawNavHeight !== undefined ? rawNavHeight / pixelRatio : 10
|
|
163
163
|
};
|
|
164
164
|
},
|
|
165
|
+
get abTests(): string[] {
|
|
166
|
+
return env.abValues?.split(',') ?? [];
|
|
167
|
+
},
|
|
165
168
|
onEnvConfigChanged: (newConfig: Partial<Env>) => {
|
|
166
169
|
mergeWith(env, newConfig, mergeArray);
|
|
167
170
|
},
|
|
@@ -61,16 +61,21 @@ export const createCommonJolicoinRewardHandler = (
|
|
|
61
61
|
registerUseJolicoinCommand(type, {
|
|
62
62
|
showUnlockWithJolicoinModal: showUnlockWithJolicoinModal
|
|
63
63
|
});
|
|
64
|
+
|
|
65
|
+
const targetABTest = context.abTests.find((abTest) => abTest.startsWith('coinOpt_v1'));
|
|
66
|
+
let commands = [];
|
|
67
|
+
if (targetABTest) {
|
|
68
|
+
commands = [`Rewards.${type}.usePayment`, `Rewards.${type}.useJolicoin`];
|
|
69
|
+
} else {
|
|
70
|
+
commands = [
|
|
71
|
+
`Rewards.${type}.useUnloginModal`,
|
|
72
|
+
`Rewards.${type}.usePayment`,
|
|
73
|
+
`Rewards.${type}.useJolicoin`
|
|
74
|
+
];
|
|
75
|
+
}
|
|
64
76
|
return async (params: IAdBreakParams) => {
|
|
65
77
|
try {
|
|
66
78
|
let result = true;
|
|
67
|
-
|
|
68
|
-
const commands = [
|
|
69
|
-
`Rewards.${type}.useUnloginModal`,
|
|
70
|
-
`Rewards.${type}.usePayment`,
|
|
71
|
-
`Rewards.${type}.useJolicoin`
|
|
72
|
-
];
|
|
73
|
-
|
|
74
79
|
for (const command of commands) {
|
|
75
80
|
const commandResult = await rewardsCommands.executeCommand(command as RewardsCommandType);
|
|
76
81
|
result = result && commandResult.result !== 'FAILED';
|
package/src/h5/api/ads.ts
CHANGED
|
@@ -127,6 +127,11 @@ const adsContext: IAdsContext<'GAME'> = {
|
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
+
const handleUnlockSuccess = (params: { quantity: number; balance: number }) => {
|
|
131
|
+
notifyCustomEvent('JOLIBOX_CUSTOM_REWARDS_EVENT', {
|
|
132
|
+
JOLI_COIN: params
|
|
133
|
+
});
|
|
134
|
+
};
|
|
130
135
|
|
|
131
136
|
const adsManager = new H5AdsManager(adsContext);
|
|
132
137
|
const adsHandler = adsManager.getAdsHandler(context.sdkEnvironment);
|
|
@@ -135,11 +140,14 @@ rewardsHelper.registerRewardHandler('ADS', createAdsRewardHandler(adsHandler.get
|
|
|
135
140
|
rewardsHelper.registerRewardHandler(
|
|
136
141
|
'JOLI_COIN',
|
|
137
142
|
createJolicoinRewardHandler(httpClient, {
|
|
138
|
-
onUnlockSuccess: (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
onUnlockSuccess: handleUnlockSuccess.bind(this)
|
|
144
|
+
}) as unknown as (params?: unknown) => Promise<boolean>
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
rewardsHelper.registerRewardHandler(
|
|
148
|
+
'JOLI_COIN_ONLY',
|
|
149
|
+
createJolicoinOnlyRewardHandler(httpClient, {
|
|
150
|
+
onUnlockSuccess: handleUnlockSuccess.bind(this)
|
|
143
151
|
}) as unknown as (params?: unknown) => Promise<boolean>
|
|
144
152
|
);
|
|
145
153
|
|
package/CHANGELOG.json
DELETED
package/CHANGELOG.md
DELETED
package/implementation.build.log
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Invoking: npm run clean && npm run build:esm && tsc
|
|
2
|
-
|
|
3
|
-
> @jolibox/implementation@1.1.4-beta.3 clean
|
|
4
|
-
> rimraf ./dist
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
> @jolibox/implementation@1.1.4-beta.3 build:esm
|
|
8
|
-
> BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
|
|
9
|
-
|