@tryvital/vital-node 0.3.9 → 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 (135) 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 +7 -1
  6. package/client/Vitals.ts +45 -45
  7. package/client/Webhooks.ts +7 -58
  8. package/client/Workouts.ts +3 -3
  9. package/client/index.ts +1 -1
  10. package/client/models/activity.ts +7 -0
  11. package/client/models/body_model.ts +0 -18
  12. package/client/models/profile_model.ts +34 -0
  13. package/dist/client/Activity.js +1 -1
  14. package/dist/client/Body.js +1 -1
  15. package/dist/client/Profile.d.ts +8 -0
  16. package/dist/client/{ProviderSpecific.js → Profile.js} +8 -12
  17. package/dist/client/Sleep.js +2 -2
  18. package/dist/client/Testkits.d.ts +1 -0
  19. package/dist/client/Testkits.js +13 -0
  20. package/dist/client/Vitals.d.ts +7 -6
  21. package/dist/client/Vitals.js +16 -41
  22. package/dist/client/Webhooks.d.ts +1 -7
  23. package/dist/client/Webhooks.js +4 -102
  24. package/dist/client/Workouts.d.ts +1 -1
  25. package/dist/client/Workouts.js +3 -3
  26. package/dist/client/index.d.ts +1 -1
  27. package/dist/client/index.js +3 -3
  28. package/dist/client/models/activity.d.ts +6 -0
  29. package/dist/client/models/body_model.d.ts +0 -18
  30. package/dist/client/models/profile_model.d.ts +33 -0
  31. package/dist/{swagger_client/models/client-activity-response.js → client/models/profile_model.js} +0 -0
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.js +11 -11
  34. package/dist/lib/config.d.ts +0 -1
  35. package/dist/lib/config.js +0 -1
  36. package/index.ts +14 -14
  37. package/lib/config.ts +0 -1
  38. package/package.json +3 -2
  39. package/client/ProviderSpecific.ts +0 -31
  40. package/dist/client/ProviderSpecific.d.ts +0 -8
  41. package/dist/swagger_client/api.d.ts +0 -18
  42. package/dist/swagger_client/api.js +0 -32
  43. package/dist/swagger_client/apis/activity-api.d.ts +0 -86
  44. package/dist/swagger_client/apis/activity-api.js +0 -241
  45. package/dist/swagger_client/apis/body-api.d.ts +0 -86
  46. package/dist/swagger_client/apis/body-api.js +0 -241
  47. package/dist/swagger_client/apis/link-api.d.ts +0 -115
  48. package/dist/swagger_client/apis/link-api.js +0 -310
  49. package/dist/swagger_client/apis/provider-specific-api.d.ts +0 -90
  50. package/dist/swagger_client/apis/provider-specific-api.js +0 -250
  51. package/dist/swagger_client/apis/sleep-api.d.ts +0 -120
  52. package/dist/swagger_client/apis/sleep-api.js +0 -330
  53. package/dist/swagger_client/apis/user-api.d.ts +0 -243
  54. package/dist/swagger_client/apis/user-api.js +0 -657
  55. package/dist/swagger_client/apis/webhooks-api.d.ts +0 -138
  56. package/dist/swagger_client/apis/webhooks-api.js +0 -379
  57. package/dist/swagger_client/apis/workouts-api.d.ts +0 -120
  58. package/dist/swagger_client/apis/workouts-api.js +0 -330
  59. package/dist/swagger_client/base.d.ts +0 -55
  60. package/dist/swagger_client/base.js +0 -67
  61. package/dist/swagger_client/configuration.d.ts +0 -63
  62. package/dist/swagger_client/configuration.js +0 -16
  63. package/dist/swagger_client/index.d.ts +0 -13
  64. package/dist/swagger_client/index.js +0 -27
  65. package/dist/swagger_client/models/client-activity-response.d.ts +0 -24
  66. package/dist/swagger_client/models/client-body-response.d.ts +0 -24
  67. package/dist/swagger_client/models/client-body-response.js +0 -2
  68. package/dist/swagger_client/models/client-facing-activity.d.ts +0 -84
  69. package/dist/swagger_client/models/client-facing-activity.js +0 -2
  70. package/dist/swagger_client/models/client-facing-body.d.ts +0 -72
  71. package/dist/swagger_client/models/client-facing-body.js +0 -2
  72. package/dist/swagger_client/models/client-facing-sleep-stream.d.ts +0 -48
  73. package/dist/swagger_client/models/client-facing-sleep-stream.js +0 -2
  74. package/dist/swagger_client/models/client-facing-sleep.d.ts +0 -138
  75. package/dist/swagger_client/models/client-facing-sleep.js +0 -2
  76. package/dist/swagger_client/models/client-facing-source-specific.d.ts +0 -48
  77. package/dist/swagger_client/models/client-facing-source-specific.js +0 -2
  78. package/dist/swagger_client/models/client-facing-sport.d.ts +0 -30
  79. package/dist/swagger_client/models/client-facing-sport.js +0 -2
  80. package/dist/swagger_client/models/client-facing-stream.d.ts +0 -84
  81. package/dist/swagger_client/models/client-facing-stream.js +0 -2
  82. package/dist/swagger_client/models/client-facing-user.d.ts +0 -48
  83. package/dist/swagger_client/models/client-facing-user.js +0 -2
  84. package/dist/swagger_client/models/client-facing-webhook.d.ts +0 -42
  85. package/dist/swagger_client/models/client-facing-webhook.js +0 -2
  86. package/dist/swagger_client/models/client-facing-workout.d.ts +0 -150
  87. package/dist/swagger_client/models/client-facing-workout.js +0 -2
  88. package/dist/swagger_client/models/client-sleep-response.d.ts +0 -24
  89. package/dist/swagger_client/models/client-sleep-response.js +0 -2
  90. package/dist/swagger_client/models/client-source-specific-response.d.ts +0 -24
  91. package/dist/swagger_client/models/client-source-specific-response.js +0 -2
  92. package/dist/swagger_client/models/client-webhook-response.d.ts +0 -24
  93. package/dist/swagger_client/models/client-webhook-response.js +0 -2
  94. package/dist/swagger_client/models/client-workout-response.d.ts +0 -24
  95. package/dist/swagger_client/models/client-workout-response.js +0 -2
  96. package/dist/swagger_client/models/connected-source-client-facing.d.ts +0 -24
  97. package/dist/swagger_client/models/connected-source-client-facing.js +0 -2
  98. package/dist/swagger_client/models/httpvalidation-error.d.ts +0 -24
  99. package/dist/swagger_client/models/httpvalidation-error.js +0 -2
  100. package/dist/swagger_client/models/index.d.ts +0 -32
  101. package/dist/swagger_client/models/index.js +0 -44
  102. package/dist/swagger_client/models/individual-provider-data.d.ts +0 -30
  103. package/dist/swagger_client/models/individual-provider-data.js +0 -2
  104. package/dist/swagger_client/models/link-token-exchange-response.d.ts +0 -24
  105. package/dist/swagger_client/models/link-token-exchange-response.js +0 -2
  106. package/dist/swagger_client/models/link-token-exchange.d.ts +0 -30
  107. package/dist/swagger_client/models/link-token-exchange.js +0 -2
  108. package/dist/swagger_client/models/password-providers.d.ts +0 -22
  109. package/dist/swagger_client/models/password-providers.js +0 -28
  110. package/dist/swagger_client/models/provider-link-response.d.ts +0 -30
  111. package/dist/swagger_client/models/provider-link-response.js +0 -2
  112. package/dist/swagger_client/models/providers-that-require-password-auth-whoop-renpho-peloton-zwift.d.ts +0 -18
  113. package/dist/swagger_client/models/providers-that-require-password-auth-whoop-renpho-peloton-zwift.js +0 -2
  114. package/dist/swagger_client/models/providers.d.ts +0 -27
  115. package/dist/swagger_client/models/providers.js +0 -33
  116. package/dist/swagger_client/models/source-client-facing.d.ts +0 -36
  117. package/dist/swagger_client/models/source-client-facing.js +0 -2
  118. package/dist/swagger_client/models/user-create.d.ts +0 -24
  119. package/dist/swagger_client/models/user-create.js +0 -2
  120. package/dist/swagger_client/models/user-key-response.d.ts +0 -30
  121. package/dist/swagger_client/models/user-key-response.js +0 -2
  122. package/dist/swagger_client/models/user-success-response.d.ts +0 -24
  123. package/dist/swagger_client/models/user-success-response.js +0 -2
  124. package/dist/swagger_client/models/validation-error.d.ts +0 -36
  125. package/dist/swagger_client/models/validation-error.js +0 -2
  126. package/dist/swagger_client/models/webhook-register.d.ts +0 -36
  127. package/dist/swagger_client/models/webhook-register.js +0 -2
  128. package/dist/swagger_client/models/webhook-type.d.ts +0 -24
  129. package/dist/swagger_client/models/webhook-type.js +0 -30
  130. package/dist/test/data/mock_webhook.d.ts +0 -49
  131. package/dist/test/data/mock_webhook.js +0 -170
  132. package/dist/test/webhook.spec.d.ts +0 -1
  133. package/dist/test/webhook.spec.js +0 -160
  134. package/test/data/mock_webhook.ts +0 -167
  135. package/test/webhook.spec.ts +0 -254
