nestjs-temporal-core 3.0.9 → 3.0.11
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.
- package/README.md +1451 -721
- package/dist/constants.d.ts +49 -151
- package/dist/constants.js +38 -141
- package/dist/constants.js.map +1 -1
- package/dist/decorators/activity.decorator.js +75 -15
- package/dist/decorators/activity.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +1 -3
- package/dist/decorators/index.js +4 -13
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/workflow.decorator.d.ts +7 -3
- package/dist/decorators/workflow.decorator.js +161 -48
- package/dist/decorators/workflow.decorator.js.map +1 -1
- package/dist/health/temporal-health.controller.d.ts +7 -0
- package/dist/health/temporal-health.controller.js +77 -0
- package/dist/health/temporal-health.controller.js.map +1 -0
- package/dist/health/temporal-health.module.d.ts +2 -0
- package/dist/health/temporal-health.module.js +20 -0
- package/dist/health/temporal-health.module.js.map +1 -0
- package/dist/index.d.ts +10 -20
- package/dist/index.js +15 -30
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +740 -160
- package/dist/interfaces.js +1 -2
- package/dist/interfaces.js.map +1 -1
- package/dist/providers/temporal-connection.factory.d.ts +28 -0
- package/dist/providers/temporal-connection.factory.js +194 -0
- package/dist/providers/temporal-connection.factory.js.map +1 -0
- package/dist/services/temporal-client.service.d.ts +33 -0
- package/dist/services/temporal-client.service.js +285 -0
- package/dist/services/temporal-client.service.js.map +1 -0
- package/dist/services/temporal-discovery.service.d.ts +34 -0
- package/dist/services/temporal-discovery.service.js +348 -0
- package/dist/services/temporal-discovery.service.js.map +1 -0
- package/dist/services/temporal-metadata.service.d.ts +37 -0
- package/dist/services/temporal-metadata.service.js +512 -0
- package/dist/services/temporal-metadata.service.js.map +1 -0
- package/dist/services/temporal-schedule.service.d.ts +35 -0
- package/dist/services/temporal-schedule.service.js +380 -0
- package/dist/services/temporal-schedule.service.js.map +1 -0
- package/dist/services/temporal-worker.service.d.ts +54 -0
- package/dist/services/temporal-worker.service.js +605 -0
- package/dist/services/temporal-worker.service.js.map +1 -0
- package/dist/services/temporal.service.d.ts +85 -0
- package/dist/services/temporal.service.js +572 -0
- package/dist/services/temporal.service.js.map +1 -0
- package/dist/temporal.module.d.ts +6 -9
- package/dist/temporal.module.js +160 -109
- package/dist/temporal.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +5 -8
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/logger.d.ts +10 -4
- package/dist/utils/logger.js +77 -106
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/metadata.d.ts +1 -3
- package/dist/utils/metadata.js +8 -18
- package/dist/utils/metadata.js.map +1 -1
- package/dist/utils/validation.d.ts +16 -2
- package/dist/utils/validation.js +103 -9
- package/dist/utils/validation.js.map +1 -1
- package/package.json +37 -26
- package/dist/activity/index.d.ts +0 -2
- package/dist/activity/index.js +0 -19
- package/dist/activity/index.js.map +0 -1
- package/dist/activity/temporal-activity.module.d.ts +0 -11
- package/dist/activity/temporal-activity.module.js +0 -52
- package/dist/activity/temporal-activity.module.js.map +0 -1
- package/dist/activity/temporal-activity.service.d.ts +0 -46
- package/dist/activity/temporal-activity.service.js +0 -192
- package/dist/activity/temporal-activity.service.js.map +0 -1
- package/dist/client/index.d.ts +0 -3
- package/dist/client/index.js +0 -20
- package/dist/client/index.js.map +0 -1
- package/dist/client/temporal-client.module.d.ts +0 -18
- package/dist/client/temporal-client.module.js +0 -198
- package/dist/client/temporal-client.module.js.map +0 -1
- package/dist/client/temporal-client.service.d.ts +0 -35
- package/dist/client/temporal-client.service.js +0 -187
- package/dist/client/temporal-client.service.js.map +0 -1
- package/dist/client/temporal-schedule.service.d.ts +0 -41
- package/dist/client/temporal-schedule.service.js +0 -204
- package/dist/client/temporal-schedule.service.js.map +0 -1
- package/dist/decorators/parameter.decorator.d.ts +0 -5
- package/dist/decorators/parameter.decorator.js +0 -57
- package/dist/decorators/parameter.decorator.js.map +0 -1
- package/dist/decorators/scheduling.decorator.d.ts +0 -4
- package/dist/decorators/scheduling.decorator.js +0 -44
- package/dist/decorators/scheduling.decorator.js.map +0 -1
- package/dist/discovery/index.d.ts +0 -2
- package/dist/discovery/index.js +0 -19
- package/dist/discovery/index.js.map +0 -1
- package/dist/discovery/temporal-discovery.service.d.ts +0 -39
- package/dist/discovery/temporal-discovery.service.js +0 -191
- package/dist/discovery/temporal-discovery.service.js.map +0 -1
- package/dist/discovery/temporal-schedule-manager.service.d.ts +0 -41
- package/dist/discovery/temporal-schedule-manager.service.js +0 -238
- package/dist/discovery/temporal-schedule-manager.service.js.map +0 -1
- package/dist/schedules/index.d.ts +0 -2
- package/dist/schedules/index.js +0 -19
- package/dist/schedules/index.js.map +0 -1
- package/dist/schedules/temporal-schedules.module.d.ts +0 -11
- package/dist/schedules/temporal-schedules.module.js +0 -55
- package/dist/schedules/temporal-schedules.module.js.map +0 -1
- package/dist/schedules/temporal-schedules.service.d.ts +0 -52
- package/dist/schedules/temporal-schedules.service.js +0 -221
- package/dist/schedules/temporal-schedules.service.js.map +0 -1
- package/dist/temporal.service.d.ts +0 -77
- package/dist/temporal.service.js +0 -243
- package/dist/temporal.service.js.map +0 -1
- package/dist/worker/index.d.ts +0 -3
- package/dist/worker/index.js +0 -20
- package/dist/worker/index.js.map +0 -1
- package/dist/worker/temporal-metadata.accessor.d.ts +0 -32
- package/dist/worker/temporal-metadata.accessor.js +0 -208
- package/dist/worker/temporal-metadata.accessor.js.map +0 -1
- package/dist/worker/temporal-worker-manager.service.d.ts +0 -49
- package/dist/worker/temporal-worker-manager.service.js +0 -389
- package/dist/worker/temporal-worker-manager.service.js.map +0 -1
- package/dist/worker/temporal-worker.module.d.ts +0 -18
- package/dist/worker/temporal-worker.module.js +0 -156
- package/dist/worker/temporal-worker.module.js.map +0 -1
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
1
|
export { RetryPolicy, Duration, SearchAttributes } from '@temporalio/common';
|
|
3
|
-
export {
|
|
2
|
+
export { WorkflowHandle, Client, ConnectionOptions as TemporalConnectionOptions, } from '@temporalio/client';
|
|
4
3
|
export { Worker } from '@temporalio/worker';
|
|
5
|
-
|
|
4
|
+
import { Type } from '@nestjs/common';
|
|
5
|
+
import { ScheduleClient, ScheduleHandle } from '@temporalio/client';
|
|
6
|
+
import { NativeConnection, Worker } from '@temporalio/worker';
|
|
7
|
+
import { TypedSearchAttributes } from '@temporalio/common';
|
|
8
|
+
import { TLSConfig } from '@temporalio/common/lib/internal-non-workflow';
|
|
9
|
+
export interface ClientConnectionOptions {
|
|
6
10
|
address: string;
|
|
7
|
-
tls?: boolean |
|
|
8
|
-
serverName?: string;
|
|
9
|
-
clientCertPair?: {
|
|
10
|
-
crt: Buffer;
|
|
11
|
-
key: Buffer;
|
|
12
|
-
ca?: Buffer;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
apiKey?: string;
|
|
11
|
+
tls?: boolean | TLSConfig;
|
|
16
12
|
metadata?: Record<string, string>;
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
namespace?: string;
|
|
15
|
+
}
|
|
16
|
+
export type ConnectionOptions = import('@temporalio/client').ConnectionOptions;
|
|
17
|
+
export interface RetryPolicyConfig {
|
|
18
|
+
maximumAttempts: number;
|
|
19
|
+
initialInterval: string;
|
|
20
|
+
maximumInterval: string;
|
|
21
|
+
backoffCoefficient: number;
|
|
17
22
|
}
|
|
18
23
|
export interface TemporalOptions extends LoggerConfig {
|
|
19
|
-
connection
|
|
24
|
+
connection?: {
|
|
20
25
|
address: string;
|
|
21
26
|
namespace?: string;
|
|
22
|
-
tls?:
|
|
27
|
+
tls?: boolean | TLSConfig;
|
|
23
28
|
apiKey?: string;
|
|
24
29
|
metadata?: Record<string, string>;
|
|
25
30
|
};
|
|
26
31
|
taskQueue?: string;
|
|
27
32
|
worker?: {
|
|
28
33
|
workflowsPath?: string;
|
|
29
|
-
workflowBundle?: unknown
|
|
30
|
-
activityClasses?: Array<Type<
|
|
34
|
+
workflowBundle?: Record<string, unknown>;
|
|
35
|
+
activityClasses?: Array<Type<object>>;
|
|
31
36
|
autoStart?: boolean;
|
|
32
37
|
workerOptions?: WorkerCreateOptions;
|
|
33
38
|
};
|
|
39
|
+
autoRestart?: boolean;
|
|
34
40
|
isGlobal?: boolean;
|
|
35
41
|
allowConnectionFailure?: boolean;
|
|
36
42
|
}
|
|
@@ -47,29 +53,6 @@ export interface WorkerCreateOptions {
|
|
|
47
53
|
maxConcurrentActivityTaskPolls?: number;
|
|
48
54
|
enableLoggingInReplay?: boolean;
|
|
49
55
|
}
|
|
50
|
-
export interface RetryPolicyConfig {
|
|
51
|
-
maximumAttempts: number;
|
|
52
|
-
initialInterval: string;
|
|
53
|
-
maximumInterval: string;
|
|
54
|
-
backoffCoefficient: number;
|
|
55
|
-
}
|
|
56
|
-
export interface TemporalOptionsFactory {
|
|
57
|
-
createTemporalOptions(): Promise<TemporalOptions> | TemporalOptions;
|
|
58
|
-
}
|
|
59
|
-
export interface TemporalAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
60
|
-
useExisting?: Type<TemporalOptionsFactory>;
|
|
61
|
-
useClass?: Type<TemporalOptionsFactory>;
|
|
62
|
-
useFactory?: (...args: unknown[]) => Promise<TemporalOptions> | TemporalOptions;
|
|
63
|
-
inject?: (string | symbol | Type<unknown>)[];
|
|
64
|
-
isGlobal?: boolean;
|
|
65
|
-
}
|
|
66
|
-
export interface ClientConnectionOptions {
|
|
67
|
-
address: string;
|
|
68
|
-
tls?: unknown;
|
|
69
|
-
metadata?: Record<string, string>;
|
|
70
|
-
apiKey?: string;
|
|
71
|
-
namespace?: string;
|
|
72
|
-
}
|
|
73
56
|
export interface WorkerModuleOptions {
|
|
74
57
|
connection?: {
|
|
75
58
|
address?: string;
|
|
@@ -80,8 +63,8 @@ export interface WorkerModuleOptions {
|
|
|
80
63
|
};
|
|
81
64
|
taskQueue?: string;
|
|
82
65
|
workflowsPath?: string;
|
|
83
|
-
workflowBundle?: unknown
|
|
84
|
-
activityClasses?: Array<
|
|
66
|
+
workflowBundle?: Record<string, unknown>;
|
|
67
|
+
activityClasses?: Array<Type<object>>;
|
|
85
68
|
autoStart?: boolean;
|
|
86
69
|
autoRestart?: boolean;
|
|
87
70
|
allowWorkerFailure?: boolean;
|
|
@@ -89,36 +72,33 @@ export interface WorkerModuleOptions {
|
|
|
89
72
|
enableLogger?: boolean;
|
|
90
73
|
logLevel?: LogLevel;
|
|
91
74
|
}
|
|
75
|
+
export type LogLevel = 'error' | 'warn' | 'info' | 'debug' | 'verbose';
|
|
92
76
|
export interface GlobalLoggerConfig extends LoggerConfig {
|
|
93
77
|
appName?: string;
|
|
94
78
|
formatter?: (level: string, message: string, context: string, timestamp: string) => string;
|
|
95
79
|
logToFile?: boolean;
|
|
96
80
|
logFilePath?: string;
|
|
97
81
|
}
|
|
98
|
-
export interface
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export interface QueryOptions {
|
|
102
|
-
name?: string;
|
|
82
|
+
export interface LoggerConfig {
|
|
83
|
+
enableLogger?: boolean;
|
|
84
|
+
logLevel?: LogLevel;
|
|
103
85
|
}
|
|
104
|
-
export interface
|
|
105
|
-
|
|
106
|
-
workflowId?: string;
|
|
107
|
-
signal?: {
|
|
108
|
-
name: string;
|
|
109
|
-
args?: unknown[];
|
|
110
|
-
};
|
|
111
|
-
[key: string]: unknown;
|
|
86
|
+
export interface TemporalOptionsFactory {
|
|
87
|
+
createTemporalOptions(): Promise<TemporalOptions> | TemporalOptions;
|
|
112
88
|
}
|
|
113
|
-
export interface
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
89
|
+
export interface TemporalAsyncOptions {
|
|
90
|
+
useExisting?: Type<TemporalOptionsFactory>;
|
|
91
|
+
useClass?: Type<TemporalOptionsFactory>;
|
|
92
|
+
useFactory?: (...args: unknown[]) => Promise<TemporalOptions> | TemporalOptions;
|
|
93
|
+
inject?: Array<string | symbol | Type<unknown>>;
|
|
94
|
+
imports?: Array<Type<unknown>>;
|
|
95
|
+
isGlobal?: boolean;
|
|
119
96
|
}
|
|
120
|
-
export interface
|
|
121
|
-
name
|
|
97
|
+
export interface ActivityMethodMetadata {
|
|
98
|
+
name: string;
|
|
99
|
+
originalName: string;
|
|
100
|
+
options?: Record<string, string | number | boolean | object>;
|
|
101
|
+
handler: ActivityMethodHandler;
|
|
122
102
|
}
|
|
123
103
|
export interface ActivityMethodOptions {
|
|
124
104
|
name?: string;
|
|
@@ -127,72 +107,27 @@ export interface ActivityMethodOptions {
|
|
|
127
107
|
}
|
|
128
108
|
export interface ActivityMetadata {
|
|
129
109
|
name?: string;
|
|
130
|
-
options?: Record<string,
|
|
131
|
-
}
|
|
132
|
-
export interface ScheduledOptions {
|
|
133
|
-
scheduleId: string;
|
|
134
|
-
cron?: string;
|
|
135
|
-
interval?: string;
|
|
136
|
-
description?: string;
|
|
137
|
-
taskQueue?: string;
|
|
138
|
-
timezone?: string;
|
|
139
|
-
overlapPolicy?: 'ALLOW_ALL' | 'SKIP' | 'BUFFER_ONE' | 'BUFFER_ALL' | 'CANCEL_OTHER';
|
|
140
|
-
startPaused?: boolean;
|
|
141
|
-
autoStart?: boolean;
|
|
110
|
+
options?: Record<string, string | number | boolean | object>;
|
|
142
111
|
}
|
|
143
|
-
export interface
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
export interface IntervalOptions extends Omit<ScheduledOptions, 'cron' | 'interval'> {
|
|
147
|
-
scheduleId: string;
|
|
112
|
+
export interface ActivityOptions {
|
|
113
|
+
name?: string;
|
|
148
114
|
}
|
|
149
|
-
export
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
handler: SignalMethodHandler;
|
|
115
|
+
export interface DiscoveryStats {
|
|
116
|
+
controllers: number;
|
|
117
|
+
methods: number;
|
|
118
|
+
signals: number;
|
|
119
|
+
queries: number;
|
|
120
|
+
workflows: number;
|
|
121
|
+
childWorkflows: number;
|
|
157
122
|
}
|
|
158
123
|
export interface QueryMethodInfo {
|
|
159
124
|
methodName: string;
|
|
160
125
|
queryName: string;
|
|
161
126
|
options: QueryOptions;
|
|
162
|
-
handler: QueryMethodHandler;
|
|
163
|
-
}
|
|
164
|
-
export interface ScheduledMethodInfo {
|
|
165
|
-
methodName: string;
|
|
166
|
-
workflowName: string;
|
|
167
|
-
scheduleOptions: ScheduledOptions;
|
|
168
|
-
workflowOptions: StartWorkflowOptions;
|
|
169
127
|
handler: (...args: unknown[]) => unknown | Promise<unknown>;
|
|
170
|
-
controllerInfo: {
|
|
171
|
-
name: string;
|
|
172
|
-
instance: object;
|
|
173
|
-
};
|
|
174
128
|
}
|
|
175
|
-
export interface
|
|
176
|
-
name
|
|
177
|
-
originalName: string;
|
|
178
|
-
options?: Record<string, unknown>;
|
|
179
|
-
handler: ActivityMethodHandler;
|
|
180
|
-
}
|
|
181
|
-
export interface DiscoveryStats {
|
|
182
|
-
controllers: number;
|
|
183
|
-
methods: number;
|
|
184
|
-
scheduled: number;
|
|
185
|
-
signals: number;
|
|
186
|
-
queries: number;
|
|
187
|
-
}
|
|
188
|
-
export interface ScheduleStatus {
|
|
189
|
-
scheduleId: string;
|
|
190
|
-
workflowName: string;
|
|
191
|
-
isManaged: boolean;
|
|
192
|
-
isActive: boolean;
|
|
193
|
-
lastError?: string;
|
|
194
|
-
createdAt: Date;
|
|
195
|
-
lastUpdatedAt: Date;
|
|
129
|
+
export interface QueryOptions {
|
|
130
|
+
name?: string;
|
|
196
131
|
}
|
|
197
132
|
export interface ScheduleStats {
|
|
198
133
|
total: number;
|
|
@@ -200,17 +135,23 @@ export interface ScheduleStats {
|
|
|
200
135
|
inactive: number;
|
|
201
136
|
errors: number;
|
|
202
137
|
}
|
|
203
|
-
export interface
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
138
|
+
export interface SignalMethodInfo {
|
|
139
|
+
methodName: string;
|
|
140
|
+
signalName: string;
|
|
141
|
+
options?: Record<string, string | number | boolean | object>;
|
|
142
|
+
handler: (...args: unknown[]) => unknown | Promise<unknown>;
|
|
143
|
+
}
|
|
144
|
+
export interface SignalOptions {
|
|
145
|
+
name?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface StartWorkflowOptions {
|
|
207
148
|
taskQueue: string;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
149
|
+
workflowId?: string;
|
|
150
|
+
signal?: {
|
|
151
|
+
name: string;
|
|
152
|
+
args?: unknown[];
|
|
153
|
+
};
|
|
154
|
+
[key: string]: unknown;
|
|
214
155
|
}
|
|
215
156
|
export interface SystemStatus {
|
|
216
157
|
client: {
|
|
@@ -223,18 +164,36 @@ export interface SystemStatus {
|
|
|
223
164
|
health?: string;
|
|
224
165
|
};
|
|
225
166
|
discovery: DiscoveryStats;
|
|
226
|
-
schedules: ScheduleStats;
|
|
227
167
|
}
|
|
228
|
-
export interface
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
168
|
+
export interface WorkerStatus {
|
|
169
|
+
isInitialized: boolean;
|
|
170
|
+
isRunning: boolean;
|
|
171
|
+
isHealthy: boolean;
|
|
172
|
+
taskQueue: string;
|
|
173
|
+
namespace: string;
|
|
174
|
+
workflowSource: 'bundle' | 'filesystem' | 'registered' | 'none';
|
|
175
|
+
activitiesCount: number;
|
|
176
|
+
workflowsCount?: number;
|
|
177
|
+
lastError?: string;
|
|
178
|
+
startedAt?: Date;
|
|
179
|
+
uptime?: number;
|
|
232
180
|
}
|
|
233
|
-
export
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
logLevel?: LogLevel;
|
|
181
|
+
export interface SignalMethodMetadata {
|
|
182
|
+
signalName: string;
|
|
183
|
+
methodName: string;
|
|
237
184
|
}
|
|
185
|
+
export interface QueryMethodMetadata {
|
|
186
|
+
queryName: string;
|
|
187
|
+
methodName: string;
|
|
188
|
+
}
|
|
189
|
+
export interface ChildWorkflowMetadata {
|
|
190
|
+
workflowType: string | Type<unknown>;
|
|
191
|
+
options?: Record<string, string | number | boolean | object>;
|
|
192
|
+
propertyKey: string | symbol;
|
|
193
|
+
}
|
|
194
|
+
export type ActivityMethodHandler = (...args: unknown[]) => Promise<unknown> | unknown;
|
|
195
|
+
export type QueryMethodHandler = (...args: unknown[]) => unknown;
|
|
196
|
+
export type SignalMethodHandler = (...args: unknown[]) => void | Promise<void>;
|
|
238
197
|
export interface ActivityModuleOptions extends LoggerConfig {
|
|
239
198
|
activityClasses?: Array<Type<unknown>>;
|
|
240
199
|
timeout?: string | number;
|
|
@@ -242,7 +201,7 @@ export interface ActivityModuleOptions extends LoggerConfig {
|
|
|
242
201
|
}
|
|
243
202
|
export interface ActivityInfo {
|
|
244
203
|
className: string;
|
|
245
|
-
instance:
|
|
204
|
+
instance: Record<string, unknown>;
|
|
246
205
|
targetClass: Type<unknown>;
|
|
247
206
|
methods: Array<{
|
|
248
207
|
name: string;
|
|
@@ -251,31 +210,652 @@ export interface ActivityInfo {
|
|
|
251
210
|
}>;
|
|
252
211
|
totalMethods: number;
|
|
253
212
|
}
|
|
254
|
-
export interface
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
213
|
+
export interface ExtendedSignalMethodInfo {
|
|
214
|
+
className: string;
|
|
215
|
+
signalName: string;
|
|
216
|
+
methodName: string;
|
|
217
|
+
handler: (...args: unknown[]) => unknown | Promise<unknown>;
|
|
218
|
+
instance: Record<string, unknown>;
|
|
219
|
+
}
|
|
220
|
+
export interface ExtendedQueryMethodInfo {
|
|
221
|
+
className: string;
|
|
222
|
+
queryName: string;
|
|
223
|
+
methodName: string;
|
|
224
|
+
handler: (...args: unknown[]) => unknown | Promise<unknown>;
|
|
225
|
+
instance: Record<string, unknown>;
|
|
226
|
+
options?: Record<string, string | number | boolean | object>;
|
|
227
|
+
}
|
|
228
|
+
export interface ChildWorkflowInfo {
|
|
229
|
+
className: string;
|
|
230
|
+
propertyKey: string | symbol;
|
|
231
|
+
workflowType: Type<unknown>;
|
|
232
|
+
options?: Record<string, string | number | boolean | object>;
|
|
233
|
+
instance: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
export type ActivityFunction = (...args: unknown[]) => unknown | Promise<unknown>;
|
|
236
|
+
export interface ActivityMethodInfo {
|
|
237
|
+
methodName: string;
|
|
238
|
+
name: string;
|
|
239
|
+
metadata: ActivityMethodOptions;
|
|
240
|
+
}
|
|
241
|
+
export interface ActivityContext {
|
|
242
|
+
activityType: string;
|
|
243
|
+
className?: string;
|
|
244
|
+
methodName?: string;
|
|
245
|
+
executionId?: string;
|
|
246
|
+
timestamp?: Date;
|
|
247
|
+
}
|
|
248
|
+
export interface ScheduleSpec {
|
|
249
|
+
intervals?: Array<{
|
|
250
|
+
every: string | number;
|
|
251
|
+
}>;
|
|
252
|
+
cronExpressions?: string[];
|
|
253
|
+
timezones?: string[];
|
|
254
|
+
startAt?: Date;
|
|
255
|
+
endAt?: Date;
|
|
256
|
+
jitter?: string | number;
|
|
257
|
+
}
|
|
258
|
+
export interface ScheduleAction {
|
|
259
|
+
type: 'startWorkflow';
|
|
260
|
+
workflowType: string;
|
|
261
|
+
args?: unknown[];
|
|
262
|
+
taskQueue: string;
|
|
263
|
+
workflowId?: string;
|
|
258
264
|
}
|
|
259
|
-
export interface
|
|
265
|
+
export interface ScheduleCreateOptions {
|
|
260
266
|
scheduleId: string;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
spec: ScheduleSpec;
|
|
268
|
+
action: ScheduleAction;
|
|
269
|
+
memo?: Record<string, string | number | boolean | object>;
|
|
270
|
+
searchAttributes?: Record<string, string | number | boolean | object>;
|
|
271
|
+
workflowType?: string;
|
|
272
|
+
args?: unknown[];
|
|
273
|
+
taskQueue?: string;
|
|
274
|
+
interval?: string | number;
|
|
275
|
+
cron?: string;
|
|
276
|
+
timezone?: string;
|
|
277
|
+
overlapPolicy?: 'skip' | 'buffer_one' | 'buffer_all' | 'cancel_other' | 'terminate_other' | 'allow_all';
|
|
278
|
+
catchupWindow?: string | number;
|
|
279
|
+
pauseOnFailure?: boolean;
|
|
264
280
|
description?: string;
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
281
|
+
paused?: boolean;
|
|
282
|
+
limitedActions?: number;
|
|
283
|
+
}
|
|
284
|
+
export interface WorkflowStartOptions {
|
|
285
|
+
workflowId?: string;
|
|
269
286
|
taskQueue?: string;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
287
|
+
searchAttributes?: TypedSearchAttributes;
|
|
288
|
+
memo?: Record<string, string | number | boolean | object>;
|
|
289
|
+
workflowIdReusePolicy?: 'ALLOW_DUPLICATE' | 'ALLOW_DUPLICATE_FAILED_ONLY' | 'REJECT_DUPLICATE';
|
|
290
|
+
workflowExecutionTimeout?: string;
|
|
291
|
+
workflowRunTimeout?: string;
|
|
292
|
+
workflowTaskTimeout?: string;
|
|
293
|
+
}
|
|
294
|
+
export type HealthStatus = 'healthy' | 'unhealthy' | 'degraded';
|
|
295
|
+
export interface ServiceHealth {
|
|
296
|
+
status: HealthStatus;
|
|
297
|
+
details?: Record<string, string | number | boolean | object>;
|
|
298
|
+
timestamp?: Date;
|
|
299
|
+
}
|
|
300
|
+
export interface ServiceStats {
|
|
301
|
+
activities: {
|
|
302
|
+
classes: number;
|
|
303
|
+
methods: number;
|
|
304
|
+
total: number;
|
|
305
|
+
};
|
|
306
|
+
schedules: number;
|
|
307
|
+
discoveries: DiscoveryStats;
|
|
308
|
+
worker: WorkerStatus;
|
|
309
|
+
client: ServiceHealth;
|
|
310
|
+
}
|
|
311
|
+
export type OverlapPolicy = 'skip' | 'buffer_one' | 'buffer_all' | 'cancel_other' | 'terminate_other' | 'allow_all';
|
|
312
|
+
export type TemporalOverlapPolicy = 'SKIP' | 'BUFFER_ONE' | 'BUFFER_ALL' | 'CANCEL_OTHER' | 'TERMINATE_OTHER' | 'ALLOW_ALL';
|
|
313
|
+
export interface MetadataInfo {
|
|
314
|
+
[key: string]: string | number | boolean | object | null;
|
|
315
|
+
}
|
|
316
|
+
export type ActivityWrapper = (...args: unknown[]) => Promise<unknown>;
|
|
317
|
+
export interface ProviderInstance {
|
|
318
|
+
[key: string]: string | number | boolean | object | null | undefined;
|
|
319
|
+
}
|
|
320
|
+
export interface NestJSWrapper {
|
|
321
|
+
instance?: Record<string, unknown>;
|
|
322
|
+
metatype?: new (...args: unknown[]) => Record<string, unknown>;
|
|
323
|
+
}
|
|
324
|
+
export interface InstanceWithConstructor {
|
|
325
|
+
constructor: new (...args: unknown[]) => Record<string, unknown>;
|
|
326
|
+
}
|
|
327
|
+
export interface DiscoveredActivity {
|
|
328
|
+
name: string;
|
|
329
|
+
className: string;
|
|
330
|
+
method: ActivityMethodInfo | ActivityMethodHandler;
|
|
331
|
+
instance: Record<string, unknown>;
|
|
332
|
+
handler: ActivityMethodHandler;
|
|
333
|
+
}
|
|
334
|
+
export interface WorkflowSignalConfig {
|
|
335
|
+
name: string;
|
|
336
|
+
args?: unknown[];
|
|
337
|
+
}
|
|
338
|
+
export type WorkflowHandleWithMetadata = import('@temporalio/client').WorkflowHandle & {
|
|
339
|
+
handle: import('@temporalio/client').WorkflowHandle;
|
|
340
|
+
};
|
|
341
|
+
export interface ClientServiceStatus {
|
|
342
|
+
available: boolean;
|
|
343
|
+
healthy: boolean;
|
|
344
|
+
initialized: boolean;
|
|
345
|
+
lastHealthCheck: Date | null;
|
|
346
|
+
namespace: string;
|
|
347
|
+
}
|
|
348
|
+
export interface ClientHealthStatus {
|
|
349
|
+
status: 'healthy' | 'unhealthy' | 'degraded';
|
|
350
|
+
}
|
|
351
|
+
export interface GenericClient {
|
|
352
|
+
workflow: {
|
|
353
|
+
start: (type: string, options: Record<string, string | number | boolean | object>) => Promise<import('@temporalio/client').WorkflowHandle>;
|
|
354
|
+
getHandle: (id: string, runId?: string) => import('@temporalio/client').WorkflowHandle;
|
|
274
355
|
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
356
|
+
}
|
|
357
|
+
export interface ScheduleDescription {
|
|
358
|
+
spec: ScheduleSpec;
|
|
359
|
+
action: ScheduleAction;
|
|
360
|
+
policies: {
|
|
361
|
+
overlap: TemporalOverlapPolicy;
|
|
362
|
+
catchupWindow: number;
|
|
363
|
+
pauseOnFailure: boolean;
|
|
364
|
+
};
|
|
365
|
+
state: {
|
|
366
|
+
paused: boolean;
|
|
367
|
+
note?: string;
|
|
368
|
+
remainingActions?: number;
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
export interface DiscoveryServiceStats {
|
|
372
|
+
methods: number;
|
|
373
|
+
activities: number;
|
|
374
|
+
totalComponents: number;
|
|
375
|
+
}
|
|
376
|
+
export interface DiscoveryHealthStatus {
|
|
377
|
+
isComplete: boolean;
|
|
378
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
379
|
+
discoveredItems?: {
|
|
380
|
+
activities: number;
|
|
381
|
+
};
|
|
382
|
+
lastDiscovery?: Date | null;
|
|
383
|
+
discoveryDuration?: number | null;
|
|
384
|
+
totalComponents?: number;
|
|
385
|
+
}
|
|
386
|
+
export interface DiscoveryServiceConfig {
|
|
387
|
+
enableLogging: boolean;
|
|
388
|
+
logLevel: LogLevel;
|
|
389
|
+
activityClasses: Array<Type<unknown>>;
|
|
390
|
+
}
|
|
391
|
+
export interface ComponentDiscoveryResult {
|
|
392
|
+
success: boolean;
|
|
393
|
+
discoveredCount: number;
|
|
394
|
+
errors: Array<{
|
|
395
|
+
component: string;
|
|
396
|
+
error: string;
|
|
397
|
+
}>;
|
|
398
|
+
duration: number;
|
|
399
|
+
}
|
|
400
|
+
export interface ActivityMethodValidationResult {
|
|
401
|
+
isValid: boolean;
|
|
402
|
+
issues: string[];
|
|
403
|
+
warnings?: string[];
|
|
404
|
+
}
|
|
405
|
+
export interface DiscoveryServiceOptions {
|
|
406
|
+
enableLogger?: boolean;
|
|
407
|
+
logLevel?: LogLevel;
|
|
408
|
+
activityClasses?: Array<Type<unknown>>;
|
|
409
|
+
validateOnDiscovery?: boolean;
|
|
410
|
+
cacheResults?: boolean;
|
|
411
|
+
}
|
|
412
|
+
export interface WrapperProcessingResult {
|
|
413
|
+
success: boolean;
|
|
414
|
+
processedCount: number;
|
|
415
|
+
errors: Array<{
|
|
416
|
+
component: string;
|
|
417
|
+
error: string;
|
|
418
|
+
}>;
|
|
419
|
+
}
|
|
420
|
+
export interface ActivityDiscoveryContext {
|
|
421
|
+
className: string;
|
|
422
|
+
instance: Record<string, unknown>;
|
|
423
|
+
metatype: Type<unknown>;
|
|
424
|
+
validationResult?: ActivityMethodValidationResult;
|
|
425
|
+
}
|
|
426
|
+
export interface ActivityMethodMetadataResult {
|
|
427
|
+
name: string;
|
|
428
|
+
originalName: string;
|
|
429
|
+
methodName: string;
|
|
430
|
+
className: string;
|
|
431
|
+
options?: Record<string, unknown>;
|
|
432
|
+
handler?: Function;
|
|
433
|
+
}
|
|
434
|
+
export interface ActivityMetadataExtractionResult {
|
|
435
|
+
success: boolean;
|
|
436
|
+
methods: Map<string, ActivityMethodMetadataResult>;
|
|
437
|
+
errors: Array<{
|
|
438
|
+
method: string;
|
|
439
|
+
error: string;
|
|
440
|
+
}>;
|
|
441
|
+
extractedCount: number;
|
|
442
|
+
}
|
|
443
|
+
export interface ActivityClassValidationResult {
|
|
444
|
+
isValid: boolean;
|
|
445
|
+
issues: string[];
|
|
446
|
+
warnings?: string[];
|
|
447
|
+
className?: string;
|
|
448
|
+
methodCount?: number;
|
|
449
|
+
}
|
|
450
|
+
export interface MetadataValidationResult {
|
|
451
|
+
isValid: boolean;
|
|
452
|
+
missing: string[];
|
|
453
|
+
present: string[];
|
|
454
|
+
target: string;
|
|
455
|
+
}
|
|
456
|
+
export interface ActivityInfoResult {
|
|
457
|
+
className: string;
|
|
458
|
+
isActivity: boolean;
|
|
459
|
+
activityName: string | null;
|
|
460
|
+
methodNames: string[];
|
|
461
|
+
metadata: unknown;
|
|
462
|
+
activityOptions: unknown;
|
|
463
|
+
methodCount: number;
|
|
464
|
+
}
|
|
465
|
+
export interface CacheStatsResult {
|
|
466
|
+
size: number;
|
|
467
|
+
entries: string[];
|
|
468
|
+
message?: string;
|
|
469
|
+
note?: string;
|
|
470
|
+
hitRate?: number;
|
|
471
|
+
missRate?: number;
|
|
472
|
+
}
|
|
473
|
+
export interface SignalMethodExtractionResult {
|
|
474
|
+
success: boolean;
|
|
475
|
+
methods: Record<string, string>;
|
|
476
|
+
errors: Array<{
|
|
477
|
+
method: string;
|
|
478
|
+
error: string;
|
|
479
|
+
}>;
|
|
480
|
+
}
|
|
481
|
+
export interface QueryMethodExtractionResult {
|
|
482
|
+
success: boolean;
|
|
483
|
+
methods: Record<string, string>;
|
|
484
|
+
errors: Array<{
|
|
485
|
+
method: string;
|
|
486
|
+
error: string;
|
|
487
|
+
}>;
|
|
488
|
+
}
|
|
489
|
+
export interface ChildWorkflowExtractionResult {
|
|
490
|
+
success: boolean;
|
|
491
|
+
workflows: Record<string, unknown>;
|
|
492
|
+
errors: Array<{
|
|
493
|
+
workflow: string;
|
|
494
|
+
error: string;
|
|
495
|
+
}>;
|
|
496
|
+
}
|
|
497
|
+
export interface MetadataExtractionOptions {
|
|
498
|
+
includeOptions?: boolean;
|
|
499
|
+
validateMethods?: boolean;
|
|
500
|
+
cacheResults?: boolean;
|
|
501
|
+
strictMode?: boolean;
|
|
502
|
+
}
|
|
503
|
+
export interface ActivityMethodExtractionContext {
|
|
504
|
+
instance: unknown;
|
|
505
|
+
className: string;
|
|
506
|
+
methodName: string;
|
|
507
|
+
prototype: object;
|
|
508
|
+
metadata: unknown;
|
|
509
|
+
}
|
|
510
|
+
export interface ScheduleCreationOptions {
|
|
511
|
+
scheduleId: string;
|
|
512
|
+
spec: ScheduleSpec;
|
|
513
|
+
action: ScheduleAction;
|
|
514
|
+
memo?: Record<string, unknown>;
|
|
515
|
+
searchAttributes?: Record<string, unknown>;
|
|
516
|
+
}
|
|
517
|
+
export interface ScheduleCreationResult {
|
|
518
|
+
success: boolean;
|
|
519
|
+
scheduleId?: string;
|
|
520
|
+
handle?: ScheduleHandle;
|
|
521
|
+
error?: Error;
|
|
522
|
+
}
|
|
523
|
+
export interface ScheduleRetrievalResult {
|
|
524
|
+
success: boolean;
|
|
525
|
+
handle?: ScheduleHandle;
|
|
526
|
+
error?: Error;
|
|
527
|
+
}
|
|
528
|
+
export interface ScheduleServiceStatus {
|
|
529
|
+
available: boolean;
|
|
530
|
+
healthy: boolean;
|
|
531
|
+
schedulesSupported: boolean;
|
|
532
|
+
initialized: boolean;
|
|
533
|
+
}
|
|
534
|
+
export interface ScheduleServiceHealth {
|
|
535
|
+
status: 'healthy' | 'unhealthy' | 'degraded';
|
|
536
|
+
schedulesCount: number;
|
|
537
|
+
isInitialized: boolean;
|
|
538
|
+
details: Record<string, unknown>;
|
|
280
539
|
lastError?: string;
|
|
281
540
|
}
|
|
541
|
+
export interface ScheduleServiceStats {
|
|
542
|
+
total: number;
|
|
543
|
+
active: number;
|
|
544
|
+
inactive: number;
|
|
545
|
+
errors: number;
|
|
546
|
+
lastUpdated?: Date;
|
|
547
|
+
}
|
|
548
|
+
export interface ScheduleDiscoveryResult {
|
|
549
|
+
success: boolean;
|
|
550
|
+
discoveredCount: number;
|
|
551
|
+
errors: Array<{
|
|
552
|
+
schedule: string;
|
|
553
|
+
error: string;
|
|
554
|
+
}>;
|
|
555
|
+
duration: number;
|
|
556
|
+
}
|
|
557
|
+
export interface ScheduleRegistrationResult {
|
|
558
|
+
success: boolean;
|
|
559
|
+
scheduleId: string;
|
|
560
|
+
handle?: ScheduleHandle;
|
|
561
|
+
error?: Error;
|
|
562
|
+
}
|
|
563
|
+
export interface ScheduleMetadataValidationResult {
|
|
564
|
+
isValid: boolean;
|
|
565
|
+
issues: string[];
|
|
566
|
+
warnings?: string[];
|
|
567
|
+
scheduleId?: string;
|
|
568
|
+
}
|
|
569
|
+
export interface ScheduleClientInitResult {
|
|
570
|
+
success: boolean;
|
|
571
|
+
client?: ScheduleClient;
|
|
572
|
+
error?: Error;
|
|
573
|
+
source: 'existing' | 'new' | 'none';
|
|
574
|
+
}
|
|
575
|
+
export interface ScheduleWorkflowOptions {
|
|
576
|
+
taskQueue?: string;
|
|
577
|
+
workflowId?: string;
|
|
578
|
+
workflowExecutionTimeout?: string;
|
|
579
|
+
workflowRunTimeout?: string;
|
|
580
|
+
workflowTaskTimeout?: string;
|
|
581
|
+
retryPolicy?: Record<string, unknown>;
|
|
582
|
+
args?: unknown[];
|
|
583
|
+
}
|
|
584
|
+
export interface ScheduleSpecBuilderResult {
|
|
585
|
+
success: boolean;
|
|
586
|
+
spec?: Record<string, unknown>;
|
|
587
|
+
error?: Error;
|
|
588
|
+
}
|
|
589
|
+
export interface ScheduleIntervalParseResult {
|
|
590
|
+
success: boolean;
|
|
591
|
+
interval?: Record<string, unknown>;
|
|
592
|
+
error?: Error;
|
|
593
|
+
}
|
|
594
|
+
export interface TemporalConnection {
|
|
595
|
+
address: string;
|
|
596
|
+
namespace?: string;
|
|
597
|
+
tls?: boolean | object;
|
|
598
|
+
metadata?: Record<string, string>;
|
|
599
|
+
}
|
|
600
|
+
export interface ScheduleWorkflowAction {
|
|
601
|
+
type: 'startWorkflow';
|
|
602
|
+
workflowType: string;
|
|
603
|
+
taskQueue: string;
|
|
604
|
+
args?: unknown[];
|
|
605
|
+
workflowId?: string;
|
|
606
|
+
workflowExecutionTimeout?: string;
|
|
607
|
+
workflowRunTimeout?: string;
|
|
608
|
+
workflowTaskTimeout?: string;
|
|
609
|
+
retryPolicy?: Record<string, unknown>;
|
|
610
|
+
}
|
|
611
|
+
export interface ScheduleOptions {
|
|
612
|
+
scheduleId: string;
|
|
613
|
+
spec: Record<string, unknown>;
|
|
614
|
+
action: ScheduleWorkflowAction;
|
|
615
|
+
memo?: Record<string, unknown>;
|
|
616
|
+
searchAttributes?: Record<string, unknown>;
|
|
617
|
+
}
|
|
618
|
+
export interface WorkerConnectionOptions {
|
|
619
|
+
address: string;
|
|
620
|
+
tls?: boolean | object;
|
|
621
|
+
metadata?: Record<string, string>;
|
|
622
|
+
apiKey?: string;
|
|
623
|
+
namespace?: string;
|
|
624
|
+
}
|
|
625
|
+
export interface WorkerConfig {
|
|
626
|
+
taskQueue: string;
|
|
627
|
+
namespace: string;
|
|
628
|
+
connection: NativeConnection;
|
|
629
|
+
activities: Record<string, Function>;
|
|
630
|
+
workflowsPath?: string;
|
|
631
|
+
workflowBundle?: unknown;
|
|
632
|
+
workerOptions?: Record<string, unknown>;
|
|
633
|
+
[key: string]: unknown;
|
|
634
|
+
}
|
|
635
|
+
export interface WorkerInitResult {
|
|
636
|
+
success: boolean;
|
|
637
|
+
worker?: Worker;
|
|
638
|
+
error?: Error;
|
|
639
|
+
activitiesCount: number;
|
|
640
|
+
taskQueue: string;
|
|
641
|
+
namespace: string;
|
|
642
|
+
}
|
|
643
|
+
export interface WorkerRestartResult {
|
|
644
|
+
success: boolean;
|
|
645
|
+
error?: Error;
|
|
646
|
+
restartCount: number;
|
|
647
|
+
maxRestarts: number;
|
|
648
|
+
}
|
|
649
|
+
export interface WorkerShutdownResult {
|
|
650
|
+
success: boolean;
|
|
651
|
+
error?: Error;
|
|
652
|
+
shutdownTime: number;
|
|
653
|
+
}
|
|
654
|
+
export interface WorkerHealthStatus {
|
|
655
|
+
isHealthy: boolean;
|
|
656
|
+
isRunning: boolean;
|
|
657
|
+
isInitialized: boolean;
|
|
658
|
+
lastError?: string;
|
|
659
|
+
uptime?: number;
|
|
660
|
+
activitiesCount: number;
|
|
661
|
+
restartCount: number;
|
|
662
|
+
maxRestarts: number;
|
|
663
|
+
}
|
|
664
|
+
export interface WorkerStats {
|
|
665
|
+
isInitialized: boolean;
|
|
666
|
+
isRunning: boolean;
|
|
667
|
+
activitiesCount: number;
|
|
668
|
+
restartCount: number;
|
|
669
|
+
maxRestarts: number;
|
|
670
|
+
uptime?: number;
|
|
671
|
+
startedAt?: Date;
|
|
672
|
+
lastError?: string;
|
|
673
|
+
taskQueue: string;
|
|
674
|
+
namespace: string;
|
|
675
|
+
workflowSource: 'bundle' | 'filesystem' | 'registered' | 'none';
|
|
676
|
+
}
|
|
677
|
+
export interface ActivityRegistrationResult {
|
|
678
|
+
success: boolean;
|
|
679
|
+
registeredCount: number;
|
|
680
|
+
errors: Array<{
|
|
681
|
+
activityName: string;
|
|
682
|
+
error: string;
|
|
683
|
+
}>;
|
|
684
|
+
}
|
|
685
|
+
export interface WorkerDiscoveryResult {
|
|
686
|
+
success: boolean;
|
|
687
|
+
discoveredActivities: number;
|
|
688
|
+
loadedActivities: number;
|
|
689
|
+
errors: Array<{
|
|
690
|
+
component: string;
|
|
691
|
+
error: string;
|
|
692
|
+
}>;
|
|
693
|
+
duration: number;
|
|
694
|
+
}
|
|
695
|
+
export interface TemporalServiceInitResult {
|
|
696
|
+
success: boolean;
|
|
697
|
+
error?: Error;
|
|
698
|
+
servicesInitialized: {
|
|
699
|
+
client: boolean;
|
|
700
|
+
worker: boolean;
|
|
701
|
+
schedule: boolean;
|
|
702
|
+
discovery: boolean;
|
|
703
|
+
metadata: boolean;
|
|
704
|
+
};
|
|
705
|
+
initializationTime: number;
|
|
706
|
+
}
|
|
707
|
+
export interface WorkflowExecutionResult<T = unknown> {
|
|
708
|
+
success: boolean;
|
|
709
|
+
result?: T;
|
|
710
|
+
error?: Error;
|
|
711
|
+
workflowId?: string;
|
|
712
|
+
runId?: string;
|
|
713
|
+
executionTime?: number;
|
|
714
|
+
}
|
|
715
|
+
export interface WorkflowSignalResult {
|
|
716
|
+
success: boolean;
|
|
717
|
+
error?: Error;
|
|
718
|
+
workflowId: string;
|
|
719
|
+
signalName: string;
|
|
720
|
+
}
|
|
721
|
+
export interface WorkflowQueryResult<T = unknown> {
|
|
722
|
+
success: boolean;
|
|
723
|
+
result?: T;
|
|
724
|
+
error?: Error;
|
|
725
|
+
workflowId: string;
|
|
726
|
+
queryName: string;
|
|
727
|
+
}
|
|
728
|
+
export interface WorkflowTerminationResult {
|
|
729
|
+
success: boolean;
|
|
730
|
+
error?: Error;
|
|
731
|
+
workflowId: string;
|
|
732
|
+
reason?: string;
|
|
733
|
+
}
|
|
734
|
+
export interface WorkflowCancellationResult {
|
|
735
|
+
success: boolean;
|
|
736
|
+
error?: Error;
|
|
737
|
+
workflowId: string;
|
|
738
|
+
}
|
|
739
|
+
export interface ActivityExecutionResult<T = unknown> {
|
|
740
|
+
success: boolean;
|
|
741
|
+
result?: T;
|
|
742
|
+
error?: Error;
|
|
743
|
+
activityName: string;
|
|
744
|
+
executionTime?: number;
|
|
745
|
+
args?: unknown[];
|
|
746
|
+
}
|
|
747
|
+
export interface ServiceHealthStatus {
|
|
748
|
+
status: 'healthy' | 'unhealthy' | 'degraded';
|
|
749
|
+
isInitialized: boolean;
|
|
750
|
+
lastError?: string;
|
|
751
|
+
uptime?: number;
|
|
752
|
+
details?: Record<string, unknown>;
|
|
753
|
+
}
|
|
754
|
+
export interface ComponentHealthStatus {
|
|
755
|
+
client: ServiceHealthStatus;
|
|
756
|
+
worker: ServiceHealthStatus;
|
|
757
|
+
schedule: ServiceHealthStatus;
|
|
758
|
+
activity: ServiceHealthStatus;
|
|
759
|
+
discovery: ServiceHealthStatus;
|
|
760
|
+
}
|
|
761
|
+
export interface OverallHealthStatus {
|
|
762
|
+
status: 'healthy' | 'unhealthy' | 'degraded';
|
|
763
|
+
components: ComponentHealthStatus;
|
|
764
|
+
isInitialized: boolean;
|
|
765
|
+
namespace: string;
|
|
766
|
+
summary: {
|
|
767
|
+
totalActivities: number;
|
|
768
|
+
totalSchedules: number;
|
|
769
|
+
workerRunning: boolean;
|
|
770
|
+
clientConnected: boolean;
|
|
771
|
+
};
|
|
772
|
+
timestamp: Date;
|
|
773
|
+
}
|
|
774
|
+
export interface ServiceStatistics {
|
|
775
|
+
activities: {
|
|
776
|
+
classes: number;
|
|
777
|
+
methods: number;
|
|
778
|
+
total: number;
|
|
779
|
+
registered: number;
|
|
780
|
+
available: number;
|
|
781
|
+
};
|
|
782
|
+
schedules: {
|
|
783
|
+
total: number;
|
|
784
|
+
active: number;
|
|
785
|
+
paused: number;
|
|
786
|
+
};
|
|
787
|
+
worker: {
|
|
788
|
+
isRunning: boolean;
|
|
789
|
+
isHealthy: boolean;
|
|
790
|
+
activitiesCount: number;
|
|
791
|
+
uptime?: number;
|
|
792
|
+
};
|
|
793
|
+
client: {
|
|
794
|
+
isConnected: boolean;
|
|
795
|
+
isHealthy: boolean;
|
|
796
|
+
namespace: string;
|
|
797
|
+
};
|
|
798
|
+
discovery: {
|
|
799
|
+
isComplete: boolean;
|
|
800
|
+
discoveredCount: number;
|
|
801
|
+
errors: number;
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
export interface ServiceInitOptions {
|
|
805
|
+
waitForServices?: boolean;
|
|
806
|
+
maxWaitTime?: number;
|
|
807
|
+
retryAttempts?: number;
|
|
808
|
+
retryDelay?: number;
|
|
809
|
+
}
|
|
810
|
+
export interface ServiceShutdownOptions {
|
|
811
|
+
graceful?: boolean;
|
|
812
|
+
timeout?: number;
|
|
813
|
+
stopWorker?: boolean;
|
|
814
|
+
}
|
|
815
|
+
export interface ServiceShutdownResult {
|
|
816
|
+
success: boolean;
|
|
817
|
+
error?: Error;
|
|
818
|
+
shutdownTime: number;
|
|
819
|
+
servicesShutdown: {
|
|
820
|
+
worker: boolean;
|
|
821
|
+
client: boolean;
|
|
822
|
+
schedule: boolean;
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
export interface HealthResponse {
|
|
826
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
827
|
+
timestamp: string;
|
|
828
|
+
uptime: number;
|
|
829
|
+
client: {
|
|
830
|
+
available: boolean;
|
|
831
|
+
healthy: boolean;
|
|
832
|
+
connected: boolean;
|
|
833
|
+
};
|
|
834
|
+
worker: {
|
|
835
|
+
available: boolean;
|
|
836
|
+
running: boolean;
|
|
837
|
+
healthy: boolean;
|
|
838
|
+
activitiesCount: number;
|
|
839
|
+
};
|
|
840
|
+
discovery: {
|
|
841
|
+
activities: number;
|
|
842
|
+
complete: boolean;
|
|
843
|
+
discoveredCount: number;
|
|
844
|
+
};
|
|
845
|
+
schedules: {
|
|
846
|
+
total: number;
|
|
847
|
+
active: number;
|
|
848
|
+
paused: number;
|
|
849
|
+
};
|
|
850
|
+
metadata: {
|
|
851
|
+
classes: number;
|
|
852
|
+
methods: number;
|
|
853
|
+
total: number;
|
|
854
|
+
};
|
|
855
|
+
summary: {
|
|
856
|
+
totalComponents: number;
|
|
857
|
+
healthyComponents: number;
|
|
858
|
+
degradedComponents: number;
|
|
859
|
+
unhealthyComponents: number;
|
|
860
|
+
};
|
|
861
|
+
}
|