@jolibox/implement 1.2.0-beta.9 → 1.2.1
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 +5 -5
- package/dist/index.js +25 -25
- package/dist/index.native.js +22 -22
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.ts +4 -8
- package/src/common/rewards/registers/utils/coins/joligem/gem-handler.ts +0 -4
- package/src/h5/api/ads.ts +3 -0
- package/src/native/api/ads.ts +14 -0
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.2.
|
|
3
|
+
> @jolibox/implement@1.2.1 clean
|
|
4
4
|
> rimraf ./dist
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> @jolibox/implement@1.2.
|
|
7
|
+
> @jolibox/implement@1.2.1 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.2.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jolibox/common": "1.2.
|
|
10
|
-
"@jolibox/types": "1.2.
|
|
11
|
-
"@jolibox/native-bridge": "1.2.
|
|
12
|
-
"@jolibox/ads": "1.2.
|
|
9
|
+
"@jolibox/common": "1.2.1",
|
|
10
|
+
"@jolibox/types": "1.2.1",
|
|
11
|
+
"@jolibox/native-bridge": "1.2.1",
|
|
12
|
+
"@jolibox/ads": "1.2.1",
|
|
13
13
|
"localforage": "1.10.0",
|
|
14
14
|
"@jolibox/ui": "1.0.0",
|
|
15
15
|
"web-vitals": "4.2.4"
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
} from '../commands';
|
|
17
17
|
import { rewardsCommands } from '../rewards-command';
|
|
18
18
|
import { RewardsCommandType } from '@jolibox/types';
|
|
19
|
-
import { track } from '@/native/report';
|
|
20
19
|
|
|
21
20
|
interface ICurrencyUnlockRes {
|
|
22
21
|
code: 'SUCCESS' | 'BALANCE_NOT_ENOUGH' | 'EPISODE_LOCK_JUMP' | 'EPISODE_UNLOCK_ALREADY';
|
|
@@ -52,10 +51,10 @@ const createCommonCurrencyRewardHandler = (
|
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
53
|
) => {
|
|
55
|
-
registerUseUnloginCommand(type, 'JOLI_COIN', {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
54
|
+
// registerUseUnloginCommand(type, 'JOLI_COIN', {
|
|
55
|
+
// httpClient: httpClient,
|
|
56
|
+
// showUnloginModal: showUnloginModal
|
|
57
|
+
// });
|
|
59
58
|
registerUsePaymentCommand(type, 'JOLI_COIN', {
|
|
60
59
|
httpClient: httpClient,
|
|
61
60
|
initiateAndAwaitPayment: initiateAndAwaitPayment
|
|
@@ -104,9 +103,6 @@ const createCommonCurrencyRewardHandler = (
|
|
|
104
103
|
if ('adViewed' in params) {
|
|
105
104
|
params.adViewed?.();
|
|
106
105
|
}
|
|
107
|
-
track('jolicoin_unlock_success', {
|
|
108
|
-
quantity: unlockWithCurrency.data.quantity
|
|
109
|
-
});
|
|
110
106
|
} catch (e) {
|
|
111
107
|
console.error('-----unlockWithJolicoin adBreakDone error-----', e);
|
|
112
108
|
}
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
import { registerUseJolicoinCommand, createShowUnlockWithCurrencyModal } from '../commands/use-jolicoin';
|
|
16
16
|
import { rewardsCommands } from '../rewards-command';
|
|
17
17
|
import { RewardsCommandType } from '@jolibox/types';
|
|
18
|
-
import { track } from '@/native/report';
|
|
19
18
|
|
|
20
19
|
interface IGemUnlockRes {
|
|
21
20
|
code: 'SUCCESS' | 'BALANCE_NOT_ENOUGH' | 'EPISODE_LOCK_JUMP' | 'EPISODE_UNLOCK_ALREADY';
|
|
@@ -104,9 +103,6 @@ export const createCommonGemRewardHandler = (
|
|
|
104
103
|
if ('adViewed' in params) {
|
|
105
104
|
params.adViewed?.();
|
|
106
105
|
}
|
|
107
|
-
track('gem_unlock_success', {
|
|
108
|
-
quantity: unlockWithGem.data.quantity
|
|
109
|
-
});
|
|
110
106
|
} catch (e) {
|
|
111
107
|
console.error('-----unlockWithGem adBreakDone error-----', e);
|
|
112
108
|
}
|
package/src/h5/api/ads.ts
CHANGED
|
@@ -131,6 +131,9 @@ const handleUnlockSuccess = (params: { quantity: number; balance: number }) => {
|
|
|
131
131
|
notifyCustomEvent('JOLIBOX_CUSTOM_REWARDS_EVENT', {
|
|
132
132
|
JOLI_COIN: params
|
|
133
133
|
});
|
|
134
|
+
track('jolicoin_unlock_success', {
|
|
135
|
+
quantity: params.quantity
|
|
136
|
+
});
|
|
134
137
|
};
|
|
135
138
|
|
|
136
139
|
const adsManager = new H5AdsManager(adsContext);
|
package/src/native/api/ads.ts
CHANGED
|
@@ -98,6 +98,9 @@ rewardsHelper.registerRewardHandler(
|
|
|
98
98
|
createJolicoinRewardHandler(httpClient, {
|
|
99
99
|
onUnlockSuccess: (params) => {
|
|
100
100
|
showUnlockSuccessToast(params);
|
|
101
|
+
track('jolicoin_unlock_success', {
|
|
102
|
+
quantity: params.quantity
|
|
103
|
+
});
|
|
101
104
|
},
|
|
102
105
|
onUnlockFailed: () => {
|
|
103
106
|
console.log('onUnlockFailed');
|
|
@@ -110,6 +113,10 @@ rewardsHelper.registerRewardHandler(
|
|
|
110
113
|
createJolicoinOnlyRewardHandler(httpClient, {
|
|
111
114
|
onUnlockSuccess: (params) => {
|
|
112
115
|
showUnlockSuccessToast(params);
|
|
116
|
+
track('jolicoin_unlock_success', {
|
|
117
|
+
quantity: params.quantity,
|
|
118
|
+
isOnly: true
|
|
119
|
+
});
|
|
113
120
|
},
|
|
114
121
|
onUnlockFailed: () => {
|
|
115
122
|
console.log('onUnlockFailed');
|
|
@@ -123,6 +130,9 @@ rewardsHelper.registerRewardHandler(
|
|
|
123
130
|
createGemRewardHandler(httpClient, {
|
|
124
131
|
onUnlockSuccess: (params) => {
|
|
125
132
|
showGemSuccessToast(params);
|
|
133
|
+
track('gem_unlock_success', {
|
|
134
|
+
quantity: params.quantity
|
|
135
|
+
});
|
|
126
136
|
}
|
|
127
137
|
}) as unknown as (params?: unknown) => Promise<boolean>
|
|
128
138
|
);
|
|
@@ -132,6 +142,10 @@ rewardsHelper.registerRewardHandler(
|
|
|
132
142
|
createGemOnlyRewardHandler(httpClient, {
|
|
133
143
|
onUnlockSuccess: (params) => {
|
|
134
144
|
showGemSuccessToast(params);
|
|
145
|
+
track('gem_unlock_success', {
|
|
146
|
+
quantity: params.quantity,
|
|
147
|
+
isOnly: true
|
|
148
|
+
});
|
|
135
149
|
}
|
|
136
150
|
}) as unknown as (params?: unknown) => Promise<boolean>
|
|
137
151
|
);
|