Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api for call status update #141

Draft
wants to merge 2 commits into
base: multiple-clients
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
},
"husky": {
"hooks": {
"pre-push": "npm run test:hook"
"pre-push": "npm run test:hook"
}
},
"devDependencies": {
"@types/event-emitter": "^0.3.2",
"@types/eventemitter3": "^2.0.2",
"@types/chai": "^4.1.2",
"@types/event-emitter": "^0.3.2",
"@types/eventemitter3": "^2.0.2",
"@types/chai": "^4.1.2",
"@types/mocha": "^2.2.48",
"@types/sinon": "^4.3.0",
"@types/ws": "^5.1.2",
Expand All @@ -64,8 +64,8 @@
"dotenv": "^5.0.1",
"husky": "^0.14.3",
"mocha": "^5.0.1",
"node-fetch": "^2.2.1",
"node-fetch-polyfill": "^2.0.6",
"node-fetch": "^2.2.1",
"node-fetch-polyfill": "^2.0.6",
"nyc": "^11.4.1",
"package-preview": "^1.0.5",
"rimraf": "^2.6.2",
Expand All @@ -81,7 +81,6 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {

"js-sha256": "^0.9.0",
"lru-cache": "^4.1.1",
"mem": "^4.0.0",
Expand Down
7 changes: 7 additions & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,13 @@ export interface INewLivechatOfflineMessageAPI {
message: string // Message text
}

export interface webrtcMessage {
callId: string
rid:string
status:string
user:string
}

/** Result structure for Livechat Offline Message */
export interface ILivechatOfflineMessageResultAPI {
message: string
Expand Down
2 changes: 2 additions & 0 deletions src/lib/api/Livechat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
INewLivechatNavigationAPI,
INewLivechatCustomFieldAPI,
INewLivechatOfflineMessageAPI,
webrtcMessage,
INewLivechatCustomFieldsAPI,
ILivechatRoom,
INewLivechatRoomCredentialAPI,
Expand Down Expand Up @@ -40,6 +41,7 @@ export default class ApiLivechat extends ApiBase {
}
async deleteVisitor () { return (await this.del(`livechat/visitor/${this.credentials.token}`)).visitor }
async updateVisitorStatus (status: string) { return (await this.post(`livechat/visitor.status`, { token: this.credentials.token, status })).status }
async updateCallStatus (callStatus: string, rid: string) { return (await this.post(`livechat/visitor.callStatus`, { token: this.credentials.token, callStatus, rid })).callStatus}
async nextAgent (department: string = '') { return (await this.get(`livechat/agent.next/${this.credentials.token}`, { department })).agent }
async agent ({ rid }: any) { return (await this.get(`livechat/agent.info/${rid}/${this.credentials.token}`)).agent }
async message (id: string, params: ILivechatRoom) { return (await this.get(`livechat/message/${id}`, { token: this.credentials.token, ...params })).message }
Expand Down