Skip to content

Commit fa480f5

Browse files
committed
v1.0.1
1 parent 05b970c commit fa480f5

File tree

5 files changed

+102
-1
lines changed

5 files changed

+102
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
## Change Log
22

3+
### v1.0.1(Mar 30, 2018)
4+
* add SendBirdDesk.init().
5+
* add SendBirdDesk.isDeskChannel(channel).
6+
* add TypeScript interface - SendBird.Desk.d.ts.
7+
* add console logger in debug mode.
8+
39
### v1.0.0-zendesk(Mar 16, 2018)
410
* Zendesk-integrated version release.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Authentication in SendBird Desk is done by calling `SendBirdDesk.authenticate()`
3838
const sb = new SendBird({ appId : 'YOUR_APP_ID' });
3939
sb.connect(userId, accessToken, (res, err) => {
4040
if(err) throw err;
41+
SendBirdDesk.init();
4142
SendBirdDesk.authenticate(userId, accessToken, (res, err) => {
4243
if(err) throw err;
4344
// Now you can use Desk SDK later on

sdk/1.0.0/SendBird.Desk-1.0.0-zendesk.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

sdk/SendBird.Desk.d.ts

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/**
2+
* Type Definitions for SendBird Desc SDK v1.0.1
3+
* homepage: https://sendbird.com/
4+
*/
5+
declare const SendBirdDesk: SendBirdDeskStatic;
6+
export = SendBirdDesk;
7+
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;
16+
17+
interface SendBirdDeskStatic {
18+
version: String;
19+
Agent: AgentStatic;
20+
Ticket: TicketStatic;
21+
Message: MessageStatic;
22+
Error: SendBirdDeskErrorStatic;
23+
24+
init();
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;
58+
}
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;
92+
}
93+
interface SendBirdDeskErrorStatic {}

sdk/SendBird.Desk.min.js

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

0 commit comments

Comments
 (0)