nestjs-temporal-core 3.0.10 → 3.0.12

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 (123) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +1755 -693
  3. package/dist/constants.d.ts +49 -151
  4. package/dist/constants.js +38 -141
  5. package/dist/constants.js.map +1 -1
  6. package/dist/decorators/activity.decorator.js +75 -15
  7. package/dist/decorators/activity.decorator.js.map +1 -1
  8. package/dist/decorators/index.d.ts +1 -3
  9. package/dist/decorators/index.js +4 -13
  10. package/dist/decorators/index.js.map +1 -1
  11. package/dist/decorators/workflow.decorator.d.ts +7 -3
  12. package/dist/decorators/workflow.decorator.js +161 -48
  13. package/dist/decorators/workflow.decorator.js.map +1 -1
  14. package/dist/health/temporal-health.controller.d.ts +7 -0
  15. package/dist/health/temporal-health.controller.js +77 -0
  16. package/dist/health/temporal-health.controller.js.map +1 -0
  17. package/dist/health/temporal-health.module.d.ts +2 -0
  18. package/dist/health/temporal-health.module.js +20 -0
  19. package/dist/health/temporal-health.module.js.map +1 -0
  20. package/dist/index.d.ts +10 -20
  21. package/dist/index.js +15 -30
  22. package/dist/index.js.map +1 -1
  23. package/dist/interfaces.d.ts +773 -160
  24. package/dist/interfaces.js +1 -2
  25. package/dist/interfaces.js.map +1 -1
  26. package/dist/providers/temporal-connection.factory.d.ts +28 -0
  27. package/dist/providers/temporal-connection.factory.js +194 -0
  28. package/dist/providers/temporal-connection.factory.js.map +1 -0
  29. package/dist/services/temporal-client.service.d.ts +33 -0
  30. package/dist/services/temporal-client.service.js +285 -0
  31. package/dist/services/temporal-client.service.js.map +1 -0
  32. package/dist/services/temporal-discovery.service.d.ts +34 -0
  33. package/dist/services/temporal-discovery.service.js +348 -0
  34. package/dist/services/temporal-discovery.service.js.map +1 -0
  35. package/dist/services/temporal-metadata.service.d.ts +37 -0
  36. package/dist/services/temporal-metadata.service.js +512 -0
  37. package/dist/services/temporal-metadata.service.js.map +1 -0
  38. package/dist/services/temporal-schedule.service.d.ts +35 -0
  39. package/dist/services/temporal-schedule.service.js +380 -0
  40. package/dist/services/temporal-schedule.service.js.map +1 -0
  41. package/dist/services/temporal-worker.service.d.ts +67 -0
  42. package/dist/services/temporal-worker.service.js +845 -0
  43. package/dist/services/temporal-worker.service.js.map +1 -0
  44. package/dist/services/temporal.service.d.ts +92 -0
  45. package/dist/services/temporal.service.js +621 -0
  46. package/dist/services/temporal.service.js.map +1 -0
  47. package/dist/temporal.module.d.ts +6 -9
  48. package/dist/temporal.module.js +160 -109
  49. package/dist/temporal.module.js.map +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/dist/utils/index.d.ts +2 -2
  52. package/dist/utils/index.js +5 -8
  53. package/dist/utils/index.js.map +1 -1
  54. package/dist/utils/logger.d.ts +10 -4
  55. package/dist/utils/logger.js +77 -106
  56. package/dist/utils/logger.js.map +1 -1
  57. package/dist/utils/metadata.d.ts +1 -3
  58. package/dist/utils/metadata.js +8 -18
  59. package/dist/utils/metadata.js.map +1 -1
  60. package/dist/utils/validation.d.ts +16 -2
  61. package/dist/utils/validation.js +103 -9
  62. package/dist/utils/validation.js.map +1 -1
  63. package/package.json +37 -26
  64. package/dist/activity/index.d.ts +0 -2
  65. package/dist/activity/index.js +0 -19
  66. package/dist/activity/index.js.map +0 -1
  67. package/dist/activity/temporal-activity.module.d.ts +0 -11
  68. package/dist/activity/temporal-activity.module.js +0 -52
  69. package/dist/activity/temporal-activity.module.js.map +0 -1
  70. package/dist/activity/temporal-activity.service.d.ts +0 -46
  71. package/dist/activity/temporal-activity.service.js +0 -192
  72. package/dist/activity/temporal-activity.service.js.map +0 -1
  73. package/dist/client/index.d.ts +0 -3
  74. package/dist/client/index.js +0 -20
  75. package/dist/client/index.js.map +0 -1
  76. package/dist/client/temporal-client.module.d.ts +0 -18
  77. package/dist/client/temporal-client.module.js +0 -198
  78. package/dist/client/temporal-client.module.js.map +0 -1
  79. package/dist/client/temporal-client.service.d.ts +0 -35
  80. package/dist/client/temporal-client.service.js +0 -187
  81. package/dist/client/temporal-client.service.js.map +0 -1
  82. package/dist/client/temporal-schedule.service.d.ts +0 -41
  83. package/dist/client/temporal-schedule.service.js +0 -204
  84. package/dist/client/temporal-schedule.service.js.map +0 -1
  85. package/dist/decorators/parameter.decorator.d.ts +0 -5
  86. package/dist/decorators/parameter.decorator.js +0 -57
  87. package/dist/decorators/parameter.decorator.js.map +0 -1
  88. package/dist/decorators/scheduling.decorator.d.ts +0 -4
  89. package/dist/decorators/scheduling.decorator.js +0 -44
  90. package/dist/decorators/scheduling.decorator.js.map +0 -1
  91. package/dist/discovery/index.d.ts +0 -2
  92. package/dist/discovery/index.js +0 -19
  93. package/dist/discovery/index.js.map +0 -1
  94. package/dist/discovery/temporal-discovery.service.d.ts +0 -39
  95. package/dist/discovery/temporal-discovery.service.js +0 -191
  96. package/dist/discovery/temporal-discovery.service.js.map +0 -1
  97. package/dist/discovery/temporal-schedule-manager.service.d.ts +0 -41
  98. package/dist/discovery/temporal-schedule-manager.service.js +0 -238
  99. package/dist/discovery/temporal-schedule-manager.service.js.map +0 -1
  100. package/dist/schedules/index.d.ts +0 -2
  101. package/dist/schedules/index.js +0 -19
  102. package/dist/schedules/index.js.map +0 -1
  103. package/dist/schedules/temporal-schedules.module.d.ts +0 -11
  104. package/dist/schedules/temporal-schedules.module.js +0 -55
  105. package/dist/schedules/temporal-schedules.module.js.map +0 -1
  106. package/dist/schedules/temporal-schedules.service.d.ts +0 -52
  107. package/dist/schedules/temporal-schedules.service.js +0 -221
  108. package/dist/schedules/temporal-schedules.service.js.map +0 -1
  109. package/dist/temporal.service.d.ts +0 -77
  110. package/dist/temporal.service.js +0 -243
  111. package/dist/temporal.service.js.map +0 -1
  112. package/dist/worker/index.d.ts +0 -3
  113. package/dist/worker/index.js +0 -20
  114. package/dist/worker/index.js.map +0 -1
  115. package/dist/worker/temporal-metadata.accessor.d.ts +0 -32
  116. package/dist/worker/temporal-metadata.accessor.js +0 -208
  117. package/dist/worker/temporal-metadata.accessor.js.map +0 -1
  118. package/dist/worker/temporal-worker-manager.service.d.ts +0 -49
  119. package/dist/worker/temporal-worker-manager.service.js +0 -389
  120. package/dist/worker/temporal-worker-manager.service.js.map +0 -1
  121. package/dist/worker/temporal-worker.module.d.ts +0 -18
  122. package/dist/worker/temporal-worker.module.js +0 -156
  123. package/dist/worker/temporal-worker.module.js.map +0 -1
