nestjs-temporal-core 2.0.0 → 2.0.2

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 (50) hide show
  1. package/README.md +55 -17
  2. package/dist/client/index.d.ts +2 -0
  3. package/dist/client/index.js +19 -0
  4. package/dist/client/index.js.map +1 -0
  5. package/dist/{temporal-client.module.d.ts → client/temporal-client.module.d.ts} +1 -1
  6. package/dist/{temporal-client.module.js → client/temporal-client.module.js} +29 -31
  7. package/dist/client/temporal-client.module.js.map +1 -0
  8. package/dist/{temporal-client.service.d.ts → client/temporal-client.service.d.ts} +5 -3
  9. package/dist/{temporal-client.service.js → client/temporal-client.service.js} +22 -44
  10. package/dist/client/temporal-client.service.js.map +1 -0
  11. package/dist/constants.d.ts +9 -5
  12. package/dist/constants.js +10 -6
  13. package/dist/constants.js.map +1 -1
  14. package/dist/decorators/activity-method.decorator.d.ts +1 -4
  15. package/dist/decorators/activity-method.decorator.js +6 -4
  16. package/dist/decorators/activity-method.decorator.js.map +1 -1
  17. package/dist/decorators/activity.decorator.d.ts +1 -4
  18. package/dist/decorators/activity.decorator.js +3 -5
  19. package/dist/decorators/activity.decorator.js.map +1 -1
  20. package/dist/decorators/index.d.ts +0 -1
  21. package/dist/decorators/index.js +0 -1
  22. package/dist/decorators/index.js.map +1 -1
  23. package/dist/decorators/workflow.decorator.js.map +1 -1
  24. package/dist/index.d.ts +2 -3
  25. package/dist/index.js +2 -3
  26. package/dist/index.js.map +1 -1
  27. package/dist/interfaces/worker.interface.d.ts +1 -0
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/worker/index.d.ts +3 -0
  30. package/dist/worker/index.js +20 -0
  31. package/dist/worker/index.js.map +1 -0
  32. package/dist/worker/temporal-metadata.accessor.d.ts +5 -0
  33. package/dist/{temporal-metadata.accessor.js → worker/temporal-metadata.accessor.js} +2 -2
  34. package/dist/worker/temporal-metadata.accessor.js.map +1 -0
  35. package/dist/{temporal-worker.module.d.ts → worker/temporal-worker.module.d.ts} +1 -2
  36. package/dist/worker/temporal-worker.module.js +89 -0
  37. package/dist/worker/temporal-worker.module.js.map +1 -0
  38. package/dist/worker/worker-manager.service.d.ts +24 -0
  39. package/dist/worker/worker-manager.service.js +122 -0
  40. package/dist/worker/worker-manager.service.js.map +1 -0
  41. package/package.json +23 -24
  42. package/dist/decorators/inject-temporal-client.decorator.d.ts +0 -1
  43. package/dist/decorators/inject-temporal-client.decorator.js +0 -8
  44. package/dist/decorators/inject-temporal-client.decorator.js.map +0 -1
  45. package/dist/temporal-client.module.js.map +0 -1
  46. package/dist/temporal-client.service.js.map +0 -1
  47. package/dist/temporal-metadata.accessor.d.ts +0 -5
  48. package/dist/temporal-metadata.accessor.js.map +0 -1
  49. package/dist/temporal-worker.module.js +0 -270
  50. package/dist/temporal-worker.module.js.map +0 -1
