@tennac-booking/sdk 1.0.6 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/.openapi-generator/FILES +10 -1
  2. package/README.md +17 -2
  3. package/api.ts +831 -224
  4. package/dist/api.d.ts +589 -109
  5. package/dist/api.js +394 -148
  6. package/dist/esm/api.d.ts +589 -109
  7. package/dist/esm/api.js +394 -144
  8. package/docs/ApiErrorResponse.md +22 -0
  9. package/docs/ChangePasswordRequestBody.md +22 -0
  10. package/docs/ChangePasswordResponse.md +20 -0
  11. package/docs/LoginRequestBody.md +22 -0
  12. package/docs/LoginResponse.md +26 -0
  13. package/docs/RefreshTokenRequestBody.md +20 -0
  14. package/docs/RefreshTokenResponse.md +26 -0
  15. package/docs/RegisterRequestBody.md +36 -0
  16. package/docs/UpdateUserRequestBody.md +32 -0
  17. package/docs/UserResponse.md +44 -0
  18. package/docs/UsersApi.md +345 -6
  19. package/package.json +1 -4
  20. package/apis/AuthApi.ts +0 -157
  21. package/apis/UsersApi.ts +0 -56
  22. package/apis/index.ts +0 -4
  23. package/dist/apis/AuthApi.d.ts +0 -39
  24. package/dist/apis/AuthApi.js +0 -117
  25. package/dist/apis/UsersApi.d.ts +0 -26
  26. package/dist/apis/UsersApi.js +0 -58
  27. package/dist/apis/index.d.ts +0 -2
  28. package/dist/apis/index.js +0 -20
  29. package/dist/esm/apis/AuthApi.d.ts +0 -39
  30. package/dist/esm/apis/AuthApi.js +0 -113
  31. package/dist/esm/apis/UsersApi.d.ts +0 -26
  32. package/dist/esm/apis/UsersApi.js +0 -54
  33. package/dist/esm/apis/index.d.ts +0 -2
  34. package/dist/esm/apis/index.js +0 -4
  35. package/dist/esm/models/Booking.d.ts +0 -87
  36. package/dist/esm/models/Booking.js +0 -82
  37. package/dist/esm/models/Court.d.ts +0 -76
  38. package/dist/esm/models/Court.js +0 -72
  39. package/dist/esm/models/Slot.d.ts +0 -44
  40. package/dist/esm/models/Slot.js +0 -51
  41. package/dist/esm/models/SlotException.d.ts +0 -50
  42. package/dist/esm/models/SlotException.js +0 -55
  43. package/dist/esm/models/User.d.ts +0 -92
  44. package/dist/esm/models/User.js +0 -69
  45. package/dist/esm/models/index.d.ts +0 -5
  46. package/dist/esm/models/index.js +0 -7
  47. package/dist/esm/runtime.d.ts +0 -184
  48. package/dist/esm/runtime.js +0 -334
  49. package/dist/esm/src/apis/AuthApi.d.ts +0 -39
  50. package/dist/esm/src/apis/AuthApi.js +0 -113
  51. package/dist/esm/src/apis/UsersApi.d.ts +0 -26
  52. package/dist/esm/src/apis/UsersApi.js +0 -54
  53. package/dist/esm/src/apis/index.d.ts +0 -2
  54. package/dist/esm/src/apis/index.js +0 -4
  55. package/dist/esm/src/index.d.ts +0 -3
  56. package/dist/esm/src/index.js +0 -5
  57. package/dist/esm/src/models/Booking.d.ts +0 -87
  58. package/dist/esm/src/models/Booking.js +0 -82
  59. package/dist/esm/src/models/BookingStatus.d.ts +0 -25
  60. package/dist/esm/src/models/BookingStatus.js +0 -43
  61. package/dist/esm/src/models/Court.d.ts +0 -76
  62. package/dist/esm/src/models/Court.js +0 -72
  63. package/dist/esm/src/models/CourtStatus.d.ts +0 -25
  64. package/dist/esm/src/models/CourtStatus.js +0 -43
  65. package/dist/esm/src/models/Slot.d.ts +0 -44
  66. package/dist/esm/src/models/Slot.js +0 -51
  67. package/dist/esm/src/models/SlotException.d.ts +0 -50
  68. package/dist/esm/src/models/SlotException.js +0 -55
  69. package/dist/esm/src/models/StripeStatus.d.ts +0 -28
  70. package/dist/esm/src/models/StripeStatus.js +0 -46
  71. package/dist/esm/src/models/User.d.ts +0 -92
  72. package/dist/esm/src/models/User.js +0 -69
  73. package/dist/esm/src/models/index.d.ts +0 -5
  74. package/dist/esm/src/models/index.js +0 -7
  75. package/dist/esm/src/runtime.d.ts +0 -184
  76. package/dist/esm/src/runtime.js +0 -334
  77. package/dist/models/Booking.d.ts +0 -87
  78. package/dist/models/Booking.js +0 -90
  79. package/dist/models/Court.d.ts +0 -76
  80. package/dist/models/Court.js +0 -80
  81. package/dist/models/Slot.d.ts +0 -44
  82. package/dist/models/Slot.js +0 -58
  83. package/dist/models/SlotException.d.ts +0 -50
  84. package/dist/models/SlotException.js +0 -62
  85. package/dist/models/User.d.ts +0 -92
  86. package/dist/models/User.js +0 -76
  87. package/dist/models/index.d.ts +0 -5
  88. package/dist/models/index.js +0 -23
  89. package/dist/runtime.d.ts +0 -184
  90. package/dist/runtime.js +0 -350
  91. package/dist/src/apis/AuthApi.d.ts +0 -39
  92. package/dist/src/apis/AuthApi.js +0 -117
  93. package/dist/src/apis/UsersApi.d.ts +0 -26
  94. package/dist/src/apis/UsersApi.js +0 -58
  95. package/dist/src/apis/index.d.ts +0 -2
  96. package/dist/src/apis/index.js +0 -20
  97. package/dist/src/index.d.ts +0 -3
  98. package/dist/src/index.js +0 -21
  99. package/dist/src/models/Booking.d.ts +0 -87
  100. package/dist/src/models/Booking.js +0 -90
  101. package/dist/src/models/BookingStatus.d.ts +0 -25
  102. package/dist/src/models/BookingStatus.js +0 -51
  103. package/dist/src/models/Court.d.ts +0 -76
  104. package/dist/src/models/Court.js +0 -80
  105. package/dist/src/models/CourtStatus.d.ts +0 -25
  106. package/dist/src/models/CourtStatus.js +0 -51
  107. package/dist/src/models/Slot.d.ts +0 -44
  108. package/dist/src/models/Slot.js +0 -58
  109. package/dist/src/models/SlotException.d.ts +0 -50
  110. package/dist/src/models/SlotException.js +0 -62
  111. package/dist/src/models/StripeStatus.d.ts +0 -28
  112. package/dist/src/models/StripeStatus.js +0 -54
  113. package/dist/src/models/User.d.ts +0 -92
  114. package/dist/src/models/User.js +0 -76
  115. package/dist/src/models/index.d.ts +0 -5
  116. package/dist/src/models/index.js +0 -23
  117. package/dist/src/runtime.d.ts +0 -184
  118. package/dist/src/runtime.js +0 -350
  119. package/docs/AuthApi.md +0 -88
  120. package/models/Booking.ts +0 -142
  121. package/models/Court.ts +0 -130
  122. package/models/Slot.ts +0 -84
  123. package/models/SlotException.ts +0 -93
  124. package/models/User.ts +0 -149
  125. package/models/index.ts +0 -7
  126. package/runtime.ts +0 -432
  127. package/src/apis/AuthApi.ts +0 -157
  128. package/src/apis/UsersApi.ts +0 -56
  129. package/src/apis/index.ts +0 -4
  130. package/src/index.ts +0 -5
  131. package/src/models/Booking.ts +0 -142
  132. package/src/models/BookingStatus.ts +0 -53
  133. package/src/models/Court.ts +0 -130
  134. package/src/models/CourtStatus.ts +0 -53
  135. package/src/models/Slot.ts +0 -84
  136. package/src/models/SlotException.ts +0 -93
  137. package/src/models/StripeStatus.ts +0 -56
  138. package/src/models/User.ts +0 -149
  139. package/src/models/index.ts +0 -7
  140. package/src/runtime.ts +0 -432
