Skip to content

Commit e98d32e

Browse files
committed
v1.0.6
1 parent a072bab commit e98d32e

File tree

5 files changed

+121
-95
lines changed

5 files changed

+121
-95
lines changed

CHANGELOG.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
## Change Log
22

3+
### v1.0.6(May 13, 2019)
4+
* Added `reopen()` in `Ticket`
5+
* Added `groupKey` and `customField` parameters to `Ticket.create()`.
6+
* Added `customFieldFilter` parameter to `getOpenedList()` and `getClosedList()` in `Ticket`.
7+
38
### v1.0.5(Nov 23, 2018)
4-
* added SendBird parameter to SendBirdDesk.init().
5-
* bug-fix in 'SendBird missing' error at init().
9+
* Added SendBird parameter to SendBirdDesk.init().
10+
* Bug-fix in 'SendBird missing' error at init().
611

712
### v1.0.4(July 18, 2018)
8-
* added setApiHost to customize host.
13+
* Added setApiHost to customize host.
914

1015
### v1.0.3(July 4, 2018)
11-
* corrected package.json to fix library path.
16+
* Corrected package.json to fix library path.
1217

1318
### v1.0.2(May 21, 2018)
14-
* applied ticket assignment update.
19+
* Applied ticket assignment update.
1520

1621
### v1.0.1(Mar 30, 2018)
17-
* added SendBirdDesk.init().
18-
* added SendBirdDesk.isDeskChannel(channel).
19-
* added TypeScript interface - SendBird.Desk.d.ts.
20-
* added console logger in debug mode.
22+
* Added SendBirdDesk.init().
23+
* Added SendBirdDesk.isDeskChannel(channel).
24+
* Added TypeScript interface - SendBird.Desk.d.ts.
25+
* Added console logger in debug mode.
2126

2227
### v1.0.0-zendesk(Mar 16, 2018)
2328
* Zendesk-integrated version release.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Now your customers are ready to create tickets and start inquiry with your agent
5252

