module-develop-kit 1.0.1 → 1.0.3

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.
@@ -1,5 +1,7 @@
1
- import { __require as r } from "../vendor/gm-crypt/index.js";
2
- var p = r();
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../vendor/sdp-transform/lib/index.js";
3
+ var t = o();
4
+ const a = /* @__PURE__ */ r(t);
3
5
  export {
4
- p as g
6
+ a as default
5
7
  };
@@ -1,7 +1,5 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../vendor/sdp-transform/lib/index.js";
3
- var t = o();
4
- const a = /* @__PURE__ */ r(t);
1
+ import { __require as r } from "../vendor/gm-crypt/index.js";
2
+ var p = r();
5
3
  export {
6
- a as default
4
+ p as g
7
5
  };
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var r = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ e as __module
4
4
  };
package/dist/main.d.ts CHANGED
@@ -181,8 +181,18 @@ export declare interface ICallConfig extends SipAccount {
181
181
  credential: string;
182
182
  };
183
183
  };
184
+ /**
185
+ * ice 传输策略
186
+ */
187
+ iceTransportPolicy?: string;
188
+ /**
189
+ * ice 候选收集最大时长
190
+ * @default 2000
191
+ */
192
+ iceCandidateTimeout?: number;
184
193
  /**
185
194
  * 是否开发环境
195
+ * @deprecated 该属性已废弃,所有情况都会传递 iceConfig
186
196
  */
187
197
  isDev?: boolean;
188
198
  /**
@@ -1,27 +1,27 @@
1
- import { J as h } from "../../commonjs-virtual-dir/JsSIP.js";
2
- import { C as l } from "../../commonjs-virtual-dir/Constants.js";
3
- import { ECallStatus as r, EMIT_EVENT_NAME as S } from "./constants.js";
4
- import { CallLogger as s, getIceServersByCallConfig as p, formatSdp as f } from "./utils.js";
5
- import { EventBus as m } from "../utils/eventBus.js";
6
- class g {
1
+ import { J as C } from "../../commonjs-virtual-dir/JsSIP.js";
2
+ import { C as h } from "../../commonjs-virtual-dir/Constants.js";
3
+ import { ECallStatus as a, EMIT_EVENT_NAME as y } from "./constants.js";
4
+ import { CallLogger as e, getIceServersByCallConfig as m, formatSdp as T } from "./utils.js";
5
+ import { EventBus as I } from "../utils/eventBus.js";
6
+ class $ {
7
7
  ua = null;
8
8
  session = null;
9
9
  eventBus;
10
- callStatus = r.INITIAL;
10
+ callStatus = a.INITIAL;
11
11
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
12
12
  stopPlayTipAudio = () => {
13
13
  };
14
14
  // 有可能会出现 音频还未加载成功,但是会话已经结束的情况
15
15
  isStop = !1;
16
16
  constructor(o, t) {
17
- this.eventBus = new m(), this.playTipAudio(t.tipAudioUrl), this.initUa(o, t);
17
+ this.eventBus = new I(), this.playTipAudio(t.tipAudioUrl), this.initUa(o, t);
18
18
  }
19
19
  /**
20
20
  * 监听状态更新
21
21
  * @param callback
22
22
  */
23
23
  onStatusUpdate(o) {
24
- this.eventBus.$on(S.UPDATE_STATUS, o, !0);
24
+ this.eventBus.$on(y.UPDATE_STATUS, o, !0);
25
25
  }
26
26
  /**
27
27
  * 更新状态,触发状态更新
@@ -29,8 +29,8 @@ class g {
29
29
  * @param cause
30
30
  * @param statusCode
31
31
  */
