@diia-inhouse/workflow 1.15.0

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 (93) hide show
  1. package/LICENCE.md +287 -0
  2. package/README.md +93 -0
  3. package/dist/activities/index.js +18 -0
  4. package/dist/activities/index.js.map +1 -0
  5. package/dist/activities/proxy.js +26 -0
  6. package/dist/activities/proxy.js.map +1 -0
  7. package/dist/activity.js +15 -0
  8. package/dist/activity.js.map +1 -0
  9. package/dist/cli/checkWorkflowDeterminism.js +443 -0
  10. package/dist/cli/checkWorkflowDeterminism.js.map +1 -0
  11. package/dist/cli/index.js +111 -0
  12. package/dist/cli/index.js.map +1 -0
  13. package/dist/cli/syncTemporalSchedules.js +92 -0
  14. package/dist/cli/syncTemporalSchedules.js.map +1 -0
  15. package/dist/cli/updateTemporalSchedule.js +53 -0
  16. package/dist/cli/updateTemporalSchedule.js.map +1 -0
  17. package/dist/client.js +19 -0
  18. package/dist/client.js.map +1 -0
  19. package/dist/common.js +13 -0
  20. package/dist/common.js.map +1 -0
  21. package/dist/encryption/crypto.js +28 -0
  22. package/dist/encryption/crypto.js.map +1 -0
  23. package/dist/encryption/dataConverter.js +27 -0
  24. package/dist/encryption/dataConverter.js.map +1 -0
  25. package/dist/encryption/encryptionCodec.js +125 -0
  26. package/dist/encryption/encryptionCodec.js.map +1 -0
  27. package/dist/encryption/index.js +20 -0
  28. package/dist/encryption/index.js.map +1 -0
  29. package/dist/index.js +42 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/instrumentation.js +10 -0
  32. package/dist/instrumentation.js.map +1 -0
  33. package/dist/interceptors/asyncLocalStorageBridge.js +67 -0
  34. package/dist/interceptors/asyncLocalStorageBridge.js.map +1 -0
  35. package/dist/interceptors/index.js +6 -0
  36. package/dist/interceptors/index.js.map +1 -0
  37. package/dist/interceptors.js +10 -0
  38. package/dist/interceptors.js.map +1 -0
  39. package/dist/interfaces/config.js +3 -0
  40. package/dist/interfaces/config.js.map +1 -0
  41. package/dist/interfaces/index.js +18 -0
  42. package/dist/interfaces/index.js.map +1 -0
  43. package/dist/interfaces/services/worker.js +3 -0
  44. package/dist/interfaces/services/worker.js.map +1 -0
  45. package/dist/operations.js +77 -0
  46. package/dist/operations.js.map +1 -0
  47. package/dist/services/client.js +96 -0
  48. package/dist/services/client.js.map +1 -0
  49. package/dist/services/index.js +19 -0
  50. package/dist/services/index.js.map +1 -0
  51. package/dist/services/worker/identity.js +11 -0
  52. package/dist/services/worker/identity.js.map +1 -0
  53. package/dist/services/worker/index.js +18 -0
  54. package/dist/services/worker/index.js.map +1 -0
  55. package/dist/services/worker.js +324 -0
  56. package/dist/services/worker.js.map +1 -0
  57. package/dist/services/workerHealth.js +39 -0
  58. package/dist/services/workerHealth.js.map +1 -0
  59. package/dist/testing.js +57 -0
  60. package/dist/testing.js.map +1 -0
  61. package/dist/types/activities/index.d.ts +1 -0
  62. package/dist/types/activities/proxy.d.ts +35 -0
  63. package/dist/types/activity.d.ts +1 -0
  64. package/dist/types/cli/checkWorkflowDeterminism.d.ts +22 -0
  65. package/dist/types/cli/index.d.ts +2 -0
  66. package/dist/types/cli/syncTemporalSchedules.d.ts +12 -0
  67. package/dist/types/cli/updateTemporalSchedule.d.ts +9 -0
  68. package/dist/types/client.d.ts +2 -0
  69. package/dist/types/common.d.ts +1 -0
  70. package/dist/types/encryption/crypto.d.ts +3 -0
  71. package/dist/types/encryption/dataConverter.d.ts +3 -0
  72. package/dist/types/encryption/encryptionCodec.d.ts +27 -0
  73. package/dist/types/encryption/index.d.ts +3 -0
  74. package/dist/types/index.d.ts +3 -0
  75. package/dist/types/instrumentation.d.ts +2 -0
  76. package/dist/types/interceptors/asyncLocalStorageBridge.d.ts +21 -0
  77. package/dist/types/interceptors/index.d.ts +1 -0
  78. package/dist/types/interceptors.d.ts +2 -0
  79. package/dist/types/interfaces/config.d.ts +38 -0
  80. package/dist/types/interfaces/index.d.ts +1 -0
  81. package/dist/types/interfaces/services/worker.d.ts +37 -0
  82. package/dist/types/operations.d.ts +5 -0
  83. package/dist/types/services/client.d.ts +20 -0
  84. package/dist/types/services/index.d.ts +2 -0
  85. package/dist/types/services/worker/identity.d.ts +1 -0
  86. package/dist/types/services/worker/index.d.ts +1 -0
  87. package/dist/types/services/worker.d.ts +113 -0
  88. package/dist/types/services/workerHealth.d.ts +11 -0
  89. package/dist/types/testing.d.ts +42 -0
  90. package/dist/types/worker.d.ts +3 -0
  91. package/dist/worker.js +25 -0
  92. package/dist/worker.js.map +1 -0
  93. package/package.json +139 -0
