@keycloak/keycloak-account-ui 25.0.6 → 26.0.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Keycloak Account UI
2
2
 
3
- This project is the next generation of the Keycloak Account UI. It is written with React and [PatternFly 4](https://www.patternfly.org/v4/) and uses [Vite](https://vitejs.dev/guide/).
3
+ This project is the next generation of the Keycloak Account UI. It is written with React and [PatternFly](https://www.patternfly.org/) and uses [Vite](https://vitejs.dev/guide/).
4
4
 
5
5
  ## Features
6
6
 
@@ -17,7 +17,7 @@ npm i @keycloak/keycloak-account-ui
17
17
  To use these pages you'll need to add `KeycloakProvider` in your component hierarchy to setup what client, realm and url to use.
18
18
 
19
19
  ```jsx
20
- import { KeycloakProvider } from "@keycloak/keycloak-account-ui";
20
+ import { KeycloakProvider } from "@keycloak/keycloak-ui-shared";
21
21
 
22
22
  //...
23
23
 
@@ -1,5 +1,4 @@
1
1
  import { LinkedAccountRepresentation } from '../api/representations';
2
-
3
2
  type AccountRowProps = {
4
3
  account: LinkedAccountRepresentation;
5
4
  isLinked?: boolean;
@@ -0,0 +1,12 @@
1
+ type LinkedAccountsToolbarProps = {
2
+ onFilter: (nameFilter: string) => void;
3
+ count: number;
4
+ first: number;
5
+ max: number;
6
+ onNextClick: (page: number) => void;
7
+ onPreviousClick: (page: number) => void;
8
+ onPerPageSelect: (max: number, first: number) => void;
9
+ hasNext: boolean;
10
+ };
11
+ export declare const LinkedAccountsToolbar: ({ count, first, max, onNextClick, onPreviousClick, onPerPageSelect, onFilter, hasNext, }: LinkedAccountsToolbarProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { BaseEnvironment, KeycloakContext } from '@keycloak/keycloak-ui-shared';
2
+ import { default as OrganizationRepresentation } from '@keycloak/keycloak-admin-client/lib/defs/organizationRepresentation';
2
3
  import { ClientRepresentation, CredentialContainer, DeviceRepresentation, Group, LinkedAccountRepresentation, Permission, UserRepresentation } from './representations';
3
-
4
4
  export type CallOptions = {
5
5
  context: KeycloakContext<BaseEnvironment>;
6
6
  signal?: AbortSignal;
@@ -18,9 +18,14 @@ export declare function getApplications({ signal, context, }: CallOptions): Prom
18
18
  export declare function deleteConsent(context: KeycloakContext<BaseEnvironment>, id: string): Promise<Response>;
19
19
  export declare function deleteSession(context: KeycloakContext<BaseEnvironment>, id?: string): Promise<Response>;
20
20
  export declare function getCredentials({ signal, context }: CallOptions): Promise<CredentialContainer[]>;
21
- export declare function getLinkedAccounts({ signal, context }: CallOptions): Promise<LinkedAccountRepresentation[]>;
21
+ export type LinkedAccountQueryParams = PaginationParams & {
22
+ search?: string;
23
+ linked?: boolean;
24
+ };
25
+ export declare function getLinkedAccounts({ signal, context }: CallOptions, query: LinkedAccountQueryParams): Promise<LinkedAccountRepresentation[]>;
22
26
  export declare function unLinkAccount(context: KeycloakContext<BaseEnvironment>, account: LinkedAccountRepresentation): Promise<unknown>;
23
27
  export declare function linkAccount(context: KeycloakContext<BaseEnvironment>, account: LinkedAccountRepresentation): Promise<{
24
28
  accountLinkUri: string;
25
29
  }>;
26
30
  export declare function getGroups({ signal, context }: CallOptions): Promise<Group[]>;
31
+ export declare function getUserOrganizations({ signal, context }: CallOptions): Promise<OrganizationRepresentation[]>;
@@ -1,3 +1,5 @@
1
1
  export declare class ApiError extends Error {
2
+ description?: string;
3
+ constructor(message: string, description?: string);
2
4
  }
3
5
  export declare function parseResponse<T>(response: Response): Promise<T>;
@@ -1,6 +1,5 @@
1
1
  import { KeycloakContext, BaseEnvironment } from '@keycloak/keycloak-ui-shared';
2
2
  import { default as Keycloak } from 'keycloak-js';
3
-
4
3
  export type RequestOptions = {
5
4
  signal?: AbortSignal;
6
5
  getAccessToken?: () => Promise<string | undefined>;
package/lib/api.d.ts CHANGED
@@ -2,7 +2,6 @@ import { KeycloakContext, BaseEnvironment } from '@keycloak/keycloak-ui-shared';
2
2
  import { CallOptions } from './api/methods';
3
3
  import { Links } from './api/parse-links';
4
4
  import { CredentialsIssuer, Permission, Resource, Scope, SupportedCredentialConfiguration } from './api/representations';
5
-
6
5
  export declare const fetchResources: ({ signal, context }: CallOptions, requestParams: Record<string, string>, shared?: boolean | undefined) => Promise<{
7
6
  data: Resource[];
8
7
  links: Links;
@@ -1,5 +1,4 @@
1
1
  import { PropsWithChildren } from 'react';
2
-
3
2
  type PageProps = {
4
3
  title: string;
5
4
  description: string;
@@ -1,4 +1,3 @@
1
1
  import { CallOptions } from '../api/methods';
2
2
  import { MenuItem } from '../root/PageNav';
3
-
4
3
  export default function fetchContentJson(opts: CallOptions): Promise<MenuItem[]>;
@@ -1,5 +1,4 @@
1
1
  import { BaseEnvironment } from '@keycloak/keycloak-ui-shared';
2
-
3
2
  export type Environment = BaseEnvironment & {
4
3
  /** The URL to the root of the account console. */
5
4
  baseUrl: string;
@@ -21,6 +20,7 @@ export type Feature = {
21
20
  updateEmailFeatureEnabled: boolean;
22
21
  updateEmailActionEnabled: boolean;
23
22
  isViewGroupsEnabled: boolean;
23
+ isViewOrganizationsEnabled: boolean;
24
24
  isOid4VciEnabled: boolean;
25
25
  };
26
26
  export declare const environment: Environment;
package/lib/index.d.ts CHANGED
@@ -21,5 +21,6 @@ export { Oid4Vci } from './oid4vci/Oid4Vci';
21
21
  export { ShareTheResource } from './resources/ShareTheResource';
22
22
  export { deleteConsent, deleteSession, getApplications, getCredentials, getDevices, getGroups, getLinkedAccounts, getPermissionRequests, getPersonalInfo, getSupportedLocales, linkAccount, savePersonalInfo, unLinkAccount, } from './api/methods';
23
23
  export type { Environment as AccountEnvironment } from './environment';
24
- export { KeycloakProvider, useEnvironment, useAlerts, } from '@keycloak/keycloak-ui-shared';
24
+ export { KeycloakProvider, useEnvironment } from '@keycloak/keycloak-ui-shared';
25
+ export { useAccountAlerts } from './utils/useAccountAlerts';
25
26
  export { usePromise } from './utils/usePromise';
@@ -1 +1,2 @@
1
1
  export * from './index'
2
+ export {}