@quantumbpm/sdk 1.2.0 → 2.0.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.
Files changed (146) hide show
  1. package/README.md +93 -34
  2. package/dist/auth.d.ts +19 -14
  3. package/dist/auth.js +62 -84
  4. package/dist/bpmn.d.ts +83 -21
  5. package/dist/bpmn.js +61 -33
  6. package/dist/dmn.d.ts +0 -6
  7. package/dist/dmn.js +1 -15
  8. package/dist/generated/RawClient.js +2 -2
  9. package/dist/generated/core/OpenAPI.js +2 -2
  10. package/dist/generated/index.d.ts +9 -2
  11. package/dist/generated/index.js +8 -4
  12. package/dist/generated/models/BpmnActivityState.d.ts +85 -0
  13. package/dist/generated/models/BpmnActivityState.js +18 -0
  14. package/dist/generated/models/BpmnElementStatistics.d.ts +36 -0
  15. package/dist/generated/models/BpmnElementStatistics.js +17 -0
  16. package/dist/generated/models/BpmnExternalJobPaginatedResponse.d.ts +2 -2
  17. package/dist/generated/models/BpmnExternalJobPaginatedResponse.js +1 -1
  18. package/dist/generated/models/BpmnHistoryPage.d.ts +15 -0
  19. package/dist/generated/models/BpmnHistoryPage.js +3 -0
  20. package/dist/generated/models/BpmnIncident.d.ts +17 -17
  21. package/dist/generated/models/BpmnIncident.js +11 -11
  22. package/dist/generated/models/BpmnIncidentRecord.d.ts +10 -18
  23. package/dist/generated/models/BpmnIncidentRecord.js +6 -6
  24. package/dist/generated/models/BpmnIncidentRecordPaginatedResponse.d.ts +2 -2
  25. package/dist/generated/models/BpmnIncidentRecordPaginatedResponse.js +1 -1
  26. package/dist/generated/models/BpmnInstance.d.ts +21 -29
  27. package/dist/generated/models/BpmnInstance.js +1 -17
  28. package/dist/generated/models/BpmnInstancePaginatedResponse.d.ts +2 -2
  29. package/dist/generated/models/BpmnInstancePaginatedResponse.js +1 -1
  30. package/dist/generated/models/BpmnInstanceState.d.ts +49 -16
  31. package/dist/generated/models/BpmnInstanceState.js +1 -1
  32. package/dist/generated/models/BpmnInstanceStatus.d.ts +10 -0
  33. package/dist/generated/models/BpmnInstanceStatus.js +19 -0
  34. package/dist/generated/models/BpmnProcessDefinition.d.ts +5 -5
  35. package/dist/generated/models/BpmnProcessDefinition.js +1 -1
  36. package/dist/generated/models/BpmnProcessVersion.d.ts +9 -9
  37. package/dist/generated/models/BpmnProcessVersion.js +1 -1
  38. package/dist/generated/models/BpmnUserTaskPaginatedResponse.d.ts +2 -2
  39. package/dist/generated/models/BpmnUserTaskPaginatedResponse.js +1 -1
  40. package/dist/generated/models/CorrelationKeyNumber.d.ts +1 -1
  41. package/dist/generated/models/CorrelationKeyNumber.js +1 -1
  42. package/dist/generated/models/CorrelationKeys.d.ts +7 -6
  43. package/dist/generated/models/CorrelationKeys.js +1 -1
  44. package/dist/generated/models/CreateDefinitionRequest.d.ts +1 -5
  45. package/dist/generated/models/CreateDefinitionRequest.js +1 -1
  46. package/dist/generated/models/CursorPage.d.ts +12 -0
  47. package/dist/generated/models/CursorPage.js +3 -0
  48. package/dist/generated/models/DecisionSummary.d.ts +2 -2
  49. package/dist/generated/models/DecisionSummary.js +1 -1
  50. package/dist/generated/models/DecisionVersion.d.ts +25 -0
  51. package/dist/generated/models/DecisionVersion.js +3 -0
  52. package/dist/generated/models/DecisionVersionList.d.ts +7 -0
  53. package/dist/generated/models/DecisionVersionList.js +3 -0
  54. package/dist/generated/models/Definition.d.ts +16 -8
  55. package/dist/generated/models/Definition.js +1 -1
  56. package/dist/generated/models/Error.d.ts +8 -2
  57. package/dist/generated/models/Error.js +6 -2
  58. package/dist/generated/models/EvaluateStoredRequest.d.ts +6 -4
  59. package/dist/generated/models/EvaluateStoredRequest.js +1 -1
  60. package/dist/generated/models/EvaluationResult.d.ts +6 -0
  61. package/dist/generated/models/EvaluationResult.js +1 -1
  62. package/dist/generated/models/Execution.d.ts +30 -9
  63. package/dist/generated/models/Execution.js +1 -1
  64. package/dist/generated/models/ExternalJob.d.ts +9 -9
  65. package/dist/generated/models/ExternalJob.js +1 -1
  66. package/dist/generated/models/ExternalJobBatchResponse.d.ts +2 -2
  67. package/dist/generated/models/ExternalJobBatchResponse.js +1 -1
  68. package/dist/generated/models/JoinArrivals.d.ts +8 -0
  69. package/dist/generated/models/JoinArrivals.js +3 -0
  70. package/dist/generated/models/PollBpmnJobRequest.d.ts +1 -1
  71. package/dist/generated/models/PollBpmnJobRequest.js +1 -1
  72. package/dist/generated/models/StartBpmnInstanceRequest.d.ts +6 -2
  73. package/dist/generated/models/StartBpmnInstanceRequest.js +1 -1
  74. package/dist/generated/models/SuspendBpmnInstanceRequest.d.ts +1 -1
  75. package/dist/generated/models/SuspendBpmnInstanceRequest.js +1 -1
  76. package/dist/generated/models/SuspensionEntry.d.ts +2 -2
  77. package/dist/generated/models/SuspensionEntry.js +1 -1
  78. package/dist/generated/models/UpdateDefinitionRequest.d.ts +1 -5
  79. package/dist/generated/models/UpdateDefinitionRequest.js +1 -1
  80. package/dist/generated/models/UpdateUserTaskAssignmentRequest.d.ts +11 -4
  81. package/dist/generated/models/UpdateUserTaskAssignmentRequest.js +1 -1
  82. package/dist/generated/models/UserTask.d.ts +15 -11
  83. package/dist/generated/models/UserTask.js +1 -1
  84. package/dist/generated/services/BpmnService.d.ts +191 -94
  85. package/dist/generated/services/BpmnService.js +300 -119
  86. package/dist/generated/services/DefaultService.d.ts +118 -118
  87. package/dist/generated/services/DefaultService.js +156 -160
  88. package/dist/index.d.ts +8 -8
  89. package/dist/index.js +7 -7
  90. package/dist/tracing.js +2 -2
  91. package/dist/workers.d.ts +41 -7
  92. package/dist/workers.js +186 -53
  93. package/package.json +2 -4
  94. package/src/auth.test.ts +128 -0
  95. package/src/auth.ts +67 -64
  96. package/src/bpmn.ts +131 -43
  97. package/src/dmn.ts +0 -19
  98. package/src/generated/RawClient.ts +1 -1
  99. package/src/generated/core/OpenAPI.ts +1 -1
  100. package/src/generated/index.ts +9 -2
  101. package/src/generated/models/BpmnActivityState.ts +90 -0
  102. package/src/generated/models/BpmnElementStatistics.ts +41 -0
  103. package/src/generated/models/BpmnExternalJobPaginatedResponse.ts +2 -2
  104. package/src/generated/models/BpmnHistoryPage.ts +20 -0
  105. package/src/generated/models/BpmnIncident.ts +17 -17
  106. package/src/generated/models/BpmnIncidentRecord.ts +10 -18
  107. package/src/generated/models/BpmnIncidentRecordPaginatedResponse.ts +2 -2
  108. package/src/generated/models/BpmnInstance.ts +21 -29
  109. package/src/generated/models/BpmnInstancePaginatedResponse.ts +2 -2
  110. package/src/generated/models/BpmnInstanceState.ts +49 -16
  111. package/src/generated/models/BpmnInstanceStatus.ts +14 -0
  112. package/src/generated/models/BpmnProcessDefinition.ts +5 -5
  113. package/src/generated/models/BpmnProcessVersion.ts +9 -9
  114. package/src/generated/models/BpmnUserTaskPaginatedResponse.ts +2 -2
  115. package/src/generated/models/CorrelationKeyNumber.ts +1 -1
  116. package/src/generated/models/CorrelationKeys.ts +7 -6
  117. package/src/generated/models/CreateDefinitionRequest.ts +1 -5
  118. package/src/generated/models/CursorPage.ts +17 -0
  119. package/src/generated/models/DecisionSummary.ts +2 -2
  120. package/src/generated/models/DecisionVersion.ts +30 -0
  121. package/src/generated/models/DecisionVersionList.ts +12 -0
  122. package/src/generated/models/Definition.ts +16 -8
  123. package/src/generated/models/Error.ts +8 -2
  124. package/src/generated/models/EvaluateStoredRequest.ts +6 -4
  125. package/src/generated/models/EvaluationResult.ts +6 -0
  126. package/src/generated/models/Execution.ts +30 -9
  127. package/src/generated/models/ExternalJob.ts +9 -9
  128. package/src/generated/models/ExternalJobBatchResponse.ts +2 -2
  129. package/src/generated/models/JoinArrivals.ts +13 -0
  130. package/src/generated/models/PollBpmnJobRequest.ts +1 -1
  131. package/src/generated/models/StartBpmnInstanceRequest.ts +6 -2
  132. package/src/generated/models/SuspendBpmnInstanceRequest.ts +1 -1
  133. package/src/generated/models/SuspensionEntry.ts +2 -2
  134. package/src/generated/models/UpdateDefinitionRequest.ts +1 -5
  135. package/src/generated/models/UpdateUserTaskAssignmentRequest.ts +11 -4
  136. package/src/generated/models/UserTask.ts +15 -11
  137. package/src/generated/services/BpmnService.ts +357 -140
  138. package/src/generated/services/DefaultService.ts +178 -189
  139. package/src/index.test.ts +77 -31
  140. package/src/index.ts +13 -6
  141. package/src/tracing.ts +1 -1
  142. package/src/workers.test.ts +280 -3
  143. package/src/workers.ts +200 -60
  144. package/dist/generated/models/CreateProjectRequest.d.ts +0 -9
  145. package/dist/generated/models/CreateProjectRequest.js +0 -3
  146. package/src/generated/models/CreateProjectRequest.ts +0 -14
