@tryvital/vital-node 3.1.1 → 3.1.3

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 (103) hide show
  1. package/api/errors/BadRequestError.d.ts +1 -2
  2. package/api/resources/activity/client/Client.js +2 -2
  3. package/api/resources/body/client/Client.js +2 -2
  4. package/api/resources/devices/client/Client.js +1 -1
  5. package/api/resources/insurance/client/Client.js +2 -2
  6. package/api/resources/introspect/client/Client.js +2 -2
  7. package/api/resources/labTests/client/Client.d.ts +1 -2
  8. package/api/resources/labTests/client/Client.js +29 -39
  9. package/api/resources/link/client/Client.d.ts +2 -6
  10. package/api/resources/link/client/Client.js +15 -19
  11. package/api/resources/meal/client/Client.js +1 -1
  12. package/api/resources/profile/client/Client.js +2 -2
  13. package/api/resources/providers/client/Client.js +1 -1
  14. package/api/resources/sleep/client/Client.js +4 -4
  15. package/api/resources/team/client/Client.js +7 -7
  16. package/api/resources/testkit/client/Client.js +2 -2
  17. package/api/resources/testkit/client/requests/RegisterTestkitRequest.d.ts +1 -0
  18. package/api/resources/user/client/Client.d.ts +1 -0
  19. package/api/resources/user/client/Client.js +16 -18
  20. package/api/resources/user/client/requests/UserCreateBody.d.ts +4 -0
  21. package/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
  22. package/api/resources/vitals/client/Client.js +50 -50
  23. package/api/resources/workouts/client/Client.js +3 -3
  24. package/api/types/ClientFacingUser.d.ts +4 -0
  25. package/api/types/ClientUserIdConflict.d.ts +9 -0
  26. package/api/types/ClientUserIdConflict.js +5 -0
  27. package/api/types/LibreConfig.d.ts +1 -0
  28. package/api/types/OrderStatus.d.ts +2 -1
  29. package/api/types/OrderStatus.js +1 -0
  30. package/api/types/Region.d.ts +2 -1
  31. package/api/types/Region.js +1 -0
  32. package/api/types/index.d.ts +1 -0
  33. package/api/types/index.js +1 -0
  34. package/dist/api/errors/BadRequestError.d.ts +1 -2
  35. package/dist/api/resources/activity/client/Client.js +2 -2
  36. package/dist/api/resources/body/client/Client.js +2 -2
  37. package/dist/api/resources/devices/client/Client.js +1 -1
  38. package/dist/api/resources/insurance/client/Client.js +2 -2
  39. package/dist/api/resources/introspect/client/Client.js +2 -2
  40. package/dist/api/resources/labTests/client/Client.d.ts +1 -2
  41. package/dist/api/resources/labTests/client/Client.js +29 -39
  42. package/dist/api/resources/link/client/Client.d.ts +2 -6
  43. package/dist/api/resources/link/client/Client.js +15 -19
  44. package/dist/api/resources/meal/client/Client.js +1 -1
  45. package/dist/api/resources/profile/client/Client.js +2 -2
  46. package/dist/api/resources/providers/client/Client.js +1 -1
  47. package/dist/api/resources/sleep/client/Client.js +4 -4
  48. package/dist/api/resources/team/client/Client.js +7 -7
  49. package/dist/api/resources/testkit/client/Client.js +2 -2
  50. package/dist/api/resources/testkit/client/requests/RegisterTestkitRequest.d.ts +1 -0
  51. package/dist/api/resources/user/client/Client.d.ts +1 -0
  52. package/dist/api/resources/user/client/Client.js +16 -18
  53. package/dist/api/resources/user/client/requests/UserCreateBody.d.ts +4 -0
  54. package/dist/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
  55. package/dist/api/resources/vitals/client/Client.js +50 -50
  56. package/dist/api/resources/workouts/client/Client.js +3 -3
  57. package/dist/api/types/ClientFacingUser.d.ts +4 -0
  58. package/dist/api/types/ClientUserIdConflict.d.ts +9 -0
  59. package/dist/api/types/ClientUserIdConflict.js +5 -0
  60. package/dist/api/types/LibreConfig.d.ts +1 -0
  61. package/dist/api/types/OrderStatus.d.ts +2 -1
  62. package/dist/api/types/OrderStatus.js +1 -0
  63. package/dist/api/types/Region.d.ts +2 -1
  64. package/dist/api/types/Region.js +1 -0
  65. package/dist/api/types/index.d.ts +1 -0
  66. package/dist/api/types/index.js +1 -0
  67. package/dist/serialization/resources/testkit/client/requests/RegisterTestkitRequest.d.ts +1 -0
  68. package/dist/serialization/resources/testkit/client/requests/RegisterTestkitRequest.js +1 -0
  69. package/dist/serialization/resources/user/client/requests/UserCreateBody.d.ts +2 -0
  70. package/dist/serialization/resources/user/client/requests/UserCreateBody.js +2 -0
  71. package/dist/serialization/resources/user/client/requests/UserPatchBody.d.ts +2 -0
  72. package/dist/serialization/resources/user/client/requests/UserPatchBody.js +2 -0
  73. package/dist/serialization/types/ClientFacingUser.d.ts +2 -0
  74. package/dist/serialization/types/ClientFacingUser.js +2 -0
  75. package/dist/serialization/types/ClientUserIdConflict.d.ts +15 -0
  76. package/dist/serialization/types/ClientUserIdConflict.js +36 -0
  77. package/dist/serialization/types/LibreConfig.d.ts +1 -0
  78. package/dist/serialization/types/LibreConfig.js +1 -0
  79. package/dist/serialization/types/OrderStatus.d.ts +1 -1
  80. package/dist/serialization/types/OrderStatus.js +1 -0
  81. package/dist/serialization/types/Region.d.ts +1 -1
  82. package/dist/serialization/types/Region.js +1 -0
  83. package/dist/serialization/types/index.d.ts +1 -0
  84. package/dist/serialization/types/index.js +1 -0
  85. package/package.json +1 -1
  86. package/serialization/resources/testkit/client/requests/RegisterTestkitRequest.d.ts +1 -0
  87. package/serialization/resources/testkit/client/requests/RegisterTestkitRequest.js +1 -0
  88. package/serialization/resources/user/client/requests/UserCreateBody.d.ts +2 -0
  89. package/serialization/resources/user/client/requests/UserCreateBody.js +2 -0
  90. package/serialization/resources/user/client/requests/UserPatchBody.d.ts +2 -0
  91. package/serialization/resources/user/client/requests/UserPatchBody.js +2 -0
  92. package/serialization/types/ClientFacingUser.d.ts +2 -0
  93. package/serialization/types/ClientFacingUser.js +2 -0
  94. package/serialization/types/ClientUserIdConflict.d.ts +15 -0
  95. package/serialization/types/ClientUserIdConflict.js +36 -0
  96. package/serialization/types/LibreConfig.d.ts +1 -0
  97. package/serialization/types/LibreConfig.js +1 -0
  98. package/serialization/types/OrderStatus.d.ts +1 -1
  99. package/serialization/types/OrderStatus.js +1 -0
  100. package/serialization/types/Region.d.ts +1 -1
  101. package/serialization/types/Region.js +1 -0
  102. package/serialization/types/index.d.ts +1 -0
  103. package/serialization/types/index.js +1 -0
