@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,17 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
README.md
|
|
4
|
+
package.json
|
|
5
|
+
src/apis/AuthApi.ts
|
|
6
|
+
src/apis/UsersApi.ts
|
|
7
|
+
src/apis/index.ts
|
|
8
|
+
src/index.ts
|
|
9
|
+
src/models/Booking.ts
|
|
10
|
+
src/models/Court.ts
|
|
11
|
+
src/models/Slot.ts
|
|
12
|
+
src/models/SlotException.ts
|
|
13
|
+
src/models/User.ts
|
|
14
|
+
src/models/index.ts
|
|
15
|
+
src/runtime.ts
|
|
16
|
+
tsconfig.esm.json
|
|
17
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.13.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## @tennac-booking/sdk@1.0.0
|
|
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:
|
|
4
|
+
|
|
5
|
+
Environment
|
|
6
|
+
* Node.js
|
|
7
|
+
* Webpack
|
|
8
|
+
* Browserify
|
|
9
|
+
|
|
10
|
+
Language level
|
|
11
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
+
* ES6
|
|
13
|
+
|
|
14
|
+
Module system
|
|
15
|
+
* CommonJS
|
|
16
|
+
* ES6 module system
|
|
17
|
+
|
|
18
|
+
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))
|
|
19
|
+
|
|
20
|
+
### Building
|
|
21
|
+
|
|
22
|
+
To build and compile the typescript sources to javascript use:
|
|
23
|
+
```
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Publishing
|
|
29
|
+
|
|
30
|
+
First build the package then run `npm publish`
|
|
31
|
+
|
|
32
|
+
### Consuming
|
|
33
|
+
|
|
34
|
+
navigate to the folder of your consuming project and run one of the following commands.
|
|
35
|
+
|
|
36
|
+
_published:_
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm install @tennac-booking/sdk@1.0.0 --save
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
_unPublished (not recommended):_
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
46
|
+
```
|
package/apis/AuthApi.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
User,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
UserFromJSON,
|
|
22
|
+
UserToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
export interface ApiAuthRegisterPostRequest {
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string;
|
|
28
|
+
email: string;
|
|
29
|
+
password: string;
|
|
30
|
+
username?: string;
|
|
31
|
+
isAccountVerified?: boolean;
|
|
32
|
+
level?: string;
|
|
33
|
+
stripeCustomerId?: string;
|
|
34
|
+
phone?: string;
|
|
35
|
+
profilePicture?: string;
|
|
36
|
+
isAdmin?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export class AuthApi extends runtime.BaseAPI {
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Register a new user
|
|
46
|
+
*/
|
|
47
|
+
async apiAuthRegisterPostRaw(requestParameters: ApiAuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<User>> {
|
|
48
|
+
if (requestParameters['firstName'] == null) {
|
|
49
|
+
throw new runtime.RequiredError(
|
|
50
|
+
'firstName',
|
|
51
|
+
'Required parameter "firstName" was null or undefined when calling apiAuthRegisterPost().'
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (requestParameters['lastName'] == null) {
|
|
56
|
+
throw new runtime.RequiredError(
|
|
57
|
+
'lastName',
|
|
58
|
+
'Required parameter "lastName" was null or undefined when calling apiAuthRegisterPost().'
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (requestParameters['email'] == null) {
|
|
63
|
+
throw new runtime.RequiredError(
|
|
64
|
+
'email',
|
|
65
|
+
'Required parameter "email" was null or undefined when calling apiAuthRegisterPost().'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (requestParameters['password'] == null) {
|
|
70
|
+
throw new runtime.RequiredError(
|
|
71
|
+
'password',
|
|
72
|
+
'Required parameter "password" was null or undefined when calling apiAuthRegisterPost().'
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const queryParameters: any = {};
|
|
77
|
+
|
|
78
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
79
|
+
|
|
80
|
+
const consumes: runtime.Consume[] = [
|
|
81
|
+
{ contentType: 'multipart/form-data' },
|
|
82
|
+
];
|
|
83
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
84
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
85
|
+
|
|
86
|
+
let formParams: { append(param: string, value: any): any };
|
|
87
|
+
let useForm = false;
|
|
88
|
+
if (useForm) {
|
|
89
|
+
formParams = new FormData();
|
|
90
|
+
} else {
|
|
91
|
+
formParams = new URLSearchParams();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (requestParameters['username'] != null) {
|
|
95
|
+
formParams.append('username', requestParameters['username'] as any);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (requestParameters['firstName'] != null) {
|
|
99
|
+
formParams.append('firstName', requestParameters['firstName'] as any);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (requestParameters['lastName'] != null) {
|
|
103
|
+
formParams.append('lastName', requestParameters['lastName'] as any);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (requestParameters['email'] != null) {
|
|
107
|
+
formParams.append('email', requestParameters['email'] as any);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (requestParameters['isAccountVerified'] != null) {
|
|
111
|
+
formParams.append('isAccountVerified', requestParameters['isAccountVerified'] as any);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (requestParameters['level'] != null) {
|
|
115
|
+
formParams.append('level', requestParameters['level'] as any);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (requestParameters['stripeCustomerId'] != null) {
|
|
119
|
+
formParams.append('stripeCustomerId', requestParameters['stripeCustomerId'] as any);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (requestParameters['phone'] != null) {
|
|
123
|
+
formParams.append('phone', requestParameters['phone'] as any);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (requestParameters['password'] != null) {
|
|
127
|
+
formParams.append('password', requestParameters['password'] as any);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (requestParameters['profilePicture'] != null) {
|
|
131
|
+
formParams.append('profilePicture', requestParameters['profilePicture'] as any);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (requestParameters['isAdmin'] != null) {
|
|
135
|
+
formParams.append('isAdmin', requestParameters['isAdmin'] as any);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const response = await this.request({
|
|
139
|
+
path: `/api/auth/register`,
|
|
140
|
+
method: 'POST',
|
|
141
|
+
headers: headerParameters,
|
|
142
|
+
query: queryParameters,
|
|
143
|
+
body: formParams,
|
|
144
|
+
}, initOverrides);
|
|
145
|
+
|
|
146
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Register a new user
|
|
151
|
+
*/
|
|
152
|
+
async apiAuthRegisterPost(requestParameters: ApiAuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<User> {
|
|
153
|
+
const response = await this.apiAuthRegisterPostRaw(requestParameters, initOverrides);
|
|
154
|
+
return await response.value();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
package/apis/UsersApi.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
User,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
UserFromJSON,
|
|
22
|
+
UserToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class UsersApi extends runtime.BaseAPI {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve all users
|
|
32
|
+
*/
|
|
33
|
+
async apiUsersGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<User>>> {
|
|
34
|
+
const queryParameters: any = {};
|
|
35
|
+
|
|
36
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
37
|
+
|
|
38
|
+
const response = await this.request({
|
|
39
|
+
path: `/api/users`,
|
|
40
|
+
method: 'GET',
|
|
41
|
+
headers: headerParameters,
|
|
42
|
+
query: queryParameters,
|
|
43
|
+
}, initOverrides);
|
|
44
|
+
|
|
45
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserFromJSON));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve all users
|
|
50
|
+
*/
|
|
51
|
+
async apiUsersGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<User>> {
|
|
52
|
+
const response = await this.apiUsersGetRaw(initOverrides);
|
|
53
|
+
return await response.value();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
package/apis/index.ts
ADDED
|
@@ -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,117 @@
|
|
|
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.AuthApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class AuthApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Register a new user
|
|
34
|
+
*/
|
|
35
|
+
apiAuthRegisterPostRaw(requestParameters, initOverrides) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['firstName'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('firstName', 'Required parameter "firstName" was null or undefined when calling apiAuthRegisterPost().');
|
|
39
|
+
}
|
|
40
|
+
if (requestParameters['lastName'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('lastName', 'Required parameter "lastName" was null or undefined when calling apiAuthRegisterPost().');
|
|
42
|
+
}
|
|
43
|
+
if (requestParameters['email'] == null) {
|
|
44
|
+
throw new runtime.RequiredError('email', 'Required parameter "email" was null or undefined when calling apiAuthRegisterPost().');
|
|
45
|
+
}
|
|
46
|
+
if (requestParameters['password'] == null) {
|
|
47
|
+
throw new runtime.RequiredError('password', 'Required parameter "password" was null or undefined when calling apiAuthRegisterPost().');
|
|
48
|
+
}
|
|
49
|
+
const queryParameters = {};
|
|
50
|
+
const headerParameters = {};
|
|
51
|
+
const consumes = [
|
|
52
|
+
{ contentType: 'multipart/form-data' },
|
|
53
|
+
];
|
|
54
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
55
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
56
|
+
let formParams;
|
|
57
|
+
let useForm = false;
|
|
58
|
+
if (useForm) {
|
|
59
|
+
formParams = new FormData();
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
formParams = new URLSearchParams();
|
|
63
|
+
}
|
|
64
|
+
if (requestParameters['username'] != null) {
|
|
65
|
+
formParams.append('username', requestParameters['username']);
|
|
66
|
+
}
|
|
67
|
+
if (requestParameters['firstName'] != null) {
|
|
68
|
+
formParams.append('firstName', requestParameters['firstName']);
|
|
69
|
+
}
|
|
70
|
+
if (requestParameters['lastName'] != null) {
|
|
71
|
+
formParams.append('lastName', requestParameters['lastName']);
|
|
72
|
+
}
|
|
73
|
+
if (requestParameters['email'] != null) {
|
|
74
|
+
formParams.append('email', requestParameters['email']);
|
|
75
|
+
}
|
|
76
|
+
if (requestParameters['isAccountVerified'] != null) {
|
|
77
|
+
formParams.append('isAccountVerified', requestParameters['isAccountVerified']);
|
|
78
|
+
}
|
|
79
|
+
if (requestParameters['level'] != null) {
|
|
80
|
+
formParams.append('level', requestParameters['level']);
|
|
81
|
+
}
|
|
82
|
+
if (requestParameters['stripeCustomerId'] != null) {
|
|
83
|
+
formParams.append('stripeCustomerId', requestParameters['stripeCustomerId']);
|
|
84
|
+
}
|
|
85
|
+
if (requestParameters['phone'] != null) {
|
|
86
|
+
formParams.append('phone', requestParameters['phone']);
|
|
87
|
+
}
|
|
88
|
+
if (requestParameters['password'] != null) {
|
|
89
|
+
formParams.append('password', requestParameters['password']);
|
|
90
|
+
}
|
|
91
|
+
if (requestParameters['profilePicture'] != null) {
|
|
92
|
+
formParams.append('profilePicture', requestParameters['profilePicture']);
|
|
93
|
+
}
|
|
94
|
+
if (requestParameters['isAdmin'] != null) {
|
|
95
|
+
formParams.append('isAdmin', requestParameters['isAdmin']);
|
|
96
|
+
}
|
|
97
|
+
const response = yield this.request({
|
|
98
|
+
path: `/api/auth/register`,
|
|
99
|
+
method: 'POST',
|
|
100
|
+
headers: headerParameters,
|
|
101
|
+
query: queryParameters,
|
|
102
|
+
body: formParams,
|
|
103
|
+
}, initOverrides);
|
|
104
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserFromJSON)(jsonValue));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Register a new user
|
|
109
|
+
*/
|
|
110
|
+
apiAuthRegisterPost(requestParameters, initOverrides) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const response = yield this.apiAuthRegisterPostRaw(requestParameters, initOverrides);
|
|
113
|
+
return yield response.value();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.AuthApi = AuthApi;
|
|
@@ -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,58 @@
|
|
|
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 = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class UsersApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve all users
|
|
34
|
+
*/
|
|
35
|
+
apiUsersGetRaw(initOverrides) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
const response = yield this.request({
|
|
40
|
+
path: `/api/users`,
|
|
41
|
+
method: 'GET',
|
|
42
|
+
headers: headerParameters,
|
|
43
|
+
query: queryParameters,
|
|
44
|
+
}, initOverrides);
|
|
45
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UserFromJSON));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve all users
|
|
50
|
+
*/
|
|
51
|
+
apiUsersGet(initOverrides) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const response = yield this.apiUsersGetRaw(initOverrides);
|
|
54
|
+
return yield response.value();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.UsersApi = UsersApi;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AuthApi"), exports);
|
|
20
|
+
__exportStar(require("./UsersApi"), exports);
|
|
@@ -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
|
+
}
|