package/dist/esm/api.js CHANGED
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  import globalAxios from 'axios';
24
24
  // Some imports not used depending on template conditions
25
25
  // @ts-ignore
26
- import { DUMMY_BASE_URL, assertParamExists, setSearchParams, toPathString, createRequestFunction } from './common';
26
+ import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
27
27
  // @ts-ignore
28
28
  import { BASE_PATH, BaseAPI, operationServerMap } from './base';
29
29
  /**
@@ -57,179 +57,169 @@ export const StripeStatus = {
57
57
  Canceled: 'canceled'
58
58
  };
59
59
  /**
60
- * AuthApi - axios parameter creator
60
+ * UsersApi - axios parameter creator
61
61
  * @export
62
62
  */
63
- export const AuthApiAxiosParamCreator = function (configuration) {
63
+ export const UsersApiAxiosParamCreator = function (configuration) {
64
64
  return {
65
65
  /**
66
66
  *
67
- * @summary Register a new user
68
- * @param {string} firstName
69
- * @param {string} lastName
70
- * @param {string} email
71
- * @param {string} password
72
- * @param {string} [username]
73
- * @param {boolean} [isAccountVerified]
74
- * @param {string} [level]
75
- * @param {string} [stripeCustomerId]
76
- * @param {string} [phone]
77
- * @param {string} [profilePicture]
78
- * @param {boolean} [isAdmin]
67
+ * @summary Modifie le mot de passe d\'un utilisateur
68
+ * @param {string} id ID de l\'utilisateur
69
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
79
70
  * @param {*} [options] Override http request option.
80
71
  * @throws {RequiredError}
81
72
  */
82
- 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 = {}) {
83
- // verify required parameter 'firstName' is not null or undefined
84
- assertParamExists('apiAuthRegisterPost', 'firstName', firstName);
85
- // verify required parameter 'lastName' is not null or undefined
86
- assertParamExists('apiAuthRegisterPost', 'lastName', lastName);
87
- // verify required parameter 'email' is not null or undefined
88
- assertParamExists('apiAuthRegisterPost', 'email', email);
89
- // verify required parameter 'password' is not null or undefined
90
- assertParamExists('apiAuthRegisterPost', 'password', password);
91
- const localVarPath = `/api/auth/register`;
73
+ changePassword: (id_1, changePasswordRequestBody_1, ...args_1) => __awaiter(this, [id_1, changePasswordRequestBody_1, ...args_1], void 0, function* (id, changePasswordRequestBody, options = {}) {
74
+ // verify required parameter 'id' is not null or undefined
75
+ assertParamExists('changePassword', 'id', id);
76
+ // verify required parameter 'changePasswordRequestBody' is not null or undefined
77
+ assertParamExists('changePassword', 'changePasswordRequestBody', changePasswordRequestBody);
78
+ const localVarPath = `/api/users/{id}/password`
79
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
92
80
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
93
81
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
94
82
  let baseOptions;
95
83
  if (configuration) {
96
84
  baseOptions = configuration.baseOptions;
97
85
  }
98
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
86
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
99
87
  const localVarHeaderParameter = {};
100
88
  const localVarQueryParameter = {};
101
- const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
102
- if (username !== undefined) {
103
- localVarFormParams.append('username', username);
104
- }
105
- if (firstName !== undefined) {
106
- localVarFormParams.append('firstName', firstName);
107
- }
108
- if (lastName !== undefined) {
109
- localVarFormParams.append('lastName', lastName);
110
- }
111
- if (email !== undefined) {
112
- localVarFormParams.append('email', email);
113
- }
114
- if (isAccountVerified !== undefined) {
115
- localVarFormParams.append('isAccountVerified', String(isAccountVerified));
116
- }
117
- if (level !== undefined) {
118
- localVarFormParams.append('level', level);
119
- }
120
- if (stripeCustomerId !== undefined) {
121
- localVarFormParams.append('stripeCustomerId', stripeCustomerId);
122
- }
123
- if (phone !== undefined) {
124
- localVarFormParams.append('phone', phone);
125
- }
126
- if (password !== undefined) {
127
- localVarFormParams.append('password', password);
128
- }
129
- if (profilePicture !== undefined) {
130
- localVarFormParams.append('profilePicture', profilePicture);
89
+ localVarHeaderParameter['Content-Type'] = 'application/json';
90
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
91
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
92
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
93
+ localVarRequestOptions.data = serializeDataIfNeeded(changePasswordRequestBody, localVarRequestOptions, configuration);
94
+ return {
95
+ url: toPathString(localVarUrlObj),
96
+ options: localVarRequestOptions,
97
+ };
98
+ }),
99
+ /**
100
+ *
101
+ * @summary Récupère la liste des utilisateurs
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ */
105
+ getAllUsers: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
106
+ const localVarPath = `/api/users`;
107
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
108
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
109
+ let baseOptions;
110
+ if (configuration) {
111
+ baseOptions = configuration.baseOptions;
131
112
  }
132
- if (isAdmin !== undefined) {
133
- localVarFormParams.append('isAdmin', String(isAdmin));
113
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
114
+ const localVarHeaderParameter = {};
115
+ const localVarQueryParameter = {};
116
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
117
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
118
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
119
+ return {
120
+ url: toPathString(localVarUrlObj),
121
+ options: localVarRequestOptions,
122
+ };
123
+ }),
124
+ /**
125
+ *
126
+ * @summary Récupère un utilisateur par ID
127
+ * @param {string} id ID de l\'utilisateur
128
+ * @param {*} [options] Override http request option.
129
+ * @throws {RequiredError}
130
+ */
131
+ getUserInfo: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
132
+ // verify required parameter 'id' is not null or undefined
133
+ assertParamExists('getUserInfo', 'id', id);
134
+ const localVarPath = `/api/users/{id}`
135
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
136
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
137
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
138
+ let baseOptions;
139
+ if (configuration) {
140
+ baseOptions = configuration.baseOptions;
134
141
  }
135
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
142
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
143
+ const localVarHeaderParameter = {};
144
+ const localVarQueryParameter = {};
136
145
  setSearchParams(localVarUrlObj, localVarQueryParameter);
137
146
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
138
147
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
139
- localVarRequestOptions.data = localVarFormParams;
140
148
  return {
141
149
  url: toPathString(localVarUrlObj),
142
150
  options: localVarRequestOptions,
143
151
  };
144
152
  }),
145
- };
146
- };
147
- /**
148
- * AuthApi - functional programming interface
149
- * @export
150
- */
151
- export const AuthApiFp = function (configuration) {
152
- const localVarAxiosParamCreator = AuthApiAxiosParamCreator(configuration);
153
- return {
154
153
  /**
155
154
  *
156
- * @summary Register a new user
157
- * @param {string} firstName
158
- * @param {string} lastName
159
- * @param {string} email
160
- * @param {string} password
161
- * @param {string} [username]
162
- * @param {boolean} [isAccountVerified]
163
- * @param {string} [level]
164
- * @param {string} [stripeCustomerId]
165
- * @param {string} [phone]
166
- * @param {string} [profilePicture]
167
- * @param {boolean} [isAdmin]
155
+ * @summary Authentifie un utilisateur
156
+ * @param {LoginRequestBody} loginRequestBody
168
157
  * @param {*} [options] Override http request option.
169
158
  * @throws {RequiredError}
170
159
  */
171
- apiAuthRegisterPost(firstName, lastName, email, password, username, isAccountVerified, level, stripeCustomerId, phone, profilePicture, isAdmin, options) {
172
- return __awaiter(this, void 0, void 0, function* () {
173
- var _a, _b, _c;
174
- const localVarAxiosArgs = yield localVarAxiosParamCreator.apiAuthRegisterPost(firstName, lastName, email, password, username, isAccountVerified, level, stripeCustomerId, phone, profilePicture, isAdmin, options);
175
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
176
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AuthApi.apiAuthRegisterPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
177
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
178
- });
179
- },
180
- };
181
- };
182
- /**
183
- * AuthApi - factory interface
184
- * @export
185
- */
186
- export const AuthApiFactory = function (configuration, basePath, axios) {
187
- const localVarFp = AuthApiFp(configuration);
188
- return {
160
+ login: (loginRequestBody_1, ...args_1) => __awaiter(this, [loginRequestBody_1, ...args_1], void 0, function* (loginRequestBody, options = {}) {
161
+ // verify required parameter 'loginRequestBody' is not null or undefined
162
+ assertParamExists('login', 'loginRequestBody', loginRequestBody);
163
+ const localVarPath = `/api/users/login`;
164
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
166
+ let baseOptions;
167
+ if (configuration) {
168
+ baseOptions = configuration.baseOptions;
169
+ }
170
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
171
+ const localVarHeaderParameter = {};
172
+ const localVarQueryParameter = {};
173
+ localVarHeaderParameter['Content-Type'] = 'application/json';
174
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
175
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
176
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
177
+ localVarRequestOptions.data = serializeDataIfNeeded(loginRequestBody, localVarRequestOptions, configuration);
178
+ return {
179
+ url: toPathString(localVarUrlObj),
180
+ options: localVarRequestOptions,
181
+ };
182
+ }),
189
183
  /**
190
184
  *
191
- * @summary Register a new user
192
- * @param {AuthApiApiAuthRegisterPostRequest} requestParameters Request parameters.
185
+ * @summary Rafraîchit le token d\'accès
186
+ * @param {RefreshTokenRequestBody} refreshTokenRequestBody
193
187
  * @param {*} [options] Override http request option.
194
188
  * @throws {RequiredError}
195
189
  */
196
- apiAuthRegisterPost(requestParameters, options) {
197
- 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));
198
- },
199
- };
200
- };
201
- /**
202
- * AuthApi - object-oriented interface
203
- * @export
204
- * @class AuthApi
205
- * @extends {BaseAPI}
206
- */
207
- export class AuthApi extends BaseAPI {
208
- /**
209
- *
210
- * @summary Register a new user
211
- * @param {AuthApiApiAuthRegisterPostRequest} requestParameters Request parameters.
212
- * @param {*} [options] Override http request option.
213
- * @throws {RequiredError}
214
- * @memberof AuthApi
215
- */
216
- apiAuthRegisterPost(requestParameters, options) {
217
- return 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));
218
- }
219
- }
220
- /**
221
- * UsersApi - axios parameter creator
222
- * @export
223
- */
224
- export const UsersApiAxiosParamCreator = function (configuration) {
225
- return {
190
+ refreshToken: (refreshTokenRequestBody_1, ...args_1) => __awaiter(this, [refreshTokenRequestBody_1, ...args_1], void 0, function* (refreshTokenRequestBody, options = {}) {
191
+ // verify required parameter 'refreshTokenRequestBody' is not null or undefined
192
+ assertParamExists('refreshToken', 'refreshTokenRequestBody', refreshTokenRequestBody);
193
+ const localVarPath = `/api/users/refresh-token`;
194
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
195
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
196
+ let baseOptions;
197
+ if (configuration) {
198
+ baseOptions = configuration.baseOptions;
199
+ }
200
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
201
+ const localVarHeaderParameter = {};
202
+ const localVarQueryParameter = {};
203
+ localVarHeaderParameter['Content-Type'] = 'application/json';
204
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
205
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
206
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
207
+ localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenRequestBody, localVarRequestOptions, configuration);
208
+ return {
209
+ url: toPathString(localVarUrlObj),
210
+ options: localVarRequestOptions,
211
+ };
212
+ }),
226
213
  /**
227
214
  *
228
- * @summary Retrieve all users
215
+ * @summary Crée un nouvel utilisateur
216
+ * @param {RegisterRequestBody} registerRequestBody
229
217
  * @param {*} [options] Override http request option.
230
218
  * @throws {RequiredError}
231
219
  */
232
- apiUsersGet: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
220
+ register: (registerRequestBody_1, ...args_1) => __awaiter(this, [registerRequestBody_1, ...args_1], void 0, function* (registerRequestBody, options = {}) {
221
+ // verify required parameter 'registerRequestBody' is not null or undefined
222
+ assertParamExists('register', 'registerRequestBody', registerRequestBody);
233
223
  const localVarPath = `/api/users`;
234
224
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
235
225
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -237,12 +227,48 @@ export const UsersApiAxiosParamCreator = function (configuration) {
237
227
  if (configuration) {
238
228
  baseOptions = configuration.baseOptions;
239
229
  }
240
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
230
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
231
+ const localVarHeaderParameter = {};
232
+ const localVarQueryParameter = {};
233
+ localVarHeaderParameter['Content-Type'] = 'application/json';
234
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
235
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
236
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
237
+ localVarRequestOptions.data = serializeDataIfNeeded(registerRequestBody, localVarRequestOptions, configuration);
238
+ return {
239
+ url: toPathString(localVarUrlObj),
240
+ options: localVarRequestOptions,
241
+ };
242
+ }),
243
+ /**
244
+ *
245
+ * @summary Met à jour un utilisateur
246
+ * @param {string} id ID de l\'utilisateur
247
+ * @param {UpdateUserRequestBody} updateUserRequestBody
248
+ * @param {*} [options] Override http request option.
249
+ * @throws {RequiredError}
250
+ */
251
+ updateUser: (id_1, updateUserRequestBody_1, ...args_1) => __awaiter(this, [id_1, updateUserRequestBody_1, ...args_1], void 0, function* (id, updateUserRequestBody, options = {}) {
252
+ // verify required parameter 'id' is not null or undefined
253
+ assertParamExists('updateUser', 'id', id);
254
+ // verify required parameter 'updateUserRequestBody' is not null or undefined
255
+ assertParamExists('updateUser', 'updateUserRequestBody', updateUserRequestBody);
256
+ const localVarPath = `/api/users/{id}`
257
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
258
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
259
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
260
+ let baseOptions;
261
+ if (configuration) {
262
+ baseOptions = configuration.baseOptions;
263
+ }
264
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
241
265
  const localVarHeaderParameter = {};
242
266
  const localVarQueryParameter = {};
267
+ localVarHeaderParameter['Content-Type'] = 'application/json';
243
268
  setSearchParams(localVarUrlObj, localVarQueryParameter);
244
269
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
245
270
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
271
+ localVarRequestOptions.data = serializeDataIfNeeded(updateUserRequestBody, localVarRequestOptions, configuration);
246
272
  return {
247
273
  url: toPathString(localVarUrlObj),
248
274
  options: localVarRequestOptions,
@@ -259,16 +285,114 @@ export const UsersApiFp = function (configuration) {
259
285
  return {
260
286
  /**
261
287
  *
262
- * @summary Retrieve all users
288
+ * @summary Modifie le mot de passe d\'un utilisateur
289
+ * @param {string} id ID de l\'utilisateur
290
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
291
+ * @param {*} [options] Override http request option.
292
+ * @throws {RequiredError}
293
+ */
294
+ changePassword(id, changePasswordRequestBody, options) {
295
+ return __awaiter(this, void 0, void 0, function* () {
296
+ var _a, _b, _c;
297
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.changePassword(id, changePasswordRequestBody, options);
298
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
299
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.changePassword']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
300
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
301
+ });
302
+ },
303
+ /**
304
+ *
305
+ * @summary Récupère la liste des utilisateurs
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ getAllUsers(options) {
310
+ return __awaiter(this, void 0, void 0, function* () {
311
+ var _a, _b, _c;
312
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getAllUsers(options);
313
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
314
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.getAllUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
315
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
316
+ });
317
+ },
318
+ /**
319
+ *
320
+ * @summary Récupère un utilisateur par ID
321
+ * @param {string} id ID de l\'utilisateur
322
+ * @param {*} [options] Override http request option.
323
+ * @throws {RequiredError}
324
+ */
325
+ getUserInfo(id, options) {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ var _a, _b, _c;
328
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserInfo(id, options);
329
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
330
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.getUserInfo']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
331
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
332
+ });
333
+ },
334
+ /**
335
+ *
336
+ * @summary Authentifie un utilisateur
337
+ * @param {LoginRequestBody} loginRequestBody
338
+ * @param {*} [options] Override http request option.
339
+ * @throws {RequiredError}
340
+ */
341
+ login(loginRequestBody, options) {
342
+ return __awaiter(this, void 0, void 0, function* () {
343
+ var _a, _b, _c;
344
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.login(loginRequestBody, options);
345
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
346
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.login']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
347
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
348
+ });
349
+ },
350
+ /**
351
+ *
352
+ * @summary Rafraîchit le token d\'accès
353
+ * @param {RefreshTokenRequestBody} refreshTokenRequestBody
263
354
  * @param {*} [options] Override http request option.
264
355
  * @throws {RequiredError}
265
356
  */
266
- apiUsersGet(options) {
357
+ refreshToken(refreshTokenRequestBody, options) {
267
358
  return __awaiter(this, void 0, void 0, function* () {
268
359
  var _a, _b, _c;
269
- const localVarAxiosArgs = yield localVarAxiosParamCreator.apiUsersGet(options);
360
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.refreshToken(refreshTokenRequestBody, options);
270
361
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
271
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.apiUsersGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
362
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.refreshToken']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
363
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
364
+ });
365
+ },
366
+ /**
367
+ *
368
+ * @summary Crée un nouvel utilisateur
369
+ * @param {RegisterRequestBody} registerRequestBody
370
+ * @param {*} [options] Override http request option.
371
+ * @throws {RequiredError}
372
+ */
373
+ register(registerRequestBody, options) {
374
+ return __awaiter(this, void 0, void 0, function* () {
375
+ var _a, _b, _c;
376
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.register(registerRequestBody, options);
377
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
378
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.register']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
379
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
380
+ });
381
+ },
382
+ /**
383
+ *
384
+ * @summary Met à jour un utilisateur
385
+ * @param {string} id ID de l\'utilisateur
386
+ * @param {UpdateUserRequestBody} updateUserRequestBody
387
+ * @param {*} [options] Override http request option.
388
+ * @throws {RequiredError}
389
+ */
390
+ updateUser(id, updateUserRequestBody, options) {
391
+ return __awaiter(this, void 0, void 0, function* () {
392
+ var _a, _b, _c;
393
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateUser(id, updateUserRequestBody, options);
394
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
395
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.updateUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
272
396
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
273
397
  });
274
398
  },
@@ -283,12 +407,72 @@ export const UsersApiFactory = function (configuration, basePath, axios) {
283
407
  return {
284
408
  /**
285
409
  *
286
- * @summary Retrieve all users
410
+ * @summary Modifie le mot de passe d\'un utilisateur
411
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
287
412
  * @param {*} [options] Override http request option.
288
413
  * @throws {RequiredError}
289
414
  */
290
- apiUsersGet(options) {
291
- return localVarFp.apiUsersGet(options).then((request) => request(axios, basePath));
415
+ changePassword(requestParameters, options) {
416
+ return localVarFp.changePassword(requestParameters.id, requestParameters.changePasswordRequestBody, options).then((request) => request(axios, basePath));
417
+ },
418
+ /**
419
+ *
420
+ * @summary Récupère la liste des utilisateurs
421
+ * @param {*} [options] Override http request option.
422
+ * @throws {RequiredError}
423
+ */
424
+ getAllUsers(options) {
425
+ return localVarFp.getAllUsers(options).then((request) => request(axios, basePath));
426
+ },
427
+ /**
428
+ *
429
+ * @summary Récupère un utilisateur par ID
430
+ * @param {UsersApiGetUserInfoRequest} requestParameters Request parameters.
431
+ * @param {*} [options] Override http request option.
432
+ * @throws {RequiredError}
433
+ */
434
+ getUserInfo(requestParameters, options) {
435
+ return localVarFp.getUserInfo(requestParameters.id, options).then((request) => request(axios, basePath));
436
+ },
437
+ /**
438
+ *
439
+ * @summary Authentifie un utilisateur
440
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
441
+ * @param {*} [options] Override http request option.
442
+ * @throws {RequiredError}
443
+ */
444
+ login(requestParameters, options) {
445
+ return localVarFp.login(requestParameters.loginRequestBody, options).then((request) => request(axios, basePath));
446
+ },
447
+ /**
448
+ *
449
+ * @summary Rafraîchit le token d\'accès
450
+ * @param {UsersApiRefreshTokenRequest} requestParameters Request parameters.
451
+ * @param {*} [options] Override http request option.
452
+ * @throws {RequiredError}
453
+ */
454
+ refreshToken(requestParameters, options) {
455
+ return localVarFp.refreshToken(requestParameters.refreshTokenRequestBody, options).then((request) => request(axios, basePath));
456
+ },
457
+ /**
458
+ *
459
+ * @summary Crée un nouvel utilisateur
460
+ * @param {UsersApiRegisterRequest} requestParameters Request parameters.
461
+ * @param {*} [options] Override http request option.
462
+ * @throws {RequiredError}
463
+ */
464
+ register(requestParameters, options) {
465
+ return localVarFp.register(requestParameters.registerRequestBody, options).then((request) => request(axios, basePath));
466
+ },
467
+ /**
468
+ *
469
+ * @summary Met à jour un utilisateur
470
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
471
+ * @param {*} [options] Override http request option.
472
+ * @throws {RequiredError}
473
+ */
474
+ updateUser(requestParameters, options) {
475
+ return localVarFp.updateUser(requestParameters.id, requestParameters.updateUserRequestBody, options).then((request) => request(axios, basePath));
292
476
  },
293
477
  };
294
478
  };
@@ -301,12 +485,78 @@ export const UsersApiFactory = function (configuration, basePath, axios) {
301
485
  export class UsersApi extends BaseAPI {
302
486
  /**
303
487
  *
304
- * @summary Retrieve all users
488
+ * @summary Modifie le mot de passe d\'un utilisateur
489
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
490
+ * @param {*} [options] Override http request option.
491
+ * @throws {RequiredError}
492
+ * @memberof UsersApi
493
+ */
494
+ changePassword(requestParameters, options) {
495
+ return UsersApiFp(this.configuration).changePassword(requestParameters.id, requestParameters.changePasswordRequestBody, options).then((request) => request(this.axios, this.basePath));
496
+ }
497
+ /**
498
+ *
499
+ * @summary Récupère la liste des utilisateurs
500
+ * @param {*} [options] Override http request option.
501
+ * @throws {RequiredError}
502
+ * @memberof UsersApi
503
+ */
504
+ getAllUsers(options) {
505
+ return UsersApiFp(this.configuration).getAllUsers(options).then((request) => request(this.axios, this.basePath));
506
+ }
507
+ /**
508
+ *
509
+ * @summary Récupère un utilisateur par ID
510
+ * @param {UsersApiGetUserInfoRequest} requestParameters Request parameters.
511
+ * @param {*} [options] Override http request option.
512
+ * @throws {RequiredError}
513
+ * @memberof UsersApi
514
+ */
515
+ getUserInfo(requestParameters, options) {
516
+ return UsersApiFp(this.configuration).getUserInfo(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
517
+ }
518
+ /**
519
+ *
520
+ * @summary Authentifie un utilisateur
521
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
522
+ * @param {*} [options] Override http request option.
523
+ * @throws {RequiredError}
524
+ * @memberof UsersApi
525
+ */
526
+ login(requestParameters, options) {
527
+ return UsersApiFp(this.configuration).login(requestParameters.loginRequestBody, options).then((request) => request(this.axios, this.basePath));
528
+ }
529
+ /**
530
+ *
531
+ * @summary Rafraîchit le token d\'accès
532
+ * @param {UsersApiRefreshTokenRequest} requestParameters Request parameters.
533
+ * @param {*} [options] Override http request option.
534
+ * @throws {RequiredError}
535
+ * @memberof UsersApi
536
+ */
537
+ refreshToken(requestParameters, options) {
538
+ return UsersApiFp(this.configuration).refreshToken(requestParameters.refreshTokenRequestBody, options).then((request) => request(this.axios, this.basePath));
539
+ }
540
+ /**
541
+ *
542
+ * @summary Crée un nouvel utilisateur
543
+ * @param {UsersApiRegisterRequest} requestParameters Request parameters.
544
+ * @param {*} [options] Override http request option.
545
+ * @throws {RequiredError}
546
+ * @memberof UsersApi
547
+ */
548
+ register(requestParameters, options) {
549
+ return UsersApiFp(this.configuration).register(requestParameters.registerRequestBody, options).then((request) => request(this.axios, this.basePath));
550
+ }
551
+ /**
552
+ *
553
+ * @summary Met à jour un utilisateur
554
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
305
555
  * @param {*} [options] Override http request option.
306
556
  * @throws {RequiredError}
307
557
  * @memberof UsersApi
308
558
  */
309
- apiUsersGet(options) {
310
- return UsersApiFp(this.configuration).apiUsersGet(options).then((request) => request(this.axios, this.basePath));
559
+ updateUser(requestParameters, options) {
560
+ return UsersApiFp(this.configuration).updateUser(requestParameters.id, requestParameters.updateUserRequestBody, options).then((request) => request(this.axios, this.basePath));
311
561
  }
312
562
  }