@authenty/authapi-types 1.0.26 → 1.0.28
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.d.ts +7 -4
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +8 -5
package/dist/index.d.ts
CHANGED
|
@@ -373,10 +373,10 @@ export declare namespace AuthApi {
|
|
|
373
373
|
endDate?: string;
|
|
374
374
|
};
|
|
375
375
|
type PaginationInfo = {
|
|
376
|
-
total
|
|
376
|
+
total?: number;
|
|
377
377
|
page: number;
|
|
378
378
|
itemsPerPage: number;
|
|
379
|
-
totalPages
|
|
379
|
+
totalPages?: number;
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
382
|
/**
|
|
@@ -408,7 +408,10 @@ export declare namespace AuthApi {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
namespace users {
|
|
411
|
-
type GET =
|
|
411
|
+
type GET = {
|
|
412
|
+
users: objects.LocalUser[];
|
|
413
|
+
pagination: auxiliarTypes.PaginationInfo;
|
|
414
|
+
};
|
|
412
415
|
}
|
|
413
416
|
namespace user {
|
|
414
417
|
type POST = objects.LocalUser;
|
|
@@ -758,7 +761,7 @@ export declare namespace AuthApi {
|
|
|
758
761
|
};
|
|
759
762
|
checkHealth(): Promise<boolean>;
|
|
760
763
|
users: {
|
|
761
|
-
list: () => Promise<responses.ApiResponse<responses.users.GET>>;
|
|
764
|
+
list: (search?: string, page?: number, itemsPerPage?: number, includeDeleted?: boolean) => Promise<responses.ApiResponse<responses.users.GET>>;
|
|
762
765
|
get: (userId: number, includePurchases?: boolean) => Promise<responses.ApiResponse<responses.user.$userId.GET>>;
|
|
763
766
|
update: (userId: number, userData: Partial<objects.LocalUser>) => Promise<responses.ApiResponse<objects.LocalUser>>;
|
|
764
767
|
updateConfig: (obj: {
|
package/dist/index.js
CHANGED
|
@@ -138,8 +138,8 @@ var AuthApi;
|
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
this.users = {
|
|
141
|
-
list: async () => {
|
|
142
|
-
return await this.request('GET', 'users', {});
|
|
141
|
+
list: async (search = '', page = 1, itemsPerPage = 50, includeDeleted = false) => {
|
|
142
|
+
return await this.request('GET', 'users', { search, page, itemsPerPage, includeDeleted });
|
|
143
143
|
},
|
|
144
144
|
get: async (userId, includePurchases = true) => {
|
|
145
145
|
return await this.request('GET', `user/${userId}?includePurchases=${includePurchases}`, {});
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -421,10 +421,10 @@ export namespace AuthApi {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
export type PaginationInfo = {
|
|
424
|
-
total
|
|
424
|
+
total?: number; //quando undefined, considerar "de muitos"
|
|
425
425
|
page: number;
|
|
426
426
|
itemsPerPage: number;
|
|
427
|
-
totalPages
|
|
427
|
+
totalPages?: number;//quando undefined, considerar "de muitos"
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
|
|
@@ -455,7 +455,10 @@ export namespace AuthApi {
|
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
export namespace users {
|
|
458
|
-
export type GET =
|
|
458
|
+
export type GET = {
|
|
459
|
+
users: objects.LocalUser[],
|
|
460
|
+
pagination: auxiliarTypes.PaginationInfo
|
|
461
|
+
};
|
|
459
462
|
}
|
|
460
463
|
|
|
461
464
|
export namespace user {
|
|
@@ -979,8 +982,8 @@ export namespace AuthApi {
|
|
|
979
982
|
}
|
|
980
983
|
|
|
981
984
|
public users = {
|
|
982
|
-
list: async () => {
|
|
983
|
-
return await this.request<responses.users.GET>('GET', 'users', {});
|
|
985
|
+
list: async (search:string='', page:number=1, itemsPerPage:number=50, includeDeleted:boolean=false) => {
|
|
986
|
+
return await this.request<responses.users.GET>('GET', 'users', {search,page,itemsPerPage,includeDeleted});
|
|
984
987
|
},
|
|
985
988
|
get: async (userId: number, includePurchases: boolean = true) => {
|
|
986
989
|
return await this.request<responses.user.$userId.GET>('GET', `user/${userId}?includePurchases=${includePurchases}`, {});
|