@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,542 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export type NativeConfiguration = {
|
|
6
|
+
applicationSupportDirectory?: string;
|
|
7
|
+
logLevel: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type NativeCapabilities = {
|
|
11
|
+
backgroundReconnect: boolean;
|
|
12
|
+
backgroundScan: boolean;
|
|
13
|
+
bluetooth: boolean;
|
|
14
|
+
nativeFileTransfer: boolean;
|
|
15
|
+
platform: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type NativeDiscoveredDevice = {
|
|
19
|
+
id: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
deviceType?: string;
|
|
22
|
+
firmwareVersion?: string;
|
|
23
|
+
macAddress?: string;
|
|
24
|
+
pairingState?: string;
|
|
25
|
+
rssi: number;
|
|
26
|
+
discoveredAtMs: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type NativeConnectedDevice = {
|
|
30
|
+
id: string;
|
|
31
|
+
serialNumber: string;
|
|
32
|
+
deviceType: string;
|
|
33
|
+
firmwareVersion: string;
|
|
34
|
+
hardwareRevision?: string;
|
|
35
|
+
isProvisioned: boolean;
|
|
36
|
+
connectionState: string;
|
|
37
|
+
mtu: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type NativeDeviceDisconnection = {
|
|
41
|
+
error?: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type NativeReconnectOptions = {
|
|
45
|
+
scanTimeoutMs: number;
|
|
46
|
+
connectionTimeoutMs: number;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type NativeDeviceFlags = {
|
|
50
|
+
charging: boolean;
|
|
51
|
+
lowBattery: boolean;
|
|
52
|
+
storageFull: boolean;
|
|
53
|
+
wifiConnected: boolean;
|
|
54
|
+
lteConnected: boolean;
|
|
55
|
+
syncActive: boolean;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type NativeModemInfo = {
|
|
59
|
+
imei?: string;
|
|
60
|
+
iccid?: string;
|
|
61
|
+
operator?: string;
|
|
62
|
+
rat?: string;
|
|
63
|
+
band?: string;
|
|
64
|
+
apn?: string;
|
|
65
|
+
simStatus?: string;
|
|
66
|
+
csq?: number;
|
|
67
|
+
ipAddress?: string;
|
|
68
|
+
modemVoltage?: number;
|
|
69
|
+
modemFirmware?: string;
|
|
70
|
+
roaming?: boolean;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type NativeDeviceStatus = {
|
|
74
|
+
batteryLevel: number;
|
|
75
|
+
batteryMv?: number;
|
|
76
|
+
storageTotalMb: number;
|
|
77
|
+
storageUsedMb: number;
|
|
78
|
+
state: string;
|
|
79
|
+
pendingRecordings: number;
|
|
80
|
+
lastTimeSyncAtMs?: number;
|
|
81
|
+
signalStrength: number;
|
|
82
|
+
flags: NativeDeviceFlags;
|
|
83
|
+
timestamp: number;
|
|
84
|
+
lteStatus: string;
|
|
85
|
+
lteSignalQuality?: number;
|
|
86
|
+
wifiStatus?: string;
|
|
87
|
+
modemInfo?: NativeModemInfo;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type NativeProvisioningMaterialRequest = {
|
|
91
|
+
requestId: string;
|
|
92
|
+
serialNumber: string;
|
|
93
|
+
nonce: string;
|
|
94
|
+
devicePublicKey: string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type NativeProvisioningMaterial = {
|
|
98
|
+
apiEndpoint: string;
|
|
99
|
+
deviceToken: string;
|
|
100
|
+
mtu: number;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type NativeDeprovisionResult = {
|
|
104
|
+
success: boolean;
|
|
105
|
+
error?: string;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type NativeEnabledConnections = {
|
|
109
|
+
wifi: boolean;
|
|
110
|
+
cellular: boolean;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type NativePowerManagement = {
|
|
114
|
+
wifiIdleTimeoutSeconds: number;
|
|
115
|
+
cellularIdleTimeoutSeconds: number;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type NativeDeviceConnectionSettings = {
|
|
119
|
+
enabledConnections: NativeEnabledConnections;
|
|
120
|
+
heartbeatEnabledConnections: NativeEnabledConnections;
|
|
121
|
+
uploadNetworkPreference: ReadonlyArray<string>;
|
|
122
|
+
powerManagement: NativePowerManagement;
|
|
123
|
+
streamingEnabled: boolean;
|
|
124
|
+
streamingFlushIntervalSeconds: number;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type NativeFactoryResetGrantRequest = {
|
|
128
|
+
requestId: string;
|
|
129
|
+
serialNumber: string;
|
|
130
|
+
nonce: string;
|
|
131
|
+
commandId: string;
|
|
132
|
+
bindingGeneration: number;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type NativeFactoryResetCompletion = {
|
|
136
|
+
commandId: string;
|
|
137
|
+
bindingGeneration: number;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type NativeFactoryResetPersistenceRequest = {
|
|
141
|
+
requestId: string;
|
|
142
|
+
localRecordingsDeleted: number;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export type NativeDeviceRecording = {
|
|
146
|
+
uuid: string;
|
|
147
|
+
startedAtMs: number;
|
|
148
|
+
durationMs: number;
|
|
149
|
+
fileSize: number;
|
|
150
|
+
codec: string;
|
|
151
|
+
isEncrypted: boolean;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export type NativeEncryptedUploadV2Recording = {
|
|
155
|
+
uuid: string;
|
|
156
|
+
generation: number;
|
|
157
|
+
ciphertextLength: string;
|
|
158
|
+
ciphertextSha256: string;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type NativeEncryptedUploadV2Capability = {
|
|
162
|
+
encodingVersion: number;
|
|
163
|
+
transferProfileVersion: number;
|
|
164
|
+
rawValueHex: string;
|
|
165
|
+
sha256Hex: string;
|
|
166
|
+
flags: number;
|
|
167
|
+
maximumSignedBlobBytes: number;
|
|
168
|
+
maximumManifestBytes: number;
|
|
169
|
+
maximumDataPayloadBytes: number;
|
|
170
|
+
maximumWindowPackets: number;
|
|
171
|
+
durableCheckpointIntervalBlocks: number;
|
|
172
|
+
maximumMissingSequences: number;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export type NativeEncryptedUploadV2Checkpoint = {
|
|
176
|
+
version: number;
|
|
177
|
+
uploadSessionId: string;
|
|
178
|
+
ownerRevision: number;
|
|
179
|
+
revision: number;
|
|
180
|
+
nextCiphertextOffset: string;
|
|
181
|
+
prefixSha256: string;
|
|
182
|
+
highestContiguousSequence?: number;
|
|
183
|
+
transportSessionId: string;
|
|
184
|
+
sinkRegistrationId: string;
|
|
185
|
+
windowPackets: number;
|
|
186
|
+
dataPayloadBytes: number;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export type NativeEncryptedUploadV2ProfileRequest = {
|
|
190
|
+
requestId: string;
|
|
191
|
+
operationId: string;
|
|
192
|
+
recording: NativeEncryptedUploadV2Recording;
|
|
193
|
+
capability: NativeEncryptedUploadV2Capability;
|
|
194
|
+
checkpoint?: NativeEncryptedUploadV2Checkpoint;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type NativeEncryptedUploadV2ProfileDecision = {
|
|
198
|
+
profile: string;
|
|
199
|
+
uploadSessionId: string;
|
|
200
|
+
ownerRevision: number;
|
|
201
|
+
securityPolicy: string;
|
|
202
|
+
materialRegistrationId: string;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export type NativeEncryptedUploadV2Progress = {
|
|
206
|
+
operationId: string;
|
|
207
|
+
recordingUuid: string;
|
|
208
|
+
phase: string;
|
|
209
|
+
completedBytes: string;
|
|
210
|
+
totalBytes: string;
|
|
211
|
+
checkpointRevision?: number;
|
|
212
|
+
errorCode?: string;
|
|
213
|
+
retryable?: boolean;
|
|
214
|
+
protocolStatus?: number;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export type NativeRecordingTransferProgress = {
|
|
218
|
+
completedUnits: number;
|
|
219
|
+
totalUnits: number;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export type NativeRecordingTransferResult = {
|
|
223
|
+
localPath: string;
|
|
224
|
+
e2eEncrypted: boolean;
|
|
225
|
+
contentSha256?: string;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export type NativeRecordingUploadProgress = {
|
|
229
|
+
taskId: string;
|
|
230
|
+
completedBytes: number;
|
|
231
|
+
totalBytes: number;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export type NativeRecordingUploadRequest = {
|
|
235
|
+
taskId: string;
|
|
236
|
+
recordingId: string;
|
|
237
|
+
deviceId: string;
|
|
238
|
+
localPath: string;
|
|
239
|
+
uploadUrl: string;
|
|
240
|
+
uploadToken?: string;
|
|
241
|
+
completeUrl?: string;
|
|
242
|
+
contentType?: string;
|
|
243
|
+
contentSha256?: string;
|
|
244
|
+
relayUrl?: string;
|
|
245
|
+
relayBearerToken?: string;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export type NativeStreamingStartRequest = {
|
|
249
|
+
sessionId: string;
|
|
250
|
+
recordingUuid: string;
|
|
251
|
+
recordingId: string;
|
|
252
|
+
chunkSizeBytes: number;
|
|
253
|
+
flushIntervalMs: number;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export type NativeStreamingProgress = {
|
|
257
|
+
sessionId: string;
|
|
258
|
+
state: string;
|
|
259
|
+
bytesReceived: number;
|
|
260
|
+
chunksUploaded: number;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export type NativeStreamingChunkDestinationRequest = {
|
|
264
|
+
requestId: string;
|
|
265
|
+
sessionId: string;
|
|
266
|
+
sequence: number;
|
|
267
|
+
encrypted: boolean;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export type NativeStreamingFinalizeRequest = {
|
|
271
|
+
requestId: string;
|
|
272
|
+
sessionId: string;
|
|
273
|
+
totalChunks: number;
|
|
274
|
+
durationMs: number;
|
|
275
|
+
fileSizeBytes: number;
|
|
276
|
+
encrypted: boolean;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export type NativeStreamingUploadDestination = {
|
|
280
|
+
url: string;
|
|
281
|
+
method: string;
|
|
282
|
+
contentType: string;
|
|
283
|
+
bearerToken?: string;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export type NativeStreamingResult = {
|
|
287
|
+
totalBytes: number;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export type NativeRecordingControlResult = {
|
|
291
|
+
success: boolean;
|
|
292
|
+
error?: string;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export type NativeRecordingState = {
|
|
296
|
+
active: boolean;
|
|
297
|
+
recordingId?: string;
|
|
298
|
+
initiatedBy: string;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export type NativeUploadOwnershipRequest = {
|
|
302
|
+
recordingUuid: string;
|
|
303
|
+
uploadId: string;
|
|
304
|
+
destinationId: string;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export type NativeUploadOwnershipResult = {
|
|
308
|
+
kind: string;
|
|
309
|
+
recordingUuid?: string;
|
|
310
|
+
uploadId?: string;
|
|
311
|
+
destinationId?: string;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export type NativeFirmwareImage = {
|
|
315
|
+
version: string;
|
|
316
|
+
sizeUnits: number;
|
|
317
|
+
crc32: number;
|
|
318
|
+
url: string;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
export type NativeFirmwareUpdateProgress = {
|
|
322
|
+
phase: string;
|
|
323
|
+
completedUnits: number;
|
|
324
|
+
totalUnits: number;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export type NativeDeviceLogLine = {
|
|
328
|
+
message: string;
|
|
329
|
+
isBacklog: boolean;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export type NativeWiFiConfigResult = {
|
|
333
|
+
success: boolean;
|
|
334
|
+
error?: string;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export type NativeWiFiStatusInfo = {
|
|
338
|
+
status: string;
|
|
339
|
+
signalStrength?: number;
|
|
340
|
+
ssid?: string;
|
|
341
|
+
lastError?: string;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export type NativeWiFiScanNetwork = {
|
|
345
|
+
ssid: string;
|
|
346
|
+
quality: number;
|
|
347
|
+
isCurrent: boolean;
|
|
348
|
+
isOpen: boolean;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export type NativeDeviceWiFiScanResult = {
|
|
352
|
+
networks: ReadonlyArray<NativeWiFiScanNetwork>;
|
|
353
|
+
currentSsid?: string;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
export interface Spec extends TurboModule {
|
|
357
|
+
readonly onDeviceDiscovered: EventEmitter<NativeDiscoveredDevice>;
|
|
358
|
+
readonly onDeviceDisconnected: EventEmitter<NativeDeviceDisconnection>;
|
|
359
|
+
readonly onDeviceStatusUpdated: EventEmitter<NativeDeviceStatus>;
|
|
360
|
+
readonly onRecordingStateUpdated: EventEmitter<NativeRecordingState>;
|
|
361
|
+
readonly onProvisioningMaterialRequested: EventEmitter<NativeProvisioningMaterialRequest>;
|
|
362
|
+
readonly onFactoryResetGrantRequested: EventEmitter<NativeFactoryResetGrantRequest>;
|
|
363
|
+
readonly onFactoryResetResultPersistenceRequested: EventEmitter<NativeFactoryResetPersistenceRequest>;
|
|
364
|
+
readonly onRecordingTransferProgress: EventEmitter<NativeRecordingTransferProgress>;
|
|
365
|
+
readonly onEncryptedUploadV2ProfileRequested: EventEmitter<NativeEncryptedUploadV2ProfileRequest>;
|
|
366
|
+
readonly onEncryptedUploadV2Progress: EventEmitter<NativeEncryptedUploadV2Progress>;
|
|
367
|
+
readonly onRecordingUploadProgress: EventEmitter<NativeRecordingUploadProgress>;
|
|
368
|
+
readonly onStreamingProgress: EventEmitter<NativeStreamingProgress>;
|
|
369
|
+
readonly onStreamingChunkDestinationRequested: EventEmitter<NativeStreamingChunkDestinationRequest>;
|
|
370
|
+
readonly onStreamingFinalizeRequested: EventEmitter<NativeStreamingFinalizeRequest>;
|
|
371
|
+
readonly onUploadOwnershipProgress: EventEmitter<NativeRecordingTransferProgress>;
|
|
372
|
+
readonly onFirmwareUpdateProgress: EventEmitter<NativeFirmwareUpdateProgress>;
|
|
373
|
+
readonly onDeviceLog: EventEmitter<NativeDeviceLogLine>;
|
|
374
|
+
readonly onWiFiStatusUpdated: EventEmitter<NativeWiFiStatusInfo>;
|
|
375
|
+
configure: (configuration: NativeConfiguration) => Promise<void>;
|
|
376
|
+
connectSelected: (
|
|
377
|
+
device: NativeDiscoveredDevice
|
|
378
|
+
) => Promise<NativeConnectedDevice>;
|
|
379
|
+
destroy: () => Promise<void>;
|
|
380
|
+
deprovision: (
|
|
381
|
+
device: NativeConnectedDevice,
|
|
382
|
+
grantBlob: string
|
|
383
|
+
) => Promise<NativeDeprovisionResult>;
|
|
384
|
+
disconnect: () => Promise<void>;
|
|
385
|
+
isProvisioned: (device: NativeConnectedDevice) => Promise<boolean>;
|
|
386
|
+
readPublicKey: (device: NativeConnectedDevice) => Promise<string | null>;
|
|
387
|
+
readAuthNonce: (device: NativeConnectedDevice) => Promise<string | null>;
|
|
388
|
+
setApiEndpoint: (
|
|
389
|
+
device: NativeConnectedDevice,
|
|
390
|
+
environment: string
|
|
391
|
+
) => Promise<void>;
|
|
392
|
+
deliverCertificate: (
|
|
393
|
+
device: NativeConnectedDevice,
|
|
394
|
+
certificatePem: string,
|
|
395
|
+
privateKeyPem: string
|
|
396
|
+
) => Promise<void>;
|
|
397
|
+
deliverBackendPublicKey: (
|
|
398
|
+
device: NativeConnectedDevice,
|
|
399
|
+
publicKeyHex: string
|
|
400
|
+
) => Promise<void>;
|
|
401
|
+
writeGrant: (
|
|
402
|
+
device: NativeConnectedDevice,
|
|
403
|
+
grantBlob: string
|
|
404
|
+
) => Promise<void>;
|
|
405
|
+
syncTime: (device: NativeConnectedDevice) => Promise<void>;
|
|
406
|
+
requestStartRecording: (
|
|
407
|
+
device: NativeConnectedDevice,
|
|
408
|
+
grantBlob: string
|
|
409
|
+
) => Promise<NativeRecordingControlResult>;
|
|
410
|
+
requestStopRecording: (
|
|
411
|
+
device: NativeConnectedDevice,
|
|
412
|
+
grantBlob: string
|
|
413
|
+
) => Promise<NativeRecordingControlResult>;
|
|
414
|
+
readRecordingState: (
|
|
415
|
+
device: NativeConnectedDevice
|
|
416
|
+
) => Promise<NativeRecordingState>;
|
|
417
|
+
startRecordingStateUpdates: (
|
|
418
|
+
device: NativeConnectedDevice
|
|
419
|
+
) => Promise<void>;
|
|
420
|
+
stopRecordingStateUpdates: () => Promise<void>;
|
|
421
|
+
configureWiFi: (
|
|
422
|
+
device: NativeConnectedDevice,
|
|
423
|
+
ssid: string,
|
|
424
|
+
password: string,
|
|
425
|
+
grantBlob: string
|
|
426
|
+
) => Promise<NativeWiFiConfigResult>;
|
|
427
|
+
disconnectWiFi: (
|
|
428
|
+
device: NativeConnectedDevice
|
|
429
|
+
) => Promise<NativeWiFiConfigResult>;
|
|
430
|
+
factoryReset: (
|
|
431
|
+
device: NativeConnectedDevice,
|
|
432
|
+
commandId: string,
|
|
433
|
+
bindingGeneration: number,
|
|
434
|
+
requiresApplicationPersistence: boolean
|
|
435
|
+
) => Promise<NativeFactoryResetCompletion>;
|
|
436
|
+
getCapabilities: () => Promise<NativeCapabilities>;
|
|
437
|
+
getState: () => Promise<string>;
|
|
438
|
+
listRecordings: (
|
|
439
|
+
device: NativeConnectedDevice
|
|
440
|
+
) => Promise<ReadonlyArray<NativeDeviceRecording>>;
|
|
441
|
+
observeUploadOwnership: (
|
|
442
|
+
device: NativeConnectedDevice,
|
|
443
|
+
request: NativeUploadOwnershipRequest
|
|
444
|
+
) => Promise<NativeUploadOwnershipResult>;
|
|
445
|
+
reconnect: (
|
|
446
|
+
serialNumber: string,
|
|
447
|
+
options: NativeReconnectOptions
|
|
448
|
+
) => Promise<NativeConnectedDevice>;
|
|
449
|
+
provision: (device: NativeConnectedDevice) => Promise<void>;
|
|
450
|
+
rejectApplicationMaterial: (
|
|
451
|
+
requestId: string,
|
|
452
|
+
message: string
|
|
453
|
+
) => Promise<void>;
|
|
454
|
+
resolveProvisioningMaterial: (
|
|
455
|
+
requestId: string,
|
|
456
|
+
material: NativeProvisioningMaterial
|
|
457
|
+
) => Promise<void>;
|
|
458
|
+
resolveFactoryResetGrant: (
|
|
459
|
+
requestId: string,
|
|
460
|
+
grantBlob: string
|
|
461
|
+
) => Promise<void>;
|
|
462
|
+
resolveFactoryResetResultPersistence: (requestId: string) => Promise<void>;
|
|
463
|
+
resumePendingFactoryReset: (
|
|
464
|
+
device: NativeConnectedDevice,
|
|
465
|
+
currentBindingGeneration: number,
|
|
466
|
+
requiresApplicationPersistence: boolean
|
|
467
|
+
) => Promise<NativeFactoryResetCompletion | null>;
|
|
468
|
+
readConnectionSettings: (
|
|
469
|
+
device: NativeConnectedDevice
|
|
470
|
+
) => Promise<NativeDeviceConnectionSettings>;
|
|
471
|
+
startScan: (timeoutMs: number, allowDuplicates: boolean) => Promise<void>;
|
|
472
|
+
readStatus: () => Promise<NativeDeviceStatus>;
|
|
473
|
+
readWiFiStatus: (
|
|
474
|
+
device: NativeConnectedDevice
|
|
475
|
+
) => Promise<NativeWiFiStatusInfo>;
|
|
476
|
+
scanWiFiNetworks: (
|
|
477
|
+
device: NativeConnectedDevice
|
|
478
|
+
) => Promise<NativeDeviceWiFiScanResult>;
|
|
479
|
+
startStatusUpdates: () => Promise<void>;
|
|
480
|
+
startWiFiStatusUpdates: (device: NativeConnectedDevice) => Promise<void>;
|
|
481
|
+
startDeviceLogs: (device: NativeConnectedDevice) => Promise<void>;
|
|
482
|
+
stopDeviceLogs: () => Promise<void>;
|
|
483
|
+
stopStatusUpdates: () => Promise<void>;
|
|
484
|
+
stopWiFiStatusUpdates: () => Promise<void>;
|
|
485
|
+
stopScan: () => Promise<void>;
|
|
486
|
+
syncRecording: (
|
|
487
|
+
device: NativeConnectedDevice,
|
|
488
|
+
recording: NativeDeviceRecording,
|
|
489
|
+
sinkId: string
|
|
490
|
+
) => Promise<NativeRecordingTransferResult>;
|
|
491
|
+
syncEncryptedRecordingV2: (
|
|
492
|
+
device: NativeConnectedDevice,
|
|
493
|
+
recording: NativeEncryptedUploadV2Recording,
|
|
494
|
+
operationId: string
|
|
495
|
+
) => Promise<void>;
|
|
496
|
+
resolveEncryptedUploadV2Profile: (
|
|
497
|
+
requestId: string,
|
|
498
|
+
decision: NativeEncryptedUploadV2ProfileDecision
|
|
499
|
+
) => Promise<void>;
|
|
500
|
+
rejectEncryptedUploadV2Profile: (
|
|
501
|
+
requestId: string,
|
|
502
|
+
errorCode: string
|
|
503
|
+
) => Promise<void>;
|
|
504
|
+
confirmRecording: (
|
|
505
|
+
device: NativeConnectedDevice,
|
|
506
|
+
recordingUuid: string
|
|
507
|
+
) => Promise<void>;
|
|
508
|
+
uploadRecordingFile: (request: NativeRecordingUploadRequest) => Promise<void>;
|
|
509
|
+
cancelRecordingUpload: (taskId: string) => Promise<void>;
|
|
510
|
+
loadCompatibilityUploadQueue: () => Promise<string>;
|
|
511
|
+
saveCompatibilityUploadQueue: (serializedTasks: string) => Promise<void>;
|
|
512
|
+
stopAllRecordingOperations: () => Promise<void>;
|
|
513
|
+
startStreaming: (
|
|
514
|
+
device: NativeConnectedDevice,
|
|
515
|
+
request: NativeStreamingStartRequest
|
|
516
|
+
) => Promise<NativeStreamingResult>;
|
|
517
|
+
abortStreaming: (sessionId: string) => Promise<void>;
|
|
518
|
+
resolveStreamingChunkDestination: (
|
|
519
|
+
requestId: string,
|
|
520
|
+
destination: NativeStreamingUploadDestination
|
|
521
|
+
) => Promise<void>;
|
|
522
|
+
rejectStreamingChunkDestination: (
|
|
523
|
+
requestId: string,
|
|
524
|
+
message: string
|
|
525
|
+
) => Promise<void>;
|
|
526
|
+
resolveStreamingFinalize: (requestId: string) => Promise<void>;
|
|
527
|
+
rejectStreamingFinalize: (
|
|
528
|
+
requestId: string,
|
|
529
|
+
message: string
|
|
530
|
+
) => Promise<void>;
|
|
531
|
+
updateFirmware: (
|
|
532
|
+
device: NativeConnectedDevice,
|
|
533
|
+
image: NativeFirmwareImage
|
|
534
|
+
) => Promise<void>;
|
|
535
|
+
cancelFirmwareUpdate: () => Promise<void>;
|
|
536
|
+
writeConnectionSettings: (
|
|
537
|
+
device: NativeConnectedDevice,
|
|
538
|
+
settings: NativeDeviceConnectionSettings
|
|
539
|
+
) => Promise<void>;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export default TurboModuleRegistry.get<Spec>('BotaDeviceSDK');
|