@bota.dev/react-native-app-sdk 2.0.0-beta.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.
Files changed (173) hide show
  1. package/BotaDeviceSDK.podspec +55 -0
  2. package/LICENSE +21 -0
  3. package/README.md +101 -0
  4. package/android/build.gradle +76 -0
  5. package/android/src/main/AndroidManifest.xml +1 -0
  6. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidDevices.kt +172 -0
  7. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLifecycle.kt +100 -0
  8. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLogs.kt +82 -0
  9. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidModels.kt +476 -0
  10. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidOTA.kt +58 -0
  11. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordingUploads.kt +180 -0
  12. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordings.kt +751 -0
  13. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidSecurity.kt +509 -0
  14. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidWiFi.kt +125 -0
  15. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKEncryptedUploadV2Materials.kt +46 -0
  16. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKModule.kt +723 -0
  17. package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKPackage.kt +33 -0
  18. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidDevicesTest.kt +211 -0
  19. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLifecycleTest.kt +132 -0
  20. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLogsTest.kt +57 -0
  21. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidOTATest.kt +75 -0
  22. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordingUploadsTest.kt +147 -0
  23. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordingsTest.kt +355 -0
  24. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidSecurityTest.kt +523 -0
  25. package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidWiFiTest.kt +100 -0
  26. package/generated/codegen-contract.json +3593 -0
  27. package/ios/BotaDeviceSDK.mm +1300 -0
  28. package/ios/BotaDeviceSDKAppleBridge.swift +2260 -0
  29. package/ios/BotaDeviceSDKAppleDevices.swift +191 -0
  30. package/ios/BotaDeviceSDKAppleLifecycle.swift +167 -0
  31. package/ios/BotaDeviceSDKAppleLogs.swift +79 -0
  32. package/ios/BotaDeviceSDKAppleOTA.swift +73 -0
  33. package/ios/BotaDeviceSDKAppleRecordingUploads.swift +178 -0
  34. package/ios/BotaDeviceSDKAppleRecordings.swift +670 -0
  35. package/ios/BotaDeviceSDKAppleSecurity.swift +586 -0
  36. package/ios/BotaDeviceSDKAppleWiFi.swift +128 -0
  37. package/ios/BotaDeviceSDKEncryptedUploadV2Materials.swift +99 -0
  38. package/lib/commonjs/BotaClient.js +194 -0
  39. package/lib/commonjs/BotaClient.js.map +1 -0
  40. package/lib/commonjs/ble/constants.js +10 -0
  41. package/lib/commonjs/ble/constants.js.map +1 -0
  42. package/lib/commonjs/ble/deviceLogs.js +50 -0
  43. package/lib/commonjs/ble/deviceLogs.js.map +1 -0
  44. package/lib/commonjs/cache/DeviceStateCache.js +6 -0
  45. package/lib/commonjs/cache/DeviceStateCache.js.map +1 -0
  46. package/lib/commonjs/client.js +746 -0
  47. package/lib/commonjs/client.js.map +1 -0
  48. package/lib/commonjs/compatibility/runtime.js +44 -0
  49. package/lib/commonjs/compatibility/runtime.js.map +1 -0
  50. package/lib/commonjs/index.js +123 -0
  51. package/lib/commonjs/index.js.map +1 -0
  52. package/lib/commonjs/managers/DeviceManager.js +647 -0
  53. package/lib/commonjs/managers/DeviceManager.js.map +1 -0
  54. package/lib/commonjs/managers/OTAManager.js +140 -0
  55. package/lib/commonjs/managers/OTAManager.js.map +1 -0
  56. package/lib/commonjs/managers/RecordingManager.js +444 -0
  57. package/lib/commonjs/managers/RecordingManager.js.map +1 -0
  58. package/lib/commonjs/managers/StreamingSession.js +175 -0
  59. package/lib/commonjs/managers/StreamingSession.js.map +1 -0
  60. package/lib/commonjs/managers/types.js +6 -0
  61. package/lib/commonjs/managers/types.js.map +1 -0
  62. package/lib/commonjs/models/Device.js +2 -0
  63. package/lib/commonjs/models/Device.js.map +1 -0
  64. package/lib/commonjs/models/Recording.js +2 -0
  65. package/lib/commonjs/models/Recording.js.map +1 -0
  66. package/lib/commonjs/models/Status.js +6 -0
  67. package/lib/commonjs/models/Status.js.map +1 -0
  68. package/lib/commonjs/package.json +1 -0
  69. package/lib/commonjs/specs/NativeBotaDeviceSDK.js +9 -0
  70. package/lib/commonjs/specs/NativeBotaDeviceSDK.js.map +1 -0
  71. package/lib/commonjs/sync/syncStatus.js +178 -0
  72. package/lib/commonjs/sync/syncStatus.js.map +1 -0
  73. package/lib/commonjs/utils/errors.js +194 -0
  74. package/lib/commonjs/utils/errors.js.map +1 -0
  75. package/lib/commonjs/utils/logger.js +84 -0
  76. package/lib/commonjs/utils/logger.js.map +1 -0
  77. package/lib/module/BotaClient.js +189 -0
  78. package/lib/module/BotaClient.js.map +1 -0
  79. package/lib/module/ble/constants.js +6 -0
  80. package/lib/module/ble/constants.js.map +1 -0
  81. package/lib/module/ble/deviceLogs.js +45 -0
  82. package/lib/module/ble/deviceLogs.js.map +1 -0
  83. package/lib/module/cache/DeviceStateCache.js +4 -0
  84. package/lib/module/cache/DeviceStateCache.js.map +1 -0
  85. package/lib/module/client.js +740 -0
  86. package/lib/module/client.js.map +1 -0
  87. package/lib/module/compatibility/runtime.js +35 -0
  88. package/lib/module/compatibility/runtime.js.map +1 -0
  89. package/lib/module/index.js +17 -0
  90. package/lib/module/index.js.map +1 -0
  91. package/lib/module/managers/DeviceManager.js +641 -0
  92. package/lib/module/managers/DeviceManager.js.map +1 -0
  93. package/lib/module/managers/OTAManager.js +134 -0
  94. package/lib/module/managers/OTAManager.js.map +1 -0
  95. package/lib/module/managers/RecordingManager.js +438 -0
  96. package/lib/module/managers/RecordingManager.js.map +1 -0
  97. package/lib/module/managers/StreamingSession.js +168 -0
  98. package/lib/module/managers/StreamingSession.js.map +1 -0
  99. package/lib/module/managers/types.js +4 -0
  100. package/lib/module/managers/types.js.map +1 -0
  101. package/lib/module/models/Device.js +2 -0
  102. package/lib/module/models/Device.js.map +1 -0
  103. package/lib/module/models/Recording.js +2 -0
  104. package/lib/module/models/Recording.js.map +1 -0
  105. package/lib/module/models/Status.js +4 -0
  106. package/lib/module/models/Status.js.map +1 -0
  107. package/lib/module/specs/NativeBotaDeviceSDK.js +5 -0
  108. package/lib/module/specs/NativeBotaDeviceSDK.js.map +1 -0
  109. package/lib/module/sync/syncStatus.js +174 -0
  110. package/lib/module/sync/syncStatus.js.map +1 -0
  111. package/lib/module/utils/errors.js +183 -0
  112. package/lib/module/utils/errors.js.map +1 -0
  113. package/lib/module/utils/logger.js +80 -0
  114. package/lib/module/utils/logger.js.map +1 -0
  115. package/lib/typescript/BotaClient.d.ts +40 -0
  116. package/lib/typescript/BotaClient.d.ts.map +1 -0
  117. package/lib/typescript/ble/constants.d.ts +4 -0
  118. package/lib/typescript/ble/constants.d.ts.map +1 -0
  119. package/lib/typescript/ble/deviceLogs.d.ts +10 -0
  120. package/lib/typescript/ble/deviceLogs.d.ts.map +1 -0
  121. package/lib/typescript/cache/DeviceStateCache.d.ts +14 -0
  122. package/lib/typescript/cache/DeviceStateCache.d.ts.map +1 -0
  123. package/lib/typescript/client.d.ts +208 -0
  124. package/lib/typescript/client.d.ts.map +1 -0
  125. package/lib/typescript/compatibility/runtime.d.ts +11 -0
  126. package/lib/typescript/compatibility/runtime.d.ts.map +1 -0
  127. package/lib/typescript/index.d.ts +19 -0
  128. package/lib/typescript/index.d.ts.map +1 -0
  129. package/lib/typescript/managers/DeviceManager.d.ts +117 -0
  130. package/lib/typescript/managers/DeviceManager.d.ts.map +1 -0
  131. package/lib/typescript/managers/OTAManager.d.ts +25 -0
  132. package/lib/typescript/managers/OTAManager.d.ts.map +1 -0
  133. package/lib/typescript/managers/RecordingManager.d.ts +54 -0
  134. package/lib/typescript/managers/RecordingManager.d.ts.map +1 -0
  135. package/lib/typescript/managers/StreamingSession.d.ts +35 -0
  136. package/lib/typescript/managers/StreamingSession.d.ts.map +1 -0
  137. package/lib/typescript/managers/types.d.ts +19 -0
  138. package/lib/typescript/managers/types.d.ts.map +1 -0
  139. package/lib/typescript/models/Device.d.ts +392 -0
  140. package/lib/typescript/models/Device.d.ts.map +1 -0
  141. package/lib/typescript/models/Recording.d.ts +259 -0
  142. package/lib/typescript/models/Recording.d.ts.map +1 -0
  143. package/lib/typescript/models/Status.d.ts +106 -0
  144. package/lib/typescript/models/Status.d.ts.map +1 -0
  145. package/lib/typescript/specs/NativeBotaDeviceSDK.d.ts +393 -0
  146. package/lib/typescript/specs/NativeBotaDeviceSDK.d.ts.map +1 -0
  147. package/lib/typescript/sync/syncStatus.d.ts +123 -0
  148. package/lib/typescript/sync/syncStatus.d.ts.map +1 -0
  149. package/lib/typescript/utils/errors.d.ts +83 -0
  150. package/lib/typescript/utils/errors.d.ts.map +1 -0
  151. package/lib/typescript/utils/logger.d.ts +36 -0
  152. package/lib/typescript/utils/logger.d.ts.map +1 -0
  153. package/package.json +100 -0
  154. package/scripts/bota_device_sdk_spm_workaround.rb +53 -0
  155. package/src/BotaClient.ts +231 -0
  156. package/src/ble/constants.ts +3 -0
  157. package/src/ble/deviceLogs.ts +61 -0
  158. package/src/cache/DeviceStateCache.ts +20 -0
  159. package/src/client.ts +1410 -0
  160. package/src/compatibility/runtime.ts +55 -0
  161. package/src/index.ts +146 -0
  162. package/src/managers/DeviceManager.ts +927 -0
  163. package/src/managers/OTAManager.ts +195 -0
  164. package/src/managers/RecordingManager.ts +578 -0
  165. package/src/managers/StreamingSession.ts +212 -0
  166. package/src/managers/types.ts +36 -0
  167. package/src/models/Device.ts +484 -0
  168. package/src/models/Recording.ts +281 -0
  169. package/src/models/Status.ts +128 -0
  170. package/src/specs/NativeBotaDeviceSDK.ts +542 -0
  171. package/src/sync/syncStatus.ts +243 -0
  172. package/src/utils/errors.ts +327 -0
  173. package/src/utils/logger.ts +122 -0
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Recording-related type definitions
3
+ */
4
+ /**
5
+ * Audio codec type
6
+ */
7
+ export type AudioCodec = 'pcm_16k' | 'pcm_8k' | 'opus_16k' | 'opus_8k';
8
+ /**
9
+ * Recording metadata from device
10
+ */
11
+ export interface DeviceRecording {
12
+ /** Unique identifier on device (UUID) */
13
+ uuid: string;
14
+ /** Recording start timestamp */
15
+ startedAt: Date;
16
+ /** Duration in milliseconds */
17
+ durationMs: number;
18
+ /** File size in bytes */
19
+ fileSizeBytes: number;
20
+ /** Audio codec used */
21
+ codec: AudioCodec;
22
+ /** True if the file is stored encrypted at rest on the device (P4). False/undefined = legacy plaintext. */
23
+ isEncrypted?: boolean;
24
+ }
25
+ /**
26
+ * Upload information provided by customer backend
27
+ * (obtained by calling customer's API, not Bota API directly)
28
+ */
29
+ export interface UploadInfo {
30
+ /** Pre-signed S3 URL for upload */
31
+ uploadUrl: string;
32
+ /** Recording ID assigned by Bota API (rec_*) */
33
+ recordingId: string;
34
+ /** Upload token (up_*) for verification - optional if using custom completion flow */
35
+ uploadToken?: string;
36
+ /** URL to call when upload is complete - optional if using custom completion flow */
37
+ completeUrl?: string;
38
+ /** Expiration time of the upload URL */
39
+ expiresAt?: Date;
40
+ /** Content type for S3 upload (e.g., 'audio/opus', 'audio/wav') */
41
+ contentType?: string;
42
+ /** P10: when present AND the transferred audio bytes are BLE-e2e ciphertext
43
+ * (device encrypted before BLE relay), the SDK POSTs the raw bytes to this
44
+ * endpoint instead of the presigned S3 PUT. Backend decrypts server-side
45
+ * and writes plaintext to S3. Use the bind-time `cert`-flavored auth
46
+ * token (or any valid Bearer for the project). */
47
+ relay?: {
48
+ /** Full URL of `/v1/recordings/{id}/upload-relay` */
49
+ url: string;
50
+ /** Bearer token (typically sk_*, rk_*, or dtok_*) */
51
+ bearerToken: string;
52
+ };
53
+ }
54
+ /**
55
+ * Sync progress stages
56
+ */
57
+ export type SyncStage = 'preparing' | 'transferring' | 'uploading' | 'device_uploading' | 'completing' | 'completed' | 'failed';
58
+ /**
59
+ * Sync progress information
60
+ */
61
+ export interface SyncProgress {
62
+ /** Current stage */
63
+ stage: SyncStage;
64
+ /** Progress within current stage (0.0 - 1.0) */
65
+ progress: number;
66
+ /** Bytes transferred so far (for transferring stage) */
67
+ bytesTransferred?: number;
68
+ /** Total bytes to transfer */
69
+ totalBytes?: number;
70
+ /** Bytes uploaded so far (for uploading stage) */
71
+ bytesUploaded?: number;
72
+ /** Recording ID (set when completed) */
73
+ recordingId?: string;
74
+ /** Error message (set when failed) */
75
+ error?: string;
76
+ /** P9.F2 BLE integrity hash. SHA-256 (64-char hex) the device computed over
77
+ * the SD-file bytes. Set on the `transferring` and `completed` stages when
78
+ * P9.F2+ firmware emitted a BOTA_PKT_TYPE_SHA256 packet after EOF. Forward
79
+ * to your backend's /upload-complete (or equivalent) so server-side stitch
80
+ * can verify integrity. Undefined on pre-P9.F2 firmware. */
81
+ contentSha256?: string;
82
+ }
83
+ /**
84
+ * Upload task status
85
+ */
86
+ export type UploadTaskStatus = 'pending' | 'uploading' | 'completed' | 'failed';
87
+ /**
88
+ * Upload task in the queue
89
+ */
90
+ export interface UploadTask {
91
+ /** Unique task identifier */
92
+ id: string;
93
+ /** Recording ID from Bota API */
94
+ recordingId: string;
95
+ /** Device ID the recording came from */
96
+ deviceId: string;
97
+ /** Local file path */
98
+ localPath: string;
99
+ /** Pre-signed S3 upload URL */
100
+ uploadUrl: string;
101
+ /** Upload token - optional if using custom completion flow */
102
+ uploadToken?: string;
103
+ /** Complete URL to call after upload - optional if using custom completion flow */
104
+ completeUrl?: string;
105
+ /** Content type for S3 upload (e.g., 'audio/opus', 'audio/wav') */
106
+ contentType?: string;
107
+ /** P9.F2 BLE integrity hash. SHA-256 (64-char hex) the device computed over
108
+ * the SD-file bytes — forwarded to the host app's backend in the
109
+ * /upload-complete body so server-side stitch+SHA can verify integrity. */
110
+ contentSha256?: string;
111
+ /** P10: when set, the file at `localPath` is BLE-e2e ciphertext that must
112
+ * be POSTed to this relay endpoint (with the bearer token) instead of
113
+ * PUT to the presigned `uploadUrl`. The backend decrypts and writes
114
+ * plaintext to S3 on receipt. */
115
+ relay?: {
116
+ url: string;
117
+ bearerToken: string;
118
+ };
119
+ /** Current status */
120
+ status: UploadTaskStatus;
121
+ /** Number of retry attempts */
122
+ retryCount: number;
123
+ /** Error message if failed */
124
+ errorMessage?: string;
125
+ /** Task creation time */
126
+ createdAt: Date;
127
+ /** Last update time */
128
+ updatedAt: Date;
129
+ }
130
+ /**
131
+ * Transfer packet from device
132
+ */
133
+ export interface TransferPacket {
134
+ /** Packet type. P10 adds:
135
+ * - 'e2e_start' session header (ephemeral_pk + salt)
136
+ * - 'encrypted_data' DATA with ciphertext + tag payload
137
+ * - 'encrypted_eof' EOF for an encrypted transfer (no CRC) */
138
+ type: 'data' | 'eof' | 'paused' | 'error' | 'sha256' | 'e2e_start' | 'encrypted_data' | 'encrypted_eof';
139
+ /** Sequence number */
140
+ sequenceNumber: number;
141
+ /** Audio data (for data packets) */
142
+ data?: Uint8Array;
143
+ /** CRC32 checksum (for EOF packets) */
144
+ checksum?: number;
145
+ /** Bytes sent so far (for paused packets — streaming mode) */
146
+ bytesSent?: number;
147
+ /** Error code (for error packets) */
148
+ errorCode?: number;
149
+ /** P10 e2e_start only: ephemeral X25519 pubkey (32 bytes). */
150
+ e2eEphemeralPk?: Uint8Array;
151
+ /** P10 e2e_start only: session salt (4 bytes) for per-chunk nonce. */
152
+ e2eSalt?: Uint8Array;
153
+ /** P10 encrypted_data only: full payload (ciphertext + 16-byte tag). */
154
+ e2eChunk?: Uint8Array;
155
+ /** P9.F2 sha256 only: device's SHA-256 over the SD-file bytes (32 raw bytes). */
156
+ sha256?: Uint8Array;
157
+ }
158
+ /**
159
+ * Options for startStreamingSync()
160
+ */
161
+ export interface StreamingSyncOptions {
162
+ /**
163
+ * Size of each upload chunk in KB (64-1024).
164
+ * Smaller = more real-time (lower latency, higher HTTP overhead).
165
+ * Larger = less real-time (higher latency, lower overhead).
166
+ * Default: 256 (from device settings.upload.streaming_chunk_kb)
167
+ */
168
+ chunkSizeKb?: number;
169
+ /**
170
+ * Time-based flush interval in milliseconds. Buffered data is uploaded
171
+ * as a partial chunk even if chunkSizeKb hasn't been reached yet.
172
+ * Mirrors firmware's streaming_flush_interval_seconds behaviour.
173
+ * 0 = disabled (flush on chunk full only). Default: 60000 (60s).
174
+ */
175
+ flushIntervalMs?: number;
176
+ }
177
+ /**
178
+ * Streaming sync state
179
+ */
180
+ export type StreamingState = 'idle' | 'streaming' | 'paused' | 'uploading' | 'completing' | 'completed' | 'disconnected' | 'failed';
181
+ /**
182
+ * Streaming sync progress event
183
+ */
184
+ export interface StreamingSyncProgress {
185
+ /** Current streaming state */
186
+ state: StreamingState;
187
+ /** Bytes received from device so far */
188
+ bytesReceived: number;
189
+ /** Chunks uploaded to S3 so far */
190
+ chunksUploaded: number;
191
+ /** Recording ID from backend (set after first chunk upload) */
192
+ recordingId?: string;
193
+ /** Error message (if failed) */
194
+ error?: string;
195
+ }
196
+ /**
197
+ * Upload provider for streaming sync.
198
+ * Called by StreamingSession to create the backend record and upload chunks
199
+ * concurrently with Bluetooth transfer — same pattern as firmware WiFi/4G upload.
200
+ */
201
+ export interface StreamingUploadProvider {
202
+ /**
203
+ * Create backend record at session start to obtain recordingId for chunk URLs.
204
+ *
205
+ * Optionally return `relay` info so the SDK can route P10 e2e-encrypted
206
+ * chunks (when the device delivers ciphertext) to the per-chunk streaming
207
+ * relay endpoints instead of trying to push them to S3 presigned URLs.
208
+ * Required when the project has a backend pubkey provisioned and the
209
+ * device emits encrypted streaming packets; without it, the SDK cannot
210
+ * deliver the recording.
211
+ *
212
+ * Per-chunk model (foundation for real-time downstream features):
213
+ * chunkUrl(seq) → POST [eph_pk||salt||ct+tag] for seq=0, [ct+tag] for seq>0
214
+ * finalizeUrl → POST { total_chunks, ... } once EOF received
215
+ */
216
+ createRecording: (info: {
217
+ startedAt: Date;
218
+ }) => Promise<{
219
+ recordingId: string;
220
+ relay?: {
221
+ /** Build the per-chunk POST URL for chunk `seq` (0-indexed). */
222
+ chunkUrl: (seq: number) => string;
223
+ /** POST URL for the finalize call after all chunks have been POSTed. */
224
+ finalizeUrl: string;
225
+ /** Bearer token used for both chunkUrl and finalizeUrl. */
226
+ bearerToken: string;
227
+ };
228
+ }>;
229
+ /** Get pre-signed S3 URL for a specific chunk (1-indexed) */
230
+ getChunkUrl: (recordingId: string, chunkIndex: number) => Promise<string>;
231
+ /** Finalize after all chunks uploaded — triggers backend stitching + transcription */
232
+ finalizeRecording: (recordingId: string, info: {
233
+ totalChunks: number;
234
+ durationMs?: number;
235
+ fileSizeBytes?: number;
236
+ }) => Promise<void>;
237
+ }
238
+ /**
239
+ * Streaming session — represents an active streaming sync of the current recording.
240
+ * Event-based because it's long-lived (entire recording duration).
241
+ */
242
+ export interface StreamingSessionEvents {
243
+ /** Emitted when a new chunk of audio data is received */
244
+ chunk: (progress: StreamingSyncProgress) => void;
245
+ /** Emitted when device has caught up to recording write position */
246
+ paused: () => void;
247
+ /** Emitted when device resumes sending data after pause */
248
+ resumed: () => void;
249
+ /** Emitted when recording stops and all data has been uploaded */
250
+ completed: (result: {
251
+ recordingId: string;
252
+ totalBytes: number;
253
+ }) => void;
254
+ /** Emitted when Bluetooth disconnects — recording continues on device, batch sync later */
255
+ disconnected: () => void;
256
+ /** Emitted on error */
257
+ error: (err: Error) => void;
258
+ }
259
+ //# sourceMappingURL=Recording.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Recording.d.ts","sourceRoot":"","sources":["../../../src/models/Recording.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,SAAS,EAAE,IAAI,CAAC;IAChB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,KAAK,EAAE,UAAU,CAAC;IAClB,2GAA2G;IAC3G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;uDAImD;IACnD,KAAK,CAAC,EAAE;QACN,qDAAqD;QACrD,GAAG,EAAE,MAAM,CAAC;QACZ,qDAAqD;QACrD,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,WAAW,GACX,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,YAAY,GACZ,WAAW,GACX,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,Y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AAK,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CAC7B"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Status and configuration type definitions
3
+ */
4
+ import type { DeviceStatus, StorageInfo } from './Device';
5
+ import type { SyncProgress, UploadTask } from './Recording';
6
+ /**
7
+ * SDK log level
8
+ */
9
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
10
+ /**
11
+ * SDK configuration options
12
+ */
13
+ export interface BotaConfig {
14
+ /** Environment for API endpoint (development, gamma, or production) */
15
+ environment?: 'development' | 'gamma' | 'production';
16
+ /** Enable background sync (default: true) */
17
+ backgroundSyncEnabled?: boolean;
18
+ /** Only upload on WiFi (default: false) */
19
+ wifiOnlyUpload?: boolean;
20
+ /** Logging level (default: 'warn') */
21
+ logLevel?: LogLevel;
22
+ /** Enable debug mode with verbose logging */
23
+ debug?: boolean;
24
+ }
25
+ /**
26
+ * SDK state
27
+ */
28
+ export type SdkState = 'uninitialized' | 'initializing' | 'ready' | 'error';
29
+ /**
30
+ * Bluetooth state
31
+ */
32
+ export type BluetoothState = 'unknown' | 'resetting' | 'unsupported' | 'unauthorized' | 'poweredOff' | 'poweredOn';
33
+ /**
34
+ * SDK status information
35
+ */
36
+ export interface SdkStatus {
37
+ /** Current SDK state */
38
+ state: SdkState;
39
+ /** Bluetooth state */
40
+ bluetoothState: BluetoothState;
41
+ /** Whether Bluetooth is ready for operations */
42
+ isBluetoothReady: boolean;
43
+ /** Number of connected devices */
44
+ connectedDevicesCount: number;
45
+ /** Number of pending uploads in queue */
46
+ pendingUploadsCount: number;
47
+ }
48
+ export type { DeviceStatus, StorageInfo, SyncProgress, UploadTask };
49
+ /**
50
+ * Event types emitted by DeviceManager
51
+ */
52
+ export interface DeviceManagerEvents {
53
+ /** Emitted when a device is discovered during scan */
54
+ deviceDiscovered: (device: import('./Device').DiscoveredDevice) => void;
55
+ /** Emitted when a device is connected */
56
+ deviceConnected: (device: import('./Device').ConnectedDevice) => void;
57
+ /** Emitted when a device is disconnected */
58
+ deviceDisconnected: (deviceId: string, error?: Error) => void;
59
+ /** Emitted when device status is updated */
60
+ deviceStatusUpdated: (deviceId: string, status: import('./Device').DeviceStatus) => void;
61
+ /** Emitted when scan starts */
62
+ scanStarted: () => void;
63
+ /** Emitted when scan stops */
64
+ scanStopped: () => void;
65
+ /** Emitted on scan error */
66
+ scanError: (error: Error) => void;
67
+ /** Emitted on connection state change */
68
+ connectionStateChanged: (deviceId: string, state: import('./Device').ConnectionState) => void;
69
+ /** Emitted when Bluetooth powers back on (off → on transition) */
70
+ bluetoothReady: () => void;
71
+ }
72
+ /**
73
+ * Event types emitted by RecordingManager
74
+ */
75
+ export interface RecordingManagerEvents {
76
+ /** Emitted when sync starts for a recording */
77
+ syncStarted: (deviceRecordingUuid: string) => void;
78
+ /** Emitted on sync progress update */
79
+ syncProgress: (deviceRecordingUuid: string, progress: SyncProgress) => void;
80
+ /** Emitted when sync completes successfully */
81
+ syncCompleted: (deviceRecordingUuid: string, recordingId: string) => void;
82
+ /** Emitted when sync fails */
83
+ syncFailed: (deviceRecordingUuid: string, error: Error) => void;
84
+ /** Emitted when upload queue changes */
85
+ queueUpdated: (tasks: UploadTask[]) => void;
86
+ /** Emitted when an upload starts */
87
+ uploadStarted: (taskId: string) => void;
88
+ /** Emitted on upload progress */
89
+ uploadProgress: (taskId: string, progress: number) => void;
90
+ /** Emitted when an upload completes */
91
+ uploadCompleted: (taskId: string, recordingId: string) => void;
92
+ /** Emitted when an upload fails */
93
+ uploadFailed: (taskId: string, error: Error) => void;
94
+ }
95
+ /**
96
+ * Event types emitted by BotaClient
97
+ */
98
+ export interface BotaClientEvents {
99
+ /** Emitted when SDK state changes */
100
+ stateChanged: (state: SdkState) => void;
101
+ /** Emitted when Bluetooth state changes */
102
+ bluetoothStateChanged: (state: BluetoothState) => void;
103
+ /** Emitted on SDK error */
104
+ error: (error: Error) => void;
105
+ }
106
+ //# sourceMappingURL=Status.d.ts.map
@@ -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