@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
@@ -2,9 +2,12 @@
2
2
  /* istanbul ignore file */
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
+ import type { BpmnActivityState } from '../models/BpmnActivityState';
6
+ import type { BpmnHistoryPage } from '../models/BpmnHistoryPage';
5
7
  import type { BpmnIncidentRecordPaginatedResponse } from '../models/BpmnIncidentRecordPaginatedResponse';
6
8
  import type { BpmnInstanceChildrenResponse } from '../models/BpmnInstanceChildrenResponse';
7
9
  import type { BpmnProcessSummaryPaginatedResponse } from '../models/BpmnProcessSummaryPaginatedResponse';
10
+ import type { BpmnProcessVersion } from '../models/BpmnProcessVersion';
8
11
  import type { BpmnProcessVersionPaginatedResponse } from '../models/BpmnProcessVersionPaginatedResponse';
9
12
  import type { BpmnResourceDetail } from '../models/BpmnResourceDetail';
10
13
  import type { BpmnResourcePaginatedResponse } from '../models/BpmnResourcePaginatedResponse';
@@ -58,7 +61,9 @@ export class BpmnService {
58
61
  * Create a BPMN resource
59
62
  * Uploads a new BPMN XML resource as a draft. Drafts can be edited and
60
63
  * tested but cannot start production instances until they are deployed.
61
- * The XML is validated; invalid XML is rejected.
64
+ * Invalid XML is rejected. XML identical to the latest deployed resource
65
+ * of the same `<definitions id>` is refused with 409, and nothing is
66
+ * saved.
62
67
  *
63
68
  * @param projectId
64
69
  * @param requestBody
@@ -77,6 +82,9 @@ export class BpmnService {
77
82
  },
78
83
  body: requestBody,
79
84
  mediaType: 'application/json',
85
+ errors: {
86
+ 409: `Conflict`,
87
+ },
80
88
  });
81
89
  }
82
90
  /**
@@ -98,6 +106,9 @@ export class BpmnService {
98
106
  'projectID': projectId,
99
107
  'resourceID': resourceId,
100
108
  },
109
+ errors: {
110
+ 404: `Not Found`,
111
+ },
101
112
  });
102
113
  }
103
114
  /**
@@ -126,7 +137,7 @@ export class BpmnService {
126
137
  body: requestBody,
127
138
  mediaType: 'application/json',
128
139
  errors: {
129
- 409: `Conflict - resource is already deployed`,
140
+ 409: `Conflict`,
130
141
  },
131
142
  });
132
143
  }
@@ -153,15 +164,18 @@ export class BpmnService {
153
164
  'resourceID': resourceId,
154
165
  },
155
166
  errors: {
156
- 409: `Conflict - resource has running instances`,
167
+ 409: `Conflict`,
157
168
  },
158
169
  });
159
170
  }
160
171
  /**
161
172
  * Deploy a BPMN resource
162
173
  * Marks all processes inside the resource as executable, making them
163
- * available to start instances of. Deployment is one-way; to change a
164
- * deployed resource, upload a new version and deploy that.
174
+ * available to start instances of. Each of them gets its next version.
175
+ * Deployment is one-way. To change a deployed resource, upload a new
176
+ * version and deploy that. A resource identical to the latest deployed
177
+ * resource of the same `<definitions id>` is refused with 409, and
178
+ * deploying that latest one again changes nothing.
165
179
  *
166
180
  * @param projectId
167
181
  * @param resourceId
@@ -182,16 +196,29 @@ export class BpmnService {
182
196
  errors: {
183
197
  400: `Bad Request`,
184
198
  401: `Unauthorized`,
199
+ 404: `Not Found`,
200
+ 409: `Conflict`,
185
201
  500: `Internal Server Error`,
186
202
  },
187
203
  });
188
204
  }
189
205
  /**
190
- * Start a test instance from a draft resource
191
- * Starts a process instance against a draft (non-deployed) resource.
192
- * Useful for trying out an in-progress design before deploying.
193
- * Test instances run with the same engine as production but are flagged
194
- * so they can be filtered out of dashboards.
206
+ * Start a test instance from a resource
207
+ * Starts a test instance of a resource, draft or deployed. A draft can
208
+ * only be started this way, which makes it the way to try out an
209
+ * in-progress design before deploying. A suspended definition does not
210
+ * stop it, since the test run takes no deployed version.
211
+ *
212
+ * A test run runs on the same engine as production but stays apart from
213
+ * it, and so do its call-activity children. It stays a test run for
214
+ * life, also after a migration to a deployed version.
215
+ * - Its job task types, message names and signal names carry the
216
+ * `draft:` prefix. A worker activates `draft:<type>` to work its jobs,
217
+ * and a publish names `draft:<name>` to reach it.
218
+ * - Its user tasks, jobs and incidents list only when `instanceID` names
219
+ * it.
220
+ * - Instance counts, analytics and job queue depth leave it out. The
221
+ * instance list shows it, with `draft` set.
195
222
  *
196
223
  * @param projectId
197
224
  * @param resourceId
@@ -205,9 +232,9 @@ export class BpmnService {
205
232
  requestBody: StartBpmnTestInstanceRequest,
206
233
  ): CancelablePromise<{
207
234
  /**
208
- * Stable execution identifier of the new test instance.
235
+ * Identifier of the new test instance.
209
236
  */
