@tennac-booking/sdk 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +16 -11
- package/README.md +29 -1
- package/api.ts +668 -0
- package/base.ts +86 -0
- package/common.ts +150 -0
- package/configuration.ts +115 -0
- package/dist/api.d.ts +482 -0
- package/dist/api.js +323 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +65 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +161 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +44 -0
- package/dist/esm/api.d.ts +482 -0
- package/dist/esm/api.js +312 -0
- package/dist/esm/base.d.ts +66 -0
- package/dist/esm/base.js +60 -0
- package/dist/esm/common.d.ts +65 -0
- package/dist/esm/common.js +149 -0
- package/dist/esm/configuration.d.ts +91 -0
- package/dist/esm/configuration.js +40 -0
- package/dist/esm/index.d.ts +13 -3
- package/dist/esm/index.js +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +15 -5
- package/docs/AuthApi.md +88 -0
- package/docs/Booking.md +32 -0
- package/docs/BookingStatus.md +10 -0
- package/docs/Court.md +32 -0
- package/docs/CourtStatus.md +10 -0
- package/docs/Slot.md +24 -0
- package/docs/SlotException.md +26 -0
- package/docs/StripeStatus.md +16 -0
- package/docs/User.md +40 -0
- package/docs/UsersApi.md +51 -0
- package/git_push.sh +57 -0
- package/index.ts +16 -3
- package/package.json +14 -2
- package/tsconfig.json +4 -2
package/dist/api.js
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Pickle Ball API
|
|
6
|
+
* API for managing pickle ball games and players
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = exports.AuthApi = exports.AuthApiFactory = exports.AuthApiFp = exports.AuthApiAxiosParamCreator = exports.StripeStatus = exports.CourtStatus = exports.BookingStatus = void 0;
|
|
26
|
+
const axios_1 = require("axios");
|
|
27
|
+
// Some imports not used depending on template conditions
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const common_1 = require("./common");
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
const base_1 = require("./base");
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @export
|
|
35
|
+
* @enum {string}
|
|
36
|
+
*/
|
|
37
|
+
exports.BookingStatus = {
|
|
38
|
+
Active: 'active',
|
|
39
|
+
Inactive: 'inactive'
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
* @enum {string}
|
|
45
|
+
*/
|
|
46
|
+
exports.CourtStatus = {
|
|
47
|
+
Available: 'available',
|
|
48
|
+
Unavailable: 'unavailable'
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @export
|
|
53
|
+
* @enum {string}
|
|
54
|
+
*/
|
|
55
|
+
exports.StripeStatus = {
|
|
56
|
+
Pending: 'pending',
|
|
57
|
+
Paid: 'paid',
|
|
58
|
+
Failed: 'failed',
|
|
59
|
+
Refunded: 'refunded',
|
|
60
|
+
Canceled: 'canceled'
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* AuthApi - axios parameter creator
|
|
64
|
+
* @export
|
|
65
|
+
*/
|
|
66
|
+
const AuthApiAxiosParamCreator = function (configuration) {
|
|
67
|
+
return {
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @summary Register a new user
|
|
71
|
+
* @param {string} firstName
|
|
72
|
+
* @param {string} lastName
|
|
73
|
+
* @param {string} email
|
|
74
|
+
* @param {string} password
|
|
75
|
+
* @param {string} [username]
|
|
76
|
+
* @param {boolean} [isAccountVerified]
|
|
77
|
+
* @param {string} [level]
|
|
78
|
+
* @param {string} [stripeCustomerId]
|
|
79
|
+
* @param {string} [phone]
|
|
80
|
+
* @param {string} [profilePicture]
|
|
81
|
+
* @param {boolean} [isAdmin]
|
|
82
|
+
* @param {*} [options] Override http request option.
|
|
83
|
+
* @throws {RequiredError}
|
|
84
|
+
*/
|
|
85
|
+
apiAuthRegisterPost: (firstName_1, lastName_1, email_1, password_1, username_1, isAccountVerified_1, level_1, stripeCustomerId_1, phone_1, profilePicture_1, isAdmin_1, ...args_1) => __awaiter(this, [firstName_1, lastName_1, email_1, password_1, username_1, isAccountVerified_1, level_1, stripeCustomerId_1, phone_1, profilePicture_1, isAdmin_1, ...args_1], void 0, function* (firstName, lastName, email, password, username, isAccountVerified, level, stripeCustomerId, phone, profilePicture, isAdmin, options = {}) {
|
|
86
|
+
// verify required parameter 'firstName' is not null or undefined
|
|
87
|
+
(0, common_1.assertParamExists)('apiAuthRegisterPost', 'firstName', firstName);
|
|
88
|
+
// verify required parameter 'lastName' is not null or undefined
|
|
89
|
+
(0, common_1.assertParamExists)('apiAuthRegisterPost', 'lastName', lastName);
|
|
90
|
+
// verify required parameter 'email' is not null or undefined
|
|
91
|
+
(0, common_1.assertParamExists)('apiAuthRegisterPost', 'email', email);
|
|
92
|
+
// verify required parameter 'password' is not null or undefined
|
|
93
|
+
(0, common_1.assertParamExists)('apiAuthRegisterPost', 'password', password);
|
|
94
|
+
const localVarPath = `/api/auth/register`;
|
|
95
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
96
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
97
|
+
let baseOptions;
|
|
98
|
+
if (configuration) {
|
|
99
|
+
baseOptions = configuration.baseOptions;
|
|
100
|
+
}
|
|
101
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
102
|
+
const localVarHeaderParameter = {};
|
|
103
|
+
const localVarQueryParameter = {};
|
|
104
|
+
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
|
|
105
|
+
if (username !== undefined) {
|
|
106
|
+
localVarFormParams.append('username', username);
|
|
107
|
+
}
|
|
108
|
+
if (firstName !== undefined) {
|
|
109
|
+
localVarFormParams.append('firstName', firstName);
|
|
110
|
+
}
|
|
111
|
+
if (lastName !== undefined) {
|
|
112
|
+
localVarFormParams.append('lastName', lastName);
|
|
113
|
+
}
|
|
114
|
+
if (email !== undefined) {
|
|
115
|
+
localVarFormParams.append('email', email);
|
|
116
|
+
}
|
|
117
|
+
if (isAccountVerified !== undefined) {
|
|
118
|
+
localVarFormParams.append('isAccountVerified', String(isAccountVerified));
|
|
119
|
+
}
|
|
120
|
+
if (level !== undefined) {
|
|
121
|
+
localVarFormParams.append('level', level);
|
|
122
|
+
}
|
|
123
|
+
if (stripeCustomerId !== undefined) {
|
|
124
|
+
localVarFormParams.append('stripeCustomerId', stripeCustomerId);
|
|
125
|
+
}
|
|
126
|
+
if (phone !== undefined) {
|
|
127
|
+
localVarFormParams.append('phone', phone);
|
|
128
|
+
}
|
|
129
|
+
if (password !== undefined) {
|
|
130
|
+
localVarFormParams.append('password', password);
|
|
131
|
+
}
|
|
132
|
+
if (profilePicture !== undefined) {
|
|
133
|
+
localVarFormParams.append('profilePicture', profilePicture);
|
|
134
|
+
}
|
|
135
|
+
if (isAdmin !== undefined) {
|
|
136
|
+
localVarFormParams.append('isAdmin', String(isAdmin));
|
|
137
|
+
}
|
|
138
|
+
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
|
|
139
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
140
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
141
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
142
|
+
localVarRequestOptions.data = localVarFormParams;
|
|
143
|
+
return {
|
|
144
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
145
|
+
options: localVarRequestOptions,
|
|
146
|
+
};
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
exports.AuthApiAxiosParamCreator = AuthApiAxiosParamCreator;
|
|
151
|
+
/**
|
|
152
|
+
* AuthApi - functional programming interface
|
|
153
|
+
* @export
|
|
154
|
+
*/
|
|
155
|
+
const AuthApiFp = function (configuration) {
|
|
156
|
+
const localVarAxiosParamCreator = (0, exports.AuthApiAxiosParamCreator)(configuration);
|
|
157
|
+
return {
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
* @summary Register a new user
|
|
161
|
+
* @param {string} firstName
|
|
162
|
+
* @param {string} lastName
|
|
163
|
+
* @param {string} email
|
|
164
|
+
* @param {string} password
|
|
165
|
+
* @param {string} [username]
|
|
166
|
+
* @param {boolean} [isAccountVerified]
|
|
167
|
+
* @param {string} [level]
|
|
168
|
+
* @param {string} [stripeCustomerId]
|
|
169
|
+
* @param {string} [phone]
|
|
170
|
+
* @param {string} [profilePicture]
|
|
171
|
+
* @param {boolean} [isAdmin]
|
|
172
|
+
* @param {*} [options] Override http request option.
|
|
173
|
+
* @throws {RequiredError}
|
|
174
|
+
*/
|
|
175
|
+
apiAuthRegisterPost(firstName, lastName, email, password, username, isAccountVerified, level, stripeCustomerId, phone, profilePicture, isAdmin, options) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
var _a, _b, _c;
|
|
178
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.apiAuthRegisterPost(firstName, lastName, email, password, username, isAccountVerified, level, stripeCustomerId, phone, profilePicture, isAdmin, options);
|
|
179
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
180
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AuthApi.apiAuthRegisterPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
181
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
exports.AuthApiFp = AuthApiFp;
|
|
187
|
+
/**
|
|
188
|
+
* AuthApi - factory interface
|
|
189
|
+
* @export
|
|
190
|
+
*/
|
|
191
|
+
const AuthApiFactory = function (configuration, basePath, axios) {
|
|
192
|
+
const localVarFp = (0, exports.AuthApiFp)(configuration);
|
|
193
|
+
return {
|
|
194
|
+
/**
|
|
195
|
+
*
|
|
196
|
+
* @summary Register a new user
|
|
197
|
+
* @param {AuthApiApiAuthRegisterPostRequest} requestParameters Request parameters.
|
|
198
|
+
* @param {*} [options] Override http request option.
|
|
199
|
+
* @throws {RequiredError}
|
|
200
|
+
*/
|
|
201
|
+
apiAuthRegisterPost(requestParameters, options) {
|
|
202
|
+
return localVarFp.apiAuthRegisterPost(requestParameters.firstName, requestParameters.lastName, requestParameters.email, requestParameters.password, requestParameters.username, requestParameters.isAccountVerified, requestParameters.level, requestParameters.stripeCustomerId, requestParameters.phone, requestParameters.profilePicture, requestParameters.isAdmin, options).then((request) => request(axios, basePath));
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
exports.AuthApiFactory = AuthApiFactory;
|
|
207
|
+
/**
|
|
208
|
+
* AuthApi - object-oriented interface
|
|
209
|
+
* @export
|
|
210
|
+
* @class AuthApi
|
|
211
|
+
* @extends {BaseAPI}
|
|
212
|
+
*/
|
|
213
|
+
class AuthApi extends base_1.BaseAPI {
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
* @summary Register a new user
|
|
217
|
+
* @param {AuthApiApiAuthRegisterPostRequest} requestParameters Request parameters.
|
|
218
|
+
* @param {*} [options] Override http request option.
|
|
219
|
+
* @throws {RequiredError}
|
|
220
|
+
* @memberof AuthApi
|
|
221
|
+
*/
|
|
222
|
+
apiAuthRegisterPost(requestParameters, options) {
|
|
223
|
+
return (0, exports.AuthApiFp)(this.configuration).apiAuthRegisterPost(requestParameters.firstName, requestParameters.lastName, requestParameters.email, requestParameters.password, requestParameters.username, requestParameters.isAccountVerified, requestParameters.level, requestParameters.stripeCustomerId, requestParameters.phone, requestParameters.profilePicture, requestParameters.isAdmin, options).then((request) => request(this.axios, this.basePath));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
exports.AuthApi = AuthApi;
|
|
227
|
+
/**
|
|
228
|
+
* UsersApi - axios parameter creator
|
|
229
|
+
* @export
|
|
230
|
+
*/
|
|
231
|
+
const UsersApiAxiosParamCreator = function (configuration) {
|
|
232
|
+
return {
|
|
233
|
+
/**
|
|
234
|
+
*
|
|
235
|
+
* @summary Retrieve all users
|
|
236
|
+
* @param {*} [options] Override http request option.
|
|
237
|
+
* @throws {RequiredError}
|
|
238
|
+
*/
|
|
239
|
+
apiUsersGet: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
|
|
240
|
+
const localVarPath = `/api/users`;
|
|
241
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
242
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
243
|
+
let baseOptions;
|
|
244
|
+
if (configuration) {
|
|
245
|
+
baseOptions = configuration.baseOptions;
|
|
246
|
+
}
|
|
247
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
248
|
+
const localVarHeaderParameter = {};
|
|
249
|
+
const localVarQueryParameter = {};
|
|
250
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
251
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
252
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
253
|
+
return {
|
|
254
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
255
|
+
options: localVarRequestOptions,
|
|
256
|
+
};
|
|
257
|
+
}),
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
exports.UsersApiAxiosParamCreator = UsersApiAxiosParamCreator;
|
|
261
|
+
/**
|
|
262
|
+
* UsersApi - functional programming interface
|
|
263
|
+
* @export
|
|
264
|
+
*/
|
|
265
|
+
const UsersApiFp = function (configuration) {
|
|
266
|
+
const localVarAxiosParamCreator = (0, exports.UsersApiAxiosParamCreator)(configuration);
|
|
267
|
+
return {
|
|
268
|
+
/**
|
|
269
|
+
*
|
|
270
|
+
* @summary Retrieve all users
|
|
271
|
+
* @param {*} [options] Override http request option.
|
|
272
|
+
* @throws {RequiredError}
|
|
273
|
+
*/
|
|
274
|
+
apiUsersGet(options) {
|
|
275
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
276
|
+
var _a, _b, _c;
|
|
277
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.apiUsersGet(options);
|
|
278
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
279
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UsersApi.apiUsersGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
280
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
exports.UsersApiFp = UsersApiFp;
|
|
286
|
+
/**
|
|
287
|
+
* UsersApi - factory interface
|
|
288
|
+
* @export
|
|
289
|
+
*/
|
|
290
|
+
const UsersApiFactory = function (configuration, basePath, axios) {
|
|
291
|
+
const localVarFp = (0, exports.UsersApiFp)(configuration);
|
|
292
|
+
return {
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* @summary Retrieve all users
|
|
296
|
+
* @param {*} [options] Override http request option.
|
|
297
|
+
* @throws {RequiredError}
|
|
298
|
+
*/
|
|
299
|
+
apiUsersGet(options) {
|
|
300
|
+
return localVarFp.apiUsersGet(options).then((request) => request(axios, basePath));
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
exports.UsersApiFactory = UsersApiFactory;
|
|
305
|
+
/**
|
|
306
|
+
* UsersApi - object-oriented interface
|
|
307
|
+
* @export
|
|
308
|
+
* @class UsersApi
|
|
309
|
+
* @extends {BaseAPI}
|
|
310
|
+
*/
|
|
311
|
+
class UsersApi extends base_1.BaseAPI {
|
|
312
|
+
/**
|
|
313
|
+
*
|
|
314
|
+
* @summary Retrieve all users
|
|
315
|
+
* @param {*} [options] Override http request option.
|
|
316
|
+
* @throws {RequiredError}
|
|
317
|
+
* @memberof UsersApi
|
|
318
|
+
*/
|
|
319
|
+
apiUsersGet(options) {
|
|
320
|
+
return (0, exports.UsersApiFp)(this.configuration).apiUsersGet(options).then((request) => request(this.axios, this.basePath));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
exports.UsersApi = UsersApi;
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pickle Ball API
|
|
3
|
+
* API for managing pickle ball games and players
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from './configuration';
|
|
13
|
+
import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLLECTION_FORMATS: {
|
|
20
|
+
csv: string;
|
|
21
|
+
ssv: string;
|
|
22
|
+
tsv: string;
|
|
23
|
+
pipes: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface RequestArgs
|
|
29
|
+
*/
|
|
30
|
+
export interface RequestArgs {
|
|
31
|
+
url: string;
|
|
32
|
+
options: RawAxiosRequestConfig;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @class BaseAPI
|
|
38
|
+
*/
|
|
39
|
+
export declare class BaseAPI {
|
|
40
|
+
protected basePath: string;
|
|
41
|
+
protected axios: AxiosInstance;
|
|
42
|
+
protected configuration: Configuration | undefined;
|
|
43
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class RequiredError
|
|
49
|
+
* @extends {Error}
|
|
50
|
+
*/
|
|
51
|
+
export declare class RequiredError extends Error {
|
|
52
|
+
field: string;
|
|
53
|
+
constructor(field: string, msg?: string);
|
|
54
|
+
}
|
|
55
|
+
interface ServerMap {
|
|
56
|
+
[key: string]: {
|
|
57
|
+
url: string;
|
|
58
|
+
description: string;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
export declare const operationServerMap: ServerMap;
|
|
66
|
+
export {};
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Pickle Ball API
|
|
6
|
+
* API for managing pickle ball games and players
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
17
|
+
const axios_1 = require("axios");
|
|
18
|
+
exports.BASE_PATH = "https://api.mon-domaine.com".replace(/\/+$/, "");
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
*/
|
|
23
|
+
exports.COLLECTION_FORMATS = {
|
|
24
|
+
csv: ",",
|
|
25
|
+
ssv: " ",
|
|
26
|
+
tsv: "\t",
|
|
27
|
+
pipes: "|",
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @export
|
|
32
|
+
* @class BaseAPI
|
|
33
|
+
*/
|
|
34
|
+
class BaseAPI {
|
|
35
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
36
|
+
var _a;
|
|
37
|
+
this.basePath = basePath;
|
|
38
|
+
this.axios = axios;
|
|
39
|
+
if (configuration) {
|
|
40
|
+
this.configuration = configuration;
|
|
41
|
+
this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.BaseAPI = BaseAPI;
|
|
46
|
+
;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
* @class RequiredError
|
|
51
|
+
* @extends {Error}
|
|
52
|
+
*/
|
|
53
|
+
class RequiredError extends Error {
|
|
54
|
+
constructor(field, msg) {
|
|
55
|
+
super(msg);
|
|
56
|
+
this.field = field;
|
|
57
|
+
this.name = "RequiredError";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.RequiredError = RequiredError;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
exports.operationServerMap = {};
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pickle Ball API
|
|
3
|
+
* API for managing pickle ball games and players
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from "./configuration";
|
|
13
|
+
import type { RequestArgs } from "./base";
|
|
14
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const toPathString: (url: URL) => string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Pickle Ball API
|
|
6
|
+
* API for managing pickle ball games and players
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
26
|
+
const base_1 = require("./base");
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @throws {RequiredError}
|
|
35
|
+
* @export
|
|
36
|
+
*/
|
|
37
|
+
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
38
|
+
if (paramValue === null || paramValue === undefined) {
|
|
39
|
+
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.assertParamExists = assertParamExists;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
const setApiKeyToObject = function (object, keyParamName, configuration) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
if (configuration && configuration.apiKey) {
|
|
50
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
51
|
+
? yield configuration.apiKey(keyParamName)
|
|
52
|
+
: yield configuration.apiKey;
|
|
53
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
exports.setApiKeyToObject = setApiKeyToObject;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @export
|
|
61
|
+
*/
|
|
62
|
+
const setBasicAuthToObject = function (object, configuration) {
|
|
63
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
64
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @export
|
|
71
|
+
*/
|
|
72
|
+
const setBearerAuthToObject = function (object, configuration) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
if (configuration && configuration.accessToken) {
|
|
75
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
76
|
+
? yield configuration.accessToken()
|
|
77
|
+
: yield configuration.accessToken;
|
|
78
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @export
|
|
86
|
+
*/
|
|
87
|
+
const setOAuthToObject = function (object, name, scopes, configuration) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
if (configuration && configuration.accessToken) {
|
|
90
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
91
|
+
? yield configuration.accessToken(name, scopes)
|
|
92
|
+
: yield configuration.accessToken;
|
|
93
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
exports.setOAuthToObject = setOAuthToObject;
|
|
98
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
99
|
+
if (parameter == null)
|
|
100
|
+
return;
|
|
101
|
+
if (typeof parameter === "object") {
|
|
102
|
+
if (Array.isArray(parameter)) {
|
|
103
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (urlSearchParams.has(key)) {
|
|
111
|
+
urlSearchParams.append(key, parameter);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
urlSearchParams.set(key, parameter);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* @export
|
|
121
|
+
*/
|
|
122
|
+
const setSearchParams = function (url, ...objects) {
|
|
123
|
+
const searchParams = new URLSearchParams(url.search);
|
|
124
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
125
|
+
url.search = searchParams.toString();
|
|
126
|
+
};
|
|
127
|
+
exports.setSearchParams = setSearchParams;
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* @export
|
|
131
|
+
*/
|
|
132
|
+
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
133
|
+
const nonString = typeof value !== 'string';
|
|
134
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
135
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
136
|
+
: nonString;
|
|
137
|
+
return needsSerialization
|
|
138
|
+
? JSON.stringify(value !== undefined ? value : {})
|
|
139
|
+
: (value || "");
|
|
140
|
+
};
|
|
141
|
+
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* @export
|
|
145
|
+
*/
|
|
146
|
+
const toPathString = function (url) {
|
|
147
|
+
return url.pathname + url.search + url.hash;
|
|
148
|
+
};
|
|
149
|
+
exports.toPathString = toPathString;
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @export
|
|
153
|
+
*/
|
|
154
|
+
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
155
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
156
|
+
var _a;
|
|
157
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
|
|
158
|
+
return axios.request(axiosRequestArgs);
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
exports.createRequestFunction = createRequestFunction;
|