@tryvital/vital-node 3.0.0-beta.0 → 3.0.1
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 +0 -3
- package/Client.js +14 -19
- package/README.md +91 -0
- 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/index.d.ts +0 -1
- package/api/resources/index.js +1 -2
- package/api/resources/insurance/client/Client.js +2 -2
- package/api/resources/labTests/client/Client.d.ts +10 -1
- package/api/resources/labTests/client/Client.js +136 -21
- package/api/resources/link/client/Client.d.ts +1 -1
- package/api/resources/link/client/Client.js +16 -16
- package/api/resources/meal/client/Client.js +1 -1
- package/api/resources/profile/client/Client.js +2 -2
- package/api/resources/providers/client/Client.d.ts +1 -1
- package/api/resources/providers/client/Client.js +3 -3
- package/api/resources/sleep/client/Client.d.ts +5 -0
- package/api/resources/sleep/client/Client.js +61 -3
- package/api/resources/team/client/Client.d.ts +6 -6
- package/api/resources/team/client/Client.js +13 -13
- package/api/resources/team/client/requests/{GetSourcePrioritiesV2TeamSourcePrioritiesGetRequest.d.ts → TeamGetSourcePrioritiesRequest.d.ts} +1 -1
- package/{dist/api/resources/team/client/requests/SearchTeamUsersByUuidOrClientUserIdV2TeamUsersSearchGetRequest.d.ts → api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts} +1 -1
- package/{dist/api/resources/team/client/requests/UpdateSourcePrioritiesV2TeamSourcePrioritiesPatchRequest.d.ts → api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts} +1 -1
- package/api/resources/team/client/requests/index.d.ts +3 -3
- package/api/resources/testkit/client/Client.js +2 -2
- package/api/resources/user/client/Client.js +11 -11
- package/api/resources/vitals/client/Client.d.ts +5 -0
- package/api/resources/vitals/client/Client.js +90 -22
- package/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +17 -0
- package/api/resources/vitals/client/requests/index.d.ts +1 -0
- package/api/resources/workouts/client/Client.d.ts +4 -0
- package/api/resources/workouts/client/Client.js +59 -2
- package/api/types/BiomarkerResult.d.ts +2 -0
- package/api/types/ClientFacingElectrocardiogramVoltageTimeseries.d.ts +17 -0
- package/api/types/ClientFacingLoinc.d.ts +10 -0
- package/api/types/ClientFacingMarkerComplete.d.ts +16 -0
- package/api/types/ClientFacingMarkerComplete.js +5 -0
- package/api/types/ClientFacingResult.d.ts +12 -0
- package/api/types/ClientFacingResult.js +5 -0
- package/api/types/ClientFacingSleep.d.ts +1 -1
- package/api/types/GetMarkersResponse.d.ts +1 -1
- package/api/types/Region.d.ts +2 -1
- package/api/types/Region.js +1 -0
- package/api/types/index.d.ts +4 -0
- package/api/types/index.js +4 -0
- package/dist/Client.d.ts +0 -3
- package/dist/Client.js +14 -19
- 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/index.d.ts +0 -1
- package/dist/api/resources/index.js +1 -2
- package/dist/api/resources/insurance/client/Client.js +2 -2
- package/dist/api/resources/labTests/client/Client.d.ts +10 -1
- package/dist/api/resources/labTests/client/Client.js +136 -21
- package/dist/api/resources/link/client/Client.d.ts +1 -1
- package/dist/api/resources/link/client/Client.js +16 -16
- package/dist/api/resources/meal/client/Client.js +1 -1
- package/dist/api/resources/profile/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.d.ts +1 -1
- package/dist/api/resources/providers/client/Client.js +3 -3
- package/dist/api/resources/sleep/client/Client.d.ts +5 -0
- package/dist/api/resources/sleep/client/Client.js +61 -3
- package/dist/api/resources/team/client/Client.d.ts +6 -6
- package/dist/api/resources/team/client/Client.js +13 -13
- package/dist/api/resources/team/client/requests/{GetSourcePrioritiesV2TeamSourcePrioritiesGetRequest.d.ts → TeamGetSourcePrioritiesRequest.d.ts} +1 -1
- package/dist/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.js +5 -0
- package/{api/resources/team/client/requests/SearchTeamUsersByUuidOrClientUserIdV2TeamUsersSearchGetRequest.d.ts → dist/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts} +1 -1
- package/dist/api/resources/team/client/requests/TeamGetUserByIdRequest.js +5 -0
- package/{api/resources/team/client/requests/UpdateSourcePrioritiesV2TeamSourcePrioritiesPatchRequest.d.ts → dist/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts} +1 -1
- package/dist/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.js +5 -0
- package/dist/api/resources/team/client/requests/index.d.ts +3 -3
- package/dist/api/resources/testkit/client/Client.js +2 -2
- package/dist/api/resources/user/client/Client.js +11 -11
- package/dist/api/resources/vitals/client/Client.d.ts +5 -0
- package/dist/api/resources/vitals/client/Client.js +90 -22
- package/dist/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +17 -0
- package/dist/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.js +5 -0
- package/dist/api/resources/vitals/client/requests/index.d.ts +1 -0
- package/dist/api/resources/workouts/client/Client.d.ts +4 -0
- package/dist/api/resources/workouts/client/Client.js +59 -2
- package/dist/api/types/BiomarkerResult.d.ts +2 -0
- package/dist/api/types/ClientFacingElectrocardiogramVoltageTimeseries.d.ts +17 -0
- package/dist/api/types/ClientFacingElectrocardiogramVoltageTimeseries.js +5 -0
- package/dist/api/types/ClientFacingLoinc.d.ts +10 -0
- package/dist/api/types/ClientFacingLoinc.js +5 -0
- package/dist/api/types/ClientFacingMarkerComplete.d.ts +16 -0
- package/dist/api/types/ClientFacingMarkerComplete.js +5 -0
- package/dist/api/types/ClientFacingResult.d.ts +12 -0
- package/dist/api/types/ClientFacingResult.js +5 -0
- package/dist/api/types/ClientFacingSleep.d.ts +1 -1
- package/dist/api/types/GetMarkersResponse.d.ts +1 -1
- package/dist/api/types/Region.d.ts +2 -1
- package/dist/api/types/Region.js +1 -0
- package/dist/api/types/index.d.ts +4 -0
- package/dist/api/types/index.js +4 -0
- package/dist/serialization/resources/labTests/client/getMarkersForLabTest.d.ts +10 -0
- package/dist/serialization/resources/labTests/client/getMarkersForLabTest.js +40 -0
- package/dist/serialization/resources/labTests/client/index.d.ts +1 -0
- package/dist/serialization/resources/labTests/client/index.js +2 -1
- package/dist/serialization/resources/link/client/{getProviders.d.ts → getAllProviders.d.ts} +1 -1
- package/dist/serialization/resources/link/client/index.d.ts +1 -1
- package/dist/serialization/resources/link/client/index.js +2 -2
- package/{serialization/resources/providers/client/getListOfProviders.d.ts → dist/serialization/resources/providers/client/getAll.d.ts} +1 -1
- package/dist/serialization/resources/providers/client/index.d.ts +1 -1
- package/dist/serialization/resources/providers/client/index.js +2 -2
- package/{serialization/resources/team/client/getTeamConfig.d.ts → dist/serialization/resources/team/client/getLinkConfig.d.ts} +1 -1
- package/dist/serialization/resources/team/client/{getTeamConfig.d.ts → getSvixUrl.d.ts} +1 -1
- package/{serialization/resources/team/client/searchTeamUsersByUuidOrClientUserId.d.ts → dist/serialization/resources/team/client/getUserById.d.ts} +1 -1
- package/dist/serialization/resources/team/client/index.d.ts +3 -3
- package/dist/serialization/resources/team/client/index.js +4 -4
- package/dist/serialization/resources/vitals/client/electrocardiogramVoltage.d.ts +10 -0
- package/dist/serialization/resources/vitals/client/electrocardiogramVoltage.js +40 -0
- package/dist/serialization/resources/vitals/client/index.d.ts +1 -0
- package/dist/serialization/resources/vitals/client/index.js +2 -1
- package/dist/serialization/types/BiomarkerResult.d.ts +2 -0
- package/dist/serialization/types/BiomarkerResult.js +2 -0
- package/dist/serialization/types/ClientFacingElectrocardiogramVoltageTimeseries.d.ts +17 -0
- package/dist/serialization/types/ClientFacingElectrocardiogramVoltageTimeseries.js +38 -0
- package/dist/serialization/types/ClientFacingLoinc.d.ts +16 -0
- package/dist/serialization/types/ClientFacingLoinc.js +37 -0
- package/dist/serialization/types/ClientFacingMarkerComplete.d.ts +21 -0
- package/dist/serialization/types/ClientFacingMarkerComplete.js +51 -0
- package/dist/serialization/types/ClientFacingResult.d.ts +17 -0
- package/dist/serialization/types/ClientFacingResult.js +47 -0
- package/dist/serialization/types/GetMarkersResponse.d.ts +1 -1
- package/dist/serialization/types/GetMarkersResponse.js +1 -1
- package/dist/serialization/types/Region.d.ts +1 -1
- package/dist/serialization/types/Region.js +1 -0
- package/dist/serialization/types/index.d.ts +4 -0
- package/dist/serialization/types/index.js +4 -0
- package/package.json +1 -1
- package/serialization/resources/labTests/client/getMarkersForLabTest.d.ts +10 -0
- package/serialization/resources/labTests/client/getMarkersForLabTest.js +40 -0
- package/serialization/resources/labTests/client/index.d.ts +1 -0
- package/serialization/resources/labTests/client/index.js +2 -1
- package/serialization/resources/link/client/{getProviders.d.ts → getAllProviders.d.ts} +1 -1
- package/serialization/resources/link/client/index.d.ts +1 -1
- package/serialization/resources/link/client/index.js +2 -2
- package/{dist/serialization/resources/providers/client/getListOfProviders.d.ts → serialization/resources/providers/client/getAll.d.ts} +1 -1
- package/serialization/resources/providers/client/index.d.ts +1 -1
- package/serialization/resources/providers/client/index.js +2 -2
- package/serialization/resources/team/client/{getSvixWebhookUrl.d.ts → getLinkConfig.d.ts} +1 -1
- package/{dist/serialization/resources/team/client/getSvixWebhookUrl.d.ts → serialization/resources/team/client/getSvixUrl.d.ts} +1 -1
- package/{dist/serialization/resources/team/client/searchTeamUsersByUuidOrClientUserId.d.ts → serialization/resources/team/client/getUserById.d.ts} +1 -1
- package/serialization/resources/team/client/index.d.ts +3 -3
- package/serialization/resources/team/client/index.js +4 -4
- package/serialization/resources/vitals/client/electrocardiogramVoltage.d.ts +10 -0
- package/serialization/resources/vitals/client/electrocardiogramVoltage.js +40 -0
- package/serialization/resources/vitals/client/index.d.ts +1 -0
- package/serialization/resources/vitals/client/index.js +2 -1
- package/serialization/types/BiomarkerResult.d.ts +2 -0
- package/serialization/types/BiomarkerResult.js +2 -0
- package/serialization/types/ClientFacingElectrocardiogramVoltageTimeseries.d.ts +17 -0
- package/serialization/types/ClientFacingElectrocardiogramVoltageTimeseries.js +38 -0
- package/serialization/types/ClientFacingLoinc.d.ts +16 -0
- package/serialization/types/ClientFacingLoinc.js +37 -0
- package/serialization/types/ClientFacingMarkerComplete.d.ts +21 -0
- package/serialization/types/ClientFacingMarkerComplete.js +51 -0
- package/serialization/types/ClientFacingResult.d.ts +17 -0
- package/serialization/types/ClientFacingResult.js +47 -0
- package/serialization/types/GetMarkersResponse.d.ts +1 -1
- package/serialization/types/GetMarkersResponse.js +1 -1
- package/serialization/types/Region.d.ts +1 -1
- package/serialization/types/Region.js +1 -0
- package/serialization/types/index.d.ts +4 -0
- package/serialization/types/index.js +4 -0
- package/api/resources/timeseries/client/Client.d.ts +0 -28
- package/api/resources/timeseries/client/Client.js +0 -168
- package/api/resources/timeseries/client/index.d.ts +0 -1
- package/api/resources/timeseries/client/index.js +0 -2
- package/api/resources/timeseries/index.d.ts +0 -1
- package/api/resources/timeseries/index.js +0 -17
- package/dist/api/resources/timeseries/client/Client.d.ts +0 -28
- package/dist/api/resources/timeseries/client/Client.js +0 -168
- package/dist/api/resources/timeseries/client/index.d.ts +0 -1
- package/dist/api/resources/timeseries/client/index.js +0 -2
- package/dist/api/resources/timeseries/index.d.ts +0 -1
- package/dist/api/resources/timeseries/index.js +0 -17
- /package/api/resources/team/client/requests/{GetSourcePrioritiesV2TeamSourcePrioritiesGetRequest.js → TeamGetSourcePrioritiesRequest.js} +0 -0
- /package/api/resources/team/client/requests/{SearchTeamUsersByUuidOrClientUserIdV2TeamUsersSearchGetRequest.js → TeamGetUserByIdRequest.js} +0 -0
- /package/api/resources/team/client/requests/{UpdateSourcePrioritiesV2TeamSourcePrioritiesPatchRequest.js → TeamUpdateSourcePrioritiesRequest.js} +0 -0
- /package/{dist/api/resources/team/client/requests/GetSourcePrioritiesV2TeamSourcePrioritiesGetRequest.js → api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.js} +0 -0
- /package/{dist/api/resources/team/client/requests/SearchTeamUsersByUuidOrClientUserIdV2TeamUsersSearchGetRequest.js → api/types/ClientFacingElectrocardiogramVoltageTimeseries.js} +0 -0
- /package/{dist/api/resources/team/client/requests/UpdateSourcePrioritiesV2TeamSourcePrioritiesPatchRequest.js → api/types/ClientFacingLoinc.js} +0 -0
- /package/dist/serialization/resources/link/client/{getProviders.js → getAllProviders.js} +0 -0
- /package/dist/serialization/resources/providers/client/{getListOfProviders.js → getAll.js} +0 -0
- /package/dist/serialization/resources/team/client/{getSvixWebhookUrl.js → getLinkConfig.js} +0 -0
- /package/dist/serialization/resources/team/client/{getTeamConfig.js → getSvixUrl.js} +0 -0
- /package/dist/serialization/resources/team/client/{searchTeamUsersByUuidOrClientUserId.js → getUserById.js} +0 -0
- /package/serialization/resources/link/client/{getProviders.js → getAllProviders.js} +0 -0
- /package/serialization/resources/providers/client/{getListOfProviders.js → getAll.js} +0 -0
- /package/serialization/resources/team/client/{getSvixWebhookUrl.js → getLinkConfig.js} +0 -0
- /package/serialization/resources/team/client/{getTeamConfig.js → getSvixUrl.js} +0 -0
- /package/serialization/resources/team/client/{searchTeamUsersByUuidOrClientUserId.js → getUserById.js} +0 -0
@@ -1,168 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
4
|
-
*/
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
10
|
-
}
|
11
|
-
Object.defineProperty(o, k2, desc);
|
12
|
-
}) : (function(o, m, k, k2) {
|
13
|
-
if (k2 === undefined) k2 = k;
|
14
|
-
o[k2] = m[k];
|
15
|
-
}));
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
18
|
-
}) : function(o, v) {
|
19
|
-
o["default"] = v;
|
20
|
-
});
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
22
|
-
if (mod && mod.__esModule) return mod;
|
23
|
-
var result = {};
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
25
|
-
__setModuleDefault(result, mod);
|
26
|
-
return result;
|
27
|
-
};
|
28
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
35
|
-
});
|
36
|
-
};
|
37
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
38
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
39
|
-
};
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
41
|
-
exports.Timeseries = void 0;
|
42
|
-
const environments = __importStar(require("../../../../environments"));
|
43
|
-
const core = __importStar(require("../../../../core"));
|
44
|
-
const Vital = __importStar(require("../../.."));
|
45
|
-
const url_join_1 = __importDefault(require("url-join"));
|
46
|
-
const serializers = __importStar(require("../../../../serialization"));
|
47
|
-
const errors = __importStar(require("../../../../errors"));
|
48
|
-
class Timeseries {
|
49
|
-
constructor(_options) {
|
50
|
-
this._options = _options;
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Get Sleep stream for a user_id
|
54
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
55
|
-
*/
|
56
|
-
getUserSleepStream(sleepId, requestOptions) {
|
57
|
-
var _a;
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
59
|
-
const _response = yield core.fetcher({
|
60
|
-
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`),
|
61
|
-
method: "GET",
|
62
|
-
headers: {
|
63
|
-
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
64
|
-
"X-Fern-Language": "JavaScript",
|
65
|
-
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
66
|
-
"X-Fern-SDK-Version": "3.0.0-beta.0",
|
67
|
-
},
|
68
|
-
contentType: "application/json",
|
69
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
70
|
-
});
|
71
|
-
if (_response.ok) {
|
72
|
-
return yield serializers.ClientFacingSleepStream.parseOrThrow(_response.body, {
|
73
|
-
unrecognizedObjectKeys: "passthrough",
|
74
|
-
allowUnrecognizedUnionMembers: true,
|
75
|
-
allowUnrecognizedEnumValues: true,
|
76
|
-
breadcrumbsPrefix: ["response"],
|
77
|
-
});
|
78
|
-
}
|
79
|
-
if (_response.error.reason === "status-code") {
|
80
|
-
switch (_response.error.statusCode) {
|
81
|
-
case 422:
|
82
|
-
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
83
|
-
unrecognizedObjectKeys: "passthrough",
|
84
|
-
allowUnrecognizedUnionMembers: true,
|
85
|
-
allowUnrecognizedEnumValues: true,
|
86
|
-
breadcrumbsPrefix: ["response"],
|
87
|
-
}));
|
88
|
-
default:
|
89
|
-
throw new errors.VitalError({
|
90
|
-
statusCode: _response.error.statusCode,
|
91
|
-
body: _response.error.body,
|
92
|
-
});
|
93
|
-
}
|
94
|
-
}
|
95
|
-
switch (_response.error.reason) {
|
96
|
-
case "non-json":
|
97
|
-
throw new errors.VitalError({
|
98
|
-
statusCode: _response.error.statusCode,
|
99
|
-
body: _response.error.rawBody,
|
100
|
-
});
|
101
|
-
case "timeout":
|
102
|
-
throw new errors.VitalTimeoutError();
|
103
|
-
case "unknown":
|
104
|
-
throw new errors.VitalError({
|
105
|
-
message: _response.error.errorMessage,
|
106
|
-
});
|
107
|
-
}
|
108
|
-
});
|
109
|
-
}
|
110
|
-
/**
|
111
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
112
|
-
*/
|
113
|
-
getUserWorkouts(workoutId, requestOptions) {
|
114
|
-
var _a;
|
115
|
-
return __awaiter(this, void 0, void 0, function* () {
|
116
|
-
const _response = yield core.fetcher({
|
117
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/timeseries/workouts/${workoutId}/stream`),
|
118
|
-
method: "GET",
|
119
|
-
headers: {
|
120
|
-
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
121
|
-
"X-Fern-Language": "JavaScript",
|
122
|
-
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
123
|
-
"X-Fern-SDK-Version": "3.0.0-beta.0",
|
124
|
-
},
|
125
|
-
contentType: "application/json",
|
126
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
127
|
-
});
|
128
|
-
if (_response.ok) {
|
129
|
-
return yield serializers.ClientFacingStream.parseOrThrow(_response.body, {
|
130
|
-
unrecognizedObjectKeys: "passthrough",
|
131
|
-
allowUnrecognizedUnionMembers: true,
|
132
|
-
allowUnrecognizedEnumValues: true,
|
133
|
-
breadcrumbsPrefix: ["response"],
|
134
|
-
});
|
135
|
-
}
|
136
|
-
if (_response.error.reason === "status-code") {
|
137
|
-
switch (_response.error.statusCode) {
|
138
|
-
case 422:
|
139
|
-
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
140
|
-
unrecognizedObjectKeys: "passthrough",
|
141
|
-
allowUnrecognizedUnionMembers: true,
|
142
|
-
allowUnrecognizedEnumValues: true,
|
143
|
-
breadcrumbsPrefix: ["response"],
|
144
|
-
}));
|
145
|
-
default:
|
146
|
-
throw new errors.VitalError({
|
147
|
-
statusCode: _response.error.statusCode,
|
148
|
-
body: _response.error.body,
|
149
|
-
});
|
150
|
-
}
|
151
|
-
}
|
152
|
-
switch (_response.error.reason) {
|
153
|
-
case "non-json":
|
154
|
-
throw new errors.VitalError({
|
155
|
-
statusCode: _response.error.statusCode,
|
156
|
-
body: _response.error.rawBody,
|
157
|
-
});
|
158
|
-
case "timeout":
|
159
|
-
throw new errors.VitalTimeoutError();
|
160
|
-
case "unknown":
|
161
|
-
throw new errors.VitalError({
|
162
|
-
message: _response.error.errorMessage,
|
163
|
-
});
|
164
|
-
}
|
165
|
-
});
|
166
|
-
}
|
167
|
-
}
|
168
|
-
exports.Timeseries = Timeseries;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./client";
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./client"), exports);
|
@@ -1,28 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as environments from "../../../../environments";
|
5
|
-
import * as core from "../../../../core";
|
6
|
-
import * as Vital from "../../..";
|
7
|
-
export declare namespace Timeseries {
|
8
|
-
interface Options {
|
9
|
-
environment?: core.Supplier<environments.VitalEnvironment | string>;
|
10
|
-
apiKey: core.Supplier<string>;
|
11
|
-
}
|
12
|
-
interface RequestOptions {
|
13
|
-
timeoutInSeconds?: number;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
export declare class Timeseries {
|
17
|
-
protected readonly _options: Timeseries.Options;
|
18
|
-
constructor(_options: Timeseries.Options);
|
19
|
-
/**
|
20
|
-
* Get Sleep stream for a user_id
|
21
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
22
|
-
*/
|
23
|
-
getUserSleepStream(sleepId: string, requestOptions?: Timeseries.RequestOptions): Promise<Vital.ClientFacingSleepStream>;
|
24
|
-
/**
|
25
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
26
|
-
*/
|
27
|
-
getUserWorkouts(workoutId: string, requestOptions?: Timeseries.RequestOptions): Promise<Vital.ClientFacingStream>;
|
28
|
-
}
|
@@ -1,168 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
4
|
-
*/
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
10
|
-
}
|
11
|
-
Object.defineProperty(o, k2, desc);
|
12
|
-
}) : (function(o, m, k, k2) {
|
13
|
-
if (k2 === undefined) k2 = k;
|
14
|
-
o[k2] = m[k];
|
15
|
-
}));
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
18
|
-
}) : function(o, v) {
|
19
|
-
o["default"] = v;
|
20
|
-
});
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
22
|
-
if (mod && mod.__esModule) return mod;
|
23
|
-
var result = {};
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
25
|
-
__setModuleDefault(result, mod);
|
26
|
-
return result;
|
27
|
-
};
|
28
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
35
|
-
});
|
36
|
-
};
|
37
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
38
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
39
|
-
};
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
41
|
-
exports.Timeseries = void 0;
|
42
|
-
const environments = __importStar(require("../../../../environments"));
|
43
|
-
const core = __importStar(require("../../../../core"));
|
44
|
-
const Vital = __importStar(require("../../.."));
|
45
|
-
const url_join_1 = __importDefault(require("url-join"));
|
46
|
-
const serializers = __importStar(require("../../../../serialization"));
|
47
|
-
const errors = __importStar(require("../../../../errors"));
|
48
|
-
class Timeseries {
|
49
|
-
constructor(_options) {
|
50
|
-
this._options = _options;
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Get Sleep stream for a user_id
|
54
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
55
|
-
*/
|
56
|
-
getUserSleepStream(sleepId, requestOptions) {
|
57
|
-
var _a;
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
59
|
-
const _response = yield core.fetcher({
|
60
|
-
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`),
|
61
|
-
method: "GET",
|
62
|
-
headers: {
|
63
|
-
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
64
|
-
"X-Fern-Language": "JavaScript",
|
65
|
-
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
66
|
-
"X-Fern-SDK-Version": "3.0.0-beta.0",
|
67
|
-
},
|
68
|
-
contentType: "application/json",
|
69
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
70
|
-
});
|
71
|
-
if (_response.ok) {
|
72
|
-
return yield serializers.ClientFacingSleepStream.parseOrThrow(_response.body, {
|
73
|
-
unrecognizedObjectKeys: "passthrough",
|
74
|
-
allowUnrecognizedUnionMembers: true,
|
75
|
-
allowUnrecognizedEnumValues: true,
|
76
|
-
breadcrumbsPrefix: ["response"],
|
77
|
-
});
|
78
|
-
}
|
79
|
-
if (_response.error.reason === "status-code") {
|
80
|
-
switch (_response.error.statusCode) {
|
81
|
-
case 422:
|
82
|
-
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
83
|
-
unrecognizedObjectKeys: "passthrough",
|
84
|
-
allowUnrecognizedUnionMembers: true,
|
85
|
-
allowUnrecognizedEnumValues: true,
|
86
|
-
breadcrumbsPrefix: ["response"],
|
87
|
-
}));
|
88
|
-
default:
|
89
|
-
throw new errors.VitalError({
|
90
|
-
statusCode: _response.error.statusCode,
|
91
|
-
body: _response.error.body,
|
92
|
-
});
|
93
|
-
}
|
94
|
-
}
|
95
|
-
switch (_response.error.reason) {
|
96
|
-
case "non-json":
|
97
|
-
throw new errors.VitalError({
|
98
|
-
statusCode: _response.error.statusCode,
|
99
|
-
body: _response.error.rawBody,
|
100
|
-
});
|
101
|
-
case "timeout":
|
102
|
-
throw new errors.VitalTimeoutError();
|
103
|
-
case "unknown":
|
104
|
-
throw new errors.VitalError({
|
105
|
-
message: _response.error.errorMessage,
|
106
|
-
});
|
107
|
-
}
|
108
|
-
});
|
109
|
-
}
|
110
|
-
/**
|
111
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
112
|
-
*/
|
113
|
-
getUserWorkouts(workoutId, requestOptions) {
|
114
|
-
var _a;
|
115
|
-
return __awaiter(this, void 0, void 0, function* () {
|
116
|
-
const _response = yield core.fetcher({
|
117
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/timeseries/workouts/${workoutId}/stream`),
|
118
|
-
method: "GET",
|
119
|
-
headers: {
|
120
|
-
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
121
|
-
"X-Fern-Language": "JavaScript",
|
122
|
-
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
123
|
-
"X-Fern-SDK-Version": "3.0.0-beta.0",
|
124
|
-
},
|
125
|
-
contentType: "application/json",
|
126
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
127
|
-
});
|
128
|
-
if (_response.ok) {
|
129
|
-
return yield serializers.ClientFacingStream.parseOrThrow(_response.body, {
|
130
|
-
unrecognizedObjectKeys: "passthrough",
|
131
|
-
allowUnrecognizedUnionMembers: true,
|
132
|
-
allowUnrecognizedEnumValues: true,
|
133
|
-
breadcrumbsPrefix: ["response"],
|
134
|
-
});
|
135
|
-
}
|
136
|
-
if (_response.error.reason === "status-code") {
|
137
|
-
switch (_response.error.statusCode) {
|
138
|
-
case 422:
|
139
|
-
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
140
|
-
unrecognizedObjectKeys: "passthrough",
|
141
|
-
allowUnrecognizedUnionMembers: true,
|
142
|
-
allowUnrecognizedEnumValues: true,
|
143
|
-
breadcrumbsPrefix: ["response"],
|
144
|
-
}));
|
145
|
-
default:
|
146
|
-
throw new errors.VitalError({
|
147
|
-
statusCode: _response.error.statusCode,
|
148
|
-
body: _response.error.body,
|
149
|
-
});
|
150
|
-
}
|
151
|
-
}
|
152
|
-
switch (_response.error.reason) {
|
153
|
-
case "non-json":
|
154
|
-
throw new errors.VitalError({
|
155
|
-
statusCode: _response.error.statusCode,
|
156
|
-
body: _response.error.rawBody,
|
157
|
-
});
|
158
|
-
case "timeout":
|
159
|
-
throw new errors.VitalTimeoutError();
|
160
|
-
case "unknown":
|
161
|
-
throw new errors.VitalError({
|
162
|
-
message: _response.error.errorMessage,
|
163
|
-
});
|
164
|
-
}
|
165
|
-
});
|
166
|
-
}
|
167
|
-
}
|
168
|
-
exports.Timeseries = Timeseries;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./client";
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./client"), exports);
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|