@tryvital/vital-node 3.0.7 → 3.0.9
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 +1 -0
- package/api/errors/BadRequestError.js +1 -0
- package/api/errors/UnprocessableEntityError.js +1 -0
- package/api/resources/activity/client/Client.d.ts +11 -0
- package/api/resources/activity/client/Client.js +22 -11
- package/api/resources/activity/client/requests/ActivityGetRawRequest.d.ts +6 -0
- package/api/resources/activity/client/requests/ActivityGetRequest.d.ts +6 -0
- package/api/resources/body/client/Client.d.ts +11 -0
- package/api/resources/body/client/Client.js +22 -11
- package/api/resources/body/client/requests/BodyGetRawRequest.d.ts +6 -0
- package/api/resources/body/client/requests/BodyGetRequest.d.ts +6 -0
- package/api/resources/devices/client/Client.d.ts +4 -0
- package/api/resources/devices/client/Client.js +7 -4
- package/api/resources/devices/client/requests/DevicesGetRawRequest.d.ts +4 -0
- package/api/resources/insurance/client/Client.d.ts +6 -0
- package/api/resources/insurance/client/Client.js +11 -5
- package/api/resources/insurance/client/requests/InsuranceSearchDiagnosisRequest.d.ts +6 -0
- package/api/resources/introspect/client/Client.d.ts +11 -0
- package/api/resources/introspect/client/Client.js +24 -13
- package/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +6 -0
- package/api/resources/introspect/client/requests/IntrospectGetUserResourcesRequest.d.ts +6 -0
- package/api/resources/labTests/client/Client.d.ts +21 -1
- package/api/resources/labTests/client/Client.js +115 -59
- package/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
- package/api/resources/labTests/client/requests/LabTestsGetMarkersForLabTestRequest.d.ts +4 -0
- package/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +4 -0
- package/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.d.ts +4 -0
- package/api/resources/link/client/Client.d.ts +7 -0
- package/api/resources/link/client/Client.js +35 -17
- package/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +4 -0
- package/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +4 -0
- package/api/resources/meal/client/Client.d.ts +6 -0
- package/api/resources/meal/client/Client.js +11 -6
- package/api/resources/meal/client/requests/MealGetRequest.d.ts +6 -0
- package/api/resources/profile/client/Client.d.ts +1 -0
- package/api/resources/profile/client/Client.js +8 -7
- package/api/resources/providers/client/Client.d.ts +4 -0
- package/api/resources/providers/client/Client.js +5 -1
- package/api/resources/sleep/client/Client.d.ts +19 -0
- package/api/resources/sleep/client/Client.js +38 -17
- package/api/resources/sleep/client/requests/SleepGetRawRequest.d.ts +6 -0
- package/api/resources/sleep/client/requests/SleepGetRequest.d.ts +6 -0
- package/api/resources/sleep/client/requests/SleepGetStreamRequest.d.ts +6 -0
- package/api/resources/team/client/Client.d.ts +18 -0
- package/api/resources/team/client/Client.js +37 -14
- package/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +4 -0
- package/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.d.ts +4 -0
- package/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts +4 -0
- package/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts +6 -0
- package/api/resources/testkit/client/Client.d.ts +1 -0
- package/api/resources/testkit/client/Client.js +4 -2
- package/api/resources/user/client/Client.d.ts +7 -0
- package/api/resources/user/client/Client.js +33 -17
- package/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
- package/api/resources/vitals/client/Client.d.ts +116 -0
- package/api/resources/vitals/client/Client.js +253 -116
- package/api/resources/vitals/client/requests/VitalsBloodOxygenRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsBloodPressureRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCaffeineRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCaloriesActiveRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCaloriesBasalRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolHdlRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolLdlRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolTotalRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsDistanceRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsFloorsClimbedRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsGlucoseRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsHeartrateRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsHrvRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsHypnogramRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsIgeRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsIggRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsMindfulnessMinutesRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsRespiratoryRateRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsStepsRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsTriglyceridesRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsWaterRequest.d.ts +6 -0
- package/api/resources/workouts/client/Client.d.ts +14 -0
- package/api/resources/workouts/client/Client.js +27 -12
- package/api/resources/workouts/client/requests/WorkoutsGetRawRequest.d.ts +6 -0
- package/api/resources/workouts/client/requests/WorkoutsGetRequest.d.ts +6 -0
- package/api/types/ClientFacingDiagnosisInformation.d.ts +2 -2
- package/api/types/ClientFacingLabTest.d.ts +1 -1
- package/api/types/ClientFacingOrder.d.ts +1 -1
- package/api/types/ClientFacingPayorSearchResponse.d.ts +3 -3
- package/api/types/ClientFacingSleep.d.ts +1 -1
- package/api/types/ClientFacingTeam.d.ts +1 -0
- package/api/types/ClientFacingUser.d.ts +0 -1
- package/api/types/DeviceV2InDb.d.ts +1 -1
- package/api/types/FallbackTimeZone.d.ts +0 -1
- package/api/types/OAuthProviders.d.ts +2 -1
- package/api/types/OAuthProviders.js +1 -0
- package/api/types/Providers.d.ts +2 -1
- package/api/types/Providers.js +1 -0
- package/api/types/TeamConfig.d.ts +1 -0
- package/api/types/index.d.ts +7 -7
- package/api/types/index.js +7 -7
- package/core/fetcher/APIResponse.d.ts +1 -0
- package/core/fetcher/Fetcher.d.ts +3 -6
- package/core/fetcher/Fetcher.js +70 -26
- package/core/fetcher/getHeader.d.ts +1 -0
- package/{dist/core/streaming-fetcher → core/fetcher}/getHeader.js +2 -2
- package/core/fetcher/index.d.ts +1 -0
- package/core/fetcher/index.js +3 -1
- package/core/index.d.ts +0 -1
- package/core/index.js +0 -1
- package/core/schemas/Schema.d.ts +1 -0
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/core/schemas/builders/literals/index.d.ts +1 -0
- package/core/schemas/builders/literals/index.js +3 -1
- package/core/schemas/builders/object/index.d.ts +2 -0
- package/core/schemas/builders/object/index.js +3 -1
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/Client.d.ts +1 -0
- package/dist/api/errors/BadRequestError.js +1 -0
- package/dist/api/errors/UnprocessableEntityError.js +1 -0
- package/dist/api/resources/activity/client/Client.d.ts +11 -0
- package/dist/api/resources/activity/client/Client.js +22 -11
- package/dist/api/resources/activity/client/requests/ActivityGetRawRequest.d.ts +6 -0
- package/dist/api/resources/activity/client/requests/ActivityGetRequest.d.ts +6 -0
- package/dist/api/resources/body/client/Client.d.ts +11 -0
- package/dist/api/resources/body/client/Client.js +22 -11
- package/dist/api/resources/body/client/requests/BodyGetRawRequest.d.ts +6 -0
- package/dist/api/resources/body/client/requests/BodyGetRequest.d.ts +6 -0
- package/dist/api/resources/devices/client/Client.d.ts +4 -0
- package/dist/api/resources/devices/client/Client.js +7 -4
- package/dist/api/resources/devices/client/requests/DevicesGetRawRequest.d.ts +4 -0
- package/dist/api/resources/insurance/client/Client.d.ts +6 -0
- package/dist/api/resources/insurance/client/Client.js +11 -5
- package/dist/api/resources/insurance/client/requests/InsuranceSearchDiagnosisRequest.d.ts +6 -0
- package/dist/api/resources/introspect/client/Client.d.ts +11 -0
- package/dist/api/resources/introspect/client/Client.js +24 -13
- package/dist/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +6 -0
- package/dist/api/resources/introspect/client/requests/IntrospectGetUserResourcesRequest.d.ts +6 -0
- package/dist/api/resources/labTests/client/Client.d.ts +21 -1
- package/dist/api/resources/labTests/client/Client.js +115 -59
- package/dist/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
- package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersForLabTestRequest.d.ts +4 -0
- package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +4 -0
- package/dist/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.d.ts +4 -0
- package/dist/api/resources/link/client/Client.d.ts +7 -0
- package/dist/api/resources/link/client/Client.js +35 -17
- package/dist/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +4 -0
- package/dist/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +4 -0
- package/dist/api/resources/meal/client/Client.d.ts +6 -0
- package/dist/api/resources/meal/client/Client.js +11 -6
- package/dist/api/resources/meal/client/requests/MealGetRequest.d.ts +6 -0
- package/dist/api/resources/profile/client/Client.d.ts +1 -0
- package/dist/api/resources/profile/client/Client.js +8 -7
- package/dist/api/resources/providers/client/Client.d.ts +4 -0
- package/dist/api/resources/providers/client/Client.js +5 -1
- package/dist/api/resources/sleep/client/Client.d.ts +19 -0
- package/dist/api/resources/sleep/client/Client.js +38 -17
- package/dist/api/resources/sleep/client/requests/SleepGetRawRequest.d.ts +6 -0
- package/dist/api/resources/sleep/client/requests/SleepGetRequest.d.ts +6 -0
- package/dist/api/resources/sleep/client/requests/SleepGetStreamRequest.d.ts +6 -0
- package/dist/api/resources/team/client/Client.d.ts +18 -0
- package/dist/api/resources/team/client/Client.js +37 -14
- package/dist/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +4 -0
- package/dist/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.d.ts +4 -0
- package/dist/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts +4 -0
- package/dist/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts +6 -0
- package/dist/api/resources/testkit/client/Client.d.ts +1 -0
- package/dist/api/resources/testkit/client/Client.js +4 -2
- package/dist/api/resources/user/client/Client.d.ts +7 -0
- package/dist/api/resources/user/client/Client.js +33 -17
- package/dist/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
- package/dist/api/resources/vitals/client/Client.d.ts +116 -0
- package/dist/api/resources/vitals/client/Client.js +253 -116
- package/dist/api/resources/vitals/client/requests/VitalsBloodOxygenRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsBloodPressureRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCaffeineRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCaloriesActiveRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCaloriesBasalRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolHdlRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolLdlRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolTotalRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsDistanceRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsFloorsClimbedRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsGlucoseRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsHeartrateRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsHrvRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsHypnogramRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsIgeRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsIggRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsMindfulnessMinutesRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsRespiratoryRateRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsStepsRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsTriglyceridesRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsWaterRequest.d.ts +6 -0
- package/dist/api/resources/workouts/client/Client.d.ts +14 -0
- package/dist/api/resources/workouts/client/Client.js +27 -12
- package/dist/api/resources/workouts/client/requests/WorkoutsGetRawRequest.d.ts +6 -0
- package/dist/api/resources/workouts/client/requests/WorkoutsGetRequest.d.ts +6 -0
- package/dist/api/types/ClientFacingDiagnosisInformation.d.ts +2 -2
- package/dist/api/types/ClientFacingLabTest.d.ts +1 -1
- package/dist/api/types/ClientFacingOrder.d.ts +1 -1
- package/dist/api/types/ClientFacingPayorSearchResponse.d.ts +3 -3
- package/dist/api/types/ClientFacingSleep.d.ts +1 -1
- package/dist/api/types/ClientFacingTeam.d.ts +1 -0
- package/dist/api/types/ClientFacingUser.d.ts +0 -1
- package/dist/api/types/DeviceV2InDb.d.ts +1 -1
- package/dist/api/types/FallbackTimeZone.d.ts +0 -1
- package/dist/api/types/OAuthProviders.d.ts +2 -1
- package/dist/api/types/OAuthProviders.js +1 -0
- package/dist/api/types/Providers.d.ts +2 -1
- package/dist/api/types/Providers.js +1 -0
- package/dist/api/types/TeamConfig.d.ts +1 -0
- package/dist/api/types/index.d.ts +7 -7
- package/dist/api/types/index.js +7 -7
- package/dist/core/fetcher/APIResponse.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +3 -6
- package/dist/core/fetcher/Fetcher.js +70 -26
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/{core/streaming-fetcher → dist/core/fetcher}/getHeader.js +2 -2
- package/dist/core/fetcher/index.d.ts +1 -0
- package/dist/core/fetcher/index.js +3 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/schemas/Schema.d.ts +1 -0
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/dist/core/schemas/builders/literals/index.d.ts +1 -0
- package/dist/core/schemas/builders/literals/index.js +3 -1
- package/dist/core/schemas/builders/object/index.d.ts +2 -0
- package/dist/core/schemas/builders/object/index.js +3 -1
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/serialization/types/ClientFacingTeam.d.ts +1 -0
- package/dist/serialization/types/ClientFacingTeam.js +1 -0
- package/dist/serialization/types/DeviceV2InDb.d.ts +1 -1
- package/dist/serialization/types/DeviceV2InDb.js +1 -1
- package/dist/serialization/types/OAuthProviders.d.ts +1 -1
- package/dist/serialization/types/OAuthProviders.js +1 -0
- package/dist/serialization/types/Providers.d.ts +1 -1
- package/dist/serialization/types/Providers.js +1 -0
- package/dist/serialization/types/TeamConfig.d.ts +1 -0
- package/dist/serialization/types/TeamConfig.js +1 -0
- package/dist/serialization/types/index.d.ts +7 -7
- package/dist/serialization/types/index.js +7 -7
- package/package.json +7 -4
- package/serialization/types/ClientFacingTeam.d.ts +1 -0
- package/serialization/types/ClientFacingTeam.js +1 -0
- package/serialization/types/DeviceV2InDb.d.ts +1 -1
- package/serialization/types/DeviceV2InDb.js +1 -1
- package/serialization/types/OAuthProviders.d.ts +1 -1
- package/serialization/types/OAuthProviders.js +1 -0
- package/serialization/types/Providers.d.ts +1 -1
- package/serialization/types/Providers.js +1 -0
- package/serialization/types/TeamConfig.d.ts +1 -0
- package/serialization/types/TeamConfig.js +1 -0
- package/serialization/types/index.d.ts +7 -7
- package/serialization/types/index.js +7 -7
- package/core/streaming-fetcher/StreamingFetcher.d.ts +0 -30
- package/core/streaming-fetcher/StreamingFetcher.js +0 -79
- package/core/streaming-fetcher/getHeader.d.ts +0 -2
- package/core/streaming-fetcher/index.d.ts +0 -3
- package/core/streaming-fetcher/index.js +0 -7
- package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +0 -30
- package/dist/core/streaming-fetcher/StreamingFetcher.js +0 -79
- package/dist/core/streaming-fetcher/getHeader.d.ts +0 -2
- package/dist/core/streaming-fetcher/index.d.ts +0 -3
- package/dist/core/streaming-fetcher/index.js +0 -7
@@ -56,7 +56,6 @@ const Vital = __importStar(require("../../.."));
|
|
56
56
|
const serializers = __importStar(require("../../../../serialization"));
|
57
57
|
const url_join_1 = __importDefault(require("url-join"));
|
58
58
|
const errors = __importStar(require("../../../../errors"));
|
59
|
-
const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
|
60
59
|
class Link {
|
61
60
|
constructor(_options) {
|
62
61
|
this._options = _options;
|
@@ -80,11 +79,12 @@ class Link {
|
|
80
79
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
81
80
|
"X-Fern-Language": "JavaScript",
|
82
81
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
83
|
-
"X-Fern-SDK-Version": "3.0.
|
82
|
+
"X-Fern-SDK-Version": "3.0.9",
|
84
83
|
},
|
85
84
|
contentType: "application/json",
|
86
85
|
body: yield serializers.LinkTokenExchange.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
87
86
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
87
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
88
88
|
});
|
89
89
|
if (_response.ok) {
|
90
90
|
return yield serializers.LinkTokenExchangeResponse.parseOrThrow(_response.body, {
|
@@ -138,11 +138,12 @@ class Link {
|
|
138
138
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
139
139
|
"X-Fern-Language": "JavaScript",
|
140
140
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
141
|
-
"X-Fern-SDK-Version": "3.0.
|
141
|
+
"X-Fern-SDK-Version": "3.0.9",
|
142
142
|
},
|
143
143
|
contentType: "application/json",
|
144
144
|
body: yield serializers.LinkTokenBase.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
145
145
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
146
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
146
147
|
});
|
147
148
|
if (_response.ok) {
|
148
149
|
return yield serializers.link.isTokenValid.Response.parseOrThrow(_response.body, {
|
@@ -191,10 +192,10 @@ class Link {
|
|
191
192
|
var _a;
|
192
193
|
return __awaiter(this, void 0, void 0, function* () {
|
193
194
|
const { userId, expiresAt } = request;
|
194
|
-
const _queryParams =
|
195
|
-
_queryParams
|
195
|
+
const _queryParams = {};
|
196
|
+
_queryParams["user_id"] = userId;
|
196
197
|
if (expiresAt != null) {
|
197
|
-
_queryParams
|
198
|
+
_queryParams["expires_at"] = expiresAt.toISOString();
|
198
199
|
}
|
199
200
|
const _response = yield core.fetcher({
|
200
201
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/code/create"),
|
@@ -203,11 +204,12 @@ class Link {
|
|
203
204
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
204
205
|
"X-Fern-Language": "JavaScript",
|
205
206
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
206
|
-
"X-Fern-SDK-Version": "3.0.
|
207
|
+
"X-Fern-SDK-Version": "3.0.9",
|
207
208
|
},
|
208
209
|
contentType: "application/json",
|
209
210
|
queryParameters: _queryParams,
|
210
211
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
212
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
211
213
|
});
|
212
214
|
if (_response.ok) {
|
213
215
|
return yield serializers.VitalTokenCreatedResponse.parseOrThrow(_response.body, {
|
@@ -263,11 +265,12 @@ class Link {
|
|
263
265
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
264
266
|
"X-Fern-Language": "JavaScript",
|
265
267
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
266
|
-
"X-Fern-SDK-Version": "3.0.
|
268
|
+
"X-Fern-SDK-Version": "3.0.9",
|
267
269
|
},
|
268
270
|
contentType: "application/json",
|
269
271
|
body: yield serializers.BeginLinkTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
270
272
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
273
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
271
274
|
});
|
272
275
|
if (_response.ok) {
|
273
276
|
return yield serializers.link.startConnect.Response.parseOrThrow(_response.body, {
|
@@ -312,6 +315,9 @@ class Link {
|
|
312
315
|
* REQUEST_SOURCE: VITAL-LINK
|
313
316
|
* Check link token state - can be hit continuously used as heartbeat
|
314
317
|
* @throws {@link Vital.UnprocessableEntityError}
|
318
|
+
*
|
319
|
+
* @example
|
320
|
+
* await vital.link.tokenState({})
|
315
321
|
*/
|
316
322
|
tokenState(request = {}, requestOptions) {
|
317
323
|
var _a;
|
@@ -324,11 +330,12 @@ class Link {
|
|
324
330
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
325
331
|
"X-Fern-Language": "JavaScript",
|
326
332
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
327
|
-
"X-Fern-SDK-Version": "3.0.
|
333
|
+
"X-Fern-SDK-Version": "3.0.9",
|
328
334
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
329
335
|
},
|
330
336
|
contentType: "application/json",
|
331
337
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
338
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
332
339
|
});
|
333
340
|
if (_response.ok) {
|
334
341
|
return yield serializers.link.tokenState.Response.parseOrThrow(_response.body, {
|
@@ -386,12 +393,13 @@ class Link {
|
|
386
393
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
387
394
|
"X-Fern-Language": "JavaScript",
|
388
395
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
389
|
-
"X-Fern-SDK-Version": "3.0.
|
396
|
+
"X-Fern-SDK-Version": "3.0.9",
|
390
397
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
391
398
|
},
|
392
399
|
contentType: "application/json",
|
393
400
|
body: yield serializers.EmailAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
394
401
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
402
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
395
403
|
});
|
396
404
|
if (_response.ok) {
|
397
405
|
return yield serializers.ConnectionStatus.parseOrThrow(_response.body, {
|
@@ -449,13 +457,14 @@ class Link {
|
|
449
457
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
450
458
|
"X-Fern-Language": "JavaScript",
|
451
459
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
452
|
-
"X-Fern-SDK-Version": "3.0.
|
460
|
+
"X-Fern-SDK-Version": "3.0.9",
|
453
461
|
"x-vital-link-client-region": vitalLinkClientRegion != null ? vitalLinkClientRegion : undefined,
|
454
462
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
455
463
|
},
|
456
464
|
contentType: "application/json",
|
457
465
|
body: yield serializers.PasswordAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
458
466
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
467
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
459
468
|
});
|
460
469
|
if (_response.ok) {
|
461
470
|
return yield serializers.ConnectionStatus.parseOrThrow(_response.body, {
|
@@ -511,11 +520,12 @@ class Link {
|
|
511
520
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
512
521
|
"X-Fern-Language": "JavaScript",
|
513
522
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
514
|
-
"X-Fern-SDK-Version": "3.0.
|
523
|
+
"X-Fern-SDK-Version": "3.0.9",
|
515
524
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
516
525
|
},
|
517
526
|
contentType: "application/json",
|
518
527
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
528
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
519
529
|
});
|
520
530
|
if (_response.ok) {
|
521
531
|
return yield serializers.Source.parseOrThrow(_response.body, {
|
@@ -571,13 +581,14 @@ class Link {
|
|
571
581
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
572
582
|
"X-Fern-Language": "JavaScript",
|
573
583
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
574
|
-
"X-Fern-SDK-Version": "3.0.
|
584
|
+
"X-Fern-SDK-Version": "3.0.9",
|
575
585
|
"x-vital-link-client-region": vitalLinkClientRegion != null ? vitalLinkClientRegion : undefined,
|
576
586
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
577
587
|
},
|
578
588
|
contentType: "application/json",
|
579
589
|
body: yield serializers.IndividualProviderData.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
580
590
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
591
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
581
592
|
});
|
582
593
|
if (_response.ok) {
|
583
594
|
return yield serializers.ProviderLinkResponse.parseOrThrow(_response.body, {
|
@@ -633,12 +644,13 @@ class Link {
|
|
633
644
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
634
645
|
"X-Fern-Language": "JavaScript",
|
635
646
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
636
|
-
"X-Fern-SDK-Version": "3.0.
|
647
|
+
"X-Fern-SDK-Version": "3.0.9",
|
637
648
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
638
649
|
},
|
639
650
|
contentType: "application/json",
|
640
651
|
body: yield serializers.EmailProviderAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
641
652
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
653
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
642
654
|
});
|
643
655
|
if (_response.ok) {
|
644
656
|
return yield serializers.ConnectionStatus.parseOrThrow(_response.body, {
|
@@ -682,6 +694,9 @@ class Link {
|
|
682
694
|
/**
|
683
695
|
* GET List of all available providers given the generated link token.
|
684
696
|
* @throws {@link Vital.UnprocessableEntityError}
|
697
|
+
*
|
698
|
+
* @example
|
699
|
+
* await vital.link.getAllProviders({})
|
685
700
|
*/
|
686
701
|
getAllProviders(request = {}, requestOptions) {
|
687
702
|
var _a;
|
@@ -694,11 +709,12 @@ class Link {
|
|
694
709
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
695
710
|
"X-Fern-Language": "JavaScript",
|
696
711
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
697
|
-
"X-Fern-SDK-Version": "3.0.
|
712
|
+
"X-Fern-SDK-Version": "3.0.9",
|
698
713
|
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
699
714
|
},
|
700
715
|
contentType: "application/json",
|
701
716
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
717
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
702
718
|
});
|
703
719
|
if (_response.ok) {
|
704
720
|
return yield serializers.link.getAllProviders.Response.parseOrThrow(_response.body, {
|
@@ -755,11 +771,12 @@ class Link {
|
|
755
771
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
756
772
|
"X-Fern-Language": "JavaScript",
|
757
773
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
758
|
-
"X-Fern-SDK-Version": "3.0.
|
774
|
+
"X-Fern-SDK-Version": "3.0.9",
|
759
775
|
},
|
760
776
|
contentType: "application/json",
|
761
777
|
body: yield serializers.ManualConnectionData.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
762
778
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
779
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
763
780
|
});
|
764
781
|
if (_response.ok) {
|
765
782
|
return yield serializers.link.connectManualProvider.Response.parseOrThrow(_response.body, {
|
@@ -814,13 +831,14 @@ class Link {
|
|
814
831
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
815
832
|
"X-Fern-Language": "JavaScript",
|
816
833
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
817
|
-
"X-Fern-SDK-Version": "3.0.
|
834
|
+
"X-Fern-SDK-Version": "3.0.9",
|
818
835
|
},
|
819
836
|
contentType: "application/json",
|
820
837
|
body: yield serializers.DemoConnectionCreationPayload.jsonOrThrow(request, {
|
821
838
|
unrecognizedObjectKeys: "strip",
|
822
839
|
}),
|
823
840
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
841
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
824
842
|
});
|
825
843
|
if (_response.ok) {
|
826
844
|
return yield serializers.DemoConnectionStatus.parseOrThrow(_response.body, {
|
@@ -11,6 +11,7 @@ export declare namespace Meal {
|
|
11
11
|
}
|
12
12
|
interface RequestOptions {
|
13
13
|
timeoutInSeconds?: number;
|
14
|
+
maxRetries?: number;
|
14
15
|
}
|
15
16
|
}
|
16
17
|
export declare class Meal {
|
@@ -19,6 +20,11 @@ export declare class Meal {
|
|
19
20
|
/**
|
20
21
|
* Get user's meals
|
21
22
|
* @throws {@link Vital.UnprocessableEntityError}
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* await vital.meal.get("user-id", {
|
26
|
+
* startDate: "start-date"
|
27
|
+
* })
|
22
28
|
*/
|
23
29
|
get(userId: string, request: Vital.MealGetRequest, requestOptions?: Meal.RequestOptions): Promise<Vital.ClientFacingMealResponse>;
|
24
30
|
}
|
@@ -42,7 +42,6 @@ exports.Meal = void 0;
|
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
43
43
|
const core = __importStar(require("../../../../core"));
|
44
44
|
const Vital = __importStar(require("../../.."));
|
45
|
-
const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
|
46
45
|
const url_join_1 = __importDefault(require("url-join"));
|
47
46
|
const serializers = __importStar(require("../../../../serialization"));
|
48
47
|
const errors = __importStar(require("../../../../errors"));
|
@@ -53,18 +52,23 @@ class Meal {
|
|
53
52
|
/**
|
54
53
|
* Get user's meals
|
55
54
|
* @throws {@link Vital.UnprocessableEntityError}
|
55
|
+
*
|
56
|
+
* @example
|
57
|
+
* await vital.meal.get("user-id", {
|
58
|
+
* startDate: "start-date"
|
59
|
+
* })
|
56
60
|
*/
|
57
61
|
get(userId, request, requestOptions) {
|
58
62
|
var _a;
|
59
63
|
return __awaiter(this, void 0, void 0, function* () {
|
60
64
|
const { provider, startDate, endDate } = request;
|
61
|
-
const _queryParams =
|
65
|
+
const _queryParams = {};
|
62
66
|
if (provider != null) {
|
63
|
-
_queryParams
|
67
|
+
_queryParams["provider"] = provider;
|
64
68
|
}
|
65
|
-
_queryParams
|
69
|
+
_queryParams["start_date"] = startDate;
|
66
70
|
if (endDate != null) {
|
67
|
-
_queryParams
|
71
|
+
_queryParams["end_date"] = endDate;
|
68
72
|
}
|
69
73
|
const _response = yield core.fetcher({
|
70
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/meal/${userId}`),
|
@@ -73,11 +77,12 @@ class Meal {
|
|
73
77
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
74
78
|
"X-Fern-Language": "JavaScript",
|
75
79
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
76
|
-
"X-Fern-SDK-Version": "3.0.
|
80
|
+
"X-Fern-SDK-Version": "3.0.9",
|
77
81
|
},
|
78
82
|
contentType: "application/json",
|
79
83
|
queryParameters: _queryParams,
|
80
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
85
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
81
86
|
});
|
82
87
|
if (_response.ok) {
|
83
88
|
return yield serializers.ClientFacingMealResponse.parseOrThrow(_response.body, {
|
@@ -42,7 +42,6 @@ exports.Profile = void 0;
|
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
43
43
|
const core = __importStar(require("../../../../core"));
|
44
44
|
const Vital = __importStar(require("../../.."));
|
45
|
-
const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
|
46
45
|
const url_join_1 = __importDefault(require("url-join"));
|
47
46
|
const serializers = __importStar(require("../../../../serialization"));
|
48
47
|
const errors = __importStar(require("../../../../errors"));
|
@@ -58,9 +57,9 @@ class Profile {
|
|
58
57
|
var _a;
|
59
58
|
return __awaiter(this, void 0, void 0, function* () {
|
60
59
|
const { provider } = request;
|
61
|
-
const _queryParams =
|
60
|
+
const _queryParams = {};
|
62
61
|
if (provider != null) {
|
63
|
-
_queryParams
|
62
|
+
_queryParams["provider"] = provider;
|
64
63
|
}
|
65
64
|
const _response = yield core.fetcher({
|
66
65
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/profile/${userId}`),
|
@@ -69,11 +68,12 @@ class Profile {
|
|
69
68
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
70
69
|
"X-Fern-Language": "JavaScript",
|
71
70
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
72
|
-
"X-Fern-SDK-Version": "3.0.
|
71
|
+
"X-Fern-SDK-Version": "3.0.9",
|
73
72
|
},
|
74
73
|
contentType: "application/json",
|
75
74
|
queryParameters: _queryParams,
|
76
75
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
76
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
77
77
|
});
|
78
78
|
if (_response.ok) {
|
79
79
|
return yield serializers.ClientFacingProfile.parseOrThrow(_response.body, {
|
@@ -122,9 +122,9 @@ class Profile {
|
|
122
122
|
var _a;
|
123
123
|
return __awaiter(this, void 0, void 0, function* () {
|
124
124
|
const { provider } = request;
|
125
|
-
const _queryParams =
|
125
|
+
const _queryParams = {};
|
126
126
|
if (provider != null) {
|
127
|
-
_queryParams
|
127
|
+
_queryParams["provider"] = provider;
|
128
128
|
}
|
129
129
|
const _response = yield core.fetcher({
|
130
130
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/profile/${userId}/raw`),
|
@@ -133,11 +133,12 @@ class Profile {
|
|
133
133
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
134
134
|
"X-Fern-Language": "JavaScript",
|
135
135
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
136
|
-
"X-Fern-SDK-Version": "3.0.
|
136
|
+
"X-Fern-SDK-Version": "3.0.9",
|
137
137
|
},
|
138
138
|
contentType: "application/json",
|
139
139
|
queryParameters: _queryParams,
|
140
140
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
141
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
141
142
|
});
|
142
143
|
if (_response.ok) {
|
143
144
|
return yield serializers.RawProfile.parseOrThrow(_response.body, {
|
@@ -11,6 +11,7 @@ export declare namespace Providers {
|
|
11
11
|
}
|
12
12
|
interface RequestOptions {
|
13
13
|
timeoutInSeconds?: number;
|
14
|
+
maxRetries?: number;
|
14
15
|
}
|
15
16
|
}
|
16
17
|
export declare class Providers {
|
@@ -18,6 +19,9 @@ export declare class Providers {
|
|
18
19
|
constructor(_options: Providers.Options);
|
19
20
|
/**
|
20
21
|
* Get Provider list
|
22
|
+
*
|
23
|
+
* @example
|
24
|
+
* await vital.providers.getAll()
|
21
25
|
*/
|
22
26
|
getAll(requestOptions?: Providers.RequestOptions): Promise<Vital.ClientFacingProviderDetailed[]>;
|
23
27
|
}
|
@@ -50,6 +50,9 @@ class Providers {
|
|
50
50
|
}
|
51
51
|
/**
|
52
52
|
* Get Provider list
|
53
|
+
*
|
54
|
+
* @example
|
55
|
+
* await vital.providers.getAll()
|
53
56
|
*/
|
54
57
|
getAll(requestOptions) {
|
55
58
|
var _a;
|
@@ -61,10 +64,11 @@ class Providers {
|
|
61
64
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
62
65
|
"X-Fern-Language": "JavaScript",
|
63
66
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
64
|
-
"X-Fern-SDK-Version": "3.0.
|
67
|
+
"X-Fern-SDK-Version": "3.0.9",
|
65
68
|
},
|
66
69
|
contentType: "application/json",
|
67
70
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
71
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
68
72
|
});
|
69
73
|
if (_response.ok) {
|
70
74
|
return yield serializers.providers.getAll.Response.parseOrThrow(_response.body, {
|
@@ -11,6 +11,7 @@ export declare namespace Sleep {
|
|
11
11
|
}
|
12
12
|
interface RequestOptions {
|
13
13
|
timeoutInSeconds?: number;
|
14
|
+
maxRetries?: number;
|
14
15
|
}
|
15
16
|
}
|
16
17
|
export declare class Sleep {
|
@@ -19,21 +20,39 @@ export declare class Sleep {
|
|
19
20
|
/**
|
20
21
|
* Get Daily sleep for user_id
|
21
22
|
* @throws {@link Vital.UnprocessableEntityError}
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* await vital.sleep.get("user-id", {
|
26
|
+
* startDate: "start-date"
|
27
|
+
* })
|
22
28
|
*/
|
23
29
|
get(userId: string, request: Vital.SleepGetRequest, requestOptions?: Sleep.RequestOptions): Promise<Vital.ClientSleepResponse>;
|
24
30
|
/**
|
25
31
|
* Get Daily sleep stream for user_id
|
26
32
|
* @throws {@link Vital.UnprocessableEntityError}
|
33
|
+
*
|
34
|
+
* @example
|
35
|
+
* await vital.sleep.getStream("user-id", {
|
36
|
+
* startDate: "start-date"
|
37
|
+
* })
|
27
38
|
*/
|
28
39
|
getStream(userId: string, request: Vital.SleepGetStreamRequest, requestOptions?: Sleep.RequestOptions): Promise<Vital.ClientSleepResponse>;
|
29
40
|
/**
|
30
41
|
* Get Daily sleep for user_id
|
31
42
|
* @throws {@link Vital.UnprocessableEntityError}
|
43
|
+
*
|
44
|
+
* @example
|
45
|
+
* await vital.sleep.getRaw("user-id", {
|
46
|
+
* startDate: "start-date"
|
47
|
+
* })
|
32
48
|
*/
|
33
49
|
getRaw(userId: string, request: Vital.SleepGetRawRequest, requestOptions?: Sleep.RequestOptions): Promise<Vital.RawSleep>;
|
34
50
|
/**
|
35
51
|
* Get Sleep stream for a user_id
|
36
52
|
* @throws {@link Vital.UnprocessableEntityError}
|
53
|
+
*
|
54
|
+
* @example
|
55
|
+
* await vital.sleep.getStreamBySleepId("sleep-id")
|
37
56
|
*/
|
38
57
|
getStreamBySleepId(sleepId: string, requestOptions?: Sleep.RequestOptions): Promise<Vital.ClientFacingSleepStream>;
|
39
58
|
}
|
@@ -42,7 +42,6 @@ exports.Sleep = void 0;
|
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
43
43
|
const core = __importStar(require("../../../../core"));
|
44
44
|
const Vital = __importStar(require("../../.."));
|
45
|
-
const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
|
46
45
|
const url_join_1 = __importDefault(require("url-join"));
|
47
46
|
const serializers = __importStar(require("../../../../serialization"));
|
48
47
|
const errors = __importStar(require("../../../../errors"));
|
@@ -53,18 +52,23 @@ class Sleep {
|
|
53
52
|
/**
|
54
53
|
* Get Daily sleep for user_id
|
55
54
|
* @throws {@link Vital.UnprocessableEntityError}
|
55
|
+
*
|
56
|
+
* @example
|
57
|
+
* await vital.sleep.get("user-id", {
|
58
|
+
* startDate: "start-date"
|
59
|
+
* })
|
56
60
|
*/
|
57
61
|
get(userId, request, requestOptions) {
|
58
62
|
var _a;
|
59
63
|
return __awaiter(this, void 0, void 0, function* () {
|
60
64
|
const { provider, startDate, endDate } = request;
|
61
|
-
const _queryParams =
|
65
|
+
const _queryParams = {};
|
62
66
|
if (provider != null) {
|
63
|
-
_queryParams
|
67
|
+
_queryParams["provider"] = provider;
|
64
68
|
}
|
65
|
-
_queryParams
|
69
|
+
_queryParams["start_date"] = startDate;
|
66
70
|
if (endDate != null) {
|
67
|
-
_queryParams
|
71
|
+
_queryParams["end_date"] = endDate;
|
68
72
|
}
|
69
73
|
const _response = yield core.fetcher({
|
70
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}`),
|
@@ -73,11 +77,12 @@ class Sleep {
|
|
73
77
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
74
78
|
"X-Fern-Language": "JavaScript",
|
75
79
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
76
|
-
"X-Fern-SDK-Version": "3.0.
|
80
|
+
"X-Fern-SDK-Version": "3.0.9",
|
77
81
|
},
|
78
82
|
contentType: "application/json",
|
79
83
|
queryParameters: _queryParams,
|
80
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
85
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
81
86
|
});
|
82
87
|
if (_response.ok) {
|
83
88
|
return yield serializers.ClientSleepResponse.parseOrThrow(_response.body, {
|
@@ -121,18 +126,23 @@ class Sleep {
|
|
121
126
|
/**
|
122
127
|
* Get Daily sleep stream for user_id
|
123
128
|
* @throws {@link Vital.UnprocessableEntityError}
|
129
|
+
*
|
130
|
+
* @example
|
131
|
+
* await vital.sleep.getStream("user-id", {
|
132
|
+
* startDate: "start-date"
|
133
|
+
* })
|
124
134
|
*/
|
125
135
|
getStream(userId, request, requestOptions) {
|
126
136
|
var _a;
|
127
137
|
return __awaiter(this, void 0, void 0, function* () {
|
128
138
|
const { provider, startDate, endDate } = request;
|
129
|
-
const _queryParams =
|
139
|
+
const _queryParams = {};
|
130
140
|
if (provider != null) {
|
131
|
-
_queryParams
|
141
|
+
_queryParams["provider"] = provider;
|
132
142
|
}
|
133
|
-
_queryParams
|
143
|
+
_queryParams["start_date"] = startDate;
|
134
144
|
if (endDate != null) {
|
135
|
-
_queryParams
|
145
|
+
_queryParams["end_date"] = endDate;
|
136
146
|
}
|
137
147
|
const _response = yield core.fetcher({
|
138
148
|
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`),
|
@@ -141,11 +151,12 @@ class Sleep {
|
|
141
151
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
142
152
|
"X-Fern-Language": "JavaScript",
|
143
153
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
144
|
-
"X-Fern-SDK-Version": "3.0.
|
154
|
+
"X-Fern-SDK-Version": "3.0.9",
|
145
155
|
},
|
146
156
|
contentType: "application/json",
|
147
157
|
queryParameters: _queryParams,
|
148
158
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
159
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
149
160
|
});
|
150
161
|
if (_response.ok) {
|
151
162
|
return yield serializers.ClientSleepResponse.parseOrThrow(_response.body, {
|
@@ -189,18 +200,23 @@ class Sleep {
|
|
189
200
|
/**
|
190
201
|
* Get Daily sleep for user_id
|
191
202
|
* @throws {@link Vital.UnprocessableEntityError}
|
203
|
+
*
|
204
|
+
* @example
|
205
|
+
* await vital.sleep.getRaw("user-id", {
|
206
|
+
* startDate: "start-date"
|
207
|
+
* })
|
192
208
|
*/
|
193
209
|
getRaw(userId, request, requestOptions) {
|
194
210
|
var _a;
|
195
211
|
return __awaiter(this, void 0, void 0, function* () {
|
196
212
|
const { provider, startDate, endDate } = request;
|
197
|
-
const _queryParams =
|
213
|
+
const _queryParams = {};
|
198
214
|
if (provider != null) {
|
199
|
-
_queryParams
|
215
|
+
_queryParams["provider"] = provider;
|
200
216
|
}
|
201
|
-
_queryParams
|
217
|
+
_queryParams["start_date"] = startDate;
|
202
218
|
if (endDate != null) {
|
203
|
-
_queryParams
|
219
|
+
_queryParams["end_date"] = endDate;
|
204
220
|
}
|
205
221
|
const _response = yield core.fetcher({
|
206
222
|
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`),
|
@@ -209,11 +225,12 @@ class Sleep {
|
|
209
225
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
210
226
|
"X-Fern-Language": "JavaScript",
|
211
227
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
212
|
-
"X-Fern-SDK-Version": "3.0.
|
228
|
+
"X-Fern-SDK-Version": "3.0.9",
|
213
229
|
},
|
214
230
|
contentType: "application/json",
|
215
231
|
queryParameters: _queryParams,
|
216
232
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
233
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
217
234
|
});
|
218
235
|
if (_response.ok) {
|
219
236
|
return yield serializers.RawSleep.parseOrThrow(_response.body, {
|
@@ -257,6 +274,9 @@ class Sleep {
|
|
257
274
|
/**
|
258
275
|
* Get Sleep stream for a user_id
|
259
276
|
* @throws {@link Vital.UnprocessableEntityError}
|
277
|
+
*
|
278
|
+
* @example
|
279
|
+
* await vital.sleep.getStreamBySleepId("sleep-id")
|
260
280
|
*/
|
261
281
|
getStreamBySleepId(sleepId, requestOptions) {
|
262
282
|
var _a;
|
@@ -268,10 +288,11 @@ class Sleep {
|
|
268
288
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
269
289
|
"X-Fern-Language": "JavaScript",
|
270
290
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
271
|
-
"X-Fern-SDK-Version": "3.0.
|
291
|
+
"X-Fern-SDK-Version": "3.0.9",
|
272
292
|
},
|
273
293
|
contentType: "application/json",
|
274
294
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
295
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
275
296
|
});
|
276
297
|
if (_response.ok) {
|
277
298
|
return yield serializers.ClientFacingSleepStream.parseOrThrow(_response.body, {
|