@unmeshed/sdk 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apiClient.d.ts +2 -2
- package/dist/apiClient.js +28 -11
- package/dist/apiClient.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -0
- package/dist/poller/pollerClientImpl.js +22 -14
- package/dist/poller/pollerClientImpl.js.map +1 -0
- package/dist/process/processClientImpl.d.ts +1 -1
- package/dist/process/processClientImpl.js +54 -33
- package/dist/process/processClientImpl.js.map +1 -0
- package/dist/registration/registrationClientImpl.js +8 -3
- package/dist/registration/registrationClientImpl.js.map +1 -0
- package/dist/sampleTest.d.ts +1 -0
- package/dist/sampleTest.js +82 -0
- package/dist/sampleTest.js.map +1 -0
- package/dist/types/index.js +20 -16
- package/dist/types/index.js.map +1 -0
- package/dist/utils/unmeshedCommonUtils.js +8 -3
- package/dist/utils/unmeshedCommonUtils.js.map +1 -0
- package/package.json +11 -13
- package/src/apiClient.ts +142 -0
- package/src/index.ts +43 -0
- package/src/poller/pollerClientImpl.ts +150 -0
- package/src/process/processClientImpl.ts +267 -0
- package/src/registration/registrationClientImpl.ts +17 -0
- package/src/sampleTest.ts +86 -0
- package/src/types/index.ts +349 -0
- package/src/utils/unmeshedCommonUtils.ts +13 -0
- package/dist/sample/sampleAPI.d.ts +0 -2
- package/dist/sample/sampleAPI.js +0 -29
- package/dist/sample/server.d.ts +0 -1
- package/dist/sample/server.js +0 -9
- package/dist/src/apiClient.d.ts +0 -14
- package/dist/src/apiClient.js +0 -99
- package/dist/src/index.d.ts +0 -21
- package/dist/src/index.js +0 -22
- package/dist/src/poller/pollerClientImpl.d.ts +0 -2
- package/dist/src/poller/pollerClientImpl.js +0 -126
- package/dist/src/process/processClientImpl.d.ts +0 -12
- package/dist/src/process/processClientImpl.js +0 -187
- package/dist/src/registration/registrationClientImpl.d.ts +0 -1
- package/dist/src/registration/registrationClientImpl.js +0 -17
- package/dist/src/sample/server.d.ts +0 -1
- package/dist/src/sample/server.js +0 -9
- package/dist/src/types/index.d.ts +0 -313
- package/dist/src/types/index.js +0 -77
- package/dist/src/utils/unmeshedCommonUtils.d.ts +0 -3
- package/dist/src/utils/unmeshedCommonUtils.js +0 -13
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/unmeshedCommonUtils.d.ts +0 -3
- package/dist/types/unmeshedCommonUtils.js +0 -17
package/dist/apiClient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiClientConfig, ApiResponse, ClientRequestConfig, QueryParams, RequestConfig } from "./types
|
|
1
|
+
import { ApiClientConfig, ApiResponse, ClientRequestConfig, QueryParams, RequestConfig } from "./types";
|
|
2
2
|
export declare class ApiClient {
|
|
3
3
|
private axiosInstance;
|
|
4
4
|
private clientId;
|
|
@@ -10,5 +10,5 @@ export declare class ApiClient {
|
|
|
10
10
|
post<T = any>(endpoint: string, clientRequestConfig: ClientRequestConfig): Promise<ApiResponse<T>>;
|
|
11
11
|
put<T = any>(endpoint: string, clientRequestConfig: ClientRequestConfig): Promise<ApiResponse<T>>;
|
|
12
12
|
delete<T = any>(endpoint: string, clientRequestConfig: ClientRequestConfig): Promise<ApiResponse<T>>;
|
|
13
|
-
getClientId(): string |
|
|
13
|
+
getClientId(): string | undefined;
|
|
14
14
|
}
|
package/dist/apiClient.js
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ApiClient = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const unmeshedCommonUtils_1 = require("./utils/unmeshedCommonUtils");
|
|
9
|
+
class ApiClient {
|
|
10
|
+
axiosInstance = null;
|
|
11
|
+
clientId = undefined;
|
|
8
12
|
initialize(config) {
|
|
13
|
+
console.log("Initializing Unmeshed ApiClient");
|
|
9
14
|
const { clientId, authToken, baseUrl, port, timeout = 10000 } = config;
|
|
10
15
|
this.clientId = clientId;
|
|
11
16
|
if (!baseUrl) {
|
|
12
17
|
throw new Error("baseUrl is required");
|
|
13
18
|
}
|
|
14
19
|
const baseURL = port ? `${baseUrl}:${port}` : baseUrl;
|
|
15
|
-
this.axiosInstance =
|
|
20
|
+
this.axiosInstance = axios_1.default.create({
|
|
16
21
|
baseURL,
|
|
17
22
|
timeout,
|
|
18
23
|
headers: {
|
|
19
24
|
"Content-Type": "application/json",
|
|
20
|
-
Authorization: `Bearer client.sdk.${clientId}.${UnmeshedCommonUtils.createSecureHash(authToken)}`,
|
|
25
|
+
Authorization: `Bearer client.sdk.${clientId}.${unmeshedCommonUtils_1.UnmeshedCommonUtils.createSecureHash(authToken)}`,
|
|
21
26
|
},
|
|
22
27
|
});
|
|
23
28
|
}
|
|
@@ -29,6 +34,10 @@ export class ApiClient {
|
|
|
29
34
|
async handleRequest({ method, endpoint, params, data, config, }) {
|
|
30
35
|
this.validateInstance();
|
|
31
36
|
try {
|
|
37
|
+
// Assert that axiosInstance exists before using it
|
|
38
|
+
if (!this.axiosInstance) {
|
|
39
|
+
throw new Error("Axios instance is not initialized");
|
|
40
|
+
}
|
|
32
41
|
const response = await this.axiosInstance.request({
|
|
33
42
|
method,
|
|
34
43
|
url: endpoint,
|
|
@@ -43,8 +52,14 @@ export class ApiClient {
|
|
|
43
52
|
};
|
|
44
53
|
}
|
|
45
54
|
catch (error) {
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
56
|
+
console.error("Request failed:", error.message);
|
|
57
|
+
throw this.handleError(error);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
console.error("Unexpected error:", error.message);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
48
63
|
}
|
|
49
64
|
}
|
|
50
65
|
handleError(error) {
|
|
@@ -87,3 +102,5 @@ export class ApiClient {
|
|
|
87
102
|
return this.clientId;
|
|
88
103
|
}
|
|
89
104
|
}
|
|
105
|
+
exports.ApiClient = ApiClient;
|
|
106
|
+
//# sourceMappingURL=apiClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiClient.js","sourceRoot":"","sources":["../src/apiClient.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAwE;AASxE,qEAAkE;AAElE,MAAa,SAAS;IACZ,aAAa,GAAyB,IAAI,CAAC;IAC3C,QAAQ,GAAuB,SAAS,CAAC;IAE1C,UAAU,CAAC,MAAuB;QACvC,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAEvE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAEtD,IAAI,CAAC,aAAa,GAAG,eAAK,CAAC,MAAM,CAAC;YAChC,OAAO;YACP,OAAO;YACP,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,qBAAqB,QAAQ,IAAI,yCAAmB,CAAC,gBAAgB,CAClF,SAAS,CACV,EAAE;aACJ;SACF,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,IAAI,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,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI;SAC3B,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,GAAG,CACd,QAAgB,EAChB,MAAoB,EACpB,MAAsB;QAEtB,OAAO,IAAI,CAAC,aAAa,CAAI;YAC3B,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,IAAI,CACf,QAAgB,EAChB,mBAAwC;QAExC,OAAO,IAAI,CAAC,aAAa,CAAI;YAC3B,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,QAAQ;YAClB,GAAG,mBAAmB;SACvB,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,GAAG,CACd,QAAgB,EAChB,mBAAwC;QAExC,OAAO,IAAI,CAAC,aAAa,CAAI;YAC3B,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,QAAQ;YAClB,GAAG,mBAAmB;SACvB,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,MAAM,CACjB,QAAgB,EAChB,mBAAwC;QAExC,OAAO,IAAI,CAAC,aAAa,CAAI;YAC3B,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,QAAQ;YAClB,GAAG,mBAAmB;SACvB,CAAC,CAAC;IACL,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAlID,8BAkIC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { ApiCallType, ApiClientConfig, ProcessRequestData, ProcessSearchRequest
|
|
|
4
4
|
export declare const apiClient: ApiClient;
|
|
5
5
|
declare const UnmeshedClient: {
|
|
6
6
|
initialize: (config: ApiClientConfig) => void;
|
|
7
|
-
runProcessSync: (ProcessRequestData: ProcessRequestData) => Promise<
|
|
8
|
-
runProcessAsync: (ProcessRequestData: ProcessRequestData) => Promise<
|
|
9
|
-
getProcessData: (processId: number) => Promise<
|
|
10
|
-
getStepData: (stepId: number | null) => Promise<
|
|
11
|
-
bulkTerminate: (processIds: number[], reason?: string) => Promise<
|
|
12
|
-
bulkResume: (processIds: number[]) => Promise<
|
|
13
|
-
bulkReviewed: (processIds: number[], reason?: string) => Promise<
|
|
14
|
-
rerun: (processId: number, clientId: string, version?: number) => Promise<
|
|
7
|
+
runProcessSync: (ProcessRequestData: ProcessRequestData) => Promise<import("./types").ProcessData>;
|
|
8
|
+
runProcessAsync: (ProcessRequestData: ProcessRequestData) => Promise<import("./types").ProcessData>;
|
|
9
|
+
getProcessData: (processId: number) => Promise<import("./types").ProcessData>;
|
|
10
|
+
getStepData: (stepId: number | null) => Promise<import("./types").StepData>;
|
|
11
|
+
bulkTerminate: (processIds: number[], reason?: string) => Promise<import("./types").ProcessActionResponseData>;
|
|
12
|
+
bulkResume: (processIds: number[]) => Promise<import("./types").ProcessActionResponseData>;
|
|
13
|
+
bulkReviewed: (processIds: number[], reason?: string) => Promise<import("./types").ProcessActionResponseData>;
|
|
14
|
+
rerun: (processId: number, clientId: string, version?: number) => Promise<import("./types").ProcessData>;
|
|
15
15
|
searchProcessExecutions: (params: ProcessSearchRequest) => Promise<any>;
|
|
16
16
|
invokeApiMappingGet: (endpoint: string, id: string, correlationId: string, apiCallType: ApiCallType) => Promise<any>;
|
|
17
17
|
invokeApiMappingPost: (endpoint: string, input: Record<string, any>, id: string, correlationId: string, apiCallType?: ApiCallType) => Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.apiClient = void 0;
|
|
7
|
+
const apiClient_1 = require("./apiClient");
|
|
8
|
+
const pollerClientImpl_1 = __importDefault(require("./poller/pollerClientImpl"));
|
|
9
|
+
const processClientImpl_1 = require("./process/processClientImpl");
|
|
10
|
+
const registrationClientImpl_1 = require("./registration/registrationClientImpl");
|
|
11
|
+
exports.apiClient = new apiClient_1.ApiClient();
|
|
6
12
|
const UnmeshedClient = {
|
|
7
|
-
initialize: (config) => apiClient.initialize(config),
|
|
8
|
-
runProcessSync,
|
|
9
|
-
runProcessAsync,
|
|
10
|
-
getProcessData,
|
|
11
|
-
getStepData,
|
|
12
|
-
bulkTerminate,
|
|
13
|
-
bulkResume,
|
|
14
|
-
bulkReviewed,
|
|
15
|
-
rerun,
|
|
16
|
-
searchProcessExecutions,
|
|
17
|
-
invokeApiMappingGet,
|
|
18
|
-
invokeApiMappingPost,
|
|
19
|
-
renewRegistration,
|
|
20
|
-
pollForWorkers,
|
|
13
|
+
initialize: (config) => exports.apiClient.initialize(config),
|
|
14
|
+
runProcessSync: processClientImpl_1.runProcessSync,
|
|
15
|
+
runProcessAsync: processClientImpl_1.runProcessAsync,
|
|
16
|
+
getProcessData: processClientImpl_1.getProcessData,
|
|
17
|
+
getStepData: processClientImpl_1.getStepData,
|
|
18
|
+
bulkTerminate: processClientImpl_1.bulkTerminate,
|
|
19
|
+
bulkResume: processClientImpl_1.bulkResume,
|
|
20
|
+
bulkReviewed: processClientImpl_1.bulkReviewed,
|
|
21
|
+
rerun: processClientImpl_1.rerun,
|
|
22
|
+
searchProcessExecutions: processClientImpl_1.searchProcessExecutions,
|
|
23
|
+
invokeApiMappingGet: processClientImpl_1.invokeApiMappingGet,
|
|
24
|
+
invokeApiMappingPost: processClientImpl_1.invokeApiMappingPost,
|
|
25
|
+
renewRegistration: registrationClientImpl_1.renewRegistration,
|
|
26
|
+
pollForWorkers: pollerClientImpl_1.default,
|
|
21
27
|
};
|
|
22
|
-
|
|
28
|
+
exports.default = UnmeshedClient;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAwC;AACxC,iFAAuD;AACvD,mEAYqC;AACrC,kFAA0E;AAQ7D,QAAA,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAEzC,MAAM,cAAc,GAAG;IACrB,UAAU,EAAE,CAAC,MAAuB,EAAE,EAAE,CAAC,iBAAS,CAAC,UAAU,CAAC,MAAM,CAAC;IACrE,cAAc,EAAd,kCAAc;IACd,eAAe,EAAf,mCAAe;IACf,cAAc,EAAd,kCAAc;IACd,WAAW,EAAX,+BAAW;IACX,aAAa,EAAb,iCAAa;IACb,UAAU,EAAV,8BAAU;IACV,YAAY,EAAZ,gCAAY;IACZ,KAAK,EAAL,yBAAK;IACL,uBAAuB,EAAvB,2CAAuB;IACvB,mBAAmB,EAAnB,uCAAmB;IACnB,oBAAoB,EAApB,wCAAoB;IACpB,iBAAiB,EAAjB,0CAAiB;IACjB,cAAc,EAAd,0BAAc;CACf,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = pollForWorkers;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const types_1 = require("../types");
|
|
3
6
|
async function registerPolling(data) {
|
|
4
7
|
const attempt = async () => {
|
|
5
8
|
try {
|
|
6
|
-
const response = await apiClient.put("/api/clients/register", {
|
|
9
|
+
const response = await __1.apiClient.put("/api/clients/register", {
|
|
7
10
|
data: data,
|
|
8
11
|
});
|
|
9
12
|
console.log("Successfully executed polling registration...");
|
|
@@ -19,7 +22,7 @@ async function registerPolling(data) {
|
|
|
19
22
|
}
|
|
20
23
|
async function pollWorker(data) {
|
|
21
24
|
try {
|
|
22
|
-
const response = await apiClient.post("/api/clients/poll", {
|
|
25
|
+
const response = await __1.apiClient.post("/api/clients/poll", {
|
|
23
26
|
data: data,
|
|
24
27
|
});
|
|
25
28
|
console.log("Succesfully executed worker polling...");
|
|
@@ -31,7 +34,7 @@ async function pollWorker(data) {
|
|
|
31
34
|
}
|
|
32
35
|
async function pollWorkerResult(data) {
|
|
33
36
|
try {
|
|
34
|
-
const response = await apiClient.post("/api/clients/bulkResults", {
|
|
37
|
+
const response = await __1.apiClient.post("/api/clients/bulkResults", {
|
|
35
38
|
data: data,
|
|
36
39
|
});
|
|
37
40
|
console.log("Worker Result returned successfully...");
|
|
@@ -41,7 +44,7 @@ async function pollWorkerResult(data) {
|
|
|
41
44
|
console.log("Error:", error);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
async function pollForWorkers(workers) {
|
|
45
48
|
const registerPollingData = workers.map((worker) => {
|
|
46
49
|
return {
|
|
47
50
|
orgId: 0,
|
|
@@ -66,13 +69,16 @@ export default async function pollForWorkers(workers) {
|
|
|
66
69
|
const workerResult = await Promise.all(pollResponse.map(async (polledWorker) => {
|
|
67
70
|
const associatedWorker = workers.find((worker) => worker.name === polledWorker.stepName &&
|
|
68
71
|
worker.namespace === polledWorker.stepNamespace);
|
|
72
|
+
if (!associatedWorker) {
|
|
73
|
+
throw Error(`No worker found for ${polledWorker.stepName} ${polledWorker.stepNamespace}`);
|
|
74
|
+
}
|
|
69
75
|
let workerResponse = {
|
|
70
76
|
processId: polledWorker.processId,
|
|
71
77
|
stepId: polledWorker.stepId,
|
|
72
78
|
stepExecutionId: polledWorker.stepExecutionId,
|
|
73
79
|
runCount: polledWorker.runCount,
|
|
74
80
|
output: {},
|
|
75
|
-
status: StepStatus.RUNNING,
|
|
81
|
+
status: types_1.StepStatus.RUNNING,
|
|
76
82
|
rescheduleAfterSeconds: null,
|
|
77
83
|
startedAt: new Date().getTime(),
|
|
78
84
|
};
|
|
@@ -91,28 +97,29 @@ export default async function pollForWorkers(workers) {
|
|
|
91
97
|
...result,
|
|
92
98
|
__workCompletedAt: new Date().getTime(),
|
|
93
99
|
},
|
|
94
|
-
status: StepStatus.COMPLETED,
|
|
100
|
+
status: types_1.StepStatus.COMPLETED,
|
|
95
101
|
};
|
|
96
102
|
}
|
|
97
103
|
catch (error) {
|
|
98
|
-
|
|
104
|
+
const err = error;
|
|
105
|
+
if (err.message === "Timed out") {
|
|
99
106
|
workerResponse = {
|
|
100
107
|
...workerResponse,
|
|
101
108
|
output: {
|
|
102
|
-
error:
|
|
109
|
+
error: err.message,
|
|
103
110
|
},
|
|
104
|
-
status: StepStatus.TIMED_OUT,
|
|
111
|
+
status: types_1.StepStatus.TIMED_OUT,
|
|
105
112
|
};
|
|
106
113
|
}
|
|
107
114
|
else {
|
|
108
115
|
workerResponse = {
|
|
109
116
|
...workerResponse,
|
|
110
117
|
output: {
|
|
111
|
-
error:
|
|
118
|
+
error: err.message,
|
|
112
119
|
},
|
|
113
|
-
status: StepStatus.FAILED,
|
|
120
|
+
status: types_1.StepStatus.FAILED,
|
|
114
121
|
};
|
|
115
|
-
console.error("Error:",
|
|
122
|
+
console.error("Error:", err.message);
|
|
116
123
|
}
|
|
117
124
|
}
|
|
118
125
|
return workerResponse;
|
|
@@ -120,3 +127,4 @@ export default async function pollForWorkers(workers) {
|
|
|
120
127
|
const workerResultResponse = await pollWorkerResult(workerResult);
|
|
121
128
|
console.log("Worker result : ", workerResultResponse);
|
|
122
129
|
}
|
|
130
|
+
//# sourceMappingURL=pollerClientImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollerClientImpl.js","sourceRoot":"","sources":["../../src/poller/pollerClientImpl.ts"],"names":[],"mappings":";;AAsDA,iCA+FC;AArJD,0BAA+B;AAC/B,oCAOkB;AAElB,KAAK,UAAU,eAAe,CAAC,IAAyB;IACtD,MAAM,OAAO,GAAG,KAAK,IAAkB,EAAE;QACvC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,M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,MAAM,EAAE,kBAAU,CAAC,MAAM;iBAC1B,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiCallType,
|
|
1
|
+
import { ApiCallType, ProcessActionResponseData, ProcessData, ProcessRequestData, ProcessSearchRequest, StepData } from "../types";
|
|
2
2
|
export declare const runProcessSync: (ProcessRequestData: ProcessRequestData) => Promise<ProcessData>;
|
|
3
3
|
export declare const runProcessAsync: (ProcessRequestData: ProcessRequestData) => Promise<ProcessData>;
|
|
4
4
|
export declare const getProcessData: (processId: number) => Promise<ProcessData>;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invokeApiMappingPost = exports.invokeApiMappingGet = exports.searchProcessExecutions = exports.rerun = exports.bulkReviewed = exports.bulkResume = exports.bulkTerminate = exports.getStepData = exports.getProcessData = exports.runProcessAsync = exports.runProcessSync = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const axios_1 = require("axios");
|
|
3
7
|
const RUN_PROCESS_REQUEST_URL = "api/process/";
|
|
4
|
-
|
|
8
|
+
const runProcessSync = async (ProcessRequestData) => {
|
|
5
9
|
try {
|
|
6
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "runSync", {
|
|
10
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "runSync", {
|
|
7
11
|
data: ProcessRequestData,
|
|
8
12
|
params: {
|
|
9
|
-
clientId: apiClient.getClientId(),
|
|
13
|
+
clientId: __1.apiClient.getClientId(),
|
|
10
14
|
},
|
|
11
15
|
});
|
|
12
16
|
console.log("Response:", response);
|
|
@@ -17,12 +21,13 @@ export const runProcessSync = async (ProcessRequestData) => {
|
|
|
17
21
|
throw error;
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
|
-
|
|
24
|
+
exports.runProcessSync = runProcessSync;
|
|
25
|
+
const runProcessAsync = async (ProcessRequestData) => {
|
|
21
26
|
try {
|
|
22
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "runAsync", {
|
|
27
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "runAsync", {
|
|
23
28
|
data: ProcessRequestData,
|
|
24
29
|
params: {
|
|
25
|
-
clientId: apiClient.getClientId(),
|
|
30
|
+
clientId: __1.apiClient.getClientId(),
|
|
26
31
|
},
|
|
27
32
|
});
|
|
28
33
|
console.log("Response:", response);
|
|
@@ -33,12 +38,13 @@ export const runProcessAsync = async (ProcessRequestData) => {
|
|
|
33
38
|
throw error;
|
|
34
39
|
}
|
|
35
40
|
};
|
|
36
|
-
|
|
41
|
+
exports.runProcessAsync = runProcessAsync;
|
|
42
|
+
const getProcessData = async (processId) => {
|
|
37
43
|
if (processId == null) {
|
|
38
44
|
throw new Error("Process ID cannot be null");
|
|
39
45
|
}
|
|
40
46
|
try {
|
|
41
|
-
const response = await apiClient.get(RUN_PROCESS_REQUEST_URL + "context/" + processId);
|
|
47
|
+
const response = await __1.apiClient.get(RUN_PROCESS_REQUEST_URL + "context/" + processId);
|
|
42
48
|
return response.data;
|
|
43
49
|
}
|
|
44
50
|
catch (error) {
|
|
@@ -46,54 +52,63 @@ export const getProcessData = async (processId) => {
|
|
|
46
52
|
throw error;
|
|
47
53
|
}
|
|
48
54
|
};
|
|
49
|
-
|
|
55
|
+
exports.getProcessData = getProcessData;
|
|
56
|
+
const getStepData = async (stepId) => {
|
|
50
57
|
if (stepId === null || stepId === undefined) {
|
|
51
58
|
throw new Error("Step ID cannot be null or undefined");
|
|
52
59
|
}
|
|
53
60
|
try {
|
|
54
|
-
const response = await apiClient.get(RUN_PROCESS_REQUEST_URL + "stepContext/" + stepId);
|
|
61
|
+
const response = await __1.apiClient.get(RUN_PROCESS_REQUEST_URL + "stepContext/" + stepId);
|
|
55
62
|
return response.data;
|
|
56
63
|
}
|
|
57
64
|
catch (error) {
|
|
58
|
-
|
|
65
|
+
const err = error;
|
|
66
|
+
throw new Error(`Error occurred while fetching step record: ${err.message || error}`);
|
|
59
67
|
}
|
|
60
68
|
};
|
|
61
|
-
|
|
69
|
+
exports.getStepData = getStepData;
|
|
70
|
+
const bulkTerminate = async (processIds, reason) => {
|
|
62
71
|
try {
|
|
63
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "bulkTerminate", {
|
|
72
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "bulkTerminate", {
|
|
64
73
|
params: { reason },
|
|
65
74
|
data: processIds,
|
|
66
75
|
});
|
|
67
76
|
return response.data;
|
|
68
77
|
}
|
|
69
78
|
catch (error) {
|
|
70
|
-
|
|
79
|
+
const err = error;
|
|
80
|
+
throw new Error(`Error occurred while terminating processes: ${err.message || error}`);
|
|
71
81
|
}
|
|
72
82
|
};
|
|
73
|
-
|
|
83
|
+
exports.bulkTerminate = bulkTerminate;
|
|
84
|
+
const bulkResume = async (processIds) => {
|
|
74
85
|
try {
|
|
75
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "bulkResume", {
|
|
86
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "bulkResume", {
|
|
76
87
|
data: processIds,
|
|
77
88
|
});
|
|
78
89
|
return response.data;
|
|
79
90
|
}
|
|
80
91
|
catch (error) {
|
|
81
|
-
|
|
92
|
+
const err = error;
|
|
93
|
+
throw new Error(`Error occurred while resuming processes: ${err.message || error}`);
|
|
82
94
|
}
|
|
83
95
|
};
|
|
84
|
-
|
|
96
|
+
exports.bulkResume = bulkResume;
|
|
97
|
+
const bulkReviewed = async (processIds, reason) => {
|
|
85
98
|
try {
|
|
86
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "bulkReviewed", {
|
|
99
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "bulkReviewed", {
|
|
87
100
|
data: processIds,
|
|
88
101
|
params: { reason },
|
|
89
102
|
});
|
|
90
103
|
return response.data;
|
|
91
104
|
}
|
|
92
105
|
catch (error) {
|
|
93
|
-
|
|
106
|
+
const err = error;
|
|
107
|
+
throw new Error(`Error occurred while marking processes as reviewed: ${err.message || error}`);
|
|
94
108
|
}
|
|
95
109
|
};
|
|
96
|
-
|
|
110
|
+
exports.bulkReviewed = bulkReviewed;
|
|
111
|
+
const rerun = async (processId, clientId, version) => {
|
|
97
112
|
const params = {
|
|
98
113
|
clientId,
|
|
99
114
|
processId,
|
|
@@ -102,26 +117,28 @@ export const rerun = async (processId, clientId, version) => {
|
|
|
102
117
|
params["version"] = version;
|
|
103
118
|
}
|
|
104
119
|
try {
|
|
105
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "rerun", {
|
|
120
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "rerun", {
|
|
106
121
|
params,
|
|
107
122
|
});
|
|
108
123
|
return response.data;
|
|
109
124
|
}
|
|
110
125
|
catch (error) {
|
|
111
|
-
if (
|
|
126
|
+
if ((0, axios_1.isAxiosError)(error)) {
|
|
112
127
|
throw new Error(`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`);
|
|
113
128
|
}
|
|
114
129
|
else {
|
|
115
|
-
|
|
130
|
+
const err = error;
|
|
131
|
+
throw new Error(`Unexpected error during rerun process: ${err.message || err}`);
|
|
116
132
|
}
|
|
117
133
|
}
|
|
118
134
|
};
|
|
119
|
-
|
|
135
|
+
exports.rerun = rerun;
|
|
136
|
+
const searchProcessExecutions = async (params) => {
|
|
120
137
|
const queryParams = new URLSearchParams();
|
|
121
138
|
if (params.startTimeEpoch !== undefined && params.startTimeEpoch !== 0)
|
|
122
139
|
queryParams.set("startTimeEpoch", params.startTimeEpoch.toString());
|
|
123
140
|
if (params.endTimeEpoch !== undefined && params.endTimeEpoch !== 0)
|
|
124
|
-
queryParams.set("endTimeEpoch", params.endTimeEpoch.toString());
|
|
141
|
+
queryParams.set("endTimeEpoch", (params.endTimeEpoch || 0).toString());
|
|
125
142
|
if (params.namespace)
|
|
126
143
|
queryParams.set("namespace", params.namespace);
|
|
127
144
|
if (params.names && params.names.length)
|
|
@@ -138,7 +155,7 @@ export const searchProcessExecutions = async (params) => {
|
|
|
138
155
|
queryParams.set("triggerTypes", params.triggerTypes.join(","));
|
|
139
156
|
const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));
|
|
140
157
|
try {
|
|
141
|
-
const response = await apiClient.get(RUN_PROCESS_REQUEST_URL + "api/stats/process/search", updatedParams);
|
|
158
|
+
const response = await __1.apiClient.get(RUN_PROCESS_REQUEST_URL + "api/stats/process/search", updatedParams);
|
|
142
159
|
console.log("Response:", response);
|
|
143
160
|
return response.data;
|
|
144
161
|
}
|
|
@@ -147,9 +164,10 @@ export const searchProcessExecutions = async (params) => {
|
|
|
147
164
|
throw error;
|
|
148
165
|
}
|
|
149
166
|
};
|
|
150
|
-
|
|
167
|
+
exports.searchProcessExecutions = searchProcessExecutions;
|
|
168
|
+
const invokeApiMappingGet = async (endpoint, id, correlationId, apiCallType) => {
|
|
151
169
|
try {
|
|
152
|
-
const response = await apiClient.get(RUN_PROCESS_REQUEST_URL + "api/call/" + endpoint, {
|
|
170
|
+
const response = await __1.apiClient.get(RUN_PROCESS_REQUEST_URL + "api/call/" + endpoint, {
|
|
153
171
|
id: id,
|
|
154
172
|
correlationId: correlationId,
|
|
155
173
|
apiCallType,
|
|
@@ -162,9 +180,10 @@ export const invokeApiMappingGet = async (endpoint, id, correlationId, apiCallTy
|
|
|
162
180
|
throw error;
|
|
163
181
|
}
|
|
164
182
|
};
|
|
165
|
-
|
|
183
|
+
exports.invokeApiMappingGet = invokeApiMappingGet;
|
|
184
|
+
const invokeApiMappingPost = async (endpoint, input, id, correlationId, apiCallType = types_1.ApiCallType.ASYNC) => {
|
|
166
185
|
try {
|
|
167
|
-
const response = await apiClient.post(RUN_PROCESS_REQUEST_URL + "api/call/" + endpoint, {
|
|
186
|
+
const response = await __1.apiClient.post(RUN_PROCESS_REQUEST_URL + "api/call/" + endpoint, {
|
|
168
187
|
data: input,
|
|
169
188
|
params: {
|
|
170
189
|
id: id,
|
|
@@ -179,3 +198,5 @@ export const invokeApiMappingPost = async (endpoint, input, id, correlationId, a
|
|
|
179
198
|
throw error;
|
|
180
199
|
}
|
|
181
200
|
};
|
|
201
|
+
exports.invokeApiMappingPost = invokeApiMappingPost;
|
|
202
|
+
//# sourceMappingURL=processClientImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processClientImpl.js","sourceRoot":"","sources":["../../src/process/processClientImpl.ts"],"names":[],"mappings":";;;AAAA,0BAA6B;AAC7B,oCAOkB;AAClB,iCAAmC;AAEnC,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAExC,MAAM,cAAc,GAAG,KAAK,EACjC,kBAAsC,EAChB,EAAE;IACxB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,aAAS,CAAC,IAAI,CAAC,uBAAuB,GAAG,SAAS,EAAE;YACzE,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE;gBACN,QAAQ,EAAE,aAAS,CAAC,WAAW,EAAE;aAClC;SACF,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gDAAgD,EAAE,KAAK,C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__1 = require("..");
|
|
5
|
+
const renewRegistration = async () => {
|
|
3
6
|
try {
|
|
4
|
-
const response = await apiClient.put("/api/clients/register", {
|
|
7
|
+
const response = await __1.apiClient.put("/api/clients/register", {
|
|
5
8
|
params: {
|
|
6
9
|
friendlyName: "Unmeshed",
|
|
7
10
|
tokenExpiryDate: "",
|
|
@@ -15,3 +18,5 @@ export const renewRegistration = async () => {
|
|
|
15
18
|
throw error;
|
|
16
19
|
}
|
|
17
20
|
};
|
|
21
|
+
exports.renewRegistration = renewRegistration;
|
|
22
|
+
//# sourceMappingURL=registrationClientImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registrationClientImpl.js","sourceRoot":"","sources":["../../src/registration/registrationClientImpl.ts"],"names":[],"mappings":";;;AAAA,0BAA+B;AAExB,MAAM,iBAAiB,GAAG,KAAK,IAAqB,EAAE;IAC3D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,aAAS,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC5D,MAAM,EAAE;gBACN,YAAY,EAAE,UAAU;gBACxB,eAAe,EAAE,EAAE;aACpB;SACF,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;QACjD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;QACpE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,iBAAiB,qBAc5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "dotenv/config";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
require("dotenv/config");
|
|
7
|
+
const index_js_1 = __importDefault(require("./index.js"));
|
|
8
|
+
const BASE_URL = process.env.UNMESHED_BASE_URL;
|
|
9
|
+
const PORT = process.env.UNMESHED_PORT;
|
|
10
|
+
const ClIENT_ID = process.env.UNMESHED_CLIENT_ID;
|
|
11
|
+
const AUTH_TOKEN = process.env.UNMESHED_AUTH_TOKEN;
|
|
12
|
+
console.log("UC2", index_js_1.default);
|
|
13
|
+
index_js_1.default.initialize({
|
|
14
|
+
baseUrl: BASE_URL || 'abc',
|
|
15
|
+
port: PORT,
|
|
16
|
+
clientId: ClIENT_ID || 'abc',
|
|
17
|
+
authToken: AUTH_TOKEN || 'token',
|
|
18
|
+
});
|
|
19
|
+
//
|
|
20
|
+
// const request = {
|
|
21
|
+
// name: "sample-http",
|
|
22
|
+
// namespace: "default",
|
|
23
|
+
// input: {},
|
|
24
|
+
// correlationId: "",
|
|
25
|
+
// requestId: "",
|
|
26
|
+
// version: 1,
|
|
27
|
+
// };
|
|
28
|
+
// const workers = [
|
|
29
|
+
// {
|
|
30
|
+
// worker: (input) => ArithmeticOperation(input),
|
|
31
|
+
// namespace: "default",
|
|
32
|
+
// name: "arithmetic_operation_worker",
|
|
33
|
+
// maxInProgress: 10,
|
|
34
|
+
// },
|
|
35
|
+
// ];
|
|
36
|
+
// UnmeshedClient.pollForWorkers(workers);
|
|
37
|
+
//
|
|
38
|
+
// const processId = 28878569;
|
|
39
|
+
// const stepId = 28878571;
|
|
40
|
+
// const processIds = [34, 344];
|
|
41
|
+
// const clientId = "jdjfjf";
|
|
42
|
+
// const endpoint = "your-endpoint";
|
|
43
|
+
// const input = { key: "value" };
|
|
44
|
+
// const id = "12345";
|
|
45
|
+
// const apiCallType = ApiCallType.SYNC;
|
|
46
|
+
//
|
|
47
|
+
// const params = {
|
|
48
|
+
// startTimeEpoch: 1673606400000,
|
|
49
|
+
// endTimeEpoch: 1673692800000,
|
|
50
|
+
// namespace: "default",
|
|
51
|
+
// processTypes: [ProcessType.STANDARD],
|
|
52
|
+
// triggerTypes: [ProcessTriggerType.MANUAL],
|
|
53
|
+
// names: ["process1", "process2", "process3"],
|
|
54
|
+
// processIds: [28883174, 28883162],
|
|
55
|
+
// correlationIds: ["correlationId1", "correlationId2"],
|
|
56
|
+
// requestIds: ["requestId1", "requestId2"],
|
|
57
|
+
// statuses: [ProcessStatus.COMPLETED],
|
|
58
|
+
// limit: 10,
|
|
59
|
+
// offset: 0,
|
|
60
|
+
// };
|
|
61
|
+
// UnmeshedClient.getStepData(stepId)
|
|
62
|
+
// .then((stepData) => {
|
|
63
|
+
// console.log("STEP_DATA", stepData);
|
|
64
|
+
// })
|
|
65
|
+
// .catch((error) => {
|
|
66
|
+
// console.error("Error fetching step data:", error.message);
|
|
67
|
+
// });
|
|
68
|
+
// UnmeshedClient.rerun(processId, ClIENT_ID)
|
|
69
|
+
// .then((data) => {
|
|
70
|
+
// console.log("PROCESS_DATA", data);
|
|
71
|
+
// })
|
|
72
|
+
// .catch((error) => {
|
|
73
|
+
// console.error("Error fetching step data:", error.message);
|
|
74
|
+
// });
|
|
75
|
+
// UnmeshedClient.bulkTerminate(processIds)
|
|
76
|
+
// .then((data) => {
|
|
77
|
+
// console.log("PROCESS_DATA", data);
|
|
78
|
+
// })
|
|
79
|
+
// .catch((error) => {
|
|
80
|
+
// console.error("Error fetching step data:", error.message);
|
|
81
|
+
// });
|
|
82
|
+
//# sourceMappingURL=sampleTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleTest.js","sourceRoot":"","sources":["../src/sampleTest.ts"],"names":[],"mappings":";;;;;AACA,yBAAuB;AACvB,0DAAuC;AAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;AAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AACvC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,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