32
- updateStatus(o, t, e) {
33
- this.callStatus = o, this.eventBus.$emit(S.UPDATE_STATUS, o, t, e);
32
+ updateStatus(o, t, s) {
33
+ this.callStatus = o, this.eventBus.$emit(y.UPDATE_STATUS, o, t, s);
34
34
  }
35
35
  /**
36
36
  * 初始化sip和websocket的链接
@@ -40,30 +40,30 @@ class g {
40
40
  */
41
41
  initUa(o, t) {
42
42
  try {
43
- s.log("wssUrl", t.wssUrl), s.log("当前作席", t.extension);
44
- const e = new h.WebSocketInterface(t.wssUrl);
45
- this.ua = new h.UA({
46
- sockets: [e],
43
+ e.log("wssUrl", t.wssUrl), e.log("当前作席", t.extension);
44
+ const s = new C.WebSocketInterface(t.wssUrl);
45
+ this.ua = new C.UA({
46
+ sockets: [s],
47
47
  uri: `sip:${t.extension}@${t.sipIp}`,
48
48
  password: t.password,
49
49
  realm: t.realm || t.sipIp,
50
50
  register_expires: 300,
51
51
  session_timers_expires: 120,
52
52
  pcConfig: {
53
- iceServers: p(t)
53
+ iceServers: m(t)
54
54
  },
55
55
  extra_headers: [`X-Call-ID: ${t.callId}`]
56
56
  }), this.ua.on("registered", () => {
57
- s.log("SIP 注册成功"), this.initSession(o, t);
57
+ e.log("SIP 注册成功"), this.initSession(o, t);
58
58
  }), this.ua.on("connected", () => {
59
- s.log("WebSocket已连接");
59
+ e.log("WebSocket已连接");
60
60
  }), this.ua.on("disconnected", () => {
61
- s.warn("WebSocket已断开"), r.PENDING === this.callStatus && this.updateStatus(r.RECONNECT, l.causes.CONNECTION_ERROR);
62
- }), this.ua.on("registrationFailed", (u) => {
63
- this.updateStatus(r.FAILED, u.cause, u.response.status_code), s.error(`SIP 注册失败 cause: ${u?.cause} status_code: ${u?.response?.status_code}`), this.stop();
64
- }), this.ua.start(), this.updateStatus(r.PENDING);
65
- } catch (e) {
66
- s.error("SIP 初始化失败", e?.message), this.stop(), this.updateStatus(r.FAILED, l.causes.SIP_FAILURE_CODE);
61
+ e.warn("WebSocket已断开"), a.PENDING === this.callStatus && this.updateStatus(a.RECONNECT, h.causes.CONNECTION_ERROR);
62
+ }), this.ua.on("registrationFailed", (n) => {
63
+ this.updateStatus(a.FAILED, n.cause, n.response.status_code), e.error(`SIP 注册失败 cause: ${n?.cause} status_code: ${n?.response?.status_code}`), this.stop();
64
+ }), this.ua.start(), this.updateStatus(a.PENDING);
65
+ } catch (s) {
66
+ e.error("SIP 初始化失败", s?.message), this.stop(), this.updateStatus(a.FAILED, h.causes.SIP_FAILURE_CODE);
67
67
  }
68
68
  }
69
69
  /**
@@ -71,27 +71,27 @@ class g {
71
71
  */
72
72
  optimizationCall() {
73
73
  const o = Date.now();
74
- s.log("开始接听倒计时:", o);
75
- const t = 80 * 1e3 + o, e = () => {
74
+ e.log("开始接听倒计时:", o);
75
+ const t = 80 * 1e3 + o, s = () => {
76
76
  requestAnimationFrame(() => {
77
- r.PENDING === this.callStatus && (Date.now() > t ? (s.error("接听超时", Date.now()), this.updateStatus(r.FAILED, l.causes.NO_ANSWER), this.stop()) : e());
77
+ a.PENDING === this.callStatus && (Date.now() > t ? (e.error("接听超时", Date.now()), this.updateStatus(a.FAILED, h.causes.NO_ANSWER), this.stop()) : s());
78
78
  });
79
79
  };
80
- e();
80
+ s();
81
81
  }
82
82
  /**
83
83
  * 音频检测,存在有早期媒体但是并无声音的情况,所以增加音频分析检测;
84
84
  */
85
85
  audioCheck(o) {
86
86
  try {
87
- const t = new (Reflect.get(window, "AudioContext") || Reflect.get(window, "webkitAudioContext"))(), e = t.createAnalyser(), u = t.createMediaStreamSource(o.streams[0]);
88
- u.connect(e), e.fftSize = 256;
89
- const a = e.frequencyBinCount, i = new Uint8Array(a), n = () => {
90
- e.getByteTimeDomainData(i), i.some((d) => Math.abs(d - 128) > 2) && (s.log("【音频分析】检测到有效声音"), u.disconnect(), this.stopPlayTipAudio()), requestAnimationFrame(n);
87
+ const t = new (Reflect.get(window, "AudioContext") || Reflect.get(window, "webkitAudioContext"))(), s = t.createAnalyser(), n = t.createMediaStreamSource(o.streams[0]);
88
+ n.connect(s), s.fftSize = 256;
89
+ const d = s.frequencyBinCount, u = new Uint8Array(d), l = () => {
90
+ s.getByteTimeDomainData(u), u.some((f) => Math.abs(f - 128) > 2) && (e.log("【音频分析】检测到有效声音"), n.disconnect(), this.stopPlayTipAudio()), requestAnimationFrame(l);
91
91
  };
92
- n();
92
+ l();
93
93
  } catch (t) {
94
- s.error("音频分析模块初始化失败", t?.message);
94
+ e.error("音频分析模块初始化失败", t?.message);
95
95
  }
96
96
  }
97
97
  /**
@@ -101,64 +101,77 @@ class g {
101
101
  * @private
102
102
  */
103
103
  getSessionEventHandlers(o, t) {
104
- let e = !1;
105
- const u = o.call.split("").slice(-4).join("");
106
- return s.log("开始呼叫(尾号):", `sip:${u}@${t.sipIp}`), {
107
- sdp: (a) => {
108
- a.sdp = f(a.sdp);
104
+ let s = !1;
105
+ const n = o.call.split("").slice(-4).join("");
106
+ e.log("开始呼叫(尾号):", `sip:${n}@${t.sipIp}`);
107
+ const d = t.iceTransportPolicy === "relay";
108
+ let u = null;
109
+ const l = () => {
110
+ u && clearTimeout(u), u = null;
111
+ }, { iceCandidateTimeout: p = 2e3 } = t;
112
+ return {
113
+ sdp: (i) => {
114
+ i.sdp = T(i.sdp);
109
115
  },
110
116
  connecting: () => {
111
- r.PENDING !== this.callStatus && this.updateStatus(r.PENDING), s.log("正在连接...");
117
+ a.PENDING !== this.callStatus && this.updateStatus(a.PENDING), e.log("正在连接...");
112
118
  },
113
- progress: (a) => {
114
- if (s.log("呼叫进行中..."), this.optimizationCall(), a.response) {
115
- const i = a.response.status_code, n = a.response.body;
116
- i === 183 && n ? (s.log("收到 183 (带SDP),确认有早期媒体,停止本地提示音。"), this.stopPlayTipAudio()) : (i === 180 || i === 183 && !n) && s.log(`收到 ${i} (无SDP),继续播放本地提示音。`);
119
+ progress: (i) => {
120
+ if (e.log("呼叫进行中..."), this.optimizationCall(), i.response) {
121
+ const r = i.response.status_code, c = i.response.body;
122
+ r === 183 && c ? (e.log("收到 183 (带SDP),确认有早期媒体,停止本地提示音。"), this.stopPlayTipAudio()) : (r === 180 || r === 183 && !c) && e.log(`收到 ${r} (无SDP),继续播放本地提示音。`);
117
123
  }
118
124
  },
119
- ended: (a) => {
120
- if (r.FAILED !== this.callStatus) {
121
- const i = e ? a?.cause : l.causes.REJECTED;
122
- this.updateStatus(r.ENDED, i), s.log("通话已结束 cause: ", i);
125
+ ended: (i) => {
126
+ if (a.FAILED !== this.callStatus) {
127
+ const r = s ? i?.cause : h.causes.REJECTED;
128
+ this.updateStatus(a.ENDED, r), e.log("通话已结束 cause: ", r);
123
129
  }
124
130
  this.stop();
125
131
  },
126
- failed: (a) => {
127
- const { cause: i, message: n = {} } = a, c = i === "Canceled";
132
+ failed: (i) => {
133
+ const { cause: r, message: c = {} } = i, S = r === "Canceled";
128
134
  this.updateStatus(
129
- c ? r.CANCELLED : r.FAILED,
130
- i,
131
- n?.status_code
132
- ), c ? s.warn(
133
- `通话已取消 cause: ${i} status_code: ${n?.status_code || ""}`
134
- ) : s.error(
135
- `通话失败 cause: ${i} status_code: ${n?.status_code || ""}`
135
+ S ? a.CANCELLED : a.FAILED,
136
+ r,
137
+ c?.status_code
138
+ ), S ? e.warn(
139
+ `通话已取消 cause: ${r} status_code: ${c?.status_code || ""}`
140
+ ) : e.error(
141
+ `通话失败 cause: ${r} status_code: ${c?.status_code || ""}`
136
142
  ), this.stop();
137
143
  },
138
144
  accepted: () => {
139
- this.stopPlayTipAudio(), s.log("通话已接听");
145
+ this.stopPlayTipAudio(), e.log("通话已接听");
140
146
  },
141
147
  confirmed: () => {
142
- this.updateStatus(r.ANSWERED), s.log("通话已确认");
143
- const a = setTimeout(() => {
144
- e = !0, clearTimeout(a);
148
+ this.updateStatus(a.ANSWERED), e.log("通话已确认");
149
+ const i = setTimeout(() => {
150
+ s = !0, clearTimeout(i);
145
151
  }, 1500);
146
152
  },
147
- peerconnection: (a) => {
148
- const i = a.peerconnection;
149
- s.log("RTCPeerConnection 已创建或更新,正在设置 ontrack 监听器"), i.ontrack = (n) => {
150
- if (n.track.kind === "audio" && n.streams[0]) {
151
- s.log(n.track, "track"), s.log(`接收到远程媒体轨道 (track): ${n.track.kind}`);
152
- const c = n.streams[0];
153
+ peerconnection: (i) => {
154
+ const r = i.peerconnection;
155
+ e.log("RTCPeerConnection 已创建或更新,正在设置 ontrack 监听器"), r.ontrack = (c) => {
156
+ if (c.track.kind === "audio" && c.streams[0]) {
157
+ e.log(c.track, "track"), e.log(`接收到远程媒体轨道 (track): ${c.track.kind}`);
158
+ const S = c.streams[0];
153
159
  this.stopPlayTipAudio();
154
- const d = document.getElementById(t.playAudioId);
155
- d ? (d.srcObject = c, d.play().catch((E) => {
156
- s.error("播放远程音频失败 (来自 ontrack)", E);
157
- })) : s.error("无法播放远程音频,播放元素不存在", `${t.playAudioId}`), this.audioCheck(n);
160
+ const E = document.getElementById(t.playAudioId);
161
+ E ? (E.srcObject = S, E.play().catch((A) => {
162
+ e.error("播放远程音频失败 (来自 ontrack)", A);
163
+ })) : e.error("无法播放远程音频,播放元素不存在", `${t.playAudioId}`), this.audioCheck(c);
158
164
  }
159
- }, i.addEventListener("iceconnectionstatechange", () => {
160
- s.log(`ICE状态: ${i.iceConnectionState}`), i.iceConnectionState === "disconnected" && (s.error("ICE连接断开"), this.updateStatus(r.FAILED, l.causes.CONNECTION_ERROR), this.stop());
165
+ }, r.addEventListener("iceconnectionstatechange", () => {
166
+ e.log(`ICE状态: ${r.iceConnectionState}`), r.iceConnectionState === "disconnected" && (e.error("ICE连接断开"), this.updateStatus(a.FAILED, h.causes.CONNECTION_ERROR), this.stop());
161
167
  });
168
+ },
169
+ icecandidate: d ? (i) => {
170
+ e.log("relay 模式 ice 候选:", i.candidate), i.ready();
171
+ } : (i) => {
172
+ l(), u = setTimeout(() => {
173
+ i.ready(), l(), e.log(`ice 候选候选${p}ms 后获取结束`);
174
+ }, p), i.candidate ? e.log("ice 候选:", i.candidate) : (l(), e.log("ice 候选结束"), i.ready());
162
175
  }
163
176
  };
164
177
  }
@@ -168,11 +181,11 @@ class g {
168
181
  */
169
182
  initSession(o, t) {
170
183
  if (!this.ua) {
171
- this.updateStatus(r.FAILED, l.causes.SIP_FAILURE_CODE), s.error("SIP 未初始化");
184
+ this.updateStatus(a.FAILED, h.causes.SIP_FAILURE_CODE), e.error("SIP 未初始化");
172
185
  return;
173
186
  }
174
187
  try {
175
- const u = {
188
+ const n = {
176
189
  eventHandlers: this.getSessionEventHandlers(o, t),
177
190
  mediaConstraints: { audio: !0, video: !1 },
178
191
  rtcOfferConstraints: {
@@ -180,15 +193,16 @@ class g {
180
193
  offerToReceiveVideo: !1
181
194
  },
182
195
  rtcConfiguration: {
183
- iceServers: p(t)
196
+ iceServers: m(t)
184
197
  },
185
- sessionTimersExpires: 180
198
+ sessionTimersExpires: 180,
199
+ pcConfig: {
200
+ iceServers: m(t)
201
+ }
186
202
  };
187
- t.isDev || (u.pcConfig = {
188
- iceServers: p(t)
189
- }), this.session = this.ua.call(`sip:${o.call}@${t.sipIp}`, u);
190
- } catch (e) {
191
- s.error("SIP 会话创建失败", e?.message), this.stop();
203
+ t.iceTransportPolicy && n.pcConfig && (e.log("iceTransportPolicy", t.iceTransportPolicy), n.pcConfig.iceTransportPolicy = t.iceTransportPolicy), this.session = this.ua.call(`sip:${o.call}@${t.sipIp}`, n);
204
+ } catch (s) {
205
+ e.error("SIP 会话创建失败", s?.message), this.stop();
192
206
  }
193
207
  }
194
208
  /**
@@ -196,26 +210,26 @@ class g {
196
210
  * @private
197
211
  */
198
212
  async playTipAudio(o) {
199
- let t, e;
213
+ let t, s;
200
214
  try {
201
- s.log("开始播放提示音");
202
- const i = await (await fetch(o || `https://store.zxfqf.com/file/uMgvB0wt9f.mp3?t=${Date.now()}`)).arrayBuffer();
215
+ e.log("开始播放提示音");
216
+ const u = await (await fetch(o || `https://store.zxfqf.com/file/uMgvB0wt9f.mp3?t=${Date.now()}`)).arrayBuffer();
203
217
  t = new (window.AudioContext || Reflect.get(window, "webkitAudioContext"))(), await t.suspend();
204
- const n = await t.decodeAudioData(i);
205
- e = t.createBufferSource(), e.buffer = n, e.connect(t.destination), e.loop = !0, e.loopStart = 0, e.loopEnd = n.duration;
206
- const c = t.currentTime;
207
- s.log("音频播放开始时间:", c), await t.resume(), e.start(c);
208
- } catch (a) {
209
- s.error("播放音频失败", a?.message);
218
+ const l = await t.decodeAudioData(u);
219
+ s = t.createBufferSource(), s.buffer = l, s.connect(t.destination), s.loop = !0, s.loopStart = 0, s.loopEnd = l.duration;
220
+ const p = t.currentTime;
221
+ e.log("音频播放开始时间:", p), await t.resume(), s.start(p);
222
+ } catch (d) {
223
+ e.error("播放音频失败", d?.message);
210
224
  }
211
- let u = !1;
225
+ let n = !1;
212
226
  this.stopPlayTipAudio = () => {
213
- u || (s.log("停止播放提示音"), u = !0, e.stop(), e.disconnect(), t.close().finally(() => {
214
- e = null, t = null, this.stopPlayTipAudio = () => {
227
+ n || (e.log("停止播放提示音"), n = !0, s.stop(), s.disconnect(), t.close().finally(() => {
228
+ s = null, t = null, this.stopPlayTipAudio = () => {
215
229
  };
216
230
  }));
217
- }, this.onStatusUpdate((a) => {
218
- r.ANSWERED === a && this.stopPlayTipAudio();
231
+ }, this.onStatusUpdate((d) => {
232
+ a.ANSWERED === d && this.stopPlayTipAudio();
219
233
  }), this.isStop && this.stopPlayTipAudio();
220
234
  }
221
235
  /**
@@ -226,7 +240,7 @@ class g {
226
240
  try {
227
241
  this.ua?.stop?.(), !this.session?.isEnded?.() && this.session?.terminate();
228
242
  } catch (o) {
229
- s.error("挂断失败", o?.message);
243
+ e.error("挂断失败", o?.message);
230
244
  } finally {
231
245
  this.isStop = !0, this.stopPlayTipAudio();
232
246
  }
@@ -241,9 +255,9 @@ class g {
241
255
  * 挂断电话
242
256
  */
243
257
  hangUp() {
244
- r.ANSWERED === this.callStatus ? (this.updateStatus(r.ENDED), s.warn("客服正常挂断结束通话")) : (this.updateStatus(r.CANCELLED), s.warn("客服取消通话")), this.stop(), this.destroy();
258
+ a.ANSWERED === this.callStatus ? (this.updateStatus(a.ENDED), e.warn("客服正常挂断结束通话")) : (this.updateStatus(a.CANCELLED), e.warn("客服取消通话")), this.stop(), this.destroy();
245
259
  }
246
260
  }
247
261
  export {
248
- g as CallManagement
262
+ $ as CallManagement
249
263
  };
@@ -1,5 +1,5 @@
1
- import a from "../../commonjs-virtual-dir/index3.js";
2
- const u = {
1
+ import c from "../../commonjs-virtual-dir/index2.js";
2
+ const g = {
3
3
  log(e, ...r) {
4
4
  console.log(`%c【${(/* @__PURE__ */ new Date()).toLocaleString()}】`, "color: green; font-weight: bold;", e, ...r);
5
5
  },
@@ -9,42 +9,39 @@ const u = {
9
9
  error(e, ...r) {
10
10
  console.log(`%c【${(/* @__PURE__ */ new Date()).toLocaleString()}】`, "color: red; font-weight: bold;", e, ...r);
11
11
  }
12
+ }, a = /* @__PURE__ */ new Map([
13
+ ["PCMA", 1],
14
+ ["G729", 2],
15
+ ["G722", 3],
16
+ ["PCMU", 4]
17
+ ]), s = (e) => (e.type === "audio" && (e.rtp.sort((r, o) => {
18
+ const t = a.get(r.codec) || 1 / 0, n = a.get(o.codec) || 1 / 0;
19
+ return t - n;
20
+ }), e.payloads = e.rtp.map((r) => r.payload).join(" ")), e), p = (e) => {
21
+ const r = c.parse(e);
22
+ return r.media = r.media.map(s), c.write(r);
12
23
  }, S = (e) => {
13
- const r = a.parse(e);
14
- return r.media = r.media.map((t) => {
15
- if (t.type === "audio") {
16
- const n = t.payloads;
17
- if (n?.includes("8")) {
18
- const o = n.split(" "), s = o.findIndex((c) => c === "8");
19
- o.splice(s, 1), o.unshift("8"), t.payloads = o.join(" ");
20
- const i = t.rtp, l = i.find((c) => c.codec === "PCMA"), d = i.findIndex((c) => c.codec === "PCMA");
21
- i.splice(d, 1), l && i.unshift(l);
22
- }
23
- }
24
- return t;
25
- }), a.write(r);
26
- }, f = (e) => {
27
24
  if (typeof e != "number" || Number.isNaN(e))
28
25
  throw new TypeError("输入必须是数字类型");
29
26
  if (e < 0 || !Number.isInteger(e))
30
27
  throw new RangeError("请输入非负整数");
31
- const r = e / 1e3, t = Math.floor(r / 60), n = Math.floor(r % 60), o = String(t).padStart(2, "0"), s = String(n).padStart(2, "0");
32
- return `${o}:${s}`;
33
- }, g = (e) => {
28
+ const r = e / 1e3, o = Math.floor(r / 60), t = Math.floor(r % 60), n = String(o).padStart(2, "0"), i = String(t).padStart(2, "0");
29
+ return `${n}:${i}`;
30
+ }, d = (e) => {
34
31
  const r = [
35
32
  {
36
33
  urls: [e.iceService.stunServerUrl]
37
34
  }
38
35
  ];
39
36
  if (e.iceService.turnServer) {
40
- const { urls: t, username: n, credential: o } = e.iceService.turnServer;
41
- t && n && o && r.push(e.iceService.turnServer);
37
+ const { urls: o, username: t, credential: n } = e.iceService.turnServer;
38
+ o && t && n && r.push(e.iceService.turnServer);
42
39
  }
43
40
  return r;
44
41
  };
45
42
  export {
46
- u as CallLogger,
47
- S as formatSdp,
48
- f as formatSeconds,
49
- g as getIceServersByCallConfig
43
+ g as CallLogger,
44
+ p as formatSdp,
45
+ S as formatSeconds,
46
+ d as getIceServersByCallConfig
50
47
  };
@@ -1,4 +1,4 @@
1
- import { g as o } from "../../../commonjs-virtual-dir/index2.js";
1
+ import { g as o } from "../../../commonjs-virtual-dir/index3.js";
2
2
  import { dataToStr as r } from "./util.js";
3
3
  const c = "cbc", n = (t, e) => new o.sm4({
4
4
  key: t.key,
@@ -1,4 +1,4 @@
1
- import { __module as C } from "../../commonjs-virtual-dir/index4.js";
1
+ import { __module as C } from "../../commonjs-virtual-dir/index5.js";
2
2
  var $i = C.exports, Y;
3
3
  function Qi() {
4
4
  return Y ? C.exports : (Y = 1, function(x, Hi) {
@@ -1,4 +1,4 @@
1
- import { __exports as r } from "../../../commonjs-virtual-dir/index5.js";
1
+ import { __exports as r } from "../../../commonjs-virtual-dir/index4.js";
2
2
  import { __require as t } from "./parser.js";
3
3
  import { __require as m } from "./writer.js";
4
4
  import { __require as p } from "./grammar.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "module-develop-kit",
3
3
  "author": "Front-End team",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "type": "module",
6
6
  "description": "前端项目通用工具包",
7
7
  "module": "dist/main.js",