@tryvital/vital-node 3.1.378 → 3.1.380
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.
- package/Client.d.ts +15 -15
- package/Client.js +49 -49
- package/api/resources/activity/client/Client.js +2 -2
- package/api/resources/aggregate/client/Client.js +3 -3
- package/api/resources/body/client/Client.js +2 -2
- package/api/resources/devices/client/Client.js +1 -1
- package/api/resources/electrocardiogram/client/Client.js +1 -1
- package/api/resources/index.d.ts +9 -9
- package/api/resources/index.js +10 -10
- package/api/resources/insurance/client/Client.js +3 -3
- package/api/resources/introspect/client/Client.js +2 -2
- package/api/resources/labTests/client/Client.d.ts +17 -17
- package/api/resources/labTests/client/Client.js +200 -200
- package/api/resources/labTests/client/requests/index.d.ts +1 -1
- package/api/resources/labTests/types/index.d.ts +2 -2
- package/api/resources/labTests/types/index.js +2 -2
- package/api/resources/link/client/Client.js +19 -19
- package/api/resources/meal/client/Client.js +1 -1
- package/api/resources/menstrualCycle/client/Client.js +1 -1
- package/api/resources/order/client/Client.js +1 -1
- package/api/resources/payor/client/Client.js +1 -1
- package/api/resources/profile/client/Client.js +2 -2
- package/api/resources/providers/client/Client.js +1 -1
- package/api/resources/sleep/client/Client.js +3 -3
- package/api/resources/sleepCycle/client/Client.js +1 -1
- package/api/resources/team/client/Client.js +7 -7
- package/api/resources/testkit/client/Client.js +2 -2
- package/api/resources/user/client/Client.js +18 -18
- package/api/resources/vitals/client/Client.js +78 -78
- package/api/resources/workouts/client/Client.js +3 -3
- package/dist/Client.d.ts +15 -15
- package/dist/Client.js +49 -49
- package/dist/api/resources/activity/client/Client.js +2 -2
- package/dist/api/resources/aggregate/client/Client.js +3 -3
- package/dist/api/resources/body/client/Client.js +2 -2
- package/dist/api/resources/devices/client/Client.js +1 -1
- package/dist/api/resources/electrocardiogram/client/Client.js +1 -1
- package/dist/api/resources/index.d.ts +9 -9
- package/dist/api/resources/index.js +10 -10
- package/dist/api/resources/insurance/client/Client.js +3 -3
- package/dist/api/resources/introspect/client/Client.js +2 -2
- package/dist/api/resources/labTests/client/Client.d.ts +17 -17
- package/dist/api/resources/labTests/client/Client.js +200 -200
- package/dist/api/resources/labTests/client/requests/index.d.ts +1 -1
- package/dist/api/resources/labTests/types/index.d.ts +2 -2
- package/dist/api/resources/labTests/types/index.js +2 -2
- package/dist/api/resources/link/client/Client.js +19 -19
- package/dist/api/resources/meal/client/Client.js +1 -1
- package/dist/api/resources/menstrualCycle/client/Client.js +1 -1
- package/dist/api/resources/order/client/Client.js +1 -1
- package/dist/api/resources/payor/client/Client.js +1 -1
- package/dist/api/resources/profile/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.js +1 -1
- package/dist/api/resources/sleep/client/Client.js +3 -3
- package/dist/api/resources/sleepCycle/client/Client.js +1 -1
- package/dist/api/resources/team/client/Client.js +7 -7
- package/dist/api/resources/testkit/client/Client.js +2 -2
- package/dist/api/resources/user/client/Client.js +18 -18
- package/dist/api/resources/vitals/client/Client.js +78 -78
- package/dist/api/resources/workouts/client/Client.js +3 -3
- package/dist/serialization/resources/index.d.ts +3 -3
- package/dist/serialization/resources/index.js +4 -4
- package/dist/serialization/resources/labTests/types/index.d.ts +2 -2
- package/dist/serialization/resources/labTests/types/index.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +2117 -2117
- package/serialization/resources/index.d.ts +3 -3
- package/serialization/resources/index.js +4 -4
- package/serialization/resources/labTests/types/index.d.ts +2 -2
- package/serialization/resources/labTests/types/index.js +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -105,7 +105,7 @@ class LabTests {
|
|
|
105
105
|
const _response = yield core.fetcher({
|
|
106
106
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests"),
|
|
107
107
|
method: "GET",
|
|
108
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
108
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
109
109
|
contentType: "application/json",
|
|
110
110
|
queryParameters: _queryParams,
|
|
111
111
|
requestType: "json",
|
|
@@ -171,7 +171,7 @@ class LabTests {
|
|
|
171
171
|
const _response = yield core.fetcher({
|
|
172
172
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests"),
|
|
173
173
|
method: "POST",
|
|
174
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
174
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
175
175
|
contentType: "application/json",
|
|
176
176
|
requestType: "json",
|
|
177
177
|
body: serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -235,7 +235,7 @@ class LabTests {
|
|
|
235
235
|
const _response = yield core.fetcher({
|
|
236
236
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labTestId)}`),
|
|
237
237
|
method: "GET",
|
|
238
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
238
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
239
239
|
contentType: "application/json",
|
|
240
240
|
requestType: "json",
|
|
241
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -297,7 +297,7 @@ class LabTests {
|
|
|
297
297
|
const _response = yield core.fetcher({
|
|
298
298
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labTestId)}`),
|
|
299
299
|
method: "PATCH",
|
|
300
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
300
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
301
301
|
contentType: "application/json",
|
|
302
302
|
requestType: "json",
|
|
303
303
|
body: serializers.UpdateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -383,7 +383,7 @@ class LabTests {
|
|
|
383
383
|
const _response = yield core.fetcher({
|
|
384
384
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/markers"),
|
|
385
385
|
method: "GET",
|
|
386
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
386
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
387
387
|
contentType: "application/json",
|
|
388
388
|
queryParameters: _queryParams,
|
|
389
389
|
requestType: "json",
|
|
@@ -455,7 +455,7 @@ class LabTests {
|
|
|
455
455
|
const _response = yield core.fetcher({
|
|
456
456
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/list_order_set_markers"),
|
|
457
457
|
method: "POST",
|
|
458
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
458
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
459
459
|
contentType: "application/json",
|
|
460
460
|
queryParameters: _queryParams,
|
|
461
461
|
requestType: "json",
|
|
@@ -527,7 +527,7 @@ class LabTests {
|
|
|
527
527
|
const _response = yield core.fetcher({
|
|
528
528
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labTestId)}/markers`),
|
|
529
529
|
method: "GET",
|
|
530
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
530
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
531
531
|
contentType: "application/json",
|
|
532
532
|
queryParameters: _queryParams,
|
|
533
533
|
requestType: "json",
|
|
@@ -592,7 +592,7 @@ class LabTests {
|
|
|
592
592
|
const _response = yield core.fetcher({
|
|
593
593
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labId)}/markers/${encodeURIComponent(providerId)}`),
|
|
594
594
|
method: "GET",
|
|
595
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
595
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
596
596
|
contentType: "application/json",
|
|
597
597
|
requestType: "json",
|
|
598
598
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -652,7 +652,7 @@ class LabTests {
|
|
|
652
652
|
const _response = yield core.fetcher({
|
|
653
653
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/labs"),
|
|
654
654
|
method: "GET",
|
|
655
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
655
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
656
656
|
contentType: "application/json",
|
|
657
657
|
requestType: "json",
|
|
658
658
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -688,167 +688,6 @@ class LabTests {
|
|
|
688
688
|
}
|
|
689
689
|
});
|
|
690
690
|
}
|
|
691
|
-
/**
|
|
692
|
-
* GET lab tests the team has access to as a paginated list.
|
|
693
|
-
*
|
|
694
|
-
* @param {Vital.LabTestsGetPaginatedRequest} request
|
|
695
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
696
|
-
*
|
|
697
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
698
|
-
*
|
|
699
|
-
* @example
|
|
700
|
-
* await client.labTests.getPaginated()
|
|
701
|
-
*/
|
|
702
|
-
getPaginated(request = {}, requestOptions) {
|
|
703
|
-
var _a;
|
|
704
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
705
|
-
const { labTestLimit, nextCursor, generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
706
|
-
const _queryParams = {};
|
|
707
|
-
if (labTestLimit != null) {
|
|
708
|
-
_queryParams["lab_test_limit"] = labTestLimit.toString();
|
|
709
|
-
}
|
|
710
|
-
if (nextCursor != null) {
|
|
711
|
-
_queryParams["next_cursor"] = nextCursor;
|
|
712
|
-
}
|
|
713
|
-
if (generationMethod != null) {
|
|
714
|
-
_queryParams["generation_method"] = generationMethod;
|
|
715
|
-
}
|
|
716
|
-
if (labSlug != null) {
|
|
717
|
-
_queryParams["lab_slug"] = labSlug;
|
|
718
|
-
}
|
|
719
|
-
if (collectionMethod != null) {
|
|
720
|
-
_queryParams["collection_method"] = collectionMethod;
|
|
721
|
-
}
|
|
722
|
-
if (status != null) {
|
|
723
|
-
_queryParams["status"] = status;
|
|
724
|
-
}
|
|
725
|
-
if (markerIds != null) {
|
|
726
|
-
if (Array.isArray(markerIds)) {
|
|
727
|
-
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
728
|
-
}
|
|
729
|
-
else {
|
|
730
|
-
_queryParams["marker_ids"] = markerIds.toString();
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
if (providerIds != null) {
|
|
734
|
-
if (Array.isArray(providerIds)) {
|
|
735
|
-
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
736
|
-
}
|
|
737
|
-
else {
|
|
738
|
-
_queryParams["provider_ids"] = providerIds;
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
if (name != null) {
|
|
742
|
-
_queryParams["name"] = name;
|
|
743
|
-
}
|
|
744
|
-
if (orderKey != null) {
|
|
745
|
-
_queryParams["order_key"] = orderKey;
|
|
746
|
-
}
|
|
747
|
-
if (orderDirection != null) {
|
|
748
|
-
_queryParams["order_direction"] = orderDirection;
|
|
749
|
-
}
|
|
750
|
-
const _response = yield core.fetcher({
|
|
751
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_test"),
|
|
752
|
-
method: "GET",
|
|
753
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.378", "User-Agent": "@tryvital/vital-node/3.1.378", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
754
|
-
contentType: "application/json",
|
|
755
|
-
queryParameters: _queryParams,
|
|
756
|
-
requestType: "json",
|
|
757
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
758
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
759
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
760
|
-
});
|
|
761
|
-
if (_response.ok) {
|
|
762
|
-
return serializers.LabTestResourcesResponse.parseOrThrow(_response.body, {
|
|
763
|
-
unrecognizedObjectKeys: "passthrough",
|
|
764
|
-
allowUnrecognizedUnionMembers: true,
|
|
765
|
-
allowUnrecognizedEnumValues: true,
|
|
766
|
-
breadcrumbsPrefix: ["response"],
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
if (_response.error.reason === "status-code") {
|
|
770
|
-
switch (_response.error.statusCode) {
|
|
771
|
-
case 422:
|
|
772
|
-
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
773
|
-
unrecognizedObjectKeys: "passthrough",
|
|
774
|
-
allowUnrecognizedUnionMembers: true,
|
|
775
|
-
allowUnrecognizedEnumValues: true,
|
|
776
|
-
breadcrumbsPrefix: ["response"],
|
|
777
|
-
}));
|
|
778
|
-
default:
|
|
779
|
-
throw new errors.VitalError({
|
|
780
|
-
statusCode: _response.error.statusCode,
|
|
781
|
-
body: _response.error.body,
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
switch (_response.error.reason) {
|
|
786
|
-
case "non-json":
|
|
787
|
-
throw new errors.VitalError({
|
|
788
|
-
statusCode: _response.error.statusCode,
|
|
789
|
-
body: _response.error.rawBody,
|
|
790
|
-
});
|
|
791
|
-
case "timeout":
|
|
792
|
-
throw new errors.VitalTimeoutError();
|
|
793
|
-
case "unknown":
|
|
794
|
-
throw new errors.VitalError({
|
|
795
|
-
message: _response.error.errorMessage,
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
/**
|
|
801
|
-
* GET collection instructions for a lab test
|
|
802
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
803
|
-
*/
|
|
804
|
-
getLabTestCollectionInstructionPdf(labTestId, requestOptions) {
|
|
805
|
-
var _a;
|
|
806
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
807
|
-
const _response = yield core.fetcher({
|
|
808
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_test/${encodeURIComponent(labTestId)}/collection_instruction_pdf`),
|
|
809
|
-
method: "GET",
|
|
810
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.378", "User-Agent": "@tryvital/vital-node/3.1.378", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
811
|
-
contentType: "application/json",
|
|
812
|
-
requestType: "json",
|
|
813
|
-
responseType: "streaming",
|
|
814
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
815
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
816
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
817
|
-
});
|
|
818
|
-
if (_response.ok) {
|
|
819
|
-
return _response.body;
|
|
820
|
-
}
|
|
821
|
-
if (_response.error.reason === "status-code") {
|
|
822
|
-
switch (_response.error.statusCode) {
|
|
823
|
-
case 422:
|
|
824
|
-
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
825
|
-
unrecognizedObjectKeys: "passthrough",
|
|
826
|
-
allowUnrecognizedUnionMembers: true,
|
|
827
|
-
allowUnrecognizedEnumValues: true,
|
|
828
|
-
breadcrumbsPrefix: ["response"],
|
|
829
|
-
}));
|
|
830
|
-
default:
|
|
831
|
-
throw new errors.VitalError({
|
|
832
|
-
statusCode: _response.error.statusCode,
|
|
833
|
-
body: _response.error.body,
|
|
834
|
-
});
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
switch (_response.error.reason) {
|
|
838
|
-
case "non-json":
|
|
839
|
-
throw new errors.VitalError({
|
|
840
|
-
statusCode: _response.error.statusCode,
|
|
841
|
-
body: _response.error.rawBody,
|
|
842
|
-
});
|
|
843
|
-
case "timeout":
|
|
844
|
-
throw new errors.VitalTimeoutError();
|
|
845
|
-
case "unknown":
|
|
846
|
-
throw new errors.VitalError({
|
|
847
|
-
message: _response.error.errorMessage,
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
691
|
/**
|
|
853
692
|
* Return the available time slots to book an appointment with a phlebotomist
|
|
854
693
|
* for the given address and order.
|
|
@@ -879,7 +718,7 @@ class LabTests {
|
|
|
879
718
|
const _response = yield core.fetcher({
|
|
880
719
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/phlebotomy/appointment/availability"),
|
|
881
720
|
method: "POST",
|
|
882
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
721
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
883
722
|
contentType: "application/json",
|
|
884
723
|
queryParameters: _queryParams,
|
|
885
724
|
requestType: "json",
|
|
@@ -947,7 +786,7 @@ class LabTests {
|
|
|
947
786
|
const _response = yield core.fetcher({
|
|
948
787
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/book`),
|
|
949
788
|
method: "POST",
|
|
950
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
789
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
951
790
|
contentType: "application/json",
|
|
952
791
|
requestType: "json",
|
|
953
792
|
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1020,7 +859,7 @@ class LabTests {
|
|
|
1020
859
|
const _response = yield core.fetcher({
|
|
1021
860
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/request`),
|
|
1022
861
|
method: "POST",
|
|
1023
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
862
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1024
863
|
contentType: "application/json",
|
|
1025
864
|
requestType: "json",
|
|
1026
865
|
body: serializers.RequestAppointmentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1087,7 +926,7 @@ class LabTests {
|
|
|
1087
926
|
const _response = yield core.fetcher({
|
|
1088
927
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/reschedule`),
|
|
1089
928
|
method: "PATCH",
|
|
1090
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
929
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1091
930
|
contentType: "application/json",
|
|
1092
931
|
requestType: "json",
|
|
1093
932
|
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1154,7 +993,7 @@ class LabTests {
|
|
|
1154
993
|
const _response = yield core.fetcher({
|
|
1155
994
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/cancel`),
|
|
1156
995
|
method: "PATCH",
|
|
1157
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
996
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1158
997
|
contentType: "application/json",
|
|
1159
998
|
requestType: "json",
|
|
1160
999
|
body: serializers.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1215,7 +1054,7 @@ class LabTests {
|
|
|
1215
1054
|
const _response = yield core.fetcher({
|
|
1216
1055
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/phlebotomy/appointment/cancellation-reasons"),
|
|
1217
1056
|
method: "GET",
|
|
1218
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1057
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1219
1058
|
contentType: "application/json",
|
|
1220
1059
|
requestType: "json",
|
|
1221
1060
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1268,7 +1107,7 @@ class LabTests {
|
|
|
1268
1107
|
const _response = yield core.fetcher({
|
|
1269
1108
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment`),
|
|
1270
1109
|
method: "GET",
|
|
1271
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1110
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1272
1111
|
contentType: "application/json",
|
|
1273
1112
|
requestType: "json",
|
|
1274
1113
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1354,7 +1193,7 @@ class LabTests {
|
|
|
1354
1193
|
const _response = yield core.fetcher({
|
|
1355
1194
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/area/info"),
|
|
1356
1195
|
method: "GET",
|
|
1357
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1196
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1358
1197
|
contentType: "application/json",
|
|
1359
1198
|
queryParameters: _queryParams,
|
|
1360
1199
|
requestType: "json",
|
|
@@ -1434,7 +1273,7 @@ class LabTests {
|
|
|
1434
1273
|
const _response = yield core.fetcher({
|
|
1435
1274
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/psc/info"),
|
|
1436
1275
|
method: "GET",
|
|
1437
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1276
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1438
1277
|
contentType: "application/json",
|
|
1439
1278
|
queryParameters: _queryParams,
|
|
1440
1279
|
requestType: "json",
|
|
@@ -1510,7 +1349,7 @@ class LabTests {
|
|
|
1510
1349
|
const _response = yield core.fetcher({
|
|
1511
1350
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/info`),
|
|
1512
1351
|
method: "GET",
|
|
1513
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1352
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1514
1353
|
contentType: "application/json",
|
|
1515
1354
|
queryParameters: _queryParams,
|
|
1516
1355
|
requestType: "json",
|
|
@@ -1567,7 +1406,7 @@ class LabTests {
|
|
|
1567
1406
|
const _response = yield core.fetcher({
|
|
1568
1407
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/result/pdf`),
|
|
1569
1408
|
method: "GET",
|
|
1570
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1409
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1571
1410
|
contentType: "application/json",
|
|
1572
1411
|
requestType: "json",
|
|
1573
1412
|
responseType: "streaming",
|
|
@@ -1627,7 +1466,7 @@ class LabTests {
|
|
|
1627
1466
|
const _response = yield core.fetcher({
|
|
1628
1467
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/result/metadata`),
|
|
1629
1468
|
method: "GET",
|
|
1630
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1469
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1631
1470
|
contentType: "application/json",
|
|
1632
1471
|
requestType: "json",
|
|
1633
1472
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1690,7 +1529,7 @@ class LabTests {
|
|
|
1690
1529
|
const _response = yield core.fetcher({
|
|
1691
1530
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/result`),
|
|
1692
1531
|
method: "GET",
|
|
1693
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1532
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1694
1533
|
contentType: "application/json",
|
|
1695
1534
|
requestType: "json",
|
|
1696
1535
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1752,7 +1591,7 @@ class LabTests {
|
|
|
1752
1591
|
const _response = yield core.fetcher({
|
|
1753
1592
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/labels/pdf`),
|
|
1754
1593
|
method: "GET",
|
|
1755
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1594
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1756
1595
|
contentType: "application/json",
|
|
1757
1596
|
queryParameters: _queryParams,
|
|
1758
1597
|
requestType: "json",
|
|
@@ -1832,7 +1671,7 @@ class LabTests {
|
|
|
1832
1671
|
const _response = yield core.fetcher({
|
|
1833
1672
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/psc/appointment/availability"),
|
|
1834
1673
|
method: "POST",
|
|
1835
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1674
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1836
1675
|
contentType: "application/json",
|
|
1837
1676
|
queryParameters: _queryParams,
|
|
1838
1677
|
requestType: "json",
|
|
@@ -1897,7 +1736,7 @@ class LabTests {
|
|
|
1897
1736
|
const _response = yield core.fetcher({
|
|
1898
1737
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment/book`),
|
|
1899
1738
|
method: "POST",
|
|
1900
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1739
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1901
1740
|
contentType: "application/json",
|
|
1902
1741
|
requestType: "json",
|
|
1903
1742
|
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1962,7 +1801,7 @@ class LabTests {
|
|
|
1962
1801
|
const _response = yield core.fetcher({
|
|
1963
1802
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment/reschedule`),
|
|
1964
1803
|
method: "PATCH",
|
|
1965
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1804
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1966
1805
|
contentType: "application/json",
|
|
1967
1806
|
requestType: "json",
|
|
1968
1807
|
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2027,7 +1866,7 @@ class LabTests {
|
|
|
2027
1866
|
const _response = yield core.fetcher({
|
|
2028
1867
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment/cancel`),
|
|
2029
1868
|
method: "PATCH",
|
|
2030
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1869
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2031
1870
|
contentType: "application/json",
|
|
2032
1871
|
requestType: "json",
|
|
2033
1872
|
body: serializers.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest.jsonOrThrow(request, {
|
|
@@ -2088,7 +1927,7 @@ class LabTests {
|
|
|
2088
1927
|
const _response = yield core.fetcher({
|
|
2089
1928
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/psc/appointment/cancellation-reasons"),
|
|
2090
1929
|
method: "GET",
|
|
2091
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1930
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2092
1931
|
contentType: "application/json",
|
|
2093
1932
|
requestType: "json",
|
|
2094
1933
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2141,7 +1980,7 @@ class LabTests {
|
|
|
2141
1980
|
const _response = yield core.fetcher({
|
|
2142
1981
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment`),
|
|
2143
1982
|
method: "GET",
|
|
2144
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1983
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2145
1984
|
contentType: "application/json",
|
|
2146
1985
|
requestType: "json",
|
|
2147
1986
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2197,7 +2036,7 @@ class LabTests {
|
|
|
2197
2036
|
const _response = yield core.fetcher({
|
|
2198
2037
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/collection_instruction_pdf`),
|
|
2199
2038
|
method: "GET",
|
|
2200
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2039
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2201
2040
|
contentType: "application/json",
|
|
2202
2041
|
requestType: "json",
|
|
2203
2042
|
responseType: "streaming",
|
|
@@ -2249,7 +2088,7 @@ class LabTests {
|
|
|
2249
2088
|
const _response = yield core.fetcher({
|
|
2250
2089
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/requisition/pdf`),
|
|
2251
2090
|
method: "GET",
|
|
2252
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2091
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2253
2092
|
contentType: "application/json",
|
|
2254
2093
|
requestType: "json",
|
|
2255
2094
|
responseType: "streaming",
|
|
@@ -2301,7 +2140,7 @@ class LabTests {
|
|
|
2301
2140
|
const _response = yield core.fetcher({
|
|
2302
2141
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/abn_pdf`),
|
|
2303
2142
|
method: "GET",
|
|
2304
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2143
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2305
2144
|
contentType: "application/json",
|
|
2306
2145
|
requestType: "json",
|
|
2307
2146
|
responseType: "streaming",
|
|
@@ -2360,7 +2199,7 @@ class LabTests {
|
|
|
2360
2199
|
const _response = yield core.fetcher({
|
|
2361
2200
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}`),
|
|
2362
2201
|
method: "GET",
|
|
2363
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2202
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2364
2203
|
contentType: "application/json",
|
|
2365
2204
|
requestType: "json",
|
|
2366
2205
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2438,7 +2277,7 @@ class LabTests {
|
|
|
2438
2277
|
const _response = yield core.fetcher({
|
|
2439
2278
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order"),
|
|
2440
2279
|
method: "POST",
|
|
2441
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2280
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2442
2281
|
contentType: "application/json",
|
|
2443
2282
|
requestType: "json",
|
|
2444
2283
|
body: serializers.CreateOrderRequestCompatible.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2522,7 +2361,7 @@ class LabTests {
|
|
|
2522
2361
|
const _response = yield core.fetcher({
|
|
2523
2362
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/import"),
|
|
2524
2363
|
method: "POST",
|
|
2525
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2364
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2526
2365
|
contentType: "application/json",
|
|
2527
2366
|
requestType: "json",
|
|
2528
2367
|
body: serializers.ImportOrderBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2586,7 +2425,7 @@ class LabTests {
|
|
|
2586
2425
|
const _response = yield core.fetcher({
|
|
2587
2426
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/cancel`),
|
|
2588
2427
|
method: "POST",
|
|
2589
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2428
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2590
2429
|
contentType: "application/json",
|
|
2591
2430
|
requestType: "json",
|
|
2592
2431
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2660,7 +2499,7 @@ class LabTests {
|
|
|
2660
2499
|
const _response = yield core.fetcher({
|
|
2661
2500
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/test`),
|
|
2662
2501
|
method: "POST",
|
|
2663
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2502
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2664
2503
|
contentType: "application/json",
|
|
2665
2504
|
queryParameters: _queryParams,
|
|
2666
2505
|
requestType: "json",
|
|
@@ -2724,7 +2563,7 @@ class LabTests {
|
|
|
2724
2563
|
const _response = yield core.fetcher({
|
|
2725
2564
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/draw_completed`),
|
|
2726
2565
|
method: "PATCH",
|
|
2727
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2566
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2728
2567
|
contentType: "application/json",
|
|
2729
2568
|
requestType: "json",
|
|
2730
2569
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2863,7 +2702,7 @@ class LabTests {
|
|
|
2863
2702
|
const _response = yield core.fetcher({
|
|
2864
2703
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/orders"),
|
|
2865
2704
|
method: "GET",
|
|
2866
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2705
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2867
2706
|
contentType: "application/json",
|
|
2868
2707
|
queryParameters: _queryParams,
|
|
2869
2708
|
requestType: "json",
|
|
@@ -2910,6 +2749,167 @@ class LabTests {
|
|
|
2910
2749
|
}
|
|
2911
2750
|
});
|
|
2912
2751
|
}
|
|
2752
|
+
/**
|
|
2753
|
+
* GET lab tests the team has access to as a paginated list.
|
|
2754
|
+
*
|
|
2755
|
+
* @param {Vital.LabTestsGetPaginatedRequest} request
|
|
2756
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2757
|
+
*
|
|
2758
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
2759
|
+
*
|
|
2760
|
+
* @example
|
|
2761
|
+
* await client.labTests.getPaginated()
|
|
2762
|
+
*/
|
|
2763
|
+
getPaginated(request = {}, requestOptions) {
|
|
2764
|
+
var _a;
|
|
2765
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2766
|
+
const { labTestLimit, nextCursor, generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
2767
|
+
const _queryParams = {};
|
|
2768
|
+
if (labTestLimit != null) {
|
|
2769
|
+
_queryParams["lab_test_limit"] = labTestLimit.toString();
|
|
2770
|
+
}
|
|
2771
|
+
if (nextCursor != null) {
|
|
2772
|
+
_queryParams["next_cursor"] = nextCursor;
|
|
2773
|
+
}
|
|
2774
|
+
if (generationMethod != null) {
|
|
2775
|
+
_queryParams["generation_method"] = generationMethod;
|
|
2776
|
+
}
|
|
2777
|
+
if (labSlug != null) {
|
|
2778
|
+
_queryParams["lab_slug"] = labSlug;
|
|
2779
|
+
}
|
|
2780
|
+
if (collectionMethod != null) {
|
|
2781
|
+
_queryParams["collection_method"] = collectionMethod;
|
|
2782
|
+
}
|
|
2783
|
+
if (status != null) {
|
|
2784
|
+
_queryParams["status"] = status;
|
|
2785
|
+
}
|
|
2786
|
+
if (markerIds != null) {
|
|
2787
|
+
if (Array.isArray(markerIds)) {
|
|
2788
|
+
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
2789
|
+
}
|
|
2790
|
+
else {
|
|
2791
|
+
_queryParams["marker_ids"] = markerIds.toString();
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
if (providerIds != null) {
|
|
2795
|
+
if (Array.isArray(providerIds)) {
|
|
2796
|
+
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
2797
|
+
}
|
|
2798
|
+
else {
|
|
2799
|
+
_queryParams["provider_ids"] = providerIds;
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
if (name != null) {
|
|
2803
|
+
_queryParams["name"] = name;
|
|
2804
|
+
}
|
|
2805
|
+
if (orderKey != null) {
|
|
2806
|
+
_queryParams["order_key"] = orderKey;
|
|
2807
|
+
}
|
|
2808
|
+
if (orderDirection != null) {
|
|
2809
|
+
_queryParams["order_direction"] = orderDirection;
|
|
2810
|
+
}
|
|
2811
|
+
const _response = yield core.fetcher({
|
|
2812
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_test"),
|
|
2813
|
+
method: "GET",
|
|
2814
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2815
|
+
contentType: "application/json",
|
|
2816
|
+
queryParameters: _queryParams,
|
|
2817
|
+
requestType: "json",
|
|
2818
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2819
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2820
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2821
|
+
});
|
|
2822
|
+
if (_response.ok) {
|
|
2823
|
+
return serializers.LabTestResourcesResponse.parseOrThrow(_response.body, {
|
|
2824
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2825
|
+
allowUnrecognizedUnionMembers: true,
|
|
2826
|
+
allowUnrecognizedEnumValues: true,
|
|
2827
|
+
breadcrumbsPrefix: ["response"],
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
if (_response.error.reason === "status-code") {
|
|
2831
|
+
switch (_response.error.statusCode) {
|
|
2832
|
+
case 422:
|
|
2833
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
2834
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2835
|
+
allowUnrecognizedUnionMembers: true,
|
|
2836
|
+
allowUnrecognizedEnumValues: true,
|
|
2837
|
+
breadcrumbsPrefix: ["response"],
|
|
2838
|
+
}));
|
|
2839
|
+
default:
|
|
2840
|
+
throw new errors.VitalError({
|
|
2841
|
+
statusCode: _response.error.statusCode,
|
|
2842
|
+
body: _response.error.body,
|
|
2843
|
+
});
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
switch (_response.error.reason) {
|
|
2847
|
+
case "non-json":
|
|
2848
|
+
throw new errors.VitalError({
|
|
2849
|
+
statusCode: _response.error.statusCode,
|
|
2850
|
+
body: _response.error.rawBody,
|
|
2851
|
+
});
|
|
2852
|
+
case "timeout":
|
|
2853
|
+
throw new errors.VitalTimeoutError();
|
|
2854
|
+
case "unknown":
|
|
2855
|
+
throw new errors.VitalError({
|
|
2856
|
+
message: _response.error.errorMessage,
|
|
2857
|
+
});
|
|
2858
|
+
}
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2861
|
+
/**
|
|
2862
|
+
* GET collection instructions for a lab test
|
|
2863
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
2864
|
+
*/
|
|
2865
|
+
getLabTestCollectionInstructionPdf(labTestId, requestOptions) {
|
|
2866
|
+
var _a;
|
|
2867
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2868
|
+
const _response = yield core.fetcher({
|
|
2869
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_test/${encodeURIComponent(labTestId)}/collection_instruction_pdf`),
|
|
2870
|
+
method: "GET",
|
|
2871
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.380", "User-Agent": "@tryvital/vital-node/3.1.380", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2872
|
+
contentType: "application/json",
|
|
2873
|
+
requestType: "json",
|
|
2874
|
+
responseType: "streaming",
|
|
2875
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2876
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2877
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2878
|
+
});
|
|
2879
|
+
if (_response.ok) {
|
|
2880
|
+
return _response.body;
|
|
2881
|
+
}
|
|
2882
|
+
if (_response.error.reason === "status-code") {
|
|
2883
|
+
switch (_response.error.statusCode) {
|
|
2884
|
+
case 422:
|
|
2885
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
2886
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2887
|
+
allowUnrecognizedUnionMembers: true,
|
|
2888
|
+
allowUnrecognizedEnumValues: true,
|
|
2889
|
+
breadcrumbsPrefix: ["response"],
|
|
2890
|
+
}));
|
|
2891
|
+
default:
|
|
2892
|
+
throw new errors.VitalError({
|
|
2893
|
+
statusCode: _response.error.statusCode,
|
|
2894
|
+
body: _response.error.body,
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
switch (_response.error.reason) {
|
|
2899
|
+
case "non-json":
|
|
2900
|
+
throw new errors.VitalError({
|
|
2901
|
+
statusCode: _response.error.statusCode,
|
|
2902
|
+
body: _response.error.rawBody,
|
|
2903
|
+
});
|
|
2904
|
+
case "timeout":
|
|
2905
|
+
throw new errors.VitalTimeoutError();
|
|
2906
|
+
case "unknown":
|
|
2907
|
+
throw new errors.VitalError({
|
|
2908
|
+
message: _response.error.errorMessage,
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
2913
|
_getCustomAuthorizationHeaders() {
|
|
2914
2914
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2915
2915
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|