@tennac-booking/sdk 1.0.8 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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,6 +554,91 @@ 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
644
  * UsersApi - axios parameter creator
@@ -308,12 +648,15 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration
308
648
  return {
309
649
  /**
310
650
  *
311
- * @summary Retrieve all users
651
+ * @summary Modifie le mot de passe de l\'utilisateur connecté
652
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
312
653
  * @param {*} [options] Override http request option.
313
654
  * @throws {RequiredError}
314
655
  */
315
- getAllUsers: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
316
- const localVarPath = `/api/users`;
656
+ changePassword: async (changePasswordRequestBody: ChangePasswordRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
657
+ // verify required parameter 'changePasswordRequestBody' is not null or undefined
658
+ assertParamExists('changePassword', 'changePasswordRequestBody', changePasswordRequestBody)
659
+ const localVarPath = `/api/users/me/password`;
317
660
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
318
661
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
319
662
  let baseOptions;
@@ -321,15 +664,250 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration
321
664
  baseOptions = configuration.baseOptions;
322
665
  }
323
666
 
324
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
667
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
325
668
  const localVarHeaderParameter = {} as any;
326
669
  const localVarQueryParameter = {} as any;
327
670
 
671
+ // authentication bearerAuth required
672
+ // http bearer authentication required
673
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
674
+
675
+
676
+
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;
702
+ }
703
+
704
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
705
+ const localVarHeaderParameter = {} as any;
706
+ const localVarQueryParameter = {} as any;
707
+
708
+ // authentication bearerAuth required
709
+ // http bearer authentication required
710
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
711
+
712
+
713
+
714
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
715
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
716
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
717
+
718
+ return {
719
+ url: toPathString(localVarUrlObj),
720
+ options: localVarRequestOptions,
721
+ };
722
+ },
723
+ /**
724
+ *
725
+ * @summary Récupère les informations de l\'utilisateur connecté
726
+ * @param {*} [options] Override http request option.
727
+ * @throws {RequiredError}
728
+ */
729
+ getUserInfo: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
730
+ const localVarPath = `/api/users/me`;
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;
736
+ }
737
+
738
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
739
+ const localVarHeaderParameter = {} as any;
740
+ const localVarQueryParameter = {} as any;
741
+
742
+ // authentication bearerAuth required
743
+ // http bearer authentication required
744
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
745
+
746
+
747
+
748
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
749
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
750
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
751
+
752
+ return {
753
+ url: toPathString(localVarUrlObj),
754
+ options: localVarRequestOptions,
755
+ };
756
+ },
757
+ /**
758
+ *
759
+ * @summary Authentifie un utilisateur
760
+ * @param {LoginRequestBody} loginRequestBody
761
+ * @param {*} [options] Override http request option.
762
+ * @throws {RequiredError}
763
+ */
764
+ login: async (loginRequestBody: LoginRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
765
+ // verify required parameter 'loginRequestBody' is not null or undefined
766
+ assertParamExists('login', 'loginRequestBody', loginRequestBody)
767
+ const localVarPath = `/api/users/login`;
768
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
769
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
770
+ let baseOptions;
771
+ if (configuration) {
772
+ baseOptions = configuration.baseOptions;
773
+ }
774
+
775
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
776
+ const localVarHeaderParameter = {} as any;
777
+ const localVarQueryParameter = {} as any;
778
+
779
+ // authentication bearerAuth required
780
+ // http bearer authentication required
781
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
782
+
328
783
 
329
784
 
785
+ localVarHeaderParameter['Content-Type'] = 'application/json';
786
+
787
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
788
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
789
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
790
+ localVarRequestOptions.data = serializeDataIfNeeded(loginRequestBody, localVarRequestOptions, configuration)
791
+
792
+ return {
793
+ url: toPathString(localVarUrlObj),
794
+ options: localVarRequestOptions,
795
+ };
796
+ },
797
+ /**
798
+ *
799
+ * @summary Rafraîchit le token d\'accès
800
+ * @param {RefreshTokenRequestBody} refreshTokenRequestBody
801
+ * @param {*} [options] Override http request option.
802
+ * @throws {RequiredError}
803
+ */
804
+ refreshToken: async (refreshTokenRequestBody: RefreshTokenRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
805
+ // verify required parameter 'refreshTokenRequestBody' is not null or undefined
806
+ assertParamExists('refreshToken', 'refreshTokenRequestBody', refreshTokenRequestBody)
807
+ const localVarPath = `/api/users/refresh-token`;
808
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
809
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
810
+ let baseOptions;
811
+ if (configuration) {
812
+ baseOptions = configuration.baseOptions;
813
+ }
814
+
815
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
816
+ const localVarHeaderParameter = {} as any;
817
+ const localVarQueryParameter = {} as any;
818
+
819
+ // authentication bearerAuth required
820
+ // http bearer authentication required
821
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
822
+
823
+
824
+
825
+ localVarHeaderParameter['Content-Type'] = 'application/json';
826
+
827
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
828
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
829
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
830
+ localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenRequestBody, localVarRequestOptions, configuration)
831
+
832
+ return {
833
+ url: toPathString(localVarUrlObj),
834
+ options: localVarRequestOptions,
835
+ };
836
+ },
837
+ /**
838
+ *
839
+ * @summary Crée un nouvel utilisateur
840
+ * @param {RegisterRequestBody} registerRequestBody
841
+ * @param {*} [options] Override http request option.
842
+ * @throws {RequiredError}
843
+ */
844
+ register: async (registerRequestBody: RegisterRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
845
+ // verify required parameter 'registerRequestBody' is not null or undefined
846
+ assertParamExists('register', 'registerRequestBody', registerRequestBody)
847
+ const localVarPath = `/api/users`;
848
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
849
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
850
+ let baseOptions;
851
+ if (configuration) {
852
+ baseOptions = configuration.baseOptions;
853
+ }
854
+
855
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
856
+ const localVarHeaderParameter = {} as any;
857
+ const localVarQueryParameter = {} as any;
858
+
859
+ // authentication bearerAuth required
860
+ // http bearer authentication required
861
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
862
+
863
+
864
+
865
+ localVarHeaderParameter['Content-Type'] = 'application/json';
866
+
867
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
868
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
869
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
870
+ localVarRequestOptions.data = serializeDataIfNeeded(registerRequestBody, localVarRequestOptions, configuration)
871
+
872
+ return {
873
+ url: toPathString(localVarUrlObj),
874
+ options: localVarRequestOptions,
875
+ };
876
+ },
877
+ /**
878
+ *
879
+ * @summary Met à jour les données de l\'utilisateur connecté
880
+ * @param {UpdateUserRequestBody} updateUserRequestBody
881
+ * @param {*} [options] Override http request option.
882
+ * @throws {RequiredError}
883
+ */
884
+ updateUser: async (updateUserRequestBody: UpdateUserRequestBody, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
885
+ // verify required parameter 'updateUserRequestBody' is not null or undefined
886
+ assertParamExists('updateUser', 'updateUserRequestBody', updateUserRequestBody)
887
+ const localVarPath = `/api/users/me`;
888
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
889
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
890
+ let baseOptions;
891
+ if (configuration) {
892
+ baseOptions = configuration.baseOptions;
893
+ }
894
+
895
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
896
+ const localVarHeaderParameter = {} as any;
897
+ const localVarQueryParameter = {} as any;
898
+
899
+ // authentication bearerAuth required
900
+ // http bearer authentication required
901
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
902
+
903
+
904
+
905
+ localVarHeaderParameter['Content-Type'] = 'application/json';
906
+
330
907
  setSearchParams(localVarUrlObj, localVarQueryParameter);
331
908
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
332
909
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
910
+ localVarRequestOptions.data = serializeDataIfNeeded(updateUserRequestBody, localVarRequestOptions, configuration)
333
911
 
334
912
  return {
335
913
  url: toPathString(localVarUrlObj),
@@ -348,16 +926,93 @@ export const UsersApiFp = function(configuration?: Configuration) {
348
926
  return {
349
927
  /**
350
928
  *
351
- * @summary Retrieve all users
929
+ * @summary Modifie le mot de passe de l\'utilisateur connecté
930
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
352
931
  * @param {*} [options] Override http request option.
353
932
  * @throws {RequiredError}
354
933
  */
355
- async getAllUsers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<User>>> {
934
+ async changePassword(changePasswordRequestBody: ChangePasswordRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChangePasswordResponse>> {
935
+ const localVarAxiosArgs = await localVarAxiosParamCreator.changePassword(changePasswordRequestBody, options);
936
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
937
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.changePassword']?.[localVarOperationServerIndex]?.url;
938
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
939
+ },
940
+ /**
941
+ *
942
+ * @summary Récupère la liste des utilisateurs
943
+ * @param {*} [options] Override http request option.
944
+ * @throws {RequiredError}
945
+ */
946
+ async getAllUsers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<UserResponse>>> {
356
947
  const localVarAxiosArgs = await localVarAxiosParamCreator.getAllUsers(options);
357
948
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
358
949
  const localVarOperationServerBasePath = operationServerMap['UsersApi.getAllUsers']?.[localVarOperationServerIndex]?.url;
359
950
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
360
951
  },
952
+ /**
953
+ *
954
+ * @summary Récupère les informations de l\'utilisateur connecté
955
+ * @param {*} [options] Override http request option.
956
+ * @throws {RequiredError}
957
+ */
958
+ async getUserInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserResponse>> {
959
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getUserInfo(options);
960
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
961
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.getUserInfo']?.[localVarOperationServerIndex]?.url;
962
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
963
+ },
964
+ /**
965
+ *
966
+ * @summary Authentifie un utilisateur
967
+ * @param {LoginRequestBody} loginRequestBody
968
+ * @param {*} [options] Override http request option.
969
+ * @throws {RequiredError}
970
+ */
971
+ async login(loginRequestBody: LoginRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LoginResponse>> {
972
+ const localVarAxiosArgs = await localVarAxiosParamCreator.login(loginRequestBody, options);
973
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
974
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.login']?.[localVarOperationServerIndex]?.url;
975
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
976
+ },
977
+ /**
978
+ *
979
+ * @summary Rafraîchit le token d\'accès
980
+ * @param {RefreshTokenRequestBody} refreshTokenRequestBody
981
+ * @param {*} [options] Override http request option.
982
+ * @throws {RequiredError}
983
+ */
984
+ async refreshToken(refreshTokenRequestBody: RefreshTokenRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefreshTokenResponse>> {
985
+ const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(refreshTokenRequestBody, options);
986
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
987
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.refreshToken']?.[localVarOperationServerIndex]?.url;
988
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
989
+ },
990
+ /**
991
+ *
992
+ * @summary Crée un nouvel utilisateur
993
+ * @param {RegisterRequestBody} registerRequestBody
994
+ * @param {*} [options] Override http request option.
995
+ * @throws {RequiredError}
996
+ */
997
+ async register(registerRequestBody: RegisterRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserResponse>> {
998
+ const localVarAxiosArgs = await localVarAxiosParamCreator.register(registerRequestBody, options);
999
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1000
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.register']?.[localVarOperationServerIndex]?.url;
1001
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1002
+ },
1003
+ /**
1004
+ *
1005
+ * @summary Met à jour les données de l\'utilisateur connecté
1006
+ * @param {UpdateUserRequestBody} updateUserRequestBody
1007
+ * @param {*} [options] Override http request option.
1008
+ * @throws {RequiredError}
1009
+ */
1010
+ async updateUser(updateUserRequestBody: UpdateUserRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserResponse>> {
1011
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(updateUserRequestBody, options);
1012
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1013
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.updateUser']?.[localVarOperationServerIndex]?.url;
1014
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1015
+ },
361
1016
  }
362
1017
  };
363
1018
 
@@ -370,16 +1025,145 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath
370
1025
  return {
371
1026
  /**
372
1027
  *
373
- * @summary Retrieve all users
1028
+ * @summary Modifie le mot de passe de l\'utilisateur connecté
1029
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
1030
+ * @param {*} [options] Override http request option.
1031
+ * @throws {RequiredError}
1032
+ */
1033
+ changePassword(requestParameters: UsersApiChangePasswordRequest, options?: RawAxiosRequestConfig): AxiosPromise<ChangePasswordResponse> {
1034
+ return localVarFp.changePassword(requestParameters.changePasswordRequestBody, options).then((request) => request(axios, basePath));
1035
+ },
1036
+ /**
1037
+ *
1038
+ * @summary Récupère la liste des utilisateurs
374
1039
  * @param {*} [options] Override http request option.
375
1040
  * @throws {RequiredError}
376
1041
  */
377
- getAllUsers(options?: RawAxiosRequestConfig): AxiosPromise<Array<User>> {
1042
+ getAllUsers(options?: RawAxiosRequestConfig): AxiosPromise<Array<UserResponse>> {
378
1043
  return localVarFp.getAllUsers(options).then((request) => request(axios, basePath));
379
1044
  },
1045
+ /**
1046
+ *
1047
+ * @summary Récupère les informations de l\'utilisateur connecté
1048
+ * @param {*} [options] Override http request option.
1049
+ * @throws {RequiredError}
1050
+ */
1051
+ getUserInfo(options?: RawAxiosRequestConfig): AxiosPromise<UserResponse> {
1052
+ return localVarFp.getUserInfo(options).then((request) => request(axios, basePath));
1053
+ },
1054
+ /**
1055
+ *
1056
+ * @summary Authentifie un utilisateur
1057
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
1058
+ * @param {*} [options] Override http request option.
1059
+ * @throws {RequiredError}
1060
+ */
1061
+ login(requestParameters: UsersApiLoginRequest, options?: RawAxiosRequestConfig): AxiosPromise<LoginResponse> {
1062
+ return localVarFp.login(requestParameters.loginRequestBody, options).then((request) => request(axios, basePath));
1063
+ },
1064
+ /**
1065
+ *
1066
+ * @summary Rafraîchit le token d\'accès
1067
+ * @param {UsersApiRefreshTokenRequest} requestParameters Request parameters.
1068
+ * @param {*} [options] Override http request option.
1069
+ * @throws {RequiredError}
1070
+ */
1071
+ refreshToken(requestParameters: UsersApiRefreshTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise<RefreshTokenResponse> {
1072
+ return localVarFp.refreshToken(requestParameters.refreshTokenRequestBody, options).then((request) => request(axios, basePath));
1073
+ },
1074
+ /**
1075
+ *
1076
+ * @summary Crée un nouvel utilisateur
1077
+ * @param {UsersApiRegisterRequest} requestParameters Request parameters.
1078
+ * @param {*} [options] Override http request option.
1079
+ * @throws {RequiredError}
1080
+ */
1081
+ register(requestParameters: UsersApiRegisterRequest, options?: RawAxiosRequestConfig): AxiosPromise<UserResponse> {
1082
+ return localVarFp.register(requestParameters.registerRequestBody, options).then((request) => request(axios, basePath));
1083
+ },
1084
+ /**
1085
+ *
1086
+ * @summary Met à jour les données de l\'utilisateur connecté
1087
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
1088
+ * @param {*} [options] Override http request option.
1089
+ * @throws {RequiredError}
1090
+ */
1091
+ updateUser(requestParameters: UsersApiUpdateUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<UserResponse> {
1092
+ return localVarFp.updateUser(requestParameters.updateUserRequestBody, options).then((request) => request(axios, basePath));
1093
+ },
380
1094
  };
381
1095
  };
382
1096
 
1097
+ /**
1098
+ * Request parameters for changePassword operation in UsersApi.
1099
+ * @export
1100
+ * @interface UsersApiChangePasswordRequest
1101
+ */
1102
+ export interface UsersApiChangePasswordRequest {
1103
+ /**
1104
+ *
1105
+ * @type {ChangePasswordRequestBody}
1106
+ * @memberof UsersApiChangePassword
1107
+ */
1108
+ readonly changePasswordRequestBody: ChangePasswordRequestBody
1109
+ }
1110
+
1111
+ /**
1112
+ * Request parameters for login operation in UsersApi.
1113
+ * @export
1114
+ * @interface UsersApiLoginRequest
1115
+ */
1116
+ export interface UsersApiLoginRequest {
1117
+ /**
1118
+ *
1119
+ * @type {LoginRequestBody}
1120
+ * @memberof UsersApiLogin
1121
+ */
1122
+ readonly loginRequestBody: LoginRequestBody
1123
+ }
1124
+
1125
+ /**
1126
+ * Request parameters for refreshToken operation in UsersApi.
1127
+ * @export
1128
+ * @interface UsersApiRefreshTokenRequest
1129
+ */
1130
+ export interface UsersApiRefreshTokenRequest {
1131
+ /**
1132
+ *
1133
+ * @type {RefreshTokenRequestBody}
1134
+ * @memberof UsersApiRefreshToken
1135
+ */
1136
+ readonly refreshTokenRequestBody: RefreshTokenRequestBody
1137
+ }
1138
+
1139
+ /**
1140
+ * Request parameters for register operation in UsersApi.
1141
+ * @export
1142
+ * @interface UsersApiRegisterRequest
1143
+ */
1144
+ export interface UsersApiRegisterRequest {
1145
+ /**
1146
+ *
1147
+ * @type {RegisterRequestBody}
1148
+ * @memberof UsersApiRegister
1149
+ */
1150
+ readonly registerRequestBody: RegisterRequestBody
1151
+ }
1152
+
1153
+ /**
1154
+ * Request parameters for updateUser operation in UsersApi.
1155
+ * @export
1156
+ * @interface UsersApiUpdateUserRequest
1157
+ */
1158
+ export interface UsersApiUpdateUserRequest {
1159
+ /**
1160
+ *
1161
+ * @type {UpdateUserRequestBody}
1162
+ * @memberof UsersApiUpdateUser
1163
+ */
1164
+ readonly updateUserRequestBody: UpdateUserRequestBody
1165
+ }
1166
+
383
1167
  /**
384
1168
  * UsersApi - object-oriented interface
385
1169
  * @export
@@ -389,7 +1173,19 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath
389
1173
  export class UsersApi extends BaseAPI {
390
1174
  /**
391
1175
  *
392
- * @summary Retrieve all users
1176
+ * @summary Modifie le mot de passe de l\'utilisateur connecté
1177
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
1178
+ * @param {*} [options] Override http request option.
1179
+ * @throws {RequiredError}
1180
+ * @memberof UsersApi
1181
+ */
1182
+ public changePassword(requestParameters: UsersApiChangePasswordRequest, options?: RawAxiosRequestConfig) {
1183
+ return UsersApiFp(this.configuration).changePassword(requestParameters.changePasswordRequestBody, options).then((request) => request(this.axios, this.basePath));
1184
+ }
1185
+
1186
+ /**
1187
+ *
1188
+ * @summary Récupère la liste des utilisateurs
393
1189
  * @param {*} [options] Override http request option.
394
1190
  * @throws {RequiredError}
395
1191
  * @memberof UsersApi
@@ -397,6 +1193,65 @@ export class UsersApi extends BaseAPI {
397
1193
  public getAllUsers(options?: RawAxiosRequestConfig) {
398
1194
  return UsersApiFp(this.configuration).getAllUsers(options).then((request) => request(this.axios, this.basePath));
399
1195
  }
1196
+
1197
+ /**
1198
+ *
1199
+ * @summary Récupère les informations de l\'utilisateur connecté
1200
+ * @param {*} [options] Override http request option.
1201
+ * @throws {RequiredError}
1202
+ * @memberof UsersApi
1203
+ */
1204
+ public getUserInfo(options?: RawAxiosRequestConfig) {
1205
+ return UsersApiFp(this.configuration).getUserInfo(options).then((request) => request(this.axios, this.basePath));
1206
+ }
1207
+
1208
+ /**
1209
+ *
1210
+ * @summary Authentifie un utilisateur
1211
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
1212
+ * @param {*} [options] Override http request option.
1213
+ * @throws {RequiredError}
1214
+ * @memberof UsersApi
1215
+ */
1216
+ public login(requestParameters: UsersApiLoginRequest, options?: RawAxiosRequestConfig) {
1217
+ return UsersApiFp(this.configuration).login(requestParameters.loginRequestBody, options).then((request) => request(this.axios, this.basePath));
1218
+ }
1219
+
1220
+ /**
1221
+ *
1222
+ * @summary Rafraîchit le token d\'accès
1223
+ * @param {UsersApiRefreshTokenRequest} requestParameters Request parameters.
1224
+ * @param {*} [options] Override http request option.
1225
+ * @throws {RequiredError}
1226
+ * @memberof UsersApi
1227
+ */
1228
+ public refreshToken(requestParameters: UsersApiRefreshTokenRequest, options?: RawAxiosRequestConfig) {
1229
+ return UsersApiFp(this.configuration).refreshToken(requestParameters.refreshTokenRequestBody, options).then((request) => request(this.axios, this.basePath));
1230
+ }
1231
+
1232
+ /**
1233
+ *
1234
+ * @summary Crée un nouvel utilisateur
1235
+ * @param {UsersApiRegisterRequest} requestParameters Request parameters.
1236
+ * @param {*} [options] Override http request option.
1237
+ * @throws {RequiredError}
1238
+ * @memberof UsersApi
1239
+ */
1240
+ public register(requestParameters: UsersApiRegisterRequest, options?: RawAxiosRequestConfig) {
1241
+ return UsersApiFp(this.configuration).register(requestParameters.registerRequestBody, options).then((request) => request(this.axios, this.basePath));
1242
+ }
1243
+
1244
+ /**
1245
+ *
1246
+ * @summary Met à jour les données de l\'utilisateur connecté
1247
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
1248
+ * @param {*} [options] Override http request option.
1249
+ * @throws {RequiredError}
1250
+ * @memberof UsersApi
1251
+ */
1252
+ public updateUser(requestParameters: UsersApiUpdateUserRequest, options?: RawAxiosRequestConfig) {
1253
+ return UsersApiFp(this.configuration).updateUser(requestParameters.updateUserRequestBody, options).then((request) => request(this.axios, this.basePath));
1254
+ }
400
1255
  }
401
1256
 
402
1257