nestjs-temporal-core 3.0.0 → 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 -150
  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 +13 -7
  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
@@ -1,36 +1,41 @@
1
1
  import { OnApplicationBootstrap, OnModuleDestroy } from '@nestjs/common';
2
- import { TemporalScheduleService } from '../client/temporal-schedule.service';
3
- import { WorkflowDiscoveryService } from './workflow-discovery.service';
4
- import { ScheduleStatus, ScheduleStats } from '../interfaces';
5
- export declare class ScheduleManagerService implements OnApplicationBootstrap, OnModuleDestroy {
6
- private readonly workflowDiscovery;
2
+ import { ScheduleStats, ScheduleStatus } from '../interfaces';
3
+ import { TemporalDiscoveryService } from './temporal-discovery.service';
4
+ import { TemporalScheduleService } from '../client';
5
+ export declare class TemporalScheduleManagerService implements OnApplicationBootstrap, OnModuleDestroy {
6
+ private readonly discoveryService;
7
7
  private readonly scheduleService;
8
8
  private readonly logger;
9
9
  private readonly managedSchedules;
10
10
  private readonly setupPromises;
11
- constructor(workflowDiscovery: WorkflowDiscoveryService, scheduleService: TemporalScheduleService);
11
+ constructor(discoveryService: TemporalDiscoveryService, scheduleService: TemporalScheduleService);
12
12
  onApplicationBootstrap(): Promise<void>;
13
13
  onModuleDestroy(): Promise<void>;
14
- private setupScheduledWorkflows;
15
- private setupScheduleWithErrorHandling;
16
- private setupSchedule;
14
+ private setupDiscoveredSchedules;
15
+ private setupSingleSchedule;
16
+ private performScheduleSetup;
17
17
  private createCronSchedule;
18
18
  private createIntervalSchedule;
19
- private scheduleExists;
20
- private resolveTaskQueue;
21
- private updateScheduleStatus;
22
- private logSetupResults;
23
19
  triggerSchedule(scheduleId: string): Promise<void>;
24
20
  pauseSchedule(scheduleId: string, note?: string): Promise<void>;
25
21
  resumeSchedule(scheduleId: string, note?: string): Promise<void>;
26
- deleteSchedule(scheduleId: string): Promise<void>;
22
+ deleteSchedule(scheduleId: string, force?: boolean): Promise<void>;
23
+ retryFailedSetups(): Promise<void>;
27
24
  getManagedSchedules(): string[];
28
25
  getManagedScheduleStatuses(): ScheduleStatus[];
29
26
  getScheduleStatus(scheduleId: string): ScheduleStatus | undefined;
30
27
  isScheduleManaged(scheduleId: string): boolean;
31
28
  isScheduleActive(scheduleId: string): boolean;
32
29
  getScheduleStats(): ScheduleStats;
33
- retryFailedSetups(): Promise<void>;
30
+ getHealthStatus(): {
31
+ status: 'healthy' | 'degraded' | 'unhealthy';
32
+ managedSchedules: number;
33
+ activeSchedules: number;
34
+ errorCount: number;
35
+ };
36
+ private resolveTaskQueue;
37
+ private updateScheduleStatus;
38
+ private logSetupResults;
34
39
  private ensureScheduleManaged;
35
40
  private getScheduleWorkflowName;
36
41
  }
@@ -8,49 +8,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var TemporalScheduleManagerService_1;
11
12
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ScheduleManagerService = void 0;
13
+ exports.TemporalScheduleManagerService = void 0;
13
14
  const common_1 = require("@nestjs/common");
14
- const temporal_schedule_service_1 = require("../client/temporal-schedule.service");
15
- const workflow_discovery_service_1 = require("./workflow-discovery.service");
16
- const constants_1 = require("../constants");
17
- let ScheduleManagerService = class ScheduleManagerService {
18
- constructor(workflowDiscovery, scheduleService) {
19
- this.workflowDiscovery = workflowDiscovery;
15
+ const temporal_discovery_service_1 = require("./temporal-discovery.service");
16
+ const client_1 = require("../client");
17
+ let TemporalScheduleManagerService = TemporalScheduleManagerService_1 = class TemporalScheduleManagerService {
18
+ constructor(discoveryService, scheduleService) {
19
+ this.discoveryService = discoveryService;
20
20
  this.scheduleService = scheduleService;
21
- this.logger = new common_1.Logger(constants_1.LOG_CATEGORIES.SCHEDULE);
21
+ this.logger = new common_1.Logger(TemporalScheduleManagerService_1.name);
22
22
  this.managedSchedules = new Map();
23
23
  this.setupPromises = new Map();
24
24
  }
25
25
  async onApplicationBootstrap() {
26
- await this.setupScheduledWorkflows();
26
+ await this.setupDiscoveredSchedules();
27
27
  }
28
28
  async onModuleDestroy() {
29
29
  this.logger.log('Schedule manager shutting down');
30
30
  }
31
- async setupScheduledWorkflows() {
32
- const scheduledWorkflows = this.workflowDiscovery.getScheduledWorkflows();
31
+ async setupDiscoveredSchedules() {
32
+ const scheduledWorkflows = this.discoveryService.getScheduledWorkflows();
33
33
  if (scheduledWorkflows.length === 0) {
34
34
  this.logger.log('No scheduled workflows found');
35
35
  return;
36
36
  }
37
37
  this.logger.log(`Setting up ${scheduledWorkflows.length} scheduled workflows`);
38
- const setupPromises = scheduledWorkflows.map((scheduled) => this.setupScheduleWithErrorHandling(scheduled));
38
+ const setupPromises = scheduledWorkflows.map((scheduled) => this.setupSingleSchedule(scheduled));
39
39
  const results = await Promise.allSettled(setupPromises);
40
40
  this.logSetupResults(results, scheduledWorkflows);
41
41
  }
42
- async setupScheduleWithErrorHandling(scheduled) {
42
+ async setupSingleSchedule(scheduled) {
43
43
  const { scheduleOptions, workflowName } = scheduled;
44
- const scheduleId = scheduleOptions.scheduleId;
44
+ const { scheduleId } = scheduleOptions;
45
45
  if (this.setupPromises.has(scheduleId)) {
46
46
  await this.setupPromises.get(scheduleId);
47
47
  return;
48
48
  }
49
- const setupPromise = this.setupSchedule(scheduled);
49
+ const setupPromise = this.performScheduleSetup(scheduled);
50
50
  this.setupPromises.set(scheduleId, setupPromise);
51
51
  try {
52
52
  await setupPromise;
53
53
  this.updateScheduleStatus(scheduleId, workflowName, true, true);
54
+ this.logger.debug(`Successfully set up schedule: ${scheduleId}`);
54
55
  }
55
56
  catch (error) {
56
57
  this.updateScheduleStatus(scheduleId, workflowName, false, false, error.message);
@@ -60,15 +61,15 @@ let ScheduleManagerService = class ScheduleManagerService {
60
61
  this.setupPromises.delete(scheduleId);
61
62
  }
62
63
  }
63
- async setupSchedule(scheduled) {
64
+ async performScheduleSetup(scheduled) {
64
65
  const { scheduleOptions, workflowName, controllerInfo } = scheduled;
65
- const scheduleId = scheduleOptions.scheduleId;
66
+ const { scheduleId } = scheduleOptions;
66
67
  if (scheduleOptions.autoStart === false) {
67
68
  this.logger.debug(`Auto-start disabled for schedule ${scheduleId}`);
68
69
  this.updateScheduleStatus(scheduleId, workflowName, true, false, 'Auto-start disabled');
69
70
  return;
70
71
  }
71
- if (await this.scheduleExists(scheduleId)) {
72
+ if (await this.scheduleService.scheduleExists(scheduleId)) {
72
73
  this.logger.debug(`Schedule ${scheduleId} already exists, skipping creation`);
73
74
  this.updateScheduleStatus(scheduleId, workflowName, true, true, 'Already exists');
74
75
  return;
@@ -90,51 +91,26 @@ let ScheduleManagerService = class ScheduleManagerService {
90
91
  }
91
92
  async createCronSchedule(scheduled, taskQueue) {
92
93
  const { scheduleOptions, workflowName } = scheduled;
93
- await this.scheduleService.createCronWorkflow(scheduleOptions.scheduleId, workflowName, scheduleOptions.cron, taskQueue, [], scheduleOptions.description, scheduleOptions.timezone);
94
+ await this.scheduleService.createCronSchedule(scheduleOptions.scheduleId, workflowName, scheduleOptions.cron, taskQueue, [], {
95
+ description: scheduleOptions.description,
96
+ timezone: scheduleOptions.timezone,
97
+ overlapPolicy: scheduleOptions.overlapPolicy,
98
+ startPaused: scheduleOptions.startPaused,
99
+ });
94
100
  this.logger.log(`Created cron schedule: ${scheduleOptions.scheduleId} -> ${workflowName} (${scheduleOptions.cron})`);
95
101
  }
96
102
  async createIntervalSchedule(scheduled, taskQueue) {
97
103
  const { scheduleOptions, workflowName } = scheduled;
98
- await this.scheduleService.createIntervalWorkflow(scheduleOptions.scheduleId, workflowName, scheduleOptions.interval, taskQueue, [], scheduleOptions.description);
99
- this.logger.log(`Created interval schedule: ${scheduleOptions.scheduleId} -> ${workflowName} (${scheduleOptions.interval})`);
100
- }
101
- async scheduleExists(scheduleId) {
102
- try {
103
- const existingSchedules = await this.scheduleService.listSchedules();
104
- return existingSchedules.some((s) => s.scheduleId === scheduleId);
105
- }
106
- catch (error) {
107
- this.logger.warn(`Failed to check existing schedules: ${error.message}`);
108
- return false;
109
- }
110
- }
111
- resolveTaskQueue(scheduleOptions, controllerInfo) {
112
- return scheduleOptions.taskQueue || controllerInfo.taskQueue || 'default';
113
- }
114
- updateScheduleStatus(scheduleId, workflowName, isManaged, isActive, error) {
115
- const existing = this.managedSchedules.get(scheduleId);
116
- const now = new Date();
117
- this.managedSchedules.set(scheduleId, {
118
- scheduleId,
119
- workflowName,
120
- isManaged,
121
- isActive,
122
- lastError: error,
123
- createdAt: existing?.createdAt || now,
124
- lastUpdatedAt: now,
104
+ await this.scheduleService.createIntervalSchedule(scheduleOptions.scheduleId, workflowName, scheduleOptions.interval, taskQueue, [], {
105
+ description: scheduleOptions.description,
106
+ overlapPolicy: scheduleOptions.overlapPolicy,
107
+ startPaused: scheduleOptions.startPaused,
125
108
  });
126
- }
127
- logSetupResults(results, scheduledWorkflows) {
128
- const successful = results.filter((r) => r.status === 'fulfilled').length;
129
- const failed = results.filter((r) => r.status === 'rejected').length;
130
- this.logger.log(`Schedule setup completed: ${successful} successful, ${failed} failed out of ${scheduledWorkflows.length} total`);
131
- if (failed > 0) {
132
- this.logger.warn(`${failed} schedules failed to setup. Check logs for details.`);
133
- }
109
+ this.logger.log(`Created interval schedule: ${scheduleOptions.scheduleId} -> ${workflowName} (${scheduleOptions.interval})`);
134
110
  }
135
111
  async triggerSchedule(scheduleId) {
136
112
  this.ensureScheduleManaged(scheduleId);
137
- await this.scheduleService.triggerNow(scheduleId);
113
+ await this.scheduleService.triggerSchedule(scheduleId);
138
114
  this.logger.log(`Triggered schedule: ${scheduleId}`);
139
115
  }
140
116
  async pauseSchedule(scheduleId, note) {
@@ -149,12 +125,32 @@ let ScheduleManagerService = class ScheduleManagerService {
149
125
  this.updateScheduleStatus(scheduleId, this.getScheduleWorkflowName(scheduleId), true, true);
150
126
  this.logger.log(`Resumed schedule: ${scheduleId}${note ? ` (${note})` : ''}`);
151
127
  }
152
- async deleteSchedule(scheduleId) {
128
+ async deleteSchedule(scheduleId, force = false) {
153
129
  this.ensureScheduleManaged(scheduleId);
130
+ if (!force) {
131
+ this.logger.warn(`Deleting schedule ${scheduleId} requires force=true. This action cannot be undone.`);
132
+ throw new Error('Schedule deletion requires force=true confirmation');
133
+ }
154
134
  await this.scheduleService.deleteSchedule(scheduleId);
155
135
  this.managedSchedules.delete(scheduleId);
156
136
  this.logger.log(`Deleted schedule: ${scheduleId}`);
157
137
  }
138
+ async retryFailedSetups() {
139
+ const failedSchedules = this.discoveryService
140
+ .getScheduledWorkflows()
141
+ .filter((scheduled) => {
142
+ const status = this.managedSchedules.get(scheduled.scheduleOptions.scheduleId);
143
+ return !status || !status.isManaged;
144
+ });
145
+ if (failedSchedules.length === 0) {
146
+ this.logger.log('No failed schedules to retry');
147
+ return;
148
+ }
149
+ this.logger.log(`Retrying ${failedSchedules.length} failed schedule setups`);
150
+ for (const scheduled of failedSchedules) {
151
+ await this.setupSingleSchedule(scheduled);
152
+ }
153
+ }
158
154
  getManagedSchedules() {
159
155
  return Array.from(this.managedSchedules.keys());
160
156
  }
@@ -180,25 +176,49 @@ let ScheduleManagerService = class ScheduleManagerService {
180
176
  errors: statuses.filter((s) => s.lastError).length,
181
177
  };
182
178
  }
183
- async retryFailedSetups() {
184
- const failedSchedules = this.workflowDiscovery
185
- .getScheduledWorkflows()
186
- .filter((scheduled) => {
187
- const status = this.managedSchedules.get(scheduled.scheduleOptions.scheduleId);
188
- return !status || !status.isManaged;
189
- });
190
- if (failedSchedules.length === 0) {
191
- this.logger.log('No failed schedules to retry');
192
- return;
179
+ getHealthStatus() {
180
+ const stats = this.getScheduleStats();
181
+ let status;
182
+ if (stats.errors > 0) {
183
+ status = stats.errors === stats.total ? 'unhealthy' : 'degraded';
193
184
  }
194
- this.logger.log(`Retrying ${failedSchedules.length} failed schedule setups`);
195
- for (const scheduled of failedSchedules) {
196
- await this.setupScheduleWithErrorHandling(scheduled);
185
+ else {
186
+ status = 'healthy';
187
+ }
188
+ return {
189
+ status,
190
+ managedSchedules: stats.total,
191
+ activeSchedules: stats.active,
192
+ errorCount: stats.errors,
193
+ };
194
+ }
195
+ resolveTaskQueue(scheduleOptions, controllerInfo) {
196
+ return scheduleOptions.taskQueue || controllerInfo.taskQueue || 'default';
197
+ }
198
+ updateScheduleStatus(scheduleId, workflowName, isManaged, isActive, error) {
199
+ const existing = this.managedSchedules.get(scheduleId);
200
+ const now = new Date();
201
+ this.managedSchedules.set(scheduleId, {
202
+ scheduleId,
203
+ workflowName,
204
+ isManaged,
205
+ isActive,
206
+ lastError: error,
207
+ createdAt: existing?.createdAt || now,
208
+ lastUpdatedAt: now,
209
+ });
210
+ }
211
+ logSetupResults(results, scheduledWorkflows) {
212
+ const successful = results.filter((r) => r.status === 'fulfilled').length;
213
+ const failed = results.filter((r) => r.status === 'rejected').length;
214
+ this.logger.log(`Schedule setup completed: ${successful} successful, ${failed} failed out of ${scheduledWorkflows.length} total`);
215
+ if (failed > 0) {
216
+ this.logger.warn(`${failed} schedules failed to setup. Use retryFailedSetups() to retry.`);
197
217
  }
198
218
  }
199
219
  ensureScheduleManaged(scheduleId) {
200
220
  if (!this.isScheduleManaged(scheduleId)) {
201
- throw new Error(`Schedule ${scheduleId} is not managed by this service`);
221
+ throw new Error(`Schedule '${scheduleId}' is not managed by this service`);
202
222
  }
203
223
  }
204
224
  getScheduleWorkflowName(scheduleId) {
@@ -206,10 +226,10 @@ let ScheduleManagerService = class ScheduleManagerService {
206
226
  return status?.workflowName || 'unknown';
207
227
  }
208
228
  };
209
- exports.ScheduleManagerService = ScheduleManagerService;
210
- exports.ScheduleManagerService = ScheduleManagerService = __decorate([
229
+ exports.TemporalScheduleManagerService = TemporalScheduleManagerService;
230
+ exports.TemporalScheduleManagerService = TemporalScheduleManagerService = TemporalScheduleManagerService_1 = __decorate([
211
231
  (0, common_1.Injectable)(),
212
- __metadata("design:paramtypes", [workflow_discovery_service_1.WorkflowDiscoveryService,
213
- temporal_schedule_service_1.TemporalScheduleService])
214
- ], ScheduleManagerService);
215
- //# sourceMappingURL=schedule-manager.service.js.map
232
+ __metadata("design:paramtypes", [temporal_discovery_service_1.TemporalDiscoveryService,
233
+ client_1.TemporalScheduleService])
234
+ ], TemporalScheduleManagerService);
235
+ //# sourceMappingURL=temporal-schedule-manager.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-schedule-manager.service.js","sourceRoot":"","sources":["../../src/discovery/temporal-schedule-manager.service.ts"],"names":[],"mapp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AuB,CAAC,UAAkB;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrD,OAAO,MAAM,EAAE,YAAY,IAAI,SAAS,CAAC;IAC7C,CAAC;CACJ,CAAA;AAjZY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,mBAAU,GAAE;qCAS8B,qDAAwB;QACzB,gCAAuB;GATpD,8BAA8B,CAiZ1C"}
package/dist/index.d.ts CHANGED
@@ -1,17 +1,12 @@
1
1
  import 'reflect-metadata';
2
- export { TemporalModule } from './temporal.module';
3
- export { TemporalService } from './temporal.service';
4
- export { TemporalClientModule } from './client';
5
- export { TemporalClientService } from './client';
6
- export { TemporalScheduleService } from './client';
7
- export { TemporalWorkerModule } from './worker';
8
- export { WorkerManager } from './worker';
9
- export { TemporalMetadataAccessor } from './worker';
10
- export { WorkflowDiscoveryService } from './discovery';
11
- export { ScheduleManagerService } from './discovery';
2
+ export { TemporalClientModule, TemporalClientService, TemporalScheduleService } from './client';
3
+ export { TemporalWorkerModule, TemporalWorkerManagerService, TemporalMetadataAccessor, } from './worker';
4
+ export { TemporalDiscoveryService, TemporalScheduleManagerService } from './discovery';
12
5
  export * from './decorators';
13
6
  export * from './interfaces';
14
- export { DEFAULT_NAMESPACE, DEFAULT_TASK_QUEUE, CRON_EXPRESSIONS, INTERVAL_EXPRESSIONS, WORKER_PRESETS, RETRY_POLICIES, TIMEOUTS, ERRORS, } from './constants';
7
+ export { DEFAULT_NAMESPACE, DEFAULT_TASK_QUEUE, TEMPORAL_ACTIVITY, TEMPORAL_ACTIVITY_METHOD, TEMPORAL_SIGNAL_METHOD, TEMPORAL_QUERY_METHOD, TEMPORAL_SCHEDULED_WORKFLOW, TEMPORAL_CLIENT, TEMPORAL_MODULE_OPTIONS, CRON_EXPRESSIONS, INTERVAL_EXPRESSIONS, WORKER_PRESETS, RETRY_POLICIES, TIMEOUTS, ERRORS, } from './constants';
8
+ export * from './temporal.service';
9
+ export * from './temporal.module';
15
10
  export type { RetryPolicy, Duration, SearchAttributes } from '@temporalio/common';
16
11
  export type { ScheduleOverlapPolicy, WorkflowHandle, Client } from '@temporalio/client';
17
12
  export type { Worker } from '@temporalio/worker';
package/dist/index.js CHANGED
@@ -14,37 +14,37 @@ 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
- exports.ERRORS = exports.TIMEOUTS = exports.RETRY_POLICIES = exports.WORKER_PRESETS = exports.INTERVAL_EXPRESSIONS = exports.CRON_EXPRESSIONS = exports.DEFAULT_TASK_QUEUE = exports.DEFAULT_NAMESPACE = exports.ScheduleManagerService = exports.WorkflowDiscoveryService = exports.TemporalMetadataAccessor = exports.WorkerManager = exports.TemporalWorkerModule = exports.TemporalScheduleService = exports.TemporalClientService = exports.TemporalClientModule = exports.TemporalService = exports.TemporalModule = void 0;
17
+ exports.ERRORS = exports.TIMEOUTS = exports.RETRY_POLICIES = exports.WORKER_PRESETS = exports.INTERVAL_EXPRESSIONS = exports.CRON_EXPRESSIONS = exports.TEMPORAL_MODULE_OPTIONS = exports.TEMPORAL_CLIENT = exports.TEMPORAL_SCHEDULED_WORKFLOW = exports.TEMPORAL_QUERY_METHOD = exports.TEMPORAL_SIGNAL_METHOD = exports.TEMPORAL_ACTIVITY_METHOD = exports.TEMPORAL_ACTIVITY = exports.DEFAULT_TASK_QUEUE = exports.DEFAULT_NAMESPACE = exports.TemporalScheduleManagerService = exports.TemporalDiscoveryService = exports.TemporalMetadataAccessor = exports.TemporalWorkerManagerService = exports.TemporalWorkerModule = exports.TemporalScheduleService = exports.TemporalClientService = exports.TemporalClientModule = void 0;
18
18
  require("reflect-metadata");
19
- var temporal_module_1 = require("./temporal.module");
20
- Object.defineProperty(exports, "TemporalModule", { enumerable: true, get: function () { return temporal_module_1.TemporalModule; } });
21
- var temporal_service_1 = require("./temporal.service");
22
- Object.defineProperty(exports, "TemporalService", { enumerable: true, get: function () { return temporal_service_1.TemporalService; } });
23
19
  var client_1 = require("./client");
24
20
  Object.defineProperty(exports, "TemporalClientModule", { enumerable: true, get: function () { return client_1.TemporalClientModule; } });
25
- var client_2 = require("./client");
26
- Object.defineProperty(exports, "TemporalClientService", { enumerable: true, get: function () { return client_2.TemporalClientService; } });
27
- var client_3 = require("./client");
28
- Object.defineProperty(exports, "TemporalScheduleService", { enumerable: true, get: function () { return client_3.TemporalScheduleService; } });
21
+ Object.defineProperty(exports, "TemporalClientService", { enumerable: true, get: function () { return client_1.TemporalClientService; } });
22
+ Object.defineProperty(exports, "TemporalScheduleService", { enumerable: true, get: function () { return client_1.TemporalScheduleService; } });
29
23
  var worker_1 = require("./worker");
30
24
  Object.defineProperty(exports, "TemporalWorkerModule", { enumerable: true, get: function () { return worker_1.TemporalWorkerModule; } });
31
- var worker_2 = require("./worker");
32
- Object.defineProperty(exports, "WorkerManager", { enumerable: true, get: function () { return worker_2.WorkerManager; } });
33
- var worker_3 = require("./worker");
34
- Object.defineProperty(exports, "TemporalMetadataAccessor", { enumerable: true, get: function () { return worker_3.TemporalMetadataAccessor; } });
25
+ Object.defineProperty(exports, "TemporalWorkerManagerService", { enumerable: true, get: function () { return worker_1.TemporalWorkerManagerService; } });
26
+ Object.defineProperty(exports, "TemporalMetadataAccessor", { enumerable: true, get: function () { return worker_1.TemporalMetadataAccessor; } });
35
27
  var discovery_1 = require("./discovery");
36
- Object.defineProperty(exports, "WorkflowDiscoveryService", { enumerable: true, get: function () { return discovery_1.WorkflowDiscoveryService; } });
37
- var discovery_2 = require("./discovery");
38
- Object.defineProperty(exports, "ScheduleManagerService", { enumerable: true, get: function () { return discovery_2.ScheduleManagerService; } });
28
+ Object.defineProperty(exports, "TemporalDiscoveryService", { enumerable: true, get: function () { return discovery_1.TemporalDiscoveryService; } });
29
+ Object.defineProperty(exports, "TemporalScheduleManagerService", { enumerable: true, get: function () { return discovery_1.TemporalScheduleManagerService; } });
39
30
  __exportStar(require("./decorators"), exports);
40
31
  __exportStar(require("./interfaces"), exports);
41
32
  var constants_1 = require("./constants");
42
33
  Object.defineProperty(exports, "DEFAULT_NAMESPACE", { enumerable: true, get: function () { return constants_1.DEFAULT_NAMESPACE; } });
43
34
  Object.defineProperty(exports, "DEFAULT_TASK_QUEUE", { enumerable: true, get: function () { return constants_1.DEFAULT_TASK_QUEUE; } });
35
+ Object.defineProperty(exports, "TEMPORAL_ACTIVITY", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY; } });
36
+ Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD; } });
37
+ Object.defineProperty(exports, "TEMPORAL_SIGNAL_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_SIGNAL_METHOD; } });
38
+ Object.defineProperty(exports, "TEMPORAL_QUERY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_QUERY_METHOD; } });
39
+ Object.defineProperty(exports, "TEMPORAL_SCHEDULED_WORKFLOW", { enumerable: true, get: function () { return constants_1.TEMPORAL_SCHEDULED_WORKFLOW; } });
40
+ Object.defineProperty(exports, "TEMPORAL_CLIENT", { enumerable: true, get: function () { return constants_1.TEMPORAL_CLIENT; } });
41
+ Object.defineProperty(exports, "TEMPORAL_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_MODULE_OPTIONS; } });
44
42
  Object.defineProperty(exports, "CRON_EXPRESSIONS", { enumerable: true, get: function () { return constants_1.CRON_EXPRESSIONS; } });
45
43
  Object.defineProperty(exports, "INTERVAL_EXPRESSIONS", { enumerable: true, get: function () { return constants_1.INTERVAL_EXPRESSIONS; } });
46
44
  Object.defineProperty(exports, "WORKER_PRESETS", { enumerable: true, get: function () { return constants_1.WORKER_PRESETS; } });
47
45
  Object.defineProperty(exports, "RETRY_POLICIES", { enumerable: true, get: function () { return constants_1.RETRY_POLICIES; } });
48
46
  Object.defineProperty(exports, "TIMEOUTS", { enumerable: true, get: function () { return constants_1.TIMEOUTS; } });
49
47
  Object.defineProperty(exports, "ERRORS", { enumerable: true, get: function () { return constants_1.ERRORS; } });
48
+ __exportStar(require("./temporal.service"), exports);
49
+ __exportStar(require("./temporal.module"), exports);
50
50
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAQ1B,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AAKxB,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAC7B,mCAAiD;AAAxC,+GAAA,qBAAqB,OAAA;AAC9B,mCAAmD;AAA1C,iHAAA,uBAAuB,OAAA;AAKhC,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAC7B,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AACtB,mCAAoD;AAA3C,kHAAA,wBAAwB,OAAA;AAKjC,yCAAuD;AAA9C,qHAAA,wBAAwB,OAAA;AACjC,yCAAqD;AAA5C,mHAAA,sBAAsB,OAAA;AAK/B,+CAA6B;AAK7B,+CAA6B;AAK7B,yCASqB;AARjB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,qGAAA,QAAQ,OAAA;AACR,mGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAc1B,mCAAgG;AAAvF,8GAAA,oBAAoB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AAAE,iHAAA,uBAAuB,OAAA;AAK7E,mCAIkB;AAHd,8GAAA,oBAAoB,OAAA;AACpB,sHAAA,4BAA4B,OAAA;AAC5B,kHAAA,wBAAwB,OAAA;AAM5B,yCAAuF;AAA9E,qHAAA,wBAAwB,OAAA;AAAE,2HAAA,8BAA8B,OAAA;AAKjE,+CAA6B;AAK7B,+CAA6B;AAK7B,yCAyBqB;AAvBjB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAGlB,8GAAA,iBAAiB,OAAA;AACjB,qHAAA,wBAAwB,OAAA;AACxB,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AACrB,wHAAA,2BAA2B,OAAA;AAG3B,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AAGvB,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,qGAAA,QAAQ,OAAA;AAGR,mGAAA,MAAM,OAAA;AAMV,qDAAmC;AAKnC,oDAAkC"}
@@ -0,0 +1,193 @@
1
+ import { ModuleMetadata, Type } from '@nestjs/common';
2
+ export { RetryPolicy, Duration, SearchAttributes } from '@temporalio/common';
3
+ export { ScheduleOverlapPolicy, WorkflowHandle, Client } from '@temporalio/client';
4
+ export { Worker } from '@temporalio/worker';
5
+ export interface ConnectionOptions {
6
+ address: string;
7
+ tls?: boolean | {
8
+ serverName?: string;
9
+ clientCertPair?: {
10
+ crt: Buffer;
11
+ key: Buffer;
12
+ ca?: Buffer;
13
+ };
14
+ };
15
+ apiKey?: string;
16
+ metadata?: Record<string, string>;
17
+ }
18
+ export interface TemporalOptions {
19
+ connection: {
20
+ address: string;
21
+ namespace?: string;
22
+ tls?: ConnectionOptions['tls'];
23
+ apiKey?: string;
24
+ metadata?: Record<string, string>;
25
+ };
26
+ taskQueue?: string;
27
+ worker?: {
28
+ workflowsPath?: string;
29
+ workflowBundle?: any;
30
+ activityClasses?: Array<Type<any>>;
31
+ autoStart?: boolean;
32
+ workerOptions?: WorkerCreateOptions;
33
+ };
34
+ isGlobal?: boolean;
35
+ allowConnectionFailure?: boolean;
36
+ }
37
+ export interface WorkerCreateOptions {
38
+ maxConcurrentActivityTaskExecutions?: number;
39
+ maxConcurrentWorkflowTaskExecutions?: number;
40
+ maxConcurrentLocalActivityExecutions?: number;
41
+ maxActivitiesPerSecond?: number;
42
+ reuseV8Context?: boolean;
43
+ identity?: string;
44
+ buildId?: string;
45
+ [key: string]: any;
46
+ }
47
+ export interface TemporalOptionsFactory {
48
+ createTemporalOptions(): Promise<TemporalOptions> | TemporalOptions;
49
+ }
50
+ export interface TemporalAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
51
+ useExisting?: Type<TemporalOptionsFactory>;
52
+ useClass?: Type<TemporalOptionsFactory>;
53
+ useFactory?: (...args: any[]) => Promise<TemporalOptions> | TemporalOptions;
54
+ inject?: any[];
55
+ isGlobal?: boolean;
56
+ }
57
+ export interface SignalOptions {
58
+ name?: string;
59
+ }
60
+ export interface QueryOptions {
61
+ name?: string;
62
+ }
63
+ export interface StartWorkflowOptions {
64
+ taskQueue: string;
65
+ workflowId?: string;
66
+ signal?: {
67
+ name: string;
68
+ args?: any[];
69
+ };
70
+ retry?: {
71
+ maximumAttempts?: number;
72
+ initialInterval?: string | number;
73
+ };
74
+ searchAttributes?: Record<string, unknown>;
75
+ [key: string]: any;
76
+ }
77
+ export interface WorkflowExecutionContext {
78
+ workflowId: string;
79
+ runId: string;
80
+ workflowType: string;
81
+ taskQueue: string;
82
+ namespace: string;
83
+ }
84
+ export interface ActivityOptions {
85
+ name?: string;
86
+ }
87
+ export interface ActivityMethodOptions {
88
+ name?: string;
89
+ timeout?: string | number;
90
+ maxRetries?: number;
91
+ }
92
+ export interface ActivityMetadata {
93
+ name?: string;
94
+ options?: Record<string, any>;
95
+ }
96
+ export interface ScheduledOptions {
97
+ scheduleId: string;
98
+ cron?: string;
99
+ interval?: string;
100
+ description?: string;
101
+ taskQueue?: string;
102
+ timezone?: string;
103
+ overlapPolicy?: 'ALLOW_ALL' | 'SKIP' | 'BUFFER_ONE' | 'BUFFER_ALL' | 'CANCEL_OTHER';
104
+ startPaused?: boolean;
105
+ autoStart?: boolean;
106
+ }
107
+ export interface CronOptions extends Omit<ScheduledOptions, 'cron' | 'interval'> {
108
+ scheduleId: string;
109
+ }
110
+ export interface IntervalOptions extends Omit<ScheduledOptions, 'cron' | 'interval'> {
111
+ scheduleId: string;
112
+ }
113
+ export type SignalMethodHandler = (...args: any[]) => void | Promise<void>;
114
+ export type QueryMethodHandler = (...args: any[]) => any;
115
+ export type ActivityMethodHandler = (...args: any[]) => any | Promise<any>;
116
+ export interface SignalMethodInfo {
117
+ methodName: string;
118
+ signalName: string;
119
+ options: any;
120
+ handler: SignalMethodHandler;
121
+ }
122
+ export interface QueryMethodInfo {
123
+ methodName: string;
124
+ queryName: string;
125
+ options: any;
126
+ handler: QueryMethodHandler;
127
+ }
128
+ export interface ScheduledMethodInfo {
129
+ methodName: string;
130
+ workflowName: string;
131
+ scheduleOptions: any;
132
+ workflowOptions: any;
133
+ handler: any;
134
+ controllerInfo: any;
135
+ }
136
+ export interface ActivityMethodMetadata {
137
+ name: string;
138
+ originalName: string;
139
+ options?: Record<string, any>;
140
+ handler: ActivityMethodHandler;
141
+ }
142
+ export interface DiscoveryStats {
143
+ controllers: number;
144
+ methods: number;
145
+ scheduled: number;
146
+ signals: number;
147
+ queries: number;
148
+ }
149
+ export interface ScheduleStatus {
150
+ scheduleId: string;
151
+ workflowName: string;
152
+ isManaged: boolean;
153
+ isActive: boolean;
154
+ lastError?: string;
155
+ createdAt: Date;
156
+ lastUpdatedAt: Date;
157
+ }
158
+ export interface ScheduleStats {
159
+ total: number;
160
+ active: number;
161
+ inactive: number;
162
+ errors: number;
163
+ }
164
+ export interface WorkerStatus {
165
+ isInitialized: boolean;
166
+ isRunning: boolean;
167
+ isHealthy: boolean;
168
+ taskQueue: string;
169
+ namespace: string;
170
+ workflowSource: 'bundle' | 'filesystem' | 'none';
171
+ activitiesCount: number;
172
+ lastError?: string;
173
+ startedAt?: Date;
174
+ uptime?: number;
175
+ }
176
+ export interface SystemStatus {
177
+ client: {
178
+ available: boolean;
179
+ healthy: boolean;
180
+ };
181
+ worker: {
182
+ available: boolean;
183
+ status?: WorkerStatus;
184
+ health?: string;
185
+ };
186
+ discovery: DiscoveryStats;
187
+ schedules: ScheduleStats;
188
+ }
189
+ export interface WorkflowParameterMetadata {
190
+ type: 'param' | 'context' | 'workflowId' | 'runId' | 'taskQueue';
191
+ index?: number;
192
+ extractAll?: boolean;
193
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Worker = exports.Client = exports.ScheduleOverlapPolicy = void 0;
4
+ var client_1 = require("@temporalio/client");
5
+ Object.defineProperty(exports, "ScheduleOverlapPolicy", { enumerable: true, get: function () { return client_1.ScheduleOverlapPolicy; } });
6
+ Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } });
7
+ var worker_1 = require("@temporalio/worker");
8
+ Object.defineProperty(exports, "Worker", { enumerable: true, get: function () { return worker_1.Worker; } });
9
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAMA,6CAAmF;AAA1E,+GAAA,qBAAqB,OAAA;AAAkB,gGAAA,MAAM,OAAA;AACtD,6CAA4C;AAAnC,gGAAA,MAAM,OAAA"}