@@ -1,138 +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 { ClientFacingWebhook } from '../models';
16
- import { ClientWebhookResponse } from '../models';
17
- import { WebhookRegister } from '../models';
18
- /**
19
- * WebhooksApi - axios parameter creator
20
- * @export
21
- */
22
- export declare const WebhooksApiAxiosParamCreator: (configuration?: Configuration) => {
23
- /**
24
- * DELETE sepecific webhook
25
- * @summary Delete Webhook
26
- * @param {string} webhookId
27
- * @param {*} [options] Override http request option.
28
- * @throws {RequiredError}
29
- */
30
- deleteWebhook: (webhookId: string, options?: any) => Promise<RequestArgs>;
31
- /**
32
- * GET List of team webhooks
33
- * @summary Get Registered Webhooks
34
- * @param {*} [options] Override http request option.
35
- * @throws {RequiredError}
36
- */
37
- getRegisteredWebhooks: (options?: any) => Promise<RequestArgs>;
38
- /**
39
- * POST Register webhook for team.
40
- * @summary Register Webhook
41
- * @param {WebhookRegister} body
42
- * @param {*} [options] Override http request option.
43
- * @throws {RequiredError}
44
- */
45
- registerWebhook: (body: WebhookRegister, options?: any) => Promise<RequestArgs>;
46
- };
47
- /**
48
- * WebhooksApi - functional programming interface
49
- * @export
50
- */
51
- export declare const WebhooksApiFp: (configuration?: Configuration) => {
52
- /**
53
- * DELETE sepecific webhook
54
- * @summary Delete Webhook
55
- * @param {string} webhookId
56
- * @param {*} [options] Override http request option.
57
- * @throws {RequiredError}
58
- */
59
- deleteWebhook(webhookId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientFacingWebhook>>;
60
- /**
61
- * GET List of team webhooks
62
- * @summary Get Registered Webhooks
63
- * @param {*} [options] Override http request option.
64
- * @throws {RequiredError}
65
- */
66
- getRegisteredWebhooks(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientWebhookResponse>>;
67
- /**
68
- * POST Register webhook for team.
69
- * @summary Register Webhook
70
- * @param {WebhookRegister} body
71
- * @param {*} [options] Override http request option.
72
- * @throws {RequiredError}
73
- */
74
- registerWebhook(body: WebhookRegister, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientFacingWebhook>>;
75
- };
76
- /**
77
- * WebhooksApi - factory interface
78
- * @export
79
- */
80
- export declare const WebhooksApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
81
- /**
82
- * DELETE sepecific webhook
83
- * @summary Delete Webhook
84
- * @param {string} webhookId
85
- * @param {*} [options] Override http request option.
86
- * @throws {RequiredError}
87
- */
88
- deleteWebhook(webhookId: string, options?: any): AxiosPromise<ClientFacingWebhook>;
89
- /**
90
- * GET List of team webhooks
91
- * @summary Get Registered Webhooks
92
- * @param {*} [options] Override http request option.
93
- * @throws {RequiredError}
94
- */
95
- getRegisteredWebhooks(options?: any): AxiosPromise<ClientWebhookResponse>;
96
- /**
97
- * POST Register webhook for team.
98
- * @summary Register Webhook
99
- * @param {WebhookRegister} body
100
- * @param {*} [options] Override http request option.
101
- * @throws {RequiredError}
102
- */
103
- registerWebhook(body: WebhookRegister, options?: any): AxiosPromise<ClientFacingWebhook>;
104
- };
105
- /**
106
- * WebhooksApi - object-oriented interface
107
- * @export
108
- * @class WebhooksApi
109
- * @extends {BaseAPI}
110
- */
111
- export declare class WebhooksApi extends BaseAPI {
112
- /**
113
- * DELETE sepecific webhook
114
- * @summary Delete Webhook
115
- * @param {string} webhookId
116
- * @param {*} [options] Override http request option.
117
- * @throws {RequiredError}
118
- * @memberof WebhooksApi
119
- */
120
- deleteWebhook(webhookId: string, options?: any): Promise<import("axios").AxiosResponse<ClientFacingWebhook>>;
121
- /**
122
- * GET List of team webhooks
123
- * @summary Get Registered Webhooks
124
- * @param {*} [options] Override http request option.
125
- * @throws {RequiredError}
126
- * @memberof WebhooksApi
127
- */
128
- getRegisteredWebhooks(options?: any): Promise<import("axios").AxiosResponse<ClientWebhookResponse>>;
129
- /**
130
- * POST Register webhook for team.
131
- * @summary Register Webhook
132
- * @param {WebhookRegister} body
133
- * @param {*} [options] Override http request option.
134
- * @throws {RequiredError}
135
- * @memberof WebhooksApi
136
- */
137
- registerWebhook(body: WebhookRegister, options?: any): Promise<import("axios").AxiosResponse<ClientFacingWebhook>>;
138
- }
@@ -1,379 +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.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = 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
- * WebhooksApi - axios parameter creator
83
- * @export
84
- */
85
- exports.WebhooksApiAxiosParamCreator = function (configuration) {
86
- var _this = this;
87
- return {
88
- /**
89
- * DELETE sepecific webhook
90
- * @summary Delete Webhook
91
- * @param {string} webhookId
92
- * @param {*} [options] Override http request option.
93
- * @throws {RequiredError}
94
- */
95
- deleteWebhook: function (webhookId, options) {
96
- if (options === void 0) { options = {}; }
97
- return __awaiter(_this, void 0, void 0, function () {
98
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
99
- return __generator(this, function (_a) {
100
- // verify required parameter 'webhookId' is not null or undefined
101
- if (webhookId === null || webhookId === undefined) {
102
- throw new base_1.RequiredError('webhookId', 'Required parameter webhookId was null or undefined when calling deleteWebhook.');
103
- }
104
- localVarPath = "/v1/webhooks/{webhook_id}"
105
- .replace("{" + "webhook_id" + "}", encodeURIComponent(String(webhookId)));
106
- localVarUrlObj = new URL(localVarPath, 'https://example.com');
107
- if (configuration) {
108
- baseOptions = configuration.baseOptions;
109
- }
110
- localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
111
- localVarHeaderParameter = {};
112
- localVarQueryParameter = {};
113
- query = new URLSearchParams(localVarUrlObj.search);
114
- for (key in localVarQueryParameter) {
115
- query.set(key, localVarQueryParameter[key]);
116
- }
117
- for (key in options.query) {
118
- query.set(key, options.query[key]);
119
- }
120
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
121
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
122
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
123
- return [2 /*return*/, {
124
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
125
- options: localVarRequestOptions,
126
- }];
127
- });
128
- });
129
- },
130
- /**
131
- * GET List of team webhooks
132
- * @summary Get Registered Webhooks
133
- * @param {*} [options] Override http request option.
134
- * @throws {RequiredError}
135
- */
136
- getRegisteredWebhooks: function (options) {
137
- if (options === void 0) { options = {}; }
138
- return __awaiter(_this, void 0, void 0, function () {
139
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
140
- return __generator(this, function (_a) {
141
- localVarPath = "/v1/webhooks/";
142
- localVarUrlObj = new URL(localVarPath, 'https://example.com');
143
- if (configuration) {
144
- baseOptions = configuration.baseOptions;
145
- }
146
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
147
- localVarHeaderParameter = {};
148
- localVarQueryParameter = {};
149
- query = new URLSearchParams(localVarUrlObj.search);
150
- for (key in localVarQueryParameter) {
151
- query.set(key, localVarQueryParameter[key]);
152
- }
153
- for (key in options.query) {
154
- query.set(key, options.query[key]);
155
- }
156
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
157
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
158
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
159
- return [2 /*return*/, {
160
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
161
- options: localVarRequestOptions,
162
- }];
163
- });
164
- });
165
- },
166
- /**
167
- * POST Register webhook for team.
168
- * @summary Register Webhook
169
- * @param {WebhookRegister} body
170
- * @param {*} [options] Override http request option.
171
- * @throws {RequiredError}
172
- */
173
- registerWebhook: function (body, options) {
174
- if (options === void 0) { options = {}; }
175
- return __awaiter(_this, void 0, void 0, function () {
176
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions, needsSerialization;
177
- return __generator(this, function (_a) {
178
- // verify required parameter 'body' is not null or undefined
179
- if (body === null || body === undefined) {
180
- throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling registerWebhook.');
181
- }
182
- localVarPath = "/v1/webhooks/";
183
- localVarUrlObj = new URL(localVarPath, 'https://example.com');
184
- if (configuration) {
185
- baseOptions = configuration.baseOptions;
186
- }
187
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
188
- localVarHeaderParameter = {};
189
- localVarQueryParameter = {};
190
- localVarHeaderParameter['Content-Type'] = 'application/json';
191
- query = new URLSearchParams(localVarUrlObj.search);
192
- for (key in localVarQueryParameter) {
193
- query.set(key, localVarQueryParameter[key]);
194
- }
195
- for (key in options.query) {
196
- query.set(key, options.query[key]);
197
- }
198
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
199
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
200
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
201
- needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
202
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
203
- return [2 /*return*/, {
204
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
205
- options: localVarRequestOptions,
206
- }];
207
- });
208
- });
209
- },
210
- };
211
- };
212
- /**
213
- * WebhooksApi - functional programming interface
214
- * @export
215
- */
216
- exports.WebhooksApiFp = function (configuration) {
217
- return {
218
- /**
219
- * DELETE sepecific webhook
220
- * @summary Delete Webhook
221
- * @param {string} webhookId
222
- * @param {*} [options] Override http request option.
223
- * @throws {RequiredError}
224
- */
225
- deleteWebhook: function (webhookId, options) {
226
- return __awaiter(this, void 0, void 0, function () {
227
- var localVarAxiosArgs;
228
- return __generator(this, function (_a) {
229
- switch (_a.label) {
230
- case 0: return [4 /*yield*/, exports.WebhooksApiAxiosParamCreator(configuration).deleteWebhook(webhookId, options)];
231
- case 1:
232
- localVarAxiosArgs = _a.sent();
233
- return [2 /*return*/, function (axios, basePath) {
234
- if (axios === void 0) { axios = axios_1.default; }
235
- if (basePath === void 0) { basePath = base_1.BASE_PATH; }
236
- var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
237
- return axios.request(axiosRequestArgs);
238
- }];
239
- }
240
- });
241
- });
242
- },
243
- /**
244
- * GET List of team webhooks
245
- * @summary Get Registered Webhooks
246
- * @param {*} [options] Override http request option.
247
- * @throws {RequiredError}
248
- */
249
- getRegisteredWebhooks: function (options) {
250
- return __awaiter(this, void 0, void 0, function () {
251
- var localVarAxiosArgs;
252
- return __generator(this, function (_a) {
253
- switch (_a.label) {
254
- case 0: return [4 /*yield*/, exports.WebhooksApiAxiosParamCreator(configuration).getRegisteredWebhooks(options)];
255
- case 1:
256
- localVarAxiosArgs = _a.sent();
257
- return [2 /*return*/, function (axios, basePath) {
258
- if (axios === void 0) { axios = axios_1.default; }
259
- if (basePath === void 0) { basePath = base_1.BASE_PATH; }
260
- var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
261
- return axios.request(axiosRequestArgs);
262
- }];
263
- }
264
- });
265
- });
266
- },
267
- /**
268
- * POST Register webhook for team.
269
- * @summary Register Webhook
270
- * @param {WebhookRegister} body
271
- * @param {*} [options] Override http request option.
272
- * @throws {RequiredError}
273
- */
274
- registerWebhook: function (body, options) {
275
- return __awaiter(this, void 0, void 0, function () {
276
- var localVarAxiosArgs;
277
- return __generator(this, function (_a) {
278
- switch (_a.label) {
279
- case 0: return [4 /*yield*/, exports.WebhooksApiAxiosParamCreator(configuration).registerWebhook(body, options)];
280
- case 1:
281
- localVarAxiosArgs = _a.sent();
282
- return [2 /*return*/, function (axios, basePath) {
283
- if (axios === void 0) { axios = axios_1.default; }
284
- if (basePath === void 0) { basePath = base_1.BASE_PATH; }
285
- var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
286
- return axios.request(axiosRequestArgs);
287
- }];
288
- }
289
- });
290
- });
291
- },
292
- };
293
- };
294
- /**
295
- * WebhooksApi - factory interface
296
- * @export
297
- */
298
- exports.WebhooksApiFactory = function (configuration, basePath, axios) {
299
- return {
300
- /**
301
- * DELETE sepecific webhook
302
- * @summary Delete Webhook
303
- * @param {string} webhookId
304
- * @param {*} [options] Override http request option.
305
- * @throws {RequiredError}
306
- */
307
- deleteWebhook: function (webhookId, options) {
308
- return exports.WebhooksApiFp(configuration).deleteWebhook(webhookId, options).then(function (request) { return request(axios, basePath); });
309
- },
310
- /**
311
- * GET List of team webhooks
312
- * @summary Get Registered Webhooks
313
- * @param {*} [options] Override http request option.
314
- * @throws {RequiredError}
315
- */
316
- getRegisteredWebhooks: function (options) {
317
- return exports.WebhooksApiFp(configuration).getRegisteredWebhooks(options).then(function (request) { return request(axios, basePath); });
318
- },
319
- /**
320
- * POST Register webhook for team.
321
- * @summary Register Webhook
322
- * @param {WebhookRegister} body
323
- * @param {*} [options] Override http request option.
324
- * @throws {RequiredError}
325
- */
326
- registerWebhook: function (body, options) {
327
- return exports.WebhooksApiFp(configuration).registerWebhook(body, options).then(function (request) { return request(axios, basePath); });
328
- },
329
- };
330
- };
331
- /**
332
- * WebhooksApi - object-oriented interface
333
- * @export
334
- * @class WebhooksApi
335
- * @extends {BaseAPI}
336
- */
337
- var WebhooksApi = /** @class */ (function (_super) {
338
- __extends(WebhooksApi, _super);
339
- function WebhooksApi() {
340
- return _super !== null && _super.apply(this, arguments) || this;
341
- }
342
- /**
343
- * DELETE sepecific webhook
344
- * @summary Delete Webhook
345
- * @param {string} webhookId
346
- * @param {*} [options] Override http request option.
347
- * @throws {RequiredError}
348
- * @memberof WebhooksApi
349
- */
350
- WebhooksApi.prototype.deleteWebhook = function (webhookId, options) {
351
- var _this = this;
352
- return exports.WebhooksApiFp(this.configuration).deleteWebhook(webhookId, options).then(function (request) { return request(_this.axios, _this.basePath); });
353
- };
354
- /**
355
- * GET List of team webhooks
356
- * @summary Get Registered Webhooks
357
- * @param {*} [options] Override http request option.
358
- * @throws {RequiredError}
359
- * @memberof WebhooksApi
360
- */
361
- WebhooksApi.prototype.getRegisteredWebhooks = function (options) {
362
- var _this = this;
363
- return exports.WebhooksApiFp(this.configuration).getRegisteredWebhooks(options).then(function (request) { return request(_this.axios, _this.basePath); });
364
- };
365
- /**
366
- * POST Register webhook for team.
367
- * @summary Register Webhook
368
- * @param {WebhookRegister} body
369
- * @param {*} [options] Override http request option.
370
- * @throws {RequiredError}
371
- * @memberof WebhooksApi
372
- */
373
- WebhooksApi.prototype.registerWebhook = function (body, options) {
374
- var _this = this;
375
- return exports.WebhooksApiFp(this.configuration).registerWebhook(body, options).then(function (request) { return request(_this.axios, _this.basePath); });
376
- };
377
- return WebhooksApi;
378
- }(base_1.BaseAPI));
379
- exports.WebhooksApi = WebhooksApi;
@@ -1,120 +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 { ClientFacingStream } from '../models';
16
- import { ClientWorkoutResponse } from '../models';
17
- /**
18
- * WorkoutsApi - axios parameter creator
19
- * @export
20
- */
21
- export declare const WorkoutsApiAxiosParamCreator: (configuration?: Configuration) => {
22
- /**
23
- * GET workouts for user_key between dates.
24
- * @summary Get User Workouts
25
- * @param {string} userKey
26
- * @param {Date} startDate Date from in YYYY-MM-DD
27
- * @param {Date} endDate Date to in YYYY-MM-DD
28
- * @param {string} [provider] Provider oura/strava etc.
29
- * @param {*} [options] Override http request option.
30
- * @throws {RequiredError}
31
- */
32
- getUserWorkouts: (userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any) => Promise<RequestArgs>;
33
- /**
34
- * GET Stream Data for workout
35
- * @summary Get Workout Stream
36
- * @param {string} workoutId
37
- * @param {*} [options] Override http request option.
38
- * @throws {RequiredError}
39
- */
40
- getWorkoutStream: (workoutId: string, options?: any) => Promise<RequestArgs>;
41
- };
42
- /**
43
- * WorkoutsApi - functional programming interface
44
- * @export
45
- */
46
- export declare const WorkoutsApiFp: (configuration?: Configuration) => {
47
- /**
48
- * GET workouts for user_key between dates.
49
- * @summary Get User Workouts
50
- * @param {string} userKey
51
- * @param {Date} startDate Date from in YYYY-MM-DD
52
- * @param {Date} endDate Date to in YYYY-MM-DD
53
- * @param {string} [provider] Provider oura/strava etc.
54
- * @param {*} [options] Override http request option.
55
- * @throws {RequiredError}
56
- */
57
- getUserWorkouts(userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientWorkoutResponse>>;
58
- /**
59
- * GET Stream Data for workout
60
- * @summary Get Workout Stream
61
- * @param {string} workoutId
62
- * @param {*} [options] Override http request option.
63
- * @throws {RequiredError}
64
- */
65
- getWorkoutStream(workoutId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ClientFacingStream>>;
66
- };
67
- /**
68
- * WorkoutsApi - factory interface
69
- * @export
70
- */
71
- export declare const WorkoutsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
72
- /**
73
- * GET workouts for user_key between dates.
74
- * @summary Get User Workouts
75
- * @param {string} userKey
76
- * @param {Date} startDate Date from in YYYY-MM-DD
77
- * @param {Date} endDate Date to in YYYY-MM-DD
78
- * @param {string} [provider] Provider oura/strava etc.
79
- * @param {*} [options] Override http request option.
80
- * @throws {RequiredError}
81
- */
82
- getUserWorkouts(userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any): AxiosPromise<ClientWorkoutResponse>;
83
- /**
84
- * GET Stream Data for workout
85
- * @summary Get Workout Stream
86
- * @param {string} workoutId
87
- * @param {*} [options] Override http request option.
88
- * @throws {RequiredError}
89
- */
90
- getWorkoutStream(workoutId: string, options?: any): AxiosPromise<ClientFacingStream>;
91
- };
92
- /**
93
- * WorkoutsApi - object-oriented interface
94
- * @export
95
- * @class WorkoutsApi
96
- * @extends {BaseAPI}
97
- */
98
- export declare class WorkoutsApi extends BaseAPI {
99
- /**
100
- * GET workouts for user_key between dates.
101
- * @summary Get User Workouts
102
- * @param {string} userKey
103
- * @param {Date} startDate Date from in YYYY-MM-DD
104
- * @param {Date} endDate Date to in YYYY-MM-DD
105
- * @param {string} [provider] Provider oura/strava etc.
106
- * @param {*} [options] Override http request option.
107
- * @throws {RequiredError}
108
- * @memberof WorkoutsApi
109
- */
110
- getUserWorkouts(userKey: string, startDate: Date, endDate: Date, provider?: string, options?: any): Promise<import("axios").AxiosResponse<ClientWorkoutResponse>>;
111
- /**
112
- * GET Stream Data for workout
113
- * @summary Get Workout Stream
114
- * @param {string} workoutId
115
- * @param {*} [options] Override http request option.
116
- * @throws {RequiredError}
117
- * @memberof WorkoutsApi
118
- */
119
- getWorkoutStream(workoutId: string, options?: any): Promise<import("axios").AxiosResponse<ClientFacingStream>>;
120
- }