@koi-design/callkit 2.0.0-beta.1 → 2.0.0-beta.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/dist/index.d.ts +1 -1
- package/dist/index.global.js +14 -255
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import md5 from "blueimp-md5";
|
|
|
3
3
|
|
|
4
4
|
// package/axios.ts
|
|
5
5
|
import axios from "axios";
|
|
6
|
-
import axiosRetry from "axios-retry";
|
|
7
6
|
var instance = axios.create({
|
|
8
7
|
headers: {
|
|
9
8
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -14,23 +13,6 @@ instance.interceptors.response.use(
|
|
|
14
13
|
(response) => response.data,
|
|
15
14
|
(error) => Promise.reject(error)
|
|
16
15
|
);
|
|
17
|
-
axiosRetry(instance, {
|
|
18
|
-
retries: 3,
|
|
19
|
-
// Maximum number of retries, default is 3
|
|
20
|
-
retryDelay: (retryCount, error) => {
|
|
21
|
-
console.log(
|
|
22
|
-
`AJAX Retrying attempt ${retryCount}, error: ${error?.message}`
|
|
23
|
-
);
|
|
24
|
-
return retryCount * 1e3;
|
|
25
|
-
},
|
|
26
|
-
retryCondition: (error) => {
|
|
27
|
-
if (!error.response)
|
|
28
|
-
return true;
|
|
29
|
-
return error.response.status < 200 || error.response.status >= 300;
|
|
30
|
-
},
|
|
31
|
-
shouldResetTimeout: true
|
|
32
|
-
// Whether to reset axios timeout on retry
|
|
33
|
-
});
|
|
34
16
|
var request = (config) => instance.request(config);
|
|
35
17
|
var axios_default = request;
|
|
36
18
|
|
|
@@ -2452,9 +2434,9 @@ var CallKit = class {
|
|
|
2452
2434
|
* set userstatus
|
|
2453
2435
|
* @param status
|
|
2454
2436
|
*/
|
|
2455
|
-
setUserStatus(status) {
|
|
2437
|
+
async setUserStatus(status) {
|
|
2456
2438
|
const { agentId } = this.config.getConfig().userInfo;
|
|
2457
|
-
this.api.updateUserStatus({
|
|
2439
|
+
await this.api.updateUserStatus({
|
|
2458
2440
|
agentId,
|
|
2459
2441
|
status
|
|
2460
2442
|
});
|