@smartspectra/node-sdk 3.3.0-rc.3 → 3.3.0-rc.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.
@@ -596,6 +596,9 @@ export namespace presage {
596
596
 
597
597
  /** Confidence score for the HRV measurement, expressed as a percentage in the range [0.0, 100.0] */
598
598
  confidence?: (number|null);
599
+
600
+ /** Whether the HRV measurement is considered stable/reliable */
601
+ stable?: (boolean|null);
599
602
  }
600
603
 
601
604
  /** Represents a single HRV measurement computed over some period of pulse data. */
@@ -625,6 +628,9 @@ export namespace presage {
625
628
  /** Confidence score for the HRV measurement, expressed as a percentage in the range [0.0, 100.0] */
626
629
  public confidence: number;
627
630
 
631
+ /** Whether the HRV measurement is considered stable/reliable */
632
+ public stable: boolean;
633
+
628
634
  /**
629
635
  * Creates a new Hrv instance using the specified properties.
630
636
  * @param [properties] Properties to set
@@ -125,7 +125,7 @@ $root.presage = (function() {
125
125
  * @returns {$protobuf.Writer} Writer
126
126
  */
127
127
  Measurement.encodeDelimited = function encodeDelimited(message, writer) {
128
- return this.encode(message, writer).ldelim();
128
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
129
129
  };
130
130
 
131
131
  /**
@@ -226,6 +226,8 @@ $root.presage = (function() {
226
226
  Measurement.fromObject = function fromObject(object, long) {
227
227
  if (object instanceof $root.presage.smartspectra.Measurement)
228
228
  return object;
229
+ if (!$util.isObject(object))
230
+ throw TypeError(".presage.smartspectra.Measurement: object expected");
229
231
  if (long === undefined)
230
232
  long = 0;
231
233
  if (long > $util.recursionLimit)
@@ -414,7 +416,7 @@ $root.presage = (function() {
414
416
  * @returns {$protobuf.Writer} Writer
415
417
  */
416
418
  DetectionStatus.encodeDelimited = function encodeDelimited(message, writer) {
417
- return this.encode(message, writer).ldelim();
419
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
418
420
  };
419
421
 
420
422
  /**
@@ -515,6 +517,8 @@ $root.presage = (function() {
515
517
  DetectionStatus.fromObject = function fromObject(object, long) {
516
518
  if (object instanceof $root.presage.smartspectra.DetectionStatus)
517
519
  return object;
520
+ if (!$util.isObject(object))
521
+ throw TypeError(".presage.smartspectra.DetectionStatus: object expected");
518
522
  if (long === undefined)
519
523
  long = 0;
520
524
  if (long > $util.recursionLimit)
@@ -714,7 +718,7 @@ $root.presage = (function() {
714
718
  * @returns {$protobuf.Writer} Writer
715
719
  */
716
720
  MeasurementWithConfidence.encodeDelimited = function encodeDelimited(message, writer) {
717
- return this.encode(message, writer).ldelim();
721
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
718
722
  };
719
723
 
720
724
  /**
@@ -822,6 +826,8 @@ $root.presage = (function() {
822
826
  MeasurementWithConfidence.fromObject = function fromObject(object, long) {
823
827
  if (object instanceof $root.presage.smartspectra.MeasurementWithConfidence)
824
828
  return object;
829
+ if (!$util.isObject(object))
830
+ throw TypeError(".presage.smartspectra.MeasurementWithConfidence: object expected");
825
831
  if (long === undefined)
826
832
  long = 0;
827
833
  if (long > $util.recursionLimit)
@@ -1031,7 +1037,7 @@ $root.presage = (function() {
1031
1037
  * @returns {$protobuf.Writer} Writer
1032
1038
  */
1033
1039
  ExpressionScore.encodeDelimited = function encodeDelimited(message, writer) {
1034
- return this.encode(message, writer).ldelim();
1040
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
1035
1041
  };
1036
1042
 
1037
1043
  /**
@@ -1137,6 +1143,8 @@ $root.presage = (function() {
1137
1143
  ExpressionScore.fromObject = function fromObject(object, long) {
1138
1144
  if (object instanceof $root.presage.smartspectra.ExpressionScore)
1139
1145
  return object;
1146
+ if (!$util.isObject(object))
1147
+ throw TypeError(".presage.smartspectra.ExpressionScore: object expected");
1140
1148
  if (long === undefined)
1141
1149
  long = 0;
1142
1150
  if (long > $util.recursionLimit)
@@ -1348,7 +1356,7 @@ $root.presage = (function() {
1348
1356
  * @returns {$protobuf.Writer} Writer
1349
1357
  */
1350
1358
  Expression.encodeDelimited = function encodeDelimited(message, writer) {
1351
- return this.encode(message, writer).ldelim();
1359
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
1352
1360
  };
1353
1361
 
1354
1362
  /**
@@ -1457,6 +1465,8 @@ $root.presage = (function() {
1457
1465
  Expression.fromObject = function fromObject(object, long) {
1458
1466
  if (object instanceof $root.presage.smartspectra.Expression)
1459
1467
  return object;
1468
+ if (!$util.isObject(object))
1469
+ throw TypeError(".presage.smartspectra.Expression: object expected");
1460
1470
  if (long === undefined)
1461
1471
  long = 0;
1462
1472
  if (long > $util.recursionLimit)
@@ -1478,7 +1488,7 @@ $root.presage = (function() {
1478
1488
  throw TypeError(".presage.smartspectra.Expression.scores: array expected");
1479
1489
  message.scores = [];
1480
1490
  for (var i = 0; i < object.scores.length; ++i) {
1481
- if (typeof object.scores[i] !== "object")
1491
+ if (!$util.isObject(object.scores[i]))
1482
1492
  throw TypeError(".presage.smartspectra.Expression.scores: object expected");
1483
1493
  message.scores[i] = $root.presage.smartspectra.ExpressionScore.fromObject(object.scores[i], long + 1);
1484
1494
  }
@@ -1571,6 +1581,7 @@ $root.presage = (function() {
1571
1581
  * @property {number|null} [baevsky] Baevsky's Stress Index, in 1/ms^2 (inverse-square milliseconds)
1572
1582
  * @property {number|Long|null} [timestamp] Absolute timestamp at which the HRV measurement was taken, in microseconds, since Linux epoch
1573
1583
  * @property {number|null} [confidence] Confidence score for the HRV measurement, expressed as a percentage in the range [0.0, 100.0]
1584
+ * @property {boolean|null} [stable] Whether the HRV measurement is considered stable/reliable
1574
1585
  */
1575
1586
 
1576
1587
  /**
@@ -1636,6 +1647,14 @@ $root.presage = (function() {
1636
1647
  */
1637
1648
  Hrv.prototype.confidence = 0;
1638
1649
 
1650
+ /**
1651
+ * Whether the HRV measurement is considered stable/reliable
1652
+ * @member {boolean} stable
1653
+ * @memberof presage.smartspectra.Hrv
1654
+ * @instance
1655
+ */
1656
+ Hrv.prototype.stable = false;
1657
+
1639
1658
  /**
1640
1659
  * Creates a new Hrv instance using the specified properties.
1641
1660
  * @function create
@@ -1676,6 +1695,8 @@ $root.presage = (function() {
1676
1695
  writer.uint32(/* id 5, wireType 0 =*/40).int64(message.timestamp);
