@tryvital/vital-node 3.1.383 → 3.1.384
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 +21 -21
- package/Client.js +51 -51
- package/api/resources/activity/client/Client.js +2 -2
- package/api/resources/aggregate/client/Client.js +3 -3
- package/api/resources/body/client/Client.js +2 -2
- package/api/resources/devices/client/Client.js +1 -1
- package/api/resources/electrocardiogram/client/Client.js +1 -1
- package/api/resources/index.d.ts +12 -12
- package/api/resources/index.js +13 -13
- package/api/resources/insurance/client/Client.js +3 -3
- package/api/resources/introspect/client/Client.js +2 -2
- package/api/resources/labTests/client/Client.js +41 -41
- package/api/resources/link/client/Client.js +19 -19
- package/api/resources/meal/client/Client.js +1 -1
- package/api/resources/menstrualCycle/client/Client.js +1 -1
- package/api/resources/order/client/Client.js +1 -1
- package/api/resources/payor/client/Client.js +1 -1
- package/api/resources/profile/client/Client.js +2 -2
- package/api/resources/providers/client/Client.js +1 -1
- package/api/resources/sleep/client/Client.d.ts +12 -12
- package/api/resources/sleep/client/Client.js +34 -34
- package/api/resources/sleepCycle/client/Client.js +1 -1
- package/api/resources/team/client/Client.js +7 -7
- package/api/resources/testkit/client/Client.js +2 -2
- package/api/resources/user/client/Client.js +18 -18
- package/api/resources/vitals/client/Client.js +78 -78
- package/api/resources/workouts/client/Client.d.ts +10 -10
- package/api/resources/workouts/client/Client.js +34 -34
- package/dist/Client.d.ts +21 -21
- package/dist/Client.js +51 -51
- package/dist/api/resources/activity/client/Client.js +2 -2
- package/dist/api/resources/aggregate/client/Client.js +3 -3
- package/dist/api/resources/body/client/Client.js +2 -2
- package/dist/api/resources/devices/client/Client.js +1 -1
- package/dist/api/resources/electrocardiogram/client/Client.js +1 -1
- package/dist/api/resources/index.d.ts +12 -12
- package/dist/api/resources/index.js +13 -13
- package/dist/api/resources/insurance/client/Client.js +3 -3
- package/dist/api/resources/introspect/client/Client.js +2 -2
- package/dist/api/resources/labTests/client/Client.js +41 -41
- package/dist/api/resources/link/client/Client.js +19 -19
- package/dist/api/resources/meal/client/Client.js +1 -1
- package/dist/api/resources/menstrualCycle/client/Client.js +1 -1
- package/dist/api/resources/order/client/Client.js +1 -1
- package/dist/api/resources/payor/client/Client.js +1 -1
- package/dist/api/resources/profile/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.js +1 -1
- package/dist/api/resources/sleep/client/Client.d.ts +12 -12
- package/dist/api/resources/sleep/client/Client.js +34 -34
- package/dist/api/resources/sleepCycle/client/Client.js +1 -1
- package/dist/api/resources/team/client/Client.js +7 -7
- package/dist/api/resources/testkit/client/Client.js +2 -2
- package/dist/api/resources/user/client/Client.js +18 -18
- package/dist/api/resources/vitals/client/Client.js +78 -78
- package/dist/api/resources/workouts/client/Client.d.ts +10 -10
- package/dist/api/resources/workouts/client/Client.js +34 -34
- package/dist/serialization/resources/index.d.ts +2 -2
- package/dist/serialization/resources/index.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +1647 -1647
- package/serialization/resources/index.d.ts +2 -2
- package/serialization/resources/index.js +3 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -21,6 +21,16 @@ export declare namespace Workouts {
|
|
|
21
21
|
export declare class Workouts {
|
|
22
22
|
protected readonly _options: Workouts.Options;
|
|
23
23
|
constructor(_options?: Workouts.Options);
|
|
24
|
+
/**
|
|
25
|
+
* @param {string} workoutId - The Vital ID for the workout
|
|
26
|
+
* @param {Workouts.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.workouts.getByWorkoutId("workout_id")
|
|
32
|
+
*/
|
|
33
|
+
getByWorkoutId(workoutId: string, requestOptions?: Workouts.RequestOptions): Promise<Vital.ClientFacingStream>;
|
|
24
34
|
/**
|
|
25
35
|
* Get workout summary for user_id
|
|
26
36
|
*
|
|
@@ -51,16 +61,6 @@ export declare class Workouts {
|
|
|
51
61
|
* })
|
|
52
62
|
*/
|
|
53
63
|
getRaw(userId: string, request: Vital.WorkoutsGetRawRequest, requestOptions?: Workouts.RequestOptions): Promise<Vital.RawWorkout>;
|
|
54
|
-
/**
|
|
55
|
-
* @param {string} workoutId - The Vital ID for the workout
|
|
56
|
-
* @param {Workouts.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
-
*
|
|
58
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* await client.workouts.getByWorkoutId("workout_id")
|
|
62
|
-
*/
|
|
63
|
-
getByWorkoutId(workoutId: string, requestOptions?: Workouts.RequestOptions): Promise<Vital.ClientFacingStream>;
|
|
64
64
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
65
65
|
"x-vital-api-key": string | undefined;
|
|
66
66
|
}>;
|
|
@@ -50,44 +50,29 @@ class Workouts {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @param {string} userId
|
|
56
|
-
* @param {Vital.WorkoutsGetRequest} request
|
|
53
|
+
* @param {string} workoutId - The Vital ID for the workout
|
|
57
54
|
* @param {Workouts.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
55
|
*
|
|
59
56
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
60
57
|
*
|
|
61
58
|
* @example
|
|
62
|
-
* await client.workouts.
|
|
63
|
-
* startDate: "start_date"
|
|
64
|
-
* })
|
|
59
|
+
* await client.workouts.getByWorkoutId("workout_id")
|
|
65
60
|
*/
|
|
66
|
-
|
|
61
|
+
getByWorkoutId(workoutId, requestOptions) {
|
|
67
62
|
var _a;
|
|
68
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
const { provider, startDate, endDate } = request;
|
|
70
|
-
const _queryParams = {};
|
|
71
|
-
if (provider != null) {
|
|
72
|
-
_queryParams["provider"] = provider;
|
|
73
|
-
}
|
|
74
|
-
_queryParams["start_date"] = startDate;
|
|
75
|
-
if (endDate != null) {
|
|
76
|
-
_queryParams["end_date"] = endDate;
|
|
77
|
-
}
|
|
78
64
|
const _response = yield core.fetcher({
|
|
79
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/
|
|
65
|
+
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/${encodeURIComponent(workoutId)}/stream`),
|
|
80
66
|
method: "GET",
|
|
81
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
67
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.384", "User-Agent": "@tryvital/vital-node/3.1.384", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
82
68
|
contentType: "application/json",
|
|
83
|
-
queryParameters: _queryParams,
|
|
84
69
|
requestType: "json",
|
|
85
70
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
86
71
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
87
72
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
73
|
});
|
|
89
74
|
if (_response.ok) {
|
|
90
|
-
return serializers.
|
|
75
|
+
return serializers.ClientFacingStream.parseOrThrow(_response.body, {
|
|
91
76
|
unrecognizedObjectKeys: "passthrough",
|
|
92
77
|
allowUnrecognizedUnionMembers: true,
|
|
93
78
|
allowUnrecognizedEnumValues: true,
|
|
@@ -126,20 +111,20 @@ class Workouts {
|
|
|
126
111
|
});
|
|
127
112
|
}
|
|
128
113
|
/**
|
|
129
|
-
* Get
|
|
114
|
+
* Get workout summary for user_id
|
|
130
115
|
*
|
|
131
116
|
* @param {string} userId
|
|
132
|
-
* @param {Vital.
|
|
117
|
+
* @param {Vital.WorkoutsGetRequest} request
|
|
133
118
|
* @param {Workouts.RequestOptions} requestOptions - Request-specific configuration.
|
|
134
119
|
*
|
|
135
120
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
136
121
|
*
|
|
137
122
|
* @example
|
|
138
|
-
* await client.workouts.
|
|
123
|
+
* await client.workouts.get("user_id", {
|
|
139
124
|
* startDate: "start_date"
|
|
140
125
|
* })
|
|
141
126
|
*/
|
|
142
|
-
|
|
127
|
+
get(userId, request, requestOptions) {
|
|
143
128
|
var _a;
|
|
144
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
130
|
const { provider, startDate, endDate } = request;
|
|
@@ -152,9 +137,9 @@ class Workouts {
|
|
|
152
137
|
_queryParams["end_date"] = endDate;
|
|
153
138
|
}
|
|
154
139
|
const _response = yield core.fetcher({
|
|
155
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/workouts/${encodeURIComponent(userId)}
|
|
140
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/workouts/${encodeURIComponent(userId)}`),
|
|
156
141
|
method: "GET",
|
|
157
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
142
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.384", "User-Agent": "@tryvital/vital-node/3.1.384", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
158
143
|
contentType: "application/json",
|
|
159
144
|
queryParameters: _queryParams,
|
|
160
145
|
requestType: "json",
|
|
@@ -163,7 +148,7 @@ class Workouts {
|
|
|
163
148
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
164
149
|
});
|
|
165
150
|
if (_response.ok) {
|
|
166
|
-
return serializers.
|
|
151
|
+
return serializers.ClientWorkoutResponse.parseOrThrow(_response.body, {
|
|
167
152
|
unrecognizedObjectKeys: "passthrough",
|
|
168
153
|
allowUnrecognizedUnionMembers: true,
|
|
169
154
|
allowUnrecognizedEnumValues: true,
|
|
@@ -202,29 +187,44 @@ class Workouts {
|
|
|
202
187
|
});
|
|
203
188
|
}
|
|
204
189
|
/**
|
|
205
|
-
*
|
|
190
|
+
* Get raw workout summary for user_id
|
|
191
|
+
*
|
|
192
|
+
* @param {string} userId
|
|
193
|
+
* @param {Vital.WorkoutsGetRawRequest} request
|
|
206
194
|
* @param {Workouts.RequestOptions} requestOptions - Request-specific configuration.
|
|
207
195
|
*
|
|
208
196
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
209
197
|
*
|
|
210
198
|
* @example
|
|
211
|
-
* await client.workouts.
|
|
199
|
+
* await client.workouts.getRaw("user_id", {
|
|
200
|
+
* startDate: "start_date"
|
|
201
|
+
* })
|
|
212
202
|
*/
|
|
213
|
-
|
|
203
|
+
getRaw(userId, request, requestOptions) {
|
|
214
204
|
var _a;
|
|
215
205
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
const { provider, startDate, endDate } = request;
|
|
207
|
+
const _queryParams = {};
|
|
208
|
+
if (provider != null) {
|
|
209
|
+
_queryParams["provider"] = provider;
|
|
210
|
+
}
|
|
211
|
+
_queryParams["start_date"] = startDate;
|
|
212
|
+
if (endDate != null) {
|
|
213
|
+
_queryParams["end_date"] = endDate;
|
|
214
|
+
}
|
|
216
215
|
const _response = yield core.fetcher({
|
|
217
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/
|
|
216
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/summary/workouts/${encodeURIComponent(userId)}/raw`),
|
|
218
217
|
method: "GET",
|
|
219
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
218
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.384", "User-Agent": "@tryvital/vital-node/3.1.384", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
220
219
|
contentType: "application/json",
|
|
220
|
+
queryParameters: _queryParams,
|
|
221
221
|
requestType: "json",
|
|
222
222
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
223
223
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
224
224
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
225
225
|
});
|
|
226
226
|
if (_response.ok) {
|
|
227
|
-
return serializers.
|
|
227
|
+
return serializers.RawWorkout.parseOrThrow(_response.body, {
|
|
228
228
|
unrecognizedObjectKeys: "passthrough",
|
|
229
229
|
allowUnrecognizedUnionMembers: true,
|
|
230
230
|
allowUnrecognizedEnumValues: true,
|
|
@@ -5,12 +5,12 @@ export * from "./labTests/types";
|
|
|
5
5
|
export * as aggregate from "./aggregate";
|
|
6
6
|
export * from "./aggregate/types";
|
|
7
7
|
export * as user from "./user";
|
|
8
|
-
export * as providers from "./providers";
|
|
9
8
|
export * as vitals from "./vitals";
|
|
9
|
+
export * as providers from "./providers";
|
|
10
10
|
export * as team from "./team";
|
|
11
11
|
export * as insurance from "./insurance";
|
|
12
|
-
export * from "./link/client/requests";
|
|
13
12
|
export * from "./user/client/requests";
|
|
13
|
+
export * from "./link/client/requests";
|
|
14
14
|
export * from "./labTests/client/requests";
|
|
15
15
|
export * as testkit from "./testkit";
|
|
16
16
|
export * from "./testkit/client/requests";
|
|
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.payor = exports.order = exports.testkit = exports.insurance = exports.team = exports.
|
|
29
|
+
exports.payor = exports.order = exports.testkit = exports.insurance = exports.team = exports.providers = exports.vitals = exports.user = exports.aggregate = exports.labTests = exports.link = void 0;
|
|
30
30
|
exports.link = __importStar(require("./link"));
|
|
31
31
|
__exportStar(require("./link/types"), exports);
|
|
32
32
|
exports.labTests = __importStar(require("./labTests"));
|
|
@@ -34,12 +34,12 @@ __exportStar(require("./labTests/types"), exports);
|
|
|
34
34
|
exports.aggregate = __importStar(require("./aggregate"));
|
|
35
35
|
__exportStar(require("./aggregate/types"), exports);
|
|
36
36
|
exports.user = __importStar(require("./user"));
|
|
37
|
-
exports.providers = __importStar(require("./providers"));
|
|
38
37
|
exports.vitals = __importStar(require("./vitals"));
|
|
38
|
+
exports.providers = __importStar(require("./providers"));
|
|
39
39
|
exports.team = __importStar(require("./team"));
|
|
40
40
|
exports.insurance = __importStar(require("./insurance"));
|
|
41
|
-
__exportStar(require("./link/client/requests"), exports);
|
|
42
41
|
__exportStar(require("./user/client/requests"), exports);
|
|
42
|
+
__exportStar(require("./link/client/requests"), exports);
|
|
43
43
|
__exportStar(require("./labTests/client/requests"), exports);
|
|
44
44
|
exports.testkit = __importStar(require("./testkit"));
|
|
45
45
|
__exportStar(require("./testkit/client/requests"), exports);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.1.
|
|
1
|
+
export declare const SDK_VERSION = "3.1.384";
|
package/dist/version.js
CHANGED