import { C11nEnv } from '../interpreter/c11n-env'; import type { ActionButtons, CaseInfo as ImportedCaseInfo } from './types'; /** * Class to provide case information related API's */ declare class CaseInfo { readonly c11nEnv: C11nEnv; constructor(c11nEnv: C11nEnv); /** * Obtains the details of the case stages for a specified case. * ** @example Example for getCaseStages * In this example, the API returns the details of the case stages for the case with ID "OPB1HW-SPACETRA-WORK RA-43001" rendered in the "app/primary_1" context. * getPConnect() * .getCaseInfo() * .getCaseStages('OPB1HW-SPACETRA-WORK RA-43001', 'app/primary_1') * .then((stages) => { * // success handling * console.log(stages); * }) * .catch((error) => { * // failure handling * }); * * @param {string} caseID - The unique identifier of the case whose case stage details must be fetched. * @param {string} contextName - The name of the context where the details of the case stages for a specified case are rendered. * @returns {Promise} A promise that resolves to an object containing the case stages. */ getCaseStages(caseID: string, contextName: string): Promise; /** * Obtains the name of the case type. * * @example In this example, the API returns the name of the case type. * const caseTypeName = getPConnect().getCaseInfo().getCaseTypeName(); * * @returns Case type name *

* Eg: Registration */ getCaseTypeName(): string; /** * Returns Case name * * @example Example for getName() * const caseName = getPConnect().getCaseInfo().getName(); * * @returns Case name *

* Eg: Registration */ getName(): string; /** * Returns Case class name * * @example Example for getClassName() * const className = getPConnect().getCaseInfo().getClassName(); * * @returns Case class name *

* Eg: ON8TTL-C11nGall-Work-CreateStageTest */ getClassName(): string; /** * Fetch available processes for a case * @example Example for getAvailableProcesses()". * const availableProcesses = getPConnect().getCaseInfo().getAvailableProcesses(); * @returns - returns available processes *
* Eg: [ * { * "name": "Vendor Addition", * "links": { * "add": { * "rel": "self", * "href": "/cases/ON8TTL-GALLERY-WORK PC-99001/processes/VendorAddition_Flow", * "type": "POST", * "title": "add case optional process" * } * }, * "ID": "VendorAddition_Flow", * "type": "Case" * } * ] */ getAvailableProcesses(): any[]; /** * Returns Case key * * @example Example for getKey() * const caseKey = getPConnect().getCaseInfo().getKey(); * * @returns Case key *

* Eg: ON8TTL-GALLERY-WORK CST-1 */ getKey(): string; /** * Returns Object key * * @example Example for getObjectKey() * const caseKey = getPConnect().getCaseInfo().getObjectKey(); * * @returns Object key *

* Eg: STE6QXV0aG9yaW5nQWxsWFuY2VBcHBfX1BancRfNjcyMkdMjFjMTExMDQxMGZmMTM4MmNl */ getObjectKey(): string; /** * Returns Case ID * * @example Example for getID() * const caseKey = getPConnect().getCaseInfo().getID(); * * @returns - Case ID *

* Eg: CST-1 */ getID(): string | undefined; /** * Returns Assignment ID * * @example Example for getAssignmentID() * const assignmentID = getPConnect().getCaseInfo().getAssignmentID(); * * @returns Assignment ID *

* Eg: ASSIGN-WORKLIST ON8TTL-GALLERY-WORK CST-51001!CREATEFORM_DEFAULT */ getAssignmentID(): string; /** * Returns Case actions info * * @example Example for getActions() * const actions = getPConnect().getCaseInfo().getActions(); * * * @returns Case actions info *
* Eg: { * "secondary": [ * { * "jsAction": "cancelAssignment", * "name": "Cancel", * "actionID": "cancel" * } * ], * "main": [ * { * "jsAction": "finishAssignment", * "name": "Next ", * "actionID": "next" * } * ] * } */ getActions(): ActionButtons; /** * Returns current flow action ID that is rendered. * * @example Example for getActiveFlowActionID() * const activeFlowActionID = getPConnect().getCaseInfo().getActiveFlowActionID(); * * @returns Current flow action ID *

* Eg: MyFlowAction1 */ getActiveFlowActionID(): string; /** * Returns parent case info when the current assignment is in child case. * * @example Example for getParentCaseInfo() * const parentCaseInfo = getPConnect().getCaseInfo().getParentCaseInfo(); * * @returns Parent Case details of current child Case. *

* Eg: * { * "hasMoreAncestors":"false", * "name":"Parent case", * "links":{ * "open":{ * "rel":"other", * "href":"/cases/APP-FOOD-WORK P-13002", * "type":"GET", * "title":"open parent case" * } * }, * "ID":"APP-FOOD-WORK P-13002", * "content":{ * "pyStatusWork":"New", * "classID":"APP-Food-Work-ParentCase", * "pxUpdatedOperatorAndDateTime":"Gallery less than a minute ago", * "pxUrgencyWork":"10", * "pxCreateOperatorAndDateTime":"Gallery 38 minutes ago" * } * } */ getParentCaseInfo(): any; /** * Returns true if the view is in perform mode else false * * @example Example for isPerform() * const isPerform = getPConnect().getCaseInfo().isPerform(); * * @returns Flag to indicate perform mode or not * */ isPerform(): boolean; /** * Returns true if the view is in review mode else false * * @example Example for isReview() * const isReview = getPConnect().getCaseInfo().isReview(); * * @returns Flag to indicate review mode or not * */ isReview(): boolean; /** * Checks and returns true if the current assignment is in create stage. * @private * @returns - Returns true if the current assignment is in create stage else false */ isAssignmentInCreateStage(): boolean; /** * Checks and returns true if the current action is local action. * @private * @returns - Returns true if the current action is local action else false */ isLocalAction(): boolean; /** * Obtains the name of the current assignment's view in a case. * * @example Example for getCurrentAssignmentViewName() * const viewName = getPConnect().getCaseInfo().getCurrentAssignmentViewName(); * * @returns View name *

* Eg: EmployeeDetails */ getCurrentAssignmentViewName(): string | null; /** * Retrieves a value from a nested object structure based on a given path. * * @param data - The object containing the case information. * @param path - The path to the desired value, using dot notation or array-like syntax. * Example: "caseInfo.content.MyDataList(3)" or "caseInfo.content.property". * @returns The value at the specified path, or undefined if the path is invalid or does not exist. * * @example * const data = { caseInfo: { content: { MyDataList: [1, 2, 3] } } }; * const value = getValueByPath(data, "caseInfo.content.MyDataList(2)"); * Output: 2 * * @private */ getValueByPath(data: { caseInfo: ImportedCaseInfo; }, path: string): unknown; /** * Obtains the name of the current assignment's view class. * * @example Example for getCurrentAssignmentViewClassName() * const viewName = getPConnect().getCaseInfo().getCurrentAssignmentViewClassName(); * * @returns the name of the current assignment's view class as a string. *

* Eg: OYLGY0-MySandBox-Data-MyDataTypeA */ getCurrentAssignmentViewClassName(): string | null; /** * Returns the refresh condition of current active case action * * @example Example for getActionRefreshConditions() * const refreshConditions = getPConnect().getCaseInfo().getActionRefreshConditions(); * * @returns Refresh Conditions *

* Eg: refreshConditions: [{field: ".Datetime",event: "Changes"}, {field: ".Checkbox",event: "Changes"}] * @private */ getActionRefreshConditions(): any; /** * Returns Business ID * @example Example for getBusinessID() * const caseKey = getPConnect().getCaseInfo().getBusinessID(); * * @returns Business ID *

* Eg: CST-1 */ getBusinessID(): string; getAssignments(): any; getChildAssignments(): any; isCaseWideLocalAction: () => boolean; getAllAssignments(): any; getActiveCaseActionName(): any; getFirstCaseActionName(): any; hasAssignments(): boolean; hasMessages: () => boolean; hasGetNextWorkLinks(): boolean; /** * Checks and returns true if the current action is object wide action. * @private * @returns - Returns true if the current action is object wide action else false */ isObjectWideAction(): boolean; } export default CaseInfo;