@shenai/capacitor-sdk 3.1.12 → 3.1.14

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.
@@ -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.12'
15
+ s.dependency 'ShenaiSDK', '3.1.14'
16
16
  s.dependency 'Capacitor'
17
17
  s.swift_version = '5.1'
18
18
  end
@@ -49,7 +49,7 @@ repositories {
49
49
  }
50
50
 
51
51
  dependencies {
52
- implementation "ai.shen:shenai-sdk:3.1.12"
52
+ implementation "ai.shen:shenai-sdk:3.1.14"
53
53
  implementation project(':capacitor-android')
54
54
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
55
55
  implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
@@ -360,6 +360,34 @@ public class ShenaiSdkCapacitorPlugin extends Plugin {
360
360
  call.resolve(ret);
361
361
  }
362
362
 
363
+ @PluginMethod
364
+ public void setBpCalibrationOffset(PluginCall call) {
365
+ Double systolicOffset = call.getDouble("systolicOffset");
366
+ Double diastolicOffset = call.getDouble("diastolicOffset");
367
+ if (systolicOffset == null || diastolicOffset == null) {
368
+ call.reject("systolicOffset and diastolicOffset are required");
369
+ return;
370
+ }
371
+ if (sdk != null) {
372
+ sdk.setBpCalibrationOffset(systolicOffset, diastolicOffset);
373
+ }
374
+ call.resolve();
375
+ }
376
+
377
+ @PluginMethod
378
+ public void getSbpCalibrationOffset(PluginCall call) {
379
+ JSObject ret = new JSObject();
380
+ ret.put("value", sdk != null ? sdk.getSbpCalibrationOffset() : 0.0);
381
+ call.resolve(ret);
382
+ }
383
+
384
+ @PluginMethod
385
+ public void getDbpCalibrationOffset(PluginCall call) {
386
+ JSObject ret = new JSObject();
387
+ ret.put("value", sdk != null ? sdk.getDbpCalibrationOffset() : 0.0);
388
+ call.resolve(ret);
389
+ }
390
+
363
391
  /** getCalibrationState(): Promise<number> */
364
392
  @PluginMethod
365
393
  public void getCalibrationState(PluginCall call) {
@@ -769,6 +797,14 @@ public class ShenaiSdkCapacitorPlugin extends Plugin {
769
797
  call.resolve(ret);
770
798
  }
771
799
 
800
+ @PluginMethod
801
+ public void getRequiredModelsDownloadProgressPercentage(PluginCall call) {
802
+ JSObject ret = new JSObject();
803
+ if (sdk != null) ret.put("value", sdk.getRequiredModelsDownloadProgressPercentage());
804
+ else ret.put("value", 0);
805
+ call.resolve(ret);
806
+ }
807
+
772
808
  /** getMeasurementProgressPercentage():Promise<number> */
773
809
  @PluginMethod
774
810
  public void getMeasurementProgressPercentage(PluginCall call) {
package/dist/docs.json CHANGED
@@ -94,6 +94,22 @@
94
94
  "complexTypes": [],
95
95
  "slug": "setoverlayswebview"
96
96
  },
97
+ {
98
+ "name": "setBpCalibrationOffset",
99
+ "signature": "(options: { systolicOffset: number; diastolicOffset: number; }) => Promise<void>",
100
+ "parameters": [
101
+ {
102
+ "name": "options",
103
+ "docs": "",
104
+ "type": "{ systolicOffset: number; diastolicOffset: number; }"
105
+ }
106
+ ],
107
+ "returns": "Promise<void>",
108
+ "tags": [],
109
+ "docs": "",
110
+ "complexTypes": [],
111
+ "slug": "setbpcalibrationoffset"
112
+ },
97
113
  {
98
114
  "name": "setOperatingMode",
99
115
  "signature": "(options: { operatingMode: OperatingMode; }) => Promise<void>",
@@ -470,6 +486,26 @@
470
486
  ],
471
487
  "slug": "getoperatingmode"
472
488
  },
489
+ {
490
+ "name": "getSbpCalibrationOffset",
491
+ "signature": "() => Promise<{ value: number; }>",
492
+ "parameters": [],
493
+ "returns": "Promise<{ value: number; }>",
494
+ "tags": [],
495
+ "docs": "",
496
+ "complexTypes": [],
497
+ "slug": "getsbpcalibrationoffset"
498
+ },
499
+ {
500
+ "name": "getDbpCalibrationOffset",
501
+ "signature": "() => Promise<{ value: number; }>",
502
+ "parameters": [],
503
+ "returns": "Promise<{ value: number; }>",
504
+ "tags": [],
505
+ "docs": "",
506
+ "complexTypes": [],
507
+ "slug": "getdbpcalibrationoffset"
508
+ },
473
509
  {
474
510
  "name": "getCalibrationState",
475
511
  "signature": "() => Promise<{ value: CalibrationState; }>",
@@ -788,6 +824,16 @@
788
824
  "complexTypes": [],
789
825
  "slug": "arerequiredmodelsdownloaded"
790
826
  },
827
+ {
828
+ "name": "getRequiredModelsDownloadProgressPercentage",
829
+ "signature": "() => Promise<{ value: number; }>",
830
+ "parameters": [],
831
+ "returns": "Promise<{ value: number; }>",
832
+ "tags": [],
833
+ "docs": "Required model download percentage (0–100); 100 when ready, 0 before initialization.",
834
+ "complexTypes": [],
835
+ "slug": "getrequiredmodelsdownloadprogresspercentage"
836
+ },
791
837
  {
792
838
  "name": "getMeasurementProgressPercentage",
793
839
  "signature": "() => Promise<{ value: number; }>",
@@ -400,6 +400,10 @@ export interface ShenaiSdkCapacitorPlugin {
400
400
  setOverlaysWebview(options: {
401
401
  overlay: boolean;
402
402
  }): Promise<void>;
403
+ setBpCalibrationOffset(options: {
404
+ systolicOffset: number;
405
+ diastolicOffset: number;
406
+ }): Promise<void>;
403
407
  setOperatingMode(options: {
404
408
  operatingMode: OperatingMode;
405
409
  }): Promise<void>;
@@ -466,6 +470,12 @@ export interface ShenaiSdkCapacitorPlugin {
466
470
  getOperatingMode(): Promise<{
467
471
  value: OperatingMode;
468
472
  }>;
473
+ getSbpCalibrationOffset(): Promise<{
474
+ value: number;
475
+ }>;
476
+ getDbpCalibrationOffset(): Promise<{
477
+ value: number;
478
+ }>;
469
479
  getCalibrationState(): Promise<{
470
480
  value: CalibrationState;
471
481
  }>;
@@ -548,6 +558,10 @@ export interface ShenaiSdkCapacitorPlugin {
548
558
  areRequiredModelsDownloaded(): Promise<{
549
559
  value: boolean;
550
560
  }>;
561
+ /** Required model download percentage (0–100); 100 when ready, 0 before initialization. */
562
+ getRequiredModelsDownloadProgressPercentage(): Promise<{
563
+ value: number;
564
+ }>;
551
565
  getMeasurementProgressPercentage(): Promise<{
552
566
  value: number;
553
567
  }>;
@@ -92,6 +92,9 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
92
92
  CAPPluginMethod(name: "stopMeasurement", returnType: CAPPluginReturnPromise),
93
93
  CAPPluginMethod(name: "resetMeasurementSession", returnType: CAPPluginReturnPromise),
94
94
  CAPPluginMethod(name: "getOperatingMode", returnType: CAPPluginReturnPromise),
95
+ CAPPluginMethod(name: "setBpCalibrationOffset", returnType: CAPPluginReturnPromise),
96
+ CAPPluginMethod(name: "getSbpCalibrationOffset", returnType: CAPPluginReturnPromise),
97
+ CAPPluginMethod(name: "getDbpCalibrationOffset", returnType: CAPPluginReturnPromise),
95
98
  CAPPluginMethod(name: "getCalibrationState", returnType: CAPPluginReturnPromise),
96
99
  CAPPluginMethod(name: "setPrecisionMode", returnType: CAPPluginReturnPromise),
97
100
  CAPPluginMethod(name: "getPrecisionMode", returnType: CAPPluginReturnPromise),
@@ -135,6 +138,7 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
135
138
  CAPPluginMethod(name: "getCurrentViolatedMeasurementEnvironmentCondition", returnType: CAPPluginReturnPromise),
136
139
  CAPPluginMethod(name: "isReadyToStartMeasurement", returnType: CAPPluginReturnPromise),
137
140
  CAPPluginMethod(name: "areRequiredModelsDownloaded", returnType: CAPPluginReturnPromise),
141
+ CAPPluginMethod(name: "getRequiredModelsDownloadProgressPercentage", returnType: CAPPluginReturnPromise),
138
142
  CAPPluginMethod(name: "getMeasurementProgressPercentage", returnType: CAPPluginReturnPromise),
139
143
  CAPPluginMethod(name: "getHeartRate10s", returnType: CAPPluginReturnPromise),
140
144
  CAPPluginMethod(name: "getHeartRate4s", returnType: CAPPluginReturnPromise),
@@ -495,6 +499,24 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
495
499
  call.resolve(["value": ShenaiSDK.getOperatingMode().rawValue])
496
500
  }
497
501
 
502
+ @objc func setBpCalibrationOffset(_ call: CAPPluginCall) {
503
+ guard let systolicOffset = call.getDouble("systolicOffset"),
504
+ let diastolicOffset = call.getDouble("diastolicOffset") else {
505
+ call.reject("systolicOffset and diastolicOffset are required")
506
+ return
507
+ }
508
+ ShenaiSDK.setBpCalibrationOffset(systolicOffset, diastolic: diastolicOffset)
509
+ call.resolve()
510
+ }
511
+
512
+ @objc func getSbpCalibrationOffset(_ call: CAPPluginCall) {
513
+ call.resolve(["value": ShenaiSDK.getSbpCalibrationOffset()])
514
+ }
515
+
516
+ @objc func getDbpCalibrationOffset(_ call: CAPPluginCall) {
517
+ call.resolve(["value": ShenaiSDK.getDbpCalibrationOffset()])
518
+ }
519
+
498
520
  @objc func getCalibrationState(_ call: CAPPluginCall) {
499
521
  call.resolve(["value": ShenaiSDK.getCalibrationState()])
500
522
  }
@@ -744,6 +766,10 @@ public class ShenaiSdkCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
744
766
  }
745
767
  }
746
768
 
769
+ @objc func getRequiredModelsDownloadProgressPercentage(_ call: CAPPluginCall) {
770
+ call.resolve(["value": ShenaiSDK.getRequiredModelsDownloadProgressPercentage()])
771
+ }
772
+
747
773
  @objc func getMeasurementProgressPercentage(_ call: CAPPluginCall) {
748
774
  call.resolve(["value": ShenaiSDK.getMeasurementProgressPercentage()])
749
775
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shenai/capacitor-sdk",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
4
4
  "description": "Shen.AI SDK for Capacitor.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",