@tryvital/vital-node 3.1.53 → 3.1.54
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/api/resources/activity/client/Client.js +2 -2
- package/api/resources/body/client/Client.js +2 -2
- package/api/resources/devices/client/Client.js +1 -1
- package/api/resources/insurance/client/Client.js +2 -2
- package/api/resources/insurance/client/requests/PayorSearchRequest.d.ts +0 -1
- package/api/resources/introspect/client/Client.js +2 -2
- package/api/resources/labTests/client/Client.js +27 -27
- package/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +2 -0
- package/api/resources/labTests/client/requests/LabTestsGetAreaInfoRequest.d.ts +1 -1
- package/api/resources/link/client/Client.js +14 -14
- package/api/resources/meal/client/Client.js +1 -1
- package/api/resources/menstrualCycle/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 +4 -4
- package/api/resources/team/client/Client.js +7 -7
- package/api/resources/testkit/client/Client.js +2 -2
- package/api/resources/user/client/Client.d.ts +61 -0
- package/api/resources/user/client/Client.js +271 -12
- package/api/resources/user/client/requests/CreateInsuranceRequest.d.ts +35 -0
- package/api/resources/user/client/requests/UserInfoCreateRequest.d.ts +31 -0
- package/api/resources/user/client/requests/index.d.ts +2 -0
- package/api/resources/vitals/client/Client.js +52 -52
- package/api/resources/workouts/client/Client.js +3 -3
- package/api/types/Billing.d.ts +9 -0
- package/api/types/Billing.js +11 -0
- package/api/types/ClientFacingInsurance.d.ts +13 -0
- package/api/types/ClientFacingInsurance.js +5 -0
- package/api/types/ClientFacingLabs.d.ts +9 -0
- package/api/types/ClientFacingLabs.js +11 -0
- package/api/types/ClientFacingOrder.d.ts +2 -0
- package/api/types/ClientFacingPayorSearchResponse.d.ts +2 -0
- package/api/types/ClientFacingResource.d.ts +5 -1
- package/api/types/ClientFacingResource.js +4 -0
- package/api/types/CompanyDetails.d.ts +8 -0
- package/api/types/CompanyDetails.js +5 -0
- package/api/types/HealthInsuranceCreateRequest.d.ts +1 -1
- package/api/types/LinkTokenExchangeResponse.d.ts +3 -1
- package/api/types/PersonDetailsOutput.d.ts +13 -0
- package/api/types/PersonDetailsOutput.js +5 -0
- package/api/types/PscAreaInfo.d.ts +1 -0
- package/api/types/ResponsibleRelationship.d.ts +2 -2
- package/api/types/ResponsibleRelationship.js +1 -1
- package/api/types/TimeseriesResource.d.ts +5 -1
- package/api/types/TimeseriesResource.js +4 -0
- package/api/types/UserInfo.d.ts +13 -0
- package/api/types/UserInfo.js +5 -0
- package/api/types/{PersonDetails.d.ts → VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.d.ts} +1 -1
- package/api/types/VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.js +5 -0
- package/api/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.d.ts +13 -0
- package/api/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.js +5 -0
- package/api/types/index.d.ts +8 -1
- package/api/types/index.js +8 -1
- package/dist/api/resources/activity/client/Client.js +2 -2
- package/dist/api/resources/body/client/Client.js +2 -2
- package/dist/api/resources/devices/client/Client.js +1 -1
- package/dist/api/resources/insurance/client/Client.js +2 -2
- package/dist/api/resources/insurance/client/requests/PayorSearchRequest.d.ts +0 -1
- package/dist/api/resources/introspect/client/Client.js +2 -2
- package/dist/api/resources/labTests/client/Client.js +27 -27
- package/dist/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +2 -0
- package/dist/api/resources/labTests/client/requests/LabTestsGetAreaInfoRequest.d.ts +1 -1
- package/dist/api/resources/link/client/Client.js +14 -14
- package/dist/api/resources/meal/client/Client.js +1 -1
- package/dist/api/resources/menstrualCycle/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 +4 -4
- 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.d.ts +61 -0
- package/dist/api/resources/user/client/Client.js +271 -12
- package/dist/api/resources/user/client/requests/CreateInsuranceRequest.d.ts +35 -0
- package/dist/api/resources/user/client/requests/CreateInsuranceRequest.js +5 -0
- package/dist/api/resources/user/client/requests/UserInfoCreateRequest.d.ts +31 -0
- package/dist/api/resources/user/client/requests/UserInfoCreateRequest.js +5 -0
- package/dist/api/resources/user/client/requests/index.d.ts +2 -0
- package/dist/api/resources/vitals/client/Client.js +52 -52
- package/dist/api/resources/workouts/client/Client.js +3 -3
- package/dist/api/types/Billing.d.ts +9 -0
- package/dist/api/types/Billing.js +11 -0
- package/dist/api/types/ClientFacingInsurance.d.ts +13 -0
- package/dist/api/types/ClientFacingInsurance.js +5 -0
- package/dist/api/types/ClientFacingLabs.d.ts +9 -0
- package/dist/api/types/ClientFacingLabs.js +11 -0
- package/dist/api/types/ClientFacingOrder.d.ts +2 -0
- package/dist/api/types/ClientFacingPayorSearchResponse.d.ts +2 -0
- package/dist/api/types/ClientFacingResource.d.ts +5 -1
- package/dist/api/types/ClientFacingResource.js +4 -0
- package/dist/api/types/CompanyDetails.d.ts +8 -0
- package/dist/api/types/CompanyDetails.js +5 -0
- package/dist/api/types/HealthInsuranceCreateRequest.d.ts +1 -1
- package/dist/api/types/LinkTokenExchangeResponse.d.ts +3 -1
- package/dist/api/types/PersonDetailsOutput.d.ts +13 -0
- package/dist/api/types/PersonDetailsOutput.js +5 -0
- package/dist/api/types/PscAreaInfo.d.ts +1 -0
- package/dist/api/types/ResponsibleRelationship.d.ts +2 -2
- package/dist/api/types/ResponsibleRelationship.js +1 -1
- package/dist/api/types/TimeseriesResource.d.ts +5 -1
- package/dist/api/types/TimeseriesResource.js +4 -0
- package/dist/api/types/UserInfo.d.ts +13 -0
- package/dist/api/types/UserInfo.js +5 -0
- package/dist/api/types/{PersonDetails.d.ts → VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.d.ts} +1 -1
- package/dist/api/types/VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.js +5 -0
- package/dist/api/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.d.ts +13 -0
- package/dist/api/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.js +5 -0
- package/dist/api/types/index.d.ts +8 -1
- package/dist/api/types/index.js +8 -1
- package/dist/serialization/resources/insurance/client/requests/PayorSearchRequest.d.ts +0 -1
- package/dist/serialization/resources/insurance/client/requests/PayorSearchRequest.js +0 -1
- package/dist/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +3 -0
- package/dist/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.js +3 -0
- package/dist/serialization/resources/user/client/requests/CreateInsuranceRequest.d.ts +19 -0
- package/dist/serialization/resources/user/client/requests/CreateInsuranceRequest.js +40 -0
- package/dist/serialization/resources/user/client/requests/UserInfoCreateRequest.d.ts +19 -0
- package/dist/serialization/resources/user/client/requests/UserInfoCreateRequest.js +40 -0
- package/dist/serialization/resources/user/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/user/client/requests/index.js +5 -1
- package/dist/serialization/types/Billing.d.ts +10 -0
- package/dist/serialization/types/Billing.js +35 -0
- package/dist/serialization/types/ClientFacingInsurance.d.ts +21 -0
- package/dist/serialization/types/ClientFacingInsurance.js +42 -0
- package/dist/serialization/types/ClientFacingLabs.d.ts +10 -0
- package/dist/serialization/types/ClientFacingLabs.js +31 -0
- package/dist/serialization/types/ClientFacingOrder.d.ts +3 -0
- package/dist/serialization/types/ClientFacingOrder.js +3 -0
- package/dist/serialization/types/ClientFacingPayorSearchResponse.d.ts +1 -0
- package/dist/serialization/types/ClientFacingPayorSearchResponse.js +1 -0
- package/dist/serialization/types/ClientFacingResource.d.ts +1 -1
- package/dist/serialization/types/ClientFacingResource.js +4 -0
- package/dist/serialization/types/CompanyDetails.d.ts +14 -0
- package/dist/serialization/types/CompanyDetails.js +35 -0
- package/dist/serialization/types/HealthInsuranceCreateRequest.d.ts +2 -2
- package/dist/serialization/types/HealthInsuranceCreateRequest.js +2 -2
- package/dist/serialization/types/LinkTokenExchangeResponse.d.ts +1 -0
- package/dist/serialization/types/LinkTokenExchangeResponse.js +1 -0
- package/dist/serialization/types/PersonDetailsOutput.d.ts +20 -0
- package/dist/serialization/types/PersonDetailsOutput.js +41 -0
- package/dist/serialization/types/PscAreaInfo.d.ts +2 -0
- package/dist/serialization/types/PscAreaInfo.js +2 -0
- package/dist/serialization/types/ResponsibleRelationship.d.ts +1 -1
- package/dist/serialization/types/ResponsibleRelationship.js +1 -1
- package/dist/serialization/types/TimeseriesResource.d.ts +1 -1
- package/dist/serialization/types/TimeseriesResource.js +4 -0
- package/dist/serialization/types/{PersonDetails.d.ts → UserInfo.d.ts} +6 -4
- package/dist/serialization/types/UserInfo.js +40 -0
- package/dist/serialization/types/VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.d.ts +17 -0
- package/dist/serialization/types/{PersonDetails.js → VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.js} +2 -2
- package/dist/serialization/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.d.ts +20 -0
- package/dist/serialization/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.js +41 -0
- package/dist/serialization/types/index.d.ts +8 -1
- package/dist/serialization/types/index.js +8 -1
- package/package.json +1 -1
- package/serialization/resources/insurance/client/requests/PayorSearchRequest.d.ts +0 -1
- package/serialization/resources/insurance/client/requests/PayorSearchRequest.js +0 -1
- package/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +3 -0
- package/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.js +3 -0
- package/serialization/resources/user/client/requests/CreateInsuranceRequest.d.ts +19 -0
- package/serialization/resources/user/client/requests/CreateInsuranceRequest.js +40 -0
- package/serialization/resources/user/client/requests/UserInfoCreateRequest.d.ts +19 -0
- package/serialization/resources/user/client/requests/UserInfoCreateRequest.js +40 -0
- package/serialization/resources/user/client/requests/index.d.ts +2 -0
- package/serialization/resources/user/client/requests/index.js +5 -1
- package/serialization/types/Billing.d.ts +10 -0
- package/serialization/types/Billing.js +35 -0
- package/serialization/types/ClientFacingInsurance.d.ts +21 -0
- package/serialization/types/ClientFacingInsurance.js +42 -0
- package/serialization/types/ClientFacingLabs.d.ts +10 -0
- package/serialization/types/ClientFacingLabs.js +31 -0
- package/serialization/types/ClientFacingOrder.d.ts +3 -0
- package/serialization/types/ClientFacingOrder.js +3 -0
- package/serialization/types/ClientFacingPayorSearchResponse.d.ts +1 -0
- package/serialization/types/ClientFacingPayorSearchResponse.js +1 -0
- package/serialization/types/ClientFacingResource.d.ts +1 -1
- package/serialization/types/ClientFacingResource.js +4 -0
- package/serialization/types/CompanyDetails.d.ts +14 -0
- package/serialization/types/CompanyDetails.js +35 -0
- package/serialization/types/HealthInsuranceCreateRequest.d.ts +2 -2
- package/serialization/types/HealthInsuranceCreateRequest.js +2 -2
- package/serialization/types/LinkTokenExchangeResponse.d.ts +1 -0
- package/serialization/types/LinkTokenExchangeResponse.js +1 -0
- package/serialization/types/PersonDetailsOutput.d.ts +20 -0
- package/serialization/types/PersonDetailsOutput.js +41 -0
- package/serialization/types/PscAreaInfo.d.ts +2 -0
- package/serialization/types/PscAreaInfo.js +2 -0
- package/serialization/types/ResponsibleRelationship.d.ts +1 -1
- package/serialization/types/ResponsibleRelationship.js +1 -1
- package/serialization/types/TimeseriesResource.d.ts +1 -1
- package/serialization/types/TimeseriesResource.js +4 -0
- package/serialization/types/{PersonDetails.d.ts → UserInfo.d.ts} +6 -4
- package/serialization/types/UserInfo.js +40 -0
- package/serialization/types/VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.d.ts +17 -0
- package/serialization/types/{PersonDetails.js → VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails.js} +2 -2
- package/serialization/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.d.ts +20 -0
- package/serialization/types/VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails.js +41 -0
- package/serialization/types/index.d.ts +8 -1
- package/serialization/types/index.js +8 -1
- /package/api/{types/PersonDetails.js → resources/user/client/requests/CreateInsuranceRequest.js} +0 -0
- /package/{dist/api/types/PersonDetails.js → api/resources/user/client/requests/UserInfoCreateRequest.js} +0 -0
@@ -73,7 +73,7 @@ class Sleep {
|
|
73
73
|
const _response = yield core.fetcher({
|
74
74
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/sleep/${userId}`),
|
75
75
|
method: "GET",
|
76
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
76
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
77
77
|
contentType: "application/json",
|
78
78
|
queryParameters: _queryParams,
|
79
79
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -142,7 +142,7 @@ class Sleep {
|
|
142
142
|
const _response = yield core.fetcher({
|
143
143
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/sleep/${userId}/stream`),
|
144
144
|
method: "GET",
|
145
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
145
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
146
146
|
contentType: "application/json",
|
147
147
|
queryParameters: _queryParams,
|
148
148
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -211,7 +211,7 @@ class Sleep {
|
|
211
211
|
const _response = yield core.fetcher({
|
212
212
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/sleep/${userId}/raw`),
|
213
213
|
method: "GET",
|
214
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
214
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
215
215
|
contentType: "application/json",
|
216
216
|
queryParameters: _queryParams,
|
217
217
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -269,7 +269,7 @@ class Sleep {
|
|
269
269
|
const _response = yield core.fetcher({
|
270
270
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/timeseries/sleep/${sleepId}/stream`),
|
271
271
|
method: "GET",
|
272
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
272
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
273
273
|
contentType: "application/json",
|
274
274
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
275
275
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -63,7 +63,7 @@ class Team {
|
|
63
63
|
const _response = yield core.fetcher({
|
64
64
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/team/link/config"),
|
65
65
|
method: "GET",
|
66
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
66
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined }, (yield this._getCustomAuthorizationHeaders())),
|
67
67
|
contentType: "application/json",
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
69
69
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -120,7 +120,7 @@ class Team {
|
|
120
120
|
const _response = yield core.fetcher({
|
121
121
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/team/${teamId}`),
|
122
122
|
method: "GET",
|
123
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
123
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
124
124
|
contentType: "application/json",
|
125
125
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
126
126
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -182,7 +182,7 @@ class Team {
|
|
182
182
|
const _response = yield core.fetcher({
|
183
183
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/team/users/search"),
|
184
184
|
method: "GET",
|
185
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
185
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
186
186
|
contentType: "application/json",
|
187
187
|
queryParameters: _queryParams,
|
188
188
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -233,7 +233,7 @@ class Team {
|
|
233
233
|
const _response = yield core.fetcher({
|
234
234
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/team/svix/url"),
|
235
235
|
method: "GET",
|
236
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
236
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
237
237
|
contentType: "application/json",
|
238
238
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
239
239
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -285,7 +285,7 @@ class Team {
|
|
285
285
|
const _response = yield core.fetcher({
|
286
286
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/team/source/priorities"),
|
287
287
|
method: "GET",
|
288
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
288
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
289
289
|
contentType: "application/json",
|
290
290
|
queryParameters: _queryParams,
|
291
291
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -342,7 +342,7 @@ class Team {
|
|
342
342
|
const _response = yield core.fetcher({
|
343
343
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/team/source/priorities"),
|
344
344
|
method: "PATCH",
|
345
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
345
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
346
346
|
contentType: "application/json",
|
347
347
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
348
348
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -388,7 +388,7 @@ class Team {
|
|
388
388
|
const _response = yield core.fetcher({
|
389
389
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/team/${teamId}/physicians`),
|
390
390
|
method: "GET",
|
391
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
391
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
392
392
|
contentType: "application/json",
|
393
393
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
394
394
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -58,7 +58,7 @@ class Testkit {
|
|
58
58
|
const _response = yield core.fetcher({
|
59
59
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/testkit/register"),
|
60
60
|
method: "POST",
|
61
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
61
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
62
62
|
contentType: "application/json",
|
63
63
|
body: yield serializers.RegisterTestkitRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
64
64
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -113,7 +113,7 @@ class Testkit {
|
|
113
113
|
const _response = yield core.fetcher({
|
114
114
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/testkit"),
|
115
115
|
method: "POST",
|
116
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
116
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
117
117
|
contentType: "application/json",
|
118
118
|
body: yield serializers.CreateRegistrableTestkitOrderRequest.jsonOrThrow(request, {
|
119
119
|
unrecognizedObjectKeys: "strip",
|
@@ -80,6 +80,67 @@ export declare class User {
|
|
80
80
|
* await vital.user.patch("user_id")
|
81
81
|
*/
|
82
82
|
patch(userId: string, request?: Vital.UserPatchBody, requestOptions?: User.RequestOptions): Promise<void>;
|
83
|
+
/**
|
84
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
85
|
+
*
|
86
|
+
* @example
|
87
|
+
* await vital.user.getLatestUserInfo("user_id")
|
88
|
+
*/
|
89
|
+
getLatestUserInfo(userId: string, requestOptions?: User.RequestOptions): Promise<Vital.UserInfo>;
|
90
|
+
/**
|
91
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
92
|
+
*
|
93
|
+
* @example
|
94
|
+
* await vital.user.createInsurance("user_id", {
|
95
|
+
* payorCode: "payor_code",
|
96
|
+
* memberId: "member_id",
|
97
|
+
* relationship: Vital.ResponsibleRelationship.Self,
|
98
|
+
* insured: {
|
99
|
+
* firstName: "first_name",
|
100
|
+
* lastName: "last_name",
|
101
|
+
* gender: Vital.Gender.Female,
|
102
|
+
* address: {
|
103
|
+
* firstLine: "first_line",
|
104
|
+
* country: "country",
|
105
|
+
* zip: "zip",
|
106
|
+
* city: "city",
|
107
|
+
* state: "state"
|
108
|
+
* },
|
109
|
+
* dob: "dob",
|
110
|
+
* email: "email",
|
111
|
+
* phoneNumber: "phone_number"
|
112
|
+
* }
|
113
|
+
* })
|
114
|
+
*/
|
115
|
+
createInsurance(userId: string, request: Vital.CreateInsuranceRequest, requestOptions?: User.RequestOptions): Promise<Vital.ClientFacingInsurance>;
|
116
|
+
/**
|
117
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
118
|
+
*
|
119
|
+
* @example
|
120
|
+
* await vital.user.getLatestInsurance("user_id")
|
121
|
+
*/
|
122
|
+
getLatestInsurance(userId: string, requestOptions?: User.RequestOptions): Promise<Vital.ClientFacingInsurance>;
|
123
|
+
/**
|
124
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
125
|
+
*
|
126
|
+
* @example
|
127
|
+
* await vital.user.upsertUserInfo("user_id", {
|
128
|
+
* firstName: "first_name",
|
129
|
+
* lastName: "last_name",
|
130
|
+
* email: "email",
|
131
|
+
* phoneNumber: "phone_number",
|
132
|
+
* gender: "gender",
|
133
|
+
* dob: "dob",
|
134
|
+
* address: {
|
135
|
+
* firstLine: "first_line",
|
136
|
+
* country: "country",
|
137
|
+
* zip: "zip",
|
138
|
+
* city: "city",
|
139
|
+
* state: "state"
|
140
|
+
* }
|
141
|
+
* })
|
142
|
+
*/
|
143
|
+
upsertUserInfo(userId: string, request: Vital.UserInfoCreateRequest, requestOptions?: User.RequestOptions): Promise<Vital.UserInfo>;
|
83
144
|
/**
|
84
145
|
* GET user_id from client_user_id.
|
85
146
|
* @throws {@link Vital.UnprocessableEntityError}
|
@@ -70,7 +70,7 @@ class User {
|
|
70
70
|
const _response = yield core.fetcher({
|
71
71
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/user"),
|
72
72
|
method: "GET",
|
73
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
74
74
|
contentType: "application/json",
|
75
75
|
queryParameters: _queryParams,
|
76
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -131,7 +131,7 @@ class User {
|
|
131
131
|
const _response = yield core.fetcher({
|
132
132
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/user"),
|
133
133
|
method: "POST",
|
134
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
134
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
135
135
|
contentType: "application/json",
|
136
136
|
body: yield serializers.UserCreateBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
137
137
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -190,7 +190,7 @@ class User {
|
|
190
190
|
const _response = yield core.fetcher({
|
191
191
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/user/metrics"),
|
192
192
|
method: "GET",
|
193
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
193
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
194
194
|
contentType: "application/json",
|
195
195
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
196
196
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -236,7 +236,7 @@ class User {
|
|
236
236
|
const _response = yield core.fetcher({
|
237
237
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}/sign_in_token`),
|
238
238
|
method: "POST",
|
239
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
239
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
240
240
|
contentType: "application/json",
|
241
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
242
242
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -293,7 +293,7 @@ class User {
|
|
293
293
|
const _response = yield core.fetcher({
|
294
294
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/providers/${userId}`),
|
295
295
|
method: "GET",
|
296
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
296
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
297
297
|
contentType: "application/json",
|
298
298
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
299
299
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -350,7 +350,7 @@ class User {
|
|
350
350
|
const _response = yield core.fetcher({
|
351
351
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}`),
|
352
352
|
method: "GET",
|
353
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
353
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
354
354
|
contentType: "application/json",
|
355
355
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
356
356
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -406,7 +406,7 @@ class User {
|
|
406
406
|
const _response = yield core.fetcher({
|
407
407
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}`),
|
408
408
|
method: "DELETE",
|
409
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
409
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
410
410
|
contentType: "application/json",
|
411
411
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
412
412
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -462,7 +462,7 @@ class User {
|
|
462
462
|
const _response = yield core.fetcher({
|
463
463
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}`),
|
464
464
|
method: "PATCH",
|
465
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
465
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
466
466
|
contentType: "application/json",
|
467
467
|
body: yield serializers.UserPatchBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
468
468
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -502,6 +502,265 @@ class User {
|
|
502
502
|
}
|
503
503
|
});
|
504
504
|
}
|
505
|
+
/**
|
506
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
507
|
+
*
|
508
|
+
* @example
|
509
|
+
* await vital.user.getLatestUserInfo("user_id")
|
510
|
+
*/
|
511
|
+
getLatestUserInfo(userId, requestOptions) {
|
512
|
+
var _a;
|
513
|
+
return __awaiter(this, void 0, void 0, function* () {
|
514
|
+
const _response = yield core.fetcher({
|
515
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}/info/latest`),
|
516
|
+
method: "GET",
|
517
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
518
|
+
contentType: "application/json",
|
519
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
520
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
521
|
+
});
|
522
|
+
if (_response.ok) {
|
523
|
+
return yield serializers.UserInfo.parseOrThrow(_response.body, {
|
524
|
+
unrecognizedObjectKeys: "passthrough",
|
525
|
+
allowUnrecognizedUnionMembers: true,
|
526
|
+
allowUnrecognizedEnumValues: true,
|
527
|
+
breadcrumbsPrefix: ["response"],
|
528
|
+
});
|
529
|
+
}
|
530
|
+
if (_response.error.reason === "status-code") {
|
531
|
+
switch (_response.error.statusCode) {
|
532
|
+
case 422:
|
533
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
534
|
+
unrecognizedObjectKeys: "passthrough",
|
535
|
+
allowUnrecognizedUnionMembers: true,
|
536
|
+
allowUnrecognizedEnumValues: true,
|
537
|
+
breadcrumbsPrefix: ["response"],
|
538
|
+
}));
|
539
|
+
default:
|
540
|
+
throw new errors.VitalError({
|
541
|
+
statusCode: _response.error.statusCode,
|
542
|
+
body: _response.error.body,
|
543
|
+
});
|
544
|
+
}
|
545
|
+
}
|
546
|
+
switch (_response.error.reason) {
|
547
|
+
case "non-json":
|
548
|
+
throw new errors.VitalError({
|
549
|
+
statusCode: _response.error.statusCode,
|
550
|
+
body: _response.error.rawBody,
|
551
|
+
});
|
552
|
+
case "timeout":
|
553
|
+
throw new errors.VitalTimeoutError();
|
554
|
+
case "unknown":
|
555
|
+
throw new errors.VitalError({
|
556
|
+
message: _response.error.errorMessage,
|
557
|
+
});
|
558
|
+
}
|
559
|
+
});
|
560
|
+
}
|
561
|
+
/**
|
562
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
563
|
+
*
|
564
|
+
* @example
|
565
|
+
* await vital.user.createInsurance("user_id", {
|
566
|
+
* payorCode: "payor_code",
|
567
|
+
* memberId: "member_id",
|
568
|
+
* relationship: Vital.ResponsibleRelationship.Self,
|
569
|
+
* insured: {
|
570
|
+
* firstName: "first_name",
|
571
|
+
* lastName: "last_name",
|
572
|
+
* gender: Vital.Gender.Female,
|
573
|
+
* address: {
|
574
|
+
* firstLine: "first_line",
|
575
|
+
* country: "country",
|
576
|
+
* zip: "zip",
|
577
|
+
* city: "city",
|
578
|
+
* state: "state"
|
579
|
+
* },
|
580
|
+
* dob: "dob",
|
581
|
+
* email: "email",
|
582
|
+
* phoneNumber: "phone_number"
|
583
|
+
* }
|
584
|
+
* })
|
585
|
+
*/
|
586
|
+
createInsurance(userId, request, requestOptions) {
|
587
|
+
var _a;
|
588
|
+
return __awaiter(this, void 0, void 0, function* () {
|
589
|
+
const _response = yield core.fetcher({
|
590
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}/insurance`),
|
591
|
+
method: "POST",
|
592
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
593
|
+
contentType: "application/json",
|
594
|
+
body: yield serializers.CreateInsuranceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
595
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
596
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
597
|
+
});
|
598
|
+
if (_response.ok) {
|
599
|
+
return yield serializers.ClientFacingInsurance.parseOrThrow(_response.body, {
|
600
|
+
unrecognizedObjectKeys: "passthrough",
|
601
|
+
allowUnrecognizedUnionMembers: true,
|
602
|
+
allowUnrecognizedEnumValues: true,
|
603
|
+
breadcrumbsPrefix: ["response"],
|
604
|
+
});
|
605
|
+
}
|
606
|
+
if (_response.error.reason === "status-code") {
|
607
|
+
switch (_response.error.statusCode) {
|
608
|
+
case 422:
|
609
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
610
|
+
unrecognizedObjectKeys: "passthrough",
|
611
|
+
allowUnrecognizedUnionMembers: true,
|
612
|
+
allowUnrecognizedEnumValues: true,
|
613
|
+
breadcrumbsPrefix: ["response"],
|
614
|
+
}));
|
615
|
+
default:
|
616
|
+
throw new errors.VitalError({
|
617
|
+
statusCode: _response.error.statusCode,
|
618
|
+
body: _response.error.body,
|
619
|
+
});
|
620
|
+
}
|
621
|
+
}
|
622
|
+
switch (_response.error.reason) {
|
623
|
+
case "non-json":
|
624
|
+
throw new errors.VitalError({
|
625
|
+
statusCode: _response.error.statusCode,
|
626
|
+
body: _response.error.rawBody,
|
627
|
+
});
|
628
|
+
case "timeout":
|
629
|
+
throw new errors.VitalTimeoutError();
|
630
|
+
case "unknown":
|
631
|
+
throw new errors.VitalError({
|
632
|
+
message: _response.error.errorMessage,
|
633
|
+
});
|
634
|
+
}
|
635
|
+
});
|
636
|
+
}
|
637
|
+
/**
|
638
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
639
|
+
*
|
640
|
+
* @example
|
641
|
+
* await vital.user.getLatestInsurance("user_id")
|
642
|
+
*/
|
643
|
+
getLatestInsurance(userId, requestOptions) {
|
644
|
+
var _a;
|
645
|
+
return __awaiter(this, void 0, void 0, function* () {
|
646
|
+
const _response = yield core.fetcher({
|
647
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}/insurance/latest`),
|
648
|
+
method: "GET",
|
649
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
650
|
+
contentType: "application/json",
|
651
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
652
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
653
|
+
});
|
654
|
+
if (_response.ok) {
|
655
|
+
return yield serializers.ClientFacingInsurance.parseOrThrow(_response.body, {
|
656
|
+
unrecognizedObjectKeys: "passthrough",
|
657
|
+
allowUnrecognizedUnionMembers: true,
|
658
|
+
allowUnrecognizedEnumValues: true,
|
659
|
+
breadcrumbsPrefix: ["response"],
|
660
|
+
});
|
661
|
+
}
|
662
|
+
if (_response.error.reason === "status-code") {
|
663
|
+
switch (_response.error.statusCode) {
|
664
|
+
case 422:
|
665
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
666
|
+
unrecognizedObjectKeys: "passthrough",
|
667
|
+
allowUnrecognizedUnionMembers: true,
|
668
|
+
allowUnrecognizedEnumValues: true,
|
669
|
+
breadcrumbsPrefix: ["response"],
|
670
|
+
}));
|
671
|
+
default:
|
672
|
+
throw new errors.VitalError({
|
673
|
+
statusCode: _response.error.statusCode,
|
674
|
+
body: _response.error.body,
|
675
|
+
});
|
676
|
+
}
|
677
|
+
}
|
678
|
+
switch (_response.error.reason) {
|
679
|
+
case "non-json":
|
680
|
+
throw new errors.VitalError({
|
681
|
+
statusCode: _response.error.statusCode,
|
682
|
+
body: _response.error.rawBody,
|
683
|
+
});
|
684
|
+
case "timeout":
|
685
|
+
throw new errors.VitalTimeoutError();
|
686
|
+
case "unknown":
|
687
|
+
throw new errors.VitalError({
|
688
|
+
message: _response.error.errorMessage,
|
689
|
+
});
|
690
|
+
}
|
691
|
+
});
|
692
|
+
}
|
693
|
+
/**
|
694
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
695
|
+
*
|
696
|
+
* @example
|
697
|
+
* await vital.user.upsertUserInfo("user_id", {
|
698
|
+
* firstName: "first_name",
|
699
|
+
* lastName: "last_name",
|
700
|
+
* email: "email",
|
701
|
+
* phoneNumber: "phone_number",
|
702
|
+
* gender: "gender",
|
703
|
+
* dob: "dob",
|
704
|
+
* address: {
|
705
|
+
* firstLine: "first_line",
|
706
|
+
* country: "country",
|
707
|
+
* zip: "zip",
|
708
|
+
* city: "city",
|
709
|
+
* state: "state"
|
710
|
+
* }
|
711
|
+
* })
|
712
|
+
*/
|
713
|
+
upsertUserInfo(userId, request, requestOptions) {
|
714
|
+
var _a;
|
715
|
+
return __awaiter(this, void 0, void 0, function* () {
|
716
|
+
const _response = yield core.fetcher({
|
717
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}/info`),
|
718
|
+
method: "PATCH",
|
719
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
720
|
+
contentType: "application/json",
|
721
|
+
body: yield serializers.UserInfoCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
722
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
723
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
724
|
+
});
|
725
|
+
if (_response.ok) {
|
726
|
+
return yield serializers.UserInfo.parseOrThrow(_response.body, {
|
727
|
+
unrecognizedObjectKeys: "passthrough",
|
728
|
+
allowUnrecognizedUnionMembers: true,
|
729
|
+
allowUnrecognizedEnumValues: true,
|
730
|
+
breadcrumbsPrefix: ["response"],
|
731
|
+
});
|
732
|
+
}
|
733
|
+
if (_response.error.reason === "status-code") {
|
734
|
+
switch (_response.error.statusCode) {
|
735
|
+
case 422:
|
736
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
737
|
+
unrecognizedObjectKeys: "passthrough",
|
738
|
+
allowUnrecognizedUnionMembers: true,
|
739
|
+
allowUnrecognizedEnumValues: true,
|
740
|
+
breadcrumbsPrefix: ["response"],
|
741
|
+
}));
|
742
|
+
default:
|
743
|
+
throw new errors.VitalError({
|
744
|
+
statusCode: _response.error.statusCode,
|
745
|
+
body: _response.error.body,
|
746
|
+
});
|
747
|
+
}
|
748
|
+
}
|
749
|
+
switch (_response.error.reason) {
|
750
|
+
case "non-json":
|
751
|
+
throw new errors.VitalError({
|
752
|
+
statusCode: _response.error.statusCode,
|
753
|
+
body: _response.error.rawBody,
|
754
|
+
});
|
755
|
+
case "timeout":
|
756
|
+
throw new errors.VitalTimeoutError();
|
757
|
+
case "unknown":
|
758
|
+
throw new errors.VitalError({
|
759
|
+
message: _response.error.errorMessage,
|
760
|
+
});
|
761
|
+
}
|
762
|
+
});
|
763
|
+
}
|
505
764
|
/**
|
506
765
|
* GET user_id from client_user_id.
|
507
766
|
* @throws {@link Vital.UnprocessableEntityError}
|
@@ -515,7 +774,7 @@ class User {
|
|
515
774
|
const _response = yield core.fetcher({
|
516
775
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/resolve/${clientUserId}`),
|
517
776
|
method: "GET",
|
518
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
777
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
519
778
|
contentType: "application/json",
|
520
779
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
521
780
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -571,7 +830,7 @@ class User {
|
|
571
830
|
const _response = yield core.fetcher({
|
572
831
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/${userId}/${yield serializers.Providers.jsonOrThrow(provider)}`),
|
573
832
|
method: "DELETE",
|
574
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
833
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
575
834
|
contentType: "application/json",
|
576
835
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
577
836
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
@@ -635,7 +894,7 @@ class User {
|
|
635
894
|
const _response = yield core.fetcher({
|
636
895
|
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"),
|
637
896
|
method: "POST",
|
638
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
897
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
639
898
|
contentType: "application/json",
|
640
899
|
queryParameters: _queryParams,
|
641
900
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -699,7 +958,7 @@ class User {
|
|
699
958
|
const _response = yield core.fetcher({
|
700
959
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/user/refresh/${userId}`),
|
701
960
|
method: "POST",
|
702
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
961
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
703
962
|
contentType: "application/json",
|
704
963
|
queryParameters: _queryParams,
|
705
964
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Vital from "../../../..";
|
5
|
+
/**
|
6
|
+
* @example
|
7
|
+
* {
|
8
|
+
* payorCode: "payor_code",
|
9
|
+
* memberId: "member_id",
|
10
|
+
* relationship: Vital.ResponsibleRelationship.Self,
|
11
|
+
* insured: {
|
12
|
+
* firstName: "first_name",
|
13
|
+
* lastName: "last_name",
|
14
|
+
* gender: Vital.Gender.Female,
|
15
|
+
* address: {
|
16
|
+
* firstLine: "first_line",
|
17
|
+
* country: "country",
|
18
|
+
* zip: "zip",
|
19
|
+
* city: "city",
|
20
|
+
* state: "state"
|
21
|
+
* },
|
22
|
+
* dob: "dob",
|
23
|
+
* email: "email",
|
24
|
+
* phoneNumber: "phone_number"
|
25
|
+
* }
|
26
|
+
* }
|
27
|
+
*/
|
28
|
+
export interface CreateInsuranceRequest {
|
29
|
+
payorCode: string;
|
30
|
+
memberId: string;
|
31
|
+
groupId?: string;
|
32
|
+
relationship: Vital.ResponsibleRelationship;
|
33
|
+
insured: Vital.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails;
|
34
|
+
guarantor?: Vital.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails;
|
35
|
+
}
|