@tennac-booking/sdk 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.
- package/.openapi-generator/FILES +17 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/apis/AuthApi.ts +157 -0
- package/apis/UsersApi.ts +56 -0
- package/apis/index.ts +4 -0
- package/dist/apis/AuthApi.d.ts +39 -0
- package/dist/apis/AuthApi.js +117 -0
- package/dist/apis/UsersApi.d.ts +26 -0
- package/dist/apis/UsersApi.js +58 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/esm/apis/AuthApi.d.ts +39 -0
- package/dist/esm/apis/AuthApi.js +113 -0
- package/dist/esm/apis/UsersApi.d.ts +26 -0
- package/dist/esm/apis/UsersApi.js +54 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +4 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/Booking.d.ts +87 -0
- package/dist/esm/models/Booking.js +82 -0
- package/dist/esm/models/Court.d.ts +76 -0
- package/dist/esm/models/Court.js +72 -0
- package/dist/esm/models/Slot.d.ts +44 -0
- package/dist/esm/models/Slot.js +51 -0
- package/dist/esm/models/SlotException.d.ts +50 -0
- package/dist/esm/models/SlotException.js +55 -0
- package/dist/esm/models/User.d.ts +92 -0
- package/dist/esm/models/User.js +69 -0
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +7 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/esm/src/apis/AuthApi.d.ts +39 -0
- package/dist/esm/src/apis/AuthApi.js +113 -0
- package/dist/esm/src/apis/UsersApi.d.ts +26 -0
- package/dist/esm/src/apis/UsersApi.js +54 -0
- package/dist/esm/src/apis/index.d.ts +2 -0
- package/dist/esm/src/apis/index.js +4 -0
- package/dist/esm/src/index.d.ts +3 -0
- package/dist/esm/src/index.js +5 -0
- package/dist/esm/src/models/Booking.d.ts +87 -0
- package/dist/esm/src/models/Booking.js +82 -0
- package/dist/esm/src/models/Court.d.ts +76 -0
- package/dist/esm/src/models/Court.js +72 -0
- package/dist/esm/src/models/Slot.d.ts +44 -0
- package/dist/esm/src/models/Slot.js +51 -0
- package/dist/esm/src/models/SlotException.d.ts +50 -0
- package/dist/esm/src/models/SlotException.js +55 -0
- package/dist/esm/src/models/User.d.ts +92 -0
- package/dist/esm/src/models/User.js +69 -0
- package/dist/esm/src/models/index.d.ts +5 -0
- package/dist/esm/src/models/index.js +7 -0
- package/dist/esm/src/runtime.d.ts +184 -0
- package/dist/esm/src/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Booking.d.ts +87 -0
- package/dist/models/Booking.js +90 -0
- package/dist/models/Court.d.ts +76 -0
- package/dist/models/Court.js +80 -0
- package/dist/models/Slot.d.ts +44 -0
- package/dist/models/Slot.js +58 -0
- package/dist/models/SlotException.d.ts +50 -0
- package/dist/models/SlotException.js +62 -0
- package/dist/models/User.d.ts +92 -0
- package/dist/models/User.js +76 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +23 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/dist/src/apis/AuthApi.d.ts +39 -0
- package/dist/src/apis/AuthApi.js +117 -0
- package/dist/src/apis/UsersApi.d.ts +26 -0
- package/dist/src/apis/UsersApi.js +58 -0
- package/dist/src/apis/index.d.ts +2 -0
- package/dist/src/apis/index.js +20 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +21 -0
- package/dist/src/models/Booking.d.ts +87 -0
- package/dist/src/models/Booking.js +90 -0
- package/dist/src/models/Court.d.ts +76 -0
- package/dist/src/models/Court.js +80 -0
- package/dist/src/models/Slot.d.ts +44 -0
- package/dist/src/models/Slot.js +58 -0
- package/dist/src/models/SlotException.d.ts +50 -0
- package/dist/src/models/SlotException.js +62 -0
- package/dist/src/models/User.d.ts +92 -0
- package/dist/src/models/User.js +76 -0
- package/dist/src/models/index.d.ts +5 -0
- package/dist/src/models/index.js +23 -0
- package/dist/src/runtime.d.ts +184 -0
- package/dist/src/runtime.js +350 -0
- package/index.ts +5 -0
- package/models/Booking.ts +142 -0
- package/models/Court.ts +130 -0
- package/models/Slot.ts +84 -0
- package/models/SlotException.ts +93 -0
- package/models/User.ts +149 -0
- package/models/index.ts +7 -0
- package/package.json +20 -0
- package/runtime.ts +432 -0
- package/src/apis/AuthApi.ts +157 -0
- package/src/apis/UsersApi.ts +56 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/Booking.ts +142 -0
- package/src/models/Court.ts +130 -0
- package/src/models/Slot.ts +84 -0
- package/src/models/SlotException.ts +93 -0
- package/src/models/User.ts +149 -0
- package/src/models/index.ts +7 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export const BASE_PATH = "https://api.mon-domaine.com".replace(/\/+$/, "");
|
|
24
|
+
export class Configuration {
|
|
25
|
+
constructor(configuration = {}) {
|
|
26
|
+
this.configuration = configuration;
|
|
27
|
+
}
|
|
28
|
+
set config(configuration) {
|
|
29
|
+
this.configuration = configuration;
|
|
30
|
+
}
|
|
31
|
+
get basePath() {
|
|
32
|
+
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
33
|
+
}
|
|
34
|
+
get fetchApi() {
|
|
35
|
+
return this.configuration.fetchApi;
|
|
36
|
+
}
|
|
37
|
+
get middleware() {
|
|
38
|
+
return this.configuration.middleware || [];
|
|
39
|
+
}
|
|
40
|
+
get queryParamsStringify() {
|
|
41
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
42
|
+
}
|
|
43
|
+
get username() {
|
|
44
|
+
return this.configuration.username;
|
|
45
|
+
}
|
|
46
|
+
get password() {
|
|
47
|
+
return this.configuration.password;
|
|
48
|
+
}
|
|
49
|
+
get apiKey() {
|
|
50
|
+
const apiKey = this.configuration.apiKey;
|
|
51
|
+
if (apiKey) {
|
|
52
|
+
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
get accessToken() {
|
|
57
|
+
const accessToken = this.configuration.accessToken;
|
|
58
|
+
if (accessToken) {
|
|
59
|
+
return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
get headers() {
|
|
64
|
+
return this.configuration.headers;
|
|
65
|
+
}
|
|
66
|
+
get credentials() {
|
|
67
|
+
return this.configuration.credentials;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export const DefaultConfig = new Configuration();
|
|
71
|
+
/**
|
|
72
|
+
* This is the base class for all generated API classes.
|
|
73
|
+
*/
|
|
74
|
+
export class BaseAPI {
|
|
75
|
+
constructor(configuration = DefaultConfig) {
|
|
76
|
+
this.configuration = configuration;
|
|
77
|
+
this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
let fetchParams = { url, init };
|
|
79
|
+
for (const middleware of this.middleware) {
|
|
80
|
+
if (middleware.pre) {
|
|
81
|
+
fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
let response = undefined;
|
|
85
|
+
try {
|
|
86
|
+
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
for (const middleware of this.middleware) {
|
|
90
|
+
if (middleware.onError) {
|
|
91
|
+
response = (yield middleware.onError({
|
|
92
|
+
fetch: this.fetchApi,
|
|
93
|
+
url: fetchParams.url,
|
|
94
|
+
init: fetchParams.init,
|
|
95
|
+
error: e,
|
|
96
|
+
response: response ? response.clone() : undefined,
|
|
97
|
+
})) || response;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (response === undefined) {
|
|
101
|
+
if (e instanceof Error) {
|
|
102
|
+
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
throw e;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
for (const middleware of this.middleware) {
|
|
110
|
+
if (middleware.post) {
|
|
111
|
+
response = (yield middleware.post({
|
|
112
|
+
fetch: this.fetchApi,
|
|
113
|
+
url: fetchParams.url,
|
|
114
|
+
init: fetchParams.init,
|
|
115
|
+
response: response.clone(),
|
|
116
|
+
})) || response;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return response;
|
|
120
|
+
});
|
|
121
|
+
this.middleware = configuration.middleware;
|
|
122
|
+
}
|
|
123
|
+
withMiddleware(...middlewares) {
|
|
124
|
+
const next = this.clone();
|
|
125
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
126
|
+
return next;
|
|
127
|
+
}
|
|
128
|
+
withPreMiddleware(...preMiddlewares) {
|
|
129
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
130
|
+
return this.withMiddleware(...middlewares);
|
|
131
|
+
}
|
|
132
|
+
withPostMiddleware(...postMiddlewares) {
|
|
133
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
134
|
+
return this.withMiddleware(...middlewares);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Check if the given MIME is a JSON MIME.
|
|
138
|
+
* JSON MIME examples:
|
|
139
|
+
* application/json
|
|
140
|
+
* application/json; charset=UTF8
|
|
141
|
+
* APPLICATION/JSON
|
|
142
|
+
* application/vnd.company+json
|
|
143
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
144
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
145
|
+
*/
|
|
146
|
+
isJsonMime(mime) {
|
|
147
|
+
if (!mime) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return BaseAPI.jsonRegex.test(mime);
|
|
151
|
+
}
|
|
152
|
+
request(context, initOverrides) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const { url, init } = yield this.createFetchParams(context, initOverrides);
|
|
155
|
+
const response = yield this.fetchApi(url, init);
|
|
156
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
157
|
+
return response;
|
|
158
|
+
}
|
|
159
|
+
throw new ResponseError(response, 'Response returned an error code');
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
createFetchParams(context, initOverrides) {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
let url = this.configuration.basePath + context.path;
|
|
165
|
+
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
166
|
+
// only add the querystring to the URL if there are query parameters.
|
|
167
|
+
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
168
|
+
// do not handle correctly sometimes.
|
|
169
|
+
url += '?' + this.configuration.queryParamsStringify(context.query);
|
|
170
|
+
}
|
|
171
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
172
|
+
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
|
173
|
+
const initOverrideFn = typeof initOverrides === "function"
|
|
174
|
+
? initOverrides
|
|
175
|
+
: () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
|
|
176
|
+
const initParams = {
|
|
177
|
+
method: context.method,
|
|
178
|
+
headers,
|
|
179
|
+
body: context.body,
|
|
180
|
+
credentials: this.configuration.credentials,
|
|
181
|
+
};
|
|
182
|
+
const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
|
|
183
|
+
init: initParams,
|
|
184
|
+
context,
|
|
185
|
+
})));
|
|
186
|
+
let body;
|
|
187
|
+
if (isFormData(overriddenInit.body)
|
|
188
|
+
|| (overriddenInit.body instanceof URLSearchParams)
|
|
189
|
+
|| isBlob(overriddenInit.body)) {
|
|
190
|
+
body = overriddenInit.body;
|
|
191
|
+
}
|
|
192
|
+
else if (this.isJsonMime(headers['Content-Type'])) {
|
|
193
|
+
body = JSON.stringify(overriddenInit.body);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
body = overriddenInit.body;
|
|
197
|
+
}
|
|
198
|
+
const init = Object.assign(Object.assign({}, overriddenInit), { body });
|
|
199
|
+
return { url, init };
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
204
|
+
* and then shallow cloning data members.
|
|
205
|
+
*/
|
|
206
|
+
clone() {
|
|
207
|
+
const constructor = this.constructor;
|
|
208
|
+
const next = new constructor(this.configuration);
|
|
209
|
+
next.middleware = this.middleware.slice();
|
|
210
|
+
return next;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
|
|
214
|
+
;
|
|
215
|
+
function isBlob(value) {
|
|
216
|
+
return typeof Blob !== 'undefined' && value instanceof Blob;
|
|
217
|
+
}
|
|
218
|
+
function isFormData(value) {
|
|
219
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
220
|
+
}
|
|
221
|
+
export class ResponseError extends Error {
|
|
222
|
+
constructor(response, msg) {
|
|
223
|
+
super(msg);
|
|
224
|
+
this.response = response;
|
|
225
|
+
this.name = "ResponseError";
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
export class FetchError extends Error {
|
|
229
|
+
constructor(cause, msg) {
|
|
230
|
+
super(msg);
|
|
231
|
+
this.cause = cause;
|
|
232
|
+
this.name = "FetchError";
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
export class RequiredError extends Error {
|
|
236
|
+
constructor(field, msg) {
|
|
237
|
+
super(msg);
|
|
238
|
+
this.field = field;
|
|
239
|
+
this.name = "RequiredError";
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
export const COLLECTION_FORMATS = {
|
|
243
|
+
csv: ",",
|
|
244
|
+
ssv: " ",
|
|
245
|
+
tsv: "\t",
|
|
246
|
+
pipes: "|",
|
|
247
|
+
};
|
|
248
|
+
export function querystring(params, prefix = '') {
|
|
249
|
+
return Object.keys(params)
|
|
250
|
+
.map(key => querystringSingleKey(key, params[key], prefix))
|
|
251
|
+
.filter(part => part.length > 0)
|
|
252
|
+
.join('&');
|
|
253
|
+
}
|
|
254
|
+
function querystringSingleKey(key, value, keyPrefix = '') {
|
|
255
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
256
|
+
if (value instanceof Array) {
|
|
257
|
+
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
|
258
|
+
.join(`&${encodeURIComponent(fullKey)}=`);
|
|
259
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
260
|
+
}
|
|
261
|
+
if (value instanceof Set) {
|
|
262
|
+
const valueAsArray = Array.from(value);
|
|
263
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
264
|
+
}
|
|
265
|
+
if (value instanceof Date) {
|
|
266
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
267
|
+
}
|
|
268
|
+
if (value instanceof Object) {
|
|
269
|
+
return querystring(value, fullKey);
|
|
270
|
+
}
|
|
271
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
272
|
+
}
|
|
273
|
+
export function exists(json, key) {
|
|
274
|
+
const value = json[key];
|
|
275
|
+
return value !== null && value !== undefined;
|
|
276
|
+
}
|
|
277
|
+
export function mapValues(data, fn) {
|
|
278
|
+
const result = {};
|
|
279
|
+
for (const key of Object.keys(data)) {
|
|
280
|
+
result[key] = fn(data[key]);
|
|
281
|
+
}
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
export function canConsumeForm(consumes) {
|
|
285
|
+
for (const consume of consumes) {
|
|
286
|
+
if ('multipart/form-data' === consume.contentType) {
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
export class JSONApiResponse {
|
|
293
|
+
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
294
|
+
this.raw = raw;
|
|
295
|
+
this.transformer = transformer;
|
|
296
|
+
}
|
|
297
|
+
value() {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
return this.transformer(yield this.raw.json());
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
export class VoidApiResponse {
|
|
304
|
+
constructor(raw) {
|
|
305
|
+
this.raw = raw;
|
|
306
|
+
}
|
|
307
|
+
value() {
|
|
308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
+
return undefined;
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
export class BlobApiResponse {
|
|
314
|
+
constructor(raw) {
|
|
315
|
+
this.raw = raw;
|
|
316
|
+
}
|
|
317
|
+
value() {
|
|
318
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
319
|
+
return yield this.raw.blob();
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
;
|
|
323
|
+
}
|
|
324
|
+
export class TextApiResponse {
|
|
325
|
+
constructor(raw) {
|
|
326
|
+
this.raw = raw;
|
|
327
|
+
}
|
|
328
|
+
value() {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
330
|
+
return yield this.raw.text();
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
;
|
|
334
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 * as runtime from '../runtime';
|
|
13
|
+
import type { User } from '../models/index';
|
|
14
|
+
export interface ApiAuthRegisterPostRequest {
|
|
15
|
+
firstName: string;
|
|
16
|
+
lastName: string;
|
|
17
|
+
email: string;
|
|
18
|
+
password: string;
|
|
19
|
+
username?: string;
|
|
20
|
+
isAccountVerified?: boolean;
|
|
21
|
+
level?: string;
|
|
22
|
+
stripeCustomerId?: string;
|
|
23
|
+
phone?: string;
|
|
24
|
+
profilePicture?: string;
|
|
25
|
+
isAdmin?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare class AuthApi extends runtime.BaseAPI {
|
|
31
|
+
/**
|
|
32
|
+
* Register a new user
|
|
33
|
+
*/
|
|
34
|
+
apiAuthRegisterPostRaw(requestParameters: ApiAuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<User>>;
|
|
35
|
+
/**
|
|
36
|
+
* Register a new user
|
|
37
|
+
*/
|
|
38
|
+
apiAuthRegisterPost(requestParameters: ApiAuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<User>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { UserFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class AuthApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Register a new user
|
|
31
|
+
*/
|
|
32
|
+
apiAuthRegisterPostRaw(requestParameters, initOverrides) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['firstName'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('firstName', 'Required parameter "firstName" was null or undefined when calling apiAuthRegisterPost().');
|
|
36
|
+
}
|
|
37
|
+
if (requestParameters['lastName'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('lastName', 'Required parameter "lastName" was null or undefined when calling apiAuthRegisterPost().');
|
|
39
|
+
}
|
|
40
|
+
if (requestParameters['email'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('email', 'Required parameter "email" was null or undefined when calling apiAuthRegisterPost().');
|
|
42
|
+
}
|
|
43
|
+
if (requestParameters['password'] == null) {
|
|
44
|
+
throw new runtime.RequiredError('password', 'Required parameter "password" was null or undefined when calling apiAuthRegisterPost().');
|
|
45
|
+
}
|
|
46
|
+
const queryParameters = {};
|
|
47
|
+
const headerParameters = {};
|
|
48
|
+
const consumes = [
|
|
49
|
+
{ contentType: 'multipart/form-data' },
|
|
50
|
+
];
|
|
51
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
52
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
53
|
+
let formParams;
|
|
54
|
+
let useForm = false;
|
|
55
|
+
if (useForm) {
|
|
56
|
+
formParams = new FormData();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
formParams = new URLSearchParams();
|
|
60
|
+
}
|
|
61
|
+
if (requestParameters['username'] != null) {
|
|
62
|
+
formParams.append('username', requestParameters['username']);
|
|
63
|
+
}
|
|
64
|
+
if (requestParameters['firstName'] != null) {
|
|
65
|
+
formParams.append('firstName', requestParameters['firstName']);
|
|
66
|
+
}
|
|
67
|
+
if (requestParameters['lastName'] != null) {
|
|
68
|
+
formParams.append('lastName', requestParameters['lastName']);
|
|
69
|
+
}
|
|
70
|
+
if (requestParameters['email'] != null) {
|
|
71
|
+
formParams.append('email', requestParameters['email']);
|
|
72
|
+
}
|
|
73
|
+
if (requestParameters['isAccountVerified'] != null) {
|
|
74
|
+
formParams.append('isAccountVerified', requestParameters['isAccountVerified']);
|
|
75
|
+
}
|
|
76
|
+
if (requestParameters['level'] != null) {
|
|
77
|
+
formParams.append('level', requestParameters['level']);
|
|
78
|
+
}
|
|
79
|
+
if (requestParameters['stripeCustomerId'] != null) {
|
|
80
|
+
formParams.append('stripeCustomerId', requestParameters['stripeCustomerId']);
|
|
81
|
+
}
|
|
82
|
+
if (requestParameters['phone'] != null) {
|
|
83
|
+
formParams.append('phone', requestParameters['phone']);
|
|
84
|
+
}
|
|
85
|
+
if (requestParameters['password'] != null) {
|
|
86
|
+
formParams.append('password', requestParameters['password']);
|
|
87
|
+
}
|
|
88
|
+
if (requestParameters['profilePicture'] != null) {
|
|
89
|
+
formParams.append('profilePicture', requestParameters['profilePicture']);
|
|
90
|
+
}
|
|
91
|
+
if (requestParameters['isAdmin'] != null) {
|
|
92
|
+
formParams.append('isAdmin', requestParameters['isAdmin']);
|
|
93
|
+
}
|
|
94
|
+
const response = yield this.request({
|
|
95
|
+
path: `/api/auth/register`,
|
|
96
|
+
method: 'POST',
|
|
97
|
+
headers: headerParameters,
|
|
98
|
+
query: queryParameters,
|
|
99
|
+
body: formParams,
|
|
100
|
+
}, initOverrides);
|
|
101
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Register a new user
|
|
106
|
+
*/
|
|
107
|
+
apiAuthRegisterPost(requestParameters, initOverrides) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const response = yield this.apiAuthRegisterPostRaw(requestParameters, initOverrides);
|
|
110
|
+
return yield response.value();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 * as runtime from '../runtime';
|
|
13
|
+
import type { User } from '../models/index';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare class UsersApi extends runtime.BaseAPI {
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve all users
|
|
20
|
+
*/
|
|
21
|
+
apiUsersGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<User>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve all users
|
|
24
|
+
*/
|
|
25
|
+
apiUsersGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<User>>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { UserFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class UsersApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve all users
|
|
31
|
+
*/
|
|
32
|
+
apiUsersGetRaw(initOverrides) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const queryParameters = {};
|
|
35
|
+
const headerParameters = {};
|
|
36
|
+
const response = yield this.request({
|
|
37
|
+
path: `/api/users`,
|
|
38
|
+
method: 'GET',
|
|
39
|
+
headers: headerParameters,
|
|
40
|
+
query: queryParameters,
|
|
41
|
+
}, initOverrides);
|
|
42
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserFromJSON));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Retrieve all users
|
|
47
|
+
*/
|
|
48
|
+
apiUsersGet(initOverrides) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const response = yield this.apiUsersGetRaw(initOverrides);
|
|
51
|
+
return yield response.value();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface Booking
|
|
16
|
+
*/
|
|
17
|
+
export interface Booking {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof Booking
|
|
22
|
+
*/
|
|
23
|
+
userId: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {Array<string>}
|
|
27
|
+
* @memberof Booking
|
|
28
|
+
*/
|
|
29
|
+
playersIds?: Array<string>;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof Booking
|
|
34
|
+
*/
|
|
35
|
+
status: BookingStatusEnum;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof Booking
|
|
40
|
+
*/
|
|
41
|
+
stripeStatus: BookingStripeStatusEnum;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof Booking
|
|
46
|
+
*/
|
|
47
|
+
stripePaymentIntentId: string;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof Booking
|
|
52
|
+
*/
|
|
53
|
+
totalPrice: number;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof Booking
|
|
58
|
+
*/
|
|
59
|
+
slotId: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @export
|
|
63
|
+
*/
|
|
64
|
+
export declare const BookingStatusEnum: {
|
|
65
|
+
readonly Active: "active";
|
|
66
|
+
readonly Inactive: "inactive";
|
|
67
|
+
};
|
|
68
|
+
export type BookingStatusEnum = typeof BookingStatusEnum[keyof typeof BookingStatusEnum];
|
|
69
|
+
/**
|
|
70
|
+
* @export
|
|
71
|
+
*/
|
|
72
|
+
export declare const BookingStripeStatusEnum: {
|
|
73
|
+
readonly Pending: "pending";
|
|
74
|
+
readonly Paid: "paid";
|
|
75
|
+
readonly Failed: "failed";
|
|
76
|
+
readonly Refunded: "refunded";
|
|
77
|
+
readonly Canceled: "canceled";
|
|
78
|
+
};
|
|
79
|
+
export type BookingStripeStatusEnum = typeof BookingStripeStatusEnum[keyof typeof BookingStripeStatusEnum];
|
|
80
|
+
/**
|
|
81
|
+
* Check if a given object implements the Booking interface.
|
|
82
|
+
*/
|
|
83
|
+
export declare function instanceOfBooking(value: object): value is Booking;
|
|
84
|
+
export declare function BookingFromJSON(json: any): Booking;
|
|
85
|
+
export declare function BookingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Booking;
|
|
86
|
+
export declare function BookingToJSON(json: any): Booking;
|
|
87
|
+
export declare function BookingToJSONTyped(value?: Booking | null, ignoreDiscriminator?: boolean): any;
|