210
- workflowID?: string;
237
+ instanceID?: string;
211
238
  }> {
212
239
  return this.httpRequest.request({
213
240
  method: 'POST',
@@ -221,6 +248,7 @@ export class BpmnService {
221
248
  errors: {
222
249
  400: `Bad Request`,
223
250
  401: `Unauthorized`,
251
+ 404: `Not Found`,
224
252
  500: `Internal Server Error`,
225
253
  },
226
254
  });
@@ -257,7 +285,7 @@ export class BpmnService {
257
285
  }
258
286
  /**
259
287
  * List all versions of a BPMN resource
260
- * Returns every stored version of a resource identified by the BPMN XML's outer `definitions` id, oldest to newest.
288
+ * Returns every stored version of a resource identified by the BPMN XML's outer `definitions` id, newest first.
261
289
  * @param projectId
262
290
  * @param definitionsId
263
291
  * @param page
@@ -318,23 +346,23 @@ export class BpmnService {
318
346
  * List child instances of a BPMN instance
319
347
  * Returns instances that this instance spawned via CallActivity elements.
320
348
  * Useful for navigating into a multi-level process hierarchy (parents
321
- * can be discovered via `parentWorkflowID` on the child).
349
+ * can be discovered via `parentInstanceID` on the child).
322
350
  *
323
351
  * @param projectId
324
- * @param workflowId
352
+ * @param instanceId
325
353
  * @returns BpmnInstanceChildrenResponse OK
326
354
  * @throws ApiError
327
355
  */
328
356
  public getBpmnInstanceChildren(
329
357
  projectId: string,
330
- workflowId: string,
358
+ instanceId: string,
331
359
  ): CancelablePromise<BpmnInstanceChildrenResponse> {
332
360
  return this.httpRequest.request({
333
361
  method: 'GET',
334
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/children',
362
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/children',
335
363
  path: {
336
364
  'projectID': projectId,
337
- 'workflowID': workflowId,
365
+ 'instanceID': instanceId,
338
366
  },
339
367
  });
340
368
  }
@@ -342,22 +370,22 @@ export class BpmnService {
342
370
  * Get BPMN instance variables
343
371
  * Returns the current variables in the root scope of a running or completed instance.
344
372
  * @param projectId
345
- * @param workflowId
373
+ * @param instanceId
346
374
  * @returns any OK
347
375
  * @throws ApiError
348
376
  */
349
377
  public getBpmnInstanceVariables(
350
378
  projectId: string,
351
- workflowId: string,
379
+ instanceId: string,
352
380
  ): CancelablePromise<{
353
381
  variables?: Record<string, any>;
354
382
  }> {
355
383
  return this.httpRequest.request({
356
384
  method: 'GET',
357
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/variables',
385
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/variables',
358
386
  path: {
359
387
  'projectID': projectId,
360
- 'workflowID': workflowId,
388
+ 'instanceID': instanceId,
361
389
  },
362
390
  });
363
391
  }
@@ -369,29 +397,104 @@ export class BpmnService {
369
397
  * payload are kept; pass `null` to clear a key.
370
398
  *
371
399
  * @param projectId
372
- * @param workflowId
400
+ * @param instanceId
373
401
  * @param requestBody
374
402
  * @returns any OK
375
403
  * @throws ApiError
376
404
  */
377
405
  public updateBpmnInstanceVariables(
378
406
  projectId: string,
379
- workflowId: string,
407
+ instanceId: string,
380
408
  requestBody: {
381
409
  variables: Record<string, any>;
382
410
  },
383
411
  ): CancelablePromise<any> {
384
412
  return this.httpRequest.request({
385
413
  method: 'PUT',
386
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/variables',
414
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/variables',
387
415
  path: {
388
416
  'projectID': projectId,
389
- 'workflowID': workflowId,
417
+ 'instanceID': instanceId,
390
418
  },
391
419
  body: requestBody,
392
420
  mediaType: 'application/json',
393
421
  });
394
422
  }
423
+ /**
424
+ * Get a page of a BPMN instance's history
425
+ * A window of an instance's BPMN history, oldest first, for a running or
426
+ * an ended instance. Without a cursor it is the newest entries.
427
+ * `beforeSeq` reads the entries before one, to walk back, and `fromSeq`
428
+ * the entries from one on, to follow a running instance. Every entry
429
+ * carries its `seq`.
430
+ *
431
+ * Page entries leave out `inputs` and `outputs`, so a page costs the same
432
+ * however long the history is. Read one entry's payload from
433
+ * `GetBpmnInstanceHistoryEntry`. The diagram needs no history at all: the
434
+ * instance state's `elementStatistics` and `takenFlows` summarise it.
435
+ *
436
+ * @param projectId
437
+ * @param instanceId
438
+ * @param fromSeq Read the entries from this seq on. Takes precedence over `beforeSeq`.
439
+ * @param beforeSeq Read the newest entries before this seq.
440
+ * @param limit Max entries per page. Clamped server-side to the engine's max page size.
441
+ * @returns BpmnHistoryPage OK
442
+ * @throws ApiError
443
+ */
444
+ public getBpmnInstanceHistory(
445
+ projectId: string,
446
+ instanceId: string,
447
+ fromSeq?: number,
448
+ beforeSeq?: number,
449
+ limit?: number,
450
+ ): CancelablePromise<BpmnHistoryPage> {
451
+ return this.httpRequest.request({
452
+ method: 'GET',
453
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/history',
454
+ path: {
455
+ 'projectID': projectId,
456
+ 'instanceID': instanceId,
457
+ },
458
+ query: {
459
+ 'fromSeq': fromSeq,
460
+ 'beforeSeq': beforeSeq,
461
+ 'limit': limit,
462
+ },
463
+ errors: {
464
+ 404: `Not Found`,
465
+ },
466
+ });
467
+ }
468
+ /**
469
+ * Get one BPMN history entry with its payload
470
+ * One history entry with its `inputs` and `outputs`. The engine rebuilds
471
+ * them from the variable writes of every entry before it, so the read
472
+ * grows with the entry's position: around 0.3 s at entry 40,000.
473
+ *
474
+ * @param projectId
475
+ * @param instanceId
476
+ * @param seq
477
+ * @returns BpmnActivityState OK
478
+ * @throws ApiError
479
+ */
480
+ public getBpmnInstanceHistoryEntry(
481
+ projectId: string,
482
+ instanceId: string,
483
+ seq: number,
484
+ ): CancelablePromise<BpmnActivityState> {
485
+ return this.httpRequest.request({
486
+ method: 'GET',
487
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/history/{seq}',
488
+ path: {
489
+ 'projectID': projectId,
490
+ 'instanceID': instanceId,
491
+ 'seq': seq,
492
+ },
493
+ errors: {
494
+ 404: `Not Found`,
495
+ },
496
+ });
497
+ }
395
498
  /**
396
499
  * Resolve an incident and retry the failed activity
397
500
  * Marks an incident as resolved and re-runs the activity that produced it.
@@ -400,7 +503,7 @@ export class BpmnService {
400
503
  * that triggered a FEEL evaluation error).
401
504
  *
402
505
  * @param projectId
403
- * @param workflowId
506
+ * @param instanceId
404
507
  * @param incidentId
405
508
  * @param requestBody
406
509
  * @returns any OK
@@ -408,7 +511,7 @@ export class BpmnService {
408
511
  */
409
512
  public resolveBpmnIncident(
410
513
  projectId: string,
411
- workflowId: string,
514
+ instanceId: string,
412
515
  incidentId: string,
413
516
  requestBody?: {
414
517
  variables?: Record<string, any>;
@@ -416,10 +519,10 @@ export class BpmnService {
416
519
  ): CancelablePromise<any> {
417
520
  return this.httpRequest.request({
418
521
  method: 'POST',
419
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/incidents/{incidentID}/resolve',
522
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/incidents/{incidentID}/resolve',
420
523
  path: {
421
524
  'projectID': projectId,
422
- 'workflowID': workflowId,
525
+ 'instanceID': instanceId,
423
526
  'incidentID': incidentId,
424
527
  },
425
528
  body: requestBody,
@@ -430,37 +533,39 @@ export class BpmnService {
430
533
  * List BPMN incidents
431
534
  * Cross-instance audit listing of incidents in the project. By default
432
535
  * returns open incidents first (unresolved), ordered by recency.
433
- * Filterable by definition, error type, status, and time window.
536
+ * Filterable by process version, error type, status, and time window.
434
537
  *
435
538
  * Each row carries the parent process metadata (processID, processName)
436
539
  * so a single page render needs no follow-up queries against the
437
540
  * instances endpoint. Click-through to a specific instance still uses
438
- * the workflow-scoped detail endpoint.
541
+ * the instance detail endpoint.
439
542
  *
440
543
  * @param projectId
441
- * @param definitionId Restrict to incidents on instances of a single process definition.
442
- * @param workflowId Restrict to incidents on a single instance - useful for an instance-detail "all incidents ever raised here" view that includes resolved rows.
544
+ * @param processId Restrict to incidents on instances of one process, in any version unless `version` names one.
545
+ * @param version Restrict to one version of `processID`. Ignored without `processID`.
546
+ * @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.
443
547
  * @param status Filter by lifecycle status. `open` returns unresolved incidents;
444
548
  * `resolved` returns only resolved ones. Omit to return both.
445
549
  *
446
550
  * @param errorType Restrict to a single error category (matches `BpmnIncidentRecord.errorType`).
447
551
  * @param since Earliest `raisedAt` to include (inclusive).
448
552
  * @param until Latest `raisedAt` to include (exclusive).
449
- * @param page
450
- * @param pageSize
553
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
554
+ * @param limit Most incidents per page, 20 by default and 100 at most.
451
555
  * @returns BpmnIncidentRecordPaginatedResponse OK
452
556
  * @throws ApiError
453
557
  */
454
558
  public listBpmnIncidents(
455
559
  projectId: string,
456
- definitionId?: string,
457
- workflowId?: string,
560
+ processId?: string,
561
+ version?: number,
562
+ instanceId?: string,
458
563
  status?: 'open' | 'resolved',
459
- errorType?: 'BpmnError' | 'EscalationError' | 'CompensationError' | 'FeelError' | 'NoHandler' | 'GatewayNoMatch' | 'TimerResolution' | 'LinkNotFound' | 'MigrationError' | 'SubscriptionError' | 'RotationLimitError' | 'SnapshotSizeExceeded' | 'CallActivityCanceled' | 'ExternalRowRefreshError' | 'Unknown',
564
+ errorType?: 'BpmnError' | 'CompensationError' | 'FeelError' | 'GatewayNoMatch' | 'TimerResolution' | 'LinkNotFound' | 'MigrationError' | 'CallActivityCanceled' | 'ExternalRowRefreshError' | 'JobLockLost' | 'DecisionNotFound' | 'DecisionEvaluationError' | 'ProcessNotFound' | 'ProcessSuspended' | 'Unknown',
460
565
  since?: string,
461
566
  until?: string,
462
- page?: number,
463
- pageSize?: number,
567
+ cursor?: string,
568
+ limit?: number,
464
569
  ): CancelablePromise<BpmnIncidentRecordPaginatedResponse> {
465
570
  return this.httpRequest.request({
466
571
  method: 'GET',
@@ -469,14 +574,15 @@ export class BpmnService {
469
574
  'projectID': projectId,
470
575
  },
471
576
  query: {
472
- 'definitionID': definitionId,
473
- 'workflowID': workflowId,
577
+ 'processID': processId,
578
+ 'version': version,
579
+ 'instanceID': instanceId,
474
580
  'status': status,
475
581
  'errorType': errorType,
476
582
  'since': since,
477
583
  'until': until,
478
- 'page': page,
479
- 'pageSize': pageSize,
584
+ 'cursor': cursor,
585
+ 'limit': limit,
480
586
  },
481
587
  });
482
588
  }
@@ -488,22 +594,22 @@ export class BpmnService {
488
594
  * and target. Validate the migration plan first via `MigrateValidate`.
489
595
  *
490
596
  * @param projectId
491
- * @param workflowId
597
+ * @param instanceId
492
598
  * @param requestBody
493
599
  * @returns any OK
494
600
  * @throws ApiError
495
601
  */
496
602
  public migrateBpmnInstance(
497
603
  projectId: string,
498
- workflowId: string,
604
+ instanceId: string,
499
605
  requestBody: MigrateBpmnInstanceRequest,
500
606
  ): CancelablePromise<any> {
501
607
  return this.httpRequest.request({
502
608
  method: 'POST',
503
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/migrate',
609
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/migrate',
504
610
  path: {
505
611
  'projectID': projectId,
506
- 'workflowID': workflowId,
612
+ 'instanceID': instanceId,
507
613
  },
508
614
  body: requestBody,
509
615
  mediaType: 'application/json',
@@ -517,22 +623,22 @@ export class BpmnService {
517
623
  * to the user.
518
624
  *
519
625
  * @param projectId
520
- * @param workflowId
626
+ * @param instanceId
521
627
  * @param requestBody
522
628
  * @returns MigrationValidationResult OK
523
629
  * @throws ApiError
524
630
  */
525
631
  public validateBpmnInstanceMigration(
526
632
  projectId: string,
527
- workflowId: string,
633
+ instanceId: string,
528
634
  requestBody: MigrateBpmnInstanceRequest,
529
635
  ): CancelablePromise<MigrationValidationResult> {
530
636
  return this.httpRequest.request({
531
637
  method: 'POST',
532
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/migrate/validate',
638
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/migrate/validate',
533
639
  path: {
534
640
  'projectID': projectId,
535
- 'workflowID': workflowId,
641
+ 'instanceID': instanceId,
536
642
  },
537
643
  body: requestBody,
538
644
  mediaType: 'application/json',
@@ -553,22 +659,22 @@ export class BpmnService {
553
659
  * A batch is applied whole or not at all.
554
660
  *
555
661
  * @param projectId
556
- * @param workflowId
662
+ * @param instanceId
557
663
  * @param requestBody
558
664
  * @returns any OK
559
665
  * @throws ApiError
560
666
  */
561
667
  public modifyBpmnInstance(
562
668
  projectId: string,
563
- workflowId: string,
669
+ instanceId: string,
564
670
  requestBody: ModifyBpmnInstanceRequest,
565
671
  ): CancelablePromise<any> {
566
672
  return this.httpRequest.request({
567
673
  method: 'POST',
568
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/modify',
674
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/modify',
569
675
  path: {
570
676
  'projectID': projectId,
571
- 'workflowID': workflowId,
677
+ 'instanceID': instanceId,
572
678
  },
573
679
  body: requestBody,
574
680
  mediaType: 'application/json',
@@ -585,7 +691,7 @@ export class BpmnService {
585
691
  * can be triggered repeatedly until the ad-hoc subprocess completes.
586
692
  *
587
693
  * @param projectId
588
- * @param workflowId
694
+ * @param instanceId
589
695
  * @param adHocNodeId
590
696
  * @param requestBody
591
697
  * @returns any OK
@@ -593,7 +699,7 @@ export class BpmnService {
593
699
  */
594
700
  public triggerBpmnAdHocNode(
595
701
  projectId: string,
596
- workflowId: string,
702
+ instanceId: string,
597
703
  adHocNodeId: string,
598
704
  requestBody: {
599
705
  nodeID: string;
@@ -601,10 +707,10 @@ export class BpmnService {
601
707
  ): CancelablePromise<any> {
602
708
  return this.httpRequest.request({
603
709
  method: 'POST',
604
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/adhoc/{adHocNodeID}/trigger',
710
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/adhoc/{adHocNodeID}/trigger',
605
711
  path: {
606
712
  'projectID': projectId,
607
- 'workflowID': workflowId,
713
+ 'instanceID': instanceId,
608
714
  'adHocNodeID': adHocNodeId,
609
715
  },
610
716
  body: requestBody,
@@ -618,7 +724,7 @@ export class BpmnService {
618
724
  * values, which may cause the subprocess to complete or branch.
619
725
  *
620
726
  * @param projectId
621
- * @param workflowId
727
+ * @param instanceId
622
728
  * @param adHocNodeId
623
729
  * @param requestBody
624
730
  * @returns any OK
@@ -626,7 +732,7 @@ export class BpmnService {
626
732
  */
627
733
  public setBpmnAdHocVariables(
628
734
  projectId: string,
629
- workflowId: string,
735
+ instanceId: string,
630
736
  adHocNodeId: string,
631
737
  requestBody: {
632
738
  variables?: Record<string, any>;
@@ -634,10 +740,10 @@ export class BpmnService {
634
740
  ): CancelablePromise<any> {
635
741
  return this.httpRequest.request({
636
742
  method: 'POST',
637
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/adhoc/{adHocNodeID}/variables',
743
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/adhoc/{adHocNodeID}/variables',
638
744
  path: {
639
745
  'projectID': projectId,
640
- 'workflowID': workflowId,
746
+ 'instanceID': instanceId,
641
747
  'adHocNodeID': adHocNodeId,
642
748
  },
643
749
  body: requestBody,
@@ -651,32 +757,32 @@ export class BpmnService {
651
757
  * flag layers on top. Idempotent - a second call against an already-
652
758
  * suspended instance is a no-op.
653
759
  *
654
- * While suspended: cancel / terminate / migrate / force-rotate / resolve-
655
- * incident / variable update / modify all still work. Parked tokens
656
- * released by signal demuxes or timer fires queue internally and dispatch
657
- * on resume.
760
+ * While suspended, cancel, terminate, resolve-incident and variable
761
+ * update still apply. Anything else that reaches the instance, such as a
762
+ * job completion, a message or a due timer, applies on resume, in the
763
+ * order it arrived.
658
764
  *
659
- * The audit (operator, reason, timestamp) is also recorded in the
660
- * workflow's Temporal history as a `SuspendInstanceEvent` so the timeline
661
- * view on the instance detail page can render the cycle.
765
+ * The suspension (operator, reason, timestamp) is also recorded in the
766
+ * instance's history as a `SuspendInstanceEvent`, so the timeline view on
767
+ * the instance detail page can render the cycle.
662
768
  *
663
769
  * @param projectId
664
- * @param workflowId
770
+ * @param instanceId
665
771
  * @param requestBody
666
772
  * @returns void
667
773
  * @throws ApiError
668
774
  */
669
775
  public suspendBpmnInstance(
670
776
  projectId: string,
671
- workflowId: string,
777
+ instanceId: string,
672
778
  requestBody?: SuspendBpmnInstanceRequest,
673
779
  ): CancelablePromise<void> {
674
780
  return this.httpRequest.request({
675
781
  method: 'POST',
676
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/suspend',
782
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/suspend',
677
783
  path: {
678
784
  'projectID': projectId,
679
- 'workflowID': workflowId,
785
+ 'instanceID': instanceId,
680
786
  },
681
787
  body: requestBody,
682
788
  mediaType: 'application/json',
@@ -689,91 +795,93 @@ export class BpmnService {
689
795
  * is resumed as well. Idempotent.
690
796
  *
691
797
  * @param projectId
692
- * @param workflowId
798
+ * @param instanceId
693
799
  * @returns void
694
800
  * @throws ApiError
695
801
  */
696
802
  public resumeBpmnInstance(
697
803
  projectId: string,
698
- workflowId: string,
804
+ instanceId: string,
699
805
  ): CancelablePromise<void> {
700
806
  return this.httpRequest.request({
701
807
  method: 'POST',
702
- url: '/projects/{projectID}/bpmn/instances/{workflowID}/resume',
808
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}/resume',
703
809
  path: {
704
810
  'projectID': projectId,
705
- 'workflowID': workflowId,
811
+ 'instanceID': instanceId,
706
812
  },
707
813
  });
708
814
  }
709
815
  /**
710
- * Suspend every running instance of a BPMN definition
711
- * Pauses every running instance of one deployed process definition AND
712
- * rejects new instance starts on that definition until it is resumed.
816
+ * Suspend a deployed version of a BPMN process
817
+ * Pauses every running instance of one deployed process version AND
818
+ * rejects new instance starts on that version until it is resumed.
713
819
  *
714
- * The handler acquires a row-level lock on the definition before flipping
715
- * the flag so a `StartBpmnInstance` racing the suspend can't slip through.
716
- * It then iterates over every running instance (`status='RUNNING'`) and
717
- * sends each one a definition-scope suspend signal via the engine API.
718
820
  * Instances that were also explicitly instance-suspended stay paused
719
821
  * after a definition-scope resume - the operator must clear that scope
720
822
  * too.
721
823
  *
722
- * Idempotent. The reason cascades to every affected instance's history
723
- * audit (`SuspendDefinitionEvent`) so the UI can render where the pause
724
- * came from.
824
+ * Idempotent. Suspending again reaches the running instances an earlier
825
+ * call missed. The reason reaches every affected instance's history
826
+ * (`SuspendDefinitionEvent`) so the UI can render where the pause came
827
+ * from.
725
828
  *
726
829
  * @param projectId
727
- * @param definitionId Platform identifier of the process definition version (same UUID `BpmnProcessVersion.id` exposes).
830
+ * @param processId
831
+ * @param version
728
832
  * @param requestBody
729
833
  * @returns void
730
834
  * @throws ApiError
731
835
  */
732
836
  public suspendBpmnDefinition(
733
837
  projectId: string,
734
- definitionId: string,
838
+ processId: string,
839
+ version: number,
735
840
  requestBody?: SuspendBpmnDefinitionRequest,
736
841
  ): CancelablePromise<void> {
737
842
  return this.httpRequest.request({
738
843
  method: 'POST',
739
- url: '/projects/{projectID}/bpmn/definitions/{definitionID}/suspend',
844
+ url: '/projects/{projectID}/bpmn/processes/{processID}/versions/{version}/suspend',
740
845
  path: {
741
846
  'projectID': projectId,
742
- 'definitionID': definitionId,
847
+ 'processID': processId,
848
+ 'version': version,
743
849
  },
744
850
  body: requestBody,
745
851
  mediaType: 'application/json',
746
852
  errors: {
747
- 404: `Definition not found`,
853
+ 404: `Process version not found`,
748
854
  },
749
855
  });
750
856
  }
751
857
  /**
752
- * Resume a suspended BPMN definition
753
- * Clears the definition-scope suspension and fans out a resume signal to
754
- * every running instance of the definition. Instances that were also
755
- * instance-suspended stay paused until their own scope is cleared. New
756
- * instance starts are accepted again once the definition flag clears.
757
- * Idempotent.
858
+ * Resume a suspended version of a BPMN process
859
+ * Clears the definition-scope suspension and resumes every running
860
+ * instance of the version. Instances that were also instance-suspended
861
+ * stay paused until their own scope is cleared. New instance starts are
862
+ * accepted again. Idempotent.
758
863
  *
759
864
  * @param projectId
760
- * @param definitionId
865
+ * @param processId
866
+ * @param version
761
867
  * @returns void
762
868
  * @throws ApiError
763
869
  */
764
870
  public resumeBpmnDefinition(
765
871
  projectId: string,
766
- definitionId: string,
872
+ processId: string,
873
+ version: number,
767
874
  ): CancelablePromise<void> {
768
875
  return this.httpRequest.request({
769
876
  method: 'POST',
770
- url: '/projects/{projectID}/bpmn/definitions/{definitionID}/resume',
877
+ url: '/projects/{projectID}/bpmn/processes/{processID}/versions/{version}/resume',
771
878
  path: {
772
879
  'projectID': projectId,
773
- 'definitionID': definitionId,
880
+ 'processID': processId,
881
+ 'version': version,
774
882
  },
775
883
  errors: {
776
- 404: `Definition not found`,
884
+ 404: `Process version not found`,
777
885
  },
778
886
  });
779
887
  }
@@ -821,6 +929,9 @@ export class BpmnService {
821
929
  * never fix (e.g. `PAYMENT_DECLINED`). SDK workers send this automatically
822
930
  * when a handler throws a typed `BpmnError`.
823
931
  *
932
+ * Once the instance has ended, any report on its jobs answers 200 and
933
+ * changes nothing.
934
+ *
824
935
  * @param projectId
825
936
  * @param executionKey
826
937
  * @param requestBody
@@ -831,13 +942,19 @@ export class BpmnService {
831
942
  projectId: string,
832
943
  executionKey: string,
833
944
  requestBody: {
945
+ /**
946
+ * Instance ID returned by the poll response.
947
+ */
948
+ instanceID: string;
834
949
  errorCode: string;
835
950
  /**
836
951
  * Optional worker identity (the same `clientID` used to poll).
837
- * When supplied, the error is applied only if this worker still
838
- * holds the job's lock, so a stale report can't requeue or fail
839
- * a job a peer is actively holding. Omit for the legacy
840
- * unchecked behavior.
952
+ * When supplied, a worker that no longer holds the job's lock
953
+ * gets 409 and its report is discarded, so a stale report can't
954
+ * requeue or fail the job. Repeating the report this worker last
955
+ * made on the job answers 200 again and changes nothing. Without
956
+ * it, the report applies to an open job no worker holds a live
957
+ * lock on.
841
958
  *
842
959
  */
843
960
  clientID?: string;
@@ -865,6 +982,15 @@ export class BpmnService {
865
982
  },
866
983
  body: requestBody,
867
984
  mediaType: 'application/json',
985
+ errors: {
986
+ 404: `The instance is running and has no job with this execution key.`,
987
+ 409: `The report was discarded. This worker no longer holds the job: its
988
+ lock ran out, another worker holds it, or the job has finished.
989
+ Without a \`clientID\`, a worker holds a live lock on the job, named in
990
+ the message, or the job already ended. The message says when the job
991
+ was cancelled.
992
+ `,
993
+ },
868
994
  });
869
995
  }
870
996
  /**
@@ -884,15 +1010,17 @@ export class BpmnService {
884
1010
  /**
885
1011
  * Optional worker identity (the same `clientID` used to poll)
886
1012
  * applied to every item in the batch - a batch is one worker's
887
- * report. When supplied, an item is completed only if this
888
- * worker still holds its lock; items re-acquired by a peer drop
889
- * out silently. Omit for the legacy unchecked behavior.
1013
+ * report. When supplied, an item this worker no longer holds
1014
+ * comes back with status `error` and its result is discarded,
1015
+ * and repeating this worker's last report on an item changes
1016
+ * nothing. Without it, an item a worker holds a live lock on, or
1017
+ * one that already ended, comes back with status `error`.
890
1018
  *
891
1019
  */
892
1020
  clientID?: string;
893
1021
  items: Array<{
894
1022
  executionKey: string;
895
- workflowID: string;
1023
+ instanceID: string;
896
1024
  variables?: Record<string, any>;
897
1025
  }>;
898
1026
  },
@@ -929,10 +1057,11 @@ export class BpmnService {
929
1057
  /**
930
1058
  * Optional worker identity (the same `clientID` used to poll)
931
1059
  * applied to every item in the batch - a batch is one worker's
932
- * report. When supplied, an item is requeued/failed only if this
933
- * worker still holds its lock; items held by a peer are reported
934
- * as an error and left untouched. Omit for the legacy unchecked
935
- * behavior.
1060
+ * report. When supplied, an item this worker no longer holds
1061
+ * comes back with status `error` and the job is left untouched,
1062
+ * and repeating this worker's last report on an item changes
1063
+ * nothing. Without it, an item a worker holds a live lock on, or
1064
+ * one that already ended, comes back with status `error`.
936
1065
  *
937
1066
  */
938
1067
  clientID?: string;
@@ -947,7 +1076,7 @@ export class BpmnService {
947
1076
  retryable?: boolean;
948
1077
  items: Array<{
949
1078
  executionKey: string;
950
- workflowID: string;
1079
+ instanceID: string;
951
1080
  errorCode: string;
952
1081
  variables?: Record<string, any>;
953
1082
  }>;
@@ -966,31 +1095,41 @@ export class BpmnService {
966
1095
  /**
967
1096
  * List User Tasks
968
1097
  * Paginated list of user tasks for the project, optionally filtered by
969
- * workflow, status, assignee, candidate user or candidate group.
1098
+ * instance, status, assignee, candidate user, candidate group or due date.
970
1099
  * Requires Executor role on the project.
971
1100
  *
972
1101
  * @param projectId
973
- * @param workflowId
1102
+ * @param instanceId Only this instance's tasks. A test run's tasks list only by its instance.
974
1103
  * @param status
975
1104
  * @param assignee
976
1105
  * @param candidateUser
977
1106
  * @param candidateGroup
978
1107
  * @param businessId Exact-match filter on the caller-supplied correlation key.
979
- * @param page
980
- * @param pageSize
1108
+ * @param dueAfter Only tasks due at or after this time.
1109
+ * @param dueBefore Only tasks due before this time. With `status=CREATED` and the current time, the overdue tasks.
1110
+ * @param sort `created` lists the newest first, and is the default. `dueDate` lists
1111
+ * the soonest due first and tasks without a due date last. `priority`
1112
+ * lists the highest priority first. Both list the oldest first among
1113
+ * equals. A cursor continues only a list of the same sort.
1114
+ *
1115
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
1116
+ * @param limit Most tasks per page, 20 by default and 100 at most.
981
1117
  * @returns BpmnUserTaskPaginatedResponse OK
982
1118
  * @throws ApiError
983
1119
  */
984
1120
  public listBpmnUserTasks(
985
1121
  projectId: string,
986
- workflowId?: string,
1122
+ instanceId?: string,
987
1123
  status?: 'CREATED' | 'COMPLETED' | 'CANCELED' | 'FAILED',
988
1124
  assignee?: string,
989
1125
  candidateUser?: string,
990
1126
  candidateGroup?: string,
991
1127
  businessId?: string,
992
- page?: number,
993
- pageSize?: number,
1128
+ dueAfter?: string,
1129
+ dueBefore?: string,
1130
+ sort?: 'created' | 'dueDate' | 'priority',
1131
+ cursor?: string,
1132
+ limit?: number,
994
1133
  ): CancelablePromise<BpmnUserTaskPaginatedResponse> {
995
1134
  return this.httpRequest.request({
996
1135
  method: 'GET',
@@ -999,14 +1138,17 @@ export class BpmnService {
999
1138
  'projectID': projectId,
1000
1139
  },
1001
1140
  query: {
1002
- 'workflowID': workflowId,
1141
+ 'instanceID': instanceId,
1003
1142
  'status': status,
1004
1143
  'assignee': assignee,
1005
1144
  'candidateUser': candidateUser,
1006
1145
  'candidateGroup': candidateGroup,
1007
1146
  'businessId': businessId,
1008
- 'page': page,
1009
- 'pageSize': pageSize,
1147
+ 'dueAfter': dueAfter,
1148
+ 'dueBefore': dueBefore,
1149
+ 'sort': sort,
1150
+ 'cursor': cursor,
1151
+ 'limit': limit,
1010
1152
  },
1011
1153
  });
1012
1154
  }
@@ -1017,15 +1159,25 @@ export class BpmnService {
1017
1159
  * the caller's identity-provider groups. Requires Viewer role on the project.
1018
1160
  *
1019
1161
  * @param projectId
1020
- * @param page
1021
- * @param pageSize
1162
+ * @param dueAfter Only tasks due at or after this time.
1163
+ * @param dueBefore Only tasks due before this time. With the current time, the caller's overdue tasks.
1164
+ * @param sort `created` lists the newest first, and is the default. `dueDate` lists
1165
+ * the soonest due first and tasks without a due date last. `priority`
1166
+ * lists the highest priority first. Both list the oldest first among
1167
+ * equals. A cursor continues only a list of the same sort.
1168
+ *
1169
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
1170
+ * @param limit Most tasks per page, 20 by default and 100 at most.
1022
1171
  * @returns BpmnUserTaskPaginatedResponse OK
1023
1172
  * @throws ApiError
1024
1173
  */
1025
1174
  public listBpmnUserTasksForCaller(
1026
1175
  projectId: string,
1027
- page?: number,
1028
- pageSize?: number,
1176
+ dueAfter?: string,
1177
+ dueBefore?: string,
1178
+ sort?: 'created' | 'dueDate' | 'priority',
1179
+ cursor?: string,
1180
+ limit?: number,
1029
1181
  ): CancelablePromise<BpmnUserTaskPaginatedResponse> {
1030
1182
  return this.httpRequest.request({
1031
1183
  method: 'GET',
@@ -1034,8 +1186,11 @@ export class BpmnService {
1034
1186
  'projectID': projectId,
1035
1187
  },
1036
1188
  query: {
1037
- 'page': page,
1038
- 'pageSize': pageSize,
1189
+ 'dueAfter': dueAfter,
1190
+ 'dueBefore': dueBefore,
1191
+ 'sort': sort,
1192
+ 'cursor': cursor,
1193
+ 'limit': limit,
1039
1194
  },
1040
1195
  });
1041
1196
  }
@@ -1070,7 +1225,8 @@ export class BpmnService {
1070
1225
  }
1071
1226
  /**
1072
1227
  * Update User Task Assignment
1073
- * Reassign / change candidates on a CREATED user task. Returns 404 if the
1228
+ * Reassign / change candidates on a CREATED user task. Only the fields in
1229
+ * the body change. Returns 400 for a body with none of them, and 404 if the
1074
1230
  * task does not exist or is no longer in CREATED state. Requires Executor
1075
1231
  * role on the project.
1076
1232
  *
@@ -1095,6 +1251,7 @@ export class BpmnService {
1095
1251
  body: requestBody,
1096
1252
  mediaType: 'application/json',
1097
1253
  errors: {
1254
+ 400: `Bad Request`,
1098
1255
  404: `Not Found`,
1099
1256
  },
1100
1257
  });
@@ -1131,6 +1288,10 @@ export class BpmnService {
1131
1288
  errors: {
1132
1289
  403: `Forbidden - caller is not Executor and not assigned to the task`,
1133
1290
  404: `User task not found`,
1291
+ 409: `The task is no longer open: it was already completed or failed,
1292
+ possibly by another user a moment earlier, or it was cancelled.
1293
+ Nothing was applied.
1294
+ `,
1134
1295
  },
1135
1296
  });
1136
1297
  }
@@ -1166,6 +1327,10 @@ export class BpmnService {
1166
1327
  errors: {
1167
1328
  403: `Forbidden - caller is not Executor and not assigned to the task`,
1168
1329
  404: `User task not found`,
1330
+ 409: `The task is no longer open: it was already completed or failed,
1331
+ possibly by another user a moment earlier, or it was cancelled.
1332
+ Nothing was applied.
1333
+ `,
1169
1334
  },
1170
1335
  });
1171
1336
  }
@@ -1173,7 +1338,7 @@ export class BpmnService {
1173
1338
  * Publish a BPMN message
1174
1339
  * Publishes a message into the project. Each message is delivered to at
1175
1340
  * most one waiting catch event whose subscription matches `messageName`
1176
- * and whose correlation keys are a subset of `correlationKeys`. If no
1341
+ * and whose correlation value equals `correlationKeys`. If no
1177
1342
  * subscriber is currently waiting the message is buffered up to its TTL
1178
1343
  * and delivered to the first matching subscriber that registers.
1179
1344
  *
@@ -1213,6 +1378,12 @@ export class BpmnService {
1213
1378
  },
1214
1379
  body: requestBody,
1215
1380
  mediaType: 'application/json',
1381
+ errors: {
1382
+ 400: `A message start event for \`messageName\` belongs to a suspended
1383
+ process definition, so the message would not start it. Nothing was
1384
+ published or buffered. Publish again once the definition is resumed.
1385
+ `,
1386
+ },
1216
1387
  });
1217
1388
  }
1218
1389
  /**
@@ -1258,6 +1429,12 @@ export class BpmnService {
1258
1429
  },
1259
1430
  body: requestBody,
1260
1431
  mediaType: 'application/json',
1432
+ errors: {
1433
+ 400: `A signal start event for \`signalName\` belongs to a suspended process
1434
+ definition, so the signal would not start it. Nothing was published
1435
+ or buffered. Publish again once the definition is resumed.
1436
+ `,
1437
+ },
1261
1438
  });
1262
1439
  }
1263
1440
  /**
@@ -1271,9 +1448,9 @@ export class BpmnService {
1271
1448
  * @param pageSize
1272
1449
  * @param q Optional case-insensitive substring match against process id or process name.
1273
1450
  * @param createdAfter Bounds the totalCount aggregate to instances created at or after this
1274
- * timestamp. Strongly recommended for monitoring views - instance
1275
- * history accumulates indefinitely and unfiltered totals scan the full
1276
- * table per definition. runningCount ignores this filter (it is always
1451
+ * timestamp. Strongly recommended for monitoring views - ended
1452
+ * instances stay until retention deletes them, and unfiltered totals
1453
+ * scan every kept instance per definition. runningCount ignores this filter (it is always
1277
1454
  * point-in-time).
1278
1455
  *
1279
1456
  * @param suspended Filter by paused versions. `true` → only processes with at least one
@@ -1358,4 +1535,44 @@ export class BpmnService {
1358
1535
  },
1359
1536
  });
1360
1537
  }
1538
+ /**
1539
+ * Get one deployed version of a BPMN process
1540
+ * Returns the single deployed version identified by (processID, version)
1541
+ * with its instance counts and suspension state, wherever it falls in the
1542
+ * pages of `ListBpmnProcessVersions`.
1543
+ *
1544
+ * @param projectId
1545
+ * @param processId
1546
+ * @param version
1547
+ * @param createdAfter Bounds the totalCount aggregate to instances created at or after this
1548
+ * timestamp. See ListBpmnProcesses for rationale. runningCount ignores
1549
+ * this filter.
1550
+ *
1551
+ * @returns BpmnProcessVersion OK
1552
+ * @throws ApiError
1553
+ */
1554
+ public getBpmnProcessVersion(
1555
+ projectId: string,
1556
+ processId: string,
1557
+ version: number,
1558
+ createdAfter?: string,
1559
+ ): CancelablePromise<BpmnProcessVersion> {
1560
+ return this.httpRequest.request({
1561
+ method: 'GET',
1562
+ url: '/projects/{projectID}/bpmn/processes/{processID}/versions/{version}',
1563
+ path: {
1564
+ 'projectID': projectId,
1565
+ 'processID': processId,
1566
+ 'version': version,
1567
+ },
1568
+ query: {
1569
+ 'createdAfter': createdAfter,
1570
+ },
1571
+ errors: {
1572
+ 401: `Unauthorized`,
1573
+ 404: `Not Found`,
1574
+ 500: `Internal Server Error`,
1575
+ },
1576
+ });
1577
+ }
1361
1578
  }