@io-orkes/conductor-javascript 2.1.3-alpha2 → 2.1.4

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 CHANGED
@@ -933,6 +933,29 @@ declare type WorkflowStatus = {
933
933
  status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'TERMINATED' | 'PAUSED';
934
934
  };
935
935
 
936
+ declare type TaskMock = {
937
+ executionTime?: number;
938
+ output: Record<string, any>;
939
+ queueWaitTime?: number;
940
+ status: "IN_PROGRESS" | "FAILED" | "FAILED_WITH_TERMINAL_ERROR" | "COMPLETED";
941
+ };
942
+
943
+ declare type WorkflowTestRequest = {
944
+ correlationId?: string;
945
+ createdBy?: string;
946
+ externalInputPayloadStoragePath?: string;
947
+ idempotencyKey?: string;
948
+ idempotencyStrategy?: "FAIL" | "RETURN_EXISTING";
949
+ input?: Record<string, Record<string, any>>;
950
+ name: string;
951
+ priority?: number;
952
+ subWorkflowTestRequest?: Record<string, WorkflowTestRequest>;
953
+ taskRefToMockOutput?: Record<string, Array<TaskMock>>;
954
+ taskToDomain?: Record<string, string>;
955
+ version?: number;
956
+ workflowDef?: WorkflowDef$1;
957
+ };
958
+
936
959
  declare class WorkflowResourceService {
937
960
  readonly httpRequest: BaseHttpRequest;
938
961
  constructor(httpRequest: BaseHttpRequest);
@@ -1149,6 +1172,13 @@ declare class WorkflowResourceService {
1149
1172
  * @throws ApiError
1150
1173
  */
1151
1174
  resetWorkflow(workflowId: string): CancelablePromise<void>;
1175
+ /**
1176
+ * Test workflow execution using mock data
1177
+ * @param requestBody
1178
+ * @returns Workflow OK
1179
+ * @throws ApiError
1180
+ */
1181
+ testWorkflow(requestBody: WorkflowTestRequest): CancelablePromise<Workflow>;
1152
1182
  }
1153
1183
 
1154
1184
  /**
@@ -1192,17 +1222,6 @@ declare type HumanTaskAssignment = {
1192
1222
  slaMinutes?: number;
1193
1223
  };
1194
1224
 
1195
- declare type HumanTaskTemplate = {
1196
- createdBy?: string;
1197
- createdOn?: number;
1198
- jsonSchema: Record<string, any>;
1199
- name: string;
1200
- templateUI: Record<string, any>;
1201
- updatedBy?: string;
1202
- updatedOn?: number;
1203
- version: number;
1204
- };
1205
-
1206
1225
  declare type HumanTaskTrigger = {
1207
1226
  startWorkflowRequest?: StartWorkflowRequest;
1208
1227
  triggerType?: 'ASSIGNEE_CHANGED' | 'PENDING' | 'IN_PROGRESS' | 'ASSIGNED' | 'COMPLETED' | 'TIMED_OUT';
@@ -1214,11 +1233,10 @@ declare type UserFormTemplate = {
1214
1233
  };
1215
1234
 
1216
1235
  declare type HumanTaskDefinition = {
1217
- assignmentCompletionStrategy?: "LEAVE_OPEN" | "TERMINATE";
1236
+ assignmentCompletionStrategy?: 'LEAVE_OPEN' | 'TERMINATE';
1218
1237
  assignments?: Array<HumanTaskAssignment>;
1219
1238
  taskTriggers?: Array<HumanTaskTrigger>;
1220
1239
  userFormTemplate?: UserFormTemplate;
1221
- fullTemplate?: HumanTaskTemplate;
1222
1240
  };
1223
1241
 
1224
1242
  declare type HumanTaskEntry = {
@@ -1251,7 +1269,6 @@ declare type HumanTaskSearch = {
1251
1269
  start?: number;
1252
1270
  states?: Array<'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT' | 'DELETED'>;
1253
1271
  taskRefNames?: Array<string>;
1254
- workflowIds?: Array<string>;
1255
1272
  workflowNames?: Array<string>;
1256
1273
  };
1257
1274
 
@@ -1260,6 +1277,17 @@ declare type HumanTaskSearchResult = {
1260
1277
  totalHits?: number;
1261
1278
  };
1262
1279
 
1280
+ declare type HumanTaskTemplate = {
1281
+ createdBy?: string;
1282
+ createdOn?: number;
1283
+ jsonSchema: Record<string, any>;
1284
+ name: string;
1285
+ templateUI: Record<string, any>;
1286
+ updatedBy?: string;
1287
+ updatedOn?: number;
1288
+ version: number;
1289
+ };
1290
+
1263
1291
  declare class HumanTaskService {
1264
1292
  readonly httpRequest: BaseHttpRequest;
1265
1293
  constructor(httpRequest: BaseHttpRequest);
@@ -1301,7 +1329,7 @@ declare class HumanTaskService {
1301
1329
  * @returns HumanTaskEntry OK
1302
1330
  * @throws ApiError
1303
1331
  */
1304
- getTask1(taskId: string, withTemplate?: boolean): CancelablePromise<HumanTaskEntry>;
1332
+ getTask1(taskId: string): CancelablePromise<HumanTaskEntry>;
1305
1333
  /**
1306
1334
  * Claim a task by authenticated Conductor user
1307
1335
  * @param taskId
@@ -1414,6 +1442,7 @@ declare class HumanTaskResourceService {
1414
1442
 
1415
1443
  interface ConductorClientAPIConfig extends Omit<OpenAPIConfig, "BASE"> {
1416
1444
  serverUrl: string;
1445
+ useEnvVars: boolean;
1417
1446
  }
1418
1447
  declare class ConductorClient {
1419
1448
  readonly eventResource: EventResourceService;
@@ -1918,10 +1947,6 @@ declare type PollIntervalOptions = {
1918
1947
  pollInterval: number;
1919
1948
  maxPollTimes: number;
1920
1949
  };
1921
- declare type ClaimOptions = {
1922
- overrideAssignment: boolean;
1923
- withTemplate: boolean;
1924
- };
1925
1950
  declare class HumanExecutor {
1926
1951
  readonly _client: ConductorClient;
1927
1952
  constructor(client: ConductorClient);
@@ -1967,20 +1992,20 @@ declare class HumanExecutor {
1967
1992
  * @param taskId
1968
1993
  * @returns
1969
1994
  */
1970
- getTaskById(taskId: string, withTemplate?: boolean): Promise<HumanTaskEntry>;
1995
+ getTaskById(taskId: string): Promise<HumanTaskEntry>;
1971
1996
  /**
1972
1997
  * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
1973
1998
  * @param taskId
1974
1999
  * @param assignee
1975
2000
  * @returns
1976
2001
  */
1977
- claimTaskAsExternalUser(taskId: string, assignee: string, options?: ClaimOptions): Promise<HumanTaskEntry>;
2002
+ claimTaskAsExternalUser(taskId: string, assignee: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
1978
2003
  /**
1979
2004
  * Claim task as conductor user
1980
2005
  * @param taskId
1981
2006
  * @returns
1982
2007
  */
1983
- claimTaskAsConductorUser(taskId: string, options?: ClaimOptions): Promise<HumanTaskEntry>;
2008
+ claimTaskAsConductorUser(taskId: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
1984
2009
  /**
1985
2010
  * Claim task as conductor user
1986
2011
  * @param taskId
@@ -2362,6 +2387,14 @@ declare class MetadataClient {
2362
2387
  * @returns
2363
2388
  */
2364
2389
  updateTask(taskDef: TaskDef): Promise<void>;
2390
+ /**
2391
+ * Creates or updates (overwrite: true) a workflow definition
2392
+ *
2393
+ * @param workflowDef
2394
+ * @param overwrite
2395
+ * @returns
2396
+ */
2397
+ registerWorkflowDef(workflowDef: WorkflowDef$1, overwrite?: boolean): any;
2365
2398
  }
2366
2399
 
2367
2400
  declare type FetchFn<T = RequestInit, R extends {
package/dist/index.d.ts CHANGED
@@ -933,6 +933,29 @@ declare type WorkflowStatus = {
933
933
  status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'TERMINATED' | 'PAUSED';
934
934
  };
935
935
 
936
+ declare type TaskMock = {
937
+ executionTime?: number;
938
+ output: Record<string, any>;
939
+ queueWaitTime?: number;
940
+ status: "IN_PROGRESS" | "FAILED" | "FAILED_WITH_TERMINAL_ERROR" | "COMPLETED";
941
+ };
942
+
943
+ declare type WorkflowTestRequest = {
944
+ correlationId?: string;
945
+ createdBy?: string;
946
+ externalInputPayloadStoragePath?: string;
947
+ idempotencyKey?: string;
948
+ idempotencyStrategy?: "FAIL" | "RETURN_EXISTING";
949
+ input?: Record<string, Record<string, any>>;
950
+ name: string;
951
+ priority?: number;
952
+ subWorkflowTestRequest?: Record<string, WorkflowTestRequest>;
953
+ taskRefToMockOutput?: Record<string, Array<TaskMock>>;
954
+ taskToDomain?: Record<string, string>;
955
+ version?: number;
956
+ workflowDef?: WorkflowDef$1;
957
+ };
958
+
936
959
  declare class WorkflowResourceService {
937
960
  readonly httpRequest: BaseHttpRequest;
938
961
  constructor(httpRequest: BaseHttpRequest);
@@ -1149,6 +1172,13 @@ declare class WorkflowResourceService {
1149
1172
  * @throws ApiError
1150
1173
  */
1151
1174
  resetWorkflow(workflowId: string): CancelablePromise<void>;
1175
+ /**
1176
+ * Test workflow execution using mock data
1177
+ * @param requestBody
1178
+ * @returns Workflow OK
1179
+ * @throws ApiError
1180
+ */
1181
+ testWorkflow(requestBody: WorkflowTestRequest): CancelablePromise<Workflow>;
1152
1182
  }
1153
1183
 
1154
1184
  /**
@@ -1192,17 +1222,6 @@ declare type HumanTaskAssignment = {
1192
1222
  slaMinutes?: number;
1193
1223
  };
1194
1224
 
1195
- declare type HumanTaskTemplate = {
1196
- createdBy?: string;
1197
- createdOn?: number;
1198
- jsonSchema: Record<string, any>;
1199
- name: string;
1200
- templateUI: Record<string, any>;
1201
- updatedBy?: string;
1202
- updatedOn?: number;
1203
- version: number;
1204
- };
1205
-
1206
1225
  declare type HumanTaskTrigger = {
1207
1226
  startWorkflowRequest?: StartWorkflowRequest;
1208
1227
  triggerType?: 'ASSIGNEE_CHANGED' | 'PENDING' | 'IN_PROGRESS' | 'ASSIGNED' | 'COMPLETED' | 'TIMED_OUT';
@@ -1214,11 +1233,10 @@ declare type UserFormTemplate = {
1214
1233
  };
1215
1234
 
1216
1235
  declare type HumanTaskDefinition = {
1217
- assignmentCompletionStrategy?: "LEAVE_OPEN" | "TERMINATE";
1236
+ assignmentCompletionStrategy?: 'LEAVE_OPEN' | 'TERMINATE';
1218
1237
  assignments?: Array<HumanTaskAssignment>;
1219
1238
  taskTriggers?: Array<HumanTaskTrigger>;
1220
1239
  userFormTemplate?: UserFormTemplate;
1221
- fullTemplate?: HumanTaskTemplate;
1222
1240
  };
1223
1241
 
1224
1242
  declare type HumanTaskEntry = {
@@ -1251,7 +1269,6 @@ declare type HumanTaskSearch = {
1251
1269
  start?: number;
1252
1270
  states?: Array<'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT' | 'DELETED'>;
1253
1271
  taskRefNames?: Array<string>;
1254
- workflowIds?: Array<string>;
1255
1272
  workflowNames?: Array<string>;
1256
1273
  };
1257
1274
 
@@ -1260,6 +1277,17 @@ declare type HumanTaskSearchResult = {
1260
1277
  totalHits?: number;
1261
1278
  };
1262
1279
 
1280
+ declare type HumanTaskTemplate = {
1281
+ createdBy?: string;
1282
+ createdOn?: number;
1283
+ jsonSchema: Record<string, any>;
1284
+ name: string;
1285
+ templateUI: Record<string, any>;
1286
+ updatedBy?: string;
1287
+ updatedOn?: number;
1288
+ version: number;
1289
+ };
1290
+
1263
1291
  declare class HumanTaskService {
1264
1292
  readonly httpRequest: BaseHttpRequest;
1265
1293
  constructor(httpRequest: BaseHttpRequest);
@@ -1301,7 +1329,7 @@ declare class HumanTaskService {
1301
1329
  * @returns HumanTaskEntry OK
1302
1330
  * @throws ApiError
1303
1331
  */
1304
- getTask1(taskId: string, withTemplate?: boolean): CancelablePromise<HumanTaskEntry>;
1332
+ getTask1(taskId: string): CancelablePromise<HumanTaskEntry>;
1305
1333
  /**
1306
1334
  * Claim a task by authenticated Conductor user
1307
1335
  * @param taskId
@@ -1414,6 +1442,7 @@ declare class HumanTaskResourceService {
1414
1442
 
1415
1443
  interface ConductorClientAPIConfig extends Omit<OpenAPIConfig, "BASE"> {
1416
1444
  serverUrl: string;
1445
+ useEnvVars: boolean;
1417
1446
  }
1418
1447
  declare class ConductorClient {
1419
1448
  readonly eventResource: EventResourceService;
@@ -1918,10 +1947,6 @@ declare type PollIntervalOptions = {
1918
1947
  pollInterval: number;
1919
1948
  maxPollTimes: number;
1920
1949
  };
1921
- declare type ClaimOptions = {
1922
- overrideAssignment: boolean;
1923
- withTemplate: boolean;
1924
- };
1925
1950
  declare class HumanExecutor {
1926
1951
  readonly _client: ConductorClient;
1927
1952
  constructor(client: ConductorClient);
@@ -1967,20 +1992,20 @@ declare class HumanExecutor {
1967
1992
  * @param taskId
1968
1993
  * @returns
1969
1994
  */
1970
- getTaskById(taskId: string, withTemplate?: boolean): Promise<HumanTaskEntry>;
1995
+ getTaskById(taskId: string): Promise<HumanTaskEntry>;
1971
1996
  /**
1972
1997
  * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
1973
1998
  * @param taskId
1974
1999
  * @param assignee
1975
2000
  * @returns
1976
2001
  */
1977
- claimTaskAsExternalUser(taskId: string, assignee: string, options?: ClaimOptions): Promise<HumanTaskEntry>;
2002
+ claimTaskAsExternalUser(taskId: string, assignee: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
1978
2003
  /**
1979
2004
  * Claim task as conductor user
1980
2005
  * @param taskId
1981
2006
  * @returns
1982
2007
  */
1983
- claimTaskAsConductorUser(taskId: string, options?: ClaimOptions): Promise<HumanTaskEntry>;
2008
+ claimTaskAsConductorUser(taskId: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
1984
2009
  /**
1985
2010
  * Claim task as conductor user
1986
2011
  * @param taskId
@@ -2362,6 +2387,14 @@ declare class MetadataClient {
2362
2387
  * @returns
2363
2388
  */
2364
2389
  updateTask(taskDef: TaskDef): Promise<void>;
2390
+ /**
2391
+ * Creates or updates (overwrite: true) a workflow definition
2392
+ *
2393
+ * @param workflowDef
2394
+ * @param overwrite
2395
+ * @returns
2396
+ */
2397
+ registerWorkflowDef(workflowDef: WorkflowDef$1, overwrite?: boolean): any;
2365
2398
  }
2366
2399
 
2367
2400
  declare type FetchFn<T = RequestInit, R extends {