Skip to content

Commit 08eb600

Browse files
committed
0.6.10
1 parent d98b02f commit 08eb600

File tree

7 files changed

+168
-9
lines changed

7 files changed

+168
-9
lines changed

CHANGELOG.md

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

3+
### 0.6.10 (Jan 31, 2020)
4+
* Added Typescript Definition.
5+
* Polished error description.
6+
* Properties / Method deprecated. Deprecated interfaces might be removed in future releases.
7+
* `DirectCall.onRemoteAudioEnabled` is deprecated. Use `onRemoteAudioSettingsChanged` Instead.
8+
* `DirectCall.mute` is deprecated. Use `muteMicrophone` Instead.
9+
* `DirectCall.unmute` is deprecated. Use `unmuteMicrophone` Instead.
10+
* Min / max of the `limit` field for `SendBirdCall.createDirectCallLogListQuery` parameter has been adjusted to 10 / 100 each.
11+
* `DirectCall.onRemoteAudioSettingsChanged / onRemoteAudioEnabled` is not fired anymore when actual setting is not changed.
12+
13+
314
### 0.6.6 (Jan 22, 2020)
415
* Call is automatically disconnected after certain time (currently 1 min) when one peer leaves call session without explicitly hanging up.
516
* Removed redundant deprecation warning in `callOption`.

SendBirdCall.min.d.ts

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/** 0.6.10 */
2+
3+
export as namespace SendBirdCall;
4+
5+
export function init(appId): void;
6+
export function authenticate(authOption: AuthOption, handler?: AuthHandler): Promise<User>;
7+
export function deauthenticate(): void;
8+
export function connectWebSocket(): Promise<void>;
9+
export function addListener(id: string, listener: SendBirdCallListener): void;
10+
export function removeListener(id: string): void;
11+
export function removeAllListeners(): void;
12+
export function dial(userId: string, isVideoCall: false, callOption: DirectCallOption, callback?: DialHandler): DirectCall;
13+
export function createDirectCallLogListQuery(params?: DirectCallLogListQueryParams): DirectCallLogListQuery;
14+
export function setLoggerLevel(level: LoggerLevel);
15+
export function getCall(callId: string): DirectCall;
16+
export const sdkVersion: string;
17+
export const appId: string;
18+
export const currentUser: User;
19+
20+
export enum LoggerLevel {
21+
NONE = 'NONE',
22+
ERROR = 'ERROR'
23+
}
24+
25+
export enum DirectCallUserRole {
26+
CALLER = 'dc_caller',
27+
CALLEE = 'dc_callee'
28+
}
29+
30+
export enum DirectCallEndResult {
31+
NO_ANSWER = 'no_answer',
32+
CANCELED = 'canceled',
33+
DECLINED = 'declined',
34+
OTHER_DEVICE_ACCEPTED = 'other_device_accepted',
35+
COMPLETED = 'completed',
36+
CONNECTION_LOST = 'connection_lost',
37+
TIMED_OUT = 'timed_out',
38+
FAILED_TO_DIAL = 'failed_to_dial',
39+
FAILED_TO_ACCEPT = 'failed_to_accept',
40+
UNKNOWN = 'unknown'
41+
}
42+
43+
export interface SendBirdCallListener {
44+
onRinging: ((directCall: DirectCall) => void) | null;
45+
}
46+
47+
export interface DirectCall {
48+
onEstablished: ((call: DirectCall) => void) | null;
49+
onConnected: ((call: DirectCall) => void) | null;
50+
51+
//deprecated
52+
onRemoteAudioEnabled: ((call: DirectCall) => void) | null;
53+
onRemoteAudioSettingsChanged: ((call: DirectCall) => void) | null;
54+
onEnded: ((call: DirectCall) => void) | null;
55+
56+
readonly caller: DirectCallUser;
57+
readonly callee: DirectCallUser;
58+
readonly isVideoCall: boolean;
59+
readonly localUser: DirectCallUser;
60+
readonly remoteUser: DirectCallUser;
61+
readonly isLocalAudioEnabled: boolean;
62+
readonly isRemoteAudioEnabled: boolean;
63+
readonly myRole: DirectCallUserRole;
64+
readonly endedBy: DirectCallUser;
65+
readonly endResult: DirectCallEndResult;
66+
67+
getDuration(): number;
68+
accept(callOptions: DirectCallOption): void;
69+
end(): void;
70+
71+
//deprecated
72+
mute(): void;
73+
74+
//deprecated
75+
unmute(): void;
76+
77+
muteMicrophone(): void;
78+
unmuteMicrophone(): void;
79+
}
80+
81+
export interface DirectCallOption {
82+
localMediaView?: HTMLAudioElement | HTMLVideoElement;
83+
remoteMediaView?: HTMLAudioElement | HTMLVideoElement;
84+
localVideoView?: HTMLAudioElement | HTMLVideoElement;
85+
remoteVideoView?: HTMLAudioElement | HTMLVideoElement;
86+
audioEnabled?: boolean;
87+
}
88+
89+
declare const DirectCallOption: {
90+
new(option: DirectCallOption): DirectCallOption;
91+
};
92+
93+
export interface DirectCallLogListQuery {
94+
next(callback?: DirectCallLogListQueryResultHandler): Promise<DirectCallLog[]>;
95+
readonly isLoading: boolean;
96+
readonly hasNext: boolean;
97+
}
98+
99+
export type DirectCallLogListQueryResultHandler = (callLogs?: DirectCallLog[], error?: Error) => void;
100+
101+
export interface DirectCallLog {
102+
readonly callId: string;
103+
readonly userRole: DirectCallUserRole;
104+
readonly startedAt: Date;
105+
readonly endedAt: Date;
106+
readonly endedBy: DirectCallUser;
107+
readonly duration: number;
108+
readonly endResult: DirectCallEndResult;
109+
readonly isVideoCall: boolean;
110+
}
111+
112+
export interface DirectCallUser {
113+
readonly userId: string;
114+
readonly nickname: string;
115+
readonly profileUrl: string;
116+
readonly metaData: object;
117+
readonly isActive: boolean;
118+
readonly role: DirectCallUserRole;
119+
}
120+
121+
export interface AuthOption {
122+
userId: string;
123+
accessToken?: string;
124+
}
125+
126+
export type AuthHandler = (user?: User, error?: Error) => void;
127+
export type DialHandler = (call?: DirectCall, error?: Error) => void;
128+
export type CompletionHandler = (error?: Error) => void;
129+
130+
export interface User {
131+
readonly userId: string;
132+
readonly nickname: string;
133+
readonly profileUrl: string;
134+
readonly metaData: string;
135+
readonly isActive: string;
136+
}
137+
138+
export interface DirectCallLogListQueryParams {
139+
myRole?: DirectCallUserRole;
140+
endResults?: DirectCallEndResult[];
141+
limit?: number;
142+
}

