@tennac-booking/sdk 1.0.8 → 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.
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,19 @@ 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 d\'un utilisateur
652
+ * @param {string} id ID de l\'utilisateur
653
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
312
654
  * @param {*} [options] Override http request option.
313
655
  * @throws {RequiredError}
314
656
  */
315
- getAllUsers: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
316
- const localVarPath = `/api/users`;
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)));
317
664
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
318
665
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
319
666
  let baseOptions;
@@ -321,15 +668,230 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration
321
668
  baseOptions = configuration.baseOptions;
322
669
  }
323
670
 
324
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
671
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
325
672
  const localVarHeaderParameter = {} as any;
326
673
  const localVarQueryParameter = {} as any;
327
674
 
328
675
 
329
676
 
677
+ localVarHeaderParameter['Content-Type'] = 'application/json';
678
+
330
679
  setSearchParams(localVarUrlObj, localVarQueryParameter);
331
680
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
332
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
+
709
+
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;
736
+ }
737
+
738
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
739
+ const localVarHeaderParameter = {} as any;
740
+ const localVarQueryParameter = {} as any;
741
+
742
+
743
+
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;
769
+ }
770
+
771
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
772
+ const localVarHeaderParameter = {} as any;
773
+ const localVarQueryParameter = {} as any;
774
+
775
+
776
+
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;
805
+ }
806
+
807
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
808
+ const localVarHeaderParameter = {} as any;
809
+ const localVarQueryParameter = {} as any;
810
+
811
+
812
+
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;
841
+ }
842
+
843
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
844
+ const localVarHeaderParameter = {} as any;
845
+ const localVarQueryParameter = {} as any;
846
+
847
+
848
+
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;
881
+ }
882
+
883
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
884
+ const localVarHeaderParameter = {} as any;
885
+ const localVarQueryParameter = {} as any;
886
+
887
+
888
+
889
+ localVarHeaderParameter['Content-Type'] = 'application/json';
890
+
891
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
892
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
893
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
894
+ localVarRequestOptions.data = serializeDataIfNeeded(updateUserRequestBody, localVarRequestOptions, configuration)
333
895
 
