@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/api.ts CHANGED
@@ -23,6 +23,25 @@ import type { RequestArgs } from './base';
23
23
  // @ts-ignore
24
24
  import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
25
25
 
26
+ /**
27
+ *
28
+ * @export
29
+ * @interface ApiErrorResponse
30
+ */
31
+ export interface ApiErrorResponse {
32
+ /**
33
+ *
34
+ * @type {string}
35
+ * @memberof ApiErrorResponse
36
+ */
37
+ 'message': string;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof ApiErrorResponse
42
+ */
43
+ 'error'?: string;
44
+ }
26
45
  /**
27
46
  *
28
47
  * @export
@@ -88,6 +107,38 @@ export const BookingStatus = {
88
107
  export type BookingStatus = typeof BookingStatus[keyof typeof BookingStatus];
89
108
 
90
109
 
110
+ /**
111
+ *
112
+ * @export
113
+ * @interface ChangePasswordRequestBody
114
+ */
115
+ export interface ChangePasswordRequestBody {
116
+ /**
117
+ *
118
+ * @type {string}
119
+ * @memberof ChangePasswordRequestBody
120
+ */
121
+ 'currentPassword': string;
122
+ /**
123
+ *
124
+ * @type {string}
125
+ * @memberof ChangePasswordRequestBody
126
+ */
127
+ 'newPassword': string;
128
+ }
129
+ /**
130
+ *
131
+ * @export
132
+ * @interface ChangePasswordResponse
133
+ */
134
+ export interface ChangePasswordResponse {
135
+ /**
136
+ *
137
+ * @type {string}
138
+ * @memberof ChangePasswordResponse
139
+ */
140
+ 'message': string;
141
+ }
91
142
  /**
92
143
  *
93
144
  * @export
@@ -153,6 +204,161 @@ export const CourtStatus = {
153
204
  export type CourtStatus = typeof CourtStatus[keyof typeof CourtStatus];
154
205
 
155
206
 
207
+ /**
208
+ *
209
+ * @export
210
+ * @interface LoginRequestBody
211
+ */
212
+ export interface LoginRequestBody {
213
+ /**
214
+ *
215
+ * @type {string}
216
+ * @memberof LoginRequestBody
217
+ */
218
+ 'email': string;
219
+ /**
220
+ *
221
+ * @type {string}
222
+ * @memberof LoginRequestBody
223
+ */
224
+ 'password': string;
225
+ }
226
+ /**
227
+ *
228
+ * @export
229
+ * @interface LoginResponse
230
+ */
231
+ export interface LoginResponse {
232
+ /**
233
+ *
234
+ * @type {string}
235
+ * @memberof LoginResponse
236
+ */
237
+ 'token': string;
238
+ /**
239
+ *
240
+ * @type {string}
241
+ * @memberof LoginResponse
242
+ */
243
+ 'refreshToken': string;
244
+ /**
245
+ *
246
+ * @type {number}
247
+ * @memberof LoginResponse
248
+ */
249
+ 'sessionDuration': number;
250
+ /**
251
+ *
252
+ * @type {number}
253
+ * @memberof LoginResponse
254
+ */
255
+ 'sessionEnd': number;
256
+ }
257
+ /**
258
+ *
259
+ * @export
260
+ * @interface RefreshTokenRequestBody
261
+ */
262
+ export interface RefreshTokenRequestBody {
263
+ /**
264
+ *
265
+ * @type {string}
266
+ * @memberof RefreshTokenRequestBody
267
+ */
268
+ 'refreshToken': string;
269
+ }
270
+ /**
271
+ *
272
+ * @export
273
+ * @interface RefreshTokenResponse
274
+ */
275
+ export interface RefreshTokenResponse {
276
+ /**
277
+ *
278
+ * @type {string}
279
+ * @memberof RefreshTokenResponse
280
+ */
281
+ 'token': string;
282
+ /**
283
+ *
284
+ * @type {string}
285
+ * @memberof RefreshTokenResponse
286
+ */
287
+ 'refreshToken': string;
288
+ /**
289
+ *
290
+ * @type {number}
291
+ * @memberof RefreshTokenResponse
292
+ */
293
+ 'sessionDuration': number;
294
+ /**
295
+ *
296
+ * @type {number}
297
+ * @memberof RefreshTokenResponse
298
+ */
299
+ 'sessionEnd': number;
300
+ }
301
+ /**
302
+ *
303
+ * @export
304
+ * @interface RegisterRequestBody
305
+ */
306
+ export interface RegisterRequestBody {
307
+ /**
308
+ *
309
+ * @type {string}
310
+ * @memberof RegisterRequestBody
311
+ */
312
+ 'username'?: string;
313
+ /**
314
+ *
315
+ * @type {string}
316
+ * @memberof RegisterRequestBody
317
+ */
318
+ 'firstName': string;
319
+ /**
320
+ *
321
+ * @type {string}
322
+ * @memberof RegisterRequestBody
323
+ */
324
+ 'lastName': string;
325
+ /**
326
+ *
327
+ * @type {string}
328
+ * @memberof RegisterRequestBody
329
+ */
330
+ 'email': string;
331
+ /**
332
+ *
333
+ * @type {string}
334
+ * @memberof RegisterRequestBody
335
+ */
336
+ 'password': string;
337
+ /**
338
+ *
339
+ * @type {string}
340
+ * @memberof RegisterRequestBody
341
+ */
342
+ 'level'?: string;
343
+ /**
344
+ *
345
+ * @type {string}
346
+ * @memberof RegisterRequestBody
347
+ */
348
+ 'stripeCustomerId'?: string;
349
+ /**
350
+ *
351
+ * @type {string}
352
+ * @memberof RegisterRequestBody
353
+ */
354
+ 'phone'?: string;
355
+ /**
356
+ *
357
+ * @type {string}
358
+ * @memberof RegisterRequestBody
359
+ */
360
+ 'profilePicture'?: string;
361
+ }
156
362
  /**
157
363
  *
158
364
  * @export
@@ -226,6 +432,55 @@ export const StripeStatus = {
226
432
  export type StripeStatus = typeof StripeStatus[keyof typeof StripeStatus];
227
433
 
228
434
 
435
+ /**
436
+ *
437
+ * @export
438
+ * @interface UpdateUserRequestBody
439
+ */
440
+ export interface UpdateUserRequestBody {
441
+ /**
442
+ *
443
+ * @type {string}
444
+ * @memberof UpdateUserRequestBody
445
+ */
446
+ 'username'?: string;
447
+ /**
448
+ *
449
+ * @type {string}
450
+ * @memberof UpdateUserRequestBody
451
+ */
452
+ 'firstName'?: string;
453
+ /**
454
+ *
455
+ * @type {string}
456
+ * @memberof UpdateUserRequestBody
457
+ */
458
+ 'lastName'?: string;
459
+ /**
460
+ *
461
+ * @type {string}
462
+ * @memberof UpdateUserRequestBody
463
+ */
464
+ 'email'?: string;
465
+ /**
466
+ *
467
+ * @type {string}
468
+ * @memberof UpdateUserRequestBody
469
+ */
470
+ 'phone'?: string;
471
+ /**
472
+ *
473
+ * @type {string}
474
+ * @memberof UpdateUserRequestBody
475
+ */
476
+ 'profilePicture'?: string;
477
+ /**
478
+ *
479
+ * @type {string}
480
+ * @memberof UpdateUserRequestBody
481
+ */
482
+ 'level'?: string;
483
+ }
229
484
  /**
230
485
  *
231
486
  * @export
@@ -299,40 +554,113 @@ export interface User {
299
554
  */
