@shenai/capacitor-sdk 3.1.3 → 3.1.4
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/CapacitorShenaiSdk.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/ai/mxlabs/shenai_sdk/plugins/capacitor/ShenaiSdkCapacitorPlugin.java +28 -0
- package/dist/docs.json +47 -0
- package/dist/esm/definitions.d.ts +9 -0
- package/ios/Sources/ShenaiSdkCapacitorPlugin/ShenaiSdkCapacitorPlugin.swift +20 -0
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
|
|
|
12
12
|
s.source = { :path => '.' }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
14
|
s.ios.deployment_target = '14.0'
|
|
15
|
-
s.dependency 'ShenaiSDK', '3.1.
|
|
15
|
+
s.dependency 'ShenaiSDK', '3.1.4'
|
|
16
16
|
s.dependency 'Capacitor'
|
|
17
17
|
s.swift_version = '5.1'
|
|
18
18
|
end
|
package/android/build.gradle
CHANGED
|
@@ -49,7 +49,7 @@ repositories {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
dependencies {
|
|
52
|
-
implementation "ai.shen:shenai-sdk:3.1.
|
|
52
|
+
implementation "ai.shen:shenai-sdk:3.1.4"
|
|
53
53
|
implementation project(':capacitor-android')
|
|
54
54
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
55
55
|
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
package/android/src/main/java/ai/mxlabs/shenai_sdk/plugins/capacitor/ShenaiSdkCapacitorPlugin.java
CHANGED
|
@@ -394,6 +394,28 @@ public class ShenaiSdkCapacitorPlugin extends Plugin {
|
|
|
394
394
|
call.resolve(ret);
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
+
/** setRelaxedModeConfidenceThreshold(options: { threshold: number }): Promise<void> */
|
|
398
|
+
@PluginMethod
|
|
399
|
+
public void setRelaxedModeConfidenceThreshold(PluginCall call) {
|
|
400
|
+
double threshold = call.getDouble("threshold", 0.0);
|
|
401
|
+
if (sdk != null) {
|
|
402
|
+
sdk.setRelaxedModeConfidenceThreshold(threshold);
|
|
403
|
+
}
|
|
404
|
+
call.resolve();
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** getRelaxedModeConfidenceThreshold(): Promise<number> */
|
|
408
|
+
@PluginMethod
|
|
409
|
+
public void getRelaxedModeConfidenceThreshold(PluginCall call) {
|
|
410
|
+
JSObject ret = new JSObject();
|
|
411
|
+
if (sdk != null) {
|
|
412
|
+
ret.put("value", sdk.getRelaxedModeConfidenceThreshold());
|
|
413
|
+
} else {
|
|
414
|
+
ret.put("value", 0.5);
|
|
415
|
+
}
|
|
416
|
+
call.resolve(ret);
|
|
417
|
+
}
|
|
418
|
+
|
|
397
419
|
/** setMeasurementPreset(options: { preset:number }):Promise<void> */
|
|
398
420
|
@PluginMethod
|
|
399
421
|
public void setMeasurementPreset(PluginCall call) {
|
|
@@ -1177,6 +1199,8 @@ public void getFullPpgSignal(PluginCall call) {
|
|
|
1177
1199
|
|
|
1178
1200
|
if (obj.has("precisionMode"))
|
|
1179
1201
|
settings.precisionMode = ShenAIAndroidSDK.PrecisionMode.values()[obj.getInt("precisionMode")];
|
|
1202
|
+
if (obj.has("relaxedModeConfidenceThreshold"))
|
|
1203
|
+
settings.relaxedModeConfidenceThreshold = obj.getDouble("relaxedModeConfidenceThreshold");
|
|
1180
1204
|
if (obj.has("operatingMode"))
|
|
1181
1205
|
settings.operatingMode = ShenAIAndroidSDK.OperatingMode.values()[obj.getInt("operatingMode")];
|
|
1182
1206
|
if (obj.has("measurementPreset"))
|
|
@@ -1226,6 +1250,10 @@ public void getFullPpgSignal(PluginCall call) {
|
|
|
1226
1250
|
settings.showOutOfRangeResultIndicators = obj.getBoolean("showOutOfRangeResultIndicators");
|
|
1227
1251
|
if (obj.has("showTrialMetricLabels"))
|
|
1228
1252
|
settings.showTrialMetricLabels = obj.getBoolean("showTrialMetricLabels");
|
|
1253
|
+
if (obj.has("enableBcg"))
|
|
1254
|
+
settings.enableBcg = obj.getBoolean("enableBcg");
|
|
1255
|
+
if (obj.has("infiniteModeBufferRetentionSec"))
|
|
1256
|
+
settings.infiniteModeBufferRetentionSec = obj.getDouble("infiniteModeBufferRetentionSec");
|
|
1229
1257
|
if (obj.has("showSignalQualityIndicator"))
|
|
1230
1258
|
settings.showSignalQualityIndicator = obj.getBoolean("showSignalQualityIndicator");
|
|
1231
1259
|
if (obj.has("showSignalTile"))
|
package/dist/docs.json
CHANGED
|
@@ -160,6 +160,22 @@
|
|
|
160
160
|
],
|
|
161
161
|
"slug": "setprecisionmode"
|
|
162
162
|
},
|
|
163
|
+
{
|
|
164
|
+
"name": "setRelaxedModeConfidenceThreshold",
|
|
165
|
+
"signature": "(options: { threshold: number; }) => Promise<void>",
|
|
166
|
+
"parameters": [
|
|
167
|
+
{
|
|
168
|
+
"name": "options",
|
|
169
|
+
"docs": "",
|
|
170
|
+
"type": "{ threshold: number; }"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"returns": "Promise<void>",
|
|
174
|
+
"tags": [],
|
|
175
|
+
"docs": "",
|
|
176
|
+
"complexTypes": [],
|
|
177
|
+
"slug": "setrelaxedmodeconfidencethreshold"
|
|
178
|
+
},
|
|
163
179
|
{
|
|
164
180
|
"name": "setMeasurementPreset",
|
|
165
181
|
"signature": "(options: { preset: MeasurementPreset; }) => Promise<void>",
|
|
@@ -478,6 +494,16 @@
|
|
|
478
494
|
],
|
|
479
495
|
"slug": "getprecisionmode"
|
|
480
496
|
},
|
|
497
|
+
{
|
|
498
|
+
"name": "getRelaxedModeConfidenceThreshold",
|
|
499
|
+
"signature": "() => Promise<{ value: number; }>",
|
|
500
|
+
"parameters": [],
|
|
501
|
+
"returns": "Promise<{ value: number; }>",
|
|
502
|
+
"tags": [],
|
|
503
|
+
"docs": "",
|
|
504
|
+
"complexTypes": [],
|
|
505
|
+
"slug": "getrelaxedmodeconfidencethreshold"
|
|
506
|
+
},
|
|
481
507
|
{
|
|
482
508
|
"name": "getMeasurementPreset",
|
|
483
509
|
"signature": "() => Promise<{ value: MeasurementPreset; }>",
|
|
@@ -1140,6 +1166,13 @@
|
|
|
1140
1166
|
],
|
|
1141
1167
|
"type": "PrecisionMode"
|
|
1142
1168
|
},
|
|
1169
|
+
{
|
|
1170
|
+
"name": "relaxedModeConfidenceThreshold",
|
|
1171
|
+
"tags": [],
|
|
1172
|
+
"docs": "",
|
|
1173
|
+
"complexTypes": [],
|
|
1174
|
+
"type": "number | undefined"
|
|
1175
|
+
},
|
|
1143
1176
|
{
|
|
1144
1177
|
"name": "operatingMode",
|
|
1145
1178
|
"tags": [],
|
|
@@ -1325,6 +1358,20 @@
|
|
|
1325
1358
|
"complexTypes": [],
|
|
1326
1359
|
"type": "boolean | undefined"
|
|
1327
1360
|
},
|
|
1361
|
+
{
|
|
1362
|
+
"name": "enableBcg",
|
|
1363
|
+
"tags": [],
|
|
1364
|
+
"docs": "",
|
|
1365
|
+
"complexTypes": [],
|
|
1366
|
+
"type": "boolean | undefined"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
"name": "infiniteModeBufferRetentionSec",
|
|
1370
|
+
"tags": [],
|
|
1371
|
+
"docs": "",
|
|
1372
|
+
"complexTypes": [],
|
|
1373
|
+
"type": "number | undefined"
|
|
1374
|
+
},
|
|
1328
1375
|
{
|
|
1329
1376
|
"name": "showSignalQualityIndicator",
|
|
1330
1377
|
"tags": [],
|
|
@@ -135,6 +135,7 @@ export declare const enum Event {
|
|
|
135
135
|
}
|
|
136
136
|
export interface InitializationSettings {
|
|
137
137
|
precisionMode?: PrecisionMode;
|
|
138
|
+
relaxedModeConfidenceThreshold?: number;
|
|
138
139
|
operatingMode?: OperatingMode;
|
|
139
140
|
measurementPreset?: MeasurementPreset;
|
|
140
141
|
cameraMode?: CameraMode;
|
|
@@ -160,6 +161,8 @@ export interface InitializationSettings {
|
|
|
160
161
|
saveHealthRisksFactors?: boolean;
|
|
161
162
|
showOutOfRangeResultIndicators?: boolean;
|
|
162
163
|
showTrialMetricLabels?: boolean;
|
|
164
|
+
enableBcg?: boolean;
|
|
165
|
+
infiniteModeBufferRetentionSec?: number;
|
|
163
166
|
showSignalQualityIndicator?: boolean;
|
|
164
167
|
showSignalTile?: boolean;
|
|
165
168
|
showStartStopButton?: boolean;
|
|
@@ -405,6 +408,9 @@ export interface ShenaiSdkCapacitorPlugin {
|
|
|
405
408
|
setPrecisionMode(options: {
|
|
406
409
|
precisionMode: PrecisionMode;
|
|
407
410
|
}): Promise<void>;
|
|
411
|
+
setRelaxedModeConfidenceThreshold(options: {
|
|
412
|
+
threshold: number;
|
|
413
|
+
}): Promise<void>;
|
|
408
414
|
setMeasurementPreset(options: {
|
|
409
415
|
preset: MeasurementPreset;
|
|
410
416
|
}): Promise<void>;
|
|
@@ -465,6 +471,9 @@ export interface ShenaiSdkCapacitorPlugin {
|
|
|
465
471
|
getPrecisionMode(): Promise<{
|
|
466
472
|
value: PrecisionMode;
|
|
467
473
|
}>;
|
|
474
|
+
getRelaxedModeConfidenceThreshold(): Promise<{
|
|
475
|
+
value: number;
|
|
476
|
+
}>;
|
|
468
477
|
getMeasurementPreset(): Promise<{
|
|
469
478
|
value: MeasurementPreset;
|
|
470
479
|
}>;
|
|
@@ -95,6 +95,8 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
95
95
|
CAPPluginMethod(name: "getCalibrationState", returnType: CAPPluginReturnPromise),
|
|
96
96
|
CAPPluginMethod(name: "setPrecisionMode", returnType: CAPPluginReturnPromise),
|
|
97
97
|
CAPPluginMethod(name: "getPrecisionMode", returnType: CAPPluginReturnPromise),
|
|
98
|
+
CAPPluginMethod(name: "setRelaxedModeConfidenceThreshold", returnType: CAPPluginReturnPromise),
|
|
99
|
+
CAPPluginMethod(name: "getRelaxedModeConfidenceThreshold", returnType: CAPPluginReturnPromise),
|
|
98
100
|
CAPPluginMethod(name: "setMeasurementPreset", returnType: CAPPluginReturnPromise),
|
|
99
101
|
CAPPluginMethod(name: "getMeasurementPreset", returnType: CAPPluginReturnPromise),
|
|
100
102
|
CAPPluginMethod(name: "setCameraMode", returnType: CAPPluginReturnPromise),
|
|
@@ -193,12 +195,16 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
193
195
|
|
|
194
196
|
func bool(_ key: String) -> Bool? { dict[key] as? Bool }
|
|
195
197
|
func int (_ key: String) -> Int? { (dict[key] as? NSNumber)?.intValue }
|
|
198
|
+
func double(_ key: String) -> Double? { (dict[key] as? NSNumber)?.doubleValue }
|
|
196
199
|
func string(_ key: String) -> String? { dict[key] as? String }
|
|
197
200
|
|
|
198
201
|
if let v = int("precisionMode"),
|
|
199
202
|
let e = PrecisionMode(rawValue: v) {
|
|
200
203
|
settings.precisionMode = e
|
|
201
204
|
}
|
|
205
|
+
if let v = double("relaxedModeConfidenceThreshold") {
|
|
206
|
+
settings.relaxedModeConfidenceThreshold = NSNumber(value: v)
|
|
207
|
+
}
|
|
202
208
|
if let v = int("operatingMode"),
|
|
203
209
|
let e = OperatingMode(rawValue: v) {
|
|
204
210
|
settings.operatingMode = e
|
|
@@ -246,6 +252,8 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
246
252
|
if let v = bool("saveHealthRisksFactors") { settings.saveHealthRisksFactors = v }
|
|
247
253
|
if let v = bool("showOutOfRangeResultIndicators"){ settings.showOutOfRangeResultIndicators = v }
|
|
248
254
|
if let v = bool("showTrialMetricLabels") { settings.showTrialMetricLabels = v }
|
|
255
|
+
if let v = bool("enableBcg") { settings.enableBcg = v }
|
|
256
|
+
if let v = double("infiniteModeBufferRetentionSec") { settings.infiniteModeBufferRetentionSec = v }
|
|
249
257
|
if let v = bool("showSignalQualityIndicator") { settings.showSignalQualityIndicator = v }
|
|
250
258
|
if let v = bool("showSignalTile") { settings.showSignalTile = v }
|
|
251
259
|
if let v = bool("showStartStopButton") { settings.showStartStopButton = v }
|
|
@@ -503,6 +511,18 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
503
511
|
@objc func getPrecisionMode(_ call: CAPPluginCall) {
|
|
504
512
|
call.resolve(["value": ShenaiSDK.getPrecisionMode().rawValue])
|
|
505
513
|
}
|
|
514
|
+
|
|
515
|
+
@objc func setRelaxedModeConfidenceThreshold(_ call: CAPPluginCall) {
|
|
516
|
+
guard let threshold = call.getDouble("threshold") else {
|
|
517
|
+
call.reject("threshold must be a number"); return
|
|
518
|
+
}
|
|
519
|
+
ShenaiSDK.setRelaxedModeConfidenceThreshold(threshold)
|
|
520
|
+
call.resolve()
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@objc func getRelaxedModeConfidenceThreshold(_ call: CAPPluginCall) {
|
|
524
|
+
call.resolve(["value": ShenaiSDK.getRelaxedModeConfidenceThreshold()])
|
|
525
|
+
}
|
|
506
526
|
|
|
507
527
|
|
|
508
528
|
@objc func setMeasurementPreset(_ call: CAPPluginCall) {
|