@tryvital/vital-node 3.1.101 → 3.1.103

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.
Files changed (118) hide show
  1. package/api/resources/activity/client/Client.js +2 -2
  2. package/api/resources/aggregate/client/Client.d.ts +0 -8
  3. package/api/resources/aggregate/client/Client.js +1 -9
  4. package/api/resources/aggregate/client/requests/Query.d.ts +0 -8
  5. package/api/resources/body/client/Client.js +2 -2
  6. package/api/resources/devices/client/Client.js +1 -1
  7. package/api/resources/insurance/client/Client.js +2 -2
  8. package/api/resources/introspect/client/Client.js +2 -2
  9. package/api/resources/labTests/client/Client.js +34 -34
  10. package/api/resources/link/client/Client.js +14 -14
  11. package/api/resources/meal/client/Client.js +1 -1
  12. package/api/resources/menstrualCycle/client/Client.js +1 -1
  13. package/api/resources/profile/client/Client.js +2 -2
  14. package/api/resources/providers/client/Client.js +1 -1
  15. package/api/resources/sleep/client/Client.js +4 -4
  16. package/api/resources/team/client/Client.js +7 -7
  17. package/api/resources/testkit/client/Client.js +2 -2
  18. package/api/resources/user/client/Client.js +16 -16
  19. package/api/resources/vitals/client/Client.js +56 -56
  20. package/api/resources/workouts/client/Client.js +3 -3
  21. package/api/types/AggregateExprArg.d.ts +1 -1
  22. package/api/types/ClientFacingResource.d.ts +2 -1
  23. package/api/types/ClientFacingResource.js +1 -0
  24. package/api/types/ClientFacingSleep.d.ts +7 -0
  25. package/api/types/QueryInstruction.d.ts +1 -1
  26. package/api/types/QueryInstructionSelectItem.d.ts +1 -1
  27. package/api/types/SleepColumnExprSleep.d.ts +2 -1
  28. package/api/types/SleepColumnExprSleep.js +1 -0
  29. package/api/types/SleepScoreValueMacroExpr.d.ts +7 -0
  30. package/api/types/SleepScoreValueMacroExpr.js +5 -0
  31. package/api/types/SleepType.d.ts +10 -0
  32. package/api/types/SleepType.js +12 -0
  33. package/api/types/UnrecognizedValueMacroExpr.d.ts +6 -0
  34. package/api/types/UnrecognizedValueMacroExpr.js +5 -0
  35. package/api/types/index.d.ts +3 -0
  36. package/api/types/index.js +3 -0
  37. package/dist/api/resources/activity/client/Client.js +2 -2
  38. package/dist/api/resources/aggregate/client/Client.d.ts +0 -8
  39. package/dist/api/resources/aggregate/client/Client.js +1 -9
  40. package/dist/api/resources/aggregate/client/requests/Query.d.ts +0 -8
  41. package/dist/api/resources/body/client/Client.js +2 -2
  42. package/dist/api/resources/devices/client/Client.js +1 -1
  43. package/dist/api/resources/insurance/client/Client.js +2 -2
  44. package/dist/api/resources/introspect/client/Client.js +2 -2
  45. package/dist/api/resources/labTests/client/Client.js +34 -34
  46. package/dist/api/resources/link/client/Client.js +14 -14
  47. package/dist/api/resources/meal/client/Client.js +1 -1
  48. package/dist/api/resources/menstrualCycle/client/Client.js +1 -1
  49. package/dist/api/resources/profile/client/Client.js +2 -2
  50. package/dist/api/resources/providers/client/Client.js +1 -1
  51. package/dist/api/resources/sleep/client/Client.js +4 -4
  52. package/dist/api/resources/team/client/Client.js +7 -7
  53. package/dist/api/resources/testkit/client/Client.js +2 -2
  54. package/dist/api/resources/user/client/Client.js +16 -16
  55. package/dist/api/resources/vitals/client/Client.js +56 -56
  56. package/dist/api/resources/workouts/client/Client.js +3 -3
  57. package/dist/api/types/AggregateExprArg.d.ts +1 -1
  58. package/dist/api/types/ClientFacingResource.d.ts +2 -1
  59. package/dist/api/types/ClientFacingResource.js +1 -0
  60. package/dist/api/types/ClientFacingSleep.d.ts +7 -0
  61. package/dist/api/types/QueryInstruction.d.ts +1 -1
  62. package/dist/api/types/QueryInstructionSelectItem.d.ts +1 -1
  63. package/dist/api/types/SleepColumnExprSleep.d.ts +2 -1
  64. package/dist/api/types/SleepColumnExprSleep.js +1 -0
  65. package/dist/api/types/SleepScoreValueMacroExpr.d.ts +7 -0
  66. package/dist/api/types/SleepScoreValueMacroExpr.js +5 -0
  67. package/dist/api/types/SleepType.d.ts +10 -0
  68. package/dist/api/types/SleepType.js +12 -0
  69. package/dist/api/types/UnrecognizedValueMacroExpr.d.ts +6 -0
  70. package/dist/api/types/UnrecognizedValueMacroExpr.js +5 -0
  71. package/dist/api/types/index.d.ts +3 -0
  72. package/dist/api/types/index.js +3 -0
  73. package/dist/serialization/types/AggregateExprArg.d.ts +3 -1
  74. package/dist/serialization/types/AggregateExprArg.js +4 -0
  75. package/dist/serialization/types/ClientFacingResource.d.ts +1 -1
  76. package/dist/serialization/types/ClientFacingResource.js +1 -0
  77. package/dist/serialization/types/ClientFacingSleep.d.ts +2 -0
  78. package/dist/serialization/types/ClientFacingSleep.js +2 -0
  79. package/dist/serialization/types/QueryInstruction.d.ts +1 -1
  80. package/dist/serialization/types/QueryInstruction.js +1 -1
  81. package/dist/serialization/types/QueryInstructionSelectItem.d.ts +3 -1
  82. package/dist/serialization/types/QueryInstructionSelectItem.js +4 -0
  83. package/dist/serialization/types/SleepColumnExprSleep.d.ts +1 -1
  84. package/dist/serialization/types/SleepColumnExprSleep.js +1 -0
  85. package/dist/serialization/types/SleepScoreValueMacroExpr.d.ts +13 -0
  86. package/dist/serialization/types/SleepScoreValueMacroExpr.js +34 -0
  87. package/dist/serialization/types/SleepType.d.ts +10 -0
  88. package/dist/serialization/types/SleepType.js +31 -0
  89. package/dist/serialization/types/UnrecognizedValueMacroExpr.d.ts +12 -0
  90. package/dist/serialization/types/UnrecognizedValueMacroExpr.js +33 -0
  91. package/dist/serialization/types/index.d.ts +3 -0
  92. package/dist/serialization/types/index.js +3 -0
  93. package/dist/version.d.ts +1 -1
  94. package/dist/version.js +1 -1
  95. package/package.json +1 -1
  96. package/reference.md +0 -10
  97. package/serialization/types/AggregateExprArg.d.ts +3 -1
  98. package/serialization/types/AggregateExprArg.js +4 -0
  99. package/serialization/types/ClientFacingResource.d.ts +1 -1
  100. package/serialization/types/ClientFacingResource.js +1 -0
  101. package/serialization/types/ClientFacingSleep.d.ts +2 -0
  102. package/serialization/types/ClientFacingSleep.js +2 -0
  103. package/serialization/types/QueryInstruction.d.ts +1 -1
  104. package/serialization/types/QueryInstruction.js +1 -1
  105. package/serialization/types/QueryInstructionSelectItem.d.ts +3 -1
  106. package/serialization/types/QueryInstructionSelectItem.js +4 -0
  107. package/serialization/types/SleepColumnExprSleep.d.ts +1 -1
  108. package/serialization/types/SleepColumnExprSleep.js +1 -0
  109. package/serialization/types/SleepScoreValueMacroExpr.d.ts +13 -0
  110. package/serialization/types/SleepScoreValueMacroExpr.js +34 -0
  111. package/serialization/types/SleepType.d.ts +10 -0
  112. package/serialization/types/SleepType.js +31 -0
  113. package/serialization/types/UnrecognizedValueMacroExpr.d.ts +12 -0
  114. package/serialization/types/UnrecognizedValueMacroExpr.js +33 -0
  115. package/serialization/types/index.d.ts +3 -0
  116. package/serialization/types/index.js +3 -0
  117. package/version.d.ts +1 -1
  118. package/version.js +1 -1
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Vital from "../index";
5
- export declare type AggregateExprArg = Vital.SleepColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr | Vital.IndexColumnExpr | Vital.GroupKeyColumnExpr;
5
+ export declare type AggregateExprArg = Vital.SleepColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr | Vital.IndexColumnExpr | Vital.GroupKeyColumnExpr | Vital.SleepScoreValueMacroExpr | Vital.UnrecognizedValueMacroExpr;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type ClientFacingResource = "profile" | "activity" | "sleep" | "body" | "workouts" | "workout_stream" | "connection" | "order" | "result" | "appointment" | "glucose" | "heartrate" | "hrv" | "hypnogram" | "ige" | "igg" | "blood_oxygen" | "blood_pressure" | "cholesterol" | "device" | "weight" | "fat" | "body_temperature" | "body_temperature_delta" | "meal" | "water" | "caffeine" | "mindfulness_minutes" | "steps" | "calories_active" | "distance" | "floors_climbed" | "respiratory_rate" | "vo2_max" | "calories_basal" | "stress_level" | "menstrual_cycle" | "electrocardiogram_voltage" | "workout_duration" | "insulin_injection" | "carbohydrates" | "note" | "sleep_stream";
4
+ export declare type ClientFacingResource = "profile" | "activity" | "sleep" | "body" | "workouts" | "workout_stream" | "connection" | "order" | "result" | "appointment" | "glucose" | "heartrate" | "hrv" | "hypnogram" | "ige" | "igg" | "blood_oxygen" | "blood_pressure" | "cholesterol" | "device" | "weight" | "fat" | "body_temperature" | "body_temperature_delta" | "meal" | "water" | "caffeine" | "mindfulness_minutes" | "steps" | "calories_active" | "distance" | "floors_climbed" | "respiratory_rate" | "vo2_max" | "calories_basal" | "stress_level" | "menstrual_cycle" | "sleep_cycle" | "electrocardiogram_voltage" | "workout_duration" | "insulin_injection" | "carbohydrates" | "note" | "sleep_stream";
5
5
  export declare const ClientFacingResource: {
6
6
  readonly Profile: "profile";
7
7
  readonly Activity: "activity";
@@ -40,6 +40,7 @@ export declare const ClientFacingResource: {
40
40
  readonly CaloriesBasal: "calories_basal";
41
41
  readonly StressLevel: "stress_level";
42
42
  readonly MenstrualCycle: "menstrual_cycle";
43
+ readonly SleepCycle: "sleep_cycle";
43
44
  readonly ElectrocardiogramVoltage: "electrocardiogram_voltage";
44
45
  readonly WorkoutDuration: "workout_duration";
45
46
  readonly InsulinInjection: "insulin_injection";
@@ -42,6 +42,7 @@ exports.ClientFacingResource = {
42
42
  CaloriesBasal: "calories_basal",
43
43
  StressLevel: "stress_level",
44
44
  MenstrualCycle: "menstrual_cycle",
45
+ SleepCycle: "sleep_cycle",
45
46
  ElectrocardiogramVoltage: "electrocardiogram_voltage",
46
47
  WorkoutDuration: "workout_duration",
47
48
  InsulinInjection: "insulin_injection",
@@ -14,6 +14,13 @@ export interface ClientFacingSleep {
14
14
  bedtimeStart: string;
15
15
  /** UTC Time when the sleep period ended */
16
16
  bedtimeStop: string;
17
+ /**
18
+ * `long_sleep`: >=3 hours of sleep;
19
+ * `short_sleep`: <3 hours of sleep;
20
+ * `acknowledged_nap`: User-acknowledged naps, typically under 3 hours of sleep;
21
+ * `unknown`: The sleep session recording is ongoing.
22
+ */
23
+ type: Vital.SleepType;
17
24
  /** Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds */
18
25
  timezoneOffset?: number;
19
26
  /** Total duration of the sleep period (sleep.duration = sleep.bedtime_end - sleep.bedtime_start)::seconds */
@@ -4,6 +4,6 @@
4
4
  import * as Vital from "../index";
5
5
  export interface QueryInstruction {
6
6
  select: Vital.QueryInstructionSelectItem[];
7
- groupBy: Vital.QueryInstructionGroupByItem[];
7
+ groupBy?: Vital.QueryInstructionGroupByItem[];
8
8
  splitBySource?: boolean;
9
9
  }
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Vital from "../index";
5
- export declare type QueryInstructionSelectItem = Vital.AggregateExpr | Vital.SleepColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr | Vital.IndexColumnExpr | Vital.GroupKeyColumnExpr;
5
+ export declare type QueryInstructionSelectItem = Vital.AggregateExpr | Vital.SleepColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr | Vital.IndexColumnExpr | Vital.GroupKeyColumnExpr | Vital.SleepScoreValueMacroExpr | Vital.UnrecognizedValueMacroExpr;
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type SleepColumnExprSleep = "session_start" | "session_end" | "state" | "duration_second" | "stage_asleep_second" | "stage_awake_second" | "stage_light_second" | "stage_rem_second" | "stage_deep_second" | "stage_unknown_second" | "latency_second" | "heart_rate_minimum" | "heart_rate_mean" | "heart_rate_maximum" | "heart_rate_dip" | "efficiency" | "hrv_mean_rmssd" | "hrv_mean_sdnn" | "skin_temperature_delta" | "respiratory_rate" | "score" | "source_type" | "source_provider" | "source_app_id";
4
+ export declare type SleepColumnExprSleep = "session_start" | "session_end" | "state" | "type" | "duration_second" | "stage_asleep_second" | "stage_awake_second" | "stage_light_second" | "stage_rem_second" | "stage_deep_second" | "stage_unknown_second" | "latency_second" | "heart_rate_minimum" | "heart_rate_mean" | "heart_rate_maximum" | "heart_rate_dip" | "efficiency" | "hrv_mean_rmssd" | "hrv_mean_sdnn" | "skin_temperature_delta" | "respiratory_rate" | "score" | "source_type" | "source_provider" | "source_app_id";
5
5
  export declare const SleepColumnExprSleep: {
6
6
  readonly SessionStart: "session_start";
7
7
  readonly SessionEnd: "session_end";
8
8
  readonly State: "state";
9
+ readonly Type: "type";
9
10
  readonly DurationSecond: "duration_second";
10
11
  readonly StageAsleepSecond: "stage_asleep_second";
11
12
  readonly StageAwakeSecond: "stage_awake_second";
@@ -8,6 +8,7 @@ exports.SleepColumnExprSleep = {
8
8
  SessionStart: "session_start",
9
9
  SessionEnd: "session_end",
10
10
  State: "state",
11
+ Type: "type",
11
12
  DurationSecond: "duration_second",
12
13
  StageAsleepSecond: "stage_asleep_second",
13
14
  StageAwakeSecond: "stage_awake_second",
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SleepScoreValueMacroExpr {
5
+ valueMacro: "sleep_score";
6
+ version?: "automatic";
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type SleepType = "long_sleep" | "short_sleep" | "acknowledged_nap" | "unknown";
5
+ export declare const SleepType: {
6
+ readonly LongSleep: "long_sleep";
7
+ readonly ShortSleep: "short_sleep";
8
+ readonly AcknowledgedNap: "acknowledged_nap";
9
+ readonly Unknown: "unknown";
10
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SleepType = void 0;
7
+ exports.SleepType = {
8
+ LongSleep: "long_sleep",
9
+ ShortSleep: "short_sleep",
10
+ AcknowledgedNap: "acknowledged_nap",
11
+ Unknown: "unknown",
12
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface UnrecognizedValueMacroExpr {
5
+ valueMacro: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -273,7 +273,9 @@ export * from "./SingleUserHistoricalPullResponse";
273
273
  export * from "./SingleUserResourceResponse";
274
274
  export * from "./SleepColumnExprSleep";
275
275
  export * from "./SleepColumnExpr";
276
+ export * from "./SleepScoreValueMacroExpr";
276
277
  export * from "./SleepSummaryState";
278
+ export * from "./SleepType";
277
279
  export * from "./SleepV2InDb";
278
280
  export * from "./Source";
279
281
  export * from "./SourceAuthType";
@@ -285,6 +287,7 @@ export * from "./TimeseriesMetricPoint";
285
287
  export * from "./TimeseriesResource";
286
288
  export * from "./TraceElements";
287
289
  export * from "./UsAddress";
290
+ export * from "./UnrecognizedValueMacroExpr";
288
291
  export * from "./UserHistoricalPullsResponse";
289
292
  export * from "./UserInfo";
290
293
  export * from "./UserRefreshErrorResponse";
@@ -289,7 +289,9 @@ __exportStar(require("./SingleUserHistoricalPullResponse"), exports);
289
289
  __exportStar(require("./SingleUserResourceResponse"), exports);
290
290
  __exportStar(require("./SleepColumnExprSleep"), exports);
291
291
  __exportStar(require("./SleepColumnExpr"), exports);
292
+ __exportStar(require("./SleepScoreValueMacroExpr"), exports);
292
293
  __exportStar(require("./SleepSummaryState"), exports);
294
+ __exportStar(require("./SleepType"), exports);
293
295
  __exportStar(require("./SleepV2InDb"), exports);
294
296
  __exportStar(require("./Source"), exports);
295
297
  __exportStar(require("./SourceAuthType"), exports);
@@ -301,6 +303,7 @@ __exportStar(require("./TimeseriesMetricPoint"), exports);
301
303
  __exportStar(require("./TimeseriesResource"), exports);
302
304
  __exportStar(require("./TraceElements"), exports);
303
305
  __exportStar(require("./UsAddress"), exports);
306
+ __exportStar(require("./UnrecognizedValueMacroExpr"), exports);
304
307
  __exportStar(require("./UserHistoricalPullsResponse"), exports);
305
308
  __exportStar(require("./UserInfo"), exports);
306
309
  __exportStar(require("./UserRefreshErrorResponse"), exports);
@@ -10,7 +10,9 @@ import { WorkoutColumnExpr } from "./WorkoutColumnExpr";
10
10
  import { BodyColumnExpr } from "./BodyColumnExpr";
11
11
  import { IndexColumnExpr } from "./IndexColumnExpr";
12
12
  import { GroupKeyColumnExpr } from "./GroupKeyColumnExpr";
13
+ import { SleepScoreValueMacroExpr } from "./SleepScoreValueMacroExpr";
14
+ import { UnrecognizedValueMacroExpr } from "./UnrecognizedValueMacroExpr";
13
15
  export declare const AggregateExprArg: core.serialization.Schema<serializers.AggregateExprArg.Raw, Vital.AggregateExprArg>;
14
16
  export declare namespace AggregateExprArg {
15
- type Raw = SleepColumnExpr.Raw | ActivityColumnExpr.Raw | WorkoutColumnExpr.Raw | BodyColumnExpr.Raw | IndexColumnExpr.Raw | GroupKeyColumnExpr.Raw;
17
+ type Raw = SleepColumnExpr.Raw | ActivityColumnExpr.Raw | WorkoutColumnExpr.Raw | BodyColumnExpr.Raw | IndexColumnExpr.Raw | GroupKeyColumnExpr.Raw | SleepScoreValueMacroExpr.Raw | UnrecognizedValueMacroExpr.Raw;
16
18
  }
@@ -34,6 +34,8 @@ const WorkoutColumnExpr_1 = require("./WorkoutColumnExpr");
34
34
  const BodyColumnExpr_1 = require("./BodyColumnExpr");
35
35
  const IndexColumnExpr_1 = require("./IndexColumnExpr");
36
36
  const GroupKeyColumnExpr_1 = require("./GroupKeyColumnExpr");
37
+ const SleepScoreValueMacroExpr_1 = require("./SleepScoreValueMacroExpr");
38
+ const UnrecognizedValueMacroExpr_1 = require("./UnrecognizedValueMacroExpr");
37
39
  exports.AggregateExprArg = core.serialization.undiscriminatedUnion([
38
40
  SleepColumnExpr_1.SleepColumnExpr,
39
41
  ActivityColumnExpr_1.ActivityColumnExpr,
@@ -41,4 +43,6 @@ exports.AggregateExprArg = core.serialization.undiscriminatedUnion([
41
43
  BodyColumnExpr_1.BodyColumnExpr,
42
44
  IndexColumnExpr_1.IndexColumnExpr,
43
45
  GroupKeyColumnExpr_1.GroupKeyColumnExpr,
46
+ SleepScoreValueMacroExpr_1.SleepScoreValueMacroExpr,
47
+ UnrecognizedValueMacroExpr_1.UnrecognizedValueMacroExpr,
44
48
  ]);
@@ -6,5 +6,5 @@ import * as Vital from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  export declare const ClientFacingResource: core.serialization.Schema<serializers.ClientFacingResource.Raw, Vital.ClientFacingResource>;
8
8
  export declare namespace ClientFacingResource {
9
- type Raw = "profile" | "activity" | "sleep" | "body" | "workouts" | "workout_stream" | "connection" | "order" | "result" | "appointment" | "glucose" | "heartrate" | "hrv" | "hypnogram" | "ige" | "igg" | "blood_oxygen" | "blood_pressure" | "cholesterol" | "device" | "weight" | "fat" | "body_temperature" | "body_temperature_delta" | "meal" | "water" | "caffeine" | "mindfulness_minutes" | "steps" | "calories_active" | "distance" | "floors_climbed" | "respiratory_rate" | "vo2_max" | "calories_basal" | "stress_level" | "menstrual_cycle" | "electrocardiogram_voltage" | "workout_duration" | "insulin_injection" | "carbohydrates" | "note" | "sleep_stream";
9
+ type Raw = "profile" | "activity" | "sleep" | "body" | "workouts" | "workout_stream" | "connection" | "order" | "result" | "appointment" | "glucose" | "heartrate" | "hrv" | "hypnogram" | "ige" | "igg" | "blood_oxygen" | "blood_pressure" | "cholesterol" | "device" | "weight" | "fat" | "body_temperature" | "body_temperature_delta" | "meal" | "water" | "caffeine" | "mindfulness_minutes" | "steps" | "calories_active" | "distance" | "floors_climbed" | "respiratory_rate" | "vo2_max" | "calories_basal" | "stress_level" | "menstrual_cycle" | "sleep_cycle" | "electrocardiogram_voltage" | "workout_duration" | "insulin_injection" | "carbohydrates" | "note" | "sleep_stream";
10
10
  }
@@ -66,6 +66,7 @@ exports.ClientFacingResource = core.serialization.enum_([
66
66
  "calories_basal",
67
67
  "stress_level",
68
68
  "menstrual_cycle",
69
+ "sleep_cycle",
69
70
  "electrocardiogram_voltage",
70
71
  "workout_duration",
71
72
  "insulin_injection",
@@ -4,6 +4,7 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Vital from "../../api/index";
6
6
  import * as core from "../../core";
7
+ import { SleepType } from "./SleepType";
7
8
  import { SleepSummaryState } from "./SleepSummaryState";
8
9
  import { ClientFacingSource } from "./ClientFacingSource";
9
10
  import { ClientFacingSleepStream } from "./ClientFacingSleepStream";
@@ -16,6 +17,7 @@ export declare namespace ClientFacingSleep {
16
17
  calendar_date: string;
17
18
  bedtime_start: string;
18
19
  bedtime_stop: string;
20
+ type: SleepType.Raw;
19
21
  timezone_offset?: number | null;
20
22
  duration: number;
21
23
  total: number;
@@ -28,6 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.ClientFacingSleep = void 0;
30
30
  const core = __importStar(require("../../core"));
31
+ const SleepType_1 = require("./SleepType");
31
32
  const SleepSummaryState_1 = require("./SleepSummaryState");
32
33
  const ClientFacingSource_1 = require("./ClientFacingSource");
33
34
  const ClientFacingSleepStream_1 = require("./ClientFacingSleepStream");
@@ -38,6 +39,7 @@ exports.ClientFacingSleep = core.serialization.object({
38
39
  calendarDate: core.serialization.property("calendar_date", core.serialization.string()),
39
40
  bedtimeStart: core.serialization.property("bedtime_start", core.serialization.string()),
40
41
  bedtimeStop: core.serialization.property("bedtime_stop", core.serialization.string()),
42
+ type: SleepType_1.SleepType,
41
43
  timezoneOffset: core.serialization.property("timezone_offset", core.serialization.number().optional()),
42
44
  duration: core.serialization.number(),
43
45
  total: core.serialization.number(),
@@ -10,7 +10,7 @@ export declare const QueryInstruction: core.serialization.ObjectSchema<serialize
10
10
  export declare namespace QueryInstruction {
11
11
  interface Raw {
12
12
  select: QueryInstructionSelectItem.Raw[];
13
- group_by: QueryInstructionGroupByItem.Raw[];
13
+ group_by?: QueryInstructionGroupByItem.Raw[] | null;
14
14
  split_by_source?: boolean | null;
15
15
  }
16
16
  }
@@ -32,6 +32,6 @@ const QueryInstructionSelectItem_1 = require("./QueryInstructionSelectItem");
32
32
  const QueryInstructionGroupByItem_1 = require("./QueryInstructionGroupByItem");
33
33
  exports.QueryInstruction = core.serialization.object({
34
34
  select: core.serialization.list(QueryInstructionSelectItem_1.QueryInstructionSelectItem),
35
- groupBy: core.serialization.property("group_by", core.serialization.list(QueryInstructionGroupByItem_1.QueryInstructionGroupByItem)),
35
+ groupBy: core.serialization.property("group_by", core.serialization.list(QueryInstructionGroupByItem_1.QueryInstructionGroupByItem).optional()),
36
36
  splitBySource: core.serialization.property("split_by_source", core.serialization.boolean().optional()),
37
37
  });
@@ -11,7 +11,9 @@ import { WorkoutColumnExpr } from "./WorkoutColumnExpr";
11
11
  import { BodyColumnExpr } from "./BodyColumnExpr";
12
12
  import { IndexColumnExpr } from "./IndexColumnExpr";
13
13
  import { GroupKeyColumnExpr } from "./GroupKeyColumnExpr";
14
+ import { SleepScoreValueMacroExpr } from "./SleepScoreValueMacroExpr";
15
+ import { UnrecognizedValueMacroExpr } from "./UnrecognizedValueMacroExpr";
14
16
  export declare const QueryInstructionSelectItem: core.serialization.Schema<serializers.QueryInstructionSelectItem.Raw, Vital.QueryInstructionSelectItem>;
15
17
  export declare namespace QueryInstructionSelectItem {
16
- type Raw = AggregateExpr.Raw | SleepColumnExpr.Raw | ActivityColumnExpr.Raw | WorkoutColumnExpr.Raw | BodyColumnExpr.Raw | IndexColumnExpr.Raw | GroupKeyColumnExpr.Raw;
18
+ type Raw = AggregateExpr.Raw | SleepColumnExpr.Raw | ActivityColumnExpr.Raw | WorkoutColumnExpr.Raw | BodyColumnExpr.Raw | IndexColumnExpr.Raw | GroupKeyColumnExpr.Raw | SleepScoreValueMacroExpr.Raw | UnrecognizedValueMacroExpr.Raw;
17
19
  }
@@ -35,6 +35,8 @@ const WorkoutColumnExpr_1 = require("./WorkoutColumnExpr");
35
35
  const BodyColumnExpr_1 = require("./BodyColumnExpr");
36
36
  const IndexColumnExpr_1 = require("./IndexColumnExpr");
37
37
  const GroupKeyColumnExpr_1 = require("./GroupKeyColumnExpr");
38
+ const SleepScoreValueMacroExpr_1 = require("./SleepScoreValueMacroExpr");
39
+ const UnrecognizedValueMacroExpr_1 = require("./UnrecognizedValueMacroExpr");
38
40
  exports.QueryInstructionSelectItem = core.serialization.undiscriminatedUnion([
39
41
  AggregateExpr_1.AggregateExpr,
40
42
  SleepColumnExpr_1.SleepColumnExpr,
@@ -43,4 +45,6 @@ exports.QueryInstructionSelectItem = core.serialization.undiscriminatedUnion([
43
45
  BodyColumnExpr_1.BodyColumnExpr,
44
46
  IndexColumnExpr_1.IndexColumnExpr,
45
47
  GroupKeyColumnExpr_1.GroupKeyColumnExpr,
48
+ SleepScoreValueMacroExpr_1.SleepScoreValueMacroExpr,
49
+ UnrecognizedValueMacroExpr_1.UnrecognizedValueMacroExpr,
46
50
  ]);
@@ -6,5 +6,5 @@ import * as Vital from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  export declare const SleepColumnExprSleep: core.serialization.Schema<serializers.SleepColumnExprSleep.Raw, Vital.SleepColumnExprSleep>;
8
8
  export declare namespace SleepColumnExprSleep {
9
- type Raw = "session_start" | "session_end" | "state" | "duration_second" | "stage_asleep_second" | "stage_awake_second" | "stage_light_second" | "stage_rem_second" | "stage_deep_second" | "stage_unknown_second" | "latency_second" | "heart_rate_minimum" | "heart_rate_mean" | "heart_rate_maximum" | "heart_rate_dip" | "efficiency" | "hrv_mean_rmssd" | "hrv_mean_sdnn" | "skin_temperature_delta" | "respiratory_rate" | "score" | "source_type" | "source_provider" | "source_app_id";
9
+ type Raw = "session_start" | "session_end" | "state" | "type" | "duration_second" | "stage_asleep_second" | "stage_awake_second" | "stage_light_second" | "stage_rem_second" | "stage_deep_second" | "stage_unknown_second" | "latency_second" | "heart_rate_minimum" | "heart_rate_mean" | "heart_rate_maximum" | "heart_rate_dip" | "efficiency" | "hrv_mean_rmssd" | "hrv_mean_sdnn" | "skin_temperature_delta" | "respiratory_rate" | "score" | "source_type" | "source_provider" | "source_app_id";
10
10
  }
@@ -32,6 +32,7 @@ exports.SleepColumnExprSleep = core.serialization.enum_([
32
32
  "session_start",
33
33
  "session_end",
34
34
  "state",
35
+ "type",
35
36
  "duration_second",
36
37
  "stage_asleep_second",
37
38
  "stage_awake_second",
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Vital from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const SleepScoreValueMacroExpr: core.serialization.ObjectSchema<serializers.SleepScoreValueMacroExpr.Raw, Vital.SleepScoreValueMacroExpr>;
8
+ export declare namespace SleepScoreValueMacroExpr {
9
+ interface Raw {
10
+ value_macro: "sleep_score";
11
+ version?: "automatic" | null;
12
+ }
13
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SleepScoreValueMacroExpr = void 0;
30
+ const core = __importStar(require("../../core"));
31
+ exports.SleepScoreValueMacroExpr = core.serialization.object({
32
+ valueMacro: core.serialization.property("value_macro", core.serialization.stringLiteral("sleep_score")),
33
+ version: core.serialization.stringLiteral("automatic").optional(),
34
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Vital from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const SleepType: core.serialization.Schema<serializers.SleepType.Raw, Vital.SleepType>;
8
+ export declare namespace SleepType {
9
+ type Raw = "long_sleep" | "short_sleep" | "acknowledged_nap" | "unknown";
10
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SleepType = void 0;
30
+ const core = __importStar(require("../../core"));
31
+ exports.SleepType = core.serialization.enum_(["long_sleep", "short_sleep", "acknowledged_nap", "unknown"]);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Vital from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const UnrecognizedValueMacroExpr: core.serialization.ObjectSchema<serializers.UnrecognizedValueMacroExpr.Raw, Vital.UnrecognizedValueMacroExpr>;
8
+ export declare namespace UnrecognizedValueMacroExpr {
9
+ interface Raw {
10
+ value_macro: string;
11
+ }
12
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.UnrecognizedValueMacroExpr = void 0;
30
+ const core = __importStar(require("../../core"));
31
+ exports.UnrecognizedValueMacroExpr = core.serialization.object({
32
+ valueMacro: core.serialization.property("value_macro", core.serialization.string()),
33
+ });
@@ -273,7 +273,9 @@ export * from "./SingleUserHistoricalPullResponse";
273
273
  export * from "./SingleUserResourceResponse";
274
274
  export * from "./SleepColumnExprSleep";
275
275
  export * from "./SleepColumnExpr";
276
+ export * from "./SleepScoreValueMacroExpr";
276
277
  export * from "./SleepSummaryState";
278
+ export * from "./SleepType";
277
279
  export * from "./SleepV2InDb";
278
280
  export * from "./Source";
279
281
  export * from "./SourceAuthType";
@@ -285,6 +287,7 @@ export * from "./TimeseriesMetricPoint";
285
287
  export * from "./TimeseriesResource";
286
288
  export * from "./TraceElements";
287
289
  export * from "./UsAddress";
290
+ export * from "./UnrecognizedValueMacroExpr";
288
291
  export * from "./UserHistoricalPullsResponse";
289
292
  export * from "./UserInfo";
290
293
  export * from "./UserRefreshErrorResponse";
@@ -289,7 +289,9 @@ __exportStar(require("./SingleUserHistoricalPullResponse"), exports);
289
289
  __exportStar(require("./SingleUserResourceResponse"), exports);
290
290
  __exportStar(require("./SleepColumnExprSleep"), exports);
291
291
  __exportStar(require("./SleepColumnExpr"), exports);
292
+ __exportStar(require("./SleepScoreValueMacroExpr"), exports);
292
293
  __exportStar(require("./SleepSummaryState"), exports);
294
+ __exportStar(require("./SleepType"), exports);
293
295
  __exportStar(require("./SleepV2InDb"), exports);
294
296
  __exportStar(require("./Source"), exports);
295
297
  __exportStar(require("./SourceAuthType"), exports);
@@ -301,6 +303,7 @@ __exportStar(require("./TimeseriesMetricPoint"), exports);
301
303
  __exportStar(require("./TimeseriesResource"), exports);
302
304
  __exportStar(require("./TraceElements"), exports);
303
305
  __exportStar(require("./UsAddress"), exports);
306
+ __exportStar(require("./UnrecognizedValueMacroExpr"), exports);
304
307
  __exportStar(require("./UserHistoricalPullsResponse"), exports);
305
308
  __exportStar(require("./UserInfo"), exports);
306
309
  __exportStar(require("./UserRefreshErrorResponse"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.1.101";
1
+ export declare const SDK_VERSION = "3.1.103";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "3.1.101";
4
+ exports.SDK_VERSION = "3.1.103";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "3.1.101",
3
+ "version": "3.1.103",
4
4
  "private": false,
5
5
  "repository": "https://github.com/tryVital/vital-node",
6
6
  "main": "./index.js",
package/reference.md CHANGED
@@ -9213,16 +9213,6 @@ await client.aggregate.queryOne("user_id", {
9213
9213
  func: "mean",
9214
9214
  },
9215
9215
  ],
9216
- groupBy: [
9217
- {
9218
- dateTrunc: {
9219
- unit: "minute",
9220
- },
9221
- arg: {
9222
- index: "sleep",
9223
- },
9224
- },
9225
- ],
9226
9216
  },
9227
9217
  ],
9228
9218
  });
@@ -10,7 +10,9 @@ import { WorkoutColumnExpr } from "./WorkoutColumnExpr";
10
10
  import { BodyColumnExpr } from "./BodyColumnExpr";
11
11
  import { IndexColumnExpr } from "./IndexColumnExpr";
12
12
  import { GroupKeyColumnExpr } from "./GroupKeyColumnExpr";
13
+ import { SleepScoreValueMacroExpr } from "./SleepScoreValueMacroExpr";
14
+ import { UnrecognizedValueMacroExpr } from "./UnrecognizedValueMacroExpr";
13
15
  export declare const AggregateExprArg: core.serialization.Schema<serializers.AggregateExprArg.Raw, Vital.AggregateExprArg>;
14
16
  export declare namespace AggregateExprArg {
15
- type Raw = SleepColumnExpr.Raw | ActivityColumnExpr.Raw | WorkoutColumnExpr.Raw | BodyColumnExpr.Raw | IndexColumnExpr.Raw | GroupKeyColumnExpr.Raw;
17
+ type Raw = SleepColumnExpr.Raw | ActivityColumnExpr.Raw | WorkoutColumnExpr.Raw | BodyColumnExpr.Raw | IndexColumnExpr.Raw | GroupKeyColumnExpr.Raw | SleepScoreValueMacroExpr.Raw | UnrecognizedValueMacroExpr.Raw;
16
18
  }
@@ -34,6 +34,8 @@ const WorkoutColumnExpr_1 = require("./WorkoutColumnExpr");
34
34
  const BodyColumnExpr_1 = require("./BodyColumnExpr");
35
35
  const IndexColumnExpr_1 = require("./IndexColumnExpr");
36
36
  const GroupKeyColumnExpr_1 = require("./GroupKeyColumnExpr");
37
+ const SleepScoreValueMacroExpr_1 = require("./SleepScoreValueMacroExpr");
38
+ const UnrecognizedValueMacroExpr_1 = require("./UnrecognizedValueMacroExpr");
37
39
  exports.AggregateExprArg = core.serialization.undiscriminatedUnion([
38
40
  SleepColumnExpr_1.SleepColumnExpr,
39
41
  ActivityColumnExpr_1.ActivityColumnExpr,
@@ -41,4 +43,6 @@ exports.AggregateExprArg = core.serialization.undiscriminatedUnion([
41
43
  BodyColumnExpr_1.BodyColumnExpr,
42
44
  IndexColumnExpr_1.IndexColumnExpr,
43
45
  GroupKeyColumnExpr_1.GroupKeyColumnExpr,
46
+ SleepScoreValueMacroExpr_1.SleepScoreValueMacroExpr,
47
+ UnrecognizedValueMacroExpr_1.UnrecognizedValueMacroExpr,
44
48
  ]);
@@ -6,5 +6,5 @@ import * as Vital from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  export declare const ClientFacingResource: core.serialization.Schema<serializers.ClientFacingResource.Raw, Vital.ClientFacingResource>;
8
8
  export declare namespace ClientFacingResource {
9
- type Raw = "profile" | "activity" | "sleep" | "body" | "workouts" | "workout_stream" | "connection" | "order" | "result" | "appointment" | "glucose" | "heartrate" | "hrv" | "hypnogram" | "ige" | "igg" | "blood_oxygen" | "blood_pressure" | "cholesterol" | "device" | "weight" | "fat" | "body_temperature" | "body_temperature_delta" | "meal" | "water" | "caffeine" | "mindfulness_minutes" | "steps" | "calories_active" | "distance" | "floors_climbed" | "respiratory_rate" | "vo2_max" | "calories_basal" | "stress_level" | "menstrual_cycle" | "electrocardiogram_voltage" | "workout_duration" | "insulin_injection" | "carbohydrates" | "note" | "sleep_stream";
9
+ type Raw = "profile" | "activity" | "sleep" | "body" | "workouts" | "workout_stream" | "connection" | "order" | "result" | "appointment" | "glucose" | "heartrate" | "hrv" | "hypnogram" | "ige" | "igg" | "blood_oxygen" | "blood_pressure" | "cholesterol" | "device" | "weight" | "fat" | "body_temperature" | "body_temperature_delta" | "meal" | "water" | "caffeine" | "mindfulness_minutes" | "steps" | "calories_active" | "distance" | "floors_climbed" | "respiratory_rate" | "vo2_max" | "calories_basal" | "stress_level" | "menstrual_cycle" | "sleep_cycle" | "electrocardiogram_voltage" | "workout_duration" | "insulin_injection" | "carbohydrates" | "note" | "sleep_stream";
10
10
  }
@@ -66,6 +66,7 @@ exports.ClientFacingResource = core.serialization.enum_([
66
66
  "calories_basal",
67
67
  "stress_level",
68
68
  "menstrual_cycle",
69
+ "sleep_cycle",
69
70
  "electrocardiogram_voltage",
70
71
  "workout_duration",
71
72
  "insulin_injection",