334
896
  return {
335
897
  url: toPathString(localVarUrlObj),
@@ -348,16 +910,96 @@ export const UsersApiFp = function(configuration?: Configuration) {
348
910
  return {
349
911
  /**
350
912
  *
351
- * @summary Retrieve all users
913
+ * @summary Modifie le mot de passe d\'un utilisateur
914
+ * @param {string} id ID de l\&#39;utilisateur
915
+ * @param {ChangePasswordRequestBody} changePasswordRequestBody
352
916
  * @param {*} [options] Override http request option.
353
917
  * @throws {RequiredError}
354
918
  */
355
- async getAllUsers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<User>>> {
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>>> {
356
932
  const localVarAxiosArgs = await localVarAxiosParamCreator.getAllUsers(options);
357
933
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
358
934
  const localVarOperationServerBasePath = operationServerMap['UsersApi.getAllUsers']?.[localVarOperationServerIndex]?.url;
359
935
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
360
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
967
+ * @param {*} [options] Override http request option.
968
+ * @throws {RequiredError}
969
+ */
970
+ async refreshToken(refreshTokenRequestBody: RefreshTokenRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefreshTokenResponse>> {
971
+ const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(refreshTokenRequestBody, options);
972
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
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;
1001
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1002
+ },
361
1003
  }
362
1004
  };
363
1005
 
@@ -370,16 +1012,174 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath
370
1012
  return {
371
1013
  /**
372
1014
  *
373
- * @summary Retrieve all users
1015
+ * @summary Modifie le mot de passe d\'un utilisateur
1016
+ * @param {UsersApiChangePasswordRequest} requestParameters Request parameters.
374
1017
  * @param {*} [options] Override http request option.
375
1018
  * @throws {RequiredError}
376
1019
  */
377
- getAllUsers(options?: RawAxiosRequestConfig): AxiosPromise<Array<User>> {
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>> {
378
1030
  return localVarFp.getAllUsers(options).then((request) => request(axios, basePath));
379
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));
1081
+ },
380
1082
  };
381
1083
  };
382
1084
 
1085
+ /**
1086
+ * Request parameters for changePassword operation in UsersApi.
1087
+ * @export
1088
+ * @interface UsersApiChangePasswordRequest
1089
+ */
1090
+ export interface UsersApiChangePasswordRequest {
1091
+ /**
1092
+ * ID de l\&#39;utilisateur
1093
+ * @type {string}
1094
+ * @memberof UsersApiChangePassword
1095
+ */
1096
+ readonly id: string
1097
+
1098
+ /**
1099
+ *
1100
+ * @type {ChangePasswordRequestBody}
1101
+ * @memberof UsersApiChangePassword
1102
+ */
1103
+ readonly changePasswordRequestBody: ChangePasswordRequestBody
1104
+ }
1105
+
1106
+ /**
1107
+ * Request parameters for getUserInfo operation in UsersApi.
1108
+ * @export
1109
+ * @interface UsersApiGetUserInfoRequest
1110
+ */
1111
+ export interface UsersApiGetUserInfoRequest {
1112
+ /**
1113
+ * ID de l\&#39;utilisateur
1114
+ * @type {string}
1115
+ * @memberof UsersApiGetUserInfo
1116
+ */
1117
+ readonly id: string
1118
+ }
1119
+
1120
+ /**
1121
+ * Request parameters for login operation in UsersApi.
1122
+ * @export
1123
+ * @interface UsersApiLoginRequest
1124
+ */
1125
+ export interface UsersApiLoginRequest {
1126
+ /**
1127
+ *
1128
+ * @type {LoginRequestBody}
1129
+ * @memberof UsersApiLogin
1130
+ */
1131
+ readonly loginRequestBody: LoginRequestBody
1132
+ }
1133
+
1134
+ /**
1135
+ * Request parameters for refreshToken operation in UsersApi.
1136
+ * @export
1137
+ * @interface UsersApiRefreshTokenRequest
1138
+ */
1139
+ export interface UsersApiRefreshTokenRequest {
1140
+ /**
1141
+ *
1142
+ * @type {RefreshTokenRequestBody}
1143
+ * @memberof UsersApiRefreshToken
1144
+ */
1145
+ readonly refreshTokenRequestBody: RefreshTokenRequestBody
1146
+ }
1147
+
1148
+ /**
1149
+ * Request parameters for register operation in UsersApi.
1150
+ * @export
1151
+ * @interface UsersApiRegisterRequest
1152
+ */
1153
+ export interface UsersApiRegisterRequest {
1154
+ /**
1155
+ *
1156
+ * @type {RegisterRequestBody}
1157
+ * @memberof UsersApiRegister
1158
+ */
1159
+ readonly registerRequestBody: RegisterRequestBody
1160
+ }
1161
+
1162
+ /**
1163
+ * Request parameters for updateUser operation in UsersApi.
1164
+ * @export
1165
+ * @interface UsersApiUpdateUserRequest
1166
+ */
1167
+ export interface UsersApiUpdateUserRequest {
1168
+ /**
1169
+ * ID de l\&#39;utilisateur
1170
+ * @type {string}
1171
+ * @memberof UsersApiUpdateUser
1172
+ */
1173
+ readonly id: string
1174
+
1175
+ /**
1176
+ *
1177
+ * @type {UpdateUserRequestBody}
1178
+ * @memberof UsersApiUpdateUser
1179
+ */
1180
+ readonly updateUserRequestBody: UpdateUserRequestBody
1181
+ }
1182
+
383
1183
  /**
384
1184
  * UsersApi - object-oriented interface
385
1185
  * @export
@@ -389,7 +1189,19 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath
389
1189
  export class UsersApi extends BaseAPI {
390
1190
  /**
391
1191
  *
392
- * @summary Retrieve all users
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
1197
+ */
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
+ }
1201
+
1202
+ /**
1203
+ *
1204
+ * @summary Récupère la liste des utilisateurs
393
1205
  * @param {*} [options] Override http request option.
394
1206
  * @throws {RequiredError}
395
1207
  * @memberof UsersApi
@@ -397,6 +1209,66 @@ export class UsersApi extends BaseAPI {
397
1209
  public getAllUsers(options?: RawAxiosRequestConfig) {
398
1210
  return UsersApiFp(this.configuration).getAllUsers(options).then((request) => request(this.axios, this.basePath));
399
1211
  }
1212
+
1213
+ /**
1214
+ *
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
1220
+ */
1221
+ public getUserInfo(requestParameters: UsersApiGetUserInfoRequest, options?: RawAxiosRequestConfig) {
1222
+ return UsersApiFp(this.configuration).getUserInfo(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
1223
+ }
1224
+
1225
+ /**
1226
+ *
1227
+ * @summary Authentifie un utilisateur
1228
+ * @param {UsersApiLoginRequest} requestParameters Request parameters.
1229
+ * @param {*} [options] Override http request option.
1230
+ * @throws {RequiredError}
1231
+ * @memberof UsersApi
1232
+ */
1233
+ public login(requestParameters: UsersApiLoginRequest, options?: RawAxiosRequestConfig) {
1234
+ return UsersApiFp(this.configuration).login(requestParameters.loginRequestBody, options).then((request) => request(this.axios, this.basePath));
1235
+ }
1236
+
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));
1247
+ }
1248
+
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));
1259
+ }
1260
+
1261
+ /**
1262
+ *
1263
+ * @summary Met à jour un utilisateur
1264
+ * @param {UsersApiUpdateUserRequest} requestParameters Request parameters.
1265
+ * @param {*} [options] Override http request option.
1266
+ * @throws {RequiredError}
1267
+ * @memberof UsersApi
1268
+ */
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));
1271
+ }
400
1272
  }
401
1273
 
402
1274