/** * Signal delivery to paused hook activities. * * Signals resume workflows waiting on external events: * - `signal()` → single webhook delivery to a specific hook * - `signalAll()` → fan-out to all workflows matching a query * - `hookTime()` → time-based hook awaken (sleep/cron) * * Also provides the quorum-level task processors for web/time hooks * and the router throttle control. */ import { Router } from '../router'; import { StoreService } from '../store'; import { StreamService } from '../stream'; import { SubService } from '../sub'; import { TaskService } from '../task'; import { ILogger } from '../logger'; import { AppVID } from '../../types/app'; import { JobData } from '../../types/job'; import { ProviderClient, ProviderTransaction } from '../../types/provider'; import { JobStatsInput } from '../../types/stats'; import { StreamCode, StreamStatus } from '../../types/stream'; import { WorkListTaskType } from '../../types/task'; import { HookInterface } from '../../types/hook'; import { JobMessageCallback } from '../../types/quorum'; import { JobOutput } from '../../types/job'; interface SignalContext { guid: string; appId: string; store: StoreService; stream: StreamService; subscribe: SubService; router: Router | null; taskService: TaskService; logger: ILogger; jobCallbacks: Record; getVID(vid?: AppVID): Promise; getSchema(topic: string): Promise<[string, any]>; resolveQuery(topic: string, query: JobStatsInput): Promise; interrupt(topic: string, jobId: string, options?: any): Promise; } /** * Delivers a signal (data payload) to a paused hook activity, * resuming its Leg 2 execution. */ export declare function signal(instance: SignalContext, topic: string, data: JobData, status?: StreamStatus, code?: StreamCode, transaction?: ProviderTransaction): Promise; export declare function hookTime(instance: SignalContext, jobId: string, gId: string, topicOrActivity: string, type?: WorkListTaskType): Promise; /** * Fan-out variant that delivers data to all paused workflows * matching a search query. */ export declare function signalAll(instance: SignalContext, hookTopic: string, data: JobData, keyResolver: JobStatsInput, queryFacets?: string[]): Promise; export declare function processWebHooks(instance: SignalContext, signalFn: HookInterface): Promise; export declare function processTimeHooks(instance: SignalContext, hookTimeFn: (jobId: string, gId: string, activityId: string, type: WorkListTaskType) => Promise): Promise; export declare function throttle(instance: SignalContext, delayInMillis: number): Promise; export declare function routeToSubscribers(instance: SignalContext, topic: string, message: JobOutput): void; export {};