@wizai/agent-sip-sdk 0.1.7-alpha → 0.1.8-alpha
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/README.md +241 -241
- package/lib/agent-sip-sdk-cjs.js +2 -2
- package/lib/agent-sip-sdk-es.js +2 -2
- package/lib/agent-sip-sdk-umd.js +2 -2
- package/lib/types/api/index.d.ts +2 -1
- package/lib/types/api/types.d.ts +8 -0
- package/lib/types/index.d.ts +4 -3
- package/lib/types/types.d.ts +0 -4
- package/package.json +54 -53
package/lib/types/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IApiProps, IRespones, IAgentStatusListResponse, IAgentStatusResponse, IGetAgentSettingParams, IGetAgentSettingResponse, IUpdateAgentTicketParams, IRegisterSSEParams, ICloseSSEParams, ISwitchAgentStatusParams, IOutboundCallParams, IOutboundCallResponse, IAgentResponseTimeParams, IGetCallTaskInfoParams, IGetCallTaskInfoResponse, ISendBeaconParams } from './types';
|
|
1
|
+
import type { IApiProps, IRespones, IAgentStatusListResponse, IAgentStatusResponse, IGetAgentSettingParams, IGetAgentSettingResponse, IUpdateAgentTicketParams, IRegisterSSEParams, ICloseSSEParams, ISwitchAgentStatusParams, IOutboundCallParams, IOutboundCallResponse, IAgentResponseTimeParams, IAgentAbnormalCloseParams, IGetCallTaskInfoParams, IGetCallTaskInfoResponse, ISendBeaconParams } from './types';
|
|
2
2
|
import { EApiCode } from '../enums/common';
|
|
3
3
|
declare class Api {
|
|
4
4
|
private baseUrl;
|
|
@@ -31,6 +31,7 @@ declare class Api {
|
|
|
31
31
|
getCallTaskInfo(data: IGetCallTaskInfoParams): Promise<IGetCallTaskInfoResponse>;
|
|
32
32
|
getAfterCallProcessTime(data: IGetCallTaskInfoParams): Promise<IRespones<number>>;
|
|
33
33
|
formatFormData<T = Record<string, any>>(params: T): FormData;
|
|
34
|
+
agentAbnormalClose(params: IAgentAbnormalCloseParams): Promise<IRespones<any>>;
|
|
34
35
|
sendBeacon<T extends ISendBeaconParams>(params: T): void;
|
|
35
36
|
clearnSendBeaconQueue(): Promise<void>;
|
|
36
37
|
/**
|
package/lib/types/api/types.d.ts
CHANGED
|
@@ -110,6 +110,14 @@ export interface IAgentResponseTimeParams {
|
|
|
110
110
|
agentGroupId: number;
|
|
111
111
|
resultType: EAgentAction;
|
|
112
112
|
}
|
|
113
|
+
export interface IAgentAbnormalCloseParams {
|
|
114
|
+
id: number;
|
|
115
|
+
groupId: number;
|
|
116
|
+
trace: string;
|
|
117
|
+
createTime?: string;
|
|
118
|
+
sendTime?: string;
|
|
119
|
+
Authentication?: string;
|
|
120
|
+
}
|
|
113
121
|
export interface IGetCustomerInfoParams {
|
|
114
122
|
customerId: string;
|
|
115
123
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ECode } from './enums/common';
|
|
2
2
|
import type { IAnswerFnType, INewMessageFnType, ISessionType, ISessionEventListener } from './sip/types';
|
|
3
|
-
import
|
|
3
|
+
import { IAgentSipSDKOptions, IAgentStatusParams, IInitType, IInitFnType, IAgentType, IAgentFnType, IGetAgentStatus, IGetAgentStatusList, ISwitchAgentStatus, IOutboundCall } from './types';
|
|
4
4
|
declare class AgentSipSDK {
|
|
5
5
|
private sip;
|
|
6
6
|
private api;
|
|
@@ -12,8 +12,8 @@ declare class AgentSipSDK {
|
|
|
12
12
|
private timer;
|
|
13
13
|
private callDetails;
|
|
14
14
|
private unloadingHandled;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
15
|
+
private baseUrl;
|
|
16
|
+
private autoFinishACWTimer;
|
|
17
17
|
constructor(props: IAgentSipSDKOptions);
|
|
18
18
|
private init;
|
|
19
19
|
getAgentStatusList(): Promise<IGetAgentStatusList>;
|
|
@@ -28,6 +28,7 @@ declare class AgentSipSDK {
|
|
|
28
28
|
private offlineAgent;
|
|
29
29
|
switchAgentStatus(data: IAgentStatusParams): Promise<ISwitchAgentStatus>;
|
|
30
30
|
outboundCall(phoneNumber: string): Promise<IOutboundCall>;
|
|
31
|
+
private autoFinishACW;
|
|
31
32
|
finshACW(): Promise<{
|
|
32
33
|
code: ECode;
|
|
33
34
|
data: null;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { ECode } from './enums/common';
|
|
2
2
|
import { EAgentStatus } from './enums/agent';
|
|
3
3
|
import type { IAgentStatusListResponse, IOutboundCallResponse } from './api/types';
|
|
4
|
-
export declare class SDKError extends Error {
|
|
5
|
-
code: ECode;
|
|
6
|
-
constructor(code: ECode, message: string);
|
|
7
|
-
}
|
|
8
4
|
export interface IResponse<T = any> {
|
|
9
5
|
code: ECode;
|
|
10
6
|
data: T;
|
package/package.json
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wizai/agent-sip-sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Manages SIP clients and agent status, simplifying calls and events.",
|
|
5
|
-
"main": "lib/agent-sip-sdk-cjs.js",
|
|
6
|
-
"module": "lib/agent-sip-sdk-es.js",
|
|
7
|
-
"types": "lib/types/index.d.ts",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"files": [
|
|
10
|
-
"lib/"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "node test/index.js",
|
|
14
|
-
"jest": "jest",
|
|
15
|
-
"lint": "eslint --fix",
|
|
16
|
-
"build": "rollup -c"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"sip",
|
|
20
|
-
"agent",
|
|
21
|
-
"sdk"
|
|
22
|
-
],
|
|
23
|
-
"author": "Yuki Xie",
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@eslint/js": "^9.6.0",
|
|
27
|
-
"@rollup/plugin-alias": "^5.1.1",
|
|
28
|
-
"@rollup/plugin-commonjs": "^26.0.1",
|
|
29
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
30
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
31
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
32
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
33
|
-
"@rollup/plugin-url": "^8.0.2",
|
|
34
|
-
"@types/event-source-polyfill": "^1.0.5",
|
|
35
|
-
"@types/jest": "^29.5.12",
|
|
36
|
-
"@types/node": "^22.7.8",
|
|
37
|
-
"eslint": "^9.6.0",
|
|
38
|
-
"globals": "^15.8.0",
|
|
39
|
-
"jest": "^29.7.0",
|
|
40
|
-
"rollup": "^4.18.0",
|
|
41
|
-
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
42
|
-
"ts-jest": "^29.2.2",
|
|
43
|
-
"tslib": "^2.6.3",
|
|
44
|
-
"typescript": "^5.5.2",
|
|
45
|
-
"typescript-eslint": "^7.16.0"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wizai/agent-sip-sdk",
|
|
3
|
+
"version": "0.1.8-alpha",
|
|
4
|
+
"description": "Manages SIP clients and agent status, simplifying calls and events.",
|
|
5
|
+
"main": "lib/agent-sip-sdk-cjs.js",
|
|
6
|
+
"module": "lib/agent-sip-sdk-es.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"lib/"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "node test/index.js",
|
|
14
|
+
"jest": "jest",
|
|
15
|
+
"lint": "eslint --fix",
|
|
16
|
+
"build": "rollup -c"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"sip",
|
|
20
|
+
"agent",
|
|
21
|
+
"sdk"
|
|
22
|
+
],
|
|
23
|
+
"author": "Yuki Xie",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^9.6.0",
|
|
27
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
28
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
29
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
30
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
31
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
32
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
33
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
34
|
+
"@types/event-source-polyfill": "^1.0.5",
|
|
35
|
+
"@types/jest": "^29.5.12",
|
|
36
|
+
"@types/node": "^22.7.8",
|
|
37
|
+
"eslint": "^9.6.0",
|
|
38
|
+
"globals": "^15.8.0",
|
|
39
|
+
"jest": "^29.7.0",
|
|
40
|
+
"rollup": "^4.18.0",
|
|
41
|
+
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
42
|
+
"ts-jest": "^29.2.2",
|
|
43
|
+
"tslib": "^2.6.3",
|
|
44
|
+
"typescript": "^5.5.2",
|
|
45
|
+
"typescript-eslint": "^7.16.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@wizai/agent-sip-sdk": "^0.1.7-alpha",
|
|
49
|
+
"dayjs": "^1.11.18",
|
|
50
|
+
"event-source-polyfill": "^1.0.31",
|
|
51
|
+
"jssip": "^3.10.1",
|
|
52
|
+
"nanoid": "^5.0.8"
|
|
53
|
+
}
|
|
54
|
+
}
|