@tryvital/vital-node 0.3.6 → 1.0.0

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 +11 -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 +16 -2
  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 +15 -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 +15 -2
  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,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;
@@ -1,115 +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 { IndividualProviderData } from '../models';
16
- import { LinkTokenExchange } from '../models';
17
- import { LinkTokenExchangeResponse } from '../models';
18
- import { ProviderLinkResponse } from '../models';
19
- import { ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift } from '../models';
20
- /**
21
- * LinkApi - axios parameter creator
22
- * @export
23
- */
24
- export declare const LinkApiAxiosParamCreator: (configuration?: Configuration) => {
25
- /**
26
- * Check token is valid and begin deletion for one time use token.
27
- * @summary Connect Individual Provider
28
- * @param {IndividualProviderData} body
29
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
30
- * @param {*} [options] Override http request option.
31
- * @throws {RequiredError}
32
- */
33
- connectIndividualProvider: (body: IndividualProviderData, provider: ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift, options?: any) => Promise<RequestArgs>;
34
- /**
35
- * POST Generate user Link token using user_key.
36
- * @summary Generate Temp Link Token
37
- * @param {LinkTokenExchange} body
38
- * @param {*} [options] Override http request option.
39
- * @throws {RequiredError}
40
- */
41
- generateTempLinkToken: (body: LinkTokenExchange, options?: any) => Promise<RequestArgs>;
42
- };
43
- /**
44
- * LinkApi - functional programming interface
45
- * @export
46
- */
47
- export declare const LinkApiFp: (configuration?: Configuration) => {
48
- /**
49
- * Check token is valid and begin deletion for one time use token.
50
- * @summary Connect Individual Provider
51
- * @param {IndividualProviderData} body
52
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
53
- * @param {*} [options] Override http request option.
54
- * @throws {RequiredError}
55
- */
56
- connectIndividualProvider(body: IndividualProviderData, provider: ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProviderLinkResponse>>;
57
- /**
58
- * POST Generate user Link token using user_key.
59
- * @summary Generate Temp Link Token
60
- * @param {LinkTokenExchange} body
61
- * @param {*} [options] Override http request option.
62
- * @throws {RequiredError}
63
- */
64
- generateTempLinkToken(body: LinkTokenExchange, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LinkTokenExchangeResponse>>;
65
- };
66
- /**
67
- * LinkApi - factory interface
68
- * @export
69
- */
70
- export declare const LinkApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
71
- /**
72
- * Check token is valid and begin deletion for one time use token.
73
- * @summary Connect Individual Provider
74
- * @param {IndividualProviderData} body
75
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
76
- * @param {*} [options] Override http request option.
77
- * @throws {RequiredError}
78
- */
79
- connectIndividualProvider(body: IndividualProviderData, provider: ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift, options?: any): AxiosPromise<ProviderLinkResponse>;
80
- /**
81
- * POST Generate user Link token using user_key.
82
- * @summary Generate Temp Link Token
83
- * @param {LinkTokenExchange} body
84
- * @param {*} [options] Override http request option.
85
- * @throws {RequiredError}
86
- */
87
- generateTempLinkToken(body: LinkTokenExchange, options?: any): AxiosPromise<LinkTokenExchangeResponse>;
88
- };
89
- /**
90
- * LinkApi - object-oriented interface
91
- * @export
92
- * @class LinkApi
93
- * @extends {BaseAPI}
94
- */
95
- export declare class LinkApi extends BaseAPI {
96
- /**
97
- * Check token is valid and begin deletion for one time use token.
98
- * @summary Connect Individual Provider
99
- * @param {IndividualProviderData} body
100
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
101
- * @param {*} [options] Override http request option.
102
- * @throws {RequiredError}
103
- * @memberof LinkApi
104
- */
105
- connectIndividualProvider(body: IndividualProviderData, provider: ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift, options?: any): Promise<import("axios").AxiosResponse<ProviderLinkResponse>>;
106
- /**
107
- * POST Generate user Link token using user_key.
108
- * @summary Generate Temp Link Token
109
- * @param {LinkTokenExchange} body
110
- * @param {*} [options] Override http request option.
111
- * @throws {RequiredError}
112
- * @memberof LinkApi
113
- */
114
- generateTempLinkToken(body: LinkTokenExchange, options?: any): Promise<import("axios").AxiosResponse<LinkTokenExchangeResponse>>;
115
- }
@@ -1,310 +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.LinkApi = exports.LinkApiFactory = exports.LinkApiFp = exports.LinkApiAxiosParamCreator = 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
- * LinkApi - axios parameter creator
83
- * @export
84
- */
85
- exports.LinkApiAxiosParamCreator = function (configuration) {
86
- var _this = this;
87
- return {
88
- /**
89
- * Check token is valid and begin deletion for one time use token.
90
- * @summary Connect Individual Provider
91
- * @param {IndividualProviderData} body
92
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
93
- * @param {*} [options] Override http request option.
94
- * @throws {RequiredError}
95
- */
96
- connectIndividualProvider: function (body, provider, options) {
97
- if (options === void 0) { options = {}; }
98
- return __awaiter(_this, void 0, void 0, function () {
99
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions, needsSerialization;
100
- return __generator(this, function (_a) {
101
- // verify required parameter 'body' is not null or undefined
102
- if (body === null || body === undefined) {
103
- throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling connectIndividualProvider.');
104
- }
105
- // verify required parameter 'provider' is not null or undefined
106
- if (provider === null || provider === undefined) {
107
- throw new base_1.RequiredError('provider', 'Required parameter provider was null or undefined when calling connectIndividualProvider.');
108
- }
109
- localVarPath = "/v1/link/provider/{provider}"
110
- .replace("{" + "provider" + "}", encodeURIComponent(String(provider)));
111
- localVarUrlObj = new URL(localVarPath, 'https://example.com');
112
- if (configuration) {
113
- baseOptions = configuration.baseOptions;
114
- }
115
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
116
- localVarHeaderParameter = {};
117
- localVarQueryParameter = {};
118
- localVarHeaderParameter['Content-Type'] = 'application/json';
119
- query = new URLSearchParams(localVarUrlObj.search);
120
- for (key in localVarQueryParameter) {
121
- query.set(key, localVarQueryParameter[key]);
122
- }
123
- for (key in options.query) {
124
- query.set(key, options.query[key]);
125
- }
126
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
127
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
128
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
129
- needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
130
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
131
- return [2 /*return*/, {
132
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
133
- options: localVarRequestOptions,
134
- }];
135
- });
136
- });
137
- },
138
- /**
139
- * POST Generate user Link token using user_key.
140
- * @summary Generate Temp Link Token
141
- * @param {LinkTokenExchange} body
142
- * @param {*} [options] Override http request option.
143
- * @throws {RequiredError}
144
- */
145
- generateTempLinkToken: function (body, options) {
146
- if (options === void 0) { options = {}; }
147
- return __awaiter(_this, void 0, void 0, function () {
148
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions, needsSerialization;
149
- return __generator(this, function (_a) {
150
- // verify required parameter 'body' is not null or undefined
151
- if (body === null || body === undefined) {
152
- throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling generateTempLinkToken.');
153
- }
154
- localVarPath = "/v1/link/token";
155
- localVarUrlObj = new URL(localVarPath, 'https://example.com');
156
- if (configuration) {
157
- baseOptions = configuration.baseOptions;
158
- }
159
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
160
- localVarHeaderParameter = {};
161
- localVarQueryParameter = {};
162
- localVarHeaderParameter['Content-Type'] = 'application/json';
163
- query = new URLSearchParams(localVarUrlObj.search);
164
- for (key in localVarQueryParameter) {
165
- query.set(key, localVarQueryParameter[key]);
166
- }
167
- for (key in options.query) {
168
- query.set(key, options.query[key]);
169
- }
170
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
171
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
172
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
173
- needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
174
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
175
- return [2 /*return*/, {
176
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
177
- options: localVarRequestOptions,
178
- }];
179
- });
180
- });
181
- },
182
- };
183
- };
184
- /**
185
- * LinkApi - functional programming interface
186
- * @export
187
- */
188
- exports.LinkApiFp = function (configuration) {
189
- return {
190
- /**
191
- * Check token is valid and begin deletion for one time use token.
192
- * @summary Connect Individual Provider
193
- * @param {IndividualProviderData} body
194
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
195
- * @param {*} [options] Override http request option.
196
- * @throws {RequiredError}
197
- */
198
- connectIndividualProvider: function (body, provider, options) {
199
- return __awaiter(this, void 0, void 0, function () {
200
- var localVarAxiosArgs;
201
- return __generator(this, function (_a) {
202
- switch (_a.label) {
203
- case 0: return [4 /*yield*/, exports.LinkApiAxiosParamCreator(configuration).connectIndividualProvider(body, provider, options)];
204
- case 1:
205
- localVarAxiosArgs = _a.sent();
206
- return [2 /*return*/, function (axios, basePath) {
207
- if (axios === void 0) { axios = axios_1.default; }
208
- if (basePath === void 0) { basePath = base_1.BASE_PATH; }
209
- var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
210
- return axios.request(axiosRequestArgs);
211
- }];
212
- }
213
- });
214
- });
215
- },
216
- /**
217
- * POST Generate user Link token using user_key.
218
- * @summary Generate Temp Link Token
219
- * @param {LinkTokenExchange} body
220
- * @param {*} [options] Override http request option.
221
- * @throws {RequiredError}
222
- */
223
- generateTempLinkToken: function (body, options) {
224
- return __awaiter(this, void 0, void 0, function () {
225
- var localVarAxiosArgs;
226
- return __generator(this, function (_a) {
227
- switch (_a.label) {
228
- case 0: return [4 /*yield*/, exports.LinkApiAxiosParamCreator(configuration).generateTempLinkToken(body, options)];
229
- case 1:
230
- localVarAxiosArgs = _a.sent();
231
- return [2 /*return*/, function (axios, basePath) {
232
- if (axios === void 0) { axios = axios_1.default; }
233
- if (basePath === void 0) { basePath = base_1.BASE_PATH; }
234
- var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
235
- return axios.request(axiosRequestArgs);
236
- }];
237
- }
238
- });
239
- });
240
- },
241
- };
242
- };
243
- /**
244
- * LinkApi - factory interface
245
- * @export
246
- */
247
- exports.LinkApiFactory = function (configuration, basePath, axios) {
248
- return {
249
- /**
250
- * Check token is valid and begin deletion for one time use token.
251
- * @summary Connect Individual Provider
252
- * @param {IndividualProviderData} body
253
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
254
- * @param {*} [options] Override http request option.
255
- * @throws {RequiredError}
256
- */
257
- connectIndividualProvider: function (body, provider, options) {
258
- return exports.LinkApiFp(configuration).connectIndividualProvider(body, provider, options).then(function (request) { return request(axios, basePath); });
259
- },
260
- /**
261
- * POST Generate user Link token using user_key.
262
- * @summary Generate Temp Link Token
263
- * @param {LinkTokenExchange} body
264
- * @param {*} [options] Override http request option.
265
- * @throws {RequiredError}
266
- */
267
- generateTempLinkToken: function (body, options) {
268
- return exports.LinkApiFp(configuration).generateTempLinkToken(body, options).then(function (request) { return request(axios, basePath); });
269
- },
270
- };
271
- };
272
- /**
273
- * LinkApi - object-oriented interface
274
- * @export
275
- * @class LinkApi
276
- * @extends {BaseAPI}
277
- */
278
- var LinkApi = /** @class */ (function (_super) {
279
- __extends(LinkApi, _super);
280
- function LinkApi() {
281
- return _super !== null && _super.apply(this, arguments) || this;
282
- }
283
- /**
284
- * Check token is valid and begin deletion for one time use token.
285
- * @summary Connect Individual Provider
286
- * @param {IndividualProviderData} body
287
- * @param {ProvidersThatRequirePasswordAuthWhoopRenphoPelotonZwift} provider
288
- * @param {*} [options] Override http request option.
289
- * @throws {RequiredError}
290
- * @memberof LinkApi
291
- */
292
- LinkApi.prototype.connectIndividualProvider = function (body, provider, options) {
293
- var _this = this;
294
- return exports.LinkApiFp(this.configuration).connectIndividualProvider(body, provider, options).then(function (request) { return request(_this.axios, _this.basePath); });
295
- };
296
- /**
297
- * POST Generate user Link token using user_key.
298
- * @summary Generate Temp Link Token
299
- * @param {LinkTokenExchange} body
300
- * @param {*} [options] Override http request option.
301
- * @throws {RequiredError}
302
- * @memberof LinkApi
303
- */
304
- LinkApi.prototype.generateTempLinkToken = function (body, options) {
305
- var _this = this;
306
- return exports.LinkApiFp(this.configuration).generateTempLinkToken(body, options).then(function (request) { return request(_this.axios, _this.basePath); });
307
- };
308
- return LinkApi;
309
- }(base_1.BaseAPI));
310
- exports.LinkApi = LinkApi;