nestjs-temporal-core 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +271 -140
  2. package/dist/client/temporal-client.module.d.ts +9 -3
  3. package/dist/client/temporal-client.module.js +43 -13
  4. package/dist/client/temporal-client.module.js.map +1 -1
  5. package/dist/client/temporal-client.service.d.ts +10 -3
  6. package/dist/client/temporal-client.service.js +15 -6
  7. package/dist/client/temporal-client.service.js.map +1 -1
  8. package/dist/client/temporal-schedule.service.d.ts +21 -5
  9. package/dist/client/temporal-schedule.service.js +42 -10
  10. package/dist/client/temporal-schedule.service.js.map +1 -1
  11. package/dist/constants.d.ts +47 -70
  12. package/dist/constants.js +51 -74
  13. package/dist/constants.js.map +1 -1
  14. package/dist/decorators/activity.decorator.d.ts +3 -0
  15. package/dist/decorators/activity.decorator.js +39 -0
  16. package/dist/decorators/activity.decorator.js.map +1 -0
  17. package/dist/decorators/index.d.ts +4 -5
  18. package/dist/decorators/index.js +17 -19
  19. package/dist/decorators/index.js.map +1 -1
  20. package/dist/decorators/parameter.decorator.d.ts +7 -0
  21. package/dist/decorators/parameter.decorator.js +69 -0
  22. package/dist/decorators/parameter.decorator.js.map +1 -0
  23. package/dist/decorators/{scheduling.decorators.d.ts → scheduling.decorator.d.ts} +1 -1
  24. package/dist/decorators/{scheduling.decorators.js → scheduling.decorator.js} +24 -1
  25. package/dist/decorators/scheduling.decorator.js.map +1 -0
  26. package/dist/decorators/workflow.decorator.d.ts +3 -0
  27. package/dist/decorators/workflow.decorator.js +58 -0
  28. package/dist/decorators/workflow.decorator.js.map +1 -0
  29. package/dist/discovery/index.d.ts +2 -2
  30. package/dist/discovery/index.js +2 -2
  31. package/dist/discovery/index.js.map +1 -1
  32. package/dist/discovery/{workflow-discovery.service.d.ts → temporal-discovery.service.d.ts} +21 -18
  33. package/dist/discovery/temporal-discovery.service.js +190 -0
  34. package/dist/discovery/temporal-discovery.service.js.map +1 -0
  35. package/dist/discovery/{schedule-manager.service.d.ts → temporal-schedule-manager.service.d.ts} +20 -15
  36. package/dist/discovery/{schedule-manager.service.js → temporal-schedule-manager.service.js} +96 -76
  37. package/dist/discovery/temporal-schedule-manager.service.js.map +1 -0
  38. package/dist/index.d.ts +6 -11
  39. package/dist/index.js +16 -16
  40. package/dist/index.js.map +1 -1
  41. package/dist/interfaces.d.ts +193 -0
  42. package/dist/interfaces.js +9 -0
  43. package/dist/interfaces.js.map +1 -0
  44. package/dist/temporal.module.d.ts +2 -1
  45. package/dist/temporal.module.js +84 -49
  46. package/dist/temporal.module.js.map +1 -1
  47. package/dist/temporal.service.d.ts +34 -26
  48. package/dist/temporal.service.js +76 -47
  49. package/dist/temporal.service.js.map +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/dist/worker/index.d.ts +1 -1
  52. package/dist/worker/index.js +1 -1
  53. package/dist/worker/index.js.map +1 -1
  54. package/dist/worker/temporal-metadata.accessor.d.ts +13 -5
  55. package/dist/worker/temporal-metadata.accessor.js +38 -26
  56. package/dist/worker/temporal-metadata.accessor.js.map +1 -1
  57. package/dist/worker/{worker-manager.service.d.ts → temporal-worker-manager.service.d.ts} +13 -4
  58. package/dist/worker/{worker-manager.service.js → temporal-worker-manager.service.js} +58 -22
  59. package/dist/worker/temporal-worker-manager.service.js.map +1 -0
  60. package/dist/worker/temporal-worker.module.d.ts +14 -4
  61. package/dist/worker/temporal-worker.module.js +81 -15
  62. package/dist/worker/temporal-worker.module.js.map +1 -1
  63. package/package.json +12 -6
  64. package/dist/decorators/communication.decorators.d.ts +0 -5
  65. package/dist/decorators/communication.decorators.js +0 -66
  66. package/dist/decorators/communication.decorators.js.map +0 -1
  67. package/dist/decorators/core.decorators.d.ts +0 -6
  68. package/dist/decorators/core.decorators.js +0 -87
  69. package/dist/decorators/core.decorators.js.map +0 -1
  70. package/dist/decorators/parameter.decorators.d.ts +0 -2
  71. package/dist/decorators/parameter.decorators.js +0 -29
  72. package/dist/decorators/parameter.decorators.js.map +0 -1
  73. package/dist/decorators/scheduling.decorators.js.map +0 -1
  74. package/dist/decorators/workflow-starter.decorator.d.ts +0 -2
  75. package/dist/decorators/workflow-starter.decorator.js +0 -14
  76. package/dist/decorators/workflow-starter.decorator.js.map +0 -1
  77. package/dist/discovery/schedule-manager.service.js.map +0 -1
  78. package/dist/discovery/workflow-discovery.service.js +0 -216
  79. package/dist/discovery/workflow-discovery.service.js.map +0 -1
  80. package/dist/interfaces/activity.interface.d.ts +0 -8
  81. package/dist/interfaces/activity.interface.js +0 -3
  82. package/dist/interfaces/activity.interface.js.map +0 -1
  83. package/dist/interfaces/core.interface.d.ts +0 -112
  84. package/dist/interfaces/core.interface.js +0 -3
  85. package/dist/interfaces/core.interface.js.map +0 -1
  86. package/dist/interfaces/discovery.interface.d.ts +0 -61
  87. package/dist/interfaces/discovery.interface.js +0 -3
  88. package/dist/interfaces/discovery.interface.js.map +0 -1
  89. package/dist/interfaces/index.d.ts +0 -9
  90. package/dist/interfaces/index.js +0 -29
  91. package/dist/interfaces/index.js.map +0 -1
  92. package/dist/interfaces/scheduling.interface.d.ts +0 -17
  93. package/dist/interfaces/scheduling.interface.js +0 -3
  94. package/dist/interfaces/scheduling.interface.js.map +0 -1
  95. package/dist/interfaces/worker.interface.d.ts +0 -23
  96. package/dist/interfaces/worker.interface.js +0 -3
  97. package/dist/interfaces/worker.interface.js.map +0 -1
  98. package/dist/interfaces/workflow.interface.d.ts +0 -55
  99. package/dist/interfaces/workflow.interface.js +0 -3
  100. package/dist/interfaces/workflow.interface.js.map +0 -1
  101. package/dist/worker/worker-manager.service.js.map +0 -1
