module-develop-kit 0.3.3 → 0.4.0
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/dist/index.d.ts +163 -0
- package/dist/index.es.js +13431 -2560
- package/package.json +6 -2
- package/dist/index.umd.js +0 -14
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { default as default_2 } from 'crypto-js';
|
|
2
|
+
import { Plugin as Plugin_2 } from 'vite';
|
|
3
|
+
import { Ref } from 'vue';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* 使用AES算法对字符串进行解密。
|
|
@@ -26,6 +28,15 @@ export declare const aesDecryptString: (key: string, str: string | default_2.lib
|
|
|
26
28
|
*/
|
|
27
29
|
export declare const aesEncryptString: (key: string, str: string | default_2.lib.WordArray, iv: string) => string;
|
|
28
30
|
|
|
31
|
+
/**
|
|
32
|
+
* 用于格式化输出会话过程中的日志信息
|
|
33
|
+
*/
|
|
34
|
+
export declare const CallLogger: {
|
|
35
|
+
log(message: any, ...args: any[]): void;
|
|
36
|
+
warn(message: any, ...args: any[]): void;
|
|
37
|
+
error(message: any, ...args: any[]): void;
|
|
38
|
+
};
|
|
39
|
+
|
|
29
40
|
/**
|
|
30
41
|
* 创建带有签名信息的请求头对象。
|
|
31
42
|
* 该方法根据传入的参数生成时间戳、随机数和签名,并将它们添加到自定义请求头中。
|
|
@@ -38,6 +49,41 @@ export declare function createHeaders({ uid, salt, ts, data, ...headers }: ICrea
|
|
|
38
49
|
"X-Sign-Client": string;
|
|
39
50
|
};
|
|
40
51
|
|
|
52
|
+
export declare enum ECallStatus {
|
|
53
|
+
/**
|
|
54
|
+
* 正在接听中
|
|
55
|
+
*/
|
|
56
|
+
PENDING = "pending",
|
|
57
|
+
/**
|
|
58
|
+
* 已接听
|
|
59
|
+
*/
|
|
60
|
+
ANSWERED = "answered",
|
|
61
|
+
/**
|
|
62
|
+
* 呼叫失败
|
|
63
|
+
*/
|
|
64
|
+
FAILED = "failed",
|
|
65
|
+
/**
|
|
66
|
+
* 结束通话
|
|
67
|
+
*/
|
|
68
|
+
ENDED = "ended",
|
|
69
|
+
/**
|
|
70
|
+
* 初始状态
|
|
71
|
+
*/
|
|
72
|
+
INITIAL = "initial",
|
|
73
|
+
/**
|
|
74
|
+
* 用户取消通话
|
|
75
|
+
*/
|
|
76
|
+
CANCELLED = "cancelled",
|
|
77
|
+
/**
|
|
78
|
+
* 说明ws链接失败,需要重新连接,会重新初始化状态
|
|
79
|
+
*/
|
|
80
|
+
RECONNECT = "reconnect"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare const EMIT_EVENT_NAME: {
|
|
84
|
+
UPDATE_STATUS: string;
|
|
85
|
+
};
|
|
86
|
+
|
|
41
87
|
/**
|
|
42
88
|
* 生成指定长度的随机字符串。
|
|
43
89
|
* 该函数通过从包含大小写字母和数字的字符集合中随机选取字符,拼接成所需长度的字符串。
|
|
@@ -53,6 +99,51 @@ export declare const generateRandomString: (length: number) => string;
|
|
|
53
99
|
*/
|
|
54
100
|
export declare function htmlSanitize(input: string): string;
|
|
55
101
|
|
|
102
|
+
/**
|
|
103
|
+
* jssip、音频播放相关配置信息
|
|
104
|
+
*/
|
|
105
|
+
declare interface ICallConfig extends SipAccount {
|
|
106
|
+
/**
|
|
107
|
+
* WebSocket安全协议地址
|
|
108
|
+
*/
|
|
109
|
+
wssUrl: string;
|
|
110
|
+
/**
|
|
111
|
+
* SIP服务器IP地址
|
|
112
|
+
*/
|
|
113
|
+
sipIp: string;
|
|
114
|
+
/**
|
|
115
|
+
* 音频播放器DOM元素ID
|
|
116
|
+
*/
|
|
117
|
+
playAudioId: string;
|
|
118
|
+
/**
|
|
119
|
+
* 播放提示音的链接。默认为 https://store.zxfqf.com/file/uMgvB0wt9f.mp3
|
|
120
|
+
*/
|
|
121
|
+
tipAudioUrl?: string;
|
|
122
|
+
/**
|
|
123
|
+
* ice地址
|
|
124
|
+
*/
|
|
125
|
+
iceService: string;
|
|
126
|
+
/**
|
|
127
|
+
* 是否开发环境
|
|
128
|
+
*/
|
|
129
|
+
isDev?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* 用与加在请求头上的参数
|
|
132
|
+
*/
|
|
133
|
+
callId: string;
|
|
134
|
+
/**
|
|
135
|
+
* realm
|
|
136
|
+
*/
|
|
137
|
+
realm: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 用于拨打电话的相关信息
|
|
142
|
+
*/
|
|
143
|
+
declare interface ICallOptions {
|
|
144
|
+
call: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
56
147
|
declare interface ICreateHeaders {
|
|
57
148
|
/**
|
|
58
149
|
* 用户唯一标识符,用于参与签名的生成
|
|
@@ -92,6 +183,61 @@ declare interface ISm4Params {
|
|
|
92
183
|
mode?: "cbc" | "ecb";
|
|
93
184
|
}
|
|
94
185
|
|
|
186
|
+
/**
|
|
187
|
+
* sip code对应的的状态,优先处理 code 对应的提示文案,如果不存在则按照 causes 状态去处理
|
|
188
|
+
*/
|
|
189
|
+
export declare const SIP_CODE_MESSAGE: {
|
|
190
|
+
/**
|
|
191
|
+
* 黑名单或者不存在
|
|
192
|
+
*/
|
|
193
|
+
"404": string;
|
|
194
|
+
/**
|
|
195
|
+
* 拒接
|
|
196
|
+
*/
|
|
197
|
+
"500": string;
|
|
198
|
+
/**
|
|
199
|
+
* 拒接
|
|
200
|
+
*/
|
|
201
|
+
"607": string;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* jssip 中的 causes 对应的错误信息(只有部分需要提示的code)
|
|
206
|
+
*/
|
|
207
|
+
export declare const SIP_ERROR_CAUSES: {
|
|
208
|
+
"Authentication Error": string;
|
|
209
|
+
"Connection Error": string;
|
|
210
|
+
"Request Timeout": string;
|
|
211
|
+
"SIP Failure Code": string;
|
|
212
|
+
"WebRTC Error": string;
|
|
213
|
+
Busy: string;
|
|
214
|
+
Rejected: string;
|
|
215
|
+
Redirected: string;
|
|
216
|
+
Unavailable: string;
|
|
217
|
+
"Not Found": string;
|
|
218
|
+
"Incompatible SDP": string;
|
|
219
|
+
"Missing SDP": string;
|
|
220
|
+
Canceled: string;
|
|
221
|
+
"No Answer": string;
|
|
222
|
+
Expires: string;
|
|
223
|
+
"User Denied Media Access": string;
|
|
224
|
+
"RTP Timeout": string;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* sip 账号相关信息
|
|
229
|
+
*/
|
|
230
|
+
declare interface SipAccount {
|
|
231
|
+
/**
|
|
232
|
+
* 分机号码(支持字符串形式的数字编号)
|
|
233
|
+
*/
|
|
234
|
+
extension: string;
|
|
235
|
+
/**
|
|
236
|
+
* SIP认证密码
|
|
237
|
+
*/
|
|
238
|
+
password: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
95
241
|
/**
|
|
96
242
|
* SM4解密
|
|
97
243
|
* @param data 解密数据
|
|
@@ -134,4 +280,21 @@ export declare function transmissionDataEncryption(key: string, _data?: TData, t
|
|
|
134
280
|
};
|
|
135
281
|
};
|
|
136
282
|
|
|
283
|
+
/**
|
|
284
|
+
* 打电话
|
|
285
|
+
* FIXME: callBack 为什么存在?zyy 中通过 useCall 拿到的变量无法实现响应式,所以通过 callback 的方式更新外部依赖。
|
|
286
|
+
* @param callBack
|
|
287
|
+
*/
|
|
288
|
+
export declare const useCall: (callBack?: (status: ECallStatus, callStatusText: string, cause: string) => void) => {
|
|
289
|
+
call: (options: ICallOptions, config: ICallConfig) => void;
|
|
290
|
+
hangUp: () => void;
|
|
291
|
+
callStatus: Ref<ECallStatus, ECallStatus>;
|
|
292
|
+
callStatusText: Ref<string, string>;
|
|
293
|
+
destroy: () => void;
|
|
294
|
+
extension: Ref<string, string>;
|
|
295
|
+
getErrorMessage: () => any;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export declare const vitePluginCompatibilityDetection: () => Plugin_2;
|
|
299
|
+
|
|
137
300
|
export { }
|