Add pagination typing for listGroups (#3821)

This commit is contained in:
JBWatenbergScality 2022-11-25 00:33:36 +01:00 committed by GitHub
parent 2ed958b4d0
commit 6b63f83fd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",