@teemill/website 0.1.3 → 0.1.6

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 (60) hide show
  1. package/.openapi-generator/FILES +7 -10
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +3 -3
  4. package/api.ts +409 -0
  5. package/base.ts +86 -0
  6. package/common.ts +150 -0
  7. package/configuration.ts +110 -0
  8. package/dist/api.d.ts +243 -0
  9. package/dist/api.js +292 -0
  10. package/dist/base.d.ts +66 -0
  11. package/dist/base.js +65 -0
  12. package/dist/common.d.ts +65 -0
  13. package/dist/common.js +161 -0
  14. package/dist/configuration.d.ts +91 -0
  15. package/dist/configuration.js +43 -0
  16. package/dist/esm/api.d.ts +243 -0
  17. package/dist/esm/api.js +285 -0
  18. package/dist/esm/base.d.ts +66 -0
  19. package/dist/esm/base.js +60 -0
  20. package/dist/esm/common.d.ts +65 -0
  21. package/dist/esm/common.js +149 -0
  22. package/dist/esm/configuration.d.ts +91 -0
  23. package/dist/esm/configuration.js +39 -0
  24. package/dist/esm/index.d.ts +13 -0
  25. package/dist/esm/index.js +15 -0
  26. package/dist/index.d.ts +13 -3
  27. package/dist/index.js +15 -5
  28. package/git_push.sh +57 -0
  29. package/index.ts +18 -0
  30. package/package.json +18 -4
  31. package/tsconfig.esm.json +7 -0
  32. package/tsconfig.json +4 -6
  33. package/dist/apis/ShippingMethodsApi.d.ts +0 -96
  34. package/dist/apis/ShippingMethodsApi.js +0 -386
  35. package/dist/apis/index.d.ts +0 -1
  36. package/dist/apis/index.js +0 -19
  37. package/dist/models/ApiError.d.ts +0 -37
  38. package/dist/models/ApiError.js +0 -53
  39. package/dist/models/Price.d.ts +0 -37
  40. package/dist/models/Price.js +0 -52
  41. package/dist/models/ShippingMethod.d.ts +0 -56
  42. package/dist/models/ShippingMethod.js +0 -59
  43. package/dist/models/ShippingMethods.d.ts +0 -38
  44. package/dist/models/ShippingMethods.js +0 -54
  45. package/dist/models/UpdateShippingMethodRequest.d.ts +0 -44
  46. package/dist/models/UpdateShippingMethodRequest.js +0 -55
  47. package/dist/models/index.d.ts +0 -5
  48. package/dist/models/index.js +0 -23
  49. package/dist/runtime.d.ts +0 -187
  50. package/dist/runtime.js +0 -565
  51. package/src/apis/ShippingMethodsApi.ts +0 -337
  52. package/src/apis/index.ts +0 -3
  53. package/src/index.ts +0 -5
  54. package/src/models/ApiError.ts +0 -74
  55. package/src/models/Price.ts +0 -73
  56. package/src/models/ShippingMethod.ts +0 -104
  57. package/src/models/ShippingMethods.ts +0 -81
  58. package/src/models/UpdateShippingMethodRequest.ts +0 -88
  59. package/src/models/index.ts +0 -7
  60. package/src/runtime.ts +0 -441
@@ -1,15 +1,12 @@
1
1
  .gitignore
2
2
  .npmignore
3
3
  README.md
4
+ api.ts
5
+ base.ts
6
+ common.ts
7
+ configuration.ts
8
+ git_push.sh
9
+ index.ts
4
10
  package.json
5
- src/apis/ShippingMethodsApi.ts
6
- src/apis/index.ts
7
- src/index.ts
8
- src/models/ApiError.ts
9
- src/models/Price.ts
10
- src/models/ShippingMethod.ts
11
- src/models/ShippingMethods.ts
12
- src/models/UpdateShippingMethodRequest.ts
13
- src/models/index.ts
14
- src/runtime.ts
11
+ tsconfig.esm.json
15
12
  tsconfig.json
@@ -1 +1 @@
1
- 7.3.0
1
+ 7.6.0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- ## @teemill/website@0.1.3
1
+ ## @teemill/website@0.1.6
2
2
 
3
- This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
3
+ This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
5
5
  Environment
