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