@@ -0,0 +1,443 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CheckWorkflowDeterminismCommand = void 0;
7
+ /* eslint-disable unicorn/no-process-exit */
8
+ const node_fs_1 = require("node:fs");
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const node_process_1 = require("node:process");
11
+ const node_util_1 = require("node:util");
12
+ const worker_1 = require("@temporalio/worker");
13
+ const workflow_1 = require("@temporalio/workflow");
14
+ const ts_node_1 = require("ts-node");
15
+ const env_1 = require("@diia-inhouse/env");
16
+ const utils_1 = require("@diia-inhouse/utils");
17
+ const encryption_1 = require("../encryption");
18
+ const client_1 = require("../services/client");
19
+ (0, ts_node_1.register)();
20
+ class CheckWorkflowDeterminismCommand {
21
+ logger;
22
+ envService;
23
+ temporalConfig;
24
+ report = {
25
+ successCount: 0,
26
+ failureCount: 0,
27
+ errors: [],
28
+ warnings: [],
29
+ checkedWorkflows: [],
30
+ };
31
+ maxWorkflowsPerType = 10;
32
+ maxRetries = 3;
33
+ retryDelay = 100;
34
+ constructor(logger, envService) {
35
+ this.logger = logger;
36
+ this.envService = envService;
37
+ }
38
+ async run(workflowsPath = 'worker/workflows', taskQueueParam, workflowId) {
39
+ const startTime = Date.now();
40
+ worker_1.Runtime.install({ logger: this.logger });
41
+ this.logger.info('Starting workflow determinism check', { workflowsPath, taskQueue: taskQueueParam, workflowId });
42
+ const workflows = await this.loadWorkflows(workflowsPath);
43
+ this.logger.info(`Found ${Object.keys(workflows).length} workflows`, { workflows: Object.keys(workflows) });
44
+ const taskQueue = taskQueueParam || this.getTaskQueue();
45
+ if (!taskQueue) {
46
+ throw new Error('Task queue is not provided');
47
+ }
48
+ this.temporalConfig = {
49
+ address: env_1.EnvService.getVar('TEMPORAL_ADDRESS'),
50
+ namespace: env_1.EnvService.getVar('TEMPORAL_NAMESPACE', 'string', 'default'),
51
+ taskQueue,
52
+ encryptionEnabled: env_1.EnvService.getVar('TEMPORAL_ENCRYPTION_ENABLED', 'boolean', false),
53
+ encryptionKeyId: env_1.EnvService.getVar('TEMPORAL_ENCRYPTION_KEY_ID', 'string', ''),
54
+ };
55
+ const client = new client_1.TemporalClient(this.temporalConfig, this.envService, this.logger);
56
+ await client.onInit();
57
+ try {
58
+ await this.checkWorkflowDeterminism(client, workflowsPath, workflowId);
59
+ this.logger.info(`Workflow determinism check finished! It took ${((Date.now() - startTime) / 1000).toFixed(1)} seconds`);
60
+ if (this.report.failureCount > 0) {
61
+ this.logger.error(`Determinism check failed: ${this.report.failureCount} workflows have determinism issues`);
62
+ process.exit(1);
63
+ }
64
+ }
65
+ finally {
66
+ await client.nativeClient.connection.close();
67
+ }
68
+ process.exit(0);
69
+ }
70
+ async checkWorkflowDeterminism(client, workflowsPath, specificWorkflowId) {
71
+ try {
72
+ this.report = {
73
+ successCount: 0,
74
+ failureCount: 0,
75
+ errors: [],
76
+ warnings: [],
77
+ checkedWorkflows: [],
78
+ };
79
+ if (specificWorkflowId) {
80
+ try {
81
+ await this.checkSingleWorkflow(client, workflowsPath, specificWorkflowId);
82
+ this.report.successCount++;
83
+ }
84
+ catch {
85
+ const workflow = this.report.checkedWorkflows.find((w) => w.id === specificWorkflowId);
86
+ if (workflow && workflow.status === 'success') {
87
+ this.report.successCount++;
88
+ }
89
+ else {
90
+ this.report.failureCount++;
91
+ }
92
+ }
93
+ this.printBeautifulResults();
94
+ return;
95
+ }
96
+ const completedOrFailedWorkflows = await this.listCompletedOrFailedWorkflows(client, workflowsPath);
97
+ if (completedOrFailedWorkflows.length === 0) {
98
+ this.logger.info('No completed or failed workflows found to check');
99
+ return;
100
+ }
101
+ this.logger.info(`Found ${completedOrFailedWorkflows.length} completed or failed workflows to check (limited to max 10 per workflow type)`);
102
+ for (const [i, workflowId] of completedOrFailedWorkflows.entries()) {
103
+ if (i > 0) {
104
+ await new Promise((resolve) => setTimeout(resolve, this.retryDelay));
105
+ }
106
+ try {
107
+ await this.checkSingleWorkflow(client, workflowsPath, workflowId);
108
+ this.report.successCount++;
109
+ }
110
+ catch {
111
+ const workflow = this.report.checkedWorkflows.find((w) => w.id === workflowId);
112
+ if (workflow && workflow.status === 'success') {
113
+ this.report.successCount++;
114
+ }
115
+ else {
116
+ this.report.failureCount++;
117
+ this.logger.error(`❌ Failed to check workflow ${workflowId}`);
118
+ }
119
+ }
120
+ }
121
+ this.printBeautifulResults();
122
+ }
123
+ catch (err) {
124
+ this.logger.error('❌ Failed to check workflow determinism', { err });
125
+ throw err;
126
+ }
127
+ }
128
+ async runReplayHistory(workflowsPath, history, workflowId) {
129
+ const fullPath = this.resolveWorkflowsPath(workflowsPath);
130
+ const options = { workflowsPath: require.resolve(fullPath) };
131
+ if (this.temporalConfig.encryptionEnabled) {
132
+ const dataConverter = await (0, encryption_1.getDataConverter)(this.temporalConfig.encryptionKeyId, this.envService);
133
+ options.dataConverter = dataConverter;
134
+ }
135
+ return await this.runReplayHistoryWithRetry(options, history, workflowId);
136
+ }
137
+ async runReplayHistoryWithRetry(options, history, workflowId, maxRetries = this.maxRetries) {
138
+ let lastError;
139
+ let failedAttempts = 0;
140
+ const originalErrors = [];
141
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
142
+ try {
143
+ if (attempt > 1) {
144
+ const delay = Math.min(1000 * Math.pow(2, attempt - 2), 5000); // Exponential backoff, max 5s
145
+ this.logger.info(`Retrying replay history for workflow ${workflowId} (attempt ${attempt}/${maxRetries}) after ${delay}ms delay`);
146
+ await new Promise((resolve) => setTimeout(resolve, delay));
147
+ }
148
+ await worker_1.Worker.runReplayHistory(options, history, workflowId);
149
+ return { recoveredOnRetry: attempt > 1, failedAttempts, originalErrors };
150
+ }
151
+ catch (err) {
152
+ if (err instanceof workflow_1.DeterminismViolationError) {
153
+ throw err;
154
+ }
155
+ failedAttempts++;
156
+ lastError = err;
157
+ const errorMessage = err instanceof Error ? err.message : String(err);
158
+ originalErrors.push(`Attempt ${attempt}: ${errorMessage}`);
159
+ this.logger.warn(`🔁 Failed to replay history for workflow ${workflowId} on attempt ${attempt}/${maxRetries}`, { err });
160
+ continue;
161
+ }
162
+ }
163
+ throw lastError ?? new Error('Unknown error during replay history retry');
164
+ }
165
+ async checkSingleWorkflow(client, workflowsPath, workflowId) {
166
+ this.logger.info(`Checking workflow ${workflowId}`);
167
+ const handle = client.workflow.getHandle(workflowId);
168
+ const history = await handle.fetchHistory();
169
+ const description = await handle.describe();
170
+ const workflowName = description.type;
171
+ try {
172
+ this.logger.info(`Checking determinism for workflow functions in ${workflowId}`);
173
+ const retryResult = await this.runReplayHistory(workflowsPath, history, workflowId);
174
+ this.logger.info(`✅ Workflow ${workflowId} is deterministic`);
175
+ if (retryResult.recoveredOnRetry) {
176
+ this.report.warnings.push({
177
+ workflowId,
178
+ errorType: 'ReplayFailure',
179
+ errorMessage: `Workflow failed ${retryResult.failedAttempts} time(s) but recovered on retry`,
180
+ details: {
181
+ issue: 'Workflow Recovered on Retry',
182
+ explanation: `This workflow initially failed replay but succeeded after ${retryResult.failedAttempts} failed attempt(s). This may indicate transient issues or race conditions.`,
183
+ failedAttempts: retryResult.failedAttempts,
184
+ originalErrors: retryResult.originalErrors,
185
+ },
186
+ });
187
+ this.logger.warn(`⚠️ Workflow ${workflowId} recovered after ${retryResult.failedAttempts} failed attempt(s)`);
188
+ }
189
+ this.report.checkedWorkflows.push({
190
+ name: workflowName,
191
+ id: workflowId,
192
+ status: 'success',
193
+ });
194
+ }
195
+ catch (err) {
196
+ this.report.checkedWorkflows.push({
197
+ name: workflowName,
198
+ id: workflowId,
199
+ status: 'failure',
200
+ });
201
+ if (err instanceof workflow_1.DeterminismViolationError) {
202
+ const errorMessage = err.message || '';
203
+ const activityMismatchRegex = /Activity type of scheduled event '(.+?)' does not match activity type of activity command '(.+?)'/;
204
+ const match = errorMessage.match(activityMismatchRegex);
205
+ if (match) {
206
+ const [, scheduledEvent, activityCommand] = match;
207
+ const details = {
208
+ issue: 'Activity Type Mismatch',
209
+ explanation: `The workflow history expected activity '${scheduledEvent}' but the code attempted to execute '${activityCommand}'`,
210
+ };
211
+ this.report.errors.push({
212
+ workflowId,
213
+ errorType: 'DeterminismViolation',
214
+ errorMessage,
215
+ details,
216
+ });
217
+ this.logger.fatal(`❌ Workflow ${workflowId} has determinism issues: Activity type mismatch`, {
218
+ nondeterminismDetails: details,
219
+ });
220
+ }
221
+ else if (errorMessage.includes('WorkflowExecutionCompleted')) {
222
+ const details = {
223
+ issue: 'New Steps Added',
224
+ explanation: 'This workflow has been modified to add new steps after the point where it previously completed. This is safe to ignore as it does not affect existing history.',
225
+ };
226
+ this.report.warnings.push({
227
+ workflowId,
228
+ errorType: 'DeterminismViolation',
229
+ errorMessage,
230
+ details,
231
+ });
232
+ this.logger.warn(`⚠️ Workflow ${workflowId} has been modified to add new steps`, {
233
+ details,
234
+ err,
235
+ });
236
+ const lastWorkflow = this.report.checkedWorkflows.at(-1);
237
+ if (lastWorkflow) {
238
+ lastWorkflow.status = 'success';
239
+ }
240
+ return;
241
+ }
242
+ else {
243
+ this.report.errors.push({
244
+ workflowId,
245
+ errorType: 'DeterminismViolation',
246
+ errorMessage,
247
+ });
248
+ this.logger.error(`❌ Workflow ${workflowId} has determinism issues`, {});
249
+ }
250
+ }
251
+ else {
252
+ const errorMessage = err instanceof Error ? err.message : String(err);
253
+ this.report.errors.push({
254
+ workflowId,
255
+ errorType: 'ReplayFailure',
256
+ errorMessage,
257
+ });
258
+ this.logger.error(`⚠️ Workflow ${workflowId} replay failed`, { err });
259
+ }
260
+ throw err;
261
+ }
262
+ }
263
+ async loadWorkflows(workflowsPath) {
264
+ const fullWorkflowsPath = this.resolveWorkflowsPath(workflowsPath);
265
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
266
+ const workflowsExist = (0, node_fs_1.existsSync)(fullWorkflowsPath); // nosemgrep: eslint.detect-non-literal-fs-filename
267
+ if (!workflowsExist) {
268
+ throw new Error(`Workflow files not found under provided path: ${fullWorkflowsPath}`);
269
+ }
270
+ const module = await import(fullWorkflowsPath);
271
+ const workflows = module.default;
272
+ if (workflows['interceptors']) {
273
+ delete workflows['interceptors'];
274
+ }
275
+ return workflows;
276
+ }
277
+ async listCompletedOrFailedWorkflows(client, workflowsPath) {
278
+ const workflowsByType = {};
279
+ const taskQueue = this.getTaskQueue() || 'default';
280
+ const completedOrFailedWorkflows = client.workflow.list({
281
+ query: `TaskQueue="${taskQueue}" AND (ExecutionStatus="Completed" OR ExecutionStatus="Failed")`,
282
+ });
283
+ for await (const workflow of completedOrFailedWorkflows) {
284
+ const workflowType = workflow.type;
285
+ if (!workflowsByType[workflowType]) {
286
+ workflowsByType[workflowType] = [];
287
+ }
288
+ if (workflowsByType[workflowType].length < this.maxWorkflowsPerType) {
289
+ workflowsByType[workflowType].push(workflow.workflowId);
290
+ if (workflowsByType[workflowType].length === this.maxWorkflowsPerType) {
291
+ this.logger.info(`Reached limit of ${this.maxWorkflowsPerType} workflows for type '${workflowType}'`);
292
+ }
293
+ }
294
+ }
295
+ const workflowTypes = Object.keys(workflowsByType);
296
+ const relevantWorkflows = await this.loadWorkflows(workflowsPath);
297
+ const relevantWorkflowTypes = Object.keys(relevantWorkflows);
298
+ const filteredWorkflowsByType = {};
299
+ for (const [type, workflows] of Object.entries(workflowsByType)) {
300
+ if (relevantWorkflowTypes.includes(type)) {
301
+ filteredWorkflowsByType[type] = workflows;
302
+ }
303
+ }
304
+ const filteredWorkflowTypes = Object.keys(filteredWorkflowsByType);
305
+ const excludedCount = workflowTypes.length - filteredWorkflowTypes.length;
306
+ this.logger.info(`Found workflows of ${filteredWorkflowTypes.length} relevant types: ${filteredWorkflowTypes.join(', ')}`);
307
+ if (excludedCount > 0) {
308
+ const excludedTypes = workflowTypes.filter((type) => !relevantWorkflowTypes.includes(type));
309
+ this.logger.info(`🚫 Excluded ${excludedCount} workflow types which are missing in codebase: ${excludedTypes.join(', ')}`);
310
+ }
311
+ return Object.values(filteredWorkflowsByType).flat();
312
+ }
313
+ resolveWorkflowsPath(workflowsPath) {
314
+ const baseDir = node_path_1.default.resolve('./dist');
315
+ const fullPath = node_path_1.default.resolve(baseDir, workflowsPath, 'index.js');
316
+ if (!fullPath.startsWith(baseDir + node_path_1.default.sep)) {
317
+ throw new Error(`Invalid workflows path: path traversal detected in '${workflowsPath}'`);
318
+ }
319
+ return fullPath;
320
+ }
321
+ getTaskQueue() {
322
+ const taskQueue = env_1.EnvService.getVar('TEMPORAL_TASK_QUEUE', 'string', '');
323
+ if (!taskQueue) {
324
+ return utils_1.utils.getServiceName();
325
+ }
326
+ return taskQueue;
327
+ }
328
+ printBeautifulResults() {
329
+ const reset = '\u001B[0m';
330
+ const bold = '\u001B[1m';
331
+ const green = '\u001B[32m';
332
+ const red = '\u001B[31m';
333
+ const yellow = '\u001B[33m';
334
+ const magenta = '\u001B[35m';
335
+ const cyan = '\u001B[36m';
336
+ const white = '\u001B[37m';
337
+ const bgBlue = '\u001B[44m';
338
+ const bgRed = '\u001B[41m';
339
+ const bgGreen = '\u001B[42m';
340
+ const bgYellow = '\u001B[43m';
341
+ const dim = '\u001B[2m';
342
+ const underline = '\u001B[4m';
343
+ node_process_1.stdout.write('\n\n');
344
+ node_process_1.stdout.write(` ${bgBlue}${bold}${white} WORKFLOW DETERMINISM CHECK RESULTS ${reset}\n\n`);
345
+ if (this.report.errors.length > 0) {
346
+ node_process_1.stdout.write(` ${bold}${red}${underline}Errors${reset}\n\n`);
347
+ for (const [index, error] of this.report.errors.entries()) {
348
+ const errorTypeColor = error.errorType === 'DeterminismViolation' ? red : yellow;
349
+ const errorBg = error.errorType === 'DeterminismViolation' ? bgRed : bgYellow;
350
+ node_process_1.stdout.write(` ${errorBg}${white}${bold} Error #${index + 1} ${reset} ${errorTypeColor}${bold}${error.errorType}${reset}\n\n`);
351
+ node_process_1.stdout.write(` ${bold}Workflow ID:${reset} ${cyan}${error.workflowId}${reset}\n`);
352
+ node_process_1.stdout.write(` ${bold}Message:${reset} ${errorTypeColor}${error.errorMessage}${reset}\n`);
353
+ if (error.details) {
354
+ node_process_1.stdout.write(`\n ${bold}${underline}Details:${reset}\n`);
355
+ for (const [key, value] of Object.entries(error.details)) {
356
+ const formattedValue = typeof value === 'string' ? value : (0, node_util_1.format)('%o', value);
357
+ node_process_1.stdout.write(` ${magenta}${key}:${reset} ${formattedValue}\n`);
358
+ }
359
+ }
360
+ if (index < this.report.errors.length - 1) {
361
+ node_process_1.stdout.write(`\n ${dim}${'─'.repeat(60)}${reset}\n\n`);
362
+ }
363
+ }
364
+ }
365
+ if (this.report.warnings.length > 0) {
366
+ node_process_1.stdout.write(`\n ${bold}${yellow}${underline}Warnings${reset}\n\n`);
367
+ for (const [index, warning] of this.report.warnings.entries()) {
368
+ const errorBg = bgYellow;
369
+ const errorTypeColor = yellow;
370
+ node_process_1.stdout.write(` ${errorBg}${white}${bold} Warning #${index + 1} ${reset} ${errorTypeColor}${bold}${warning.errorType}${reset}\n\n`);
371
+ node_process_1.stdout.write(` ${bold}Workflow ID:${reset} ${cyan}${warning.workflowId}${reset}\n`);
372
+ node_process_1.stdout.write(` ${bold}Message:${reset} ${errorTypeColor}${warning.errorMessage}${reset}\n`);
373
+ if (warning.details) {
374
+ node_process_1.stdout.write(`\n ${bold}${underline}Details:${reset}\n`);
375
+ for (const [key, value] of Object.entries(warning.details)) {
376
+ const formattedValue = typeof value === 'string' ? value : (0, node_util_1.format)('%o', value);
377
+ node_process_1.stdout.write(` ${magenta}${key}:${reset} ${formattedValue}\n`);
378
+ }
379
+ }
380
+ if (index < this.report.warnings.length - 1) {
381
+ node_process_1.stdout.write(`\n ${dim}${'─'.repeat(60)}${reset}\n\n`);
382
+ }
383
+ }
384
+ }
385
+ if (this.report.checkedWorkflows.length > 0) {
386
+ node_process_1.stdout.write(`\n ${bold}${underline}Checked Workflow Types${reset}\n\n`);
387
+ const workflowTypeMap = new Map();
388
+ for (const workflow of this.report.checkedWorkflows) {
389
+ if (workflowTypeMap.has(workflow.name)) {
390
+ const entry = workflowTypeMap.get(workflow.name);
391
+ entry.totalCount++;
392
+ if (workflow.status === 'failure') {
393
+ entry.status = 'failure';
394
+ entry.failingCount++;
395
+ }
396
+ }
397
+ else {
398
+ workflowTypeMap.set(workflow.name, {
399
+ status: workflow.status,
400
+ totalCount: 1,
401
+ failingCount: workflow.status === 'failure' ? 1 : 0,
402
+ });
403
+ }
404
+ }
405
+ const sortedTypes = Array.from(workflowTypeMap.entries()).toSorted((a, b) => a[0].localeCompare(b[0]));
406
+ const deterministic = sortedTypes.filter(([, data]) => data.status === 'success');
407
+ if (deterministic.length > 0) {
408
+ node_process_1.stdout.write(` ${bgGreen}${white}${bold} DETERMINISTIC WORKFLOW TYPES ${reset}\n\n`);
409
+ for (const [name, data] of deterministic) {
410
+ node_process_1.stdout.write(` ${green}✓${reset} ${bold}${name}${reset} (${data.totalCount} instance${data.totalCount === 1 ? '' : 's'})\n`);
411
+ }
412
+ node_process_1.stdout.write('\n');
413
+ }
414
+ const nonDeterministic = sortedTypes.filter(([, data]) => data.status === 'failure');
415
+ if (nonDeterministic.length > 0) {
416
+ node_process_1.stdout.write(` ${bgRed}${white}${bold} NON-DETERMINISTIC WORKFLOW TYPES ${reset}\n\n`);
417
+ for (const [name, data] of nonDeterministic) {
418
+ node_process_1.stdout.write(` ${red}✗${reset} ${bold}${name}${reset} (${data.failingCount} failing instance${data.failingCount === 1 ? '' : 's'} out of ${data.totalCount})\n`);
419
+ }
420
+ node_process_1.stdout.write('\n');
421
+ }
422
+ }
423
+ node_process_1.stdout.write('\n');
424
+ node_process_1.stdout.write(` ${bold}${underline}Summary${reset}\n\n`);
425
+ node_process_1.stdout.write(` ${green}✓ ${bold}Passed:${reset} ${this.report.successCount > 0 ? green : dim}${this.report.successCount}${reset}\n`);
426
+ node_process_1.stdout.write(` ${red}✗ ${bold}Failed:${reset} ${this.report.failureCount > 0 ? red : dim}${this.report.failureCount}${reset}\n`);
427
+ const total = this.report.successCount + this.report.failureCount;
428
+ node_process_1.stdout.write(` ${bold}Total:${reset} ${total > 0 ? bold : dim}${total}${reset}\n\n`);
429
+ if (this.report.failureCount === 0 && this.report.successCount > 0) {
430
+ node_process_1.stdout.write(` ${bgGreen}${white}${bold} SUCCESS ${reset} ${green}All workflows are deterministic!${reset}\n\n`);
431
+ }
432
+ else if (this.report.failureCount > 0) {
433
+ node_process_1.stdout.write(` ${bgRed}${white}${bold} FAILURE ${reset} ${red}Some workflows have determinism issues!${reset}\n\n`);
434
+ }
435
+ else {
436
+ node_process_1.stdout.write(` ${bgYellow}${white}${bold} INFO ${reset} ${yellow}No workflows were checked.${reset}\n\n`);
437
+ }
438
+ node_process_1.stdout.write('\n');
439
+ this.logger.info(`Workflow determinism check results: ${this.report.successCount} passed, ${this.report.failureCount} failed`);
440
+ }
441
+ }
442
+ exports.CheckWorkflowDeterminismCommand = CheckWorkflowDeterminismCommand;
443
+ //# sourceMappingURL=checkWorkflowDeterminism.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkWorkflowDeterminism.js","sourceRoot":"","sources":["../../src/cli/checkWorkflowDeterminism.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA4C;AAC5C,qCAAoC;AACpC,0DAA4B;AAC5B,+CAAqC;AACrC,yCAAkC;AAElC,+CAAyE;AACzE,mDAAgE;AAChE,qCAAkC;AAElC,2CAA8C;AAE9C,+CAA2C;AAE3C,8CAAg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A;QAEzF,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;YACjE,qBAAM,CAAC,KAAK,CAAC,KAAK,OAAO,GAAG,KAAK,GAAG,IAAI,YAAY,KAAK,IAAI,KAAK,mCAAmC,KAAK,MAAM,CAAC,CAAA;QACrH,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;YACtC,qBAAM,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,KAAK,GAAG,IAAI,YAAY,KAAK,IAAI,GAAG,0CAA0C,KAAK,MAAM,CAAC,CAAA;QACxH,CAAC;aAAM,CAAC;YACJ,qBAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,SAAS,KAAK,IAAI,MAAM,6BAA6B,KAAK,MAAM,CAAC,CAAA;QAC9G,CAAC;QAED,qBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAElB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,IAAI,CAAC,MAAM,CAAC,YAAY,YAAY,IAAI,CAAC,MAAM,CAAC,YAAY,SAAS,CAAC,CAAA;IAClI,CAAC;CACJ;AA9hBD,0EA8hBC"}
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const yargs_1 = __importDefault(require("yargs"));
8
+ const helpers_1 = require("yargs/helpers");
9
+ const diia_logger_1 = __importDefault(require("@diia-inhouse/diia-logger"));
10
+ const env_1 = require("@diia-inhouse/env");
11
+ const checkWorkflowDeterminism_1 = require("./checkWorkflowDeterminism");
12
+ const syncTemporalSchedules_1 = require("./syncTemporalSchedules");
13
+ const updateTemporalSchedule_1 = require("./updateTemporalSchedule");
14
+ async function main() {
15
+ await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
16
+ .command('sync-schedules', 'Sync schedules with Temporal server', (args) => args
17
+ .option('schedulesPath', {
18
+ type: 'string',
19
+ default: 'worker/schedules',
20
+ describe: 'Path to schedules directory',
21
+ })
22
+ .option('taskQueue', {
23
+ type: 'string',
24
+ describe: 'Task queue name',
25
+ }), async (argv) => {
26
+ const logger = new diia_logger_1.default();
27
+ const envService = new env_1.EnvService(logger);
28
+ await envService.init();
29
+ try {
30
+ const command = new syncTemporalSchedules_1.SyncTemporalSchedulesCommand(logger, envService);
31
+ await command.run(argv.schedulesPath, argv.taskQueue);
32
+ }
33
+ finally {
34
+ await envService.onDestroy();
35
+ }
36
+ })
37
+ .command('update-schedule <scheduleId> <updateJson>', 'Update a temporal schedule', (args) => args
38
+ .positional('scheduleId', {
39
+ type: 'string',
40
+ describe: 'ID of the schedule to update',
41
+ })
42
+ .positional('updateJson', {
43
+ type: 'string',
44
+ describe: 'JSON object containing fields to update',
45
+ })
46
+ .example('diia-workflow update-schedule my-schedule \'{"spec": {"intervals": [{"every": "300s"}]}}\'', 'Change a schedule to run every 5 minutes')
47
+ .example('diia-workflow update-schedule my-schedule \'{"state": {"paused": true}}\'', 'Pause a schedule')
48
+ .example('diia-workflow update-schedule my-schedule \'{"state": {"paused": false}}\'', 'Resume a paused schedule')
49
+ .example('diia-workflow update-schedule my-schedule \'{"action": {"args": [{"param": "new-arg1"}]}}\'', 'Update the arguments passed to the workflow')
50
+ .example('diia-workflow update-schedule my-schedule \'{\n "spec": {"intervals": [{"every": "600s"}]},\n "state": {"paused": false},\n "action": {"args": [{"param": "new-arg1"}]}\n}\'', 'Update multiple fields in a single command'), async (argv) => {
51
+ if (!argv.scheduleId) {
52
+ throw new Error('scheduleId is required');
53
+ }
54
+ if (!argv.updateJson) {
55
+ throw new Error('updateJson is required');
56
+ }
57
+ let updateData;
58
+ try {
59
+ updateData = JSON.parse(argv.updateJson);
60
+ if (typeof updateData !== 'object' || updateData === null) {
61
+ throw new Error('Update data must be a valid JSON object');
62
+ }
63
+ }
64
+ catch (err) {
65
+ throw new Error(`Invalid JSON format. Please provide a valid JSON object. Error: ${err.message}`);
66
+ }
67
+ if (Object.keys(updateData).length === 0) {
68
+ throw new Error('Update data cannot be empty');
69
+ }
70
+ const logger = new diia_logger_1.default();
71
+ const envService = new env_1.EnvService(logger);
72
+ await envService.init();
73
+ try {
74
+ const command = new updateTemporalSchedule_1.UpdateTemporalScheduleCommand(logger, envService);
75
+ await command.run(argv.scheduleId, updateData);
76
+ }
77
+ finally {
78
+ await envService.onDestroy();
79
+ }
80
+ })
81
+ .command('check-determinism [workflowId]', 'Check completed or failed workflows for determinism issues', (args) => args
82
+ .option('workflowsPath', {
83
+ type: 'string',
84
+ default: 'worker/workflows',
85
+ describe: 'Path to workflows directory',
86
+ })
87
+ .option('taskQueue', {
88
+ type: 'string',
89
+ describe: 'Task queue name',
90
+ })
91
+ .positional('workflowId', {
92
+ type: 'string',
93
+ describe: 'Specific workflow ID to check (optional)',
94
+ })
95
+ .example('diia-workflow check-determinism', 'Check recent completed or failed workflows for determinism issues')
96
+ .example('diia-workflow check-determinism my-workflow-id', 'Check a specific workflow by ID for determinism issues'), async (argv) => {
97
+ const logger = new diia_logger_1.default();
98
+ const envService = new env_1.EnvService(logger);
99
+ await envService.init();
100
+ try {
101
+ const command = new checkWorkflowDeterminism_1.CheckWorkflowDeterminismCommand(logger, envService);
102
+ await command.run(argv.workflowsPath, argv.taskQueue, argv.workflowId);
103
+ }
104
+ finally {
105
+ await envService.onDestroy();
106
+ }
107
+ })
108
+ .help().argv;
109
+ }
110
+ void main();
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;AACA,kDAAyB;AACzB,2CAAuC;AAEvC,4EAAkD;AAClD,2CAA8C;AAE9C,yE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