@jetthai/cuora 1.0.37 → 1.0.39

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,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.0.39](https://github.com/jetthai/cuora-module/compare/v1.0.38...v1.0.39) (2021-11-09)
6
+
7
+ ### [1.0.38](https://github.com/jetthai/cuora-module/compare/v1.0.37...v1.0.38) (2021-11-05)
8
+
5
9
  ### [1.0.37](https://github.com/jetthai/cuora-module/compare/v1.0.36...v1.0.37) (2021-11-03)
6
10
 
7
11
  ### [1.0.36](https://github.com/jetthai/cuora-module/compare/v1.0.35...v1.0.36) (2021-10-29)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import api from './api'
2
2
  import machine from './machine'
3
3
  import Request from './request/request'
4
- import Cookie from './request/cookie'
5
4
  import Config from './request/config'
6
- export { api, machine, Request, Cookie, Config }
5
+ export { api, machine, Request, Config }
@@ -24,7 +24,7 @@ export default function (request) {
24
24
  },
25
25
  paymentMethods: {},
26
26
  },
27
- ua: '',
27
+ userAgent: '',
28
28
  isMobile: false,
29
29
  announcementList: null,
30
30
  broadcastList: null,
@@ -130,10 +130,10 @@ export default function (request) {
130
130
  }),
131
131
  setUA: assign((context, event) => {
132
132
  const parser = new UAParser()
133
- const ua = parser.getResult()
133
+ const userAgent = parser.getResult()
134
134
  return {
135
- ua,
136
- isMobile: ua?.device?.type,
135
+ userAgent,
136
+ isMobile: userAgent?.device?.type,
137
137
  }
138
138
  }),
139
139
  setFeeds: assign((context, event) => {
@@ -1,15 +1,16 @@
1
1
  import pickBy from 'lodash/pickBy'
2
+ import Cookie from './cookie'
2
3
 
3
4
  function isValid(value) {
4
5
  return value !== undefined && value !== null
5
6
  }
6
7
 
7
8
  export default class Request {
8
- constructor(axios, config, cookie) {
9
+ constructor(axios, config) {
9
10
  this.axios = axios
10
11
  this.source = axios.CancelToken.source()
11
12
  this.config = config
12
- this.cookie = cookie
13
+ this.cookie = new Cookie(`cuora_${config.clientId}`)
13
14
  this.errorHandler = null
14
15
  this.initialize()
15
16
  }