@unmeshed/sdk 1.0.15 → 1.0.17
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 +128 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -2
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Unmeshed Javascript / Typescript SDK
|
|
2
|
+
|
|
3
|
+
This README will guide you on how to set up Unmeshed credentials, run workers, and get started with the Unmeshed
|
|
4
|
+
platform. Read more about unmeshed on https://unmeshed.io/
|
|
5
|
+
|
|
6
|
+
## About Unmeshed
|
|
7
|
+
|
|
8
|
+
Unmeshed is a ⚡ fast, low latency orchestration platform, that can be used to build 🛠️, run 🏃, and scale 📈 API and
|
|
9
|
+
microservices orchestration, scheduled jobs ⏰, and more with ease. Learn more on
|
|
10
|
+
our [🌍 main website](https://unmeshed.io) or explore
|
|
11
|
+
the [📖 documentation overview](https://unmeshed.io/docs/concepts/overview).
|
|
12
|
+
|
|
13
|
+
Unmeshed is built by the ex-founders of Netflix Conductor. This is the next gen platform built using similar principles
|
|
14
|
+
but is blazing fast and covers many more use cases.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Installing the Unmeshed SDK
|
|
19
|
+
|
|
20
|
+
To use Unmeshed in your project, install the SDK using your preferred package manager:
|
|
21
|
+
|
|
22
|
+
### Using npm:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @unmeshed/sdk
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Using Yarn:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
yarn add @unmeshed/sdk
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Setting Up Unmeshed Credentials
|
|
35
|
+
|
|
36
|
+
To use the Unmeshed SDK in your Node.js app, you need to initialize the `UnmeshedClient` with your credentials. Replace
|
|
37
|
+
the placeholder values below with your actual credentials:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
const {UnmeshedClient} = require("@unmeshed/sdk");
|
|
41
|
+
|
|
42
|
+
const unmeshedClient = new UnmeshedClient({
|
|
43
|
+
baseUrl: 'http://localhost', // Replace with your Unmeshed API endpoint 🌐
|
|
44
|
+
port: 8080, // Replace with your Unmeshed API port 🚪
|
|
45
|
+
authToken: 'your-auth-token', // Replace with your API 🔒 auth token
|
|
46
|
+
clientId: 'your-client-id' // Replace with your API 🆔 client ID
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> **Note:** Do not expose these credentials in a browser 🌐. For browser implementations, leverage webhooks and user
|
|
51
|
+
> tokens 🔑 directly.
|
|
52
|
+
|
|
53
|
+
You can get started with Unmeshed by visiting our [📘 Get Started Guide](https://unmeshed.io/docs/concepts/overview).
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Running a Worker
|
|
58
|
+
|
|
59
|
+
A worker in Unmeshed processes 🌀 tasks asynchronously based on workflows or process definitions. Below is an example of
|
|
60
|
+
defining and starting a worker:
|
|
61
|
+
|
|
62
|
+
### Step 1: Define a Worker Function
|
|
63
|
+
|
|
64
|
+
A worker function processes incoming tasks and returns an output:
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
let workerFunction = (input) => {
|
|
68
|
+
return new Promise((resolve) => {
|
|
69
|
+
const output = {
|
|
70
|
+
...input || {},
|
|
71
|
+
"ranAt": new Date() // Add the current timestamp to the output 🕒
|
|
72
|
+
};
|
|
73
|
+
resolve(output);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 2: Register the Worker
|
|
79
|
+
|
|
80
|
+
Define the worker configuration and register it with the `UnmeshedClient`:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
const worker = {
|
|
84
|
+
worker: workerFunction,
|
|
85
|
+
namespace: 'default', // Namespace for the worker 🗂️
|
|
86
|
+
name: 'test-node-worker', // Unique name for the worker 🏷️
|
|
87
|
+
maxInProgress: 500 // Maximum number of in-progress tasks ⏳
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
unmeshedClient.startPolling([worker]);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
You can run as many workers as you want.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Et voilà — that's it! Now whenever a process definition or worker reaches this step with name test-node-worker, it will run your function
|
|
98
|
+
|
|
99
|
+
> The `startPolling` method starts the worker to listen 👂 for tasks continuously.
|
|
100
|
+
|
|
101
|
+
### Step 3: Start Your Application
|
|
102
|
+
|
|
103
|
+
When you run your Node.js app, and the worker will start polling for tasks automatically 🤖.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Additional Resources
|
|
108
|
+
|
|
109
|
+
- **[📖 Workers Documentation](https://unmeshed.io/docs/concepts/workers):** Learn more about workers and how to use them
|
|
110
|
+
effectively.
|
|
111
|
+
- **Use Case Highlights:**
|
|
112
|
+
- [🌐 API Orchestration](https://unmeshed.io/docs/use-cases/api-orchestration)
|
|
113
|
+
- [🧩 Microservices Orchestration](https://unmeshed.io/docs/use-cases/microservices-orchestration)
|
|
114
|
+
- [⏰ Scheduled Jobs](https://unmeshed.io/docs/use-cases/scheduled-jobs)
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Example Applications
|
|
119
|
+
|
|
120
|
+
1. [express-server-example](https://github.com/unmeshed/express-server-example)
|
|
121
|
+
2. [typescript-sdk-example](https://github.com/unmeshed/typescript-sdk-example)
|
|
122
|
+
3. [javascript-sdk-example](https://github.com/unmeshed/javascript-sdk-example)
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
For more details, visit our [📖 documentation](https://unmeshed.io/docs/concepts/overview). If you encounter issues, feel
|
|
127
|
+
free to reach out or open an issue in this repository!
|
|
128
|
+
|
package/dist/index.d.mts
CHANGED
|
@@ -355,7 +355,7 @@ declare class UnmeshedClient {
|
|
|
355
355
|
startPolling(workers: UnmeshedWorkerConfig[]): void;
|
|
356
356
|
runProcessSync(ProcessRequestData: ProcessRequestData): Promise<ProcessData>;
|
|
357
357
|
runProcessAsync(ProcessRequestData: ProcessRequestData): Promise<ProcessData>;
|
|
358
|
-
getProcessData(processId: number): Promise<ProcessData>;
|
|
358
|
+
getProcessData(processId: number, includeSteps: boolean): Promise<ProcessData>;
|
|
359
359
|
getStepData(stepId: number): Promise<StepData>;
|
|
360
360
|
bulkTerminate(processIds: number[], reason?: string): Promise<ProcessActionResponseData>;
|
|
361
361
|
bulkResume(processIds: number[]): Promise<ProcessActionResponseData>;
|
package/dist/index.d.ts
CHANGED
|
@@ -355,7 +355,7 @@ declare class UnmeshedClient {
|
|
|
355
355
|
startPolling(workers: UnmeshedWorkerConfig[]): void;
|
|
356
356
|
runProcessSync(ProcessRequestData: ProcessRequestData): Promise<ProcessData>;
|
|
357
357
|
runProcessAsync(ProcessRequestData: ProcessRequestData): Promise<ProcessData>;
|
|
358
|
-
getProcessData(processId: number): Promise<ProcessData>;
|
|
358
|
+
getProcessData(processId: number, includeSteps: boolean): Promise<ProcessData>;
|
|
359
359
|
getStepData(stepId: number): Promise<StepData>;
|
|
360
360
|
bulkTerminate(processIds: number[], reason?: string): Promise<ProcessActionResponseData>;
|
|
361
361
|
bulkResume(processIds: number[]): Promise<ProcessActionResponseData>;
|
package/dist/index.js
CHANGED
|
@@ -344,7 +344,7 @@ var BlockingQueue = class {
|
|
|
344
344
|
async function registerPolling(apiClient, data) {
|
|
345
345
|
const attempt = async () => {
|
|
346
346
|
try {
|
|
347
|
-
const response = await apiClient.put(
|
|
347
|
+
const response = await apiClient.put(`/api/clients/register`, {
|
|
348
348
|
data
|
|
349
349
|
});
|
|
350
350
|
console.log("Successfully renewed registration for workers", data);
|
|
@@ -361,7 +361,7 @@ async function registerPolling(apiClient, data) {
|
|
|
361
361
|
}
|
|
362
362
|
async function pollWorker(apiClient, data) {
|
|
363
363
|
try {
|
|
364
|
-
const response = await apiClient.post(
|
|
364
|
+
const response = await apiClient.post(`/api/clients/poll`, { data });
|
|
365
365
|
if (response.data && response.data.length > 0) {
|
|
366
366
|
console.log(`Received ${response.data.length} work requests`);
|
|
367
367
|
}
|
|
@@ -382,7 +382,7 @@ async function postWorkerResponse(apiClient, workResponses) {
|
|
|
382
382
|
}, {});
|
|
383
383
|
const resultString = Object.entries(grouped).map(([status, stepIds]) => `${status}: [${stepIds.join(", ")}]`).join(", ");
|
|
384
384
|
console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`);
|
|
385
|
-
const response = await apiClient.post(
|
|
385
|
+
const response = await apiClient.post(`/api/clients/bulkResults`, {
|
|
386
386
|
data: workResponses
|
|
387
387
|
});
|
|
388
388
|
return response.data;
|
|
@@ -546,10 +546,10 @@ async function startPollingWorkers(apiClient, workers, intervalMs = 5e3) {
|
|
|
546
546
|
|
|
547
547
|
// src/apis/processClientImpl.ts
|
|
548
548
|
var import_axios2 = require("axios");
|
|
549
|
-
var
|
|
549
|
+
var PROCESS_PREFIX = "api/process";
|
|
550
550
|
var runProcessSync = async (apiClient, ProcessRequestData2) => {
|
|
551
551
|
try {
|
|
552
|
-
const response = await apiClient.post(
|
|
552
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/runSync`, {
|
|
553
553
|
data: ProcessRequestData2,
|
|
554
554
|
params: {
|
|
555
555
|
clientId: apiClient.getClientId()
|
|
@@ -565,7 +565,7 @@ var runProcessSync = async (apiClient, ProcessRequestData2) => {
|
|
|
565
565
|
var runProcessAsync = async (apiClient, ProcessRequestData2) => {
|
|
566
566
|
try {
|
|
567
567
|
const response = await apiClient.post(
|
|
568
|
-
|
|
568
|
+
`${PROCESS_PREFIX}/runAsync`,
|
|
569
569
|
{
|
|
570
570
|
data: ProcessRequestData2,
|
|
571
571
|
params: {
|
|
@@ -580,13 +580,14 @@ var runProcessAsync = async (apiClient, ProcessRequestData2) => {
|
|
|
580
580
|
throw error;
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
var getProcessData = async (apiClient, processId) => {
|
|
584
|
-
if (processId
|
|
583
|
+
var getProcessData = async (apiClient, processId, includeSteps = false) => {
|
|
584
|
+
if (!processId) {
|
|
585
585
|
throw new Error("Process ID cannot be null");
|
|
586
586
|
}
|
|
587
587
|
try {
|
|
588
588
|
const response = await apiClient.get(
|
|
589
|
-
|
|
589
|
+
`${PROCESS_PREFIX}/context/${processId}`,
|
|
590
|
+
{ includeSteps }
|
|
590
591
|
);
|
|
591
592
|
return response.data;
|
|
592
593
|
} catch (error) {
|
|
@@ -595,12 +596,12 @@ var getProcessData = async (apiClient, processId) => {
|
|
|
595
596
|
}
|
|
596
597
|
};
|
|
597
598
|
var getStepData = async (apiClient, stepId) => {
|
|
598
|
-
if (stepId
|
|
599
|
+
if (!stepId) {
|
|
599
600
|
throw new Error("Step ID cannot be null or undefined");
|
|
600
601
|
}
|
|
601
602
|
try {
|
|
602
603
|
const response = await apiClient.get(
|
|
603
|
-
|
|
604
|
+
`${PROCESS_PREFIX}/stepContext/${stepId}`
|
|
604
605
|
);
|
|
605
606
|
return response.data;
|
|
606
607
|
} catch (error) {
|
|
@@ -611,7 +612,7 @@ var getStepData = async (apiClient, stepId) => {
|
|
|
611
612
|
var bulkTerminate = async (apiClient, processIds, reason) => {
|
|
612
613
|
try {
|
|
613
614
|
const response = await apiClient.post(
|
|
614
|
-
|
|
615
|
+
`${PROCESS_PREFIX}/bulkTerminate`,
|
|
615
616
|
{
|
|
616
617
|
params: { reason },
|
|
617
618
|
data: processIds
|
|
@@ -628,7 +629,7 @@ var bulkTerminate = async (apiClient, processIds, reason) => {
|
|
|
628
629
|
var bulkResume = async (apiClient, processIds) => {
|
|
629
630
|
try {
|
|
630
631
|
const response = await apiClient.post(
|
|
631
|
-
|
|
632
|
+
`${PROCESS_PREFIX}/bulkResume`,
|
|
632
633
|
{
|
|
633
634
|
data: processIds
|
|
634
635
|
}
|
|
@@ -644,7 +645,7 @@ var bulkResume = async (apiClient, processIds) => {
|
|
|
644
645
|
var bulkReviewed = async (apiClient, processIds, reason) => {
|
|
645
646
|
try {
|
|
646
647
|
const response = await apiClient.post(
|
|
647
|
-
|
|
648
|
+
`${PROCESS_PREFIX}/bulkReviewed`,
|
|
648
649
|
{
|
|
649
650
|
data: processIds,
|
|
650
651
|
params: { reason }
|
|
@@ -667,7 +668,7 @@ var rerun = async (apiClient, processId, clientId, version) => {
|
|
|
667
668
|
params["version"] = version;
|
|
668
669
|
}
|
|
669
670
|
try {
|
|
670
|
-
const response = await apiClient.post(
|
|
671
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/rerun`, {
|
|
671
672
|
params
|
|
672
673
|
});
|
|
673
674
|
return response.data;
|
|
@@ -706,7 +707,7 @@ var searchProcessExecutions = async (apiClient, params) => {
|
|
|
706
707
|
const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));
|
|
707
708
|
try {
|
|
708
709
|
const response = await apiClient.get(
|
|
709
|
-
|
|
710
|
+
`${PROCESS_PREFIX}/api/stats/process/search`,
|
|
710
711
|
updatedParams
|
|
711
712
|
);
|
|
712
713
|
console.log("Response:", response);
|
|
@@ -719,7 +720,7 @@ var searchProcessExecutions = async (apiClient, params) => {
|
|
|
719
720
|
var invokeApiMappingGet = async (apiClient, endpoint, id, correlationId, apiCallType) => {
|
|
720
721
|
try {
|
|
721
722
|
const response = await apiClient.get(
|
|
722
|
-
|
|
723
|
+
`${PROCESS_PREFIX}/api/call/${endpoint}`,
|
|
723
724
|
{
|
|
724
725
|
id,
|
|
725
726
|
correlationId,
|
|
@@ -736,7 +737,7 @@ var invokeApiMappingGet = async (apiClient, endpoint, id, correlationId, apiCall
|
|
|
736
737
|
var invokeApiMappingPost = async (apiClient, endpoint, input, id, correlationId, apiCallType = "ASYNC" /* ASYNC */) => {
|
|
737
738
|
try {
|
|
738
739
|
const response = await apiClient.post(
|
|
739
|
-
|
|
740
|
+
`${PROCESS_PREFIX}/api/call/${endpoint}`,
|
|
740
741
|
{
|
|
741
742
|
data: input,
|
|
742
743
|
params: {
|
|
@@ -776,15 +777,14 @@ var UnmeshedClient = class {
|
|
|
776
777
|
startPolling(workers) {
|
|
777
778
|
startPollingWorkers(this.client, workers);
|
|
778
779
|
}
|
|
779
|
-
// Other methods for interacting with Unmeshed API
|
|
780
780
|
runProcessSync(ProcessRequestData2) {
|
|
781
781
|
return runProcessSync(this.client, ProcessRequestData2);
|
|
782
782
|
}
|
|
783
783
|
runProcessAsync(ProcessRequestData2) {
|
|
784
784
|
return runProcessAsync(this.client, ProcessRequestData2);
|
|
785
785
|
}
|
|
786
|
-
getProcessData(processId) {
|
|
787
|
-
return getProcessData(this.client, processId);
|
|
786
|
+
getProcessData(processId, includeSteps) {
|
|
787
|
+
return getProcessData(this.client, processId, includeSteps);
|
|
788
788
|
}
|
|
789
789
|
getStepData(stepId) {
|
|
790
790
|
return getStepData(this.client, stepId);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/apis/unmeshedApiClient.ts","../src/utils/unmeshedCommonUtils.ts","../src/types/index.ts","../src/apis/queuedWorker.ts","../src/apis/pollerClientImpl.ts","../src/apis/processClientImpl.ts","../src/apis/registrationClientImpl.ts"],"sourcesContent":["import {\n ApiCallType,\n ProcessRequestData,\n ProcessSearchRequest,\n RenewRegistrationParams,\n UnmeshedClientConfig,\n UnmeshedWorkerConfig,\n} from \"./types\";\nimport {UnmeshedApiClient} from \"./apis/unmeshedApiClient\";\nimport {startPollingWorkers} from \"./apis/pollerClientImpl\";\nimport {\n bulkResume,\n bulkReviewed,\n bulkTerminate,\n getProcessData,\n getStepData,\n invokeApiMappingGet,\n invokeApiMappingPost,\n rerun,\n runProcessAsync,\n runProcessSync,\n searchProcessExecutions,\n} from \"./apis/processClientImpl\";\nimport {renewRegistration} from \"./apis/registrationClientImpl\";\n\nexport class UnmeshedClient {\n private client: UnmeshedApiClient;\n\n constructor(config: UnmeshedClientConfig) {\n this.client = new UnmeshedApiClient(config);\n }\n\n startPolling(workers: UnmeshedWorkerConfig[]) {\n startPollingWorkers(this.client, workers);\n }\n\n // Other methods for interacting with Unmeshed API\n\n runProcessSync(ProcessRequestData: ProcessRequestData) {\n return runProcessSync(this.client, ProcessRequestData);\n }\n\n runProcessAsync(ProcessRequestData: ProcessRequestData) {\n return runProcessAsync(this.client, ProcessRequestData);\n }\n\n getProcessData(processId: number) {\n return getProcessData(this.client, processId);\n }\n\n getStepData(stepId: number) {\n return getStepData(this.client, stepId);\n }\n\n bulkTerminate(processIds: number[], reason?: string) {\n return bulkTerminate(this.client, processIds, reason);\n }\n\n bulkResume(processIds: number[]) {\n return bulkResume(this.client, processIds);\n }\n\n bulkReviewed(processIds: number[], reason?: string) {\n return bulkReviewed(this.client, processIds, reason);\n }\n\n reRun(processId: number, clientId: string, version?: number) {\n return rerun(this.client, processId, clientId, version);\n }\n\n searchProcessExecution(params: ProcessSearchRequest) {\n return searchProcessExecutions(this.client, params);\n }\n\n invokeApiMappingGet(\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingGet(\n apiClient,\n endpoint,\n id,\n correlationId,\n apiCallType\n );\n }\n\n invokeApiMappingPost(\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingPost(\n this.client,\n endpoint,\n input,\n id,\n correlationId,\n apiCallType\n );\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n}\n\nexport * from \"./types\";\n","import axios, {AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders} from \"axios\";\nimport {\n ApiResponse,\n ClientRequestConfig, FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from \"../types\";\nimport {UnmeshedCommonUtils} from \"../utils/unmeshedCommonUtils\";\n\nexport class UnmeshedApiClient {\n\n private axiosInstance: AxiosInstance | null = null;\n private clientId: string | undefined = undefined;\n private _config: FinalUnmeshedClientConfig;\n\n constructor(unmeshedClientConfig: UnmeshedClientConfig) {\n console.log(\"Initializing Unmeshed ApiClient\");\n\n this._config = createUnmeshedClientConfig(unmeshedClientConfig);\n\n console.log(this._config);\n\n this.clientId = this._config.clientId;\n\n if (!this._config.baseUrl) {\n throw new Error(\"baseUrl is required\");\n }\n\n const baseURL = this._config.port ? `${this._config.baseUrl}:${this._config.port}` : this._config.baseUrl;\n\n this.axiosInstance = axios.create({\n baseURL,\n timeout: this._config.timeout,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer client.sdk.${this._config.clientId}.${UnmeshedCommonUtils.createSecureHash(\n this._config.authToken\n )}`,\n } as RawAxiosRequestHeaders,\n });\n }\n\n private async handleRequest<T>({\n method,\n endpoint,\n params,\n data,\n config,\n }: HandleRequestConfig): Promise<ApiResponse<T>> {\n\n if (!this.axiosInstance) {\n throw new Error(\"ApiClient must be initialized before making requests\");\n }\n\n try {\n const response: AxiosResponse<T> = await this.axiosInstance.request<T>({\n method,\n url: endpoint,\n params,\n data,\n ...config,\n } as AxiosRequestConfig);\n\n return {\n data: response.data,\n status: response.status,\n headers: response.headers as Record<string, string>,\n };\n } catch (error) {\n if (axios.isAxiosError(error)) {\n console.error(\"Request failed:\", error.message);\n throw this.handleError(error);\n }\n console.error(\"Unexpected error:\", (error as Error).message);\n throw error;\n }\n }\n\n private handleError(error: AxiosError): Error {\n console.error(\"Error details:\", {\n message: error.message,\n status: error.response?.status,\n data: error.response?.data,\n });\n\n let response = error?.response?.data as ErrorResponse;\n if (response?.errorMessage) {\n return new Error(`${response.errorMessage} [Status code: ${error.response?.status || ''}]`)\n }\n\n return new Error(error.message, {cause: error.response?.data || {}});\n }\n\n public async get<T = any>(\n endpoint: string,\n params?: QueryParams,\n config?: RequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"get\",\n endpoint: endpoint,\n params: params,\n config: config,\n });\n }\n\n public async post<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"post\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async put<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"put\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async delete<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"delete\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public getClientId(): string | undefined {\n return this.clientId;\n }\n\n\n get config(): FinalUnmeshedClientConfig {\n return this._config;\n }\n}\n\ninterface ErrorResponse {\n errorMessage?: string;\n [key: string]: any; // To allow other unexpected properties\n}\n\nexport function createUnmeshedClientConfig(config: UnmeshedClientConfig): Required<FinalUnmeshedClientConfig> {\n return {\n baseUrl: config.baseUrl,\n clientId: config.clientId,\n authToken: config.authToken,\n port: config.port ?? 443,\n timeout: config.timeout ?? 5000,\n pollInterval: config.pollInterval ?? 100,\n apiWorkerTimeout: config.apiWorkerTimeout ?? 10000,\n pollTimeout: config.pollTimeout ?? 10000,\n responsePollInterval: config.responsePollInterval ?? 100,\n responsePollTimeout: config.responsePollTimeout ?? 10000,\n responseBatchSize: config.responseBatchSize ?? 50,\n };\n}\n","import { createHash } from \"crypto\";\n\nexport class UnmeshedCommonUtils {\n static createSecureHash(input: string): string {\n try {\n const hash = createHash(\"sha256\");\n hash.update(input, \"utf8\");\n return hash.digest(\"hex\");\n } catch (e) {\n throw new Error(\"Error creating hash\");\n }\n }\n}\n","import { AxiosRequestConfig } from \"axios\";\n\nexport enum ApiCallType {\n SYNC = \"SYNC\",\n ASYNC = \"ASYNC\",\n STREAM = \"STREAM\",\n}\n\nexport interface ApiMappingData {\n endpoint: string;\n processDefNamespace: string;\n processDefName: string;\n processDefVersion: number;\n authType: string;\n authClaims: string;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n}\n\nexport type ApiMappingWebhookData = {\n endpoint: string;\n name: string;\n uniqueId: string;\n urlSecret: string;\n description: string;\n userIdentifier: string;\n webhookSource: WebhookSource;\n webhookSourceConfig: Record<string, string>;\n expiryDate: Date;\n userType: SQAuthUserType;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n};\n\nexport enum WebhookSource {\n MS_TEAMS = \"MS_TEAMS\",\n NOT_DEFINED = \"NOT_DEFINED\",\n}\n\nexport enum SQAuthUserType {\n USER = \"USER\",\n API = \"API\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport enum StepType {\n WORKER = \"WORKER\",\n HTTP = \"HTTP\",\n WAIT = \"WAIT\",\n FAIL = \"FAIL\",\n PYTHON = \"PYTHON\",\n JAVASCRIPT = \"JAVASCRIPT\",\n JQ = \"JQ\",\n MANAGED = \"MANAGED\",\n BUILTIN = \"BUILTIN\",\n NOOP = \"NOOP\",\n PERSISTED_STATE = \"PERSISTED_STATE\",\n DEPENDSON = \"DEPENDSON\",\n INTEGRATION = \"INTEGRATION\",\n EXIT = \"EXIT\",\n SUB_PROCESS = \"SUB_PROCESS\",\n LIST = \"LIST\",\n PARALLEL = \"PARALLEL\",\n FOREACH = \"FOREACH\",\n SWITCH = \"SWITCH\",\n}\n\nexport enum StepStatus {\n PENDING = \"PENDING\",\n SCHEDULED = \"SCHEDULED\",\n RUNNING = \"RUNNING\",\n PAUSED = \"PAUSED\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n SKIPPED = \"SKIPPED\",\n CANCELLED = \"CANCELLED\",\n}\n\nexport enum ProcessStatus {\n RUNNING = \"RUNNING\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n CANCELLED = \"CANCELLED\",\n TERMINATED = \"TERMINATED\",\n REVIEWED = \"REVIEWED\",\n}\n\nexport enum ProcessTriggerType {\n MANUAL = \"MANUAL\",\n SCHEDULED = \"SCHEDULED\",\n API_MAPPING = \"API_MAPPING\",\n WEBHOOK = \"WEBHOOK\",\n API = \"API\",\n SUB_PROCESS = \"SUB_PROCESS\",\n}\n\nexport enum ProcessType {\n STANDARD = \"STANDARD\",\n DYNAMIC = \"DYNAMIC\",\n API_ORCHESTRATION = \"API_ORCHESTRATION\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport type ClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n};\n\nexport type FullClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n tokenValue: string;\n};\n\nexport type StepQueueNameData = {\n orgId: number;\n namespace: string;\n stepType: StepType;\n name: string;\n};\n\nexport type ProcessActionResponseData = {\n count: number;\n details: ProcessActionResponseDetailData[];\n};\n\nexport type ProcessActionResponseDetailData = {\n id: string;\n message: string;\n error: string;\n};\n\nexport type ProcessData = {\n processId: number;\n processType: ProcessType;\n triggerType: ProcessTriggerType;\n namespace: string;\n name: string;\n version: number | null;\n processDefinitionHistoryId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n stepIds: StepId[];\n stepDataById: Record<number, StepData>;\n created: number;\n updated: number;\n createdBy: string;\n};\n\nexport type StepData = {\n id: number;\n processId: number;\n ref: string;\n parentId: number | null;\n parentRef: string | null;\n namespace: string;\n name: string;\n type: StepType;\n stepDefinitionHistoryId: number | null;\n status: StepStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n workerId: string;\n start: number;\n schedule: number;\n priority: number;\n updated: number;\n optional: boolean;\n executionList: StepExecutionData[];\n};\n\nexport type StepExecutionData = {\n id: number;\n scheduled: number;\n polled: number;\n start: number;\n updated: number;\n executor: string;\n ref: string;\n runs: number;\n output: Record<string, unknown>;\n};\n\nexport type StepId = {\n id: number;\n processId: number;\n ref: string;\n};\n\nexport type ProcessRequestData = {\n name: string;\n namespace: string;\n version: number | null;\n requestId: string;\n correlationId: string;\n input: Record<string, unknown>;\n};\n\nexport type ProcessSearchRequest = {\n startTimeEpoch: number;\n endTimeEpoch?: number | null;\n namespace: string;\n processTypes: ProcessType[];\n triggerTypes: ProcessTriggerType[];\n names: string[];\n processIds: number[];\n correlationIds: string[];\n requestIds: string[];\n statuses: ProcessStatus[];\n limit: number;\n offset: number;\n};\n\nexport type StepSize = {\n stepQueueNameData: StepQueueNameData;\n size: number | null;\n};\n\nexport type ClientSubmitResult = {\n processId: number;\n stepId: number;\n errorMessage: string | null;\n httpStatusCode: number | null;\n};\n\nexport type WorkRequest = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n stepName: string;\n stepNamespace: string;\n stepRef: string;\n inputParam: Record<string, unknown>;\n isOptional: boolean;\n polled: number;\n scheduled: number;\n updated: number;\n priority: number;\n};\n\nexport type WorkResponse = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n output: Record<string, unknown>;\n status: StepStatus;\n rescheduleAfterSeconds: number | null;\n startedAt: number;\n};\n\nexport type WorkResult = {\n output: unknown;\n taskExecutionId: string;\n startTime: number;\n endTime: number;\n workRequest: WorkRequest;\n};\n\nexport interface FinalUnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout: number;\n apiWorkerTimeout: number;\n pollTimeout: number;\n pollInterval: number;\n responsePollInterval: number;\n responsePollTimeout: number;\n responseBatchSize: number;\n}\n\nexport interface UnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout?: number;\n apiWorkerTimeout?: number;\n pollTimeout?: number;\n pollInterval?: number;\n responsePollInterval?: number;\n responsePollTimeout?: number;\n responseBatchSize?: number;\n}\n\nexport interface ApiResponse<T = any> {\n data: T;\n status: number;\n headers: Record<string, string>;\n}\n\nexport interface ApiError extends Error {\n status?: number;\n response?: {\n data?: any;\n status: number;\n headers: Record<string, string>;\n };\n}\n\nexport interface QueryParams {\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface RequestConfig\n extends Omit<AxiosRequestConfig, \"baseURL\" | \"url\" | \"method\"> {\n headers?: Record<string, string>;\n}\n\nexport interface HandleRequestConfig {\n method: \"get\" | \"post\" | \"put\" | \"delete\";\n endpoint: string;\n params?: QueryParams;\n data?: Record<string, unknown>;\n config?: RequestConfig;\n}\n\nexport interface ClientRequestConfig {\n params?: QueryParams;\n data?: any;\n config?: RequestConfig;\n}\n\ninterface UnmeshedWorker {\n (input: Record<string, any>): Promise<any>;\n}\n\nexport interface UnmeshedWorkerConfig {\n worker: UnmeshedWorker;\n namespace: string;\n name: string;\n maxInProgress: number;\n}\n\nexport interface PollRequestData {\n stepQueueNameData: StepQueueNameData;\n size: number;\n}\nexport interface RenewRegistrationParams {\n friendlyName: string;\n}\n","export type WorkerFunction<T> = (items: T[]) => Promise<void>;\n\nexport class QueuedWorker<T> {\n\n private readonly queue: BlockingQueue<T>;\n private readonly pollIntervalMs: number;\n private readonly batchSize: number;\n private readonly workerFn: WorkerFunction<T>;\n private readonly timeoutMs: number;\n\n constructor(\n capacity: number,\n pollIntervalMs: number,\n batchSize: number,\n workerFn: WorkerFunction<T>,\n timeoutMs: number\n ) {\n this.queue = new BlockingQueue<T>(capacity);\n this.pollIntervalMs = pollIntervalMs;\n this.batchSize = batchSize;\n this.workerFn = workerFn;\n this.timeoutMs = timeoutMs;\n\n console.log(`Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`);\n // noinspection JSIgnoredPromiseFromCall\n this.start();\n }\n\n async start(): Promise<void> {\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (true) {\n try {\n const batch = await this.queue.takeBatch(this.batchSize);\n if(batch.length > 0) {\n console.log(`Batch work ${batch.length} received`);\n await this.runWithTimeout(this.workerFn(batch), this.timeoutMs);\n }\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));\n }\n }\n\n private async runWithTimeout(task: Promise<void>, timeoutMs: number): Promise<void> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then(() => {\n clearTimeout(timeout);\n resolve();\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n }\n\n async put(item: T): Promise<void> {\n await this.queue.put(item);\n }\n\n}\n\n\nclass BlockingQueue<T> {\n private queue: T[] = [];\n private readonly capacity: number;\n\n constructor(capacity: number) {\n if (capacity <= 0) {\n throw new Error(\"Capacity must be greater than 0\");\n }\n this.capacity = capacity;\n }\n\n async put(item: T): Promise<void> {\n while (this.queue.length >= this.capacity) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n this.queue.push(item);\n }\n\n async takeBatch(batchSize: number): Promise<T[]> {\n while (this.queue.length === 0) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n return this.queue.splice(0, batchSize);\n }\n\n size(): number {\n return this.queue.length;\n }\n\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n peek(): T | undefined {\n return this.queue[0];\n }\n}\n","import {\n ApiResponse,\n PollRequestData,\n StepQueueNameData,\n StepStatus,\n UnmeshedWorkerConfig,\n WorkRequest,\n WorkResponse,\n} from \"../types\";\nimport {UnmeshedApiClient} from \"./unmeshedApiClient\";\nimport {QueuedWorker} from \"./queuedWorker\";\n\nasync function registerPolling(\n apiClient: UnmeshedApiClient,\n data: StepQueueNameData[]\n) {\n const attempt = async (): Promise<any> => {\n try {\n const response = await apiClient.put(\"/api/clients/register\", {\n data: data,\n });\n console.log(\"Successfully renewed registration for workers\", data);\n return response.data;\n } catch {\n console.error(\n \"An error occurred during polling registration. Retrying in 3 seconds...\"\n );\n await new Promise((resolve) => setTimeout(resolve, 3000));\n return attempt();\n }\n };\n\n return attempt();\n}\n\nasync function pollWorker(apiClient: UnmeshedApiClient, data: PollRequestData[]): Promise<WorkRequest[]> {\n try {\n const response: ApiResponse<WorkRequest[]> = await apiClient.post(\"/api/clients/poll\", {data: data});\n if(response.data && response.data.length > 0) {\n console.log(`Received ${response.data.length} work requests`);\n }\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during worker polling\", error);\n }\n}\n\nasync function postWorkerResponse(apiClient: UnmeshedApiClient, workResponses: WorkResponse[]) {\n try {\n if (workResponses.length > 0) {\n const grouped: Record<StepStatus, number[]> = workResponses.reduce((acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n }, {} as Record<StepStatus, number[]>);\n const resultString = Object.entries(grouped)\n .map(([status, stepIds]) => `${status}: [${stepIds.join(\", \")}]`)\n .join(\", \");\n console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`)\n const response = await apiClient.post(\"/api/clients/bulkResults\", {\n data: workResponses,\n });\n return response.data;\n }\n return {};\n } catch (error) {\n console.log(\"Error:\", error);\n }\n}\n\nasync function runPollWithTimeout(task: Promise<WorkRequest[]>, timeoutMs: number): Promise<WorkRequest[]> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n}\n\nexport const continuePolling: { value: boolean } = {\n value: true,\n};\n\nexport async function pollForWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[]\n) {\n\n const queuedWorker: QueuedWorker<WorkResponse> = new QueuedWorker<WorkResponse>(\n 100000,\n apiClient.config.responsePollInterval,\n apiClient.config.responseBatchSize,\n async (batchWork: WorkResponse[]) => {\n await postWorkerResponse(apiClient, batchWork);\n },\n apiClient.config.responsePollTimeout,\n );\n\n const registerPollingData = workers.map((worker) => {\n return {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n } as StepQueueNameData;\n });\n\n await registerPolling(apiClient, registerPollingData);\n\n const pollWorkerData = workers.map((worker) => {\n return {\n stepQueueNameData: {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n },\n size: worker.maxInProgress,\n } as PollRequestData;\n });\n\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (continuePolling.value) {\n try {\n const workRequests: WorkRequest[] = await runPollWithTimeout(pollWorker(apiClient, pollWorkerData), apiClient.config.pollTimeout);\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) =>\n worker.name === polledWorker.stepName &&\n worker.namespace === polledWorker.stepNamespace\n );\n\n let workerResponse: WorkResponse = {\n processId: polledWorker.processId,\n stepId: polledWorker.stepId,\n stepExecutionId: polledWorker.stepExecutionId,\n runCount: polledWorker.runCount,\n output: {},\n status: StepStatus.RUNNING,\n rescheduleAfterSeconds: null,\n startedAt: new Date().getTime(),\n };\n\n if (!associatedWorker) {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `No worker found for ${polledWorker.stepName} ${polledWorker.stepNamespace}`,\n },\n status: StepStatus.TIMED_OUT,\n };\n await queuedWorker.put(workerResponse);\n continue;\n }\n\n const TIMEOUT = apiClient.config.apiWorkerTimeout;\n\n const timeoutPromise = new Promise((_, reject) => {\n setTimeout(() => reject(new Error(\"Timed out\")), TIMEOUT);\n });\n\n try {\n console.log(`Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`);\n const result = await Promise.race([\n associatedWorker.worker(polledWorker.inputParam),\n timeoutPromise,\n ]);\n\n workerResponse = {\n ...workerResponse,\n output: {\n ...result,\n __workCompletedAt: new Date().getTime(),\n },\n status: StepStatus.COMPLETED,\n };\n } catch (error: unknown) {\n const err = error as Error;\n if (err.message && err.message === \"Timed out\") {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `${err.message} based on work timeout settings in worker - ${apiClient.config.apiWorkerTimeout} ms`,\n },\n status: StepStatus.TIMED_OUT,\n };\n } else {\n workerResponse = {\n ...workerResponse,\n output: {\n error: safeStringifyError(err)\n },\n status: StepStatus.FAILED,\n };\n console.error(\"Error:\", err.message);\n }\n }\n await queuedWorker.put(workerResponse);\n }\n await new Promise((resolve) => setTimeout(resolve, apiClient.config.pollInterval));\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n }\n}\n\nfunction safeStringifyError(error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...error, // Include enumerable custom properties if they exist\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n}\n\nexport async function startPollingWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[],\n intervalMs: number = 5000\n) {\n async function pollCycle() {\n try {\n await pollForWorkers(apiClient, workers);\n } catch (error) {\n console.error(\"Error during worker polling:\", error);\n }\n\n setTimeout(pollCycle, intervalMs);\n }\n\n await pollCycle();\n}\n","import {\n ApiCallType,\n ProcessActionResponseData,\n ProcessData,\n ProcessRequestData,\n ProcessSearchRequest,\n StepData,\n} from \"../types\";\nimport { isAxiosError } from \"axios\";\nimport { UnmeshedApiClient } from \"./unmeshedApiClient\";\n\nconst RUN_PROCESS_REQUEST_URL = \"api/process/\";\n\nexport const runProcessSync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + \"runSync\", {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n });\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const runProcessAsync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"runAsync\",\n {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const getProcessData = async (\n apiClient: UnmeshedApiClient,\n processId: number\n): Promise<ProcessData> => {\n if (processId == null) {\n throw new Error(\"Process ID cannot be null\");\n }\n try {\n const response = await apiClient.get<ProcessData>(\n RUN_PROCESS_REQUEST_URL + \"context/\" + processId\n );\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while fetching process record: \", error);\n throw error;\n }\n};\n\nexport const getStepData = async (\n apiClient: UnmeshedApiClient,\n stepId: number | null\n): Promise<StepData> => {\n if (stepId === null || stepId === undefined) {\n throw new Error(\"Step ID cannot be null or undefined\");\n }\n\n try {\n const response = await apiClient.get<StepData>(\n RUN_PROCESS_REQUEST_URL + \"stepContext/\" + stepId\n );\n return response.data;\n } catch (error) {\n console.log(\"Error occurred while getStepData: \", error);\n throw error\n }\n};\n\nexport const bulkTerminate = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"bulkTerminate\",\n {\n params: { reason },\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while terminating processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"bulkResume\",\n {\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while resuming processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkReviewed = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"bulkReviewed\",\n {\n data: processIds,\n params: { reason },\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while marking processes as reviewed: ${\n err.message || error\n }`\n );\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n clientId: string,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\n clientId,\n processId,\n };\n\n if (version !== undefined) {\n params[\"version\"] = version;\n }\n\n try {\n const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + \"rerun\", {\n params,\n });\n\n return response.data as ProcessData;\n } catch (error) {\n if (isAxiosError(error)) {\n throw new Error(\n `HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`\n );\n } else {\n const err = error as Error;\n throw new Error(\n `Unexpected error during rerun process: ${err.message || err}`\n );\n }\n }\n};\n\nexport const searchProcessExecutions = async (\n apiClient: UnmeshedApiClient,\n params: ProcessSearchRequest\n) => {\n const queryParams = new URLSearchParams();\n\n if (params.startTimeEpoch !== undefined && params.startTimeEpoch !== 0)\n queryParams.set(\"startTimeEpoch\", params.startTimeEpoch.toString());\n if (params.endTimeEpoch !== undefined && params.endTimeEpoch !== 0)\n queryParams.set(\"endTimeEpoch\", (params.endTimeEpoch || 0).toString());\n if (params.namespace) queryParams.set(\"namespace\", params.namespace);\n if (params.names && params.names.length)\n queryParams.set(\"names\", params.names.join(\",\"));\n if (params.processIds && params.processIds.length)\n queryParams.set(\"processIds\", params.processIds.join(\",\"));\n if (params.correlationIds && params.correlationIds.length)\n queryParams.set(\"correlationIds\", params.correlationIds.join(\",\"));\n if (params.requestIds && params.requestIds.length)\n queryParams.set(\"requestIds\", params.requestIds.join(\",\"));\n if (params.statuses && params.statuses.length)\n queryParams.set(\"statuses\", params.statuses.join(\",\"));\n if (params.triggerTypes && params.triggerTypes.length)\n queryParams.set(\"triggerTypes\", params.triggerTypes.join(\",\"));\n\n const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));\n\n try {\n const response = await apiClient.get(\n RUN_PROCESS_REQUEST_URL + \"api/stats/process/search\",\n updatedParams\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while searching process executions: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingGet = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n) => {\n try {\n const response = await apiClient.get(\n RUN_PROCESS_REQUEST_URL + \"api/call/\" + endpoint,\n {\n id: id,\n correlationId: correlationId,\n apiCallType,\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping GET: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingPost = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType = ApiCallType.ASYNC\n): Promise<any> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"api/call/\" + endpoint,\n {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\n },\n }\n );\n\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping POST: \", error);\n throw error;\n }\n};\n","import { RenewRegistrationParams } from \"../types\";\nimport { UnmeshedApiClient } from \"./unmeshedApiClient\";\n\nexport const renewRegistration = async (\n apiClient: UnmeshedApiClient,\n params: RenewRegistrationParams\n): Promise<string> => {\n try {\n const response = await apiClient.put(\"/api/clients/register\", {\n params: { ...params },\n });\n console.debug(\"Response from server:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during registration renewal:\", error);\n throw error;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0G;;;ACA1G,oBAA2B;AAEpB,IAAM,sBAAN,MAA0B;AAAA,EAC/B,OAAO,iBAAiB,OAAuB;AAC7C,QAAI;AACF,YAAM,WAAO,0BAAW,QAAQ;AAChC,WAAK,OAAO,OAAO,MAAM;AACzB,aAAO,KAAK,OAAO,KAAK;AAAA,IAC1B,SAAS,GAAG;AACV,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACvC;AAAA,EACF;AACF;;;ADDO,IAAM,oBAAN,MAAwB;AAAA,EAEnB,gBAAsC;AAAA,EACtC,WAA+B;AAAA,EAC/B;AAAA,EAER,YAAY,sBAA4C;AACpD,YAAQ,IAAI,iCAAiC;AAE7C,SAAK,UAAU,2BAA2B,oBAAoB;AAE9D,YAAQ,IAAI,KAAK,OAAO;AAExB,SAAK,WAAW,KAAK,QAAQ;AAE7B,QAAI,CAAC,KAAK,QAAQ,SAAS;AACvB,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACzC;AAEA,UAAM,UAAU,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ;AAEl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H,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,kBAAkB,QAAiC;AAC/C,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAChD;AACJ;","names":["axios","ApiCallType","WebhookSource","SQAuthUserType","StepType","StepStatus","ProcessStatus","ProcessTriggerType","ProcessType","response","import_axios","ProcessRequestData","ProcessRequestData"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/apis/unmeshedApiClient.ts","../src/utils/unmeshedCommonUtils.ts","../src/types/index.ts","../src/apis/queuedWorker.ts","../src/apis/pollerClientImpl.ts","../src/apis/processClientImpl.ts","../src/apis/registrationClientImpl.ts"],"sourcesContent":["import {\n ApiCallType,\n ProcessRequestData,\n ProcessSearchRequest,\n RenewRegistrationParams,\n UnmeshedClientConfig,\n UnmeshedWorkerConfig,\n} from \"./types\";\nimport {UnmeshedApiClient} from \"./apis/unmeshedApiClient\";\nimport {startPollingWorkers} from \"./apis/pollerClientImpl\";\nimport {\n bulkResume,\n bulkReviewed,\n bulkTerminate,\n getProcessData,\n getStepData,\n invokeApiMappingGet,\n invokeApiMappingPost,\n rerun,\n runProcessAsync,\n runProcessSync,\n searchProcessExecutions,\n} from \"./apis/processClientImpl\";\nimport {renewRegistration} from \"./apis/registrationClientImpl\";\n\n// noinspection JSUnusedGlobalSymbols\nexport class UnmeshedClient {\n private client: UnmeshedApiClient;\n\n constructor(config: UnmeshedClientConfig) {\n this.client = new UnmeshedApiClient(config);\n }\n\n startPolling(workers: UnmeshedWorkerConfig[]) {\n startPollingWorkers(this.client, workers);\n }\n\n runProcessSync(ProcessRequestData: ProcessRequestData) {\n return runProcessSync(this.client, ProcessRequestData);\n }\n\n runProcessAsync(ProcessRequestData: ProcessRequestData) {\n return runProcessAsync(this.client, ProcessRequestData);\n }\n\n getProcessData(processId: number, includeSteps: boolean) {\n return getProcessData(this.client, processId, includeSteps);\n }\n\n getStepData(stepId: number) {\n return getStepData(this.client, stepId);\n }\n\n bulkTerminate(processIds: number[], reason?: string) {\n return bulkTerminate(this.client, processIds, reason);\n }\n\n bulkResume(processIds: number[]) {\n return bulkResume(this.client, processIds);\n }\n\n bulkReviewed(processIds: number[], reason?: string) {\n return bulkReviewed(this.client, processIds, reason);\n }\n\n reRun(processId: number, clientId: string, version?: number) {\n return rerun(this.client, processId, clientId, version);\n }\n\n searchProcessExecution(params: ProcessSearchRequest) {\n return searchProcessExecutions(this.client, params);\n }\n\n invokeApiMappingGet(\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingGet(\n apiClient,\n endpoint,\n id,\n correlationId,\n apiCallType\n );\n }\n\n invokeApiMappingPost(\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingPost(\n this.client,\n endpoint,\n input,\n id,\n correlationId,\n apiCallType\n );\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n\n}\n\nexport * from \"./types\";\n","import axios, {AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders} from \"axios\";\nimport {\n ApiResponse,\n ClientRequestConfig, FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from \"../types\";\nimport {UnmeshedCommonUtils} from \"../utils/unmeshedCommonUtils\";\n\nexport class UnmeshedApiClient {\n\n private axiosInstance: AxiosInstance | null = null;\n private clientId: string | undefined = undefined;\n private _config: FinalUnmeshedClientConfig;\n\n constructor(unmeshedClientConfig: UnmeshedClientConfig) {\n console.log(\"Initializing Unmeshed ApiClient\");\n\n this._config = createUnmeshedClientConfig(unmeshedClientConfig);\n\n console.log(this._config);\n\n this.clientId = this._config.clientId;\n\n if (!this._config.baseUrl) {\n throw new Error(\"baseUrl is required\");\n }\n\n const baseURL = this._config.port ? `${this._config.baseUrl}:${this._config.port}` : this._config.baseUrl;\n\n this.axiosInstance = axios.create({\n baseURL,\n timeout: this._config.timeout,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer client.sdk.${this._config.clientId}.${UnmeshedCommonUtils.createSecureHash(\n this._config.authToken\n )}`,\n } as RawAxiosRequestHeaders,\n });\n }\n\n private async handleRequest<T>({\n method,\n endpoint,\n params,\n data,\n config,\n }: HandleRequestConfig): Promise<ApiResponse<T>> {\n\n if (!this.axiosInstance) {\n throw new Error(\"ApiClient must be initialized before making requests\");\n }\n\n try {\n const response: AxiosResponse<T> = await this.axiosInstance.request<T>({\n method,\n url: endpoint,\n params,\n data,\n ...config,\n } as AxiosRequestConfig);\n\n return {\n data: response.data,\n status: response.status,\n headers: response.headers as Record<string, string>,\n };\n } catch (error) {\n if (axios.isAxiosError(error)) {\n console.error(\"Request failed:\", error.message);\n throw this.handleError(error);\n }\n console.error(\"Unexpected error:\", (error as Error).message);\n throw error;\n }\n }\n\n private handleError(error: AxiosError): Error {\n console.error(\"Error details:\", {\n message: error.message,\n status: error.response?.status,\n data: error.response?.data,\n });\n\n let response = error?.response?.data as ErrorResponse;\n if (response?.errorMessage) {\n return new Error(`${response.errorMessage} [Status code: ${error.response?.status || ''}]`)\n }\n\n return new Error(error.message, {cause: error.response?.data || {}});\n }\n\n public async get<T = any>(\n endpoint: string,\n params?: QueryParams,\n config?: RequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"get\",\n endpoint: endpoint,\n params: params,\n config: config,\n });\n }\n\n public async post<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"post\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async put<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"put\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async delete<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"delete\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public getClientId(): string | undefined {\n return this.clientId;\n }\n\n\n get config(): FinalUnmeshedClientConfig {\n return this._config;\n }\n}\n\ninterface ErrorResponse {\n errorMessage?: string;\n [key: string]: any; // To allow other unexpected properties\n}\n\nexport function createUnmeshedClientConfig(config: UnmeshedClientConfig): Required<FinalUnmeshedClientConfig> {\n return {\n baseUrl: config.baseUrl,\n clientId: config.clientId,\n authToken: config.authToken,\n port: config.port ?? 443,\n timeout: config.timeout ?? 5000,\n pollInterval: config.pollInterval ?? 100,\n apiWorkerTimeout: config.apiWorkerTimeout ?? 10000,\n pollTimeout: config.pollTimeout ?? 10000,\n responsePollInterval: config.responsePollInterval ?? 100,\n responsePollTimeout: config.responsePollTimeout ?? 10000,\n responseBatchSize: config.responseBatchSize ?? 50,\n };\n}\n","import { createHash } from \"crypto\";\n\nexport class UnmeshedCommonUtils {\n static createSecureHash(input: string): string {\n try {\n const hash = createHash(\"sha256\");\n hash.update(input, \"utf8\");\n return hash.digest(\"hex\");\n } catch (e) {\n throw new Error(\"Error creating hash\");\n }\n }\n}\n","import { AxiosRequestConfig } from \"axios\";\n\nexport enum ApiCallType {\n SYNC = \"SYNC\",\n ASYNC = \"ASYNC\",\n STREAM = \"STREAM\",\n}\n\nexport interface ApiMappingData {\n endpoint: string;\n processDefNamespace: string;\n processDefName: string;\n processDefVersion: number;\n authType: string;\n authClaims: string;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n}\n\nexport type ApiMappingWebhookData = {\n endpoint: string;\n name: string;\n uniqueId: string;\n urlSecret: string;\n description: string;\n userIdentifier: string;\n webhookSource: WebhookSource;\n webhookSourceConfig: Record<string, string>;\n expiryDate: Date;\n userType: SQAuthUserType;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n};\n\nexport enum WebhookSource {\n MS_TEAMS = \"MS_TEAMS\",\n NOT_DEFINED = \"NOT_DEFINED\",\n}\n\nexport enum SQAuthUserType {\n USER = \"USER\",\n API = \"API\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport enum StepType {\n WORKER = \"WORKER\",\n HTTP = \"HTTP\",\n WAIT = \"WAIT\",\n FAIL = \"FAIL\",\n PYTHON = \"PYTHON\",\n JAVASCRIPT = \"JAVASCRIPT\",\n JQ = \"JQ\",\n MANAGED = \"MANAGED\",\n BUILTIN = \"BUILTIN\",\n NOOP = \"NOOP\",\n PERSISTED_STATE = \"PERSISTED_STATE\",\n DEPENDSON = \"DEPENDSON\",\n INTEGRATION = \"INTEGRATION\",\n EXIT = \"EXIT\",\n SUB_PROCESS = \"SUB_PROCESS\",\n LIST = \"LIST\",\n PARALLEL = \"PARALLEL\",\n FOREACH = \"FOREACH\",\n SWITCH = \"SWITCH\",\n}\n\nexport enum StepStatus {\n PENDING = \"PENDING\",\n SCHEDULED = \"SCHEDULED\",\n RUNNING = \"RUNNING\",\n PAUSED = \"PAUSED\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n SKIPPED = \"SKIPPED\",\n CANCELLED = \"CANCELLED\",\n}\n\nexport enum ProcessStatus {\n RUNNING = \"RUNNING\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n CANCELLED = \"CANCELLED\",\n TERMINATED = \"TERMINATED\",\n REVIEWED = \"REVIEWED\",\n}\n\nexport enum ProcessTriggerType {\n MANUAL = \"MANUAL\",\n SCHEDULED = \"SCHEDULED\",\n API_MAPPING = \"API_MAPPING\",\n WEBHOOK = \"WEBHOOK\",\n API = \"API\",\n SUB_PROCESS = \"SUB_PROCESS\",\n}\n\nexport enum ProcessType {\n STANDARD = \"STANDARD\",\n DYNAMIC = \"DYNAMIC\",\n API_ORCHESTRATION = \"API_ORCHESTRATION\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport type ClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n};\n\nexport type FullClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n tokenValue: string;\n};\n\nexport type StepQueueNameData = {\n orgId: number;\n namespace: string;\n stepType: StepType;\n name: string;\n};\n\nexport type ProcessActionResponseData = {\n count: number;\n details: ProcessActionResponseDetailData[];\n};\n\nexport type ProcessActionResponseDetailData = {\n id: string;\n message: string;\n error: string;\n};\n\nexport type ProcessData = {\n processId: number;\n processType: ProcessType;\n triggerType: ProcessTriggerType;\n namespace: string;\n name: string;\n version: number | null;\n processDefinitionHistoryId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n stepIds: StepId[];\n stepDataById: Record<number, StepData>;\n created: number;\n updated: number;\n createdBy: string;\n};\n\nexport type StepData = {\n id: number;\n processId: number;\n ref: string;\n parentId: number | null;\n parentRef: string | null;\n namespace: string;\n name: string;\n type: StepType;\n stepDefinitionHistoryId: number | null;\n status: StepStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n workerId: string;\n start: number;\n schedule: number;\n priority: number;\n updated: number;\n optional: boolean;\n executionList: StepExecutionData[];\n};\n\nexport type StepExecutionData = {\n id: number;\n scheduled: number;\n polled: number;\n start: number;\n updated: number;\n executor: string;\n ref: string;\n runs: number;\n output: Record<string, unknown>;\n};\n\nexport type StepId = {\n id: number;\n processId: number;\n ref: string;\n};\n\nexport type ProcessRequestData = {\n name: string;\n namespace: string;\n version: number | null;\n requestId: string;\n correlationId: string;\n input: Record<string, unknown>;\n};\n\nexport type ProcessSearchRequest = {\n startTimeEpoch: number;\n endTimeEpoch?: number | null;\n namespace: string;\n processTypes: ProcessType[];\n triggerTypes: ProcessTriggerType[];\n names: string[];\n processIds: number[];\n correlationIds: string[];\n requestIds: string[];\n statuses: ProcessStatus[];\n limit: number;\n offset: number;\n};\n\nexport type StepSize = {\n stepQueueNameData: StepQueueNameData;\n size: number | null;\n};\n\nexport type ClientSubmitResult = {\n processId: number;\n stepId: number;\n errorMessage: string | null;\n httpStatusCode: number | null;\n};\n\nexport type WorkRequest = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n stepName: string;\n stepNamespace: string;\n stepRef: string;\n inputParam: Record<string, unknown>;\n isOptional: boolean;\n polled: number;\n scheduled: number;\n updated: number;\n priority: number;\n};\n\nexport type WorkResponse = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n output: Record<string, unknown>;\n status: StepStatus;\n rescheduleAfterSeconds: number | null;\n startedAt: number;\n};\n\nexport type WorkResult = {\n output: unknown;\n taskExecutionId: string;\n startTime: number;\n endTime: number;\n workRequest: WorkRequest;\n};\n\nexport interface FinalUnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout: number;\n apiWorkerTimeout: number;\n pollTimeout: number;\n pollInterval: number;\n responsePollInterval: number;\n responsePollTimeout: number;\n responseBatchSize: number;\n}\n\nexport interface UnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout?: number;\n apiWorkerTimeout?: number;\n pollTimeout?: number;\n pollInterval?: number;\n responsePollInterval?: number;\n responsePollTimeout?: number;\n responseBatchSize?: number;\n}\n\nexport interface ApiResponse<T = any> {\n data: T;\n status: number;\n headers: Record<string, string>;\n}\n\nexport interface ApiError extends Error {\n status?: number;\n response?: {\n data?: any;\n status: number;\n headers: Record<string, string>;\n };\n}\n\nexport interface QueryParams {\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface RequestConfig\n extends Omit<AxiosRequestConfig, \"baseURL\" | \"url\" | \"method\"> {\n headers?: Record<string, string>;\n}\n\nexport interface HandleRequestConfig {\n method: \"get\" | \"post\" | \"put\" | \"delete\";\n endpoint: string;\n params?: QueryParams;\n data?: Record<string, unknown>;\n config?: RequestConfig;\n}\n\nexport interface ClientRequestConfig {\n params?: QueryParams;\n data?: any;\n config?: RequestConfig;\n}\n\ninterface UnmeshedWorker {\n (input: Record<string, any>): Promise<any>;\n}\n\nexport interface UnmeshedWorkerConfig {\n worker: UnmeshedWorker;\n namespace: string;\n name: string;\n maxInProgress: number;\n}\n\nexport interface PollRequestData {\n stepQueueNameData: StepQueueNameData;\n size: number;\n}\nexport interface RenewRegistrationParams {\n friendlyName: string;\n}\n","export type WorkerFunction<T> = (items: T[]) => Promise<void>;\n\nexport class QueuedWorker<T> {\n\n private readonly queue: BlockingQueue<T>;\n private readonly pollIntervalMs: number;\n private readonly batchSize: number;\n private readonly workerFn: WorkerFunction<T>;\n private readonly timeoutMs: number;\n\n constructor(\n capacity: number,\n pollIntervalMs: number,\n batchSize: number,\n workerFn: WorkerFunction<T>,\n timeoutMs: number\n ) {\n this.queue = new BlockingQueue<T>(capacity);\n this.pollIntervalMs = pollIntervalMs;\n this.batchSize = batchSize;\n this.workerFn = workerFn;\n this.timeoutMs = timeoutMs;\n\n console.log(`Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`);\n // noinspection JSIgnoredPromiseFromCall\n this.start();\n }\n\n async start(): Promise<void> {\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (true) {\n try {\n const batch = await this.queue.takeBatch(this.batchSize);\n if(batch.length > 0) {\n console.log(`Batch work ${batch.length} received`);\n await this.runWithTimeout(this.workerFn(batch), this.timeoutMs);\n }\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));\n }\n }\n\n private async runWithTimeout(task: Promise<void>, timeoutMs: number): Promise<void> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then(() => {\n clearTimeout(timeout);\n resolve();\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n }\n\n async put(item: T): Promise<void> {\n await this.queue.put(item);\n }\n\n}\n\n\nclass BlockingQueue<T> {\n private queue: T[] = [];\n private readonly capacity: number;\n\n constructor(capacity: number) {\n if (capacity <= 0) {\n throw new Error(\"Capacity must be greater than 0\");\n }\n this.capacity = capacity;\n }\n\n async put(item: T): Promise<void> {\n while (this.queue.length >= this.capacity) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n this.queue.push(item);\n }\n\n async takeBatch(batchSize: number): Promise<T[]> {\n while (this.queue.length === 0) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n return this.queue.splice(0, batchSize);\n }\n\n size(): number {\n return this.queue.length;\n }\n\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n peek(): T | undefined {\n return this.queue[0];\n }\n}\n","import {\n ApiResponse,\n PollRequestData,\n StepQueueNameData,\n StepStatus,\n UnmeshedWorkerConfig,\n WorkRequest,\n WorkResponse,\n} from \"../types\";\nimport {UnmeshedApiClient} from \"./unmeshedApiClient\";\nimport {QueuedWorker} from \"./queuedWorker\";\n\nasync function registerPolling(\n apiClient: UnmeshedApiClient,\n data: StepQueueNameData[]\n) {\n const attempt = async (): Promise<any> => {\n try {\n const response = await apiClient.put(`/api/clients/register`, {\n data: data,\n });\n console.log(\"Successfully renewed registration for workers\", data);\n return response.data;\n } catch {\n console.error(\n \"An error occurred during polling registration. Retrying in 3 seconds...\"\n );\n await new Promise((resolve) => setTimeout(resolve, 3000));\n return attempt();\n }\n };\n\n return attempt();\n}\n\nasync function pollWorker(apiClient: UnmeshedApiClient, data: PollRequestData[]): Promise<WorkRequest[]> {\n try {\n const response: ApiResponse<WorkRequest[]> = await apiClient.post(`/api/clients/poll`, {data: data});\n if(response.data && response.data.length > 0) {\n console.log(`Received ${response.data.length} work requests`);\n }\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during worker polling\", error);\n }\n}\n\nasync function postWorkerResponse(apiClient: UnmeshedApiClient, workResponses: WorkResponse[]) {\n try {\n if (workResponses.length > 0) {\n const grouped: Record<StepStatus, number[]> = workResponses.reduce((acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n }, {} as Record<StepStatus, number[]>);\n const resultString = Object.entries(grouped)\n .map(([status, stepIds]) => `${status}: [${stepIds.join(\", \")}]`)\n .join(\", \");\n console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`)\n const response = await apiClient.post(`/api/clients/bulkResults`, {\n data: workResponses,\n });\n return response.data;\n }\n return {};\n } catch (error) {\n console.log(\"Error:\", error);\n }\n}\n\nasync function runPollWithTimeout(task: Promise<WorkRequest[]>, timeoutMs: number): Promise<WorkRequest[]> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n}\n\nexport const continuePolling: { value: boolean } = {\n value: true,\n};\n\nexport async function pollForWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[]\n) {\n\n const queuedWorker: QueuedWorker<WorkResponse> = new QueuedWorker<WorkResponse>(\n 100000,\n apiClient.config.responsePollInterval,\n apiClient.config.responseBatchSize,\n async (batchWork: WorkResponse[]) => {\n await postWorkerResponse(apiClient, batchWork);\n },\n apiClient.config.responsePollTimeout,\n );\n\n const registerPollingData = workers.map((worker) => {\n return {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n } as StepQueueNameData;\n });\n\n await registerPolling(apiClient, registerPollingData);\n\n const pollWorkerData = workers.map((worker) => {\n return {\n stepQueueNameData: {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n },\n size: worker.maxInProgress,\n } as PollRequestData;\n });\n\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (continuePolling.value) {\n try {\n const workRequests: WorkRequest[] = await runPollWithTimeout(pollWorker(apiClient, pollWorkerData), apiClient.config.pollTimeout);\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) =>\n worker.name === polledWorker.stepName &&\n worker.namespace === polledWorker.stepNamespace\n );\n\n let workerResponse: WorkResponse = {\n processId: polledWorker.processId,\n stepId: polledWorker.stepId,\n stepExecutionId: polledWorker.stepExecutionId,\n runCount: polledWorker.runCount,\n output: {},\n status: StepStatus.RUNNING,\n rescheduleAfterSeconds: null,\n startedAt: new Date().getTime(),\n };\n\n if (!associatedWorker) {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `No worker found for ${polledWorker.stepName} ${polledWorker.stepNamespace}`,\n },\n status: StepStatus.TIMED_OUT,\n };\n await queuedWorker.put(workerResponse);\n continue;\n }\n\n const TIMEOUT = apiClient.config.apiWorkerTimeout;\n\n const timeoutPromise = new Promise((_, reject) => {\n setTimeout(() => reject(new Error(\"Timed out\")), TIMEOUT);\n });\n\n try {\n console.log(`Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`);\n const result = await Promise.race([\n associatedWorker.worker(polledWorker.inputParam),\n timeoutPromise,\n ]);\n\n workerResponse = {\n ...workerResponse,\n output: {\n ...result,\n __workCompletedAt: new Date().getTime(),\n },\n status: StepStatus.COMPLETED,\n };\n } catch (error: unknown) {\n const err = error as Error;\n if (err.message && err.message === \"Timed out\") {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `${err.message} based on work timeout settings in worker - ${apiClient.config.apiWorkerTimeout} ms`,\n },\n status: StepStatus.TIMED_OUT,\n };\n } else {\n workerResponse = {\n ...workerResponse,\n output: {\n error: safeStringifyError(err)\n },\n status: StepStatus.FAILED,\n };\n console.error(\"Error:\", err.message);\n }\n }\n await queuedWorker.put(workerResponse);\n }\n await new Promise((resolve) => setTimeout(resolve, apiClient.config.pollInterval));\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n }\n}\n\nfunction safeStringifyError(error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...error, // Include enumerable custom properties if they exist\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n}\n\nexport async function startPollingWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[],\n intervalMs: number = 5000\n) {\n async function pollCycle() {\n try {\n await pollForWorkers(apiClient, workers);\n } catch (error) {\n console.error(\"Error during worker polling:\", error);\n }\n\n setTimeout(pollCycle, intervalMs);\n }\n\n await pollCycle();\n}\n","import {\n ApiCallType,\n ProcessActionResponseData,\n ProcessData,\n ProcessRequestData,\n ProcessSearchRequest,\n StepData,\n} from \"../types\";\nimport {isAxiosError} from \"axios\";\nimport {UnmeshedApiClient} from \"./unmeshedApiClient\";\n\nconst PROCESS_PREFIX = \"api/process\";\n\nexport const runProcessSync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/runSync`, {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n });\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const runProcessAsync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/runAsync`,\n {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const getProcessData = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n includeSteps: boolean = false\n): Promise<ProcessData> => {\n if (!processId) {\n throw new Error(\"Process ID cannot be null\");\n }\n try {\n const response = await apiClient.get<ProcessData>(\n `${PROCESS_PREFIX}/context/${processId}`,\n {includeSteps}\n );\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while fetching process record: \", error);\n throw error;\n }\n};\n\nexport const getStepData = async (\n apiClient: UnmeshedApiClient,\n stepId: number\n): Promise<StepData> => {\n if (!stepId) {\n throw new Error(\"Step ID cannot be null or undefined\");\n }\n try {\n const response = await apiClient.get<StepData>(\n `${PROCESS_PREFIX}/stepContext/${stepId}`\n );\n return response.data;\n } catch (error) {\n console.log(\"Error occurred while getStepData: \", error);\n throw error\n }\n};\n\nexport const bulkTerminate = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/bulkTerminate`,\n {\n params: {reason},\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while terminating processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/bulkResume`,\n {\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while resuming processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkReviewed = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/bulkReviewed`,\n {\n data: processIds,\n params: {reason},\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while marking processes as reviewed: ${\n err.message || error\n }`\n );\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n clientId: string,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\n clientId,\n processId,\n };\n\n if (version !== undefined) {\n params[\"version\"] = version;\n }\n\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/rerun`, {\n params,\n });\n\n return response.data as ProcessData;\n } catch (error) {\n if (isAxiosError(error)) {\n throw new Error(\n `HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`\n );\n } else {\n const err = error as Error;\n throw new Error(\n `Unexpected error during rerun process: ${err.message || err}`\n );\n }\n }\n};\n\nexport const searchProcessExecutions = async (\n apiClient: UnmeshedApiClient,\n params: ProcessSearchRequest\n) => {\n const queryParams = new URLSearchParams();\n\n if (params.startTimeEpoch !== undefined && params.startTimeEpoch !== 0)\n queryParams.set(\"startTimeEpoch\", params.startTimeEpoch.toString());\n if (params.endTimeEpoch !== undefined && params.endTimeEpoch !== 0)\n queryParams.set(\"endTimeEpoch\", (params.endTimeEpoch || 0).toString());\n if (params.namespace) queryParams.set(\"namespace\", params.namespace);\n if (params.names && params.names.length)\n queryParams.set(\"names\", params.names.join(\",\"));\n if (params.processIds && params.processIds.length)\n queryParams.set(\"processIds\", params.processIds.join(\",\"));\n if (params.correlationIds && params.correlationIds.length)\n queryParams.set(\"correlationIds\", params.correlationIds.join(\",\"));\n if (params.requestIds && params.requestIds.length)\n queryParams.set(\"requestIds\", params.requestIds.join(\",\"));\n if (params.statuses && params.statuses.length)\n queryParams.set(\"statuses\", params.statuses.join(\",\"));\n if (params.triggerTypes && params.triggerTypes.length)\n queryParams.set(\"triggerTypes\", params.triggerTypes.join(\",\"));\n\n const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));\n\n try {\n const response = await apiClient.get(\n `${PROCESS_PREFIX}/api/stats/process/search`,\n updatedParams\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while searching process executions: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingGet = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n) => {\n try {\n const response = await apiClient.get(\n `${PROCESS_PREFIX}/api/call/${endpoint}`,\n {\n id: id,\n correlationId: correlationId,\n apiCallType,\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping GET: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingPost = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType = ApiCallType.ASYNC\n): Promise<any> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/api/call/${endpoint}`,\n {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\n },\n }\n );\n\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping POST: \", error);\n throw error;\n }\n};\n","import { RenewRegistrationParams } from \"../types\";\nimport { UnmeshedApiClient } from \"./unmeshedApiClient\";\n\nexport const renewRegistration = async (\n apiClient: UnmeshedApiClient,\n params: RenewRegistrationParams\n): Promise<string> => {\n try {\n const response = await apiClient.put(\"/api/clients/register\", {\n params: { ...params },\n });\n console.debug(\"Response from server:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during registration renewal:\", error);\n throw error;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AEA,gBAAgBA,qBAAwC;AACpD,WAAO,gBAAgB,KAAK,QAAQA,mBAAkB;AAAA,EAC1D;AAAA,EAEA,eAAe,WAAmB,cAAuB;AACrD,WAAO,eAAe,KAAK,QAAQ,WAAW,YAAY;AAAA,EAC9D;AAAA,EAEA,YAAY,QAAgB;AACxB,WAAO,YAAY,KAAK,QAAQ,MAAM;AAAA,EAC1C;AAAA,EAEA,cAAc,YAAsB,QAAiB;AACjD,WAAO,cAAc,KAAK,QAAQ,YAAY,MAAM;AAAA,EACxD;AAAA,EAEA,WAAW,YAAsB;AAC7B,WAAO,WAAW,KAAK,QAAQ,UAAU;AAAA,EAC7C;AAAA,EAEA,aAAa,YAAsB,QAAiB;AAChD,WAAO,aAAa,KAAK,QAAQ,YAAY,MAAM;AAAA,EACvD;AAAA,EAEA,MAAM,WAAmB,UAAkB,SAAkB;AACzD,WAAO,MAAM,KAAK,QAAQ,WAAW,UAAU,OAAO;AAAA,EAC1D;AAAA,EAEA,uBAAuB,QAA8B;AACjD,WAAO,wBAAwB,KAAK,QAAQ,MAAM;AAAA,EACtD;AAAA,EAEA,oBACI,WACA,UACA,IACA,eACA,aACF;AACE,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,qBACI,UACA,OACA,IACA,eACA,aACF;AACE,WAAO;AAAA,MACH,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,kBAAkB,QAAiC;AAC/C,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAChD;AAEJ;","names":["axios","ApiCallType","WebhookSource","SQAuthUserType","StepType","StepStatus","ProcessStatus","ProcessTriggerType","ProcessType","response","import_axios","ProcessRequestData","ProcessRequestData"]}
|
package/dist/index.mjs
CHANGED
|
@@ -300,7 +300,7 @@ var BlockingQueue = class {
|
|
|
300
300
|
async function registerPolling(apiClient, data) {
|
|
301
301
|
const attempt = async () => {
|
|
302
302
|
try {
|
|
303
|
-
const response = await apiClient.put(
|
|
303
|
+
const response = await apiClient.put(`/api/clients/register`, {
|
|
304
304
|
data
|
|
305
305
|
});
|
|
306
306
|
console.log("Successfully renewed registration for workers", data);
|
|
@@ -317,7 +317,7 @@ async function registerPolling(apiClient, data) {
|
|
|
317
317
|
}
|
|
318
318
|
async function pollWorker(apiClient, data) {
|
|
319
319
|
try {
|
|
320
|
-
const response = await apiClient.post(
|
|
320
|
+
const response = await apiClient.post(`/api/clients/poll`, { data });
|
|
321
321
|
if (response.data && response.data.length > 0) {
|
|
322
322
|
console.log(`Received ${response.data.length} work requests`);
|
|
323
323
|
}
|
|
@@ -338,7 +338,7 @@ async function postWorkerResponse(apiClient, workResponses) {
|
|
|
338
338
|
}, {});
|
|
339
339
|
const resultString = Object.entries(grouped).map(([status, stepIds]) => `${status}: [${stepIds.join(", ")}]`).join(", ");
|
|
340
340
|
console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`);
|
|
341
|
-
const response = await apiClient.post(
|
|
341
|
+
const response = await apiClient.post(`/api/clients/bulkResults`, {
|
|
342
342
|
data: workResponses
|
|
343
343
|
});
|
|
344
344
|
return response.data;
|
|
@@ -502,10 +502,10 @@ async function startPollingWorkers(apiClient, workers, intervalMs = 5e3) {
|
|
|
502
502
|
|
|
503
503
|
// src/apis/processClientImpl.ts
|
|
504
504
|
import { isAxiosError } from "axios";
|
|
505
|
-
var
|
|
505
|
+
var PROCESS_PREFIX = "api/process";
|
|
506
506
|
var runProcessSync = async (apiClient, ProcessRequestData2) => {
|
|
507
507
|
try {
|
|
508
|
-
const response = await apiClient.post(
|
|
508
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/runSync`, {
|
|
509
509
|
data: ProcessRequestData2,
|
|
510
510
|
params: {
|
|
511
511
|
clientId: apiClient.getClientId()
|
|
@@ -521,7 +521,7 @@ var runProcessSync = async (apiClient, ProcessRequestData2) => {
|
|
|
521
521
|
var runProcessAsync = async (apiClient, ProcessRequestData2) => {
|
|
522
522
|
try {
|
|
523
523
|
const response = await apiClient.post(
|
|
524
|
-
|
|
524
|
+
`${PROCESS_PREFIX}/runAsync`,
|
|
525
525
|
{
|
|
526
526
|
data: ProcessRequestData2,
|
|
527
527
|
params: {
|
|
@@ -536,13 +536,14 @@ var runProcessAsync = async (apiClient, ProcessRequestData2) => {
|
|
|
536
536
|
throw error;
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
|
-
var getProcessData = async (apiClient, processId) => {
|
|
540
|
-
if (processId
|
|
539
|
+
var getProcessData = async (apiClient, processId, includeSteps = false) => {
|
|
540
|
+
if (!processId) {
|
|
541
541
|
throw new Error("Process ID cannot be null");
|
|
542
542
|
}
|
|
543
543
|
try {
|
|
544
544
|
const response = await apiClient.get(
|
|
545
|
-
|
|
545
|
+
`${PROCESS_PREFIX}/context/${processId}`,
|
|
546
|
+
{ includeSteps }
|
|
546
547
|
);
|
|
547
548
|
return response.data;
|
|
548
549
|
} catch (error) {
|
|
@@ -551,12 +552,12 @@ var getProcessData = async (apiClient, processId) => {
|
|
|
551
552
|
}
|
|
552
553
|
};
|
|
553
554
|
var getStepData = async (apiClient, stepId) => {
|
|
554
|
-
if (stepId
|
|
555
|
+
if (!stepId) {
|
|
555
556
|
throw new Error("Step ID cannot be null or undefined");
|
|
556
557
|
}
|
|
557
558
|
try {
|
|
558
559
|
const response = await apiClient.get(
|
|
559
|
-
|
|
560
|
+
`${PROCESS_PREFIX}/stepContext/${stepId}`
|
|
560
561
|
);
|
|
561
562
|
return response.data;
|
|
562
563
|
} catch (error) {
|
|
@@ -567,7 +568,7 @@ var getStepData = async (apiClient, stepId) => {
|
|
|
567
568
|
var bulkTerminate = async (apiClient, processIds, reason) => {
|
|
568
569
|
try {
|
|
569
570
|
const response = await apiClient.post(
|
|
570
|
-
|
|
571
|
+
`${PROCESS_PREFIX}/bulkTerminate`,
|
|
571
572
|
{
|
|
572
573
|
params: { reason },
|
|
573
574
|
data: processIds
|
|
@@ -584,7 +585,7 @@ var bulkTerminate = async (apiClient, processIds, reason) => {
|
|
|
584
585
|
var bulkResume = async (apiClient, processIds) => {
|
|
585
586
|
try {
|
|
586
587
|
const response = await apiClient.post(
|
|
587
|
-
|
|
588
|
+
`${PROCESS_PREFIX}/bulkResume`,
|
|
588
589
|
{
|
|
589
590
|
data: processIds
|
|
590
591
|
}
|
|
@@ -600,7 +601,7 @@ var bulkResume = async (apiClient, processIds) => {
|
|
|
600
601
|
var bulkReviewed = async (apiClient, processIds, reason) => {
|
|
601
602
|
try {
|
|
602
603
|
const response = await apiClient.post(
|
|
603
|
-
|
|
604
|
+
`${PROCESS_PREFIX}/bulkReviewed`,
|
|
604
605
|
{
|
|
605
606
|
data: processIds,
|
|
606
607
|
params: { reason }
|
|
@@ -623,7 +624,7 @@ var rerun = async (apiClient, processId, clientId, version) => {
|
|
|
623
624
|
params["version"] = version;
|
|
624
625
|
}
|
|
625
626
|
try {
|
|
626
|
-
const response = await apiClient.post(
|
|
627
|
+
const response = await apiClient.post(`${PROCESS_PREFIX}/rerun`, {
|
|
627
628
|
params
|
|
628
629
|
});
|
|
629
630
|
return response.data;
|
|
@@ -662,7 +663,7 @@ var searchProcessExecutions = async (apiClient, params) => {
|
|
|
662
663
|
const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));
|
|
663
664
|
try {
|
|
664
665
|
const response = await apiClient.get(
|
|
665
|
-
|
|
666
|
+
`${PROCESS_PREFIX}/api/stats/process/search`,
|
|
666
667
|
updatedParams
|
|
667
668
|
);
|
|
668
669
|
console.log("Response:", response);
|
|
@@ -675,7 +676,7 @@ var searchProcessExecutions = async (apiClient, params) => {
|
|
|
675
676
|
var invokeApiMappingGet = async (apiClient, endpoint, id, correlationId, apiCallType) => {
|
|
676
677
|
try {
|
|
677
678
|
const response = await apiClient.get(
|
|
678
|
-
|
|
679
|
+
`${PROCESS_PREFIX}/api/call/${endpoint}`,
|
|
679
680
|
{
|
|
680
681
|
id,
|
|
681
682
|
correlationId,
|
|
@@ -692,7 +693,7 @@ var invokeApiMappingGet = async (apiClient, endpoint, id, correlationId, apiCall
|
|
|
692
693
|
var invokeApiMappingPost = async (apiClient, endpoint, input, id, correlationId, apiCallType = "ASYNC" /* ASYNC */) => {
|
|
693
694
|
try {
|
|
694
695
|
const response = await apiClient.post(
|
|
695
|
-
|
|
696
|
+
`${PROCESS_PREFIX}/api/call/${endpoint}`,
|
|
696
697
|
{
|
|
697
698
|
data: input,
|
|
698
699
|
params: {
|
|
@@ -732,15 +733,14 @@ var UnmeshedClient = class {
|
|
|
732
733
|
startPolling(workers) {
|
|
733
734
|
startPollingWorkers(this.client, workers);
|
|
734
735
|
}
|
|
735
|
-
// Other methods for interacting with Unmeshed API
|
|
736
736
|
runProcessSync(ProcessRequestData2) {
|
|
737
737
|
return runProcessSync(this.client, ProcessRequestData2);
|
|
738
738
|
}
|
|
739
739
|
runProcessAsync(ProcessRequestData2) {
|
|
740
740
|
return runProcessAsync(this.client, ProcessRequestData2);
|
|
741
741
|
}
|
|
742
|
-
getProcessData(processId) {
|
|
743
|
-
return getProcessData(this.client, processId);
|
|
742
|
+
getProcessData(processId, includeSteps) {
|
|
743
|
+
return getProcessData(this.client, processId, includeSteps);
|
|
744
744
|
}
|
|
745
745
|
getStepData(stepId) {
|
|
746
746
|
return getStepData(this.client, stepId);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/apis/unmeshedApiClient.ts","../src/utils/unmeshedCommonUtils.ts","../src/types/index.ts","../src/apis/queuedWorker.ts","../src/apis/pollerClientImpl.ts","../src/apis/processClientImpl.ts","../src/apis/registrationClientImpl.ts","../src/index.ts"],"sourcesContent":["import axios, {AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders} from \"axios\";\nimport {\n ApiResponse,\n ClientRequestConfig, FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from \"../types\";\nimport {UnmeshedCommonUtils} from \"../utils/unmeshedCommonUtils\";\n\nexport class UnmeshedApiClient {\n\n private axiosInstance: AxiosInstance | null = null;\n private clientId: string | undefined = undefined;\n private _config: FinalUnmeshedClientConfig;\n\n constructor(unmeshedClientConfig: UnmeshedClientConfig) {\n console.log(\"Initializing Unmeshed ApiClient\");\n\n this._config = createUnmeshedClientConfig(unmeshedClientConfig);\n\n console.log(this._config);\n\n this.clientId = this._config.clientId;\n\n if (!this._config.baseUrl) {\n throw new Error(\"baseUrl is required\");\n }\n\n const baseURL = this._config.port ? `${this._config.baseUrl}:${this._config.port}` : this._config.baseUrl;\n\n this.axiosInstance = axios.create({\n baseURL,\n timeout: this._config.timeout,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer client.sdk.${this._config.clientId}.${UnmeshedCommonUtils.createSecureHash(\n this._config.authToken\n )}`,\n } as RawAxiosRequestHeaders,\n });\n }\n\n private async handleRequest<T>({\n method,\n endpoint,\n params,\n data,\n config,\n }: HandleRequestConfig): Promise<ApiResponse<T>> {\n\n if (!this.axiosInstance) {\n throw new Error(\"ApiClient must be initialized before making requests\");\n }\n\n try {\n const response: AxiosResponse<T> = await this.axiosInstance.request<T>({\n method,\n url: endpoint,\n params,\n data,\n ...config,\n } as AxiosRequestConfig);\n\n return {\n data: response.data,\n status: response.status,\n headers: response.headers as Record<string, string>,\n };\n } catch (error) {\n if (axios.isAxiosError(error)) {\n console.error(\"Request failed:\", error.message);\n throw this.handleError(error);\n }\n console.error(\"Unexpected error:\", (error as Error).message);\n throw error;\n }\n }\n\n private handleError(error: AxiosError): Error {\n console.error(\"Error details:\", {\n message: error.message,\n status: error.response?.status,\n data: error.response?.data,\n });\n\n let response = error?.response?.data as ErrorResponse;\n if (response?.errorMessage) {\n return new Error(`${response.errorMessage} [Status code: ${error.response?.status || ''}]`)\n }\n\n return new Error(error.message, {cause: error.response?.data || {}});\n }\n\n public async get<T = any>(\n endpoint: string,\n params?: QueryParams,\n config?: RequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"get\",\n endpoint: endpoint,\n params: params,\n config: config,\n });\n }\n\n public async post<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"post\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async put<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"put\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async delete<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"delete\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public getClientId(): string | undefined {\n return this.clientId;\n }\n\n\n get config(): FinalUnmeshedClientConfig {\n return this._config;\n }\n}\n\ninterface ErrorResponse {\n errorMessage?: string;\n [key: string]: any; // To allow other unexpected properties\n}\n\nexport function createUnmeshedClientConfig(config: UnmeshedClientConfig): Required<FinalUnmeshedClientConfig> {\n return {\n baseUrl: config.baseUrl,\n clientId: config.clientId,\n authToken: config.authToken,\n port: config.port ?? 443,\n timeout: config.timeout ?? 5000,\n pollInterval: config.pollInterval ?? 100,\n apiWorkerTimeout: config.apiWorkerTimeout ?? 10000,\n pollTimeout: config.pollTimeout ?? 10000,\n responsePollInterval: config.responsePollInterval ?? 100,\n responsePollTimeout: config.responsePollTimeout ?? 10000,\n responseBatchSize: config.responseBatchSize ?? 50,\n };\n}\n","import { createHash } from \"crypto\";\n\nexport class UnmeshedCommonUtils {\n static createSecureHash(input: string): string {\n try {\n const hash = createHash(\"sha256\");\n hash.update(input, \"utf8\");\n return hash.digest(\"hex\");\n } catch (e) {\n throw new Error(\"Error creating hash\");\n }\n }\n}\n","import { AxiosRequestConfig } from \"axios\";\n\nexport enum ApiCallType {\n SYNC = \"SYNC\",\n ASYNC = \"ASYNC\",\n STREAM = \"STREAM\",\n}\n\nexport interface ApiMappingData {\n endpoint: string;\n processDefNamespace: string;\n processDefName: string;\n processDefVersion: number;\n authType: string;\n authClaims: string;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n}\n\nexport type ApiMappingWebhookData = {\n endpoint: string;\n name: string;\n uniqueId: string;\n urlSecret: string;\n description: string;\n userIdentifier: string;\n webhookSource: WebhookSource;\n webhookSourceConfig: Record<string, string>;\n expiryDate: Date;\n userType: SQAuthUserType;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n};\n\nexport enum WebhookSource {\n MS_TEAMS = \"MS_TEAMS\",\n NOT_DEFINED = \"NOT_DEFINED\",\n}\n\nexport enum SQAuthUserType {\n USER = \"USER\",\n API = \"API\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport enum StepType {\n WORKER = \"WORKER\",\n HTTP = \"HTTP\",\n WAIT = \"WAIT\",\n FAIL = \"FAIL\",\n PYTHON = \"PYTHON\",\n JAVASCRIPT = \"JAVASCRIPT\",\n JQ = \"JQ\",\n MANAGED = \"MANAGED\",\n BUILTIN = \"BUILTIN\",\n NOOP = \"NOOP\",\n PERSISTED_STATE = \"PERSISTED_STATE\",\n DEPENDSON = \"DEPENDSON\",\n INTEGRATION = \"INTEGRATION\",\n EXIT = \"EXIT\",\n SUB_PROCESS = \"SUB_PROCESS\",\n LIST = \"LIST\",\n PARALLEL = \"PARALLEL\",\n FOREACH = \"FOREACH\",\n SWITCH = \"SWITCH\",\n}\n\nexport enum StepStatus {\n PENDING = \"PENDING\",\n SCHEDULED = \"SCHEDULED\",\n RUNNING = \"RUNNING\",\n PAUSED = \"PAUSED\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n SKIPPED = \"SKIPPED\",\n CANCELLED = \"CANCELLED\",\n}\n\nexport enum ProcessStatus {\n RUNNING = \"RUNNING\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n CANCELLED = \"CANCELLED\",\n TERMINATED = \"TERMINATED\",\n REVIEWED = \"REVIEWED\",\n}\n\nexport enum ProcessTriggerType {\n MANUAL = \"MANUAL\",\n SCHEDULED = \"SCHEDULED\",\n API_MAPPING = \"API_MAPPING\",\n WEBHOOK = \"WEBHOOK\",\n API = \"API\",\n SUB_PROCESS = \"SUB_PROCESS\",\n}\n\nexport enum ProcessType {\n STANDARD = \"STANDARD\",\n DYNAMIC = \"DYNAMIC\",\n API_ORCHESTRATION = \"API_ORCHESTRATION\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport type ClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n};\n\nexport type FullClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n tokenValue: string;\n};\n\nexport type StepQueueNameData = {\n orgId: number;\n namespace: string;\n stepType: StepType;\n name: string;\n};\n\nexport type ProcessActionResponseData = {\n count: number;\n details: ProcessActionResponseDetailData[];\n};\n\nexport type ProcessActionResponseDetailData = {\n id: string;\n message: string;\n error: string;\n};\n\nexport type ProcessData = {\n processId: number;\n processType: ProcessType;\n triggerType: ProcessTriggerType;\n namespace: string;\n name: string;\n version: number | null;\n processDefinitionHistoryId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n stepIds: StepId[];\n stepDataById: Record<number, StepData>;\n created: number;\n updated: number;\n createdBy: string;\n};\n\nexport type StepData = {\n id: number;\n processId: number;\n ref: string;\n parentId: number | null;\n parentRef: string | null;\n namespace: string;\n name: string;\n type: StepType;\n stepDefinitionHistoryId: number | null;\n status: StepStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n workerId: string;\n start: number;\n schedule: number;\n priority: number;\n updated: number;\n optional: boolean;\n executionList: StepExecutionData[];\n};\n\nexport type StepExecutionData = {\n id: number;\n scheduled: number;\n polled: number;\n start: number;\n updated: number;\n executor: string;\n ref: string;\n runs: number;\n output: Record<string, unknown>;\n};\n\nexport type StepId = {\n id: number;\n processId: number;\n ref: string;\n};\n\nexport type ProcessRequestData = {\n name: string;\n namespace: string;\n version: number | null;\n requestId: string;\n correlationId: string;\n input: Record<string, unknown>;\n};\n\nexport type ProcessSearchRequest = {\n startTimeEpoch: number;\n endTimeEpoch?: number | null;\n namespace: string;\n processTypes: ProcessType[];\n triggerTypes: ProcessTriggerType[];\n names: string[];\n processIds: number[];\n correlationIds: string[];\n requestIds: string[];\n statuses: ProcessStatus[];\n limit: number;\n offset: number;\n};\n\nexport type StepSize = {\n stepQueueNameData: StepQueueNameData;\n size: number | null;\n};\n\nexport type ClientSubmitResult = {\n processId: number;\n stepId: number;\n errorMessage: string | null;\n httpStatusCode: number | null;\n};\n\nexport type WorkRequest = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n stepName: string;\n stepNamespace: string;\n stepRef: string;\n inputParam: Record<string, unknown>;\n isOptional: boolean;\n polled: number;\n scheduled: number;\n updated: number;\n priority: number;\n};\n\nexport type WorkResponse = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n output: Record<string, unknown>;\n status: StepStatus;\n rescheduleAfterSeconds: number | null;\n startedAt: number;\n};\n\nexport type WorkResult = {\n output: unknown;\n taskExecutionId: string;\n startTime: number;\n endTime: number;\n workRequest: WorkRequest;\n};\n\nexport interface FinalUnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout: number;\n apiWorkerTimeout: number;\n pollTimeout: number;\n pollInterval: number;\n responsePollInterval: number;\n responsePollTimeout: number;\n responseBatchSize: number;\n}\n\nexport interface UnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout?: number;\n apiWorkerTimeout?: number;\n pollTimeout?: number;\n pollInterval?: number;\n responsePollInterval?: number;\n responsePollTimeout?: number;\n responseBatchSize?: number;\n}\n\nexport interface ApiResponse<T = any> {\n data: T;\n status: number;\n headers: Record<string, string>;\n}\n\nexport interface ApiError extends Error {\n status?: number;\n response?: {\n data?: any;\n status: number;\n headers: Record<string, string>;\n };\n}\n\nexport interface QueryParams {\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface RequestConfig\n extends Omit<AxiosRequestConfig, \"baseURL\" | \"url\" | \"method\"> {\n headers?: Record<string, string>;\n}\n\nexport interface HandleRequestConfig {\n method: \"get\" | \"post\" | \"put\" | \"delete\";\n endpoint: string;\n params?: QueryParams;\n data?: Record<string, unknown>;\n config?: RequestConfig;\n}\n\nexport interface ClientRequestConfig {\n params?: QueryParams;\n data?: any;\n config?: RequestConfig;\n}\n\ninterface UnmeshedWorker {\n (input: Record<string, any>): Promise<any>;\n}\n\nexport interface UnmeshedWorkerConfig {\n worker: UnmeshedWorker;\n namespace: string;\n name: string;\n maxInProgress: number;\n}\n\nexport interface PollRequestData {\n stepQueueNameData: StepQueueNameData;\n size: number;\n}\nexport interface RenewRegistrationParams {\n friendlyName: string;\n}\n","export type WorkerFunction<T> = (items: T[]) => Promise<void>;\n\nexport class QueuedWorker<T> {\n\n private readonly queue: BlockingQueue<T>;\n private readonly pollIntervalMs: number;\n private readonly batchSize: number;\n private readonly workerFn: WorkerFunction<T>;\n private readonly timeoutMs: number;\n\n constructor(\n capacity: number,\n pollIntervalMs: number,\n batchSize: number,\n workerFn: WorkerFunction<T>,\n timeoutMs: number\n ) {\n this.queue = new BlockingQueue<T>(capacity);\n this.pollIntervalMs = pollIntervalMs;\n this.batchSize = batchSize;\n this.workerFn = workerFn;\n this.timeoutMs = timeoutMs;\n\n console.log(`Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`);\n // noinspection JSIgnoredPromiseFromCall\n this.start();\n }\n\n async start(): Promise<void> {\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (true) {\n try {\n const batch = await this.queue.takeBatch(this.batchSize);\n if(batch.length > 0) {\n console.log(`Batch work ${batch.length} received`);\n await this.runWithTimeout(this.workerFn(batch), this.timeoutMs);\n }\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));\n }\n }\n\n private async runWithTimeout(task: Promise<void>, timeoutMs: number): Promise<void> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then(() => {\n clearTimeout(timeout);\n resolve();\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n }\n\n async put(item: T): Promise<void> {\n await this.queue.put(item);\n }\n\n}\n\n\nclass BlockingQueue<T> {\n private queue: T[] = [];\n private readonly capacity: number;\n\n constructor(capacity: number) {\n if (capacity <= 0) {\n throw new Error(\"Capacity must be greater than 0\");\n }\n this.capacity = capacity;\n }\n\n async put(item: T): Promise<void> {\n while (this.queue.length >= this.capacity) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n this.queue.push(item);\n }\n\n async takeBatch(batchSize: number): Promise<T[]> {\n while (this.queue.length === 0) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n return this.queue.splice(0, batchSize);\n }\n\n size(): number {\n return this.queue.length;\n }\n\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n peek(): T | undefined {\n return this.queue[0];\n }\n}\n","import {\n ApiResponse,\n PollRequestData,\n StepQueueNameData,\n StepStatus,\n UnmeshedWorkerConfig,\n WorkRequest,\n WorkResponse,\n} from \"../types\";\nimport {UnmeshedApiClient} from \"./unmeshedApiClient\";\nimport {QueuedWorker} from \"./queuedWorker\";\n\nasync function registerPolling(\n apiClient: UnmeshedApiClient,\n data: StepQueueNameData[]\n) {\n const attempt = async (): Promise<any> => {\n try {\n const response = await apiClient.put(\"/api/clients/register\", {\n data: data,\n });\n console.log(\"Successfully renewed registration for workers\", data);\n return response.data;\n } catch {\n console.error(\n \"An error occurred during polling registration. Retrying in 3 seconds...\"\n );\n await new Promise((resolve) => setTimeout(resolve, 3000));\n return attempt();\n }\n };\n\n return attempt();\n}\n\nasync function pollWorker(apiClient: UnmeshedApiClient, data: PollRequestData[]): Promise<WorkRequest[]> {\n try {\n const response: ApiResponse<WorkRequest[]> = await apiClient.post(\"/api/clients/poll\", {data: data});\n if(response.data && response.data.length > 0) {\n console.log(`Received ${response.data.length} work requests`);\n }\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during worker polling\", error);\n }\n}\n\nasync function postWorkerResponse(apiClient: UnmeshedApiClient, workResponses: WorkResponse[]) {\n try {\n if (workResponses.length > 0) {\n const grouped: Record<StepStatus, number[]> = workResponses.reduce((acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n }, {} as Record<StepStatus, number[]>);\n const resultString = Object.entries(grouped)\n .map(([status, stepIds]) => `${status}: [${stepIds.join(\", \")}]`)\n .join(\", \");\n console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`)\n const response = await apiClient.post(\"/api/clients/bulkResults\", {\n data: workResponses,\n });\n return response.data;\n }\n return {};\n } catch (error) {\n console.log(\"Error:\", error);\n }\n}\n\nasync function runPollWithTimeout(task: Promise<WorkRequest[]>, timeoutMs: number): Promise<WorkRequest[]> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n}\n\nexport const continuePolling: { value: boolean } = {\n value: true,\n};\n\nexport async function pollForWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[]\n) {\n\n const queuedWorker: QueuedWorker<WorkResponse> = new QueuedWorker<WorkResponse>(\n 100000,\n apiClient.config.responsePollInterval,\n apiClient.config.responseBatchSize,\n async (batchWork: WorkResponse[]) => {\n await postWorkerResponse(apiClient, batchWork);\n },\n apiClient.config.responsePollTimeout,\n );\n\n const registerPollingData = workers.map((worker) => {\n return {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n } as StepQueueNameData;\n });\n\n await registerPolling(apiClient, registerPollingData);\n\n const pollWorkerData = workers.map((worker) => {\n return {\n stepQueueNameData: {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n },\n size: worker.maxInProgress,\n } as PollRequestData;\n });\n\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (continuePolling.value) {\n try {\n const workRequests: WorkRequest[] = await runPollWithTimeout(pollWorker(apiClient, pollWorkerData), apiClient.config.pollTimeout);\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) =>\n worker.name === polledWorker.stepName &&\n worker.namespace === polledWorker.stepNamespace\n );\n\n let workerResponse: WorkResponse = {\n processId: polledWorker.processId,\n stepId: polledWorker.stepId,\n stepExecutionId: polledWorker.stepExecutionId,\n runCount: polledWorker.runCount,\n output: {},\n status: StepStatus.RUNNING,\n rescheduleAfterSeconds: null,\n startedAt: new Date().getTime(),\n };\n\n if (!associatedWorker) {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `No worker found for ${polledWorker.stepName} ${polledWorker.stepNamespace}`,\n },\n status: StepStatus.TIMED_OUT,\n };\n await queuedWorker.put(workerResponse);\n continue;\n }\n\n const TIMEOUT = apiClient.config.apiWorkerTimeout;\n\n const timeoutPromise = new Promise((_, reject) => {\n setTimeout(() => reject(new Error(\"Timed out\")), TIMEOUT);\n });\n\n try {\n console.log(`Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`);\n const result = await Promise.race([\n associatedWorker.worker(polledWorker.inputParam),\n timeoutPromise,\n ]);\n\n workerResponse = {\n ...workerResponse,\n output: {\n ...result,\n __workCompletedAt: new Date().getTime(),\n },\n status: StepStatus.COMPLETED,\n };\n } catch (error: unknown) {\n const err = error as Error;\n if (err.message && err.message === \"Timed out\") {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `${err.message} based on work timeout settings in worker - ${apiClient.config.apiWorkerTimeout} ms`,\n },\n status: StepStatus.TIMED_OUT,\n };\n } else {\n workerResponse = {\n ...workerResponse,\n output: {\n error: safeStringifyError(err)\n },\n status: StepStatus.FAILED,\n };\n console.error(\"Error:\", err.message);\n }\n }\n await queuedWorker.put(workerResponse);\n }\n await new Promise((resolve) => setTimeout(resolve, apiClient.config.pollInterval));\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n }\n}\n\nfunction safeStringifyError(error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...error, // Include enumerable custom properties if they exist\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n}\n\nexport async function startPollingWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[],\n intervalMs: number = 5000\n) {\n async function pollCycle() {\n try {\n await pollForWorkers(apiClient, workers);\n } catch (error) {\n console.error(\"Error during worker polling:\", error);\n }\n\n setTimeout(pollCycle, intervalMs);\n }\n\n await pollCycle();\n}\n","import {\n ApiCallType,\n ProcessActionResponseData,\n ProcessData,\n ProcessRequestData,\n ProcessSearchRequest,\n StepData,\n} from \"../types\";\nimport { isAxiosError } from \"axios\";\nimport { UnmeshedApiClient } from \"./unmeshedApiClient\";\n\nconst RUN_PROCESS_REQUEST_URL = \"api/process/\";\n\nexport const runProcessSync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + \"runSync\", {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n });\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const runProcessAsync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"runAsync\",\n {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const getProcessData = async (\n apiClient: UnmeshedApiClient,\n processId: number\n): Promise<ProcessData> => {\n if (processId == null) {\n throw new Error(\"Process ID cannot be null\");\n }\n try {\n const response = await apiClient.get<ProcessData>(\n RUN_PROCESS_REQUEST_URL + \"context/\" + processId\n );\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while fetching process record: \", error);\n throw error;\n }\n};\n\nexport const getStepData = async (\n apiClient: UnmeshedApiClient,\n stepId: number | null\n): Promise<StepData> => {\n if (stepId === null || stepId === undefined) {\n throw new Error(\"Step ID cannot be null or undefined\");\n }\n\n try {\n const response = await apiClient.get<StepData>(\n RUN_PROCESS_REQUEST_URL + \"stepContext/\" + stepId\n );\n return response.data;\n } catch (error) {\n console.log(\"Error occurred while getStepData: \", error);\n throw error\n }\n};\n\nexport const bulkTerminate = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"bulkTerminate\",\n {\n params: { reason },\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while terminating processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"bulkResume\",\n {\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while resuming processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkReviewed = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"bulkReviewed\",\n {\n data: processIds,\n params: { reason },\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while marking processes as reviewed: ${\n err.message || error\n }`\n );\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n clientId: string,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\n clientId,\n processId,\n };\n\n if (version !== undefined) {\n params[\"version\"] = version;\n }\n\n try {\n const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + \"rerun\", {\n params,\n });\n\n return response.data as ProcessData;\n } catch (error) {\n if (isAxiosError(error)) {\n throw new Error(\n `HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`\n );\n } else {\n const err = error as Error;\n throw new Error(\n `Unexpected error during rerun process: ${err.message || err}`\n );\n }\n }\n};\n\nexport const searchProcessExecutions = async (\n apiClient: UnmeshedApiClient,\n params: ProcessSearchRequest\n) => {\n const queryParams = new URLSearchParams();\n\n if (params.startTimeEpoch !== undefined && params.startTimeEpoch !== 0)\n queryParams.set(\"startTimeEpoch\", params.startTimeEpoch.toString());\n if (params.endTimeEpoch !== undefined && params.endTimeEpoch !== 0)\n queryParams.set(\"endTimeEpoch\", (params.endTimeEpoch || 0).toString());\n if (params.namespace) queryParams.set(\"namespace\", params.namespace);\n if (params.names && params.names.length)\n queryParams.set(\"names\", params.names.join(\",\"));\n if (params.processIds && params.processIds.length)\n queryParams.set(\"processIds\", params.processIds.join(\",\"));\n if (params.correlationIds && params.correlationIds.length)\n queryParams.set(\"correlationIds\", params.correlationIds.join(\",\"));\n if (params.requestIds && params.requestIds.length)\n queryParams.set(\"requestIds\", params.requestIds.join(\",\"));\n if (params.statuses && params.statuses.length)\n queryParams.set(\"statuses\", params.statuses.join(\",\"));\n if (params.triggerTypes && params.triggerTypes.length)\n queryParams.set(\"triggerTypes\", params.triggerTypes.join(\",\"));\n\n const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));\n\n try {\n const response = await apiClient.get(\n RUN_PROCESS_REQUEST_URL + \"api/stats/process/search\",\n updatedParams\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while searching process executions: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingGet = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n) => {\n try {\n const response = await apiClient.get(\n RUN_PROCESS_REQUEST_URL + \"api/call/\" + endpoint,\n {\n id: id,\n correlationId: correlationId,\n apiCallType,\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping GET: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingPost = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType = ApiCallType.ASYNC\n): Promise<any> => {\n try {\n const response = await apiClient.post(\n RUN_PROCESS_REQUEST_URL + \"api/call/\" + endpoint,\n {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\n },\n }\n );\n\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping POST: \", error);\n throw error;\n }\n};\n","import { RenewRegistrationParams } from \"../types\";\nimport { UnmeshedApiClient } from \"./unmeshedApiClient\";\n\nexport const renewRegistration = async (\n apiClient: UnmeshedApiClient,\n params: RenewRegistrationParams\n): Promise<string> => {\n try {\n const response = await apiClient.put(\"/api/clients/register\", {\n params: { ...params },\n });\n console.debug(\"Response from server:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during registration renewal:\", error);\n throw error;\n }\n};\n","import {\n ApiCallType,\n ProcessRequestData,\n ProcessSearchRequest,\n RenewRegistrationParams,\n UnmeshedClientConfig,\n UnmeshedWorkerConfig,\n} from \"./types\";\nimport {UnmeshedApiClient} from \"./apis/unmeshedApiClient\";\nimport {startPollingWorkers} from \"./apis/pollerClientImpl\";\nimport {\n bulkResume,\n bulkReviewed,\n bulkTerminate,\n getProcessData,\n getStepData,\n invokeApiMappingGet,\n invokeApiMappingPost,\n rerun,\n runProcessAsync,\n runProcessSync,\n searchProcessExecutions,\n} from \"./apis/processClientImpl\";\nimport {renewRegistration} from \"./apis/registrationClientImpl\";\n\nexport class UnmeshedClient {\n private client: UnmeshedApiClient;\n\n constructor(config: UnmeshedClientConfig) {\n this.client = new UnmeshedApiClient(config);\n }\n\n startPolling(workers: UnmeshedWorkerConfig[]) {\n startPollingWorkers(this.client, workers);\n }\n\n // Other methods for interacting with Unmeshed API\n\n runProcessSync(ProcessRequestData: ProcessRequestData) {\n return runProcessSync(this.client, ProcessRequestData);\n }\n\n runProcessAsync(ProcessRequestData: ProcessRequestData) {\n return runProcessAsync(this.client, ProcessRequestData);\n }\n\n getProcessData(processId: number) {\n return getProcessData(this.client, processId);\n }\n\n getStepData(stepId: number) {\n return getStepData(this.client, stepId);\n }\n\n bulkTerminate(processIds: number[], reason?: string) {\n return bulkTerminate(this.client, processIds, reason);\n }\n\n bulkResume(processIds: number[]) {\n return bulkResume(this.client, processIds);\n }\n\n bulkReviewed(processIds: number[], reason?: string) {\n return bulkReviewed(this.client, processIds, reason);\n }\n\n reRun(processId: number, clientId: string, version?: number) {\n return rerun(this.client, processId, clientId, version);\n }\n\n searchProcessExecution(params: ProcessSearchRequest) {\n return searchProcessExecutions(this.client, params);\n }\n\n invokeApiMappingGet(\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingGet(\n apiClient,\n endpoint,\n id,\n correlationId,\n apiCallType\n );\n }\n\n invokeApiMappingPost(\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingPost(\n this.client,\n endpoint,\n input,\n id,\n correlationId,\n apiCallType\n );\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n}\n\nexport * from \"./types\";\n"],"mappings":";AAAA,OAAO,WAAmG;;;ACA1G,SAAS,kBAAkB;AAEpB,IAAM,sBAAN,MAA0B;AAAA,EAC/B,OAAO,iBAAiB,OAAuB;AAC7C,QAAI;AACF,YAAM,OAAO,WAAW,QAAQ;AAChC,WAAK,OAAO,OAAO,MAAM;AACzB,aAAO,KAAK,OAAO,KAAK;AAAA,IAC1B,SAAS,GAAG;AACV,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACvC;AAAA,EACF;AACF;;;ADDO,IAAM,oBAAN,MAAwB;AAAA,EAEnB,gBAAsC;AAAA,EACtC,WAA+B;AAAA,EAC/B;AAAA,EAER,YAAY,sBAA4C;AACpD,YAAQ,IAAI,iCAAiC;AAE7C,SAAK,UAAU,2BAA2B,oBAAoB;AAE9D,YAAQ,IAAI,KAAK,OAAO;AAExB,SAAK,WAAW,KAAK,QAAQ;AAE7B,QAAI,CAAC,KAAK,QAAQ,SAAS;AACvB,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACzC;AAEA,UAAM,UAAU,KAAK,QAAQ,O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;AAAA,EAEA,qBACI,UACA,OACA,IACA,eACA,aACF;AACE,WAAO;AAAA,MACH,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,kBAAkB,QAAiC;AAC/C,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAChD;AACJ;","names":["ApiCallType","WebhookSource","SQAuthUserType","StepType","StepStatus","ProcessStatus","ProcessTriggerType","ProcessType","response","ProcessRequestData","ProcessRequestData"]}
|
|
1
|
+
{"version":3,"sources":["../src/apis/unmeshedApiClient.ts","../src/utils/unmeshedCommonUtils.ts","../src/types/index.ts","../src/apis/queuedWorker.ts","../src/apis/pollerClientImpl.ts","../src/apis/processClientImpl.ts","../src/apis/registrationClientImpl.ts","../src/index.ts"],"sourcesContent":["import axios, {AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders} from \"axios\";\nimport {\n ApiResponse,\n ClientRequestConfig, FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from \"../types\";\nimport {UnmeshedCommonUtils} from \"../utils/unmeshedCommonUtils\";\n\nexport class UnmeshedApiClient {\n\n private axiosInstance: AxiosInstance | null = null;\n private clientId: string | undefined = undefined;\n private _config: FinalUnmeshedClientConfig;\n\n constructor(unmeshedClientConfig: UnmeshedClientConfig) {\n console.log(\"Initializing Unmeshed ApiClient\");\n\n this._config = createUnmeshedClientConfig(unmeshedClientConfig);\n\n console.log(this._config);\n\n this.clientId = this._config.clientId;\n\n if (!this._config.baseUrl) {\n throw new Error(\"baseUrl is required\");\n }\n\n const baseURL = this._config.port ? `${this._config.baseUrl}:${this._config.port}` : this._config.baseUrl;\n\n this.axiosInstance = axios.create({\n baseURL,\n timeout: this._config.timeout,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer client.sdk.${this._config.clientId}.${UnmeshedCommonUtils.createSecureHash(\n this._config.authToken\n )}`,\n } as RawAxiosRequestHeaders,\n });\n }\n\n private async handleRequest<T>({\n method,\n endpoint,\n params,\n data,\n config,\n }: HandleRequestConfig): Promise<ApiResponse<T>> {\n\n if (!this.axiosInstance) {\n throw new Error(\"ApiClient must be initialized before making requests\");\n }\n\n try {\n const response: AxiosResponse<T> = await this.axiosInstance.request<T>({\n method,\n url: endpoint,\n params,\n data,\n ...config,\n } as AxiosRequestConfig);\n\n return {\n data: response.data,\n status: response.status,\n headers: response.headers as Record<string, string>,\n };\n } catch (error) {\n if (axios.isAxiosError(error)) {\n console.error(\"Request failed:\", error.message);\n throw this.handleError(error);\n }\n console.error(\"Unexpected error:\", (error as Error).message);\n throw error;\n }\n }\n\n private handleError(error: AxiosError): Error {\n console.error(\"Error details:\", {\n message: error.message,\n status: error.response?.status,\n data: error.response?.data,\n });\n\n let response = error?.response?.data as ErrorResponse;\n if (response?.errorMessage) {\n return new Error(`${response.errorMessage} [Status code: ${error.response?.status || ''}]`)\n }\n\n return new Error(error.message, {cause: error.response?.data || {}});\n }\n\n public async get<T = any>(\n endpoint: string,\n params?: QueryParams,\n config?: RequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"get\",\n endpoint: endpoint,\n params: params,\n config: config,\n });\n }\n\n public async post<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"post\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async put<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"put\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public async delete<T = any>(\n endpoint: string,\n clientRequestConfig: ClientRequestConfig\n ): Promise<ApiResponse<T>> {\n return this.handleRequest<T>({\n method: \"delete\",\n endpoint: endpoint,\n ...clientRequestConfig,\n });\n }\n\n public getClientId(): string | undefined {\n return this.clientId;\n }\n\n\n get config(): FinalUnmeshedClientConfig {\n return this._config;\n }\n}\n\ninterface ErrorResponse {\n errorMessage?: string;\n [key: string]: any; // To allow other unexpected properties\n}\n\nexport function createUnmeshedClientConfig(config: UnmeshedClientConfig): Required<FinalUnmeshedClientConfig> {\n return {\n baseUrl: config.baseUrl,\n clientId: config.clientId,\n authToken: config.authToken,\n port: config.port ?? 443,\n timeout: config.timeout ?? 5000,\n pollInterval: config.pollInterval ?? 100,\n apiWorkerTimeout: config.apiWorkerTimeout ?? 10000,\n pollTimeout: config.pollTimeout ?? 10000,\n responsePollInterval: config.responsePollInterval ?? 100,\n responsePollTimeout: config.responsePollTimeout ?? 10000,\n responseBatchSize: config.responseBatchSize ?? 50,\n };\n}\n","import { createHash } from \"crypto\";\n\nexport class UnmeshedCommonUtils {\n static createSecureHash(input: string): string {\n try {\n const hash = createHash(\"sha256\");\n hash.update(input, \"utf8\");\n return hash.digest(\"hex\");\n } catch (e) {\n throw new Error(\"Error creating hash\");\n }\n }\n}\n","import { AxiosRequestConfig } from \"axios\";\n\nexport enum ApiCallType {\n SYNC = \"SYNC\",\n ASYNC = \"ASYNC\",\n STREAM = \"STREAM\",\n}\n\nexport interface ApiMappingData {\n endpoint: string;\n processDefNamespace: string;\n processDefName: string;\n processDefVersion: number;\n authType: string;\n authClaims: string;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n}\n\nexport type ApiMappingWebhookData = {\n endpoint: string;\n name: string;\n uniqueId: string;\n urlSecret: string;\n description: string;\n userIdentifier: string;\n webhookSource: WebhookSource;\n webhookSourceConfig: Record<string, string>;\n expiryDate: Date;\n userType: SQAuthUserType;\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n};\n\nexport enum WebhookSource {\n MS_TEAMS = \"MS_TEAMS\",\n NOT_DEFINED = \"NOT_DEFINED\",\n}\n\nexport enum SQAuthUserType {\n USER = \"USER\",\n API = \"API\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport enum StepType {\n WORKER = \"WORKER\",\n HTTP = \"HTTP\",\n WAIT = \"WAIT\",\n FAIL = \"FAIL\",\n PYTHON = \"PYTHON\",\n JAVASCRIPT = \"JAVASCRIPT\",\n JQ = \"JQ\",\n MANAGED = \"MANAGED\",\n BUILTIN = \"BUILTIN\",\n NOOP = \"NOOP\",\n PERSISTED_STATE = \"PERSISTED_STATE\",\n DEPENDSON = \"DEPENDSON\",\n INTEGRATION = \"INTEGRATION\",\n EXIT = \"EXIT\",\n SUB_PROCESS = \"SUB_PROCESS\",\n LIST = \"LIST\",\n PARALLEL = \"PARALLEL\",\n FOREACH = \"FOREACH\",\n SWITCH = \"SWITCH\",\n}\n\nexport enum StepStatus {\n PENDING = \"PENDING\",\n SCHEDULED = \"SCHEDULED\",\n RUNNING = \"RUNNING\",\n PAUSED = \"PAUSED\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n SKIPPED = \"SKIPPED\",\n CANCELLED = \"CANCELLED\",\n}\n\nexport enum ProcessStatus {\n RUNNING = \"RUNNING\",\n COMPLETED = \"COMPLETED\",\n FAILED = \"FAILED\",\n TIMED_OUT = \"TIMED_OUT\",\n CANCELLED = \"CANCELLED\",\n TERMINATED = \"TERMINATED\",\n REVIEWED = \"REVIEWED\",\n}\n\nexport enum ProcessTriggerType {\n MANUAL = \"MANUAL\",\n SCHEDULED = \"SCHEDULED\",\n API_MAPPING = \"API_MAPPING\",\n WEBHOOK = \"WEBHOOK\",\n API = \"API\",\n SUB_PROCESS = \"SUB_PROCESS\",\n}\n\nexport enum ProcessType {\n STANDARD = \"STANDARD\",\n DYNAMIC = \"DYNAMIC\",\n API_ORCHESTRATION = \"API_ORCHESTRATION\",\n INTERNAL = \"INTERNAL\",\n}\n\nexport type ClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n};\n\nexport type FullClientProfileData = {\n clientId: string;\n ipAddress: string;\n friendlyName: string;\n userIdentifier: string;\n stepQueueNames: StepQueueNameData[];\n createdBy: string;\n updatedBy: string;\n created: Date;\n updated: Date;\n expiryDate: Date;\n tokenValue: string;\n};\n\nexport type StepQueueNameData = {\n orgId: number;\n namespace: string;\n stepType: StepType;\n name: string;\n};\n\nexport type ProcessActionResponseData = {\n count: number;\n details: ProcessActionResponseDetailData[];\n};\n\nexport type ProcessActionResponseDetailData = {\n id: string;\n message: string;\n error: string;\n};\n\nexport type ProcessData = {\n processId: number;\n processType: ProcessType;\n triggerType: ProcessTriggerType;\n namespace: string;\n name: string;\n version: number | null;\n processDefinitionHistoryId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n stepIds: StepId[];\n stepDataById: Record<number, StepData>;\n created: number;\n updated: number;\n createdBy: string;\n};\n\nexport type StepData = {\n id: number;\n processId: number;\n ref: string;\n parentId: number | null;\n parentRef: string | null;\n namespace: string;\n name: string;\n type: StepType;\n stepDefinitionHistoryId: number | null;\n status: StepStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n workerId: string;\n start: number;\n schedule: number;\n priority: number;\n updated: number;\n optional: boolean;\n executionList: StepExecutionData[];\n};\n\nexport type StepExecutionData = {\n id: number;\n scheduled: number;\n polled: number;\n start: number;\n updated: number;\n executor: string;\n ref: string;\n runs: number;\n output: Record<string, unknown>;\n};\n\nexport type StepId = {\n id: number;\n processId: number;\n ref: string;\n};\n\nexport type ProcessRequestData = {\n name: string;\n namespace: string;\n version: number | null;\n requestId: string;\n correlationId: string;\n input: Record<string, unknown>;\n};\n\nexport type ProcessSearchRequest = {\n startTimeEpoch: number;\n endTimeEpoch?: number | null;\n namespace: string;\n processTypes: ProcessType[];\n triggerTypes: ProcessTriggerType[];\n names: string[];\n processIds: number[];\n correlationIds: string[];\n requestIds: string[];\n statuses: ProcessStatus[];\n limit: number;\n offset: number;\n};\n\nexport type StepSize = {\n stepQueueNameData: StepQueueNameData;\n size: number | null;\n};\n\nexport type ClientSubmitResult = {\n processId: number;\n stepId: number;\n errorMessage: string | null;\n httpStatusCode: number | null;\n};\n\nexport type WorkRequest = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n stepName: string;\n stepNamespace: string;\n stepRef: string;\n inputParam: Record<string, unknown>;\n isOptional: boolean;\n polled: number;\n scheduled: number;\n updated: number;\n priority: number;\n};\n\nexport type WorkResponse = {\n processId: number;\n stepId: number;\n stepExecutionId: number;\n runCount: number;\n output: Record<string, unknown>;\n status: StepStatus;\n rescheduleAfterSeconds: number | null;\n startedAt: number;\n};\n\nexport type WorkResult = {\n output: unknown;\n taskExecutionId: string;\n startTime: number;\n endTime: number;\n workRequest: WorkRequest;\n};\n\nexport interface FinalUnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout: number;\n apiWorkerTimeout: number;\n pollTimeout: number;\n pollInterval: number;\n responsePollInterval: number;\n responsePollTimeout: number;\n responseBatchSize: number;\n}\n\nexport interface UnmeshedClientConfig {\n baseUrl: string;\n clientId: string;\n authToken: string;\n port: string | number;\n timeout?: number;\n apiWorkerTimeout?: number;\n pollTimeout?: number;\n pollInterval?: number;\n responsePollInterval?: number;\n responsePollTimeout?: number;\n responseBatchSize?: number;\n}\n\nexport interface ApiResponse<T = any> {\n data: T;\n status: number;\n headers: Record<string, string>;\n}\n\nexport interface ApiError extends Error {\n status?: number;\n response?: {\n data?: any;\n status: number;\n headers: Record<string, string>;\n };\n}\n\nexport interface QueryParams {\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface RequestConfig\n extends Omit<AxiosRequestConfig, \"baseURL\" | \"url\" | \"method\"> {\n headers?: Record<string, string>;\n}\n\nexport interface HandleRequestConfig {\n method: \"get\" | \"post\" | \"put\" | \"delete\";\n endpoint: string;\n params?: QueryParams;\n data?: Record<string, unknown>;\n config?: RequestConfig;\n}\n\nexport interface ClientRequestConfig {\n params?: QueryParams;\n data?: any;\n config?: RequestConfig;\n}\n\ninterface UnmeshedWorker {\n (input: Record<string, any>): Promise<any>;\n}\n\nexport interface UnmeshedWorkerConfig {\n worker: UnmeshedWorker;\n namespace: string;\n name: string;\n maxInProgress: number;\n}\n\nexport interface PollRequestData {\n stepQueueNameData: StepQueueNameData;\n size: number;\n}\nexport interface RenewRegistrationParams {\n friendlyName: string;\n}\n","export type WorkerFunction<T> = (items: T[]) => Promise<void>;\n\nexport class QueuedWorker<T> {\n\n private readonly queue: BlockingQueue<T>;\n private readonly pollIntervalMs: number;\n private readonly batchSize: number;\n private readonly workerFn: WorkerFunction<T>;\n private readonly timeoutMs: number;\n\n constructor(\n capacity: number,\n pollIntervalMs: number,\n batchSize: number,\n workerFn: WorkerFunction<T>,\n timeoutMs: number\n ) {\n this.queue = new BlockingQueue<T>(capacity);\n this.pollIntervalMs = pollIntervalMs;\n this.batchSize = batchSize;\n this.workerFn = workerFn;\n this.timeoutMs = timeoutMs;\n\n console.log(`Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`);\n // noinspection JSIgnoredPromiseFromCall\n this.start();\n }\n\n async start(): Promise<void> {\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (true) {\n try {\n const batch = await this.queue.takeBatch(this.batchSize);\n if(batch.length > 0) {\n console.log(`Batch work ${batch.length} received`);\n await this.runWithTimeout(this.workerFn(batch), this.timeoutMs);\n }\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));\n }\n }\n\n private async runWithTimeout(task: Promise<void>, timeoutMs: number): Promise<void> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then(() => {\n clearTimeout(timeout);\n resolve();\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n }\n\n async put(item: T): Promise<void> {\n await this.queue.put(item);\n }\n\n}\n\n\nclass BlockingQueue<T> {\n private queue: T[] = [];\n private readonly capacity: number;\n\n constructor(capacity: number) {\n if (capacity <= 0) {\n throw new Error(\"Capacity must be greater than 0\");\n }\n this.capacity = capacity;\n }\n\n async put(item: T): Promise<void> {\n while (this.queue.length >= this.capacity) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n this.queue.push(item);\n }\n\n async takeBatch(batchSize: number): Promise<T[]> {\n while (this.queue.length === 0) {\n await new Promise((resolve) => setTimeout(resolve, 10));\n }\n return this.queue.splice(0, batchSize);\n }\n\n size(): number {\n return this.queue.length;\n }\n\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n peek(): T | undefined {\n return this.queue[0];\n }\n}\n","import {\n ApiResponse,\n PollRequestData,\n StepQueueNameData,\n StepStatus,\n UnmeshedWorkerConfig,\n WorkRequest,\n WorkResponse,\n} from \"../types\";\nimport {UnmeshedApiClient} from \"./unmeshedApiClient\";\nimport {QueuedWorker} from \"./queuedWorker\";\n\nasync function registerPolling(\n apiClient: UnmeshedApiClient,\n data: StepQueueNameData[]\n) {\n const attempt = async (): Promise<any> => {\n try {\n const response = await apiClient.put(`/api/clients/register`, {\n data: data,\n });\n console.log(\"Successfully renewed registration for workers\", data);\n return response.data;\n } catch {\n console.error(\n \"An error occurred during polling registration. Retrying in 3 seconds...\"\n );\n await new Promise((resolve) => setTimeout(resolve, 3000));\n return attempt();\n }\n };\n\n return attempt();\n}\n\nasync function pollWorker(apiClient: UnmeshedApiClient, data: PollRequestData[]): Promise<WorkRequest[]> {\n try {\n const response: ApiResponse<WorkRequest[]> = await apiClient.post(`/api/clients/poll`, {data: data});\n if(response.data && response.data.length > 0) {\n console.log(`Received ${response.data.length} work requests`);\n }\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during worker polling\", error);\n }\n}\n\nasync function postWorkerResponse(apiClient: UnmeshedApiClient, workResponses: WorkResponse[]) {\n try {\n if (workResponses.length > 0) {\n const grouped: Record<StepStatus, number[]> = workResponses.reduce((acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n }, {} as Record<StepStatus, number[]>);\n const resultString = Object.entries(grouped)\n .map(([status, stepIds]) => `${status}: [${stepIds.join(\", \")}]`)\n .join(\", \");\n console.log(`Posting response of size: ${workResponses.length} including ids: ${resultString}`)\n const response = await apiClient.post(`/api/clients/bulkResults`, {\n data: workResponses,\n });\n return response.data;\n }\n return {};\n } catch (error) {\n console.log(\"Error:\", error);\n }\n}\n\nasync function runPollWithTimeout(task: Promise<WorkRequest[]>, timeoutMs: number): Promise<WorkRequest[]> {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(\"Task timed out\")), timeoutMs);\n task.then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n }).catch((error) => {\n clearTimeout(timeout);\n reject(error);\n });\n });\n}\n\nexport const continuePolling: { value: boolean } = {\n value: true,\n};\n\nexport async function pollForWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[]\n) {\n\n const queuedWorker: QueuedWorker<WorkResponse> = new QueuedWorker<WorkResponse>(\n 100000,\n apiClient.config.responsePollInterval,\n apiClient.config.responseBatchSize,\n async (batchWork: WorkResponse[]) => {\n await postWorkerResponse(apiClient, batchWork);\n },\n apiClient.config.responsePollTimeout,\n );\n\n const registerPollingData = workers.map((worker) => {\n return {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n } as StepQueueNameData;\n });\n\n await registerPolling(apiClient, registerPollingData);\n\n const pollWorkerData = workers.map((worker) => {\n return {\n stepQueueNameData: {\n orgId: 0,\n namespace: worker.namespace,\n stepType: \"WORKER\",\n name: worker.name,\n },\n size: worker.maxInProgress,\n } as PollRequestData;\n });\n\n let errorCount = 0;\n // noinspection InfiniteLoopJS\n while (continuePolling.value) {\n try {\n const workRequests: WorkRequest[] = await runPollWithTimeout(pollWorker(apiClient, pollWorkerData), apiClient.config.pollTimeout);\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) =>\n worker.name === polledWorker.stepName &&\n worker.namespace === polledWorker.stepNamespace\n );\n\n let workerResponse: WorkResponse = {\n processId: polledWorker.processId,\n stepId: polledWorker.stepId,\n stepExecutionId: polledWorker.stepExecutionId,\n runCount: polledWorker.runCount,\n output: {},\n status: StepStatus.RUNNING,\n rescheduleAfterSeconds: null,\n startedAt: new Date().getTime(),\n };\n\n if (!associatedWorker) {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `No worker found for ${polledWorker.stepName} ${polledWorker.stepNamespace}`,\n },\n status: StepStatus.TIMED_OUT,\n };\n await queuedWorker.put(workerResponse);\n continue;\n }\n\n const TIMEOUT = apiClient.config.apiWorkerTimeout;\n\n const timeoutPromise = new Promise((_, reject) => {\n setTimeout(() => reject(new Error(\"Timed out\")), TIMEOUT);\n });\n\n try {\n console.log(`Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`);\n const result = await Promise.race([\n associatedWorker.worker(polledWorker.inputParam),\n timeoutPromise,\n ]);\n\n workerResponse = {\n ...workerResponse,\n output: {\n ...result,\n __workCompletedAt: new Date().getTime(),\n },\n status: StepStatus.COMPLETED,\n };\n } catch (error: unknown) {\n const err = error as Error;\n if (err.message && err.message === \"Timed out\") {\n workerResponse = {\n ...workerResponse,\n output: {\n error: `${err.message} based on work timeout settings in worker - ${apiClient.config.apiWorkerTimeout} ms`,\n },\n status: StepStatus.TIMED_OUT,\n };\n } else {\n workerResponse = {\n ...workerResponse,\n output: {\n error: safeStringifyError(err)\n },\n status: StepStatus.FAILED,\n };\n console.error(\"Error:\", err.message);\n }\n }\n await queuedWorker.put(workerResponse);\n }\n await new Promise((resolve) => setTimeout(resolve, apiClient.config.pollInterval));\n } catch (error) {\n errorCount++;\n console.error(`Error processing batch - error count : ${errorCount} - `, error);\n await new Promise((resolve) => setTimeout(resolve, 1000));\n }\n }\n}\n\nfunction safeStringifyError(error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...error, // Include enumerable custom properties if they exist\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n}\n\nexport async function startPollingWorkers(\n apiClient: UnmeshedApiClient,\n workers: UnmeshedWorkerConfig[],\n intervalMs: number = 5000\n) {\n async function pollCycle() {\n try {\n await pollForWorkers(apiClient, workers);\n } catch (error) {\n console.error(\"Error during worker polling:\", error);\n }\n\n setTimeout(pollCycle, intervalMs);\n }\n\n await pollCycle();\n}\n","import {\n ApiCallType,\n ProcessActionResponseData,\n ProcessData,\n ProcessRequestData,\n ProcessSearchRequest,\n StepData,\n} from \"../types\";\nimport {isAxiosError} from \"axios\";\nimport {UnmeshedApiClient} from \"./unmeshedApiClient\";\n\nconst PROCESS_PREFIX = \"api/process\";\n\nexport const runProcessSync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/runSync`, {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n });\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const runProcessAsync = async (\n apiClient: UnmeshedApiClient,\n ProcessRequestData: ProcessRequestData\n): Promise<ProcessData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/runAsync`,\n {\n data: ProcessRequestData,\n params: {\n clientId: apiClient.getClientId(),\n },\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Some error occurred running process request : \", error);\n throw error;\n }\n};\n\nexport const getProcessData = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n includeSteps: boolean = false\n): Promise<ProcessData> => {\n if (!processId) {\n throw new Error(\"Process ID cannot be null\");\n }\n try {\n const response = await apiClient.get<ProcessData>(\n `${PROCESS_PREFIX}/context/${processId}`,\n {includeSteps}\n );\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while fetching process record: \", error);\n throw error;\n }\n};\n\nexport const getStepData = async (\n apiClient: UnmeshedApiClient,\n stepId: number\n): Promise<StepData> => {\n if (!stepId) {\n throw new Error(\"Step ID cannot be null or undefined\");\n }\n try {\n const response = await apiClient.get<StepData>(\n `${PROCESS_PREFIX}/stepContext/${stepId}`\n );\n return response.data;\n } catch (error) {\n console.log(\"Error occurred while getStepData: \", error);\n throw error\n }\n};\n\nexport const bulkTerminate = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/bulkTerminate`,\n {\n params: {reason},\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while terminating processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/bulkResume`,\n {\n data: processIds,\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while resuming processes: ${err.message || error}`\n );\n }\n};\n\nexport const bulkReviewed = async (\n apiClient: UnmeshedApiClient,\n processIds: number[],\n reason?: string\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/bulkReviewed`,\n {\n data: processIds,\n params: {reason},\n }\n );\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(\n `Error occurred while marking processes as reviewed: ${\n err.message || error\n }`\n );\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n clientId: string,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\n clientId,\n processId,\n };\n\n if (version !== undefined) {\n params[\"version\"] = version;\n }\n\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/rerun`, {\n params,\n });\n\n return response.data as ProcessData;\n } catch (error) {\n if (isAxiosError(error)) {\n throw new Error(\n `HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`\n );\n } else {\n const err = error as Error;\n throw new Error(\n `Unexpected error during rerun process: ${err.message || err}`\n );\n }\n }\n};\n\nexport const searchProcessExecutions = async (\n apiClient: UnmeshedApiClient,\n params: ProcessSearchRequest\n) => {\n const queryParams = new URLSearchParams();\n\n if (params.startTimeEpoch !== undefined && params.startTimeEpoch !== 0)\n queryParams.set(\"startTimeEpoch\", params.startTimeEpoch.toString());\n if (params.endTimeEpoch !== undefined && params.endTimeEpoch !== 0)\n queryParams.set(\"endTimeEpoch\", (params.endTimeEpoch || 0).toString());\n if (params.namespace) queryParams.set(\"namespace\", params.namespace);\n if (params.names && params.names.length)\n queryParams.set(\"names\", params.names.join(\",\"));\n if (params.processIds && params.processIds.length)\n queryParams.set(\"processIds\", params.processIds.join(\",\"));\n if (params.correlationIds && params.correlationIds.length)\n queryParams.set(\"correlationIds\", params.correlationIds.join(\",\"));\n if (params.requestIds && params.requestIds.length)\n queryParams.set(\"requestIds\", params.requestIds.join(\",\"));\n if (params.statuses && params.statuses.length)\n queryParams.set(\"statuses\", params.statuses.join(\",\"));\n if (params.triggerTypes && params.triggerTypes.length)\n queryParams.set(\"triggerTypes\", params.triggerTypes.join(\",\"));\n\n const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));\n\n try {\n const response = await apiClient.get(\n `${PROCESS_PREFIX}/api/stats/process/search`,\n updatedParams\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while searching process executions: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingGet = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n) => {\n try {\n const response = await apiClient.get(\n `${PROCESS_PREFIX}/api/call/${endpoint}`,\n {\n id: id,\n correlationId: correlationId,\n apiCallType,\n }\n );\n console.log(\"Response:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping GET: \", error);\n throw error;\n }\n};\n\nexport const invokeApiMappingPost = async (\n apiClient: UnmeshedApiClient,\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType = ApiCallType.ASYNC\n): Promise<any> => {\n try {\n const response = await apiClient.post(\n `${PROCESS_PREFIX}/api/call/${endpoint}`,\n {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\n },\n }\n );\n\n return response.data;\n } catch (error) {\n console.error(\"Error occurred while invoking API Mapping POST: \", error);\n throw error;\n }\n};\n","import { RenewRegistrationParams } from \"../types\";\nimport { UnmeshedApiClient } from \"./unmeshedApiClient\";\n\nexport const renewRegistration = async (\n apiClient: UnmeshedApiClient,\n params: RenewRegistrationParams\n): Promise<string> => {\n try {\n const response = await apiClient.put(\"/api/clients/register\", {\n params: { ...params },\n });\n console.debug(\"Response from server:\", response);\n return response.data;\n } catch (error) {\n console.error(\"Error occurred during registration renewal:\", error);\n throw error;\n }\n};\n","import {\n ApiCallType,\n ProcessRequestData,\n ProcessSearchRequest,\n RenewRegistrationParams,\n UnmeshedClientConfig,\n UnmeshedWorkerConfig,\n} from \"./types\";\nimport {UnmeshedApiClient} from \"./apis/unmeshedApiClient\";\nimport {startPollingWorkers} from \"./apis/pollerClientImpl\";\nimport {\n bulkResume,\n bulkReviewed,\n bulkTerminate,\n getProcessData,\n getStepData,\n invokeApiMappingGet,\n invokeApiMappingPost,\n rerun,\n runProcessAsync,\n runProcessSync,\n searchProcessExecutions,\n} from \"./apis/processClientImpl\";\nimport {renewRegistration} from \"./apis/registrationClientImpl\";\n\n// noinspection JSUnusedGlobalSymbols\nexport class UnmeshedClient {\n private client: UnmeshedApiClient;\n\n constructor(config: UnmeshedClientConfig) {\n this.client = new UnmeshedApiClient(config);\n }\n\n startPolling(workers: UnmeshedWorkerConfig[]) {\n startPollingWorkers(this.client, workers);\n }\n\n runProcessSync(ProcessRequestData: ProcessRequestData) {\n return runProcessSync(this.client, ProcessRequestData);\n }\n\n runProcessAsync(ProcessRequestData: ProcessRequestData) {\n return runProcessAsync(this.client, ProcessRequestData);\n }\n\n getProcessData(processId: number, includeSteps: boolean) {\n return getProcessData(this.client, processId, includeSteps);\n }\n\n getStepData(stepId: number) {\n return getStepData(this.client, stepId);\n }\n\n bulkTerminate(processIds: number[], reason?: string) {\n return bulkTerminate(this.client, processIds, reason);\n }\n\n bulkResume(processIds: number[]) {\n return bulkResume(this.client, processIds);\n }\n\n bulkReviewed(processIds: number[], reason?: string) {\n return bulkReviewed(this.client, processIds, reason);\n }\n\n reRun(processId: number, clientId: string, version?: number) {\n return rerun(this.client, processId, clientId, version);\n }\n\n searchProcessExecution(params: ProcessSearchRequest) {\n return searchProcessExecutions(this.client, params);\n }\n\n invokeApiMappingGet(\n apiClient: UnmeshedApiClient,\n endpoint: string,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingGet(\n apiClient,\n endpoint,\n id,\n correlationId,\n apiCallType\n );\n }\n\n invokeApiMappingPost(\n endpoint: string,\n input: Record<string, any>,\n id: string,\n correlationId: string,\n apiCallType: ApiCallType\n ) {\n return invokeApiMappingPost(\n this.client,\n endpoint,\n input,\n id,\n correlationId,\n apiCallType\n );\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n\n}\n\nexport * from \"./types\";\n"],"mappings":";AAAA,OAAO,WAAmG;;;ACA1G,SAAS,kBAAkB;A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AA,EAC1D;AAAA,EAEA,eAAe,WAAmB,cAAuB;AACrD,WAAO,eAAe,KAAK,QAAQ,WAAW,YAAY;AAAA,EAC9D;AAAA,EAEA,YAAY,QAAgB;AACxB,WAAO,YAAY,KAAK,QAAQ,MAAM;AAAA,EAC1C;AAAA,EAEA,cAAc,YAAsB,QAAiB;AACjD,WAAO,cAAc,KAAK,QAAQ,YAAY,MAAM;AAAA,EACxD;AAAA,EAEA,WAAW,YAAsB;AAC7B,WAAO,WAAW,KAAK,QAAQ,UAAU;AAAA,EAC7C;AAAA,EAEA,aAAa,YAAsB,QAAiB;AAChD,WAAO,aAAa,KAAK,QAAQ,YAAY,MAAM;AAAA,EACvD;AAAA,EAEA,MAAM,WAAmB,UAAkB,SAAkB;AACzD,WAAO,MAAM,KAAK,QAAQ,WAAW,UAAU,OAAO;AAAA,EAC1D;AAAA,EAEA,uBAAuB,QAA8B;AACjD,WAAO,wBAAwB,KAAK,QAAQ,MAAM;AAAA,EACtD;AAAA,EAEA,oBACI,WACA,UACA,IACA,eACA,aACF;AACE,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,qBACI,UACA,OACA,IACA,eACA,aACF;AACE,WAAO;AAAA,MACH,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,kBAAkB,QAAiC;AAC/C,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAChD;AAEJ;","names":["ApiCallType","WebhookSource","SQAuthUserType","StepType","StepStatus","ProcessStatus","ProcessTriggerType","ProcessType","response","ProcessRequestData","ProcessRequestData"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unmeshed/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Unmeshed TS/JS SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,7 +22,14 @@
|
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"typescript",
|
|
25
|
-
"library"
|
|
25
|
+
"library",
|
|
26
|
+
"unmeshed",
|
|
27
|
+
"netflixconductor",
|
|
28
|
+
"javascript",
|
|
29
|
+
"orchestration",
|
|
30
|
+
"scheduler",
|
|
31
|
+
"workflows",
|
|
32
|
+
"automations"
|
|
26
33
|
],
|
|
27
34
|
"author": "Your Name",
|
|
28
35
|
"license": "MIT",
|