import type { ActionVisibility } from './ActionVisibility'; import type { AllowedStatuses } from './AllowedStatuses'; export type ActionMetadata = { /** * A human-readable name */ name: string; /** * A detailed description of what the action will do */ description: string; /** * Presents as an alert prior to executing the action. Should be used sparingly but important if the action could have harmful, unintended consequences */ warning: string | null; /** * One of: "enabled", "hidden", or { disabled: "" } * - "enabled" - the action is available be run * - "hidden" - the action cannot be seen or run * - { disabled: "example explanation" } means the action is visible but cannot be run. Replace "example explanation" with a reason why the action is disable to prevent user confusion. */ visibility: ActionVisibility; /** * One of: "only-stopped", "only-running", "all" * - "only-stopped" - the action can only be run when the service is stopped * - "only-running" - the action can only be run when the service is running * - "any" - the action can only be run regardless of the service's status */ allowedStatuses: AllowedStatuses; hasInput: boolean; /** * If provided, this action will be nested under a header of this value, along with other actions of the same group */ group: string | null; };