UNPKG

1.83 kBTypeScriptView Raw
1import type { Except } from 'type-fest';
2import type { BasicMetaSysProps, CreateWithResponseParams, DefaultElements, MakeRequest, SysLink } from '../common-types';
3import type { WebhookCallDetailsProps } from './webhook';
4type AppActionCallSys = Except<BasicMetaSysProps, 'version'> & {
5 appDefinition: SysLink;
6 space: SysLink;
7 environment: SysLink;
8 action: SysLink;
9};
10type RetryOptions = Pick<CreateWithResponseParams, 'retries' | 'retryInterval'>;
11export type AppActionCallProps = {
12 /**
13 * System metadata
14 */
15 sys: AppActionCallSys;
16};
17export type CreateAppActionCallProps = {
18 /** The body for the call */
19 parameters: {
20 [key: string]: any;
21 };
22};
23type AppActionCallApi = {
24 createWithResponse(): Promise<AppActionCallResponse>;
25 getCallDetails(): Promise<AppActionCallResponse>;
26};
27export type AppActionCallResponse = WebhookCallDetailsProps;
28export interface AppActionCallResponseData extends AppActionCallResponse, DefaultElements<AppActionCallResponse>, AppActionCallApi {
29}
30export interface AppActionCall extends AppActionCallProps, DefaultElements<AppActionCallProps> {
31}
32/**
33 * @private
34 */
35export default function createAppActionCallApi(makeRequest: MakeRequest, retryOptions?: RetryOptions): AppActionCallApi;
36/**
37 * @private
38 * @param http - HTTP client instance
39 * @param data - Raw AppActionCall data
40 * @return Wrapped AppActionCall data
41 */
42export declare function wrapAppActionCall(makeRequest: MakeRequest, data: AppActionCallProps): AppActionCall;
43/**
44 * @private
45 * @param http - HTTP client instance
46 * @param data - Raw AppActionCall data
47 * @return Wrapped AppActionCall data
48 */
49export declare function wrapAppActionCallResponse(makeRequest: MakeRequest, data: AppActionCallResponse, retryOptions?: RetryOptions): AppActionCallResponseData;
50export {};