Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/c1gvka.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"keycloak-api": patch
---

Enhance GetAdminRealmsRealmUsersCountQueryParams with attributes like exact match, email verification, and identity provider filters
31 changes: 25 additions & 6 deletions packages/keycloak-api/src/admin/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13468,29 +13468,47 @@ export type GetAdminRealmsRealmUsersCountPathParams = {

export type GetAdminRealmsRealmUsersCountQueryParams = {
/**
* email filter
* A String contained in email, or the complete email, if param "exact" is true
*/
email?: string;
/**
* whether the email has been verified
*/
emailVerified?: boolean;
/**
* Boolean representing if user is enabled or not
*/
enabled?: boolean;
/**
* first name filter
* Boolean which defines whether the params "last", "first", "email" and "username" must match exactly
*/
exact?: boolean;
/**
* A String contained in firstName, or the complete firstName, if param "exact" is true
*/
firstName?: string;
/**
* last name filter
* The alias of an Identity Provider linked to the user
*/
idpAlias?: string;
/**
* The userId at an Identity Provider linked to the user
*/
idpUserId?: string;
/**
* A String contained in lastName, or the complete lastName, if param "exact" is true
*/
lastName?: string;
/**
* A query to search for custom attributes, in the format 'key1:value2 key2:value2'
*/
q?: string;
/**
* arbitrary search string for all the fields below. Default search behavior is prefix-based (e.g., foo or foo*). Use *foo* for infix search and "foo" for exact search.
* A String contained in username, first or last name, or email. Default search behavior is prefix-based (e.g., foo or foo*). Use *foo* for infix search and "foo" for exact search.
*/
search?: string;
/**
* username filter
* A String contained in username, or the complete username, if param "exact" is true
*/
username?: string;
};
Expand Down Expand Up @@ -14195,6 +14213,7 @@ export type PostAdminRealmsRealmUsersUserIdFederatedIdentityProviderError =

export type PostAdminRealmsRealmUsersUserIdFederatedIdentityProviderVariables =
{
body?: Schemas.FederatedIdentityRepresentation;
pathParams: PostAdminRealmsRealmUsersUserIdFederatedIdentityProviderPathParams;
} & FetcherExtraProps;

Expand All @@ -14205,7 +14224,7 @@ export const postAdminRealmsRealmUsersUserIdFederatedIdentityProvider = (
fetch<
undefined,
PostAdminRealmsRealmUsersUserIdFederatedIdentityProviderError,
undefined,
Schemas.FederatedIdentityRepresentation,
{},
{},
PostAdminRealmsRealmUsersUserIdFederatedIdentityProviderPathParams
Expand Down
51 changes: 42 additions & 9 deletions packages/keycloak-api/src/admin/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ export type ComponentTypeRepresentation = {
id?: string;
helpText?: string;
properties?: ConfigPropertyRepresentation[];
clientProperties?: ConfigPropertyRepresentation[];
metadata?: {
[key: string]: any;
};
Expand Down Expand Up @@ -921,7 +922,7 @@ export type KeyStoreConfig = {
validity?: number;
};

export type KeyUse = "ENC" | "SIG";
export type KeyUse = "ENC" | "JWT_SVID" | "SIG";

export type KeysMetadataRepresentation = {
active?: {
Expand Down Expand Up @@ -1641,14 +1642,6 @@ export type RealmRepresentation = {
* @deprecated true
*/
clientTemplates?: ClientTemplateRepresentation[];
/**
* @format int32
*/
oAuth2DeviceCodeLifespan?: number;
/**
* @format int32
*/
oAuth2DevicePollingInterval?: number;
};

export type RequiredActionConfigInfoRepresentation = {
Expand Down Expand Up @@ -1812,6 +1805,7 @@ export type UPAttribute = {
selector?: UPAttributeSelector;
group?: string;
multivalued?: boolean;
defaultValue?: string;
};

export type UPAttributePermissions = {
Expand Down Expand Up @@ -1938,6 +1932,7 @@ export type UserProfileAttributeMetadata = {
};
group?: string;
multivalued?: boolean;
defaultValue?: string;
};

export type UserProfileMetadata = {
Expand Down Expand Up @@ -2017,3 +2012,41 @@ export type UserSessionRepresentation = {
};
transientUser?: boolean;
};

export type WorkflowConditionRepresentation = {
uses?: string;
id?: string;
config?: MultivaluedHashMapStringString;
};

export type WorkflowRepresentation = {
id?: string;
name?: string;
uses?: string;
enabled?: boolean;
on?: void;
["reset-on"]?: void;
Comment on lines +2027 to +2028
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
on?: void;
["reset-on"]?: void;
on?: unknown;
["reset-on"]?: unknown;

The on and reset-on properties in WorkflowRepresentation are typed as void, which means they cannot hold any meaningful data and can only be undefined.

View Details

Analysis

WorkflowRepresentation properties typed as void prevent workflow configuration

What fails: WorkflowRepresentation.on and WorkflowRepresentation["reset-on"] are typed as void instead of unknown, preventing assignment of workflow event configuration values

How to reproduce:

import { WorkflowRepresentation } from './packages/keycloak-api/src/admin/schemas';

const workflow: WorkflowRepresentation = {
  id: "test",
  on: "some-event", // TypeScript error: Type 'string' is not assignable to type 'void'
  "reset-on": ["event1", "event2"] // TypeScript error: Type 'string[]' is not assignable to type 'void'
};

Result: TypeScript compilation fails with "Type 'string' is not assignable to type 'void'" errors

Expected: Properties should accept any values since the Keycloak OpenAPI spec defines them as {} (empty object/any type), similar to how other event properties like onValues and onEventsReset are properly typed as string[]

recurring?: boolean;
["if"]?: WorkflowConditionRepresentation[];
steps?: WorkflowStepRepresentation[];
state?: WorkflowStateRepresentation;
["with"]?: MultivaluedHashMapStringString;
onValues?: string[];
onEventsReset?: string[];
};

export type WorkflowSetRepresentation = {
workflows?: WorkflowRepresentation[];
};

export type WorkflowStateRepresentation = {
errors?: string[];
};

export type WorkflowStepRepresentation = {
id?: string;
uses?: string;
after?: string;
priority?: string;
config?: MultivaluedHashMapStringString;
};
Loading