1677
1696
  if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
1678
1697
  writer.uint32(/* id 6, wireType 5 =*/53).float(message.confidence);
1698
+ if (message.stable != null && Object.hasOwnProperty.call(message, "stable"))
1699
+ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.stable);
1679
1700
  return writer;
1680
1701
  };
1681
1702
 
@@ -1689,7 +1710,7 @@ $root.presage = (function() {
1689
1710
  * @returns {$protobuf.Writer} Writer
1690
1711
  */
1691
1712
  Hrv.encodeDelimited = function encodeDelimited(message, writer) {
1692
- return this.encode(message, writer).ldelim();
1713
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
1693
1714
  };
1694
1715
 
1695
1716
  /**
@@ -1740,6 +1761,10 @@ $root.presage = (function() {
1740
1761
  message.confidence = reader.float();
1741
1762
  break;
1742
1763
  }
1764
+ case 7: {
1765
+ message.stable = reader.bool();
1766
+ break;
1767
+ }
1743
1768
  default:
1744
1769
  reader.skipType(tag & 7, long);
1745
1770
  break;
@@ -1797,6 +1822,9 @@ $root.presage = (function() {
1797
1822
  if (message.confidence != null && message.hasOwnProperty("confidence"))
1798
1823
  if (typeof message.confidence !== "number")
1799
1824
  return "confidence: number expected";
1825
+ if (message.stable != null && message.hasOwnProperty("stable"))
1826
+ if (typeof message.stable !== "boolean")
1827
+ return "stable: boolean expected";
1800
1828
  return null;
1801
1829
  };
1802
1830
 
@@ -1811,6 +1839,8 @@ $root.presage = (function() {
1811
1839
  Hrv.fromObject = function fromObject(object, long) {
1812
1840
  if (object instanceof $root.presage.smartspectra.Hrv)
1813
1841
  return object;
1842
+ if (!$util.isObject(object))
1843
+ throw TypeError(".presage.smartspectra.Hrv: object expected");
1814
1844
  if (long === undefined)
1815
1845
  long = 0;
1816
1846
  if (long > $util.recursionLimit)
@@ -1835,6 +1865,8 @@ $root.presage = (function() {
1835
1865
  message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber();
1836
1866
  if (object.confidence != null)
1837
1867
  message.confidence = Number(object.confidence);
1868
+ if (object.stable != null)
1869
+ message.stable = Boolean(object.stable);
1838
1870
  return message;
1839
1871
  };
1840
1872
 
@@ -1866,6 +1898,7 @@ $root.presage = (function() {
1866
1898
  } else
1867
1899
  object.timestamp = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0;
1868
1900
  object.confidence = 0;
1901
+ object.stable = false;
1869
1902
  }
1870
1903
  if (message.rmssd != null && message.hasOwnProperty("rmssd"))
1871
1904
  object.rmssd = options.json && !isFinite(message.rmssd) ? String(message.rmssd) : message.rmssd;
@@ -1884,6 +1917,8 @@ $root.presage = (function() {
1884
1917
  object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp;
1885
1918
  if (message.confidence != null && message.hasOwnProperty("confidence"))
1886
1919
  object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
1920
+ if (message.stable != null && message.hasOwnProperty("stable"))
1921
+ object.stable = message.stable;
1887
1922
  return object;
1888
1923
  };
1889
1924
 
@@ -1992,7 +2027,7 @@ $root.presage = (function() {
1992
2027
  * @returns {$protobuf.Writer} Writer
1993
2028
  */
1994
2029
  Strict.encodeDelimited = function encodeDelimited(message, writer) {
1995
- return this.encode(message, writer).ldelim();
2030
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
1996
2031
  };
1997
2032
 
1998
2033
  /**
@@ -2079,6 +2114,8 @@ $root.presage = (function() {
2079
2114
  Strict.fromObject = function fromObject(object, long) {
2080
2115
  if (object instanceof $root.presage.smartspectra.Strict)
2081
2116
  return object;
2117
+ if (!$util.isObject(object))
2118
+ throw TypeError(".presage.smartspectra.Strict: object expected");
2082
2119
  if (long === undefined)
2083
2120
  long = 0;
2084
2121
  if (long > $util.recursionLimit)
@@ -2259,7 +2296,7 @@ $root.presage = (function() {
2259
2296
  * @returns {$protobuf.Writer} Writer
2260
2297
  */
2261
2298
  Pulse.encodeDelimited = function encodeDelimited(message, writer) {
2262
- return this.encode(message, writer).ldelim();
2299
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
2263
2300
  };
2264
2301
 
2265
2302
  /**
@@ -2393,6 +2430,8 @@ $root.presage = (function() {
2393
2430
  Pulse.fromObject = function fromObject(object, long) {
2394
2431
  if (object instanceof $root.presage.smartspectra.Pulse)
2395
2432
  return object;
2433
+ if (!$util.isObject(object))
2434
+ throw TypeError(".presage.smartspectra.Pulse: object expected");
2396
2435
  if (long === undefined)
2397
2436
  long = 0;
2398
2437
  if (long > $util.recursionLimit)
@@ -2403,7 +2442,7 @@ $root.presage = (function() {
2403
2442
  throw TypeError(".presage.smartspectra.Pulse.rate: array expected");
2404
2443
  message.rate = [];
2405
2444
  for (var i = 0; i < object.rate.length; ++i) {
2406
- if (typeof object.rate[i] !== "object")
2445
+ if (!$util.isObject(object.rate[i]))
2407
2446
  throw TypeError(".presage.smartspectra.Pulse.rate: object expected");
2408
2447
  message.rate[i] = $root.presage.smartspectra.MeasurementWithConfidence.fromObject(object.rate[i], long + 1);
2409
2448
  }
@@ -2413,7 +2452,7 @@ $root.presage = (function() {
2413
2452
  throw TypeError(".presage.smartspectra.Pulse.trace: array expected");
2414
2453
  message.trace = [];
2415
2454
  for (var i = 0; i < object.trace.length; ++i) {
2416
- if (typeof object.trace[i] !== "object")
2455
+ if (!$util.isObject(object.trace[i]))
2417
2456
  throw TypeError(".presage.smartspectra.Pulse.trace: object expected");
2418
2457
  message.trace[i] = $root.presage.smartspectra.Measurement.fromObject(object.trace[i], long + 1);
2419
2458
  }
@@ -2423,13 +2462,13 @@ $root.presage = (function() {
2423
2462
  throw TypeError(".presage.smartspectra.Pulse.pulseRespirationQuotient: array expected");
2424
2463
  message.pulseRespirationQuotient = [];
2425
2464
  for (var i = 0; i < object.pulseRespirationQuotient.length; ++i) {
2426
- if (typeof object.pulseRespirationQuotient[i] !== "object")
2465
+ if (!$util.isObject(object.pulseRespirationQuotient[i]))
2427
2466
  throw TypeError(".presage.smartspectra.Pulse.pulseRespirationQuotient: object expected");
2428
2467
  message.pulseRespirationQuotient[i] = $root.presage.smartspectra.Measurement.fromObject(object.pulseRespirationQuotient[i], long + 1);
2429
2468
  }
2430
2469
  }
2431
2470
  if (object.strict != null) {
2432
- if (typeof object.strict !== "object")
2471
+ if (!$util.isObject(object.strict))
2433
2472
  throw TypeError(".presage.smartspectra.Pulse.strict: object expected");
2434
2473
  message.strict = $root.presage.smartspectra.Strict.fromObject(object.strict, long + 1);
2435
2474
  }
@@ -2691,7 +2730,7 @@ $root.presage = (function() {
2691
2730
  * @returns {$protobuf.Writer} Writer
2692
2731
  */
2693
2732
  Breathing.encodeDelimited = function encodeDelimited(message, writer) {
2694
- return this.encode(message, writer).ldelim();
2733
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
2695
2734
  };
2696
2735
 
2697
2736
  /**
@@ -2900,6 +2939,8 @@ $root.presage = (function() {
2900
2939
  Breathing.fromObject = function fromObject(object, long) {
2901
2940
  if (object instanceof $root.presage.smartspectra.Breathing)
2902
2941
  return object;
2942
+ if (!$util.isObject(object))
2943
+ throw TypeError(".presage.smartspectra.Breathing: object expected");
2903
2944
  if (long === undefined)
2904
2945
  long = 0;
2905
2946
  if (long > $util.recursionLimit)
@@ -2910,7 +2951,7 @@ $root.presage = (function() {
2910
2951
  throw TypeError(".presage.smartspectra.Breathing.rate: array expected");
2911
2952
  message.rate = [];
2912
2953
  for (var i = 0; i < object.rate.length; ++i) {
2913
- if (typeof object.rate[i] !== "object")
2954
+ if (!$util.isObject(object.rate[i]))
2914
2955
  throw TypeError(".presage.smartspectra.Breathing.rate: object expected");
2915
2956
  message.rate[i] = $root.presage.smartspectra.MeasurementWithConfidence.fromObject(object.rate[i], long + 1);
2916
2957
  }
@@ -2920,7 +2961,7 @@ $root.presage = (function() {
2920
2961
  throw TypeError(".presage.smartspectra.Breathing.upperTrace: array expected");
2921
2962
  message.upperTrace = [];
2922
2963
  for (var i = 0; i < object.upperTrace.length; ++i) {
2923
- if (typeof object.upperTrace[i] !== "object")
2964
+ if (!$util.isObject(object.upperTrace[i]))
2924
2965
  throw TypeError(".presage.smartspectra.Breathing.upperTrace: object expected");
2925
2966
  message.upperTrace[i] = $root.presage.smartspectra.Measurement.fromObject(object.upperTrace[i], long + 1);
2926
2967
  }
@@ -2930,7 +2971,7 @@ $root.presage = (function() {
2930
2971
  throw TypeError(".presage.smartspectra.Breathing.lowerTrace: array expected");
2931
2972
  message.lowerTrace = [];
2932
2973
  for (var i = 0; i < object.lowerTrace.length; ++i) {
2933
- if (typeof object.lowerTrace[i] !== "object")
2974
+ if (!$util.isObject(object.lowerTrace[i]))
2934
2975
  throw TypeError(".presage.smartspectra.Breathing.lowerTrace: object expected");
2935
2976
  message.lowerTrace[i] = $root.presage.smartspectra.Measurement.fromObject(object.lowerTrace[i], long + 1);
2936
2977
  }
@@ -2940,7 +2981,7 @@ $root.presage = (function() {
2940
2981
  throw TypeError(".presage.smartspectra.Breathing.amplitude: array expected");
2941
2982
  message.amplitude = [];
2942
2983
  for (var i = 0; i < object.amplitude.length; ++i) {
2943
- if (typeof object.amplitude[i] !== "object")
2984
+ if (!$util.isObject(object.amplitude[i]))
2944
2985
  throw TypeError(".presage.smartspectra.Breathing.amplitude: object expected");
2945
2986
  message.amplitude[i] = $root.presage.smartspectra.Measurement.fromObject(object.amplitude[i], long + 1);
2946
2987
  }
@@ -2950,7 +2991,7 @@ $root.presage = (function() {
2950
2991
  throw TypeError(".presage.smartspectra.Breathing.apnea: array expected");
2951
2992
  message.apnea = [];
2952
2993
  for (var i = 0; i < object.apnea.length; ++i) {
2953
- if (typeof object.apnea[i] !== "object")
2994
+ if (!$util.isObject(object.apnea[i]))
2954
2995
  throw TypeError(".presage.smartspectra.Breathing.apnea: object expected");
2955
2996
  message.apnea[i] = $root.presage.smartspectra.DetectionStatus.fromObject(object.apnea[i], long + 1);
2956
2997
  }
@@ -2960,7 +3001,7 @@ $root.presage = (function() {
2960
3001
  throw TypeError(".presage.smartspectra.Breathing.respiratoryLineLength: array expected");
2961
3002
  message.respiratoryLineLength = [];
2962
3003
  for (var i = 0; i < object.respiratoryLineLength.length; ++i) {
2963
- if (typeof object.respiratoryLineLength[i] !== "object")
3004
+ if (!$util.isObject(object.respiratoryLineLength[i]))
2964
3005
  throw TypeError(".presage.smartspectra.Breathing.respiratoryLineLength: object expected");
2965
3006
  message.respiratoryLineLength[i] = $root.presage.smartspectra.Measurement.fromObject(object.respiratoryLineLength[i], long + 1);
2966
3007
  }
@@ -2970,7 +3011,7 @@ $root.presage = (function() {
2970
3011
  throw TypeError(".presage.smartspectra.Breathing.baseline: array expected");
2971
3012
  message.baseline = [];
2972
3013
  for (var i = 0; i < object.baseline.length; ++i) {
2973
- if (typeof object.baseline[i] !== "object")
3014
+ if (!$util.isObject(object.baseline[i]))
2974
3015
  throw TypeError(".presage.smartspectra.Breathing.baseline: object expected");
2975
3016
  message.baseline[i] = $root.presage.smartspectra.Measurement.fromObject(object.baseline[i], long + 1);
2976
3017
  }
@@ -2980,13 +3021,13 @@ $root.presage = (function() {
2980
3021
  throw TypeError(".presage.smartspectra.Breathing.inhaleExhaleRatio: array expected");
2981
3022
  message.inhaleExhaleRatio = [];
2982
3023
  for (var i = 0; i < object.inhaleExhaleRatio.length; ++i) {
2983
- if (typeof object.inhaleExhaleRatio[i] !== "object")
3024
+ if (!$util.isObject(object.inhaleExhaleRatio[i]))
2984
3025
  throw TypeError(".presage.smartspectra.Breathing.inhaleExhaleRatio: object expected");
2985
3026
  message.inhaleExhaleRatio[i] = $root.presage.smartspectra.Measurement.fromObject(object.inhaleExhaleRatio[i], long + 1);
2986
3027
  }
2987
3028
  }
2988
3029
  if (object.strict != null) {
2989
- if (typeof object.strict !== "object")
3030
+ if (!$util.isObject(object.strict))
2990
3031
  throw TypeError(".presage.smartspectra.Breathing.strict: object expected");
2991
3032
  message.strict = $root.presage.smartspectra.Strict.fromObject(object.strict, long + 1);
2992
3033
  }
@@ -3207,7 +3248,7 @@ $root.presage = (function() {
3207
3248
  * @returns {$protobuf.Writer} Writer
3208
3249
  */
3209
3250
  Landmarks.encodeDelimited = function encodeDelimited(message, writer) {
3210
- return this.encode(message, writer).ldelim();
3251
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
3211
3252
  };
3212
3253
 
3213
3254
  /**
@@ -3323,6 +3364,8 @@ $root.presage = (function() {
3323
3364
  Landmarks.fromObject = function fromObject(object, long) {
3324
3365
  if (object instanceof $root.presage.smartspectra.Landmarks)
3325
3366
  return object;
3367
+ if (!$util.isObject(object))
3368
+ throw TypeError(".presage.smartspectra.Landmarks: object expected");
3326
3369
  if (long === undefined)
3327
3370
  long = 0;
3328
3371
  if (long > $util.recursionLimit)
@@ -3333,7 +3376,7 @@ $root.presage = (function() {
3333
3376
  throw TypeError(".presage.smartspectra.Landmarks.value: array expected");
3334
3377
  message.value = [];
3335
3378
  for (var i = 0; i < object.value.length; ++i) {
3336
- if (typeof object.value[i] !== "object")
3379
+ if (!$util.isObject(object.value[i]))
3337
3380
  throw TypeError(".presage.smartspectra.Landmarks.value: object expected");
3338
3381
  message.value[i] = $root.presage.smartspectra.Point2dFloat.fromObject(object.value[i], long + 1);
3339
3382
  }
@@ -3547,7 +3590,7 @@ $root.presage = (function() {
3547
3590
  * @returns {$protobuf.Writer} Writer
3548
3591
  */
3549
3592
  Face.encodeDelimited = function encodeDelimited(message, writer) {
3550
- return this.encode(message, writer).ldelim();
3593
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
3551
3594
  };
3552
3595
 
3553
3596
  /**
@@ -3687,6 +3730,8 @@ $root.presage = (function() {
3687
3730
  Face.fromObject = function fromObject(object, long) {
3688
3731
  if (object instanceof $root.presage.smartspectra.Face)
3689
3732
  return object;
3733
+ if (!$util.isObject(object))
3734
+ throw TypeError(".presage.smartspectra.Face: object expected");
3690
3735
  if (long === undefined)
3691
3736
  long = 0;
3692
3737
  if (long > $util.recursionLimit)
@@ -3697,7 +3742,7 @@ $root.presage = (function() {
3697
3742
  throw TypeError(".presage.smartspectra.Face.blinking: array expected");
3698
3743
  message.blinking = [];
3699
3744
  for (var i = 0; i < object.blinking.length; ++i) {
3700
- if (typeof object.blinking[i] !== "object")
3745
+ if (!$util.isObject(object.blinking[i]))
3701
3746
  throw TypeError(".presage.smartspectra.Face.blinking: object expected");
3702
3747
  message.blinking[i] = $root.presage.smartspectra.DetectionStatus.fromObject(object.blinking[i], long + 1);
3703
3748
  }
@@ -3707,7 +3752,7 @@ $root.presage = (function() {
3707
3752
  throw TypeError(".presage.smartspectra.Face.talking: array expected");
3708
3753
  message.talking = [];
3709
3754
  for (var i = 0; i < object.talking.length; ++i) {
3710
- if (typeof object.talking[i] !== "object")
3755
+ if (!$util.isObject(object.talking[i]))
3711
3756
  throw TypeError(".presage.smartspectra.Face.talking: object expected");
3712
3757
  message.talking[i] = $root.presage.smartspectra.DetectionStatus.fromObject(object.talking[i], long + 1);
3713
3758
  }
@@ -3717,7 +3762,7 @@ $root.presage = (function() {
3717
3762
  throw TypeError(".presage.smartspectra.Face.landmarks: array expected");
3718
3763
  message.landmarks = [];
3719
3764
  for (var i = 0; i < object.landmarks.length; ++i) {
3720
- if (typeof object.landmarks[i] !== "object")
3765
+ if (!$util.isObject(object.landmarks[i]))
3721
3766
  throw TypeError(".presage.smartspectra.Face.landmarks: object expected");
3722
3767
  message.landmarks[i] = $root.presage.smartspectra.Landmarks.fromObject(object.landmarks[i], long + 1);
3723
3768
  }
@@ -3727,7 +3772,7 @@ $root.presage = (function() {
3727
3772
  throw TypeError(".presage.smartspectra.Face.expression: array expected");
3728
3773
  message.expression = [];
3729
3774
  for (var i = 0; i < object.expression.length; ++i) {
3730
- if (typeof object.expression[i] !== "object")
3775
+ if (!$util.isObject(object.expression[i]))
3731
3776
  throw TypeError(".presage.smartspectra.Face.expression: object expected");
3732
3777
  message.expression[i] = $root.presage.smartspectra.Expression.fromObject(object.expression[i], long + 1);
3733
3778
  }
@@ -3901,7 +3946,7 @@ $root.presage = (function() {
3901
3946
  * @returns {$protobuf.Writer} Writer
3902
3947
  */
3903
3948
  MicroMotion.encodeDelimited = function encodeDelimited(message, writer) {
3904
- return this.encode(message, writer).ldelim();
3949
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
3905
3950
  };
3906
3951
 
3907
3952
  /**
@@ -4011,6 +4056,8 @@ $root.presage = (function() {
4011
4056
  MicroMotion.fromObject = function fromObject(object, long) {
4012
4057
  if (object instanceof $root.presage.smartspectra.MicroMotion)
4013
4058
  return object;
4059
+ if (!$util.isObject(object))
4060
+ throw TypeError(".presage.smartspectra.MicroMotion: object expected");
4014
4061
  if (long === undefined)
4015
4062
  long = 0;
4016
4063
  if (long > $util.recursionLimit)
@@ -4021,7 +4068,7 @@ $root.presage = (function() {
4021
4068
  throw TypeError(".presage.smartspectra.MicroMotion.glutes: array expected");
4022
4069
  message.glutes = [];
4023
4070
  for (var i = 0; i < object.glutes.length; ++i) {
4024
- if (typeof object.glutes[i] !== "object")
4071
+ if (!$util.isObject(object.glutes[i]))
4025
4072
  throw TypeError(".presage.smartspectra.MicroMotion.glutes: object expected");
4026
4073
  message.glutes[i] = $root.presage.smartspectra.Measurement.fromObject(object.glutes[i], long + 1);
4027
4074
  }
@@ -4031,7 +4078,7 @@ $root.presage = (function() {
4031
4078
  throw TypeError(".presage.smartspectra.MicroMotion.knees: array expected");
4032
4079
  message.knees = [];
4033
4080
  for (var i = 0; i < object.knees.length; ++i) {
4034
- if (typeof object.knees[i] !== "object")
4081
+ if (!$util.isObject(object.knees[i]))
4035
4082
  throw TypeError(".presage.smartspectra.MicroMotion.knees: object expected");
4036
4083
  message.knees[i] = $root.presage.smartspectra.Measurement.fromObject(object.knees[i], long + 1);
4037
4084
  }
@@ -4180,7 +4227,7 @@ $root.presage = (function() {
4180
4227
  * @returns {$protobuf.Writer} Writer
4181
4228
  */
4182
4229
  Eda.encodeDelimited = function encodeDelimited(message, writer) {
4183
- return this.encode(message, writer).ldelim();
4230
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
4184
4231
  };
4185
4232
 
4186
4233
  /**
@@ -4275,6 +4322,8 @@ $root.presage = (function() {
4275
4322
  Eda.fromObject = function fromObject(object, long) {
4276
4323
  if (object instanceof $root.presage.smartspectra.Eda)
4277
4324
  return object;
4325
+ if (!$util.isObject(object))
4326
+ throw TypeError(".presage.smartspectra.Eda: object expected");
4278
4327
  if (long === undefined)
4279
4328
  long = 0;
4280
4329
  if (long > $util.recursionLimit)
@@ -4285,7 +4334,7 @@ $root.presage = (function() {
4285
4334
  throw TypeError(".presage.smartspectra.Eda.trace: array expected");
4286
4335
  message.trace = [];
4287
4336
  for (var i = 0; i < object.trace.length; ++i) {
4288
- if (typeof object.trace[i] !== "object")
4337
+ if (!$util.isObject(object.trace[i]))
4289
4338
  throw TypeError(".presage.smartspectra.Eda.trace: object expected");
4290
4339
  message.trace[i] = $root.presage.smartspectra.Measurement.fromObject(object.trace[i], long + 1);
4291
4340
  }
@@ -4452,7 +4501,7 @@ $root.presage = (function() {
4452
4501
  * @returns {$protobuf.Writer} Writer
4453
4502
  */
4454
4503
  Cardio.encodeDelimited = function encodeDelimited(message, writer) {
4455
- return this.encode(message, writer).ldelim();
4504
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
4456
4505
  };
4457
4506
 
4458
4507
  /**
@@ -4577,6 +4626,8 @@ $root.presage = (function() {
4577
4626
  Cardio.fromObject = function fromObject(object, long) {
4578
4627
  if (object instanceof $root.presage.smartspectra.Cardio)
4579
4628
  return object;
4629
+ if (!$util.isObject(object))
4630
+ throw TypeError(".presage.smartspectra.Cardio: object expected");
4580
4631
  if (long === undefined)
4581
4632
  long = 0;
4582
4633
  if (long > $util.recursionLimit)
@@ -4587,7 +4638,7 @@ $root.presage = (function() {
4587
4638
  throw TypeError(".presage.smartspectra.Cardio.pulseRate: array expected");
4588
4639
  message.pulseRate = [];
4589
4640
  for (var i = 0; i < object.pulseRate.length; ++i) {
4590
- if (typeof object.pulseRate[i] !== "object")
4641
+ if (!$util.isObject(object.pulseRate[i]))
4591
4642
  throw TypeError(".presage.smartspectra.Cardio.pulseRate: object expected");
4592
4643
  message.pulseRate[i] = $root.presage.smartspectra.MeasurementWithConfidence.fromObject(object.pulseRate[i], long + 1);
4593
4644
  }
@@ -4597,7 +4648,7 @@ $root.presage = (function() {
4597
4648
  throw TypeError(".presage.smartspectra.Cardio.arterialPressureTrace: array expected");
4598
4649
  message.arterialPressureTrace = [];
4599
4650
  for (var i = 0; i < object.arterialPressureTrace.length; ++i) {
4600
- if (typeof object.arterialPressureTrace[i] !== "object")
4651
+ if (!$util.isObject(object.arterialPressureTrace[i]))
4601
4652
  throw TypeError(".presage.smartspectra.Cardio.arterialPressureTrace: object expected");
4602
4653
  message.arterialPressureTrace[i] = $root.presage.smartspectra.MeasurementWithConfidence.fromObject(object.arterialPressureTrace[i], long + 1);
4603
4654
  }
@@ -4607,7 +4658,7 @@ $root.presage = (function() {
4607
4658
  throw TypeError(".presage.smartspectra.Cardio.hrv: array expected");
4608
4659
  message.hrv = [];
4609
4660
  for (var i = 0; i < object.hrv.length; ++i) {
4610
- if (typeof object.hrv[i] !== "object")
4661
+ if (!$util.isObject(object.hrv[i]))
4611
4662
  throw TypeError(".presage.smartspectra.Cardio.hrv: object expected");
4612
4663
  message.hrv[i] = $root.presage.smartspectra.Hrv.fromObject(object.hrv[i], long + 1);
4613
4664
  }
@@ -4804,7 +4855,7 @@ $root.presage = (function() {
4804
4855
  * @returns {$protobuf.Writer} Writer
4805
4856
  */
4806
4857
  Metrics.encodeDelimited = function encodeDelimited(message, writer) {
4807
- return this.encode(message, writer).ldelim();
4858
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
4808
4859
  };
4809
4860
 
4810
4861
  /**
@@ -4929,33 +4980,35 @@ $root.presage = (function() {
4929
4980
  Metrics.fromObject = function fromObject(object, long) {
4930
4981
  if (object instanceof $root.presage.smartspectra.Metrics)
4931
4982
  return object;
4983
+ if (!$util.isObject(object))
4984
+ throw TypeError(".presage.smartspectra.Metrics: object expected");
4932
4985
  if (long === undefined)
4933
4986
  long = 0;
4934
4987
  if (long > $util.recursionLimit)
4935
4988
  throw Error("maximum nesting depth exceeded");
4936
4989
  var message = new $root.presage.smartspectra.Metrics();
4937
4990
  if (object.breathing != null) {
4938
- if (typeof object.breathing !== "object")
4991
+ if (!$util.isObject(object.breathing))
4939
4992
  throw TypeError(".presage.smartspectra.Metrics.breathing: object expected");
4940
4993
  message.breathing = $root.presage.smartspectra.Breathing.fromObject(object.breathing, long + 1);
4941
4994
  }
4942
4995
  if (object.micromotion != null) {
4943
- if (typeof object.micromotion !== "object")
4996
+ if (!$util.isObject(object.micromotion))
4944
4997
  throw TypeError(".presage.smartspectra.Metrics.micromotion: object expected");
4945
4998
  message.micromotion = $root.presage.smartspectra.MicroMotion.fromObject(object.micromotion, long + 1);
4946
4999
  }
4947
5000
  if (object.eda != null) {
4948
- if (typeof object.eda !== "object")
5001
+ if (!$util.isObject(object.eda))
4949
5002
  throw TypeError(".presage.smartspectra.Metrics.eda: object expected");
4950
5003
  message.eda = $root.presage.smartspectra.Eda.fromObject(object.eda, long + 1);
4951
5004
  }
4952
5005
  if (object.face != null) {
4953
- if (typeof object.face !== "object")
5006
+ if (!$util.isObject(object.face))
4954
5007
  throw TypeError(".presage.smartspectra.Metrics.face: object expected");
4955
5008
  message.face = $root.presage.smartspectra.Face.fromObject(object.face, long + 1);
4956
5009
  }
4957
5010
  if (object.cardio != null) {
4958
- if (typeof object.cardio !== "object")
5011
+ if (!$util.isObject(object.cardio))
4959
5012
  throw TypeError(".presage.smartspectra.Metrics.cardio: object expected");
4960
5013
  message.cardio = $root.presage.smartspectra.Cardio.fromObject(object.cardio, long + 1);
4961
5014
  }
@@ -5115,7 +5168,7 @@ $root.presage = (function() {
5115
5168
  * @returns {$protobuf.Writer} Writer
5116
5169
  */
5117
5170
  Point2dInt32.encodeDelimited = function encodeDelimited(message, writer) {
5118
- return this.encode(message, writer).ldelim();
5171
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5119
5172
  };
5120
5173
 
5121
5174
  /**
@@ -5209,6 +5262,8 @@ $root.presage = (function() {
5209
5262
  Point2dInt32.fromObject = function fromObject(object, long) {
5210
5263
  if (object instanceof $root.presage.smartspectra.Point2dInt32)
5211
5264
  return object;
5265
+ if (!$util.isObject(object))
5266
+ throw TypeError(".presage.smartspectra.Point2dInt32: object expected");
5212
5267
  if (long === undefined)
5213
5268
  long = 0;
5214
5269
  if (long > $util.recursionLimit)
@@ -5365,7 +5420,7 @@ $root.presage = (function() {
5365
5420
  * @returns {$protobuf.Writer} Writer
5366
5421
  */
5367
5422
  Point2dFloat.encodeDelimited = function encodeDelimited(message, writer) {
5368
- return this.encode(message, writer).ldelim();
5423
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5369
5424
  };
5370
5425
 
5371
5426
  /**
@@ -5459,6 +5514,8 @@ $root.presage = (function() {
5459
5514
  Point2dFloat.fromObject = function fromObject(object, long) {
5460
5515
  if (object instanceof $root.presage.smartspectra.Point2dFloat)
5461
5516
  return object;
5517
+ if (!$util.isObject(object))
5518
+ throw TypeError(".presage.smartspectra.Point2dFloat: object expected");
5462
5519
  if (long === undefined)
5463
5520
  long = 0;
5464
5521
  if (long > $util.recursionLimit)
@@ -5626,7 +5683,7 @@ $root.presage = (function() {
5626
5683
  * @returns {$protobuf.Writer} Writer
5627
5684
  */
5628
5685
  Point3dFloat.encodeDelimited = function encodeDelimited(message, writer) {
5629
- return this.encode(message, writer).ldelim();
5686
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5630
5687
  };
5631
5688
 
5632
5689
  /**
@@ -5727,6 +5784,8 @@ $root.presage = (function() {
5727
5784
  Point3dFloat.fromObject = function fromObject(object, long) {
5728
5785
  if (object instanceof $root.presage.smartspectra.Point3dFloat)
5729
5786
  return object;
5787
+ if (!$util.isObject(object))
5788
+ throw TypeError(".presage.smartspectra.Point3dFloat: object expected");
5730
5789
  if (long === undefined)
5731
5790
  long = 0;
5732
5791
  if (long > $util.recursionLimit)