@tryvital/vital-node 0.3.8 → 1.0.2
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/Activity.ts +1 -1
- package/client/Body.ts +1 -1
- package/client/Profile.ts +25 -0
- package/client/Sleep.ts +2 -2
- package/client/Testkits.ts +11 -1
- package/client/Vitals.ts +45 -45
- package/client/Webhooks.ts +7 -58
- package/client/Workouts.ts +3 -3
- package/client/index.ts +1 -1
- package/client/models/activity.ts +7 -0
- package/client/models/body_model.ts +0 -18
- package/client/models/profile_model.ts +34 -0
- package/client/models/testkit_models.ts +9 -0
- package/dist/client/Activity.js +1 -1
- package/dist/client/Body.js +1 -1
- package/dist/client/Profile.d.ts +8 -0
- package/dist/client/{ProviderSpecific.js → Profile.js} +8 -12
- package/dist/client/Sleep.js +2 -2
- package/dist/client/Testkits.d.ts +1 -0
- package/dist/client/Testkits.js +16 -0
- package/dist/client/Vitals.d.ts +7 -6
- package/dist/client/Vitals.js +16 -41
- package/dist/client/Webhooks.d.ts +1 -7
- package/dist/client/Webhooks.js +4 -102
- package/dist/client/Workouts.d.ts +1 -1
- package/dist/client/Workouts.js +3 -3
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/models/activity.d.ts +6 -0
- package/dist/client/models/body_model.d.ts +0 -18
- package/dist/client/models/profile_model.d.ts +33 -0
- package/dist/{swagger_client/models/client-activity-response.js → client/models/profile_model.js} +0 -0
- package/dist/client/models/testkit_models.d.ts +9 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -11
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +0 -1
- package/index.ts +14 -14
- package/lib/config.ts +0 -1
- package/package.json +3 -2
- package/client/ProviderSpecific.ts +0 -31
- package/dist/client/ProviderSpecific.d.ts +0 -8
- package/dist/swagger_client/api.d.ts +0 -18
- package/dist/swagger_client/api.js +0 -32
- package/dist/swagger_client/apis/activity-api.d.ts +0 -86
- package/dist/swagger_client/apis/activity-api.js +0 -241
- package/dist/swagger_client/apis/body-api.d.ts +0 -86
- package/dist/swagger_client/apis/body-api.js +0 -241
- package/dist/swagger_client/apis/link-api.d.ts +0 -115
- package/dist/swagger_client/apis/link-api.js +0 -310
- package/dist/swagger_client/apis/provider-specific-api.d.ts +0 -90
- package/dist/swagger_client/apis/provider-specific-api.js +0 -250
- package/dist/swagger_client/apis/sleep-api.d.ts +0 -120
- package/dist/swagger_client/apis/sleep-api.js +0 -330
- package/dist/swagger_client/apis/user-api.d.ts +0 -243
- package/dist/swagger_client/apis/user-api.js +0 -657
- package/dist/swagger_client/apis/webhooks-api.d.ts +0 -138
- package/dist/swagger_client/apis/webhooks-api.js +0 -379
- package/dist/swagger_client/apis/workouts-api.d.ts +0 -120
- package/dist/swagger_client/apis/workouts-api.js +0 -330
- package/dist/swagger_client/base.d.ts +0 -55
- package/dist/swagger_client/base.js +0 -67
- package/dist/swagger_client/configuration.d.ts +0 -63
- package/dist/swagger_client/configuration.js +0 -16
- package/dist/swagger_client/index.d.ts +0 -13
- package/dist/swagger_client/index.js +0 -27
- package/dist/swagger_client/models/client-activity-response.d.ts +0 -24
- package/dist/swagger_client/models/client-body-response.d.ts +0 -24
- package/dist/swagger_client/models/client-body-response.js +0 -2
- package/dist/swagger_client/models/client-facing-activity.d.ts +0 -84
- package/dist/swagger_client/models/client-facing-activity.js +0 -2
- package/dist/swagger_client/models/client-facing-body.d.ts +0 -72
- package/dist/swagger_client/models/client-facing-body.js +0 -2
- package/dist/swagger_client/models/client-facing-sleep-stream.d.ts +0 -48
- package/dist/swagger_client/models/client-facing-sleep-stream.js +0 -2
- package/dist/swagger_client/models/client-facing-sleep.d.ts +0 -138
- package/dist/swagger_client/models/client-facing-sleep.js +0 -2
- package/dist/swagger_client/models/client-facing-source-specific.d.ts +0 -48
- package/dist/swagger_client/models/client-facing-source-specific.js +0 -2
- package/dist/swagger_client/models/client-facing-sport.d.ts +0 -30
- package/dist/swagger_client/models/client-facing-sport.js +0 -2
- package/dist/swagger_client/models/client-facing-stream.d.ts +0 -84
- package/dist/swagger_client/models/client-facing-stream.js +0 -2
- package/dist/swagger_client/models/client-facing-user.d.ts +0 -48
- package/dist/swagger_client/models/client-facing-user.js +0 -2
- package/dist/swagger_client/models/client-facing-webhook.d.ts +0 -42
- package/dist/swagger_client/models/client-facing-webhook.js +0 -2
- package/dist/swagger_client/models/client-facing-workout.d.ts +0 -150
- package/dist/swagger_client/models/client-facing-workout.js +0 -2
- package/dist/swagger_client/models/client-sleep-response.d.ts +0 -24
- package/dist/swagger_client/models/client-sleep-response.js +0 -2
- package/dist/swagger_client/models/client-source-specific-response.d.ts +0 -24
- package/dist/swagger_client/models/client-source-specific-response.js +0 -2
- package/dist/swagger_client/models/client-webhook-response.d.ts +0 -24
- package/dist/swagger_client/models/client-webhook-response.js +0 -2
- package/dist/swagger_client/models/client-workout-response.d.ts +0 -24
- package/dist/swagger_client/models/client-workout-response.js +0 -2
- package/dist/swagger_client/models/connected-source-client-facing.d.ts +0 -24
- package/dist/swagger_client/models/connected-source-client-facing.js +0 -2
- package/dist/swagger_client/models/httpvalidation-error.d.ts +0 -24
- package/dist/swagger_client/models/httpvalidation-error.js +0 -2
- package/dist/swagger_client/models/index.d.ts +0 -32
- package/dist/swagger_client/models/index.js +0 -44
- package/dist/swagger_client/models/individual-provider-data.d.ts +0 -30
- package/dist/swagger_client/models/individual-provider-data.js +0 -2
- package/dist/swagger_client/models/link-token-exchange-response.d.ts +0 -24
- package/dist/swagger_client/models/link-token-exchange-response.js +0 -2
- package/dist/swagger_client/models/link-token-exchange.d.ts +0 -30
- package/dist/swagger_client/models/link-token-exchange.js +0 -2
- package/dist/swagger_client/models/password-providers.d.ts +0 -22
- package/dist/swagger_client/models/password-providers.js +0 -28
- package/dist/swagger_client/models/provider-link-response.d.ts +0 -30
- package/dist/swagger_client/models/provider-link-response.js +0 -2
- package/dist/swagger_client/models/providers-that-require-password-auth-whoop-renpho-peloton-zwift.d.ts +0 -18
- package/dist/swagger_client/models/providers-that-require-password-auth-whoop-renpho-peloton-zwift.js +0 -2
- package/dist/swagger_client/models/providers.d.ts +0 -27
- package/dist/swagger_client/models/providers.js +0 -33
- package/dist/swagger_client/models/source-client-facing.d.ts +0 -36
- package/dist/swagger_client/models/source-client-facing.js +0 -2
- package/dist/swagger_client/models/user-create.d.ts +0 -24
- package/dist/swagger_client/models/user-create.js +0 -2
- package/dist/swagger_client/models/user-key-response.d.ts +0 -30
- package/dist/swagger_client/models/user-key-response.js +0 -2
- package/dist/swagger_client/models/user-success-response.d.ts +0 -24
- package/dist/swagger_client/models/user-success-response.js +0 -2
- package/dist/swagger_client/models/validation-error.d.ts +0 -36
- package/dist/swagger_client/models/validation-error.js +0 -2
- package/dist/swagger_client/models/webhook-register.d.ts +0 -36
- package/dist/swagger_client/models/webhook-register.js +0 -2
- package/dist/swagger_client/models/webhook-type.d.ts +0 -24
- package/dist/swagger_client/models/webhook-type.js +0 -30
- package/dist/test/data/mock_webhook.d.ts +0 -49
- package/dist/test/data/mock_webhook.js +0 -170
- package/dist/test/webhook.spec.d.ts +0 -1
- package/dist/test/webhook.spec.js +0 -160
- package/test/data/mock_webhook.ts +0 -167
- package/test/webhook.spec.ts +0 -254
@@ -1,86 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Vital
|
3
|
-
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
4
|
-
*
|
5
|
-
* OpenAPI spec version: 0.1.0
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* NOTE: This class is auto generated by the swagger code generator program.
|
9
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
10
|
-
* Do not edit the class manually.
|
11
|
-
*/
|
12
|
-
import { AxiosPromise, AxiosInstance } from 'axios';
|
13
|
-
import { Configuration } from '../configuration';
|
14
|
-
import { RequestArgs, BaseAPI } from '../base';
|
15
|
-
import { ClientActivityResponse } from '../models';
|
16
|
-
/**
|
17
|
-
* ActivityApi - axios parameter creator
|
18
|
-
* @export
|
19
|
-
*/
|
20
|
-
export declare const ActivityApiAxiosParamCreator: (configuration?: Configuration) => {
|
21
|
-
/**
|
22
|
-
* Get Daily Activity for user_key
|
23
|
-
* @summary Get User Activity
|
24
|
-
* @param {string} userKey
|
25
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
26
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
27
|
-
* @param {string} [provider] Provider oura/strava etc.
|
28
|
-
* @param {*} [options] Override http request option.
|
29
|
-
* @throws {RequiredError}
|
30
|
-
*/
|
31
|
-
getUserActivity: (userKey: string, endDate: Date, startDate: Date, provider?: string, options?: any) => Promise<RequestArgs>;
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* ActivityApi - functional programming interface
|
35
|
-
* @export
|
36
|
-
*/
|
37
|
-
export declare const ActivityApiFp: (configuration?: Configuration) => {
|
38
|
-
/**
|
39
|
-
* Get Daily Activity for user_key
|
40
|
-
* @summary Get User Activity
|
41
|
-
* @param {string} userKey
|
42
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
43
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
44
|
-
* @param {string} [provider] Provider oura/strava etc.
|
45
|
-
* @param {*} [options] Override http request option.
|
46
|
-
* @throws {RequiredError}
|
47
|
-
*/
|
48
|
-
getUserActivity(userKey: string, endDate: Date, startDate: Date, provider?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientActivityResponse>>;
|
49
|
-
};
|
50
|
-
/**
|
51
|
-
* ActivityApi - factory interface
|
52
|
-
* @export
|
53
|
-
*/
|
54
|
-
export declare const ActivityApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
55
|
-
/**
|
56
|
-
* Get Daily Activity for user_key
|
57
|
-
* @summary Get User Activity
|
58
|
-
* @param {string} userKey
|
59
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
60
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
61
|
-
* @param {string} [provider] Provider oura/strava etc.
|
62
|
-
* @param {*} [options] Override http request option.
|
63
|
-
* @throws {RequiredError}
|
64
|
-
*/
|
65
|
-
getUserActivity(userKey: string, endDate: Date, startDate: Date, provider?: string, options?: any): AxiosPromise<ClientActivityResponse>;
|
66
|
-
};
|
67
|
-
/**
|
68
|
-
* ActivityApi - object-oriented interface
|
69
|
-
* @export
|
70
|
-
* @class ActivityApi
|
71
|
-
* @extends {BaseAPI}
|
72
|
-
*/
|
73
|
-
export declare class ActivityApi extends BaseAPI {
|
74
|
-
/**
|
75
|
-
* Get Daily Activity for user_key
|
76
|
-
* @summary Get User Activity
|
77
|
-
* @param {string} userKey
|
78
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
79
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
80
|
-
* @param {string} [provider] Provider oura/strava etc.
|
81
|
-
* @param {*} [options] Override http request option.
|
82
|
-
* @throws {RequiredError}
|
83
|
-
* @memberof ActivityApi
|
84
|
-
*/
|
85
|
-
getUserActivity(userKey: string, endDate: Date, startDate: Date, provider?: string, options?: any): Promise<import("axios").AxiosResponse<ClientActivityResponse>>;
|
86
|
-
}
|
@@ -1,241 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
3
|
-
var extendStatics = function (d, b) {
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7
|
-
return extendStatics(d, b);
|
8
|
-
};
|
9
|
-
return function (d, b) {
|
10
|
-
extendStatics(d, b);
|
11
|
-
function __() { this.constructor = d; }
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13
|
-
};
|
14
|
-
})();
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
16
|
-
__assign = Object.assign || function(t) {
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
18
|
-
s = arguments[i];
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
20
|
-
t[p] = s[p];
|
21
|
-
}
|
22
|
-
return t;
|
23
|
-
};
|
24
|
-
return __assign.apply(this, arguments);
|
25
|
-
};
|
26
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
33
|
-
});
|
34
|
-
};
|
35
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
36
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
37
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
38
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
39
|
-
function step(op) {
|
40
|
-
if (f) throw new TypeError("Generator is already executing.");
|
41
|
-
while (_) try {
|
42
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
43
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
44
|
-
switch (op[0]) {
|
45
|
-
case 0: case 1: t = op; break;
|
46
|
-
case 4: _.label++; return { value: op[1], done: false };
|
47
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
48
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
49
|
-
default:
|
50
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
51
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
52
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
53
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
54
|
-
if (t[2]) _.ops.pop();
|
55
|
-
_.trys.pop(); continue;
|
56
|
-
}
|
57
|
-
op = body.call(thisArg, _);
|
58
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
59
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
60
|
-
}
|
61
|
-
};
|
62
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
63
|
-
exports.ActivityApi = exports.ActivityApiFactory = exports.ActivityApiFp = exports.ActivityApiAxiosParamCreator = void 0;
|
64
|
-
/* tslint:disable */
|
65
|
-
/* eslint-disable */
|
66
|
-
/**
|
67
|
-
* Vital
|
68
|
-
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
69
|
-
*
|
70
|
-
* OpenAPI spec version: 0.1.0
|
71
|
-
*
|
72
|
-
*
|
73
|
-
* NOTE: This class is auto generated by the swagger code generator program.
|
74
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
75
|
-
* Do not edit the class manually.
|
76
|
-
*/
|
77
|
-
var axios_1 = require("axios");
|
78
|
-
// Some imports not used depending on template conditions
|
79
|
-
// @ts-ignore
|
80
|
-
var base_1 = require("../base");
|
81
|
-
/**
|
82
|
-
* ActivityApi - axios parameter creator
|
83
|
-
* @export
|
84
|
-
*/
|
85
|
-
exports.ActivityApiAxiosParamCreator = function (configuration) {
|
86
|
-
var _this = this;
|
87
|
-
return {
|
88
|
-
/**
|
89
|
-
* Get Daily Activity for user_key
|
90
|
-
* @summary Get User Activity
|
91
|
-
* @param {string} userKey
|
92
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
93
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
94
|
-
* @param {string} [provider] Provider oura/strava etc.
|
95
|
-
* @param {*} [options] Override http request option.
|
96
|
-
* @throws {RequiredError}
|
97
|
-
*/
|
98
|
-
getUserActivity: function (userKey, endDate, startDate, provider, options) {
|
99
|
-
if (options === void 0) { options = {}; }
|
100
|
-
return __awaiter(_this, void 0, void 0, function () {
|
101
|
-
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
|
102
|
-
return __generator(this, function (_a) {
|
103
|
-
// verify required parameter 'userKey' is not null or undefined
|
104
|
-
if (userKey === null || userKey === undefined) {
|
105
|
-
throw new base_1.RequiredError('userKey', 'Required parameter userKey was null or undefined when calling getUserActivity.');
|
106
|
-
}
|
107
|
-
// verify required parameter 'endDate' is not null or undefined
|
108
|
-
if (endDate === null || endDate === undefined) {
|
109
|
-
throw new base_1.RequiredError('endDate', 'Required parameter endDate was null or undefined when calling getUserActivity.');
|
110
|
-
}
|
111
|
-
// verify required parameter 'startDate' is not null or undefined
|
112
|
-
if (startDate === null || startDate === undefined) {
|
113
|
-
throw new base_1.RequiredError('startDate', 'Required parameter startDate was null or undefined when calling getUserActivity.');
|
114
|
-
}
|
115
|
-
localVarPath = "/v1/activity/{user_key}"
|
116
|
-
.replace("{" + "user_key" + "}", encodeURIComponent(String(userKey)));
|
117
|
-
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
118
|
-
if (configuration) {
|
119
|
-
baseOptions = configuration.baseOptions;
|
120
|
-
}
|
121
|
-
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
122
|
-
localVarHeaderParameter = {};
|
123
|
-
localVarQueryParameter = {};
|
124
|
-
if (endDate !== undefined) {
|
125
|
-
localVarQueryParameter['end_date'] = (endDate instanceof Date) ?
|
126
|
-
endDate.toISOString() :
|
127
|
-
endDate;
|
128
|
-
}
|
129
|
-
if (provider !== undefined) {
|
130
|
-
localVarQueryParameter['provider'] = provider;
|
131
|
-
}
|
132
|
-
if (startDate !== undefined) {
|
133
|
-
localVarQueryParameter['start_date'] = (startDate instanceof Date) ?
|
134
|
-
startDate.toISOString() :
|
135
|
-
startDate;
|
136
|
-
}
|
137
|
-
query = new URLSearchParams(localVarUrlObj.search);
|
138
|
-
for (key in localVarQueryParameter) {
|
139
|
-
query.set(key, localVarQueryParameter[key]);
|
140
|
-
}
|
141
|
-
for (key in options.query) {
|
142
|
-
query.set(key, options.query[key]);
|
143
|
-
}
|
144
|
-
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
145
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
146
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
147
|
-
return [2 /*return*/, {
|
148
|
-
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
149
|
-
options: localVarRequestOptions,
|
150
|
-
}];
|
151
|
-
});
|
152
|
-
});
|
153
|
-
},
|
154
|
-
};
|
155
|
-
};
|
156
|
-
/**
|
157
|
-
* ActivityApi - functional programming interface
|
158
|
-
* @export
|
159
|
-
*/
|
160
|
-
exports.ActivityApiFp = function (configuration) {
|
161
|
-
return {
|
162
|
-
/**
|
163
|
-
* Get Daily Activity for user_key
|
164
|
-
* @summary Get User Activity
|
165
|
-
* @param {string} userKey
|
166
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
167
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
168
|
-
* @param {string} [provider] Provider oura/strava etc.
|
169
|
-
* @param {*} [options] Override http request option.
|
170
|
-
* @throws {RequiredError}
|
171
|
-
*/
|
172
|
-
getUserActivity: function (userKey, endDate, startDate, provider, options) {
|
173
|
-
return __awaiter(this, void 0, void 0, function () {
|
174
|
-
var localVarAxiosArgs;
|
175
|
-
return __generator(this, function (_a) {
|
176
|
-
switch (_a.label) {
|
177
|
-
case 0: return [4 /*yield*/, exports.ActivityApiAxiosParamCreator(configuration).getUserActivity(userKey, endDate, startDate, provider, options)];
|
178
|
-
case 1:
|
179
|
-
localVarAxiosArgs = _a.sent();
|
180
|
-
return [2 /*return*/, function (axios, basePath) {
|
181
|
-
if (axios === void 0) { axios = axios_1.default; }
|
182
|
-
if (basePath === void 0) { basePath = base_1.BASE_PATH; }
|
183
|
-
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
184
|
-
return axios.request(axiosRequestArgs);
|
185
|
-
}];
|
186
|
-
}
|
187
|
-
});
|
188
|
-
});
|
189
|
-
},
|
190
|
-
};
|
191
|
-
};
|
192
|
-
/**
|
193
|
-
* ActivityApi - factory interface
|
194
|
-
* @export
|
195
|
-
*/
|
196
|
-
exports.ActivityApiFactory = function (configuration, basePath, axios) {
|
197
|
-
return {
|
198
|
-
/**
|
199
|
-
* Get Daily Activity for user_key
|
200
|
-
* @summary Get User Activity
|
201
|
-
* @param {string} userKey
|
202
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
203
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
204
|
-
* @param {string} [provider] Provider oura/strava etc.
|
205
|
-
* @param {*} [options] Override http request option.
|
206
|
-
* @throws {RequiredError}
|
207
|
-
*/
|
208
|
-
getUserActivity: function (userKey, endDate, startDate, provider, options) {
|
209
|
-
return exports.ActivityApiFp(configuration).getUserActivity(userKey, endDate, startDate, provider, options).then(function (request) { return request(axios, basePath); });
|
210
|
-
},
|
211
|
-
};
|
212
|
-
};
|
213
|
-
/**
|
214
|
-
* ActivityApi - object-oriented interface
|
215
|
-
* @export
|
216
|
-
* @class ActivityApi
|
217
|
-
* @extends {BaseAPI}
|
218
|
-
*/
|
219
|
-
var ActivityApi = /** @class */ (function (_super) {
|
220
|
-
__extends(ActivityApi, _super);
|
221
|
-
function ActivityApi() {
|
222
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
223
|
-
}
|
224
|
-
/**
|
225
|
-
* Get Daily Activity for user_key
|
226
|
-
* @summary Get User Activity
|
227
|
-
* @param {string} userKey
|
228
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
229
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
230
|
-
* @param {string} [provider] Provider oura/strava etc.
|
231
|
-
* @param {*} [options] Override http request option.
|
232
|
-
* @throws {RequiredError}
|
233
|
-
* @memberof ActivityApi
|
234
|
-
*/
|
235
|
-
ActivityApi.prototype.getUserActivity = function (userKey, endDate, startDate, provider, options) {
|
236
|
-
var _this = this;
|
237
|
-
return exports.ActivityApiFp(this.configuration).getUserActivity(userKey, endDate, startDate, provider, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
238
|
-
};
|
239
|
-
return ActivityApi;
|
240
|
-
}(base_1.BaseAPI));
|
241
|
-
exports.ActivityApi = ActivityApi;
|
@@ -1,86 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Vital
|
3
|
-
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
4
|
-
*
|
5
|
-
* OpenAPI spec version: 0.1.0
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* NOTE: This class is auto generated by the swagger code generator program.
|
9
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
10
|
-
* Do not edit the class manually.
|
11
|
-
*/
|
12
|
-
import { AxiosPromise, AxiosInstance } from 'axios';
|
13
|
-
import { Configuration } from '../configuration';
|
14
|
-
import { RequestArgs, BaseAPI } from '../base';
|
15
|
-
import { ClientBodyResponse } from '../models';
|
16
|
-
/**
|
17
|
-
* BodyApi - axios parameter creator
|
18
|
-
* @export
|
19
|
-
*/
|
20
|
-
export declare const BodyApiAxiosParamCreator: (configuration?: Configuration) => {
|
21
|
-
/**
|
22
|
-
* Get Body for client user id
|
23
|
-
* @summary Get User Body Composition
|
24
|
-
* @param {string} userKey
|
25
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
26
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
27
|
-
* @param {string} [provider] Provider oura/strava etc.
|
28
|
-
* @param {*} [options] Override http request option.
|
29
|
-
* @throws {RequiredError}
|
30
|
-
*/
|
31
|
-
getUserBodyComposition: (userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any) => Promise<RequestArgs>;
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* BodyApi - functional programming interface
|
35
|
-
* @export
|
36
|
-
*/
|
37
|
-
export declare const BodyApiFp: (configuration?: Configuration) => {
|
38
|
-
/**
|
39
|
-
* Get Body for client user id
|
40
|
-
* @summary Get User Body Composition
|
41
|
-
* @param {string} userKey
|
42
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
43
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
44
|
-
* @param {string} [provider] Provider oura/strava etc.
|
45
|
-
* @param {*} [options] Override http request option.
|
46
|
-
* @throws {RequiredError}
|
47
|
-
*/
|
48
|
-
getUserBodyComposition(userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientBodyResponse>>;
|
49
|
-
};
|
50
|
-
/**
|
51
|
-
* BodyApi - factory interface
|
52
|
-
* @export
|
53
|
-
*/
|
54
|
-
export declare const BodyApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
55
|
-
/**
|
56
|
-
* Get Body for client user id
|
57
|
-
* @summary Get User Body Composition
|
58
|
-
* @param {string} userKey
|
59
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
60
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
61
|
-
* @param {string} [provider] Provider oura/strava etc.
|
62
|
-
* @param {*} [options] Override http request option.
|
63
|
-
* @throws {RequiredError}
|
64
|
-
*/
|
65
|
-
getUserBodyComposition(userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any): AxiosPromise<ClientBodyResponse>;
|
66
|
-
};
|
67
|
-
/**
|
68
|
-
* BodyApi - object-oriented interface
|
69
|
-
* @export
|
70
|
-
* @class BodyApi
|
71
|
-
* @extends {BaseAPI}
|
72
|
-
*/
|
73
|
-
export declare class BodyApi extends BaseAPI {
|
74
|
-
/**
|
75
|
-
* Get Body for client user id
|
76
|
-
* @summary Get User Body Composition
|
77
|
-
* @param {string} userKey
|
78
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
79
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
80
|
-
* @param {string} [provider] Provider oura/strava etc.
|
81
|
-
* @param {*} [options] Override http request option.
|
82
|
-
* @throws {RequiredError}
|
83
|
-
* @memberof BodyApi
|
84
|
-
*/
|
85
|
-
getUserBodyComposition(userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any): Promise<import("axios").AxiosResponse<ClientBodyResponse>>;
|
86
|
-
}
|
@@ -1,241 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
3
|
-
var extendStatics = function (d, b) {
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7
|
-
return extendStatics(d, b);
|
8
|
-
};
|
9
|
-
return function (d, b) {
|
10
|
-
extendStatics(d, b);
|
11
|
-
function __() { this.constructor = d; }
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13
|
-
};
|
14
|
-
})();
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
16
|
-
__assign = Object.assign || function(t) {
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
18
|
-
s = arguments[i];
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
20
|
-
t[p] = s[p];
|
21
|
-
}
|
22
|
-
return t;
|
23
|
-
};
|
24
|
-
return __assign.apply(this, arguments);
|
25
|
-
};
|
26
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
33
|
-
});
|
34
|
-
};
|
35
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
36
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
37
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
38
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
39
|
-
function step(op) {
|
40
|
-
if (f) throw new TypeError("Generator is already executing.");
|
41
|
-
while (_) try {
|
42
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
43
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
44
|
-
switch (op[0]) {
|
45
|
-
case 0: case 1: t = op; break;
|
46
|
-
case 4: _.label++; return { value: op[1], done: false };
|
47
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
48
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
49
|
-
default:
|
50
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
51
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
52
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
53
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
54
|
-
if (t[2]) _.ops.pop();
|
55
|
-
_.trys.pop(); continue;
|
56
|
-
}
|
57
|
-
op = body.call(thisArg, _);
|
58
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
59
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
60
|
-
}
|
61
|
-
};
|
62
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
63
|
-
exports.BodyApi = exports.BodyApiFactory = exports.BodyApiFp = exports.BodyApiAxiosParamCreator = void 0;
|
64
|
-
/* tslint:disable */
|
65
|
-
/* eslint-disable */
|
66
|
-
/**
|
67
|
-
* Vital
|
68
|
-
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
69
|
-
*
|
70
|
-
* OpenAPI spec version: 0.1.0
|
71
|
-
*
|
72
|
-
*
|
73
|
-
* NOTE: This class is auto generated by the swagger code generator program.
|
74
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
75
|
-
* Do not edit the class manually.
|
76
|
-
*/
|
77
|
-
var axios_1 = require("axios");
|
78
|
-
// Some imports not used depending on template conditions
|
79
|
-
// @ts-ignore
|
80
|
-
var base_1 = require("../base");
|
81
|
-
/**
|
82
|
-
* BodyApi - axios parameter creator
|
83
|
-
* @export
|
84
|
-
*/
|
85
|
-
exports.BodyApiAxiosParamCreator = function (configuration) {
|
86
|
-
var _this = this;
|
87
|
-
return {
|
88
|
-
/**
|
89
|
-
* Get Body for client user id
|
90
|
-
* @summary Get User Body Composition
|
91
|
-
* @param {string} userKey
|
92
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
93
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
94
|
-
* @param {string} [provider] Provider oura/strava etc.
|
95
|
-
* @param {*} [options] Override http request option.
|
96
|
-
* @throws {RequiredError}
|
97
|
-
*/
|
98
|
-
getUserBodyComposition: function (userKey, startDate, endDate, provider, options) {
|
99
|
-
if (options === void 0) { options = {}; }
|
100
|
-
return __awaiter(_this, void 0, void 0, function () {
|
101
|
-
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
|
102
|
-
return __generator(this, function (_a) {
|
103
|
-
// verify required parameter 'userKey' is not null or undefined
|
104
|
-
if (userKey === null || userKey === undefined) {
|
105
|
-
throw new base_1.RequiredError('userKey', 'Required parameter userKey was null or undefined when calling getUserBodyComposition.');
|
106
|
-
}
|
107
|
-
// verify required parameter 'startDate' is not null or undefined
|
108
|
-
if (startDate === null || startDate === undefined) {
|
109
|
-
throw new base_1.RequiredError('startDate', 'Required parameter startDate was null or undefined when calling getUserBodyComposition.');
|
110
|
-
}
|
111
|
-
// verify required parameter 'endDate' is not null or undefined
|
112
|
-
if (endDate === null || endDate === undefined) {
|
113
|
-
throw new base_1.RequiredError('endDate', 'Required parameter endDate was null or undefined when calling getUserBodyComposition.');
|
114
|
-
}
|
115
|
-
localVarPath = "/v1/body/{user_key}"
|
116
|
-
.replace("{" + "user_key" + "}", encodeURIComponent(String(userKey)));
|
117
|
-
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
118
|
-
if (configuration) {
|
119
|
-
baseOptions = configuration.baseOptions;
|
120
|
-
}
|
121
|
-
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
122
|
-
localVarHeaderParameter = {};
|
123
|
-
localVarQueryParameter = {};
|
124
|
-
if (startDate !== undefined) {
|
125
|
-
localVarQueryParameter['start_date'] = (startDate instanceof Date) ?
|
126
|
-
startDate.toISOString() :
|
127
|
-
startDate;
|
128
|
-
}
|
129
|
-
if (endDate !== undefined) {
|
130
|
-
localVarQueryParameter['end_date'] = (endDate instanceof Date) ?
|
131
|
-
endDate.toISOString() :
|
132
|
-
endDate;
|
133
|
-
}
|
134
|
-
if (provider !== undefined) {
|
135
|
-
localVarQueryParameter['provider'] = provider;
|
136
|
-
}
|
137
|
-
query = new URLSearchParams(localVarUrlObj.search);
|
138
|
-
for (key in localVarQueryParameter) {
|
139
|
-
query.set(key, localVarQueryParameter[key]);
|
140
|
-
}
|
141
|
-
for (key in options.query) {
|
142
|
-
query.set(key, options.query[key]);
|
143
|
-
}
|
144
|
-
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
145
|
-
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
146
|
-
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
147
|
-
return [2 /*return*/, {
|
148
|
-
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
149
|
-
options: localVarRequestOptions,
|
150
|
-
}];
|
151
|
-
});
|
152
|
-
});
|
153
|
-
},
|
154
|
-
};
|
155
|
-
};
|
156
|
-
/**
|
157
|
-
* BodyApi - functional programming interface
|
158
|
-
* @export
|
159
|
-
*/
|
160
|
-
exports.BodyApiFp = function (configuration) {
|
161
|
-
return {
|
162
|
-
/**
|
163
|
-
* Get Body for client user id
|
164
|
-
* @summary Get User Body Composition
|
165
|
-
* @param {string} userKey
|
166
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
167
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
168
|
-
* @param {string} [provider] Provider oura/strava etc.
|
169
|
-
* @param {*} [options] Override http request option.
|
170
|
-
* @throws {RequiredError}
|
171
|
-
*/
|
172
|
-
getUserBodyComposition: function (userKey, startDate, endDate, provider, options) {
|
173
|
-
return __awaiter(this, void 0, void 0, function () {
|
174
|
-
var localVarAxiosArgs;
|
175
|
-
return __generator(this, function (_a) {
|
176
|
-
switch (_a.label) {
|
177
|
-
case 0: return [4 /*yield*/, exports.BodyApiAxiosParamCreator(configuration).getUserBodyComposition(userKey, startDate, endDate, provider, options)];
|
178
|
-
case 1:
|
179
|
-
localVarAxiosArgs = _a.sent();
|
180
|
-
return [2 /*return*/, function (axios, basePath) {
|
181
|
-
if (axios === void 0) { axios = axios_1.default; }
|
182
|
-
if (basePath === void 0) { basePath = base_1.BASE_PATH; }
|
183
|
-
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
184
|
-
return axios.request(axiosRequestArgs);
|
185
|
-
}];
|
186
|
-
}
|
187
|
-
});
|
188
|
-
});
|
189
|
-
},
|
190
|
-
};
|
191
|
-
};
|
192
|
-
/**
|
193
|
-
* BodyApi - factory interface
|
194
|
-
* @export
|
195
|
-
*/
|
196
|
-
exports.BodyApiFactory = function (configuration, basePath, axios) {
|
197
|
-
return {
|
198
|
-
/**
|
199
|
-
* Get Body for client user id
|
200
|
-
* @summary Get User Body Composition
|
201
|
-
* @param {string} userKey
|
202
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
203
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
204
|
-
* @param {string} [provider] Provider oura/strava etc.
|
205
|
-
* @param {*} [options] Override http request option.
|
206
|
-
* @throws {RequiredError}
|
207
|
-
*/
|
208
|
-
getUserBodyComposition: function (userKey, startDate, endDate, provider, options) {
|
209
|
-
return exports.BodyApiFp(configuration).getUserBodyComposition(userKey, startDate, endDate, provider, options).then(function (request) { return request(axios, basePath); });
|
210
|
-
},
|
211
|
-
};
|
212
|
-
};
|
213
|
-
/**
|
214
|
-
* BodyApi - object-oriented interface
|
215
|
-
* @export
|
216
|
-
* @class BodyApi
|
217
|
-
* @extends {BaseAPI}
|
218
|
-
*/
|
219
|
-
var BodyApi = /** @class */ (function (_super) {
|
220
|
-
__extends(BodyApi, _super);
|
221
|
-
function BodyApi() {
|
222
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
223
|
-
}
|
224
|
-
/**
|
225
|
-
* Get Body for client user id
|
226
|
-
* @summary Get User Body Composition
|
227
|
-
* @param {string} userKey
|
228
|
-
* @param {Date} startDate Date from in YYYY-MM-DD
|
229
|
-
* @param {Date} endDate Date to in YYYY-MM-DD
|
230
|
-
* @param {string} [provider] Provider oura/strava etc.
|
231
|
-
* @param {*} [options] Override http request option.
|
232
|
-
* @throws {RequiredError}
|
233
|
-
* @memberof BodyApi
|
234
|
-
*/
|
235
|
-
BodyApi.prototype.getUserBodyComposition = function (userKey, startDate, endDate, provider, options) {
|
236
|
-
var _this = this;
|
237
|
-
return exports.BodyApiFp(this.configuration).getUserBodyComposition(userKey, startDate, endDate, provider, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
238
|
-
};
|
239
|
-
return BodyApi;
|
240
|
-
}(base_1.BaseAPI));
|
241
|
-
exports.BodyApi = BodyApi;
|