@jetthai/cuora 1.1.51 → 1.1.53
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 +22 -6
- package/package.json +1 -1
- package/src/machine/activity/activity.js +5 -0
- package/src/machine/auth_otp_v2.js +10 -4
- package/src/machine/auth_otp_v3.js +7 -2
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.53](https://github.com/jetthai/cuora-module/compare/v1.1.51...v1.1.53) (2023-02-24)
|
|
6
|
+
|
|
7
|
+
### [1.1.52](https://github.com/jetthai/cuora-module/compare/v1.1.51...v1.1.52) (2023-02-23)
|
|
8
|
+
|
|
5
9
|
### [1.1.51](https://github.com/jetthai/cuora-module/compare/v1.1.48-1...v1.1.51) (2023-02-17)
|
|
6
10
|
|
|
7
11
|
### [1.1.50](https://github.com/jetthai/cuora-module/compare/v1.1.49...v1.1.50) (2023-02-16)
|
package/dist/bundle.mjs
CHANGED
|
@@ -9101,6 +9101,11 @@ function activity$1 (request) {
|
|
|
9101
9101
|
actions: 'setUnread',
|
|
9102
9102
|
},
|
|
9103
9103
|
},
|
|
9104
|
+
on: {
|
|
9105
|
+
REFRESH: {
|
|
9106
|
+
target: '#activity.fetchingActivityList',
|
|
9107
|
+
},
|
|
9108
|
+
},
|
|
9104
9109
|
},
|
|
9105
9110
|
},
|
|
9106
9111
|
},
|
|
@@ -20812,10 +20817,16 @@ function auth_otp_v2 (request) {
|
|
|
20812
20817
|
otpFetching: {
|
|
20813
20818
|
invoke: {
|
|
20814
20819
|
src: 'sendOtp',
|
|
20815
|
-
onDone:
|
|
20816
|
-
|
|
20817
|
-
|
|
20818
|
-
|
|
20820
|
+
onDone: [
|
|
20821
|
+
{
|
|
20822
|
+
target: 'acknowledged',
|
|
20823
|
+
cond: (context, event) => event.data.status === 'success-verified',
|
|
20824
|
+
},
|
|
20825
|
+
{
|
|
20826
|
+
target: 'otp',
|
|
20827
|
+
actions: 'setOtpResult',
|
|
20828
|
+
},
|
|
20829
|
+
],
|
|
20819
20830
|
onError: {
|
|
20820
20831
|
target: 'idle',
|
|
20821
20832
|
},
|
|
@@ -20962,6 +20973,7 @@ function auth_otp_v3 (request) {
|
|
|
20962
20973
|
email: null,
|
|
20963
20974
|
target: null,
|
|
20964
20975
|
requestId: null,
|
|
20976
|
+
status: null,
|
|
20965
20977
|
ttl: 0,
|
|
20966
20978
|
},
|
|
20967
20979
|
states: {
|
|
@@ -21061,7 +21073,7 @@ function auth_otp_v3 (request) {
|
|
|
21061
21073
|
},
|
|
21062
21074
|
},
|
|
21063
21075
|
verification: {
|
|
21064
|
-
|
|
21076
|
+
always: [{ target: '#auth_otp.verified', cond: 'isAutoVerified' }, { target: '.idle' }],
|
|
21065
21077
|
states: {
|
|
21066
21078
|
idle: {
|
|
21067
21079
|
on: {
|
|
@@ -21120,11 +21132,12 @@ function auth_otp_v3 (request) {
|
|
|
21120
21132
|
}
|
|
21121
21133
|
}),
|
|
21122
21134
|
setVerificationData: assign((context, event) => {
|
|
21123
|
-
const { requestId, ttl, target } = event.data;
|
|
21135
|
+
const { requestId, ttl, target, status } = event.data;
|
|
21124
21136
|
return {
|
|
21125
21137
|
requestId,
|
|
21126
21138
|
ttl: ttl * 1000,
|
|
21127
21139
|
target,
|
|
21140
|
+
status,
|
|
21128
21141
|
}
|
|
21129
21142
|
}),
|
|
21130
21143
|
decreaseTtl: assign((context, evnet) => {
|
|
@@ -21171,6 +21184,9 @@ function auth_otp_v3 (request) {
|
|
|
21171
21184
|
const { error } = context;
|
|
21172
21185
|
return error.code === 'ERR_F106'
|
|
21173
21186
|
},
|
|
21187
|
+
isAutoVerified: (context, event) => {
|
|
21188
|
+
return context.status === 'success-verified'
|
|
21189
|
+
},
|
|
21174
21190
|
},
|
|
21175
21191
|
services: {
|
|
21176
21192
|
fetchUserInfo: async (context, event) => {
|
package/package.json
CHANGED
|
@@ -34,10 +34,16 @@ export default function (request) {
|
|
|
34
34
|
otpFetching: {
|
|
35
35
|
invoke: {
|
|
36
36
|
src: 'sendOtp',
|
|
37
|
-
onDone:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
onDone: [
|
|
38
|
+
{
|
|
39
|
+
target: 'acknowledged',
|
|
40
|
+
cond: (context, event) => event.data.status === 'success-verified',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
target: 'otp',
|
|
44
|
+
actions: 'setOtpResult',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
41
47
|
onError: {
|
|
42
48
|
target: 'idle',
|
|
43
49
|
},
|
|
@@ -16,6 +16,7 @@ export default function (request) {
|
|
|
16
16
|
email: null,
|
|
17
17
|
target: null,
|
|
18
18
|
requestId: null,
|
|
19
|
+
status: null,
|
|
19
20
|
ttl: 0,
|
|
20
21
|
},
|
|
21
22
|
states: {
|
|
@@ -115,7 +116,7 @@ export default function (request) {
|
|
|
115
116
|
},
|
|
116
117
|
},
|
|
117
118
|
verification: {
|
|
118
|
-
|
|
119
|
+
always: [{ target: '#auth_otp.verified', cond: 'isAutoVerified' }, { target: '.idle' }],
|
|
119
120
|
states: {
|
|
120
121
|
idle: {
|
|
121
122
|
on: {
|
|
@@ -174,11 +175,12 @@ export default function (request) {
|
|
|
174
175
|
}
|
|
175
176
|
}),
|
|
176
177
|
setVerificationData: assign((context, event) => {
|
|
177
|
-
const { requestId, ttl, target } = event.data
|
|
178
|
+
const { requestId, ttl, target, status } = event.data
|
|
178
179
|
return {
|
|
179
180
|
requestId,
|
|
180
181
|
ttl: ttl * 1000,
|
|
181
182
|
target,
|
|
183
|
+
status,
|
|
182
184
|
}
|
|
183
185
|
}),
|
|
184
186
|
decreaseTtl: assign((context, evnet) => {
|
|
@@ -225,6 +227,9 @@ export default function (request) {
|
|
|
225
227
|
const { error } = context
|
|
226
228
|
return error.code === 'ERR_F106'
|
|
227
229
|
},
|
|
230
|
+
isAutoVerified: (context, event) => {
|
|
231
|
+
return context.status === 'success-verified'
|
|
232
|
+
},
|
|
228
233
|
},
|
|
229
234
|
services: {
|
|
230
235
|
fetchUserInfo: async (context, event) => {
|