UNPKG

nestjs-temporal-core

Version:

Complete NestJS integration for Temporal.io with auto-discovery, declarative scheduling, enhanced monitoring, and enterprise-ready features

42 lines (41 loc) 1.99 kB
import { OnModuleInit } from '@nestjs/common'; import { Client, ScheduleClient, ScheduleHandle, ScheduleOverlapPolicy } from '@temporalio/client'; import { Duration } from '@temporalio/common'; import { TemporalOptions } from '../interfaces'; export declare class TemporalScheduleService implements OnModuleInit { private readonly client; private readonly options; private readonly logger; private scheduleClient; constructor(client: Client | null, options: TemporalOptions); onModuleInit(): Promise<void>; createCronSchedule(scheduleId: string, workflowType: string, cronExpression: string, taskQueue: string, args?: unknown[], options?: { description?: string; timezone?: string; overlapPolicy?: ScheduleOverlapPolicy; startPaused?: boolean; }): Promise<ScheduleHandle>; createIntervalSchedule(scheduleId: string, workflowType: string, interval: Duration, taskQueue: string, args?: unknown[], options?: { description?: string; overlapPolicy?: ScheduleOverlapPolicy; startPaused?: boolean; }): Promise<ScheduleHandle>; pauseSchedule(scheduleId: string, note?: string): Promise<void>; resumeSchedule(scheduleId: string, note?: string): Promise<void>; deleteSchedule(scheduleId: string): Promise<void>; triggerSchedule(scheduleId: string, overlapPolicy?: ScheduleOverlapPolicy): Promise<void>; updateSchedule(scheduleId: string, updateFn: (schedule: unknown) => unknown): Promise<void>; listSchedules(pageSize?: number): Promise<unknown[]>; describeSchedule(scheduleId: string): Promise<unknown>; scheduleExists(scheduleId: string): Promise<boolean>; getScheduleClient(): ScheduleClient | null; isHealthy(): boolean; getStatus(): { available: boolean; healthy: boolean; schedulesSupported: boolean; }; private executeScheduleOperation; private ensureClientInitialized; private generateScheduledWorkflowId; }