nestjs-temporal-core 2.0.7 → 2.0.8

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 (2) hide show
  1. package/README.md +39 -34
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -339,6 +339,7 @@ When integrating Temporal with your NestJS application, organizing your code pro
339
339
 
340
340
  ```
341
341
 
342
+ ```
342
343
  src/
343
344
  ├── temporal/
344
345
  │ ├── activities/
@@ -364,29 +365,33 @@ src/
364
365
  │ └── payment.module.ts
365
366
  └── app.module.ts
366
367
 
367
- ````
368
+ ```
368
369
 
369
370
  ### Key Files and Their Purpose
370
371
 
371
372
  1. **Activities (src/temporal/activities/)**:
372
- - Contains activity classes decorated with `@Activity()`
373
- - Each activity class should group related functionality
373
+
374
+ - Contains activity classes decorated with `@Activity()`
375
+ - Each activity class should group related functionality
374
376
 
375
377
  2. **Workflows (src/temporal/workflows/)**:
376
- - Contains workflow definitions that orchestrate activities
377
- - Workflows should be in separate files based on domain
378
+
379
+ - Contains workflow definitions that orchestrate activities
380
+ - Workflows should be in separate files based on domain
378
381
 
379
382
  3. **Interfaces (src/temporal/interfaces/)**:
380
- - TypeScript interfaces that define activity and workflow parameters/returns
381
- - Helps maintain type safety between activities and workflows
383
+
384
+ - TypeScript interfaces that define activity and workflow parameters/returns
385
+ - Helps maintain type safety between activities and workflows
382
386
 
383
387
  4. **Temporal Module (src/temporal/temporal.module.ts)**:
384
- - Centralizes Temporal configuration
385
- - Imports and registers all activities
386
388
 
387
- 5. **Business Services (src/modules/*/)**:
388
- - Inject the TemporalService
389
- - Use it to start workflows and interact with Temporal
389
+ - Centralizes Temporal configuration
390
+ - Imports and registers all activities
391
+
392
+ 5. **Business Services (src/modules/\*/)**:
393
+ - Inject the TemporalService
394
+ - Use it to start workflows and interact with Temporal
390
395
 
391
396
  ## Integration Examples
392
397
 
@@ -401,29 +406,29 @@ import { EmailService } from '../../modules/email/email.service';
401
406
  @Injectable()
402
407
  @Activity()
403
408
  export class EmailActivities {
404
- constructor(private readonly emailService: EmailService) {}
405
-
406
- @ActivityMethod()
407
- async sendWelcomeEmail(to: string, name: string): Promise<boolean> {
408
- await this.emailService.sendEmail({
409
- to,
410
- subject: 'Welcome!',
411
- body: `Hello ${name}, welcome to our platform!`,
412
- });
413
- return true;
414
- }
415
-
416
- @ActivityMethod()
417
- async sendPasswordReset(to: string, resetToken: string): Promise<boolean> {
418
- await this.emailService.sendEmail({
419
- to,
420
- subject: 'Password Reset',
421
- body: `Please use this token to reset your password: ${resetToken}`,
422
- });
423
- return true;
424
- }
409
+ constructor(private readonly emailService: EmailService) {}
410
+
411
+ @ActivityMethod()
412
+ async sendWelcomeEmail(to: string, name: string): Promise<boolean> {
413
+ await this.emailService.sendEmail({
414
+ to,
415
+ subject: 'Welcome!',
416
+ body: `Hello ${name}, welcome to our platform!`,
417
+ });
418
+ return true;
419
+ }
420
+
421
+ @ActivityMethod()
422
+ async sendPasswordReset(to: string, resetToken: string): Promise<boolean> {
423
+ await this.emailService.sendEmail({
424
+ to,
425
+ subject: 'Password Reset',
426
+ body: `Please use this token to reset your password: ${resetToken}`,
427
+ });
428
+ return true;
429
+ }
425
430
  }
426
- ````
431
+ ```
427
432
 
428
433
  ```typescript
429
434
  // src/temporal/activities/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-temporal-core",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "NestJS integration for Temporal.io with worker and client support",
5
5
  "author": "Harsh M",
6
6
  "license": "MIT",