@@ -67,7 +67,7 @@ class Team {
67
67
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
68
68
  "X-Fern-Language": "JavaScript",
69
69
  "X-Fern-SDK-Name": "@tryvital/vital-node",
70
- "X-Fern-SDK-Version": "3.1.1",
70
+ "X-Fern-SDK-Version": "3.1.3",
71
71
  "x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
72
72
  },
73
73
  contentType: "application/json",
@@ -127,7 +127,7 @@ class Team {
127
127
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
128
128
  "X-Fern-Language": "JavaScript",
129
129
  "X-Fern-SDK-Name": "@tryvital/vital-node",
130
- "X-Fern-SDK-Version": "3.1.1",
130
+ "X-Fern-SDK-Version": "3.1.3",
131
131
  },
132
132
  contentType: "application/json",
133
133
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -194,7 +194,7 @@ class Team {
194
194
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
195
195
  "X-Fern-Language": "JavaScript",
196
196
  "X-Fern-SDK-Name": "@tryvital/vital-node",
197
- "X-Fern-SDK-Version": "3.1.1",
197
+ "X-Fern-SDK-Version": "3.1.3",
198
198
  },
199
199
  contentType: "application/json",
200
200
  queryParameters: _queryParams,
@@ -250,7 +250,7 @@ class Team {
250
250
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
251
251
  "X-Fern-Language": "JavaScript",
252
252
  "X-Fern-SDK-Name": "@tryvital/vital-node",
253
- "X-Fern-SDK-Version": "3.1.1",
253
+ "X-Fern-SDK-Version": "3.1.3",
254
254
  },
