@everymatrix/player-account-controller-nd 1.43.2 → 1.43.4

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-nd",
3
- "version": "1.43.2",
3
+ "version": "1.43.4",
4
4
  "main": "dist/player-account-controller-nd.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "0477411e57fe6c3eda8ff28059aa540dcada8ae0"
38
+ "gitHead": "8464c47cb49b4ffa1c9debfac3a7dfc3097cf57a"
39
39
  }
@@ -14,7 +14,7 @@
14
14
  import '@everymatrix/player-account-gaming-limits';
15
15
  import '@everymatrix/player-active-bonuses';
16
16
  import '@everymatrix/player-profile-info';
17
- import '@everymatrix/player-change-password';
17
+ import '@everymatrix/player-change-password-nd';
18
18
  import '@everymatrix/player-reality-check';
19
19
  import '@everymatrix/player-bonus-history';
20
20
  import '@everymatrix/player-deposit';
@@ -65,8 +65,8 @@
65
65
  export let showcashierbonus:string = '';
66
66
  export let biometricsenabled:string = 'false';
67
67
  export let activepage:string = '';
68
- export let bonushistorystatus:string = '';
69
- export let bonushistorytype:string = '';
68
+ export let bonushistorystatus:string = 'closed,forfeited,released,expired';
69
+ export let bonushistorytype:string = 'standard,freeround,freebet';
70
70
 
71
71
  setupI18n({ withLocale: 'en', translations: {}});
72
72
 
@@ -74,14 +74,11 @@
74
74
  let isLoading:boolean = false;
75
75
  let userAgent:string = window.navigator.userAgent;
76
76
  let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
77
- let menuData:any = [];
78
- let notificationsData:any = [];
79
77
  let userId:string = '';
80
78
  let sessionId:string = '';
81
79
  let countrycode:string = '';
82
80
  let playercurrency: string = null;
83
81
  // limits variables
84
- let deviceSegregationValue: string = '';
85
82
  let playerlimits: any = {};
86
83
  let depositlimit:any;
87
84
  let wageringlimit:any;
@@ -89,8 +86,6 @@
89
86
  let timelimit:any;
90
87
  let showsuccessnotification:boolean = false;
91
88
  let showdeletenotification:boolean = false;
92
- let realityCheckData:any;
93
- let storedRealityCheck:string = '';
94
89
  let errorPasswordChanged:string = '';
95
90
  let showErrorPasswordChanged:boolean = false;
96
91
  let selected:string;
@@ -120,35 +115,22 @@
120
115
  '/biometrics'];
121
116
 
122
117
  const initialLoad = ():void => {
123
- setDevice();
124
-
125
118
  userId = playerid;
126
119
  sessionId = session;
127
-
128
- getData(); //For now we will let it here until we move all the datas to other widgets
120
+ getUserProfileInfo();
129
121
  setActivePage();
130
122
  }
131
123
 
132
- const setDevice = ():void => {
133
- let device = getDevice(userAgent);
134
-
135
- if (device){
136
- if (device === 'PC'){
137
- deviceSegregationValue = 'dk';
138
- } else if (device === 'iPad' || device === 'iPhone') {
139
- deviceSegregationValue = 'mtWeb'; // replace with ios when we will have a native ios up for this
140
- } else {
141
- deviceSegregationValue = 'mtWeb';
142
- }
143
- }
144
- }
145
-
146
124
  const setActivePage = ():void => {
147
125
  if(!activepage && !isMobile) { activepage = widgetPath[0]; }
148
126
 
149
127
  activeMenuItem = activepage;
150
128
  }
151
129
 
130
+ const setActiveLanguage = ():void => {
131
+ setLocale(lang);
132
+ }
133
+
152
134
  const setTranslationUrl = ():void => {
153
135
  let url:string = translationurl;
154
136
 
@@ -171,19 +153,10 @@
171
153
  let url:URL;
172
154
  if (e.data) {
173
155
  switch(e.data.type) {
174
- case 'AccountMenuDetails':
175
- // @TODO open after launch event is triggered from CMS menu
176
- // @TODO what is dis?
177
- break;
178
156
 
179
157
  case 'ChangeAccountPage':
180
158
  activepage = e.data.page.path;
181
-
182
- if(activepage == '/profile-info') {
183
- getUserProfileInfo();
184
- getUserProfileConsent();
185
- }
186
-
159
+
187
160
  if(activepage == '/deposit'){
188
161
  //Analytics event
189
162
  if(typeof gtag == 'function'){
@@ -201,7 +174,8 @@
201
174
  });
202
175
  }
203
176
  }
204
- break;
177
+
178
+ break;
205
179
 
206
180
  case 'PlayerAccountMenuActive':
207
181
  case 'GoToPreviousRoute':
@@ -211,65 +185,6 @@
211
185
  }
