@unmeshed/sdk 1.1.1 → 1.1.3
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/dist/index.d.mts +32 -24
- package/dist/index.d.ts +32 -24
- package/dist/index.js +89 -127
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -127
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/dist/index.d.mts
CHANGED
|
@@ -43,25 +43,33 @@ declare enum SQAuthUserType {
|
|
|
43
43
|
INTERNAL = "INTERNAL"
|
|
44
44
|
}
|
|
45
45
|
declare enum StepType {
|
|
46
|
-
|
|
46
|
+
LIST = "LIST",
|
|
47
47
|
HTTP = "HTTP",
|
|
48
|
-
|
|
48
|
+
WORKER = "WORKER",
|
|
49
|
+
SWITCH = "SWITCH",
|
|
50
|
+
PARALLEL = "PARALLEL",
|
|
49
51
|
FAIL = "FAIL",
|
|
50
52
|
PYTHON = "PYTHON",
|
|
51
53
|
JAVASCRIPT = "JAVASCRIPT",
|
|
52
54
|
JQ = "JQ",
|
|
53
|
-
|
|
55
|
+
SLACK = "SLACK",
|
|
56
|
+
GRAPHQL = "GRAPHQL",
|
|
57
|
+
WAIT = "WAIT",
|
|
54
58
|
BUILTIN = "BUILTIN",
|
|
55
59
|
NOOP = "NOOP",
|
|
56
|
-
|
|
60
|
+
AI_AGENT = "AI_AGENT",
|
|
61
|
+
EXIT = "EXIT",
|
|
57
62
|
DEPENDSON = "DEPENDSON",
|
|
63
|
+
PERSISTED_STATE = "PERSISTED_STATE",
|
|
64
|
+
UPDATE_STEP = "UPDATE_STEP",
|
|
58
65
|
INTEGRATION = "INTEGRATION",
|
|
59
|
-
EXIT = "EXIT",
|
|
60
|
-
SUB_PROCESS = "SUB_PROCESS",
|
|
61
|
-
LIST = "LIST",
|
|
62
|
-
PARALLEL = "PARALLEL",
|
|
63
66
|
FOREACH = "FOREACH",
|
|
64
|
-
|
|
67
|
+
WHILE = "WHILE",
|
|
68
|
+
SUB_PROCESS = "SUB_PROCESS",
|
|
69
|
+
FLOW_GATEWAY = "FLOW_GATEWAY",
|
|
70
|
+
DECISION_ENGINE = "DECISION_ENGINE",
|
|
71
|
+
SQLITE = "SQLITE",
|
|
72
|
+
MANAGED = "MANAGED"
|
|
65
73
|
}
|
|
66
74
|
declare enum StepStatus {
|
|
67
75
|
PENDING = "PENDING",
|
|
@@ -201,23 +209,23 @@ type ProcessRequestData = {
|
|
|
201
209
|
name: string;
|
|
202
210
|
namespace: string;
|
|
203
211
|
version: number | null;
|
|
204
|
-
requestId
|
|
205
|
-
correlationId
|
|
206
|
-
input
|
|
212
|
+
requestId?: string;
|
|
213
|
+
correlationId?: string;
|
|
214
|
+
input?: Record<string, unknown>;
|
|
207
215
|
};
|
|
208
216
|
type ProcessSearchRequest = {
|
|
209
217
|
startTimeEpoch: number;
|
|
210
218
|
endTimeEpoch?: number | null;
|
|
211
|
-
namespace
|
|
212
|
-
processTypes
|
|
213
|
-
triggerTypes
|
|
214
|
-
names
|
|
215
|
-
processIds
|
|
216
|
-
correlationIds
|
|
217
|
-
requestIds
|
|
218
|
-
statuses
|
|
219
|
-
limit
|
|
220
|
-
offset
|
|
219
|
+
namespace?: string;
|
|
220
|
+
processTypes?: ProcessType[];
|
|
221
|
+
triggerTypes?: ProcessTriggerType[];
|
|
222
|
+
names?: string[];
|
|
223
|
+
processIds?: number[];
|
|
224
|
+
correlationIds?: string[];
|
|
225
|
+
requestIds?: string[];
|
|
226
|
+
statuses?: ProcessStatus[];
|
|
227
|
+
limit?: number;
|
|
228
|
+
offset?: number;
|
|
221
229
|
};
|
|
222
230
|
type StepSize = {
|
|
223
231
|
stepQueueNameData: StepQueueNameData;
|
|
@@ -303,11 +311,11 @@ interface ApiError extends Error {
|
|
|
303
311
|
interface QueryParams {
|
|
304
312
|
[key: string]: string | number | boolean | undefined;
|
|
305
313
|
}
|
|
306
|
-
interface RequestConfig extends Omit<AxiosRequestConfig,
|
|
314
|
+
interface RequestConfig extends Omit<AxiosRequestConfig, 'baseURL' | 'url' | 'method'> {
|
|
307
315
|
headers?: Record<string, string>;
|
|
308
316
|
}
|
|
309
317
|
interface HandleRequestConfig {
|
|
310
|
-
method:
|
|
318
|
+
method: 'get' | 'post' | 'put' | 'delete';
|
|
311
319
|
endpoint: string;
|
|
312
320
|
params?: QueryParams;
|
|
313
321
|
data?: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,25 +43,33 @@ declare enum SQAuthUserType {
|
|
|
43
43
|
INTERNAL = "INTERNAL"
|
|
44
44
|
}
|
|
45
45
|
declare enum StepType {
|
|
46
|
-
|
|
46
|
+
LIST = "LIST",
|
|
47
47
|
HTTP = "HTTP",
|
|
48
|
-
|
|
48
|
+
WORKER = "WORKER",
|
|
49
|
+
SWITCH = "SWITCH",
|
|
50
|
+
PARALLEL = "PARALLEL",
|
|
49
51
|
FAIL = "FAIL",
|
|
50
52
|
PYTHON = "PYTHON",
|
|
51
53
|
JAVASCRIPT = "JAVASCRIPT",
|
|
52
54
|
JQ = "JQ",
|
|
53
|
-
|
|
55
|
+
SLACK = "SLACK",
|
|
56
|
+
GRAPHQL = "GRAPHQL",
|
|
57
|
+
WAIT = "WAIT",
|
|
54
58
|
BUILTIN = "BUILTIN",
|
|
55
59
|
NOOP = "NOOP",
|
|
56
|
-
|
|
60
|
+
AI_AGENT = "AI_AGENT",
|
|
61
|
+
EXIT = "EXIT",
|
|
57
62
|
DEPENDSON = "DEPENDSON",
|
|
63
|
+
PERSISTED_STATE = "PERSISTED_STATE",
|
|
64
|
+
UPDATE_STEP = "UPDATE_STEP",
|
|
58
65
|
INTEGRATION = "INTEGRATION",
|
|
59
|
-
EXIT = "EXIT",
|
|
60
|
-
SUB_PROCESS = "SUB_PROCESS",
|
|
61
|
-
LIST = "LIST",
|
|
62
|
-
PARALLEL = "PARALLEL",
|
|
63
66
|
FOREACH = "FOREACH",
|
|
64
|
-
|
|
67
|
+
WHILE = "WHILE",
|
|
68
|
+
SUB_PROCESS = "SUB_PROCESS",
|
|
69
|
+
FLOW_GATEWAY = "FLOW_GATEWAY",
|
|
70
|
+
DECISION_ENGINE = "DECISION_ENGINE",
|
|
71
|
+
SQLITE = "SQLITE",
|
|
72
|
+
MANAGED = "MANAGED"
|
|
65
73
|
}
|
|
66
74
|
declare enum StepStatus {
|
|
67
75
|
PENDING = "PENDING",
|
|
@@ -201,23 +209,23 @@ type ProcessRequestData = {
|
|
|
201
209
|
name: string;
|
|
202
210
|
namespace: string;
|
|
203
211
|
version: number | null;
|
|
204
|
-
requestId
|
|
205
|
-
correlationId
|
|
206
|
-
input
|
|
212
|
+
requestId?: string;
|
|
213
|
+
correlationId?: string;
|
|
214
|
+
input?: Record<string, unknown>;
|
|
207
215
|
};
|
|
208
216
|
type ProcessSearchRequest = {
|
|
209
217
|
startTimeEpoch: number;
|
|
210
218
|
endTimeEpoch?: number | null;
|
|
211
|
-
namespace
|
|
212
|
-
processTypes
|
|
213
|
-
triggerTypes
|
|
214
|
-
names
|
|
215
|
-
processIds
|
|
216
|
-
correlationIds
|
|
217
|
-
requestIds
|
|
218
|
-
statuses
|
|
219
|
-
limit
|
|
220
|
-
offset
|
|
219
|
+
namespace?: string;
|
|
220
|
+
processTypes?: ProcessType[];
|
|
221
|
+
triggerTypes?: ProcessTriggerType[];
|
|
222
|
+
names?: string[];
|
|
223
|
+
processIds?: number[];
|
|
224
|
+
correlationIds?: string[];
|
|
225
|
+
requestIds?: string[];
|
|
226
|
+
statuses?: ProcessStatus[];
|
|
227
|
+
limit?: number;
|
|
228
|
+
offset?: number;
|
|
221
229
|
};
|
|
222
230
|
type StepSize = {
|
|
223
231
|
stepQueueNameData: StepQueueNameData;
|
|
@@ -303,11 +311,11 @@ interface ApiError extends Error {
|
|
|
303
311
|
interface QueryParams {
|
|
304
312
|
[key: string]: string | number | boolean | undefined;
|
|
305
313
|
}
|
|
306
|
-
interface RequestConfig extends Omit<AxiosRequestConfig,
|
|
314
|
+
interface RequestConfig extends Omit<AxiosRequestConfig, 'baseURL' | 'url' | 'method'> {
|
|
307
315
|
headers?: Record<string, string>;
|
|
308
316
|
}
|
|
309
317
|
interface HandleRequestConfig {
|
|
310
|
-
method:
|
|
318
|
+
method: 'get' | 'post' | 'put' | 'delete';
|
|
311
319
|
endpoint: string;
|
|
312
320
|
params?: QueryParams;
|
|
313
321
|
data?: Record<string, unknown>;
|
package/dist/index.js
CHANGED
|
@@ -199,25 +199,33 @@ var SQAuthUserType = /* @__PURE__ */ ((SQAuthUserType2) => {
|
|
|
199
199
|
return SQAuthUserType2;
|
|
200
200
|
})(SQAuthUserType || {});
|
|
201
201
|
var StepType = /* @__PURE__ */ ((StepType2) => {
|
|
202
|
-
StepType2["
|
|
202
|
+
StepType2["LIST"] = "LIST";
|
|
203
203
|
StepType2["HTTP"] = "HTTP";
|
|
204
|
-
StepType2["
|
|
204
|
+
StepType2["WORKER"] = "WORKER";
|
|
205
|
+
StepType2["SWITCH"] = "SWITCH";
|
|
206
|
+
StepType2["PARALLEL"] = "PARALLEL";
|
|
205
207
|
StepType2["FAIL"] = "FAIL";
|
|
206
208
|
StepType2["PYTHON"] = "PYTHON";
|
|
207
209
|
StepType2["JAVASCRIPT"] = "JAVASCRIPT";
|
|
208
210
|
StepType2["JQ"] = "JQ";
|
|
209
|
-
StepType2["
|
|
211
|
+
StepType2["SLACK"] = "SLACK";
|
|
212
|
+
StepType2["GRAPHQL"] = "GRAPHQL";
|
|
213
|
+
StepType2["WAIT"] = "WAIT";
|
|
210
214
|
StepType2["BUILTIN"] = "BUILTIN";
|
|
211
215
|
StepType2["NOOP"] = "NOOP";
|
|
212
|
-
StepType2["
|
|
216
|
+
StepType2["AI_AGENT"] = "AI_AGENT";
|
|
217
|
+
StepType2["EXIT"] = "EXIT";
|
|
213
218
|
StepType2["DEPENDSON"] = "DEPENDSON";
|
|
219
|
+
StepType2["PERSISTED_STATE"] = "PERSISTED_STATE";
|
|
220
|
+
StepType2["UPDATE_STEP"] = "UPDATE_STEP";
|
|
214
221
|
StepType2["INTEGRATION"] = "INTEGRATION";
|
|
215
|
-
StepType2["EXIT"] = "EXIT";
|
|
216
|
-
StepType2["SUB_PROCESS"] = "SUB_PROCESS";
|
|
217
|
-
StepType2["LIST"] = "LIST";
|
|
218
|
-
StepType2["PARALLEL"] = "PARALLEL";
|
|
219
222
|
StepType2["FOREACH"] = "FOREACH";
|
|
220
|
-
StepType2["
|
|
223
|
+
StepType2["WHILE"] = "WHILE";
|
|
224
|
+
StepType2["SUB_PROCESS"] = "SUB_PROCESS";
|
|
225
|
+
StepType2["FLOW_GATEWAY"] = "FLOW_GATEWAY";
|
|
226
|
+
StepType2["DECISION_ENGINE"] = "DECISION_ENGINE";
|
|
227
|
+
StepType2["SQLITE"] = "SQLITE";
|
|
228
|
+
StepType2["MANAGED"] = "MANAGED";
|
|
221
229
|
return StepType2;
|
|
222
230
|
})(StepType || {});
|
|
223
231
|
var StepStatus = /* @__PURE__ */ ((StepStatus2) => {
|
|
@@ -272,7 +280,9 @@ var QueuedWorker = class {
|
|
|
272
280
|
this.batchSize = batchSize;
|
|
273
281
|
this.workerFn = workerFn;
|
|
274
282
|
this.timeoutMs = timeoutMs;
|
|
275
|
-
console.log(
|
|
283
|
+
console.log(
|
|
284
|
+
`Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`
|
|
285
|
+
);
|
|
276
286
|
this.start();
|
|
277
287
|
}
|
|
278
288
|
async start() {
|
|
@@ -350,9 +360,7 @@ async function registerPolling(apiClient, data) {
|
|
|
350
360
|
console.log("Successfully renewed registration for workers", data);
|
|
351
361
|
return response.data;
|
|
352
362
|
} catch {
|
|
353
|
-
console.error(
|
|
354
|
-
"An error occurred during polling registration. Retrying in 3 seconds..."
|
|
355
|
-
);
|
|
363
|
+
console.error("An error occurred during polling registration. Retrying in 3 seconds...");
|
|
356
364
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
357
365
|
return attempt();
|
|
358
366
|
}
|
|
@@ -368,18 +376,22 @@ async function pollWorker(apiClient, data) {
|
|
|
368
376
|
return response.data;
|
|
369
377
|
} catch (error) {
|
|
370
378
|
console.error("Error occurred during worker polling", error);
|
|
379
|
+
return [];
|
|
371
380
|
}
|
|
372
381
|
}
|
|
373
382
|
async function postWorkerResponse(apiClient, workResponses) {
|
|
374
383
|
try {
|
|
375
384
|
if (workResponses.length > 0) {
|
|
376
|
-
const grouped = workResponses.reduce(
|
|
377
|
-
|
|
378
|
-
acc[response2.status]
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
385
|
+
const grouped = workResponses.reduce(
|
|
386
|
+
(acc, response2) => {
|
|
387
|
+
if (!acc[response2.status]) {
|
|
388
|
+
acc[response2.status] = [];
|
|
389
|
+
}
|
|
390
|
+
acc[response2.status].push(response2.stepId);
|
|
391
|
+
return acc;
|
|
392
|
+
},
|
|
393
|
+
{}
|
|
394
|
+
);
|
|
383
395
|
const resultString = Object.entries(grouped).map(([status, stepIds]) => `${status}: [${stepIds.join(", ")}]`).join(", ");
|
|
384
396
|
console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`);
|
|
385
397
|
const response = await apiClient.post(`/api/clients/bulkResults`, {
|
|
@@ -440,7 +452,10 @@ async function pollForWorkers(apiClient, workers) {
|
|
|
440
452
|
let errorCount = 0;
|
|
441
453
|
while (continuePolling.value) {
|
|
442
454
|
try {
|
|
443
|
-
const workRequests = await runPollWithTimeout(
|
|
455
|
+
const workRequests = await runPollWithTimeout(
|
|
456
|
+
pollWorker(apiClient, pollWorkerData),
|
|
457
|
+
apiClient.config.pollTimeout
|
|
458
|
+
);
|
|
444
459
|
for (const polledWorker of workRequests) {
|
|
445
460
|
const associatedWorker = workers.find(
|
|
446
461
|
(worker) => worker.name === polledWorker.stepName && worker.namespace === polledWorker.stepNamespace
|
|
@@ -471,11 +486,10 @@ async function pollForWorkers(apiClient, workers) {
|
|
|
471
486
|
setTimeout(() => reject(new Error("Timed out")), TIMEOUT);
|
|
472
487
|
});
|
|
473
488
|
try {
|
|
474
|
-
console.log(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
]);
|
|
489
|
+
console.log(
|
|
490
|
+
`Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`
|
|
491
|
+
);
|
|
492
|
+
const result = await Promise.race([associatedWorker.worker(polledWorker.inputParam), timeoutPromise]);
|
|
479
493
|
workerResponse = {
|
|
480
494
|
...workerResponse,
|
|
481
495
|
output: {
|
|
@@ -519,17 +533,19 @@ function safeStringifyError(error) {
|
|
|
519
533
|
try {
|
|
520
534
|
if (error instanceof Error) {
|
|
521
535
|
const plainError = {
|
|
536
|
+
...error,
|
|
522
537
|
name: error.name,
|
|
523
538
|
message: error.message,
|
|
524
|
-
stack: error.stack
|
|
525
|
-
...error
|
|
526
|
-
// Include enumerable custom properties if they exist
|
|
539
|
+
stack: error.stack
|
|
527
540
|
};
|
|
528
541
|
return JSON.stringify(plainError);
|
|
529
542
|
}
|
|
530
543
|
return JSON.stringify(error);
|
|
531
544
|
} catch (stringifyError) {
|
|
532
|
-
|
|
545
|
+
if (stringifyError instanceof Error) {
|
|
546
|
+
return `Error stringification failed: ${stringifyError.message}`;
|
|
547
|
+
}
|
|
548
|
+
return "Error stringification failed: An unknown error occurred during stringification.";
|
|
533
549
|
}
|
|
534
550
|
}
|
|
535
551
|
async function startPollingWorkers(apiClient, workers, intervalMs = 5e3) {
|
|
@@ -564,15 +580,12 @@ var runProcessSync = async (apiClient, ProcessRequestData2) => {
|
|
|
564
580
|
};
|
|
565
581
|
var runProcessAsync = async (apiClient, ProcessRequestData2) => {
|
|
566
582
|
try {
|
|
567
|
-
const response = await apiClient.post(
|
|
568
|
-
|
|
569
|
-
{
|
|
570
|
-
|
|
571
|
-
params: {
|
|
572
|
-
clientId: apiClient.getClientId()
|
|
573
|
-
}
|
|
583
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/runAsync`, {
|
|
584
|
+
data: ProcessRequestData2,
|
|
585
|
+
params: {
|
|
586
|
+
clientId: apiClient.getClientId()
|
|
574
587
|
}
|
|
575
|
-
);
|
|
588
|
+
});
|
|
576
589
|
console.log("Response:", response);
|
|
577
590
|
return response.data;
|
|
578
591
|
} catch (error) {
|
|
@@ -585,10 +598,7 @@ var getProcessData = async (apiClient, processId, includeSteps = false) => {
|
|
|
585
598
|
throw new Error("Process ID cannot be null");
|
|
586
599
|
}
|
|
587
600
|
try {
|
|
588
|
-
const response = await apiClient.get(
|
|
589
|
-
`${PROCESS_PREFIX}/context/${processId}`,
|
|
590
|
-
{ includeSteps }
|
|
591
|
-
);
|
|
601
|
+
const response = await apiClient.get(`${PROCESS_PREFIX}/context/${processId}`, { includeSteps });
|
|
592
602
|
return response.data;
|
|
593
603
|
} catch (error) {
|
|
594
604
|
console.error("Error occurred while fetching process record: ", error);
|
|
@@ -600,9 +610,7 @@ var getStepData = async (apiClient, stepId) => {
|
|
|
600
610
|
throw new Error("Step ID cannot be null or undefined");
|
|
601
611
|
}
|
|
602
612
|
try {
|
|
603
|
-
const response = await apiClient.get(
|
|
604
|
-
`${PROCESS_PREFIX}/stepContext/${stepId}`
|
|
605
|
-
);
|
|
613
|
+
const response = await apiClient.get(`${PROCESS_PREFIX}/stepContext/${stepId}`);
|
|
606
614
|
return response.data;
|
|
607
615
|
} catch (error) {
|
|
608
616
|
console.log("Error occurred while getStepData: ", error);
|
|
@@ -611,52 +619,37 @@ var getStepData = async (apiClient, stepId) => {
|
|
|
611
619
|
};
|
|
612
620
|
var bulkTerminate = async (apiClient, processIds, reason) => {
|
|
613
621
|
try {
|
|
614
|
-
const response = await apiClient.post(
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
data: processIds
|
|
619
|
-
}
|
|
620
|
-
);
|
|
622
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/bulkTerminate`, {
|
|
623
|
+
params: { reason },
|
|
624
|
+
data: processIds
|
|
625
|
+
});
|
|
621
626
|
return response.data;
|
|
622
627
|
} catch (error) {
|
|
623
628
|
const err = error;
|
|
624
|
-
throw new Error(
|
|
625
|
-
`Error occurred while terminating processes: ${err.message || error}`
|
|
626
|
-
);
|
|
629
|
+
throw new Error(`Error occurred while terminating processes: ${err.message || error}`);
|
|
627
630
|
}
|
|
628
631
|
};
|
|
629
632
|
var bulkResume = async (apiClient, processIds) => {
|
|
630
633
|
try {
|
|
631
|
-
const response = await apiClient.post(
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
data: processIds
|
|
635
|
-
}
|
|
636
|
-
);
|
|
634
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/bulkResume`, {
|
|
635
|
+
data: processIds
|
|
636
|
+
});
|
|
637
637
|
return response.data;
|
|
638
638
|
} catch (error) {
|
|
639
639
|
const err = error;
|
|
640
|
-
throw new Error(
|
|
641
|
-
`Error occurred while resuming processes: ${err.message || error}`
|
|
642
|
-
);
|
|
640
|
+
throw new Error(`Error occurred while resuming processes: ${err.message || error}`);
|
|
643
641
|
}
|
|
644
642
|
};
|
|
645
643
|
var bulkReviewed = async (apiClient, processIds, reason) => {
|
|
646
644
|
try {
|
|
647
|
-
const response = await apiClient.post(
|
|
648
|
-
|
|
649
|
-
{
|
|
650
|
-
|
|
651
|
-
params: { reason }
|
|
652
|
-
}
|
|
653
|
-
);
|
|
645
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/bulkReviewed`, {
|
|
646
|
+
data: processIds,
|
|
647
|
+
params: { reason }
|
|
648
|
+
});
|
|
654
649
|
return response.data;
|
|
655
650
|
} catch (error) {
|
|
656
651
|
const err = error;
|
|
657
|
-
throw new Error(
|
|
658
|
-
`Error occurred while marking processes as reviewed: ${err.message || error}`
|
|
659
|
-
);
|
|
652
|
+
throw new Error(`Error occurred while marking processes as reviewed: ${err.message || error}`);
|
|
660
653
|
}
|
|
661
654
|
};
|
|
662
655
|
var rerun = async (apiClient, processId, version) => {
|
|
@@ -673,14 +666,10 @@ var rerun = async (apiClient, processId, version) => {
|
|
|
673
666
|
return response.data;
|
|
674
667
|
} catch (error) {
|
|
675
668
|
if ((0, import_axios2.isAxiosError)(error)) {
|
|
676
|
-
throw new Error(
|
|
677
|
-
`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`
|
|
678
|
-
);
|
|
669
|
+
throw new Error(`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`);
|
|
679
670
|
} else {
|
|
680
671
|
const err = error;
|
|
681
|
-
throw new Error(
|
|
682
|
-
`Unexpected error during rerun process: ${err.message || err}`
|
|
683
|
-
);
|
|
672
|
+
throw new Error(`Unexpected error during rerun process: ${err.message || err}`);
|
|
684
673
|
}
|
|
685
674
|
}
|
|
686
675
|
};
|
|
@@ -691,24 +680,16 @@ var searchProcessExecutions = async (apiClient, params) => {
|
|
|
691
680
|
if (params.endTimeEpoch !== void 0 && params.endTimeEpoch !== 0)
|
|
692
681
|
queryParams.set("endTimeEpoch", (params.endTimeEpoch || 0).toString());
|
|
693
682
|
if (params.namespace) queryParams.set("namespace", params.namespace);
|
|
694
|
-
if (params.names && params.names.length)
|
|
695
|
-
|
|
696
|
-
if (params.processIds && params.processIds.length)
|
|
697
|
-
queryParams.set("processIds", params.processIds.join(","));
|
|
683
|
+
if (params.names && params.names.length) queryParams.set("names", params.names.join(","));
|
|
684
|
+
if (params.processIds && params.processIds.length) queryParams.set("processIds", params.processIds.join(","));
|
|
698
685
|
if (params.correlationIds && params.correlationIds.length)
|
|
699
686
|
queryParams.set("correlationIds", params.correlationIds.join(","));
|
|
700
|
-
if (params.requestIds && params.requestIds.length)
|
|
701
|
-
|
|
702
|
-
if (params.
|
|
703
|
-
queryParams.set("statuses", params.statuses.join(","));
|
|
704
|
-
if (params.triggerTypes && params.triggerTypes.length)
|
|
705
|
-
queryParams.set("triggerTypes", params.triggerTypes.join(","));
|
|
687
|
+
if (params.requestIds && params.requestIds.length) queryParams.set("requestIds", params.requestIds.join(","));
|
|
688
|
+
if (params.statuses && params.statuses.length) queryParams.set("statuses", params.statuses.join(","));
|
|
689
|
+
if (params.triggerTypes && params.triggerTypes.length) queryParams.set("triggerTypes", params.triggerTypes.join(","));
|
|
706
690
|
const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));
|
|
707
691
|
try {
|
|
708
|
-
const response = await apiClient.get(
|
|
709
|
-
`${PROCESS_PREFIX}/api/stats/process/search`,
|
|
710
|
-
updatedParams
|
|
711
|
-
);
|
|
692
|
+
const response = await apiClient.get(`api/stats/process/search`, updatedParams);
|
|
712
693
|
console.log("Response:", response);
|
|
713
694
|
return response.data;
|
|
714
695
|
} catch (error) {
|
|
@@ -718,14 +699,11 @@ var searchProcessExecutions = async (apiClient, params) => {
|
|
|
718
699
|
};
|
|
719
700
|
var invokeApiMappingGet = async (apiClient, endpoint, id, correlationId, apiCallType) => {
|
|
720
701
|
try {
|
|
721
|
-
const response = await apiClient.get(
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
apiCallType
|
|
727
|
-
}
|
|
728
|
-
);
|
|
702
|
+
const response = await apiClient.get(`${PROCESS_PREFIX}/api/call/${endpoint}`, {
|
|
703
|
+
id,
|
|
704
|
+
correlationId,
|
|
705
|
+
apiCallType
|
|
706
|
+
});
|
|
729
707
|
console.log("Response:", response);
|
|
730
708
|
return response.data;
|
|
731
709
|
} catch (error) {
|
|
@@ -735,17 +713,14 @@ var invokeApiMappingGet = async (apiClient, endpoint, id, correlationId, apiCall
|
|
|
735
713
|
};
|
|
736
714
|
var invokeApiMappingPost = async (apiClient, endpoint, input, id, correlationId, apiCallType = "ASYNC" /* ASYNC */) => {
|
|
737
715
|
try {
|
|
738
|
-
const response = await apiClient.post(
|
|
739
|
-
|
|
740
|
-
{
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
correlationId,
|
|
745
|
-
apiCallType
|
|
746
|
-
}
|
|
716
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/api/call/${endpoint}`, {
|
|
717
|
+
data: input,
|
|
718
|
+
params: {
|
|
719
|
+
id,
|
|
720
|
+
correlationId,
|
|
721
|
+
apiCallType
|
|
747
722
|
}
|
|
748
|
-
);
|
|
723
|
+
});
|
|
749
724
|
return response.data;
|
|
750
725
|
} catch (error) {
|
|
751
726
|
console.error("Error occurred while invoking API Mapping POST: ", error);
|
|
@@ -804,23 +779,10 @@ var UnmeshedClient = class {
|
|
|
804
779
|
return searchProcessExecutions(this.client, params);
|
|
805
780
|
}
|
|
806
781
|
invokeApiMappingGet(apiClient, endpoint, id, correlationId, apiCallType) {
|
|
807
|
-
return invokeApiMappingGet(
|
|
808
|
-
apiClient,
|
|
809
|
-
endpoint,
|
|
810
|
-
id,
|
|
811
|
-
correlationId,
|
|
812
|
-
apiCallType
|
|
813
|
-
);
|
|
782
|
+
return invokeApiMappingGet(apiClient, endpoint, id, correlationId, apiCallType);
|
|
814
783
|
}
|
|
815
784
|
invokeApiMappingPost(endpoint, input, id, correlationId, apiCallType) {
|
|
816
|
-
return invokeApiMappingPost(
|
|
817
|
-
this.client,
|
|
818
|
-
endpoint,
|
|
819
|
-
input,
|
|
820
|
-
id,
|
|
821
|
-
correlationId,
|
|
822
|
-
apiCallType
|
|
823
|
-
);
|
|
785
|
+
return invokeApiMappingPost(this.client, endpoint, input, id, correlationId, apiCallType);
|
|
824
786
|
}
|
|
825
787
|
reNewRegistration(params) {
|
|
826
788
|
return renewRegistration(this.client, params);
|