@abpjs/identity 3.0.0 → 3.2.0

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/dist/index.js CHANGED
@@ -23,8 +23,12 @@ __export(index_exports, {
23
23
  IDENTITY_POLICIES: () => IDENTITY_POLICIES,
24
24
  IDENTITY_ROUTE_PATHS: () => IDENTITY_ROUTE_PATHS,
25
25
  IDENTITY_ROUTE_PROVIDERS: () => IDENTITY_ROUTE_PROVIDERS,
26
+ IdentityRoleService: () => IdentityRoleService,
26
27
  IdentityService: () => IdentityService,
27
28
  IdentityStateService: () => IdentityStateService,
29
+ IdentityUserLookupService: () => IdentityUserLookupService,
30
+ IdentityUserService: () => IdentityUserService,
31
+ ProfileService: () => ProfileService,
28
32
  RolesComponent: () => RolesComponent,
29
33
  UsersComponent: () => UsersComponent,
30
34
  configureRoutes: () => configureRoutes,
@@ -125,6 +129,314 @@ var eIdentityComponents = {
125
129
  Users: "Identity.UsersComponent"
126
130
  };
127
131
 
132
+ // src/proxy/identity/identity-role.service.ts
133
+ var IdentityRoleService = class {
134
+ constructor(restService) {
135
+ /**
136
+ * The API name used for REST requests.
137
+ */
138
+ this.apiName = "default";
139
+ /**
140
+ * Create a new role
141
+ * @param input - The role data to create
142
+ * @returns Promise with the created role
143
+ */
144
+ this.create = (input) => {
145
+ return this.restService.request({
146
+ method: "POST",
147
+ url: "/api/identity/roles",
148
+ body: input
149
+ });
150
+ };
151
+ /**
152
+ * Delete a role by ID
153
+ * @param id - The role ID to delete
154
+ * @returns Promise that resolves when deletion is complete
155
+ */
156
+ this.delete = (id) => {
157
+ return this.restService.request({
158
+ method: "DELETE",
159
+ url: `/api/identity/roles/${id}`
160
+ });
161
+ };
162
+ /**
163
+ * Get a role by ID
164
+ * @param id - The role ID
165
+ * @returns Promise with the role
166
+ */
167
+ this.get = (id) => {
168
+ return this.restService.request({
169
+ method: "GET",
170
+ url: `/api/identity/roles/${id}`
171
+ });
172
+ };
173
+ /**
174
+ * Get all roles without pagination
175
+ * @returns Promise with all roles
176
+ */
177
+ this.getAllList = () => {
178
+ return this.restService.request({
179
+ method: "GET",
180
+ url: "/api/identity/roles/all"
181
+ });
182
+ };
183
+ /**
184
+ * Get roles with pagination
185
+ * @param input - Pagination and sorting parameters
186
+ * @returns Promise with paginated roles
187
+ */
188
+ this.getList = (input) => {
189
+ return this.restService.request({
190
+ method: "GET",
191
+ url: "/api/identity/roles",
192
+ params: input
193
+ });
194
+ };
195
+ /**
196
+ * Update a role
197
+ * @param id - The role ID to update
198
+ * @param input - The updated role data
199
+ * @returns Promise with the updated role
200
+ */
201
+ this.update = (id, input) => {
202
+ return this.restService.request({
203
+ method: "PUT",
204
+ url: `/api/identity/roles/${id}`,
205
+ body: input
206
+ });
207
+ };
208
+ this.restService = restService;
209
+ }
210
+ };
211
+
212
+ // src/proxy/identity/identity-user-lookup.service.ts
213
+ var IdentityUserLookupService = class {
214
+ constructor(restService) {
215
+ /**
216
+ * The API name used for REST requests.
217
+ */
218
+ this.apiName = "default";
219
+ /**
220
+ * Find a user by ID
221
+ * @param id - The user ID
222
+ * @returns Promise with the user data
223
+ */
224
+ this.findById = (id) => {
225
+ return this.restService.request({
226
+ method: "GET",
227
+ url: `/api/identity/users/lookup/${id}`
228
+ });
229
+ };
230
+ /**
231
+ * Find a user by username
232
+ * @param userName - The username to search for
233
+ * @returns Promise with the user data
234
+ */
235
+ this.findByUserName = (userName) => {
236
+ return this.restService.request({
237
+ method: "GET",
238
+ url: `/api/identity/users/lookup/by-username/${userName}`
239
+ });
240
+ };
241
+ /**
242
+ * Get count of users matching filter
243
+ * @param input - Filter parameters
244
+ * @returns Promise with the count
245
+ */
246
+ this.getCount = (input) => {
247
+ return this.restService.request({
248
+ method: "GET",
249
+ url: "/api/identity/users/lookup/count",
250
+ params: input
251
+ });
252
+ };
253
+ /**
254
+ * Search for users
255
+ * @param input - Search and pagination parameters
256
+ * @returns Promise with matching users
257
+ */
258
+ this.search = (input) => {
259
+ return this.restService.request({
260
+ method: "GET",
261
+ url: "/api/identity/users/lookup/search",
262
+ params: input
263
+ });
264
+ };
265
+ this.restService = restService;
266
+ }
267
+ };
268
+
269
+ // src/proxy/identity/identity-user.service.ts
270
+ var IdentityUserService = class {
271
+ constructor(restService) {
272
+ /**
273
+ * The API name used for REST requests.
274
+ */
275
+ this.apiName = "default";
276
+ /**
277
+ * Create a new user
278
+ * @param input - The user data to create
279
+ * @returns Promise with the created user
280
+ */
281
+ this.create = (input) => {
282
+ return this.restService.request({
283
+ method: "POST",
284
+ url: "/api/identity/users",
285
+ body: input
286
+ });
287
+ };
288
+ /**
289
+ * Delete a user by ID
290
+ * @param id - The user ID to delete
291
+ * @returns Promise that resolves when deletion is complete
292
+ */
293
+ this.delete = (id) => {
294
+ return this.restService.request({
295
+ method: "DELETE",
296
+ url: `/api/identity/users/${id}`
297
+ });
298
+ };
299
+ /**
300
+ * Find a user by email
301
+ * @param email - The user's email
302
+ * @returns Promise with the user
303
+ */
304
+ this.findByEmail = (email) => {
305
+ return this.restService.request({
306
+ method: "GET",
307
+ url: `/api/identity/users/by-email/${email}`
308
+ });
309
+ };
310
+ /**
311
+ * Find a user by username
312
+ * @param username - The user's username
313
+ * @returns Promise with the user
314
+ */
315
+ this.findByUsername = (username) => {
316
+ return this.restService.request({
317
+ method: "GET",
318
+ url: `/api/identity/users/by-username/${username}`
319
+ });
320
+ };
321
+ /**
322
+ * Get a user by ID
323
+ * @param id - The user ID
324
+ * @returns Promise with the user
325
+ */
326
+ this.get = (id) => {
327
+ return this.restService.request({
328
+ method: "GET",
329
+ url: `/api/identity/users/${id}`
330
+ });
331
+ };
332
+ /**
333
+ * Get all roles that can be assigned to users
334
+ * @returns Promise with assignable roles
335
+ */
336
+ this.getAssignableRoles = () => {
337
+ return this.restService.request({
338
+ method: "GET",
339
+ url: "/api/identity/users/assignable-roles"
340
+ });
341
+ };
342
+ /**
343
+ * Get users with pagination and filtering
344
+ * @param input - Pagination, sorting, and filter parameters
345
+ * @returns Promise with paginated users
346
+ */
347
+ this.getList = (input) => {
348
+ return this.restService.request({
349
+ method: "GET",
350
+ url: "/api/identity/users",
351
+ params: input
352
+ });
353
+ };
354
+ /**
355
+ * Get roles assigned to a user
356
+ * @param id - The user ID
357
+ * @returns Promise with the user's roles
358
+ */
359
+ this.getRoles = (id) => {
360
+ return this.restService.request({
361
+ method: "GET",
362
+ url: `/api/identity/users/${id}/roles`
363
+ });
364
+ };
365
+ /**
366
+ * Update a user
367
+ * @param id - The user ID to update
368
+ * @param input - The updated user data
369
+ * @returns Promise with the updated user
370
+ */
371
+ this.update = (id, input) => {
372
+ return this.restService.request({
373
+ method: "PUT",
374
+ url: `/api/identity/users/${id}`,
375
+ body: input
376
+ });
377
+ };
378
+ /**
379
+ * Update a user's roles
380
+ * @param id - The user ID
381
+ * @param input - The new role assignments
382
+ * @returns Promise that resolves when update is complete
383
+ */
384
+ this.updateRoles = (id, input) => {
385
+ return this.restService.request({
386
+ method: "PUT",
387
+ url: `/api/identity/users/${id}/roles`,
388
+ body: input
389
+ });
390
+ };
391
+ this.restService = restService;
392
+ }
393
+ };
394
+
395
+ // src/proxy/identity/profile.service.ts
396
+ var ProfileService = class {
397
+ constructor(restService) {
398
+ /**
399
+ * The API name used for REST requests.
400
+ */
401
+ this.apiName = "default";
402
+ /**
403
+ * Change the current user's password
404
+ * @param input - Current and new password
405
+ * @returns Promise that resolves when password is changed
406
+ */
407
+ this.changePassword = (input) => {
408
+ return this.restService.request({
409
+ method: "POST",
410
+ url: "/api/identity/my-profile/change-password",
411
+ body: input
412
+ });
413
+ };
414
+ /**
415
+ * Get the current user's profile
416
+ * @returns Promise with the profile data
417
+ */
418
+ this.get = () => {
419
+ return this.restService.request({
420
+ method: "GET",
421
+ url: "/api/identity/my-profile"
422
+ });
423
+ };
424
+ /**
425
+ * Update the current user's profile
426
+ * @param input - Updated profile data
427
+ * @returns Promise with the updated profile
428
+ */
429
+ this.update = (input) => {
430
+ return this.restService.request({
431
+ method: "PUT",
432
+ url: "/api/identity/my-profile",
433
+ body: input
434
+ });
435
+ };
436
+ this.restService = restService;
437
+ }
438
+ };
439
+
128
440
  // src/services/identity.service.ts
129
441
  var IdentityService = class {
130
442
  constructor(rest) {
@@ -1434,8 +1746,12 @@ var IDENTITY_POLICIES = {
1434
1746
  IDENTITY_POLICIES,
1435
1747
  IDENTITY_ROUTE_PATHS,
1436
1748
  IDENTITY_ROUTE_PROVIDERS,
1749
+ IdentityRoleService,
1437
1750
  IdentityService,
1438
1751
  IdentityStateService,
1752
+ IdentityUserLookupService,
1753
+ IdentityUserService,
1754
+ ProfileService,
1439
1755
  RolesComponent,
1440
1756
  UsersComponent,
1441
1757
  configureRoutes,
package/dist/index.mjs CHANGED
@@ -85,6 +85,314 @@ var eIdentityComponents = {
85
85
  Users: "Identity.UsersComponent"
86
86
  };
87
87
 
88
+ // src/proxy/identity/identity-role.service.ts
89
+ var IdentityRoleService = class {
90
+ constructor(restService) {
91
+ /**
92
+ * The API name used for REST requests.
93
+ */
94
+ this.apiName = "default";
95
+ /**
96
+ * Create a new role
97
+ * @param input - The role data to create
98
+ * @returns Promise with the created role
99
+ */
100
+ this.create = (input) => {
101
+ return this.restService.request({
102
+ method: "POST",
103
+ url: "/api/identity/roles",
104
+ body: input
105
+ });
106
+ };
107
+ /**
108
+ * Delete a role by ID
109
+ * @param id - The role ID to delete
110
+ * @returns Promise that resolves when deletion is complete
111
+ */
112
+ this.delete = (id) => {
113
+ return this.restService.request({
114
+ method: "DELETE",
115
+ url: `/api/identity/roles/${id}`
116
+ });
117
+ };
118
+ /**
119
+ * Get a role by ID
120
+ * @param id - The role ID
121
+ * @returns Promise with the role
122
+ */
123
+ this.get = (id) => {
124
+ return this.restService.request({
125
+ method: "GET",
126
+ url: `/api/identity/roles/${id}`
127
+ });
128
+ };
129
+ /**
130
+ * Get all roles without pagination
131
+ * @returns Promise with all roles
132
+ */
133
+ this.getAllList = () => {
134
+ return this.restService.request({
135
+ method: "GET",
136
+ url: "/api/identity/roles/all"
137
+ });
138
+ };
139
+ /**
140
+ * Get roles with pagination
141
+ * @param input - Pagination and sorting parameters
142
+ * @returns Promise with paginated roles
143
+ */
144
+ this.getList = (input) => {
145
+ return this.restService.request({
146
+ method: "GET",
147
+ url: "/api/identity/roles",
148
+ params: input
149
+ });
150
+ };
151
+ /**
152
+ * Update a role
153
+ * @param id - The role ID to update
154
+ * @param input - The updated role data
155
+ * @returns Promise with the updated role
156
+ */
157
+ this.update = (id, input) => {
158
+ return this.restService.request({
159
+ method: "PUT",
160
+ url: `/api/identity/roles/${id}`,
161
+ body: input
162
+ });
163
+ };
164
+ this.restService = restService;
165
+ }
166
+ };
167
+
168
+ // src/proxy/identity/identity-user-lookup.service.ts
169
+ var IdentityUserLookupService = class {
170
+ constructor(restService) {
171
+ /**
172
+ * The API name used for REST requests.
173
+ */
174
+ this.apiName = "default";
175
+ /**
176
+ * Find a user by ID
177
+ * @param id - The user ID
178
+ * @returns Promise with the user data
179
+ */
180
+ this.findById = (id) => {
181
+ return this.restService.request({
182
+ method: "GET",
183
+ url: `/api/identity/users/lookup/${id}`
184
+ });
185
+ };
186
+ /**
187
+ * Find a user by username
188
+ * @param userName - The username to search for
189
+ * @returns Promise with the user data
190
+ */
191
+ this.findByUserName = (userName) => {
192
+ return this.restService.request({
193
+ method: "GET",
194
+ url: `/api/identity/users/lookup/by-username/${userName}`
195
+ });
196
+ };
197
+ /**
198
+ * Get count of users matching filter
199
+ * @param input - Filter parameters
200
+ * @returns Promise with the count
201
+ */
202
+ this.getCount = (input) => {
203
+ return this.restService.request({
204
+ method: "GET",
205
+ url: "/api/identity/users/lookup/count",
206
+ params: input
207
+ });
208
+ };
209
+ /**
210
+ * Search for users
211
+ * @param input - Search and pagination parameters
212
+ * @returns Promise with matching users
213
+ */
214
+ this.search = (input) => {
215
+ return this.restService.request({
216
+ method: "GET",
217
+ url: "/api/identity/users/lookup/search",
218
+ params: input
219
+ });
220
+ };
221
+ this.restService = restService;
222
+ }
223
+ };
224
+
225
+ // src/proxy/identity/identity-user.service.ts
226
+ var IdentityUserService = class {
227
+ constructor(restService) {
228
+ /**
229
+ * The API name used for REST requests.
230
+ */
231
+ this.apiName = "default";
232
+ /**
233
+ * Create a new user
234
+ * @param input - The user data to create
235
+ * @returns Promise with the created user
236
+ */
237
+ this.create = (input) => {
238
+ return this.restService.request({
239
+ method: "POST",
240
+ url: "/api/identity/users",
241
+ body: input
242
+ });
243
+ };
244
+ /**
245
+ * Delete a user by ID
246
+ * @param id - The user ID to delete
247
+ * @returns Promise that resolves when deletion is complete
248
+ */
249
+ this.delete = (id) => {
250
+ return this.restService.request({
251
+ method: "DELETE",
252
+ url: `/api/identity/users/${id}`
253
+ });
254
+ };
255
+ /**
256
+ * Find a user by email
257
+ * @param email - The user's email
258
+ * @returns Promise with the user
259
+ */
260
+ this.findByEmail = (email) => {
261
+ return this.restService.request({
262
+ method: "GET",
263
+ url: `/api/identity/users/by-email/${email}`
264
+ });
265
+ };
266
+ /**
267
+ * Find a user by username
268
+ * @param username - The user's username
269
+ * @returns Promise with the user
270
+ */
271
+ this.findByUsername = (username) => {
272
+ return this.restService.request({
273
+ method: "GET",
274
+ url: `/api/identity/users/by-username/${username}`
275
+ });
276
+ };
277
+ /**
278
+ * Get a user by ID
279
+ * @param id - The user ID
280
+ * @returns Promise with the user
281
+ */
282
+ this.get = (id) => {
283
+ return this.restService.request({
284
+ method: "GET",
285
+ url: `/api/identity/users/${id}`
286
+ });
287
+ };
288
+ /**
289
+ * Get all roles that can be assigned to users
290
+ * @returns Promise with assignable roles
291
+ */
292
+ this.getAssignableRoles = () => {
293
+ return this.restService.request({
294
+ method: "GET",
295
+ url: "/api/identity/users/assignable-roles"
296
+ });
297
+ };
298
+ /**
299
+ * Get users with pagination and filtering
300
+ * @param input - Pagination, sorting, and filter parameters
301
+ * @returns Promise with paginated users
302
+ */
303
+ this.getList = (input) => {
304
+ return this.restService.request({
305
+ method: "GET",
306
+ url: "/api/identity/users",
307
+ params: input
308
+ });
309
+ };
310
+ /**
311
+ * Get roles assigned to a user
312
+ * @param id - The user ID
313
+ * @returns Promise with the user's roles
314
+ */
315
+ this.getRoles = (id) => {
316
+ return this.restService.request({
317
+ method: "GET",
318
+ url: `/api/identity/users/${id}/roles`
319
+ });
320
+ };
321
+ /**
322
+ * Update a user
323
+ * @param id - The user ID to update
324
+ * @param input - The updated user data
325
+ * @returns Promise with the updated user
326
+ */
327
+ this.update = (id, input) => {
328
+ return this.restService.request({
329
+ method: "PUT",
330
+ url: `/api/identity/users/${id}`,
331
+ body: input
332
+ });
333
+ };
334
+ /**
335
+ * Update a user's roles
336
+ * @param id - The user ID
337
+ * @param input - The new role assignments
338
+ * @returns Promise that resolves when update is complete
339
+ */
340
+ this.updateRoles = (id, input) => {
341
+ return this.restService.request({
342
+ method: "PUT",
343
+ url: `/api/identity/users/${id}/roles`,
344
+ body: input
345
+ });
346
+ };
347
+ this.restService = restService;
348
+ }
349
+ };
350
+
351
+ // src/proxy/identity/profile.service.ts
352
+ var ProfileService = class {
353
+ constructor(restService) {
354
+ /**
355
+ * The API name used for REST requests.
356
+ */
357
+ this.apiName = "default";
358
+ /**
359
+ * Change the current user's password
360
+ * @param input - Current and new password
361
+ * @returns Promise that resolves when password is changed
362
+ */
363
+ this.changePassword = (input) => {
364
+ return this.restService.request({
365
+ method: "POST",
366
+ url: "/api/identity/my-profile/change-password",
367
+ body: input
368
+ });
369
+ };
370
+ /**
371
+ * Get the current user's profile
372
+ * @returns Promise with the profile data
373
+ */
374
+ this.get = () => {
375
+ return this.restService.request({
376
+ method: "GET",
377
+ url: "/api/identity/my-profile"
378
+ });
379
+ };
380
+ /**
381
+ * Update the current user's profile
382
+ * @param input - Updated profile data
383
+ * @returns Promise with the updated profile
384
+ */
385
+ this.update = (input) => {
386
+ return this.restService.request({
387
+ method: "PUT",
388
+ url: "/api/identity/my-profile",
389
+ body: input
390
+ });
391
+ };
392
+ this.restService = restService;
393
+ }
394
+ };
395
+
88
396
  // src/services/identity.service.ts
89
397
  var IdentityService = class {
90
398
  constructor(rest) {
@@ -1413,8 +1721,12 @@ export {
1413
1721
  IDENTITY_POLICIES,
1414
1722
  IDENTITY_ROUTE_PATHS,
1415
1723
  IDENTITY_ROUTE_PROVIDERS,
1724
+ IdentityRoleService,
1416
1725
  IdentityService,
1417
1726
  IdentityStateService,
1727
+ IdentityUserLookupService,
1728
+ IdentityUserService,
1729
+ ProfileService,
1418
1730
  RolesComponent,
1419
1731
  UsersComponent,
1420
1732
  configureRoutes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abpjs/identity",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "ABP Framework identity components for React - translated from @abp/ng.identity",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "@chakra-ui/react": "^3.2.0",
27
27
  "@emotion/react": "^11.11.0",
28
- "@abpjs/core": "3.0.0",
29
- "@abpjs/theme-shared": "3.0.0",
30
- "@abpjs/permission-management": "3.0.0"
28
+ "@abpjs/core": "3.2.0",
29
+ "@abpjs/permission-management": "3.2.0",
30
+ "@abpjs/theme-shared": "3.2.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@abp/ng.identity": "3.0.0",
33
+ "@abp/ng.identity": "3.2.0",
34
34
  "@testing-library/jest-dom": "^6.9.1",
35
35
  "@testing-library/react": "^14.0.0",
36
36
  "@testing-library/user-event": "^14.6.1",