212
186
  break;
213
187
 
214
- case 'UpdatePlayerInfo':
215
- let profileData = e.data.provisionalArray;
216
- let sentData = {
217
- mobile: {
218
- prefix: profileData.mobilePrefix,
219
- number: profileData.mobileNumber
220
- },
221
- address1: profileData.address,
222
- city: profileData.city,
223
- postalCode: profileData.postalCode,
224
- securityQuestion: profileData.securityQuestion,
225
- securityAnswer: profileData.securityAnswer,
226
- };
227
-
228
- url = new URL(`${endpoint}/v1/player/${userId}/profile`);
229
-
230
- let options = {
231
- method: "POST",
232
- headers: {
233
- 'X-SessionID': sessionId,
234
- 'Content-Type': "application/json",
235
- 'Accept': 'application/json',
236
- },
237
- body: JSON.stringify(sentData)
238
- };
239
-
240
- fetch(url.href, options)
241
- .then((res:any) => {
242
- if (res.status == 200) {
243
- window.postMessage({ type: 'WidgetNotification', data: {
244
- type: 'success',
245
- message: $_('profileUpdateSuccess')
246
- }}, window.location.href);
247
- window.postMessage({ type: 'ConfirmProfileInfoSave' }, window.location.href);
248
- }
249
- });
250
- break;
251
-
252
- case 'UpdatePlayerConsent':
253
- url = new URL(`${endpoint}/v1/player/${userId}/consent`);
254
-
255
- let optionsConsent = {
256
- method: "POST",
257
- headers: {
258
- 'X-SessionID': sessionId,
259
- 'Content-Type': "application/json",
260
- 'Accept': 'application/json',
261
- },
262
- body: JSON.stringify(e.data.consentArray)
263
- };
264
-
265
- fetch(url.href, optionsConsent)
266
- .then((res:any) => {
267
- if (res.status == 200) {
268
- window.postMessage({ type: 'ConfirmProfileInfoSave' }, window.location.href);
269
- }
270
- });
271
- break;
272
-
273
188
  case 'ChangePassword':
274
189
  sendChangePassword(e.data.userCurrentPassword, e.data.userNewPassword);
275
190
  break;
@@ -384,8 +299,8 @@
384
299
  case 'UserSessionID':
385
300
  sessionId = e.data.session;
386
301
  userId = e.data.userid;
387
-
388
- getData();
302
+ getUserProfileInfo();
303
+
389
304
  break;
390
305
 
391
306
  case 'PlayerAccountGamingLimitsUpdate':
@@ -492,31 +407,10 @@
492
407
  case 'CancelGamingLimitsChanges':
493
408
  getGamingLimits(new URL(`/v2/player/${userId}/limits`, endpoint));
494
409
  break;
495
-
496
- case 'SubmittedRealityCheck':
497
- setRealityCheckValue(e.data.realityCheckUpdatedValue);
498
- break;
499
410
  }
500
411
  }
501
412
  }
502
413
 
503
- const getNotificationsDetails = (url:URL):void => {
504
-
505
- url.searchParams.append('userRoles', userroles);
506
- url.searchParams.append('device', deviceSegregationValue)
507
-
508
- fetch(url.href)
509
- .then((res:any) => res.json())
510
- .then((data:any):void => {
511
- if(data.length) {
512
- notificationsData = data[0].children;
513
- window.postMessage({ type: 'NotificationsDetails', notificationsInfo: notificationsData }, window.location.href);
514
- }
515
- }, (err:any):void => {
516
- console.error(err);
517
- });
518
- }
519
-
520
414
  const getUserProfileInfo = ():void => {
521
415
  let url:URL = new URL(`${endpoint}/v1/player/${userId}/profile`);
522
416
  let options = {
@@ -538,24 +432,6 @@
538
432
  });
539
433
  }
540
434
 
