@mentra/bluetooth-sdk 0.1.21-beta.1 → 0.1.21-beta.2

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.
@@ -206,6 +206,7 @@ data class StreamRequest @JvmOverloads constructor(
206
206
  val sound: Boolean = true,
207
207
  val video: StreamVideoConfig? = null,
208
208
  val audio: StreamAudioConfig? = null,
209
+ val authToken: String? = null,
209
210
  ) {
210
211
  fun toMap(): Map<String, Any> =
211
212
  buildMap {
@@ -215,6 +216,7 @@ data class StreamRequest @JvmOverloads constructor(
215
216
  put("sound", sound)
216
217
  video?.toMap()?.takeIf { it.isNotEmpty() }?.let { put("video", it) }
217
218
  audio?.toMap()?.takeIf { it.isNotEmpty() }?.let { put("audio", it) }
219
+ authToken?.takeIf { it.isNotEmpty() }?.let { put("authToken", it) }
218
220
  }
219
221
 
220
222
  companion object {
@@ -228,6 +230,7 @@ data class StreamRequest @JvmOverloads constructor(
228
230
  sound = values["sound"] as? Boolean ?: true,
229
231
  video = StreamVideoConfig.fromMap(stringMapValue(values["video"])),
230
232
  audio = StreamAudioConfig.fromMap(stringMapValue(values["audio"])),
233
+ authToken = values["authToken"] as? String ?: values["auth_token"] as? String,
231
234
  )
232
235
  }
233
236
  }
@@ -8,7 +8,7 @@ enum BluetoothSdkDefaults {
8
8
 
9
9
  static let voiceActivityDetectionEnabled = false
10
10
  static let loudnessGateEnabled = true
11
- private static let swiftPackageSdkVersion = "0.1.21-beta.1"
11
+ private static let swiftPackageSdkVersion = "0.1.21-beta.2"
12
12
  private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
13
13
 
14
14
  private static func normalizedSdkVersion(_ value: String?) -> String? {
@@ -274,19 +274,22 @@ public struct StreamRequest {
274
274
  public let sound: Bool
275
275
  public let video: StreamVideoConfig?
276
276
  public let audio: StreamAudioConfig?
277
+ public let authToken: String?
277
278
 
278
279
  public init(
279
280
  streamUrl: String,
280
281
  streamId: String = "",
281
282
  sound: Bool = true,
282
283
  video: StreamVideoConfig? = nil,
283
- audio: StreamAudioConfig? = nil
284
+ audio: StreamAudioConfig? = nil,
285
+ authToken: String? = nil
284
286
  ) {
285
287
  self.streamUrl = streamUrl
286
288
  self.streamId = streamId
287
289
  self.sound = sound
288
290
  self.video = video
289
291
  self.audio = audio
292
+ self.authToken = authToken
290
293
  }
291
294
 
292
295
  init(values: [String: Any]) {
@@ -299,7 +302,8 @@ public struct StreamRequest {
299
302
  streamId: values["streamId"] as? String ?? "",
300
303
  sound: values["sound"] as? Bool ?? true,
301
304
  video: StreamVideoConfig(values: values["video"] as? [String: Any]),
302
- audio: StreamAudioConfig(values: values["audio"] as? [String: Any])
305
+ audio: StreamAudioConfig(values: values["audio"] as? [String: Any]),
306
+ authToken: values["authToken"] as? String ?? values["auth_token"] as? String
303
307
  )
304
308
  }
305
309
 
@@ -315,6 +319,9 @@ public struct StreamRequest {
315
319
  if let audioValues = audio?.dictionary, !audioValues.isEmpty {
316
320
  values["audio"] = audioValues
317
321
  }
322
+ if let authToken, !authToken.isEmpty {
323
+ values["authToken"] = authToken
324
+ }
318
325
  return values
319
326
  }
320
327
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "0.1.21-beta.1",
3
+ "version": "0.1.21-beta.2",
4
4
  "description": "SDK for communicating with smart glasses",
5
5
  "main": "build/index.js",
6
6
  "react-native": "src/index.ts",