@wizai/agent-sip-sdk 0.1.6-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 +7 -1
- package/lib/types/types.d.ts +2 -0
- 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;
|
|
@@ -11,6 +11,9 @@ declare class AgentSipSDK {
|
|
|
11
11
|
private agentResponseTime;
|
|
12
12
|
private timer;
|
|
13
13
|
private callDetails;
|
|
14
|
+
private unloadingHandled;
|
|
15
|
+
private baseUrl;
|
|
16
|
+
private autoFinishACWTimer;
|
|
14
17
|
constructor(props: IAgentSipSDKOptions);
|
|
15
18
|
private init;
|
|
16
19
|
getAgentStatusList(): Promise<IGetAgentStatusList>;
|
|
@@ -19,11 +22,13 @@ declare class AgentSipSDK {
|
|
|
19
22
|
private processSSEMessage;
|
|
20
23
|
private resetSSE;
|
|
21
24
|
private createSSEAndOpensips;
|
|
25
|
+
private waitSIPRegistered;
|
|
22
26
|
getAgentStatus(): Promise<IGetAgentStatus>;
|
|
23
27
|
private onlineAgent;
|
|
24
28
|
private offlineAgent;
|
|
25
29
|
switchAgentStatus(data: IAgentStatusParams): Promise<ISwitchAgentStatus>;
|
|
26
30
|
outboundCall(phoneNumber: string): Promise<IOutboundCall>;
|
|
31
|
+
private autoFinishACW;
|
|
27
32
|
finshACW(): Promise<{
|
|
28
33
|
code: ECode;
|
|
29
34
|
data: null;
|
|
@@ -33,6 +38,7 @@ declare class AgentSipSDK {
|
|
|
33
38
|
private sessionFailed;
|
|
34
39
|
private openOnunload;
|
|
35
40
|
private cancelOnunload;
|
|
41
|
+
private doForceOfflineCleanup;
|
|
36
42
|
private saveAgentResponseTime;
|
|
37
43
|
hangup(): void;
|
|
38
44
|
private timingResTime;
|
package/lib/types/types.d.ts
CHANGED
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
|
+
}
|