@ahomevilla-hotel/node-sdk 1.1.4 → 1.1.5

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 (2) hide show
  1. package/api.ts +852 -93
  2. package/package.json +1 -1
package/api.ts CHANGED
@@ -42,6 +42,34 @@ export interface AddTranslationDto {
42
42
  */
43
43
  'data': Array<TranslationData>;
44
44
  }
45
+ /**
46
+ *
47
+ * @export
48
+ * @interface AdminUpdateUserDto
49
+ */
50
+ export interface AdminUpdateUserDto {
51
+ /**
52
+ * The user\'s role.
53
+ * @type {string}
54
+ * @memberof AdminUpdateUserDto
55
+ */
56
+ 'role': AdminUpdateUserDtoRoleEnum;
57
+ /**
58
+ * Filter by branch ID
59
+ * @type {string}
60
+ * @memberof AdminUpdateUserDto
61
+ */
62
+ 'branchId'?: string;
63
+ }
64
+
65
+ export const AdminUpdateUserDtoRoleEnum = {
66
+ User: 'USER',
67
+ Staff: 'STAFF',
68
+ Admin: 'ADMIN'
69
+ } as const;
70
+
71
+ export type AdminUpdateUserDtoRoleEnum = typeof AdminUpdateUserDtoRoleEnum[keyof typeof AdminUpdateUserDtoRoleEnum];
72
+
45
73
  /**
46
74
  *
47
75
  * @export
@@ -131,6 +159,114 @@ export const AmenityTypeEnum = {
131
159
 
132
160
  export type AmenityTypeEnum = typeof AmenityTypeEnum[keyof typeof AmenityTypeEnum];
133
161
 
162
+ /**
163
+ *
164
+ * @export
165
+ * @interface BlockActivity
166
+ */
167
+ export interface BlockActivity {
168
+ /**
169
+ *
170
+ * @type {string}
171
+ * @memberof BlockActivity
172
+ */
173
+ 'id': string;
174
+ /**
175
+ * Soft delete flag
176
+ * @type {boolean}
177
+ * @memberof BlockActivity
178
+ */
179
+ 'isDeleted': boolean;
180
+ /**
181
+ * Soft delete timestamp
182
+ * @type {string}
183
+ * @memberof BlockActivity
184
+ */
185
+ 'deletedAt': string | null;
186
+ /**
187
+ *
188
+ * @type {string}
189
+ * @memberof BlockActivity
190
+ */
191
+ 'createdAt': string;
192
+ /**
193
+ *
194
+ * @type {string}
195
+ * @memberof BlockActivity
196
+ */
197
+ 'updatedAt': string;
198
+ /**
199
+ * ID of user who was blocked/unblocked
200
+ * @type {string}
201
+ * @memberof BlockActivity
202
+ */
203
+ 'userId': string;
204
+ /**
205
+ * Details of user who was blocked/unblocked
206
+ * @type {User}
207
+ * @memberof BlockActivity
208
+ */
209
+ 'user': User;
210
+ /**
211
+ * ID of user who performed the block/unblock action
212
+ * @type {string}
213
+ * @memberof BlockActivity
214
+ */
215
+ 'blockedBy': string;
216
+ /**
217
+ * Details of user who performed the block/unblock action
218
+ * @type {User}
219
+ * @memberof BlockActivity
220
+ */
221
+ 'blockedByUser': User;
222
+ /**
223
+ * Type of action performed (BLOCK/UNBLOCK)
224
+ * @type {string}
225
+ * @memberof BlockActivity
226
+ */
227
+ 'action': BlockActivityActionEnum;
228
+ /**
229
+ * Reason for the block/unblock action
230
+ * @type {string}
231
+ * @memberof BlockActivity
232
+ */
233
+ 'reason': string;
234
+ }
235
+
236
+ export const BlockActivityActionEnum = {
237
+ Block: 'BLOCK',
238
+ Unblock: 'UNBLOCK'
239
+ } as const;
240
+
241
+ export type BlockActivityActionEnum = typeof BlockActivityActionEnum[keyof typeof BlockActivityActionEnum];
242
+
243
+ /**
244
+ *
245
+ * @export
246
+ * @interface BlockOrUnblockUserDto
247
+ */
248
+ export interface BlockOrUnblockUserDto {
249
+ /**
250
+ * The reason for blocking/unblocking the user
251
+ * @type {string}
252
+ * @memberof BlockOrUnblockUserDto
253
+ */
254
+ 'reason': string;
255
+ /**
256
+ * The action to perform (BLOCK or UNBLOCK)
257
+ * @type {string}
258
+ * @memberof BlockOrUnblockUserDto
259
+ */
260
+ 'action': BlockOrUnblockUserDtoActionEnum;
261
+ }
262
+
263
+ export const BlockOrUnblockUserDtoActionEnum = {
264
+ Block: 'BLOCK',
265
+ Unblock: 'UNBLOCK'
266
+ } as const;
267
+
268
+ export type BlockOrUnblockUserDtoActionEnum = typeof BlockOrUnblockUserDtoActionEnum[keyof typeof BlockOrUnblockUserDtoActionEnum];
269
+
134
270
  /**
135
271
  *
136
272
  * @export
@@ -1263,6 +1399,19 @@ export interface CreateUserDto {
1263
1399
  */
1264
1400
  'name': string;
1265
1401
  }