package/README.md CHANGED
@@ -1,206 +1,337 @@
1
1
  # NestJS Temporal Core
2
2
 
3
- A comprehensive NestJS integration for [Temporal.io](https://temporal.io/) that provides seamless worker and client support with auto-discovery, declarative scheduling, and enterprise-ready features for building reliable distributed applications.
3
+ A comprehensive NestJS integration for [Temporal.io](https://temporal.io/) that provides seamless workflow orchestration with auto-discovery, declarative scheduling, and production-ready features.
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/nestjs-temporal-core.svg)](https://badge.fury.io/js/nestjs-temporal-core)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
8
8
 
9
- ## 📚 Documentation
10
-
11
- ### Quick Links
12
- - **[🚀 Getting Started](./docs/getting-started.md)** - Installation, basic setup, and first workflow
13
- - **[⚙️ Configuration](./docs/configuration.md)** - Complete configuration reference and examples
14
- - **[📖 API Reference](./docs/api-reference.md)** - Detailed API documentation for all services and decorators
15
- - **[🍳 Examples & Recipes](./docs/examples.md)** - Practical examples and common patterns
16
-
17
9
  ## Overview
18
10
 
19
- NestJS Temporal Core makes it easy to integrate Temporal.io with your NestJS applications using familiar decorator patterns. Temporal is a durable execution system for reliable microservices and workflow orchestration.
11
+ NestJS Temporal Core brings Temporal's durable execution to NestJS with familiar decorator patterns and automatic discovery. Build reliable distributed systems with activities and scheduled tasks using native NestJS conventions.
20
12
 
21
- ## Features
13
+ ## 🚀 Key Features
22
14
 
23
- - 🚀 **Easy NestJS Integration** - Simple module registration with unified configuration
24
- - 🎯 **Auto-Discovery** - Automatic discovery of workflow controllers and scheduled workflows
25
- - 🔄 **Complete Lifecycle Management** - Automatic worker initialization and graceful shutdown
26
- - 📋 **Declarative Decorators** - NestJS-style `@WorkflowController`, `@Cron`, `@Interval`, and more
27
- - 🕐 **Smart Scheduling** - Built-in cron and interval-based workflow scheduling with management
28
- - 🔌 **Connection Management** - Simplified connection handling with TLS and Temporal Cloud support
29
- - 🔒 **Type Safety** - Clean, strongly typed interfaces for all Temporal concepts
30
- - 📡 **Enhanced Client** - Methods for starting, signaling, and querying workflows with auto-discovery
31
- - 📊 **Worker Management** - Advanced worker lifecycle control, monitoring, and health checks
32
- - 🏭 **Production Ready** - Environment-aware configuration, health monitoring, and graceful degradation
33
-
34
- ## 🚀 Quick Start
15
+ - **🎯 NestJS-Native** - Familiar patterns: `@Activity`, `@Cron`, `@Interval`
16
+ - **🔍 Auto-Discovery** - Automatically finds and registers activities and schedules
17
+ - **📅 Declarative Scheduling** - Built-in cron and interval scheduling that just works
18
+ - **🔄 Unified Service** - Single `TemporalService` for all operations
19
+ - **⚙️ Flexible Setup** - Client-only, worker-only, or unified deployments
20
+ - **🏥 Health Monitoring** - Comprehensive status monitoring and health checks
21
+ - **🔧 Production Ready** - TLS, connection management, graceful shutdowns
22
+ - **📊 Complete Integration** - Full-featured module architecture
35
23
 
36
- ### Installation
24
+ ## 📦 Installation
37
25
 
38
26
  ```bash
39
27
  npm install nestjs-temporal-core @temporalio/client @temporalio/worker @temporalio/workflow
40
28
  ```
41
29
 
42
- ### Basic Setup
30
+ ## 🚀 Quick Start
31
+
32
+ ### 1. Module Setup
43
33
 
44
34
  ```typescript
45
35
  // app.module.ts
46
36
  import { Module } from '@nestjs/common';
47
37
  import { TemporalModule } from 'nestjs-temporal-core';
38
+ import { EmailActivities } from './activities/email.activities';
48
39
 
49
40
  @Module({
50
- imports: [
51
- TemporalModule.register({
52
- connection: {
53
- address: 'localhost:7233',
54
- namespace: 'default',
55
- },
56
- taskQueue: 'my-task-queue',
57
- worker: {
58
- workflowsPath: './dist/workflows',
59
- activityClasses: [EmailActivities],
60
- autoStart: true,
61
- },
62
- isGlobal: true,
63
- }),
64
- ],
41
+ imports: [
42
+ TemporalModule.register({
43
+ connection: {
44
+ address: 'localhost:7233',
45
+ namespace: 'default',
46
+ },
47
+ taskQueue: 'my-app',
48
+ worker: {
49
+ workflowsPath: './dist/workflows',
50
+ activityClasses: [EmailActivities], // Auto-discovered
51
+ },
52
+ }),
53
+ ],
54
+ providers: [EmailActivities],
65
55
  })
66
56
  export class AppModule {}
67
57
  ```
68
58
 
69
- ### Create a Workflow Controller
59
+ ### 2. Create Activities
70
60
 
71
61
  ```typescript
72
- import { WorkflowController, WorkflowMethod, Cron, Signal, Query } from 'nestjs-temporal-core';
62
+ // activities/email.activities.ts
63
+ import { Injectable } from '@nestjs/common';
64
+ import { Activity, ActivityMethod } from 'nestjs-temporal-core';
73
65
 
74
- @WorkflowController({ taskQueue: 'orders' })
75
- export class OrderWorkflowController {
76
- private status = 'pending';
77
-
78
- @WorkflowMethod()
79
- async processOrder(orderId: string, customerId: string): Promise<string> {
80
- this.status = 'processing';
81
- // Workflow logic here
82
- this.status = 'completed';
83
- return this.status;
84
- }
85
-
86
- @Cron('0 8 * * *', {
87
- scheduleId: 'daily-order-report',
88
- description: 'Generate daily order report'
89
- })
90
- @WorkflowMethod()
91
- async generateDailyReport(): Promise<void> {
92
- console.log('Generating daily order report...');
93
- }
94
-
95
- @Signal('addItem')
96
- async addItemToOrder(item: any): Promise<void> {
97
- console.log('Item added to order:', item);
98
- }
99
-
100
- @Query('getStatus')
101
- getOrderStatus(): string {
102
- return this.status;
103
- }
66
+ @Injectable()
67
+ @Activity()
68
+ export class EmailActivities {
69
+ @ActivityMethod()
70
+ async sendWelcomeEmail(email: string, name: string): Promise<boolean> {
71
+ console.log(`Sending welcome email to ${email}`);
72
+ // Your email logic here
73
+ return true;
74
+ }
75
+
76
+ @ActivityMethod()
77
+ async sendNotification(email: string, message: string): Promise<void> {
78
+ console.log(`Notification to ${email}: ${message}`);
79
+ // Your notification logic here
80
+ }
104
81
  }
105
82
  ```
106
83
 
107
- ### Use the Service
84
+ ### 3. Create Scheduled Workflows
108
85
 
109
86
  ```typescript
87
+ // services/scheduled.service.ts
110
88
  import { Injectable } from '@nestjs/common';
111
- import { TemporalService } from 'nestjs-temporal-core';
89
+ import { Cron, Interval } from 'nestjs-temporal-core';
112
90
 
113
91
  @Injectable()
114
- export class OrderService {
115
- constructor(private readonly temporalService: TemporalService) {}
116
-
117
- async processOrder(orderId: string, customerId: string): Promise<string> {
118
- const { workflowId } = await this.temporalService.startWorkflow(
119
- 'processOrder',
120
- [orderId, customerId],
121
- { workflowId: `order-${orderId}` }
122
- );
123
-
124
- return workflowId;
125
- }
92
+ export class ScheduledService {
93
+ // Automatic scheduling - runs at 9 AM daily
94
+ @Cron('0 9 * * *', {
95
+ scheduleId: 'daily-user-report',
96
+ description: 'Generate daily user report'
97
+ })
98
+ async generateDailyReport(): Promise<void> {
99
+ console.log('Generating daily user report...');
100
+ // Report generation logic
101
+ }
102
+
103
+ // Interval-based scheduling - runs every hour
104
+ @Interval('1h', {
105
+ scheduleId: 'hourly-cleanup',
106
+ description: 'Hourly cleanup task'
107
+ })
108
+ async cleanupTask(): Promise<void> {
109
+ console.log('Running cleanup task...');
110
+ // Cleanup logic
111
+ }
126
112
  }
127
113
  ```
128
114
 
129
- ## 📖 Core Concepts
115
+ ### 4. Use in Services
130
116
 
131
- ### Workflow Controllers
132
- New NestJS-style controllers for defining workflows with auto-discovery and declarative scheduling.
117
+ ```typescript
118
+ // services/user.service.ts
119
+ import { Injectable } from '@nestjs/common';
120
+ import { TemporalService } from 'nestjs-temporal-core';
133
121
 
134
- ### Activities
135
- Reusable business logic components that can be called from workflows.
122
+ @Injectable()
123
+ export class UserService {
124
+ constructor(private readonly temporal: TemporalService) {}
125
+
126
+ async processUser(email: string, name: string): Promise<string> {
127
+ // Start workflow directly with client
128
+ const { workflowId } = await this.temporal.startWorkflow(
129
+ 'processUser',
130
+ [email, name],
131
+ {
132
+ taskQueue: 'user-processing',
133
+ workflowId: `user-${email}-${Date.now()}`
134
+ }
135
+ );
136
+
137
+ return workflowId;
138
+ }
139
+
140
+ async getUserStatus(workflowId: string): Promise<string> {
141
+ return await this.temporal.queryWorkflow(workflowId, 'getStatus');
142
+ }
143
+
144
+ async updateUserStatus(workflowId: string, status: string): Promise<void> {
145
+ await this.temporal.signalWorkflow(workflowId, 'updateStatus', [status]);
146
+ }
147
+
148
+ // Schedule management
149
+ async pauseDailyReport(): Promise<void> {
150
+ await this.temporal.pauseSchedule('daily-user-report', 'Maintenance mode');
151
+ }
152
+
153
+ async resumeDailyReport(): Promise<void> {
154
+ await this.temporal.resumeSchedule('daily-user-report');
155
+ }
156
+ }
157
+ ```
136
158
 
137
- ### Scheduling
138
- Built-in support for cron and interval-based workflow scheduling using decorators.
159
+ ## ⚙️ Configuration Options
139
160
 
140
- ### Auto-Discovery
141
- Automatic detection and registration of workflow controllers and scheduled workflows.
161
+ ### Basic Configuration
162
+
163
+ ```typescript
164
+ TemporalModule.register({
165
+ connection: {
166
+ address: 'localhost:7233',
167
+ namespace: 'default',
168
+ },
169
+ taskQueue: 'my-app',
170
+ worker: {
171
+ workflowsPath: './dist/workflows',
172
+ activityClasses: [EmailActivities, PaymentActivities],
173
+ },
174
+ });
175
+ ```
142
176
 
143
- ## 🏗️ Architecture
177
+ ### Client-Only Mode
144
178
 
179
+ ```typescript
180
+ TemporalModule.forClient({
181
+ connection: {
182
+ address: 'temporal.company.com:7233',
183
+ namespace: 'production',
184
+ tls: true,
185
+ },
186
+ });
145
187
  ```
146
- ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
147
- │ NestJS App │ │ Temporal Server │ │ Worker Process │
148
- │ │ │ │ │ │
149
- │ ┌─────────────┐ │ │ ┌──────────────┐ │ │ ┌─────────────┐ │
150
- │ │ Controllers │ │───▶│ │ Workflows │ │───▶│ │ Activities │ │
151
- │ │ Services │ │ │ Schedules │ │ │ │ Workers │ │
152
- │ └─────────────┘ │ └──────────────┘ │ │ └─────────────┘ │
153
- └─────────────────┘ └──────────────────┘ └─────────────────┘
188
+
189
+ ### Worker-Only Mode
190
+
191
+ ```typescript
192
+ TemporalModule.forWorker({
193
+ connection: {
194
+ address: 'localhost:7233',
195
+ namespace: 'development',
196
+ },
197
+ taskQueue: 'worker-queue',
198
+ workflowsPath: './dist/workflows',
199
+ activityClasses: [ProcessingActivities],
200
+ });
154
201
  ```
155
202
 
156
- ## 🎯 Use Cases
203
+ ### Async Configuration
204
+
205
+ ```typescript
206
+ TemporalModule.registerAsync({
207
+ imports: [ConfigModule],
208
+ useFactory: (config: ConfigService) => ({
209
+ connection: {
210
+ address: config.get('TEMPORAL_ADDRESS'),
211
+ namespace: config.get('TEMPORAL_NAMESPACE'),
212
+ },
213
+ taskQueue: config.get('TEMPORAL_TASK_QUEUE'),
214
+ worker: {
215
+ workflowsPath: './dist/workflows',
216
+ activityClasses: [EmailActivities],
217
+ },
218
+ }),
219
+ inject: [ConfigService],
220
+ });
221
+ ```
157
222
 
158
- - **Order Processing** - Reliable order fulfillment with compensation
159
- - **Payment Processing** - Multi-step payment flows with retries
160
- - **Data Pipelines** - Long-running data processing workflows
161
- - **Scheduled Jobs** - Cron-based and interval-based background tasks
162
- - **Saga Patterns** - Distributed transaction management
163
- - **Human Tasks** - Workflows requiring human intervention
164
- - **Microservice Orchestration** - Coordinating multiple services
223
+ ## 📋 Core Concepts
165
224
 
166
- ## 🌟 What's New in v3.0
225
+ ### Auto-Discovery
226
+ The module automatically discovers and registers:
227
+ - **Activity Classes** marked with `@Activity`
228
+ - **Scheduled Workflows** marked with `@Cron` or `@Interval`
229
+ - **Signals and Queries** within classes
167
230
 
168
- - **🎮 Workflow Controllers** - NestJS-style workflow definition
169
- - **📅 Declarative Scheduling** - `@Cron` and `@Interval` decorators
170
- - **🔍 Auto-Discovery** - Automatic workflow and schedule detection
171
- - **📊 Enhanced Monitoring** - Built-in health checks and metrics
172
- - **🏭 Production Features** - Worker presets, graceful shutdown, error handling
173
- - **🔧 Better Developer Experience** - Improved APIs and TypeScript support
231
+ ### Scheduling Made Simple
232
+ ```typescript
233
+ // Just add the decorator - schedule is created automatically!
234
+ @Cron('0 8 * * *', { scheduleId: 'daily-report' })
235
+ async generateReport(): Promise<void> {
236
+ // This will run every day at 8 AM
237
+ }
238
+ ```
174
239
 
175
- ## 📦 Packages
240
+ ## 🔧 Common Use Cases
176
241
 
177
- | Package | Version | Description |
178
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------ |
179
- | `nestjs-temporal-core` | [![npm](https://img.shields.io/npm/v/nestjs-temporal-core.svg)](https://www.npmjs.com/package/nestjs-temporal-core) | Main integration package |
180
- | `@temporalio/client` | [![npm](https://img.shields.io/npm/v/@temporalio/client.svg)](https://www.npmjs.com/package/@temporalio/client) | Temporal client library |
181
- | `@temporalio/worker` | [![npm](https://img.shields.io/npm/v/@temporalio/worker.svg)](https://www.npmjs.com/package/@temporalio/worker) | Temporal worker library |
182
- | `@temporalio/workflow` | [![npm](https://img.shields.io/npm/v/@temporalio/workflow.svg)](https://www.npmjs.com/package/@temporalio/workflow) | Workflow runtime library |
242
+ ### Scheduled Reports
243
+ ```typescript
244
+ @Injectable()
245
+ export class ReportService {
246
+ @Cron('0 0 * * 0', { scheduleId: 'weekly-sales-report' })
247
+ async generateWeeklySalesReport(): Promise<void> {
248
+ // Automatically runs every Sunday at midnight
249
+ console.log('Generating weekly sales report...');
250
+ }
251
+ }
252
+ ```
183
253
 
184
- ## 🤝 Community
254
+ ### Data Processing
255
+ ```typescript
256
+ @Injectable()
257
+ @Activity()
258
+ export class DataProcessingActivities {
259
+ @ActivityMethod()
260
+ async processFile(filePath: string): Promise<string> {
261
+ console.log(`Processing file: ${filePath}`);
262
+ // File processing logic
263
+ return 'processed';
264
+ }
265
+
266
+ @ActivityMethod()
267
+ async sendNotification(message: string): Promise<void> {
268
+ console.log(`Sending notification: ${message}`);
269
+ // Notification logic
270
+ }
271
+ }
272
+ ```
185
273
 
186
- - **GitHub Discussions** - Ask questions and share ideas
187
- - **Issues** - Report bugs and request features
188
- - **Pull Requests** - Contribute to the project
274
+ ### Monitoring Tasks
275
+ ```typescript
276
+ @Injectable()
277
+ export class MonitoringService {
278
+ @Interval('5m', {
279
+ scheduleId: 'health-check',
280
+ description: 'Health check every 5 minutes'
281
+ })
282
+ async healthCheck(): Promise<void> {
283
+ console.log('Running health check...');
284
+ // Health check logic
285
+ }
286
+ }
287
+ ```
189
288
 
190
- ## 📄 License
289
+ ## 📊 Monitoring & Health Checks
191
290
 
192
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
291
+ ```typescript
292
+ @Injectable()
293
+ export class MonitoringService {
294
+ constructor(private readonly temporal: TemporalService) {}
295
+
296
+ async getSystemHealth() {
297
+ // Comprehensive health status
298
+ const health = await this.temporal.getOverallHealth();
299
+ return {
300
+ status: health.status, // 'healthy' | 'degraded' | 'unhealthy'
301
+ components: health.components,
302
+ };
303
+ }
304
+
305
+ async getDiscoveryInfo() {
306
+ // What was discovered
307
+ const schedules = this.temporal.getManagedSchedules();
308
+ const stats = this.temporal.getDiscoveryStats();
309
+
310
+ return { schedules, stats };
311
+ }
312
+
313
+ async manageSchedules() {
314
+ // Schedule management
315
+ await this.temporal.pauseSchedule('daily-report', 'Maintenance');
316
+ await this.temporal.resumeSchedule('daily-report');
317
+ await this.temporal.triggerSchedule('daily-report'); // Run now
318
+ }
319
+ }
320
+ ```
193
321
 
194
- ## 👨‍💻 Author
322
+ ## 🌟 Why This Package?
195
323
 
196
- **Harsh M** - [GitHub](https://github.com/harsh-simform)
324
+ - **🎯 NestJS First** - Built specifically for NestJS with familiar patterns
325
+ - **🔄 Auto-Discovery** - No manual registration, just use decorators
326
+ - **📅 Built-in Scheduling** - Cron jobs that integrate with workflows
327
+ - **🔧 Production Ready** - Health checks, monitoring, graceful shutdowns
328
+ - **📚 Easy to Learn** - Familiar NestJS service patterns
329
+ - **🚀 Scalable** - Client-only, worker-only, or unified deployments
197
330
 
198
- ## 🙏 Acknowledgments
331
+ ## 🤝 Contributing
199
332
 
200
- - [Temporal.io](https://temporal.io/) - For the amazing workflow engine
201
- - [NestJS](https://nestjs.com/) - For the incredible framework
202
- - [TypeScript](https://www.typescriptlang.org/) - For making JavaScript enjoyable
333
+ Contributions welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.
203
334
 
204
- ---
335
+ ## 📄 License
205
336
 
206
- **[📚 Continue to Getting Started →](./docs/getting-started.md)**
337
+ MIT License - see [LICENSE](LICENSE) file for details.
@@ -1,12 +1,18 @@
1
1
  import { DynamicModule } from '@nestjs/common';
2
- import { TemporalClientOptions, TemporalClientAsyncOptions } from '../interfaces';
2
+ import { TemporalAsyncOptions, TemporalOptions } from '../interfaces';
3
3
  export declare class TemporalClientModule {
4
4
  private static readonly logger;
5
- static register(options: TemporalClientOptions): DynamicModule;
6
- static registerAsync(options: TemporalClientAsyncOptions): DynamicModule;
5
+ static register(options: TemporalOptions): DynamicModule;
6
+ static registerAsync(options: TemporalAsyncOptions): DynamicModule;
7
+ static forClient(options: {
8
+ connection: TemporalOptions['connection'];
9
+ isGlobal?: boolean;
10
+ }): DynamicModule;
7
11
  private static createClientProvider;
8
12
  private static createAsyncClientProvider;
9
13
  private static createAsyncProviders;
10
14
  private static createClientInstance;
11
15
  private static enhanceClientWithShutdown;
16
+ private static extractClientOptions;
17
+ private static validateOptions;
12
18
  }
@@ -15,18 +15,19 @@ const temporal_client_service_1 = require("./temporal-client.service");
15
15
  const temporal_schedule_service_1 = require("./temporal-schedule.service");
16
16
  let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
17
17
  static register(options) {
18
+ const clientOptions = this.extractClientOptions(options);
18
19
  return {
19
20
  module: TemporalClientModule_1,
20
21
  providers: [
21
22
  {
22
- provide: constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS,
23
- useValue: options,
23
+ provide: constants_1.TEMPORAL_MODULE_OPTIONS,
24
+ useValue: clientOptions,
24
25
  },
25
- this.createClientProvider(options),
26
+ this.createClientProvider(clientOptions),
26
27
  temporal_client_service_1.TemporalClientService,
27
28
  temporal_schedule_service_1.TemporalScheduleService,
28
29
  ],
29
- exports: [temporal_client_service_1.TemporalClientService, temporal_schedule_service_1.TemporalScheduleService],
30
+ exports: [temporal_client_service_1.TemporalClientService, temporal_schedule_service_1.TemporalScheduleService, constants_1.TEMPORAL_CLIENT],
30
31
  };
31
32
  }
32
33
  static registerAsync(options) {
@@ -39,9 +40,15 @@ let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
39
40
  temporal_client_service_1.TemporalClientService,
40
41
  temporal_schedule_service_1.TemporalScheduleService,
41
42
  ],
42
- exports: [temporal_client_service_1.TemporalClientService, temporal_schedule_service_1.TemporalScheduleService],
43
+ exports: [temporal_client_service_1.TemporalClientService, temporal_schedule_service_1.TemporalScheduleService, constants_1.TEMPORAL_CLIENT],
43
44
  };
44
45
  }
46
+ static forClient(options) {
47
+ return this.register({
48
+ connection: options.connection,
49
+ isGlobal: options.isGlobal,
50
+ });
51
+ }
45
52
  static createClientProvider(options) {
46
53
  return {
47
54
  provide: constants_1.TEMPORAL_CLIENT,
@@ -51,15 +58,18 @@ let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
51
58
  static createAsyncClientProvider() {
52
59
  return {
53
60
  provide: constants_1.TEMPORAL_CLIENT,
54
- useFactory: async (clientOptions) => this.createClientInstance(clientOptions),
55
- inject: [constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS],
61
+ useFactory: async (temporalOptions) => {
62
+ const clientOptions = this.extractClientOptions(temporalOptions);
63
+ return this.createClientInstance(clientOptions);
64
+ },
65
+ inject: [constants_1.TEMPORAL_MODULE_OPTIONS],
56
66
  };
57
67
  }
58
68
  static createAsyncProviders(options) {
59
69
  if (options.useFactory) {
60
70
  return [
61
71
  {
62
- provide: constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS,
72
+ provide: constants_1.TEMPORAL_MODULE_OPTIONS,
63
73
  useFactory: options.useFactory,
64
74
  inject: options.inject || [],
65
75
  },
@@ -68,8 +78,8 @@ let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
68
78
  if (options.useClass) {
69
79
  return [
70
80
  {
71
- provide: constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS,
72
- useFactory: async (optionsFactory) => optionsFactory.createClientOptions(),
81
+ provide: constants_1.TEMPORAL_MODULE_OPTIONS,
82
+ useFactory: async (optionsFactory) => optionsFactory.createTemporalOptions(),
73
83
  inject: [options.useClass],
74
84
  },
75
85
  {
@@ -81,8 +91,8 @@ let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
81
91
  if (options.useExisting) {
82
92
  return [
83
93
  {
84
- provide: constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS,
85
- useFactory: async (optionsFactory) => optionsFactory.createClientOptions(),
94
+ provide: constants_1.TEMPORAL_MODULE_OPTIONS,
95
+ useFactory: async (optionsFactory) => optionsFactory.createTemporalOptions(),
86
96
  inject: [options.useExisting],
87
97
  },
88
98
  ];
@@ -105,7 +115,7 @@ let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
105
115
  };
106
116
  }
107
117
  connection = await client_1.Connection.connect(connectionConfig);
108
- const namespace = options.namespace || constants_1.DEFAULT_NAMESPACE;
118
+ const namespace = options.connection.namespace || constants_1.DEFAULT_NAMESPACE;
109
119
  this.logger.log(`Connected to Temporal server, using namespace "${namespace}"`);
110
120
  const client = new client_1.Client({ connection, namespace });
111
121
  return this.enhanceClientWithShutdown(client);
@@ -141,6 +151,26 @@ let TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
141
151
  };
142
152
  return enhancedClient;
143
153
  }
154
+ static extractClientOptions(options) {
155
+ return {
156
+ connection: {
157
+ address: options.connection.address,
158
+ namespace: options.connection.namespace,
159
+ tls: options.connection.tls,
160
+ apiKey: options.connection.apiKey,
161
+ metadata: options.connection.metadata,
162
+ },
163
+ allowConnectionFailure: true,
164
+ };
165
+ }
166
+ static validateOptions(options) {
167
+ if (!options.connection) {
168
+ throw new Error('Connection configuration is required');
169
+ }
170
+ if (!options.connection.address) {
171
+ throw new Error('Connection address is required');
172
+ }
173
+ }
144
174
  };
145
175
  exports.TemporalClientModule = TemporalClientModule;
146
176
  TemporalClientModule.logger = new common_1.Logger(TemporalClientModule_1.name);
@@ -1 +1 @@
1
- {"version":3,"file":"temporal-client.module.js","sourceRoot":"","sources":["../../src/client/temporal-client.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAOwB;AACxB,+CAAwD;AAMxD,4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