UNPKG

integreat

Version:
74 lines (73 loc) 2.72 kB
import type { Action, Payload, Meta, Response } from '../types.js'; import type Endpoint from '../service/Endpoint.js'; export declare function createAction(type?: string, payload?: Payload, meta?: Meta): Action | null; export declare function setDataOnActionPayload(action: Action, data?: unknown): { payload: { data: unknown; type?: string | string[]; id?: string | string[]; sourceService?: string; targetService?: string; service?: string; endpoint?: string; uri?: string; method?: string; headers?: import("../types.js").Headers; page?: number; pageOffset?: number; pageSize?: number; pageAfter?: string; pageBefore?: string; pageId?: string; }; type: string; response?: Response<unknown> | undefined; meta?: Meta; }; export declare function setResponseOnAction(action: Action, response?: Response): { response: Response<unknown>; type: string; payload: Payload<unknown>; meta?: Meta; }; export declare function setMetaOnAction(action: Action, { queue, queuedAt, id, ...meta }: Meta): { meta: { queue?: boolean | undefined; cid?: string; gid?: string; ident?: import("../types.js").Ident; dispatchedAt?: number; cache?: boolean; auth?: Record<string, unknown> | null; options?: import("../service/types.js").TransporterOptions; jobId?: string; stepId?: string; }; type: string; payload: Payload<unknown>; response?: Response<unknown> | undefined; }; export declare function removeQueueFlag({ meta: { queue, ...meta }, ...action }: Action): { meta: { [x: string]: unknown; id?: string; cid?: string; gid?: string; ident?: import("../types.js").Ident; dispatchedAt?: number; queuedAt?: number; cache?: boolean; auth?: Record<string, unknown> | null; options?: import("../service/types.js").TransporterOptions; jobId?: string; stepId?: string; }; type: string; payload: Payload<unknown>; response?: Response<unknown> | undefined; }; export declare function setOptionsOnAction(action: Action, endpoint: Endpoint): Action; export declare function setErrorOnAction(action: Action, error: unknown, origin?: string, status?: string): Action; export declare const setOriginOnAction: (action: Action, origin: string, doPrefix?: boolean) => Action<Payload<unknown>, unknown>; export declare function setActionIds(action: Action): Action<Payload<unknown>, unknown>; export declare const createMetaForSubAction: ({ id, ...meta }?: Meta) => Meta;