6
6
  * Node.js
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @teemill/website@0.1.3 --save
39
+ npm install @teemill/website@0.1.6 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
package/api.ts ADDED
@@ -0,0 +1,409 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Website API
5
+ * Manage your Teemill Website Currently this API is in development and is not yet publicly accessible. All paths and models are subject to change. For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.6
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
+ import type { RequestArgs } from './base';
23
+ // @ts-ignore
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
25
+
26
+ /**
27
+ *
28
+ * @export
29
+ * @interface ApiError
30
+ */
31
+ export interface ApiError {
32
+ /**
33
+ *
34
+ * @type {string}
35
+ * @memberof ApiError
36
+ */
37
+ 'code': string;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof ApiError
42
+ */
43
+ 'message': string;
44
+ }
45
+ /**
46
+ *
47
+ * @export
48
+ * @interface AuthorizeStripe200Response
49
+ */
50
+ export interface AuthorizeStripe200Response {
51
+ /**
52
+ * The URL to redirect to
53
+ * @type {string}
54
+ * @memberof AuthorizeStripe200Response
55
+ */
56
+ 'redirect_url': string;
57
+ }
58
+ /**
59
+ *
60
+ * @export
61
+ * @interface PaymentAccount
62
+ */
63
+ export interface PaymentAccount {
64
+ /**
65
+ * The name of the payment account
66
+ * @type {string}
67
+ * @memberof PaymentAccount
68
+ */
69
+ 'name': string;
70
+ /**
71
+ * The payment method
72
+ * @type {string}
73
+ * @memberof PaymentAccount
74
+ */
75
+ 'method': PaymentAccountMethodEnum;
76
+ /**
77
+ * The configuration for the payment account
78
+ * @type {{ [key: string]: string; }}
79
+ * @memberof PaymentAccount
80
+ */
81
+ 'config': { [key: string]: string; };
82
+ }
83
+
84
+ export const PaymentAccountMethodEnum = {
85
+ Stripe: 'stripe',
86
+ Paypal: 'paypal'
87
+ } as const;
88
+
89
+ export type PaymentAccountMethodEnum = typeof PaymentAccountMethodEnum[keyof typeof PaymentAccountMethodEnum];
90
+
91
+
92
+ /**
93
+ * PaymentApi - axios parameter creator
94
+ * @export
95
+ */
96
+ export const PaymentApiAxiosParamCreator = function (configuration?: Configuration) {
97
+ return {
98
+ /**
99
+ * Authorize a Stripe payment account
100
+ * @summary Authorize Stripe
101
+ * @param {string} project What project it is
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ */
105
+ authorizeStripe: async (project: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
106
+ // verify required parameter 'project' is not null or undefined
107
+ assertParamExists('authorizeStripe', 'project', project)
108
+ const localVarPath = `/v1/website/payment/stripe/authorize`;
109
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
110
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
111
+ let baseOptions;
112
+ if (configuration) {
113
+ baseOptions = configuration.baseOptions;
114
+ }
115
+
116
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
117
+ const localVarHeaderParameter = {} as any;
118
+ const localVarQueryParameter = {} as any;
119
+
120
+ // authentication session-oauth required
121
+ // oauth required
122
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
123
+
124
+ // authentication api-key required
125
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
126
+
127
+ if (project !== undefined) {
128
+ localVarQueryParameter['project'] = project;
129
+ }
130
+
131
+
132
+
133
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
134
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
135
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
136
+
137
+ return {
138
+ url: toPathString(localVarUrlObj),
139
+ options: localVarRequestOptions,
140
+ };
141
+ },
142
+ /**
143
+ * Deauthorize a Stripe payment account
144
+ * @summary Deauthorize Stripe
145
+ * @param {string} project What project it is
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ */
149
+ deauthorizeStripe: async (project: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
150
+ // verify required parameter 'project' is not null or undefined
151
+ assertParamExists('deauthorizeStripe', 'project', project)
152
+ const localVarPath = `/v1/website/payment/stripe/deauthorize`;
153
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
154
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
155
+ let baseOptions;
156
+ if (configuration) {
157
+ baseOptions = configuration.baseOptions;
158
+ }
159
+
160
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
161
+ const localVarHeaderParameter = {} as any;
162
+ const localVarQueryParameter = {} as any;
163
+
164
+ // authentication session-oauth required
165
+ // oauth required
166
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
167
+
168
+ // authentication api-key required
169
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
170
+
171
+ if (project !== undefined) {
172
+ localVarQueryParameter['project'] = project;
173
+ }
174
+
175
+
176
+
177
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
178
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
179
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
180
+
181
+ return {
182
+ url: toPathString(localVarUrlObj),
183
+ options: localVarRequestOptions,
184
+ };
185
+ },
186
+ /**
187
+ * Get the Stripe payment account for the project
188
+ * @summary Get Stripe Payment Account
189
+ * @param {string} project What project it is
190
+ * @param {*} [options] Override http request option.
191
+ * @throws {RequiredError}
192
+ */
193
+ getStripePaymentAccount: async (project: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
194
+ // verify required parameter 'project' is not null or undefined
195
+ assertParamExists('getStripePaymentAccount', 'project', project)
196
+ const localVarPath = `/v1/website/payment/stripe`;
197
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
198
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
199
+ let baseOptions;
200
+ if (configuration) {
201
+ baseOptions = configuration.baseOptions;
202
+ }
203
+
204
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
205
+ const localVarHeaderParameter = {} as any;
206
+ const localVarQueryParameter = {} as any;
207
+
208
+ // authentication session-oauth required
209
+ // oauth required
210
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
211
+
212
+ // authentication api-key required
213
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
214
+
215
+ if (project !== undefined) {
216
+ localVarQueryParameter['project'] = project;
217
+ }
218
+
219
+
220
+
221
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
222
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
223
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
224
+
225
+ return {
226
+ url: toPathString(localVarUrlObj),
227
+ options: localVarRequestOptions,
228
+ };
229
+ },
230
+ }
231
+ };
232
+
233
+ /**
234
+ * PaymentApi - functional programming interface
235
+ * @export
236
+ */
237
+ export const PaymentApiFp = function(configuration?: Configuration) {
238
+ const localVarAxiosParamCreator = PaymentApiAxiosParamCreator(configuration)
239
+ return {
240
+ /**
241
+ * Authorize a Stripe payment account
242
+ * @summary Authorize Stripe
243
+ * @param {string} project What project it is
244
+ * @param {*} [options] Override http request option.
245
+ * @throws {RequiredError}
246
+ */
247
+ async authorizeStripe(project: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthorizeStripe200Response>> {
248
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authorizeStripe(project, options);
249
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
250
+ const localVarOperationServerBasePath = operationServerMap['PaymentApi.authorizeStripe']?.[localVarOperationServerIndex]?.url;
251
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
252
+ },
253
+ /**
254
+ * Deauthorize a Stripe payment account
255
+ * @summary Deauthorize Stripe
256
+ * @param {string} project What project it is
257
+ * @param {*} [options] Override http request option.
258
+ * @throws {RequiredError}
259
+ */
260
+ async deauthorizeStripe(project: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
261
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deauthorizeStripe(project, options);
262
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
263
+ const localVarOperationServerBasePath = operationServerMap['PaymentApi.deauthorizeStripe']?.[localVarOperationServerIndex]?.url;
264
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
265
+ },
266
+ /**
267
+ * Get the Stripe payment account for the project
268
+ * @summary Get Stripe Payment Account
269
+ * @param {string} project What project it is
270
+ * @param {*} [options] Override http request option.
271
+ * @throws {RequiredError}
272
+ */
273
+ async getStripePaymentAccount(project: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentAccount>> {
274
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getStripePaymentAccount(project, options);
275
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
276
+ const localVarOperationServerBasePath = operationServerMap['PaymentApi.getStripePaymentAccount']?.[localVarOperationServerIndex]?.url;
277
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
278
+ },
279
+ }
280
+ };
281
+
282
+ /**
283
+ * PaymentApi - factory interface
284
+ * @export
285
+ */
286
+ export const PaymentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
287
+ const localVarFp = PaymentApiFp(configuration)
288
+ return {
289
+ /**
290
+ * Authorize a Stripe payment account
291
+ * @summary Authorize Stripe
292
+ * @param {PaymentApiAuthorizeStripeRequest} requestParameters Request parameters.
293
+ * @param {*} [options] Override http request option.
294
+ * @throws {RequiredError}
295
+ */
296
+ authorizeStripe(requestParameters: PaymentApiAuthorizeStripeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthorizeStripe200Response> {
297
+ return localVarFp.authorizeStripe(requestParameters.project, options).then((request) => request(axios, basePath));
298
+ },
299
+ /**
300
+ * Deauthorize a Stripe payment account
301
+ * @summary Deauthorize Stripe
302
+ * @param {PaymentApiDeauthorizeStripeRequest} requestParameters Request parameters.
303
+ * @param {*} [options] Override http request option.
304
+ * @throws {RequiredError}
305
+ */
306
+ deauthorizeStripe(requestParameters: PaymentApiDeauthorizeStripeRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
307
+ return localVarFp.deauthorizeStripe(requestParameters.project, options).then((request) => request(axios, basePath));
308
+ },
309
+ /**
310
+ * Get the Stripe payment account for the project
311
+ * @summary Get Stripe Payment Account
312
+ * @param {PaymentApiGetStripePaymentAccountRequest} requestParameters Request parameters.
313
+ * @param {*} [options] Override http request option.
314
+ * @throws {RequiredError}
315
+ */
316
+ getStripePaymentAccount(requestParameters: PaymentApiGetStripePaymentAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise<PaymentAccount> {
317
+ return localVarFp.getStripePaymentAccount(requestParameters.project, options).then((request) => request(axios, basePath));
318
+ },
319
+ };
320
+ };
321
+
322
+ /**
323
+ * Request parameters for authorizeStripe operation in PaymentApi.
324
+ * @export
325
+ * @interface PaymentApiAuthorizeStripeRequest
326
+ */
327
+ export interface PaymentApiAuthorizeStripeRequest {
328
+ /**
329
+ * What project it is
330
+ * @type {string}
331
+ * @memberof PaymentApiAuthorizeStripe
332
+ */
333
+ readonly project: string
334
+ }
335
+
336
+ /**
337
+ * Request parameters for deauthorizeStripe operation in PaymentApi.
338
+ * @export
339
+ * @interface PaymentApiDeauthorizeStripeRequest
340
+ */
341
+ export interface PaymentApiDeauthorizeStripeRequest {
342
+ /**
343
+ * What project it is
344
+ * @type {string}
345
+ * @memberof PaymentApiDeauthorizeStripe
346
+ */
347
+ readonly project: string
348
+ }
349
+
350
+ /**
351
+ * Request parameters for getStripePaymentAccount operation in PaymentApi.
352
+ * @export
353
+ * @interface PaymentApiGetStripePaymentAccountRequest
354
+ */
355
+ export interface PaymentApiGetStripePaymentAccountRequest {
356
+ /**
357
+ * What project it is
358
+ * @type {string}
359
+ * @memberof PaymentApiGetStripePaymentAccount
360
+ */
361
+ readonly project: string
362
+ }
363
+
364
+ /**
365
+ * PaymentApi - object-oriented interface
366
+ * @export
367
+ * @class PaymentApi
368
+ * @extends {BaseAPI}
369
+ */
370
+ export class PaymentApi extends BaseAPI {
371
+ /**
372
+ * Authorize a Stripe payment account
373
+ * @summary Authorize Stripe
374
+ * @param {PaymentApiAuthorizeStripeRequest} requestParameters Request parameters.
375
+ * @param {*} [options] Override http request option.
376
+ * @throws {RequiredError}
377
+ * @memberof PaymentApi
378
+ */
379
+ public authorizeStripe(requestParameters: PaymentApiAuthorizeStripeRequest, options?: RawAxiosRequestConfig) {
380
+ return PaymentApiFp(this.configuration).authorizeStripe(requestParameters.project, options).then((request) => request(this.axios, this.basePath));
381
+ }
382
+
383
+ /**
384
+ * Deauthorize a Stripe payment account
385
+ * @summary Deauthorize Stripe
386
+ * @param {PaymentApiDeauthorizeStripeRequest} requestParameters Request parameters.
387
+ * @param {*} [options] Override http request option.
388
+ * @throws {RequiredError}
389
+ * @memberof PaymentApi
390
+ */
391
+ public deauthorizeStripe(requestParameters: PaymentApiDeauthorizeStripeRequest, options?: RawAxiosRequestConfig) {
392
+ return PaymentApiFp(this.configuration).deauthorizeStripe(requestParameters.project, options).then((request) => request(this.axios, this.basePath));
393
+ }
394
+
395
+ /**
396
+ * Get the Stripe payment account for the project
397
+ * @summary Get Stripe Payment Account
398
+ * @param {PaymentApiGetStripePaymentAccountRequest} requestParameters Request parameters.
399
+ * @param {*} [options] Override http request option.
400
+ * @throws {RequiredError}
401
+ * @memberof PaymentApi
402
+ */
403
+ public getStripePaymentAccount(requestParameters: PaymentApiGetStripePaymentAccountRequest, options?: RawAxiosRequestConfig) {
404
+ return PaymentApiFp(this.configuration).getStripePaymentAccount(requestParameters.project, options).then((request) => request(this.axios, this.basePath));
405
+ }
406
+ }
407
+
408
+
409
+
package/base.ts ADDED
@@ -0,0 +1,86 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Website API
5
+ * Manage your Teemill Website Currently this API is in development and is not yet publicly accessible. All paths and models are subject to change. For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.6
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20
+ import globalAxios from 'axios';
21
+
22
+ export const BASE_PATH = "https://api.localhost:8080".replace(/\/+$/, "");
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const COLLECTION_FORMATS = {
29
+ csv: ",",
30
+ ssv: " ",
31
+ tsv: "\t",
32
+ pipes: "|",
33
+ };
34
+
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface RequestArgs
39
+ */
40
+ export interface RequestArgs {
41
+ url: string;
42
+ options: RawAxiosRequestConfig;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @class BaseAPI
49
+ */
50
+ export class BaseAPI {
51
+ protected configuration: Configuration | undefined;
52
+
53
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54
+ if (configuration) {
55
+ this.configuration = configuration;
56
+ this.basePath = configuration.basePath ?? basePath;
57
+ }
58
+ }
59
+ };
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ * @class RequiredError
65
+ * @extends {Error}
66
+ */
67
+ export class RequiredError extends Error {
68
+ constructor(public field: string, msg?: string) {
69
+ super(msg);
70
+ this.name = "RequiredError"
71
+ }
72
+ }
73
+
74
+ interface ServerMap {
75
+ [key: string]: {
76
+ url: string,
77
+ description: string,
78
+ }[];
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @export
84
+ */
85
+ export const operationServerMap: ServerMap = {
86
+ }
package/common.ts ADDED
@@ -0,0 +1,150 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Website API
5
+ * Manage your Teemill Website Currently this API is in development and is not yet publicly accessible. All paths and models are subject to change. For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.6
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from "./configuration";
17
+ import type { RequestArgs } from "./base";
18
+ import type { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { RequiredError } from "./base";
20
+
21
+ /**
22
+ *
23
+ * @export
24
+ */
25
+ export const DUMMY_BASE_URL = 'https://example.com'
26
+
27
+ /**
28
+ *
29
+ * @throws {RequiredError}
30
+ * @export
31
+ */
32
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ */
42
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
43
+ if (configuration && configuration.apiKey) {
44
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
+ ? await configuration.apiKey(keyParamName)
46
+ : await configuration.apiKey;
47
+ object[keyParamName] = localVarApiKeyValue;
48
+ }
49
+ }
50
+
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
66
+ if (configuration && configuration.accessToken) {
67
+ const accessToken = typeof configuration.accessToken === 'function'
68
+ ? await configuration.accessToken()
69
+ : await configuration.accessToken;
70
+ object["Authorization"] = "Bearer " + accessToken;
71
+ }
72
+ }
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ */
78
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
79
+ if (configuration && configuration.accessToken) {
80
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
+ ? await configuration.accessToken(name, scopes)
82
+ : await configuration.accessToken;
83
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
+ }
85
+ }
86
+
87
+ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter)) {
91
+ (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
92
+ }
93
+ else {
94
+ Object.keys(parameter).forEach(currentKey =>
95
+ setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
+ );
97
+ }
98
+ }
99
+ else {
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = decodeURIComponent(searchParams.toString());
117
+ }
118
+
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ }
132
+
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ export const toPathString = function (url: URL) {
138
+ return url.pathname + url.search + url.hash
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ */
145
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }