@tryvital/vital-node 3.1.0 → 3.1.2

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 (53) hide show
  1. package/api/resources/activity/client/Client.js +2 -2
  2. package/api/resources/body/client/Client.js +2 -2
  3. package/api/resources/devices/client/Client.js +1 -1
  4. package/api/resources/insurance/client/Client.js +2 -2
  5. package/api/resources/introspect/client/Client.js +2 -2
  6. package/api/resources/labTests/client/Client.d.ts +1 -2
  7. package/api/resources/labTests/client/Client.js +29 -39
  8. package/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
  9. package/api/resources/link/client/Client.js +13 -13
  10. package/api/resources/meal/client/Client.js +1 -1
  11. package/api/resources/profile/client/Client.js +2 -2
  12. package/api/resources/providers/client/Client.js +1 -1
  13. package/api/resources/sleep/client/Client.js +4 -4
  14. package/api/resources/team/client/Client.js +7 -7
  15. package/api/resources/testkit/client/Client.js +2 -2
  16. package/api/resources/user/client/Client.d.ts +4 -0
  17. package/api/resources/user/client/Client.js +78 -11
  18. package/api/resources/user/client/requests/UserUndoDeleteRequest.d.ts +13 -0
  19. package/api/resources/user/client/requests/UserUndoDeleteRequest.js +5 -0
  20. package/api/resources/user/client/requests/index.d.ts +1 -0
  21. package/api/resources/vitals/client/Client.js +50 -50
  22. package/api/resources/workouts/client/Client.js +3 -3
  23. package/api/types/ClientFacingOrder.d.ts +1 -1
  24. package/api/types/ClientFacingResult.d.ts +1 -0
  25. package/dist/api/resources/activity/client/Client.js +2 -2
  26. package/dist/api/resources/body/client/Client.js +2 -2
  27. package/dist/api/resources/devices/client/Client.js +1 -1
  28. package/dist/api/resources/insurance/client/Client.js +2 -2
  29. package/dist/api/resources/introspect/client/Client.js +2 -2
  30. package/dist/api/resources/labTests/client/Client.d.ts +1 -2
  31. package/dist/api/resources/labTests/client/Client.js +29 -39
  32. package/dist/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
  33. package/dist/api/resources/link/client/Client.js +13 -13
  34. package/dist/api/resources/meal/client/Client.js +1 -1
  35. package/dist/api/resources/profile/client/Client.js +2 -2
  36. package/dist/api/resources/providers/client/Client.js +1 -1
  37. package/dist/api/resources/sleep/client/Client.js +4 -4
  38. package/dist/api/resources/team/client/Client.js +7 -7
  39. package/dist/api/resources/testkit/client/Client.js +2 -2
  40. package/dist/api/resources/user/client/Client.d.ts +4 -0
  41. package/dist/api/resources/user/client/Client.js +78 -11
  42. package/dist/api/resources/user/client/requests/UserUndoDeleteRequest.d.ts +13 -0
  43. package/dist/api/resources/user/client/requests/UserUndoDeleteRequest.js +5 -0
  44. package/dist/api/resources/user/client/requests/index.d.ts +1 -0
  45. package/dist/api/resources/vitals/client/Client.js +50 -50
  46. package/dist/api/resources/workouts/client/Client.js +3 -3
  47. package/dist/api/types/ClientFacingOrder.d.ts +1 -1
  48. package/dist/api/types/ClientFacingResult.d.ts +1 -0
  49. package/dist/serialization/types/ClientFacingResult.d.ts +1 -0
  50. package/dist/serialization/types/ClientFacingResult.js +1 -0
  51. package/package.json +1 -1
  52. package/serialization/types/ClientFacingResult.d.ts +1 -0
  53. package/serialization/types/ClientFacingResult.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.0",
70
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
130
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
197
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
253
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
310
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
378
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
440
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
65
+ "X-Fern-SDK-Version": "3.1.2",
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.0",
125
+ "X-Fern-SDK-Version": "3.1.2",
126
126
  },
127
127
  contentType: "application/json",
