UNPKG

nestjs-temporal-core

Version:

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

35 lines (34 loc) 1.63 kB
import { OnModuleInit, OnModuleDestroy } from '@nestjs/common'; import { DiscoveryService } from '@nestjs/core'; import { ScheduleClient } from '@temporalio/client'; import { TemporalOptions, ScheduleCreationOptions, ScheduleCreationResult, ScheduleRetrievalResult, ScheduleServiceStatus, ScheduleServiceHealth, ScheduleServiceStats, TemporalConnection } from '../interfaces'; import { TemporalMetadataAccessor } from './temporal-metadata.service'; export declare class TemporalScheduleService implements OnModuleInit, OnModuleDestroy { private readonly options; private readonly client; private readonly discoveryService; private readonly metadataAccessor; private readonly logger; private scheduleClient?; private scheduleHandles; private isInitialized; constructor(options: TemporalOptions, client: { schedule?: ScheduleClient; connection?: TemporalConnection; }, discoveryService: DiscoveryService, metadataAccessor: TemporalMetadataAccessor); onModuleInit(): Promise<void>; onModuleDestroy(): Promise<void>; private initializeScheduleClient; private discoverAndRegisterSchedules; private registerScheduledWorkflow; private buildScheduleSpec; private buildWorkflowOptions; private parseInterval; createSchedule(options: ScheduleCreationOptions): Promise<ScheduleCreationResult>; getSchedule(scheduleId: string): Promise<ScheduleRetrievalResult>; isHealthy(): boolean; getScheduleStats(): ScheduleServiceStats; getStatus(): ScheduleServiceStatus; getHealth(): ScheduleServiceHealth; private ensureInitialized; }