@everymatrix/player-account-controller 0.0.231 → 0.0.235
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-account-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.235",
|
|
4
4
|
"main": "dist/player-account-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typescript": "^3.9.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@everymatrix/player-account-menu": "^0.0.
|
|
33
|
-
"@everymatrix/player-account-notifications": "^0.0.
|
|
32
|
+
"@everymatrix/player-account-menu": "^0.0.235",
|
|
33
|
+
"@everymatrix/player-account-notifications": "^0.0.235",
|
|
34
34
|
"cross-env": "^7.0.3",
|
|
35
35
|
"sirv-cli": "^1.0.0",
|
|
36
36
|
"svelte": "^3.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "61a6a3f31e48f5f6865ef5aafdaa2091436ca9d5"
|
|
42
42
|
}
|
|
@@ -129,6 +129,10 @@
|
|
|
129
129
|
fetch(`${endpoint}/player/${userId}/profile`, options)
|
|
130
130
|
.then((res:any) => {
|
|
131
131
|
if (res.status == 200) {
|
|
132
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
133
|
+
type: 'success',
|
|
134
|
+
message: 'Profile updated!'
|
|
135
|
+
}}, window.location.href);
|
|
132
136
|
window.postMessage({ type: 'ConfirmProfileInfoSave' }, window.location.href);
|
|
133
137
|
}
|
|
134
138
|
});
|
|
@@ -160,7 +164,11 @@
|
|
|
160
164
|
fetch(`${endpoint}/player/${userId}/limits`, setTimeout)
|
|
161
165
|
.then((res:any) => {
|
|
162
166
|
if (res.status == 200) {
|
|
163
|
-
window.postMessage({ type: '
|
|
167
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
168
|
+
type: 'success',
|
|
169
|
+
message: 'Timeout active'
|
|
170
|
+
}}, window.location.href);
|
|
171
|
+
window.postMessage({ type: 'LogoutSuccessfull' }, window.location.href);
|
|
164
172
|
} else {
|
|
165
173
|
// ERROR
|
|
166
174
|
}
|
|
@@ -192,6 +200,10 @@
|
|
|
192
200
|
fetch(`${endpoint}/player/${userId}/limits`, setSelfExclusion)
|
|
193
201
|
.then((res:any) => {
|
|
194
202
|
if (res.status == 200) {
|
|
203
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
204
|
+
type: 'success',
|
|
205
|
+
message: 'Self exclusion active'
|
|
206
|
+
}}, window.location.href);
|
|
195
207
|
window.postMessage({ type: 'LogoutSuccessfull'}, window.location.href);
|
|
196
208
|
} else {
|
|
197
209
|
// ERROR
|
|
@@ -223,6 +235,10 @@
|
|
|
223
235
|
fetch(`${endpoint}/player/${userId}/limits`, optionsAccountClosure)
|
|
224
236
|
.then((res:any) => {
|
|
225
237
|
if (res.status == 200) {
|
|
238
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
239
|
+
type: 'success',
|
|
240
|
+
message: 'Account closed'
|
|
241
|
+
}}, window.location.href);
|
|
226
242
|
window.postMessage({ type: 'LogoutSuccessfull'}, window.location.href);
|
|
227
243
|
} else {
|
|
228
244
|
// ERROR
|
|
@@ -257,6 +273,11 @@
|
|
|
257
273
|
if (res.status == 200) {
|
|
258
274
|
showsuccessnotification = true;
|
|
259
275
|
|
|
276
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
277
|
+
type: 'success',
|
|
278
|
+
message: 'Limits updated'
|
|
279
|
+
}}, window.location.href);
|
|
280
|
+
|
|
260
281
|
getGamingLimits(`${endpoint}/player/${playerid}/limits`);
|
|
261
282
|
} else {
|
|
262
283
|
// ERROR
|
|
@@ -320,6 +341,10 @@
|
|
|
320
341
|
.then((res:any) => {
|
|
321
342
|
if (res.status == 200) {
|
|
322
343
|
showdeletenotification = true;
|
|
344
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
345
|
+
type: 'success',
|
|
346
|
+
message: 'Limits deleted'
|
|
347
|
+
}}, window.location.href);
|
|
323
348
|
getGamingLimits(`${endpoint}/player/${playerid}/limits`);
|
|
324
349
|
} else {
|
|
325
350
|
// ERROR
|
|
@@ -408,12 +433,20 @@
|
|
|
408
433
|
|
|
409
434
|
if (response.ok) {
|
|
410
435
|
window.postMessage({ type: 'PasswordChangedSuccessfully' }, window.location.href);
|
|
436
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
437
|
+
type: 'success',
|
|
438
|
+
message: 'Password changed successfully'
|
|
439
|
+
}}, window.location.href);
|
|
411
440
|
} else {
|
|
412
441
|
let dataResponse:any = await response.json();
|
|
413
442
|
// Parsing GMCore message 'cuz it's stupid and it doesn't know how to send error messages in 2021 ffs
|
|
414
443
|
errorPasswordChanged = dataResponse.error.substring(dataResponse.error.indexOf('errorMessage') + 13, dataResponse.error.length);
|
|
415
444
|
showErrorPasswordChanged = true;
|
|
416
445
|
window.postMessage({ type: "ShowPasswordChangedError", showErrorPasswordChanged, errorPasswordChanged }, window.location.href);
|
|
446
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
447
|
+
type: 'error',
|
|
448
|
+
message: errorPasswordChanged
|
|
449
|
+
}}, window.location.href);
|
|
417
450
|
}
|
|
418
451
|
}
|
|
419
452
|
|
|
@@ -453,6 +486,10 @@
|
|
|
453
486
|
if (res.status == 200) {
|
|
454
487
|
getRealityCheckData(`${endpoint}/player/${playerid}/realitycheck`);
|
|
455
488
|
window.postMessage({ type: 'RealityCheckValueUpdated' }, window.location.href);
|
|
489
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
490
|
+
type: 'success',
|
|
491
|
+
message: 'Reality check options saved'
|
|
492
|
+
}}, window.location.href);
|
|
456
493
|
}
|
|
457
494
|
}, (err:any) => {
|
|
458
495
|
console.error(err);
|
|
@@ -478,27 +515,26 @@
|
|
|
478
515
|
.then((data:any) => {
|
|
479
516
|
playerlimits = data;
|
|
480
517
|
// add name property for info boxes
|
|
481
|
-
if(Object.keys(playerlimits).length !== 0) {
|
|
482
|
-
|
|
483
|
-
if(playerlimits.hasOwnProperty('depositLimits')) {
|
|
518
|
+
if (Object.keys(playerlimits).length !== 0) {
|
|
519
|
+
if (playerlimits.hasOwnProperty('depositLimits')) {
|
|
484
520
|
depositlimit = playerlimits.depositLimits;
|
|
485
521
|
} else {
|
|
486
522
|
depositlimit = [];
|
|
487
523
|
}
|
|
488
524
|
|
|
489
|
-
if(playerlimits.hasOwnProperty('wageringLimit')) {
|
|
525
|
+
if (playerlimits.hasOwnProperty('wageringLimit')) {
|
|
490
526
|
wageringlimit = playerlimits.wageringLimit;
|
|
491
527
|
} else {
|
|
492
528
|
wageringlimit = {};
|
|
493
529
|
}
|
|
494
530
|
|
|
495
|
-
if(playerlimits.hasOwnProperty('lossLimit')) {
|
|
531
|
+
if (playerlimits.hasOwnProperty('lossLimit')) {
|
|
496
532
|
losslimit = playerlimits.lossLimit;
|
|
497
533
|
} else {
|
|
498
534
|
losslimit = {};
|
|
499
535
|
}
|
|
500
536
|
|
|
501
|
-
if(playerlimits.hasOwnProperty('cumulativeSessionLimits')) {
|
|
537
|
+
if (playerlimits.hasOwnProperty('cumulativeSessionLimits')) {
|
|
502
538
|
timelimit = playerlimits.timeLimit;
|
|
503
539
|
timelimit = playerlimits.cumulativeSessionLimits.map((item) => {
|
|
504
540
|
item.amount = item.minutes;
|
|
@@ -522,7 +558,6 @@
|
|
|
522
558
|
});
|
|
523
559
|
}
|
|
524
560
|
|
|
525
|
-
|
|
526
561
|
const getData = () => {
|
|
527
562
|
getAccountMenuDetails(`${cmsendpoint}/${lang}/profile-menu?env=${env}`);
|
|
528
563
|
getNotificationsDetails(`${cmsendpoint}/${lang}/support-information?env=${env}`);
|