128
128
  body: yield serializers.CreateRegistrableTestkitOrderRequest.jsonOrThrow(request, {
@@ -68,6 +68,10 @@ export declare class User {
68
68
  * @throws {@link Vital.UnprocessableEntityError}
69
69
  */
70
70
  deregisterProvider(userId: string, provider: Vital.Providers, requestOptions?: User.RequestOptions): Promise<Vital.UserSuccessResponse>;
71
+ /**
72
+ * @throws {@link Vital.UnprocessableEntityError}
73
+ */
74
+ undoDelete(request?: Vital.UserUndoDeleteRequest, requestOptions?: User.RequestOptions): Promise<Vital.UserSuccessResponse>;
71
75
  /**
72
76
  * Trigger a manual refresh for a specific user
73
77
  * @throws {@link Vital.BadRequestError}
@@ -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.0",
74
+ "X-Fern-SDK-Version": "3.1.2",
75
75
  },
76
76
  contentType: "application/json",
77
77
  queryParameters: _queryParams,
@@ -131,7 +131,7 @@ class User {
131
131
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
132
132
  "X-Fern-Language": "JavaScript",
133
133
  "X-Fern-SDK-Name": "@tryvital/vital-node",
134
- "X-Fern-SDK-Version": "3.1.0",
134
+ "X-Fern-SDK-Version": "3.1.2",
135
135
  },
136
136
  contentType: "application/json",
137
137
  body: yield serializers.UserCreateBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -190,7 +190,7 @@ class User {
190
190
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
191
191
  "X-Fern-Language": "JavaScript",
192
192
  "X-Fern-SDK-Name": "@tryvital/vital-node",
193
- "X-Fern-SDK-Version": "3.1.0",
193
+ "X-Fern-SDK-Version": "3.1.2",
194
194
  },
195
195
  contentType: "application/json",
196
196
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -238,7 +238,7 @@ class User {
238
238
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
239
239
  "X-Fern-Language": "JavaScript",
240
240
  "X-Fern-SDK-Name": "@tryvital/vital-node",
241
- "X-Fern-SDK-Version": "3.1.0",
241
+ "X-Fern-SDK-Version": "3.1.2",
242
242
  },
243
243
  contentType: "application/json",
244
244
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -300,7 +300,7 @@ class User {
300
300
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
301
301
  "X-Fern-Language": "JavaScript",
302
302
  "X-Fern-SDK-Name": "@tryvital/vital-node",
303
- "X-Fern-SDK-Version": "3.1.0",
303
+ "X-Fern-SDK-Version": "3.1.2",
304
304
  },
305
305
  contentType: "application/json",
306
306
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -359,7 +359,7 @@ class User {
359
359
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
360
360
  "X-Fern-Language": "JavaScript",
361
361
  "X-Fern-SDK-Name": "@tryvital/vital-node",
362
- "X-Fern-SDK-Version": "3.1.0",
362
+ "X-Fern-SDK-Version": "3.1.2",
363
363
  },
364
364
  contentType: "application/json",
365
365
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -417,7 +417,7 @@ class User {
417
417
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
418
418
  "X-Fern-Language": "JavaScript",
419
419
  "X-Fern-SDK-Name": "@tryvital/vital-node",
420
- "X-Fern-SDK-Version": "3.1.0",
420
+ "X-Fern-SDK-Version": "3.1.2",
421
421
  },
422
422
  contentType: "application/json",
423
423
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -478,7 +478,7 @@ class User {
478
478
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
479
479
  "X-Fern-Language": "JavaScript",
480
480
  "X-Fern-SDK-Name": "@tryvital/vital-node",
481
- "X-Fern-SDK-Version": "3.1.0",
481
+ "X-Fern-SDK-Version": "3.1.2",
482
482
  },
483
483
  contentType: "application/json",
484
484
  body: yield serializers.UserPatchBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -533,7 +533,7 @@ class User {
533
533
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
534
534
  "X-Fern-Language": "JavaScript",
535
535
  "X-Fern-SDK-Name": "@tryvital/vital-node",
536
- "X-Fern-SDK-Version": "3.1.0",
536
+ "X-Fern-SDK-Version": "3.1.2",
537
537
  },
538
538
  contentType: "application/json",
539
539
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -591,7 +591,7 @@ class User {
591
591
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
592
592
  "X-Fern-Language": "JavaScript",
593
593
  "X-Fern-SDK-Name": "@tryvital/vital-node",
594
- "X-Fern-SDK-Version": "3.1.0",
594
+ "X-Fern-SDK-Version": "3.1.2",
595
595
  },
596
596
  contentType: "application/json",
597
597
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -636,6 +636,73 @@ class User {
636
636
  }
637
637
  });
638
638
  }
639
+ /**
640
+ * @throws {@link Vital.UnprocessableEntityError}
641
+ */
642
+ undoDelete(request = {}, requestOptions) {
643
+ var _a;
644
+ return __awaiter(this, void 0, void 0, function* () {
645
+ const { userId, clientUserId } = request;
646
+ const _queryParams = {};
647
+ if (userId != null) {
648
+ _queryParams["user_id"] = userId;
649
+ }
650
+ if (clientUserId != null) {
651
+ _queryParams["client_user_id"] = clientUserId;
652
+ }
653
+ const _response = yield core.fetcher({
654
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/user/undo_delete"),
655
+ method: "POST",
656
+ headers: {
657
+ "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
658
+ "X-Fern-Language": "JavaScript",
659
+ "X-Fern-SDK-Name": "@tryvital/vital-node",
660
+ "X-Fern-SDK-Version": "3.1.2",
661
+ },
662
+ contentType: "application/json",
663
+ queryParameters: _queryParams,
664
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
665
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
666
+ });
667
+ if (_response.ok) {
668
+ return yield serializers.UserSuccessResponse.parseOrThrow(_response.body, {
669
+ unrecognizedObjectKeys: "passthrough",
670
+ allowUnrecognizedUnionMembers: true,
671
+ allowUnrecognizedEnumValues: true,
672
+ breadcrumbsPrefix: ["response"],
673
+ });
674
+ }
675
+ if (_response.error.reason === "status-code") {
676
+ switch (_response.error.statusCode) {
677
+ case 422:
678
+ throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
679
+ unrecognizedObjectKeys: "passthrough",
680
+ allowUnrecognizedUnionMembers: true,
681
+ allowUnrecognizedEnumValues: true,
682
+ breadcrumbsPrefix: ["response"],
683
+ }));
684
+ default:
685
+ throw new errors.VitalError({
686
+ statusCode: _response.error.statusCode,
687
+ body: _response.error.body,
688
+ });
689
+ }
690
+ }
691
+ switch (_response.error.reason) {
692
+ case "non-json":
693
+ throw new errors.VitalError({
694
+ statusCode: _response.error.statusCode,
695
+ body: _response.error.rawBody,
696
+ });
697
+ case "timeout":
698
+ throw new errors.VitalTimeoutError();
699
+ case "unknown":
700
+ throw new errors.VitalError({
701
+ message: _response.error.errorMessage,
702
+ });
703
+ }
704
+ });
705
+ }
639
706
  /**
640
707
  * Trigger a manual refresh for a specific user
641
708
  * @throws {@link Vital.BadRequestError}
@@ -656,7 +723,7 @@ class User {
656
723
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
657
724
  "X-Fern-Language": "JavaScript",
658
725
  "X-Fern-SDK-Name": "@tryvital/vital-node",
659
- "X-Fern-SDK-Version": "3.1.0",
726
+ "X-Fern-SDK-Version": "3.1.2",
660
727
  },
661
728
  contentType: "application/json",
662
729
  queryParameters: _queryParams,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface UserUndoDeleteRequest {
5
+ /**
6
+ * User ID to undo deletion. Mutually exclusive with `client_user_id`.
7
+ */
8
+ userId?: string;
9
+ /**
10
+ * Client User ID to undo deletion. Mutually exclusive with `user_id`.
11
+ */
12
+ clientUserId?: string;
13
+ }
@@ -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 });
@@ -1,4 +1,5 @@
1
1
  export { UserGetAllRequest } from "./UserGetAllRequest";
2
2
  export { UserCreateBody } from "./UserCreateBody";
3
3
  export { UserPatchBody } from "./UserPatchBody";
4
+ export { UserUndoDeleteRequest } from "./UserUndoDeleteRequest";
4
5
  export { UserRefreshRequest } from "./UserRefreshRequest";