@jetthai/cuora 1.1.1 → 1.1.2
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 +2 -0
- package/dist/bundle.mjs +33 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.2](https://github.com/jetthai/cuora-module/compare/v1.1.1...v1.1.2) (2022-12-01)
|
|
6
|
+
|
|
5
7
|
### [1.1.1](https://github.com/jetthai/cuora-module/compare/v1.1.0...v1.1.1) (2022-12-01)
|
|
6
8
|
|
|
7
9
|
## [1.1.0](https://github.com/jetthai/cuora-module/compare/v1.0.205...v1.1.0) (2022-11-30)
|
package/dist/bundle.mjs
CHANGED
|
@@ -8388,24 +8388,33 @@ function auth (request) {
|
|
|
8388
8388
|
const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL });
|
|
8389
8389
|
sentry.setTag('dt', dt);
|
|
8390
8390
|
|
|
8391
|
+
const referralCode = storage.get('referralCode');
|
|
8391
8392
|
const messages = {
|
|
8392
8393
|
url: window.location.href,
|
|
8393
|
-
|
|
8394
|
+
channelOrders: [
|
|
8394
8395
|
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
8395
8396
|
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
8396
8397
|
{ channel: channel, subchannel: subchannel },
|
|
8397
8398
|
],
|
|
8399
|
+
referralCode
|
|
8398
8400
|
};
|
|
8399
8401
|
sentry.captureMessage(JSON.stringify(messages));
|
|
8400
8402
|
|
|
8403
|
+
const referralObj = {};
|
|
8404
|
+
if (referralCode) {
|
|
8405
|
+
referralObj.referralCode = referralCode;
|
|
8406
|
+
} else {
|
|
8407
|
+
referralObj.channel = storage.get('channel') || defaultChannel || channel,
|
|
8408
|
+
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel;
|
|
8409
|
+
}
|
|
8410
|
+
|
|
8401
8411
|
const redirectURL = urljoin(
|
|
8402
8412
|
request.config.fullURL,
|
|
8403
8413
|
'login?' +
|
|
8404
8414
|
new URLSearchParams({
|
|
8405
8415
|
provider,
|
|
8406
8416
|
redirectURI: `${window.location.protocol}//${window.location.host}${context.base}`,
|
|
8407
|
-
|
|
8408
|
-
subchannel: storage.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
|
|
8417
|
+
...referralObj,
|
|
8409
8418
|
// dt,
|
|
8410
8419
|
platform: 'pwa',
|
|
8411
8420
|
affiliate,
|
|
@@ -10793,6 +10802,7 @@ function common (request) {
|
|
|
10793
10802
|
sentNormalBroadcastList: [],
|
|
10794
10803
|
channel: null,
|
|
10795
10804
|
subchannel: null,
|
|
10805
|
+
referralCode: null
|
|
10796
10806
|
},
|
|
10797
10807
|
states: {
|
|
10798
10808
|
config: {
|
|
@@ -10908,6 +10918,7 @@ function common (request) {
|
|
|
10908
10918
|
let urlParams = new URLSearchParams(window.location.search);
|
|
10909
10919
|
const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official';
|
|
10910
10920
|
const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa';
|
|
10921
|
+
const referralCode = urlParams.get('referralCode') || storage.get('referralCode');
|
|
10911
10922
|
|
|
10912
10923
|
storage.set('channel', channel, {
|
|
10913
10924
|
path: '/',
|
|
@@ -10917,10 +10928,16 @@ function common (request) {
|
|
|
10917
10928
|
path: '/',
|
|
10918
10929
|
maxAge: 60 * 60 * 24 * 7,
|
|
10919
10930
|
});
|
|
10931
|
+
storage.set('referralCode', referralCode, {
|
|
10932
|
+
path: '/',
|
|
10933
|
+
maxAge: 60 * 60 * 24 * 7,
|
|
10934
|
+
});
|
|
10935
|
+
|
|
10920
10936
|
|
|
10921
10937
|
return {
|
|
10922
10938
|
channel,
|
|
10923
10939
|
subchannel,
|
|
10940
|
+
referralCode
|
|
10924
10941
|
}
|
|
10925
10942
|
}
|
|
10926
10943
|
}),
|
|
@@ -13736,23 +13753,32 @@ function user_sign_up (request) {
|
|
|
13736
13753
|
authenticate: async (context, event) => {
|
|
13737
13754
|
const { channel, subchannel, signUpData } = context;
|
|
13738
13755
|
const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL });
|
|
13739
|
-
|
|
13740
13756
|
sentry.setTag('dt', dt);
|
|
13757
|
+
|
|
13758
|
+
const referralCode = storage.get('referralCode');
|
|
13741
13759
|
const messages = {
|
|
13742
13760
|
url: window.location.href,
|
|
13743
|
-
|
|
13761
|
+
channelOrders: [
|
|
13744
13762
|
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
13745
13763
|
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
13746
13764
|
{ channel: channel, subchannel: subchannel },
|
|
13747
13765
|
],
|
|
13766
|
+
referralCode
|
|
13748
13767
|
};
|
|
13749
13768
|
sentry.captureMessage(JSON.stringify(messages));
|
|
13750
13769
|
|
|
13770
|
+
const referralObj = {};
|
|
13771
|
+
if (referralCode) {
|
|
13772
|
+
referralObj.referralCode = referralCode;
|
|
13773
|
+
} else {
|
|
13774
|
+
referralObj.channel = storage.get('channel') || defaultChannel || channel,
|
|
13775
|
+
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel;
|
|
13776
|
+
}
|
|
13777
|
+
|
|
13751
13778
|
return await request.send(
|
|
13752
13779
|
auth$1.register({
|
|
13753
13780
|
...signUpData,
|
|
13754
|
-
|
|
13755
|
-
subchannel: storage.get('subchannel') || defaultSubchannel || subchannel,
|
|
13781
|
+
...referralObj,
|
|
13756
13782
|
dt,
|
|
13757
13783
|
reCaptchaToken: context.reCaptchaToken,
|
|
13758
13784
|
affiliate: context.affiliate
|