@jetthai/cuora 1.1.89 → 1.1.90-ac

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 CHANGED
@@ -2,6 +2,12 @@
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.90-ac](https://github.com/jetthai/cuora-module/compare/v1.1.90...v1.1.90-ac) (2023-05-05)
6
+
7
+ ### [1.1.74-ac](https://github.com/jetthai/cuora-module/compare/v1.1.88...v1.1.74-ac) (2023-05-02)
8
+
9
+ ### [1.1.90](https://github.com/jetthai/cuora-module/compare/v1.1.89...v1.1.90) (2023-05-02)
10
+
5
11
  ### [1.1.89](https://github.com/jetthai/cuora-module/compare/v1.1.88...v1.1.89) (2023-05-02)
6
12
 
7
13
  ### [1.1.88](https://github.com/jetthai/cuora-module/compare/v1.1.74-1...v1.1.88) (2023-05-02)
package/dist/bundle.mjs CHANGED
@@ -3582,8 +3582,8 @@ var auth$1 = {
3582
3582
  },
3583
3583
  isPublic: true,
3584
3584
  }),
3585
- register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
3586
- const params = pickBy_1({ channel, subchannel, referralCode, affiliate }, (value) => {
3585
+ register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
3586
+ const params = pickBy_1({ channel, subchannel, ac, fc }, (value) => {
3587
3587
  return value !== undefined && value !== null
3588
3588
  });
3589
3589
  const qs = Object.keys(params)
@@ -3885,6 +3885,11 @@ var user = {
3885
3885
  getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
3886
3886
  getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
3887
3887
  postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
3888
+ getFriends: () => ({ url: 'friends', method: 'get' }),
3889
+ getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
3890
+ getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
3891
+ getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
3892
+ postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
3888
3893
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
3889
3894
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
3890
3895
  passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
@@ -7891,17 +7896,17 @@ function invite_friends_activity (request) {
7891
7896
  bindingCode: null,
7892
7897
  uidSite: null,
7893
7898
  receiveNo: null,
7894
- affiliateCode: null,
7899
+ friendCode: null,
7895
7900
  downlineCount: 0,
7896
7901
  },
7897
7902
  initial: 'idle',
7898
7903
  states: {
7899
7904
  idle: {
7900
7905
  on: {
7901
- FETCH_AFFILIATE_CODE: {
7906
+ FETCH_FRIEND_CODE: {
7902
7907
  target: 'fetching',
7903
7908
  },
7904
- BIND_AFFILIATE_CODE: {
7909
+ BIND_FRIEND_CODE: {
7905
7910
  target: 'binding',
7906
7911
  actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
7907
7912
  },
@@ -7953,9 +7958,9 @@ function invite_friends_activity (request) {
7953
7958
  {
7954
7959
  actions: {
7955
7960
  setAffiliateCode: assign((context, event) => {
7956
- const { affiliateCode, downlineCount } = event.data;
7961
+ const { friendCode, downlineCount } = event.data;
7957
7962
  return {
7958
- affiliateCode,
7963
+ friendCode,
7959
7964
  downlineCount,
7960
7965
  }
7961
7966
  }),
@@ -7977,7 +7982,7 @@ function invite_friends_activity (request) {
7977
7982
  },
7978
7983
  services: {
7979
7984
  postAffiliate: async (context, event) => {
7980
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
7985
+ return await request.send(user.postAffiliate({ friendCode: context.bindingCode }))
7981
7986
  },
7982
7987
  fetchAffiliate: async (context, event) => {
7983
7988
  return await request.send(user.getAffiliate())
@@ -7992,18 +7997,18 @@ function invite_friends_activity (request) {
7992
7997
  )
7993
7998
  }
7994
7999
 
7995
- function affiliate_invite_friends_activity (request) {
8000
+ function friend_invite_friends_activity (request) {
7996
8001
  const { appSecret } = request.config;
7997
8002
  return createMachine(
7998
8003
  {
7999
- id: 'affiliate_invite_friends_activity',
8004
+ id: 'friend_invite_friends_activity',
8000
8005
  context: {
8001
- affiliateEnable: false,
8006
+ friendsEnable: false,
8002
8007
  activityNo: null,
8003
8008
  bindingCode: null,
8004
8009
  uidSite: null,
8005
8010
  receiveNo: null,
8006
- affiliateCode: '',
8011
+ friendCode: '',
8007
8012
  commission: 0,
8008
8013
  downLine: 0,
8009
8014
  activeDownLine: 0,
@@ -8017,10 +8022,10 @@ function affiliate_invite_friends_activity (request) {
8017
8022
  states: {
8018
8023
  fetching1: {
8019
8024
  invoke: {
8020
- src: 'fetchAffiliateCode',
8025
+ src: 'fetchFriendsCode',
8021
8026
  onDone: {
8022
8027
  target: 'checking',
8023
- actions: 'setAffiliateCode',
8028
+ actions: 'setFriendsCode',
8024
8029
  },
8025
8030
  onError: {
8026
8031
  target: 'fetching2',
@@ -8028,11 +8033,11 @@ function affiliate_invite_friends_activity (request) {
8028
8033
  },
8029
8034
  },
8030
8035
  checking: {
8031
- always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
8036
+ always: [{ target: 'fetching2', cond: 'isFriendsEnable' }, { target: 'idle' }],
8032
8037
  },
8033
8038
  fetching2: {
8034
8039
  invoke: {
8035
- src: 'fetchAffiliateData',
8040
+ src: 'fetchFriendsData',
8036
8041
  onDone: {
8037
8042
  target: 'idle',
8038
8043
  actions: 'setInitialData',
@@ -8044,7 +8049,7 @@ function affiliate_invite_friends_activity (request) {
8044
8049
  },
8045
8050
  idle: {
8046
8051
  on: {
8047
- BIND_AFFILIATE_CODE: {
8052
+ BIND_FRIEND_CODE: {
8048
8053
  target: 'binding',
8049
8054
  actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
8050
8055
  },
@@ -8061,7 +8066,7 @@ function affiliate_invite_friends_activity (request) {
8061
8066
  },
8062
8067
  binding: {
8063
8068
  invoke: {
8064
- src: 'postAffiliate',
8069
+ src: 'postFriends',
8065
8070
  onDone: {
8066
8071
  target: 'awarding',
8067
8072
  },
@@ -8105,10 +8110,10 @@ function affiliate_invite_friends_activity (request) {
8105
8110
  },
8106
8111
  {
8107
8112
  actions: {
8108
- setAffiliateCode: assign((context, event) => {
8109
- const { affiliateCode = '' } = event.data || {};
8113
+ setFriendsCode: assign((context, event) => {
8114
+ const { friendCode = '' } = event.data || {};
8110
8115
  return {
8111
- affiliateCode,
8116
+ friendCode,
8112
8117
  }
8113
8118
  }),
8114
8119
  setInitialData: assign((context, event) => {
@@ -8165,20 +8170,20 @@ function affiliate_invite_friends_activity (request) {
8165
8170
  const { page } = context.levelDownLine;
8166
8171
  return page.current < page.total
8167
8172
  },
8168
- isAffiliateEnable: (context, event) => context.affiliateEnable,
8173
+ isFriendsEnable: (context, event) => context.friendsEnable,
8169
8174
  },
8170
8175
  services: {
8171
- fetchAffiliateCode: async () => {
8172
- return await request.send(user.getAffiliate())
8176
+ fetchFriendsCode: async () => {
8177
+ return await request.send(user.getFriends())
8173
8178
  },
8174
- fetchAffiliateData: async (context, event) => {
8175
- const affiliateHomeAPI = request.send(user.getAffiliateHome());
8176
- const affiliateDashboard = request.send(user.getAffiliateDashboard());
8177
- const [affiliateHomeData, affiliateDashboardData] = await Promise.all([affiliateHomeAPI, affiliateDashboard]);
8178
- return [affiliateHomeData, affiliateDashboardData]
8179
+ fetchFriendsData: async (context, event) => {
8180
+ const friendsHomeAPI = request.send(user.getFriendsHome());
8181
+ const friendsDashboard = request.send(user.getFriendsDashboard());
8182
+ const [friendsHomeData, friendsDashboardData] = await Promise.all([friendsHomeAPI, friendsDashboard]);
8183
+ return [friendsHomeData, friendsDashboardData]
8179
8184
  },
8180
- postAffiliate: async (context, event) => {
8181
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
8185
+ postFriends: async (context, event) => {
8186
+ return await request.send(user.postFriends({ friendCode: context.bindingCode }))
8182
8187
  },
8183
8188
  awardPrize: async (context, event) => {
8184
8189
  const { activityNo, uidSite, bindingCode } = context;
@@ -8189,7 +8194,7 @@ function affiliate_invite_friends_activity (request) {
8189
8194
  const { currentLevel, page, levelDownLine } = context;
8190
8195
  const copiedObj = JSON.parse(JSON.stringify(levelDownLine));
8191
8196
  const copiedList = copiedObj.data;
8192
- const resopnseData = await request.send(user.getAffiliateDashboardList({ level: currentLevel, page, row: 10 }));
8197
+ const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }));
8193
8198
  if (!!copiedList && !!resopnseData?.data) {
8194
8199
  const combindData = {
8195
8200
  ...resopnseData,
@@ -9270,7 +9275,7 @@ var activity = {
9270
9275
  diamond_shop_activity_vn,
9271
9276
  fafafa_activity,
9272
9277
  invite_friends_activity,
9273
- affiliate_invite_friends_activity,
9278
+ friend_invite_friends_activity,
9274
9279
  ranking_activity,
9275
9280
  return_bonus_activity,
9276
9281
  specify_bets_activity,
@@ -15463,7 +15468,7 @@ function auth (request) {
15463
15468
  userInfo: {},
15464
15469
  redirectURL: null,
15465
15470
  reCaptchaToken: null,
15466
- affiliate: null,
15471
+ fc: null,
15467
15472
  },
15468
15473
  states: {
15469
15474
  idle: {
@@ -15748,7 +15753,7 @@ function auth (request) {
15748
15753
  return { token }
15749
15754
  }),
15750
15755
  redirectTo3Party: async (context, event) => {
15751
- const { provider, channel, subchannel, affiliate } = event.data;
15756
+ const { provider, channel, subchannel, fc } = event.data;
15752
15757
 
15753
15758
  const dt = await getDeviceToken({
15754
15759
  fpToken,
@@ -15757,7 +15762,7 @@ function auth (request) {
15757
15762
  });
15758
15763
  sentry.setTag('dt', dt);
15759
15764
 
15760
- const referralCode = storage.get('referralCode');
15765
+ const affiliateCode = storage.get('ac');
15761
15766
  const messages = {
15762
15767
  url: window.location.href,
15763
15768
  channelOrders: [
@@ -15765,13 +15770,13 @@ function auth (request) {
15765
15770
  { channel: defaultChannel, subchannel: defaultSubchannel },
15766
15771
  { channel: channel, subchannel: subchannel },
15767
15772
  ],
15768
- referralCode,
15773
+ affiliateCode,
15769
15774
  };
15770
15775
  sentry.captureMessage(JSON.stringify(messages));
15771
15776
 
15772
15777
  const referralObj = {};
15773
15778
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
15774
- referralObj.referralCode = referralCode;
15779
+ referralObj.ac = affiliateCode;
15775
15780
  }
15776
15781
 
15777
15782
  referralObj.channel = storage.get('channel') || defaultChannel || channel;
@@ -15786,7 +15791,7 @@ function auth (request) {
15786
15791
  ...referralObj,
15787
15792
  // dt,
15788
15793
  platform: 'pwa',
15789
- affiliate,
15794
+ fc,
15790
15795
  }).toString()
15791
15796
  );
15792
15797
 
@@ -15939,7 +15944,7 @@ var uaParser = {exports: {}};
15939
15944
 
15940
15945
  (function (module, exports) {
15941
15946
  /////////////////////////////////////////////////////////////////////////////////
15942
- /* UAParser.js v0.7.34
15947
+ /* UAParser.js v0.7.35
15943
15948
  Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
15944
15949
  MIT License *//*
15945
15950
  Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
@@ -15955,7 +15960,7 @@ var uaParser = {exports: {}};
15955
15960
  /////////////
15956
15961
 
15957
15962
 
15958
- var LIBVERSION = '0.7.34',
15963
+ var LIBVERSION = '0.7.35',
15959
15964
  EMPTY = '',
15960
15965
  UNKNOWN = '?',
15961
15966
  FUNC_TYPE = 'function',
@@ -16173,8 +16178,9 @@ var uaParser = {exports: {}};
16173
16178
  /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
16174
16179
 
16175
16180
  // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
16176
- /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
16181
+ /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
16177
16182
  // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
16183
+ /(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
16178
16184
  /(weibo)__([\d\.]+)/i // Weibo
16179
16185
  ], [NAME, VERSION], [
16180
16186
  /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
@@ -16188,7 +16194,7 @@ var uaParser = {exports: {}};
16188
16194
  ], [VERSION, [NAME, 'Konqueror']], [
16189
16195
  /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
16190
16196
  ], [VERSION, [NAME, 'IE']], [
16191
- /yabrowser\/([\w\.]+)/i // Yandex
16197
+ /ya(?:search)?browser\/([\w\.]+)/i // Yandex
16192
16198
  ], [VERSION, [NAME, 'Yandex']], [
16193
16199
  /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
16194
16200
  ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [
@@ -16232,6 +16238,8 @@ var uaParser = {exports: {}};
16232
16238
  ], [NAME, VERSION], [
16233
16239
  /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
16234
16240
  ], [VERSION, [NAME, 'GSA']], [
16241
+ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
16242
+ ], [VERSION, [NAME, 'TikTok']], [
16235
16243
 
16236
16244
  /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless
16237
16245
  ], [VERSION, [NAME, CHROME+' Headless']], [
@@ -16327,7 +16335,7 @@ var uaParser = {exports: {}};
16327
16335
  ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [
16328
16336
 
16329
16337
  // Apple
16330
- /\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone
16338
+ /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i // iPod/iPhone
16331
16339
  ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [
16332
16340
  /\((ipad);[-\w\),; ]+apple/i, // iPad
16333
16341
  /applecoremedia\/[\w\.]+ \((ipad)/i,
@@ -16417,7 +16425,7 @@ var uaParser = {exports: {}};
16417
16425
 
16418
16426
  // Amazon
16419
16427
  /(alexa)webm/i,
16420
- /(kf[a-z]{2}wi)( bui|\))/i, // Kindle Fire without Silk
16428
+ /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show
16421
16429
  /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD
16422
16430
  ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [
16423
16431
  /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone
@@ -16602,6 +16610,8 @@ var uaParser = {exports: {}};
16602
16610
 
16603
16611
  /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla
16604
16612
  ], [VENDOR, [TYPE, EMBEDDED]], [
16613
+ /(aeobc)\b/i // Echo Dot
16614
+ ], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
16605
16615
 
16606
16616
  ////////////////////
16607
16617
  // MIXED (GENERIC)
@@ -16631,7 +16641,8 @@ var uaParser = {exports: {}};
16631
16641
  /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
16632
16642
  /ekioh(flow)\/([\w\.]+)/i, // Flow
16633
16643
  /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
16634
- /(icab)[\/ ]([23]\.[\d\.]+)/i // iCab
16644
+ /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
16645
+ /\b(libweb)/i
16635
16646
  ], [NAME, VERSION], [
16636
16647
 
16637
16648
  /rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
@@ -16652,6 +16663,7 @@ var uaParser = {exports: {}};
16652
16663
 
16653
16664
  // iOS/macOS
16654
16665
  /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
16666
+ /ios;fbsv\/([\d\.]+)/i,
16655
16667
  /cfnetwork\/.+darwin/i
16656
16668
  ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
16657
16669
  /(mac os x) ?([\w\. ]*)/i,
@@ -16708,7 +16720,7 @@ var uaParser = {exports: {}};
16708
16720
  ], [[NAME, 'Solaris'], VERSION], [
16709
16721
  /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris
16710
16722
  /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX
16711
- /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
16723
+ /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
16712
16724
  /(unix) ?([\w\.]*)/i // UNIX
16713
16725
  ], [NAME, VERSION]
16714
16726
  ]
@@ -16733,6 +16745,7 @@ var uaParser = {exports: {}};
16733
16745
  var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY);
16734
16746
  var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined$1;
16735
16747
  var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
16748
+ var _isSelfNav = _navigator && _navigator.userAgent == _ua;
16736
16749
 
16737
16750
  this.getBrowser = function () {
16738
16751
  var _browser = {};
@@ -16741,7 +16754,7 @@ var uaParser = {exports: {}};
16741
16754
  rgxMapper.call(_browser, _ua, _rgxmap.browser);
16742
16755
  _browser[MAJOR] = majorize(_browser[VERSION]);
16743
16756
  // Brave-specific detection
16744
- if (_navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
16757
+ if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
16745
16758
  _browser[NAME] = 'Brave';
16746
16759
  }
16747
16760
  return _browser;
@@ -16758,11 +16771,11 @@ var uaParser = {exports: {}};
16758
16771
  _device[MODEL] = undefined$1;
16759
16772
  _device[TYPE] = undefined$1;
16760
16773
  rgxMapper.call(_device, _ua, _rgxmap.device);
16761
- if (!_device[TYPE] && _uach && _uach.mobile) {
16774
+ if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {
16762
16775
  _device[TYPE] = MOBILE;
16763
16776
  }
16764
16777
  // iPadOS-specific detection: identified as Mac, but has some iOS-only properties
16765
- if (_device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
16778
+ if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
16766
16779
  _device[MODEL] = 'iPad';
16767
16780
  _device[TYPE] = TABLET;
16768
16781
  }
@@ -16780,7 +16793,7 @@ var uaParser = {exports: {}};
16780
16793
  _os[NAME] = undefined$1;
16781
16794
  _os[VERSION] = undefined$1;
16782
16795
  rgxMapper.call(_os, _ua, _rgxmap.os);
16783
- if (!_os[NAME] && _uach && _uach.platform != 'Unknown') {
16796
+ if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
16784
16797
  _os[NAME] = _uach.platform
16785
16798
  .replace(/chrome os/i, CHROMIUM_OS)
16786
16799
  .replace(/macos/i, MAC_OS); // backward compatibility
@@ -16890,7 +16903,7 @@ function common (request) {
16890
16903
  sentNormalBroadcastList: [],
16891
16904
  channel: null,
16892
16905
  subchannel: null,
16893
- referralCode: null,
16906
+ affiliateCode: null,
16894
16907
  },
16895
16908
  states: {
16896
16909
  config: {
@@ -17006,7 +17019,7 @@ function common (request) {
17006
17019
  let urlParams = new URLSearchParams(window.location.search);
17007
17020
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official';
17008
17021
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa';
17009
- const referralCode = urlParams.get('referralCode') || storage.get('referralCode');
17022
+ const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode');
17010
17023
 
17011
17024
  storage.set('channel', channel, {
17012
17025
  path: '/',
@@ -17016,7 +17029,7 @@ function common (request) {
17016
17029
  path: '/',
17017
17030
  maxAge: 60 * 60 * 24 * 7,
17018
17031
  });
17019
- storage.set('referralCode', referralCode, {
17032
+ storage.set('ac', affiliateCode, {
17020
17033
  path: '/',
17021
17034
  maxAge: 60 * 60 * 24 * 7,
17022
17035
  });
@@ -17024,7 +17037,7 @@ function common (request) {
17024
17037
  return {
17025
17038
  channel,
17026
17039
  subchannel,
17027
- referralCode,
17040
+ affiliateCode,
17028
17041
  }
17029
17042
  }
17030
17043
  }),
@@ -17824,6 +17837,7 @@ function game_v2_1 (request) {
17824
17837
  id: 'game',
17825
17838
  type: 'parallel',
17826
17839
  context: {
17840
+ base: '/',
17827
17841
  loadable: false,
17828
17842
  isLastPage: false,
17829
17843
  room: null,
@@ -18193,7 +18207,7 @@ function game_v2_1 (request) {
18193
18207
  is_demo: false,
18194
18208
  is_mobile: isMobile,
18195
18209
  lang,
18196
- return_url: returnProviders.includes(providerId) ? `${window.location.origin}/return` : window.location.href, // For providers to return.
18210
+ return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
18197
18211
  };
18198
18212
  const { redirect_url } = await request.send(game$1.playGame(params));
18199
18213
  return { gameURL: redirect_url }
@@ -20303,7 +20317,7 @@ function user_sign_up (request) {
20303
20317
  channel: null,
20304
20318
  subchannel: null,
20305
20319
  signUpData: {},
20306
- affiliate: null,
20320
+ fc: null,
20307
20321
  reCaptchaToken: null,
20308
20322
  registrationData: {
20309
20323
  account: null,
@@ -20350,9 +20364,9 @@ function user_sign_up (request) {
20350
20364
  }
20351
20365
  }),
20352
20366
  setAffiliate: assign((context, event) => {
20353
- const { affiliate } = event.data;
20367
+ const { fc } = event.data;
20354
20368
  return {
20355
- affiliate,
20369
+ fc,
20356
20370
  }
20357
20371
  }),
20358
20372
  setSignUpPhone: assign((context, event) => {
@@ -20401,7 +20415,7 @@ function user_sign_up (request) {
20401
20415
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts });
20402
20416
  sentry.setTag('dt', dt);
20403
20417
 
20404
- const referralCode = storage.get('referralCode');
20418
+ const affiliateCode = storage.get('ac');
20405
20419
  const messages = {
20406
20420
  url: window.location.href,
20407
20421
  channelOrders: [
@@ -20409,13 +20423,13 @@ function user_sign_up (request) {
20409
20423
  { channel: defaultChannel, subchannel: defaultSubchannel },
20410
20424
  { channel: channel, subchannel: subchannel },
20411
20425
  ],
20412
- referralCode,
20426
+ affiliateCode,
20413
20427
  };
20414
20428
  sentry.captureMessage(JSON.stringify(messages));
20415
20429
 
20416
20430
  const referralObj = {};
20417
20431
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
20418
- referralObj.referralCode = referralCode;
20432
+ referralObj.ac = affiliateCode;
20419
20433
  }
20420
20434
 
20421
20435
  referralObj.channel = storage.get('channel') || defaultChannel || channel;
@@ -20427,7 +20441,7 @@ function user_sign_up (request) {
20427
20441
  ...referralObj,
20428
20442
  dt,
20429
20443
  reCaptchaToken: context.reCaptchaToken,
20430
- affiliate: context.affiliate,
20444
+ fc: context.fc,
20431
20445
  })
20432
20446
  )
20433
20447
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.89",
3
+ "version": "1.1.90-ac",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/auth.js CHANGED
@@ -31,8 +31,8 @@ export default {
31
31
  },
32
32
  isPublic: true,
33
33
  }),
34
- register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
35
- const params = pickBy({ channel, subchannel, referralCode, affiliate }, (value) => {
34
+ register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
35
+ const params = pickBy({ channel, subchannel, ac, fc }, (value) => {
36
36
  return value !== undefined && value !== null
37
37
  })
38
38
  const qs = Object.keys(params)
package/src/api/user.js CHANGED
@@ -14,6 +14,11 @@ export default {
14
14
  getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
15
15
  getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
16
16
  postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
17
+ getFriends: () => ({ url: 'friends', method: 'get' }),
18
+ getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
19
+ getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
20
+ getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
21
+ postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
17
22
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
18
23
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
19
24
  passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
@@ -6,14 +6,14 @@ export default function (request) {
6
6
  const { appSecret } = request.config
7
7
  return createMachine(
8
8
  {
9
- id: 'affiliate_invite_friends_activity',
9
+ id: 'friend_invite_friends_activity',
10
10
  context: {
11
- affiliateEnable: false,
11
+ friendsEnable: false,
12
12
  activityNo: null,
13
13
  bindingCode: null,
14
14
  uidSite: null,
15
15
  receiveNo: null,
16
- affiliateCode: '',
16
+ friendCode: '',
17
17
  commission: 0,
18
18
  downLine: 0,
19
19
  activeDownLine: 0,
@@ -27,10 +27,10 @@ export default function (request) {
27
27
  states: {
28
28
  fetching1: {
29
29
  invoke: {
30
- src: 'fetchAffiliateCode',
30
+ src: 'fetchFriendsCode',
31
31
  onDone: {
32
32
  target: 'checking',
33
- actions: 'setAffiliateCode',
33
+ actions: 'setFriendsCode',
34
34
  },
35
35
  onError: {
36
36
  target: 'fetching2',
@@ -38,11 +38,11 @@ export default function (request) {
38
38
  },
39
39
  },
40
40
  checking: {
41
- always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
41
+ always: [{ target: 'fetching2', cond: 'isFriendsEnable' }, { target: 'idle' }],
42
42
  },
43
43
  fetching2: {
44
44
  invoke: {
45
- src: 'fetchAffiliateData',
45
+ src: 'fetchFriendsData',
46
46
  onDone: {
47
47
  target: 'idle',
48
48
  actions: 'setInitialData',
@@ -54,7 +54,7 @@ export default function (request) {
54
54
  },
55
55
  idle: {
56
56
  on: {
57
- BIND_AFFILIATE_CODE: {
57
+ BIND_FRIEND_CODE: {
58
58
  target: 'binding',
59
59
  actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
60
60
  },
@@ -71,7 +71,7 @@ export default function (request) {
71
71
  },
72
72
  binding: {
73
73
  invoke: {
74
- src: 'postAffiliate',
74
+ src: 'postFriends',
75
75
  onDone: {
76
76
  target: 'awarding',
77
77
  },
@@ -115,10 +115,10 @@ export default function (request) {
115
115
  },
116
116
  {
117
117
  actions: {
118
- setAffiliateCode: assign((context, event) => {
119
- const { affiliateCode = '' } = event.data || {}
118
+ setFriendsCode: assign((context, event) => {
119
+ const { friendCode = '' } = event.data || {}
120
120
  return {
121
- affiliateCode,
121
+ friendCode,
122
122
  }
123
123
  }),
124
124
  setInitialData: assign((context, event) => {
@@ -175,20 +175,20 @@ export default function (request) {
175
175
  const { page } = context.levelDownLine
176
176
  return page.current < page.total
177
177
  },
178
- isAffiliateEnable: (context, event) => context.affiliateEnable,
178
+ isFriendsEnable: (context, event) => context.friendsEnable,
179
179
  },
180
180
  services: {
181
- fetchAffiliateCode: async () => {
182
- return await request.send(user.getAffiliate())
181
+ fetchFriendsCode: async () => {
182
+ return await request.send(user.getFriends())
183
183
  },
184
- fetchAffiliateData: async (context, event) => {
185
- const affiliateHomeAPI = request.send(user.getAffiliateHome())
186
- const affiliateDashboard = request.send(user.getAffiliateDashboard())
187
- const [affiliateHomeData, affiliateDashboardData] = await Promise.all([affiliateHomeAPI, affiliateDashboard])
188
- return [affiliateHomeData, affiliateDashboardData]
184
+ fetchFriendsData: async (context, event) => {
185
+ const friendsHomeAPI = request.send(user.getFriendsHome())
186
+ const friendsDashboard = request.send(user.getFriendsDashboard())
187
+ const [friendsHomeData, friendsDashboardData] = await Promise.all([friendsHomeAPI, friendsDashboard])
188
+ return [friendsHomeData, friendsDashboardData]
189
189
  },
190
- postAffiliate: async (context, event) => {
191
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
190
+ postFriends: async (context, event) => {
191
+ return await request.send(user.postFriends({ friendCode: context.bindingCode }))
192
192
  },
193
193
  awardPrize: async (context, event) => {
194
194
  const { activityNo, uidSite, bindingCode } = context
@@ -199,7 +199,7 @@ export default function (request) {
199
199
  const { currentLevel, page, levelDownLine } = context
200
200
  const copiedObj = JSON.parse(JSON.stringify(levelDownLine))
201
201
  const copiedList = copiedObj.data
202
- const resopnseData = await request.send(user.getAffiliateDashboardList({ level: currentLevel, page, row: 10 }))
202
+ const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }))
203
203
  if (!!copiedList && !!resopnseData?.data) {
204
204
  const combindData = {
205
205
  ...resopnseData,
@@ -4,7 +4,7 @@ import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
4
4
  import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
5
5
  import fafafa_activity from './fafafa_activity.js'
6
6
  import invite_friends_activity from './invite_friends_activity.js'
7
- import affiliate_invite_friends_activity from './affiliate_invite_friends_activity.js'
7
+ import friend_invite_friends_activity from './friend_invite_friends_activity.js'
8
8
  import ranking_activity from './ranking_activity.js'
9
9
  import return_bonus_activity from './return_bonus_activity.js'
10
10
  import specify_bets_activity from './specify_bets_activity.js'
@@ -23,7 +23,7 @@ export default {
23
23
  diamond_shop_activity_vn,
24
24
  fafafa_activity,
25
25
  invite_friends_activity,
26
- affiliate_invite_friends_activity,
26
+ friend_invite_friends_activity,
27
27
  ranking_activity,
28
28
  return_bonus_activity,
29
29
  specify_bets_activity,
@@ -12,17 +12,17 @@ export default function (request) {
12
12
  bindingCode: null,
13
13
  uidSite: null,
14
14
  receiveNo: null,
15
- affiliateCode: null,
15
+ friendCode: null,
16
16
  downlineCount: 0,
17
17
  },
18
18
  initial: 'idle',
19
19
  states: {
20
20
  idle: {
21
21
  on: {
22
- FETCH_AFFILIATE_CODE: {
22
+ FETCH_FRIEND_CODE: {
23
23
  target: 'fetching',
24
24
  },
25
- BIND_AFFILIATE_CODE: {
25
+ BIND_FRIEND_CODE: {
26
26
  target: 'binding',
27
27
  actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
28
28
  },
@@ -74,9 +74,9 @@ export default function (request) {
74
74
  {
75
75
  actions: {
76
76
  setAffiliateCode: assign((context, event) => {
77
- const { affiliateCode, downlineCount } = event.data
77
+ const { friendCode, downlineCount } = event.data
78
78
  return {
79
- affiliateCode,
79
+ friendCode,
80
80
  downlineCount,
81
81
  }
82
82
  }),
@@ -98,7 +98,7 @@ export default function (request) {
98
98
  },
99
99
  services: {
100
100
  postAffiliate: async (context, event) => {
101
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
101
+ return await request.send(user.postAffiliate({ friendCode: context.bindingCode }))
102
102
  },
103
103
  fetchAffiliate: async (context, event) => {
104
104
  return await request.send(user.getAffiliate())
@@ -36,7 +36,7 @@ export default function (request) {
36
36
  userInfo: {},
37
37
  redirectURL: null,
38
38
  reCaptchaToken: null,
39
- affiliate: null,
39
+ fc: null,
40
40
  },
41
41
  states: {
42
42
  idle: {
@@ -321,7 +321,7 @@ export default function (request) {
321
321
  return { token }
322
322
  }),
323
323
  redirectTo3Party: async (context, event) => {
324
- const { provider, channel, subchannel, affiliate } = event.data
324
+ const { provider, channel, subchannel, fc } = event.data
325
325
 
326
326
  const dt = await getDeviceToken({
327
327
  fpToken,
@@ -330,7 +330,7 @@ export default function (request) {
330
330
  })
331
331
  sentry.setTag('dt', dt)
332
332
 
333
- const referralCode = storage.get('referralCode')
333
+ const affiliateCode = storage.get('ac')
334
334
  const messages = {
335
335
  url: window.location.href,
336
336
  channelOrders: [
@@ -338,13 +338,13 @@ export default function (request) {
338
338
  { channel: defaultChannel, subchannel: defaultSubchannel },
339
339
  { channel: channel, subchannel: subchannel },
340
340
  ],
341
- referralCode,
341
+ affiliateCode,
342
342
  }
343
343
  sentry.captureMessage(JSON.stringify(messages))
344
344
 
345
345
  const referralObj = {}
346
346
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
347
- referralObj.referralCode = referralCode
347
+ referralObj.ac = affiliateCode
348
348
  }
349
349
 
350
350
  referralObj.channel = storage.get('channel') || defaultChannel || channel
@@ -359,7 +359,7 @@ export default function (request) {
359
359
  ...referralObj,
360
360
  // dt,
361
361
  platform: 'pwa',
362
- affiliate,
362
+ fc,
363
363
  }).toString()
364
364
  )
365
365
 
@@ -41,7 +41,7 @@ export default function (request) {
41
41
  sentNormalBroadcastList: [],
42
42
  channel: null,
43
43
  subchannel: null,
44
- referralCode: null,
44
+ affiliateCode: null,
45
45
  },
46
46
  states: {
47
47
  config: {
@@ -157,7 +157,7 @@ export default function (request) {
157
157
  let urlParams = new URLSearchParams(window.location.search)
158
158
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
159
159
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
160
- const referralCode = urlParams.get('referralCode') || storage.get('referralCode')
160
+ const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
161
161
 
162
162
  storage.set('channel', channel, {
163
163
  path: '/',
@@ -167,7 +167,7 @@ export default function (request) {
167
167
  path: '/',
168
168
  maxAge: 60 * 60 * 24 * 7,
169
169
  })
170
- storage.set('referralCode', referralCode, {
170
+ storage.set('ac', affiliateCode, {
171
171
  path: '/',
172
172
  maxAge: 60 * 60 * 24 * 7,
173
173
  })
@@ -175,7 +175,7 @@ export default function (request) {
175
175
  return {
176
176
  channel,
177
177
  subchannel,
178
- referralCode,
178
+ affiliateCode,
179
179
  }
180
180
  }
181
181
  }),
@@ -10,6 +10,7 @@ export default function (request) {
10
10
  id: 'game',
11
11
  type: 'parallel',
12
12
  context: {
13
+ base: '/',
13
14
  loadable: false,
14
15
  isLastPage: false,
15
16
  room: null,
@@ -379,7 +380,7 @@ export default function (request) {
379
380
  is_demo: false,
380
381
  is_mobile: isMobile,
381
382
  lang,
382
- return_url: returnProviders.includes(providerId) ? `${window.location.origin}/return` : window.location.href, // For providers to return.
383
+ return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
383
384
  }
384
385
  const { redirect_url } = await request.send(api.playGame(params))
385
386
  return { gameURL: redirect_url }
@@ -14,7 +14,7 @@ export default function (request) {
14
14
  channel: null,
15
15
  subchannel: null,
16
16
  signUpData: {},
17
- affiliate: null,
17
+ fc: null,
18
18
  reCaptchaToken: null,
19
19
  registrationData: {
20
20
  account: null,
@@ -61,9 +61,9 @@ export default function (request) {
61
61
  }
62
62
  }),
63
63
  setAffiliate: assign((context, event) => {
64
- const { affiliate } = event.data
64
+ const { fc } = event.data
65
65
  return {
66
- affiliate,
66
+ fc,
67
67
  }
68
68
  }),
69
69
  setSignUpPhone: assign((context, event) => {
@@ -112,7 +112,7 @@ export default function (request) {
112
112
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts })
113
113
  sentry.setTag('dt', dt)
114
114
 
115
- const referralCode = storage.get('referralCode')
115
+ const affiliateCode = storage.get('ac')
116
116
  const messages = {
117
117
  url: window.location.href,
118
118
  channelOrders: [
@@ -120,13 +120,13 @@ export default function (request) {
120
120
  { channel: defaultChannel, subchannel: defaultSubchannel },
121
121
  { channel: channel, subchannel: subchannel },
122
122
  ],
123
- referralCode,
123
+ affiliateCode,
124
124
  }
125
125
  sentry.captureMessage(JSON.stringify(messages))
126
126
 
127
127
  const referralObj = {}
128
128
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
129
- referralObj.referralCode = referralCode
129
+ referralObj.ac = affiliateCode
130
130
  }
131
131
 
132
132
  referralObj.channel = storage.get('channel') || defaultChannel || channel
@@ -138,7 +138,7 @@ export default function (request) {
138
138
  ...referralObj,
139
139
  dt,
140
140
  reCaptchaToken: context.reCaptchaToken,
141
- affiliate: context.affiliate,
141
+ fc: context.fc,
142
142
  })
143
143
  )
144
144
  },