300
555
  'isAdmin'?: boolean;
301
556
  }
557
+ /**
558
+ *
559
+ * @export
560
+ * @interface UserResponse
561
+ */
562
+ export interface UserResponse {
563
+ /**
564
+ *
565
+ * @type {string}
566
+ * @memberof UserResponse
567
+ */
568
+ 'id': string;
569
+ /**
570
+ *
571
+ * @type {string}
572
+ * @memberof UserResponse
573
+ */
574
+ 'username'?: string;
575
+ /**
576
+ *
577
+ * @type {string}
578
+ * @memberof UserResponse
579
+ */
580
+ 'firstName': string;
581
+ /**
582
+ *
583
+ * @type {string}
584
+ * @memberof UserResponse
585
+ */
586
+ 'lastName': string;
587
+ /**
588
+ *
589
+ * @type {string}
590
+ * @memberof UserResponse
591
+ */
592
+ 'email': string;
593
+ /**
594
+ *
595
+ * @type {boolean}
596
+ * @memberof UserResponse
597
+ */
598
+ 'isAccountVerified': boolean;
599
+ /**
600
+ *
601
+ * @type {string}
602
+ * @memberof UserResponse
603
+ */
604
+ 'level'?: string;
605
+ /**
606
+ *
607
+ * @type {string}
608
+ * @memberof UserResponse
609
+ */
610
+ 'stripeCustomerId'?: string;
611
+ /**
612
+ *
613
+ * @type {string}
614
+ * @memberof UserResponse
615
+ */
616
+ 'phone'?: string;
617
+ /**
618
+ *
619
+ * @type {string}
620
+ * @memberof UserResponse
621
+ */
622
+ 'profilePicture'?: string;
623
+ /**
624
+ *
625
+ * @type {boolean}
626
+ * @memberof UserResponse
627
+ */
628
+ 'isAdmin': boolean;
629
+ /**
630
+ *
631
+ * @type {string}
632
+ * @memberof UserResponse
633
+ */
634
+ 'createdAt': string;
635
+ /**
636
+ *
637
+ * @type {string}
638
+ * @memberof UserResponse
639
+ */
640
+ 'updatedAt': string;
641
+ }
302
642
 
303
643
  /**
304
- * AuthApi - axios parameter creator
644
+ * UsersApi - axios parameter creator
305
645
  * @export
306
646
  */
