interface ActionsDiscoveryInterface { aris: string[]; entityType: string; fieldKeys: string[]; } interface DatasourceIntegration extends ActionsDiscoveryInterface { datasourceId: string; } interface TargetIntegration extends ActionsDiscoveryInterface { integrationKey: string; } export type ActionsDiscoveryRequest = DatasourceIntegration | TargetIntegration; export interface PermissionTypes { isEditable: boolean; } export interface PermissionInterface extends PermissionTypes { ari: string; fieldKey: string; } export interface AtomicActionInterface { /** * To be sent to actions-service to execute an action * eg: atlassian:work-item:update:summary */ actionKey: string; description?: string; /** * To identify the actionable column in FE. * Should be the same as the last word in `actionKey`. */ fieldKey: string; /** * The inputs required to execute the action */ inputs?: ActionInputs; integrationKey: string; /** * types the field value can take */ type: 'string' | 'number'; } type ActionInputs = { [key: string]: ActionInput; }; /** * Information received from ORS about the a given input type and the * actions that can be applied to it. */ type ActionInput = { description?: string; fetchAction?: AtomicActionInterface; type: 'string' | 'number'; }; export interface ActionsServiceDiscoveryResponse { actions: AtomicActionInterface[]; permissions: { data: PermissionInterface[]; }; } export type ActionsDiscoveryResponse = ActionsServiceDiscoveryResponse | ActionsServiceError; type XOR = (T1 & { [k in Exclude]?: never; }) | (T2 & { [k in Exclude]?: never; }) | (T3 & { [k in Exclude]?: never; }); type ActionsTarget = XOR<{ ari: string; }, { url: string; }, { id: string; }>; type SupportedActionInputPrimitives = string | number | boolean; type ActionInputValue = SupportedActionInputPrimitives | Record | SupportedActionInputPrimitives[]; export type AtomicActionExecuteRequest = { integrationKey: string; parameters: { inputs: { [key: string]: TInputs; }; target: ActionsTarget; }; } & ({ actionId?: never; actionKey: string; } | { actionId: string; actionKey?: never; }); export declare enum ActionOperationStatus { SUCCESS = "SUCCESS", FAILURE = "FAILURE" } /** * The response shape from /gateway/api/object-resolver/actions/execute * T could be Icon or Status for example. */ export interface AtomicActionExecuteResponse { entities?: T[]; errors: ActionsServiceError[]; operationStatus: ActionOperationStatus; } export interface ActionsServiceError { code: number; message: string; } export {};