541
- const getUserProfileConsent = ():void => {
542
- let url:URL = new URL(`${endpoint}/v1/player/${userId}/consent`);
543
- let options = {
544
- method: "GET",
545
- headers: {
546
- 'X-SessionID': sessionId,
547
- }
548
- };
549
-
550
- fetch(url.href, options)
551
- .then((res:any) => { return res.json(); })
552
- .then((data:any) => {
553
- window.postMessage({ type: 'ProfileConsentData', consent: data }, window.location.href);
554
- }, (err:any) => {
555
- console.error(err);
556
- });
557
- }
558
-
559
435
  const sendChangePassword = async (playerCurrentPassword:string, playerNewPassword:string) => {
560
436
  let url:URL = new URL(`${endpoint}/v1/player/${userId}/password`)
561
437
  let data = {
@@ -587,6 +463,7 @@
587
463
  } else {
588
464
  let dataResponse:any = await response.json();
589
465
  // Parsing GMCore message 'cuz it's stupid and it doesn't know how to send error messages in 2021 ffs
466
+ // 2024 and still counting
590
467
  errorPasswordChanged = dataResponse.error.substring(dataResponse.error.indexOf('errorMessage') + 13, dataResponse.error.length);
591
468
  showErrorPasswordChanged = true;
592
469
  window.postMessage({ type: "ShowPasswordChangedError", showErrorPasswordChanged, errorPasswordChanged }, window.location.href);
@@ -597,54 +474,6 @@
597
474
  }
598
475
  }
599
476
 
600
- const getRealityCheckData = (url:URL):void => {
601
- let options = {
602
- method: 'GET',
603
- headers: {
604
- 'X-SessionID': sessionId,
605
- }
606
- }
607
- fetch(url.href, options)
608
- .then((res:any) => { return res.json(); })
609
- .then((data:any) => {
610
- realityCheckData = data.UserRealityCheckValue;
611
- }, (err:any) => {
612
- console.error(err);
613
- });
614
- }
615
-
616
- const setRealityCheckValue = (updatedData:string):void => {
617
- let url:URL = new URL(`${endpoint}/v1/player/${userId}/realitycheck`);
618
-
619
- if (updatedData) {
620
- storedRealityCheck = updatedData;
621
- }
622
-
623
- let optionsRealityCheck = {
624
- method: "POST",
625
- headers: {
626
- 'X-SessionID': sessionId,
627
- 'Content-Type': "application/json",
628
- 'Accept': 'application/json',
629
- 'realityCheckValue': parseInt(storedRealityCheck, 10)
630
- }
631
- };
632
-
633
- fetch(url.href, optionsRealityCheck)
634
- .then((res:any) => {
635
- if (res.status == 200) {
636
- getRealityCheckData(new URL(`${endpoint}/v1/player/${playerid}/realitycheck`));
637
- window.postMessage({ type: 'RealityCheckValueUpdated' }, window.location.href);
638
- window.postMessage({ type: 'WidgetNotification', data: {
639
- type: 'success',
640
- message: $_('realityCheckSuccess')
641
- }}, window.location.href);
642
- }
643
- }, (err:any) => {
644
- console.error(err);
645
- });
646
- }
647
-
648
477
  const getGamingLimits = (url:URL):void => {
649
478
  if (showsuccessnotification === true) {
650
479
  setTimeout(() => {showsuccessnotification = false; }, 3000);
@@ -703,17 +532,6 @@
703
532
  });
704
533
  }
705
534
 
706
- const getData = ():void => {
707
- getNotificationsDetails(new URL(`${cmsendpoint}/${lang}/support-information?env=${env}`));
708
- getUserProfileInfo();
709
- getUserProfileConsent();
710
- getRealityCheckData(new URL(`${endpoint}/v1/player/${playerid}/realitycheck`));
711
- }
712
-
713
- const setActiveLanguage = ():void => {
714
- setLocale(lang);
715
- }
716
-
717
535
  const sendLimitsData = (e:any):void => {
718
536
  getGamingLimits(new URL(`/v2/player/${userId}/limits`, endpoint));
719
537
  }
@@ -746,7 +564,7 @@
746
564
  });
747
565
 
748
566
  $: lang && setActiveLanguage();
749
- $: cmsendpoint && endpoint && customnotifications && playerid && session && lang && env && userroles && initialLoad();
567
+ $: cmsendpoint && endpoint && customnotifications && playerid && session && lang && env && userroles && initialLoad();
750
568
  $: depositlimit && wageringlimit && losslimit && timelimit;
751
569
  $: clientstyling && customStylingContainer && setClientStyling();