@@ -1,3 +1,7 @@
1
- import { QueryOptions, SignalOptions } from '../interfaces';
2
- export declare const Signal: (nameOrOptions?: string | SignalOptions) => MethodDecorator;
3
- export declare const Query: (nameOrOptions?: string | QueryOptions) => MethodDecorator;
1
+ import 'reflect-metadata';
2
+ import { Type } from '@nestjs/common';
3
+ export declare const SignalMethod: (signalName?: string) => MethodDecorator;
4
+ export declare const QueryMethod: (queryName?: string) => MethodDecorator;
5
+ export declare const ChildWorkflow: (workflowType: Type<unknown>, options?: {
6
+ taskQueue?: string;
7
+ }) => PropertyDecorator;
@@ -1,58 +1,171 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Query = exports.Signal = void 0;
4
- const common_1 = require("@nestjs/common");
3
+ exports.ChildWorkflow = exports.QueryMethod = exports.SignalMethod = void 0;
5
4
  const constants_1 = require("../constants");
6
- const Signal = (nameOrOptions) => {
7
- return (_target, propertyKey, descriptor) => {
8
- let signalName;
9
- let signalOptions = {};
10
- if (typeof nameOrOptions === 'string') {
11
- signalName = nameOrOptions;
12
- signalOptions = { name: nameOrOptions };
13
- }
14
- else if (nameOrOptions?.name) {
15
- signalName = nameOrOptions.name;
16
- signalOptions = nameOrOptions;
17
- }
18
- else {
19
- signalName = propertyKey.toString();
20
- signalOptions = { name: signalName };
21
- }
22
- const metadata = {
23
- name: signalName,
24
- ...signalOptions,
25
- };
26
- Reflect.defineMetadata(constants_1.TEMPORAL_SIGNAL_METHOD, metadata, descriptor.value);
27
- (0, common_1.SetMetadata)(constants_1.TEMPORAL_SIGNAL_METHOD, metadata)(descriptor.value);
5
+ require("reflect-metadata");
6
+ const logger_1 = require("../utils/logger");
7
+ const validation_1 = require("../utils/validation");
8
+ const logger = (0, logger_1.createLogger)('WorkflowDecorators');
9
+ const SignalMethod = (signalName) => {
10
+ return (target, propertyKey, descriptor) => {
11
+ const className = target.constructor.name;
12
+ const methodName = propertyKey.toString();
13
+ const finalSignalName = signalName || methodName;
14
+ logger.debug(`@SignalMethod decorator applied to method: ${className}.${methodName}`);
15
+ logger.debug(`Signal name: ${finalSignalName} (provided: ${signalName || 'auto-generated'})`);
16
+ if (!descriptor || typeof descriptor.value !== 'function') {
17
+ const error = `@SignalMethod can only be applied to methods, not ${typeof descriptor?.value}`;
18
+ logger.error(`@SignalMethod validation failed for ${className}.${methodName}: ${error}`);
19
+ throw new Error(error);
20
+ }
21
+ if (signalName !== undefined && signalName.length === 0) {
22
+ const error = 'Signal name cannot be empty';
23
+ logger.error(`@SignalMethod validation failed for ${className}.${methodName}: ${error}`);
24
+ throw new Error(error);
25
+ }
26
+ try {
27
+ (0, validation_1.validateSignalName)(finalSignalName);
28
+ }
29
+ catch (error) {
30
+ logger.error(`@SignalMethod validation failed for ${className}.${methodName}: ${error.message}`);
31
+ throw error;
32
+ }
33
+ const signals = Reflect.getMetadata(constants_1.TEMPORAL_SIGNAL_METHOD, target.constructor.prototype) || {};
34
+ logger.debug(`Existing signals in ${className}: [${Object.keys(signals).join(', ')}]`);
35
+ if (signals[finalSignalName] && signals[finalSignalName] !== propertyKey) {
36
+ const error = `Duplicate signal name "${finalSignalName}" found in class ${className}. ` +
37
+ `Signal names must be unique within a workflow class.`;
38
+ logger.error(`@SignalMethod validation failed: ${error}`);
39
+ throw new Error(error);
40
+ }
41
+ logger.debug(`Registering signal "${finalSignalName}" for method ${className}.${methodName}`);
42
+ try {
43
+ signals[finalSignalName] = propertyKey;
44
+ Reflect.defineMetadata(constants_1.TEMPORAL_SIGNAL_METHOD, signals, target.constructor.prototype);
45
+ logger.debug(`Stored signal metadata on class prototype: ${className}`);
46
+ const signalMetadata = {
47
+ signalName: finalSignalName,
48
+ methodName,
49
+ className,
50
+ };
51
+ Reflect.defineMetadata(constants_1.TEMPORAL_SIGNAL_METHOD + '_METHOD', signalMetadata, descriptor.value);
52
+ logger.debug(`Stored individual signal metadata on method: ${className}.${methodName}`);
53
+ logger.debug(`@SignalMethod decorator successfully applied to ${className}.${methodName}`);
54
+ }
55
+ catch (error) {
56
+ logger.error(`Failed to store @SignalMethod metadata for ${className}.${methodName}:`, error);
57
+ throw error;
58
+ }
28
59
  return descriptor;
29
60
  };
30
61
  };
31
- exports.Signal = Signal;
32
- const Query = (nameOrOptions) => {
33
- return (_target, propertyKey, descriptor) => {
34
- let queryName;
35
- let queryOptions = {};
36
- if (typeof nameOrOptions === 'string') {
37
- queryName = nameOrOptions;
38
- queryOptions = { name: nameOrOptions };
39
- }
40
- else if (nameOrOptions?.name) {
41
- queryName = nameOrOptions.name;
42
- queryOptions = nameOrOptions;
43
- }
44
- else {
45
- queryName = propertyKey.toString();
46
- queryOptions = { name: queryName };
47
- }
48
- const metadata = {
49
- name: queryName,
50
- ...queryOptions,
51
- };
52
- Reflect.defineMetadata(constants_1.TEMPORAL_QUERY_METHOD, metadata, descriptor.value);
53
- (0, common_1.SetMetadata)(constants_1.TEMPORAL_QUERY_METHOD, metadata)(descriptor.value);
62
+ exports.SignalMethod = SignalMethod;
63
+ const QueryMethod = (queryName) => {
64
+ return (target, propertyKey, descriptor) => {
65
+ const className = target.constructor.name;
66
+ const methodName = propertyKey.toString();
67
+ const finalQueryName = queryName || methodName;
68
+ logger.debug(`@QueryMethod decorator applied to method: ${className}.${methodName}`);
69
+ logger.debug(`Query name: ${finalQueryName} (provided: ${queryName || 'auto-generated'})`);
70
+ if (!descriptor || typeof descriptor.value !== 'function') {
71
+ const error = `@QueryMethod can only be applied to methods, not ${typeof descriptor?.value}`;
72
+ logger.error(`@QueryMethod validation failed for ${className}.${methodName}: ${error}`);
73
+ throw new Error(error);
74
+ }
75
+ if (queryName !== undefined && queryName.length === 0) {
76
+ const error = 'Query name cannot be empty';
77
+ logger.error(`@QueryMethod validation failed for ${className}.${methodName}: ${error}`);
78
+ throw new Error(error);
79
+ }
80
+ try {
81
+ (0, validation_1.validateQueryName)(finalQueryName);
82
+ }
83
+ catch (error) {
84
+ logger.error(`@QueryMethod validation failed for ${className}.${methodName}: ${error.message}`);
85
+ throw error;
86
+ }
87
+ const queries = Reflect.getMetadata(constants_1.TEMPORAL_QUERY_METHOD, target.constructor.prototype) || {};
88
+ logger.debug(`Existing queries in ${className}: [${Object.keys(queries).join(', ')}]`);
89
+ if (queries[finalQueryName] && queries[finalQueryName] !== propertyKey) {
90
+ const error = `Duplicate query name "${finalQueryName}" found in class ${className}. ` +
91
+ `Query names must be unique within a workflow class.`;
92
+ logger.error(`@QueryMethod validation failed: ${error}`);
93
+ throw new Error(error);
94
+ }
95
+ logger.debug(`Registering query "${finalQueryName}" for method ${className}.${methodName}`);
96
+ try {
97
+ queries[finalQueryName] = propertyKey;
98
+ Reflect.defineMetadata(constants_1.TEMPORAL_QUERY_METHOD, queries, target.constructor.prototype);
99
+ logger.debug(`Stored query metadata on class prototype: ${className}`);
100
+ const queryMetadata = {
101
+ queryName: finalQueryName,
102
+ methodName,
103
+ className,
104
+ };
105
+ Reflect.defineMetadata(constants_1.TEMPORAL_QUERY_METHOD + '_METHOD', queryMetadata, descriptor.value);
106
+ logger.debug(`Stored individual query metadata on method: ${className}.${methodName}`);
107
+ logger.debug(`@QueryMethod decorator successfully applied to ${className}.${methodName}`);
108
+ }
109
+ catch (error) {
110
+ logger.error(`Failed to store @QueryMethod metadata for ${className}.${methodName}:`, error);
111
+ throw error;
112
+ }
54
113
  return descriptor;
55
114
  };
56
115
  };
57
- exports.Query = Query;
116
+ exports.QueryMethod = QueryMethod;
117
+ const ChildWorkflow = (workflowType, options) => {
118
+ return (target, propertyKey) => {
119
+ const className = target.constructor.name;
120
+ const propertyName = propertyKey.toString();
121
+ logger.debug(`@ChildWorkflow decorator applied to property: ${className}.${propertyName}`);
122
+ logger.debug(`Child workflow type: ${workflowType?.name}`);
123
+ logger.debug(`Child workflow options: ${JSON.stringify(options)}`);
124
+ if (!workflowType) {
125
+ const error = 'Child workflow type is required';
126
+ logger.error(`@ChildWorkflow validation failed for ${className}.${propertyName}: ${error}`);
127
+ throw new Error(error);
128
+ }
129
+ if (typeof workflowType !== 'function') {
130
+ const error = 'Child workflow type must be a class constructor';
131
+ logger.error(`@ChildWorkflow validation failed for ${className}.${propertyName}: ${error}`);
132
+ throw new Error(error);
133
+ }
134
+ const workflowName = workflowType.name;
135
+ logger.debug(`Using class name as workflow name: ${workflowName}`);
136
+ const childWorkflowMetadata = {
137
+ workflowType,
138
+ workflowName,
139
+ propertyKey: propertyName,
140
+ className,
141
+ options: options || {},
142
+ };
143
+ logger.debug(`Storing @ChildWorkflow metadata for ${className}.${propertyName}: ${JSON.stringify(childWorkflowMetadata)}`);
144
+ try {
145
+ Reflect.defineMetadata(constants_1.TEMPORAL_CHILD_WORKFLOW, childWorkflowMetadata, target, propertyKey);
146
+ logger.debug(`Stored @ChildWorkflow metadata for ${className}.${propertyName}`);
147
+ Object.defineProperty(target, propertyKey, {
148
+ get() {
149
+ const error = `Child workflow ${workflowName} not initialized. This should be set up by the worker service.`;
150
+ logger.warn(`Child workflow proxy not initialized: ${className}.${propertyName} -> ${workflowName}`);
151
+ throw new Error(error);
152
+ },
153
+ set() {
154
+ const error = 'Child workflow proxy is read-only';
155
+ logger.warn(`Attempted to set child workflow proxy: ${className}.${propertyName}`);
156
+ throw new Error(error);
157
+ },
158
+ enumerable: false,
159
+ configurable: true,
160
+ });
161
+ logger.debug(`Created property descriptor for child workflow: ${className}.${propertyName}`);
162
+ logger.debug(`@ChildWorkflow decorator successfully applied to ${className}.${propertyName}`);
163
+ }
164
+ catch (error) {
165
+ logger.error(`Failed to apply @ChildWorkflow decorator to ${className}.${propertyName}:`, error);
166
+ throw error;
167
+ }
168
+ };
169
+ };
170
+ exports.ChildWorkflow = ChildWorkflow;
58
171
  //# sourceMappingURL=workflow.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAA6E;AAsBtE,MAAM,MAAM,GAAG,CAAC,aAAsC,EAAmB,EAAE;IAC9E,OAAO,CAAC,OAAgB,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACtF,IAAI,UAAkB,CAAC;QACvB,IAAI,aAAa,GAAkB,EAAE,CAAC;QAEtC,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACpC,UAAU,GAAG,aAAa,CAAC;YAC3B,aAAa,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;QAC5C,CAAC;aAAM,IAAI,aAAa,EAAE,IAAI,EAAE,CAAC;YAC7B,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC;YAChC,aAAa,GAAG,aAAa,CAAC;QAClC,CAAC;aAAM,CAAC;YACJ,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;YACpC,aAAa,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QACzC,CAAC;QAED,MAAM,QAAQ,GAAG;YACb,IAAI,EAAE,UAAU;YAChB,GAAG,aAAa;SACnB,CAAC;QAEF,OAAO,CAAC,cAAc,CAAC,kCAAsB,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3E,IAAA,oBAAW,EAAC,kCAAsB,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChE,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC,CAAC;AAzBW,QAAA,MAAM,UAyBjB;AAqBK,MAAM,KAAK,GAAG,CAAC,aAAqC,EAAmB,EAAE;IAC5E,OAAO,CAAC,OAAgB,EAAE,WAA4B,E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AA+C,SAAS,IAAI,YAAY,GAAG,EAC3E,KAAK,CACR,CAAC;YACF,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC,CAAC;AACN,CAAC,CAAC;AA3FW,QAAA,aAAa,iBA2FxB"}
@@ -0,0 +1,7 @@
1
+ import { TemporalService } from '../services/temporal.service';
2
+ import { HealthResponse } from '../interfaces';
3
+ export declare class TemporalHealthController {
4
+ private readonly temporalService;
5
+ constructor(temporalService: TemporalService);
6
+ getHealth(): Promise<HealthResponse>;
7
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TemporalHealthController = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const temporal_service_1 = require("../services/temporal.service");
15
+ let TemporalHealthController = class TemporalHealthController {
16
+ constructor(temporalService) {
17
+ this.temporalService = temporalService;
18
+ }
19
+ async getHealth() {
20
+ const overallHealth = await this.temporalService.getOverallHealth();
21
+ const serviceStats = this.temporalService.getStats();
22
+ const workerStatus = this.temporalService.getWorkerStatus();
23
+ const components = overallHealth.components;
24
+ const healthyComponents = Object.values(components).filter((component) => component.status === 'healthy').length;
25
+ const degradedComponents = Object.values(components).filter((component) => component.status === 'degraded').length;
26
+ const unhealthyComponents = Object.values(components).filter((component) => component.status === 'unhealthy').length;
27
+ return {
28
+ status: overallHealth.status,
29
+ timestamp: overallHealth.timestamp.toISOString(),
30
+ uptime: process.uptime(),
31
+ client: {
32
+ available: serviceStats.client.isConnected,
33
+ healthy: serviceStats.client.isHealthy,
34
+ connected: serviceStats.client.isConnected,
35
+ },
36
+ worker: {
37
+ available: this.temporalService.hasWorker(),
38
+ running: workerStatus?.isRunning || false,
39
+ healthy: workerStatus?.isHealthy || false,
40
+ activitiesCount: serviceStats.worker.activitiesCount,
41
+ },
42
+ discovery: {
43
+ activities: serviceStats.discovery.discoveredCount,
44
+ complete: serviceStats.discovery.isComplete,
45
+ discoveredCount: serviceStats.discovery.discoveredCount,
46
+ },
47
+ schedules: {
48
+ total: serviceStats.schedules.total,
49
+ active: serviceStats.schedules.active,
50
+ paused: serviceStats.schedules.paused,
51
+ },
52
+ metadata: {
53
+ classes: serviceStats.activities.classes,
54
+ methods: serviceStats.activities.methods,
55
+ total: serviceStats.activities.total,
56
+ },
57
+ summary: {
58
+ totalComponents: Object.keys(components).length,
59
+ healthyComponents,
60
+ degradedComponents,
61
+ unhealthyComponents,
62
+ },
63
+ };
64
+ }
65
+ };
66
+ exports.TemporalHealthController = TemporalHealthController;
67
+ __decorate([
68
+ (0, common_1.Get)(),
69
+ __metadata("design:type", Function),
70
+ __metadata("design:paramtypes", []),
71
+ __metadata("design:returntype", Promise)
72
+ ], TemporalHealthController.prototype, "getHealth", null);
73
+ exports.TemporalHealthController = TemporalHealthController = __decorate([
74
+ (0, common_1.Controller)('temporal/health'),
75
+ __metadata("design:paramtypes", [temporal_service_1.TemporalService])
76
+ ], TemporalHealthController);
77
+ //# sourceMappingURL=temporal-health.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-health.controller.js","sourceRoot":"","sources":["../../src/health/temporal-health.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,mEAA+D;AAUxD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACjC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;gBAC3C,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,KAAK;gBACzC,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,KAAK;gBACzC,eAAe,EAAE,YAAY,CAAC,MAAM,CAAC,eAAe;aACvD;YACD,SAAS,EAAE;gBACP,UAAU,EAAE,YAAY,CAAC,SAAS,CAAC,eAAe;gBAClD,QAAQ,EAAE,YAAY,CAAC,SAAS,CAAC,UAAU;gBAC3C,eAAe,EAAE,YAAY,CAAC,SAAS,CAAC,eAAe;aAC1D;YACD,SAAS,EAAE;gBACP,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK;gBACnC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,MAAM;gBACrC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,MAAM;aACxC;YACD,QAAQ,EAAE;gBACN,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,OAAO;gBACxC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,OAAO;gBACxC,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,KAAK;aACvC;YACD,OAAO,EAAE;gBACL,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM;gBAC/C,iBAAiB;gBACjB,kBAAkB;gBAClB,mBAAmB;aACtB;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AAzEY,4DAAwB;AAkB3B;IADL,IAAA,YAAG,GAAE;;;;yDAuDL;mCAxEQ,wBAAwB;IADpC,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEoB,kCAAe;GADpD,wBAAwB,CAyEpC"}
@@ -0,0 +1,2 @@
1
+ export declare class TemporalHealthModule {
2
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TemporalHealthModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const temporal_health_controller_1 = require("./temporal-health.controller");
12
+ let TemporalHealthModule = class TemporalHealthModule {
13
+ };
14
+ exports.TemporalHealthModule = TemporalHealthModule;
15
+ exports.TemporalHealthModule = TemporalHealthModule = __decorate([
16
+ (0, common_1.Module)({
17
+ controllers: [temporal_health_controller_1.TemporalHealthController],
18
+ })
19
+ ], TemporalHealthModule);
20
+ //# sourceMappingURL=temporal-health.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-health.module.js","sourceRoot":"","sources":["../../src/health/temporal-health.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6EAAwE;AA4BjE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IAHhC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,CAAC,qDAAwB,CAAC;KAC1C,CAAC;GACW,oBAAoB,CAAG"}
package/dist/index.d.ts CHANGED
@@ -1,24 +1,14 @@
1
1
  import 'reflect-metadata';
2
+ export * from './decorators';
2
3
  export { TemporalModule } from './temporal.module';
3
- export { TemporalService } from './temporal.service';
4
- export { TemporalClientModule } from './client/temporal-client.module';
5
- export { TemporalClientService } from './client/temporal-client.service';
6
- export { TemporalScheduleService } from './client/temporal-schedule.service';
7
- export { TemporalWorkerModule } from './worker/temporal-worker.module';
8
- export { TemporalWorkerManagerService } from './worker/temporal-worker-manager.service';
9
- export { TemporalMetadataAccessor } from './worker/temporal-metadata.accessor';
10
- export { TemporalActivityModule } from './activity/temporal-activity.module';
11
- export { TemporalActivityService } from './activity/temporal-activity.service';
12
- export { TemporalSchedulesModule } from './schedules/temporal-schedules.module';
13
- export { TemporalSchedulesService } from './schedules/temporal-schedules.service';
14
- export { TemporalDiscoveryService } from './discovery/temporal-discovery.service';
15
- export { TemporalScheduleManagerService } from './discovery/temporal-schedule-manager.service';
4
+ export { TemporalHealthModule } from './health/temporal-health.module';
5
+ export { TemporalHealthController } from './health/temporal-health.controller';
6
+ export { TemporalService } from './services/temporal.service';
7
+ export { TemporalClientService } from './services/temporal-client.service';
8
+ export { TemporalWorkerManagerService } from './services/temporal-worker.service';
9
+ export { TemporalDiscoveryService } from './services/temporal-discovery.service';
10
+ export { TemporalMetadataAccessor } from './services/temporal-metadata.service';
11
+ export { TemporalScheduleService } from './services/temporal-schedule.service';
16
12
  export * from './utils';
17
- export * from './decorators';
18
13
  export * from './interfaces';
19
- export { DEFAULT_NAMESPACE, DEFAULT_TASK_QUEUE, DEFAULT_CONNECTION_TIMEOUT_MS, TEMPORAL_ACTIVITY, TEMPORAL_ACTIVITY_METHOD, TEMPORAL_SIGNAL_METHOD, TEMPORAL_QUERY_METHOD, TEMPORAL_SCHEDULED_WORKFLOW, WORKFLOW_PARAMS_METADATA, TEMPORAL_CLIENT, TEMPORAL_MODULE_OPTIONS, TEMPORAL_CONNECTION, CRON_EXPRESSIONS, INTERVAL_EXPRESSIONS, TIMEOUTS, RETRY_POLICIES, } from './constants';
20
- export * from './temporal.service';
21
- export * from './temporal.module';
22
- export type { RetryPolicy, Duration, SearchAttributes } from '@temporalio/common';
23
- export type { ScheduleOverlapPolicy, WorkflowHandle, Client } from '@temporalio/client';
24
- export type { Worker } from '@temporalio/worker';
14
+ export { DEFAULT_NAMESPACE, DEFAULT_TASK_QUEUE, DEFAULT_CONNECTION_TIMEOUT_MS, TEMPORAL_ACTIVITY, TEMPORAL_ACTIVITY_METHOD, TEMPORAL_SIGNAL_METHOD, TEMPORAL_QUERY_METHOD, WORKFLOW_PARAMS_METADATA, TEMPORAL_CLIENT, TEMPORAL_MODULE_OPTIONS, TEMPORAL_CONNECTION, TIMEOUTS, RETRY_POLICIES, } from './constants';
package/dist/index.js CHANGED
@@ -14,38 +14,28 @@ 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.RETRY_POLICIES = exports.TIMEOUTS = exports.INTERVAL_EXPRESSIONS = exports.CRON_EXPRESSIONS = exports.TEMPORAL_CONNECTION = exports.TEMPORAL_MODULE_OPTIONS = exports.TEMPORAL_CLIENT = exports.WORKFLOW_PARAMS_METADATA = exports.TEMPORAL_SCHEDULED_WORKFLOW = exports.TEMPORAL_QUERY_METHOD = exports.TEMPORAL_SIGNAL_METHOD = exports.TEMPORAL_ACTIVITY_METHOD = exports.TEMPORAL_ACTIVITY = exports.DEFAULT_CONNECTION_TIMEOUT_MS = exports.DEFAULT_TASK_QUEUE = exports.DEFAULT_NAMESPACE = exports.TemporalScheduleManagerService = exports.TemporalDiscoveryService = exports.TemporalSchedulesService = exports.TemporalSchedulesModule = exports.TemporalActivityService = exports.TemporalActivityModule = exports.TemporalMetadataAccessor = exports.TemporalWorkerManagerService = exports.TemporalWorkerModule = exports.TemporalScheduleService = exports.TemporalClientService = exports.TemporalClientModule = exports.TemporalService = exports.TemporalModule = void 0;
17
+ exports.RETRY_POLICIES = exports.TIMEOUTS = exports.TEMPORAL_CONNECTION = exports.TEMPORAL_MODULE_OPTIONS = exports.TEMPORAL_CLIENT = exports.WORKFLOW_PARAMS_METADATA = exports.TEMPORAL_QUERY_METHOD = exports.TEMPORAL_SIGNAL_METHOD = exports.TEMPORAL_ACTIVITY_METHOD = exports.TEMPORAL_ACTIVITY = exports.DEFAULT_CONNECTION_TIMEOUT_MS = exports.DEFAULT_TASK_QUEUE = exports.DEFAULT_NAMESPACE = exports.TemporalScheduleService = exports.TemporalMetadataAccessor = exports.TemporalDiscoveryService = exports.TemporalWorkerManagerService = exports.TemporalClientService = exports.TemporalService = exports.TemporalHealthController = exports.TemporalHealthModule = exports.TemporalModule = void 0;
18
18
  require("reflect-metadata");
19
+ __exportStar(require("./decorators"), exports);
19
20
  var temporal_module_1 = require("./temporal.module");
20
21
  Object.defineProperty(exports, "TemporalModule", { enumerable: true, get: function () { return temporal_module_1.TemporalModule; } });
21
- var temporal_service_1 = require("./temporal.service");
22
+ var temporal_health_module_1 = require("./health/temporal-health.module");
23
+ Object.defineProperty(exports, "TemporalHealthModule", { enumerable: true, get: function () { return temporal_health_module_1.TemporalHealthModule; } });
24
+ var temporal_health_controller_1 = require("./health/temporal-health.controller");
25
+ Object.defineProperty(exports, "TemporalHealthController", { enumerable: true, get: function () { return temporal_health_controller_1.TemporalHealthController; } });
26
+ var temporal_service_1 = require("./services/temporal.service");
22
27
  Object.defineProperty(exports, "TemporalService", { enumerable: true, get: function () { return temporal_service_1.TemporalService; } });
23
- var temporal_client_module_1 = require("./client/temporal-client.module");
24
- Object.defineProperty(exports, "TemporalClientModule", { enumerable: true, get: function () { return temporal_client_module_1.TemporalClientModule; } });
25
- var temporal_client_service_1 = require("./client/temporal-client.service");
28
+ var temporal_client_service_1 = require("./services/temporal-client.service");
26
29
  Object.defineProperty(exports, "TemporalClientService", { enumerable: true, get: function () { return temporal_client_service_1.TemporalClientService; } });
27
- var temporal_schedule_service_1 = require("./client/temporal-schedule.service");
28
- Object.defineProperty(exports, "TemporalScheduleService", { enumerable: true, get: function () { return temporal_schedule_service_1.TemporalScheduleService; } });
29
- var temporal_worker_module_1 = require("./worker/temporal-worker.module");
30
- Object.defineProperty(exports, "TemporalWorkerModule", { enumerable: true, get: function () { return temporal_worker_module_1.TemporalWorkerModule; } });
31
- var temporal_worker_manager_service_1 = require("./worker/temporal-worker-manager.service");
32
- Object.defineProperty(exports, "TemporalWorkerManagerService", { enumerable: true, get: function () { return temporal_worker_manager_service_1.TemporalWorkerManagerService; } });
33
- var temporal_metadata_accessor_1 = require("./worker/temporal-metadata.accessor");
34
- Object.defineProperty(exports, "TemporalMetadataAccessor", { enumerable: true, get: function () { return temporal_metadata_accessor_1.TemporalMetadataAccessor; } });
35
- var temporal_activity_module_1 = require("./activity/temporal-activity.module");
36
- Object.defineProperty(exports, "TemporalActivityModule", { enumerable: true, get: function () { return temporal_activity_module_1.TemporalActivityModule; } });
37
- var temporal_activity_service_1 = require("./activity/temporal-activity.service");
38
- Object.defineProperty(exports, "TemporalActivityService", { enumerable: true, get: function () { return temporal_activity_service_1.TemporalActivityService; } });
39
- var temporal_schedules_module_1 = require("./schedules/temporal-schedules.module");
40
- Object.defineProperty(exports, "TemporalSchedulesModule", { enumerable: true, get: function () { return temporal_schedules_module_1.TemporalSchedulesModule; } });
41
- var temporal_schedules_service_1 = require("./schedules/temporal-schedules.service");
42
- Object.defineProperty(exports, "TemporalSchedulesService", { enumerable: true, get: function () { return temporal_schedules_service_1.TemporalSchedulesService; } });
43
- var temporal_discovery_service_1 = require("./discovery/temporal-discovery.service");
30
+ var temporal_worker_service_1 = require("./services/temporal-worker.service");
31
+ Object.defineProperty(exports, "TemporalWorkerManagerService", { enumerable: true, get: function () { return temporal_worker_service_1.TemporalWorkerManagerService; } });
32
+ var temporal_discovery_service_1 = require("./services/temporal-discovery.service");
44
33
  Object.defineProperty(exports, "TemporalDiscoveryService", { enumerable: true, get: function () { return temporal_discovery_service_1.TemporalDiscoveryService; } });
45
- var temporal_schedule_manager_service_1 = require("./discovery/temporal-schedule-manager.service");
46
- Object.defineProperty(exports, "TemporalScheduleManagerService", { enumerable: true, get: function () { return temporal_schedule_manager_service_1.TemporalScheduleManagerService; } });
34
+ var temporal_metadata_service_1 = require("./services/temporal-metadata.service");
35
+ Object.defineProperty(exports, "TemporalMetadataAccessor", { enumerable: true, get: function () { return temporal_metadata_service_1.TemporalMetadataAccessor; } });
36
+ var temporal_schedule_service_1 = require("./services/temporal-schedule.service");
37
+ Object.defineProperty(exports, "TemporalScheduleService", { enumerable: true, get: function () { return temporal_schedule_service_1.TemporalScheduleService; } });
47
38
  __exportStar(require("./utils"), exports);
48
- __exportStar(require("./decorators"), exports);
49
39
  __exportStar(require("./interfaces"), exports);
50
40
  var constants_1 = require("./constants");
51
41
  Object.defineProperty(exports, "DEFAULT_NAMESPACE", { enumerable: true, get: function () { return constants_1.DEFAULT_NAMESPACE; } });
@@ -55,15 +45,10 @@ Object.defineProperty(exports, "TEMPORAL_ACTIVITY", { enumerable: true, get: fun
55
45
  Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD; } });
56
46
  Object.defineProperty(exports, "TEMPORAL_SIGNAL_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_SIGNAL_METHOD; } });
57
47
  Object.defineProperty(exports, "TEMPORAL_QUERY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_QUERY_METHOD; } });
58
- Object.defineProperty(exports, "TEMPORAL_SCHEDULED_WORKFLOW", { enumerable: true, get: function () { return constants_1.TEMPORAL_SCHEDULED_WORKFLOW; } });
59
48
  Object.defineProperty(exports, "WORKFLOW_PARAMS_METADATA", { enumerable: true, get: function () { return constants_1.WORKFLOW_PARAMS_METADATA; } });
60
49
  Object.defineProperty(exports, "TEMPORAL_CLIENT", { enumerable: true, get: function () { return constants_1.TEMPORAL_CLIENT; } });
61
50
  Object.defineProperty(exports, "TEMPORAL_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_MODULE_OPTIONS; } });
62
51
  Object.defineProperty(exports, "TEMPORAL_CONNECTION", { enumerable: true, get: function () { return constants_1.TEMPORAL_CONNECTION; } });
63
- Object.defineProperty(exports, "CRON_EXPRESSIONS", { enumerable: true, get: function () { return constants_1.CRON_EXPRESSIONS; } });
64
- Object.defineProperty(exports, "INTERVAL_EXPRESSIONS", { enumerable: true, get: function () { return constants_1.INTERVAL_EXPRESSIONS; } });
65
52
  Object.defineProperty(exports, "TIMEOUTS", { enumerable: true, get: function () { return constants_1.TIMEOUTS; } });
66
53
  Object.defineProperty(exports, "RETRY_POLICIES", { enumerable: true, get: function () { return constants_1.RETRY_POLICIES; } });
67
- __exportStar(require("./temporal.service"), exports);
68
- __exportStar(require("./temporal.module"), exports);
69
54
  //# 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;AA0B1B,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAGvB,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AAOxB,0EAAuE;AAA9D,8HAAA,oBAAoB,OAAA;AAG7B,4EAAyE;AAAhE,gIAAA,qBAAqB,OAAA;AAG9B,gFAA6E;AAApE,oIAAA,uBAAuB,OAAA;AAOhC,0EAAuE;AAA9D,8HAAA,oBAAoB,OAAA;AAG7B,4FAAwF;AAA/E,+IAAA,4BAA4B,OAAA;AAGrC,kFAA+E;AAAtE,sIAAA,wBAAwB,OAAA;AAOjC,gFAA6E;AAApE,kIAAA,sBAAsB,OAAA;AAG/B,kFAA+E;AAAtE,oIAAA,uBAAuB,OAAA;AAOhC,mFAAgF;AAAvE,oIAAA,uBAAuB,OAAA;AAGhC,qFAAkF;AAAzE,sIAAA,wBAAwB,OAAA;AAOjC,qFAAkF;AAAzE,sIAAA,wBAAwB,OAAA;AAGjC,mGAA+F;AAAtF,mJAAA,8BAA8B,OAAA;AAOvC,0CAAwB;AAOxB,+CAA6B;AAO7B,+CAA6B;AAO7B,yCAwBqB;AAtBjB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,0HAAA,6BAA6B,OAAA;AAG7B,8GAAA,iBAAiB,OAAA;AACjB,qHAAA,wBAAwB,OAAA;AACxB,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,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