nestjs-temporal-core
Version:
Complete NestJS integration for Temporal.io with auto-discovery, declarative scheduling, enhanced monitoring, and enterprise-ready features
172 lines (171 loc) • 7.3 kB
TypeScript
export declare const TEMPORAL_MODULE_OPTIONS = "TEMPORAL_MODULE_OPTIONS";
export declare const TEMPORAL_CLIENT = "TEMPORAL_CLIENT";
export declare const TEMPORAL_CONNECTION = "TEMPORAL_CONNECTION";
export declare const ACTIVITY_MODULE_OPTIONS = "ACTIVITY_MODULE_OPTIONS";
export declare const SCHEDULES_MODULE_OPTIONS = "SCHEDULES_MODULE_OPTIONS";
export declare const WORKER_MODULE_OPTIONS = "WORKER_MODULE_OPTIONS";
export declare const TEMPORAL_ACTIVITY = "TEMPORAL_ACTIVITY";
export declare const TEMPORAL_ACTIVITY_METHOD = "TEMPORAL_ACTIVITY_METHOD";
export declare const TEMPORAL_SIGNAL_METHOD = "TEMPORAL_SIGNAL_METHOD";
export declare const TEMPORAL_QUERY_METHOD = "TEMPORAL_QUERY_METHOD";
export declare const TEMPORAL_SCHEDULED_WORKFLOW = "TEMPORAL_SCHEDULED_WORKFLOW";
export declare const WORKFLOW_PARAMS_METADATA = "workflow:params";
export declare const WORKFLOW_CONTEXT_METADATA = "workflow:context";
export declare const WORKFLOW_ID_METADATA = "workflow:id";
export declare const RUN_ID_METADATA = "workflow:runId";
export declare const TASK_QUEUE_METADATA = "workflow:taskQueue";
export declare const DEFAULT_NAMESPACE = "default";
export declare const DEFAULT_TASK_QUEUE = "default-task-queue";
export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 5000;
export declare const CRON_EXPRESSIONS: {
readonly EVERY_MINUTE: "* * * * *";
readonly EVERY_5_MINUTES: "*/5 * * * *";
readonly EVERY_15_MINUTES: "*/15 * * * *";
readonly EVERY_30_MINUTES: "*/30 * * * *";
readonly EVERY_HOUR: "0 * * * *";
readonly EVERY_2_HOURS: "0 */2 * * *";
readonly EVERY_6_HOURS: "0 */6 * * *";
readonly EVERY_12_HOURS: "0 */12 * * *";
readonly DAILY_MIDNIGHT: "0 0 * * *";
readonly DAILY_6AM: "0 6 * * *";
readonly DAILY_8AM: "0 8 * * *";
readonly DAILY_NOON: "0 12 * * *";
readonly DAILY_6PM: "0 18 * * *";
readonly WEEKLY_SUNDAY_MIDNIGHT: "0 0 * * 0";
readonly WEEKLY_MONDAY_9AM: "0 9 * * 1";
readonly WEEKLY_FRIDAY_5PM: "0 17 * * 5";
readonly MONTHLY_FIRST: "0 0 1 * *";
readonly MONTHLY_LAST: "0 0 28-31 * *";
readonly YEARLY: "0 0 1 1 *";
};
export declare const INTERVAL_EXPRESSIONS: {
readonly EVERY_10_SECONDS: "10s";
readonly EVERY_30_SECONDS: "30s";
readonly EVERY_MINUTE: "1m";
readonly EVERY_5_MINUTES: "5m";
readonly EVERY_15_MINUTES: "15m";
readonly EVERY_30_MINUTES: "30m";
readonly EVERY_HOUR: "1h";
readonly EVERY_2_HOURS: "2h";
readonly EVERY_6_HOURS: "6h";
readonly EVERY_12_HOURS: "12h";
readonly DAILY: "24h";
readonly EVERY_2_DAYS: "48h";
readonly WEEKLY: "168h";
};
export declare const TIMEOUTS: {
readonly HEARTBEAT: "30s";
readonly SIGNAL_TIMEOUT: "10s";
readonly QUERY_TIMEOUT: "5s";
readonly ACTIVITY_SHORT: "1m";
readonly ACTIVITY_MEDIUM: "5m";
readonly ACTIVITY_LONG: "30m";
readonly WORKFLOW_SHORT: "1h";
readonly WORKFLOW_MEDIUM: "24h";
readonly WORKFLOW_LONG: "7d";
readonly CONNECTION_TIMEOUT: "10s";
readonly STARTUP_TIMEOUT: "30s";
};
export declare const RETRY_POLICIES: {
readonly QUICK: {
readonly maximumAttempts: 3;
readonly initialInterval: "1s";
readonly maximumInterval: "10s";
readonly backoffCoefficient: 2;
};
readonly STANDARD: {
readonly maximumAttempts: 5;
readonly initialInterval: "5s";
readonly maximumInterval: "60s";
readonly backoffCoefficient: 2;
};
readonly AGGRESSIVE: {
readonly maximumAttempts: 10;
readonly initialInterval: "1s";
readonly maximumInterval: "300s";
readonly backoffCoefficient: 1.5;
};
readonly CONSERVATIVE: {
readonly maximumAttempts: 3;
readonly initialInterval: "30s";
readonly maximumInterval: "600s";
readonly backoffCoefficient: 3;
};
};
export declare const WORKER_PRESETS: {
readonly DEVELOPMENT: {
readonly maxConcurrentActivityTaskExecutions: 10;
readonly maxConcurrentWorkflowTaskExecutions: 5;
readonly maxConcurrentLocalActivityExecutions: 10;
readonly reuseV8Context: false;
};
readonly PRODUCTION_BALANCED: {
readonly maxConcurrentActivityTaskExecutions: 100;
readonly maxConcurrentWorkflowTaskExecutions: 40;
readonly maxConcurrentLocalActivityExecutions: 100;
readonly reuseV8Context: true;
};
readonly PRODUCTION_HIGH_THROUGHPUT: {
readonly maxConcurrentActivityTaskExecutions: 200;
readonly maxConcurrentWorkflowTaskExecutions: 80;
readonly maxConcurrentLocalActivityExecutions: 200;
readonly reuseV8Context: true;
readonly maxActivitiesPerSecond: 1000;
};
readonly PRODUCTION_MINIMAL: {
readonly maxConcurrentActivityTaskExecutions: 20;
readonly maxConcurrentWorkflowTaskExecutions: 10;
readonly maxConcurrentLocalActivityExecutions: 20;
readonly reuseV8Context: true;
};
};
export declare const ERRORS: {
readonly CLIENT_INITIALIZATION: "Failed to initialize Temporal client";
readonly CLIENT_NOT_INITIALIZED: "Temporal client not initialized";
readonly WORKER_INITIALIZATION: "Failed to initialize Temporal worker";
readonly WORKER_NOT_INITIALIZED: "Temporal worker not initialized";
readonly INVALID_OPTIONS: "Invalid Temporal module options";
readonly MISSING_TASK_QUEUE: "Task queue is required";
readonly MISSING_WORKFLOW_TYPE: "Workflow type is required";
readonly MISSING_SCHEDULE_ID: "Schedule ID is required";
readonly ACTIVITY_NOT_FOUND: "Activity not found";
readonly WORKFLOW_NOT_FOUND: "Workflow not found";
readonly DUPLICATE_WORKFLOW_NAME: "Duplicate workflow name found";
readonly SCHEDULE_CLIENT_NOT_INITIALIZED: "Temporal schedule client not initialized";
readonly INVALID_SCHEDULE_OPTIONS: "Invalid schedule options";
readonly INVALID_CRON_EXPRESSION: "Invalid cron expression";
readonly SCHEDULE_ALREADY_EXISTS: "Schedule already exists";
readonly SCHEDULE_NOT_FOUND: "Schedule not found";
readonly WORKFLOW_EXECUTION_FAILED: "Workflow execution failed";
readonly SIGNAL_DELIVERY_FAILED: "Signal delivery failed";
readonly QUERY_EXECUTION_FAILED: "Query execution failed";
readonly ACTIVITY_EXECUTION_FAILED: "Activity execution failed";
readonly ACTIVITY_TIMEOUT: "Activity execution timeout";
readonly ACTIVITY_RETRY_EXHAUSTED: "Activity retry attempts exhausted";
};
export declare enum WorkflowIdReusePolicy {
ALLOW_DUPLICATE = 0,
ALLOW_DUPLICATE_FAILED_ONLY = 1,
REJECT_DUPLICATE = 2,
TERMINATE_IF_RUNNING = 3
}
export declare enum WorkflowIdConflictPolicy {
REJECT_DUPLICATE = "REJECT_DUPLICATE",
TERMINATE_IF_RUNNING = "TERMINATE_IF_RUNNING",
ALLOW_DUPLICATE = "ALLOW_DUPLICATE"
}
export declare enum ScheduleOverlapPolicy {
ALLOW_ALL = "ALLOW_ALL",
SKIP = "SKIP",
BUFFER_ONE = "BUFFER_ONE",
BUFFER_ALL = "BUFFER_ALL",
CANCEL_OTHER = "CANCEL_OTHER"
}
export declare const LOG_CATEGORIES: {
readonly CLIENT: "TemporalClient";
readonly WORKER: "TemporalWorker";
readonly DISCOVERY: "WorkflowDiscovery";
readonly SCHEDULE: "ScheduleManager";
readonly ACTIVITY: "ActivityExecution";
readonly WORKFLOW: "WorkflowExecution";
};