255
255
  contentType: "application/json",
256
256
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -307,7 +307,7 @@ class Team {
307
307
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
308
308
  "X-Fern-Language": "JavaScript",
309
309
  "X-Fern-SDK-Name": "@tryvital/vital-node",
310
- "X-Fern-SDK-Version": "3.1.1",
310
+ "X-Fern-SDK-Version": "3.1.3",
311
311
  },
312
312
  contentType: "application/json",
313
313
  queryParameters: _queryParams,
@@ -375,7 +375,7 @@ class Team {
375
375
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
376
376
  "X-Fern-Language": "JavaScript",
377
377
  "X-Fern-SDK-Name": "@tryvital/vital-node",
378
- "X-Fern-SDK-Version": "3.1.1",
378
+ "X-Fern-SDK-Version": "3.1.3",
379
379
  },
380
380
  contentType: "application/json",
381
381
  queryParameters: _queryParams,
@@ -437,7 +437,7 @@ class Team {
437
437
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
438
438
  "X-Fern-Language": "JavaScript",
439
439
  "X-Fern-SDK-Name": "@tryvital/vital-node",
440
- "X-Fern-SDK-Version": "3.1.1",
440
+ "X-Fern-SDK-Version": "3.1.3",
441
441
  },
442
442
  contentType: "application/json",
443
443
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -62,7 +62,7 @@ class Testkit {
62
62
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
63
63
  "X-Fern-Language": "JavaScript",
64
64
  "X-Fern-SDK-Name": "@tryvital/vital-node",
65
- "X-Fern-SDK-Version": "3.1.1",
65
+ "X-Fern-SDK-Version": "3.1.3",
66
66
  },
67
67
  contentType: "application/json",
68
68
  body: yield serializers.RegisterTestkitRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -122,7 +122,7 @@ class Testkit {
122
122
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
123
123
  "X-Fern-Language": "JavaScript",
124
124
  "X-Fern-SDK-Name": "@tryvital/vital-node",
125
- "X-Fern-SDK-Version": "3.1.1",
125
+ "X-Fern-SDK-Version": "3.1.3",
126
126
  },
127
127
  contentType: "application/json",
