@unmeshed/sdk 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +176 -1
- package/dist/index.d.ts +176 -1
- package/dist/index.js +102 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -205,6 +205,10 @@ type StepId = {
|
|
|
205
205
|
processId: number;
|
|
206
206
|
ref: string;
|
|
207
207
|
};
|
|
208
|
+
type TagValue = {
|
|
209
|
+
name: string;
|
|
210
|
+
value: string;
|
|
211
|
+
};
|
|
208
212
|
type ProcessRequestData = {
|
|
209
213
|
name: string;
|
|
210
214
|
namespace: string;
|
|
@@ -226,7 +230,172 @@ type ProcessSearchRequest = {
|
|
|
226
230
|
statuses?: ProcessStatus[];
|
|
227
231
|
limit?: number;
|
|
228
232
|
offset?: number;
|
|
233
|
+
tags?: TagValue[];
|
|
234
|
+
};
|
|
235
|
+
type ProcessDefinitionDeleteRequest = {
|
|
236
|
+
namespace: string;
|
|
237
|
+
name: string;
|
|
238
|
+
type: string;
|
|
239
|
+
version: number;
|
|
240
|
+
steps?: Step[];
|
|
229
241
|
};
|
|
242
|
+
interface ProcessRequest {
|
|
243
|
+
name?: string;
|
|
244
|
+
namespace?: string;
|
|
245
|
+
version?: number | null;
|
|
246
|
+
id?: string | null;
|
|
247
|
+
correlationId?: string | null;
|
|
248
|
+
input?: Record<string, any> | null;
|
|
249
|
+
testRun?: boolean | null;
|
|
250
|
+
}
|
|
251
|
+
interface ProcessConfiguration {
|
|
252
|
+
completionTimeout?: number;
|
|
253
|
+
onTimeoutProcess?: ProcessRequest;
|
|
254
|
+
onFailProcess?: ProcessRequest | null;
|
|
255
|
+
onCompleteProcess?: ProcessRequest | null;
|
|
256
|
+
onCancelProcess?: ProcessRequest;
|
|
257
|
+
}
|
|
258
|
+
interface ProcessDefinitionData {
|
|
259
|
+
namespace: string;
|
|
260
|
+
name: string;
|
|
261
|
+
version?: number;
|
|
262
|
+
type: ProcessType | string;
|
|
263
|
+
description?: string;
|
|
264
|
+
configuration?: ProcessConfiguration;
|
|
265
|
+
steps: Step[];
|
|
266
|
+
defaultInput?: Record<string, any>;
|
|
267
|
+
defaultOutput?: Record<string, any>;
|
|
268
|
+
outputMapping?: Record<string, any>;
|
|
269
|
+
tags?: TagValue[];
|
|
270
|
+
}
|
|
271
|
+
interface ProcessDefinitionsDetail {
|
|
272
|
+
name: string;
|
|
273
|
+
namespace: string;
|
|
274
|
+
}
|
|
275
|
+
interface ProcessDefinitionDetails {
|
|
276
|
+
name: string;
|
|
277
|
+
namespace: string;
|
|
278
|
+
version?: number;
|
|
279
|
+
}
|
|
280
|
+
interface ExecutionWait {
|
|
281
|
+
result: {
|
|
282
|
+
waitUntil: number;
|
|
283
|
+
};
|
|
284
|
+
logs: [];
|
|
285
|
+
}
|
|
286
|
+
interface ExecutionWait {
|
|
287
|
+
result: {
|
|
288
|
+
waitUntil: number;
|
|
289
|
+
};
|
|
290
|
+
logs: [];
|
|
291
|
+
}
|
|
292
|
+
interface ExecutionTimelineType {
|
|
293
|
+
id: number;
|
|
294
|
+
executor: string;
|
|
295
|
+
output: ExecutionWait | null;
|
|
296
|
+
polled: number;
|
|
297
|
+
scheduled: number;
|
|
298
|
+
start: number;
|
|
299
|
+
updated: number;
|
|
300
|
+
ref?: string | null;
|
|
301
|
+
}
|
|
302
|
+
interface ExecutionTimelineType {
|
|
303
|
+
id: number;
|
|
304
|
+
executor: string;
|
|
305
|
+
output: ExecutionWait | null;
|
|
306
|
+
polled: number;
|
|
307
|
+
scheduled: number;
|
|
308
|
+
start: number;
|
|
309
|
+
updated: number;
|
|
310
|
+
ref?: string | null;
|
|
311
|
+
}
|
|
312
|
+
interface ExecutionDetails extends ExecutionTimelineType {
|
|
313
|
+
stepRef: string;
|
|
314
|
+
}
|
|
315
|
+
interface ExecutionDetails extends ExecutionTimelineType {
|
|
316
|
+
stepRef: string;
|
|
317
|
+
}
|
|
318
|
+
interface AuditInfo {
|
|
319
|
+
createdBy: string;
|
|
320
|
+
updatedBy: string;
|
|
321
|
+
created: number;
|
|
322
|
+
updated: number;
|
|
323
|
+
}
|
|
324
|
+
interface AuditInfo {
|
|
325
|
+
createdBy: string;
|
|
326
|
+
updatedBy: string;
|
|
327
|
+
created: number;
|
|
328
|
+
updated: number;
|
|
329
|
+
}
|
|
330
|
+
interface Step extends NewStepData, AuditInfo, Object {
|
|
331
|
+
executionList?: ExecutionDetails[];
|
|
332
|
+
parentRef?: string;
|
|
333
|
+
status?: string;
|
|
334
|
+
completed?: number;
|
|
335
|
+
children: Step[];
|
|
336
|
+
executionCount?: number;
|
|
337
|
+
triggerType?: string;
|
|
338
|
+
}
|
|
339
|
+
interface Step extends NewStepData, AuditInfo, Object {
|
|
340
|
+
executionList?: ExecutionDetails[];
|
|
341
|
+
parentRef?: string;
|
|
342
|
+
status?: string;
|
|
343
|
+
completed?: number;
|
|
344
|
+
children: Step[];
|
|
345
|
+
executionCount?: number;
|
|
346
|
+
triggerType?: string;
|
|
347
|
+
}
|
|
348
|
+
interface StepConfiguration {
|
|
349
|
+
errorPolicyName?: string;
|
|
350
|
+
useCache?: boolean;
|
|
351
|
+
stream?: boolean;
|
|
352
|
+
cacheKey?: string;
|
|
353
|
+
cacheTimeoutSeconds?: number;
|
|
354
|
+
jqTransformer?: string;
|
|
355
|
+
rateLimitWindowSeconds?: number | null;
|
|
356
|
+
rateLimitMaxRequests?: number | null;
|
|
357
|
+
preExecutionScript?: string;
|
|
358
|
+
scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';
|
|
359
|
+
constructInputFromScript?: boolean;
|
|
360
|
+
additionalRefs?: string[];
|
|
361
|
+
}
|
|
362
|
+
interface StepConfiguration {
|
|
363
|
+
errorPolicyName?: string;
|
|
364
|
+
useCache?: boolean;
|
|
365
|
+
stream?: boolean;
|
|
366
|
+
cacheKey?: string;
|
|
367
|
+
cacheTimeoutSeconds?: number;
|
|
368
|
+
jqTransformer?: string;
|
|
369
|
+
rateLimitWindowSeconds?: number | null;
|
|
370
|
+
rateLimitMaxRequests?: number | null;
|
|
371
|
+
preExecutionScript?: string;
|
|
372
|
+
scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';
|
|
373
|
+
constructInputFromScript?: boolean;
|
|
374
|
+
additionalRefs?: string[];
|
|
375
|
+
streamAllStatuses?: boolean;
|
|
376
|
+
}
|
|
377
|
+
interface NewStepData {
|
|
378
|
+
type: StepType;
|
|
379
|
+
name: string;
|
|
380
|
+
namespace: string;
|
|
381
|
+
ref: string;
|
|
382
|
+
optional?: boolean;
|
|
383
|
+
configuration?: StepConfiguration;
|
|
384
|
+
children?: Step[];
|
|
385
|
+
input?: Record<string, any>;
|
|
386
|
+
output?: Record<string, any>;
|
|
387
|
+
}
|
|
388
|
+
interface NewStepData {
|
|
389
|
+
type: StepType;
|
|
390
|
+
name: string;
|
|
391
|
+
namespace: string;
|
|
392
|
+
ref: string;
|
|
393
|
+
optional?: boolean;
|
|
394
|
+
configuration?: StepConfiguration;
|
|
395
|
+
children?: Step[];
|
|
396
|
+
input?: Record<string, any>;
|
|
397
|
+
output?: Record<string, any>;
|
|
398
|
+
}
|
|
230
399
|
type StepSize = {
|
|
231
400
|
stepQueueNameData: StepQueueNameData;
|
|
232
401
|
size: number | null;
|
|
@@ -374,6 +543,12 @@ declare class UnmeshedClient {
|
|
|
374
543
|
invokeApiMappingGet(apiClient: UnmeshedApiClient, endpoint: string, id: string, correlationId: string, apiCallType: ApiCallType): Promise<any>;
|
|
375
544
|
invokeApiMappingPost(endpoint: string, input: Record<string, any>, id: string, correlationId: string, apiCallType: ApiCallType): Promise<any>;
|
|
376
545
|
reNewRegistration(params: RenewRegistrationParams): Promise<string>;
|
|
546
|
+
createProcessDefinition(body: ProcessDefinitionData): Promise<any>;
|
|
547
|
+
updateProcessDefinition(body: ProcessDefinitionData): Promise<any>;
|
|
548
|
+
deleteProcessDefinition(body: ProcessDefinitionDeleteRequest): Promise<any>;
|
|
549
|
+
getProcessDefinitions(namespace?: string): Promise<any>;
|
|
550
|
+
getProcessDefinitionVersions(body: ProcessDefinitionsDetail): Promise<any>;
|
|
551
|
+
getProcessDefinitionByVersion(body: ProcessDefinitionDetails): Promise<any>;
|
|
377
552
|
}
|
|
378
553
|
|
|
379
|
-
export { ApiCallType, type ApiError, type ApiMappingData, type ApiMappingWebhookData, type ApiResponse, type ClientProfileData, type ClientRequestConfig, type ClientSubmitResult, type FinalUnmeshedClientConfig, type FullClientProfileData, type HandleRequestConfig, type PollRequestData, type ProcessActionResponseData, type ProcessActionResponseDetailData, type ProcessData, type ProcessRequestData, type ProcessSearchRequest, ProcessStatus, ProcessTriggerType, ProcessType, type QueryParams, type RenewRegistrationParams, type RequestConfig, SQAuthUserType, type StepData, type StepExecutionData, type StepId, type StepQueueNameData, type StepSize, StepStatus, StepType, UnmeshedClient, type UnmeshedClientConfig, type UnmeshedWorkerConfig, WebhookSource, type WorkRequest, type WorkResponse, type WorkResult };
|
|
554
|
+
export { ApiCallType, type ApiError, type ApiMappingData, type ApiMappingWebhookData, type ApiResponse, type AuditInfo, type ClientProfileData, type ClientRequestConfig, type ClientSubmitResult, type ExecutionDetails, type ExecutionTimelineType, type ExecutionWait, type FinalUnmeshedClientConfig, type FullClientProfileData, type HandleRequestConfig, type NewStepData, type PollRequestData, type ProcessActionResponseData, type ProcessActionResponseDetailData, type ProcessConfiguration, type ProcessData, type ProcessDefinitionData, type ProcessDefinitionDeleteRequest, type ProcessDefinitionDetails, type ProcessDefinitionsDetail, type ProcessRequest, type ProcessRequestData, type ProcessSearchRequest, ProcessStatus, ProcessTriggerType, ProcessType, type QueryParams, type RenewRegistrationParams, type RequestConfig, SQAuthUserType, type Step, type StepConfiguration, type StepData, type StepExecutionData, type StepId, type StepQueueNameData, type StepSize, StepStatus, StepType, type TagValue, UnmeshedClient, type UnmeshedClientConfig, type UnmeshedWorkerConfig, WebhookSource, type WorkRequest, type WorkResponse, type WorkResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -205,6 +205,10 @@ type StepId = {
|
|
|
205
205
|
processId: number;
|
|
206
206
|
ref: string;
|
|
207
207
|
};
|
|
208
|
+
type TagValue = {
|
|
209
|
+
name: string;
|
|
210
|
+
value: string;
|
|
211
|
+
};
|
|
208
212
|
type ProcessRequestData = {
|
|
209
213
|
name: string;
|
|
210
214
|
namespace: string;
|
|
@@ -226,7 +230,172 @@ type ProcessSearchRequest = {
|
|
|
226
230
|
statuses?: ProcessStatus[];
|
|
227
231
|
limit?: number;
|
|
228
232
|
offset?: number;
|
|
233
|
+
tags?: TagValue[];
|
|
234
|
+
};
|
|
235
|
+
type ProcessDefinitionDeleteRequest = {
|
|
236
|
+
namespace: string;
|
|
237
|
+
name: string;
|
|
238
|
+
type: string;
|
|
239
|
+
version: number;
|
|
240
|
+
steps?: Step[];
|
|
229
241
|
};
|
|
242
|
+
interface ProcessRequest {
|
|
243
|
+
name?: string;
|
|
244
|
+
namespace?: string;
|
|
245
|
+
version?: number | null;
|
|
246
|
+
id?: string | null;
|
|
247
|
+
correlationId?: string | null;
|
|
248
|
+
input?: Record<string, any> | null;
|
|
249
|
+
testRun?: boolean | null;
|
|
250
|
+
}
|
|
251
|
+
interface ProcessConfiguration {
|
|
252
|
+
completionTimeout?: number;
|
|
253
|
+
onTimeoutProcess?: ProcessRequest;
|
|
254
|
+
onFailProcess?: ProcessRequest | null;
|
|
255
|
+
onCompleteProcess?: ProcessRequest | null;
|
|
256
|
+
onCancelProcess?: ProcessRequest;
|
|
257
|
+
}
|
|
258
|
+
interface ProcessDefinitionData {
|
|
259
|
+
namespace: string;
|
|
260
|
+
name: string;
|
|
261
|
+
version?: number;
|
|
262
|
+
type: ProcessType | string;
|
|
263
|
+
description?: string;
|
|
264
|
+
configuration?: ProcessConfiguration;
|
|
265
|
+
steps: Step[];
|
|
266
|
+
defaultInput?: Record<string, any>;
|
|
267
|
+
defaultOutput?: Record<string, any>;
|
|
268
|
+
outputMapping?: Record<string, any>;
|
|
269
|
+
tags?: TagValue[];
|
|
270
|
+
}
|
|
271
|
+
interface ProcessDefinitionsDetail {
|
|
272
|
+
name: string;
|
|
273
|
+
namespace: string;
|
|
274
|
+
}
|
|
275
|
+
interface ProcessDefinitionDetails {
|
|
276
|
+
name: string;
|
|
277
|
+
namespace: string;
|
|
278
|
+
version?: number;
|
|
279
|
+
}
|
|
280
|
+
interface ExecutionWait {
|
|
281
|
+
result: {
|
|
282
|
+
waitUntil: number;
|
|
283
|
+
};
|
|
284
|
+
logs: [];
|
|
285
|
+
}
|
|
286
|
+
interface ExecutionWait {
|
|
287
|
+
result: {
|
|
288
|
+
waitUntil: number;
|
|
289
|
+
};
|
|
290
|
+
logs: [];
|
|
291
|
+
}
|
|
292
|
+
interface ExecutionTimelineType {
|
|
293
|
+
id: number;
|
|
294
|
+
executor: string;
|
|
295
|
+
output: ExecutionWait | null;
|
|
296
|
+
polled: number;
|
|
297
|
+
scheduled: number;
|
|
298
|
+
start: number;
|
|
299
|
+
updated: number;
|
|
300
|
+
ref?: string | null;
|
|
301
|
+
}
|
|
302
|
+
interface ExecutionTimelineType {
|
|
303
|
+
id: number;
|
|
304
|
+
executor: string;
|
|
305
|
+
output: ExecutionWait | null;
|
|
306
|
+
polled: number;
|
|
307
|
+
scheduled: number;
|
|
308
|
+
start: number;
|
|
309
|
+
updated: number;
|
|
310
|
+
ref?: string | null;
|
|
311
|
+
}
|
|
312
|
+
interface ExecutionDetails extends ExecutionTimelineType {
|
|
313
|
+
stepRef: string;
|
|
314
|
+
}
|
|
315
|
+
interface ExecutionDetails extends ExecutionTimelineType {
|
|
316
|
+
stepRef: string;
|
|
317
|
+
}
|
|
318
|
+
interface AuditInfo {
|
|
319
|
+
createdBy: string;
|
|
320
|
+
updatedBy: string;
|
|
321
|
+
created: number;
|
|
322
|
+
updated: number;
|
|
323
|
+
}
|
|
324
|
+
interface AuditInfo {
|
|
325
|
+
createdBy: string;
|
|
326
|
+
updatedBy: string;
|
|
327
|
+
created: number;
|
|
328
|
+
updated: number;
|
|
329
|
+
}
|
|
330
|
+
interface Step extends NewStepData, AuditInfo, Object {
|
|
331
|
+
executionList?: ExecutionDetails[];
|
|
332
|
+
parentRef?: string;
|
|
333
|
+
status?: string;
|
|
334
|
+
completed?: number;
|
|
335
|
+
children: Step[];
|
|
336
|
+
executionCount?: number;
|
|
337
|
+
triggerType?: string;
|
|
338
|
+
}
|
|
339
|
+
interface Step extends NewStepData, AuditInfo, Object {
|
|
340
|
+
executionList?: ExecutionDetails[];
|
|
341
|
+
parentRef?: string;
|
|
342
|
+
status?: string;
|
|
343
|
+
completed?: number;
|
|
344
|
+
children: Step[];
|
|
345
|
+
executionCount?: number;
|
|
346
|
+
triggerType?: string;
|
|
347
|
+
}
|
|
348
|
+
interface StepConfiguration {
|
|
349
|
+
errorPolicyName?: string;
|
|
350
|
+
useCache?: boolean;
|
|
351
|
+
stream?: boolean;
|
|
352
|
+
cacheKey?: string;
|
|
353
|
+
cacheTimeoutSeconds?: number;
|
|
354
|
+
jqTransformer?: string;
|
|
355
|
+
rateLimitWindowSeconds?: number | null;
|
|
356
|
+
rateLimitMaxRequests?: number | null;
|
|
357
|
+
preExecutionScript?: string;
|
|
358
|
+
scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';
|
|
359
|
+
constructInputFromScript?: boolean;
|
|
360
|
+
additionalRefs?: string[];
|
|
361
|
+
}
|
|
362
|
+
interface StepConfiguration {
|
|
363
|
+
errorPolicyName?: string;
|
|
364
|
+
useCache?: boolean;
|
|
365
|
+
stream?: boolean;
|
|
366
|
+
cacheKey?: string;
|
|
367
|
+
cacheTimeoutSeconds?: number;
|
|
368
|
+
jqTransformer?: string;
|
|
369
|
+
rateLimitWindowSeconds?: number | null;
|
|
370
|
+
rateLimitMaxRequests?: number | null;
|
|
371
|
+
preExecutionScript?: string;
|
|
372
|
+
scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';
|
|
373
|
+
constructInputFromScript?: boolean;
|
|
374
|
+
additionalRefs?: string[];
|
|
375
|
+
streamAllStatuses?: boolean;
|
|
376
|
+
}
|
|
377
|
+
interface NewStepData {
|
|
378
|
+
type: StepType;
|
|
379
|
+
name: string;
|
|
380
|
+
namespace: string;
|
|
381
|
+
ref: string;
|
|
382
|
+
optional?: boolean;
|
|
383
|
+
configuration?: StepConfiguration;
|
|
384
|
+
children?: Step[];
|
|
385
|
+
input?: Record<string, any>;
|
|
386
|
+
output?: Record<string, any>;
|
|
387
|
+
}
|
|
388
|
+
interface NewStepData {
|
|
389
|
+
type: StepType;
|
|
390
|
+
name: string;
|
|
391
|
+
namespace: string;
|
|
392
|
+
ref: string;
|
|
393
|
+
optional?: boolean;
|
|
394
|
+
configuration?: StepConfiguration;
|
|
395
|
+
children?: Step[];
|
|
396
|
+
input?: Record<string, any>;
|
|
397
|
+
output?: Record<string, any>;
|
|
398
|
+
}
|
|
230
399
|
type StepSize = {
|
|
231
400
|
stepQueueNameData: StepQueueNameData;
|
|
232
401
|
size: number | null;
|
|
@@ -374,6 +543,12 @@ declare class UnmeshedClient {
|
|
|
374
543
|
invokeApiMappingGet(apiClient: UnmeshedApiClient, endpoint: string, id: string, correlationId: string, apiCallType: ApiCallType): Promise<any>;
|
|
375
544
|
invokeApiMappingPost(endpoint: string, input: Record<string, any>, id: string, correlationId: string, apiCallType: ApiCallType): Promise<any>;
|
|
376
545
|
reNewRegistration(params: RenewRegistrationParams): Promise<string>;
|
|
546
|
+
createProcessDefinition(body: ProcessDefinitionData): Promise<any>;
|
|
547
|
+
updateProcessDefinition(body: ProcessDefinitionData): Promise<any>;
|
|
548
|
+
deleteProcessDefinition(body: ProcessDefinitionDeleteRequest): Promise<any>;
|
|
549
|
+
getProcessDefinitions(namespace?: string): Promise<any>;
|
|
550
|
+
getProcessDefinitionVersions(body: ProcessDefinitionsDetail): Promise<any>;
|
|
551
|
+
getProcessDefinitionByVersion(body: ProcessDefinitionDetails): Promise<any>;
|
|
377
552
|
}
|
|
378
553
|
|
|
379
|
-
export { ApiCallType, type ApiError, type ApiMappingData, type ApiMappingWebhookData, type ApiResponse, type ClientProfileData, type ClientRequestConfig, type ClientSubmitResult, type FinalUnmeshedClientConfig, type FullClientProfileData, type HandleRequestConfig, type PollRequestData, type ProcessActionResponseData, type ProcessActionResponseDetailData, type ProcessData, type ProcessRequestData, type ProcessSearchRequest, ProcessStatus, ProcessTriggerType, ProcessType, type QueryParams, type RenewRegistrationParams, type RequestConfig, SQAuthUserType, type StepData, type StepExecutionData, type StepId, type StepQueueNameData, type StepSize, StepStatus, StepType, UnmeshedClient, type UnmeshedClientConfig, type UnmeshedWorkerConfig, WebhookSource, type WorkRequest, type WorkResponse, type WorkResult };
|
|
554
|
+
export { ApiCallType, type ApiError, type ApiMappingData, type ApiMappingWebhookData, type ApiResponse, type AuditInfo, type ClientProfileData, type ClientRequestConfig, type ClientSubmitResult, type ExecutionDetails, type ExecutionTimelineType, type ExecutionWait, type FinalUnmeshedClientConfig, type FullClientProfileData, type HandleRequestConfig, type NewStepData, type PollRequestData, type ProcessActionResponseData, type ProcessActionResponseDetailData, type ProcessConfiguration, type ProcessData, type ProcessDefinitionData, type ProcessDefinitionDeleteRequest, type ProcessDefinitionDetails, type ProcessDefinitionsDetail, type ProcessRequest, type ProcessRequestData, type ProcessSearchRequest, ProcessStatus, ProcessTriggerType, ProcessType, type QueryParams, type RenewRegistrationParams, type RequestConfig, SQAuthUserType, type Step, type StepConfiguration, type StepData, type StepExecutionData, type StepId, type StepQueueNameData, type StepSize, StepStatus, StepType, type TagValue, UnmeshedClient, type UnmeshedClientConfig, type UnmeshedWorkerConfig, WebhookSource, type WorkRequest, type WorkResponse, type WorkResult };
|
package/dist/index.js
CHANGED
|
@@ -674,26 +674,25 @@ var rerun = async (apiClient, processId, version) => {
|
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
676
|
var searchProcessExecutions = async (apiClient, params) => {
|
|
677
|
-
const
|
|
678
|
-
if (params.startTimeEpoch
|
|
679
|
-
|
|
680
|
-
if (params.
|
|
681
|
-
|
|
682
|
-
if (params.
|
|
683
|
-
if (params.
|
|
684
|
-
if (params.
|
|
685
|
-
if (params.
|
|
686
|
-
|
|
687
|
-
if (params.
|
|
688
|
-
if (params.statuses && params.statuses.length) queryParams.set("statuses", params.statuses.join(","));
|
|
689
|
-
if (params.triggerTypes && params.triggerTypes.length) queryParams.set("triggerTypes", params.triggerTypes.join(","));
|
|
690
|
-
const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));
|
|
677
|
+
const body = {};
|
|
678
|
+
if (params.startTimeEpoch) body.startTimeEpoch = params.startTimeEpoch;
|
|
679
|
+
if (params.endTimeEpoch) body.endTimeEpoch = params.endTimeEpoch;
|
|
680
|
+
if (params.namespace) body.namespace = params.namespace;
|
|
681
|
+
if (params.names?.length) body.names = params.names;
|
|
682
|
+
if (params.processIds?.length) body.processIds = params.processIds;
|
|
683
|
+
if (params.correlationIds?.length) body.correlationIds = params.correlationIds;
|
|
684
|
+
if (params.requestIds?.length) body.requestIds = params.requestIds;
|
|
685
|
+
if (params.statuses?.length) body.statuses = params.statuses;
|
|
686
|
+
if (params.triggerTypes?.length) body.triggerTypes = params.triggerTypes;
|
|
687
|
+
if (params.tags?.length) body.tags = params.tags;
|
|
691
688
|
try {
|
|
692
|
-
const response = await apiClient.
|
|
693
|
-
|
|
689
|
+
const response = await apiClient.post(`api/stats/process/search`, {
|
|
690
|
+
data: body,
|
|
691
|
+
params: {}
|
|
692
|
+
});
|
|
694
693
|
return response.data;
|
|
695
694
|
} catch (error) {
|
|
696
|
-
console.error("Error occurred while searching process executions:
|
|
695
|
+
console.error("Error occurred while searching process executions:", error);
|
|
697
696
|
throw error;
|
|
698
697
|
}
|
|
699
698
|
};
|
|
@@ -727,6 +726,74 @@ var invokeApiMappingPost = async (apiClient, endpoint, input, id, correlationId,
|
|
|
727
726
|
throw error;
|
|
728
727
|
}
|
|
729
728
|
};
|
|
729
|
+
var createProcessDefinition = async (apiClient, requestData) => {
|
|
730
|
+
try {
|
|
731
|
+
const response = await apiClient.post(`/api/processDefinitions`, {
|
|
732
|
+
data: requestData,
|
|
733
|
+
params: {}
|
|
734
|
+
});
|
|
735
|
+
return response.data;
|
|
736
|
+
} catch (error) {
|
|
737
|
+
console.error("Error occurred while creating process definition:", error);
|
|
738
|
+
throw error;
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
var deleteProcessDefinition = async (apiClient, requestData) => {
|
|
742
|
+
try {
|
|
743
|
+
const response = await apiClient.delete(`/api/processDefinitions`, {
|
|
744
|
+
data: [requestData],
|
|
745
|
+
params: {}
|
|
746
|
+
});
|
|
747
|
+
return response.data;
|
|
748
|
+
} catch (error) {
|
|
749
|
+
console.error("Error occurred while deleting process definition:", error);
|
|
750
|
+
throw error;
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
var updateProcessDefinition = async (apiClient, requestData) => {
|
|
754
|
+
try {
|
|
755
|
+
const response = await apiClient.put(`/api/processDefinitions`, {
|
|
756
|
+
data: requestData,
|
|
757
|
+
params: {}
|
|
758
|
+
});
|
|
759
|
+
return response.data;
|
|
760
|
+
} catch (error) {
|
|
761
|
+
console.error("Error occurred while creating process definition:", error);
|
|
762
|
+
throw error;
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
var getProcessDefinitions = async (apiClient, namespace) => {
|
|
766
|
+
try {
|
|
767
|
+
const params = namespace ? { namespace } : {};
|
|
768
|
+
const response = await apiClient.get("/api/processDefinitions", params);
|
|
769
|
+
return response.data;
|
|
770
|
+
} catch (error) {
|
|
771
|
+
console.error("Error occurred while fetching process definitions:", error);
|
|
772
|
+
throw error;
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
var getProcessDefinitionVersions = async (apiClient, body) => {
|
|
776
|
+
try {
|
|
777
|
+
const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}/versions`);
|
|
778
|
+
return response.data;
|
|
779
|
+
} catch (error) {
|
|
780
|
+
console.error("Error occurred while fetching process definition: ", error);
|
|
781
|
+
throw error;
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
var getProcessDefinitionByVersion = async (apiClient, body) => {
|
|
785
|
+
if (!body.namespace || !body.name || !body.version) {
|
|
786
|
+
throw new Error("namespace, name, and version are required");
|
|
787
|
+
}
|
|
788
|
+
try {
|
|
789
|
+
const params = body.version ? { version: body.version } : {};
|
|
790
|
+
const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}`, params);
|
|
791
|
+
return response.data;
|
|
792
|
+
} catch (error) {
|
|
793
|
+
console.error("Error occurred while fetching process definition:", error);
|
|
794
|
+
throw error;
|
|
795
|
+
}
|
|
796
|
+
};
|
|
730
797
|
|
|
731
798
|
// src/apis/registrationClientImpl.ts
|
|
732
799
|
var renewRegistration = async (apiClient, params) => {
|
|
@@ -787,6 +854,24 @@ var UnmeshedClient = class {
|
|
|
787
854
|
reNewRegistration(params) {
|
|
788
855
|
return renewRegistration(this.client, params);
|
|
789
856
|
}
|
|
857
|
+
createProcessDefinition(body) {
|
|
858
|
+
return createProcessDefinition(this.client, body);
|
|
859
|
+
}
|
|
860
|
+
updateProcessDefinition(body) {
|
|
861
|
+
return updateProcessDefinition(this.client, body);
|
|
862
|
+
}
|
|
863
|
+
deleteProcessDefinition(body) {
|
|
864
|
+
return deleteProcessDefinition(this.client, body);
|
|
865
|
+
}
|
|
866
|
+
getProcessDefinitions(namespace) {
|
|
867
|
+
return getProcessDefinitions(this.client, namespace);
|
|
868
|
+
}
|
|
869
|
+
getProcessDefinitionVersions(body) {
|
|
870
|
+
return getProcessDefinitionVersions(this.client, body);
|
|
871
|
+
}
|
|
872
|
+
getProcessDefinitionByVersion(body) {
|
|
873
|
+
return getProcessDefinitionByVersion(this.client, body);
|
|
874
|
+
}
|
|
790
875
|
};
|
|
791
876
|
// Annotate the CommonJS export names for ESM import in node:
|
|
792
877
|
0 && (module.exports = {
|
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\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, version?: number) {\n return rerun(this.client, processId, 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(apiClient, endpoint, id, correlationId, apiCallType);\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(this.client, endpoint, input, id, correlationId, apiCallType);\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,\n FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from '../types';\nimport { UnmeshedCommonUtils } from '../utils/unmeshedCommonUtils';\n\nexport class UnmeshedApiClient {\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 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>(endpoint: string, params?: QueryParams, config?: RequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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 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 LIST = 'LIST',\n HTTP = 'HTTP',\n WORKER = 'WORKER',\n SWITCH = 'SWITCH',\n PARALLEL = 'PARALLEL',\n FAIL = 'FAIL',\n PYTHON = 'PYTHON',\n JAVASCRIPT = 'JAVASCRIPT',\n JQ = 'JQ',\n SLACK = 'SLACK',\n GRAPHQL = 'GRAPHQL',\n WAIT = 'WAIT',\n BUILTIN = 'BUILTIN',\n NOOP = 'NOOP',\n AI_AGENT = 'AI_AGENT',\n EXIT = 'EXIT',\n DEPENDSON = 'DEPENDSON',\n PERSISTED_STATE = 'PERSISTED_STATE',\n UPDATE_STEP = 'UPDATE_STEP',\n INTEGRATION = 'INTEGRATION',\n FOREACH = 'FOREACH',\n WHILE = 'WHILE',\n SUB_PROCESS = 'SUB_PROCESS',\n FLOW_GATEWAY = 'FLOW_GATEWAY',\n DECISION_ENGINE = 'DECISION_ENGINE',\n SQLITE = 'SQLITE',\n MANAGED = 'MANAGED',\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 historyId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n authClaims: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n steps: StepId[];\n stepRecords: 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};\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 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 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(\n `Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`\n );\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\n .then(() => {\n clearTimeout(timeout);\n resolve();\n })\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\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(apiClient: UnmeshedApiClient, data: StepQueueNameData[]) {\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('An error occurred during polling registration. Retrying in 3 seconds...');\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 return [];\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(\n (acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n },\n {} as Record<StepStatus, number[]>\n );\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\n .then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n })\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(apiClient: UnmeshedApiClient, workers: UnmeshedWorkerConfig[]) {\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(\n pollWorker(apiClient, pollWorkerData),\n apiClient.config.pollTimeout\n );\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) => worker.name === polledWorker.stepName && 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(\n `Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`\n );\n const result = await Promise.race([associatedWorker.worker(polledWorker.inputParam), timeoutPromise]);\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: Error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n ...error,\n name: error.name,\n message: error.message,\n stack: error.stack,\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError: unknown) {\n if (stringifyError instanceof Error) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n return 'Error stringification failed: An unknown error occurred during stringification.';\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(`${PROCESS_PREFIX}/runAsync`, {\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 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>(`${PROCESS_PREFIX}/context/${processId}`, { includeSteps });\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 (apiClient: UnmeshedApiClient, stepId: number): 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>(`${PROCESS_PREFIX}/stepContext/${stepId}`);\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(`${PROCESS_PREFIX}/bulkTerminate`, {\n params: { reason },\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while terminating processes: ${err.message || error}`);\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/bulkResume`, {\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while resuming processes: ${err.message || error}`);\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(`${PROCESS_PREFIX}/bulkReviewed`, {\n data: processIds,\n params: { reason },\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while marking processes as reviewed: ${err.message || error}`);\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\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(`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`);\n } else {\n const err = error as Error;\n throw new Error(`Unexpected error during rerun process: ${err.message || err}`);\n }\n }\n};\n\nexport const searchProcessExecutions = async (apiClient: UnmeshedApiClient, params: ProcessSearchRequest) => {\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) queryParams.set('names', params.names.join(','));\n if (params.processIds && params.processIds.length) 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) queryParams.set('requestIds', params.requestIds.join(','));\n if (params.statuses && params.statuses.length) queryParams.set('statuses', params.statuses.join(','));\n if (params.triggerTypes && params.triggerTypes.length) queryParams.set('triggerTypes', params.triggerTypes.join(','));\n\n const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));\n\n try {\n const response = await apiClient.get(`api/stats/process/search`, updatedParams);\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n id: id,\n correlationId: correlationId,\n apiCallType,\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\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,mBAA4G;;;ACA5G,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;;;ADAO,IAAM,oBAAN,MAAwB;AAAA,EACrB,gBAAsC;AAAA,EACtC,WAA+B;AAAA,EAC/B;AAAA,EAER,YAAY,sBAA4C;AACtD,YAAQ,IAAI,iCAAiC;AAE7C,SAAK,UAAU,2BAA2B,oBAAoB;AAE9D,YAAQ,IAAI,KAAK,OAAO;AAExB,SAAK,WAAW,KAAK,QAAQ;AAE7B,QAAI,CAAC,KA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AAQ,WAAW,OAAO;AAAA,EAC9C;AAAA,EAEA,uBAAuB,QAA8B;AACnD,WAAO,wBAAwB,KAAK,QAAQ,MAAM;AAAA,EACpD;AAAA,EAEA,oBACE,WACA,UACA,IACA,eACA,aACA;AACA,WAAO,oBAAoB,WAAW,UAAU,IAAI,eAAe,WAAW;AAAA,EAChF;AAAA,EAEA,qBACE,UACA,OACA,IACA,eACA,aACA;AACA,WAAO,qBAAqB,KAAK,QAAQ,UAAU,OAAO,IAAI,eAAe,WAAW;AAAA,EAC1F;AAAA,EAEA,kBAAkB,QAAiC;AACjD,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAC9C;AACF;","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 ProcessDefinitionData,\n ProcessDefinitionDeleteRequest,\n ProcessDefinitionDetails,\n ProcessDefinitionsDetail,\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 createProcessDefinition,\n updateProcessDefinition,\n deleteProcessDefinition,\n getProcessDefinitions,\n getProcessDefinitionVersions,\n getProcessDefinitionByVersion,\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, version?: number) {\n return rerun(this.client, processId, 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(apiClient, endpoint, id, correlationId, apiCallType);\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(this.client, endpoint, input, id, correlationId, apiCallType);\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n\n createProcessDefinition(body: ProcessDefinitionData) {\n return createProcessDefinition(this.client, body);\n }\n updateProcessDefinition(body: ProcessDefinitionData) {\n return updateProcessDefinition(this.client, body);\n }\n deleteProcessDefinition(body: ProcessDefinitionDeleteRequest) {\n return deleteProcessDefinition(this.client, body);\n }\n getProcessDefinitions(namespace?: string) {\n return getProcessDefinitions(this.client, namespace);\n }\n getProcessDefinitionVersions(body: ProcessDefinitionsDetail) {\n return getProcessDefinitionVersions(this.client, body);\n }\n getProcessDefinitionByVersion(body: ProcessDefinitionDetails) {\n return getProcessDefinitionByVersion(this.client, body);\n }\n}\n\nexport * from './types';\n","import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from 'axios';\nimport {\n ApiResponse,\n ClientRequestConfig,\n FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from '../types';\nimport { UnmeshedCommonUtils } from '../utils/unmeshedCommonUtils';\n\nexport class UnmeshedApiClient {\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 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>(endpoint: string, params?: QueryParams, config?: RequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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 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 LIST = 'LIST',\n HTTP = 'HTTP',\n WORKER = 'WORKER',\n SWITCH = 'SWITCH',\n PARALLEL = 'PARALLEL',\n FAIL = 'FAIL',\n PYTHON = 'PYTHON',\n JAVASCRIPT = 'JAVASCRIPT',\n JQ = 'JQ',\n SLACK = 'SLACK',\n GRAPHQL = 'GRAPHQL',\n WAIT = 'WAIT',\n BUILTIN = 'BUILTIN',\n NOOP = 'NOOP',\n AI_AGENT = 'AI_AGENT',\n EXIT = 'EXIT',\n DEPENDSON = 'DEPENDSON',\n PERSISTED_STATE = 'PERSISTED_STATE',\n UPDATE_STEP = 'UPDATE_STEP',\n INTEGRATION = 'INTEGRATION',\n FOREACH = 'FOREACH',\n WHILE = 'WHILE',\n SUB_PROCESS = 'SUB_PROCESS',\n FLOW_GATEWAY = 'FLOW_GATEWAY',\n DECISION_ENGINE = 'DECISION_ENGINE',\n SQLITE = 'SQLITE',\n MANAGED = 'MANAGED',\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 historyId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n authClaims: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n steps: StepId[];\n stepRecords: 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 TagValue = {\n name: string;\n value: 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 tags?: TagValue[];\n};\n\nexport interface ExecutionWait {\n result: { waitUntil: number };\n logs: [];\n}\n\nexport interface ExecutionTimelineType {\n id: number;\n executor: string;\n output: ExecutionWait | null;\n polled: number;\n scheduled: number;\n start: number;\n updated: number;\n ref?: string | null;\n}\n\nexport interface ExecutionDetails extends ExecutionTimelineType {\n stepRef: string;\n}\n\nexport interface AuditInfo {\n createdBy: string;\n updatedBy: string;\n created: number;\n updated: number;\n}\n\nexport interface Step extends NewStepData, AuditInfo, Object {\n executionList?: ExecutionDetails[];\n parentRef?: string;\n status?: string;\n completed?: number;\n children: Step[];\n executionCount?: number;\n triggerType?: string;\n}\nexport interface StepConfiguration {\n errorPolicyName?: string;\n useCache?: boolean;\n stream?: boolean;\n cacheKey?: string;\n cacheTimeoutSeconds?: number;\n jqTransformer?: string;\n rateLimitWindowSeconds?: number | null;\n rateLimitMaxRequests?: number | null;\n preExecutionScript?: string;\n scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';\n constructInputFromScript?: boolean;\n additionalRefs?: string[];\n}\n\nexport interface NewStepData {\n type: StepType;\n name: string;\n namespace: string;\n ref: string;\n optional?: boolean;\n configuration?: StepConfiguration;\n children?: Step[];\n input?: Record<string, any>;\n output?: Record<string, any>;\n}\n\nexport type ProcessDefinitionDeleteRequest = {\n namespace: string;\n name: string;\n type: string;\n version: number;\n steps?: Step[];\n};\n\nexport interface ProcessRequest {\n name?: string;\n namespace?: string;\n version?: number | null;\n id?: string | null;\n correlationId?: string | null;\n input?: Record<string, any> | null;\n testRun?: boolean | null;\n}\nexport interface ProcessConfiguration {\n completionTimeout?: number;\n onTimeoutProcess?: ProcessRequest;\n onFailProcess?: ProcessRequest | null;\n onCompleteProcess?: ProcessRequest | null;\n onCancelProcess?: ProcessRequest;\n}\n\nexport interface ProcessDefinitionData {\n namespace: string;\n name: string;\n version?: number;\n type: ProcessType | string;\n description?: string;\n configuration?: ProcessConfiguration;\n steps: Step[];\n defaultInput?: Record<string, any>;\n defaultOutput?: Record<string, any>;\n outputMapping?: Record<string, any>;\n tags?: TagValue[];\n}\nexport interface ProcessDefinitionsDetail {\n name: string;\n namespace: string;\n}\n\nexport interface ProcessDefinitionDetails {\n name: string;\n namespace: string;\n version?: number;\n}\n\nexport interface ExecutionWait {\n result: { waitUntil: number };\n logs: [];\n}\n\nexport interface ExecutionTimelineType {\n id: number;\n executor: string;\n output: ExecutionWait | null;\n polled: number;\n scheduled: number;\n start: number;\n updated: number;\n ref?: string | null;\n}\n\nexport interface ExecutionDetails extends ExecutionTimelineType {\n stepRef: string;\n}\n\nexport interface AuditInfo {\n createdBy: string;\n updatedBy: string;\n created: number;\n updated: number;\n}\n\nexport interface Step extends NewStepData, AuditInfo, Object {\n executionList?: ExecutionDetails[];\n parentRef?: string;\n status?: string;\n completed?: number;\n children: Step[];\n executionCount?: number;\n triggerType?: string;\n}\nexport interface StepConfiguration {\n errorPolicyName?: string;\n useCache?: boolean;\n stream?: boolean;\n cacheKey?: string;\n cacheTimeoutSeconds?: number;\n jqTransformer?: string;\n rateLimitWindowSeconds?: number | null;\n rateLimitMaxRequests?: number | null;\n preExecutionScript?: string;\n scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';\n constructInputFromScript?: boolean;\n additionalRefs?: string[];\n streamAllStatuses?: boolean;\n}\n\nexport interface NewStepData {\n type: StepType;\n name: string;\n namespace: string;\n ref: string;\n optional?: boolean;\n configuration?: StepConfiguration;\n children?: Step[];\n input?: Record<string, any>;\n output?: Record<string, any>;\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 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 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(\n `Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`\n );\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\n .then(() => {\n clearTimeout(timeout);\n resolve();\n })\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\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(apiClient: UnmeshedApiClient, data: StepQueueNameData[]) {\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('An error occurred during polling registration. Retrying in 3 seconds...');\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 return [];\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(\n (acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n },\n {} as Record<StepStatus, number[]>\n );\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\n .then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n })\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(apiClient: UnmeshedApiClient, workers: UnmeshedWorkerConfig[]) {\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(\n pollWorker(apiClient, pollWorkerData),\n apiClient.config.pollTimeout\n );\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) => worker.name === polledWorker.stepName && 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(\n `Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`\n );\n const result = await Promise.race([associatedWorker.worker(polledWorker.inputParam), timeoutPromise]);\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: Error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n ...error,\n name: error.name,\n message: error.message,\n stack: error.stack,\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError: unknown) {\n if (stringifyError instanceof Error) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n return 'Error stringification failed: An unknown error occurred during stringification.';\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 ProcessDefinitionData,\n ProcessDefinitionDeleteRequest,\n ProcessDefinitionDetails,\n ProcessDefinitionsDetail,\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(`${PROCESS_PREFIX}/runAsync`, {\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 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>(`${PROCESS_PREFIX}/context/${processId}`, { includeSteps });\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 (apiClient: UnmeshedApiClient, stepId: number): 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>(`${PROCESS_PREFIX}/stepContext/${stepId}`);\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(`${PROCESS_PREFIX}/bulkTerminate`, {\n params: { reason },\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while terminating processes: ${err.message || error}`);\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/bulkResume`, {\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while resuming processes: ${err.message || error}`);\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(`${PROCESS_PREFIX}/bulkReviewed`, {\n data: processIds,\n params: { reason },\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while marking processes as reviewed: ${err.message || error}`);\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\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(`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`);\n } else {\n const err = error as Error;\n throw new Error(`Unexpected error during rerun process: ${err.message || err}`);\n }\n }\n};\n\nexport const searchProcessExecutions = async (apiClient: UnmeshedApiClient, params: ProcessSearchRequest) => {\n const body: Record<string, any> = {};\n\n if (params.startTimeEpoch) body.startTimeEpoch = params.startTimeEpoch;\n if (params.endTimeEpoch) body.endTimeEpoch = params.endTimeEpoch;\n\n if (params.namespace) body.namespace = params.namespace;\n if (params.names?.length) body.names = params.names;\n if (params.processIds?.length) body.processIds = params.processIds;\n if (params.correlationIds?.length) body.correlationIds = params.correlationIds;\n if (params.requestIds?.length) body.requestIds = params.requestIds;\n if (params.statuses?.length) body.statuses = params.statuses;\n if (params.triggerTypes?.length) body.triggerTypes = params.triggerTypes;\n\n if (params.tags?.length) body.tags = params.tags;\n\n try {\n const response = await apiClient.post(`api/stats/process/search`, {\n data: body,\n params: {},\n });\n\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n id: id,\n correlationId: correlationId,\n apiCallType,\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\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\nexport const createProcessDefinition = async (apiClient: UnmeshedApiClient, requestData: ProcessDefinitionData) => {\n try {\n const response = await apiClient.post(`/api/processDefinitions`, {\n data: requestData,\n params: {},\n });\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while creating process definition:', error);\n throw error;\n }\n};\n\nexport const deleteProcessDefinition = async (\n apiClient: UnmeshedApiClient,\n requestData: ProcessDefinitionDeleteRequest\n) => {\n try {\n const response = await apiClient.delete(`/api/processDefinitions`, {\n data: [requestData],\n params: {},\n });\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while deleting process definition:', error);\n throw error;\n }\n};\n\nexport const updateProcessDefinition = async (apiClient: UnmeshedApiClient, requestData: ProcessDefinitionData) => {\n try {\n const response = await apiClient.put(`/api/processDefinitions`, {\n data: requestData,\n params: {},\n });\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while creating process definition:', error);\n throw error;\n }\n};\n\nexport const getProcessDefinitions = async (apiClient: UnmeshedApiClient, namespace?: string) => {\n try {\n const params = namespace ? { namespace } : {};\n const response = await apiClient.get('/api/processDefinitions', params);\n return response.data;\n } catch (error) {\n console.error('Error occurred while fetching process definitions:', error);\n throw error;\n }\n};\n\nexport const getProcessDefinitionVersions = async (apiClient: UnmeshedApiClient, body: ProcessDefinitionsDetail) => {\n try {\n const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}/versions`);\n return response.data;\n } catch (error) {\n console.error('Error occurred while fetching process definition: ', error);\n throw error;\n }\n};\n\nexport const getProcessDefinitionByVersion = async (apiClient: UnmeshedApiClient, body: ProcessDefinitionDetails) => {\n if (!body.namespace || !body.name || !body.version) {\n throw new Error('namespace, name, and version are required');\n }\n\n try {\n const params = body.version ? { version: body.version } : {};\n\n const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}`, params);\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while fetching process definition:', 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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AA,EACA,wBAAwB,MAAsC;AAC5D,WAAO,wBAAwB,KAAK,QAAQ,IAAI;AAAA,EAClD;AAAA,EACA,sBAAsB,WAAoB;AACxC,WAAO,sBAAsB,KAAK,QAAQ,SAAS;AAAA,EACrD;AAAA,EACA,6BAA6B,MAAgC;AAC3D,WAAO,6BAA6B,KAAK,QAAQ,IAAI;AAAA,EACvD;AAAA,EACA,8BAA8B,MAAgC;AAC5D,WAAO,8BAA8B,KAAK,QAAQ,IAAI;AAAA,EACxD;AACF;","names":["axios","ApiCallType","WebhookSource","SQAuthUserType","StepType","StepStatus","ProcessStatus","ProcessTriggerType","ProcessType","response","import_axios","ProcessRequestData","ProcessRequestData"]}
|
package/dist/index.mjs
CHANGED
|
@@ -630,26 +630,25 @@ var rerun = async (apiClient, processId, version) => {
|
|
|
630
630
|
}
|
|
631
631
|
};
|
|
632
632
|
var searchProcessExecutions = async (apiClient, params) => {
|
|
633
|
-
const
|
|
634
|
-
if (params.startTimeEpoch
|
|
635
|
-
|
|
636
|
-
if (params.
|
|
637
|
-
|
|
638
|
-
if (params.
|
|
639
|
-
if (params.
|
|
640
|
-
if (params.
|
|
641
|
-
if (params.
|
|
642
|
-
|
|
643
|
-
if (params.
|
|
644
|
-
if (params.statuses && params.statuses.length) queryParams.set("statuses", params.statuses.join(","));
|
|
645
|
-
if (params.triggerTypes && params.triggerTypes.length) queryParams.set("triggerTypes", params.triggerTypes.join(","));
|
|
646
|
-
const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));
|
|
633
|
+
const body = {};
|
|
634
|
+
if (params.startTimeEpoch) body.startTimeEpoch = params.startTimeEpoch;
|
|
635
|
+
if (params.endTimeEpoch) body.endTimeEpoch = params.endTimeEpoch;
|
|
636
|
+
if (params.namespace) body.namespace = params.namespace;
|
|
637
|
+
if (params.names?.length) body.names = params.names;
|
|
638
|
+
if (params.processIds?.length) body.processIds = params.processIds;
|
|
639
|
+
if (params.correlationIds?.length) body.correlationIds = params.correlationIds;
|
|
640
|
+
if (params.requestIds?.length) body.requestIds = params.requestIds;
|
|
641
|
+
if (params.statuses?.length) body.statuses = params.statuses;
|
|
642
|
+
if (params.triggerTypes?.length) body.triggerTypes = params.triggerTypes;
|
|
643
|
+
if (params.tags?.length) body.tags = params.tags;
|
|
647
644
|
try {
|
|
648
|
-
const response = await apiClient.
|
|
649
|
-
|
|
645
|
+
const response = await apiClient.post(`api/stats/process/search`, {
|
|
646
|
+
data: body,
|
|
647
|
+
params: {}
|
|
648
|
+
});
|
|
650
649
|
return response.data;
|
|
651
650
|
} catch (error) {
|
|
652
|
-
console.error("Error occurred while searching process executions:
|
|
651
|
+
console.error("Error occurred while searching process executions:", error);
|
|
653
652
|
throw error;
|
|
654
653
|
}
|
|
655
654
|
};
|
|
@@ -683,6 +682,74 @@ var invokeApiMappingPost = async (apiClient, endpoint, input, id, correlationId,
|
|
|
683
682
|
throw error;
|
|
684
683
|
}
|
|
685
684
|
};
|
|
685
|
+
var createProcessDefinition = async (apiClient, requestData) => {
|
|
686
|
+
try {
|
|
687
|
+
const response = await apiClient.post(`/api/processDefinitions`, {
|
|
688
|
+
data: requestData,
|
|
689
|
+
params: {}
|
|
690
|
+
});
|
|
691
|
+
return response.data;
|
|
692
|
+
} catch (error) {
|
|
693
|
+
console.error("Error occurred while creating process definition:", error);
|
|
694
|
+
throw error;
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
var deleteProcessDefinition = async (apiClient, requestData) => {
|
|
698
|
+
try {
|
|
699
|
+
const response = await apiClient.delete(`/api/processDefinitions`, {
|
|
700
|
+
data: [requestData],
|
|
701
|
+
params: {}
|
|
702
|
+
});
|
|
703
|
+
return response.data;
|
|
704
|
+
} catch (error) {
|
|
705
|
+
console.error("Error occurred while deleting process definition:", error);
|
|
706
|
+
throw error;
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
var updateProcessDefinition = async (apiClient, requestData) => {
|
|
710
|
+
try {
|
|
711
|
+
const response = await apiClient.put(`/api/processDefinitions`, {
|
|
712
|
+
data: requestData,
|
|
713
|
+
params: {}
|
|
714
|
+
});
|
|
715
|
+
return response.data;
|
|
716
|
+
} catch (error) {
|
|
717
|
+
console.error("Error occurred while creating process definition:", error);
|
|
718
|
+
throw error;
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
var getProcessDefinitions = async (apiClient, namespace) => {
|
|
722
|
+
try {
|
|
723
|
+
const params = namespace ? { namespace } : {};
|
|
724
|
+
const response = await apiClient.get("/api/processDefinitions", params);
|
|
725
|
+
return response.data;
|
|
726
|
+
} catch (error) {
|
|
727
|
+
console.error("Error occurred while fetching process definitions:", error);
|
|
728
|
+
throw error;
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
var getProcessDefinitionVersions = async (apiClient, body) => {
|
|
732
|
+
try {
|
|
733
|
+
const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}/versions`);
|
|
734
|
+
return response.data;
|
|
735
|
+
} catch (error) {
|
|
736
|
+
console.error("Error occurred while fetching process definition: ", error);
|
|
737
|
+
throw error;
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
var getProcessDefinitionByVersion = async (apiClient, body) => {
|
|
741
|
+
if (!body.namespace || !body.name || !body.version) {
|
|
742
|
+
throw new Error("namespace, name, and version are required");
|
|
743
|
+
}
|
|
744
|
+
try {
|
|
745
|
+
const params = body.version ? { version: body.version } : {};
|
|
746
|
+
const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}`, params);
|
|
747
|
+
return response.data;
|
|
748
|
+
} catch (error) {
|
|
749
|
+
console.error("Error occurred while fetching process definition:", error);
|
|
750
|
+
throw error;
|
|
751
|
+
}
|
|
752
|
+
};
|
|
686
753
|
|
|
687
754
|
// src/apis/registrationClientImpl.ts
|
|
688
755
|
var renewRegistration = async (apiClient, params) => {
|
|
@@ -743,6 +810,24 @@ var UnmeshedClient = class {
|
|
|
743
810
|
reNewRegistration(params) {
|
|
744
811
|
return renewRegistration(this.client, params);
|
|
745
812
|
}
|
|
813
|
+
createProcessDefinition(body) {
|
|
814
|
+
return createProcessDefinition(this.client, body);
|
|
815
|
+
}
|
|
816
|
+
updateProcessDefinition(body) {
|
|
817
|
+
return updateProcessDefinition(this.client, body);
|
|
818
|
+
}
|
|
819
|
+
deleteProcessDefinition(body) {
|
|
820
|
+
return deleteProcessDefinition(this.client, body);
|
|
821
|
+
}
|
|
822
|
+
getProcessDefinitions(namespace) {
|
|
823
|
+
return getProcessDefinitions(this.client, namespace);
|
|
824
|
+
}
|
|
825
|
+
getProcessDefinitionVersions(body) {
|
|
826
|
+
return getProcessDefinitionVersions(this.client, body);
|
|
827
|
+
}
|
|
828
|
+
getProcessDefinitionByVersion(body) {
|
|
829
|
+
return getProcessDefinitionByVersion(this.client, body);
|
|
830
|
+
}
|
|
746
831
|
};
|
|
747
832
|
export {
|
|
748
833
|
ApiCallType,
|
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,\n FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from '../types';\nimport { UnmeshedCommonUtils } from '../utils/unmeshedCommonUtils';\n\nexport class UnmeshedApiClient {\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 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>(endpoint: string, params?: QueryParams, config?: RequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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 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 LIST = 'LIST',\n HTTP = 'HTTP',\n WORKER = 'WORKER',\n SWITCH = 'SWITCH',\n PARALLEL = 'PARALLEL',\n FAIL = 'FAIL',\n PYTHON = 'PYTHON',\n JAVASCRIPT = 'JAVASCRIPT',\n JQ = 'JQ',\n SLACK = 'SLACK',\n GRAPHQL = 'GRAPHQL',\n WAIT = 'WAIT',\n BUILTIN = 'BUILTIN',\n NOOP = 'NOOP',\n AI_AGENT = 'AI_AGENT',\n EXIT = 'EXIT',\n DEPENDSON = 'DEPENDSON',\n PERSISTED_STATE = 'PERSISTED_STATE',\n UPDATE_STEP = 'UPDATE_STEP',\n INTEGRATION = 'INTEGRATION',\n FOREACH = 'FOREACH',\n WHILE = 'WHILE',\n SUB_PROCESS = 'SUB_PROCESS',\n FLOW_GATEWAY = 'FLOW_GATEWAY',\n DECISION_ENGINE = 'DECISION_ENGINE',\n SQLITE = 'SQLITE',\n MANAGED = 'MANAGED',\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 historyId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n authClaims: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n steps: StepId[];\n stepRecords: 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};\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 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 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(\n `Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`\n );\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\n .then(() => {\n clearTimeout(timeout);\n resolve();\n })\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\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(apiClient: UnmeshedApiClient, data: StepQueueNameData[]) {\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('An error occurred during polling registration. Retrying in 3 seconds...');\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 return [];\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(\n (acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n },\n {} as Record<StepStatus, number[]>\n );\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\n .then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n })\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(apiClient: UnmeshedApiClient, workers: UnmeshedWorkerConfig[]) {\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(\n pollWorker(apiClient, pollWorkerData),\n apiClient.config.pollTimeout\n );\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) => worker.name === polledWorker.stepName && 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(\n `Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`\n );\n const result = await Promise.race([associatedWorker.worker(polledWorker.inputParam), timeoutPromise]);\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: Error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n ...error,\n name: error.name,\n message: error.message,\n stack: error.stack,\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError: unknown) {\n if (stringifyError instanceof Error) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n return 'Error stringification failed: An unknown error occurred during stringification.';\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(`${PROCESS_PREFIX}/runAsync`, {\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 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>(`${PROCESS_PREFIX}/context/${processId}`, { includeSteps });\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 (apiClient: UnmeshedApiClient, stepId: number): 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>(`${PROCESS_PREFIX}/stepContext/${stepId}`);\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(`${PROCESS_PREFIX}/bulkTerminate`, {\n params: { reason },\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while terminating processes: ${err.message || error}`);\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/bulkResume`, {\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while resuming processes: ${err.message || error}`);\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(`${PROCESS_PREFIX}/bulkReviewed`, {\n data: processIds,\n params: { reason },\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while marking processes as reviewed: ${err.message || error}`);\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\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(`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`);\n } else {\n const err = error as Error;\n throw new Error(`Unexpected error during rerun process: ${err.message || err}`);\n }\n }\n};\n\nexport const searchProcessExecutions = async (apiClient: UnmeshedApiClient, params: ProcessSearchRequest) => {\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) queryParams.set('names', params.names.join(','));\n if (params.processIds && params.processIds.length) 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) queryParams.set('requestIds', params.requestIds.join(','));\n if (params.statuses && params.statuses.length) queryParams.set('statuses', params.statuses.join(','));\n if (params.triggerTypes && params.triggerTypes.length) queryParams.set('triggerTypes', params.triggerTypes.join(','));\n\n const updatedParams = Object.fromEntries(new URLSearchParams(queryParams));\n\n try {\n const response = await apiClient.get(`api/stats/process/search`, updatedParams);\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n id: id,\n correlationId: correlationId,\n apiCallType,\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\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, version?: number) {\n return rerun(this.client, processId, 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(apiClient, endpoint, id, correlationId, apiCallType);\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(this.client, endpoint, input, id, correlationId, apiCallType);\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n}\n\nexport * from './types';\n"],"mappings":";AAAA,OAAO,WAAqG;;;ACA5G,SAAS,kBAAkB;AAEpB,IAAM,sBAAN,MAA0B;AAAA,EAC/B,OAAO,iBAAiB,OA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O,eAAe,KAAK,QAAQ,WAAW,YAAY;AAAA,EAC5D;AAAA,EAEA,YAAY,QAAgB;AAC1B,WAAO,YAAY,KAAK,QAAQ,MAAM;AAAA,EACxC;AAAA,EAEA,cAAc,YAAsB,QAAiB;AACnD,WAAO,cAAc,KAAK,QAAQ,YAAY,MAAM;AAAA,EACtD;AAAA,EAEA,WAAW,YAAsB;AAC/B,WAAO,WAAW,KAAK,QAAQ,UAAU;AAAA,EAC3C;AAAA,EAEA,aAAa,YAAsB,QAAiB;AAClD,WAAO,aAAa,KAAK,QAAQ,YAAY,MAAM;AAAA,EACrD;AAAA,EAEA,MAAM,WAAmB,SAAkB;AACzC,WAAO,MAAM,KAAK,QAAQ,WAAW,OAAO;AAAA,EAC9C;AAAA,EAEA,uBAAuB,QAA8B;AACnD,WAAO,wBAAwB,KAAK,QAAQ,MAAM;AAAA,EACpD;AAAA,EAEA,oBACE,WACA,UACA,IACA,eACA,aACA;AACA,WAAO,oBAAoB,WAAW,UAAU,IAAI,eAAe,WAAW;AAAA,EAChF;AAAA,EAEA,qBACE,UACA,OACA,IACA,eACA,aACA;AACA,WAAO,qBAAqB,KAAK,QAAQ,UAAU,OAAO,IAAI,eAAe,WAAW;AAAA,EAC1F;AAAA,EAEA,kBAAkB,QAAiC;AACjD,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAC9C;AACF;","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,\n FinalUnmeshedClientConfig,\n HandleRequestConfig,\n QueryParams,\n RequestConfig,\n UnmeshedClientConfig,\n} from '../types';\nimport { UnmeshedCommonUtils } from '../utils/unmeshedCommonUtils';\n\nexport class UnmeshedApiClient {\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 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>(endpoint: string, params?: QueryParams, config?: RequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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>(endpoint: string, clientRequestConfig: ClientRequestConfig): 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 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 LIST = 'LIST',\n HTTP = 'HTTP',\n WORKER = 'WORKER',\n SWITCH = 'SWITCH',\n PARALLEL = 'PARALLEL',\n FAIL = 'FAIL',\n PYTHON = 'PYTHON',\n JAVASCRIPT = 'JAVASCRIPT',\n JQ = 'JQ',\n SLACK = 'SLACK',\n GRAPHQL = 'GRAPHQL',\n WAIT = 'WAIT',\n BUILTIN = 'BUILTIN',\n NOOP = 'NOOP',\n AI_AGENT = 'AI_AGENT',\n EXIT = 'EXIT',\n DEPENDSON = 'DEPENDSON',\n PERSISTED_STATE = 'PERSISTED_STATE',\n UPDATE_STEP = 'UPDATE_STEP',\n INTEGRATION = 'INTEGRATION',\n FOREACH = 'FOREACH',\n WHILE = 'WHILE',\n SUB_PROCESS = 'SUB_PROCESS',\n FLOW_GATEWAY = 'FLOW_GATEWAY',\n DECISION_ENGINE = 'DECISION_ENGINE',\n SQLITE = 'SQLITE',\n MANAGED = 'MANAGED',\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 historyId: number | null;\n requestId: string;\n correlationId: string;\n status: ProcessStatus;\n input: Record<string, unknown>;\n output: Record<string, unknown>;\n authClaims: Record<string, unknown>;\n stepIdCount: number | null;\n shardName: string;\n shardInstanceId: number | null;\n steps: StepId[];\n stepRecords: 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 TagValue = {\n name: string;\n value: 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 tags?: TagValue[];\n};\n\nexport interface ExecutionWait {\n result: { waitUntil: number };\n logs: [];\n}\n\nexport interface ExecutionTimelineType {\n id: number;\n executor: string;\n output: ExecutionWait | null;\n polled: number;\n scheduled: number;\n start: number;\n updated: number;\n ref?: string | null;\n}\n\nexport interface ExecutionDetails extends ExecutionTimelineType {\n stepRef: string;\n}\n\nexport interface AuditInfo {\n createdBy: string;\n updatedBy: string;\n created: number;\n updated: number;\n}\n\nexport interface Step extends NewStepData, AuditInfo, Object {\n executionList?: ExecutionDetails[];\n parentRef?: string;\n status?: string;\n completed?: number;\n children: Step[];\n executionCount?: number;\n triggerType?: string;\n}\nexport interface StepConfiguration {\n errorPolicyName?: string;\n useCache?: boolean;\n stream?: boolean;\n cacheKey?: string;\n cacheTimeoutSeconds?: number;\n jqTransformer?: string;\n rateLimitWindowSeconds?: number | null;\n rateLimitMaxRequests?: number | null;\n preExecutionScript?: string;\n scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';\n constructInputFromScript?: boolean;\n additionalRefs?: string[];\n}\n\nexport interface NewStepData {\n type: StepType;\n name: string;\n namespace: string;\n ref: string;\n optional?: boolean;\n configuration?: StepConfiguration;\n children?: Step[];\n input?: Record<string, any>;\n output?: Record<string, any>;\n}\n\nexport type ProcessDefinitionDeleteRequest = {\n namespace: string;\n name: string;\n type: string;\n version: number;\n steps?: Step[];\n};\n\nexport interface ProcessRequest {\n name?: string;\n namespace?: string;\n version?: number | null;\n id?: string | null;\n correlationId?: string | null;\n input?: Record<string, any> | null;\n testRun?: boolean | null;\n}\nexport interface ProcessConfiguration {\n completionTimeout?: number;\n onTimeoutProcess?: ProcessRequest;\n onFailProcess?: ProcessRequest | null;\n onCompleteProcess?: ProcessRequest | null;\n onCancelProcess?: ProcessRequest;\n}\n\nexport interface ProcessDefinitionData {\n namespace: string;\n name: string;\n version?: number;\n type: ProcessType | string;\n description?: string;\n configuration?: ProcessConfiguration;\n steps: Step[];\n defaultInput?: Record<string, any>;\n defaultOutput?: Record<string, any>;\n outputMapping?: Record<string, any>;\n tags?: TagValue[];\n}\nexport interface ProcessDefinitionsDetail {\n name: string;\n namespace: string;\n}\n\nexport interface ProcessDefinitionDetails {\n name: string;\n namespace: string;\n version?: number;\n}\n\nexport interface ExecutionWait {\n result: { waitUntil: number };\n logs: [];\n}\n\nexport interface ExecutionTimelineType {\n id: number;\n executor: string;\n output: ExecutionWait | null;\n polled: number;\n scheduled: number;\n start: number;\n updated: number;\n ref?: string | null;\n}\n\nexport interface ExecutionDetails extends ExecutionTimelineType {\n stepRef: string;\n}\n\nexport interface AuditInfo {\n createdBy: string;\n updatedBy: string;\n created: number;\n updated: number;\n}\n\nexport interface Step extends NewStepData, AuditInfo, Object {\n executionList?: ExecutionDetails[];\n parentRef?: string;\n status?: string;\n completed?: number;\n children: Step[];\n executionCount?: number;\n triggerType?: string;\n}\nexport interface StepConfiguration {\n errorPolicyName?: string;\n useCache?: boolean;\n stream?: boolean;\n cacheKey?: string;\n cacheTimeoutSeconds?: number;\n jqTransformer?: string;\n rateLimitWindowSeconds?: number | null;\n rateLimitMaxRequests?: number | null;\n preExecutionScript?: string;\n scriptLanguage?: 'JAVASCRIPT' | 'PYTHON';\n constructInputFromScript?: boolean;\n additionalRefs?: string[];\n streamAllStatuses?: boolean;\n}\n\nexport interface NewStepData {\n type: StepType;\n name: string;\n namespace: string;\n ref: string;\n optional?: boolean;\n configuration?: StepConfiguration;\n children?: Step[];\n input?: Record<string, any>;\n output?: Record<string, any>;\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 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 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(\n `Configured queued worker with ${pollIntervalMs} ms interval and batch size of ${batchSize} and a timeout of ${timeoutMs} ms`\n );\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\n .then(() => {\n clearTimeout(timeout);\n resolve();\n })\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\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(apiClient: UnmeshedApiClient, data: StepQueueNameData[]) {\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('An error occurred during polling registration. Retrying in 3 seconds...');\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 return [];\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(\n (acc, response) => {\n if (!acc[response.status]) {\n acc[response.status] = [];\n }\n acc[response.status].push(response.stepId);\n return acc;\n },\n {} as Record<StepStatus, number[]>\n );\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\n .then((workRequests) => {\n clearTimeout(timeout);\n resolve(workRequests);\n })\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(apiClient: UnmeshedApiClient, workers: UnmeshedWorkerConfig[]) {\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(\n pollWorker(apiClient, pollWorkerData),\n apiClient.config.pollTimeout\n );\n for (const polledWorker of workRequests) {\n const associatedWorker: UnmeshedWorkerConfig | undefined = workers.find(\n (worker) => worker.name === polledWorker.stepName && 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(\n `Starting work ${polledWorker.processId} : ${polledWorker.stepId} : ${polledWorker.stepName} : ${polledWorker.stepRef}`\n );\n const result = await Promise.race([associatedWorker.worker(polledWorker.inputParam), timeoutPromise]);\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: Error) {\n try {\n if (error instanceof Error) {\n const plainError = {\n ...error,\n name: error.name,\n message: error.message,\n stack: error.stack,\n };\n return JSON.stringify(plainError);\n }\n return JSON.stringify(error);\n } catch (stringifyError: unknown) {\n if (stringifyError instanceof Error) {\n return `Error stringification failed: ${stringifyError.message}`;\n }\n return 'Error stringification failed: An unknown error occurred during stringification.';\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 ProcessDefinitionData,\n ProcessDefinitionDeleteRequest,\n ProcessDefinitionDetails,\n ProcessDefinitionsDetail,\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(`${PROCESS_PREFIX}/runAsync`, {\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 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>(`${PROCESS_PREFIX}/context/${processId}`, { includeSteps });\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 (apiClient: UnmeshedApiClient, stepId: number): 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>(`${PROCESS_PREFIX}/stepContext/${stepId}`);\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(`${PROCESS_PREFIX}/bulkTerminate`, {\n params: { reason },\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while terminating processes: ${err.message || error}`);\n }\n};\n\nexport const bulkResume = async (\n apiClient: UnmeshedApiClient,\n processIds: number[]\n): Promise<ProcessActionResponseData> => {\n try {\n const response = await apiClient.post(`${PROCESS_PREFIX}/bulkResume`, {\n data: processIds,\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while resuming processes: ${err.message || error}`);\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(`${PROCESS_PREFIX}/bulkReviewed`, {\n data: processIds,\n params: { reason },\n });\n return response.data as ProcessActionResponseData;\n } catch (error) {\n const err = error as Error;\n throw new Error(`Error occurred while marking processes as reviewed: ${err.message || error}`);\n }\n};\n\nexport const rerun = async (\n apiClient: UnmeshedApiClient,\n processId: number,\n version?: number\n): Promise<ProcessData> => {\n const params: Record<string, any> = {\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(`HTTP request error during rerun process: ${error.response?.status} - ${error.response?.data}`);\n } else {\n const err = error as Error;\n throw new Error(`Unexpected error during rerun process: ${err.message || err}`);\n }\n }\n};\n\nexport const searchProcessExecutions = async (apiClient: UnmeshedApiClient, params: ProcessSearchRequest) => {\n const body: Record<string, any> = {};\n\n if (params.startTimeEpoch) body.startTimeEpoch = params.startTimeEpoch;\n if (params.endTimeEpoch) body.endTimeEpoch = params.endTimeEpoch;\n\n if (params.namespace) body.namespace = params.namespace;\n if (params.names?.length) body.names = params.names;\n if (params.processIds?.length) body.processIds = params.processIds;\n if (params.correlationIds?.length) body.correlationIds = params.correlationIds;\n if (params.requestIds?.length) body.requestIds = params.requestIds;\n if (params.statuses?.length) body.statuses = params.statuses;\n if (params.triggerTypes?.length) body.triggerTypes = params.triggerTypes;\n\n if (params.tags?.length) body.tags = params.tags;\n\n try {\n const response = await apiClient.post(`api/stats/process/search`, {\n data: body,\n params: {},\n });\n\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n id: id,\n correlationId: correlationId,\n apiCallType,\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(`${PROCESS_PREFIX}/api/call/${endpoint}`, {\n data: input,\n params: {\n id: id,\n correlationId: correlationId,\n apiCallType,\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\nexport const createProcessDefinition = async (apiClient: UnmeshedApiClient, requestData: ProcessDefinitionData) => {\n try {\n const response = await apiClient.post(`/api/processDefinitions`, {\n data: requestData,\n params: {},\n });\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while creating process definition:', error);\n throw error;\n }\n};\n\nexport const deleteProcessDefinition = async (\n apiClient: UnmeshedApiClient,\n requestData: ProcessDefinitionDeleteRequest\n) => {\n try {\n const response = await apiClient.delete(`/api/processDefinitions`, {\n data: [requestData],\n params: {},\n });\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while deleting process definition:', error);\n throw error;\n }\n};\n\nexport const updateProcessDefinition = async (apiClient: UnmeshedApiClient, requestData: ProcessDefinitionData) => {\n try {\n const response = await apiClient.put(`/api/processDefinitions`, {\n data: requestData,\n params: {},\n });\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while creating process definition:', error);\n throw error;\n }\n};\n\nexport const getProcessDefinitions = async (apiClient: UnmeshedApiClient, namespace?: string) => {\n try {\n const params = namespace ? { namespace } : {};\n const response = await apiClient.get('/api/processDefinitions', params);\n return response.data;\n } catch (error) {\n console.error('Error occurred while fetching process definitions:', error);\n throw error;\n }\n};\n\nexport const getProcessDefinitionVersions = async (apiClient: UnmeshedApiClient, body: ProcessDefinitionsDetail) => {\n try {\n const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}/versions`);\n return response.data;\n } catch (error) {\n console.error('Error occurred while fetching process definition: ', error);\n throw error;\n }\n};\n\nexport const getProcessDefinitionByVersion = async (apiClient: UnmeshedApiClient, body: ProcessDefinitionDetails) => {\n if (!body.namespace || !body.name || !body.version) {\n throw new Error('namespace, name, and version are required');\n }\n\n try {\n const params = body.version ? { version: body.version } : {};\n\n const response = await apiClient.get(`/api/processDefinitions/${body.namespace}/${body.name}`, params);\n\n return response.data;\n } catch (error) {\n console.error('Error occurred while fetching process definition:', 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 ProcessDefinitionData,\n ProcessDefinitionDeleteRequest,\n ProcessDefinitionDetails,\n ProcessDefinitionsDetail,\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 createProcessDefinition,\n updateProcessDefinition,\n deleteProcessDefinition,\n getProcessDefinitions,\n getProcessDefinitionVersions,\n getProcessDefinitionByVersion,\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, version?: number) {\n return rerun(this.client, processId, 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(apiClient, endpoint, id, correlationId, apiCallType);\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(this.client, endpoint, input, id, correlationId, apiCallType);\n }\n\n reNewRegistration(params: RenewRegistrationParams) {\n return renewRegistration(this.client, params);\n }\n\n createProcessDefinition(body: ProcessDefinitionData) {\n return createProcessDefinition(this.client, body);\n }\n updateProcessDefinition(body: ProcessDefinitionData) {\n return updateProcessDefinition(this.client, body);\n }\n deleteProcessDefinition(body: ProcessDefinitionDeleteRequest) {\n return deleteProcessDefinition(this.client, body);\n }\n getProcessDefinitions(namespace?: string) {\n return getProcessDefinitions(this.client, namespace);\n }\n getProcessDefinitionVersions(body: ProcessDefinitionsDetail) {\n return getProcessDefinitionVersions(this.client, body);\n }\n getProcessDefinitionByVersion(body: ProcessDefinitionDetails) {\n return getProcessDefinitionByVersion(this.client, body);\n }\n}\n\nexport * from './types';\n"],"mappings":";AAAA,OAAO,WAAqG;;;ACA5G,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;;;ADAO,IAAM,oBAAN,MAAwB;AAAA,EACrB,gBAAsC;AAAA,EACtC,WAA+B;AAAA,EAC/B;AAAA,EAER,YAAY,sBAA4C;AACtD,YAAQ,IAAI,iCAAiC;AAE7C,SAAK,UAAU,2BAA2B,oBAAoB;AAE9D,YAAQ,IAAI,KAAK,OAAO;AAExB,SAAK,WAAW,KAAK,QAAQ;AAE7B,QAAI,CAAC,KAAK,QAAQ,SAAS;AACzB,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACvC;AAEA,UAAM,UAAU,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ;AAElG,SAAK,gBAAgB,MAAM,OAAO;AAAA,MAChC;AAAA,MACA,SAAS,KAAK,QAAQ;AAAA,MACtB,SAAS;AAAA,QACP,gBAAgB;AAAA,QAChB,eAAe,qBAAqB,KAAK,QAAQ,QAAQ,IAAI,o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AqB,KAAK,QAAQ,UAAU,OAAO,IAAI,eAAe,WAAW;AAAA,EAC1F;AAAA,EAEA,kBAAkB,QAAiC;AACjD,WAAO,kBAAkB,KAAK,QAAQ,MAAM;AAAA,EAC9C;AAAA,EAEA,wBAAwB,MAA6B;AACnD,WAAO,wBAAwB,KAAK,QAAQ,IAAI;AAAA,EAClD;AAAA,EACA,wBAAwB,MAA6B;AACnD,WAAO,wBAAwB,KAAK,QAAQ,IAAI;AAAA,EAClD;AAAA,EACA,wBAAwB,MAAsC;AAC5D,WAAO,wBAAwB,KAAK,QAAQ,IAAI;AAAA,EAClD;AAAA,EACA,sBAAsB,WAAoB;AACxC,WAAO,sBAAsB,KAAK,QAAQ,SAAS;AAAA,EACrD;AAAA,EACA,6BAA6B,MAAgC;AAC3D,WAAO,6BAA6B,KAAK,QAAQ,IAAI;AAAA,EACvD;AAAA,EACA,8BAA8B,MAAgC;AAC5D,WAAO,8BAA8B,KAAK,QAAQ,IAAI;AAAA,EACxD;AACF;","names":["ApiCallType","WebhookSource","SQAuthUserType","StepType","StepStatus","ProcessStatus","ProcessTriggerType","ProcessType","response","ProcessRequestData","ProcessRequestData"]}
|