1402
+ /**
1403
+ *
1404
+ * @export
1405
+ * @interface DeleteUserDto
1406
+ */
1407
+ export interface DeleteUserDto {
1408
+ /**
1409
+ * Reason for deleting the user
1410
+ * @type {string}
1411
+ * @memberof DeleteUserDto
1412
+ */
1413
+ 'reason': string;
1414
+ }
1266
1415
  /**
1267
1416
  *
1268
1417
  * @export
@@ -1658,12 +1807,36 @@ export type FilterRoomDetailDtoBedTypeEnum = typeof FilterRoomDetailDtoBedTypeEn
1658
1807
  * @interface FilterUserDto
1659
1808
  */
1660
1809
  export interface FilterUserDto {
1810
+ /**
1811
+ *
1812
+ * @type {string}
1813
+ * @memberof FilterUserDto
1814
+ */
1815
+ 'keyword'?: string;
1661
1816
  /**
1662
1817
  *
1663
1818
  * @type {string}
1664
1819
  * @memberof FilterUserDto
1665
1820
  */
1666
1821
  'roles'?: FilterUserDtoRolesEnum;
1822
+ /**
1823
+ *
1824
+ * @type {boolean}
1825
+ * @memberof FilterUserDto
1826
+ */
1827
+ 'is_blocked'?: boolean;
1828
+ /**
1829
+ *
1830
+ * @type {boolean}
1831
+ * @memberof FilterUserDto
1832
+ */
1833
+ 'is_active'?: boolean;
1834
+ /**
1835
+ * Filter by branch ID
1836
+ * @type {string}
1837
+ * @memberof FilterUserDto
1838
+ */
1839
+ 'branchId'?: string;
1667
1840
  }
1668
1841
 
