@jetthai/cuora 1.1.22 → 1.1.24
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/CHANGELOG.md +4 -0
- package/dist/bundle.mjs +60 -19
- package/package.json +1 -1
- package/src/machine/game_v2.js +44 -16
- package/src/machine/promotions.js +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.24](https://github.com/jetthai/cuora-module/compare/v1.1.23...v1.1.24) (2023-01-04)
|
|
6
|
+
|
|
7
|
+
### [1.1.23](https://github.com/jetthai/cuora-module/compare/v1.1.22...v1.1.23) (2023-01-03)
|
|
8
|
+
|
|
5
9
|
### [1.1.22](https://github.com/jetthai/cuora-module/compare/v1.1.21...v1.1.22) (2023-01-03)
|
|
6
10
|
|
|
7
11
|
### [1.1.21](https://github.com/jetthai/cuora-module/compare/v1.1.20...v1.1.21) (2022-12-30)
|
package/dist/bundle.mjs
CHANGED
|
@@ -11254,6 +11254,11 @@ function game_v2 (request) {
|
|
|
11254
11254
|
parentCategoryId: null,
|
|
11255
11255
|
totalPage: 1,
|
|
11256
11256
|
},
|
|
11257
|
+
addition: {
|
|
11258
|
+
data: [],
|
|
11259
|
+
timestamp: null,
|
|
11260
|
+
totalPage: 1,
|
|
11261
|
+
},
|
|
11257
11262
|
// play params
|
|
11258
11263
|
game: {
|
|
11259
11264
|
providerId: null,
|
|
@@ -11438,6 +11443,11 @@ function game_v2 (request) {
|
|
|
11438
11443
|
parentCategoryId: null,
|
|
11439
11444
|
totalPage: 1,
|
|
11440
11445
|
},
|
|
11446
|
+
addition: {
|
|
11447
|
+
data: [],
|
|
11448
|
+
timestamp: null,
|
|
11449
|
+
totalPage: 1,
|
|
11450
|
+
},
|
|
11441
11451
|
}
|
|
11442
11452
|
}),
|
|
11443
11453
|
appendContent: assign((context, event) => {
|
|
@@ -11445,23 +11455,31 @@ function game_v2 (request) {
|
|
|
11445
11455
|
if (room.categoryId === GAME_SEARCH) {
|
|
11446
11456
|
return
|
|
11447
11457
|
} else {
|
|
11448
|
-
const
|
|
11458
|
+
const [content, addition] = event.data;
|
|
11449
11459
|
return {
|
|
11450
11460
|
content: {
|
|
11451
11461
|
...context.content,
|
|
11452
|
-
...
|
|
11453
|
-
data: context.content.data.concat(data),
|
|
11462
|
+
...content,
|
|
11463
|
+
data: context.content.data.concat(content.data),
|
|
11464
|
+
},
|
|
11465
|
+
addition: {
|
|
11466
|
+
...context.addition,
|
|
11467
|
+
...addition,
|
|
11468
|
+
data: context.addition.data.concat(addition.data),
|
|
11454
11469
|
},
|
|
11455
11470
|
}
|
|
11456
11471
|
}
|
|
11457
11472
|
}),
|
|
11458
11473
|
swapContent: assign((context, event) => {
|
|
11459
|
-
const
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11474
|
+
const [content, addition] = event.data;
|
|
11475
|
+
let result = {};
|
|
11476
|
+
if (content?.data?.length) {
|
|
11477
|
+
result.content = content;
|
|
11478
|
+
}
|
|
11479
|
+
if (addition?.data?.length) {
|
|
11480
|
+
result.addition = addition;
|
|
11464
11481
|
}
|
|
11482
|
+
return result
|
|
11465
11483
|
}),
|
|
11466
11484
|
increaseIndex: assign((context, event) => {
|
|
11467
11485
|
return {
|
|
@@ -11498,7 +11516,8 @@ function game_v2 (request) {
|
|
|
11498
11516
|
if (room.categoryId === GAME_SEARCH) {
|
|
11499
11517
|
return
|
|
11500
11518
|
} else {
|
|
11501
|
-
|
|
11519
|
+
const param = { categoryId: room.categoryId, index };
|
|
11520
|
+
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
11502
11521
|
}
|
|
11503
11522
|
},
|
|
11504
11523
|
updatePageContent: async (context, event) => {
|
|
@@ -11506,13 +11525,22 @@ function game_v2 (request) {
|
|
|
11506
11525
|
if (room.categoryId === GAME_SEARCH) {
|
|
11507
11526
|
return
|
|
11508
11527
|
} else {
|
|
11509
|
-
return await
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
|
|
11515
|
-
|
|
11528
|
+
return await Promise.all([
|
|
11529
|
+
request.send(
|
|
11530
|
+
game$1.getListCategoryByRange({
|
|
11531
|
+
categoryId: room.categoryId,
|
|
11532
|
+
end: index,
|
|
11533
|
+
timestamp: content.timestamp,
|
|
11534
|
+
})
|
|
11535
|
+
),
|
|
11536
|
+
request.send(
|
|
11537
|
+
game$1.getListAdditionByRange({
|
|
11538
|
+
categoryId: room.categoryId,
|
|
11539
|
+
end: index,
|
|
11540
|
+
timestamp: content.timestamp,
|
|
11541
|
+
})
|
|
11542
|
+
),
|
|
11543
|
+
])
|
|
11516
11544
|
}
|
|
11517
11545
|
},
|
|
11518
11546
|
connectGame: async (context, event) => {
|
|
@@ -20313,6 +20341,7 @@ function promotions (request) {
|
|
|
20313
20341
|
initial: 'loading',
|
|
20314
20342
|
context: {
|
|
20315
20343
|
noBonus: {},
|
|
20344
|
+
userInfo: {},
|
|
20316
20345
|
withdrawRule: {},
|
|
20317
20346
|
promotionsList: [],
|
|
20318
20347
|
selectedPromo: {},
|
|
@@ -20384,9 +20413,21 @@ function promotions (request) {
|
|
|
20384
20413
|
{
|
|
20385
20414
|
actions: {
|
|
20386
20415
|
setInitData: assign((context, event) => {
|
|
20387
|
-
const { noBonus } = context;
|
|
20416
|
+
const { noBonus, userInfo } = context;
|
|
20417
|
+
const promotionsList = JSON.parse(JSON.stringify(event.data));
|
|
20418
|
+
if (userInfo.withdraw_rule.includes('FREE_LIMIT')) {
|
|
20419
|
+
promotionsList.map((item) => {
|
|
20420
|
+
item.attendEnable = false;
|
|
20421
|
+
return item
|
|
20422
|
+
});
|
|
20423
|
+
} else {
|
|
20424
|
+
promotionsList.map((item) => {
|
|
20425
|
+
item.attendEnable = true;
|
|
20426
|
+
return item
|
|
20427
|
+
});
|
|
20428
|
+
}
|
|
20388
20429
|
return {
|
|
20389
|
-
promotionsList
|
|
20430
|
+
promotionsList,
|
|
20390
20431
|
selectedPromo: noBonus,
|
|
20391
20432
|
}
|
|
20392
20433
|
}),
|
|
@@ -20423,7 +20464,7 @@ function promotions (request) {
|
|
|
20423
20464
|
},
|
|
20424
20465
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
20425
20466
|
const { selectedPromo, amount } = context;
|
|
20426
|
-
const
|
|
20467
|
+
const data = await request.send(
|
|
20427
20468
|
payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
|
|
20428
20469
|
);
|
|
20429
20470
|
return data
|
package/package.json
CHANGED
package/src/machine/game_v2.js
CHANGED
|
@@ -17,6 +17,11 @@ export default function (request) {
|
|
|
17
17
|
parentCategoryId: null,
|
|
18
18
|
totalPage: 1,
|
|
19
19
|
},
|
|
20
|
+
addition: {
|
|
21
|
+
data: [],
|
|
22
|
+
timestamp: null,
|
|
23
|
+
totalPage: 1,
|
|
24
|
+
},
|
|
20
25
|
// play params
|
|
21
26
|
game: {
|
|
22
27
|
providerId: null,
|
|
@@ -201,6 +206,11 @@ export default function (request) {
|
|
|
201
206
|
parentCategoryId: null,
|
|
202
207
|
totalPage: 1,
|
|
203
208
|
},
|
|
209
|
+
addition: {
|
|
210
|
+
data: [],
|
|
211
|
+
timestamp: null,
|
|
212
|
+
totalPage: 1,
|
|
213
|
+
},
|
|
204
214
|
}
|
|
205
215
|
}),
|
|
206
216
|
appendContent: assign((context, event) => {
|
|
@@ -208,23 +218,31 @@ export default function (request) {
|
|
|
208
218
|
if (room.categoryId === GAME_SEARCH) {
|
|
209
219
|
return
|
|
210
220
|
} else {
|
|
211
|
-
const
|
|
221
|
+
const [content, addition] = event.data
|
|
212
222
|
return {
|
|
213
223
|
content: {
|
|
214
224
|
...context.content,
|
|
215
|
-
...
|
|
216
|
-
data: context.content.data.concat(data),
|
|
225
|
+
...content,
|
|
226
|
+
data: context.content.data.concat(content.data),
|
|
227
|
+
},
|
|
228
|
+
addition: {
|
|
229
|
+
...context.addition,
|
|
230
|
+
...addition,
|
|
231
|
+
data: context.addition.data.concat(addition.data),
|
|
217
232
|
},
|
|
218
233
|
}
|
|
219
234
|
}
|
|
220
235
|
}),
|
|
221
236
|
swapContent: assign((context, event) => {
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
237
|
+
const [content, addition] = event.data
|
|
238
|
+
let result = {}
|
|
239
|
+
if (content?.data?.length) {
|
|
240
|
+
result.content = content
|
|
241
|
+
}
|
|
242
|
+
if (addition?.data?.length) {
|
|
243
|
+
result.addition = addition
|
|
227
244
|
}
|
|
245
|
+
return result
|
|
228
246
|
}),
|
|
229
247
|
increaseIndex: assign((context, event) => {
|
|
230
248
|
return {
|
|
@@ -261,7 +279,8 @@ export default function (request) {
|
|
|
261
279
|
if (room.categoryId === GAME_SEARCH) {
|
|
262
280
|
return
|
|
263
281
|
} else {
|
|
264
|
-
|
|
282
|
+
const param = { categoryId: room.categoryId, index }
|
|
283
|
+
return await Promise.all([request.send(api.getListCategory(param)), request.send(api.getListAddition(param))])
|
|
265
284
|
}
|
|
266
285
|
},
|
|
267
286
|
updatePageContent: async (context, event) => {
|
|
@@ -269,13 +288,22 @@ export default function (request) {
|
|
|
269
288
|
if (room.categoryId === GAME_SEARCH) {
|
|
270
289
|
return
|
|
271
290
|
} else {
|
|
272
|
-
return await
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
return await Promise.all([
|
|
292
|
+
request.send(
|
|
293
|
+
api.getListCategoryByRange({
|
|
294
|
+
categoryId: room.categoryId,
|
|
295
|
+
end: index,
|
|
296
|
+
timestamp: content.timestamp,
|
|
297
|
+
})
|
|
298
|
+
),
|
|
299
|
+
request.send(
|
|
300
|
+
api.getListAdditionByRange({
|
|
301
|
+
categoryId: room.categoryId,
|
|
302
|
+
end: index,
|
|
303
|
+
timestamp: content.timestamp,
|
|
304
|
+
})
|
|
305
|
+
),
|
|
306
|
+
])
|
|
279
307
|
}
|
|
280
308
|
},
|
|
281
309
|
connectGame: async (context, event) => {
|
|
@@ -8,6 +8,7 @@ export default function (request) {
|
|
|
8
8
|
initial: 'loading',
|
|
9
9
|
context: {
|
|
10
10
|
noBonus: {},
|
|
11
|
+
userInfo: {},
|
|
11
12
|
withdrawRule: {},
|
|
12
13
|
promotionsList: [],
|
|
13
14
|
selectedPromo: {},
|
|
@@ -79,9 +80,21 @@ export default function (request) {
|
|
|
79
80
|
{
|
|
80
81
|
actions: {
|
|
81
82
|
setInitData: assign((context, event) => {
|
|
82
|
-
const { noBonus } = context
|
|
83
|
+
const { noBonus, userInfo } = context
|
|
84
|
+
const promotionsList = JSON.parse(JSON.stringify(event.data))
|
|
85
|
+
if (userInfo.withdraw_rule.includes('FREE_LIMIT')) {
|
|
86
|
+
promotionsList.map((item) => {
|
|
87
|
+
item.attendEnable = false
|
|
88
|
+
return item
|
|
89
|
+
})
|
|
90
|
+
} else {
|
|
91
|
+
promotionsList.map((item) => {
|
|
92
|
+
item.attendEnable = true
|
|
93
|
+
return item
|
|
94
|
+
})
|
|
95
|
+
}
|
|
83
96
|
return {
|
|
84
|
-
promotionsList
|
|
97
|
+
promotionsList,
|
|
85
98
|
selectedPromo: noBonus,
|
|
86
99
|
}
|
|
87
100
|
}),
|
|
@@ -118,7 +131,7 @@ export default function (request) {
|
|
|
118
131
|
},
|
|
119
132
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
120
133
|
const { selectedPromo, amount } = context
|
|
121
|
-
const
|
|
134
|
+
const data = await request.send(
|
|
122
135
|
payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
|
|
123
136
|
)
|
|
124
137
|
return data
|