@tryvital/vital-node 0.3.7 → 1.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.
Files changed (141) hide show
  1. package/client/Activity.ts +1 -1
  2. package/client/Body.ts +1 -1
  3. package/client/Profile.ts +25 -0
  4. package/client/Sleep.ts +2 -2
  5. package/client/Testkits.ts +14 -8
  6. package/client/User.ts +2 -2
  7. package/client/Vitals.ts +45 -45
  8. package/client/Webhooks.ts +7 -58
  9. package/client/Workouts.ts +3 -3
  10. package/client/index.ts +1 -1
  11. package/client/models/activity.ts +10 -3
  12. package/client/models/body_model.ts +0 -18
  13. package/client/models/profile_model.ts +34 -0
  14. package/client/models/testkit_models.ts +14 -0
  15. package/client/models/user_models.ts +4 -0
  16. package/dist/client/Activity.js +1 -1
  17. package/dist/client/Body.js +1 -1
  18. package/dist/client/Profile.d.ts +8 -0
  19. package/dist/client/{ProviderSpecific.js → Profile.js} +8 -12
  20. package/dist/client/Sleep.js +2 -2
  21. package/dist/client/Testkits.d.ts +3 -2
  22. package/dist/client/Testkits.js +17 -1
  23. package/dist/client/User.d.ts +2 -2
  24. package/dist/client/Vitals.d.ts +7 -6
  25. package/dist/client/Vitals.js +16 -41
  26. package/dist/client/Webhooks.d.ts +1 -7
  27. package/dist/client/Webhooks.js +4 -102
  28. package/dist/client/Workouts.d.ts +1 -1
  29. package/dist/client/Workouts.js +3 -3
  30. package/dist/client/index.d.ts +1 -1
  31. package/dist/client/index.js +3 -3
  32. package/dist/client/models/activity.d.ts +9 -3
  33. package/dist/client/models/body_model.d.ts +0 -18
  34. package/dist/client/models/profile_model.d.ts +33 -0
  35. package/dist/{swagger_client/models/client-activity-response.js → client/models/profile_model.js} +0 -0
  36. package/dist/client/models/testkit_models.d.ts +13 -0
  37. package/dist/client/models/user_models.d.ts +3 -0
  38. package/dist/index.d.ts +2 -2
  39. package/dist/index.js +11 -11
  40. package/dist/lib/config.d.ts +0 -1
  41. package/dist/lib/config.js +0 -1
  42. package/index.ts +14 -14
  43. package/lib/config.ts +0 -1
  44. package/package.json +3 -2
  45. package/client/ProviderSpecific.ts +0 -31
  46. package/dist/client/ProviderSpecific.d.ts +0 -8
  47. package/dist/swagger_client/api.d.ts +0 -18
  48. package/dist/swagger_client/api.js +0 -32
  49. package/dist/swagger_client/apis/activity-api.d.ts +0 -86
  50. package/dist/swagger_client/apis/activity-api.js +0 -241
  51. package/dist/swagger_client/apis/body-api.d.ts +0 -86
  52. package/dist/swagger_client/apis/body-api.js +0 -241
  53. package/dist/swagger_client/apis/link-api.d.ts +0 -115
  54. package/dist/swagger_client/apis/link-api.js +0 -310
  55. package/dist/swagger_client/apis/provider-specific-api.d.ts +0 -90
  56. package/dist/swagger_client/apis/provider-specific-api.js +0 -250
  57. package/dist/swagger_client/apis/sleep-api.d.ts +0 -120
  58. package/dist/swagger_client/apis/sleep-api.js +0 -330
  59. package/dist/swagger_client/apis/user-api.d.ts +0 -243
  60. package/dist/swagger_client/apis/user-api.js +0 -657
  61. package/dist/swagger_client/apis/webhooks-api.d.ts +0 -138
  62. package/dist/swagger_client/apis/webhooks-api.js +0 -379
  63. package/dist/swagger_client/apis/workouts-api.d.ts +0 -120
  64. package/dist/swagger_client/apis/workouts-api.js +0 -330
  65. package/dist/swagger_client/base.d.ts +0 -55
  66. package/dist/swagger_client/base.js +0 -67
  67. package/dist/swagger_client/configuration.d.ts +0 -63
  68. package/dist/swagger_client/configuration.js +0 -16
  69. package/dist/swagger_client/index.d.ts +0 -13
  70. package/dist/swagger_client/index.js +0 -27
  71. package/dist/swagger_client/models/client-activity-response.d.ts +0 -24
  72. package/dist/swagger_client/models/client-body-response.d.ts +0 -24
  73. package/dist/swagger_client/models/client-body-response.js +0 -2
  74. package/dist/swagger_client/models/client-facing-activity.d.ts +0 -84
  75. package/dist/swagger_client/models/client-facing-activity.js +0 -2
  76. package/dist/swagger_client/models/client-facing-body.d.ts +0 -72
  77. package/dist/swagger_client/models/client-facing-body.js +0 -2
  78. package/dist/swagger_client/models/client-facing-sleep-stream.d.ts +0 -48
  79. package/dist/swagger_client/models/client-facing-sleep-stream.js +0 -2
  80. package/dist/swagger_client/models/client-facing-sleep.d.ts +0 -138
  81. package/dist/swagger_client/models/client-facing-sleep.js +0 -2
  82. package/dist/swagger_client/models/client-facing-source-specific.d.ts +0 -48
  83. package/dist/swagger_client/models/client-facing-source-specific.js +0 -2
  84. package/dist/swagger_client/models/client-facing-sport.d.ts +0 -30
  85. package/dist/swagger_client/models/client-facing-sport.js +0 -2
  86. package/dist/swagger_client/models/client-facing-stream.d.ts +0 -84
  87. package/dist/swagger_client/models/client-facing-stream.js +0 -2
  88. package/dist/swagger_client/models/client-facing-user.d.ts +0 -48
  89. package/dist/swagger_client/models/client-facing-user.js +0 -2
  90. package/dist/swagger_client/models/client-facing-webhook.d.ts +0 -42
  91. package/dist/swagger_client/models/client-facing-webhook.js +0 -2
  92. package/dist/swagger_client/models/client-facing-workout.d.ts +0 -150
  93. package/dist/swagger_client/models/client-facing-workout.js +0 -2
  94. package/dist/swagger_client/models/client-sleep-response.d.ts +0 -24
  95. package/dist/swagger_client/models/client-sleep-response.js +0 -2
  96. package/dist/swagger_client/models/client-source-specific-response.d.ts +0 -24
  97. package/dist/swagger_client/models/client-source-specific-response.js +0 -2
  98. package/dist/swagger_client/models/client-webhook-response.d.ts +0 -24
  99. package/dist/swagger_client/models/client-webhook-response.js +0 -2
  100. package/dist/swagger_client/models/client-workout-response.d.ts +0 -24
  101. package/dist/swagger_client/models/client-workout-response.js +0 -2
  102. package/dist/swagger_client/models/connected-source-client-facing.d.ts +0 -24
  103. package/dist/swagger_client/models/connected-source-client-facing.js +0 -2
  104. package/dist/swagger_client/models/httpvalidation-error.d.ts +0 -24
  105. package/dist/swagger_client/models/httpvalidation-error.js +0 -2
  106. package/dist/swagger_client/models/index.d.ts +0 -32
  107. package/dist/swagger_client/models/index.js +0 -44
  108. package/dist/swagger_client/models/individual-provider-data.d.ts +0 -30
  109. package/dist/swagger_client/models/individual-provider-data.js +0 -2
  110. package/dist/swagger_client/models/link-token-exchange-response.d.ts +0 -24
  111. package/dist/swagger_client/models/link-token-exchange-response.js +0 -2
  112. package/dist/swagger_client/models/link-token-exchange.d.ts +0 -30
  113. package/dist/swagger_client/models/link-token-exchange.js +0 -2
  114. package/dist/swagger_client/models/password-providers.d.ts +0 -22
  115. package/dist/swagger_client/models/password-providers.js +0 -28
  116. package/dist/swagger_client/models/provider-link-response.d.ts +0 -30
  117. package/dist/swagger_client/models/provider-link-response.js +0 -2
  118. package/dist/swagger_client/models/providers-that-require-password-auth-whoop-renpho-peloton-zwift.d.ts +0 -18
  119. package/dist/swagger_client/models/providers-that-require-password-auth-whoop-renpho-peloton-zwift.js +0 -2
  120. package/dist/swagger_client/models/providers.d.ts +0 -27
  121. package/dist/swagger_client/models/providers.js +0 -33
  122. package/dist/swagger_client/models/source-client-facing.d.ts +0 -36
  123. package/dist/swagger_client/models/source-client-facing.js +0 -2
  124. package/dist/swagger_client/models/user-create.d.ts +0 -24
  125. package/dist/swagger_client/models/user-create.js +0 -2
  126. package/dist/swagger_client/models/user-key-response.d.ts +0 -30
  127. package/dist/swagger_client/models/user-key-response.js +0 -2
  128. package/dist/swagger_client/models/user-success-response.d.ts +0 -24
  129. package/dist/swagger_client/models/user-success-response.js +0 -2
  130. package/dist/swagger_client/models/validation-error.d.ts +0 -36
  131. package/dist/swagger_client/models/validation-error.js +0 -2
  132. package/dist/swagger_client/models/webhook-register.d.ts +0 -36
  133. package/dist/swagger_client/models/webhook-register.js +0 -2
  134. package/dist/swagger_client/models/webhook-type.d.ts +0 -24
  135. package/dist/swagger_client/models/webhook-type.js +0 -30
  136. package/dist/test/data/mock_webhook.d.ts +0 -49
  137. package/dist/test/data/mock_webhook.js +0 -170
  138. package/dist/test/webhook.spec.d.ts +0 -1
  139. package/dist/test/webhook.spec.js +0 -160
  140. package/test/data/mock_webhook.ts +0 -167
  141. package/test/webhook.spec.ts +0 -254
