@io-orkes/conductor-javascript 0.0.11 → 0.9.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.
- package/README.md +29 -16
- package/dist/index.d.ts +151 -727
- package/dist/index.js +32 -622
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -622
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ __export(conductor_javascript_exports, {
|
|
|
76
76
|
jsonJqTask: () => jsonJqTask,
|
|
77
77
|
kafkaPublishTask: () => kafkaPublishTask,
|
|
78
78
|
newLoopTask: () => newLoopTask,
|
|
79
|
+
noopErrorHandler: () => noopErrorHandler,
|
|
79
80
|
orkesConductorClient: () => orkesConductorClient,
|
|
80
81
|
setVariableTask: () => setVariableTask,
|
|
81
82
|
simpleTask: () => simpleTask,
|
|
@@ -92,6 +93,9 @@ module.exports = __toCommonJS(conductor_javascript_exports);
|
|
|
92
93
|
|
|
93
94
|
// src/task/TaskRunner.ts
|
|
94
95
|
var DEFAULT_ERROR_MESSAGE = "An unknown error occurred";
|
|
96
|
+
var MAX_RETRIES = 3;
|
|
97
|
+
var noopErrorHandler = (__error) => {
|
|
98
|
+
};
|
|
95
99
|
var noopLogger = {
|
|
96
100
|
debug: (...args) => {
|
|
97
101
|
},
|
|
@@ -105,7 +109,8 @@ var TaskRunner = class {
|
|
|
105
109
|
worker,
|
|
106
110
|
taskResource,
|
|
107
111
|
options,
|
|
108
|
-
logger = noopLogger
|
|
112
|
+
logger = noopLogger,
|
|
113
|
+
onError: errorHandler = noopErrorHandler
|
|
109
114
|
}) {
|
|
110
115
|
this.isPolling = false;
|
|
111
116
|
this.startPolling = () => {
|
|
@@ -130,27 +135,44 @@ var TaskRunner = class {
|
|
|
130
135
|
}
|
|
131
136
|
} catch (unknownError) {
|
|
132
137
|
this.handleUnknownError(unknownError);
|
|
138
|
+
this.errorHandler(unknownError);
|
|
133
139
|
}
|
|
134
140
|
await new Promise((r) => setTimeout(() => r(true), this.options.pollInterval));
|
|
135
141
|
}
|
|
136
142
|
};
|
|
143
|
+
this.updateTaskWithRetry = async (task, taskResult) => {
|
|
144
|
+
let retryCount = 0;
|
|
145
|
+
while (retryCount < MAX_RETRIES) {
|
|
146
|
+
try {
|
|
147
|
+
await this.taskResource.updateTask1(taskResult);
|
|
148
|
+
return;
|
|
149
|
+
} catch (error) {
|
|
150
|
+
this.errorHandler(error, task);
|
|
151
|
+
this.logger.error(`Error updating task ${taskResult.taskId} on retry ${retryCount}`, error);
|
|
152
|
+
retryCount++;
|
|
153
|
+
await new Promise((r) => setTimeout(() => r(true), retryCount * 10));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
this.logger.error(`Unable to update task ${taskResult.taskId} after ${retryCount} retries`);
|
|
157
|
+
};
|
|
137
158
|
this.executeTask = async (task) => {
|
|
138
159
|
try {
|
|
139
160
|
const result = await this.worker.execute(task);
|
|
140
|
-
await this.
|
|
161
|
+
await this.updateTaskWithRetry(task, __spreadProps(__spreadValues({}, result), {
|
|
141
162
|
workflowInstanceId: task.workflowInstanceId,
|
|
142
163
|
taskId: task.taskId
|
|
143
164
|
}));
|
|
144
165
|
this.logger.debug(`Finished polling for task ${task.taskId}`);
|
|
145
166
|
} catch (error) {
|
|
146
|
-
this.
|
|
147
|
-
await this.taskResource.updateTask1({
|
|
167
|
+
await this.updateTaskWithRetry(task, {
|
|
148
168
|
workflowInstanceId: task.workflowInstanceId,
|
|
149
169
|
taskId: task.taskId,
|
|
150
170
|
reasonForIncompletion: error?.message ?? DEFAULT_ERROR_MESSAGE,
|
|
151
171
|
status: "FAILED",
|
|
152
172
|
outputData: {}
|
|
153
173
|
});
|
|
174
|
+
this.errorHandler(error, task);
|
|
175
|
+
this.logger.error(`Error executing ${task.taskId}`, error);
|
|
154
176
|
}
|
|
155
177
|
};
|
|
156
178
|
this.handleUnknownError = (unknownError) => {
|
|
@@ -168,6 +190,7 @@ var TaskRunner = class {
|
|
|
168
190
|
this.logger = logger;
|
|
169
191
|
this.worker = worker;
|
|
170
192
|
this.options = options;
|
|
193
|
+
this.errorHandler = errorHandler;
|
|
171
194
|
}
|
|
172
195
|
};
|
|
173
196
|
|
|
@@ -298,200 +321,6 @@ var CancelablePromise = class {
|
|
|
298
321
|
};
|
|
299
322
|
Symbol.toStringTag;
|
|
300
323
|
|
|
301
|
-
// src/common/open-api/services/AdminResourceService.ts
|
|
302
|
-
var AdminResourceService = class {
|
|
303
|
-
constructor(httpRequest) {
|
|
304
|
-
this.httpRequest = httpRequest;
|
|
305
|
-
}
|
|
306
|
-
verifyAndRepairWorkflowConsistency(workflowId) {
|
|
307
|
-
return this.httpRequest.request({
|
|
308
|
-
method: "POST",
|
|
309
|
-
url: "/admin/consistency/verifyAndRepair/{workflowId}",
|
|
310
|
-
path: {
|
|
311
|
-
"workflowId": workflowId
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
getRedisUsage() {
|
|
316
|
-
return this.httpRequest.request({
|
|
317
|
-
method: "GET",
|
|
318
|
-
url: "/admin/redisUsage"
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
view(tasktype, start, count = 100) {
|
|
322
|
-
return this.httpRequest.request({
|
|
323
|
-
method: "GET",
|
|
324
|
-
url: "/admin/task/{tasktype}",
|
|
325
|
-
path: {
|
|
326
|
-
"tasktype": tasktype
|
|
327
|
-
},
|
|
328
|
-
query: {
|
|
329
|
-
"start": start,
|
|
330
|
-
"count": count
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
requeueSweep(workflowId) {
|
|
335
|
-
return this.httpRequest.request({
|
|
336
|
-
method: "POST",
|
|
337
|
-
url: "/admin/sweep/requeue/{workflowId}",
|
|
338
|
-
path: {
|
|
339
|
-
"workflowId": workflowId
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
getEventQueues(verbose = false) {
|
|
344
|
-
return this.httpRequest.request({
|
|
345
|
-
method: "GET",
|
|
346
|
-
url: "/admin/queues",
|
|
347
|
-
query: {
|
|
348
|
-
"verbose": verbose
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
// src/common/open-api/services/ApplicationResourceService.ts
|
|
355
|
-
var ApplicationResourceService = class {
|
|
356
|
-
constructor(httpRequest) {
|
|
357
|
-
this.httpRequest = httpRequest;
|
|
358
|
-
}
|
|
359
|
-
getApplication(id) {
|
|
360
|
-
return this.httpRequest.request({
|
|
361
|
-
method: "GET",
|
|
362
|
-
url: "/applications/{id}",
|
|
363
|
-
path: {
|
|
364
|
-
"id": id
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
updateApplication(id, requestBody) {
|
|
369
|
-
return this.httpRequest.request({
|
|
370
|
-
method: "PUT",
|
|
371
|
-
url: "/applications/{id}",
|
|
372
|
-
path: {
|
|
373
|
-
"id": id
|
|
374
|
-
},
|
|
375
|
-
body: requestBody,
|
|
376
|
-
mediaType: "application/json"
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
deleteApplication(id) {
|
|
380
|
-
return this.httpRequest.request({
|
|
381
|
-
method: "DELETE",
|
|
382
|
-
url: "/applications/{id}",
|
|
383
|
-
path: {
|
|
384
|
-
"id": id
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
getAccessKeys(id) {
|
|
389
|
-
return this.httpRequest.request({
|
|
390
|
-
method: "GET",
|
|
391
|
-
url: "/applications/{id}/accessKeys",
|
|
392
|
-
path: {
|
|
393
|
-
"id": id
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
createAccessKey(id) {
|
|
398
|
-
return this.httpRequest.request({
|
|
399
|
-
method: "POST",
|
|
400
|
-
url: "/applications/{id}/accessKeys",
|
|
401
|
-
path: {
|
|
402
|
-
"id": id
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
addRoleToApplicationUser(applicationId, role) {
|
|
407
|
-
return this.httpRequest.request({
|
|
408
|
-
method: "POST",
|
|
409
|
-
url: "/applications/{applicationId}/roles/{role}",
|
|
410
|
-
path: {
|
|
411
|
-
"applicationId": applicationId,
|
|
412
|
-
"role": role
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
removeRoleFromApplicationUser(applicationId, role) {
|
|
417
|
-
return this.httpRequest.request({
|
|
418
|
-
method: "DELETE",
|
|
419
|
-
url: "/applications/{applicationId}/roles/{role}",
|
|
420
|
-
path: {
|
|
421
|
-
"applicationId": applicationId,
|
|
422
|
-
"role": role
|
|
423
|
-
}
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
toggleAccessKeyStatus(applicationId, keyId) {
|
|
427
|
-
return this.httpRequest.request({
|
|
428
|
-
method: "POST",
|
|
429
|
-
url: "/applications/{applicationId}/accessKeys/{keyId}/status",
|
|
430
|
-
path: {
|
|
431
|
-
"applicationId": applicationId,
|
|
432
|
-
"keyId": keyId
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
listApplications() {
|
|
437
|
-
return this.httpRequest.request({
|
|
438
|
-
method: "GET",
|
|
439
|
-
url: "/applications"
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
createApplication(requestBody) {
|
|
443
|
-
return this.httpRequest.request({
|
|
444
|
-
method: "POST",
|
|
445
|
-
url: "/applications",
|
|
446
|
-
body: requestBody,
|
|
447
|
-
mediaType: "application/json"
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
deleteAccessKey(applicationId, keyId) {
|
|
451
|
-
return this.httpRequest.request({
|
|
452
|
-
method: "DELETE",
|
|
453
|
-
url: "/applications/{applicationId}/accessKeys/{keyId}",
|
|
454
|
-
path: {
|
|
455
|
-
"applicationId": applicationId,
|
|
456
|
-
"keyId": keyId
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
// src/common/open-api/services/AuthorizationResourceService.ts
|
|
463
|
-
var AuthorizationResourceService = class {
|
|
464
|
-
constructor(httpRequest) {
|
|
465
|
-
this.httpRequest = httpRequest;
|
|
466
|
-
}
|
|
467
|
-
grantPermissions(requestBody) {
|
|
468
|
-
return this.httpRequest.request({
|
|
469
|
-
method: "POST",
|
|
470
|
-
url: "/auth/authorization",
|
|
471
|
-
body: requestBody,
|
|
472
|
-
mediaType: "application/json"
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
removePermissions(requestBody) {
|
|
476
|
-
return this.httpRequest.request({
|
|
477
|
-
method: "DELETE",
|
|
478
|
-
url: "/auth/authorization",
|
|
479
|
-
body: requestBody,
|
|
480
|
-
mediaType: "application/json"
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
getPermissions(type, id) {
|
|
484
|
-
return this.httpRequest.request({
|
|
485
|
-
method: "GET",
|
|
486
|
-
url: "/auth/authorization/{type}/{id}",
|
|
487
|
-
path: {
|
|
488
|
-
"type": type,
|
|
489
|
-
"id": id
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
|
|
495
324
|
// src/common/open-api/services/EventResourceService.ts
|
|
496
325
|
var EventResourceService = class {
|
|
497
326
|
constructor(httpRequest) {
|
|
@@ -580,86 +409,6 @@ var EventResourceService = class {
|
|
|
580
409
|
}
|
|
581
410
|
};
|
|
582
411
|
|
|
583
|
-
// src/common/open-api/services/GroupResourceService.ts
|
|
584
|
-
var GroupResourceService = class {
|
|
585
|
-
constructor(httpRequest) {
|
|
586
|
-
this.httpRequest = httpRequest;
|
|
587
|
-
}
|
|
588
|
-
addUserToGroup(groupId, userId) {
|
|
589
|
-
return this.httpRequest.request({
|
|
590
|
-
method: "POST",
|
|
591
|
-
url: "/groups/{groupId}/users/{userId}",
|
|
592
|
-
path: {
|
|
593
|
-
"groupId": groupId,
|
|
594
|
-
"userId": userId
|
|
595
|
-
}
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
removeUserFromGroup(groupId, userId) {
|
|
599
|
-
return this.httpRequest.request({
|
|
600
|
-
method: "DELETE",
|
|
601
|
-
url: "/groups/{groupId}/users/{userId}",
|
|
602
|
-
path: {
|
|
603
|
-
"groupId": groupId,
|
|
604
|
-
"userId": userId
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
getGroup(id) {
|
|
609
|
-
return this.httpRequest.request({
|
|
610
|
-
method: "GET",
|
|
611
|
-
url: "/groups/{id}",
|
|
612
|
-
path: {
|
|
613
|
-
"id": id
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
upsertGroup(id, requestBody) {
|
|
618
|
-
return this.httpRequest.request({
|
|
619
|
-
method: "PUT",
|
|
620
|
-
url: "/groups/{id}",
|
|
621
|
-
path: {
|
|
622
|
-
"id": id
|
|
623
|
-
},
|
|
624
|
-
body: requestBody,
|
|
625
|
-
mediaType: "application/json"
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
deleteGroup(id) {
|
|
629
|
-
return this.httpRequest.request({
|
|
630
|
-
method: "DELETE",
|
|
631
|
-
url: "/groups/{id}",
|
|
632
|
-
path: {
|
|
633
|
-
"id": id
|
|
634
|
-
}
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
getGrantedPermissions(groupId) {
|
|
638
|
-
return this.httpRequest.request({
|
|
639
|
-
method: "GET",
|
|
640
|
-
url: "/groups/{groupId}/permissions",
|
|
641
|
-
path: {
|
|
642
|
-
"groupId": groupId
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
getUsersInGroup(id) {
|
|
647
|
-
return this.httpRequest.request({
|
|
648
|
-
method: "GET",
|
|
649
|
-
url: "/groups/{id}/users",
|
|
650
|
-
path: {
|
|
651
|
-
"id": id
|
|
652
|
-
}
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
listGroups() {
|
|
656
|
-
return this.httpRequest.request({
|
|
657
|
-
method: "GET",
|
|
658
|
-
url: "/groups"
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
|
|
663
412
|
// src/common/open-api/services/HealthCheckResourceService.ts
|
|
664
413
|
var HealthCheckResourceService = class {
|
|
665
414
|
constructor(httpRequest) {
|
|
@@ -786,122 +535,6 @@ var MetadataResourceService = class {
|
|
|
786
535
|
}
|
|
787
536
|
};
|
|
788
537
|
|
|
789
|
-
// src/common/open-api/services/MigrationResourceService.ts
|
|
790
|
-
var MigrationResourceService = class {
|
|
791
|
-
constructor(httpRequest) {
|
|
792
|
-
this.httpRequest = httpRequest;
|
|
793
|
-
}
|
|
794
|
-
migrateWorkflows(batchSize, startFromTimestamp) {
|
|
795
|
-
return this.httpRequest.request({
|
|
796
|
-
method: "GET",
|
|
797
|
-
url: "/admin/migrate_workflow",
|
|
798
|
-
query: {
|
|
799
|
-
"batchSize": batchSize,
|
|
800
|
-
"startFromTimestamp": startFromTimestamp
|
|
801
|
-
}
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
migrateIndex() {
|
|
805
|
-
return this.httpRequest.request({
|
|
806
|
-
method: "GET",
|
|
807
|
-
url: "/admin/migrate_index"
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
migrateMetadata() {
|
|
811
|
-
return this.httpRequest.request({
|
|
812
|
-
method: "GET",
|
|
813
|
-
url: "/admin/migrate_metadata"
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
// src/common/open-api/services/PublisherConfigResourceService.ts
|
|
819
|
-
var PublisherConfigResourceService = class {
|
|
820
|
-
constructor(httpRequest) {
|
|
821
|
-
this.httpRequest = httpRequest;
|
|
822
|
-
}
|
|
823
|
-
listAllConfigs() {
|
|
824
|
-
return this.httpRequest.request({
|
|
825
|
-
method: "GET",
|
|
826
|
-
url: "/publishers"
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
downloadConfig(id) {
|
|
830
|
-
return this.httpRequest.request({
|
|
831
|
-
method: "GET",
|
|
832
|
-
url: "/publishers/{id}",
|
|
833
|
-
path: {
|
|
834
|
-
"id": id
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
uploadConfig(id, requestBody) {
|
|
839
|
-
return this.httpRequest.request({
|
|
840
|
-
method: "PUT",
|
|
841
|
-
url: "/publishers/{id}",
|
|
842
|
-
path: {
|
|
843
|
-
"id": id
|
|
844
|
-
},
|
|
845
|
-
body: requestBody,
|
|
846
|
-
mediaType: "application/json"
|
|
847
|
-
});
|
|
848
|
-
}
|
|
849
|
-
deleteConfig(id) {
|
|
850
|
-
return this.httpRequest.request({
|
|
851
|
-
method: "DELETE",
|
|
852
|
-
url: "/publishers/{id}",
|
|
853
|
-
path: {
|
|
854
|
-
"id": id
|
|
855
|
-
}
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
};
|
|
859
|
-
|
|
860
|
-
// src/common/open-api/services/QueueAdminResourceService.ts
|
|
861
|
-
var QueueAdminResourceService = class {
|
|
862
|
-
constructor(httpRequest) {
|
|
863
|
-
this.httpRequest = httpRequest;
|
|
864
|
-
}
|
|
865
|
-
names() {
|
|
866
|
-
return this.httpRequest.request({
|
|
867
|
-
method: "GET",
|
|
868
|
-
url: "/queue/"
|
|
869
|
-
});
|
|
870
|
-
}
|
|
871
|
-
size() {
|
|
872
|
-
return this.httpRequest.request({
|
|
873
|
-
method: "GET",
|
|
874
|
-
url: "/queue/size"
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
updateByTaskId(workflowId, taskId, status, requestBody) {
|
|
878
|
-
return this.httpRequest.request({
|
|
879
|
-
method: "POST",
|
|
880
|
-
url: "/queue/update/{workflowId}/task/{taskId}/{status}",
|
|
881
|
-
path: {
|
|
882
|
-
"workflowId": workflowId,
|
|
883
|
-
"taskId": taskId,
|
|
884
|
-
"status": status
|
|
885
|
-
},
|
|
886
|
-
body: requestBody,
|
|
887
|
-
mediaType: "application/json"
|
|
888
|
-
});
|
|
889
|
-
}
|
|
890
|
-
update1(workflowId, taskRefName, status, requestBody) {
|
|
891
|
-
return this.httpRequest.request({
|
|
892
|
-
method: "POST",
|
|
893
|
-
url: "/queue/update/{workflowId}/{taskRefName}/{status}",
|
|
894
|
-
path: {
|
|
895
|
-
"workflowId": workflowId,
|
|
896
|
-
"taskRefName": taskRefName,
|
|
897
|
-
"status": status
|
|
898
|
-
},
|
|
899
|
-
body: requestBody,
|
|
900
|
-
mediaType: "application/json"
|
|
901
|
-
});
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
|
|
905
538
|
// src/common/open-api/services/SchedulerResourceService.ts
|
|
906
539
|
var SchedulerResourceService = class {
|
|
907
540
|
constructor(httpRequest) {
|
|
@@ -1011,154 +644,6 @@ var SchedulerResourceService = class {
|
|
|
1011
644
|
}
|
|
1012
645
|
};
|
|
1013
646
|
|
|
1014
|
-
// src/common/open-api/services/SecretResourceService.ts
|
|
1015
|
-
var SecretResourceService = class {
|
|
1016
|
-
constructor(httpRequest) {
|
|
1017
|
-
this.httpRequest = httpRequest;
|
|
1018
|
-
}
|
|
1019
|
-
getSecret(key) {
|
|
1020
|
-
return this.httpRequest.request({
|
|
1021
|
-
method: "GET",
|
|
1022
|
-
url: "/secrets/{key}",
|
|
1023
|
-
path: {
|
|
1024
|
-
"key": key
|
|
1025
|
-
}
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
putSecret(key, requestBody) {
|
|
1029
|
-
return this.httpRequest.request({
|
|
1030
|
-
method: "PUT",
|
|
1031
|
-
url: "/secrets/{key}",
|
|
1032
|
-
path: {
|
|
1033
|
-
"key": key
|
|
1034
|
-
},
|
|
1035
|
-
body: requestBody,
|
|
1036
|
-
mediaType: "application/json"
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
deleteSecret(key) {
|
|
1040
|
-
return this.httpRequest.request({
|
|
1041
|
-
method: "DELETE",
|
|
1042
|
-
url: "/secrets/{key}",
|
|
1043
|
-
path: {
|
|
1044
|
-
"key": key
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
}
|
|
1048
|
-
listSecretsThatUserCanGrantAccessTo() {
|
|
1049
|
-
return this.httpRequest.request({
|
|
1050
|
-
method: "GET",
|
|
1051
|
-
url: "/secrets"
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
listAllSecretNames() {
|
|
1055
|
-
return this.httpRequest.request({
|
|
1056
|
-
method: "POST",
|
|
1057
|
-
url: "/secrets"
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
secretExists(key) {
|
|
1061
|
-
return this.httpRequest.request({
|
|
1062
|
-
method: "GET",
|
|
1063
|
-
url: "/secrets/{key}/exists",
|
|
1064
|
-
path: {
|
|
1065
|
-
"key": key
|
|
1066
|
-
}
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
|
|
1071
|
-
// src/common/open-api/services/TagsExperimentalService.ts
|
|
1072
|
-
var TagsExperimentalService = class {
|
|
1073
|
-
constructor(httpRequest) {
|
|
1074
|
-
this.httpRequest = httpRequest;
|
|
1075
|
-
}
|
|
1076
|
-
getWorkflowTags(name) {
|
|
1077
|
-
return this.httpRequest.request({
|
|
1078
|
-
method: "GET",
|
|
1079
|
-
url: "/metadata/workflow/{name}/tags",
|
|
1080
|
-
path: {
|
|
1081
|
-
"name": name
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
}
|
|
1085
|
-
setWorkflowTags(name, requestBody) {
|
|
1086
|
-
return this.httpRequest.request({
|
|
1087
|
-
method: "PUT",
|
|
1088
|
-
url: "/metadata/workflow/{name}/tags",
|
|
1089
|
-
path: {
|
|
1090
|
-
"name": name
|
|
1091
|
-
},
|
|
1092
|
-
body: requestBody,
|
|
1093
|
-
mediaType: "application/json"
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
addWorkflowTag(name, requestBody) {
|
|
1097
|
-
return this.httpRequest.request({
|
|
1098
|
-
method: "POST",
|
|
1099
|
-
url: "/metadata/workflow/{name}/tags",
|
|
1100
|
-
path: {
|
|
1101
|
-
"name": name
|
|
1102
|
-
},
|
|
1103
|
-
body: requestBody,
|
|
1104
|
-
mediaType: "application/json"
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1107
|
-
deleteWorkflowTag(name, requestBody) {
|
|
1108
|
-
return this.httpRequest.request({
|
|
1109
|
-
method: "DELETE",
|
|
1110
|
-
url: "/metadata/workflow/{name}/tags",
|
|
1111
|
-
path: {
|
|
1112
|
-
"name": name
|
|
1113
|
-
},
|
|
1114
|
-
body: requestBody,
|
|
1115
|
-
mediaType: "application/json"
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
getTaskTags(taskName) {
|
|
1119
|
-
return this.httpRequest.request({
|
|
1120
|
-
method: "GET",
|
|
1121
|
-
url: "/metadata/task/{taskName}/tags",
|
|
1122
|
-
path: {
|
|
1123
|
-
"taskName": taskName
|
|
1124
|
-
}
|
|
1125
|
-
});
|
|
1126
|
-
}
|
|
1127
|
-
setTaskTags(taskName, requestBody) {
|
|
1128
|
-
return this.httpRequest.request({
|
|
1129
|
-
method: "PUT",
|
|
1130
|
-
url: "/metadata/task/{taskName}/tags",
|
|
1131
|
-
path: {
|
|
1132
|
-
"taskName": taskName
|
|
1133
|
-
},
|
|
1134
|
-
body: requestBody,
|
|
1135
|
-
mediaType: "application/json"
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
addTaskTag(taskName, requestBody) {
|
|
1139
|
-
return this.httpRequest.request({
|
|
1140
|
-
method: "POST",
|
|
1141
|
-
url: "/metadata/task/{taskName}/tags",
|
|
1142
|
-
path: {
|
|
1143
|
-
"taskName": taskName
|
|
1144
|
-
},
|
|
1145
|
-
body: requestBody,
|
|
1146
|
-
mediaType: "application/json"
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
deleteTaskTag(taskName, requestBody) {
|
|
1150
|
-
return this.httpRequest.request({
|
|
1151
|
-
method: "DELETE",
|
|
1152
|
-
url: "/metadata/task/{taskName}/tags",
|
|
1153
|
-
path: {
|
|
1154
|
-
"taskName": taskName
|
|
1155
|
-
},
|
|
1156
|
-
body: requestBody,
|
|
1157
|
-
mediaType: "application/json"
|
|
1158
|
-
});
|
|
1159
|
-
}
|
|
1160
|
-
};
|
|
1161
|
-
|
|
1162
647
|
// src/common/open-api/services/TaskResourceService.ts
|
|
1163
648
|
var TaskResourceService = class {
|
|
1164
649
|
constructor(httpRequest) {
|
|
@@ -1347,73 +832,6 @@ var TokenResourceService = class {
|
|
|
1347
832
|
}
|
|
1348
833
|
};
|
|
1349
834
|
|
|
1350
|
-
// src/common/open-api/services/UserResourceService.ts
|
|
1351
|
-
var UserResourceService = class {
|
|
1352
|
-
constructor(httpRequest) {
|
|
1353
|
-
this.httpRequest = httpRequest;
|
|
1354
|
-
}
|
|
1355
|
-
getUser(id) {
|
|
1356
|
-
return this.httpRequest.request({
|
|
1357
|
-
method: "GET",
|
|
1358
|
-
url: "/users/{id}",
|
|
1359
|
-
path: {
|
|
1360
|
-
"id": id
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
}
|
|
1364
|
-
upsertUser(id, requestBody) {
|
|
1365
|
-
return this.httpRequest.request({
|
|
1366
|
-
method: "PUT",
|
|
1367
|
-
url: "/users/{id}",
|
|
1368
|
-
path: {
|
|
1369
|
-
"id": id
|
|
1370
|
-
},
|
|
1371
|
-
body: requestBody,
|
|
1372
|
-
mediaType: "application/json"
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
deleteUser(id) {
|
|
1376
|
-
return this.httpRequest.request({
|
|
1377
|
-
method: "DELETE",
|
|
1378
|
-
url: "/users/{id}",
|
|
1379
|
-
path: {
|
|
1380
|
-
"id": id
|
|
1381
|
-
}
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
listUsers(apps = false) {
|
|
1385
|
-
return this.httpRequest.request({
|
|
1386
|
-
method: "GET",
|
|
1387
|
-
url: "/users",
|
|
1388
|
-
query: {
|
|
1389
|
-
"apps": apps
|
|
1390
|
-
}
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
getGrantedPermissions1(userId) {
|
|
1394
|
-
return this.httpRequest.request({
|
|
1395
|
-
method: "GET",
|
|
1396
|
-
url: "/users/{userId}/permissions",
|
|
1397
|
-
path: {
|
|
1398
|
-
"userId": userId
|
|
1399
|
-
}
|
|
1400
|
-
});
|
|
1401
|
-
}
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
|
-
// src/common/open-api/services/VersionResourceService.ts
|
|
1405
|
-
var VersionResourceService = class {
|
|
1406
|
-
constructor(httpRequest) {
|
|
1407
|
-
this.httpRequest = httpRequest;
|
|
1408
|
-
}
|
|
1409
|
-
getVersion() {
|
|
1410
|
-
return this.httpRequest.request({
|
|
1411
|
-
method: "GET",
|
|
1412
|
-
url: "/version"
|
|
1413
|
-
});
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
|
|
1417
835
|
// src/common/open-api/services/WorkflowBulkResourceService.ts
|
|
1418
836
|
var WorkflowBulkResourceService = class {
|
|
1419
837
|
constructor(httpRequest) {
|
|
@@ -1990,23 +1408,12 @@ var ConductorClient = class {
|
|
|
1990
1408
|
}
|
|
1991
1409
|
};
|
|
1992
1410
|
this.token = config?.TOKEN;
|
|
1993
|
-
this.adminResource = new AdminResourceService(this.request);
|
|
1994
|
-
this.applicationResource = new ApplicationResourceService(this.request);
|
|
1995
|
-
this.authorizationResource = new AuthorizationResourceService(this.request);
|
|
1996
1411
|
this.eventResource = new EventResourceService(this.request);
|
|
1997
|
-
this.groupResource = new GroupResourceService(this.request);
|
|
1998
1412
|
this.healthCheckResource = new HealthCheckResourceService(this.request);
|
|
1999
1413
|
this.metadataResource = new MetadataResourceService(this.request);
|
|
2000
|
-
this.migrationResource = new MigrationResourceService(this.request);
|
|
2001
|
-
this.publisherConfigResource = new PublisherConfigResourceService(this.request);
|
|
2002
|
-
this.queueAdminResource = new QueueAdminResourceService(this.request);
|
|
2003
1414
|
this.schedulerResource = new SchedulerResourceService(this.request);
|
|
2004
|
-
this.secretResource = new SecretResourceService(this.request);
|
|
2005
|
-
this.tagsExperimental = new TagsExperimentalService(this.request);
|
|
2006
1415
|
this.taskResource = new TaskResourceService(this.request);
|
|
2007
1416
|
this.tokenResource = new TokenResourceService(this.request);
|
|
2008
|
-
this.userResource = new UserResourceService(this.request);
|
|
2009
|
-
this.versionResource = new VersionResourceService(this.request);
|
|
2010
1417
|
this.workflowBulkResource = new WorkflowBulkResourceService(this.request);
|
|
2011
1418
|
this.workflowResource = new WorkflowResourceService(this.request);
|
|
2012
1419
|
}
|
|
@@ -2319,7 +1726,7 @@ var taskGenMapper = (tasks) => tasks.reduce((acc, task, idx) => {
|
|
|
2319
1726
|
return acc.concat(maybeAddJoinTask(filledTask, maybeNextTask));
|
|
2320
1727
|
}, []);
|
|
2321
1728
|
var maybeAddJoinTask = (currentTask, maybeNextTask) => {
|
|
2322
|
-
if (currentTask.type === "FORK_JOIN" /* FORK_JOIN */ || currentTask.type === "FORK_JOIN_DYNAMIC" /* FORK_JOIN_DYNAMIC */ && maybeNextTask != null && maybeNextTask.type !== "JOIN" /* JOIN */) {
|
|
1729
|
+
if ((currentTask.type === "FORK_JOIN" /* FORK_JOIN */ || currentTask.type === "FORK_JOIN_DYNAMIC" /* FORK_JOIN_DYNAMIC */) && maybeNextTask != null && maybeNextTask.type !== "JOIN" /* JOIN */) {
|
|
2323
1730
|
return [currentTask, generateJoinTask({})];
|
|
2324
1731
|
}
|
|
2325
1732
|
return currentTask;
|
|
@@ -2545,7 +1952,8 @@ var TaskManager = class {
|
|
|
2545
1952
|
worker,
|
|
2546
1953
|
options,
|
|
2547
1954
|
taskResource: this.client.taskResource,
|
|
2548
|
-
logger: this.logger
|
|
1955
|
+
logger: this.logger,
|
|
1956
|
+
onError: this.errorHandler
|
|
2549
1957
|
});
|
|
2550
1958
|
runner.startPolling();
|
|
2551
1959
|
this.tasks[worker.taskDefName].push(runner);
|
|
@@ -2563,6 +1971,7 @@ var TaskManager = class {
|
|
|
2563
1971
|
}
|
|
2564
1972
|
this.client = client;
|
|
2565
1973
|
this.logger = config.logger ?? new DefaultLogger();
|
|
1974
|
+
this.errorHandler = config.onError ?? noopErrorHandler;
|
|
2566
1975
|
this.workers = workers;
|
|
2567
1976
|
const providedOptions = config.options ?? {};
|
|
2568
1977
|
this.taskManageOptions = __spreadProps(__spreadValues(__spreadValues({}, defaultManagerOptions), providedOptions), {
|
|
@@ -2706,6 +2115,7 @@ var WorkflowExecutor = class {
|
|
|
2706
2115
|
jsonJqTask,
|
|
2707
2116
|
kafkaPublishTask,
|
|
2708
2117
|
newLoopTask,
|
|
2118
|
+
noopErrorHandler,
|
|
2709
2119
|
orkesConductorClient,
|
|
2710
2120
|
setVariableTask,
|
|
2711
2121
|
simpleTask,
|