307
- export const AuthApiAxiosParamCreator = function (configuration?: Configuration) {
647
+ export const UsersApiAxiosParamCreator = function (configuration?: Configuration) {
308
648
  return {
309
649
  /**
310
650
  *
311
- * @summary Register a new user
312
- * @param {string} firstName
313
- * @param {string} lastName
314
- * @param {string} email
315
- * @param {string} password
316
- * @param {string} [username]
317
- * @param {boolean} [isAccountVerified]
318
- * @param {string} [level]
319
- * @param {string} [stripeCustomerId]
320
- * @param {string} [phone]
321
- * @param {string} [profilePicture]
322
- * @param {boolean} [isAdmin]
651
+ * @summary Modifie le mot de passe d\'un utilisateur
652
+ * @param {string} id ID de l\'utilisateur
653
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
323
654
  * @param {*} [options] Override http request option.
324
655
  * @throws {RequiredError}
325
656
  */
326
- apiAuthRegisterPost: async (firstName: string, lastName: string, email: string, password: string, username?: string, isAccountVerified?: boolean, level?: string, stripeCustomerId?: string, phone?: string, profilePicture?: string, isAdmin?: boolean, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
327
- // verify required parameter 'firstName' is not null or undefined
328
- assertParamExists('apiAuthRegisterPost', 'firstName', firstName)
329
- // verify required parameter 'lastName' is not null or undefined
330
- assertParamExists('apiAuthRegisterPost', 'lastName', lastName)
331
- // verify required parameter 'email' is not null or undefined
332
- assertParamExists('apiAuthRegisterPost', 'email', email)
333
- // verify required parameter 'password' is not null or undefined
334
- assertParamExists('apiAuthRegisterPost', 'password', password)
335
- const localVarPath = `/api/auth/register`;
657
+ changePassword: async (id: string, changePasswordRequestBody: ChangePasswordRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
658
+ // verify required parameter 'id' is not null or undefined
659
+ assertParamExists('changePassword', 'id', id)
660
+ // verify required parameter 'changePasswordRequestBody' is not null or undefined
661
+ assertParamExists('changePassword', 'changePasswordRequestBody', changePasswordRequestBody)
662
+ const localVarPath = `/api/users/{id}/password`
663
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
336
664
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
337
665
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
338
666
  let baseOptions;
@@ -340,63 +668,230 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
340
668
  baseOptions = configuration.baseOptions;
341
669
  }
342
670
 
343
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
671
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
344
672
  const localVarHeaderParameter = {} as any;
345
673
  const localVarQueryParameter = {} as any;
346
- const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
347
674
 
348
675
 
349
- if (username !== undefined) {
350
- localVarFormParams.append('username', username as any);
351
- }
352
-
353
- if (firstName !== undefined) {
354
- localVarFormParams.append('firstName', firstName as any);
355
- }
356
-
357
- if (lastName !== undefined) {
358
- localVarFormParams.append('lastName', lastName as any);
359
- }
360
-
361
- if (email !== undefined) {
362
- localVarFormParams.append('email', email as any);
363
- }
364
676
 
365
- if (isAccountVerified !== undefined) {
366
- localVarFormParams.append('isAccountVerified', String(isAccountVerified) as any);
367
- }
368
-
369
- if (level !== undefined) {
370
- localVarFormParams.append('level', level as any);
677
+ localVarHeaderParameter['Content-Type'] = 'application/json';
678
+
679
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
680
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
681
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
682
+ localVarRequestOptions.data = serializeDataIfNeeded(changePasswordRequestBody, localVarRequestOptions, configuration)
683
+
684
+ return {
685
+ url: toPathString(localVarUrlObj),
686
+ options: localVarRequestOptions,
687
+ };
688
+ },
689
+ /**
690
+ *
691
+ * @summary Récupère la liste des utilisateurs
692
+ * @param {*} [options] Override http request option.
693
+ * @throws {RequiredError}
694
+ */
695
+ getAllUsers: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
696
+ const localVarPath = `/api/users`;
697
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
698
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
699
+ let baseOptions;
700
+ if (configuration) {
701
+ baseOptions = configuration.baseOptions;
371
702
  }
703
+
704
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
705
+ const localVarHeaderParameter = {} as any;
706
+ const localVarQueryParameter = {} as any;
707
+
708
+
372
709
 
373
- if (stripeCustomerId !== undefined) {
374
- localVarFormParams.append('stripeCustomerId', stripeCustomerId as any);
710
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
711
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
712
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
713
+
714
+ return {
715
+ url: toPathString(localVarUrlObj),
716
+ options: localVarRequestOptions,
717
+ };
718
+ },
719
+ /**
720
+ *
721
+ * @summary Récupère un utilisateur par ID
722
+ * @param {string} id ID de l\&#39;utilisateur
723
+ * @param {*} [options] Override http request option.
724
+ * @throws {RequiredError}
725
+ */
726
+ getUserInfo: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
727
+ // verify required parameter 'id' is not null or undefined
728
+ assertParamExists('getUserInfo', 'id', id)
729
+ const localVarPath = `/api/users/{id}`
730
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
731
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
732
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
733
+ let baseOptions;
734
+ if (configuration) {
735
+ baseOptions = configuration.baseOptions;
375
736
  }
737
+
738
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
739
+ const localVarHeaderParameter = {} as any;
740
+ const localVarQueryParameter = {} as any;
741
+
742
+
376
743
 
377
- if (phone !== undefined) {
378
- localVarFormParams.append('phone', phone as any);
744
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
745
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
746
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
747
+
748
+ return {
749
+ url: toPathString(localVarUrlObj),
750
+ options: localVarRequestOptions,
751
+ };
752
+ },
753
+ /**
754
+ *
755
+ * @summary Authentifie un utilisateur
756
+ * @param {LoginRequestBody} loginRequestBody
757
+ * @param {*} [options] Override http request option.
758
+ * @throws {RequiredError}
759
+ */
760
+ login: async (loginRequestBody: LoginRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
761
+ // verify required parameter 'loginRequestBody' is not null or undefined
762
+ assertParamExists('login', 'loginRequestBody', loginRequestBody)
763
+ const localVarPath = `/api/users/login`;
764
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
765
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
766
+ let baseOptions;
767
+ if (configuration) {
768
+ baseOptions = configuration.baseOptions;
379
769
  }
770
+
771
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
772
+ const localVarHeaderParameter = {} as any;
773
+ const localVarQueryParameter = {} as any;
774
+
775
+
380
776
 
381
- if (password !== undefined) {
382
- localVarFormParams.append('password', password as any);
777
+ localVarHeaderParameter['Content-Type'] = 'application/json';
778
+
779
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
780
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
781
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
782
+ localVarRequestOptions.data = serializeDataIfNeeded(loginRequestBody, localVarRequestOptions, configuration)
783
+
784
+ return {
785
+ url: toPathString(localVarUrlObj),
786
+ options: localVarRequestOptions,
787
+ };
788
+ },
789
+ /**
790
+ *
791
+ * @summary Rafraîchit le token d\'accès
792
+ * @param {RefreshTokenRequestBody} refreshTokenRequestBody
793
+ * @param {*} [options] Override http request option.
794
+ * @throws {RequiredError}
795
+ */
796
+ refreshToken: async (refreshTokenRequestBody: RefreshTokenRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
797
+ // verify required parameter 'refreshTokenRequestBody' is not null or undefined
798
+ assertParamExists('refreshToken', 'refreshTokenRequestBody', refreshTokenRequestBody)
799
+ const localVarPath = `/api/users/refresh-token`;
800
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
801
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
802
+ let baseOptions;
803
+ if (configuration) {
804
+ baseOptions = configuration.baseOptions;
383
805
  }
806
+
807
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
808
+ const localVarHeaderParameter = {} as any;
809
+ const localVarQueryParameter = {} as any;
810
+
811
+
384
812
 
385
- if (profilePicture !== undefined) {
386
- localVarFormParams.append('profilePicture', profilePicture as any);
813
+ localVarHeaderParameter['Content-Type'] = 'application/json';
814
+
815
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
816
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
817
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
818
+ localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenRequestBody, localVarRequestOptions, configuration)
819
+
820
+ return {
821
+ url: toPathString(localVarUrlObj),
822
+ options: localVarRequestOptions,
823
+ };
824
+ },
825
+ /**
826
+ *
827
+ * @summary Crée un nouvel utilisateur
828
+ * @param {RegisterRequestBody} registerRequestBody
829
+ * @param {*} [options] Override http request option.
830
+ * @throws {RequiredError}
831
+ */
832
+ register: async (registerRequestBody: RegisterRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
833
+ // verify required parameter 'registerRequestBody' is not null or undefined
834
+ assertParamExists('register', 'registerRequestBody', registerRequestBody)
835
+ const localVarPath = `/api/users`;
836
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
837
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
838
+ let baseOptions;
839
+ if (configuration) {
840
+ baseOptions = configuration.baseOptions;
387
841
  }
842
+
843
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
844
+ const localVarHeaderParameter = {} as any;
845
+ const localVarQueryParameter = {} as any;
846
+
847
+
388
848
 
389
- if (isAdmin !== undefined) {
390
- localVarFormParams.append('isAdmin', String(isAdmin) as any);
849
+ localVarHeaderParameter['Content-Type'] = 'application/json';
850
+
851
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
852
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
853
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
854
+ localVarRequestOptions.data = serializeDataIfNeeded(registerRequestBody, localVarRequestOptions, configuration)
855
+
856
+ return {
857
+ url: toPathString(localVarUrlObj),
858
+ options: localVarRequestOptions,
859
+ };
860
+ },
861
+ /**
862
+ *
863
+ * @summary Met à jour un utilisateur
864
+ * @param {string} id ID de l\&#39;utilisateur
865
+ * @param {UpdateUserRequestBody} updateUserRequestBody
866
+ * @param {*} [options] Override http request option.
867
+ * @throws {RequiredError}
868
+ */
869
+ updateUser: async (id: string, updateUserRequestBody: UpdateUserRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
870
+ // verify required parameter 'id' is not null or undefined
871
+ assertParamExists('updateUser', 'id', id)
872
+ // verify required parameter 'updateUserRequestBody' is not null or undefined
873
+ assertParamExists('updateUser', 'updateUserRequestBody', updateUserRequestBody)
874
+ const localVarPath = `/api/users/{id}`
875
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
876
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
877
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
878
+ let baseOptions;
879
+ if (configuration) {
880
+ baseOptions = configuration.baseOptions;
391
881
  }
882
+
883
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
884
+ const localVarHeaderParameter = {} as any;
885
+ const localVarQueryParameter = {} as any;
886
+
887
+
392
888
 
393
-
394
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
395
-
889
+ localVarHeaderParameter['Content-Type'] = 'application/json';
890
+
396
891
  setSearchParams(localVarUrlObj, localVarQueryParameter);
397
892
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
398
893
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
399
- localVarRequestOptions.data = localVarFormParams;
894
+ localVarRequestOptions.data = serializeDataIfNeeded(updateUserRequestBody, localVarRequestOptions, configuration)
400
895
 
401
896
  return {
402
897
  url: toPathString(localVarUrlObj),
@@ -407,260 +902,372 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
407
902
  };
408
903
 
409
904
  /**
410
- * AuthApi - functional programming interface
905
+ * UsersApi - functional programming interface
411
906
  * @export
412
907
  */
413
- export const AuthApiFp = function(configuration?: Configuration) {
414
- const localVarAxiosParamCreator = AuthApiAxiosParamCreator(configuration)
908
+ export const UsersApiFp = function(configuration?: Configuration) {
909
+ const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration)
415
910
  return {
416
911
  /**
417
912
  *
418
- * @summary Register a new user
419
- * @param {string} firstName
420
- * @param {string} lastName
421
- * @param {string} email
422
- * @param {string} password
423
- * @param {string} [username]
424
- * @param {boolean} [isAccountVerified]
425
- * @param {string} [level]
426
- * @param {string} [stripeCustomerId]
427
- * @param {string} [phone]
428
- * @param {string} [profilePicture]
429
- * @param {boolean} [isAdmin]
913
+ * @summary Modifie le mot de passe d\'un utilisateur
914
+ * @param {string} id ID de l\&#39;utilisateur
915
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
916
+ * @param {*} [options] Override http request option.
917
+ * @throws {RequiredError}
918
+ */
919
+ async changePassword(id: string, changePasswordRequestBody: ChangePasswordRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChangePasswordResponse>> {
920
+ const localVarAxiosArgs = await localVarAxiosParamCreator.changePassword(id, changePasswordRequestBody, options);
921
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
922
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.changePassword']?.[localVarOperationServerIndex]?.url;
923
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
924
+ },
925
+ /**
926
+ *
927
+ * @summary Récupère la liste des utilisateurs
928
+ * @param {*} [options] Override http request option.
929
+ * @throws {RequiredError}
930
+ */
931
+ async getAllUsers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<UserResponse>>> {
932
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getAllUsers(options);
933
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
934
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.getAllUsers']?.[localVarOperationServerIndex]?.url;
935
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
936
+ },
937
+ /**
938
+ *
939
+ * @summary Récupère un utilisateur par ID
940
+ * @param {string} id ID de l\&#39;utilisateur
941
+ * @param {*} [options] Override http request option.
942
+ * @throws {RequiredError}
943
+ */
944
+ async getUserInfo(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserResponse>> {
945
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getUserInfo(id, options);
946
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
947
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.getUserInfo']?.[localVarOperationServerIndex]?.url;
948
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
949
+ },
950
+ /**
951
+ *
952
+ * @summary Authentifie un utilisateur
953
+ * @param {LoginRequestBody} loginRequestBody
954
+ * @param {*} [options] Override http request option.
955
+ * @throws {RequiredError}
956
+ */
957
+ async login(loginRequestBody: LoginRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LoginResponse>> {
958
+ const localVarAxiosArgs = await localVarAxiosParamCreator.login(loginRequestBody, options);
959
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
960
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.login']?.[localVarOperationServerIndex]?.url;
961
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
962
+ },
963
+ /**
964
+ *
965
+ * @summary Rafraîchit le token d\'accès
966
+ * @param {RefreshTokenRequestBody} refreshTokenRequestBody
430
967
  * @param {*} [options] Override http request option.
431
968
  * @throws {RequiredError}
432
969
  */
433
- async apiAuthRegisterPost(firstName: string, lastName: string, email: string, password: string, username?: string, isAccountVerified?: boolean, level?: string, stripeCustomerId?: string, phone?: string, profilePicture?: string, isAdmin?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
434
- const localVarAxiosArgs = await localVarAxiosParamCreator.apiAuthRegisterPost(firstName, lastName, email, password, username, isAccountVerified, level, stripeCustomerId, phone, profilePicture, isAdmin, options);
970
+ async refreshToken(refreshTokenRequestBody: RefreshTokenRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefreshTokenResponse>> {
971
+ const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(refreshTokenRequestBody, options);
435
972
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
436
- const localVarOperationServerBasePath = operationServerMap['AuthApi.apiAuthRegisterPost']?.[localVarOperationServerIndex]?.url;
973
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.refreshToken']?.[localVarOperationServerIndex]?.url;
974
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
975
+ },
976
+ /**
977
+ *
978
+ * @summary Crée un nouvel utilisateur
979
+ * @param {RegisterRequestBody} registerRequestBody
980
+ * @param {*} [options] Override http request option.
981
+ * @throws {RequiredError}
982
+ */
983
+ async register(registerRequestBody: RegisterRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserResponse>> {
984
+ const localVarAxiosArgs = await localVarAxiosParamCreator.register(registerRequestBody, options);
985
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
986
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.register']?.[localVarOperationServerIndex]?.url;
987
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
988
+ },
989
+ /**
990
+ *
991
+ * @summary Met à jour un utilisateur
992
+ * @param {string} id ID de l\&#39;utilisateur
993
+ * @param {UpdateUserRequestBody} updateUserRequestBody
994
+ * @param {*} [options] Override http request option.
995
+ * @throws {RequiredError}
996
+ */
997
+ async updateUser(id: string, updateUserRequestBody: UpdateUserRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserResponse>> {
998
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(id, updateUserRequestBody, options);
999
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1000
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.updateUser']?.[localVarOperationServerIndex]?.url;
437
1001
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
438
1002
  },
439
1003
  }
440
1004
  };
441
1005
 
442
1006
  /**
443
- * AuthApi - factory interface
1007
+ * UsersApi - factory interface
444
1008
  * @export
445
1009
  */
446
- export const AuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
447
- const localVarFp = AuthApiFp(configuration)
1010
+ export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1011
+ const localVarFp = UsersApiFp(configuration)
448
1012
  return {
449
1013
  /**
450
1014
  *
451
- * @summary Register a new user
452
- * @param {AuthApiApiAuthRegisterPostRequest} requestParameters Request parameters.
1015
+ * @summary Modifie le mot de passe d\'un utilisateur
1016
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
453
1017
  * @param {*} [options] Override http request option.
454
1018
  * @throws {RequiredError}
455
1019
  */
456
- apiAuthRegisterPost(requestParameters: AuthApiApiAuthRegisterPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<User> {
457
- 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));
1020
+ changePassword(requestParameters: UsersApiChangePasswordRequest, options?: RawAxiosRequestConfig): AxiosPromise<ChangePasswordResponse> {
1021
+ return localVarFp.changePassword(requestParameters.id, requestParameters.changePasswordRequestBody, options).then((request) => request(axios, basePath));
1022
+ },
1023
+ /**
1024
+ *
1025
+ * @summary Récupère la liste des utilisateurs
1026
+ * @param {*} [options] Override http request option.
1027
+ * @throws {RequiredError}
1028
+ */
1029
+ getAllUsers(options?: RawAxiosRequestConfig): AxiosPromise<Array<UserResponse>> {
1030
+ return localVarFp.getAllUsers(options).then((request) => request(axios, basePath));
1031
+ },
1032
+ /**
1033
+ *
1034
+ * @summary Récupère un utilisateur par ID
1035
+ * @param {UsersApiGetUserInfoRequest} requestParameters Request parameters.
1036
+ * @param {*} [options] Override http request option.
1037
+ * @throws {RequiredError}
1038
+ */
1039
+ getUserInfo(requestParameters: UsersApiGetUserInfoRequest, options?: RawAxiosRequestConfig): AxiosPromise<UserResponse> {
1040
+ return localVarFp.getUserInfo(requestParameters.id, options).then((request) => request(axios, basePath));
1041
+ },
1042
+ /**
1043
+ *
1044
+ * @summary Authentifie un utilisateur
1045
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
1046
+ * @param {*} [options] Override http request option.
1047
+ * @throws {RequiredError}
1048
+ */
1049
+ login(requestParameters: UsersApiLoginRequest, options?: RawAxiosRequestConfig): AxiosPromise<LoginResponse> {
1050
+ return localVarFp.login(requestParameters.loginRequestBody, options).then((request) => request(axios, basePath));
1051
+ },
1052
+ /**
1053
+ *
1054
+ * @summary Rafraîchit le token d\'accès
1055
+ * @param {UsersApiRefreshTokenRequest} requestParameters Request parameters.
1056
+ * @param {*} [options] Override http request option.
1057
+ * @throws {RequiredError}
1058
+ */
1059
+ refreshToken(requestParameters: UsersApiRefreshTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise<RefreshTokenResponse> {
1060
+ return localVarFp.refreshToken(requestParameters.refreshTokenRequestBody, options).then((request) => request(axios, basePath));
1061
+ },
1062
+ /**
1063
+ *
1064
+ * @summary Crée un nouvel utilisateur
1065
+ * @param {UsersApiRegisterRequest} requestParameters Request parameters.
1066
+ * @param {*} [options] Override http request option.
1067
+ * @throws {RequiredError}
1068
+ */
1069
+ register(requestParameters: UsersApiRegisterRequest, options?: RawAxiosRequestConfig): AxiosPromise<UserResponse> {
1070
+ return localVarFp.register(requestParameters.registerRequestBody, options).then((request) => request(axios, basePath));
1071
+ },
1072
+ /**
1073
+ *
1074
+ * @summary Met à jour un utilisateur
1075
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
1076
+ * @param {*} [options] Override http request option.
1077
+ * @throws {RequiredError}
1078
+ */
1079
+ updateUser(requestParameters: UsersApiUpdateUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<UserResponse> {
1080
+ return localVarFp.updateUser(requestParameters.id, requestParameters.updateUserRequestBody, options).then((request) => request(axios, basePath));
458
1081
  },
459
1082
  };
460
1083
  };
461
1084
 
462
1085
  /**
463
- * Request parameters for apiAuthRegisterPost operation in AuthApi.
1086
+ * Request parameters for changePassword operation in UsersApi.
464
1087
  * @export
465
- * @interface AuthApiApiAuthRegisterPostRequest
1088
+ * @interface UsersApiChangePasswordRequest
466
1089
  */
467
- export interface AuthApiApiAuthRegisterPostRequest {
1090
+ export interface UsersApiChangePasswordRequest {
468
1091
  /**
469
- *
1092
+ * ID de l\&#39;utilisateur
470
1093
  * @type {string}
471
- * @memberof AuthApiApiAuthRegisterPost
1094
+ * @memberof UsersApiChangePassword
472
1095
  */
473
- readonly firstName: string
1096
+ readonly id: string
474
1097
 
475
1098
  /**
476
1099
  *
477
- * @type {string}
478
- * @memberof AuthApiApiAuthRegisterPost
1100
+ * @type {ChangePasswordRequestBody}
1101
+ * @memberof UsersApiChangePassword
479
1102
  */
480
- readonly lastName: string
1103
+ readonly changePasswordRequestBody: ChangePasswordRequestBody
1104
+ }
481
1105
 
1106
+ /**
1107
+ * Request parameters for getUserInfo operation in UsersApi.
1108
+ * @export
1109
+ * @interface UsersApiGetUserInfoRequest
1110
+ */
1111
+ export interface UsersApiGetUserInfoRequest {
482
1112
  /**
483
- *
1113
+ * ID de l\&#39;utilisateur
484
1114
  * @type {string}
485
- * @memberof AuthApiApiAuthRegisterPost
1115
+ * @memberof UsersApiGetUserInfo
486
1116
  */
487
- readonly email: string
1117
+ readonly id: string
1118
+ }
488
1119
 
1120
+ /**
1121
+ * Request parameters for login operation in UsersApi.
1122
+ * @export
1123
+ * @interface UsersApiLoginRequest
1124
+ */
1125
+ export interface UsersApiLoginRequest {
489
1126
  /**
490
1127
  *
491
- * @type {string}
492
- * @memberof AuthApiApiAuthRegisterPost
1128
+ * @type {LoginRequestBody}
1129
+ * @memberof UsersApiLogin
493
1130
  */
494
- readonly password: string
1131
+ readonly loginRequestBody: LoginRequestBody
1132
+ }
495
1133
 
1134
+ /**
1135
+ * Request parameters for refreshToken operation in UsersApi.
1136
+ * @export
1137
+ * @interface UsersApiRefreshTokenRequest
1138
+ */
1139
+ export interface UsersApiRefreshTokenRequest {
496
1140
  /**
497
1141
  *
498
- * @type {string}
499
- * @memberof AuthApiApiAuthRegisterPost
1142
+ * @type {RefreshTokenRequestBody}
1143
+ * @memberof UsersApiRefreshToken
500
1144
  */
501
- readonly username?: string
1145
+ readonly refreshTokenRequestBody: RefreshTokenRequestBody
1146
+ }
502
1147
 
1148
+ /**
1149
+ * Request parameters for register operation in UsersApi.
1150
+ * @export
1151
+ * @interface UsersApiRegisterRequest
1152
+ */
1153
+ export interface UsersApiRegisterRequest {
503
1154
  /**
504
1155
  *
505
- * @type {boolean}
506
- * @memberof AuthApiApiAuthRegisterPost
1156
+ * @type {RegisterRequestBody}
1157
+ * @memberof UsersApiRegister
507
1158
  */
508
- readonly isAccountVerified?: boolean
1159
+ readonly registerRequestBody: RegisterRequestBody
1160
+ }
509
1161
 
1162
+ /**
1163
+ * Request parameters for updateUser operation in UsersApi.
1164
+ * @export
1165
+ * @interface UsersApiUpdateUserRequest
1166
+ */
1167
+ export interface UsersApiUpdateUserRequest {
510
1168
  /**
511
- *
1169
+ * ID de l\&#39;utilisateur
512
1170
  * @type {string}
513
- * @memberof AuthApiApiAuthRegisterPost
1171
+ * @memberof UsersApiUpdateUser
514
1172
  */
515
- readonly level?: string
1173
+ readonly id: string
516
1174
 
517
1175
  /**
518
1176
  *
519
- * @type {string}
520
- * @memberof AuthApiApiAuthRegisterPost
1177
+ * @type {UpdateUserRequestBody}
1178
+ * @memberof UsersApiUpdateUser
521
1179
  */
522
- readonly stripeCustomerId?: string
1180
+ readonly updateUserRequestBody: UpdateUserRequestBody
1181
+ }
523
1182
 
1183
+ /**
1184
+ * UsersApi - object-oriented interface
1185
+ * @export
1186
+ * @class UsersApi
1187
+ * @extends {BaseAPI}
1188
+ */
1189
+ export class UsersApi extends BaseAPI {
524
1190
  /**
525
1191
  *
526
- * @type {string}
527
- * @memberof AuthApiApiAuthRegisterPost
1192
+ * @summary Modifie le mot de passe d\'un utilisateur
1193
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
1194
+ * @param {*} [options] Override http request option.
1195
+ * @throws {RequiredError}
1196
+ * @memberof UsersApi
528
1197
  */
529
- readonly phone?: string
1198
+ public changePassword(requestParameters: UsersApiChangePasswordRequest, options?: RawAxiosRequestConfig) {
1199
+ return UsersApiFp(this.configuration).changePassword(requestParameters.id, requestParameters.changePasswordRequestBody, options).then((request) => request(this.axios, this.basePath));
1200
+ }
530
1201
 
531
1202
  /**
532
1203
  *
533
- * @type {string}
534
- * @memberof AuthApiApiAuthRegisterPost
1204
+ * @summary Récupère la liste des utilisateurs
1205
+ * @param {*} [options] Override http request option.
1206
+ * @throws {RequiredError}
1207
+ * @memberof UsersApi
535
1208
  */
536
- readonly profilePicture?: string
1209
+ public getAllUsers(options?: RawAxiosRequestConfig) {
1210
+ return UsersApiFp(this.configuration).getAllUsers(options).then((request) => request(this.axios, this.basePath));
1211
+ }
537
1212
 
538
1213
  /**
539
1214
  *
540
- * @type {boolean}
541
- * @memberof AuthApiApiAuthRegisterPost
1215
+ * @summary Récupère un utilisateur par ID
1216
+ * @param {UsersApiGetUserInfoRequest} requestParameters Request parameters.
1217
+ * @param {*} [options] Override http request option.
1218
+ * @throws {RequiredError}
1219
+ * @memberof UsersApi
542
1220
  */
543
- readonly isAdmin?: boolean
544
- }
1221
+ public getUserInfo(requestParameters: UsersApiGetUserInfoRequest, options?: RawAxiosRequestConfig) {
1222
+ return UsersApiFp(this.configuration).getUserInfo(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
1223
+ }
545
1224
 
546
- /**
547
- * AuthApi - object-oriented interface
548
- * @export
549
- * @class AuthApi
550
- * @extends {BaseAPI}
551
- */
552
- export class AuthApi extends BaseAPI {
553
1225
  /**
554
1226
  *
555
- * @summary Register a new user
556
- * @param {AuthApiApiAuthRegisterPostRequest} requestParameters Request parameters.
1227
+ * @summary Authentifie un utilisateur
1228
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
557
1229
  * @param {*} [options] Override http request option.
558
1230
  * @throws {RequiredError}
559
- * @memberof AuthApi
1231
+ * @memberof UsersApi
560
1232
  */
561
- public apiAuthRegisterPost(requestParameters: AuthApiApiAuthRegisterPostRequest, options?: RawAxiosRequestConfig) {
562
- 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));
1233
+ public login(requestParameters: UsersApiLoginRequest, options?: RawAxiosRequestConfig) {
1234
+ return UsersApiFp(this.configuration).login(requestParameters.loginRequestBody, options).then((request) => request(this.axios, this.basePath));
563
1235
  }
564
- }
565
-
566
-
567
-
568
- /**
569
- * UsersApi - axios parameter creator
570
- * @export
571
- */
572
- export const UsersApiAxiosParamCreator = function (configuration?: Configuration) {
573
- return {
574
- /**
575
- *
576
- * @summary Retrieve all users
577
- * @param {*} [options] Override http request option.
578
- * @throws {RequiredError}
579
- */
580
- apiUsersGet: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
581
- const localVarPath = `/api/users`;
582
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
583
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
584
- let baseOptions;
585
- if (configuration) {
586
- baseOptions = configuration.baseOptions;
587
- }
588
-
589
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
590
- const localVarHeaderParameter = {} as any;
591
- const localVarQueryParameter = {} as any;
592
-
593
1236
 
594
-
595
- setSearchParams(localVarUrlObj, localVarQueryParameter);
596
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
597
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
598
-
599
- return {
600
- url: toPathString(localVarUrlObj),
601
- options: localVarRequestOptions,
602
- };
603
- },
1237
+ /**
1238
+ *
1239
+ * @summary Rafraîchit le token d\'accès
1240
+ * @param {UsersApiRefreshTokenRequest} requestParameters Request parameters.
1241
+ * @param {*} [options] Override http request option.
1242
+ * @throws {RequiredError}
1243
+ * @memberof UsersApi
1244
+ */
1245
+ public refreshToken(requestParameters: UsersApiRefreshTokenRequest, options?: RawAxiosRequestConfig) {
1246
+ return UsersApiFp(this.configuration).refreshToken(requestParameters.refreshTokenRequestBody, options).then((request) => request(this.axios, this.basePath));
604
1247
  }
605
- };
606
1248
 
607
- /**
608
- * UsersApi - functional programming interface
609
- * @export
610
- */
611
- export const UsersApiFp = function(configuration?: Configuration) {
612
- const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration)
613
- return {
614
- /**
615
- *
616
- * @summary Retrieve all users
617
- * @param {*} [options] Override http request option.
618
- * @throws {RequiredError}
619
- */
620
- async apiUsersGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<User>>> {
621
- const localVarAxiosArgs = await localVarAxiosParamCreator.apiUsersGet(options);
622
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
623
- const localVarOperationServerBasePath = operationServerMap['UsersApi.apiUsersGet']?.[localVarOperationServerIndex]?.url;
624
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
625
- },
1249
+ /**
1250
+ *
1251
+ * @summary Crée un nouvel utilisateur
1252
+ * @param {UsersApiRegisterRequest} requestParameters Request parameters.
1253
+ * @param {*} [options] Override http request option.
1254
+ * @throws {RequiredError}
1255
+ * @memberof UsersApi
1256
+ */
1257
+ public register(requestParameters: UsersApiRegisterRequest, options?: RawAxiosRequestConfig) {
1258
+ return UsersApiFp(this.configuration).register(requestParameters.registerRequestBody, options).then((request) => request(this.axios, this.basePath));
626
1259
  }
627
- };
628
1260
 
629
- /**
630
- * UsersApi - factory interface
631
- * @export
632
- */
633
- export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
634
- const localVarFp = UsersApiFp(configuration)
635
- return {
636
- /**
637
- *
638
- * @summary Retrieve all users
639
- * @param {*} [options] Override http request option.
640
- * @throws {RequiredError}
641
- */
642
- apiUsersGet(options?: RawAxiosRequestConfig): AxiosPromise<Array<User>> {
643
- return localVarFp.apiUsersGet(options).then((request) => request(axios, basePath));
644
- },
645
- };
646
- };
647
-
648
- /**
649
- * UsersApi - object-oriented interface
650
- * @export
651
- * @class UsersApi
652
- * @extends {BaseAPI}
653
- */
654
- export class UsersApi extends BaseAPI {
655
1261
  /**
656
1262
  *
657
- * @summary Retrieve all users
1263
+ * @summary Met à jour un utilisateur
1264
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
658
1265
  * @param {*} [options] Override http request option.
659
1266
  * @throws {RequiredError}
660
1267
  * @memberof UsersApi
661
1268
  */
662
- public apiUsersGet(options?: RawAxiosRequestConfig) {
663
- return UsersApiFp(this.configuration).apiUsersGet(options).then((request) => request(this.axios, this.basePath));
1269
+ public updateUser(requestParameters: UsersApiUpdateUserRequest, options?: RawAxiosRequestConfig) {
1270
+ return UsersApiFp(this.configuration).updateUser(requestParameters.id, requestParameters.updateUserRequestBody, options).then((request) => request(this.axios, this.basePath));
664
1271
  }
665
1272
  }
666
1273