@@ -1,31 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- import { ClientProviderSpecificResponse } from './models/provider_specific';
3
-
4
- export class ProviderSpecificApi {
5
- baseURL: string;
6
- client: AxiosInstance;
7
- constructor(baseURL: string, axios: AxiosInstance) {
8
- this.baseURL = baseURL;
9
- this.client = axios;
10
- }
11
-
12
- public async get(
13
- userKey: string,
14
- startDate: Date,
15
- endDate: Date,
16
- provider: string,
17
- dataType?: 'activity' | 'sleep' | 'body' | 'workouts'
18
- ): Promise<ClientProviderSpecificResponse> {
19
- const resp = await this.client.get(
20
- this.baseURL.concat(`/provider-specific/${userKey}/${provider}`),
21
- {
22
- params: {
23
- start_date: startDate,
24
- end_date: endDate,
25
- data_type: dataType,
26
- },
27
- }
28
- );
29
- return resp.data;
30
- }
31
- }
@@ -1,8 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- import { ClientProviderSpecificResponse } from './models/provider_specific';
3
- export declare class ProviderSpecificApi {
4
- baseURL: string;
5
- client: AxiosInstance;
6
- constructor(baseURL: string, axios: AxiosInstance);
7
- get(userKey: string, startDate: Date, endDate: Date, provider: string, dataType?: 'activity' | 'sleep' | 'body' | 'workouts'): Promise<ClientProviderSpecificResponse>;
8
- }
@@ -1,18 +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
- */ export * from './apis/activity-api';
12
- export * from './apis/body-api';
13
- export * from './apis/link-api';
14
- export * from './apis/provider-specific-api';
15
- export * from './apis/sleep-api';
16
- export * from './apis/user-api';
17
- export * from './apis/webhooks-api';
18
- export * from './apis/workouts-api';
@@ -1,32 +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
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- /* tslint:disable */
14
- /* eslint-disable */
15
- /**
16
- * Vital
17
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
18
- *
19
- * OpenAPI spec version: 0.1.0
20
- *
21
- *
22
- * NOTE: This class is auto generated by the swagger code generator program.
23
- * https://github.com/swagger-api/swagger-codegen.git
24
- * Do not edit the class manually.
25
- */ __exportStar(require("./apis/activity-api"), exports);
26
- __exportStar(require("./apis/body-api"), exports);
27
- __exportStar(require("./apis/link-api"), exports);
28
- __exportStar(require("./apis/provider-specific-api"), exports);
29
- __exportStar(require("./apis/sleep-api"), exports);
30
- __exportStar(require("./apis/user-api"), exports);
31
- __exportStar(require("./apis/webhooks-api"), exports);
32
- __exportStar(require("./apis/workouts-api"), exports);
@@ -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
- }