diff --git a/apps/console/package.json b/apps/console/package.json index 5a698a13a29..2b540bd5942 100644 --- a/apps/console/package.json +++ b/apps/console/package.json @@ -52,6 +52,7 @@ "@wso2is/admin.alternative-login-identifier.v1": "^1.5.203", "@wso2is/admin.api-resources.v1": "^2.25.203", "@wso2is/admin.api-resources.v2": "^2.25.203", + "@wso2is/admin.application-templates.v1": "^1.5.2", "@wso2is/admin.applications.v1": "^2.34.3", "@wso2is/admin.authentication.v1": "^2.25.204", "@wso2is/admin.authorization.v1": "^2.25.88", @@ -64,24 +65,27 @@ "@wso2is/admin.email-and-sms.v1": "^2.25.203", "@wso2is/admin.email-management.v1": "^2.25.203", "@wso2is/admin.email-providers.v1": "^2.25.203", + "@wso2is/admin.email-templates.v1": "^2.25.203", "@wso2is/admin.extensions.v1": "^2.37.3", "@wso2is/admin.feature-gate.v1": "^1.6.1", "@wso2is/admin.groups.v1": "^2.27.117", "@wso2is/admin.home.v1": "^1.7.2", "@wso2is/admin.identity-verification-providers.v1": "^2.27.203", + "@wso2is/admin.impersonation.v1": "^1.6.203", "@wso2is/admin.logs.v1": "^1.6.2", "@wso2is/admin.oidc-scopes.v1": "^2.25.203", "@wso2is/admin.org-insights.v1": "^2.25.203", "@wso2is/admin.organization-discovery.v1": "^2.25.203", "@wso2is/admin.organizations.v1": "^2.26.203", + "@wso2is/admin.policy-administration.v1": "^1.0.120", "@wso2is/admin.private-key-jwt.v1": "^2.25.203", "@wso2is/admin.push-providers.v1": "^1.0.92", + "@wso2is/admin.registration-flow-builder.v1": "^0.5.6", "@wso2is/admin.remote-repository-configuration.v1": "^2.25.203", - "@wso2is/admin.impersonation.v1": "^1.6.203", - "@wso2is/admin.policy-administration.v1": "^1.0.120", "@wso2is/admin.remote-userstores.v1": "^1.7.159", "@wso2is/admin.roles.v1": "^2.25.203", "@wso2is/admin.roles.v2": "^2.27.149", + "@wso2is/admin.rules.v1": "^0.4.19", "@wso2is/admin.saml2-configuration.v1": "^2.25.204", "@wso2is/admin.secrets.v1": "^2.25.203", "@wso2is/admin.server-configurations.v1": "^2.34.2", @@ -89,11 +93,12 @@ "@wso2is/admin.sms-providers.v1": "^2.25.203", "@wso2is/admin.sms-templates.v1": "^1.0.202", "@wso2is/admin.subscription.v1": "^1.5.203", + "@wso2is/admin.template-core.v1": "^1.5.157", "@wso2is/admin.tenants.v1": "^2.29.9", "@wso2is/admin.username-validation.v1": "^1.5.203", "@wso2is/admin.users.v1": "^2.30.124", - "@wso2is/admin.validation.v1": "^2.27.142", "@wso2is/admin.userstores.v1": "^2.27.29", + "@wso2is/admin.validation.v1": "^2.27.142", "@wso2is/admin.workflow-approvals.v1": "^2.25.203", "@wso2is/admin.wsfed-configuration.v1": "^2.25.203", "@wso2is/common.ui.v1": "^0.2.0", @@ -141,9 +146,7 @@ "slashes": "^2.0.2", "styled-components": "^4.4.1", "swr": "^2.0.0", - "uuid": "^8.3.0", - "@wso2is/admin.application-templates.v1": "^1.5.2", - "@wso2is/admin.template-core.v1": "^1.5.157" + "uuid": "^8.3.0" }, "devDependencies": { "@pmmmwh/react-refresh-webpack-plugin": "^0.4.3", diff --git a/apps/console/src/app.tsx b/apps/console/src/app.tsx index 681cd3af426..844f7e97895 100755 --- a/apps/console/src/app.tsx +++ b/apps/console/src/app.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2023-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -71,6 +71,7 @@ import { Redirect, Route, RouteComponentProps, Router, Switch } from "react-rout import { Dispatch } from "redux"; import "moment/locale/si"; import "moment/locale/fr"; +import { getServiceResourceEndpoints } from "./configs/endpoints"; import { getBaseRoutes } from "./configs/routes"; import DecoratedApp from "./decorated-app"; import "./app.scss"; @@ -129,9 +130,9 @@ export const App: FunctionComponent> = (): ReactElement => * Set the deployment configs in redux state. */ useEffect(() => { - dispatch(setServiceResourceEndpoints(Config.getServiceResourceEndpoints())); + dispatch(setServiceResourceEndpoints(getServiceResourceEndpoints())); dispatch(setI18nConfigs(Config.getI18nConfig())); - setResourceEndpoints(Config.getServiceResourceEndpoints() as any); + setResourceEndpoints(getServiceResourceEndpoints() as any); }, [ AppConstants.getTenantQualifiedAppBasename() ]); /** diff --git a/apps/console/src/configs/endpoints.tsx b/apps/console/src/configs/endpoints.tsx new file mode 100644 index 00000000000..d2e20cbc80a --- /dev/null +++ b/apps/console/src/configs/endpoints.tsx @@ -0,0 +1,182 @@ +/** + * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { getActionsResourceEndpoints } from "@wso2is/admin.actions.v1/configs/endpoints"; +import { getAdministratorsResourceEndpoints } from "@wso2is/admin.administrators.v1/config/endpoints"; +import { getAPIResourceEndpoints } from "@wso2is/admin.api-resources.v2/configs/endpoint"; +import { getApplicationTemplatesResourcesEndpoints } from "@wso2is/admin.application-templates.v1/configs/endpoints"; +import { getApplicationsResourceEndpoints } from "@wso2is/admin.applications.v1/configs/endpoints"; +import { getBrandingResourceEndpoints } from "@wso2is/admin.branding.v1/configs/endpoints"; +import { getCertificatesResourceEndpoints } from "@wso2is/admin.certificates.v1/configs/endpoints"; +import { getClaimResourceEndpoints } from "@wso2is/admin.claims.v1/configs/endpoints"; +import { getConnectionResourceEndpoints } from "@wso2is/admin.connections.v1/configs/endpoints"; +import { DeploymentConfigInterface, ServiceResourceEndpointsInterface } from "@wso2is/admin.core.v1/models/config"; +import { store } from "@wso2is/admin.core.v1/store"; +import { getEmailTemplatesResourceEndpoints } from "@wso2is/admin.email-templates.v1/configs/endpoints"; +import { getExtendedFeatureResourceEndpoints } from "@wso2is/admin.extensions.v1/configs/endpoints"; +import { getFeatureGateResourceEndpoints } from "@wso2is/admin.feature-gate.v1/configs/endpoints"; +import { getGroupsResourceEndpoints } from "@wso2is/admin.groups.v1/configs/endpoints"; +import { getIDVPResourceEndpoints } from "@wso2is/admin.identity-verification-providers.v1/configs/endpoints"; +import { getRemoteLoggingEndpoints } from "@wso2is/admin.logs.v1/configs/endpoints"; +import { getScopesResourceEndpoints } from "@wso2is/admin.oidc-scopes.v1/configs/endpoints"; +import { getInsightsResourceEndpoints } from "@wso2is/admin.org-insights.v1/config/org-insights"; +import { getOrganizationsResourceEndpoints } from "@wso2is/admin.organizations.v1/configs/endpoints"; +import { OrganizationUtils } from "@wso2is/admin.organizations.v1/utils/organization"; +import { getPolicyAdministrationResourceEndpoints } from "@wso2is/admin.policy-administration.v1/configs/endpoints"; +import { + getPushProviderResourceEndpoints, + getPushProviderTemplateEndpoints +} from "@wso2is/admin.push-providers.v1/configs/endpoints"; +import { + getRegistrationFlowBuilderResourceEndpoints +} from "@wso2is/admin.registration-flow-builder.v1/config/endpoints"; +import { + getRemoteFetchConfigResourceEndpoints +} from "@wso2is/admin.remote-repository-configuration.v1/configs/endpoints"; +import { getRolesResourceEndpoints } from "@wso2is/admin.roles.v2/configs/endpoints"; +import { getRulesEndpoints } from "@wso2is/admin.rules.v1/configs/endpoints"; +import { getSecretsManagementEndpoints } from "@wso2is/admin.secrets.v1/configs/endpoints"; +import { getServerConfigurationsResourceEndpoints } from "@wso2is/admin.server-configurations.v1/configs/endpoints"; +import { getSmsTemplateResourceEndpoints } from "@wso2is/admin.sms-templates.v1/configs/endpoints"; +import { getExtensionTemplatesEndpoints } from "@wso2is/admin.template-core.v1/configs/endpoints"; +import { getTenantResourceEndpoints } from "@wso2is/admin.tenants.v1/configs/endpoints"; +import { getUsersResourceEndpoints } from "@wso2is/admin.users.v1/configs/endpoints"; +import { getUserstoreResourceEndpoints } from "@wso2is/admin.userstores.v1/configs/endpoints"; +import { getValidationServiceEndpoints } from "@wso2is/admin.validation.v1/configs/endpoints"; +import { getApprovalsResourceEndpoints } from "@wso2is/admin.workflow-approvals.v1/configs/endpoints"; + +// TODO: Revisit and clean the util functions. + +/** + * Get the deployment config. + * + * @returns Deployment config object. + */ +const getDeploymentConfig = (): DeploymentConfigInterface => { + return { + __experimental__platformIdP: window[ "AppUtils" ]?.getConfig()?.__experimental__platformIdP, + accountApp: window[ "AppUtils" ]?.getConfig()?.accountApp, + adminApp: window[ "AppUtils" ]?.getConfig()?.adminApp, + allowMultipleAppProtocols: window[ "AppUtils" ]?.getConfig()?.allowMultipleAppProtocols, + appBaseName: window[ "AppUtils" ]?.getConfig()?.appBaseWithTenant, + appBaseNameWithoutTenant: window[ "AppUtils" ]?.getConfig()?.appBase, + appHomePath: window[ "AppUtils" ]?.getConfig()?.routes?.home, + appLoginPath: window[ "AppUtils" ]?.getConfig()?.routes?.login, + appLogoutPath: window[ "AppUtils" ]?.getConfig()?.routes?.logout, + centralDeploymentEnabled: window[ "AppUtils" ]?.getConfig()?.centralDeploymentEnabled, + clientHost: window[ "AppUtils" ]?.getConfig()?.clientOriginWithTenant, + clientID: window[ "AppUtils" ]?.getConfig()?.clientID, + clientOrigin: window[ "AppUtils" ]?.getConfig()?.clientOrigin, + clientOriginWithTenant: window[ "AppUtils" ]?.getConfig()?.clientOriginWithTenant, + customServerHost: window[ "AppUtils" ]?.getConfig()?.customServerHost, + developerApp: window[ "AppUtils" ]?.getConfig()?.developerApp, + docSiteURL: window[ "AppUtils" ]?.getConfig()?.docSiteUrl, + extensions: window[ "AppUtils" ]?.getConfig()?.extensions, + idpConfigs: window[ "AppUtils" ]?.getConfig()?.idpConfigs, + loginCallbackUrl: window[ "AppUtils" ]?.getConfig()?.loginCallbackURL, + organizationPrefix: window["AppUtils"]?.getConfig()?.organizationPrefix, + serverHost: window[ "AppUtils" ]?.getConfig()?.serverOriginWithTenant, + serverOrigin: window[ "AppUtils" ]?.getConfig()?.serverOrigin, + superTenant: window[ "AppUtils" ]?.getConfig()?.superTenant, + tenant: window[ "AppUtils" ]?.getConfig()?.tenant, + tenantPath: window[ "AppUtils" ]?.getConfig()?.tenantPath, + tenantPrefix: window[ "AppUtils" ]?.getConfig()?.tenantPrefix + }; +}; + +/** + * This method adds organization path to the server host if an organization is selected. + * + * @returns Server host. + */ +const resolveServerHost = (skipAuthzRuntimePath?: boolean): string => { + const serverOriginWithTenant: string = window["AppUtils"]?.getConfig()?.serverOriginWithTenant; + + if (skipAuthzRuntimePath && serverOriginWithTenant?.slice(-2) === "/o") { + return serverOriginWithTenant.substring(0, serverOriginWithTenant.lastIndexOf("/o")); + } + + return window["AppUtils"]?.getConfig()?.serverOriginWithTenant; +}; + +/** + * This method adds organization path (t/org_uuid) to the server host if a sub-org is selected. + * + * @returns Server host. + */ +const resolveServerHostforFG = (): string => { + if ((OrganizationUtils.isSuperOrganization(store.getState().organization.organization) + || store.getState().organization.isFirstLevelOrganization)) { + return window[ "AppUtils" ]?.getConfig()?.serverOriginWithTenant; + } else { + return `${ + window[ "AppUtils" ]?.getConfig()?.serverOrigin }/t/${ store.getState().organization.organization.id + }`; + } +}; + +/** + * Get the the list of service resource endpoints. + * + * @returns Service resource endpoints as an object. + */ +export const getServiceResourceEndpoints = (): ServiceResourceEndpointsInterface => { + const serviceResourceEndpoints: ServiceResourceEndpointsInterface = { + ...getAPIResourceEndpoints(resolveServerHost()), + ...getAdministratorsResourceEndpoints(resolveServerHost()), + ...getApplicationsResourceEndpoints(resolveServerHost()), + ...getApprovalsResourceEndpoints(getDeploymentConfig()?.serverHost), + ...getBrandingResourceEndpoints(resolveServerHost()), + ...getClaimResourceEndpoints(getDeploymentConfig()?.serverHost, resolveServerHost()), + ...getCertificatesResourceEndpoints(getDeploymentConfig()?.serverHost), + ...getIDVPResourceEndpoints(resolveServerHost()), + ...getEmailTemplatesResourceEndpoints(resolveServerHost()), + ...getConnectionResourceEndpoints(resolveServerHost()), + ...getRolesResourceEndpoints(resolveServerHost(), getDeploymentConfig().serverHost), + ...getServerConfigurationsResourceEndpoints(resolveServerHost()), + ...getUsersResourceEndpoints(resolveServerHost()), + ...getUserstoreResourceEndpoints(resolveServerHost()), + ...getScopesResourceEndpoints(getDeploymentConfig()?.serverHost), + ...getGroupsResourceEndpoints(resolveServerHost()), + ...getValidationServiceEndpoints(resolveServerHost()), + ...getRemoteFetchConfigResourceEndpoints(getDeploymentConfig()?.serverHost), + ...getSecretsManagementEndpoints(getDeploymentConfig()?.serverHost), + ...getExtendedFeatureResourceEndpoints(resolveServerHost(), getDeploymentConfig()), + ...getOrganizationsResourceEndpoints(resolveServerHost(), getDeploymentConfig().serverHost), + ...getTenantResourceEndpoints(getDeploymentConfig().serverOrigin), + ...getFeatureGateResourceEndpoints(resolveServerHostforFG()), + ...getInsightsResourceEndpoints(getDeploymentConfig()?.serverHost), + ...getExtensionTemplatesEndpoints(resolveServerHost()), + ...getApplicationTemplatesResourcesEndpoints(resolveServerHost()), + ...getActionsResourceEndpoints(resolveServerHost()), + ...getRulesEndpoints(resolveServerHost()), + ...getSmsTemplateResourceEndpoints(resolveServerHost()), + ...getPolicyAdministrationResourceEndpoints(resolveServerHost()), + ...getPushProviderResourceEndpoints(resolveServerHost()), + ...getPushProviderTemplateEndpoints(resolveServerHost()), + ...getRemoteLoggingEndpoints(resolveServerHost()), + ...getRegistrationFlowBuilderResourceEndpoints(resolveServerHost()), + CORSOrigins: `${getDeploymentConfig()?.serverHost}/api/server/v1/cors/origins`, + // TODO: Remove this endpoint and use ID token to get the details + me: `${getDeploymentConfig()?.serverHost}/scim2/Me`, + saml2Meta: `${resolveServerHost(true)}/identity/metadata/saml2`, + wellKnown: `${resolveServerHost(true)}/oauth2/token/.well-known/openid-configuration` + }; + + return serviceResourceEndpoints; +}; diff --git a/features/admin.authentication.v1/hooks/use-sign-in.ts b/features/admin.authentication.v1/hooks/use-sign-in.ts index b139875c348..82e64b3aaf6 100644 --- a/features/admin.authentication.v1/hooks/use-sign-in.ts +++ b/features/admin.authentication.v1/hooks/use-sign-in.ts @@ -557,7 +557,6 @@ const useSignIn = (): UseSignInInterface => { await dispatch( getProfileInformation( - Config.getServiceResourceEndpoints().me, window["AppUtils"].getConfig().clientOriginWithTenant, true ) diff --git a/features/admin.authentication.v1/store/actions/authenticate.ts b/features/admin.authentication.v1/store/actions/authenticate.ts index 2c1a793d540..4ba18050a61 100644 --- a/features/admin.authentication.v1/store/actions/authenticate.ts +++ b/features/admin.authentication.v1/store/actions/authenticate.ts @@ -17,7 +17,6 @@ */ import { AsgardeoSPAClient, DecodedIDTokenPayload } from "@asgardeo/auth-react"; -import { Config } from "@wso2is/admin.core.v1/configs/app"; import { store } from "@wso2is/admin.core.v1/store"; import { getProfileInfo, getProfileSchemas } from "@wso2is/admin.users.v1/api"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; @@ -42,11 +41,12 @@ import { Dispatch } from "redux"; * Gets profile information by making an API call */ export const getProfileInformation = ( - meEndpoint: string = Config.getServiceResourceEndpoints().me, clientOrigin: string = window["AppUtils"].getConfig().clientOriginWithTenant, fetchProfileSchema: boolean = false ) => (dispatch: Dispatch): void => { + const meEndpoint: string = store.getState().config.endpoints.me; + dispatch(setProfileInfoRequestLoadingStatus(true)); const isSubOrg: boolean = window[ "AppUtils" ].getConfig().organizationName; diff --git a/features/admin.core.v1/configs/app.ts b/features/admin.core.v1/configs/app.ts index c409b4d8d05..79b70b37b64 100644 --- a/features/admin.core.v1/configs/app.ts +++ b/features/admin.core.v1/configs/app.ts @@ -259,7 +259,7 @@ export class Config { * @returns Service resource endpoints as an object. */ public static getServiceResourceEndpoints(): ServiceResourceEndpointsInterface { - return { + const serviceResourceEndpoints: ServiceResourceEndpointsInterface = { ...getAPIResourceEndpoints(this.resolveServerHost()), ...getAdministratorsResourceEndpoints(this.resolveServerHost()), ...getApplicationsResourceEndpoints(this.resolveServerHost()), @@ -300,6 +300,8 @@ export class Config { saml2Meta: `${ this.resolveServerHost(false, true) }/identity/metadata/saml2`, wellKnown: `${ this.resolveServerHost(false, true) }/oauth2/token/.well-known/openid-configuration` }; + + return serviceResourceEndpoints; } /** diff --git a/features/admin.impersonation.v1/api/impersonation-configuration.ts b/features/admin.impersonation.v1/api/impersonation-configuration.ts index 0eaba9e2fd4..55fedfba8e3 100644 --- a/features/admin.impersonation.v1/api/impersonation-configuration.ts +++ b/features/admin.impersonation.v1/api/impersonation-configuration.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2024-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -17,19 +17,19 @@ */ import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react"; -import { Config } from "@wso2is/admin.core.v1/configs/app"; import useRequest, { RequestConfigInterface, RequestErrorInterface, RequestResultInterface } from "@wso2is/admin.core.v1/hooks/use-request"; +import { store } from "@wso2is/admin.core.v1/store"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { HttpMethods } from "@wso2is/core/models"; import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; import { ImpersonationConfigConstants } from "../constants/impersonation-configuration"; import { ImpersonationConfigAPIResponseInterface, - ImpersonationConfigPatchInterface + ImpersonationConfigPatchInterface } from "../models/impersonation-configuration"; const httpClient: HttpClientInstance = AsgardeoSPAClient.getInstance() @@ -49,7 +49,7 @@ export const useImpersonationConfig = < "Content-Type": "application/json" }, method: HttpMethods.GET, - url: Config.getServiceResourceEndpoints().impersonationConfigurations + url: store.getState().config.endpoints.impersonationConfigurations }; const { data, error, isValidating, mutate } = useRequest(requestConfig); @@ -78,7 +78,7 @@ export const updateImpersonationConfigurations = (data: ImpersonationConfigPatch "Content-Type": "application/json" }, method: HttpMethods.PATCH, - url: Config.getServiceResourceEndpoints().impersonationConfigurations + url: store.getState().config.endpoints.impersonationConfigurations }; return httpClient(requestConfig) diff --git a/features/admin.saml2-configuration.v1/api/saml2-configuration.ts b/features/admin.saml2-configuration.v1/api/saml2-configuration.ts index 92ff75df11a..1e620465b65 100644 --- a/features/admin.saml2-configuration.v1/api/saml2-configuration.ts +++ b/features/admin.saml2-configuration.v1/api/saml2-configuration.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2023-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -17,12 +17,12 @@ */ import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react"; -import { Config } from "@wso2is/admin.core.v1/configs/app"; import useRequest, { RequestConfigInterface, RequestErrorInterface, RequestResultInterface } from "@wso2is/admin.core.v1/hooks/use-request"; +import { store } from "@wso2is/admin.core.v1/store"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { HttpMethods } from "@wso2is/core/models"; import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; @@ -47,7 +47,7 @@ export const useSaml2Config = < "Content-Type": "application/json" }, method: HttpMethods.GET, - url: Config.getServiceResourceEndpoints().saml2Configurations + url: store.getState().config.endpoints.saml2Configurations }; const { data, error, isValidating, mutate } = useRequest(requestConfig); @@ -77,7 +77,7 @@ export const updateSaml2Configurations = (data: Saml2ConfigAPIResponseInterface) "Content-Type": "application/json" }, method: HttpMethods.PATCH, - url: Config.getServiceResourceEndpoints().saml2Configurations + url: store.getState().config.endpoints.saml2Configurations }; return httpClient(requestConfig) diff --git a/features/admin.session-management.v1/api/session-management.ts b/features/admin.session-management.v1/api/session-management.ts index a831f8352f2..969195e99e5 100644 --- a/features/admin.session-management.v1/api/session-management.ts +++ b/features/admin.session-management.v1/api/session-management.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2023-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -17,12 +17,12 @@ */ import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react"; -import { Config } from "@wso2is/admin.core.v1/configs/app"; import useRequest, { RequestConfigInterface, RequestErrorInterface, RequestResultInterface } from "@wso2is/admin.core.v1/hooks/use-request"; +import { store } from "@wso2is/admin.core.v1/store"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { HttpMethods } from "@wso2is/core/models"; import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; @@ -48,7 +48,7 @@ export const useSessionManagementConfig = < "Content-Type": "application/json" }, method: HttpMethods.GET, - url: Config.getServiceResourceEndpoints().serverConfigurations + url: store.getState().config.endpoints.serverConfigurations }; const { data, error, isValidating, mutate } = useRequest(requestConfig); @@ -78,7 +78,7 @@ export const updateSessionManagmentConfigurations = (data: PatchData[]): "Content-Type": "application/json" }, method: HttpMethods.PATCH, - url: Config.getServiceResourceEndpoints().serverConfigurations + url: store.getState().config.endpoints.serverConfigurations }; return httpClient(requestConfig) diff --git a/features/admin.users.v1/api/profile.ts b/features/admin.users.v1/api/profile.ts index 274041d61f6..2fb8d6f2bf7 100644 --- a/features/admin.users.v1/api/profile.ts +++ b/features/admin.users.v1/api/profile.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2022-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -17,7 +17,6 @@ */ import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react"; -import { Config } from "@wso2is/admin.core.v1/configs/app"; import { RequestConfigInterface } from "@wso2is/admin.core.v1/hooks/use-request"; import { store } from "@wso2is/admin.core.v1/store"; import { ProfileConstants } from "@wso2is/core/constants"; @@ -191,7 +190,7 @@ export const getProfileSchemas = (): Promise => { "Accept": "application/json" }, method: HttpMethods.GET, - url: Config.getServiceResourceEndpoints().schemas + url: store.getState().config.endpoints.schemas }; const schemaAttributes: ProfileSchemaInterface[] = []; diff --git a/features/admin.wsfed-configuration.v1/api/wsfed-configuration.ts b/features/admin.wsfed-configuration.v1/api/wsfed-configuration.ts index fcaf4138574..5674d266517 100644 --- a/features/admin.wsfed-configuration.v1/api/wsfed-configuration.ts +++ b/features/admin.wsfed-configuration.v1/api/wsfed-configuration.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2023-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -17,12 +17,12 @@ */ import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react"; -import { Config } from "@wso2is/admin.core.v1/configs/app"; import useRequest, { RequestConfigInterface, RequestErrorInterface, RequestResultInterface } from "@wso2is/admin.core.v1/hooks/use-request"; +import { store } from "@wso2is/admin.core.v1/store"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { HttpMethods } from "@wso2is/core/models"; import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; @@ -49,7 +49,7 @@ export const useWSFederationConfig = < "Content-Type": "application/json" }, method: HttpMethods.GET, - url: Config.getServiceResourceEndpoints().passiveStsConfigurations + url: store.getState().config.endpoints.passiveStsConfigurations }; const { data, error, isValidating, mutate } = useRequest(requestConfig); @@ -79,7 +79,7 @@ export const updateWSFederationConfigurations = (data: WSFederationConfigAPIResp "Content-Type": "application/json" }, method: HttpMethods.PATCH, - url: Config.getServiceResourceEndpoints().passiveStsConfigurations + url: store.getState().config.endpoints.passiveStsConfigurations }; return httpClient(requestConfig) diff --git a/modules/unit-testing/__mocks__/server/handlers.ts b/modules/unit-testing/__mocks__/server/handlers.ts index 1d8be826dd6..1f0188cb5af 100644 --- a/modules/unit-testing/__mocks__/server/handlers.ts +++ b/modules/unit-testing/__mocks__/server/handlers.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022-2024, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2022-2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -16,9 +16,9 @@ * under the License. */ -import { Config } from "@wso2is/admin.core.v1/configs/app"; import { handlers as extendedHandlers } from "@wso2is/admin.extensions.v1/test-configs/__mocks__/server/handlers"; import { ResponseComposition, RestContext, RestHandler, RestRequest, rest } from "msw"; +import ReduxStoreStateMock from "../redux/redux-store-state"; /** * MSW Request Handlers. @@ -26,7 +26,7 @@ import { ResponseComposition, RestContext, RestHandler, RestRequest, rest } from */ export const handlers: RestHandler[] = [ - rest.get(Config.getServiceResourceEndpoints().users, ( + rest.get(ReduxStoreStateMock.config.endpoints.users, ( req: RestRequest, res: ResponseComposition, ctx: RestContext) => { @@ -35,7 +35,7 @@ export const handlers: RestHandler[] = [ ctx.status(200) ); }), - rest.get(Config.getServiceResourceEndpoints().applications, ( + rest.get(ReduxStoreStateMock.config.endpoints.applications, ( req: RestRequest, res: ResponseComposition, ctx: RestContext) => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9fd33ecf0c7..1d29356e4c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -548,6 +548,9 @@ importers: '@wso2is/admin.email-providers.v1': specifier: ^2.25.203 version: link:../../features/admin.email-providers.v1 + '@wso2is/admin.email-templates.v1': + specifier: ^2.25.203 + version: link:../../features/admin.email-templates.v1 '@wso2is/admin.extensions.v1': specifier: ^2.37.3 version: link:../../features/admin.extensions.v1 @@ -590,6 +593,9 @@ importers: '@wso2is/admin.push-providers.v1': specifier: ^1.0.92 version: link:../../features/admin.push-providers.v1 + '@wso2is/admin.registration-flow-builder.v1': + specifier: ^0.5.6 + version: link:../../features/admin.registration-flow-builder.v1 '@wso2is/admin.remote-repository-configuration.v1': specifier: ^2.25.203 version: link:../../features/admin.remote-repository-configuration.v1 @@ -602,6 +608,9 @@ importers: '@wso2is/admin.roles.v2': specifier: ^2.27.149 version: link:../../features/admin.roles.v2 + '@wso2is/admin.rules.v1': + specifier: ^0.4.19 + version: link:../../features/admin.rules.v1 '@wso2is/admin.saml2-configuration.v1': specifier: ^2.25.204 version: link:../../features/admin.saml2-configuration.v1 @@ -41779,8 +41788,6 @@ packages: peerDependenciesMeta: webpack: optional: true - webpack-sources: - optional: true dependencies: webpack: 5.84.1(@swc/core@1.3.99)(esbuild@0.18.20)(webpack-cli@4.10.0) webpack-sources: 3.2.3