@jolibox/implement 1.2.8 → 1.2.9-beta.9
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 +37 -27
- package/dist/common/rewards/registers/use-gem-only.d.ts +2 -1
- package/dist/common/rewards/registers/use-gem.d.ts +2 -1
- package/dist/common/rewards/registers/use-jolicoin-only.d.ts +2 -1
- package/dist/common/rewards/registers/use-jolicoin.d.ts +2 -1
- package/dist/common/rewards/registers/use-subscription.d.ts +2 -1
- package/dist/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.d.ts +1 -0
- package/dist/common/rewards/registers/utils/coins/joligem/gem-handler.d.ts +2 -1
- package/dist/common/rewards/registers/utils/common.d.ts +1 -0
- package/dist/common/rewards/registers/utils/subscription/sub-handler.d.ts +2 -1
- package/dist/common/rewards/reward-emitter.d.ts +8 -0
- package/dist/common/rewards/type.d.ts +1 -1
- package/dist/common/utils/index.d.ts +1 -1
- package/dist/index.js +25 -25
- package/dist/index.native.js +54 -54
- package/dist/native/payment/utils/__tests__/cache-with-storage.test.d.ts +1 -0
- package/dist/native/payment/utils/cache-with-storage.d.ts +7 -0
- package/dist/native/rewards/check-frequency.d.ts +8 -0
- package/dist/native/rewards/index.d.ts +1 -0
- package/dist/native/rewards/ui/subscription-modal.d.ts +1 -0
- package/dist/native/subscription/index.d.ts +3 -0
- package/dist/native/subscription/registers/base.d.ts +22 -0
- package/dist/native/subscription/registers/sub-app.d.ts +21 -0
- package/dist/native/subscription/registers/type.d.ts +10 -0
- package/dist/native/subscription/subscription-helper.d.ts +22 -0
- package/dist/native/subscription/subscription-service.d.ts +43 -0
- package/dist/native/subscription/type.d.ts +18 -0
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/context/index.ts +4 -1
- package/src/common/rewards/registers/use-gem-only.ts +5 -2
- package/src/common/rewards/registers/use-gem.ts +5 -2
- package/src/common/rewards/registers/use-jolicoin-only.ts +5 -2
- package/src/common/rewards/registers/use-jolicoin.ts +5 -2
- package/src/common/rewards/registers/use-subscription.ts +5 -2
- package/src/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.ts +33 -11
- package/src/common/rewards/registers/utils/coins/joligem/gem-handler.ts +34 -13
- package/src/common/rewards/registers/utils/common.ts +9 -0
- package/src/common/rewards/registers/utils/subscription/commands/use-subscription.ts +16 -0
- package/src/common/rewards/registers/utils/subscription/sub-handler.ts +22 -6
- package/src/common/rewards/reward-emitter.ts +8 -0
- package/src/common/rewards/type.ts +1 -1
- package/src/common/utils/index.ts +1 -1
- package/src/h5/api/ads.ts +6 -3
- package/src/h5/bootstrap/auth/__tests__/auth.test.ts +15 -9
- package/src/h5/bootstrap/auth/sub.ts +1 -1
- package/src/native/api/ads.ts +43 -6
- package/src/native/api/call-host-method.ts +5 -61
- package/src/native/api/login.ts +22 -7
- package/src/native/api/payment.ts +78 -3
- package/src/native/payment/__tests__/payment-service-simple.test.ts +14 -1
- package/src/native/payment/payment-service.ts +26 -27
- package/src/native/payment/utils/__tests__/cache-with-storage.test.ts +414 -0
- package/src/native/payment/utils/cache-with-storage.ts +112 -0
- package/src/native/rewards/check-frequency.ts +6 -0
- package/src/native/rewards/index.ts +1 -0
- package/src/native/rewards/ui/payment-modal.ts +2 -2
- package/src/native/rewards/ui/subscription-modal.ts +81 -0
- package/src/native/subscription/index.ts +12 -0
- package/src/native/subscription/registers/base.ts +88 -0
- package/src/native/subscription/registers/sub-app.ts +258 -0
- package/src/native/subscription/registers/type.ts +13 -0
- package/src/native/subscription/subscription-helper.ts +53 -0
- package/src/native/subscription/subscription-service.ts +339 -0
- package/src/native/subscription/type.ts +18 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"packages/implement/.eslintrc.js": "7a3d2747dc887655ca9e2d3ff621f7dfd98500b9",
|
|
5
5
|
"packages/implement/README.md": "5660cd88848b7a5428394cc34d881a35dd402188",
|
|
6
6
|
"packages/implement/esbuild.config.js": "876db4e384d8543b66a0b61d8f7b277a36dfb4e0",
|
|
7
|
-
"packages/implement/package.json": "
|
|
7
|
+
"packages/implement/package.json": "daf48a931336d492e4a311b1ca21a3ec57a7841f",
|
|
8
8
|
"packages/implement/src/common/ads/ads-action-detection.ts": "5a7b9f85d7eab9e744f8a9fc7638063f43baa214",
|
|
9
9
|
"packages/implement/src/common/ads/anti-cheating.test.ts": "e2ff3dc6760cfd28d0f8c15703d7fb20d43df583",
|
|
10
10
|
"packages/implement/src/common/ads/anti-cheating.ts": "a3ffb6a78e289e1c0ce45c7f7c0cee000e75e541",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"packages/implement/src/common/api-factory/validator/index.ts": "204e86b97c854647d177805e3180d4cfd542b0f8",
|
|
32
32
|
"packages/implement/src/common/api-factory/validator/validate.ts": "5fee8175a9a05a69fe709c7e7899e5372d81efb1",
|
|
33
33
|
"packages/implement/src/common/can-i-use.ts": "9a28562870d92b82ce42ec656c8e9d868dd87528",
|
|
34
|
-
"packages/implement/src/common/context/index.ts": "
|
|
34
|
+
"packages/implement/src/common/context/index.ts": "a8212536b55c979025ba6544122894bca1dfd198",
|
|
35
35
|
"packages/implement/src/common/context/types.ts": "244ff65de52dcbce2457ffee427f5fa102987825",
|
|
36
36
|
"packages/implement/src/common/context/url-parse.ts": "f0c52a43038503d1c234738cd971715373c8e03e",
|
|
37
37
|
"packages/implement/src/common/http/index.ts": "5087185d80e1e239262f849b3015eb9b810e2945",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"packages/implement/src/common/rewards/fetch-reward.ts": "23f40af40ca4c3a594f7bc3ef6ea96a593648e35",
|
|
53
53
|
"packages/implement/src/common/rewards/index.ts": "92a31d63098d8dc874d3814a76819e96d7e9f269",
|
|
54
54
|
"packages/implement/src/common/rewards/registers/use-ads.ts": "77c887f0e2065a8f3eec31cb5b62e1752d07298b",
|
|
55
|
-
"packages/implement/src/common/rewards/registers/use-gem-only.ts": "
|
|
56
|
-
"packages/implement/src/common/rewards/registers/use-gem.ts": "
|
|
57
|
-
"packages/implement/src/common/rewards/registers/use-jolicoin-only.ts": "
|
|
58
|
-
"packages/implement/src/common/rewards/registers/use-jolicoin.ts": "
|
|
59
|
-
"packages/implement/src/common/rewards/registers/use-subscription.ts": "
|
|
55
|
+
"packages/implement/src/common/rewards/registers/use-gem-only.ts": "4c2e556cd0298c38efa6c519a0a5c5f27fb54eba",
|
|
56
|
+
"packages/implement/src/common/rewards/registers/use-gem.ts": "dbf2c94d1d4cd0ccc26d92c3232300b08219430c",
|
|
57
|
+
"packages/implement/src/common/rewards/registers/use-jolicoin-only.ts": "0fd5504cbd02340b0bf7add644b8248262231e47",
|
|
58
|
+
"packages/implement/src/common/rewards/registers/use-jolicoin.ts": "8b4e47b65decfb087417401a0d6082579580ee81",
|
|
59
|
+
"packages/implement/src/common/rewards/registers/use-subscription.ts": "713a435de1b547948a358bb6b47604d11bfff336",
|
|
60
60
|
"packages/implement/src/common/rewards/registers/utils/coins/commands/currency-handlers.ts": "77219e8ce3b7cfe8c26880f6c619d41e2cccf8cb",
|
|
61
61
|
"packages/implement/src/common/rewards/registers/utils/coins/commands/index.ts": "1d5700642bf3bddb8eb598b6018cfd55bd7b3308",
|
|
62
62
|
"packages/implement/src/common/rewards/registers/utils/coins/commands/use-jolicoin.ts": "1d4eca1b189d67db138b0ac93144c9d8b33f22bb",
|
|
@@ -66,22 +66,22 @@
|
|
|
66
66
|
"packages/implement/src/common/rewards/registers/utils/coins/index.ts": "454c807a24a64a0a7c2c8ce0f11539d3e08c9ebe",
|
|
67
67
|
"packages/implement/src/common/rewards/registers/utils/coins/jolicoin/cached-fetch-balance.ts": "4d4e504fb00ddd0de11a74d8e62cfb3190ec23e3",
|
|
68
68
|
"packages/implement/src/common/rewards/registers/utils/coins/jolicoin/fetch-balance.ts": "cb54beec6a430d42ff81410198adf892f7e11182",
|
|
69
|
-
"packages/implement/src/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.ts": "
|
|
69
|
+
"packages/implement/src/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.ts": "7e0917db25d16122d647738de1e535d113b3e7a2",
|
|
70
70
|
"packages/implement/src/common/rewards/registers/utils/coins/joligem/cached-fetch-gem-balance.ts": "e462c138142b2f51971c9596f864fc0b5f8a7dda",
|
|
71
71
|
"packages/implement/src/common/rewards/registers/utils/coins/joligem/fetch-gem-balance.ts": "78efdd85ea2b0141f2ff7614ef563a62e56efbfa",
|
|
72
|
-
"packages/implement/src/common/rewards/registers/utils/coins/joligem/gem-handler.ts": "
|
|
72
|
+
"packages/implement/src/common/rewards/registers/utils/coins/joligem/gem-handler.ts": "36f733c5dcefa00e2dc96e17cc33dacea2d190b5",
|
|
73
73
|
"packages/implement/src/common/rewards/registers/utils/coins/rewards-command.ts": "b7a5309a43869f5024022158e3c95b505ecb55df",
|
|
74
|
-
"packages/implement/src/common/rewards/registers/utils/common.ts": "
|
|
74
|
+
"packages/implement/src/common/rewards/registers/utils/common.ts": "e195e121428cb049482036f0f96d3c45e9506e2e",
|
|
75
75
|
"packages/implement/src/common/rewards/registers/utils/event-listener.ts": "cd6a393d4771833cc37e38d9fb8af1900c8b0487",
|
|
76
76
|
"packages/implement/src/common/rewards/registers/utils/index.ts": "f496c92e3bf81418e463f0a9a95d44798c3424b9",
|
|
77
77
|
"packages/implement/src/common/rewards/registers/utils/subscription/commands/index.ts": "94b4f9510641773cb4f73a4544a36af3c1b4bd10",
|
|
78
|
-
"packages/implement/src/common/rewards/registers/utils/subscription/commands/use-subscription.ts": "
|
|
79
|
-
"packages/implement/src/common/rewards/registers/utils/subscription/sub-handler.ts": "
|
|
80
|
-
"packages/implement/src/common/rewards/reward-emitter.ts": "
|
|
78
|
+
"packages/implement/src/common/rewards/registers/utils/subscription/commands/use-subscription.ts": "721023689a25c34f330e8d1e9981b89423ca45aa",
|
|
79
|
+
"packages/implement/src/common/rewards/registers/utils/subscription/sub-handler.ts": "db0bd59b2d245c273614573a0e8a3c1e5a151b98",
|
|
80
|
+
"packages/implement/src/common/rewards/reward-emitter.ts": "6ff370379b63c96183833750338d6f6c357fdaf1",
|
|
81
81
|
"packages/implement/src/common/rewards/reward-helper.ts": "3f1a0064b1932b4e94140ed42b41d794a3ca0019",
|
|
82
|
-
"packages/implement/src/common/rewards/type.ts": "
|
|
83
|
-
"packages/implement/src/common/utils/index.ts": "
|
|
84
|
-
"packages/implement/src/h5/api/ads.ts": "
|
|
82
|
+
"packages/implement/src/common/rewards/type.ts": "91cb8140346f0d9c65b2a480cd13e059f9731f59",
|
|
83
|
+
"packages/implement/src/common/utils/index.ts": "e91ef3f08793488a9ce1bee930e4db3720dbec73",
|
|
84
|
+
"packages/implement/src/h5/api/ads.ts": "8194db9ebf81d17a3521b72b6396aae757128925",
|
|
85
85
|
"packages/implement/src/h5/api/base.ts": "ead2c3cdcbe174b0e725c31a3885c7985bd8f667",
|
|
86
86
|
"packages/implement/src/h5/api/get-system-info.ts": "158d66156c720446457318b7eaa9112452114dbb",
|
|
87
87
|
"packages/implement/src/h5/api/index.ts": "59b4a8a83134e52de589f77bf3a6591cbf3a0e11",
|
|
@@ -94,9 +94,9 @@
|
|
|
94
94
|
"packages/implement/src/h5/api/runtime.ts": "25e72f2af156fe2abaf0f25e34681511995ab22a",
|
|
95
95
|
"packages/implement/src/h5/api/storage.ts": "d16fe40e39f1e04f5f527c0878edba6d618b5a05",
|
|
96
96
|
"packages/implement/src/h5/api/task.ts": "c501814d9dc01a564b716fdcefa4a86427717a08",
|
|
97
|
-
"packages/implement/src/h5/bootstrap/auth/__tests__/auth.test.ts": "
|
|
97
|
+
"packages/implement/src/h5/bootstrap/auth/__tests__/auth.test.ts": "3ee716d49824c7181275f014e5d1c43bc89064de",
|
|
98
98
|
"packages/implement/src/h5/bootstrap/auth/index.ts": "1f99932c09442673326b97c457427d8595104aca",
|
|
99
|
-
"packages/implement/src/h5/bootstrap/auth/sub.ts": "
|
|
99
|
+
"packages/implement/src/h5/bootstrap/auth/sub.ts": "c7f3cebf2edad5c58a7f57b9533baa9b3bf4a65b",
|
|
100
100
|
"packages/implement/src/h5/bootstrap/index.ts": "6b0d615068762a5ab17e4c28a93ed19726989339",
|
|
101
101
|
"packages/implement/src/h5/http/index.ts": "1e3118ffc31a5e93d673c703d637b082f2420c15",
|
|
102
102
|
"packages/implement/src/h5/http/utils/__tests__/xua.test.ts": "4345cfd10cae6f94cef673f04a5155b70123c048",
|
|
@@ -110,17 +110,17 @@
|
|
|
110
110
|
"packages/implement/src/index.native.ts": "96cc46c8919ba2333600e9c3ee100f47c511a79a",
|
|
111
111
|
"packages/implement/src/index.ts": "d0ca7b5312b0a258ae8887e725440c70190442f7",
|
|
112
112
|
"packages/implement/src/native/api/__tests__/convertVersionCodeToVString.test.ts": "5f948265725f8ca48851de4bd41b24a10d754982",
|
|
113
|
-
"packages/implement/src/native/api/ads.ts": "
|
|
113
|
+
"packages/implement/src/native/api/ads.ts": "2f40d1dbe7407446a781109d20017c359e42e3cf",
|
|
114
114
|
"packages/implement/src/native/api/base.ts": "0ebf7c92ef5154ca1d321172e4f94a65e2d91b41",
|
|
115
|
-
"packages/implement/src/native/api/call-host-method.ts": "
|
|
115
|
+
"packages/implement/src/native/api/call-host-method.ts": "9183e6aba53fda0ddee8b2603eae725b4ab07a71",
|
|
116
116
|
"packages/implement/src/native/api/get-system-info.ts": "33aa88b7f4d6c4204bc7e81ee9cce05296587691",
|
|
117
117
|
"packages/implement/src/native/api/index.ts": "1c0aa1767f0135f28f7a3f08d8129d3d2ee9ec29",
|
|
118
118
|
"packages/implement/src/native/api/is-native-support.ts": "46d9353fcec02ac0f4ed7094a7ceae2900eb45c1",
|
|
119
119
|
"packages/implement/src/native/api/keyboard.ts": "cb65da6e8cbfb7ef4a21582acd74f450a0e3c894",
|
|
120
120
|
"packages/implement/src/native/api/lifecycle.ts": "af0f376f1283ed0e80062d1568225a334c7d22f9",
|
|
121
|
-
"packages/implement/src/native/api/login.ts": "
|
|
121
|
+
"packages/implement/src/native/api/login.ts": "780cabf471d1c0232f474f98f3bc06b302d0484d",
|
|
122
122
|
"packages/implement/src/native/api/navigate.ts": "278f1bc5d48b72a72c38762e47bac528e5138fec",
|
|
123
|
-
"packages/implement/src/native/api/payment.ts": "
|
|
123
|
+
"packages/implement/src/native/api/payment.ts": "a305ce6be81dfd859f62c54ba56634ac7a3ed618",
|
|
124
124
|
"packages/implement/src/native/api/request.ts": "c02ca1163d13a17bc5e74e27a21f7fd204ec34d1",
|
|
125
125
|
"packages/implement/src/native/api/runtime.ts": "3c66cc58685e3ed3b25554aca8979c1650ac9241",
|
|
126
126
|
"packages/implement/src/native/api/storage.ts": "d395e86a04060a1e734f12c1b9c2e7b56eba392b",
|
|
@@ -133,25 +133,35 @@
|
|
|
133
133
|
"packages/implement/src/native/network/report.ts": "705e9614faeb0611c9c57ced998885bdc3a02d11",
|
|
134
134
|
"packages/implement/src/native/network/types.ts": "4e8eb72bf0b0b26a5298ce42d96855d27769be51",
|
|
135
135
|
"packages/implement/src/native/network/utils.ts": "53877a6871dc3a6b173daef930872c44589659b9",
|
|
136
|
-
"packages/implement/src/native/payment/__tests__/payment-service-simple.test.ts": "
|
|
136
|
+
"packages/implement/src/native/payment/__tests__/payment-service-simple.test.ts": "8070cce1c04348ddfa4e5ce3097ed456a05ae34d",
|
|
137
137
|
"packages/implement/src/native/payment/index.ts": "6ead1fc6e7261ba851f926afb315f6988639e74a",
|
|
138
138
|
"packages/implement/src/native/payment/payment-helper.ts": "8ba410780450897fc9ee8f93cb38c67ae3dd7291",
|
|
139
|
-
"packages/implement/src/native/payment/payment-service.ts": "
|
|
139
|
+
"packages/implement/src/native/payment/payment-service.ts": "75db6bd58c0220f4ef203e90f84305cf3d0596be",
|
|
140
140
|
"packages/implement/src/native/payment/registers/base.ts": "63973fe618cfaa5bc0baa88c7f1d271638c65c1a",
|
|
141
141
|
"packages/implement/src/native/payment/registers/const.ts": "cba0087bccbd01349acc46f69adaeed80f4d16a0",
|
|
142
142
|
"packages/implement/src/native/payment/registers/joli-coin.ts": "caa3bd121e2159091dbe7cc3f58c2fba67d337a4",
|
|
143
143
|
"packages/implement/src/native/payment/registers/jolicoin-iap.ts": "d9ec70245e721b7937e26afc45e4a43f517d40a6",
|
|
144
144
|
"packages/implement/src/native/payment/registers/type.ts": "911f6b44b569fce15e50f945879a7eab1d53baf6",
|
|
145
|
+
"packages/implement/src/native/payment/utils/__tests__/cache-with-storage.test.ts": "fb4e7d5d82f40d1e0b047489f1c85a5c3ca27540",
|
|
146
|
+
"packages/implement/src/native/payment/utils/cache-with-storage.ts": "55293d2bb49d0fa258c32ac3df6e90371fa00941",
|
|
145
147
|
"packages/implement/src/native/report/errors/index.ts": "40e60ee03e0b91cdb0a143a2bea07f5d1e5d6dd7",
|
|
146
148
|
"packages/implement/src/native/report/index.ts": "b00979f24146bfd378e9462353ecaffd337cd645",
|
|
147
149
|
"packages/implement/src/native/report/task-tracker.ts": "f119c115ec3310b5eea53414587b263b18594bf6",
|
|
148
|
-
"packages/implement/src/native/rewards/check-frequency.ts": "
|
|
149
|
-
"packages/implement/src/native/rewards/index.ts": "
|
|
150
|
-
"packages/implement/src/native/rewards/ui/payment-modal.ts": "
|
|
150
|
+
"packages/implement/src/native/rewards/check-frequency.ts": "8680a102e765fc0e4deec42e6b12a313d2ff575f",
|
|
151
|
+
"packages/implement/src/native/rewards/index.ts": "f45622ed8c07fa53e5213fca6b439b03ab81e0da",
|
|
152
|
+
"packages/implement/src/native/rewards/ui/payment-modal.ts": "d7dd0ba4dc68ea4dbd8697e6779cf4034e872c54",
|
|
153
|
+
"packages/implement/src/native/rewards/ui/subscription-modal.ts": "5d916bb52ee633a65e83551bf4756e78ab1fccdb",
|
|
151
154
|
"packages/implement/src/native/rewards/ui/unlogin-modal.ts": "da6f18bd2cc575592e216fed584d09f6765f1e96",
|
|
152
155
|
"packages/implement/src/native/rewards/ui/use-modal.ts": "7ec80b389daac9660c20c46979e875fc00ebd0ac",
|
|
153
156
|
"packages/implement/src/native/rewards/ui/utils.ts": "4ac58033bd35757b9519c1490abb70c4e6af66af",
|
|
154
157
|
"packages/implement/src/native/rewards/utils.ts": "af00dd225556ab61332cb2cbf5e8da426136bc0b",
|
|
158
|
+
"packages/implement/src/native/subscription/index.ts": "c2583698dbe32520c475d9ca504cf062cf50b2a3",
|
|
159
|
+
"packages/implement/src/native/subscription/registers/base.ts": "a8034966b4db4c1e6883104900f27b28cfe1d586",
|
|
160
|
+
"packages/implement/src/native/subscription/registers/sub-app.ts": "9f717a98fc1599bdda75796bb831ef7fac2a9c11",
|
|
161
|
+
"packages/implement/src/native/subscription/registers/type.ts": "ebfdd101a297bb86e9dc4ea2c320065c1252f7c5",
|
|
162
|
+
"packages/implement/src/native/subscription/subscription-helper.ts": "5c7f3d52b0c0ec9899f6542c5aec21c2e4d7cf9f",
|
|
163
|
+
"packages/implement/src/native/subscription/subscription-service.ts": "8d379558899e783858c5986ae05c797538104063",
|
|
164
|
+
"packages/implement/src/native/subscription/type.ts": "38ede96d451b6e9ca2f286c5f41ecf1d16a27a5c",
|
|
155
165
|
"packages/implement/src/native/ui/modal-iframe.ts": "7d50b2c44023f08dc025d4483838f930c8e5a55d",
|
|
156
166
|
"packages/implement/src/native/ui/retention.ts": "85b600af664d714c6ce8b56a9eee823527df87ec",
|
|
157
167
|
"packages/implement/tsconfig.json": "b150f4b2ef4eb9d98f92135d481fe530eb7145b5"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IHttpClient } from '@/common/http';
|
|
2
2
|
import { IAdBreakParams } from '@/common/ads';
|
|
3
3
|
export type GemOnlyRewardsHandler = (params: IAdBreakParams) => Promise<boolean>;
|
|
4
|
-
export declare const createGemOnlyRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed }: {
|
|
4
|
+
export declare const createGemOnlyRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed, hasSubscription }: {
|
|
5
5
|
onUnlockSuccess?: (data: {
|
|
6
6
|
quantity: number;
|
|
7
7
|
balance: number;
|
|
8
8
|
}) => void;
|
|
9
9
|
onUnlockFailed?: () => void;
|
|
10
|
+
hasSubscription: () => boolean;
|
|
10
11
|
}) => GemOnlyRewardsHandler;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IHttpClient } from '@/common/http';
|
|
2
2
|
import { IAdBreakParams } from '@/common/ads';
|
|
3
3
|
export type GemRewardsHandler = (params: IAdBreakParams) => Promise<boolean>;
|
|
4
|
-
export declare const createGemRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed }: {
|
|
4
|
+
export declare const createGemRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed, hasSubscription }: {
|
|
5
5
|
onUnlockSuccess?: (data: {
|
|
6
6
|
quantity: number;
|
|
7
7
|
balance: number;
|
|
8
8
|
}) => void;
|
|
9
9
|
onUnlockFailed?: () => void;
|
|
10
|
+
hasSubscription: () => boolean;
|
|
10
11
|
}) => GemRewardsHandler;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IHttpClient } from '@/common/http';
|
|
2
2
|
import { IAdBreakParams } from '@/common/ads';
|
|
3
3
|
export type JolicoinOnlyRewardsHandler = (params: IAdBreakParams) => Promise<boolean>;
|
|
4
|
-
export declare const createJolicoinOnlyRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed }: {
|
|
4
|
+
export declare const createJolicoinOnlyRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed, hasSubscription }: {
|
|
5
5
|
onUnlockSuccess?: (data: {
|
|
6
6
|
quantity: number;
|
|
7
7
|
balance: number;
|
|
8
8
|
}) => void;
|
|
9
9
|
onUnlockFailed?: () => void;
|
|
10
|
+
hasSubscription: () => boolean;
|
|
10
11
|
}) => JolicoinOnlyRewardsHandler;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IHttpClient } from '@/common/http';
|
|
2
2
|
import { IAdBreakParams } from '@/common/ads';
|
|
3
3
|
export type JolicoinRewardsHandler = (params: IAdBreakParams) => Promise<boolean>;
|
|
4
|
-
export declare const createJolicoinRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed }: {
|
|
4
|
+
export declare const createJolicoinRewardHandler: (httpClient: IHttpClient, { onUnlockSuccess, onUnlockFailed, hasSubscription }: {
|
|
5
5
|
onUnlockSuccess?: (data: {
|
|
6
6
|
quantity: number;
|
|
7
7
|
balance: number;
|
|
8
8
|
}) => void;
|
|
9
9
|
onUnlockFailed?: () => void;
|
|
10
|
+
hasSubscription: () => boolean;
|
|
10
11
|
}) => JolicoinRewardsHandler;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IHttpClient } from '@/common/http';
|
|
2
2
|
import { IAdBreakParams } from '@/common/ads';
|
|
3
3
|
export type SubscriptionRewardsHandler = (params: IAdBreakParams) => Promise<boolean>;
|
|
4
|
-
export declare const createSubscriptionRewardHandler: (httpClient: IHttpClient, { onSubSuccess, onSubFailed }: {
|
|
4
|
+
export declare const createSubscriptionRewardHandler: (httpClient: IHttpClient, { onSubSuccess, onSubFailed, hasSubscription }: {
|
|
5
5
|
onSubSuccess?: () => void;
|
|
6
6
|
onSubFailed?: () => void;
|
|
7
|
+
hasSubscription: () => boolean;
|
|
7
8
|
}) => SubscriptionRewardsHandler;
|
|
@@ -14,5 +14,6 @@ export declare const createCommonJolicoinRewardHandler: (type: "JOLI_COIN" | "AD
|
|
|
14
14
|
initiateAndAwaitPayment: ReturnType<typeof createInitiateAndAwaitPayment>;
|
|
15
15
|
showUnlockWithCurrencyModal: ReturnType<typeof createShowUnlockWithCurrencyModal>;
|
|
16
16
|
showUnloginModal: ReturnType<typeof createShowUnloginModal>;
|
|
17
|
+
hasSubscription?: () => boolean;
|
|
17
18
|
};
|
|
18
19
|
}) => (params: IAdBreakParams) => Promise<boolean>;
|
|
@@ -4,7 +4,7 @@ import { IAdBreakParams } from '@/common/ads';
|
|
|
4
4
|
import { EventPromiseHandler } from '../../event-listener';
|
|
5
5
|
import { createInitiateAndAwaitPayment, createShowUnloginModal } from '../commands';
|
|
6
6
|
import { createShowUnlockWithCurrencyModal } from '../commands/use-jolicoin';
|
|
7
|
-
export declare const createCommonGemRewardHandler: (type: "JOLI_GEM" | "ADS-JOLI_GEM", httpClient: IHttpClient, { handlers: { handleUnlockSuccess, handleUnlockFailed, unlockOptionsHandler, initiateAndAwaitPayment, showUnlockWithCurrencyModal, showUnloginModal } }: {
|
|
7
|
+
export declare const createCommonGemRewardHandler: (type: "JOLI_GEM" | "ADS-JOLI_GEM", httpClient: IHttpClient, { handlers: { handleUnlockSuccess, handleUnlockFailed, unlockOptionsHandler, initiateAndAwaitPayment, showUnlockWithCurrencyModal, showUnloginModal, hasSubscription } }: {
|
|
8
8
|
handlers: {
|
|
9
9
|
handleUnlockSuccess?: (data: {
|
|
10
10
|
quantity: number;
|
|
@@ -15,5 +15,6 @@ export declare const createCommonGemRewardHandler: (type: "JOLI_GEM" | "ADS-JOLI
|
|
|
15
15
|
initiateAndAwaitPayment: ReturnType<typeof createInitiateAndAwaitPayment>;
|
|
16
16
|
showUnlockWithCurrencyModal: ReturnType<typeof createShowUnlockWithCurrencyModal>;
|
|
17
17
|
showUnloginModal: ReturnType<typeof createShowUnloginModal>;
|
|
18
|
+
hasSubscription?: () => boolean;
|
|
18
19
|
};
|
|
19
20
|
}) => (params: IAdBreakParams) => Promise<boolean>;
|
|
@@ -6,3 +6,4 @@ export declare const unlockOptionsHandler: {
|
|
|
6
6
|
getFreshData: () => Promise<IUnlockOptionsEvent>;
|
|
7
7
|
updateData: (newData: Partial<IUnlockOptionsEvent>) => IUnlockOptionsEvent | undefined;
|
|
8
8
|
};
|
|
9
|
+
export declare const checkIfSupportSubscription: (unlockOptions: IUnlockOptionsEvent, extraCheck?: () => boolean) => boolean;
|
|
@@ -3,11 +3,12 @@ import { IAdBreakParams } from '@/common/ads';
|
|
|
3
3
|
import { EventPromiseHandler } from '../event-listener';
|
|
4
4
|
import { UnlockOptionsEventName, IUnlockOptionsEvent } from '@/common/rewards/reward-emitter';
|
|
5
5
|
import { createShowSubscriptionModal } from './commands/use-subscription';
|
|
6
|
-
export declare const createCommonSubscriptionHandler: (type: "SUBSCRIPTION", httpClient: IHttpClient, { handlers: { handleSubSuccess, handleSubFailed, unlockOptionsHandler, showSubscriptionModal } }: {
|
|
6
|
+
export declare const createCommonSubscriptionHandler: (type: "SUBSCRIPTION", httpClient: IHttpClient, { handlers: { handleSubSuccess, handleSubFailed, unlockOptionsHandler, showSubscriptionModal, hasSubscription } }: {
|
|
7
7
|
handlers: {
|
|
8
8
|
handleSubSuccess?: () => void;
|
|
9
9
|
handleSubFailed?: (params: IAdBreakParams) => void;
|
|
10
10
|
unlockOptionsHandler: EventPromiseHandler<IUnlockOptionsEvent, typeof UnlockOptionsEventName>;
|
|
11
11
|
showSubscriptionModal: ReturnType<typeof createShowSubscriptionModal>;
|
|
12
|
+
hasSubscription?: () => boolean;
|
|
12
13
|
};
|
|
13
14
|
}) => (params: IAdBreakParams) => Promise<boolean>;
|
|
@@ -72,6 +72,10 @@ export interface IUseModalFrequencyConfig {
|
|
|
72
72
|
dailyMaxPopUps?: number;
|
|
73
73
|
minInterval?: number;
|
|
74
74
|
};
|
|
75
|
+
joinMember: {
|
|
76
|
+
dailyMaxPopUps?: number;
|
|
77
|
+
minInterval?: number;
|
|
78
|
+
};
|
|
75
79
|
};
|
|
76
80
|
loginGuide: {
|
|
77
81
|
show: boolean;
|
|
@@ -118,6 +122,10 @@ export declare const DefaltJoliCoinUseAndCharge: {
|
|
|
118
122
|
dailyMaxPopUps: number;
|
|
119
123
|
minInterval: number;
|
|
120
124
|
};
|
|
125
|
+
joinMember: {
|
|
126
|
+
dailyMaxPopUps: number;
|
|
127
|
+
minInterval: number;
|
|
128
|
+
};
|
|
121
129
|
};
|
|
122
130
|
export declare const DefaltLoginGuide: {
|
|
123
131
|
show: boolean;
|
|
@@ -6,7 +6,7 @@ export interface IGem {
|
|
|
6
6
|
balance: number;
|
|
7
7
|
enableAutoDeduct: boolean;
|
|
8
8
|
}
|
|
9
|
-
export type IUnlockOptionType = 'JOLI_COIN' | 'ADS' | 'JOLI_GEM';
|
|
9
|
+
export type IUnlockOptionType = 'JOLI_COIN' | 'ADS' | 'JOLI_GEM' | 'SUBSCRIPTION';
|
|
10
10
|
interface IJoliCoinChoice {
|
|
11
11
|
joliCoinQuantity: number;
|
|
12
12
|
}
|
|
@@ -56,7 +56,7 @@ declare const notifyCustomEvent: <T extends keyof JoliboxCustomEvent>(eventName:
|
|
|
56
56
|
declare const ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT = "ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT";
|
|
57
57
|
declare const ON_JOLIBOX_JOLI_COIN_USE_RESULT = "ON_JOLIBOX_JOLI_COIN_USE_RESULT";
|
|
58
58
|
declare const ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT = "ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT";
|
|
59
|
-
declare const ON_GET_USER_SUB_STATUS = "
|
|
59
|
+
declare const ON_GET_USER_SUB_STATUS = "ON_JOLIBOX_GET_USER_SUB_STATUS";
|
|
60
60
|
declare const ON_JOLIBOX_SUB_RESULT_EVENT = "ON_JOLIBOX_SUB_RESULT_EVENT";
|
|
61
61
|
interface ReceivedJoliboxCustomEvent {
|
|
62
62
|
[ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT]: {
|