@tarunzyraclavis/zyra-twilio-wrapper 1.0.0 → 1.0.9

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.js CHANGED
@@ -70,19 +70,56 @@ function createErrorResult(error) {
70
70
 
71
71
  // src/index.ts
72
72
  var ZyraTwilioWrapper = class {
73
- constructor(configObj) {
73
+ constructor(config) {
74
74
  this.device = null;
75
75
  this.activeConnection = null;
76
76
  this.isInitialized = false;
77
77
  this.isInitializing = false;
78
+ this.isAuthenticated = false;
79
+ this.axiosInstance = import_axios2.default.create();
78
80
  this.activeCallSid = null;
79
81
  this.conferenceDetail = null;
80
82
  this.participants = [];
81
83
  this.waitUrl = "https://api.twilio.com/cowbell.mp3";
82
- this.serverUrl = configObj.serverUrl;
83
- this.identity = configObj.identity;
84
- this.waitUrl = configObj.waitUrl || this.waitUrl;
85
- this.conferenceName = `conf_${this.identity}`;
84
+ this.serverUrl = config.serverUrl;
85
+ this.identity = config.identity;
86
+ this.sdkToken = config.sdkToken;
87
+ this.waitUrl = config.waitUrl || this.waitUrl;
88
+ this.conferenceName = `conf_${this.identity}_${Date.now()}`;
89
+ }
90
+ /* ------------------------------------------------------------------ */
91
+ /* AUTH */
92
+ /* ------------------------------------------------------------------ */
93
+ setupAxiosAuth(token) {
94
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${token}`;
95
+ }
96
+ ensureAuthenticated() {
97
+ if (!this.isAuthenticated) {
98
+ throw new Error("SDK not authenticated.");
99
+ }
100
+ }
101
+ async verifySDKToken() {
102
+ if (!this.sdkToken) {
103
+ throw new Error("SDK token not provided");
104
+ }
105
+ try {
106
+ const res = await this.axiosInstance.post(
107
+ `${this.serverUrl}/voipSdk.verifySdkToken`,
108
+ {},
109
+ { headers: { Authorization: `Bearer ${this.sdkToken}` } }
110
+ );
111
+ console.log("verifySDKToken :", res.data.result.data.verified);
112
+ if (res?.data?.result?.data?.verified) {
113
+ this.isAuthenticated = true;
114
+ this.setupAxiosAuth(this.sdkToken);
115
+ console.info("[verifySDKToken] SDK token verified");
116
+ return true;
117
+ }
118
+ throw new Error("Invalid SDK token");
119
+ } catch (error) {
120
+ this.isAuthenticated = false;
121
+ throw new Error("SDK authentication failed");
122
+ }
86
123
  }
87
124
  // /**
88
125
  // * Initialize the Twilio device and get token
@@ -94,31 +131,21 @@ var ZyraTwilioWrapper = class {
94
131
  * @returns Promise that resolves when initialization is complete
95
132
  */
96
133
  async init() {
134
+ this.ensureAuthenticated();
97
135
  if (this.isInitialized) {
98
- throw new Error(
99
- "SDK is already initialized. Call destroy() first to reinitialize."
100
- );
136
+ throw new Error("SDK already initialized");
101
137
  }
102
138
  if (this.isInitializing) {
103
- throw new Error("SDK initialization is already in progress");
139
+ throw new Error("SDK initialization already in progress");
104
140
  }
105
141
  this.isInitializing = true;
106
142
  try {
107
- if (!this.serverUrl) {
108
- throw new Error("serverUrl is required");
109
- }
110
- if (!this.identity) {
111
- throw new Error("identity is required");
112
- }
113
143
  const token = await this.generateToken();
114
- this.device = new import_voice_sdk.Device(token, { logLevel: 3 });
144
+ this.device = new import_voice_sdk.Device(token, { logLevel: "info" });
115
145
  this.setupDeviceEventHandlers();
116
146
  await this.device.register();
117
147
  this.isInitialized = true;
118
- console.info("[init] Device registration completed");
119
- } catch (error) {
120
- handleAxiosError(error, this.onError, "Failed to fetch token");
121
- throw error;
148
+ console.info("[init] Device registered");
122
149
  } finally {
123
150
  this.isInitializing = false;
124
151
  }
@@ -127,341 +154,217 @@ var ZyraTwilioWrapper = class {
127
154
  async generateToken() {
128
155
  try {
129
156
  const payload = {
130
- identity: this.identity,
131
- ttl: 3600,
132
- incomingAllow: true
157
+ json: {
158
+ identity: this.identity,
159
+ ttl: 3600,
160
+ incomingAllow: true
161
+ }
133
162
  };
134
- const res = await import_axios2.default.post(`${this.serverUrl}/voipSdk.generateToken`, payload);
135
- const token = res.data.result.data.token;
136
- if (!token) {
137
- throw new Error("Token not found in server response");
138
- }
163
+ console.log("Generating token with payload:", payload);
164
+ const res = await this.axiosInstance.post(
165
+ `${this.serverUrl}/voipSdk.generateToken`,
166
+ payload
167
+ );
168
+ const token = res?.data?.result?.data?.token;
169
+ if (!token) throw new Error("Token missing");
139
170
  return token;
140
171
  } catch (error) {
141
- handleAxiosError(error, this.onError, "Failed to generate Twilio token");
172
+ handleAxiosError(error, this.onError, "Token generation failed");
142
173
  throw error;
143
174
  }
144
175
  }
145
- // Private methods for handling the event for device
146
176
  setupDeviceEventHandlers() {
147
177
  if (!this.device) return;
148
- this.device.on("registered", () => {
149
- console.info("[Device] Registered");
150
- this.onReady?.();
151
- });
178
+ this.device.on("registered", () => this.onReady?.());
152
179
  this.device.on("incoming", (conn) => {
153
- console.info("[Device] Incoming call detected");
180
+ this.activeConnection = conn;
154
181
  conn.on("cancel", () => {
155
- console.warn("[Device] Caller hung up before answer");
156
182
  this.activeConnection = null;
157
183
  this.onMissedCall?.();
158
184
  });
159
- conn.on("reject", () => {
160
- console.warn("[Device] Call rejected");
161
- this.activeConnection = null;
162
- });
185
+ conn.on("reject", () => this.activeConnection = null);
163
186
  conn.on("accept", () => console.info("[Device] Call accepted"));
164
- this.activeConnection = conn;
165
187
  this.onIncoming?.(conn);
166
188
  });
167
- this.device.on("disconnect", () => {
168
- console.info("[Device] Call disconnected");
169
- this.activeConnection = null;
170
- this.onDisconnect?.();
171
- });
172
189
  this.device.on("connect", (conn) => {
173
- console.info("[Device] Call connected");
174
190
  this.activeConnection = conn;
175
191
  this.onConnect?.(conn);
176
192
  });
193
+ this.device.on("disconnect", () => {
194
+ this.activeConnection = null;
195
+ this.onDisconnect?.();
196
+ });
177
197
  this.device.on("error", (error) => {
178
- handleAxiosError(error, this.onError, "Device encountered an error");
198
+ handleAxiosError(error, this.onError, "Device error");
199
+ });
200
+ this.device.on("tokenWillExpire", async () => {
201
+ const token = await this.generateToken();
202
+ this.device?.updateToken(token);
179
203
  });
180
204
  }
205
+ /* ------------------------------------------------------------------ */
206
+ /* CALL CONTROL */
207
+ /* ------------------------------------------------------------------ */
181
208
  /**
182
- * Check if SDK is initialized
183
- */
184
- get initialized() {
185
- return this.isInitialized;
186
- }
187
- /**
188
- * Destroy the SDK instance and clean up resources
189
- */
190
- destroy() {
191
- if (this.device) {
192
- this.device.removeAllListeners();
193
- this.device.on("error", (error) => {
194
- handleAxiosError(error, this.onError, "Device encountered an error during destroy");
195
- });
196
- this.device.on("tokenWillExpire", async () => {
197
- const token = await this.generateToken();
198
- this.device?.updateToken(token);
199
- });
200
- this.device.destroy();
201
- this.device = null;
202
- }
203
- this.isInitialized = false;
204
- this.isInitializing = false;
205
- this.activeConnection = null;
206
- console.info("[destroy] Device destroyed and SDK state reset");
207
- }
208
- /**
209
- * Make an outgoing call or add participant to an existing call
210
- */
209
+ * Make an outgoing call or add participant to an existing call
210
+ */
211
211
  async makeCall(to) {
212
- if (!this.device) {
213
- return createErrorResult("Device not initialized");
214
- }
215
- if (!to) {
216
- console.warn("[makeCall] 'to' parameter is required");
217
- return createErrorResult("[makeCall] 'to' parameter is required");
218
- }
212
+ this.ensureAuthenticated();
213
+ if (!this.device) return createErrorResult("Device not initialized");
214
+ if (!to) return createErrorResult("Destination required");
219
215
  if (!this.activeConnection) {
220
- try {
221
- const connection = await this.device.connect({
222
- params: { To: to, conferenceName: this.conferenceName }
223
- });
224
- this.activeConnection = connection;
225
- connection.on("accept", async (conn) => {
226
- this.activeCallSid = connection?.parameters?.CallSid ?? null;
227
- console.info(`[makeCall] Call accepted. Call SID: ${this.activeCallSid}`);
228
- this.onAnswerOutGoing?.(conn);
229
- await this.getConferenceId();
230
- });
231
- connection.on("error", (error) => {
232
- console.error("[makeCall] Connection error:", error.message);
233
- this.onError?.(error);
234
- });
235
- connection.on("disconnect", () => {
236
- console.info("[makeCall] Call disconnected.");
237
- this.activeConnection = null;
238
- this.onDisconnect?.();
239
- });
240
- console.info(`[makeCall] Outgoing call initiated to: ${to}`);
241
- return createSuccessResult(`[makeCall] Outgoing call initiated to: ${to}`, connection);
242
- } catch (error) {
243
- const err = error instanceof Error ? error : new Error(String(error));
244
- console.error("[makeCall] Failed to initiate call:", err.message);
245
- this.onError?.(err);
246
- return createErrorResult(`[makeCall] Failed to initiate call: ${err.message}`);
247
- }
248
- } else {
249
- try {
250
- console.info("[makeCall] Active call found. Holding and adding new participant...");
251
- await this.holdAndAddParticipant(this.activeConnection.parameters.CallSid, to);
252
- return createSuccessResult(`[makeCall] Outgoing participant ${to} added`, this.activeConnection);
253
- } catch (error) {
254
- const err = error instanceof Error ? error : new Error(String(error));
255
- console.error("[makeCall] Failed to add participant:", err.message);
256
- this.onError?.(err);
257
- return createErrorResult(`[makeCall] Failed to add participant: ${err.message}`);
258
- }
216
+ const conn = await this.device.connect({
217
+ params: { To: to, conferenceName: this.conferenceName }
218
+ });
219
+ this.activeConnection = conn;
220
+ conn.on("accept", async () => {
221
+ this.activeCallSid = conn.parameters?.CallSid ?? null;
222
+ await this.getConferenceId();
223
+ });
224
+ return createSuccessResult("Call started", conn);
259
225
  }
226
+ await this.holdAndAddParticipant(
227
+ this.activeConnection.parameters.CallSid,
228
+ to
229
+ );
230
+ return createSuccessResult("Participant added", this.activeConnection);
260
231
  }
261
232
  /**
262
- * Accept incoming call
263
- */
233
+ * Accept incoming call
234
+ */
264
235
  acceptCall() {
265
- if (!this.device || !this.activeConnection) {
266
- const msg = !this.device ? "Device not initialized." : "No active call to accept.";
267
- console.warn(`[acceptCall] ${msg}`);
268
- return createErrorResult(`[acceptCall] ${msg}`);
269
- }
270
- try {
271
- this.activeConnection.accept();
272
- console.info("[acceptCall] Call accepted successfully.");
273
- return createSuccessResult("Call accepted successfully.", this.activeConnection);
274
- } catch (error) {
275
- const err = error instanceof Error ? error : new Error(String(error));
276
- console.error("[acceptCall] Failed:", err.message);
277
- this.onError?.(err);
278
- return createErrorResult(`[acceptCall] Failed: ${err.message}`);
236
+ if (!this.activeConnection) {
237
+ return createErrorResult("No incoming call");
279
238
  }
239
+ this.activeConnection.accept();
240
+ return createSuccessResult("Call accepted", this.activeConnection);
280
241
  }
281
242
  /**
282
- * Hang up active call
283
- */
243
+ * Hang up active call
244
+ */
284
245
  hangup() {
285
- if (!this.device || !this.activeConnection) {
286
- const msg = !this.device ? "Device not initialized." : "No active call to hang up.";
287
- console.warn(`[hangup] ${msg}`);
288
- return createErrorResult(`[hangup] ${msg}`);
289
- }
290
- try {
291
- this.device.disconnectAll();
292
- this.activeConnection = null;
293
- console.info("[hangup] Call hung up successfully.");
294
- return createSuccessResult("Call hung up successfully.", this.activeConnection);
295
- } catch (error) {
296
- const err = error instanceof Error ? error : new Error(String(error));
297
- console.error("[hangup] Failed:", err.message);
298
- this.onError?.(err);
299
- return createErrorResult(`Failed to hang up: ${err.message}`);
300
- }
246
+ if (!this.device) return createErrorResult("Device not initialized");
247
+ this.device.disconnectAll();
248
+ this.activeConnection = null;
249
+ return createSuccessResult("Call ended", null);
301
250
  }
302
251
  /**
303
- * Reject incoming call
304
- */
252
+ * Reject incoming call
253
+ */
305
254
  rejectCall() {
306
- if (!this.device || !this.activeConnection) {
307
- const msg = !this.device ? "Device not initialized." : "No active call to reject.";
308
- console.warn(`[rejectCall] ${msg}`);
309
- return createErrorResult(`[rejectCall] ${msg}`);
310
- }
311
- try {
312
- this.activeConnection.reject();
313
- this.activeConnection = null;
314
- console.info("[rejectCall] Call rejected successfully.");
315
- return createSuccessResult("[rejectCall] Call rejected successfully.", this.activeConnection);
316
- } catch (error) {
317
- const err = error instanceof Error ? error : new Error(String(error));
318
- console.error("[rejectCall] Failed:", err.message);
319
- this.onError?.(err);
320
- return createErrorResult(`Failed to reject call: ${err.message}`);
321
- }
255
+ if (!this.activeConnection) return createErrorResult("No call to reject");
256
+ this.activeConnection.reject();
257
+ this.activeConnection = null;
258
+ return createSuccessResult("Call rejected", null);
322
259
  }
323
260
  /**
324
- * Toggle mute/unmute
325
- */
261
+ * Toggle mute/unmute
262
+ */
326
263
  toggleMute(mute) {
327
- if (!this.activeConnection) {
328
- console.warn("[toggleMute] No active call to mute/unmute.");
329
- return createErrorResult("[toggleMute] No active call to mute/unmute.");
330
- }
331
- try {
332
- this.activeConnection.mute(mute);
333
- console.info(`[toggleMute] Call ${mute ? "muted" : "unmuted"} successfully.`);
334
- return createSuccessResult(`Call ${mute ? "muted" : "unmuted"} successfully.`, this.activeConnection);
335
- } catch (error) {
336
- const err = error instanceof Error ? error : new Error(String(error));
337
- console.error("[toggleMute] Failed:", err.message);
338
- this.onError?.(err);
339
- return createErrorResult(`Failed to toggle mute: ${err.message}`);
340
- }
264
+ if (!this.activeConnection) return createErrorResult("No active call");
265
+ this.activeConnection.mute(mute);
266
+ return createSuccessResult(`Mute ${mute}`, this.activeConnection);
341
267
  }
268
+ /* ------------------------------------------------------------------ */
269
+ /* CONFERENCE API */
270
+ /* ------------------------------------------------------------------ */
342
271
  /**
343
- * Hold a call
344
- */
272
+ * Hold a call
273
+ */
345
274
  async hold(callSid) {
346
- if (!this.activeConnection) return createErrorResult("No active call to hold.");
347
- if (!callSid) return createErrorResult("Please provide callSid.");
348
- try {
349
- const payload = { callSid, conferenceName: this.conferenceName, waitUrl: this.waitUrl };
350
- await import_axios2.default.post(`${this.serverUrl}/outgoingCall.hold`, payload);
351
- console.info("[hold] Call held successfully.");
352
- return createSuccessResult("Call held successfully.", this.activeConnection);
353
- } catch (error) {
354
- handleAxiosError(error, this.onError, "Failed to hold call");
355
- const errMessage = error instanceof Error ? error.message : String(error);
356
- return createErrorResult(`Failed to hold call: ${errMessage}`);
357
- }
275
+ this.ensureAuthenticated();
276
+ const payload = {
277
+ callSid,
278
+ conferenceName: this.conferenceName,
279
+ waitUrl: this.waitUrl
280
+ };
281
+ await this.axiosInstance.post(`${this.serverUrl}/outgoingCall.hold`, payload);
282
+ return createSuccessResult("Call held", this.activeConnection);
358
283
  }
359
284
  /**
360
- * Resume a held call
361
- */
285
+ * Resume a held call
286
+ */
362
287
  async resume(callSid) {
363
- if (!this.activeConnection) return createErrorResult("No active call to resume.");
364
- if (!callSid) return createErrorResult("Please provide callSid.");
365
- try {
366
- const payload = { callSid, conferenceName: this.conferenceName };
367
- await import_axios2.default.post(`${this.serverUrl}/outgoingCall.unhold`, payload);
368
- console.info("[resume] Call resumed successfully.");
369
- return createSuccessResult("Call resumed successfully.", this.activeConnection);
370
- } catch (error) {
371
- handleAxiosError(error, this.onError, "Failed to resume call");
372
- const errMessage = error instanceof Error ? error.message : String(error);
373
- return createErrorResult(`Failed to resume call: ${errMessage}`);
374
- }
288
+ this.ensureAuthenticated();
289
+ const payload = {
290
+ callSid,
291
+ conferenceName: this.conferenceName
292
+ };
293
+ await this.axiosInstance.post(
294
+ `${this.serverUrl}/outgoingCall.unhold`,
295
+ payload
296
+ );
297
+ return createSuccessResult("Call resumed", this.activeConnection);
375
298
  }
376
299
  /**
377
- * Hold active call and add a new participant
378
- */
379
- async holdAndAddParticipant(callSid, newParticipantNo) {
380
- if (!this.activeConnection) return createErrorResult("No active call.");
381
- if (!callSid) return createErrorResult("Please provide callSid.");
382
- if (!newParticipantNo) return createErrorResult("Please provide participant number.");
383
- try {
384
- const holdPayload = { conferenceName: this.conferenceName, callSid, waitUrl: this.waitUrl };
385
- const holdRes = await import_axios2.default.post(`${this.serverUrl}/outgoingCall.hold`, holdPayload);
386
- const addPayload = { conferenceName: this.conferenceName, newParticipantNo };
387
- const addRes = await import_axios2.default.post(`${this.serverUrl}/outgoingCall.addNewCallee`, addPayload);
388
- console.info("[holdAndAddParticipant] Call held and participant added successfully.");
389
- return {
390
- message: "Call held and participant added successfully.",
391
- status: true,
392
- holdResponse: holdRes.data,
393
- addParticipantResponse: addRes.data
394
- };
395
- } catch (error) {
396
- handleAxiosError(error, this.onError, "Failed to hold and add participant");
397
- const errMessage = error instanceof Error ? error.message : String(error);
398
- return createErrorResult(`Failed to hold/add participant: ${errMessage}`);
399
- }
300
+ * Hold active call and add a new participant
301
+ */
302
+ async holdAndAddParticipant(callSid, number) {
303
+ this.ensureAuthenticated();
304
+ await this.hold(callSid);
305
+ const payload = {
306
+ conferenceName: this.conferenceName,
307
+ newParticipantNo: number
308
+ };
309
+ const res = await this.axiosInstance.post(
310
+ `${this.serverUrl}/outgoingCall.addNewCallee`,
311
+ payload
312
+ );
313
+ return createSuccessResult("Participant added", res.data);
400
314
  }
401
315
  /**
402
- * Fetch conference details
403
- */
316
+ * Fetch conference details
317
+ */
404
318
  async getConferenceId() {
405
- if (!this.activeConnection) return createErrorResult("No active call.");
406
- const payload = { conferenceName: this.conferenceName };
407
- try {
408
- const res = await import_axios2.default.post(`${this.serverUrl}/outgoingCall.getConferenceId`, payload);
409
- if (res?.data?.result?.data) {
410
- const confDetails = {
411
- conferenceSid: res.data.result.data.conferenceSid,
412
- conferences: res.data.result.data.conferences
413
- };
414
- this.conferenceDetail = confDetails;
415
- console.info("[getConferenceId] Conference details fetched successfully.");
416
- return createSuccessResult("Call resumed successfully.", confDetails);
417
- }
418
- console.warn("[getConferenceId] No conference data returned from server.");
419
- return { message: "No conference data returned.", status: false };
420
- } catch (error) {
421
- handleAxiosError(error, this.onError, "Failed to get conference ID");
422
- const errMessage = error instanceof Error ? error.message : String(error);
423
- return createErrorResult(`Failed to get conference ID: ${errMessage}`);
424
- }
319
+ this.ensureAuthenticated();
320
+ const payload = {
321
+ conferenceName: this.conferenceName
322
+ };
323
+ const res = await this.axiosInstance.post(
324
+ `${this.serverUrl}/outgoingCall.getConferenceId`,
325
+ payload
326
+ );
327
+ this.conferenceDetail = res?.data?.result?.data ?? null;
328
+ return createSuccessResult("Conference fetched", this.conferenceDetail);
425
329
  }
426
330
  /**
427
- * Get participants of a conference
428
- */
331
+ * Get participants of a conference
332
+ */
429
333
  async getParticipants(conferenceSid) {
430
- if (!this.activeConnection) return createErrorResult("No active call.");
431
- if (!conferenceSid) return createErrorResult("Please provide conferenceSid.");
432
- try {
433
- const payload = { conferenceSid };
434
- const res = await import_axios2.default.post(`${this.serverUrl}/outgoingCall.getParticipants`, payload);
435
- if (res?.data?.result?.data?.participants) {
436
- this.participants = res.data.result.data.participants;
437
- console.info("[getParticipants] Participants fetched successfully.");
438
- return createSuccessResult("Participants fetched successfully.", this.participants);
439
- }
440
- console.warn("[getParticipants] No participants returned from server.");
441
- return { message: "No participants returned.", status: false };
442
- } catch (error) {
443
- handleAxiosError(error, this.onError, "Failed to get participants");
444
- const errMessage = error instanceof Error ? error.message : String(error);
445
- return createErrorResult(`Failed to get participants: ${errMessage}`);
446
- }
334
+ this.ensureAuthenticated();
335
+ const payload = { conferenceSid };
336
+ const res = await this.axiosInstance.post(
337
+ `${this.serverUrl}/outgoingCall.getParticipants`,
338
+ payload
339
+ );
340
+ this.participants = res?.data?.result?.data?.participants ?? [];
341
+ return createSuccessResult("Participants fetched", this.participants);
447
342
  }
448
343
  /**
449
- * Remove a participant from a conference
450
- */
344
+ * Remove a participant from a conference
345
+ */
451
346
  async removeParticipant(conferenceSid, callSid) {
452
- if (!this.activeConnection) return createErrorResult("No active call.");
453
- if (!callSid) return createErrorResult("Please provide callSid.");
454
- if (!conferenceSid) return createErrorResult("Please provide conferenceSid.");
455
- try {
456
- const payload = { callSid, conferenceSid };
457
- const res = await import_axios2.default.post(`${this.serverUrl}/outgoingCall.removeParticipant`, payload);
458
- console.info("[removeParticipant] Participant removed successfully.");
459
- return createSuccessResult("Participant removed successfully.", res.data);
460
- } catch (error) {
461
- handleAxiosError(error, this.onError, "Failed to remove participant");
462
- const errMessage = error instanceof Error ? error.message : String(error);
463
- return createErrorResult(`Failed to remove participant: ${errMessage}`);
347
+ this.ensureAuthenticated();
348
+ const payload = { conferenceSid, callSid };
349
+ const res = await this.axiosInstance.post(
350
+ `${this.serverUrl}/outgoingCall.removeParticipant`,
351
+ payload
352
+ );
353
+ return createSuccessResult("Participant removed", res.data);
354
+ }
355
+ /* ------------------------------------------------------------------ */
356
+ /* CLEANUP */
357
+ /* ------------------------------------------------------------------ */
358
+ destroy() {
359
+ if (this.device) {
360
+ this.device.removeAllListeners();
361
+ this.device.destroy();
362
+ this.device = null;
464
363
  }
364
+ this.activeConnection = null;
365
+ this.isInitialized = false;
366
+ this.isInitializing = false;
367
+ this.isAuthenticated = false;
465
368
  }
466
369
  };
467
370
  //# sourceMappingURL=index.js.map