import { type HTMLAttributes, type ReactNode } from 'react';
/** The fields of the step, in the order they appear. */
export declare const WORKFLOW_WEBHOOK_ACTION_FIELDS: readonly ["url", "secret", "legalBasisConfirmed", "parameters"];
export type WorkflowWebhookActionField = (typeof WORKFLOW_WEBHOOK_ACTION_FIELDS)[number];
/** One parameter value as the platform stores it: a flat scalar. */
export type WorkflowWebhookParameterValue = string | number | boolean | null;
/** What the step holds now. Mirrors the platform's
* `SendHttpRequestWorkflowActionDto`. */
export interface WorkflowWebhookActionValues {
/** Where the message goes: platform `url`. */
url: string;
/**
* A new signing secret: platform `secret`, stored encrypted as
* `encryptedSecret`. Empty means "keep the saved one". The server never
* sends a saved secret back.
*/
secret: string;
/** The extra parameters: platform `parameters`, a flat map of scalars. */
parameters: Record;
/** The consent box: platform `legalBasisConfirmed`. */
legalBasisConfirmed: boolean;
}
/** Values to show when the fields open. There is no secret here, on
* purpose: a saved secret is never sent back to the browser. */
export type WorkflowWebhookActionInitialValues = Partial>;
/** Messages from the server, already translated, one per field. */
export type WorkflowWebhookActionErrors = Partial>;
/** The host's own form field names, for a native form post. */
export type WorkflowWebhookActionFieldNames = Record;
/** A variable the user can insert into a parameter value. */
export interface WorkflowWebhookActionPlaceholder {
/** The code the server replaces, such as `[[NOME]]`. */
value: string;
/** What the user reads, translated, such as "First name". */
label: string;
}
/**
* What a test message got back, as the host's server saw it.
* `answered`: the app replied with this HTTP status. `unreachable`: no
* reply at all (the address does not resolve, refuses, times out or has
* no valid certificate). `message` replaces the fields' own words, already
* translated, when the server knows better.
*/
export type WorkflowWebhookTestResult = {
outcome: 'answered';
status: number;
message?: string;
} | {
outcome: 'unreachable';
message?: string;
};
export interface WorkflowWebhookActionProps extends Omit, 'children' | 'onChange'> {
/**
* Host content above the fields, such as the plan notice ("Included in
* the trial and the Elite plans"). Nothing in it is posted.
*/
children?: ReactNode;
/**
* Values to show when the fields open. Read once. Parameters keep the
* order and the names they are given; a number beyond
* `Number.MAX_SAFE_INTEGER` has already lost precision by the time it
* arrives here.
*/
initialValues?: WorkflowWebhookActionInitialValues;
/**
* True when the step already has a secret. The secret field is then
* optional: left empty, the saved secret stays.
*/
hasSavedSecret?: boolean;
/**
* Messages from the server, already translated. A field's message shows
* until the user changes that field; when the fields open with
* messages, focus goes to the first one. A message on `parameters`
* opens the Advanced section.
*
* A React host keeps `errors` in state: each new object is a new answer
* from the server, shown even when its words match the last one.
*/
errors?: WorkflowWebhookActionErrors;
/**
* For a native form post: the host's own field names. The parameters
* post as one JSON object, or an empty string when there are none. The
* consent box posts `1` when ticked and nothing when not. The fields
* must sit inside the host's `