SendBirdCall.min.js

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

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sendbird-calls",
3-
"version": "0.6.6",
3+
"version": "0.6.10",
44
"authors": [
55
"SendBird <support@sendbird.com>"
66
],

hooks/pre-commit

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ PCK_VERSION=$(cat package.json | jq '.version')
55
LOCK_VERSION=$(cat package-lock.json | jq '.version')
66
BOWER_VERSION=$(cat bower.json | jq '.version')
77
SCRIPT_VERSION=\"$(sed -n 3p SendBirdCall.min.js | awk '{print $6}' | awk -F v '{print $2}')\"
8+
TYPESCRIPT_VERSION=$(sed -n 1p SendBirdCall.min.d.ts | awk '{print $2}')
89
SCRIPT_ENV=$(sed -n 3p SendBirdCall.min.js | awk '{print $7}')
910

10-
if [[ ! (($PCK_VERSION == $LOCK_VERSION) && ($PCK_VERSION == $SCRIPT_VERSION) && ($PCK_VERSION == $BOWER_VERSION)) ]]
11+
if [[ ! (($PCK_VERSION == $LOCK_VERSION) &&\
12+
($PCK_VERSION == $SCRIPT_VERSION) && \
13+
($PCK_VERSION == $BOWER_VERSION)) && \
14+
($PCK_VERSION == $TYPESCRIPT_VERSION)) && \
15+
]]
1116
then
1217
echo -e "\033[0;31m\
13-
Error: Version in package.json, package-lock.json, bower.json and SendBirdCall.min.js does not match\
18+
Error: Version in package.json, package-lock.json, bower.json, SendBirdCall.min.js and SendBirdCall.min.d.ts does not match\
1419
\033[0m"
1520

1621
exit 1

package-lock.json

Lines changed: 2 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "sendbird-calls",
3-
"version": "0.6.6",
3+
"version": "0.6.10",
44
"description": "SendBird Calls JavaScript SDK",
55
"main": "SendBirdCall.min.js",
6+
"types": "SendBirdCall.min.d.ts",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},
@@ -23,4 +24,4 @@
2324
"url": "https://github.com/sendbird/sendbird-calls-javascript/issues"
2425
},
2526
"homepage": "https://sendbird.com"
26-
}
27+
}

0 commit comments

Comments
 (0)