Add pagination typing for listGroups (#3821)
This commit is contained in:
parent
2ed958b4d0
commit
6b63f83fd3
1 changed files with 16 additions and 6 deletions
|
@ -12,14 +12,23 @@ import type GroupRepresentation from "../defs/groupRepresentation.js";
|
||||||
import type CredentialRepresentation from "../defs/credentialRepresentation.js";
|
import type CredentialRepresentation from "../defs/credentialRepresentation.js";
|
||||||
import type UserProfileConfig from "../defs/userProfileConfig.js";
|
import type UserProfileConfig from "../defs/userProfileConfig.js";
|
||||||
|
|
||||||
export interface UserQuery {
|
interface SearchQuery {
|
||||||
email?: string;
|
search?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PaginationQuery {
|
||||||
first?: number;
|
first?: number;
|
||||||
|
max?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UserBaseQuery {
|
||||||
|
email?: string;
|
||||||
firstName?: string;
|
firstName?: string;
|
||||||
lastName?: string;
|
lastName?: string;
|
||||||
max?: number;
|
|
||||||
search?: string;
|
|
||||||
username?: string;
|
username?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserQuery extends PaginationQuery, SearchQuery, UserBaseQuery {
|
||||||
exact?: boolean;
|
exact?: boolean;
|
||||||
[key: string]: string | number | undefined | boolean;
|
[key: string]: string | number | undefined | boolean;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +73,7 @@ export class Users extends Resource<{ realm?: string }> {
|
||||||
urlParamKeys: ["id"],
|
urlParamKeys: ["id"],
|
||||||
});
|
});
|
||||||
|
|
||||||
public count = this.makeRequest<UserQuery, number>({
|
public count = this.makeRequest<UserBaseQuery & SearchQuery, number>({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
path: "/count",
|
path: "/count",
|
||||||
});
|
});
|
||||||
|
@ -226,7 +235,8 @@ export class Users extends Resource<{ realm?: string }> {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public listGroups = this.makeRequest<
|
public listGroups = this.makeRequest<
|
||||||
{ id: string; briefRepresentation?: boolean },
|
{ id: string; briefRepresentation?: boolean } & PaginationQuery &
|
||||||
|
SearchQuery,
|
||||||
GroupRepresentation[]
|
GroupRepresentation[]
|
||||||
>({
|
>({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|
Loading…
Reference in a new issue