128
128
  body: yield serializers.CreateRegistrableTestkitOrderRequest.jsonOrThrow(request, {
@@ -8,5 +8,6 @@ export interface RegisterTestkitRequest {
8
8
  patientDetails: Vital.PatientDetails;
9
9
  patientAddress: Vital.PatientAddressCompatible;
10
10
  physician?: Vital.PhysicianCreateRequestBase;
11
+ healthInsurance?: Vital.HealthInsuranceCreateRequest;
11
12
  consents?: Vital.Consent[];
12
13
  }
@@ -24,6 +24,7 @@ export declare class User {
24
24
  getAll(request?: Vital.UserGetAllRequest, requestOptions?: User.RequestOptions): Promise<Vital.PaginatedUsersResponse>;
25
25
  /**
26
26
  * POST Create a Vital user given a client_user_id and returns the user_id.
27
+ * @throws {@link Vital.BadRequestError}
27
28
  * @throws {@link Vital.UnprocessableEntityError}
28
29
  */
29
30
  create(request: Vital.UserCreateBody, requestOptions?: User.RequestOptions): Promise<Vital.ClientFacingUserKey>;
@@ -71,7 +71,7 @@ class User {
71
71
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
72
72
  "X-Fern-Language": "JavaScript",
73
73
  "X-Fern-SDK-Name": "@tryvital/vital-node",
74
- "X-Fern-SDK-Version": "3.1.1",
74
+ "X-Fern-SDK-Version": "3.1.3",
75
75
  },
76
76
  contentType: "application/json",
77
77
  queryParameters: _queryParams,
@@ -119,6 +119,7 @@ class User {
119
119
  }
120
120
  /**
121
121
  * POST Create a Vital user given a client_user_id and returns the user_id.
122
+ * @throws {@link Vital.BadRequestError}
122
123
  * @throws {@link Vital.UnprocessableEntityError}
123
124
  */
124
125
  create(request, requestOptions) {
@@ -131,7 +132,7 @@ class User {
131
132
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
132
133
  "X-Fern-Language": "JavaScript",
133
134
  "X-Fern-SDK-Name": "@tryvital/vital-node",
134
- "X-Fern-SDK-Version": "3.1.1",
135
+ "X-Fern-SDK-Version": "3.1.3",
135
136
  },
136
137
  contentType: "application/json",
137
138
  body: yield serializers.UserCreateBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -148,6 +149,8 @@ class User {
148
149
  }
149
150
  if (_response.error.reason === "status-code") {
150
151
  switch (_response.error.statusCode) {
152
+ case 400:
153
+ throw new Vital.BadRequestError(_response.error.body);
151
154
  case 422:
152
155
  throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
153
156
  unrecognizedObjectKeys: "passthrough",
@@ -190,7 +193,7 @@ class User {
190
193
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
191
194
  "X-Fern-Language": "JavaScript",
192
195
  "X-Fern-SDK-Name": "@tryvital/vital-node",
193
- "X-Fern-SDK-Version": "3.1.1",
196
+ "X-Fern-SDK-Version": "3.1.3",
194
197
  },
195
198
  contentType: "application/json",
196
199
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -238,7 +241,7 @@ class User {
238
241
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
239
242
  "X-Fern-Language": "JavaScript",
240
243
  "X-Fern-SDK-Name": "@tryvital/vital-node",
241
- "X-Fern-SDK-Version": "3.1.1",
244
+ "X-Fern-SDK-Version": "3.1.3",
242
245
  },
243
246
  contentType: "application/json",
244
247
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -300,7 +303,7 @@ class User {
300
303
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
301
304
  "X-Fern-Language": "JavaScript",
302
305
  "X-Fern-SDK-Name": "@tryvital/vital-node",
303
- "X-Fern-SDK-Version": "3.1.1",
306
+ "X-Fern-SDK-Version": "3.1.3",
304
307
  },
305
308
  contentType: "application/json",
306
309
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -359,7 +362,7 @@ class User {
359
362
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
360
363
  "X-Fern-Language": "JavaScript",
361
364
  "X-Fern-SDK-Name": "@tryvital/vital-node",
362
- "X-Fern-SDK-Version": "3.1.1",
365
+ "X-Fern-SDK-Version": "3.1.3",
363
366
  },
364
367
  contentType: "application/json",
365
368
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -417,7 +420,7 @@ class User {
417
420
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
418
421
  "X-Fern-Language": "JavaScript",
419
422
  "X-Fern-SDK-Name": "@tryvital/vital-node",
420
- "X-Fern-SDK-Version": "3.1.1",
423
+ "X-Fern-SDK-Version": "3.1.3",
421
424
  },
422
425
  contentType: "application/json",
423
426
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -478,7 +481,7 @@ class User {
478
481
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
479
482
  "X-Fern-Language": "JavaScript",
480
483
  "X-Fern-SDK-Name": "@tryvital/vital-node",
481
- "X-Fern-SDK-Version": "3.1.1",
484
+ "X-Fern-SDK-Version": "3.1.3",
482
485
  },
483
486
  contentType: "application/json",
484
487
  body: yield serializers.UserPatchBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -533,7 +536,7 @@ class User {
533
536
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
534
537
  "X-Fern-Language": "JavaScript",
535
538
  "X-Fern-SDK-Name": "@tryvital/vital-node",
536
- "X-Fern-SDK-Version": "3.1.1",
539
+ "X-Fern-SDK-Version": "3.1.3",
537
540
  },
538
541
  contentType: "application/json",
539
542
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -591,7 +594,7 @@ class User {
591
594
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
592
595
  "X-Fern-Language": "JavaScript",
593
596
  "X-Fern-SDK-Name": "@tryvital/vital-node",
594
- "X-Fern-SDK-Version": "3.1.1",
597
+ "X-Fern-SDK-Version": "3.1.3",
595
598
  },
596
599
  contentType: "application/json",
597
600
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -657,7 +660,7 @@ class User {
657
660
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
658
661
  "X-Fern-Language": "JavaScript",
659
662
  "X-Fern-SDK-Name": "@tryvital/vital-node",
660
- "X-Fern-SDK-Version": "3.1.1",
663
+ "X-Fern-SDK-Version": "3.1.3",
661
664
  },
662
665
  contentType: "application/json",
663
666
  queryParameters: _queryParams,
@@ -723,7 +726,7 @@ class User {
723
726
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
724
727
  "X-Fern-Language": "JavaScript",
725
728
  "X-Fern-SDK-Name": "@tryvital/vital-node",
726
- "X-Fern-SDK-Version": "3.1.1",
729
+ "X-Fern-SDK-Version": "3.1.3",
727
730
  },
728
731
  contentType: "application/json",
729
732
  queryParameters: _queryParams,
@@ -741,12 +744,7 @@ class User {
741
744
  if (_response.error.reason === "status-code") {
742
745
  switch (_response.error.statusCode) {
743
746
  case 400:
744
- throw new Vital.BadRequestError(yield serializers.UserRefreshErrorResponse.parseOrThrow(_response.error.body, {
745
- unrecognizedObjectKeys: "passthrough",
746
- allowUnrecognizedUnionMembers: true,
747
- allowUnrecognizedEnumValues: true,
748
- breadcrumbsPrefix: ["response"],
749
- }));
747
+ throw new Vital.BadRequestError(_response.error.body);
750
748
  case 422:
751
749
  throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
752
750
  unrecognizedObjectKeys: "passthrough",
@@ -12,4 +12,8 @@ export interface UserCreateBody {
12
12
  fallbackTimeZone?: string;
13
13
  /** Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. */
14
14
  fallbackBirthDate?: string;
15
+ /** Starting bound for user data ingestion. Data older than this date will not be ingested. */
16
+ ingestionStart?: string;
17
+ /** Ending bound for user data ingestion. Data newer than this date will not be ingested and the connection deregistered. */
18
+ ingestionEnd?: string;
15
19
  }
@@ -14,4 +14,8 @@ export interface UserPatchBody {
14
14
  fallbackTimeZone?: string;
15
15
  /** Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. */
16
16
  fallbackBirthDate?: string;
17
+ /** Starting bound for user data ingestion. Data older than this date will not be ingested. */
18
+ ingestionStart?: string;
19
+ /** Ending bound for user data ingestion. Data newer than this date will not be ingested and the connection deregistered. */
20
+ ingestionEnd?: string;
17
21
  }