@ylink-sdk/meeting 0.1.7 → 0.1.11

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 ylink
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2021 ylink
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @ylink-sdk/meeting
2
-
3
- 通过@ylink-sdk/meeting,开发者可以快速实现加入yealink会议并进行相关会议会控操作
1
+ # @ylink-sdk/meeting
2
+
3
+ 通过@ylink-sdk/meeting,开发者可以快速实现加入yealink会议并进行相关会议会控操作
package/dist/index.d.ts CHANGED
@@ -1,161 +1,161 @@
1
- import { Ctrl } from './types/ctrl';
2
- import { ENDPOINT_TYPE, EVENT, CONNECTION_STATE, ROLE, ME_CHANGE, MEETING_CHANGE } from './types/enums';
3
- import { Data, ResultInfo, JobStatus, UserState } from './types/data';
4
- export declare type Handler<T = Record<any, any>> = (event: T[keyof T]) => void;
5
- export interface ParamsJoin {
6
- meetingNum: string;
7
- pwd?: string;
8
- displayName: string;
9
- endpointType: ENDPOINT_TYPE;
10
- inviteTransID?: string;
11
- groupIDs?: Array<string>;
12
- account?: string;
13
- userAgent?: string;
14
- groupName?: string;
15
- url?: string;
16
- mobileCode?: string;
17
- mobile?: string;
18
- regEmail?: string;
19
- accEmail?: string;
20
- tk?: string;
21
- }
22
- export interface MeetingConfig {
23
- /**
24
- * 服务器地址
25
- * @example
26
- * https://meetings.ylyun.com/control
27
- */
28
- baseURL: string;
29
- }
30
- /**
31
- * 亿联会议会控
32
- */
33
- export default class Meeting {
34
- /**
35
- * 终端类型
36
- */
37
- static ENDPOINT_TYPE: typeof ENDPOINT_TYPE;
38
- /**
39
- * 通知事件
40
- */
41
- static EVENT: typeof EVENT;
42
- /**
43
- * 会议连接状态
44
- */
45
- static CONNECTION_STATE: typeof CONNECTION_STATE;
46
- /**
47
- * 角色
48
- */
49
- static ROLE: typeof ROLE;
50
- /**
51
- * 自身信息变更
52
- */
53
- static ME_CHANGE: typeof ME_CHANGE;
54
- /**
55
- * 会议信息变更
56
- */
57
- static MEETING_CHANGE: typeof MEETING_CHANGE;
58
- /**
59
- * 初始化
60
- * @example
61
- * ```typescript
62
- * const meeting = new Meeting(config);
63
- * ```
64
- */
65
- constructor(config: MeetingConfig);
66
- /**
67
- * 获取会议会控交互功能
68
- * @since 1.0.0
69
- * @example
70
- * ```typescript
71
- * meeting.ctrl.audio({ sendOn: true, userID: 1 }); // 开启用户音频
72
- * ```
73
- */
74
- get ctrl(): Ctrl;
75
- /**
76
- * 获取当前会议会控实时数据
77
- * @since 1.0.0
78
- * @returns 会议会控数据
79
- * @example
80
- * ```typescript
81
- * meeting.data.me // 获取自身信息
82
- * meeting.data.meetingInfo // 获取会议信息
83
- * ```
84
- */
85
- get data(): Data;
86
- /**
87
- * 获取当前会议连接状态
88
- * @since 1.0.0
89
- */
90
- get connectionState(): CONNECTION_STATE;
91
- /**
92
- * 事件监听
93
- * @since 1.0.0
94
- * @param type 事件
95
- * @param handler 事件消息处理
96
- * @example
97
- * ```typescript
98
- * meeting.on('me-change', payload => {});
99
- * ```
100
- */
101
- on(type: EVENT, handler: Handler): void;
102
- /**
103
- * 移除事件监听
104
- * @param type 事件
105
- * @param handler 事件消息处理
106
- * @example
107
- * ```typescript
108
- * meeting.off('me-change'); // 将移除me-change所有的handler
109
- * const handler = payload => {};
110
- * meeting.off('me-change', handler); // 移除me-change对应的handler
111
- * ```
112
- */
113
- off(type: EVENT, handler?: Handler): void;
114
- /**
115
- * 获取配置的服务器地址
116
- * @since 1.0.0
117
- */
118
- getBaseURL(): string;
119
- /**
120
- * 设置服务器地址
121
- * @param url 服务器地址
122
- * @since 1.0.0
123
- */
124
- setBaseURL(url: string): void;
125
- /**
126
- * 获取轮询和保活状态
127
- * @since 1.0.0
128
- * @example
129
- * ```typescript
130
- * const jobStatus = meeting.getJobStatus();
131
- * console.log(jobStatus.polling, jobStatus.keepalive);
132
- * ```
133
- */
134
- getJobStatus(): Record<string, JobStatus>;
135
- /**
136
- * 加入会议
137
- * @since 1.0.0
138
- */
139
- join(params: ParamsJoin): Promise<void>;
140
- /**
141
- * 上报用户媒体信息,正常用于EVENT: UPDATE_USER_STATE事件触发时进行上报,当params未传时,将采用下面默认参数,有传值时,将进行覆盖
142
- *
143
- * |类型|deviceOn|sendOn|recvOn|
144
- * |-|-|-|-|
145
- * |audio|true|true|false|
146
- * |video|true|true|false|
147
- * |share|true|false|false|
148
- * @since 1.0.0
149
- */
150
- updateUserState(params?: UserState): Promise<void>;
151
- /**
152
- * 离开会议,params传值为空时,默认传递ResultInfo:bizCode为901359
153
- * @since 1.0.0
154
- */
155
- leave(params?: ResultInfo): Promise<boolean>;
156
- /**
157
- * 结束会议(需主持人权限)
158
- * @since 1.0.0
159
- */
160
- end(): Promise<boolean>;
161
- }
1
+ import { Ctrl } from './types/ctrl';
2
+ import { ENDPOINT_TYPE, EVENT, CONNECTION_STATE, ROLE, ME_CHANGE, MEETING_CHANGE } from './types/enums';
3
+ import { Data, ResultInfo, JobStatus, UserState } from './types/data';
4
+ export declare type Handler<T = Record<any, any>> = (event: T[keyof T]) => void;
5
+ export interface ParamsJoin {
6
+ meetingNum: string;
7
+ pwd?: string;
8
+ displayName: string;
9
+ endpointType: ENDPOINT_TYPE;
10
+ inviteTransID?: string;
11
+ groupIDs?: Array<string>;
12
+ account?: string;
13
+ userAgent?: string;
14
+ groupName?: string;
15
+ url?: string;
16
+ mobileCode?: string;
17
+ mobile?: string;
18
+ regEmail?: string;
19
+ accEmail?: string;
20
+ tk?: string;
21
+ }
22
+ export interface MeetingConfig {
23
+ /**
24
+ * 服务器地址
25
+ * @example
26
+ * https://meetings.ylyun.com/control
27
+ */
28
+ baseURL: string;
29
+ }
30
+ /**
31
+ * 亿联会议会控
32
+ */
33
+ export default class Meeting {
34
+ /**
35
+ * 终端类型
36
+ */
37
+ static ENDPOINT_TYPE: typeof ENDPOINT_TYPE;
38
+ /**
39
+ * 通知事件
40
+ */
41
+ static EVENT: typeof EVENT;
42
+ /**
43
+ * 会议连接状态
44
+ */
45
+ static CONNECTION_STATE: typeof CONNECTION_STATE;
46
+ /**
47
+ * 角色
48
+ */
49
+ static ROLE: typeof ROLE;
50
+ /**
51
+ * 自身信息变更
52
+ */
53
+ static ME_CHANGE: typeof ME_CHANGE;
54
+ /**
55
+ * 会议信息变更
56
+ */
57
+ static MEETING_CHANGE: typeof MEETING_CHANGE;
58
+ /**
59
+ * 初始化
60
+ * @example
61
+ * ```typescript
62
+ * const meeting = new Meeting(config);
63
+ * ```
64
+ */
65
+ constructor(config: MeetingConfig);
66
+ /**
67
+ * 获取会议会控交互功能
68
+ * @since 1.0.0
69
+ * @example
70
+ * ```typescript
71
+ * meeting.ctrl.audio({ sendOn: true, userID: 1 }); // 开启用户音频
72
+ * ```
73
+ */
74
+ get ctrl(): Ctrl;
75
+ /**
76
+ * 获取当前会议会控实时数据
77
+ * @since 1.0.0
78
+ * @returns 会议会控数据
79
+ * @example
80
+ * ```typescript
81
+ * meeting.data.me // 获取自身信息
82
+ * meeting.data.meetingInfo // 获取会议信息
83
+ * ```
84
+ */
85
+ get data(): Data;
86
+ /**
87
+ * 获取当前会议连接状态
88
+ * @since 1.0.0
89
+ */
90
+ get connectionState(): CONNECTION_STATE;
91
+ /**
92
+ * 事件监听
93
+ * @since 1.0.0
94
+ * @param type 事件
95
+ * @param handler 事件消息处理
96
+ * @example
97
+ * ```typescript
98
+ * meeting.on('me-change', payload => {});
99
+ * ```
100
+ */
101
+ on(type: EVENT, handler: Handler): void;
102
+ /**
103
+ * 移除事件监听
104
+ * @param type 事件
105
+ * @param handler 事件消息处理
106
+ * @example
107
+ * ```typescript
108
+ * meeting.off('me-change'); // 将移除me-change所有的handler
109
+ * const handler = payload => {};
110
+ * meeting.off('me-change', handler); // 移除me-change对应的handler
111
+ * ```
112
+ */
113
+ off(type: EVENT, handler?: Handler): void;
114
+ /**
115
+ * 获取配置的服务器地址
116
+ * @since 1.0.0
117
+ */
118
+ getBaseURL(): string;
119
+ /**
120
+ * 设置服务器地址
121
+ * @param url 服务器地址
122
+ * @since 1.0.0
123
+ */
124
+ setBaseURL(url: string): void;
125
+ /**
126
+ * 获取轮询和保活状态
127
+ * @since 1.0.0
128
+ * @example
129
+ * ```typescript
130
+ * const jobStatus = meeting.getJobStatus();
131
+ * console.log(jobStatus.polling, jobStatus.keepalive);
132
+ * ```
133
+ */
134
+ getJobStatus(): Record<string, JobStatus>;
135
+ /**
136
+ * 加入会议
137
+ * @since 1.0.0
138
+ */
139
+ join(params: ParamsJoin): Promise<void>;
140
+ /**
141
+ * 上报用户媒体信息,正常用于EVENT: UPDATE_USER_STATE事件触发时进行上报,当params未传时,将采用下面默认参数,有传值时,将进行覆盖
142
+ *
143
+ * |类型|deviceOn|sendOn|recvOn|
144
+ * |-|-|-|-|
145
+ * |audio|true|true|false|
146
+ * |video|true|true|false|
147
+ * |share|true|false|false|
148
+ * @since 1.0.0
149
+ */
150
+ updateUserState(params?: UserState): Promise<void>;
151
+ /**
152
+ * 离开会议,params传值为空时,默认传递ResultInfo:bizCode为901359
153
+ * @since 1.0.0
154
+ */
155
+ leave(params?: ResultInfo): Promise<boolean>;
156
+ /**
157
+ * 结束会议(需主持人权限)
158
+ * @since 1.0.0
159
+ */
160
+ end(): Promise<boolean>;
161
+ }