5353
Creating a new ticket is as simple as calling `Ticket.create()`. Once you create the ticket, you can access to created ticket and channel in callback. Channel object can be found at `ticket.channel` so that you can send messages to the channel. For more information in sending messages to channel, see [SendBird SDK guide docs](https://docs.sendbird.com/android#group_channel_3_sending_messages).
5454

55-
> Notice that the ticket could be assigned to the agents only when customer sends at least one message to the ticket. Otherwise, agent cannot see the ticket.
55+
> Note: Notice that the ticket could be assigned to the agents only when customer sends at least one message to the ticket. Otherwise, agent cannot see the ticket.
5656
5757
```js
5858
Ticket.create(ticketTitle, userName, (ticket, err) =>
@@ -61,6 +61,8 @@ Ticket.create(ticketTitle, userName, (ticket, err) =>
6161
});
6262
```
6363

64+
> Note: `Ticket.create()` has 2 more parameters `groupKey` and `customField`. The values could be evaluated when a ticket is created though it's used only in Dashboard currently. `groupKey` is the key of an agent group so that the ticket is assigned to the agents in that group. `customField` holds customizable data for the individual ticket.
65+
6466
## Count of opened tickets
6567
When you need to display opened ticket count in your application, use `Ticket.getOpenCount()`.
6668
```js
@@ -88,6 +90,8 @@ Ticket.getClosedList(offset, (res, err) => {
8890
});
8991
```
9092

93+
> Note: Once you set `customField` to tickets, you can put `customFieldFilter` to `getOpenedList()` and `getClosedList()` in order to filter the tickets by `customField` values.
94+
9195
## Handling ticket event
9296
SendBird Desk SDK uses predefined AdminMessage custom type which can be derived by calling `message.customType`. Custom type for Desk AdminMessage is set to `SENDBIRD_DESK_ADMIN_MESSAGE_CUSTOM_TYPE`. And there are sub-types which indicate ticket events: assign, transfer, and close. Each event type is located in `message.data` which looks like below.
9397

SendBird.Desk.d.ts

Lines changed: 93 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,104 @@
11
/**
2-
* Type Definitions for SendBird Desc SDK v1.0.5
2+
* Type Definitions for SendBird Desc SDK v1.0.6
33
* homepage: https://sendbird.com/
44
*/
5-
declare const SendBirdDesk: SendBirdDeskStatic;
65
export = SendBirdDesk;
6+
export as namespace SendBirdDesk;
77

8-
interface GroupChannel {
9-
url: String;
10-
name: String;
11-
customType: String;
12-
}
13-
type Callback = (res: Object, error: Error) => void;
14-
type TicketCallback = (ticket: TicketInstance, error: Error) => void;
15-
type TicketArrayCallback = (list: Array<TicketInstance>, error: Error) => void;
8+
declare const SendBirdDesk: SendBirdDeskStatic;
169

1710
interface SendBirdDeskStatic {
1811
version: String;
19-
Agent: AgentStatic;
20-
Ticket: TicketStatic;
21-
Message: MessageStatic;
22-
Error: SendBirdDeskErrorStatic;
12+
Agent: SendBirdDesk.AgentStatic;
13+
Ticket: SendBirdDesk.TicketStatic;
14+
Message: SendBirdDesk.MessageStatic;
15+
Error: SendBirdDesk.SendBirdDeskErrorStatic;
2316

24-
init(SendBird: Object);
25-
authenticate(userId: String, callback: Callback);
26-
authenticate(userId: String, accessToken: String, callback: Callback);
27-
isDeskChannel(channel: GroupChannel): Boolean;
28-
setDebugMode();
29-
}
30-
interface AgentStatic {
31-
new (json: Object): AgentInstance;
32-
}
33-
interface AgentInstance {
34-
userId: String;
35-
name: String;
36-
profileUrl: String;
37-
fetchFromJSON(json: Object);
38-
}
39-
interface TicketStatic {
40-
Status: TicketStatus;
41-
isStatus(val: String): Boolean;
42-
clearCache(channelUrl: String);
43-
create(title: String, name: String, callback: TicketCallback);
44-
getOpenCount(callback: Callback);
45-
getByChannelUrl(channelUrl: String, callback: TicketCallback);
46-
getOpenedList(offset: Number, callback: TicketArrayCallback);
47-
getClosedList(offset: Number, callback: TicketArrayCallback);
48-
getUrlPreview(url: String, callback: Callback);
49-
confirmEndOfChat(message: Object, confirmYN: String, callback: Callback);
50-
new (json: Object): TicketInstance;
51-
}
52-
type TicketStatus = {
53-
INITIALIZED: String;
54-
UNASSIGNED: String;
55-
ASSIGNED: String;
56-
OPEN: String;
57-
CLOSED: String;
17+
init(SendBird: Object): void;
18+
authenticate(userId: String, callback: SendBirdDesk.Callback): void;
19+
authenticate(userId: String, accessToken: String, callback: SendBirdDesk.Callback): void;
20+
isDeskChannel(channel: SendBirdDesk.GroupChannel): Boolean;
21+
setDebugMode(): void;
5822
}
59-
interface TicketInstance {
60-
id: String;
61-
title: String;
62-
status: TicketStatus;
63-
info: Object;
64-
agent: AgentInstance;
65-
customer: Object;
66-
channel: Object;
67-
channelUrl: String;
68-
updatedAt: Number;
69-
fetchFromJSON(json: Object);
70-
refresh(callback: TicketCallback);
71-
}
72-
type MessageStatic = {
73-
CustomType: MessageCustomType;
74-
DataType: MessageDataType;
75-
ClosureState : MessageClosureState;
76-
}
77-
type MessageCustomType = {
78-
RICH_MESSAGE: String;
79-
ADMIN_MESSAGE: String;
80-
}
81-
type MessageDataType = {
82-
TICKET_INQUIRE_CLOSURE: String;
83-
TICKET_ASSIGN: String;
84-
TICKET_TRANSFER: String;
85-
TICKET_CLOSE: String;
86-
URL_PREVIEW: String;
87-
}
88-
type MessageClosureState = {
89-
WAITING: String;
90-
CONFIRMED: String;
91-
DECLINED: String;
23+
24+
declare namespace SendBirdDesk {
25+
interface GroupChannel {
26+
url: String;
27+
name: String;
28+
customType: String;
29+
}
30+
type Callback = (res: Object, error: Error) => void;
31+
type TicketCallback = (ticket: TicketInstance, error: Error) => void;
32+
type TicketArrayCallback = (list: Array<TicketInstance>, error: Error) => void;
33+
34+
35+
interface AgentStatic {
36+
new (json: Object): AgentInstance;
37+
}
38+
interface AgentInstance {
39+
userId: String;
40+
name: String;
41+
profileUrl: String;
42+
fetchFromJSON(json: Object): void;
43+
}
44+
interface TicketStatic {
45+
Status: TicketStatus;
46+
isStatus(val: String): Boolean;
47+
clearCache(channelUrl: String): void;
48+
create(title: String, name: String, callback: TicketCallback): void;
49+
create(title: String, name: String, groupKey: String, customField: Object, callback: TicketCallback): void;
50+
getOpenCount(callback: Callback): void;
51+
getByChannelUrl(channelUrl: String, callback: TicketCallback): void;
52+
getOpenedList(offset: Number, callback: TicketArrayCallback): void;
53+
getOpenedList(offset: Number, customFieldFilter: Object, callback: TicketArrayCallback): void;
54+
getClosedList(offset: Number, callback: TicketArrayCallback): void;
55+
getClosedList(offset: Number, customFieldFilter: Object, callback: TicketArrayCallback): void;
56+
getUrlPreview(url: String, callback: Callback): void;
57+
confirmEndOfChat(message: Object, confirmYN: String, callback: Callback): void;
58+
new (json: Object): TicketInstance;
59+
}
60+
type TicketStatus = {
61+
INITIALIZED: String;
62+
UNASSIGNED: String;
63+
ASSIGNED: String;
64+
OPEN: String;
65+
CLOSED: String;
66+
}
67+
interface TicketInstance {
68+
id: String;
69+
title: String;
70+
status: TicketStatus;
71+
info: Object;
72+
agent: AgentInstance;
73+
customer: Object;
74+
channel: Object;
75+
channelUrl: String;
76+
updatedAt: Number;
77+
fetchFromJSON(json: Object): void;
78+
refresh(callback: TicketCallback): void;
79+
reopen(callback: TicketCallback): void;
80+
}
81+
type MessageStatic = {
82+
CustomType: MessageCustomType;
83+
DataType: MessageDataType;
84+
ClosureState : MessageClosureState;
85+
}
86+
type MessageCustomType = {
87+
RICH_MESSAGE: String;
88+
ADMIN_MESSAGE: String;
89+
}
90+
type MessageDataType = {
91+
TICKET_INQUIRE_CLOSURE: String;
92+
TICKET_ASSIGN: String;
93+
TICKET_TRANSFER: String;
94+
TICKET_CLOSE: String;
95+
URL_PREVIEW: String;
96+
}
97+
type MessageClosureState = {
98+
WAITING: String;
99+
CONFIRMED: String;
100+
DECLINED: String;
101+
}
102+
interface SendBirdDeskErrorStatic {}
92103
}
93-
interface SendBirdDeskErrorStatic {}
104+

SendBird.Desk.min.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sendbird-desk",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "SendBird Desk SDK Integration Guide for JavaScript =========== SendBird Desk is a chat customer service platform built on SendBird SDK and API.",
55
"main": "SendBird.Desk.min.js",
66
"scripts": {

0 commit comments

Comments
 (0)