@amaster.ai/bpm-client 1.0.0-beta.0

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.
@@ -0,0 +1,179 @@
1
+ import { ClientResult, HttpClient } from '@amaster.ai/http-client';
2
+
3
+ type CamundaVariableType = "String" | "Boolean" | "Integer" | "Long" | "Double" | "Date" | "Json";
4
+ type CamundaVariableValue = string | number | boolean | Date | null | undefined | Record<string, unknown> | unknown[];
5
+ type CamundaVariable = {
6
+ value: CamundaVariableValue;
7
+ type?: CamundaVariableType;
8
+ };
9
+ type VariableSubmission = {
10
+ variables: Record<string, CamundaVariable>;
11
+ };
12
+ type ProcessInstance = {
13
+ id: string;
14
+ definitionId?: string;
15
+ businessKey?: string;
16
+ ended?: boolean;
17
+ suspended?: boolean;
18
+ };
19
+ type ProcessInstanceQueryParams = {
20
+ processDefinitionKey?: string;
21
+ active?: boolean;
22
+ firstResult?: number;
23
+ maxResults?: number;
24
+ };
25
+ type HistoryProcessInstance = {
26
+ id: string;
27
+ businessKey: string;
28
+ processDefinitionId: string;
29
+ processDefinitionKey: string;
30
+ processDefinitionName: string;
31
+ processDefinitionVersion: number;
32
+ startTime: string;
33
+ endTime: string | null;
34
+ durationInMillis: number | null;
35
+ startUserId: string;
36
+ startActivityId: string;
37
+ deleteReason: string | null;
38
+ state: string;
39
+ superProcessInstanceId?: string;
40
+ superCaseInstanceId?: string;
41
+ };
42
+ type HistoryProcessInstanceQueryParams = {
43
+ startedBy?: string;
44
+ finished?: boolean;
45
+ processDefinitionKey?: string;
46
+ sortBy?: string;
47
+ sortOrder?: "asc" | "desc";
48
+ firstResult?: number;
49
+ maxResults?: number;
50
+ };
51
+ type ProcessVariable = {
52
+ id: string;
53
+ name: string;
54
+ type: string;
55
+ value: CamundaVariableValue;
56
+ processInstanceId: string;
57
+ createTime?: string;
58
+ activityInstanceId?: string;
59
+ taskId?: string;
60
+ executionId?: string;
61
+ errorMessage?: string;
62
+ };
63
+ type ActivityInstance = {
64
+ id: string;
65
+ activityId: string;
66
+ activityName: string;
67
+ activityType: string;
68
+ processInstanceId: string;
69
+ executionId: string;
70
+ startTime: string;
71
+ endTime?: string;
72
+ };
73
+ type Task = {
74
+ id: string;
75
+ name: string;
76
+ description?: string | null;
77
+ assignee?: string | null;
78
+ created?: string | null;
79
+ due?: string | null;
80
+ priority?: number;
81
+ processInstanceId?: string | null;
82
+ processDefinitionId?: string | null;
83
+ taskDefinitionKey?: string | null;
84
+ businessKey?: string | null;
85
+ taskState?: string | null;
86
+ };
87
+ type TaskCount = {
88
+ count: number;
89
+ };
90
+ type TaskFormField = {
91
+ id: string;
92
+ label?: string;
93
+ type?: string;
94
+ defaultValue?: CamundaVariableValue;
95
+ properties?: Record<string, unknown>;
96
+ validationConstraints?: Array<{
97
+ name: string;
98
+ config?: unknown;
99
+ }>;
100
+ [key: string]: unknown;
101
+ };
102
+ type TaskFormSchema = {
103
+ key?: string;
104
+ contextPath?: string;
105
+ fields?: TaskFormField[];
106
+ [key: string]: unknown;
107
+ };
108
+ type TaskFormVariable = {
109
+ type: string;
110
+ value: CamundaVariableValue;
111
+ valueInfo?: Record<string, unknown>;
112
+ };
113
+ type TaskFormVariables = Record<string, TaskFormVariable>;
114
+ type HistoryTask = {
115
+ id: string;
116
+ name: string;
117
+ assignee: string;
118
+ startTime: string;
119
+ endTime: string;
120
+ duration: number;
121
+ taskState: string;
122
+ processInstanceId: string;
123
+ };
124
+ type TaskQueryParams = {
125
+ processInstanceId?: string;
126
+ assignee?: string;
127
+ candidateUser?: string;
128
+ candidateGroup?: string;
129
+ name?: string;
130
+ nameLike?: string;
131
+ taskDefinitionKey?: string;
132
+ firstResult?: number;
133
+ maxResults?: number;
134
+ sortBy?: string;
135
+ sortOrder?: "asc" | "desc";
136
+ [key: string]: string | number | boolean | undefined;
137
+ };
138
+ type HistoryTaskQueryParams = {
139
+ taskAssignee?: string;
140
+ processInstanceId?: string;
141
+ finished?: boolean;
142
+ unfinished?: boolean;
143
+ firstResult?: number;
144
+ maxResults?: number;
145
+ sortBy?: string;
146
+ sortOrder?: "asc" | "desc";
147
+ [key: string]: string | number | boolean | undefined;
148
+ };
149
+ type BpmClient = {
150
+ startProcess(processKey: string, inputs?: Record<string, CamundaVariableValue> | VariableSubmission): Promise<ClientResult<ProcessInstance>>;
151
+ getProcessInstances(params?: ProcessInstanceQueryParams): Promise<ClientResult<ProcessInstance[]>>;
152
+ getProcessInstance(processInstanceId: string): Promise<ClientResult<ProcessInstance>>;
153
+ deleteProcessInstance(processInstanceId: string, params?: {
154
+ skipCustomListeners?: boolean;
155
+ }): Promise<ClientResult<null>>;
156
+ getActiveActivities(processInstanceId: string): Promise<ClientResult<ActivityInstance[]>>;
157
+ getTasks(params?: TaskQueryParams): Promise<ClientResult<Task[]>>;
158
+ getTaskCount(params?: TaskQueryParams): Promise<ClientResult<TaskCount>>;
159
+ getTask(taskId: string): Promise<ClientResult<Task>>;
160
+ getTaskFormSchema(taskId: string, opts?: {
161
+ redirect?: string;
162
+ }): Promise<ClientResult<TaskFormSchema>>;
163
+ getTaskFormVariables(taskId: string): Promise<ClientResult<TaskFormVariables>>;
164
+ completeTask(taskId: string, inputs: Record<string, CamundaVariableValue> | VariableSubmission): Promise<ClientResult<null>>;
165
+ getHistoryTasks(params?: HistoryTaskQueryParams): Promise<ClientResult<HistoryTask[]>>;
166
+ getHistoryTaskCount(params?: HistoryTaskQueryParams): Promise<ClientResult<TaskCount>>;
167
+ getHistoryProcessInstances(params?: HistoryProcessInstanceQueryParams): Promise<ClientResult<HistoryProcessInstance[]>>;
168
+ getHistoryProcessInstanceCount(params?: HistoryProcessInstanceQueryParams): Promise<ClientResult<{
169
+ count: number;
170
+ }>>;
171
+ getHistoryProcessInstance(processInstanceId: string): Promise<ClientResult<HistoryProcessInstance>>;
172
+ getProcessVariables(params: {
173
+ processInstanceId: string;
174
+ variableName?: string;
175
+ }): Promise<ClientResult<ProcessVariable[]>>;
176
+ };
177
+ declare function createBpmClient(http?: HttpClient): BpmClient;
178
+
179
+ export { type ActivityInstance, type BpmClient, type CamundaVariable, type CamundaVariableType, type CamundaVariableValue, type HistoryProcessInstance, type HistoryProcessInstanceQueryParams, type HistoryTask, type HistoryTaskQueryParams, type ProcessInstance, type ProcessInstanceQueryParams, type ProcessVariable, type Task, type TaskCount, type TaskFormField, type TaskFormSchema, type TaskFormVariable, type TaskFormVariables, type TaskQueryParams, type VariableSubmission, createBpmClient };
@@ -0,0 +1,179 @@
1
+ import { ClientResult, HttpClient } from '@amaster.ai/http-client';
2
+
3
+ type CamundaVariableType = "String" | "Boolean" | "Integer" | "Long" | "Double" | "Date" | "Json";
4
+ type CamundaVariableValue = string | number | boolean | Date | null | undefined | Record<string, unknown> | unknown[];
5
+ type CamundaVariable = {
6
+ value: CamundaVariableValue;
7
+ type?: CamundaVariableType;
8
+ };
9
+ type VariableSubmission = {
10
+ variables: Record<string, CamundaVariable>;
11
+ };
12
+ type ProcessInstance = {
13
+ id: string;
14
+ definitionId?: string;
15
+ businessKey?: string;
16
+ ended?: boolean;
17
+ suspended?: boolean;
18
+ };
19
+ type ProcessInstanceQueryParams = {
20
+ processDefinitionKey?: string;
21
+ active?: boolean;
22
+ firstResult?: number;
23
+ maxResults?: number;
24
+ };
25
+ type HistoryProcessInstance = {
26
+ id: string;
27
+ businessKey: string;
28
+ processDefinitionId: string;
29
+ processDefinitionKey: string;
30
+ processDefinitionName: string;
31
+ processDefinitionVersion: number;
32
+ startTime: string;
33
+ endTime: string | null;
34
+ durationInMillis: number | null;
35
+ startUserId: string;
36
+ startActivityId: string;
37
+ deleteReason: string | null;
38
+ state: string;
39
+ superProcessInstanceId?: string;
40
+ superCaseInstanceId?: string;
41
+ };
42
+ type HistoryProcessInstanceQueryParams = {
43
+ startedBy?: string;
44
+ finished?: boolean;
45
+ processDefinitionKey?: string;
46
+ sortBy?: string;
47
+ sortOrder?: "asc" | "desc";
48
+ firstResult?: number;
49
+ maxResults?: number;
50
+ };
51
+ type ProcessVariable = {
52
+ id: string;
53
+ name: string;
54
+ type: string;
55
+ value: CamundaVariableValue;
56
+ processInstanceId: string;
57
+ createTime?: string;
58
+ activityInstanceId?: string;
59
+ taskId?: string;
60
+ executionId?: string;
61
+ errorMessage?: string;
62
+ };
63
+ type ActivityInstance = {
64
+ id: string;
65
+ activityId: string;
66
+ activityName: string;
67
+ activityType: string;
68
+ processInstanceId: string;
69
+ executionId: string;
70
+ startTime: string;
71
+ endTime?: string;
72
+ };
73
+ type Task = {
74
+ id: string;
75
+ name: string;
76
+ description?: string | null;
77
+ assignee?: string | null;
78
+ created?: string | null;
79
+ due?: string | null;
80
+ priority?: number;
81
+ processInstanceId?: string | null;
82
+ processDefinitionId?: string | null;
83
+ taskDefinitionKey?: string | null;
84
+ businessKey?: string | null;
85
+ taskState?: string | null;
86
+ };
87
+ type TaskCount = {
88
+ count: number;
89
+ };
90
+ type TaskFormField = {
91
+ id: string;
92
+ label?: string;
93
+ type?: string;
94
+ defaultValue?: CamundaVariableValue;
95
+ properties?: Record<string, unknown>;
96
+ validationConstraints?: Array<{
97
+ name: string;
98
+ config?: unknown;
99
+ }>;
100
+ [key: string]: unknown;
101
+ };
102
+ type TaskFormSchema = {
103
+ key?: string;
104
+ contextPath?: string;
105
+ fields?: TaskFormField[];
106
+ [key: string]: unknown;
107
+ };
108
+ type TaskFormVariable = {
109
+ type: string;
110
+ value: CamundaVariableValue;
111
+ valueInfo?: Record<string, unknown>;
112
+ };
113
+ type TaskFormVariables = Record<string, TaskFormVariable>;
114
+ type HistoryTask = {
115
+ id: string;
116
+ name: string;
117
+ assignee: string;
118
+ startTime: string;
119
+ endTime: string;
120
+ duration: number;
121
+ taskState: string;
122
+ processInstanceId: string;
123
+ };
124
+ type TaskQueryParams = {
125
+ processInstanceId?: string;
126
+ assignee?: string;
127
+ candidateUser?: string;
128
+ candidateGroup?: string;
129
+ name?: string;
130
+ nameLike?: string;
131
+ taskDefinitionKey?: string;
132
+ firstResult?: number;
133
+ maxResults?: number;
134
+ sortBy?: string;
135
+ sortOrder?: "asc" | "desc";
136
+ [key: string]: string | number | boolean | undefined;
137
+ };
138
+ type HistoryTaskQueryParams = {
139
+ taskAssignee?: string;
140
+ processInstanceId?: string;
141
+ finished?: boolean;
142
+ unfinished?: boolean;
143
+ firstResult?: number;
144
+ maxResults?: number;
145
+ sortBy?: string;
146
+ sortOrder?: "asc" | "desc";
147
+ [key: string]: string | number | boolean | undefined;
148
+ };
149
+ type BpmClient = {
150
+ startProcess(processKey: string, inputs?: Record<string, CamundaVariableValue> | VariableSubmission): Promise<ClientResult<ProcessInstance>>;
151
+ getProcessInstances(params?: ProcessInstanceQueryParams): Promise<ClientResult<ProcessInstance[]>>;
152
+ getProcessInstance(processInstanceId: string): Promise<ClientResult<ProcessInstance>>;
153
+ deleteProcessInstance(processInstanceId: string, params?: {
154
+ skipCustomListeners?: boolean;
155
+ }): Promise<ClientResult<null>>;
156
+ getActiveActivities(processInstanceId: string): Promise<ClientResult<ActivityInstance[]>>;
157
+ getTasks(params?: TaskQueryParams): Promise<ClientResult<Task[]>>;
158
+ getTaskCount(params?: TaskQueryParams): Promise<ClientResult<TaskCount>>;
159
+ getTask(taskId: string): Promise<ClientResult<Task>>;
160
+ getTaskFormSchema(taskId: string, opts?: {
161
+ redirect?: string;
162
+ }): Promise<ClientResult<TaskFormSchema>>;
163
+ getTaskFormVariables(taskId: string): Promise<ClientResult<TaskFormVariables>>;
164
+ completeTask(taskId: string, inputs: Record<string, CamundaVariableValue> | VariableSubmission): Promise<ClientResult<null>>;
165
+ getHistoryTasks(params?: HistoryTaskQueryParams): Promise<ClientResult<HistoryTask[]>>;
166
+ getHistoryTaskCount(params?: HistoryTaskQueryParams): Promise<ClientResult<TaskCount>>;
167
+ getHistoryProcessInstances(params?: HistoryProcessInstanceQueryParams): Promise<ClientResult<HistoryProcessInstance[]>>;
168
+ getHistoryProcessInstanceCount(params?: HistoryProcessInstanceQueryParams): Promise<ClientResult<{
169
+ count: number;
170
+ }>>;
171
+ getHistoryProcessInstance(processInstanceId: string): Promise<ClientResult<HistoryProcessInstance>>;
172
+ getProcessVariables(params: {
173
+ processInstanceId: string;
174
+ variableName?: string;
175
+ }): Promise<ClientResult<ProcessVariable[]>>;
176
+ };
177
+ declare function createBpmClient(http?: HttpClient): BpmClient;
178
+
179
+ export { type ActivityInstance, type BpmClient, type CamundaVariable, type CamundaVariableType, type CamundaVariableValue, type HistoryProcessInstance, type HistoryProcessInstanceQueryParams, type HistoryTask, type HistoryTaskQueryParams, type ProcessInstance, type ProcessInstanceQueryParams, type ProcessVariable, type Task, type TaskCount, type TaskFormField, type TaskFormSchema, type TaskFormVariable, type TaskFormVariables, type TaskQueryParams, type VariableSubmission, createBpmClient };
package/dist/index.js ADDED
@@ -0,0 +1,296 @@
1
+ import { createHttpClient } from '@amaster.ai/http-client';
2
+
3
+ // src/bpm-client.ts
4
+ function isVariableSubmission(x) {
5
+ return x !== null && x !== void 0 && typeof x === "object" && "variables" in x && typeof x.variables === "object" && x.variables !== null;
6
+ }
7
+ function formatDateForCamunda(date) {
8
+ let isoString;
9
+ if (date instanceof Date) {
10
+ isoString = date.toISOString();
11
+ } else if (typeof date === "number") {
12
+ isoString = new Date(date).toISOString();
13
+ } else if (typeof date === "string") {
14
+ try {
15
+ isoString = new Date(date).toISOString();
16
+ } catch {
17
+ isoString = date;
18
+ }
19
+ } else {
20
+ isoString = new Date(date).toISOString();
21
+ }
22
+ return isoString.replace(/z$/i, "+0000");
23
+ }
24
+ function inferType(value) {
25
+ if (value === null || value === void 0) {
26
+ return void 0;
27
+ }
28
+ if (typeof value === "string") {
29
+ return "String";
30
+ }
31
+ if (typeof value === "boolean") {
32
+ return "Boolean";
33
+ }
34
+ if (typeof value === "number") {
35
+ return Number.isInteger(value) ? "Long" : "Double";
36
+ }
37
+ if (value instanceof Date) {
38
+ return "Date";
39
+ }
40
+ if (typeof value === "object") {
41
+ return "Json";
42
+ }
43
+ return void 0;
44
+ }
45
+ function processVariableValue(v) {
46
+ if (v && typeof v === "object" && "value" in v && ("type" in v || Object.keys(v).length <= 2)) {
47
+ const variable = v;
48
+ if (variable.value instanceof Date) {
49
+ return {
50
+ value: formatDateForCamunda(variable.value),
51
+ type: "Date"
52
+ };
53
+ }
54
+ if (variable.type === "Date" && (typeof variable.value === "string" || typeof variable.value === "number")) {
55
+ return {
56
+ value: formatDateForCamunda(variable.value),
57
+ type: "Date"
58
+ };
59
+ }
60
+ return variable;
61
+ }
62
+ if (v instanceof Date) {
63
+ return {
64
+ value: formatDateForCamunda(v),
65
+ type: "Date"
66
+ };
67
+ }
68
+ const camundaValue = v;
69
+ return { value: camundaValue, type: inferType(camundaValue) };
70
+ }
71
+ function toVariableSubmission(inputs) {
72
+ if (!inputs) {
73
+ return { variables: {} };
74
+ }
75
+ if (isVariableSubmission(inputs)) {
76
+ const variables2 = {};
77
+ for (const [k, v] of Object.entries(inputs.variables)) {
78
+ variables2[k] = processVariableValue(v);
79
+ }
80
+ return { variables: variables2 };
81
+ }
82
+ const variables = {};
83
+ for (const [k, v] of Object.entries(inputs)) {
84
+ variables[k] = processVariableValue(v);
85
+ }
86
+ return { variables };
87
+ }
88
+ function encodeQuery(params) {
89
+ if (!params) {
90
+ return "";
91
+ }
92
+ const sp = new URLSearchParams();
93
+ for (const [k, v] of Object.entries(params)) {
94
+ if (v === void 0 || v === null) {
95
+ continue;
96
+ }
97
+ sp.append(k, String(v));
98
+ }
99
+ const q = sp.toString();
100
+ return q ? `?${q}` : "";
101
+ }
102
+ function noContentToNull(r) {
103
+ if (r.status === 204) {
104
+ return { ...r, data: null };
105
+ }
106
+ return r;
107
+ }
108
+ function createBpmClient(http = createHttpClient()) {
109
+ return {
110
+ startProcess(processKey, inputs) {
111
+ if (!processKey) {
112
+ return Promise.resolve({
113
+ data: null,
114
+ error: { message: "Process key is required", status: 400 },
115
+ status: 400
116
+ });
117
+ }
118
+ return http.request({
119
+ url: `/api/bpm/start/${processKey}`,
120
+ method: "post",
121
+ headers: { "Content-Type": "application/json" },
122
+ data: toVariableSubmission(inputs)
123
+ });
124
+ },
125
+ getProcessInstances(params) {
126
+ return http.request({
127
+ url: `/api/bpm/process-instance${encodeQuery(params)}`,
128
+ method: "get"
129
+ });
130
+ },
131
+ getProcessInstance(processInstanceId) {
132
+ if (!processInstanceId) {
133
+ return Promise.resolve({
134
+ data: null,
135
+ error: { message: "Process instance ID is required", status: 400 },
136
+ status: 400
137
+ });
138
+ }
139
+ return http.request({
140
+ url: `/api/bpm/process-instance/${processInstanceId}`,
141
+ method: "get"
142
+ });
143
+ },
144
+ async deleteProcessInstance(processInstanceId, params) {
145
+ if (!processInstanceId) {
146
+ return {
147
+ data: null,
148
+ error: { message: "Process instance ID is required", status: 400 },
149
+ status: 400
150
+ };
151
+ }
152
+ const q = params?.skipCustomListeners ? "?skipCustomListeners=true" : "";
153
+ const result = await http.request({
154
+ url: `/api/bpm/process-instance/${processInstanceId}${q}`,
155
+ method: "delete"
156
+ });
157
+ return noContentToNull(result);
158
+ },
159
+ getActiveActivities(processInstanceId) {
160
+ if (!processInstanceId) {
161
+ return Promise.resolve({
162
+ data: null,
163
+ error: { message: "Process instance ID is required", status: 400 },
164
+ status: 400
165
+ });
166
+ }
167
+ return http.request({
168
+ url: `/api/bpm/process-instance/${processInstanceId}/activity-instances`,
169
+ method: "get"
170
+ });
171
+ },
172
+ getTasks(params) {
173
+ return http.request({
174
+ url: `/api/bpm/task${encodeQuery(params)}`,
175
+ method: "get"
176
+ });
177
+ },
178
+ getTaskCount(params) {
179
+ return http.request({
180
+ url: `/api/bpm/task/count${encodeQuery(params)}`,
181
+ method: "get"
182
+ });
183
+ },
184
+ getTask(taskId) {
185
+ if (!taskId) {
186
+ return Promise.resolve({
187
+ data: null,
188
+ error: { message: "Task ID is required", status: 400 },
189
+ status: 400
190
+ });
191
+ }
192
+ return http.request({
193
+ url: `/api/bpm/task/${taskId}`,
194
+ method: "get"
195
+ });
196
+ },
197
+ getTaskFormSchema(taskId, opts) {
198
+ if (!taskId) {
199
+ return Promise.resolve({
200
+ data: null,
201
+ error: { message: "Task ID is required", status: 400 },
202
+ status: 400
203
+ });
204
+ }
205
+ const q = encodeQuery(opts?.redirect ? { redirect: opts.redirect } : void 0);
206
+ return http.request({
207
+ url: `/api/bpm/task/${taskId}/form-schema${q}`,
208
+ method: "get"
209
+ });
210
+ },
211
+ getTaskFormVariables(taskId) {
212
+ if (!taskId) {
213
+ return Promise.resolve({
214
+ data: null,
215
+ error: { message: "Task ID is required", status: 400 },
216
+ status: 400
217
+ });
218
+ }
219
+ return http.request({
220
+ url: `/api/bpm/task/${taskId}/form-variables`,
221
+ method: "get"
222
+ });
223
+ },
224
+ async completeTask(taskId, inputs) {
225
+ if (!taskId) {
226
+ return {
227
+ data: null,
228
+ error: { message: "Task ID is required", status: 400 },
229
+ status: 400
230
+ };
231
+ }
232
+ const r = await http.request({
233
+ url: `/api/bpm/task/${taskId}/complete`,
234
+ method: "post",
235
+ headers: { "Content-Type": "application/json" },
236
+ data: toVariableSubmission(inputs)
237
+ });
238
+ return noContentToNull(r);
239
+ },
240
+ getHistoryTasks(params) {
241
+ return http.request({
242
+ url: `/api/bpm/history/task${encodeQuery(params)}`,
243
+ method: "get"
244
+ });
245
+ },
246
+ getHistoryTaskCount(params) {
247
+ return http.request({
248
+ url: `/api/bpm/history/task/count${encodeQuery(params)}`,
249
+ method: "get"
250
+ });
251
+ },
252
+ getHistoryProcessInstances(params) {
253
+ return http.request({
254
+ url: `/api/bpm/history/process-instance${encodeQuery(params)}`,
255
+ method: "get"
256
+ });
257
+ },
258
+ getHistoryProcessInstanceCount(params) {
259
+ return http.request({
260
+ url: `/api/bpm/history/process-instance/count${encodeQuery(params)}`,
261
+ method: "get"
262
+ });
263
+ },
264
+ getHistoryProcessInstance(processInstanceId) {
265
+ if (!processInstanceId) {
266
+ return Promise.resolve({
267
+ data: null,
268
+ error: { message: "Process instance ID is required", status: 400 },
269
+ status: 400
270
+ });
271
+ }
272
+ return http.request({
273
+ url: `/api/bpm/history/process-instance/${processInstanceId}`,
274
+ method: "get"
275
+ });
276
+ },
277
+ getProcessVariables(params) {
278
+ if (!params.processInstanceId) {
279
+ return Promise.resolve({
280
+ data: null,
281
+ error: { message: "Process instance ID is required", status: 400 },
282
+ status: 400
283
+ });
284
+ }
285
+ const q = encodeQuery(params);
286
+ return http.request({
287
+ url: `/api/bpm/history/variable-instance${q}`,
288
+ method: "get"
289
+ });
290
+ }
291
+ };
292
+ }
293
+
294
+ export { createBpmClient };
295
+ //# sourceMappingURL=index.js.map
296
+ //# sourceMappingURL=index.js.map