@wizai/agent-sip-sdk 0.1.16-alpha → 0.1.18
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 +5 -3
- package/lib/types/api/types.d.ts +6 -1
- package/lib/types/enums/agent.d.ts +4 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/sip/index.d.ts +2 -0
- package/package.json +53 -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, IAgentAbnormalCloseParams, 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, IReportPDSTimeline } from './types';
|
|
2
2
|
import { EApiCode } from '../enums/common';
|
|
3
3
|
declare class Api {
|
|
4
4
|
private baseUrl;
|
|
@@ -23,12 +23,15 @@ declare class Api {
|
|
|
23
23
|
getAgentSetting(params: IGetAgentSettingParams): Promise<IGetAgentSettingResponse>;
|
|
24
24
|
updateAgentHangup(agentId: number): Promise<IGetAgentSettingResponse>;
|
|
25
25
|
updateAgentTicket(data: IUpdateAgentTicketParams): Promise<IRespones<any>>;
|
|
26
|
-
sendSSEACK(agentId: number): Promise<
|
|
26
|
+
sendSSEACK(agentId: number): Promise<boolean>;
|
|
27
27
|
registerSSE(data: IRegisterSSEParams): Promise<unknown>;
|
|
28
|
+
closeClientSSE(): void;
|
|
28
29
|
closeSSE(data: ICloseSSEParams): Promise<IRespones<any> | undefined>;
|
|
30
|
+
sendHeartbeat(agentId: number): Promise<boolean>;
|
|
29
31
|
switchAgentStatus(data: ISwitchAgentStatusParams): Promise<IRespones<IAgentStatusResponse>>;
|
|
30
32
|
outboundCall(data: IOutboundCallParams): Promise<IRespones<IOutboundCallResponse>>;
|
|
31
33
|
saveAgentResponseTime(data: IAgentResponseTimeParams): Promise<IRespones<any>>;
|
|
34
|
+
reportPDSTimeline(data: IReportPDSTimeline): Promise<boolean>;
|
|
32
35
|
getCallTaskInfo(data: IGetCallTaskInfoParams): Promise<IGetCallTaskInfoResponse>;
|
|
33
36
|
getAfterCallProcessTime(data: IGetCallTaskInfoParams): Promise<IRespones<number>>;
|
|
34
37
|
formatFormData<T = Record<string, any>>(params: T): FormData;
|
|
@@ -46,6 +49,5 @@ declare class Api {
|
|
|
46
49
|
private request;
|
|
47
50
|
private executePeriodically;
|
|
48
51
|
static getInstance(options?: IApiProps): Api;
|
|
49
|
-
heartbeat(): Promise<IRespones<Boolean>>;
|
|
50
52
|
}
|
|
51
53
|
export default Api;
|
package/lib/types/api/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface IRequestOptionsType<T = any> {
|
|
|
9
9
|
export interface IApiProps {
|
|
10
10
|
id: string;
|
|
11
11
|
getSystemToken: () => Promise<string>;
|
|
12
|
-
resetSSE
|
|
12
|
+
resetSSE?: () => Promise<void>;
|
|
13
13
|
baseUrl?: string;
|
|
14
14
|
retryCount?: number;
|
|
15
15
|
}
|
|
@@ -150,4 +150,9 @@ export interface ISendBeaconParams {
|
|
|
150
150
|
Authentication?: string;
|
|
151
151
|
trace?: string;
|
|
152
152
|
}
|
|
153
|
+
export interface IReportPDSTimeline {
|
|
154
|
+
callId?: string;
|
|
155
|
+
eventType: number;
|
|
156
|
+
timestamp?: number;
|
|
157
|
+
}
|
|
153
158
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ declare class AgentSipSDK {
|
|
|
26
26
|
private getHostName;
|
|
27
27
|
private processSSEMessage;
|
|
28
28
|
private resetSSE;
|
|
29
|
-
private
|
|
30
|
-
private
|
|
29
|
+
private createOpensips;
|
|
30
|
+
private closeSip;
|
|
31
31
|
private waitSIPRegistered;
|
|
32
32
|
private getAgentInfo;
|
|
33
33
|
getAgentStatus(): Promise<IGetAgentStatus>;
|
|
@@ -52,6 +52,7 @@ declare class AgentSipSDK {
|
|
|
52
52
|
private saveAgentResponseTime;
|
|
53
53
|
hangup(): void;
|
|
54
54
|
private timingResTime;
|
|
55
|
+
private trackIncomingCall;
|
|
55
56
|
private incomingCall;
|
|
56
57
|
answer(): void;
|
|
57
58
|
ignore(): void;
|
package/lib/types/sip/index.d.ts
CHANGED
|
@@ -19,9 +19,11 @@ declare class SIP {
|
|
|
19
19
|
private callDetails;
|
|
20
20
|
private cancelCallId;
|
|
21
21
|
private readonly incomingCallCallback;
|
|
22
|
+
private readonly trackIncomingCallCallback?;
|
|
22
23
|
private readonly getMediaStream;
|
|
23
24
|
constructor(props: {
|
|
24
25
|
incomingCallCallback: (_e: IncomingRTCSessionEvent) => Promise<IAnswerEventPayload>;
|
|
26
|
+
trackIncomingCallCallback?: (_callId: string) => void | undefined;
|
|
25
27
|
getMediaStream?: () => Promise<MediaStream>;
|
|
26
28
|
});
|
|
27
29
|
/**
|
package/package.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
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
|
-
"dayjs": "^1.11.18",
|
|
49
|
-
"event-source-polyfill": "^1.0.31",
|
|
50
|
-
"jssip": "^3.10.1",
|
|
51
|
-
"nanoid": "^5.0.8"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wizai/agent-sip-sdk",
|
|
3
|
+
"version": "0.1.18",
|
|
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
|
+
"dayjs": "^1.11.18",
|
|
49
|
+
"event-source-polyfill": "^1.0.31",
|
|
50
|
+
"jssip": "^3.10.1",
|
|
51
|
+
"nanoid": "^5.0.8"
|
|
52
|
+
}
|
|
53
|
+
}
|