) => void;
/**
* Access for a runtime environment to set some flags to override some
* default behaviors. Note that this action replaces
* any previous overrides. To add to the existing overrides, use
* setBehaviorOverride
* @param overridesObj The JSON object containing any behavior override flags
* Supported override flag:
* dynamicLoadComponents - when false, do not attempt to load components dynamically
* @example PCore.setBehaviorOverrides( { "dynamicLoadComponents": false } );
* @function
*/
setBehaviorOverrides: (overridesObj: {
[key: string]: boolean;
}) => void;
/**
* Access for a runtime environment to set/update a flag to override some
* default behaviors. Note that this action adds or updates
* the override key value. Other keys/values are left intact.
* To replace the existing overrides, use
* setBehaviorOverrides
* @param overrideKey The key value for the behavior override flag. (Ex: "dynamicLoadComponents")
* @param overrideValue the desired value of the override. (Ex: true, false)
* Supported override flags:
* dynamicLoadComponents - when false, do not attempt to load components dynamically
* dynamicSemanticUrl - when false, do not attempt to update the app's semantic URL dynamically
* dynamicSetCookie - when false, do not attempt to set the app's C11n cookie dynamically
*
* @example PCore.setBehaviorOverride("dynamicLoadComponents", true);
* @function
*/
setBehaviorOverride: (overrideKey: string, overrideValue: boolean) => void;
/**
* Returns the current JSON object of behavior overrides.
* @example PCore.getBehaviorOverrides() could return { "dynamicLoadComponents": false }
* @returns The current JSON object of behavior overrides.
* @function
*/
getBehaviorOverrides: () => {
[key: string]: boolean;
};
/**
* Returns the current value of the requested behavior override flag.
* If the requested flag has not been sent, this returns undefined.
* @param theOverride The requested override flag. Ex: dynamicLoadComponents
* @example PCore.getBehaviorOverride("dynamicLoadComponents") could return false
* @function
*/
getBehaviorOverride: (theOverride: string) => boolean;
/**
* This API obtains an entry point to the AsynchronousUtils object that contains utility APIs that perform asynchronous operations using Observable patterns.
* To view the APIs in the AsynchronousUtils class, see {@link AsynchronousUtils} Class.
* @example In this example, the API returns the AsynchronousUtils object.
* const asyncUtils = PCore.getAsynchronousUtils();
* @function
*/
getAsynchronousUtils: () => {
getDebouncedSubject(delay: number): import("rxjs").Observable;
};
/**
* Creates a PConnect object from the input configuration of a component.
* The PConnect object represents a newly created component context for the given input configuration and has access to all public PConnect APIs.
*
* Use the createPConnect(config) API if you need to explicitly create a PConnect object for a component.
*
* For example, in a table, each column has its own type and configuration. To render the cells in the table, you can use the createPConnect(config) API to create
* a PConnect object by passing the config object that contains the details of the cells along with the context and pageReference of the parent component.
*
* The configuration object passed to this API should include:
* - meta.type: Denotes the type of the component. In the example, the type is "DropDown". This is a required property
* - options.context: The name of the context under which the component is rendered. context must be passed if the component has to render on a context that is different from the parent component's context.
* - options.pageReference: The data reference path of the store where the data value is stored for the current component. pageReference must be passed if the component has to render on a page reference that is different from the parent component's page reference.
*
* These three properties are of type string.
*
* @example Example usage of createPConnect
* Example:
* const config = {
* "meta": {
* "type": "DropDown",
* "config": {
* label: "@L Type"
* }
* },
* "options": {
* context: "contextName",
* pageReference: "pageRef"
* }
* }
*
* const dropDownPConn = createPConnect(config);
* In this example, the API creates a PConnect object for a dropdown component based on the input configuration of the config object.
*
* @param config payload to create a PConnect Object
* @returns A PConnect object created from the configuration object.
* @function
*/
createPConnect: (config: {
meta?: {
type: string;
config?: Record;
};
options?: {
context?: string;
pageReference?: string;
referenceList?: string;
hasForm?: boolean;
contextName?: string;
};
}) => import("./interpreter/types").CreateC11nEnv;
/**
* This API provides an entry point to the PubSubUtils object that is used to access the
* utility APIs in the Constellation Core that publish and subscribe events
* This exposes the Event PubSub UtilsAPIs like
*
*
* @example Example for getPubSubUtils()
* Example usage - PCore.getPubSubUtils();
* // returns the PubSubUtils object containing the utility APIs that publish and subscribe events
* @function
*/
getPubSubUtils: () => typeof PubSubUtils;
/**
* Call registerComponentCreator with component creator function, such that it will be registered and receives the C11nEnv object.
*
* @param creator function which is called to register a component creator.
* This function will receive the C11nEnv as first argument
* and if there are any additionalProps object as second argument.
*
* @example Example for registerComponentCreator()
* Example Usage:
* PCore.registerComponentCreator((c11nEnv, additionalProps = {}) => {
* return React.createElement(PConnectHOC(), {
* ...c11nEnv,
* ...c11nEnv.getPConnect().getConfigProps(),
* ...c11nEnv.getPConnect().getActions(),
* ...{ additionalProps }
* });
*
* All the components, which render will be using this registered component create function to create the component instance
* Note: Here the usage shows React.createElement which indicates, the components are created using React.
* @function
*/
registerComponentCreator: (creator: Function) => void;
/**
* Call getConstants function to get the public constants
* which are supposed to be used at appropriate places.
*
* @example Example for getConstants()
* Example Usage:
* const constants = PCore.getConstants();
*
* constants will have un-modifiable constants object which you can use at places Infra expects.
* for example: you have to use constants.MESSAGES.MESSAGES_TYPE_ERROR if you want to add or delete error messages in the application state.
*
* @function
*/
getConstants: () => Readonly<{
APP: {
APP: string;
ROOT: string;
INFINITY_RUNTIME: string;
PXREQUESTOR: string;
PXUSERNAME: string;
OPERATORID: string;
USERNAME: string;
PXUSERIDENTIFIER: string;
USERIDENTIFIER: string;
PYIMAGEINSKEY: string;
OPERATORID_IMG_INSKEY: string;
OPERATORID_LOCALE: string;
APPLICATION_LABEL: string;
APPLICATION_RULE_NAME: string;
};
RESOURCE_TYPES: {
ASSIGNMENT: string;
CASE: string;
DATA: string;
PAGE: string;
OBJECT: string;
};
RESOURCE_STATUS: {
CREATE: string;
UPDATE: string;
OPEN_FLOW_ACTION: string;
};
VIEW_NAMES: {
PY_CASE_TAB: string;
DATA_OBJECT_CREATE_VIEW: string;
DATA_OBJECT_EDIT_VIEW: string;
PY_DATA_PREVIEW: string;
PY_DETAILS: string;
OBJECT_CREATE_VIEW: string;
SUBSCRIPT_CREATE_VIEW: string;
};
CONTAINERS: {
ROOT_CONTAINER: string;
VIEW_CONTAINER: string;
FLOW_CONTAINER: string;
MODAL_VIEW_CONTAINER: string;
PREVIEW_VIEW_CONTAINER: string;
HYBRID_VIEW_CONTAINER: string;
};
WORK_BASKET: {
MY_WORK_LIST: string;
REPORTEE: string;
WORK_QUEUE: string;
DATA_PAGES: {
D__PY_GET_USER_WORK_LIST_BY_USER_ID: string;
D__WORK_BASKET: string;
D__PY_MY_WORK_LIST: string;
};
};
CONTEXT_TREE_NODE_TYPES: {
VIEW: string;
FIELD: string;
DECLARATIVE_TARGET: string;
WHEN: string;
CONTEXT: string;
PAGELIST: string;
};
WORKLIST: string;
WAIT: string;
TODO: string;
STANDARD_FLOW: string;
CASE: string;
ASSIGNMENT: string;
FIX_BROKEN_ASSIGNMENTS: string;
PAGE: string;
PZINSKEY: string;
CREATE_DETAILS_VIEW_NAME: string;
PREVIEW_VIEW_NAME: string;
CASESUMMARY_VIEW_NAME: string;
APPSHELL_ACTIVE_CASES: string;
TRACE_ID: string;
LOAD_VIEW_STRING: string;
PRIMARY: string;
DEFER_UPDATE_CASESUMMARY_VIEW: string;
NEXT_ASSIGNMENT_INFO_ID: string;
WORKCLASS: string;
DATA_INFO: {
DATA_INFO: string;
DATA_INFO_CONTENT: string;
DATA_INFO_CONTEXT_KEY: string;
};
OBJECT_INFO: {
OBJECT_INFO: string;
OBJECT_INFO_ID: string;
OBJECT_INFO_CONTENT: string;
ACTIVE_ACTION_ID: string;
OBJECT_INFO_CONTENT_CLASS_ID: string;
};
CASE_INFO: {
CASE_INFO: string;
CASE_INFO_COLLABORATORS: string;
CASE_INFO_CONTENT: string;
CASE_INFO_ENCRYPTED_CONTENT: string;
CASE_INFO_NAME: string;
CASE_INFO_ID: string;
CASE_INFO_CLASSID: string;
CASE_INFO_CLASSNAME: string;
CASE_TYPE_ID: string;
CASE_TYPE_NAME: string;
CASE_INFO_PZINSKEY: string;
CASE_INFO_ACTIONS: string;
VIEW_NAME: string;
ACTION_BUTTONS: string;
ACTIVE_ACTION_ID: string;
ASSIGNMENT_LABEL: string;
ASSIGNMENT_ID: string;
ASSIGNMENTS: string;
INSTRUCTIONS: string;
NAVIGATION: string;
STAGES: string;
STAGEID: string;
CASECLASS: string;
AVAILABLEACTIONS: string;
AVAILABLEPROCESSES: string;
D_CASE_ASSIGNMENTS_RESULTS: string;
CHILD_ASSIGNMENTS: string;
ASSIGNMENTACTION_ID: string;
ISINCREATESTAGE: string;
APPROVALFLAG: string;
DUPLICATECASEFLAG: string;
DUPLICATECASEID: string;
DUPLICATECASEINSKEY: string;
HEADERS: string;
PARENTCASEINFO: string;
REMOTESYSTEMID: string;
CASE_RELATED_CASE_TYPES: string;
CASES: string;
IS_ASSIGNMENT: string;
GETNEXTWORK: string;
ACTION_REFRESH_CONDITIONS: string;
IS_LOCAL_ACTION: string;
BUSINESS_ID: string;
IS_FIRST_ASSIGNMENT: string;
CASE_INFO_ATTACHMENTS: string;
};
ACTIONS: {
ACTION_ID: string;
ACTIONS: string;
DELETEAVIALACTIONS: string;
FLOWACTION: string;
DATA_PAGES: {
D_PY_ADDITIONAL_CASE_ACTIONS: string;
};
};
PROCESS: {
FLOWPROBLEMS: string;
};
PAGE_TYPES: {
PAGE: string;
LANDINGPAGE: string;
LISTPAGE: string;
};
LOCAL_ACTION_TYPE: {
CASE_WIDE: string;
EXPRESS: string;
ASSIGNMENT: string;
LOCAL_ACTION: string;
};
LOCAL_ACTIONS: {
TRANSFER_ASSIGNMENT: string;
};
CONTENT: string;
MODAL: string;
ACTIONAREA: string;
STOPMERGEACTIONS: string;
IS_CREATE_DATA_OBJECT: string;
SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME: string;
SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME: string;
CONTEXT_DATA_ASSIGNMENTID: string;
BANNER_VARIANT_SUCCESS: string;
BANNER_VARIANT_WARNING: string;
BANNER_VARIANT_URGENT: string;
BANNER_VARIANT_INFO: string;
INVALID_INPUTS: string;
VALIDATION_FAIL: string;
MESSAGES: {
MESSAGES_TYPE_SUCCESS: string;
MESSAGES_TYPE_INFO: string;
MESSAGES_TYPE_ERROR: string;
};
PUB_SUB_EVENTS: {
EVENT_RENDER_APP: string;
EVENT_UNMOUNT_APP: string;
EVENT_REAUTH: string;
EVENT_FULL_REAUTH: string;
EVENT_CUSTOM_REAUTH: string;
EVENT_CANCEL: string;
EVENT_MINIMIZE: string;
EVENT_EXPRESS_LOCALACTION: string;
EVENT_BULKACTION: string;
EVENT_FINISH_ASSIGNMENT_DONE: string;
EVENT_SHOW_CANCEL_ALERT: string;
EVENT_SHOW_DELETE_ALERT: string;
EVENT_DASHBOARD_FILTER_CHANGE: string;
EVENT_DASHBOARD_FILTER_CLEAR_ALL: string;
EVENT_PROMOTED_FILTERS_CHANGE: string;
EVENT_LOCALACTION_SUBMISSION: string;
EVENT_LOGOFF: string;
EVENT_TRANSIENT_ITEMS: {
UPDATE_PROMOTED_FILTERS: string;
};
UI_EVENTS: {
INSPECTOR: string;
INSPECTOR_SHOW_ALL: string;
UI_DESIGNER: string;
UI_DESIGNER_TOOLBAR_EXPANDED: string;
SHOW_PAGE_INIT: string;
SHOW_PAGE_DONE: string;
SHOW_PAGE_STARTED: string;
THEME_CHANGE: string;
THEME_MODE_CHANGE: string;
NAV_ORIENTATION_CHANGE: string;
CASE_VIEW_TEMPLATE_CHANGE: string;
};
CASE_EVENTS: {
CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW: string;
CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW: string;
CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET: string;
CASE_CREATED: string;
CREATE_STAGE_DONE: string;
CREATE_STAGE_CANCELLED: string;
CREATE_STAGE_SAVED: string;
CREATE_STAGE_DELETED: string;
ASSIGNMENT_SUBMISSION: string;
END_OF_ASSIGNMENT_PROCESSING: string;
CLOSE_CONFIRM_VIEW: string;
CASE_OPENED: string;
CASE_VIEW_OPENED_AFTER_CREATE: string;
CASE_CLOSED: string;
ASSIGNMENT_OPENED: string;
CASE_PREVIEW: string;
CURRENT_ASSIGNMENT_UPDATED: string;
CASE_LOCK_EVENT: string;
GET_NEXT_WORK: string;
SAVE_ASSIGNMENT_COMPLETE: string;
CASE_LOAD: string;
CASE_UNLOAD: string;
CASE_EDIT_OPEN: string;
CASE_EDIT_CLOSE: string;
};
ASSIGNMENT_EVENTS: {
ASSIGNMENT_LOAD: string;
ASSIGNMENT_UNLOAD: string;
};
WORK_EVENTS: {
WORK_DELETED: string;
};
BOOTSTRAP_SHELL_EVENTS: {
CONSTELLATION_LOADED: string;
};
CONTAINER_EVENTS: {
CLOSE_CONTAINER_ITEM: string;
CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM: string;
};
DISPLAY_CASE_CREATED_TOASTER: string;
DISPLAY_CASE_SUBMITTED_TOASTER: string;
DATA_EVENTS: {
DATA_OBJECT_CREATED: string;
DATA_OBJECT_DELETED: string;
DATA_OBJECT_UPDATED: string;
};
FETCH_SUCCESS: string;
FETCH_FAILURE: string;
REVERSE_COEXISTENCE_EVENTS: {
HANDLE_DISCARD: string;
CHECK_IS_FORM_DIRTY: string;
};
TIMEOUT_REMINDER: string;
RESET_TIMER: string;
PEGA_EMBED_CUSTOM: string;
SUGGESTION_PROCESSED: string;
ERROR_ON_FINISH_ASSIGNMENT: string;
URL_NAVIGATION: string;
ON_REFRESH_START: string;
ON_REFRESH_COMPLETE: string;
EVENT_LOCALE_CHANGED: string;
};
ERROR_TYPE: {
CLIENT: string;
SERVER: string;
};
CONTAINER_TYPE: {
MULTIPLE: string;
SINGLE: string;
HYBRID: string;
};
REMOTE_SYSTEM_ID: string;
LIST_SELECTION_MODE: {
MULTI: string;
SINGLE: string;
MULTI_ON_HOVER: string;
};
SUBMISSION_FAILURE_TYPE: {
FORM_VALIDATION_ERROR: string;
};
USER_SETTINGS: {
UTILITY_PANEL_USER_STATE_PATH: string;
SUMMARY_PANEL_USER_STATE_PATH: string;
ASSIGNMENT_COLLAPSED_STATE_PATH: string;
CASE_VIEW_PATH: string;
PORTAL_AGENT_SPLIT_VIEW_PATH: string;
PORTAL_AGENT_WIDTH_PATH: string;
};
PROMISE_VALUE: {
RESOLVE: string;
REJECT: string;
};
APP_TYPE: {
UIKIT: string;
THEME_COSMOS: string;
};
PORTAL_TYPE: {
WSS: string;
};
VIEW_TYPE: {
PY_EMBEDASSIGNMENT: string;
PY_DETAILS: string;
};
ACTION: string;
CONTEXT_DATA_MODAL_VIEW: {
CONTEXT_DATA_MODAL_VIEW: string;
IS_MULTI_RECORD_DATA: string;
VIEW_NAME: string;
PARENT_CONTEXT: string;
INTERESTPAGE: string;
EDIT_TYPE: string;
ACTION_ID: string;
};
FEED: {
MESSAGE_VIEW_REFERENCE: string;
PARENT_MESSAGE_ID: string;
PX_RESULTS: string;
NAME: string;
POSTED_BY_USER: string;
UPDATED_TIME: string;
POST_MESSAGE: string;
PZ_INS_KEY: string;
PZ_PRIVATE_POST_DETAILS: string;
PY_SELECTED: string;
PY_LABEL: string;
PY_RECIPIENTS: string;
MENTIONS: string;
PY_IS_DELETE_ENABLED: string;
TAGS: string;
PZ_POST_DETAILS: string;
PY_FEED_SOURCE_REFERENCE: string;
IS_EDITED: string;
PY_LIKES: string;
PY_POST_TYPE: string;
POSTED_TIME: string;
PY_MESSAGE_VIEW_REFERENCE: string;
ID: string;
PY_COMMENT_CONTEXT: string;
PX_LIKE_COUNT: string;
MESSAGE: string;
};
CASE_VIEW_MODE: {
PERFORM: string;
REVIEW: string;
CONFIRM: string;
};
}>;
/**
* Call getResolvedConstantValue function to get the resolved constant value for objects.
*
* @example Example for getResolvedConstantValue()
* Example Usage:
* const property = PCore.getResolvedConstantValue('property');
*
* @function
*/
getResolvedConstantValue: (key: string) => string;
/**
* Call getEvents function to get all the case related events
* which are supposed to be used to subscribe using getPubSubUtils.
* This exposes Events like:
*
*
* @example Example for getEvents()
* Example Usage:
* const CaseEvent = PCore.getEvents().getCaseEvent();
*
* @function
*/
getEvents: () => typeof Events;
/**
* This API provides an entry point to the {@link module:RestClient|REST Client} API object.
* This exposes APIs that include:
*
* - invokeRestApi
* - getCancelTokenSource
* - isRequestCanceled
*
*
* @example Example for invokeRestApi api
* const { invokeRestApi } = PCore.getRestClient();
* const cancelTokenSource = getCancelTokenSource();
* invokeRestApi('getFeedMessages', {
* queryPayload: {
* filterForContext: 'DATA-PORTAL $SpaceTra',
* filterByContext: 'context'
* },
* body: {},
* headers: {},
* // passing cancel token so that we can cancel the request using cancelTokenSource
* cancelTokenSource: cancelTokenSource.token
* })
* .then(() => {
* // handle the response
* })
* .catch((error) => {
* // handle error
* if(isRequestCanceled(error)) {
* // handle the canceled request using cancelTokenSource.cancel();
* }
* });
* // above example shows how to use invokeRestApi api to make REST API call to get Feed messages.
*
* @example Example for getCancelTokenSource api
* const { getCancelTokenSource } = PCore.getRestClient();
* const cancelTokenSource = getCancelTokenSource();
* // cancel the ongoing request using the cancelTokenSource
* cancelTokenSource.cancel();
* // above example shows how to use getCancelTokenSource api to get the cancel token source using which we can cancel the ongoing request.
*
* @example Example for isRequestCanceled api
* const { isRequestCanceled } = PCore.getRestClient();
* if(isRequestCanceled(error)) {
* // handle the canceled request using cancelTokenSource.cancel();
* }
* // above example shows how to use isRequestCanceled api to know if the request is canceled using cancel token source.
*
*
* @returns the REST Client API object
* @function
*/
getRestClient: () => typeof RestClient;
/**
* This api provides api to mashup cases and views.
* @example Example for getMashupApi()
* Example usage - PCore.getMashupApi();
* // returns the MashupApi object containing the utility APIs to work with cases and pages
*
* @returns - the {@link MashupApi} API object
* @function
*/
getMashupApi: () => typeof MashupApi;
/**
* Call getEnvironmentInfo function to get the Environment Information
* such as Locale, Operator info, Application info.
*
* @example Example for getEnvironmentInfo
* Example Usage:
* const envInfo = PCore.getEnvironmentInfo();
* // to get application name
* const appName = envInfo.getApplicationName();
*
* @function
* @returns - the {@link EnvironmentInfo} API object
*/
getEnvironmentInfo: () => typeof EnvironmentInfo;
/**
* Switches the application locale at runtime.
* Updates the URL with a `lang` query parameter so the router's
* GLOBAL_QUERYPARAMS propagates it to new tabs,
* updates the document lang parameter for accessibility,
* and hot-reloads locale bundles so the UI updates without a full page reload.
*
* @param locale - The new locale to switch to. Example: 'fr-FR', 'de-DE', 'en-GB'
* @example
* PCore.switchLocale('fr-FR');
*/
switchLocale: (locale: string) => Promise;
/**
* Call getRuntimeParamsAPI to get RuntimeParamsAPI
* which is used to set parameters object while authoring and to be made available in runtime
*
* @example Example for getRuntimeParamsAPI
* Example Usage:
* const runtimeParamsAPI = PCore.getRuntimeParamsAPI();
* // to set runtimeParams
* runtimeParamsAPI.setRuntimeParams({});
*
* @function
* @private
* @returns - the {@link RuntimeParamsAPI} API object
*/
getRuntimeParamsAPI: () => {
runtimeParams: {
[key: string]: object;
};
runtimeParamsMap: {
[key: string]: string;
};
setRuntimeParams(runtimeParams: {
[key: string]: object;
}): void;
getRuntimeParams(): {
[key: string]: object;
};
setRuntimeParam(key: string, value: string): void;
getRuntimeParam(key: string): string;
};
/**
* This api provides utilities to build semantic URLs.
* @example Example for getSemanticUrlUtils()
* // this example will return the SemanticUrlUtils API object
* const semanticUrlUtils = PCore.getSemanticUrlUtils();
*
* @returns - the {@link SemanticUrlUtils} API object
* @function
*/
getSemanticUrlUtils: () => {
getResolvedSemanticURL: (routeKey: string, payload: import("./router/types").RoutePayload, params: Record, locale?: string) => string;
getActions: () => {
ACTION_OPENWORKBYHANDLE: string;
ACTION_SHOWDATA: string;
ACTION_SHOWVIEW: string;
ACTION_GETOBJECT: string;
ACTION_SHOWINSIGHT: string;
ACTION_SHOWDASHBOARD: string;
};
updateSemanticURLAndDocumentTitle: (data: import("./globals").RemoteCaseActionObject, locale?: string) => void;
getSemanticURLForToaster: (caseTypeID: string, caseID: string, isObjectType?: boolean, locale?: string) => string;
};
/**
* This api provides remote case utils.
* @example Example for getRemoteCaseUtils()
* Example usage - PCore.getRemoteCaseUtils();
*
* @returns - the {@link RemoteCase} API object
* @function
* @private
*/
getRemoteCaseUtils: () => typeof RemoteCase;
/**
* This api provides NavigationUtils
* @example Example for getNavigationUtils()
* Example usage - PCore.getNavigationUtils();
* @returns - the {@link NavigationUtils} API object
* @function
*/
getNavigationUtils: () => {
userSettings: any;
componentCache: {
[key: string]: import("./utils/types").ComponentState;
};
contextMapToClearOnCancel: {
[context: string]: Set;
};
"__#2@#isClearOnCancelRegistered": boolean;
getNormalizedKey(key: string): string;
setComponentState: (key: string, state: unknown, options?: import("./utils/types").ComponentStateOptions) => void;
getComponentState: (key: string, options?: import("./utils/types").ComponentStateOptions) => string | true | object | null | undefined;
removeComponentState: (key: string, options?: import("./utils/types").ComponentStateOptions) => void;
fetchUserSettings: () => Promise;
init: () => void;
getUserSettings: (path: string) => any;
setUserSettings: (path: string, value: string) => Promise;
setComponentCache(key: string, value: import("./utils/types").ComponentState, options?: import("./utils/types").CacheOptions): void;
getComponentCache(key: string): import("./utils/types").ComponentState | void;
getURLParam(key: string, decode: boolean): string | null;
setURLParam(key: string, value: string, encode?: boolean): void;
setURLParams(params: Record): void;
resetComponentCache(key: string): boolean;
};
/**
* This api provides registering module on demand.
* @example Example for registerModule()
* Example usage - PCore.registerModule("getFollowersApi", {
* getFollowers: () => {}
* });
*
* @param moduleName Name of the module to be exposed
* eq., getFollowersApi()
* @param module module object to be returned
* @function
* @private
*/
registerModule: (moduleName: string, module: {
[key: string]: unknown;
}) => void;
/**
* This api provides Error Handling
* @example Example for getErrorHandler()
* Example usage - PCore.getErrorHandler().setGenericFailedMessage('Failed to load preview');
* Example usage - PCore.getErrorHandler().getGenericFailedMessage();
* @returns - the {@link ErrorHandler} API object
* @function
*/
getErrorHandler: () => {
genericFailedMessage: string;
getGenericFailedMessage(): string;
setGenericFailedMessage(message: string): void;
};
/**
* Obtains an entry point to the {@link FormUtils} object that contains APIs that handle form related cases.
* @example In this example, the getFormUtils is used to obtain the getChanges API.
* // To access getChanges API
* const formUtils = PCore.getFormUtils();
* const changes = formUtils.getChanges('app/primary_1');
* @returns - the {@link FormUtils} API object
* @function
*/
getFormUtils: () => typeof FormUtils;
/**
* Provides autosave utility APIs for the dx layer: status subscription,
* context registration checks, debug events, and activity notification.
* @example
* const autosaveUtils = PCore.getAutosaveUtils();
* const enabled = autosaveUtils.isAutosaveEnabledForContext(itemKey);
* @returns the {@link AutosaveUtils} API object
* @function
*/
getAutosaveUtils: () => typeof AutosaveUtils;
/**
* This api provides messaging service (web sockets) related APIs
* @example Example getMessagingServiceManager()
* Example usage - PCore.getMessagingServiceManager().subscribe({matcher: "interaction"}, message => {
* // Do process message here
* }));
* PCore.getMessagingServiceManager().unsubscribe(subId);
* @returns - the {@link MessagingServiceManager} API object
* @function
*/
getMessagingServiceManager: () => typeof MessagingServiceManager;
/**
* This api provides metadata access like views, data-pages, fields etc.,
* @example Example getMetadataUtils()
* Example usage - PCore.getMetadataUtils().getDatapageMetadata("D_TestPage")
* @returns - the {@link RuleStore} API object
* @function
* @private
*/
getMetadataUtils: () => typeof MetadataUtils;
/**
* This API contains utility methods to retrieve data from data pages.
* @example Example getDataPageUtils()
* Example usage - PCore.getDataPageUtils()
* @returns - the {@link DataStore} API object
* @function
*/
getDataPageUtils: () => typeof DataStore;
/**
* This API contains utility methods to retrieve information about data types.
* @example Example getDataTypeUtils()
* Example usage - PCore.getDataTypeUtils().getSavableDataPage();
* @returns - the {@link DataTypeUtils} API object
* @function
*/
getDataTypeUtils: () => typeof DataTypeUtils;
/**
* This api is to register Datapage parameters for callback subscription
* @example Example getCascadeManager()
* Example usage - PCore.getCascadeManager()
* @returns - the {@link CascadeManager} API object
* @function
*/
getCascadeManager: () => {
readonly name: string;
cascadeSubscribers: import("./cascade/types").CascadeSubscribersObj;
cascadeResetSubscribers: import("./cascade/types").CascadeResetSubscribersObj;
listChangeSubscribers: Function[];
registerResetDependencies(contextName: string, pageReference: string, target: string, dependentProperties: string[], fieldType: string, mode?: string): void;
deregisterResetDependencies(contextName: string, pageReference: string, target: string, dependentProperties: string[], fieldType: string): void;
getResetDependencies(contextName: string, propertyName: string): import("./globals").PropertyInfo[];
purgeResetDependencies(contextName: string): void;
registerFields(context: string, pageReference: string, fields: string[] | undefined, callback: import("./cascade/types").CascadeSubscriptionCallback, subscriptionId: string): void;
registerListField(context: string, pageReference: string, listField: string, callback: import("./cascade/types").CascadeSubscriptionCallback, subscriptionId: string): void;
unRegisterListField(context: string, pageReference: string, listField: string, subscriptionId: string): void;
unRegisterFields(context: string, pageReference: string, fields: string[] | undefined, subscriptionId: string): void;
triggerCascade(context: string, propertyReference: string, propertyValue: string, changeSet?: Set): void;
purgeCascadeFields(context: string): void;
handleServerChanges(context: string, changedListProperty?: string[], leafProperty?: string[]): void;
_updateChangedProperties(previousValue: unknown, serverFields: unknown, isChangedListPropertyExist: boolean, pathPrefix: string, context: string, changedListProperty: string[], changedPropertyWithError: string[], lengthMismatchPageListArr: string[]): void;
isChangedListPropertyExist(pathPrefix: string): boolean;
_getServerProperties(serverFields: any, context: string, pathPrefix: string, changedListProperty: string[], leafProperty: string[], changedPropertyWithError: string[], lengthMismatchPageListArr: string[]): void;
getServerProperties(serverData: object, context: string, path?: string): {
changedListProperty: string[];
leafProperty: string[];
changedPropertyWithError: string[];
};
_handlePageReference(pageReference: string, target: string, fieldType: string): string;
registerForListChanges(callback?: Function): void;
unRegisterForListChanges(): void;
};
/**
* Determines if the values of two objects are the same by performing a deep comparison.
* @example In this example isDeepEqual is used to compare 2 objects
* Example usage - PCore.isDeepEqual({'a': '123'}, {'a': '123'});
* @param oldValue The value of the first object.
* @param newValue The value of the second object.
* @returns returns true if both object are same in terms to value else return false
* @function
*/
isDeepEqual: (oldValue: object, newValue: object) => any;
/**
* This API provides an entry point to the {@link AuthUtils} API object that contains utility APIs to
* to handle authentication tokens utilized for REST API calls.
*
*
* @example Example for getAuthUtils()
* Example usage - PCore.getAuthUtils().setTokens(tokenObj)
* Example usage - PCore.getAuthUtils().revokeTokens().then()
* Example usage - PCore.getAuthUtils().getAuthInstance(authConfig)
*
* @returns - the {@link AuthUtils} Object
* @function
*/
getAuthUtils: () => typeof AuthUtils;
/**
* This API provides an entry point to the {@link module:Debugger} API object that contains utility APIs to
* to enable Xray.
*
* @example Example for getDebugger()
* Example usage - PCore.getDebugger().toggleXRay(true)
*
* @returns - the {@link module:Debugger} Object
* @function
* @private
*/
getDebugger: () => {
"__#1@#inspectorEnabled": boolean;
"__#1@#inspectorShowAll": boolean;
"__#1@#uiDesignerEnabled": boolean;
"__#1@#uiDesignerToolbarExpanded": boolean;
isPreview: boolean;
debugLevels: string;
"__#1@#blocksInspectorEnable"(): boolean;
toggleXRay(enable: boolean): void;
readonly inspectorEnabled: boolean;
readonly inspectorShowAll: boolean;
toggleInspector(): void;
disableInspectorIfEnabled(): void;
toggleInspectorShowAll(): void;
readonly uiDesignerEnabled: boolean;
setDesignerToolbarExpanded(expanded: boolean): void;
readonly uiDesignerToolbarExpanded: boolean;
toggleUIDesigner(): void;
setPreviewMode(): void;
getPreviewMode(): boolean;
enableTracer: () => void;
disableTracer: () => void;
getDebugLevels: () => string;
};
/**
* This API provides an entry point to the {@link module:DeferLoadManager} API object that exposes methods to
* manager defer loaded components
*
*
* @example Example for getDeferLoadManager()
* Example usage - PCore.getDeferLoadManager().start(viewName, caseKey, pageReference, contextName, uniqueId)
* Example usage - PCore.getDeferLoadManager().stop(uniqueId, contextName)
*
* @returns - the {@link DeferLoadManager} Object
* @function
* @private
*/
getDeferLoadManager: () => {
components: {
[contextName: string]: {
[uniqueId: string]: import("./deferload/types").DeferLoadComponentObj;
};
};
_checkComponent(uniqueId: string, contextName: string): boolean;
start(viewName: string, caseKey: string, pageReference: string, contextName: string, uniqueId: string): void;
stop(uniqueId: string, contextName: string): void;
remove(uniqueId: string, contextName: string): void;
removeContext(contextName: string): void;
enableCascade(contextName: string): void;
activate(uniqueId: string, contextName: string): void;
deactivate(uniqueId: string, contextName: string): void;
refreshActiveComponents(contextName: string): void;
refreshComponent(uniqueId: string, contextName: string): void;
};
/**
* Obtains an entry point to the {@link ExpressionEngine} object that contains API to evaluate expression on given data
*
* @example Example for getExpressionEngine
* Example Usage:
* const expressionEngine = PCore.getExpressionEngine();
* // to evaluate an expression on localData
* const result = expressionEngine.evaluate();
*
* @function
* @returns - the {@link ExpressionEngine} API object
*/
getExpressionEngine: () => typeof ExpressionEngine;
/**
* Obtains an entry point to the ActionsSequencer object that contains APIs to sequence different type of actions in the Constellation Infrastructure.
* To view the APIs in the ActionsSequencer class, see {@link ActionsSequencer|APIs in the ActionsSequencer class}
*
* @example In this example , the API returns the ActionsSequencer object containing the utility APIs
* PCore.getActionsSequencer();
*
* @returns The ActionsSequencer Object
* @function
*/
getActionsSequencer: () => {
MISSING_CONTEXT_PARAM: string;
INVALID_CONTEXT_DETAILS: string;
INVALID_CONTEXT_OPERATION: string;
schedulePendingActionOnCompletion(context: string, contextDataObject: {
context_data: {
blocking_action_counter: number;
deferred_action_queue: StateManager.Action[];
is_deferred_action_in_progress: boolean;
};
}): void;
executeOrQueueDeferredAction(actionPayload: StateManager.Action): Promise;
handleDeferredActionCompletion(context: string): Promise;
registerBlockingAction(context: string): Promise;
deRegisterBlockingAction(context: string): Promise;
cancelDeferredActionsOnError(context: string): void;
isDeferredActionInProgress(context: string): boolean | Promise;
};
/**
* This API create unique id and registers given property in passed context
* @example Example for RefreshManager
* const callback = refreshCaseView.bind(params);
* PCore.getRefreshManager().registerForRefresh('PROP_CHANGE',callback,'caseInfo.content.Name','app/modal_1/caseInfo.content','app/modal_1');
*
* options parameter is optional
* @returns return the RefreshManager instance
* @private
*/
getRefreshManager: () => {
readonly refreshMap: import("./refresh/types").RefreshMap;
readonly propChangeRefreshMap: import("./refresh/types").RefreshMap;
registerForRefresh(refreshType: string, callback: Function, propOrTabToRegister: string, uniqueIds: string, context: string): void;
triggerPropChangeRefresh(propOrTabChanged: string, context: string): boolean;
triggerRefreshForType(refreshType: string, propOrTabChanged: string, context: string): boolean;
deRegisterForRefresh(context: string): void;
};
getInitialiser: () => {
init(configObj: import("./initialiser/configurations").ConfigurationType): Promise;
getBootstrapConfig: (restServerUrl: string, tokenInfo: {
token_type: string;
access_token: string;
}) => Promise;
initCoreContainers: (options?: {
containerType?: string;
}) => {
props: {
getPConnect: () => any;
};
};
importReactRoot: () => Promise[]>;
importDesignSystemComponentMap: (appStaticContentServer: string, environmentId: string, alternateDesignSystemName: string) => Promise;
buildSemanticUrl: (constellationPathInfo: string, queryParams: URLSearchParams, noPortal: string, restServer: string, viewName: string) => string;
initCoreConfig: (config: import("./initialiser/configurations").ConfigurationType) => Promise;
launchViewByName: (targetDom: string, viewName: string, portalName: string, viewClass: string, additionalComponents: string[], portalTarget: string, styleSheetTarget: string, containerTargetName: string, // returns -- An object of User APIs
ccLibs?: (string | import("./types").CustomComponentConfig)[]) => Promise;
launchView: (targetDom: string, viewMetadata: {
[key: string]: any;
}, preLoadComponents: string[] | undefined, runtimeParams: {
[key: string]: any;
}, portalTarget: string, styleSheetTarget: string, containerTargetName: string) => void;
launchPortal: (targetDom: string, portalName: string, containerTargetName?: string, preLoadComponents?: string[], ccLibs?: (string | import("./types").CustomComponentConfig)[]) => Promise;
launchMashup: (targetDom: string, usePegaMashupStyling?: boolean, ccLibs?: (string | import("./types").CustomComponentConfig)[]) => void;
loadEnvironmentInfoFromDataPage: (config: import("./initialiser/configurations").default) => Promise;
loadDataPagesIntoEnvironmentInfo: (dataPages: {
pxObjClass: string;
pyName: string;
pyPath: string;
}[]) => Promise;
"__#8@#isPlainObjectRecord"(value: unknown): value is Record;
setNestedProperty(obj: Record, path: string, value: unknown): void;
start: (config: any, callback?: () => void) => Promise;
registerForDebugInfo: (channel: {
[key: string]: any;
}) => void;
toggleTracerHeaders: (channel: BroadcastChannel) => void;
loadEnvironmentInfo: (config: {
theme: {
definition: string;
};
darkTheme: {
definition: string;
};
keyMapping: any;
cookieComplianceMethod: import("./environment-info/types").CookieComplianceMethod;
}) => Promise;
loadCustomComponentLibrariesIfEnabled(ccLibs: (string | import("./types").CustomComponentConfig)[]): Promise;
loadCustomComponentLibraries(ccLibs: (string | import("./types").CustomComponentConfig)[]): Promise;
importSingleCustomComponent(ccLib: string | import("./types").CustomComponentConfig): Promise;
"__#8@#initRouting"(appRoutingTable: import("./router/types").RoutingInfo, actionsTargetModel?: {
[key: string]: any;
}, servicesObj?: import("./services/types").ServicesType): void;
"__#8@#resolveHeadFaviconLinkUrls"(): void;
"__#8@#setThemeFromConfig"(themeConfig: string | object, options?: {
type: "dark";
}): void;
};
getBootstrapUtils: () => typeof BootstrapUtils;
/**
* Obtains an entry point to the ContextTreeManager object which provides apis to register and handle mutations confined to a view and its children.
* @example Example for getContextTreeManager
* PCore.getContextTreeManager().onViewMutate(
* tab.getPConnect().getContextName(),
* tab.getPConnect().getPageReference(),
* tab.getPConnect()._rawConfig.config?.name,
* (errors) => {
* setTabErrors((tabErrors) => {
* const errors = [...tabErrors];
* ...
* }
* @returns return the ContextTreeManager instance
*/
getContextTreeManager: () => typeof ContextTreeManager;
/**
* This API provides with access related information
* @example Example for AccessPrivilege
* if(PCore.getAccessPrivilege().hasCreateAccess("Person")){
* hasAccess = true;
* }
* @returns return the AccessPrivilege instance
* @private
*/
getAccessPrivilege: () => AccessPrivilege;
/**
* Obtains an entry point to the ObjectTransformer object that contains APIs to transform keys
*
* @example In this example , the API returns the ObjectTransformer object containing the utility APIs
* PCore.getObjectTransformer();
*
* @returns The ObjectTransformer Object
* @private
*/
getObjectTransformer: () => {
needsMapping: boolean;
getNeedsMapping(): boolean;
setNeedsMapping(needsMapping: boolean): void;
map(inputString: string): string;
transformObjectToCase(response: object): any;
transformCaseData(response: import("./case/types").DxAPIResponseObject): {
data: {
objectInfo: {
content: any;
};
};
uiResources: any;
};
analyseResponse(response: any): void;
replacer(inputString: string): string;
replaceToCase(inputString: string): string;
};
/**
* This API returns all the stateMachines for the given
* context, pageReference & target
* @example Example for getAllStateMachines
* getAllStateMachines("app/primary/workarea_2", "caseInfo.content", ".var1")
* @returns return the available stateMachines
* @private
*/
getAllStateMachines: (context: string, pageReference?: string, target?: string) => {
states: any;
unConnectedStates: any;
};
/**
* Determines whether namespacing is enabled for the current application.
*
* @example Example for isNamespaceEnabled()
* Example usage - PCore.isNamespaceEnabled();
* // returns -- false (namespacing disabled)
* @returns `true` if namespacing is enabled; otherwise, `false`.
* @private
*/
isNamespaceEnabled: () => boolean;
/**
* Returns the fully qualified rule name with the given namespace.
*
* @example Example for getQualifiedName()
* Example usage - PCore.getQualifiedName('TestRule', 'AgileStudio');
* // returns -- 'AgileStudio__TestRule'
* @param ruleName - The name of the rule to be qualified.
* @param namespace - The namespace to prefix to the rule name.
* @returns The namespace-qualified rule name.
* @public
*/
getQualifiedName: (ruleName: string, namespace: string) => string;
/**
* Returns the rule name qualified with the default namespace `"PegaPlatform"`.
*
* @example Example for getDefaultQualifiedName()
* Example usage - PCore.getDefaultQualifiedName('TestRule');
* // returns -- 'PegaPlatform__TestRule'
* @param ruleName - The name of the rule to be qualified.
* @returns The namespace-qualified rule name using `"PegaPlatform"` as the default namespace.
* @public
*/
getDefaultQualifiedName: (ruleName: string) => string;
/**
* This API provides an entry point to the {@link NamespaceUtils} object that contains utility APIs to handle namespace-related operations.
* @example Example for getNameSpaceUtils()
* Example usage - PCore.getNameSpaceUtils();
* // returns the NamespaceUtils object containing the utility APIs to work with namespaced rule names
*
* @returns - the {@link NamespaceUtils} API object
* @function
*/
getNameSpaceUtils: () => typeof NamespaceUtils;
/**
* Returns the NetworkUtils API — the central controller for online/offline state.
*
* Use this instead of reading `navigator.onLine` directly or adding your own
* `window.addEventListener('online'/'offline')` listeners.
*
* @example
* // Check current status
* PCore.getNetworkUtils().isOnline();
*
* // Subscribe to transitions
* const unsub = PCore.getNetworkUtils().onStatusChange((online) => { ... });
* unsub(); // unsubscribe when done
*
* // Override for tests / embedding apps
* PCore.getNetworkUtils().setOnlineOverride(false); // force offline
* PCore.getNetworkUtils().setOnlineOverride(null); // restore real navigator
*
* @returns the {@link NetworkStatusManager} instance
* @function
*/
getNetworkUtils: () => NetworkUtils;
/**
* This API provides an entry point to the {@link MashupBridge} object that contains utility APIs to handle mashup-related operations.
* @example Example for getMashupBridge()
* Example usage - PCore.getMashupBridge();
* // returns the MashupBridge object containing the utility APIs to work with mashups
*
* @returns - the {@link MashupBridge} API object
* @function
*/
getMashupBridge: () => typeof MashupBridge;
/**
* Returns the ConfirmDialogService singleton, which manages the confirmation
* dialog shown when orchestration requires user confirmation (e.g., navigating
* away from unsaved changes, exceeding container limits).
* The DXComponent layer can register a handler via `registerConfirmHandler` so that
* a Constellation UI Modal is used instead of the native `window.confirm`.
*
* @example
* PCore.getConfirmDialogService().registerConfirmHandler((message) => {
* return new Promise((resolve) => {
* // show modal and call resolve(true) to discard or resolve(false) to go back
* });
* });
*
* @returns the {@link ConfirmDialogService} singleton
* @function
*/
getConfirmDialogService: () => ConfirmDialogService;
}
export type { PCore };
declare const PCoreInstance: PCore;
export default PCoreInstance;