import type { Except } from 'type-fest'; import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types'; import type { ParameterDefinition } from './widget-parameters'; type AppActionSys = Except & { appDefinition: SysLink; organization: SysLink; }; export type AppActionParameterDefinition = Omit; export type AppActionCategoryProps = { sys: { id: AppActionCategoryType; type: 'AppActionCategory'; version: string; }; name: string; description: string; parameters?: AppActionParameterDefinition[]; }; type BuiltInCategoriesProps = { /** * Category identifying the shape of the action. */ category: 'Entries.v1.0' | 'Notification.v1.0'; }; type CustomAppActionProps = { /** * "Custom" category requires "parameters" */ category: 'Custom'; parameters: AppActionParameterDefinition[]; }; type AppActionCategory = BuiltInCategoriesProps | CustomAppActionProps; export type AppActionCategoryType = AppActionCategory['category']; export type AppActionType = 'endpoint' | 'function' | 'function-invocation'; export type CreateAppActionProps = AppActionCategory & { url: string; name: string; description?: string; type?: AppActionType; }; export type AppActionProps = AppActionCategory & { /** * System metadata */ sys: AppActionSys; /** * Url that will be called when the action is invoked */ url: string; /** * Human readable name for the action */ name: string; /** * Human readable description of the action */ description?: string; /** * Type of the action, defaults to endpoint if not provided * endpoint: action is sent to specified URL * function: deprecated, use function-invocation instead * function-invocation: action invokes a contentful function */ type?: AppActionType; }; export type AppAction = AppActionProps & DefaultElements & { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ * accessToken: '' * }) * * client.getOrganization('') * .then((org) => org.getAppDefinition('')) * .then((appDefinition) => appDefinition.getAppAction('')) * .then((appAction) => appAction.delete()) * .catch(console.error) * ``` */ delete(): Promise; }; /** * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Bundle data * @return Wrapped App Bundle data */ export declare function wrapAppAction(makeRequest: MakeRequest, data: AppActionProps): AppAction; /** * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Bundle collection data * @return Wrapped App Bundle collection data */ export declare const wrapAppActionCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp) => import("../common-types").Collection; export {};