@@ -1,6 +1,9 @@
1
+ import type { BpmnActivityState } from '../models/BpmnActivityState';
2
+ import type { BpmnHistoryPage } from '../models/BpmnHistoryPage';
1
3
  import type { BpmnIncidentRecordPaginatedResponse } from '../models/BpmnIncidentRecordPaginatedResponse';
2
4
  import type { BpmnInstanceChildrenResponse } from '../models/BpmnInstanceChildrenResponse';
3
5
  import type { BpmnProcessSummaryPaginatedResponse } from '../models/BpmnProcessSummaryPaginatedResponse';
6
+ import type { BpmnProcessVersion } from '../models/BpmnProcessVersion';
4
7
  import type { BpmnProcessVersionPaginatedResponse } from '../models/BpmnProcessVersionPaginatedResponse';
5
8
  import type { BpmnResourceDetail } from '../models/BpmnResourceDetail';
6
9
  import type { BpmnResourcePaginatedResponse } from '../models/BpmnResourcePaginatedResponse';
@@ -39,7 +42,9 @@ export declare class BpmnService {
39
42
  * Create a BPMN resource
40
43
  * Uploads a new BPMN XML resource as a draft. Drafts can be edited and
41
44
  * tested but cannot start production instances until they are deployed.
42
- * The XML is validated; invalid XML is rejected.
45
+ * Invalid XML is rejected. XML identical to the latest deployed resource
46
+ * of the same `<definitions id>` is refused with 409, and nothing is
47
+ * saved.
43
48
  *
44
49
  * @param projectId
45
50
  * @param requestBody
@@ -83,8 +88,11 @@ export declare class BpmnService {
83
88
  /**
84
89
  * Deploy a BPMN resource
85
90
  * Marks all processes inside the resource as executable, making them
86
- * available to start instances of. Deployment is one-way; to change a
87
- * deployed resource, upload a new version and deploy that.
91
+ * available to start instances of. Each of them gets its next version.
92
+ * Deployment is one-way. To change a deployed resource, upload a new
93
+ * version and deploy that. A resource identical to the latest deployed
94
+ * resource of the same `<definitions id>` is refused with 409, and
95
+ * deploying that latest one again changes nothing.
88
96
  *
89
97
  * @param projectId
90
98
  * @param resourceId
@@ -93,11 +101,22 @@ export declare class BpmnService {
93
101
  */
94
102
  deployBpmnResource(projectId: string, resourceId: string): CancelablePromise<void>;
95
103
  /**
96
- * Start a test instance from a draft resource
97
- * Starts a process instance against a draft (non-deployed) resource.
98
- * Useful for trying out an in-progress design before deploying.
99
- * Test instances run with the same engine as production but are flagged
100
- * so they can be filtered out of dashboards.
104
+ * Start a test instance from a resource
105
+ * Starts a test instance of a resource, draft or deployed. A draft can
106
+ * only be started this way, which makes it the way to try out an
107
+ * in-progress design before deploying. A suspended definition does not
108
+ * stop it, since the test run takes no deployed version.
109
+ *
110
+ * A test run runs on the same engine as production but stays apart from
111
+ * it, and so do its call-activity children. It stays a test run for
112
+ * life, also after a migration to a deployed version.
113
+ * - Its job task types, message names and signal names carry the
114
+ * `draft:` prefix. A worker activates `draft:<type>` to work its jobs,
115
+ * and a publish names `draft:<name>` to reach it.
116
+ * - Its user tasks, jobs and incidents list only when `instanceID` names
117
+ * it.
118
+ * - Instance counts, analytics and job queue depth leave it out. The
119
+ * instance list shows it, with `draft` set.
101
120
  *
102
121
  * @param projectId
103
122
  * @param resourceId
@@ -107,9 +126,9 @@ export declare class BpmnService {
107
126
  */
108
127
  startBpmnTestInstance(projectId: string, resourceId: string, requestBody: StartBpmnTestInstanceRequest): CancelablePromise<{
109
128
  /**
110
- * Stable execution identifier of the new test instance.
129
+ * Identifier of the new test instance.
111
130
  */
112
- workflowID?: string;
131
+ instanceID?: string;
113
132
  }>;
114
133
  /**
115
134
  * List the latest version of each BPMN resource
@@ -123,7 +142,7 @@ export declare class BpmnService {
123
142
  listLatestBpmnResources(projectId: string, page?: number, pageSize?: number): CancelablePromise<BpmnResourceSummaryPaginatedResponse>;
124
143
  /**
125
144
  * List all versions of a BPMN resource
126
- * Returns every stored version of a resource identified by the BPMN XML's outer `definitions` id, oldest to newest.
145
+ * Returns every stored version of a resource identified by the BPMN XML's outer `definitions` id, newest first.
127
146
  * @param projectId
128
147
  * @param definitionsId
129
148
  * @param page
@@ -149,23 +168,23 @@ export declare class BpmnService {
149
168
  * List child instances of a BPMN instance
150
169
  * Returns instances that this instance spawned via CallActivity elements.
151
170
  * Useful for navigating into a multi-level process hierarchy (parents
152
- * can be discovered via `parentWorkflowID` on the child).
171
+ * can be discovered via `parentInstanceID` on the child).
153
172
  *
154
173
  * @param projectId
155
- * @param workflowId
174
+ * @param instanceId
156
175
  * @returns BpmnInstanceChildrenResponse OK
157
176
  * @throws ApiError
158
177
  */
159
- getBpmnInstanceChildren(projectId: string, workflowId: string): CancelablePromise<BpmnInstanceChildrenResponse>;
178
+ getBpmnInstanceChildren(projectId: string, instanceId: string): CancelablePromise<BpmnInstanceChildrenResponse>;
160
179
  /**
161
180
  * Get BPMN instance variables
162
181
  * Returns the current variables in the root scope of a running or completed instance.
163
182
  * @param projectId
164
- * @param workflowId
183
+ * @param instanceId
165
184
  * @returns any OK
166
185
  * @throws ApiError
167
186
  */
168
- getBpmnInstanceVariables(projectId: string, workflowId: string): CancelablePromise<{
187
+ getBpmnInstanceVariables(projectId: string, instanceId: string): CancelablePromise<{
169
188
  variables?: Record<string, any>;
170
189
  }>;
171
190
  /**
@@ -176,14 +195,49 @@ export declare class BpmnService {
176
195
  * payload are kept; pass `null` to clear a key.
177
196
  *
178
197
  * @param projectId
179
- * @param workflowId
198
+ * @param instanceId
180
199
  * @param requestBody
181
200
  * @returns any OK
182
201
  * @throws ApiError
183
202
  */
184
- updateBpmnInstanceVariables(projectId: string, workflowId: string, requestBody: {
203
+ updateBpmnInstanceVariables(projectId: string, instanceId: string, requestBody: {
185
204
  variables: Record<string, any>;
186
205
  }): CancelablePromise<any>;
206
+ /**
207
+ * Get a page of a BPMN instance's history
208
+ * A window of an instance's BPMN history, oldest first, for a running or
209
+ * an ended instance. Without a cursor it is the newest entries.
210
+ * `beforeSeq` reads the entries before one, to walk back, and `fromSeq`
211
+ * the entries from one on, to follow a running instance. Every entry
212
+ * carries its `seq`.
213
+ *
214
+ * Page entries leave out `inputs` and `outputs`, so a page costs the same
215
+ * however long the history is. Read one entry's payload from
216
+ * `GetBpmnInstanceHistoryEntry`. The diagram needs no history at all: the
217
+ * instance state's `elementStatistics` and `takenFlows` summarise it.
218
+ *
219
+ * @param projectId
220
+ * @param instanceId
221
+ * @param fromSeq Read the entries from this seq on. Takes precedence over `beforeSeq`.
222
+ * @param beforeSeq Read the newest entries before this seq.
223
+ * @param limit Max entries per page. Clamped server-side to the engine's max page size.
224
+ * @returns BpmnHistoryPage OK
225
+ * @throws ApiError
226
+ */
227
+ getBpmnInstanceHistory(projectId: string, instanceId: string, fromSeq?: number, beforeSeq?: number, limit?: number): CancelablePromise<BpmnHistoryPage>;
228
+ /**
229
+ * Get one BPMN history entry with its payload
230
+ * One history entry with its `inputs` and `outputs`. The engine rebuilds
231
+ * them from the variable writes of every entry before it, so the read
232
+ * grows with the entry's position: around 0.3 s at entry 40,000.
233
+ *
234
+ * @param projectId
235
+ * @param instanceId
236
+ * @param seq
237
+ * @returns BpmnActivityState OK
238
+ * @throws ApiError
239
+ */
240
+ getBpmnInstanceHistoryEntry(projectId: string, instanceId: string, seq: number): CancelablePromise<BpmnActivityState>;
187
241
  /**
188
242
  * Resolve an incident and retry the failed activity
189
243
  * Marks an incident as resolved and re-runs the activity that produced it.
@@ -192,41 +246,42 @@ export declare class BpmnService {
192
246
  * that triggered a FEEL evaluation error).
193
247
  *
194
248
  * @param projectId
195
- * @param workflowId
249
+ * @param instanceId
196
250
  * @param incidentId
197
251
  * @param requestBody
198
252
  * @returns any OK
199
253
  * @throws ApiError
200
254
  */
201
- resolveBpmnIncident(projectId: string, workflowId: string, incidentId: string, requestBody?: {
255
+ resolveBpmnIncident(projectId: string, instanceId: string, incidentId: string, requestBody?: {
202
256
  variables?: Record<string, any>;
203
257
  }): CancelablePromise<any>;
204
258
  /**
205
259
  * List BPMN incidents
206
260
  * Cross-instance audit listing of incidents in the project. By default
207
261
  * returns open incidents first (unresolved), ordered by recency.
208
- * Filterable by definition, error type, status, and time window.
262
+ * Filterable by process version, error type, status, and time window.
209
263
  *
210
264
  * Each row carries the parent process metadata (processID, processName)
211
265
  * so a single page render needs no follow-up queries against the
212
266
  * instances endpoint. Click-through to a specific instance still uses
213
- * the workflow-scoped detail endpoint.
267
+ * the instance detail endpoint.
214
268
  *
215
269
  * @param projectId
216
- * @param definitionId Restrict to incidents on instances of a single process definition.
217
- * @param workflowId Restrict to incidents on a single instance - useful for an instance-detail "all incidents ever raised here" view that includes resolved rows.
270
+ * @param processId Restrict to incidents on instances of one process, in any version unless `version` names one.
271
+ * @param version Restrict to one version of `processID`. Ignored without `processID`.
272
+ * @param instanceId Restrict to incidents on a single instance - useful for an instance-detail "all incidents ever raised here" view that includes resolved rows. A test run's incidents list only by its instance.
218
273
  * @param status Filter by lifecycle status. `open` returns unresolved incidents;
219
274
  * `resolved` returns only resolved ones. Omit to return both.
220
275
  *
221
276
  * @param errorType Restrict to a single error category (matches `BpmnIncidentRecord.errorType`).
222
277
  * @param since Earliest `raisedAt` to include (inclusive).
223
278
  * @param until Latest `raisedAt` to include (exclusive).
224
- * @param page
225
- * @param pageSize
279
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
280
+ * @param limit Most incidents per page, 20 by default and 100 at most.
226
281
  * @returns BpmnIncidentRecordPaginatedResponse OK
227
282
  * @throws ApiError
228
283
  */
229
- listBpmnIncidents(projectId: string, definitionId?: string, workflowId?: string, status?: 'open' | 'resolved', errorType?: 'BpmnError' | 'EscalationError' | 'CompensationError' | 'FeelError' | 'NoHandler' | 'GatewayNoMatch' | 'TimerResolution' | 'LinkNotFound' | 'MigrationError' | 'SubscriptionError' | 'RotationLimitError' | 'SnapshotSizeExceeded' | 'CallActivityCanceled' | 'ExternalRowRefreshError' | 'Unknown', since?: string, until?: string, page?: number, pageSize?: number): CancelablePromise<BpmnIncidentRecordPaginatedResponse>;
284
+ listBpmnIncidents(projectId: string, processId?: string, version?: number, instanceId?: string, status?: 'open' | 'resolved', errorType?: 'BpmnError' | 'CompensationError' | 'FeelError' | 'GatewayNoMatch' | 'TimerResolution' | 'LinkNotFound' | 'MigrationError' | 'CallActivityCanceled' | 'ExternalRowRefreshError' | 'JobLockLost' | 'DecisionNotFound' | 'DecisionEvaluationError' | 'ProcessNotFound' | 'ProcessSuspended' | 'Unknown', since?: string, until?: string, cursor?: string, limit?: number): CancelablePromise<BpmnIncidentRecordPaginatedResponse>;
230
285
  /**
231
286
  * Migrate a running instance to a newer process version
232
287
  * Moves a running instance from its current process version to a newer
@@ -235,12 +290,12 @@ export declare class BpmnService {
235
290
  * and target. Validate the migration plan first via `MigrateValidate`.
236
291
  *
237
292
  * @param projectId
238
- * @param workflowId
293
+ * @param instanceId
239
294
  * @param requestBody
240
295
  * @returns any OK
241
296
  * @throws ApiError
242
297
  */
243
- migrateBpmnInstance(projectId: string, workflowId: string, requestBody: MigrateBpmnInstanceRequest): CancelablePromise<any>;
298
+ migrateBpmnInstance(projectId: string, instanceId: string, requestBody: MigrateBpmnInstanceRequest): CancelablePromise<any>;
244
299
  /**
245
300
  * Validate a migration plan without executing it
246
301
  * Returns the issues a migration plan would hit if executed: missing
@@ -249,12 +304,12 @@ export declare class BpmnService {
249
304
  * to the user.
250
305
  *
251
306
  * @param projectId
252
- * @param workflowId
307
+ * @param instanceId
253
308
  * @param requestBody
254
309
  * @returns MigrationValidationResult OK
255
310
  * @throws ApiError
256
311
  */
257
- validateBpmnInstanceMigration(projectId: string, workflowId: string, requestBody: MigrateBpmnInstanceRequest): CancelablePromise<MigrationValidationResult>;
312
+ validateBpmnInstanceMigration(projectId: string, instanceId: string, requestBody: MigrateBpmnInstanceRequest): CancelablePromise<MigrationValidationResult>;
258
313
  /**
259
314
  * Modify a running instance with ad-hoc token operations
260
315
  * Operational recovery tool: applies a sequence of token-level
@@ -270,12 +325,12 @@ export declare class BpmnService {
270
325
  * A batch is applied whole or not at all.
271
326
  *
272
327
  * @param projectId
273
- * @param workflowId
328
+ * @param instanceId
274
329
  * @param requestBody
275
330
  * @returns any OK
276
331
  * @throws ApiError
277
332
  */
278
- modifyBpmnInstance(projectId: string, workflowId: string, requestBody: ModifyBpmnInstanceRequest): CancelablePromise<any>;
333
+ modifyBpmnInstance(projectId: string, instanceId: string, requestBody: ModifyBpmnInstanceRequest): CancelablePromise<any>;
279
334
  /**
280
335
  * Activate an activity inside a running ad-hoc subprocess
281
336
  * Manually starts one of the activities inside an active ad-hoc
@@ -283,13 +338,13 @@ export declare class BpmnService {
283
338
  * can be triggered repeatedly until the ad-hoc subprocess completes.
284
339
  *
285
340
  * @param projectId
286
- * @param workflowId
341
+ * @param instanceId
287
342
  * @param adHocNodeId
288
343
  * @param requestBody
289
344
  * @returns any OK
290
345
  * @throws ApiError
291
346
  */
292
- triggerBpmnAdHocNode(projectId: string, workflowId: string, adHocNodeId: string, requestBody: {
347
+ triggerBpmnAdHocNode(projectId: string, instanceId: string, adHocNodeId: string, requestBody: {
293
348
  nodeID: string;
294
349
  }): CancelablePromise<any>;
295
350
  /**
@@ -299,13 +354,13 @@ export declare class BpmnService {
299
354
  * values, which may cause the subprocess to complete or branch.
300
355
  *
301
356
  * @param projectId
302
- * @param workflowId
357
+ * @param instanceId
303
358
  * @param adHocNodeId
304
359
  * @param requestBody
305
360
  * @returns any OK
306
361
  * @throws ApiError
307
362
  */
308
- setBpmnAdHocVariables(projectId: string, workflowId: string, adHocNodeId: string, requestBody: {
363
+ setBpmnAdHocVariables(projectId: string, instanceId: string, adHocNodeId: string, requestBody: {
309
364
  variables?: Record<string, any>;
310
365
  }): CancelablePromise<any>;
311
366
  /**
@@ -315,22 +370,22 @@ export declare class BpmnService {
315
370
  * flag layers on top. Idempotent - a second call against an already-
316
371
  * suspended instance is a no-op.
317
372
  *
318
- * While suspended: cancel / terminate / migrate / force-rotate / resolve-
319
- * incident / variable update / modify all still work. Parked tokens
320
- * released by signal demuxes or timer fires queue internally and dispatch
321
- * on resume.
373
+ * While suspended, cancel, terminate, resolve-incident and variable
374
+ * update still apply. Anything else that reaches the instance, such as a
375
+ * job completion, a message or a due timer, applies on resume, in the
376
+ * order it arrived.
322
377
  *
323
- * The audit (operator, reason, timestamp) is also recorded in the
324
- * workflow's Temporal history as a `SuspendInstanceEvent` so the timeline
325
- * view on the instance detail page can render the cycle.
378
+ * The suspension (operator, reason, timestamp) is also recorded in the
379
+ * instance's history as a `SuspendInstanceEvent`, so the timeline view on
380
+ * the instance detail page can render the cycle.
326
381
  *
327
382
  * @param projectId
328
- * @param workflowId
383
+ * @param instanceId
329
384
  * @param requestBody
330
385
  * @returns void
331
386
  * @throws ApiError
332
387
  */
333
- suspendBpmnInstance(projectId: string, workflowId: string, requestBody?: SuspendBpmnInstanceRequest): CancelablePromise<void>;
388
+ suspendBpmnInstance(projectId: string, instanceId: string, requestBody?: SuspendBpmnInstanceRequest): CancelablePromise<void>;
334
389
  /**
335
390
  * Resume a suspended BPMN instance
336
391
  * Clears the instance-scope suspension. If the parent definition is also
@@ -338,49 +393,47 @@ export declare class BpmnService {
338
393
  * is resumed as well. Idempotent.
339
394
  *
340
395
  * @param projectId
341
- * @param workflowId
396
+ * @param instanceId
342
397
  * @returns void
343
398
  * @throws ApiError
344
399
  */
345
- resumeBpmnInstance(projectId: string, workflowId: string): CancelablePromise<void>;
400
+ resumeBpmnInstance(projectId: string, instanceId: string): CancelablePromise<void>;
346
401
  /**
347
- * Suspend every running instance of a BPMN definition
348
- * Pauses every running instance of one deployed process definition AND
349
- * rejects new instance starts on that definition until it is resumed.
402
+ * Suspend a deployed version of a BPMN process
403
+ * Pauses every running instance of one deployed process version AND
404
+ * rejects new instance starts on that version until it is resumed.
350
405
  *
351
- * The handler acquires a row-level lock on the definition before flipping
352
- * the flag so a `StartBpmnInstance` racing the suspend can't slip through.
353
- * It then iterates over every running instance (`status='RUNNING'`) and
354
- * sends each one a definition-scope suspend signal via the engine API.
355
406
  * Instances that were also explicitly instance-suspended stay paused
356
407
  * after a definition-scope resume - the operator must clear that scope
357
408
  * too.
358
409
  *
359
- * Idempotent. The reason cascades to every affected instance's history
360
- * audit (`SuspendDefinitionEvent`) so the UI can render where the pause
361
- * came from.
410
+ * Idempotent. Suspending again reaches the running instances an earlier
411
+ * call missed. The reason reaches every affected instance's history
412
+ * (`SuspendDefinitionEvent`) so the UI can render where the pause came
413
+ * from.
362
414
  *
363
415
  * @param projectId
364
- * @param definitionId Platform identifier of the process definition version (same UUID `BpmnProcessVersion.id` exposes).
416
+ * @param processId
417
+ * @param version
365
418
  * @param requestBody
366
419
  * @returns void
367
420
  * @throws ApiError
368
421
  */
369
- suspendBpmnDefinition(projectId: string, definitionId: string, requestBody?: SuspendBpmnDefinitionRequest): CancelablePromise<void>;
422
+ suspendBpmnDefinition(projectId: string, processId: string, version: number, requestBody?: SuspendBpmnDefinitionRequest): CancelablePromise<void>;
370
423
  /**
371
- * Resume a suspended BPMN definition
372
- * Clears the definition-scope suspension and fans out a resume signal to
373
- * every running instance of the definition. Instances that were also
374
- * instance-suspended stay paused until their own scope is cleared. New
375
- * instance starts are accepted again once the definition flag clears.
376
- * Idempotent.
424
+ * Resume a suspended version of a BPMN process
425
+ * Clears the definition-scope suspension and resumes every running
426
+ * instance of the version. Instances that were also instance-suspended
427
+ * stay paused until their own scope is cleared. New instance starts are
428
+ * accepted again. Idempotent.
377
429
  *
378
430
  * @param projectId
379
- * @param definitionId
431
+ * @param processId
432
+ * @param version
380
433
  * @returns void
381
434
  * @throws ApiError
382
435
  */
383
- resumeBpmnDefinition(projectId: string, definitionId: string): CancelablePromise<void>;
436
+ resumeBpmnDefinition(projectId: string, processId: string, version: number): CancelablePromise<void>;
384
437
  /**
385
438
  * PENDING job counts grouped by taskType
386
439
  * Returns one entry per `taskType` with at least one PENDING job. Useful for
@@ -411,6 +464,9 @@ export declare class BpmnService {
411
464
  * never fix (e.g. `PAYMENT_DECLINED`). SDK workers send this automatically
412
465
  * when a handler throws a typed `BpmnError`.
413
466
  *
467
+ * Once the instance has ended, any report on its jobs answers 200 and
468
+ * changes nothing.
469
+ *
414
470
  * @param projectId
415
471
  * @param executionKey
416
472
  * @param requestBody
@@ -418,13 +474,19 @@ export declare class BpmnService {
418
474
  * @throws ApiError
419
475
  */
420
476
  throwBpmnExternalJobError(projectId: string, executionKey: string, requestBody: {
477
+ /**
478
+ * Instance ID returned by the poll response.
479
+ */
480
+ instanceID: string;
421
481
  errorCode: string;
422
482
  /**
423
483
  * Optional worker identity (the same `clientID` used to poll).
424
- * When supplied, the error is applied only if this worker still
425
- * holds the job's lock, so a stale report can't requeue or fail
426
- * a job a peer is actively holding. Omit for the legacy
427
- * unchecked behavior.
484
+ * When supplied, a worker that no longer holds the job's lock
485
+ * gets 409 and its report is discarded, so a stale report can't
486
+ * requeue or fail the job. Repeating the report this worker last
487
+ * made on the job answers 200 again and changes nothing. Without
488
+ * it, the report applies to an open job no worker holds a live
489
+ * lock on.
428
490
  *
429
491
  */
430
492
  clientID?: string;
@@ -457,15 +519,17 @@ export declare class BpmnService {
457
519
  /**
458
520
  * Optional worker identity (the same `clientID` used to poll)
459
521
  * applied to every item in the batch - a batch is one worker's
460
- * report. When supplied, an item is completed only if this
461
- * worker still holds its lock; items re-acquired by a peer drop
462
- * out silently. Omit for the legacy unchecked behavior.
522
+ * report. When supplied, an item this worker no longer holds
523
+ * comes back with status `error` and its result is discarded,
524
+ * and repeating this worker's last report on an item changes
525
+ * nothing. Without it, an item a worker holds a live lock on, or
526
+ * one that already ended, comes back with status `error`.
463
527
  *
464
528
  */
465
529
  clientID?: string;
466
530
  items: Array<{
467
531
  executionKey: string;
468
- workflowID: string;
532
+ instanceID: string;
469
533
  variables?: Record<string, any>;
470
534
  }>;
471
535
  }): CancelablePromise<ExternalJobBatchResponse>;
@@ -489,10 +553,11 @@ export declare class BpmnService {
489
553
  /**
490
554
  * Optional worker identity (the same `clientID` used to poll)
491
555
  * applied to every item in the batch - a batch is one worker's
492
- * report. When supplied, an item is requeued/failed only if this
493
- * worker still holds its lock; items held by a peer are reported
494
- * as an error and left untouched. Omit for the legacy unchecked
495
- * behavior.
556
+ * report. When supplied, an item this worker no longer holds
557
+ * comes back with status `error` and the job is left untouched,
558
+ * and repeating this worker's last report on an item changes
559
+ * nothing. Without it, an item a worker holds a live lock on, or
560
+ * one that already ended, comes back with status `error`.
496
561
  *
497
562
  */
498
563
  clientID?: string;
@@ -507,7 +572,7 @@ export declare class BpmnService {
507
572
  retryable?: boolean;
508
573
  items: Array<{
509
574
  executionKey: string;
510
- workflowID: string;
575
+ instanceID: string;
511
576
  errorCode: string;
512
577
  variables?: Record<string, any>;
513
578
  }>;
@@ -515,22 +580,29 @@ export declare class BpmnService {
515
580
  /**
516
581
  * List User Tasks
517
582
  * Paginated list of user tasks for the project, optionally filtered by
518
- * workflow, status, assignee, candidate user or candidate group.
583
+ * instance, status, assignee, candidate user, candidate group or due date.
519
584
  * Requires Executor role on the project.
520
585
  *
521
586
  * @param projectId
522
- * @param workflowId
587
+ * @param instanceId Only this instance's tasks. A test run's tasks list only by its instance.
523
588
  * @param status
524
589
  * @param assignee
525
590
  * @param candidateUser
526
591
  * @param candidateGroup
527
592
  * @param businessId Exact-match filter on the caller-supplied correlation key.
528
- * @param page
529
- * @param pageSize
593
+ * @param dueAfter Only tasks due at or after this time.
594
+ * @param dueBefore Only tasks due before this time. With `status=CREATED` and the current time, the overdue tasks.
595
+ * @param sort `created` lists the newest first, and is the default. `dueDate` lists
596
+ * the soonest due first and tasks without a due date last. `priority`
597
+ * lists the highest priority first. Both list the oldest first among
598
+ * equals. A cursor continues only a list of the same sort.
599
+ *
600
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
601
+ * @param limit Most tasks per page, 20 by default and 100 at most.
530
602
  * @returns BpmnUserTaskPaginatedResponse OK
531
603
  * @throws ApiError
532
604
  */
533
- listBpmnUserTasks(projectId: string, workflowId?: string, status?: 'CREATED' | 'COMPLETED' | 'CANCELED' | 'FAILED', assignee?: string, candidateUser?: string, candidateGroup?: string, businessId?: string, page?: number, pageSize?: number): CancelablePromise<BpmnUserTaskPaginatedResponse>;
605
+ listBpmnUserTasks(projectId: string, instanceId?: string, status?: 'CREATED' | 'COMPLETED' | 'CANCELED' | 'FAILED', assignee?: string, candidateUser?: string, candidateGroup?: string, businessId?: string, dueAfter?: string, dueBefore?: string, sort?: 'created' | 'dueDate' | 'priority', cursor?: string, limit?: number): CancelablePromise<BpmnUserTaskPaginatedResponse>;
534
606
  /**
535
607
  * List User Tasks for the Caller
536
608
  * Returns CREATED user tasks the caller can act on: directly assigned,
@@ -538,12 +610,19 @@ export declare class BpmnService {
538
610
  * the caller's identity-provider groups. Requires Viewer role on the project.
539
611
  *
540
612
  * @param projectId
541
- * @param page
542
- * @param pageSize
613
+ * @param dueAfter Only tasks due at or after this time.
614
+ * @param dueBefore Only tasks due before this time. With the current time, the caller's overdue tasks.
615
+ * @param sort `created` lists the newest first, and is the default. `dueDate` lists
616
+ * the soonest due first and tasks without a due date last. `priority`
617
+ * lists the highest priority first. Both list the oldest first among
618
+ * equals. A cursor continues only a list of the same sort.
619
+ *
620
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
621
+ * @param limit Most tasks per page, 20 by default and 100 at most.
543
622
  * @returns BpmnUserTaskPaginatedResponse OK
544
623
  * @throws ApiError
545
624
  */
546
- listBpmnUserTasksForCaller(projectId: string, page?: number, pageSize?: number): CancelablePromise<BpmnUserTaskPaginatedResponse>;
625
+ listBpmnUserTasksForCaller(projectId: string, dueAfter?: string, dueBefore?: string, sort?: 'created' | 'dueDate' | 'priority', cursor?: string, limit?: number): CancelablePromise<BpmnUserTaskPaginatedResponse>;
547
626
  /**
548
627
  * Get User Task
549
628
  * Fetch a single user task by execution key. Allowed for callers with
@@ -559,7 +638,8 @@ export declare class BpmnService {
559
638
  getBpmnUserTask(projectId: string, executionKey: string): CancelablePromise<UserTask>;
560
639
  /**
561
640
  * Update User Task Assignment
562
- * Reassign / change candidates on a CREATED user task. Returns 404 if the
641
+ * Reassign / change candidates on a CREATED user task. Only the fields in
642
+ * the body change. Returns 400 for a body with none of them, and 404 if the
563
643
  * task does not exist or is no longer in CREATED state. Requires Executor
564
644
  * role on the project.
565
645
  *
@@ -606,7 +686,7 @@ export declare class BpmnService {
606
686
  * Publish a BPMN message
607
687
  * Publishes a message into the project. Each message is delivered to at
608
688
  * most one waiting catch event whose subscription matches `messageName`
609
- * and whose correlation keys are a subset of `correlationKeys`. If no
689
+ * and whose correlation value equals `correlationKeys`. If no
610
690
  * subscriber is currently waiting the message is buffered up to its TTL
611
691
  * and delivered to the first matching subscriber that registers.
612
692
  *
@@ -678,9 +758,9 @@ export declare class BpmnService {
678
758
  * @param pageSize
679
759
  * @param q Optional case-insensitive substring match against process id or process name.
680
760
  * @param createdAfter Bounds the totalCount aggregate to instances created at or after this
681
- * timestamp. Strongly recommended for monitoring views - instance
682
- * history accumulates indefinitely and unfiltered totals scan the full
683
- * table per definition. runningCount ignores this filter (it is always
761
+ * timestamp. Strongly recommended for monitoring views - ended
762
+ * instances stay until retention deletes them, and unfiltered totals
763
+ * scan every kept instance per definition. runningCount ignores this filter (it is always
684
764
  * point-in-time).
685
765
  *
686
766
  * @param suspended Filter by paused versions. `true` → only processes with at least one
@@ -713,4 +793,21 @@ export declare class BpmnService {
713
793
  * @throws ApiError
714
794
  */
715
795
  listBpmnProcessVersions(projectId: string, processId: string, page?: number, pageSize?: number, createdAfter?: string, suspended?: boolean): CancelablePromise<BpmnProcessVersionPaginatedResponse>;
796
+ /**
797
+ * Get one deployed version of a BPMN process
798
+ * Returns the single deployed version identified by (processID, version)
799
+ * with its instance counts and suspension state, wherever it falls in the
800
+ * pages of `ListBpmnProcessVersions`.
801
+ *
802
+ * @param projectId
803
+ * @param processId
804
+ * @param version
805
+ * @param createdAfter Bounds the totalCount aggregate to instances created at or after this
806
+ * timestamp. See ListBpmnProcesses for rationale. runningCount ignores
807
+ * this filter.
808
+ *
809
+ * @returns BpmnProcessVersion OK
810
+ * @throws ApiError
811
+ */
812
+ getBpmnProcessVersion(projectId: string, processId: string, version: number, createdAfter?: string): CancelablePromise<BpmnProcessVersion>;
716
813
  }