package/README.md CHANGED
@@ -10,6 +10,10 @@ A NestJS integration for [Temporal.io](https://temporal.io/) that provides seaml
10
10
  - 🔌 Built-in connection management
11
11
  - 🛡️ Type-safe workflow execution
12
12
  - 📡 Simplified client operations
13
+ - 🔒 TLS support for secure connections
14
+ - 🎛️ Configurable runtime options
15
+ - 🔄 Enhanced worker options customization
16
+ - 📊 Worker status monitoring
13
17
 
14
18
  ## Installation
15
19
 
@@ -19,7 +23,20 @@ npm install nestjs-temporal-core @temporalio/client @temporalio/worker @temporal
19
23
 
20
24
  ## Quick Start
21
25
 
22
- ### 1. Register the Module
26
+ ### 1. Enable Shutdown Hooks
27
+
28
+ First, make sure to enable shutdown hooks in your `main.ts` file:
29
+
30
+ ```typescript
31
+ async function bootstrap() {
32
+ const app = await NestFactory.create(AppModule);
33
+ app.enableShutdownHooks();
34
+ await app.listen(3000);
35
+ }
36
+ bootstrap();
37
+ ```
38
+
39
+ ### 2. Register the Module
23
40
 
24
41
  ```typescript
25
42
  import { Module } from '@nestjs/common';
@@ -35,6 +52,14 @@ import { TemporalWorkerModule, TemporalClientModule } from 'nestjs-temporal-core
35
52
  taskQueue: 'my-task-queue',
36
53
  workflowsPath: require.resolve('./workflows'),
37
54
  activityClasses: [MyActivity],
55
+ // New: Optional runtime configuration
56
+ runtimeOptions: {
57
+ // Add your runtime options here
58
+ },
59
+ // New: Optional worker configuration
60
+ workerOptions: {
61
+ // Add your worker options here
62
+ },
38
63
  }),
39
64
  TemporalClientModule.register({
40
65
  connection: {
@@ -47,7 +72,7 @@ import { TemporalWorkerModule, TemporalClientModule } from 'nestjs-temporal-core
47
72
  export class AppModule {}
48
73
  ```
49
74
 
50
- ### 2. Define Activities
75
+ ### 3. Define Activities
51
76
 
52
77
  ```typescript
53
78
  import { Activity, ActivityMethod } from 'nestjs-temporal-core';
@@ -62,7 +87,7 @@ export class PaymentActivity {
62
87
  }
63
88
  ```
64
89
 
65
- ### 3. Define Workflows
90
+ ### 4. Define Workflows
66
91
 
67
92
  ```typescript
68
93
  import { proxyActivities } from '@temporalio/workflow';
@@ -77,7 +102,7 @@ export async function paymentWorkflow(amount: number): Promise<string> {
77
102
  }
78
103
  ```
79
104
 
80
- ### 4. Use the Client Service
105
+ ### 5. Use the Client Service
81
106
 
82
107
  ```typescript
83
108
  import { Injectable } from '@nestjs/common';
@@ -88,7 +113,7 @@ export class PaymentService {
88
113
  constructor(private readonly temporalClient: TemporalClientService) {}
89
114
 
90
115
  async initiatePayment(amount: number) {
91
- const { result } = await this.temporalClient.startWorkflow<string, [number]>(
116
+ const { result, handle } = await this.temporalClient.startWorkflow<string, [number]>(
92
117
  'paymentWorkflow',
93
118
  [amount],
94
119
  {
@@ -115,6 +140,12 @@ TemporalWorkerModule.registerAsync({
115
140
  taskQueue: configService.get('TEMPORAL_TASK_QUEUE'),
116
141
  workflowsPath: require.resolve('./workflows'),
117
142
  activityClasses: [MyActivity],
143
+ runtimeOptions: {
144
+ // Add runtime options
145
+ },
146
+ workerOptions: {
147
+ // Add worker options
148
+ },
118
149
  }),
119
150
  inject: [ConfigService],
120
151
  });
@@ -142,9 +173,8 @@ TemporalClientModule.register({
142
173
  ### Decorators
143
174
 
144
175
  - `@Activity()`: Marks a class as a Temporal activity
145
- - `@ActivityMethod()`: Marks a method as a Temporal activity implementation
146
- - `@Workflow()`: Marks a class as a Temporal workflow
147
- - `@InjectTemporalClient()`: Injects the Temporal client instance
176
+ - `@ActivityMethod(name?: string)`: Marks a method as a Temporal activity implementation with optional custom name
177
+ - `@Workflow(options?: WorkflowOptions)`: Marks a class as a Temporal workflow with optional configuration
148
178
 
149
179
  ### Services
150
180
 
@@ -154,6 +184,14 @@ TemporalClientModule.register({
154
184
  - `signalWorkflow()`: Send a signal to a running workflow
155
185
  - `terminateWorkflow()`: Terminate a running workflow
156
186
  - `getWorkflowHandle()`: Get a handle to manage a workflow
187
+ - `getWorkflowClient()`: Get the underlying workflow client instance
188
+
189
+ #### WorkerManager
190
+
191
+ - `getStatus()`: Get the current status of the worker including:
192
+ - isRunning: boolean
193
+ - taskQueue: string
194
+ - namespace: string
157
195
 
158
196
  ### Module Options
159
197
 
@@ -167,6 +205,7 @@ interface TemporalWorkerOptions {
167
205
  workflowsPath: string;
168
206
  activityClasses?: Array<new (...args: any[]) => any>;
169
207
  runtimeOptions?: RuntimeOptions;
208
+ workerOptions?: WorkerOptions;
170
209
  }
171
210
  ```
172
211
 
@@ -181,16 +220,12 @@ interface TemporalClientOptions {
181
220
 
182
221
  ## Error Handling
183
222
 
184
- The module provides built-in error handling and logging. Worker and client errors are logged using NestJS's built-in logger.
223
+ The module includes comprehensive error handling:
185
224
 
186
- ## Health Checks
187
-
188
- The WorkerManager provides a `getStatus()` method to check the worker's health:
189
-
190
- ```typescript
191
- const status = await workerManager.getStatus();
192
- // Returns: { isRunning: boolean; isInitializing: boolean; error: Error | null }
193
- ```
225
+ - Worker initialization errors are logged and can prevent application startup if critical
226
+ - Client operations include detailed error messages and proper error propagation
227
+ - Activity and workflow errors are properly captured and logged
228
+ - Connection errors are handled gracefully with automatic cleanup
194
229
 
195
230
  ## Best Practices
196
231
 
@@ -199,6 +234,9 @@ const status = await workerManager.getStatus();
199
234
  3. Implement proper error handling in activities
200
235
  4. Set appropriate timeouts for activities and workflows
201
236
  5. Use signals for long-running workflow coordination
237
+ 6. Monitor worker status using the WorkerManager service
238
+ 7. Configure appropriate runtime and worker options for production deployments
239
+ 8. Implement proper TLS security for production environments
202
240
 
203
241
  ## Contributing
204
242
 
@@ -0,0 +1,2 @@
1
+ export * from './temporal-client.module';
2
+ export * from './temporal-client.service';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./temporal-client.module"), exports);
18
+ __exportStar(require("./temporal-client.service"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C"}
@@ -1,5 +1,5 @@
1
1
  import { DynamicModule } from '@nestjs/common';
2
- import { TemporalClientOptions, TemporalClientAsyncOptions } from './interfaces';
2
+ import { TemporalClientOptions, TemporalClientAsyncOptions } from '../interfaces';
3
3
  export declare class TemporalClientModule {
4
4
  private static readonly logger;
5
5
  private static createClient;
@@ -10,41 +10,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.TemporalClientModule = void 0;
11
11
  const common_1 = require("@nestjs/common");
12
12
  const client_1 = require("@temporalio/client");
13
- const constants_1 = require("./constants");
13
+ const constants_1 = require("../constants");
14
14
  const temporal_client_service_1 = require("./temporal-client.service");
15
15
  let TemporalClientModule = exports.TemporalClientModule = TemporalClientModule_1 = class TemporalClientModule {
16
16
  static async createClient(options) {
17
- this.logger.log('Initializing Temporal client', {
18
- address: options.connection.address,
19
- namespace: options.namespace || 'default',
20
- });
17
+ let connection = null;
21
18
  try {
22
- const connection = await client_1.Connection.connect({
19
+ connection = await client_1.Connection.connect({
23
20
  address: options.connection.address,
24
21
  tls: options.connection.tls,
25
22
  });
26
- const client = new client_1.Client({
23
+ return new client_1.Client({
27
24
  connection,
28
25
  namespace: options.namespace || 'default',
29
26
  });
30
- this.logger.log('Temporal client initialized successfully');
31
- return client;
32
27
  }
33
28
  catch (error) {
34
- this.logger.error('Failed to initialize Temporal client', {
35
- error: error.message,
36
- stack: error.stack,
37
- address: options.connection.address,
38
- });
39
- throw error;
29
+ if (connection) {
30
+ await connection.close().catch(() => {
31
+ });
32
+ }
33
+ throw new Error(`Temporal client initialization failed: ${error.message}`);
40
34
  }
41
35
  }
42
36
  static register(options) {
43
37
  const clientProvider = {
44
38
  provide: constants_1.TEMPORAL_CLIENT,
45
39
  useFactory: async () => {
46
- const client = await this.createClient(options);
47
- return this.addShutdownHook(client);
40
+ try {
41
+ const client = await this.createClient(options);
42
+ return this.addShutdownHook(client);
43
+ }
44
+ catch (error) {
45
+ this.logger.error('Failed to initialize Temporal client', { error: error.message });
46
+ return null;
47
+ }
48
48
  },
49
49
  };
50
50
  return {
@@ -64,8 +64,14 @@ let TemporalClientModule = exports.TemporalClientModule = TemporalClientModule_1
64
64
  const clientProvider = {
65
65
  provide: constants_1.TEMPORAL_CLIENT,
66
66
  useFactory: async (clientOptions) => {
67
- const client = await this.createClient(clientOptions);
68
- return this.addShutdownHook(client);
67
+ try {
68
+ const client = await this.createClient(clientOptions);
69
+ return this.addShutdownHook(client);
70
+ }
71
+ catch (error) {
72
+ this.logger.error('Failed to initialize Temporal client', { error: error.message });
73
+ return null;
74
+ }
69
75
  },
70
76
  inject: [constants_1.TEMPORAL_MODULE_OPTIONS],
71
77
  };
@@ -108,22 +114,14 @@ let TemporalClientModule = exports.TemporalClientModule = TemporalClientModule_1
108
114
  },
109
115
  ];
110
116
  }
111
- const error = new Error('Invalid TemporalClientAsyncOptions configuration');
112
- this.logger.error(error.message);
113
- throw error;
117
+ throw new Error('Invalid TemporalClientAsyncOptions configuration');
114
118
  }
115
119
  static addShutdownHook(client) {
116
120
  const enhancedClient = client;
117
121
  enhancedClient.onApplicationShutdown = async () => {
118
- try {
119
- this.logger.log('Closing Temporal client connection');
120
- await client.connection?.close();
121
- this.logger.log('Temporal client connection closed successfully');
122
- }
123
- catch (error) {
124
- this.logger.error('Failed to close Temporal client connection', {
125
- error: error.message,
126
- stack: error.stack,
122
+ if (client?.connection) {
123
+ await client.connection.close().catch((error) => {
124
+ this.logger.error('Failed to close Temporal connection', { error: error.message });
127
125
  });
128
126
  }
129
127
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-client.module.js","sourceRoot":"","sources":["../../src/client/temporal-client.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAOwB;AACxB,+CAAwD;AAMxD,4CAAwE;AACxE,uEAAkE;AAI3D,IAAM,oBAAoB,2DAA1B,MAAM,oBAAoB;IAGvB,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAA8B;QAC9D,IAAI,UAAU,GAAsB,IAAI,CAAC;QACzC,IAAI;YACF,UAAU,GAAG,MAAM,mBAAU,CAAC,OAAO,CAAC;gBACpC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACnC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;aAC5B,CAAC,CAAC;YAEH,OAAO,IAAI,eAAM,CAAC;gBAChB,UAAU;gBACV,SAAS,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BAAmB,EAAE;oBAC5C,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;iBAC9B;aACF,CAAC;SACH;QAED,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IAEO,MAAM,CAAC,eAAe,CAAC,MAAc;QAC3C,MAAM,cAAc,GAAG,MAAwC,CAAC;QAChE,cAAc,CAAC,qBAAqB,GAAG,KAAK,IAAI,EAAE;YAChD,IAAI,MAAM,EAAE,UAAU,EAAE;gBACtB,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBACrF,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;QACF,OAAO,cAAc,CAAC;IACxB,CAAC;;AA/HuB,2BAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,AAAxC,CAAyC;+BAD5D,oBAAoB;IAFhC,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,oBAAoB,CAiIhC"}
@@ -1,11 +1,13 @@
1
+ import { OnModuleInit } from '@nestjs/common';
1
2
  import { Client, WorkflowClient, WorkflowHandle } from '@temporalio/client';
2
- export declare class TemporalClientService {
3
+ export declare class TemporalClientService implements OnModuleInit {
3
4
  private readonly client;
4
5
  private readonly logger;
5
6
  private workflowClient;
6
- constructor(client: Client);
7
+ constructor(client: Client | null);
7
8
  onModuleInit(): Promise<void>;
8
- getWorkflowClient(): WorkflowClient;
9
+ getWorkflowClient(): WorkflowClient | null;
10
+ private ensureClientInitialized;
9
11
  startWorkflow<T, A extends any[]>(workflowType: string, args: A, options: {
10
12
  taskQueue: string;
11
13
  workflowId?: string;
@@ -15,36 +15,38 @@ var TemporalClientService_1;
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.TemporalClientService = void 0;
17
17
  const common_1 = require("@nestjs/common");
18
- const client_1 = require("@temporalio/client");
19
- const constants_1 = require("./constants");
18
+ const constants_1 = require("../constants");
20
19
  let TemporalClientService = exports.TemporalClientService = TemporalClientService_1 = class TemporalClientService {
21
20
  constructor(client) {
22
21
  this.client = client;
23
22
  this.logger = new common_1.Logger(TemporalClientService_1.name);
24
- this.workflowClient = this.client.workflow;
23
+ this.workflowClient = null;
24
+ if (this.client) {
25
+ this.workflowClient = this.client.workflow;
26
+ }
25
27
  }
26
28
  async onModuleInit() {
27
- this.logger.log('Temporal client service initialized');
29
+ if (!this.client) {
30
+ this.logger.warn('Temporal client not initialized - some features may be unavailable');
31
+ }
28
32
  }
29
33
  getWorkflowClient() {
30
34
  return this.workflowClient;
31
35
  }
36
+ ensureClientInitialized() {
37
+ if (!this.workflowClient) {
38
+ throw new Error('Temporal client not initialized');
39
+ }
40
+ }
32
41
  async startWorkflow(workflowType, args, options) {
42
+ this.ensureClientInitialized();
33
43
  const { taskQueue, workflowId = `${workflowType}-${Date.now()}-${Math.random().toString(36).slice(2)}`, } = options;
34
44
  try {
35
- this.logger.log(`Starting workflow "${workflowType}" on task queue "${taskQueue}"`, {
36
- workflowId,
37
- taskQueue,
38
- });
39
45
  const handle = await this.workflowClient.start(workflowType, {
40
46
  args,
41
47
  taskQueue,
42
48
  workflowId,
43
49
  });
44
- this.logger.debug(`Workflow "${workflowType}" started successfully`, {
45
- workflowId: handle.workflowId,
46
- runId: handle.firstExecutionRunId,
47
- });
48
50
  return {
49
51
  result: handle.result(),
50
52
  workflowId: handle.workflowId,
@@ -53,66 +55,42 @@ let TemporalClientService = exports.TemporalClientService = TemporalClientServic
53
55
  };
54
56
  }
55
57
  catch (error) {
56
- this.logger.error(`Failed to start workflow "${workflowType}"`, {
57
- error: error.message,
58
- stack: error.stack,
59
- workflowId,
60
- taskQueue,
61
- });
62
- throw error;
58
+ throw new Error(`Failed to start workflow '${workflowType}': ${error.message}`);
63
59
  }
64
60
  }
65
61
  async signalWorkflow(workflowId, signalName, args) {
62
+ this.ensureClientInitialized();
66
63
  try {
67
- this.logger.debug(`Sending signal "${signalName}" to workflow`, { workflowId });
68
64
  const handle = await this.workflowClient.getHandle(workflowId);
69
65
  await handle.signal(signalName, ...args);
70
- this.logger.debug(`Signal "${signalName}" sent successfully`, { workflowId });
71
66
  }
72
67
  catch (error) {
73
- this.logger.error(`Failed to send signal "${signalName}" to workflow`, {
74
- error: error.message,
75
- stack: error.stack,
76
- workflowId,
77
- args,
78
- });
79
- throw error;
68
+ throw new Error(`Failed to send signal '${signalName}' to workflow ${workflowId}: ${error.message}`);
80
69
  }
81
70
  }
82
71
  async terminateWorkflow(workflowId, reason) {
72
+ this.ensureClientInitialized();
83
73
  try {
84
- this.logger.log(`Terminating workflow`, { workflowId, reason });
85
74
  const handle = await this.workflowClient.getHandle(workflowId);
86
75
  await handle.terminate(reason);
87
- this.logger.debug(`Workflow terminated successfully`, { workflowId, reason });
88
76
  }
89
77
  catch (error) {
90
- this.logger.error(`Failed to terminate workflow`, {
91
- error: error.message,
92
- stack: error.stack,
93
- workflowId,
94
- reason,
95
- });
96
- throw error;
78
+ throw new Error(`Failed to terminate workflow ${workflowId}: ${error.message}`);
97
79
  }
98
80
  }
99
81
  async getWorkflowHandle(workflowId) {
82
+ this.ensureClientInitialized();
100
83
  try {
101
84
  return await this.workflowClient.getHandle(workflowId);
102
85
  }
103
86
  catch (error) {
104
- this.logger.error(`Failed to get workflow handle`, {
105
- error: error.message,
106
- stack: error.stack,
107
- workflowId,
108
- });
109
- throw error;
87
+ throw new Error(`Failed to get workflow handle for ${workflowId}: ${error.message}`);
110
88
  }
111
89
  }
112
90
  };
113
91
  exports.TemporalClientService = TemporalClientService = TemporalClientService_1 = __decorate([
114
92
  (0, common_1.Injectable)(),
115
93
  __param(0, (0, common_1.Inject)(constants_1.TEMPORAL_CLIENT)),
116
- __metadata("design:paramtypes", [client_1.Client])
94
+ __metadata("design:paramtypes", [Object])
117
95
  ], TemporalClientService);
118
96
  //# sourceMappingURL=temporal-client.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-client.service.js","sourceRoot":"","sources":["../../src/client/temporal-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA0E;AAE1E,4CAA+C;AAGxC,IAAM,qBAAqB,6DAA3B,MAAM,qBAAqB;IAIhC,YAEE,MAAsC;QAArB,WAAM,GAAN,MAAM,CAAe;QALvB,WAAM,GAAG,IAAI,eAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;QACzD,mBAAc,GAA0B,IAAI,CAAC;QAMnD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;SAC5C;IACH,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;SACxF;IACH,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAEO,uBAAuB;QAC7B,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACpD;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,YAAoB,EACpB,IAAO,EACP,OAIC;QAOD,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAE/B,MAAM,EACJ,SAAS,EACT,UAAU,GAAG,GAAG,YAAY,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GACpF,GAAG,OAAO,CAAC;QAEZ,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CA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BAAuB,EAAE,CAAC;QAE/B,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,cAAe,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,qCAAqC,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;SACtF;IACH,CAAC;CACF,CAAA;gCArGY,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,2BAAe,CAAC,CAAA;;GALf,qBAAqB,CAqGjC"}
@@ -1,5 +1,9 @@
1
- export declare const TEMPORAL_ACTIVITY: unique symbol;
2
- export declare const TEMPORAL_ACTIVITY_METHOD: unique symbol;
3
- export declare const TEMPORAL_WORKFLOW: unique symbol;
4
- export declare const TEMPORAL_CLIENT: unique symbol;
5
- export declare const TEMPORAL_MODULE_OPTIONS: unique symbol;
1
+ export declare const TEMPORAL_MODULE_OPTIONS = "TEMPORAL_MODULE_OPTIONS";
2
+ export declare const TEMPORAL_CLIENT_MODULE_OPTIONS = "TEMPORAL_CLIENT_MODULE_OPTIONS";
3
+ export declare const TEMPORAL_WORKER_MODULE_OPTIONS = "TEMPORAL_WORKER_MODULE_OPTIONS";
4
+ export declare const TEMPORAL_ACTIVITY = "TEMPORAL_ACTIVITY";
5
+ export declare const TEMPORAL_ACTIVITY_METHOD = "TEMPORAL_ACTIVITY_METHOD";
6
+ export declare const TEMPORAL_ACTIVITY_METHOD_NAME = "TEMPORAL_ACTIVITY_METHOD_NAME";
7
+ export declare const TEMPORAL_WORKFLOW = "TEMPORAL_WORKFLOW";
8
+ export declare const TEMPORAL_WORKFLOW_METHOD = "TEMPORAL_WORKFLOW_METHOD";
9
+ export declare const TEMPORAL_CLIENT = "TEMPORAL_CLIENT";
package/dist/constants.js CHANGED
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TEMPORAL_MODULE_OPTIONS = exports.TEMPORAL_CLIENT = exports.TEMPORAL_WORKFLOW = exports.TEMPORAL_ACTIVITY_METHOD = exports.TEMPORAL_ACTIVITY = void 0;
4
- exports.TEMPORAL_ACTIVITY = Symbol('TEMPORAL_ACTIVITY');
5
- exports.TEMPORAL_ACTIVITY_METHOD = Symbol('TEMPORAL_ACTIVITY_METHOD');
6
- exports.TEMPORAL_WORKFLOW = Symbol('TEMPORAL_WORKFLOW');
7
- exports.TEMPORAL_CLIENT = Symbol('TEMPORAL_CLIENT');
8
- exports.TEMPORAL_MODULE_OPTIONS = Symbol('TEMPORAL_MODULE_OPTIONS');
3
+ exports.TEMPORAL_CLIENT = exports.TEMPORAL_WORKFLOW_METHOD = exports.TEMPORAL_WORKFLOW = exports.TEMPORAL_ACTIVITY_METHOD_NAME = exports.TEMPORAL_ACTIVITY_METHOD = exports.TEMPORAL_ACTIVITY = exports.TEMPORAL_WORKER_MODULE_OPTIONS = exports.TEMPORAL_CLIENT_MODULE_OPTIONS = exports.TEMPORAL_MODULE_OPTIONS = void 0;
4
+ exports.TEMPORAL_MODULE_OPTIONS = 'TEMPORAL_MODULE_OPTIONS';
5
+ exports.TEMPORAL_CLIENT_MODULE_OPTIONS = 'TEMPORAL_CLIENT_MODULE_OPTIONS';
6
+ exports.TEMPORAL_WORKER_MODULE_OPTIONS = 'TEMPORAL_WORKER_MODULE_OPTIONS';
7
+ exports.TEMPORAL_ACTIVITY = 'TEMPORAL_ACTIVITY';
8
+ exports.TEMPORAL_ACTIVITY_METHOD = 'TEMPORAL_ACTIVITY_METHOD';
9
+ exports.TEMPORAL_ACTIVITY_METHOD_NAME = 'TEMPORAL_ACTIVITY_METHOD_NAME';
10
+ exports.TEMPORAL_WORKFLOW = 'TEMPORAL_WORKFLOW';
11
+ exports.TEMPORAL_WORKFLOW_METHOD = 'TEMPORAL_WORKFLOW_METHOD';
12
+ exports.TEMPORAL_CLIENT = 'TEMPORAL_CLIENT';
9
13
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAChD,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAC9D,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAChD,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC5C,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AACpD,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAClE,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAGlE,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,6BAA6B,GAAG,+BAA+B,CAAC;AAGhE,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AAGtD,QAAA,eAAe,GAAG,iBAAiB,CAAC"}
@@ -1,4 +1 @@
1
- export interface ActivityMethodOptions {
2
- name?: string;
3
- }
4
- export declare function ActivityMethod(options?: ActivityMethodOptions): MethodDecorator;
1
+ export declare const ActivityMethod: (name?: string) => MethodDecorator;
@@ -3,13 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActivityMethod = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const constants_1 = require("../constants");
6
- function ActivityMethod(options = {}) {
6
+ const ActivityMethod = (name) => {
7
7
  return (target, propertyKey, descriptor) => {
8
+ const methodName = name || propertyKey.toString();
9
+ Reflect.defineMetadata(constants_1.TEMPORAL_ACTIVITY_METHOD, true, descriptor.value);
10
+ Reflect.defineMetadata(constants_1.TEMPORAL_ACTIVITY_METHOD_NAME, methodName, descriptor.value);
8
11
  (0, common_1.SetMetadata)(constants_1.TEMPORAL_ACTIVITY_METHOD, true)(descriptor.value);
9
- const methodName = options.name || propertyKey.toString();
10
- Reflect.defineMetadata('activityMethodName', methodName, descriptor.value);
12
+ (0, common_1.SetMetadata)(constants_1.TEMPORAL_ACTIVITY_METHOD_NAME, methodName)(descriptor.value);
11
13
  return descriptor;
12
14
  };
13
- }
15
+ };
14
16
  exports.ActivityMethod = ActivityMethod;
15
17
  //# sourceMappingURL=activity-method.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"activity-method.decorator.js","sourceRoot":"","sources":["../../src/decorators/activity-method.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAwD;AAMxD,SAAgB,cAAc,CAAC,UAAiC,EAAE;IAChE,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACnF,IAAA,oBAAW,EAAC,oCAAwB,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAG9D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC1D,OAAO,CAAC,cAAc,CAAC,oBAAoB,EAAE,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAE3E,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAVD,wCAUC"}
1
+ {"version":3,"file":"activity-method.decorator.js","sourceRoot":"","sources":["../../src/decorators/activity-method.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAuF;AAMhF,MAAM,cAAc,GAAG,CAAC,IAAa,EAAmB,EAAE;IAC/D,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACnF,MAAM,UAAU,GAAG,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAElD,OAAO,CAAC,cAAc,CAAC,oCAAwB,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACzE,OAAO,CAAC,cAAc,CAAC,yCAA6B,EAAE,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAEpF,IAAA,oBAAW,EAAC,oCAAwB,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC9D,IAAA,oBAAW,EAAC,yCAA6B,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAEzE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,cAAc,kBAYzB"}
@@ -1,4 +1 @@
1
- export interface ActivityOptions {
2
- name?: string;
3
- }
4
- export declare function Activity(options?: ActivityOptions): ClassDecorator;
1
+ export declare const Activity: () => ClassDecorator;
@@ -3,14 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Activity = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const constants_1 = require("../constants");
6
- function Activity(options = {}) {
6
+ const Activity = () => {
7
7
  return (target) => {
8
+ Reflect.defineMetadata(constants_1.TEMPORAL_ACTIVITY, true, target);
8
9
  (0, common_1.SetMetadata)(constants_1.TEMPORAL_ACTIVITY, true)(target);
9
- if (options.name) {
10
- Reflect.defineMetadata('activityName', options.name, target);
11
- }
12
10
  return target;
13
11
  };
14
- }
12
+ };
15
13
  exports.Activity = Activity;
16
14
  //# sourceMappingURL=activity.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"activity.decorator.js","sourceRoot":"","sources":["../../src/decorators/activity.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAiD;AAMjD,SAAgB,QAAQ,CAAC,UAA2B,EAAE;IACpD,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,IAAA,oBAAW,EAAC,6BAAiB,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,OAAO,CAAC,IAAI,EAAE;YAChB,OAAO,CAAC,cAAc,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC9D;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AARD,4BAQC"}
1
+ {"version":3,"file":"activity.decorator.js","sourceRoot":"","sources":["../../src/decorators/activity.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAiD;AAK1C,MAAM,QAAQ,GAAG,GAAmB,EAAE;IAC3C,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,OAAO,CAAC,cAAc,CAAC,6BAAiB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACxD,IAAA,oBAAW,EAAC,6BAAiB,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB"}
@@ -1,4 +1,3 @@
1
1
  export * from './activity.decorator';
2
2
  export * from './activity-method.decorator';
3
3
  export * from './workflow.decorator';
4
- export * from './inject-temporal-client.decorator';
@@ -17,5 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./activity.decorator"), exports);
18
18
  __exportStar(require("./activity-method.decorator"), exports);
19
19
  __exportStar(require("./workflow.decorator"), exports);
20
- __exportStar(require("./inject-temporal-client.decorator"), exports);
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,8DAA4C;AAC5C,uDAAqC;AACrC,qEAAmD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,8DAA4C;AAC5C,uDAAqC"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAiD;AAGjD,SAAgB,QAAQ,CACtB,UAA2B,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAE5D,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,IAAA,oBAAW,EAAC,6BAAiB,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAPD,4BAOC"}
1
+ {"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAE7C,4CAAiD;AAEjD,SAAgB,QAAQ,CACtB,UAA2B,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAE5D,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,IAAA,oBAAW,EAAC,6BAAiB,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAPD,4BAOC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export * from './temporal-client.module';
2
- export * from './temporal-worker.module';
3
- export * from './temporal-client.service';
1
+ export * from './client';
2
+ export * from './worker';
4
3
  export * from './interfaces';
5
4
  export * from './decorators';
6
5
  export * from './constants';
package/dist/index.js CHANGED
@@ -14,9 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./temporal-client.module"), exports);
18
- __exportStar(require("./temporal-worker.module"), exports);
19
- __exportStar(require("./temporal-client.service"), exports);
17
+ __exportStar(require("./client"), exports);
18
+ __exportStar(require("./worker"), exports);
20
19
  __exportStar(require("./interfaces"), exports);
21
20
  __exportStar(require("./decorators"), exports);
22
21
  __exportStar(require("./constants"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,2DAAyC;AACzC,2DAAyC;AACzC,4DAA0C;AAG1C,+CAA6B;AAG7B,+CAA6B;AAG7B,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B"}
@@ -7,6 +7,7 @@ export interface TemporalWorkerOptions {
7
7
  workflowsPath: string;
8
8
  activityClasses?: Array<new (...args: any[]) => any>;
9
9
  runtimeOptions?: RuntimeOptions;
10
+ workerOptions?: WorkerOptions;
10
11
  }
11
12
  export interface TemporalWorkerOptionsFactory {
12
13
  createWorkerOptions(): Promise<TemporalWorkerOptions> | TemporalWorkerOptions;