@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.
- package/BotaDeviceSDK.podspec +55 -0
- package/LICENSE +21 -0
- package/README.md +101 -0
- package/android/build.gradle +76 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidDevices.kt +172 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLifecycle.kt +100 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLogs.kt +82 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidModels.kt +476 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidOTA.kt +58 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordingUploads.kt +180 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordings.kt +751 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidSecurity.kt +509 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidWiFi.kt +125 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKEncryptedUploadV2Materials.kt +46 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKModule.kt +723 -0
- package/android/src/main/java/dev/bota/sdk/reactnative/BotaDeviceSDKPackage.kt +33 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidDevicesTest.kt +211 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLifecycleTest.kt +132 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidLogsTest.kt +57 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidOTATest.kt +75 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordingUploadsTest.kt +147 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidRecordingsTest.kt +355 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidSecurityTest.kt +523 -0
- package/android/src/test/java/dev/bota/sdk/reactnative/BotaDeviceSDKAndroidWiFiTest.kt +100 -0
- package/generated/codegen-contract.json +3593 -0
- package/ios/BotaDeviceSDK.mm +1300 -0
- package/ios/BotaDeviceSDKAppleBridge.swift +2260 -0
- package/ios/BotaDeviceSDKAppleDevices.swift +191 -0
- package/ios/BotaDeviceSDKAppleLifecycle.swift +167 -0
- package/ios/BotaDeviceSDKAppleLogs.swift +79 -0
- package/ios/BotaDeviceSDKAppleOTA.swift +73 -0
- package/ios/BotaDeviceSDKAppleRecordingUploads.swift +178 -0
- package/ios/BotaDeviceSDKAppleRecordings.swift +670 -0
- package/ios/BotaDeviceSDKAppleSecurity.swift +586 -0
- package/ios/BotaDeviceSDKAppleWiFi.swift +128 -0
- package/ios/BotaDeviceSDKEncryptedUploadV2Materials.swift +99 -0
- package/lib/commonjs/BotaClient.js +194 -0
- package/lib/commonjs/BotaClient.js.map +1 -0
- package/lib/commonjs/ble/constants.js +10 -0
- package/lib/commonjs/ble/constants.js.map +1 -0
- package/lib/commonjs/ble/deviceLogs.js +50 -0
- package/lib/commonjs/ble/deviceLogs.js.map +1 -0
- package/lib/commonjs/cache/DeviceStateCache.js +6 -0
- package/lib/commonjs/cache/DeviceStateCache.js.map +1 -0
- package/lib/commonjs/client.js +746 -0
- package/lib/commonjs/client.js.map +1 -0
- package/lib/commonjs/compatibility/runtime.js +44 -0
- package/lib/commonjs/compatibility/runtime.js.map +1 -0
- package/lib/commonjs/index.js +123 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/managers/DeviceManager.js +647 -0
- package/lib/commonjs/managers/DeviceManager.js.map +1 -0
- package/lib/commonjs/managers/OTAManager.js +140 -0
- package/lib/commonjs/managers/OTAManager.js.map +1 -0
- package/lib/commonjs/managers/RecordingManager.js +444 -0
- package/lib/commonjs/managers/RecordingManager.js.map +1 -0
- package/lib/commonjs/managers/StreamingSession.js +175 -0
- package/lib/commonjs/managers/StreamingSession.js.map +1 -0
- package/lib/commonjs/managers/types.js +6 -0
- package/lib/commonjs/managers/types.js.map +1 -0
- package/lib/commonjs/models/Device.js +2 -0
- package/lib/commonjs/models/Device.js.map +1 -0
- package/lib/commonjs/models/Recording.js +2 -0
- package/lib/commonjs/models/Recording.js.map +1 -0
- package/lib/commonjs/models/Status.js +6 -0
- package/lib/commonjs/models/Status.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/NativeBotaDeviceSDK.js +9 -0
- package/lib/commonjs/specs/NativeBotaDeviceSDK.js.map +1 -0
- package/lib/commonjs/sync/syncStatus.js +178 -0
- package/lib/commonjs/sync/syncStatus.js.map +1 -0
- package/lib/commonjs/utils/errors.js +194 -0
- package/lib/commonjs/utils/errors.js.map +1 -0
- package/lib/commonjs/utils/logger.js +84 -0
- package/lib/commonjs/utils/logger.js.map +1 -0
- package/lib/module/BotaClient.js +189 -0
- package/lib/module/BotaClient.js.map +1 -0
- package/lib/module/ble/constants.js +6 -0
- package/lib/module/ble/constants.js.map +1 -0
- package/lib/module/ble/deviceLogs.js +45 -0
- package/lib/module/ble/deviceLogs.js.map +1 -0
- package/lib/module/cache/DeviceStateCache.js +4 -0
- package/lib/module/cache/DeviceStateCache.js.map +1 -0
- package/lib/module/client.js +740 -0
- package/lib/module/client.js.map +1 -0
- package/lib/module/compatibility/runtime.js +35 -0
- package/lib/module/compatibility/runtime.js.map +1 -0
- package/lib/module/index.js +17 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/managers/DeviceManager.js +641 -0
- package/lib/module/managers/DeviceManager.js.map +1 -0
- package/lib/module/managers/OTAManager.js +134 -0
- package/lib/module/managers/OTAManager.js.map +1 -0
- package/lib/module/managers/RecordingManager.js +438 -0
- package/lib/module/managers/RecordingManager.js.map +1 -0
- package/lib/module/managers/StreamingSession.js +168 -0
- package/lib/module/managers/StreamingSession.js.map +1 -0
- package/lib/module/managers/types.js +4 -0
- package/lib/module/managers/types.js.map +1 -0
- package/lib/module/models/Device.js +2 -0
- package/lib/module/models/Device.js.map +1 -0
- package/lib/module/models/Recording.js +2 -0
- package/lib/module/models/Recording.js.map +1 -0
- package/lib/module/models/Status.js +4 -0
- package/lib/module/models/Status.js.map +1 -0
- package/lib/module/specs/NativeBotaDeviceSDK.js +5 -0
- package/lib/module/specs/NativeBotaDeviceSDK.js.map +1 -0
- package/lib/module/sync/syncStatus.js +174 -0
- package/lib/module/sync/syncStatus.js.map +1 -0
- package/lib/module/utils/errors.js +183 -0
- package/lib/module/utils/errors.js.map +1 -0
- package/lib/module/utils/logger.js +80 -0
- package/lib/module/utils/logger.js.map +1 -0
- package/lib/typescript/BotaClient.d.ts +40 -0
- package/lib/typescript/BotaClient.d.ts.map +1 -0
- package/lib/typescript/ble/constants.d.ts +4 -0
- package/lib/typescript/ble/constants.d.ts.map +1 -0
- package/lib/typescript/ble/deviceLogs.d.ts +10 -0
- package/lib/typescript/ble/deviceLogs.d.ts.map +1 -0
- package/lib/typescript/cache/DeviceStateCache.d.ts +14 -0
- package/lib/typescript/cache/DeviceStateCache.d.ts.map +1 -0
- package/lib/typescript/client.d.ts +208 -0
- package/lib/typescript/client.d.ts.map +1 -0
- package/lib/typescript/compatibility/runtime.d.ts +11 -0
- package/lib/typescript/compatibility/runtime.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +19 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/managers/DeviceManager.d.ts +117 -0
- package/lib/typescript/managers/DeviceManager.d.ts.map +1 -0
- package/lib/typescript/managers/OTAManager.d.ts +25 -0
- package/lib/typescript/managers/OTAManager.d.ts.map +1 -0
- package/lib/typescript/managers/RecordingManager.d.ts +54 -0
- package/lib/typescript/managers/RecordingManager.d.ts.map +1 -0
- package/lib/typescript/managers/StreamingSession.d.ts +35 -0
- package/lib/typescript/managers/StreamingSession.d.ts.map +1 -0
- package/lib/typescript/managers/types.d.ts +19 -0
- package/lib/typescript/managers/types.d.ts.map +1 -0
- package/lib/typescript/models/Device.d.ts +392 -0
- package/lib/typescript/models/Device.d.ts.map +1 -0
- package/lib/typescript/models/Recording.d.ts +259 -0
- package/lib/typescript/models/Recording.d.ts.map +1 -0
- package/lib/typescript/models/Status.d.ts +106 -0
- package/lib/typescript/models/Status.d.ts.map +1 -0
- package/lib/typescript/specs/NativeBotaDeviceSDK.d.ts +393 -0
- package/lib/typescript/specs/NativeBotaDeviceSDK.d.ts.map +1 -0
- package/lib/typescript/sync/syncStatus.d.ts +123 -0
- package/lib/typescript/sync/syncStatus.d.ts.map +1 -0
- package/lib/typescript/utils/errors.d.ts +83 -0
- package/lib/typescript/utils/errors.d.ts.map +1 -0
- package/lib/typescript/utils/logger.d.ts +36 -0
- package/lib/typescript/utils/logger.d.ts.map +1 -0
- package/package.json +100 -0
- package/scripts/bota_device_sdk_spm_workaround.rb +53 -0
- package/src/BotaClient.ts +231 -0
- package/src/ble/constants.ts +3 -0
- package/src/ble/deviceLogs.ts +61 -0
- package/src/cache/DeviceStateCache.ts +20 -0
- package/src/client.ts +1410 -0
- package/src/compatibility/runtime.ts +55 -0
- package/src/index.ts +146 -0
- package/src/managers/DeviceManager.ts +927 -0
- package/src/managers/OTAManager.ts +195 -0
- package/src/managers/RecordingManager.ts +578 -0
- package/src/managers/StreamingSession.ts +212 -0
- package/src/managers/types.ts +36 -0
- package/src/models/Device.ts +484 -0
- package/src/models/Recording.ts +281 -0
- package/src/models/Status.ts +128 -0
- package/src/specs/NativeBotaDeviceSDK.ts +542 -0
- package/src/sync/syncStatus.ts +243 -0
- package/src/utils/errors.ts +327 -0
- package/src/utils/logger.ts +122 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export type NativeConfiguration = {
|
|
4
|
+
applicationSupportDirectory?: string;
|
|
5
|
+
logLevel: string;
|
|
6
|
+
};
|
|
7
|
+
export type NativeCapabilities = {
|
|
8
|
+
backgroundReconnect: boolean;
|
|
9
|
+
backgroundScan: boolean;
|
|
10
|
+
bluetooth: boolean;
|
|
11
|
+
nativeFileTransfer: boolean;
|
|
12
|
+
platform: string;
|
|
13
|
+
};
|
|
14
|
+
export type NativeDiscoveredDevice = {
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
deviceType?: string;
|
|
18
|
+
firmwareVersion?: string;
|
|
19
|
+
macAddress?: string;
|
|
20
|
+
pairingState?: string;
|
|
21
|
+
rssi: number;
|
|
22
|
+
discoveredAtMs: number;
|
|
23
|
+
};
|
|
24
|
+
export type NativeConnectedDevice = {
|
|
25
|
+
id: string;
|
|
26
|
+
serialNumber: string;
|
|
27
|
+
deviceType: string;
|
|
28
|
+
firmwareVersion: string;
|
|
29
|
+
hardwareRevision?: string;
|
|
30
|
+
isProvisioned: boolean;
|
|
31
|
+
connectionState: string;
|
|
32
|
+
mtu: number;
|
|
33
|
+
};
|
|
34
|
+
export type NativeDeviceDisconnection = {
|
|
35
|
+
error?: string;
|
|
36
|
+
};
|
|
37
|
+
export type NativeReconnectOptions = {
|
|
38
|
+
scanTimeoutMs: number;
|
|
39
|
+
connectionTimeoutMs: number;
|
|
40
|
+
};
|
|
41
|
+
export type NativeDeviceFlags = {
|
|
42
|
+
charging: boolean;
|
|
43
|
+
lowBattery: boolean;
|
|
44
|
+
storageFull: boolean;
|
|
45
|
+
wifiConnected: boolean;
|
|
46
|
+
lteConnected: boolean;
|
|
47
|
+
syncActive: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type NativeModemInfo = {
|
|
50
|
+
imei?: string;
|
|
51
|
+
iccid?: string;
|
|
52
|
+
operator?: string;
|
|
53
|
+
rat?: string;
|
|
54
|
+
band?: string;
|
|
55
|
+
apn?: string;
|
|
56
|
+
simStatus?: string;
|
|
57
|
+
csq?: number;
|
|
58
|
+
ipAddress?: string;
|
|
59
|
+
modemVoltage?: number;
|
|
60
|
+
modemFirmware?: string;
|
|
61
|
+
roaming?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type NativeDeviceStatus = {
|
|
64
|
+
batteryLevel: number;
|
|
65
|
+
batteryMv?: number;
|
|
66
|
+
storageTotalMb: number;
|
|
67
|
+
storageUsedMb: number;
|
|
68
|
+
state: string;
|
|
69
|
+
pendingRecordings: number;
|
|
70
|
+
lastTimeSyncAtMs?: number;
|
|
71
|
+
signalStrength: number;
|
|
72
|
+
flags: NativeDeviceFlags;
|
|
73
|
+
timestamp: number;
|
|
74
|
+
lteStatus: string;
|
|
75
|
+
lteSignalQuality?: number;
|
|
76
|
+
wifiStatus?: string;
|
|
77
|
+
modemInfo?: NativeModemInfo;
|
|
78
|
+
};
|
|
79
|
+
export type NativeProvisioningMaterialRequest = {
|
|
80
|
+
requestId: string;
|
|
81
|
+
serialNumber: string;
|
|
82
|
+
nonce: string;
|
|
83
|
+
devicePublicKey: string;
|
|
84
|
+
};
|
|
85
|
+
export type NativeProvisioningMaterial = {
|
|
86
|
+
apiEndpoint: string;
|
|
87
|
+
deviceToken: string;
|
|
88
|
+
mtu: number;
|
|
89
|
+
};
|
|
90
|
+
export type NativeDeprovisionResult = {
|
|
91
|
+
success: boolean;
|
|
92
|
+
error?: string;
|
|
93
|
+
};
|
|
94
|
+
export type NativeEnabledConnections = {
|
|
95
|
+
wifi: boolean;
|
|
96
|
+
cellular: boolean;
|
|
97
|
+
};
|
|
98
|
+
export type NativePowerManagement = {
|
|
99
|
+
wifiIdleTimeoutSeconds: number;
|
|
100
|
+
cellularIdleTimeoutSeconds: number;
|
|
101
|
+
};
|
|
102
|
+
export type NativeDeviceConnectionSettings = {
|
|
103
|
+
enabledConnections: NativeEnabledConnections;
|
|
104
|
+
heartbeatEnabledConnections: NativeEnabledConnections;
|
|
105
|
+
uploadNetworkPreference: ReadonlyArray<string>;
|
|
106
|
+
powerManagement: NativePowerManagement;
|
|
107
|
+
streamingEnabled: boolean;
|
|
108
|
+
streamingFlushIntervalSeconds: number;
|
|
109
|
+
};
|
|
110
|
+
export type NativeFactoryResetGrantRequest = {
|
|
111
|
+
requestId: string;
|
|
112
|
+
serialNumber: string;
|
|
113
|
+
nonce: string;
|
|
114
|
+
commandId: string;
|
|
115
|
+
bindingGeneration: number;
|
|
116
|
+
};
|
|
117
|
+
export type NativeFactoryResetCompletion = {
|
|
118
|
+
commandId: string;
|
|
119
|
+
bindingGeneration: number;
|
|
120
|
+
};
|
|
121
|
+
export type NativeFactoryResetPersistenceRequest = {
|
|
122
|
+
requestId: string;
|
|
123
|
+
localRecordingsDeleted: number;
|
|
124
|
+
};
|
|
125
|
+
export type NativeDeviceRecording = {
|
|
126
|
+
uuid: string;
|
|
127
|
+
startedAtMs: number;
|
|
128
|
+
durationMs: number;
|
|
129
|
+
fileSize: number;
|
|
130
|
+
codec: string;
|
|
131
|
+
isEncrypted: boolean;
|
|
132
|
+
};
|
|
133
|
+
export type NativeEncryptedUploadV2Recording = {
|
|
134
|
+
uuid: string;
|
|
135
|
+
generation: number;
|
|
136
|
+
ciphertextLength: string;
|
|
137
|
+
ciphertextSha256: string;
|
|
138
|
+
};
|
|
139
|
+
export type NativeEncryptedUploadV2Capability = {
|
|
140
|
+
encodingVersion: number;
|
|
141
|
+
transferProfileVersion: number;
|
|
142
|
+
rawValueHex: string;
|
|
143
|
+
sha256Hex: string;
|
|
144
|
+
flags: number;
|
|
145
|
+
maximumSignedBlobBytes: number;
|
|
146
|
+
maximumManifestBytes: number;
|
|
147
|
+
maximumDataPayloadBytes: number;
|
|
148
|
+
maximumWindowPackets: number;
|
|
149
|
+
durableCheckpointIntervalBlocks: number;
|
|
150
|
+
maximumMissingSequences: number;
|
|
151
|
+
};
|
|
152
|
+
export type NativeEncryptedUploadV2Checkpoint = {
|
|
153
|
+
version: number;
|
|
154
|
+
uploadSessionId: string;
|
|
155
|
+
ownerRevision: number;
|
|
156
|
+
revision: number;
|
|
157
|
+
nextCiphertextOffset: string;
|
|
158
|
+
prefixSha256: string;
|
|
159
|
+
highestContiguousSequence?: number;
|
|
160
|
+
transportSessionId: string;
|
|
161
|
+
sinkRegistrationId: string;
|
|
162
|
+
windowPackets: number;
|
|
163
|
+
dataPayloadBytes: number;
|
|
164
|
+
};
|
|
165
|
+
export type NativeEncryptedUploadV2ProfileRequest = {
|
|
166
|
+
requestId: string;
|
|
167
|
+
operationId: string;
|
|
168
|
+
recording: NativeEncryptedUploadV2Recording;
|
|
169
|
+
capability: NativeEncryptedUploadV2Capability;
|
|
170
|
+
checkpoint?: NativeEncryptedUploadV2Checkpoint;
|
|
171
|
+
};
|
|
172
|
+
export type NativeEncryptedUploadV2ProfileDecision = {
|
|
173
|
+
profile: string;
|
|
174
|
+
uploadSessionId: string;
|
|
175
|
+
ownerRevision: number;
|
|
176
|
+
securityPolicy: string;
|
|
177
|
+
materialRegistrationId: string;
|
|
178
|
+
};
|
|
179
|
+
export type NativeEncryptedUploadV2Progress = {
|
|
180
|
+
operationId: string;
|
|
181
|
+
recordingUuid: string;
|
|
182
|
+
phase: string;
|
|
183
|
+
completedBytes: string;
|
|
184
|
+
totalBytes: string;
|
|
185
|
+
checkpointRevision?: number;
|
|
186
|
+
errorCode?: string;
|
|
187
|
+
retryable?: boolean;
|
|
188
|
+
protocolStatus?: number;
|
|
189
|
+
};
|
|
190
|
+
export type NativeRecordingTransferProgress = {
|
|
191
|
+
completedUnits: number;
|
|
192
|
+
totalUnits: number;
|
|
193
|
+
};
|
|
194
|
+
export type NativeRecordingTransferResult = {
|
|
195
|
+
localPath: string;
|
|
196
|
+
e2eEncrypted: boolean;
|
|
197
|
+
contentSha256?: string;
|
|
198
|
+
};
|
|
199
|
+
export type NativeRecordingUploadProgress = {
|
|
200
|
+
taskId: string;
|
|
201
|
+
completedBytes: number;
|
|
202
|
+
totalBytes: number;
|
|
203
|
+
};
|
|
204
|
+
export type NativeRecordingUploadRequest = {
|
|
205
|
+
taskId: string;
|
|
206
|
+
recordingId: string;
|
|
207
|
+
deviceId: string;
|
|
208
|
+
localPath: string;
|
|
209
|
+
uploadUrl: string;
|
|
210
|
+
uploadToken?: string;
|
|
211
|
+
completeUrl?: string;
|
|
212
|
+
contentType?: string;
|
|
213
|
+
contentSha256?: string;
|
|
214
|
+
relayUrl?: string;
|
|
215
|
+
relayBearerToken?: string;
|
|
216
|
+
};
|
|
217
|
+
export type NativeStreamingStartRequest = {
|
|
218
|
+
sessionId: string;
|
|
219
|
+
recordingUuid: string;
|
|
220
|
+
recordingId: string;
|
|
221
|
+
chunkSizeBytes: number;
|
|
222
|
+
flushIntervalMs: number;
|
|
223
|
+
};
|
|
224
|
+
export type NativeStreamingProgress = {
|
|
225
|
+
sessionId: string;
|
|
226
|
+
state: string;
|
|
227
|
+
bytesReceived: number;
|
|
228
|
+
chunksUploaded: number;
|
|
229
|
+
};
|
|
230
|
+
export type NativeStreamingChunkDestinationRequest = {
|
|
231
|
+
requestId: string;
|
|
232
|
+
sessionId: string;
|
|
233
|
+
sequence: number;
|
|
234
|
+
encrypted: boolean;
|
|
235
|
+
};
|
|
236
|
+
export type NativeStreamingFinalizeRequest = {
|
|
237
|
+
requestId: string;
|
|
238
|
+
sessionId: string;
|
|
239
|
+
totalChunks: number;
|
|
240
|
+
durationMs: number;
|
|
241
|
+
fileSizeBytes: number;
|
|
242
|
+
encrypted: boolean;
|
|
243
|
+
};
|
|
244
|
+
export type NativeStreamingUploadDestination = {
|
|
245
|
+
url: string;
|
|
246
|
+
method: string;
|
|
247
|
+
contentType: string;
|
|
248
|
+
bearerToken?: string;
|
|
249
|
+
};
|
|
250
|
+
export type NativeStreamingResult = {
|
|
251
|
+
totalBytes: number;
|
|
252
|
+
};
|
|
253
|
+
export type NativeRecordingControlResult = {
|
|
254
|
+
success: boolean;
|
|
255
|
+
error?: string;
|
|
256
|
+
};
|
|
257
|
+
export type NativeRecordingState = {
|
|
258
|
+
active: boolean;
|
|
259
|
+
recordingId?: string;
|
|
260
|
+
initiatedBy: string;
|
|
261
|
+
};
|
|
262
|
+
export type NativeUploadOwnershipRequest = {
|
|
263
|
+
recordingUuid: string;
|
|
264
|
+
uploadId: string;
|
|
265
|
+
destinationId: string;
|
|
266
|
+
};
|
|
267
|
+
export type NativeUploadOwnershipResult = {
|
|
268
|
+
kind: string;
|
|
269
|
+
recordingUuid?: string;
|
|
270
|
+
uploadId?: string;
|
|
271
|
+
destinationId?: string;
|
|
272
|
+
};
|
|
273
|
+
export type NativeFirmwareImage = {
|
|
274
|
+
version: string;
|
|
275
|
+
sizeUnits: number;
|
|
276
|
+
crc32: number;
|
|
277
|
+
url: string;
|
|
278
|
+
};
|
|
279
|
+
export type NativeFirmwareUpdateProgress = {
|
|
280
|
+
phase: string;
|
|
281
|
+
completedUnits: number;
|
|
282
|
+
totalUnits: number;
|
|
283
|
+
};
|
|
284
|
+
export type NativeDeviceLogLine = {
|
|
285
|
+
message: string;
|
|
286
|
+
isBacklog: boolean;
|
|
287
|
+
};
|
|
288
|
+
export type NativeWiFiConfigResult = {
|
|
289
|
+
success: boolean;
|
|
290
|
+
error?: string;
|
|
291
|
+
};
|
|
292
|
+
export type NativeWiFiStatusInfo = {
|
|
293
|
+
status: string;
|
|
294
|
+
signalStrength?: number;
|
|
295
|
+
ssid?: string;
|
|
296
|
+
lastError?: string;
|
|
297
|
+
};
|
|
298
|
+
export type NativeWiFiScanNetwork = {
|
|
299
|
+
ssid: string;
|
|
300
|
+
quality: number;
|
|
301
|
+
isCurrent: boolean;
|
|
302
|
+
isOpen: boolean;
|
|
303
|
+
};
|
|
304
|
+
export type NativeDeviceWiFiScanResult = {
|
|
305
|
+
networks: ReadonlyArray<NativeWiFiScanNetwork>;
|
|
306
|
+
currentSsid?: string;
|
|
307
|
+
};
|
|
308
|
+
export interface Spec extends TurboModule {
|
|
309
|
+
readonly onDeviceDiscovered: EventEmitter<NativeDiscoveredDevice>;
|
|
310
|
+
readonly onDeviceDisconnected: EventEmitter<NativeDeviceDisconnection>;
|
|
311
|
+
readonly onDeviceStatusUpdated: EventEmitter<NativeDeviceStatus>;
|
|
312
|
+
readonly onRecordingStateUpdated: EventEmitter<NativeRecordingState>;
|
|
313
|
+
readonly onProvisioningMaterialRequested: EventEmitter<NativeProvisioningMaterialRequest>;
|
|
314
|
+
readonly onFactoryResetGrantRequested: EventEmitter<NativeFactoryResetGrantRequest>;
|
|
315
|
+
readonly onFactoryResetResultPersistenceRequested: EventEmitter<NativeFactoryResetPersistenceRequest>;
|
|
316
|
+
readonly onRecordingTransferProgress: EventEmitter<NativeRecordingTransferProgress>;
|
|
317
|
+
readonly onEncryptedUploadV2ProfileRequested: EventEmitter<NativeEncryptedUploadV2ProfileRequest>;
|
|
318
|
+
readonly onEncryptedUploadV2Progress: EventEmitter<NativeEncryptedUploadV2Progress>;
|
|
319
|
+
readonly onRecordingUploadProgress: EventEmitter<NativeRecordingUploadProgress>;
|
|
320
|
+
readonly onStreamingProgress: EventEmitter<NativeStreamingProgress>;
|
|
321
|
+
readonly onStreamingChunkDestinationRequested: EventEmitter<NativeStreamingChunkDestinationRequest>;
|
|
322
|
+
readonly onStreamingFinalizeRequested: EventEmitter<NativeStreamingFinalizeRequest>;
|
|
323
|
+
readonly onUploadOwnershipProgress: EventEmitter<NativeRecordingTransferProgress>;
|
|
324
|
+
readonly onFirmwareUpdateProgress: EventEmitter<NativeFirmwareUpdateProgress>;
|
|
325
|
+
readonly onDeviceLog: EventEmitter<NativeDeviceLogLine>;
|
|
326
|
+
readonly onWiFiStatusUpdated: EventEmitter<NativeWiFiStatusInfo>;
|
|
327
|
+
configure: (configuration: NativeConfiguration) => Promise<void>;
|
|
328
|
+
connectSelected: (device: NativeDiscoveredDevice) => Promise<NativeConnectedDevice>;
|
|
329
|
+
destroy: () => Promise<void>;
|
|
330
|
+
deprovision: (device: NativeConnectedDevice, grantBlob: string) => Promise<NativeDeprovisionResult>;
|
|
331
|
+
disconnect: () => Promise<void>;
|
|
332
|
+
isProvisioned: (device: NativeConnectedDevice) => Promise<boolean>;
|
|
333
|
+
readPublicKey: (device: NativeConnectedDevice) => Promise<string | null>;
|
|
334
|
+
readAuthNonce: (device: NativeConnectedDevice) => Promise<string | null>;
|
|
335
|
+
setApiEndpoint: (device: NativeConnectedDevice, environment: string) => Promise<void>;
|
|
336
|
+
deliverCertificate: (device: NativeConnectedDevice, certificatePem: string, privateKeyPem: string) => Promise<void>;
|
|
337
|
+
deliverBackendPublicKey: (device: NativeConnectedDevice, publicKeyHex: string) => Promise<void>;
|
|
338
|
+
writeGrant: (device: NativeConnectedDevice, grantBlob: string) => Promise<void>;
|
|
339
|
+
syncTime: (device: NativeConnectedDevice) => Promise<void>;
|
|
340
|
+
requestStartRecording: (device: NativeConnectedDevice, grantBlob: string) => Promise<NativeRecordingControlResult>;
|
|
341
|
+
requestStopRecording: (device: NativeConnectedDevice, grantBlob: string) => Promise<NativeRecordingControlResult>;
|
|
342
|
+
readRecordingState: (device: NativeConnectedDevice) => Promise<NativeRecordingState>;
|
|
343
|
+
startRecordingStateUpdates: (device: NativeConnectedDevice) => Promise<void>;
|
|
344
|
+
stopRecordingStateUpdates: () => Promise<void>;
|
|
345
|
+
configureWiFi: (device: NativeConnectedDevice, ssid: string, password: string, grantBlob: string) => Promise<NativeWiFiConfigResult>;
|
|
346
|
+
disconnectWiFi: (device: NativeConnectedDevice) => Promise<NativeWiFiConfigResult>;
|
|
347
|
+
factoryReset: (device: NativeConnectedDevice, commandId: string, bindingGeneration: number, requiresApplicationPersistence: boolean) => Promise<NativeFactoryResetCompletion>;
|
|
348
|
+
getCapabilities: () => Promise<NativeCapabilities>;
|
|
349
|
+
getState: () => Promise<string>;
|
|
350
|
+
listRecordings: (device: NativeConnectedDevice) => Promise<ReadonlyArray<NativeDeviceRecording>>;
|
|
351
|
+
observeUploadOwnership: (device: NativeConnectedDevice, request: NativeUploadOwnershipRequest) => Promise<NativeUploadOwnershipResult>;
|
|
352
|
+
reconnect: (serialNumber: string, options: NativeReconnectOptions) => Promise<NativeConnectedDevice>;
|
|
353
|
+
provision: (device: NativeConnectedDevice) => Promise<void>;
|
|
354
|
+
rejectApplicationMaterial: (requestId: string, message: string) => Promise<void>;
|
|
355
|
+
resolveProvisioningMaterial: (requestId: string, material: NativeProvisioningMaterial) => Promise<void>;
|
|
356
|
+
resolveFactoryResetGrant: (requestId: string, grantBlob: string) => Promise<void>;
|
|
357
|
+
resolveFactoryResetResultPersistence: (requestId: string) => Promise<void>;
|
|
358
|
+
resumePendingFactoryReset: (device: NativeConnectedDevice, currentBindingGeneration: number, requiresApplicationPersistence: boolean) => Promise<NativeFactoryResetCompletion | null>;
|
|
359
|
+
readConnectionSettings: (device: NativeConnectedDevice) => Promise<NativeDeviceConnectionSettings>;
|
|
360
|
+
startScan: (timeoutMs: number, allowDuplicates: boolean) => Promise<void>;
|
|
361
|
+
readStatus: () => Promise<NativeDeviceStatus>;
|
|
362
|
+
readWiFiStatus: (device: NativeConnectedDevice) => Promise<NativeWiFiStatusInfo>;
|
|
363
|
+
scanWiFiNetworks: (device: NativeConnectedDevice) => Promise<NativeDeviceWiFiScanResult>;
|
|
364
|
+
startStatusUpdates: () => Promise<void>;
|
|
365
|
+
startWiFiStatusUpdates: (device: NativeConnectedDevice) => Promise<void>;
|
|
366
|
+
startDeviceLogs: (device: NativeConnectedDevice) => Promise<void>;
|
|
367
|
+
stopDeviceLogs: () => Promise<void>;
|
|
368
|
+
stopStatusUpdates: () => Promise<void>;
|
|
369
|
+
stopWiFiStatusUpdates: () => Promise<void>;
|
|
370
|
+
stopScan: () => Promise<void>;
|
|
371
|
+
syncRecording: (device: NativeConnectedDevice, recording: NativeDeviceRecording, sinkId: string) => Promise<NativeRecordingTransferResult>;
|
|
372
|
+
syncEncryptedRecordingV2: (device: NativeConnectedDevice, recording: NativeEncryptedUploadV2Recording, operationId: string) => Promise<void>;
|
|
373
|
+
resolveEncryptedUploadV2Profile: (requestId: string, decision: NativeEncryptedUploadV2ProfileDecision) => Promise<void>;
|
|
374
|
+
rejectEncryptedUploadV2Profile: (requestId: string, errorCode: string) => Promise<void>;
|
|
375
|
+
confirmRecording: (device: NativeConnectedDevice, recordingUuid: string) => Promise<void>;
|
|
376
|
+
uploadRecordingFile: (request: NativeRecordingUploadRequest) => Promise<void>;
|
|
377
|
+
cancelRecordingUpload: (taskId: string) => Promise<void>;
|
|
378
|
+
loadCompatibilityUploadQueue: () => Promise<string>;
|
|
379
|
+
saveCompatibilityUploadQueue: (serializedTasks: string) => Promise<void>;
|
|
380
|
+
stopAllRecordingOperations: () => Promise<void>;
|
|
381
|
+
startStreaming: (device: NativeConnectedDevice, request: NativeStreamingStartRequest) => Promise<NativeStreamingResult>;
|
|
382
|
+
abortStreaming: (sessionId: string) => Promise<void>;
|
|
383
|
+
resolveStreamingChunkDestination: (requestId: string, destination: NativeStreamingUploadDestination) => Promise<void>;
|
|
384
|
+
rejectStreamingChunkDestination: (requestId: string, message: string) => Promise<void>;
|
|
385
|
+
resolveStreamingFinalize: (requestId: string) => Promise<void>;
|
|
386
|
+
rejectStreamingFinalize: (requestId: string, message: string) => Promise<void>;
|
|
387
|
+
updateFirmware: (device: NativeConnectedDevice, image: NativeFirmwareImage) => Promise<void>;
|
|
388
|
+
cancelFirmwareUpdate: () => Promise<void>;
|
|
389
|
+
writeConnectionSettings: (device: NativeConnectedDevice, settings: NativeDeviceConnectionSettings) => Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
declare const _default: Spec | null;
|
|
392
|
+
export default _default;
|
|
393
|
+
//# sourceMappingURL=NativeBotaDeviceSDK.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBotaDeviceSDK.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeBotaDeviceSDK.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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,CAAC;CACpB;;AAED,wBAA8D"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized sync-status derivation.
|
|
3
|
+
*
|
|
4
|
+
* Apps display "what's happening with the recordings on the device right now"
|
|
5
|
+
* in multiple places — sync banners, pending-recordings rows, recording detail
|
|
6
|
+
* pages, list-item subtitles. Without a shared rule set every screen tends to
|
|
7
|
+
* compute its own label from raw inputs, leading to screens that disagree
|
|
8
|
+
* (one shows "Bluetooth syncing", another shows "4G uploading").
|
|
9
|
+
*
|
|
10
|
+
* This module owns the *rules* (pure function over a typed input shape). Apps
|
|
11
|
+
* own the *subscription* (a thin hook that reads from whatever stores/queries
|
|
12
|
+
* they use and calls `deriveSyncStatus`). The label text returned here is the
|
|
13
|
+
* canonical surface — every consumer should read `label` / `shortLabel`
|
|
14
|
+
* verbatim rather than re-deriving from `kind`/`channel`.
|
|
15
|
+
*
|
|
16
|
+
* Precedence policy (when multiple signals are true simultaneously):
|
|
17
|
+
* 1. Live recording — if the device is actively recording AND streaming is
|
|
18
|
+
* enabled, show "Streaming via <channel>" regardless of pending uploads.
|
|
19
|
+
* 2. Actual device transport — if `device.syncActive` is set and a radio
|
|
20
|
+
* (WiFi / 4G) is up, the label reflects *that* transport, even if the
|
|
21
|
+
* app initiated the sync via BLE. This matches what bytes are actually
|
|
22
|
+
* moving and avoids the smart-sync handoff flicker where the app's
|
|
23
|
+
* "BLE pull" state lags the device's "4G upload" reality.
|
|
24
|
+
* 3. App-driven BLE pull — `appDriving.active` (e.g. the consumer's
|
|
25
|
+
* `useSyncAllRecordings` global) shows as "Bluetooth syncing N/M".
|
|
26
|
+
* 4. Device claims sync but no radio is up — `'waiting_channel'`, best-guess
|
|
27
|
+
* channel from `wifiAttempting` / `lteAttempting`.
|
|
28
|
+
* 5. Otherwise — `'idle'`.
|
|
29
|
+
*/
|
|
30
|
+
export type SyncKind = 'idle' | 'ble_pull' | 'wifi_upload' | 'lte_upload' | 'streaming' | 'waiting_channel';
|
|
31
|
+
export type SyncChannel = 'Bluetooth' | 'WiFi' | '4G';
|
|
32
|
+
/**
|
|
33
|
+
* Inputs to `deriveSyncStatus`. Every field is what the *consumer app* already
|
|
34
|
+
* has on hand — the SDK does not subscribe to any state itself.
|
|
35
|
+
*
|
|
36
|
+
* `appDriving` — populated from the consumer's app-level sync state (e.g. the
|
|
37
|
+
* global `isSyncing` + `syncAllProgress` exposed by their `useSyncAll*`
|
|
38
|
+
* hook). Set `active: false` if the app isn't currently pulling.
|
|
39
|
+
*
|
|
40
|
+
* `device` — flags reported by the device. For BLE-connected devices these
|
|
41
|
+
* come from `BotaClient.devices.on('statusUpdate', ...)`. For backend-only
|
|
42
|
+
* visibility (no BLE) they come from the heartbeat-derived state on the
|
|
43
|
+
* server, merged at the app layer.
|
|
44
|
+
*
|
|
45
|
+
* `bleConnected` — whether the app currently has a live BLE link to this
|
|
46
|
+
* device. Used to disambiguate `'ble_pull'` from `'4g/wifi_upload'`.
|
|
47
|
+
*/
|
|
48
|
+
export interface SyncStatusInputs {
|
|
49
|
+
appDriving: {
|
|
50
|
+
/** True while the consumer's sync flow is actively pulling via BLE. */
|
|
51
|
+
active: boolean;
|
|
52
|
+
/** 1-indexed current item. Undefined if not tracking per-item progress. */
|
|
53
|
+
currentIndex?: number;
|
|
54
|
+
/** Total items being synced. Undefined if unknown. */
|
|
55
|
+
total?: number;
|
|
56
|
+
};
|
|
57
|
+
device: {
|
|
58
|
+
/** Device's own sync-active flag (bit 5 of the firmware status flags). */
|
|
59
|
+
syncActive: boolean;
|
|
60
|
+
/** Device is currently recording. */
|
|
61
|
+
isRecording: boolean;
|
|
62
|
+
/** Device has a usable WiFi connection. */
|
|
63
|
+
wifiConnected: boolean;
|
|
64
|
+
/** Device has a usable LTE/4G connection. */
|
|
65
|
+
lteConnected: boolean;
|
|
66
|
+
/** Device's WiFi radio is powered up and trying (connecting / scanning). */
|
|
67
|
+
wifiAttempting: boolean;
|
|
68
|
+
/** Device's LTE radio is powered up and trying (registered / searching). */
|
|
69
|
+
lteAttempting: boolean;
|
|
70
|
+
/** Streaming upload mode is enabled on the device. */
|
|
71
|
+
streamingEnabled: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Device's upload-channel preference order (highest priority first), e.g.
|
|
74
|
+
* `['wifi', 'ble', 'cellular']`. When provided, the streaming channel is
|
|
75
|
+
* resolved by walking this list and picking the first channel that is both
|
|
76
|
+
* enabled (`enabledConnections`) and currently up — so a device whose LTE
|
|
77
|
+
* radio is connected but whose preference ranks BLE higher (or has cellular
|
|
78
|
+
* disabled) is correctly shown as streaming via Bluetooth, not 4G.
|
|
79
|
+
* Omit to fall back to the legacy "first connected radio wins" heuristic.
|
|
80
|
+
*/
|
|
81
|
+
uploadPreference?: Array<'wifi' | 'ble' | 'cellular'>;
|
|
82
|
+
/** Which upload channels are enabled on the device. */
|
|
83
|
+
enabledConnections?: {
|
|
84
|
+
wifi: boolean;
|
|
85
|
+
cellular: boolean;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/** BLE link to the device is currently up. */
|
|
89
|
+
bleConnected: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface SyncStatus {
|
|
92
|
+
kind: SyncKind;
|
|
93
|
+
/** Resolved channel ('Bluetooth' / 'WiFi' / '4G'), absent for idle. */
|
|
94
|
+
channel?: SyncChannel;
|
|
95
|
+
/** 1-indexed current item, if known. */
|
|
96
|
+
currentIndex?: number;
|
|
97
|
+
/** Total items, if known. */
|
|
98
|
+
total?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Full label suitable for banners. Examples:
|
|
101
|
+
* "Syncing 2/5 via Bluetooth..."
|
|
102
|
+
* "Uploading 1/3 via 4G..."
|
|
103
|
+
* "Streaming via WiFi"
|
|
104
|
+
* "Waiting for upload channel..."
|
|
105
|
+
* "" (when kind === 'idle')
|
|
106
|
+
*/
|
|
107
|
+
label: string;
|
|
108
|
+
/**
|
|
109
|
+
* Compact label for tight UI (table rows, badges). Examples:
|
|
110
|
+
* "Bluetooth syncing 2/5"
|
|
111
|
+
* "4G uploading 1/3"
|
|
112
|
+
* "Streaming"
|
|
113
|
+
* "" (when kind === 'idle')
|
|
114
|
+
*/
|
|
115
|
+
shortLabel: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Pure derivation: given a snapshot of app + device + link state, return the
|
|
119
|
+
* single canonical `SyncStatus`. Safe to call on every render (no I/O, no
|
|
120
|
+
* allocations beyond the return value and label strings).
|
|
121
|
+
*/
|
|
122
|
+
export declare function deriveSyncStatus(inputs: SyncStatusInputs): SyncStatus;
|
|
123
|
+
//# sourceMappingURL=syncStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncStatus.d.ts","sourceRoot":"","sources":["../../../src/sync/syncStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,UAAU,GACV,aAAa,GACb,YAAY,GACZ,WAAW,GACX,iBAAiB,CAAC;AAEtB,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE;QACV,uEAAuE;QACvE,MAAM,EAAE,OAAO,CAAC;QAChB,2EAA2E;QAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,sDAAsD;QACtD,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACN,0EAA0E;QAC1E,UAAU,EAAE,OAAO,CAAC;QACpB,qCAAqC;QACrC,WAAW,EAAE,OAAO,CAAC;QACrB,2CAA2C;QAC3C,aAAa,EAAE,OAAO,CAAC;QACvB,6CAA6C;QAC7C,YAAY,EAAE,OAAO,CAAC;QACtB,4EAA4E;QAC5E,cAAc,EAAE,OAAO,CAAC;QACxB,4EAA4E;QAC5E,aAAa,EAAE,OAAO,CAAC;QACvB,sDAAsD;QACtD,gBAAgB,EAAE,OAAO,CAAC;QAC1B;;;;;;;;WAQG;QACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC,CAAC;QACtD,uDAAuD;QACvD,kBAAkB,CAAC,EAAE;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAE,CAAC;KAC3D,CAAC;IACF,8CAA8C;IAC9C,YAAY,EAAE,OAAO,CAAC;CACvB;AAwBD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,uEAAuE;IACvE,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AASD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,CAoFrE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error types for the Bota SDK
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Base error class for all Bota SDK errors
|
|
6
|
+
*/
|
|
7
|
+
export declare class BotaError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly cause?: Error | undefined;
|
|
10
|
+
constructor(message: string, code: string, cause?: Error | undefined);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Bluetooth-related errors
|
|
14
|
+
*/
|
|
15
|
+
export declare class BluetoothError extends BotaError {
|
|
16
|
+
constructor(message: string, code: string, cause?: Error);
|
|
17
|
+
static unavailable(): BluetoothError;
|
|
18
|
+
static unauthorized(): BluetoothError;
|
|
19
|
+
static poweredOff(): BluetoothError;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Device-related errors
|
|
23
|
+
*/
|
|
24
|
+
export declare class DeviceError extends BotaError {
|
|
25
|
+
readonly deviceId?: string | undefined;
|
|
26
|
+
constructor(message: string, code: string, deviceId?: string | undefined, cause?: Error);
|
|
27
|
+
static notFound(deviceId: string): DeviceError;
|
|
28
|
+
static connectionFailed(deviceId: string, cause?: Error): DeviceError;
|
|
29
|
+
static connectionLost(deviceId: string, during?: string): DeviceError;
|
|
30
|
+
static bondingFailed(deviceId: string, cause?: Error): DeviceError;
|
|
31
|
+
static notConnected(deviceId: string): DeviceError;
|
|
32
|
+
static alreadyConnected(deviceId: string): DeviceError;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Provisioning-related errors
|
|
36
|
+
*/
|
|
37
|
+
export declare class ProvisioningError extends BotaError {
|
|
38
|
+
readonly deviceId?: string | undefined;
|
|
39
|
+
constructor(message: string, code: string, deviceId?: string | undefined, cause?: Error);
|
|
40
|
+
static invalidToken(deviceId: string): ProvisioningError;
|
|
41
|
+
static storageError(deviceId: string): ProvisioningError;
|
|
42
|
+
static chunkError(deviceId: string): ProvisioningError;
|
|
43
|
+
static alreadyProvisioned(deviceId: string): ProvisioningError;
|
|
44
|
+
static alreadyPaired(deviceId: string): ProvisioningError;
|
|
45
|
+
static timeout(deviceId: string): ProvisioningError;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Transfer-related errors
|
|
49
|
+
*/
|
|
50
|
+
export declare class TransferError extends BotaError {
|
|
51
|
+
readonly recordingUuid?: string | undefined;
|
|
52
|
+
constructor(message: string, code: string, recordingUuid?: string | undefined, cause?: Error);
|
|
53
|
+
static recordingNotFound(uuid: string): TransferError;
|
|
54
|
+
static checksumMismatch(uuid: string): TransferError;
|
|
55
|
+
static interrupted(uuid: string, cause?: Error): TransferError;
|
|
56
|
+
static timeout(uuid: string): TransferError;
|
|
57
|
+
static deviceError(uuid: string, errorCode: number): TransferError;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Upload-related errors
|
|
61
|
+
*/
|
|
62
|
+
export declare class UploadError extends BotaError {
|
|
63
|
+
readonly taskId?: string | undefined;
|
|
64
|
+
constructor(message: string, code: string, taskId?: string | undefined, cause?: Error);
|
|
65
|
+
static urlExpired(taskId: string): UploadError;
|
|
66
|
+
static networkUnavailable(): UploadError;
|
|
67
|
+
static uploadFailed(taskId: string, cause?: Error): UploadError;
|
|
68
|
+
static completionFailed(taskId: string, cause?: Error): UploadError;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* SDK state errors
|
|
72
|
+
*/
|
|
73
|
+
export declare class SdkError extends BotaError {
|
|
74
|
+
constructor(message: string, code: string, cause?: Error);
|
|
75
|
+
static notInitialized(): SdkError;
|
|
76
|
+
static invalidState(expected: string, actual: string): SdkError;
|
|
77
|
+
static timeout(operation: string): SdkError;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Type guard to check if an error is a BotaError
|
|
81
|
+
*/
|
|
82
|
+
export declare function isBotaError(error: unknown): error is BotaError;
|
|
83
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;aAGhB,IAAI,EAAE,MAAM;aACZ,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,KAAK,YAAA;CAMhC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,SAAS;gBAC/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAMxD,MAAM,CAAC,WAAW,IAAI,cAAc;IAOpC,MAAM,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,EAAE,KAAK,CAAC,EAAE,KAAK;IAMxD,MAAM,CAAC,cAAc,IAAI,QAAQ;IAOjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ;IAO/D,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ;CAG5C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { LogLevel } from '../models/Status';
|
|
2
|
+
export type SdkLogLevel = Exclude<LogLevel, 'none'>;
|
|
3
|
+
export interface SdkLogEntry {
|
|
4
|
+
level: SdkLogLevel;
|
|
5
|
+
message: string;
|
|
6
|
+
context?: Record<string, unknown>;
|
|
7
|
+
timestamp: Date;
|
|
8
|
+
}
|
|
9
|
+
export type LogHandler = (entry: SdkLogEntry) => void;
|
|
10
|
+
declare class Logger {
|
|
11
|
+
private level;
|
|
12
|
+
private readonly prefix;
|
|
13
|
+
private handler;
|
|
14
|
+
setLevel(level: LogLevel): void;
|
|
15
|
+
getLevel(): LogLevel;
|
|
16
|
+
setHandler(handler: LogHandler | null): void;
|
|
17
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
18
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
19
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
20
|
+
error(message: string, error?: Error, context?: Record<string, unknown>): void;
|
|
21
|
+
tag(tag: string): TaggedLogger;
|
|
22
|
+
private write;
|
|
23
|
+
private format;
|
|
24
|
+
}
|
|
25
|
+
declare class TaggedLogger {
|
|
26
|
+
private readonly parent;
|
|
27
|
+
private readonly tagValue;
|
|
28
|
+
constructor(parent: Logger, tagValue: string);
|
|
29
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
30
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
31
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
32
|
+
error(message: string, error?: Error, context?: Record<string, unknown>): void;
|
|
33
|
+
}
|
|
34
|
+
export declare const logger: Logger;
|
|
35
|
+
export type { TaggedLogger };
|
|
36
|
+
//# sourceMappingURL=logger.d.ts.map
|