752
570
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
@@ -769,16 +587,16 @@
769
587
  {#if isMobile}
770
588
  {#if !activeMenuItem}
771
589
  <nav class="PlayerAccountMobile">
772
- <player-account-menu-nd {cmsendpoint} {env} {endpoint} {session} {playerid} {lang} {translationurl} {userroles} {clientstyling} {clientstylingurl}></player-account-menu-nd>
773
- <player-account-notifications customnotif={customnotifications} {translationurl} {clientstyling} {clientstylingurl}></player-account-notifications>
590
+ <player-account-menu-nd {endpoint} {session} {playerid} {cmsendpoint} {lang} {env} {translationurl} {userroles} {clientstyling} {clientstylingurl}></player-account-menu-nd>
591
+ <player-account-notifications {lang} {cmsendpoint} {env} {userroles} {customnotifications} {clientstyling} {clientstylingurl}></player-account-notifications>
774
592
  </nav>
775
593
  {:else}
776
594
  {#if activeMenuItem === widgetPath[0]}
777
- <player-profile-info {endpoint} {lang} {countrycode} {translationurl} {clientstyling} {clientstylingurl} {custominputtextswitch}></player-profile-info>
595
+ <player-profile-info userid={userId} sessionid={sessionId} {endpoint} {lang} {translationurl} {clientstyling} {clientstylingurl} {custominputtextswitch}></player-profile-info>
778
596
  {:else if activeMenuItem === widgetPath[1]}
779
- <player-change-password {simplepasswordvalidation} {translationurl} {lang} {clientstyling} {clientstylingurl}></player-change-password>
597
+ <player-change-password-nd {simplepasswordvalidation} {translationurl} {lang} {clientstyling} {clientstylingurl}></player-change-password-nd>
780
598
  {:else if activeMenuItem === widgetPath[2]}
781
- <player-reality-check realitycheck={realityCheckData} {endpoint} {translationurl} {playerid} {session} {lang} {clientstyling} {clientstylingurl}></player-reality-check>
599
+ <player-reality-check {endpoint} {translationurl} {playerid} {session} {lang} {clientstyling} {clientstylingurl}></player-reality-check>
782
600
  {:else if activeMenuItem === widgetPath[3]}
783
601
  <player-account-timeout {lang} {operator} {supportemail} {translationurl} {clientstyling} {clientstylingurl}></player-account-timeout>
784
602
  {:else if activeMenuItem === widgetPath[4]}
@@ -823,11 +641,11 @@
823
641
  </nav>
824
642
  <main>
825
643
  {#if activeMenuItem === widgetPath[0]}
826
- <player-profile-info {endpoint} {lang} {countrycode} {translationurl} {clientstyling} {clientstylingurl} {custominputtextswitch}></player-profile-info>
644
+ <player-profile-info userid={userId} sessionid={sessionId} {endpoint} {lang} {translationurl} {clientstyling} {clientstylingurl} {custominputtextswitch}></player-profile-info>
827
645
  {:else if activeMenuItem === widgetPath[1]}
828
- <player-change-password {simplepasswordvalidation}{lang} {translationurl} {clientstyling} {clientstylingurl}></player-change-password>
646
+ <player-change-password-nd {simplepasswordvalidation}{lang} {translationurl} {clientstyling} {clientstylingurl}></player-change-password-nd>
829
647
  {:else if activeMenuItem === widgetPath[2]}
830
- <player-reality-check realitycheck={realityCheckData} {endpoint} {translationurl} {playerid} {session} {lang} {clientstyling} {clientstylingurl}></player-reality-check>
648
+ <player-reality-check {endpoint} {translationurl} {playerid} {session} {lang} {clientstyling} {clientstylingurl}></player-reality-check>
831
649
  {:else if activeMenuItem === widgetPath[3]}
832
650
  <player-account-timeout {lang} {operator} {supportemail} {translationurl} {clientstyling} {clientstylingurl}></player-account-timeout>
833
651
  {:else if activeMenuItem === widgetPath[4]}
@@ -865,7 +683,7 @@
865
683
  {/if}
866
684
  </main>
867
685
  <aside>
868
- <player-account-notifications customnotif={customnotifications} {translationurl} {clientstyling} {clientstylingurl}></player-account-notifications>
686
+ <player-account-notifications {lang} {cmsendpoint} {env} {userroles} {customnotifications} {clientstyling} {clientstylingurl}></player-account-notifications>
869
687
  </aside>
870
688
  {/if}
871
689
  </section>