@io-orkes/conductor-javascript 1.2.3 → 2.0.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +242 -126
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +241 -126
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +242 -126
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +241 -126
- package/dist/index.mjs.map +1 -1
- package/dist/{types-f83aa26f.d.ts → types-dbfd77fb.d.ts} +181 -167
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OrkesApiConfig, C as ConductorHttpRequest, a as ConductorClient, b as ConductorClientAPIConfig, F as FetchFn, c as OpenAPIConfig, A as ApiRequestOptions, d as CancelablePromise } from './types-
|
|
2
|
-
export { p as Action, m as ApiError, k as ApiResult,
|
|
1
|
+
import { O as OrkesApiConfig, C as ConductorHttpRequest, a as ConductorClient, b as ConductorClientAPIConfig, F as FetchFn, c as OpenAPIConfig, A as ApiRequestOptions, d as CancelablePromise } from './types-dbfd77fb.js';
|
|
2
|
+
export { p as Action, m as ApiError, k as ApiResult, B as BaseHttpRequest, o as CancelError, ao as CommonTaskDef, aN as ConductorError, aj as ConductorLogLevel, ai as ConductorLogger, h as ConductorWorker, al as DefaultLogger, ak as DefaultLoggerConfig, ar as DoWhileTaskDef, E as EventHandler, _ as EventResourceService, as as EventTaskDef, q as ExternalStorageLocation, av as ForkJoinDynamicDef, at as ForkJoinTaskDef, G as GenerateTokenRequest, a6 as HTScrollableSearchResultHumanTaskEntry, $ as HealthCheckResourceService, aw as HttpInputParameters, ax as HttpTaskDef, aP as HumanExecutor, ab as HumanTaskAssignment, aa as HumanTaskDefinition, ah as HumanTaskEntry, ag as HumanTaskSearch, af as HumanTaskSearchResult, ae as HumanTaskTemplate, ac as HumanTaskTrigger, a9 as HumanTaskUser, az as InlineTaskDef, ay as InlineTaskInputParameters, au as JoinTaskDef, aA as JsonJQTransformTaskDef, aB as KafkaPublishInputParameters, aC as KafkaPublishTaskDef, a0 as MetadataResourceService, l as OnCancel, P as PollData, an as RequestType, r as RerunWorkflowRequest, s as Response, R as RunnerArgs, S as SaveScheduleRequest, a1 as SchedulerResourceService, t as ScrollableSearchResultWorkflowSummary, u as SearchResultTask, v as SearchResultTaskSummary, w as SearchResultWorkflow, x as SearchResultWorkflowScheduleExecutionModel, y as SearchResultWorkflowSummary, aD as SetVariableTaskDef, aE as SimpleTaskDef, z as SkipTaskRequest, D as StartWorkflow, H as StartWorkflowRequest, I as SubWorkflowParams, aF as SubWorkflowTaskDef, aG as SwitchTaskDef, J as Task, K as TaskDef, aq as TaskDefTypes, L as TaskDetails, i as TaskErrorHandler, M as TaskExecLog, aK as TaskFinderPredicate, g as TaskManager, f as TaskManagerConfig, e as TaskManagerOptions, a2 as TaskResourceService, N as TaskResult, aO as TaskResultStatus, T as TaskRunner, j as TaskRunnerOptions, Q as TaskSummary, ap as TaskType, a7 as Terminate, aH as TerminateTaskDef, a8 as TimeoutPolicy, a3 as TokenResourceService, ad as UserFormTemplate, aI as WaitTaskDef, W as Workflow, a4 as WorkflowBulkResourceService, aJ as WorkflowDef, aM as WorkflowExecutor, a5 as WorkflowResourceService, U as WorkflowSchedule, V as WorkflowScheduleExecutionModel, X as WorkflowStatus, Y as WorkflowSummary, Z as WorkflowTask, aL as completedTaskMatchingType, aV as conductorEventTask, aQ as doWhileTask, aS as dynamicForkTask, aT as eventTask, aW as forkTask, aX as forkTaskJoin, bn as generate, ba as generateDoWhileTask, bb as generateEventTask, bc as generateForkJoinTask, be as generateHTTPTask, bf as generateInlineTask, bg as generateJQTransformTask, bd as generateJoinTask, bh as generateKafkaPublishTask, bj as generateSetVariableTask, b9 as generateSimpleTask, bi as generateSubWorkflowTask, bm as generateSwitchTask, bk as generateTerminateTask, bl as generateWaitTask, aY as httpTask, aZ as inlineTask, a_ as joinTask, a$ as jsonJqTask, b0 as kafkaPublishTask, aR as newLoopTask, n as noopErrorHandler, am as noopLogger, b1 as setVariableTask, b2 as simpleTask, aU as sqsEventTask, b3 as subWorkflowTask, b4 as switchTask, bo as taskGenMapper, b5 as terminateTask, b6 as waitTaskDuration, b7 as waitTaskUntil, b8 as workflow } from './types-dbfd77fb.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Takes a config with keyId and keySecret returns a promise with an instance of ConductorClient
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OrkesApiConfig, C as ConductorHttpRequest, a as ConductorClient, b as ConductorClientAPIConfig, F as FetchFn, c as OpenAPIConfig, A as ApiRequestOptions, d as CancelablePromise } from './types-
|
|
2
|
-
export { p as Action, m as ApiError, k as ApiResult,
|
|
1
|
+
import { O as OrkesApiConfig, C as ConductorHttpRequest, a as ConductorClient, b as ConductorClientAPIConfig, F as FetchFn, c as OpenAPIConfig, A as ApiRequestOptions, d as CancelablePromise } from './types-dbfd77fb.js';
|
|
2
|
+
export { p as Action, m as ApiError, k as ApiResult, B as BaseHttpRequest, o as CancelError, ao as CommonTaskDef, aN as ConductorError, aj as ConductorLogLevel, ai as ConductorLogger, h as ConductorWorker, al as DefaultLogger, ak as DefaultLoggerConfig, ar as DoWhileTaskDef, E as EventHandler, _ as EventResourceService, as as EventTaskDef, q as ExternalStorageLocation, av as ForkJoinDynamicDef, at as ForkJoinTaskDef, G as GenerateTokenRequest, a6 as HTScrollableSearchResultHumanTaskEntry, $ as HealthCheckResourceService, aw as HttpInputParameters, ax as HttpTaskDef, aP as HumanExecutor, ab as HumanTaskAssignment, aa as HumanTaskDefinition, ah as HumanTaskEntry, ag as HumanTaskSearch, af as HumanTaskSearchResult, ae as HumanTaskTemplate, ac as HumanTaskTrigger, a9 as HumanTaskUser, az as InlineTaskDef, ay as InlineTaskInputParameters, au as JoinTaskDef, aA as JsonJQTransformTaskDef, aB as KafkaPublishInputParameters, aC as KafkaPublishTaskDef, a0 as MetadataResourceService, l as OnCancel, P as PollData, an as RequestType, r as RerunWorkflowRequest, s as Response, R as RunnerArgs, S as SaveScheduleRequest, a1 as SchedulerResourceService, t as ScrollableSearchResultWorkflowSummary, u as SearchResultTask, v as SearchResultTaskSummary, w as SearchResultWorkflow, x as SearchResultWorkflowScheduleExecutionModel, y as SearchResultWorkflowSummary, aD as SetVariableTaskDef, aE as SimpleTaskDef, z as SkipTaskRequest, D as StartWorkflow, H as StartWorkflowRequest, I as SubWorkflowParams, aF as SubWorkflowTaskDef, aG as SwitchTaskDef, J as Task, K as TaskDef, aq as TaskDefTypes, L as TaskDetails, i as TaskErrorHandler, M as TaskExecLog, aK as TaskFinderPredicate, g as TaskManager, f as TaskManagerConfig, e as TaskManagerOptions, a2 as TaskResourceService, N as TaskResult, aO as TaskResultStatus, T as TaskRunner, j as TaskRunnerOptions, Q as TaskSummary, ap as TaskType, a7 as Terminate, aH as TerminateTaskDef, a8 as TimeoutPolicy, a3 as TokenResourceService, ad as UserFormTemplate, aI as WaitTaskDef, W as Workflow, a4 as WorkflowBulkResourceService, aJ as WorkflowDef, aM as WorkflowExecutor, a5 as WorkflowResourceService, U as WorkflowSchedule, V as WorkflowScheduleExecutionModel, X as WorkflowStatus, Y as WorkflowSummary, Z as WorkflowTask, aL as completedTaskMatchingType, aV as conductorEventTask, aQ as doWhileTask, aS as dynamicForkTask, aT as eventTask, aW as forkTask, aX as forkTaskJoin, bn as generate, ba as generateDoWhileTask, bb as generateEventTask, bc as generateForkJoinTask, be as generateHTTPTask, bf as generateInlineTask, bg as generateJQTransformTask, bd as generateJoinTask, bh as generateKafkaPublishTask, bj as generateSetVariableTask, b9 as generateSimpleTask, bi as generateSubWorkflowTask, bm as generateSwitchTask, bk as generateTerminateTask, bl as generateWaitTask, aY as httpTask, aZ as inlineTask, a_ as joinTask, a$ as jsonJqTask, b0 as kafkaPublishTask, aR as newLoopTask, n as noopErrorHandler, am as noopLogger, b1 as setVariableTask, b2 as simpleTask, aU as sqsEventTask, b3 as subWorkflowTask, b4 as switchTask, bo as taskGenMapper, b5 as terminateTask, b6 as waitTaskDuration, b7 as waitTaskUntil, b8 as workflow } from './types-dbfd77fb.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Takes a config with keyId and keySecret returns a promise with an instance of ConductorClient
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ __export(conductor_javascript_exports, {
|
|
|
53
53
|
WorkflowExecutor: () => WorkflowExecutor,
|
|
54
54
|
WorkflowResourceService: () => WorkflowResourceService,
|
|
55
55
|
baseOrkesConductorClient: () => baseOrkesConductorClient,
|
|
56
|
+
completedTaskMatchingType: () => completedTaskMatchingType,
|
|
56
57
|
conductorEventTask: () => conductorEventTask,
|
|
57
58
|
doWhileTask: () => doWhileTask,
|
|
58
59
|
dynamicForkTask: () => dynamicForkTask,
|
|
@@ -1924,83 +1925,70 @@ var HumanTaskService = class {
|
|
|
1924
1925
|
this.httpRequest = httpRequest;
|
|
1925
1926
|
}
|
|
1926
1927
|
/**
|
|
1927
|
-
*
|
|
1928
|
-
* @param
|
|
1929
|
-
* @
|
|
1930
|
-
* @param assigneeType
|
|
1931
|
-
* @param claimedBy
|
|
1932
|
-
* @param taskName
|
|
1933
|
-
* @param freeText
|
|
1934
|
-
* @param includeInputOutput
|
|
1935
|
-
* @returns SearchResultHumanTaskEntry OK
|
|
1928
|
+
* If the workflow is disconnected from tasks, this API can be used to clean up (in bulk)
|
|
1929
|
+
* @param requestBody
|
|
1930
|
+
* @returns any OK
|
|
1936
1931
|
* @throws ApiError
|
|
1937
1932
|
*/
|
|
1938
|
-
|
|
1933
|
+
deleteTaskFromHumanTaskRecords(requestBody) {
|
|
1939
1934
|
return this.httpRequest.request({
|
|
1940
|
-
method: "
|
|
1941
|
-
url: "/human/tasks",
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
"assignee": assignee,
|
|
1945
|
-
"assigneeType": assigneeType,
|
|
1946
|
-
"claimedBy": claimedBy,
|
|
1947
|
-
"taskName": taskName,
|
|
1948
|
-
"freeText": freeText,
|
|
1949
|
-
"includeInputOutput": includeInputOutput
|
|
1950
|
-
}
|
|
1935
|
+
method: "DELETE",
|
|
1936
|
+
url: "/human/tasks/delete",
|
|
1937
|
+
body: requestBody,
|
|
1938
|
+
mediaType: "application/json"
|
|
1951
1939
|
});
|
|
1952
1940
|
}
|
|
1953
1941
|
/**
|
|
1954
|
-
*
|
|
1955
|
-
* @
|
|
1942
|
+
* If the workflow is disconnected from tasks, this API can be used to clean up
|
|
1943
|
+
* @param taskId
|
|
1944
|
+
* @returns any OK
|
|
1956
1945
|
* @throws ApiError
|
|
1957
1946
|
*/
|
|
1958
|
-
|
|
1947
|
+
deleteTaskFromHumanTaskRecords1(taskId) {
|
|
1959
1948
|
return this.httpRequest.request({
|
|
1960
|
-
method: "
|
|
1961
|
-
url: "/human/tasks/
|
|
1949
|
+
method: "DELETE",
|
|
1950
|
+
url: "/human/tasks/delete/{taskId}",
|
|
1951
|
+
path: {
|
|
1952
|
+
"taskId": taskId
|
|
1953
|
+
}
|
|
1962
1954
|
});
|
|
1963
1955
|
}
|
|
1964
1956
|
/**
|
|
1965
1957
|
* Search human tasks
|
|
1966
|
-
* @param
|
|
1967
|
-
* @
|
|
1968
|
-
* @param size
|
|
1969
|
-
* @param freeText
|
|
1970
|
-
* @param query
|
|
1971
|
-
* @param jsonQuery
|
|
1972
|
-
* @param includeInputOutput
|
|
1973
|
-
* @returns HTScrollableSearchResultHumanTaskEntry OK
|
|
1958
|
+
* @param requestBody
|
|
1959
|
+
* @returns HumanTaskSearchResult OK
|
|
1974
1960
|
* @throws ApiError
|
|
1975
1961
|
*/
|
|
1976
|
-
|
|
1962
|
+
search(requestBody) {
|
|
1977
1963
|
return this.httpRequest.request({
|
|
1978
|
-
method: "
|
|
1964
|
+
method: "POST",
|
|
1979
1965
|
url: "/human/tasks/search",
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
"start": start,
|
|
1983
|
-
"size": size,
|
|
1984
|
-
"freeText": freeText,
|
|
1985
|
-
"query": query,
|
|
1986
|
-
"jsonQuery": jsonQuery,
|
|
1987
|
-
"includeInputOutput": includeInputOutput
|
|
1988
|
-
}
|
|
1966
|
+
body: requestBody,
|
|
1967
|
+
mediaType: "application/json"
|
|
1989
1968
|
});
|
|
1990
1969
|
}
|
|
1991
1970
|
/**
|
|
1992
|
-
*
|
|
1993
|
-
* @param
|
|
1971
|
+
* Update task output, optionally complete
|
|
1972
|
+
* @param workflowId
|
|
1973
|
+
* @param taskRefName
|
|
1974
|
+
* @param requestBody
|
|
1975
|
+
* @param complete
|
|
1976
|
+
* @param iteration Populate this value if your task is in a loop and you want to update a specific iteration. If its not in a loop OR if you want to just update the latest iteration, leave this as empty
|
|
1994
1977
|
* @returns any OK
|
|
1995
1978
|
* @throws ApiError
|
|
1996
1979
|
*/
|
|
1997
|
-
|
|
1980
|
+
updateTaskOutputByRef(workflowId, taskRefName, requestBody, complete = false, iteration) {
|
|
1998
1981
|
return this.httpRequest.request({
|
|
1999
|
-
method: "
|
|
2000
|
-
url: "/human/tasks/
|
|
2001
|
-
|
|
2002
|
-
"
|
|
2003
|
-
|
|
1982
|
+
method: "POST",
|
|
1983
|
+
url: "/human/tasks/update/taskRef",
|
|
1984
|
+
query: {
|
|
1985
|
+
"workflowId": workflowId,
|
|
1986
|
+
"taskRefName": taskRefName,
|
|
1987
|
+
"complete": complete,
|
|
1988
|
+
"iteration": iteration
|
|
1989
|
+
},
|
|
1990
|
+
body: requestBody,
|
|
1991
|
+
mediaType: "application/json"
|
|
2004
1992
|
});
|
|
2005
1993
|
}
|
|
2006
1994
|
/**
|
|
@@ -2018,33 +2006,22 @@ var HumanTaskService = class {
|
|
|
2018
2006
|
}
|
|
2019
2007
|
});
|
|
2020
2008
|
}
|
|
2021
|
-
/**
|
|
2022
|
-
* Get human task action log entries by task id
|
|
2023
|
-
* @param taskId
|
|
2024
|
-
* @returns HumanTaskActionLogEntry OK
|
|
2025
|
-
* @throws ApiError
|
|
2026
|
-
*/
|
|
2027
|
-
getActionLogs(taskId) {
|
|
2028
|
-
return this.httpRequest.request({
|
|
2029
|
-
method: "GET",
|
|
2030
|
-
url: "/human/tasks/{taskId}/actionLogs",
|
|
2031
|
-
path: {
|
|
2032
|
-
"taskId": taskId
|
|
2033
|
-
}
|
|
2034
|
-
});
|
|
2035
|
-
}
|
|
2036
2009
|
/**
|
|
2037
2010
|
* Claim a task by authenticated Conductor user
|
|
2038
2011
|
* @param taskId
|
|
2012
|
+
* @param overrideAssignment
|
|
2039
2013
|
* @returns any OK
|
|
2040
2014
|
* @throws ApiError
|
|
2041
2015
|
*/
|
|
2042
|
-
claimTask(taskId) {
|
|
2016
|
+
claimTask(taskId, overrideAssignment = false) {
|
|
2043
2017
|
return this.httpRequest.request({
|
|
2044
2018
|
method: "POST",
|
|
2045
2019
|
url: "/human/tasks/{taskId}/claim",
|
|
2046
2020
|
path: {
|
|
2047
2021
|
"taskId": taskId
|
|
2022
|
+
},
|
|
2023
|
+
query: {
|
|
2024
|
+
"overrideAssignment": overrideAssignment
|
|
2048
2025
|
}
|
|
2049
2026
|
});
|
|
2050
2027
|
}
|
|
@@ -2052,16 +2029,20 @@ var HumanTaskService = class {
|
|
|
2052
2029
|
* Claim a task to an external user
|
|
2053
2030
|
* @param taskId
|
|
2054
2031
|
* @param userId
|
|
2032
|
+
* @param overrideAssignment
|
|
2055
2033
|
* @returns any OK
|
|
2056
2034
|
* @throws ApiError
|
|
2057
2035
|
*/
|
|
2058
|
-
assignAndClaim(taskId, userId) {
|
|
2036
|
+
assignAndClaim(taskId, userId, overrideAssignment = false) {
|
|
2059
2037
|
return this.httpRequest.request({
|
|
2060
2038
|
method: "POST",
|
|
2061
2039
|
url: "/human/tasks/{taskId}/externalUser/{userId}",
|
|
2062
2040
|
path: {
|
|
2063
2041
|
"taskId": taskId,
|
|
2064
2042
|
"userId": userId
|
|
2043
|
+
},
|
|
2044
|
+
query: {
|
|
2045
|
+
"overrideAssignment": overrideAssignment
|
|
2065
2046
|
}
|
|
2066
2047
|
});
|
|
2067
2048
|
}
|
|
@@ -2099,17 +2080,21 @@ var HumanTaskService = class {
|
|
|
2099
2080
|
});
|
|
2100
2081
|
}
|
|
2101
2082
|
/**
|
|
2102
|
-
*
|
|
2083
|
+
* If a task is assigned to a user, this API can be used to skip that assignment and move to the next assignee
|
|
2103
2084
|
* @param taskId
|
|
2104
|
-
* @
|
|
2085
|
+
* @param reason
|
|
2086
|
+
* @returns any OK
|
|
2105
2087
|
* @throws ApiError
|
|
2106
2088
|
*/
|
|
2107
|
-
|
|
2089
|
+
skipTask(taskId, reason) {
|
|
2108
2090
|
return this.httpRequest.request({
|
|
2109
|
-
method: "
|
|
2110
|
-
url: "/human/tasks/{taskId}/
|
|
2091
|
+
method: "POST",
|
|
2092
|
+
url: "/human/tasks/{taskId}/skip",
|
|
2111
2093
|
path: {
|
|
2112
2094
|
"taskId": taskId
|
|
2095
|
+
},
|
|
2096
|
+
query: {
|
|
2097
|
+
"reason": reason
|
|
2113
2098
|
}
|
|
2114
2099
|
});
|
|
2115
2100
|
}
|
|
@@ -2136,48 +2121,51 @@ var HumanTaskService = class {
|
|
|
2136
2121
|
});
|
|
2137
2122
|
}
|
|
2138
2123
|
/**
|
|
2139
|
-
*
|
|
2124
|
+
* List all user form templates or get templates by name, or a template by name and version
|
|
2140
2125
|
* @param name
|
|
2141
|
-
* @
|
|
2126
|
+
* @param version
|
|
2127
|
+
* @returns HumanTaskTemplate OK
|
|
2142
2128
|
* @throws ApiError
|
|
2143
2129
|
*/
|
|
2144
|
-
|
|
2130
|
+
getAllTemplates(name, version) {
|
|
2145
2131
|
return this.httpRequest.request({
|
|
2146
|
-
method: "
|
|
2132
|
+
method: "GET",
|
|
2147
2133
|
url: "/human/template",
|
|
2148
2134
|
query: {
|
|
2149
|
-
"name": name
|
|
2135
|
+
"name": name,
|
|
2136
|
+
"version": version
|
|
2150
2137
|
}
|
|
2151
2138
|
});
|
|
2152
2139
|
}
|
|
2153
2140
|
/**
|
|
2154
|
-
*
|
|
2155
|
-
* @param
|
|
2156
|
-
* @param
|
|
2157
|
-
* @returns
|
|
2141
|
+
* Save user form template
|
|
2142
|
+
* @param requestBody
|
|
2143
|
+
* @param newVersion
|
|
2144
|
+
* @returns HumanTaskTemplate OK
|
|
2158
2145
|
* @throws ApiError
|
|
2159
2146
|
*/
|
|
2160
|
-
|
|
2147
|
+
saveTemplate(requestBody, newVersion = false) {
|
|
2161
2148
|
return this.httpRequest.request({
|
|
2162
|
-
method: "
|
|
2149
|
+
method: "POST",
|
|
2163
2150
|
url: "/human/template",
|
|
2164
2151
|
query: {
|
|
2165
|
-
"
|
|
2166
|
-
|
|
2167
|
-
|
|
2152
|
+
"newVersion": newVersion
|
|
2153
|
+
},
|
|
2154
|
+
body: requestBody,
|
|
2155
|
+
mediaType: "application/json"
|
|
2168
2156
|
});
|
|
2169
2157
|
}
|
|
2170
2158
|
/**
|
|
2171
|
-
* Save
|
|
2159
|
+
* Save user form template
|
|
2172
2160
|
* @param requestBody
|
|
2173
2161
|
* @param newVersion
|
|
2174
|
-
* @returns
|
|
2162
|
+
* @returns HumanTaskTemplate OK
|
|
2175
2163
|
* @throws ApiError
|
|
2176
2164
|
*/
|
|
2177
|
-
|
|
2165
|
+
saveTemplates(requestBody, newVersion = false) {
|
|
2178
2166
|
return this.httpRequest.request({
|
|
2179
2167
|
method: "POST",
|
|
2180
|
-
url: "/human/template",
|
|
2168
|
+
url: "/human/template/bulk",
|
|
2181
2169
|
query: {
|
|
2182
2170
|
"newVersion": newVersion
|
|
2183
2171
|
},
|
|
@@ -2186,32 +2174,51 @@ var HumanTaskService = class {
|
|
|
2186
2174
|
});
|
|
2187
2175
|
}
|
|
2188
2176
|
/**
|
|
2189
|
-
* Delete
|
|
2190
|
-
* @param
|
|
2177
|
+
* Delete all versions of user form template by name
|
|
2178
|
+
* @param name
|
|
2191
2179
|
* @returns any OK
|
|
2192
2180
|
* @throws ApiError
|
|
2193
2181
|
*/
|
|
2194
|
-
|
|
2182
|
+
deleteTemplateByName(name) {
|
|
2195
2183
|
return this.httpRequest.request({
|
|
2196
2184
|
method: "DELETE",
|
|
2197
|
-
url: "/human/template/{
|
|
2185
|
+
url: "/human/template/{name}",
|
|
2198
2186
|
path: {
|
|
2199
|
-
"
|
|
2187
|
+
"name": name
|
|
2188
|
+
}
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
/**
|
|
2192
|
+
* Delete a version of form template by name
|
|
2193
|
+
* @param name
|
|
2194
|
+
* @param version
|
|
2195
|
+
* @returns any OK
|
|
2196
|
+
* @throws ApiError
|
|
2197
|
+
*/
|
|
2198
|
+
deleteTemplatesByNameAndVersion(name, version) {
|
|
2199
|
+
return this.httpRequest.request({
|
|
2200
|
+
method: "DELETE",
|
|
2201
|
+
url: "/human/template/{name}/{version}",
|
|
2202
|
+
path: {
|
|
2203
|
+
"name": name,
|
|
2204
|
+
"version": version
|
|
2200
2205
|
}
|
|
2201
2206
|
});
|
|
2202
2207
|
}
|
|
2203
2208
|
/**
|
|
2204
|
-
* Get
|
|
2205
|
-
* @param
|
|
2206
|
-
* @
|
|
2209
|
+
* Get user form template by name and version
|
|
2210
|
+
* @param name
|
|
2211
|
+
* @param version
|
|
2212
|
+
* @returns HumanTaskTemplate OK
|
|
2207
2213
|
* @throws ApiError
|
|
2208
2214
|
*/
|
|
2209
|
-
|
|
2215
|
+
getTemplateByNameAndVersion(name, version) {
|
|
2210
2216
|
return this.httpRequest.request({
|
|
2211
2217
|
method: "GET",
|
|
2212
|
-
url: "/human/template/{
|
|
2218
|
+
url: "/human/template/{name}/{version}",
|
|
2213
2219
|
path: {
|
|
2214
|
-
"
|
|
2220
|
+
"name": name,
|
|
2221
|
+
"version": version
|
|
2215
2222
|
}
|
|
2216
2223
|
});
|
|
2217
2224
|
}
|
|
@@ -2669,9 +2676,18 @@ var tryCatchReThrow = (fn) => {
|
|
|
2669
2676
|
throw errorMapper(error);
|
|
2670
2677
|
}
|
|
2671
2678
|
};
|
|
2679
|
+
function reverseFind(array, predicate) {
|
|
2680
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
2681
|
+
if (predicate(array[i], i, array)) {
|
|
2682
|
+
return array[i];
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
return void 0;
|
|
2686
|
+
}
|
|
2672
2687
|
|
|
2673
2688
|
// src/core/executor.ts
|
|
2674
2689
|
var RETRY_TIME_IN_MILLISECONDS = 1e4;
|
|
2690
|
+
var completedTaskMatchingType = (taskType) => (task) => task.status === "COMPLETED" && task.taskType === taskType;
|
|
2675
2691
|
var WorkflowExecutor = class {
|
|
2676
2692
|
constructor(client) {
|
|
2677
2693
|
this._client = client;
|
|
@@ -2716,6 +2732,26 @@ var WorkflowExecutor = class {
|
|
|
2716
2732
|
startWorkflows(workflowsRequest) {
|
|
2717
2733
|
return tryCatchReThrow(() => workflowsRequest.map(this.startWorkflow));
|
|
2718
2734
|
}
|
|
2735
|
+
async goBackToTask(workflowInstanceId, taskFinderPredicate, rerunWorkflowRequestOverrides = {}) {
|
|
2736
|
+
const { tasks: executedTasks = [] } = await this.getExecution(
|
|
2737
|
+
workflowInstanceId
|
|
2738
|
+
);
|
|
2739
|
+
const maybePreviousTask = reverseFind(
|
|
2740
|
+
executedTasks,
|
|
2741
|
+
taskFinderPredicate
|
|
2742
|
+
);
|
|
2743
|
+
if (!maybePreviousTask) {
|
|
2744
|
+
throw new Error("Task not found");
|
|
2745
|
+
}
|
|
2746
|
+
await this.reRun(workflowInstanceId, {
|
|
2747
|
+
//taskInput: previousTask.inputData,
|
|
2748
|
+
...rerunWorkflowRequestOverrides,
|
|
2749
|
+
reRunFromTaskId: maybePreviousTask.taskId
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
async goBackToFirstTaskMatchingType(workflowInstanceId, taskType) {
|
|
2753
|
+
return this.goBackToTask(workflowInstanceId, completedTaskMatchingType(taskType));
|
|
2754
|
+
}
|
|
2719
2755
|
/**
|
|
2720
2756
|
* Takes an workflowInstanceId and an includeTasks and an optional retry parameter returns the whole execution status.
|
|
2721
2757
|
* If includeTasks flag is provided. Details of tasks execution will be returned as well,
|
|
@@ -2760,6 +2796,22 @@ var WorkflowExecutor = class {
|
|
|
2760
2796
|
)
|
|
2761
2797
|
);
|
|
2762
2798
|
}
|
|
2799
|
+
/**
|
|
2800
|
+
* Returns a summary of the current workflow status.
|
|
2801
|
+
*
|
|
2802
|
+
* @param workflowInstanceId current running workflow
|
|
2803
|
+
* @param includeOutput flag to include output
|
|
2804
|
+
* @param includeVariables flag to include variable
|
|
2805
|
+
* @returns Promise<WorkflowStatus>
|
|
2806
|
+
*/
|
|
2807
|
+
getExecution(workflowInstanceId, includeTasks = true) {
|
|
2808
|
+
return tryCatchReThrow(
|
|
2809
|
+
() => this._client.workflowResource.getExecutionStatus(
|
|
2810
|
+
workflowInstanceId,
|
|
2811
|
+
includeTasks
|
|
2812
|
+
)
|
|
2813
|
+
);
|
|
2814
|
+
}
|
|
2763
2815
|
/**
|
|
2764
2816
|
* Pauses a running workflow
|
|
2765
2817
|
* @param workflowInstanceId current workflow execution
|
|
@@ -2929,11 +2981,24 @@ var WorkflowExecutor = class {
|
|
|
2929
2981
|
};
|
|
2930
2982
|
|
|
2931
2983
|
// src/core/human.ts
|
|
2984
|
+
var EMPTY_SEARCH = {
|
|
2985
|
+
size: 15,
|
|
2986
|
+
states: [],
|
|
2987
|
+
taskInputQuery: "",
|
|
2988
|
+
taskOutputQuery: "",
|
|
2989
|
+
definitionNames: [],
|
|
2990
|
+
taskRefNames: [],
|
|
2991
|
+
claimants: [],
|
|
2992
|
+
assignees: [],
|
|
2993
|
+
start: 0
|
|
2994
|
+
};
|
|
2995
|
+
var DEFAULT_POLL_INTERVAL2 = { pollInterval: 100, maxPollTimes: 20 };
|
|
2932
2996
|
var HumanExecutor = class {
|
|
2933
2997
|
constructor(client) {
|
|
2934
2998
|
this._client = client;
|
|
2935
2999
|
}
|
|
2936
3000
|
/**
|
|
3001
|
+
* @deprecated use search instead
|
|
2937
3002
|
* Takes a set of filter parameters. return matches of human tasks for that set of parameters
|
|
2938
3003
|
* @param state
|
|
2939
3004
|
* @param assignee
|
|
@@ -2944,21 +3009,68 @@ var HumanExecutor = class {
|
|
|
2944
3009
|
* @param includeInputOutput
|
|
2945
3010
|
* @returns
|
|
2946
3011
|
*/
|
|
2947
|
-
async getTasksByFilter(state, assignee, assigneeType, claimedBy, taskName,
|
|
2948
|
-
const
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
3012
|
+
async getTasksByFilter(state, assignee, assigneeType, claimedBy, taskName, taskInputQuery, taskOutputQuery) {
|
|
3013
|
+
const [claimedUserType, claimedUser] = claimedBy?.split(":") ?? [];
|
|
3014
|
+
if (claimedUserType && !claimedUser) {
|
|
3015
|
+
throw new Error("claimedBy should be in the format of <userType>:<user>");
|
|
3016
|
+
}
|
|
3017
|
+
const response = await this.search({
|
|
3018
|
+
states: [state],
|
|
3019
|
+
assignees: assignee ? [{ userType: assigneeType, user: assignee }] : [],
|
|
3020
|
+
claimants: claimedBy ? [{ userType: claimedUserType, user: claimedUser }] : [],
|
|
3021
|
+
taskRefNames: taskName ? [taskName] : [],
|
|
3022
|
+
taskInputQuery,
|
|
3023
|
+
taskOutputQuery
|
|
3024
|
+
});
|
|
3025
|
+
return response;
|
|
3026
|
+
}
|
|
3027
|
+
/**
|
|
3028
|
+
* Takes a set of filter parameters. return matches of human tasks for that set of parameters
|
|
3029
|
+
* @param state
|
|
3030
|
+
* @param assignee
|
|
3031
|
+
* @param assigneeType
|
|
3032
|
+
* @param claimedBy
|
|
3033
|
+
* @param taskName
|
|
3034
|
+
* @param freeText
|
|
3035
|
+
* @param includeInputOutput
|
|
3036
|
+
* @returns Promise<HumanTaskEntry[]>
|
|
3037
|
+
*/
|
|
3038
|
+
async search(searchParams) {
|
|
3039
|
+
const search = { ...EMPTY_SEARCH, ...searchParams };
|
|
3040
|
+
const response = await tryCatchReThrow(
|
|
3041
|
+
() => this._client.humanTask.search(search)
|
|
2956
3042
|
);
|
|
2957
3043
|
if (response.results != void 0) {
|
|
2958
3044
|
return response.results;
|
|
2959
3045
|
}
|
|
2960
3046
|
return [];
|
|
2961
3047
|
}
|
|
3048
|
+
/**
|
|
3049
|
+
* Takes a set of filter parameters. An polling interval options. will poll until the task returns a result
|
|
3050
|
+
* @param state
|
|
3051
|
+
* @param assignee
|
|
3052
|
+
* @param assigneeType
|
|
3053
|
+
* @param claimedBy
|
|
3054
|
+
* @param taskName
|
|
3055
|
+
* @param freeText
|
|
3056
|
+
* @param includeInputOutput
|
|
3057
|
+
* @returns Promise<HumanTaskEntry[]>
|
|
3058
|
+
*/
|
|
3059
|
+
async pollSearch(searchParams, {
|
|
3060
|
+
pollInterval = 100,
|
|
3061
|
+
maxPollTimes = 20
|
|
3062
|
+
} = DEFAULT_POLL_INTERVAL2) {
|
|
3063
|
+
let pollCount = 0;
|
|
3064
|
+
while (pollCount < maxPollTimes) {
|
|
3065
|
+
const response = await this.search(searchParams);
|
|
3066
|
+
if (response.length > 0) {
|
|
3067
|
+
return response;
|
|
3068
|
+
}
|
|
3069
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
3070
|
+
pollCount++;
|
|
3071
|
+
}
|
|
3072
|
+
return [];
|
|
3073
|
+
}
|
|
2962
3074
|
/**
|
|
2963
3075
|
* Returns task for a given task id
|
|
2964
3076
|
* @param taskId
|
|
@@ -2974,11 +3086,9 @@ var HumanExecutor = class {
|
|
|
2974
3086
|
* @returns
|
|
2975
3087
|
*/
|
|
2976
3088
|
async claimTaskAsExternalUser(taskId, assignee) {
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
throw errorMapper(error);
|
|
2981
|
-
}
|
|
3089
|
+
return tryCatchReThrow(
|
|
3090
|
+
() => this._client.humanTask.assignAndClaim(taskId, assignee)
|
|
3091
|
+
);
|
|
2982
3092
|
}
|
|
2983
3093
|
/**
|
|
2984
3094
|
* Claim task as conductor user
|
|
@@ -2986,11 +3096,7 @@ var HumanExecutor = class {
|
|
|
2986
3096
|
* @returns
|
|
2987
3097
|
*/
|
|
2988
3098
|
async claimTaskAsConductorUser(taskId) {
|
|
2989
|
-
|
|
2990
|
-
await this._client.humanTask.claimTask(taskId);
|
|
2991
|
-
} catch (error) {
|
|
2992
|
-
throw errorMapper(error);
|
|
2993
|
-
}
|
|
3099
|
+
return tryCatchReThrow(() => this._client.humanTask.claimTask(taskId));
|
|
2994
3100
|
}
|
|
2995
3101
|
/**
|
|
2996
3102
|
* Claim task as conductor user
|
|
@@ -3006,15 +3112,24 @@ var HumanExecutor = class {
|
|
|
3006
3112
|
}
|
|
3007
3113
|
}
|
|
3008
3114
|
/**
|
|
3009
|
-
* Returns a HumanTaskTemplateEntry for a given
|
|
3115
|
+
* Returns a HumanTaskTemplateEntry for a given name and version
|
|
3010
3116
|
* @param templateId
|
|
3011
3117
|
* @returns
|
|
3012
3118
|
*/
|
|
3013
|
-
async
|
|
3119
|
+
async getTemplateByNameVersion(name, version) {
|
|
3014
3120
|
return tryCatchReThrow(
|
|
3015
|
-
() => this._client.humanTask.
|
|
3121
|
+
() => this._client.humanTask.getTemplateByNameAndVersion(name, version)
|
|
3016
3122
|
);
|
|
3017
3123
|
}
|
|
3124
|
+
/**
|
|
3125
|
+
* @deprecated use getTemplate instead. name will be used as id here with version 1
|
|
3126
|
+
* Returns a HumanTaskTemplateEntry for a given templateId
|
|
3127
|
+
* @param templateId
|
|
3128
|
+
* @returns
|
|
3129
|
+
*/
|
|
3130
|
+
async getTemplateById(templateNameVersionOne) {
|
|
3131
|
+
return this.getTemplateByNameVersion(templateNameVersionOne, 1);
|
|
3132
|
+
}
|
|
3018
3133
|
/**
|
|
3019
3134
|
* Takes a taskId and a partial body. will update with given body
|
|
3020
3135
|
* @param taskId
|
|
@@ -3967,6 +4082,7 @@ var orkesConductorClient = baseOrkesConductorClient(
|
|
|
3967
4082
|
WorkflowExecutor,
|
|
3968
4083
|
WorkflowResourceService,
|
|
3969
4084
|
baseOrkesConductorClient,
|
|
4085
|
+
completedTaskMatchingType,
|
|
3970
4086
|
conductorEventTask,
|
|
3971
4087
|
doWhileTask,
|
|
3972
4088
|
dynamicForkTask,
|