1669
1842
  export const FilterUserDtoRolesEnum = {
@@ -2349,7 +2522,7 @@ export interface QueryUsersDto {
2349
2522
  */
2350
2523
  'filters'?: string;
2351
2524
  /**
2352
- * JSON string of SortUserDto[]
2525
+ * JSON string of SortUserDto
2353
2526
  * @type {string}
2354
2527
  * @memberof QueryUsersDto
2355
2528
  */
@@ -3585,6 +3758,12 @@ export interface User {
3585
3758
  * @memberof User
3586
3759
  */
3587
3760
  'updatedAt': string;
3761
+ /**
3762
+ *
3763
+ * @type {string}
3764
+ * @memberof User
3765
+ */
3766
+ 'name': string;
3588
3767
  /**
3589
3768
  *
3590
3769
  * @type {string}
@@ -3597,6 +3776,24 @@ export interface User {
3597
3776
  * @memberof User
3598
3777
  */
3599
3778
  'phone': string;
3779
+ /**
3780
+ * The user birth date
3781
+ * @type {string}
3782
+ * @memberof User
3783
+ */
3784
+ 'birth_date'?: string;
3785
+ /**
3786
+ *
3787
+ * @type {string}
3788
+ * @memberof User
3789
+ */
3790
+ 'gender'?: UserGenderEnum;
3791
+ /**
3792
+ * User avatar
3793
+ * @type {Image}
3794
+ * @memberof User
3795
+ */
3796
+ 'avatar'?: Image;
3600
3797
  /**
3601
3798
  *
3602
3799
  * @type {boolean}
@@ -3621,12 +3818,6 @@ export interface User {
3621
3818
  * @memberof User
3622
3819
  */
3623
3820
  'is_blocked': boolean;
3624
- /**
3625
- *
3626
- * @type {string}
3627
- * @memberof User
3628
- */
3629
- 'name': string;
3630
3821
  /**
3631
3822
  *
3632
3823
  * @type {string}
@@ -3635,6 +3826,12 @@ export interface User {
3635
3826
  'role': UserRoleEnum;
3636
3827
  }
3637
3828
 
3829
+ export const UserGenderEnum = {
3830
+ Male: 'MALE',
3831
+ Female: 'FEMALE'
3832
+ } as const;
3833
+
3834
+ export type UserGenderEnum = typeof UserGenderEnum[keyof typeof UserGenderEnum];
3638
3835
  export const UserIdentifierTypeEnum = {
3639
3836
  Email: 'EMAIL',
3640
3837
  Phone: 'PHONE'
@@ -3652,122 +3849,312 @@ export type UserRoleEnum = typeof UserRoleEnum[keyof typeof UserRoleEnum];
3652
3849
  /**
3653
3850
  *
3654
3851
  * @export
3655
- * @interface UsersPaginationResultDto
3852
+ * @interface UserDetail
3656
3853
  */
3657
- export interface UsersPaginationResultDto {
3854
+ export interface UserDetail {
3658
3855
  /**
3659
3856
  *
3660
- * @type {Array<User>}
3661
- * @memberof UsersPaginationResultDto
3857
+ * @type {string}
3858
+ * @memberof UserDetail
3662
3859
  */
3663
- 'data': Array<User>;
3860
+ 'id': string;
3664
3861
  /**
3665
- *
3666
- * @type {UsersPaginationResultDtoMeta}
3667
- * @memberof UsersPaginationResultDto
3862
+ * Soft delete flag
3863
+ * @type {boolean}
3864
+ * @memberof UserDetail
3668
3865
  */
3669
- 'meta': UsersPaginationResultDtoMeta;
3670
- }
3671
- /**
3672
- *
3673
- * @export
3674
- * @interface UsersPaginationResultDtoMeta
3675
- */
3676
- export interface UsersPaginationResultDtoMeta {
3866
+ 'isDeleted': boolean;
3677
3867
  /**
3678
- *
3679
- * @type {number}
3680
- * @memberof UsersPaginationResultDtoMeta
3868
+ * Soft delete timestamp
3869
+ * @type {string}
3870
+ * @memberof UserDetail
3681
3871
  */
3682
- 'total'?: number;
3872
+ 'deletedAt': string | null;
3683
3873
  /**
3684
3874
  *
3685
- * @type {number}
3686
- * @memberof UsersPaginationResultDtoMeta
3875
+ * @type {string}
3876
+ * @memberof UserDetail
3687
3877
  */
3688
- 'page'?: number;
3878
+ 'createdAt': string;
3689
3879
  /**
3690
3880
  *
3691
- * @type {number}
3692
- * @memberof UsersPaginationResultDtoMeta
3881
+ * @type {string}
3882
+ * @memberof UserDetail
3693
3883
  */
3694
- 'pageSize'?: number;
3884
+ 'updatedAt': string;
3695
3885
  /**
3696
3886
  *
3697
- * @type {number}
3698
- * @memberof UsersPaginationResultDtoMeta
3699
- */
3700
- 'totalPages'?: number;
3701
- }
3702
- /**
3703
- *
3704
- * @export
3705
- * @interface VerificationEmailDto
3706
- */
3707
- export interface VerificationEmailDto {
3708
- /**
3709
- * Email address to send verification code
3710
3887
  * @type {string}
3711
- * @memberof VerificationEmailDto
3888
+ * @memberof UserDetail
3712
3889
  */
3713
- 'to': string;
3890
+ 'name': string;
3714
3891
  /**
3715
- * Verification code to be sent
3892
+ *
3716
3893
  * @type {string}
3717
- * @memberof VerificationEmailDto
3894
+ * @memberof UserDetail
3718
3895
  */
3719
- 'code': string;
3896
+ 'email': string;
3720
3897
  /**
3721
- * Language for email template
3898
+ *
3722
3899
  * @type {string}
3723
- * @memberof VerificationEmailDto
3900
+ * @memberof UserDetail
3724
3901
  */
3725
- 'lang'?: VerificationEmailDtoLangEnum;
3902
+ 'phone': string;
3726
3903
  /**
3727
- * Type of verification email
3904
+ * The user birth date
3728
3905
  * @type {string}
3729
- * @memberof VerificationEmailDto
3906
+ * @memberof UserDetail
3730
3907
  */
3731
- 'type': VerificationEmailDtoTypeEnum;
3732
- }
3733
-
3734
- export const VerificationEmailDtoLangEnum = {
3735
- En: 'en',
3736
- Vi: 'vi'
3737
- } as const;
3738
-
3739
- export type VerificationEmailDtoLangEnum = typeof VerificationEmailDtoLangEnum[keyof typeof VerificationEmailDtoLangEnum];
3740
- export const VerificationEmailDtoTypeEnum = {
3741
- VerifyAccount: 'VERIFY_ACCOUNT',
3742
- ForgotPassword: 'FORGOT_PASSWORD'
3743
- } as const;
3744
-
3745
- export type VerificationEmailDtoTypeEnum = typeof VerificationEmailDtoTypeEnum[keyof typeof VerificationEmailDtoTypeEnum];
3746
-
3747
- /**
3748
- *
3749
- * @export
3750
- * @interface VerifyCodeDto
3751
- */
3752
- export interface VerifyCodeDto {
3908
+ 'birth_date'?: string;
3753
3909
  /**
3754
- * User ID
3910
+ *
3755
3911
  * @type {string}
3756
- * @memberof VerifyCodeDto
3912
+ * @memberof UserDetail
3757
3913
  */
3758
- 'userId': string;
3914
+ 'gender'?: UserDetailGenderEnum;
3759
3915
  /**
3760
- * Account type
3761
- * @type {string}
3762
- * @memberof VerifyCodeDto
3916
+ * User avatar
3917
+ * @type {Image}
3918
+ * @memberof UserDetail
3763
3919
  */
3764
- 'type': string;
3920
+ 'avatar'?: Image;
3765
3921
  /**
3766
- * Verification code
3767
- * @type {string}
3768
- * @memberof VerifyCodeDto
3922
+ *
3923
+ * @type {boolean}
3924
+ * @memberof UserDetail
3769
3925
  */
3770
- 'code': string;
3926
+ 'verified_email': boolean;
3927
+ /**
3928
+ *
3929
+ * @type {boolean}
3930
+ * @memberof UserDetail
3931
+ */
3932
+ 'verified_phone': boolean;
3933
+ /**
3934
+ *
3935
+ * @type {string}
3936
+ * @memberof UserDetail
3937
+ */
3938
+ 'identifier_type': UserDetailIdentifierTypeEnum;
3939
+ /**
3940
+ *
3941
+ * @type {boolean}
3942
+ * @memberof UserDetail
3943
+ */
3944
+ 'is_blocked': boolean;
3945
+ /**
3946
+ *
3947
+ * @type {string}
3948
+ * @memberof UserDetail
3949
+ */
3950
+ 'role': UserDetailRoleEnum;
3951
+ /**
3952
+ * Date when user was blocked
3953
+ * @type {string}
3954
+ * @memberof UserDetail
3955
+ */
3956
+ 'blocked_at'?: string;
3957
+ /**
3958
+ * Reason for blocking the user
3959
+ * @type {string}
3960
+ * @memberof UserDetail
3961
+ */
3962
+ 'blocked_reason'?: string;
3963
+ /**
3964
+ * Reason for deleting the user
3965
+ * @type {string}
3966
+ * @memberof UserDetail
3967
+ */
3968
+ 'deleted_reason'?: string;
3969
+ /**
3970
+ * Stored identity (email/phone) before deletion
3971
+ * @type {string}
3972
+ * @memberof UserDetail
3973
+ */
3974
+ 'deleted_identity'?: string;
3975
+ /**
3976
+ * Whether the user is active
3977
+ * @type {boolean}
3978
+ * @memberof UserDetail
3979
+ */
3980
+ 'is_active': boolean;
3981
+ /**
3982
+ * ID of the branch where user works (for staff)
3983
+ * @type {string}
3984
+ * @memberof UserDetail
3985
+ */
3986
+ 'branchId'?: string;
3987
+ /**
3988
+ * Branch details where user works
3989
+ * @type {Branch}
3990
+ * @memberof UserDetail
3991
+ */
3992
+ 'working_at'?: Branch;
3993
+ /**
3994
+ * User bookings history
3995
+ * @type {Array<Booking>}
3996
+ * @memberof UserDetail
3997
+ */
3998
+ 'bookings': Array<Booking>;
3999
+ /**
4000
+ * User loyalty points
4001
+ * @type {number}
4002
+ * @memberof UserDetail
4003
+ */
4004
+ 'loyalty_points': number;
4005
+ /**
4006
+ * History of blocks received by user
4007
+ * @type {Array<BlockActivity>}
4008
+ * @memberof UserDetail
4009
+ */
4010
+ 'blockHistory': Array<BlockActivity>;
4011
+ /**
4012
+ * History of blocks given by user
4013
+ * @type {Array<BlockActivity>}
4014
+ * @memberof UserDetail
4015
+ */
4016
+ 'blockedByMe': Array<BlockActivity>;
4017
+ }
4018
+
4019
+ export const UserDetailGenderEnum = {
4020
+ Male: 'MALE',
4021
+ Female: 'FEMALE'
4022
+ } as const;
4023
+
4024
+ export type UserDetailGenderEnum = typeof UserDetailGenderEnum[keyof typeof UserDetailGenderEnum];
4025
+ export const UserDetailIdentifierTypeEnum = {
4026
+ Email: 'EMAIL',
4027
+ Phone: 'PHONE'
4028
+ } as const;
4029
+
4030
+ export type UserDetailIdentifierTypeEnum = typeof UserDetailIdentifierTypeEnum[keyof typeof UserDetailIdentifierTypeEnum];
4031
+ export const UserDetailRoleEnum = {
4032
+ User: 'USER',
4033
+ Staff: 'STAFF',
4034
+ Admin: 'ADMIN'
4035
+ } as const;
4036
+
4037
+ export type UserDetailRoleEnum = typeof UserDetailRoleEnum[keyof typeof UserDetailRoleEnum];
4038
+
4039
+ /**
4040
+ *
4041
+ * @export
4042
+ * @interface UsersPaginationResultDto
4043
+ */
4044
+ export interface UsersPaginationResultDto {
4045
+ /**
4046
+ *
4047
+ * @type {Array<User>}
4048
+ * @memberof UsersPaginationResultDto
4049
+ */
4050
+ 'data': Array<User>;
4051
+ /**
4052
+ *
4053
+ * @type {UsersPaginationResultDtoMeta}
4054
+ * @memberof UsersPaginationResultDto
4055
+ */
4056
+ 'meta': UsersPaginationResultDtoMeta;
4057
+ }
4058
+ /**
4059
+ *
4060
+ * @export
4061
+ * @interface UsersPaginationResultDtoMeta
4062
+ */
4063
+ export interface UsersPaginationResultDtoMeta {
4064
+ /**
4065
+ *
4066
+ * @type {number}
4067
+ * @memberof UsersPaginationResultDtoMeta
4068
+ */
4069
+ 'total'?: number;
4070
+ /**
4071
+ *
4072
+ * @type {number}
4073
+ * @memberof UsersPaginationResultDtoMeta
4074
+ */
4075
+ 'page'?: number;
4076
+ /**
4077
+ *
4078
+ * @type {number}
4079
+ * @memberof UsersPaginationResultDtoMeta
4080
+ */
4081
+ 'pageSize'?: number;
4082
+ /**
4083
+ *
4084
+ * @type {number}
4085
+ * @memberof UsersPaginationResultDtoMeta
4086
+ */
4087
+ 'totalPages'?: number;
4088
+ }
4089
+ /**
4090
+ *
4091
+ * @export
4092
+ * @interface VerificationEmailDto
4093
+ */
4094
+ export interface VerificationEmailDto {
4095
+ /**
4096
+ * Email address to send verification code
4097
+ * @type {string}
4098
+ * @memberof VerificationEmailDto
4099
+ */
4100
+ 'to': string;
4101
+ /**
4102
+ * Verification code to be sent
4103
+ * @type {string}
4104
+ * @memberof VerificationEmailDto
4105
+ */
4106
+ 'code': string;
4107
+ /**
4108
+ * Language for email template
4109
+ * @type {string}
4110
+ * @memberof VerificationEmailDto
4111
+ */
4112
+ 'lang'?: VerificationEmailDtoLangEnum;
4113
+ /**
4114
+ * Type of verification email
4115
+ * @type {string}
4116
+ * @memberof VerificationEmailDto
4117
+ */
4118
+ 'type': VerificationEmailDtoTypeEnum;
4119
+ }
4120
+
4121
+ export const VerificationEmailDtoLangEnum = {
4122
+ En: 'en',
4123
+ Vi: 'vi'
4124
+ } as const;
4125
+
4126
+ export type VerificationEmailDtoLangEnum = typeof VerificationEmailDtoLangEnum[keyof typeof VerificationEmailDtoLangEnum];
4127
+ export const VerificationEmailDtoTypeEnum = {
4128
+ VerifyAccount: 'VERIFY_ACCOUNT',
4129
+ ForgotPassword: 'FORGOT_PASSWORD'
4130
+ } as const;
4131
+
4132
+ export type VerificationEmailDtoTypeEnum = typeof VerificationEmailDtoTypeEnum[keyof typeof VerificationEmailDtoTypeEnum];
4133
+
4134
+ /**
4135
+ *
4136
+ * @export
4137
+ * @interface VerifyCodeDto
4138
+ */
4139
+ export interface VerifyCodeDto {
4140
+ /**
4141
+ * User ID
4142
+ * @type {string}
4143
+ * @memberof VerifyCodeDto
4144
+ */
4145
+ 'userId': string;
4146
+ /**
4147
+ * Account type
4148
+ * @type {string}
4149
+ * @memberof VerifyCodeDto
4150
+ */
4151
+ 'type': string;
4152
+ /**
4153
+ * Verification code
4154
+ * @type {string}
4155
+ * @memberof VerifyCodeDto
4156
+ */
4157
+ 'code': string;
3771
4158
  }
3772
4159
  /**
3773
4160
  *
@@ -9312,12 +9699,166 @@ export class RoomsApi extends BaseAPI {
9312
9699
  */
9313
9700
  export const UsersApiAxiosParamCreator = function (configuration?: Configuration) {
9314
9701
  return {
9702
+ /**
9703
+ *
9704
+ * @summary Get detailed user information (Admin only)
9705
+ * @param {string} id
9706
+ * @param {*} [options] Override http request option.
9707
+ * @throws {RequiredError}
9708
+ */
9709
+ usersControllerAdminGetUserDetail: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
9710
+ // verify required parameter 'id' is not null or undefined
9711
+ assertParamExists('usersControllerAdminGetUserDetail', 'id', id)
9712
+ const localVarPath = `/api/users/admin/{id}`
9713
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
9714
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
9715
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
9716
+ let baseOptions;
9717
+ if (configuration) {
9718
+ baseOptions = configuration.baseOptions;
9719
+ }
9720
+
9721
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
9722
+ const localVarHeaderParameter = {} as any;
9723
+ const localVarQueryParameter = {} as any;
9724
+
9725
+
9726
+
9727
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
9728
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
9729
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
9730
+
9731
+ return {
9732
+ url: toPathString(localVarUrlObj),
9733
+ options: localVarRequestOptions,
9734
+ };
9735
+ },
9736
+ /**
9737
+ *
9738
+ * @summary Update user information (Admin only)
9739
+ * @param {string} id
9740
+ * @param {AdminUpdateUserDto} adminUpdateUserDto
9741
+ * @param {*} [options] Override http request option.
9742
+ * @throws {RequiredError}
9743
+ */
9744
+ usersControllerAdminUpdateUser: async (id: string, adminUpdateUserDto: AdminUpdateUserDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
9745
+ // verify required parameter 'id' is not null or undefined
9746
+ assertParamExists('usersControllerAdminUpdateUser', 'id', id)
9747
+ // verify required parameter 'adminUpdateUserDto' is not null or undefined
9748
+ assertParamExists('usersControllerAdminUpdateUser', 'adminUpdateUserDto', adminUpdateUserDto)
9749
+ const localVarPath = `/api/users/admin/{id}`
9750
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
9751
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
9752
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
9753
+ let baseOptions;
9754
+ if (configuration) {
9755
+ baseOptions = configuration.baseOptions;
9756
+ }
9757
+
9758
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
9759
+ const localVarHeaderParameter = {} as any;
9760
+ const localVarQueryParameter = {} as any;
9761
+
9762
+
9763
+
9764
+ localVarHeaderParameter['Content-Type'] = 'application/json';
9765
+
9766
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
9767
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
9768
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
9769
+ localVarRequestOptions.data = serializeDataIfNeeded(adminUpdateUserDto, localVarRequestOptions, configuration)
9770
+
9771
+ return {
9772
+ url: toPathString(localVarUrlObj),
9773
+ options: localVarRequestOptions,
9774
+ };
9775
+ },
9776
+ /**
9777
+ *
9778
+ * @summary Block or unblock a user
9779
+ * @param {string} id
9780
+ * @param {BlockOrUnblockUserDto} blockOrUnblockUserDto
9781
+ * @param {*} [options] Override http request option.
9782
+ * @throws {RequiredError}
9783
+ */
9784
+ usersControllerBlockUser: async (id: string, blockOrUnblockUserDto: BlockOrUnblockUserDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
9785
+ // verify required parameter 'id' is not null or undefined
9786
+ assertParamExists('usersControllerBlockUser', 'id', id)
9787
+ // verify required parameter 'blockOrUnblockUserDto' is not null or undefined
9788
+ assertParamExists('usersControllerBlockUser', 'blockOrUnblockUserDto', blockOrUnblockUserDto)
9789
+ const localVarPath = `/api/users/block-action/{id}`
9790
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
9791
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
9792
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
9793
+ let baseOptions;
9794
+ if (configuration) {
9795
+ baseOptions = configuration.baseOptions;
9796
+ }
9797
+
9798
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
9799
+ const localVarHeaderParameter = {} as any;
9800
+ const localVarQueryParameter = {} as any;
9801
+
9802
+
9803
+
9804
+ localVarHeaderParameter['Content-Type'] = 'application/json';
9805
+
9806
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
9807
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
9808
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
9809
+ localVarRequestOptions.data = serializeDataIfNeeded(blockOrUnblockUserDto, localVarRequestOptions, configuration)
9810
+
9811
+ return {
9812
+ url: toPathString(localVarUrlObj),
9813
+ options: localVarRequestOptions,
9814
+ };
9815
+ },
9816
+ /**
9817
+ *
9818
+ * @summary Soft delete a user (Admin only)
9819
+ * @param {string} id
9820
+ * @param {DeleteUserDto} deleteUserDto
9821
+ * @param {*} [options] Override http request option.
9822
+ * @throws {RequiredError}
9823
+ */
9824
+ usersControllerDeleteUser: async (id: string, deleteUserDto: DeleteUserDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
9825
+ // verify required parameter 'id' is not null or undefined
9826
+ assertParamExists('usersControllerDeleteUser', 'id', id)
9827
+ // verify required parameter 'deleteUserDto' is not null or undefined
9828
+ assertParamExists('usersControllerDeleteUser', 'deleteUserDto', deleteUserDto)
9829
+ const localVarPath = `/api/users/{id}`
9830
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
9831
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
9832
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
9833
+ let baseOptions;
9834
+ if (configuration) {
9835
+ baseOptions = configuration.baseOptions;
9836
+ }
9837
+
9838
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
9839
+ const localVarHeaderParameter = {} as any;
9840
+ const localVarQueryParameter = {} as any;
9841
+
9842
+
9843
+
9844
+ localVarHeaderParameter['Content-Type'] = 'application/json';
9845
+
9846
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
9847
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
9848
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
9849
+ localVarRequestOptions.data = serializeDataIfNeeded(deleteUserDto, localVarRequestOptions, configuration)
9850
+
9851
+ return {
9852
+ url: toPathString(localVarUrlObj),
9853
+ options: localVarRequestOptions,
9854
+ };
9855
+ },
9315
9856
  /**
9316
9857
  *
9317
9858
  * @param {number} [page]
9318
9859
  * @param {number} [pageSize]
9319
9860
  * @param {string} [filters] JSON string of FilterUserDto
9320
- * @param {string} [sort] JSON string of SortUserDto[]
9861
+ * @param {string} [sort] JSON string of SortUserDto
9321
9862
  * @param {*} [options] Override http request option.
9322
9863
  * @throws {RequiredError}
9323
9864
  */
@@ -9352,6 +9893,40 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration
9352
9893
 
9353
9894
 
9354
9895
 
9896
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
9897
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
9898
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
9899
+
9900
+ return {
9901
+ url: toPathString(localVarUrlObj),
9902
+ options: localVarRequestOptions,
9903
+ };
9904
+ },
9905
+ /**
9906
+ *
9907
+ * @summary Restore a deleted user (Admin only)
9908
+ * @param {string} id
9909
+ * @param {*} [options] Override http request option.
9910
+ * @throws {RequiredError}
9911
+ */
9912
+ usersControllerRestoreUser: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
9913
+ // verify required parameter 'id' is not null or undefined
9914
+ assertParamExists('usersControllerRestoreUser', 'id', id)
9915
+ const localVarPath = `/api/users/{id}/restore`
9916
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
9917
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
9918
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
9919
+ let baseOptions;
9920
+ if (configuration) {
9921
+ baseOptions = configuration.baseOptions;
9922
+ }
9923
+
9924
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
9925
+ const localVarHeaderParameter = {} as any;
9926
+ const localVarQueryParameter = {} as any;
9927
+
9928
+
9929
+
9355
9930
  setSearchParams(localVarUrlObj, localVarQueryParameter);
9356
9931
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
9357
9932
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -9371,12 +9946,67 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration
9371
9946
  export const UsersApiFp = function(configuration?: Configuration) {
9372
9947
  const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration)
9373
9948
  return {
9949
+ /**
9950
+ *
9951
+ * @summary Get detailed user information (Admin only)
9952
+ * @param {string} id
9953
+ * @param {*} [options] Override http request option.
9954
+ * @throws {RequiredError}
9955
+ */
9956
+ async usersControllerAdminGetUserDetail(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserDetail>> {
9957
+ const localVarAxiosArgs = await localVarAxiosParamCreator.usersControllerAdminGetUserDetail(id, options);
9958
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
9959
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.usersControllerAdminGetUserDetail']?.[localVarOperationServerIndex]?.url;
9960
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
9961
+ },
9962
+ /**
9963
+ *
9964
+ * @summary Update user information (Admin only)
9965
+ * @param {string} id
9966
+ * @param {AdminUpdateUserDto} adminUpdateUserDto
9967
+ * @param {*} [options] Override http request option.
9968
+ * @throws {RequiredError}
9969
+ */
9970
+ async usersControllerAdminUpdateUser(id: string, adminUpdateUserDto: AdminUpdateUserDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserDetail>> {
9971
+ const localVarAxiosArgs = await localVarAxiosParamCreator.usersControllerAdminUpdateUser(id, adminUpdateUserDto, options);
9972
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
9973
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.usersControllerAdminUpdateUser']?.[localVarOperationServerIndex]?.url;
9974
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
9975
+ },
9976
+ /**
9977
+ *
9978
+ * @summary Block or unblock a user
9979
+ * @param {string} id
9980
+ * @param {BlockOrUnblockUserDto} blockOrUnblockUserDto
9981
+ * @param {*} [options] Override http request option.
9982
+ * @throws {RequiredError}
9983
+ */
9984
+ async usersControllerBlockUser(id: string, blockOrUnblockUserDto: BlockOrUnblockUserDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
9985
+ const localVarAxiosArgs = await localVarAxiosParamCreator.usersControllerBlockUser(id, blockOrUnblockUserDto, options);
9986
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
9987
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.usersControllerBlockUser']?.[localVarOperationServerIndex]?.url;
9988
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
9989
+ },
9990
+ /**
9991
+ *
9992
+ * @summary Soft delete a user (Admin only)
9993
+ * @param {string} id
9994
+ * @param {DeleteUserDto} deleteUserDto
9995
+ * @param {*} [options] Override http request option.
9996
+ * @throws {RequiredError}
9997
+ */
9998
+ async usersControllerDeleteUser(id: string, deleteUserDto: DeleteUserDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
9999
+ const localVarAxiosArgs = await localVarAxiosParamCreator.usersControllerDeleteUser(id, deleteUserDto, options);
10000
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
10001
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.usersControllerDeleteUser']?.[localVarOperationServerIndex]?.url;
10002
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
10003
+ },
9374
10004
  /**
9375
10005
  *
9376
10006
  * @param {number} [page]
9377
10007
  * @param {number} [pageSize]
9378
10008
  * @param {string} [filters] JSON string of FilterUserDto
9379
- * @param {string} [sort] JSON string of SortUserDto[]
10009
+ * @param {string} [sort] JSON string of SortUserDto
9380
10010
  * @param {*} [options] Override http request option.
9381
10011
  * @throws {RequiredError}
9382
10012
  */
@@ -9386,6 +10016,19 @@ export const UsersApiFp = function(configuration?: Configuration) {
9386
10016
  const localVarOperationServerBasePath = operationServerMap['UsersApi.usersControllerGetUsers']?.[localVarOperationServerIndex]?.url;
9387
10017
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
9388
10018
  },
10019
+ /**
10020
+ *
10021
+ * @summary Restore a deleted user (Admin only)
10022
+ * @param {string} id
10023
+ * @param {*} [options] Override http request option.
10024
+ * @throws {RequiredError}
10025
+ */
10026
+ async usersControllerRestoreUser(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
10027
+ const localVarAxiosArgs = await localVarAxiosParamCreator.usersControllerRestoreUser(id, options);
10028
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
10029
+ const localVarOperationServerBasePath = operationServerMap['UsersApi.usersControllerRestoreUser']?.[localVarOperationServerIndex]?.url;
10030
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
10031
+ },
9389
10032
  }
9390
10033
  };
9391
10034
 
@@ -9396,18 +10039,71 @@ export const UsersApiFp = function(configuration?: Configuration) {
9396
10039
  export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
9397
10040
  const localVarFp = UsersApiFp(configuration)
9398
10041
  return {
10042
+ /**
10043
+ *
10044
+ * @summary Get detailed user information (Admin only)
10045
+ * @param {string} id
10046
+ * @param {*} [options] Override http request option.
10047
+ * @throws {RequiredError}
10048
+ */
10049
+ usersControllerAdminGetUserDetail(id: string, options?: RawAxiosRequestConfig): AxiosPromise<UserDetail> {
10050
+ return localVarFp.usersControllerAdminGetUserDetail(id, options).then((request) => request(axios, basePath));
10051
+ },
10052
+ /**
10053
+ *
10054
+ * @summary Update user information (Admin only)
10055
+ * @param {string} id
10056
+ * @param {AdminUpdateUserDto} adminUpdateUserDto
10057
+ * @param {*} [options] Override http request option.
10058
+ * @throws {RequiredError}
10059
+ */
10060
+ usersControllerAdminUpdateUser(id: string, adminUpdateUserDto: AdminUpdateUserDto, options?: RawAxiosRequestConfig): AxiosPromise<UserDetail> {
10061
+ return localVarFp.usersControllerAdminUpdateUser(id, adminUpdateUserDto, options).then((request) => request(axios, basePath));
10062
+ },
10063
+ /**
10064
+ *
10065
+ * @summary Block or unblock a user
10066
+ * @param {string} id
10067
+ * @param {BlockOrUnblockUserDto} blockOrUnblockUserDto
10068
+ * @param {*} [options] Override http request option.
10069
+ * @throws {RequiredError}
10070
+ */
10071
+ usersControllerBlockUser(id: string, blockOrUnblockUserDto: BlockOrUnblockUserDto, options?: RawAxiosRequestConfig): AxiosPromise<void> {
10072
+ return localVarFp.usersControllerBlockUser(id, blockOrUnblockUserDto, options).then((request) => request(axios, basePath));
10073
+ },
10074
+ /**
10075
+ *
10076
+ * @summary Soft delete a user (Admin only)
10077
+ * @param {string} id
10078
+ * @param {DeleteUserDto} deleteUserDto
10079
+ * @param {*} [options] Override http request option.
10080
+ * @throws {RequiredError}
10081
+ */
10082
+ usersControllerDeleteUser(id: string, deleteUserDto: DeleteUserDto, options?: RawAxiosRequestConfig): AxiosPromise<User> {
10083
+ return localVarFp.usersControllerDeleteUser(id, deleteUserDto, options).then((request) => request(axios, basePath));
10084
+ },
9399
10085
  /**
9400
10086
  *
9401
10087
  * @param {number} [page]
9402
10088
  * @param {number} [pageSize]
9403
10089
  * @param {string} [filters] JSON string of FilterUserDto
9404
- * @param {string} [sort] JSON string of SortUserDto[]
10090
+ * @param {string} [sort] JSON string of SortUserDto
9405
10091
  * @param {*} [options] Override http request option.
9406
10092
  * @throws {RequiredError}
9407
10093
  */
9408
10094
  usersControllerGetUsers(page?: number, pageSize?: number, filters?: string, sort?: string, options?: RawAxiosRequestConfig): AxiosPromise<UsersPaginationResultDto> {
9409
10095
  return localVarFp.usersControllerGetUsers(page, pageSize, filters, sort, options).then((request) => request(axios, basePath));
9410
10096
  },
10097
+ /**
10098
+ *
10099
+ * @summary Restore a deleted user (Admin only)
10100
+ * @param {string} id
10101
+ * @param {*} [options] Override http request option.
10102
+ * @throws {RequiredError}
10103
+ */
10104
+ usersControllerRestoreUser(id: string, options?: RawAxiosRequestConfig): AxiosPromise<User> {
10105
+ return localVarFp.usersControllerRestoreUser(id, options).then((request) => request(axios, basePath));
10106
+ },
9411
10107
  };
9412
10108
  };
9413
10109
 
@@ -9418,12 +10114,63 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath
9418
10114
  * @extends {BaseAPI}
9419
10115
  */
9420
10116
  export class UsersApi extends BaseAPI {
10117
+ /**
10118
+ *
10119
+ * @summary Get detailed user information (Admin only)
10120
+ * @param {string} id
10121
+ * @param {*} [options] Override http request option.
10122
+ * @throws {RequiredError}
10123
+ * @memberof UsersApi
10124
+ */
10125
+ public usersControllerAdminGetUserDetail(id: string, options?: RawAxiosRequestConfig) {
10126
+ return UsersApiFp(this.configuration).usersControllerAdminGetUserDetail(id, options).then((request) => request(this.axios, this.basePath));
10127
+ }
10128
+
10129
+ /**
10130
+ *
10131
+ * @summary Update user information (Admin only)
10132
+ * @param {string} id
10133
+ * @param {AdminUpdateUserDto} adminUpdateUserDto
10134
+ * @param {*} [options] Override http request option.
10135
+ * @throws {RequiredError}
10136
+ * @memberof UsersApi
10137
+ */
10138
+ public usersControllerAdminUpdateUser(id: string, adminUpdateUserDto: AdminUpdateUserDto, options?: RawAxiosRequestConfig) {
10139
+ return UsersApiFp(this.configuration).usersControllerAdminUpdateUser(id, adminUpdateUserDto, options).then((request) => request(this.axios, this.basePath));
10140
+ }
10141
+
10142
+ /**
10143
+ *
10144
+ * @summary Block or unblock a user
10145
+ * @param {string} id
10146
+ * @param {BlockOrUnblockUserDto} blockOrUnblockUserDto
10147
+ * @param {*} [options] Override http request option.
10148
+ * @throws {RequiredError}
10149
+ * @memberof UsersApi
10150
+ */
10151
+ public usersControllerBlockUser(id: string, blockOrUnblockUserDto: BlockOrUnblockUserDto, options?: RawAxiosRequestConfig) {
10152
+ return UsersApiFp(this.configuration).usersControllerBlockUser(id, blockOrUnblockUserDto, options).then((request) => request(this.axios, this.basePath));
10153
+ }
10154
+
10155
+ /**
10156
+ *
10157
+ * @summary Soft delete a user (Admin only)
10158
+ * @param {string} id
10159
+ * @param {DeleteUserDto} deleteUserDto
10160
+ * @param {*} [options] Override http request option.
10161
+ * @throws {RequiredError}
10162
+ * @memberof UsersApi
10163
+ */
10164
+ public usersControllerDeleteUser(id: string, deleteUserDto: DeleteUserDto, options?: RawAxiosRequestConfig) {
10165
+ return UsersApiFp(this.configuration).usersControllerDeleteUser(id, deleteUserDto, options).then((request) => request(this.axios, this.basePath));
10166
+ }
10167
+
9421
10168
  /**
9422
10169
  *
9423
10170
  * @param {number} [page]
9424
10171
  * @param {number} [pageSize]
9425
10172
  * @param {string} [filters] JSON string of FilterUserDto
9426
- * @param {string} [sort] JSON string of SortUserDto[]
10173
+ * @param {string} [sort] JSON string of SortUserDto
9427
10174
  * @param {*} [options] Override http request option.
9428
10175
  * @throws {RequiredError}
9429
10176
  * @memberof UsersApi
@@ -9431,6 +10178,18 @@ export class UsersApi extends BaseAPI {
9431
10178
  public usersControllerGetUsers(page?: number, pageSize?: number, filters?: string, sort?: string, options?: RawAxiosRequestConfig) {
9432
10179
  return UsersApiFp(this.configuration).usersControllerGetUsers(page, pageSize, filters, sort, options).then((request) => request(this.axios, this.basePath));
9433
10180
  }
10181
+
10182
+ /**
10183
+ *
10184
+ * @summary Restore a deleted user (Admin only)
10185
+ * @param {string} id
10186
+ * @param {*} [options] Override http request option.
10187
+ * @throws {RequiredError}
10188
+ * @memberof UsersApi
10189
+ */
10190
+ public usersControllerRestoreUser(id: string, options?: RawAxiosRequestConfig) {
10191
+ return UsersApiFp(this.configuration).usersControllerRestoreUser(id, options).then((request) => request(this.axios, this.basePath));
10192
+ }
9434
10193
  }
9435
10194
 
9436
10195
 
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "openapi-client",
11
11
  "openapi-generator"
12
12
  ],
13
- "version": "1.1.4",
13
+ "version": "1.1.5",
14
14
  "main": "index.js",
15
15
  "scripts": {
16
16
  "test": "echo \"Error: no test specified\" && exit 1"