@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
@@ -8,7 +8,7 @@ import type { BpmnExternalJobPaginatedResponse } from '../models/BpmnExternalJob
8
8
  import type { BpmnInstancePaginatedResponse } from '../models/BpmnInstancePaginatedResponse';
9
9
  import type { BpmnInstanceState } from '../models/BpmnInstanceState';
10
10
  import type { CreateDefinitionRequest } from '../models/CreateDefinitionRequest';
11
- import type { CreateProjectRequest } from '../models/CreateProjectRequest';
11
+ import type { DecisionVersionList } from '../models/DecisionVersionList';
12
12
  import type { Definition } from '../models/Definition';
13
13
  import type { ErrorMode } from '../models/ErrorMode';
14
14
  import type { EvaluateStoredRequest } from '../models/EvaluateStoredRequest';
@@ -34,8 +34,6 @@ export class DefaultService {
34
34
  */
35
35
  public getVersion(): CancelablePromise<{
36
36
  version?: string;
37
- buildTime?: string;
38
- commit?: string;
39
37
  }> {
40
38
  return this.httpRequest.request({
41
39
  method: 'GET',
@@ -112,7 +110,9 @@ export class DefaultService {
112
110
  }
113
111
  /**
114
112
  * List Projects
115
- * Lists projects the caller has access to within their account.
113
+ * Lists the projects the caller's token grants access to. Projects come
114
+ * from the deployment's provisioning file.
115
+ *
116
116
  * @returns Project OK
117
117
  * @throws ApiError
118
118
  */
@@ -125,31 +125,6 @@ export class DefaultService {
125
125
  },
126
126
  });
127
127
  }
128
- /**
129
- * Create Project
130
- * Creates a new project. Projects are workspaces that group DMN definitions
131
- * and BPMN processes for execution and access control. The caller is
132
- * automatically added as a project administrator.
133
- *
134
- * @param requestBody
135
- * @returns Project Created
136
- * @throws ApiError
137
- */
138
- public createProject(
139
- requestBody: CreateProjectRequest,
140
- ): CancelablePromise<Project> {
141
- return this.httpRequest.request({
142
- method: 'POST',
143
- url: '/projects',
144
- body: requestBody,
145
- mediaType: 'application/json',
146
- errors: {
147
- 400: `Bad Request`,
148
- 403: `Project quota for the caller's tier has been reached.`,
149
- 500: `Internal Server Error`,
150
- },
151
- });
152
- }
153
128
  /**
154
129
  * Get Project
155
130
  * Returns the project's metadata.
@@ -173,36 +148,9 @@ export class DefaultService {
173
148
  },
174
149
  });
175
150
  }
176
- /**
177
- * Delete Project
178
- * Permanently deletes a project and all of its data: DMN definitions and
179
- * executions, BPMN resources and instances, jobs, user tasks, messages,
180
- * signals, and members. Running BPMN instances are terminated. This
181
- * action cannot be undone.
182
- *
183
- * @param projectId Identifier of the project to delete.
184
- * @returns void
185
- * @throws ApiError
186
- */
187
- public deleteProject(
188
- projectId: string,
189
- ): CancelablePromise<void> {
190
- return this.httpRequest.request({
191
- method: 'DELETE',
192
- url: '/projects/{projectID}',
193
- path: {
194
- 'projectID': projectId,
195
- },
196
- errors: {
197
- 400: `Bad Request`,
198
- 404: `Not Found`,
199
- 500: `Internal Server Error`,
200
- },
201
- });
202
- }
203
151
  /**
204
152
  * List DMN definitions
205
- * Lists all definition versions in the project. Each call to `CreateDefinition` produces a new version.
153
+ * Lists every saved definition in the project, drafts and deployed, newest first.
206
154
  * @param projectId
207
155
  * @param page Page number (1-indexed)
208
156
  * @param pageSize Number of items per page (max 100)
@@ -233,9 +181,11 @@ export class DefaultService {
233
181
  }
234
182
  /**
235
183
  * Create a DMN definition
236
- * Stores a new DMN definition. Each call creates a new version
237
- * (auto-incremented). To replace an existing definition, post the new
238
- * XML with the same `definitionsID`.
184
+ * Saves a new draft. A draft is not evaluable until `DeployDefinition`
185
+ * deploys it. To change a deployed definition, save its new XML as
186
+ * another draft of the same `definitionsID` and deploy that. XML
187
+ * identical to the latest deployed version of its `definitionsID` is
188
+ * refused with 409, and nothing is saved.
239
189
  *
240
190
  * @param projectId
241
191
  * @param requestBody
@@ -257,13 +207,14 @@ export class DefaultService {
257
207
  errors: {
258
208
  400: `Bad Request`,
259
209
  404: `Not Found`,
210
+ 409: `Conflict`,
260
211
  500: `Internal Server Error`,
261
212
  },
262
213
  });
263
214
  }
264
215
  /**
265
216
  * List latest DMN definitions
266
- * Returns the most recent version of each unique definition. Use this for picking a definition to evaluate.
217
+ * Returns the newest saved definition of each `definitionsID`, draft or deployed.
267
218
  * @param projectId
268
219
  * @param page Page number (1-indexed)
269
220
  * @param pageSize Number of items per page (max 100)
@@ -294,13 +245,14 @@ export class DefaultService {
294
245
  }
295
246
  /**
296
247
  * Get a DMN definition by its DMN definitions id
297
- * Looks up a definition by the `id` attribute on the `<definitions>` root
298
- * element of the DMN XML, instead of by the platform-internal `id`.
299
- * Returns the latest version unless a specific version is requested.
248
+ * Looks up a deployed definition by the `id` attribute on the
249
+ * `<definitions>` root element of the DMN XML, instead of by the
250
+ * platform-internal `id`. Returns the latest deployed version unless
251
+ * `version` names one. A draft is not found this way.
300
252
  *
301
253
  * @param projectId
302
254
  * @param definitionsId Stable identifier from the DMN XML's outer `<definitions id="…">` attribute.
303
- * @param version Specific version number (defaults to latest version)
255
+ * @param version Deployed version, the latest when omitted.
304
256
  * @returns Definition OK
305
257
  * @throws ApiError
306
258
  */
@@ -327,7 +279,7 @@ export class DefaultService {
327
279
  }
328
280
  /**
329
281
  * List all versions of a DMN definition
330
- * Returns every stored version of a definition identified by its DMN `<definitions id>`, newest to oldest.
282
+ * Returns every saved definition of a DMN `<definitions id>`, drafts and deployed, newest first. A deployed one carries the version its deploy gave it.
331
283
  * @param projectId
332
284
  * @param definitionsId Stable identifier from the DMN XML's outer `<definitions id="…">` attribute.
333
285
  * @param page Page number (1-indexed)
@@ -361,15 +313,15 @@ export class DefaultService {
361
313
  }
362
314
  /**
363
315
  * Evaluate a DMN definition by its DMN definitions id
364
- * Evaluates a stored DMN definition addressed by its `<definitions id>`
365
- * XML attribute. Useful when callers know definitions by their DMN-level
366
- * identifier rather than the platform's internal `id`. Defaults to the
367
- * latest deployed version.
316
+ * Evaluates a deployed DMN definition addressed by its `<definitions id>`
317
+ * XML attribute, the latest deployed version unless `version` names one,
318
+ * and records the evaluation. A definition with no deployed version
319
+ * answers 404. Drafts evaluate through `EvaluateDesign`.
368
320
  *
369
321
  * @param projectId
370
322
  * @param definitionsId Stable identifier from the DMN XML's outer `<definitions id="…">` attribute.
371
323
  * @param requestBody
372
- * @param version Specific version number (defaults to latest version)
324
+ * @param version Deployed version, the latest when omitted.
373
325
  * @returns EvaluationResult OK
374
326
  * @throws ApiError
375
327
  */
@@ -426,7 +378,7 @@ export class DefaultService {
426
378
  }
427
379
  /**
428
380
  * Update a DMN definition version
429
- * Replaces the name and XML of a stored definition version in place. Send `version` 0 to store the change as the next version of the same definition instead.
381
+ * Replaces the name and XML of a draft. A deployed definition is read-only and answers 409, so save the change as a new draft instead.
430
382
  * @param projectId
431
383
  * @param definitionId
432
384
  * @param requestBody
@@ -450,13 +402,14 @@ export class DefaultService {
450
402
  errors: {
451
403
  400: `Bad Request`,
452
404
  404: `Not Found`,
405
+ 409: `Conflict`,
453
406
  500: `Internal Server Error`,
454
407
  },
455
408
  });
456
409
  }
457
410
  /**
458
411
  * Delete a DMN definition version
459
- * Permanently deletes a single definition version. Past executions of this version remain in history.
412
+ * Permanently deletes a draft. A deployed definition answers 409, since the engine keeps its version and evaluations.
460
413
  * @param projectId
461
414
  * @param definitionId
462
415
  * @returns void
@@ -476,115 +429,100 @@ export class DefaultService {
476
429
  errors: {
477
430
  400: `Bad Request`,
478
431
  404: `Not Found`,
432
+ 409: `Conflict`,
479
433
  500: `Internal Server Error`,
480
434
  },
481
435
  });
482
436
  }
483
437
  /**
484
- * Evaluate a stored DMN definition
485
- * Evaluates a stored DMN definition against the supplied context.
486
- * Each call is recorded in execution history and counts toward the
487
- * account's evaluation quota.
438
+ * Deploy a DMN definition
439
+ * Deploys a draft, which makes its decisions evaluable and callable from
440
+ * business rule tasks. Its document gets the next version of its
441
+ * `definitionsID`, and each decision the next version of its decision id.
442
+ * A draft identical to the latest deployed version is refused with 409. A
443
+ * deployed definition is read-only, and deploying it again answers 409.
488
444
  *
489
445
  * @param projectId
490
446
  * @param definitionId
491
- * @param requestBody
492
- * @returns EvaluationResult OK
447
+ * @returns Definition OK
493
448
  * @throws ApiError
494
449
  */
495
- public evaluateStored(
450
+ public deployDefinition(
496
451
  projectId: string,
497
452
  definitionId: string,
498
- requestBody: EvaluateStoredRequest,
499
- ): CancelablePromise<Record<string, EvaluationResult>> {
453
+ ): CancelablePromise<Definition> {
500
454
  return this.httpRequest.request({
501
455
  method: 'POST',
502
- url: '/projects/{projectID}/dmn/definitions/{definitionID}/evaluate',
456
+ url: '/projects/{projectID}/dmn/definitions/{definitionID}/deploy',
503
457
  path: {
504
458
  'projectID': projectId,
505
459
  'definitionID': definitionId,
506
460
  },
507
- body: requestBody,
508
- mediaType: 'application/json',
509
461
  errors: {
510
462
  400: `Bad Request`,
511
463
  404: `Not Found`,
464
+ 409: `Conflict`,
512
465
  500: `Internal Server Error`,
513
466
  },
514
467
  });
515
468
  }
516
469
  /**
517
- * List executions of a DMN definition
518
- * Returns paginated execution history for a single definition.
470
+ * List decisions
471
+ * Returns one row per deployed decision in the project, at its latest
472
+ * version and with the definition that version came from. Useful for
473
+ * picking a target decision when wiring a BPMN BusinessRuleTask.
474
+ *
519
475
  * @param projectId
520
- * @param definitionId
521
- * @param definitionsId Filter by DMN `<definitions id>` (XML id).
522
- * @param startDate Filter executions after this date (ISO 8601)
523
- * @param businessId Exact-match filter on the caller-supplied correlation key.
524
476
  * @param page Page number (1-indexed)
525
477
  * @param pageSize Number of items per page (max 100)
526
- * @returns PaginatedExecutionsResponse OK
478
+ * @param q Optional case-insensitive substring match against decision name, decision id, or owning definition name.
479
+ * @returns PaginatedDecisionsResponse OK
527
480
  * @throws ApiError
528
481
  */
529
- public listExecutions(
482
+ public listDecisions(
530
483
  projectId: string,
531
- definitionId: string,
532
- definitionsId?: string,
533
- startDate?: string,
534
- businessId?: string,
535
484
  page: number = 1,
536
485
  pageSize: number = 20,
537
- ): CancelablePromise<PaginatedExecutionsResponse> {
486
+ q?: string,
487
+ ): CancelablePromise<PaginatedDecisionsResponse> {
538
488
  return this.httpRequest.request({
539
489
  method: 'GET',
540
- url: '/projects/{projectID}/dmn/definitions/{definitionID}/executions',
490
+ url: '/projects/{projectID}/dmn/decisions',
541
491
  path: {
542
492
  'projectID': projectId,
543
- 'definitionID': definitionId,
544
493
  },
545
494
  query: {
546
- 'definitionsID': definitionsId,
547
- 'startDate': startDate,
548
- 'businessId': businessId,
549
495
  'page': page,
550
496
  'pageSize': pageSize,
497
+ 'q': q,
551
498
  },
552
499
  errors: {
553
- 400: `Bad Request`,
554
- 404: `Not Found`,
555
500
  500: `Internal Server Error`,
556
501
  },
557
502
  });
558
503
  }
559
504
  /**
560
- * List decisions
561
- * Returns one row per unique decision XML id in the project, with the
562
- * latest known version and the owning definition. Useful for picking
563
- * a target decision when wiring a BPMN BusinessRuleTask.
505
+ * List a decision's deployed versions
506
+ * Returns every deployed version of a decision, the latest first, with
507
+ * the DMN definition version it came from. Decision versions count per
508
+ * decision id, and a BPMN BusinessRuleTask that binds a version names one
509
+ * of them.
564
510
  *
565
511
  * @param projectId
566
- * @param page Page number (1-indexed)
567
- * @param pageSize Number of items per page (max 100)
568
- * @param q Optional case-insensitive substring match against decision name, decision id, or owning definition name.
569
- * @returns PaginatedDecisionsResponse OK
512
+ * @param decisionId ID of the decision node from the DMN XML.
513
+ * @returns DecisionVersionList OK
570
514
  * @throws ApiError
571
515
  */
572
- public listDecisions(
516
+ public listDecisionVersions(
573
517
  projectId: string,
574
- page: number = 1,
575
- pageSize: number = 20,
576
- q?: string,
577
- ): CancelablePromise<PaginatedDecisionsResponse> {
518
+ decisionId: string,
519
+ ): CancelablePromise<DecisionVersionList> {
578
520
  return this.httpRequest.request({
579
521
  method: 'GET',
580
- url: '/projects/{projectID}/dmn/decisions',
522
+ url: '/projects/{projectID}/dmn/decisions/{decisionID}/versions',
581
523
  path: {
582
524
  'projectID': projectId,
583
- },
584
- query: {
585
- 'page': page,
586
- 'pageSize': pageSize,
587
- 'q': q,
525
+ 'decisionID': decisionId,
588
526
  },
589
527
  errors: {
590
528
  500: `Internal Server Error`,
@@ -593,9 +531,13 @@ export class DefaultService {
593
531
  }
594
532
  /**
595
533
  * List DMN executions across the project
596
- * Returns paginated execution history for the entire project, optionally filtered by DMN definition.
534
+ * Returns the project's recorded decision evaluations, newest first:
535
+ * those of `EvaluateByDefinitionsID` and of business rule tasks. A test
536
+ * run's evaluations are left out.
537
+ *
597
538
  * @param projectId
598
539
  * @param definitionsId Filter by DMN `<definitions id>` (XML id).
540
+ * @param version Only evaluations of this deployed version of `definitionsID`. Ignored without `definitionsID`.
599
541
  * @param businessId Exact-match filter on the caller-supplied correlation key.
600
542
  * @param startDate Only return executions at or after this instant (ISO 8601). Bounds the scan and the reported total; omit for the full unbounded history.
601
543
  * @param page Page number (1-indexed)
@@ -606,6 +548,7 @@ export class DefaultService {
606
548
  public listProjectExecutions(
607
549
  projectId: string,
608
550
  definitionsId?: string,
551
+ version?: number,
609
552
  businessId?: string,
610
553
  startDate?: string,
611
554
  page: number = 1,
@@ -619,6 +562,7 @@ export class DefaultService {
619
562
  },
620
563
  query: {
621
564
  'definitionsID': definitionsId,
565
+ 'version': version,
622
566
  'businessId': businessId,
623
567
  'startDate': startDate,
624
568
  'page': page,
@@ -633,7 +577,7 @@ export class DefaultService {
633
577
  }
634
578
  /**
635
579
  * Get a single DMN execution
636
- * Returns the inputs, outputs, and per-decision evaluation results for a single past execution.
580
+ * Returns the inputs and per-decision results of a single recorded evaluation.
637
581
  * @param projectId
638
582
  * @param executionId
639
583
  * @returns Execution OK
@@ -659,9 +603,8 @@ export class DefaultService {
659
603
  }
660
604
  /**
661
605
  * List BPMN instances
662
- * Returns paginated process instances in the project, optionally filtered by definition or status.
606
+ * Returns paginated process instances in the project, optionally filtered by process, version or status.
663
607
  * @param projectId
664
- * @param definitionId
665
608
  * @param status
666
609
  * @param hasIncident Filter by whether the instance has at least one unresolved incident.
667
610
  * Omit to return all instances regardless of incident status; pass
@@ -676,26 +619,33 @@ export class DefaultService {
676
619
  * at a time.
677
620
  *
678
621
  * @param createdAfter Only return instances created at or after this timestamp. Strongly
679
- * recommended for monitoring views - terminal-state instance rows
680
- * accumulate indefinitely, and unfiltered queries grow linearly with
622
+ * recommended for monitoring views - ended instances stay until
623
+ * retention deletes them, and unfiltered queries grow linearly with
681
624
  * that history.
682
625
  *
683
- * @param businessId Exact-match filter on the caller-supplied correlation key set at start time.
684
- * @param page
685
- * @param pageSize
626
+ * @param businessId Prefix match on the caller-supplied correlation key set at start time.
627
+ * @param processId Only instances of this process id, in any version unless `version` names one.
628
+ * @param version Only instances of this version of `processId`. Ignored without `processId`.
629
+ * @param draft `true` keeps only test runs (see `StartBpmnTestInstance`), `false`
630
+ * leaves them out. Omit for both.
631
+ *
632
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
633
+ * @param limit Most instances per page, 20 by default and 100 at most.
686
634
  * @returns BpmnInstancePaginatedResponse OK
687
635
  * @throws ApiError
688
636
  */
689
637
  public listBpmnInstances(
690
638
  projectId: string,
691
- definitionId?: string,
692
- status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
639
+ status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED',
693
640
  hasIncident?: boolean,
694
641
  suspended?: boolean,
695
642
  createdAfter?: string,
696
643
  businessId?: string,
697
- page?: number,
698
- pageSize?: number,
644
+ processId?: string,
645
+ version?: number,
646
+ draft?: boolean,
647
+ cursor?: string,
648
+ limit?: number,
699
649
  ): CancelablePromise<BpmnInstancePaginatedResponse> {
700
650
  return this.httpRequest.request({
701
651
  method: 'GET',
@@ -704,22 +654,29 @@ export class DefaultService {
704
654
  'projectID': projectId,
705
655
  },
706
656
  query: {
707
- 'definitionID': definitionId,
708
657
  'status': status,
709
658
  'hasIncident': hasIncident,
710
659
  'suspended': suspended,
711
660
  'createdAfter': createdAfter,
712
661
  'businessId': businessId,
713
- 'page': page,
714
- 'pageSize': pageSize,
662
+ 'processId': processId,
663
+ 'version': version,
664
+ 'draft': draft,
665
+ 'cursor': cursor,
666
+ 'limit': limit,
715
667
  },
716
668
  });
717
669
  }
718
670
  /**
719
671
  * Start a BPMN process instance
720
- * Starts a new instance of a deployed BPMN process. The returned
721
- * `workflowID` is the stable execution identifier - use it to fetch
722
- * state, send signals/messages, complete user tasks, etc.
672
+ * Starts a new instance of a deployed BPMN process, the latest version
673
+ * unless the request names one. The returned `instanceID` addresses the
674
+ * instance - use it to fetch state, send signals/messages, complete user
675
+ * tasks, etc.
676
+ *
677
+ * A process with no deployed version, or without the requested one,
678
+ * answers 404, also when it exists in a resource that is not deployed yet.
679
+ * Drafts only start test instances, see `StartBpmnTestInstance`.
723
680
  *
724
681
  * @param projectId
725
682
  * @param requestBody
@@ -731,9 +688,9 @@ export class DefaultService {
731
688
  requestBody: StartBpmnInstanceRequest,
732
689
  ): CancelablePromise<{
733
690
  /**
734
- * Stable execution identifier of the new instance.
691
+ * Identifier of the new instance.
735
692
  */
736
- workflowID?: string;
693
+ instanceID?: string;
737
694
  }> {
738
695
  return this.httpRequest.request({
739
696
  method: 'POST',
@@ -746,32 +703,35 @@ export class DefaultService {
746
703
  errors: {
747
704
  400: `Bad Request`,
748
705
  401: `Unauthorized`,
706
+ 404: `Not Found`,
749
707
  500: `Internal Server Error`,
750
708
  },
751
709
  });
752
710
  }
753
711
  /**
754
712
  * Get BPMN instance state
755
- * Returns the full runtime state of a process instance - current variables,
756
- * activity history, active scopes, and any unresolved incidents. Use this
757
- * to render dashboards or to drive operational decisions on a single
758
- * instance.
713
+ * Returns the runtime state of a process instance - current variables,
714
+ * active scopes, and any unresolved incidents. Its history is paged
715
+ * separately, see `GetBpmnInstanceHistory`.
759
716
  *
760
717
  * @param projectId
761
- * @param workflowId
718
+ * @param instanceId
762
719
  * @returns BpmnInstanceState OK
763
720
  * @throws ApiError
764
721
  */
765
722
  public getBpmnInstance(
766
723
  projectId: string,
767
- workflowId: string,
724
+ instanceId: string,
768
725
  ): CancelablePromise<BpmnInstanceState> {
769
726
  return this.httpRequest.request({
770
727
  method: 'GET',
771
- url: '/projects/{projectID}/bpmn/instances/{workflowID}',
728
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}',
772
729
  path: {
773
730
  'projectID': projectId,
774
- 'workflowID': workflowId,
731
+ 'instanceID': instanceId,
732
+ },
733
+ errors: {
734
+ 404: `Not Found`,
775
735
  },
776
736
  });
777
737
  }
@@ -781,43 +741,48 @@ export class DefaultService {
781
741
  * child instances. Cancellation is best-effort - handlers in flight may
782
742
  * still complete before the cancel propagates. Cancelled instances move
783
743
  * to status `CANCELED` and stop consuming further work.
744
+ * The cancel is recorded in the instance's history as a
745
+ * `CancelInstanceEvent` naming who cancelled it.
784
746
  *
785
747
  * @param projectId
786
- * @param workflowId
748
+ * @param instanceId
787
749
  * @returns void
788
750
  * @throws ApiError
789
751
  */
790
752
  public cancelBpmnInstance(
791
753
  projectId: string,
792
- workflowId: string,
754
+ instanceId: string,
793
755
  ): CancelablePromise<void> {
794
756
  return this.httpRequest.request({
795
757
  method: 'DELETE',
796
- url: '/projects/{projectID}/bpmn/instances/{workflowID}',
758
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}',
797
759
  path: {
798
760
  'projectID': projectId,
799
- 'workflowID': workflowId,
761
+ 'instanceID': instanceId,
762
+ },
763
+ errors: {
764
+ 400: `The instance is a call-activity child of a running instance. Cancel the root instance instead.`,
765
+ 404: `No instance has this ID.`,
800
766
  },
801
767
  });
802
768
  }
803
769
  /**
804
770
  * List external jobs
805
771
  * Returns paginated external jobs in the project, with optional filters
806
- * by `taskType`, `status`, and originating instance. Use this to drive
807
- * a dashboard or to inspect a specific job's history. For pulling
808
- * pending work as a job worker, use `Poll` instead.
772
+ * by `taskType`, `status`, and originating instance. The list holds the
773
+ * pending jobs and the finished jobs of running instances. An instance's
774
+ * jobs leave the list when it ends, and its history keeps each job's task
775
+ * type, retries left and worker. For pulling pending work as a job
776
+ * worker, use `Poll` instead.
809
777
  *
810
778
  * @param projectId
811
779
  * @param taskType Filter jobs by task type
812
780
  * @param status Filter jobs by status
813
- * @param workflowId Filter jobs by workflow ID
814
- * @param businessId Exact-match filter on the caller-supplied correlation key.
815
- * @param createdAfter Only return jobs created at or after this timestamp. Strongly
816
- * recommended for monitoring views - completed-job records accumulate
817
- * indefinitely, and unfiltered queries grow linearly with that history.
818
- *
819
- * @param page
820
- * @param pageSize
781
+ * @param instanceId Only this instance's jobs. A test run's jobs list only by its instance.
782
+ * @param businessId Prefix match on the caller-supplied correlation key.
783
+ * @param createdAfter Only return jobs created at or after this timestamp.
784
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
785
+ * @param limit Most jobs per page, 20 by default and 100 at most.
821
786
  * @returns BpmnExternalJobPaginatedResponse OK
822
787
  * @throws ApiError
823
788
  */
@@ -825,11 +790,11 @@ export class DefaultService {
825
790
  projectId: string,
826
791
  taskType?: string,
827
792
  status?: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
828
- workflowId?: string,
793
+ instanceId?: string,
829
794
  businessId?: string,
830
795
  createdAfter?: string,
831
- page?: number,
832
- pageSize?: number,
796
+ cursor?: string,
797
+ limit?: number,
833
798
  ): CancelablePromise<BpmnExternalJobPaginatedResponse> {
834
799
  return this.httpRequest.request({
835
800
  method: 'GET',
@@ -840,11 +805,11 @@ export class DefaultService {
840
805
  query: {
841
806
  'taskType': taskType,
842
807
  'status': status,
843
- 'workflowID': workflowId,
808
+ 'instanceID': instanceId,
844
809
  'businessId': businessId,
845
810
  'createdAfter': createdAfter,
846
- 'page': page,
847
- 'pageSize': pageSize,
811
+ 'cursor': cursor,
812
+ 'limit': limit,
848
813
  },
849
814
  });
850
815
  }
@@ -852,9 +817,11 @@ export class DefaultService {
852
817
  * Poll for external jobs (long-poll)
853
818
  * Long-polls for PENDING jobs of a given `taskType`. Returns a batch of
854
819
  * jobs (up to `maxJobs`) as soon as any are available, or `204 No Content`
855
- * when the timeout elapses with no work. Each returned job is exclusively
856
- * leased to the caller for `lockDuration` - call `Heartbeat` to extend
857
- * the lock, then `Complete` or `ThrowError` to finalize.
820
+ * when the timeout elapses with no work. Each returned job is locked to
821
+ * the caller until `lockDuration` passes without a `Heartbeat`, and for at
822
+ * most the server's `ENGINE_JOB_MAX_HOLD` (30m by default) in total. Finish
823
+ * with `Complete` or `ThrowError`. A lock that runs out costs the job a
824
+ * retry, and with no retries left it raises an incident.
858
825
  *
859
826
  * @param projectId
860
827
  * @param requestBody
@@ -873,14 +840,18 @@ export class DefaultService {
873
840
  },
874
841
  body: requestBody,
875
842
  mediaType: 'application/json',
843
+ errors: {
844
+ 400: `An empty \`clientID\`, or a \`lockDuration\` or \`timeout\` that is not a Go duration.`,
845
+ },
876
846
  });
877
847
  }
878
848
  /**
879
849
  * Extend the lock on an acquired job
880
- * Refreshes the exclusive lock on a job that the caller previously
881
- * acquired via `Poll`. Call this periodically when handling a job that
882
- * takes longer than the original `lockDuration`. Other workers cannot
883
- * claim the job until the lock expires or the job is completed.
850
+ * Keeps the caller's lock on a job it acquired via `Poll` for another
851
+ * `lockDuration`, up to `ENGINE_JOB_MAX_HOLD` after the job was handed out.
852
+ * SDK workers send it at half of the lock the poll granted
853
+ * (`lockExpiresAt`) while a handler runs.
854
+ * Other workers cannot claim the job while the lock holds.
884
855
  *
885
856
  * @param projectId
886
857
  * @param executionKey
@@ -909,7 +880,12 @@ export class DefaultService {
909
880
  body: requestBody,
910
881
  mediaType: 'application/json',
911
882
  errors: {
912
- 404: `Job not found, not owned by this client, or already terminated`,
883
+ 400: `An empty \`clientID\`, or a \`lockDuration\` that is not a Go duration.`,
884
+ 404: `No job has this execution key, or its instance has ended. Stop working on it.`,
885
+ 409: `This worker no longer holds the job. Its lock ran out, another
886
+ worker holds it, or the job has finished. Stop working on it. The
887
+ message says when the job was cancelled.
888
+ `,
913
889
  },
914
890
  });
915
891
  }
@@ -918,7 +894,9 @@ export class DefaultService {
918
894
  * Finalizes an acquired external job successfully. The supplied
919
895
  * `variables` are merged into the originating instance's scope and the
920
896
  * process resumes after the service task. Idempotent on the executionKey:
921
- * a second call with the same key after success is a no-op.
897
+ * a second call with the same key after success is a no-op. Once the
898
+ * instance has ended, any report on its jobs answers 200 and changes
899
+ * nothing.
922
900
  *
923
901
  * @param projectId
924
902
  * @param executionKey
@@ -931,15 +909,17 @@ export class DefaultService {
931
909
  executionKey: string,
932
910
  requestBody: {
933
911
  /**
934
- * Workflow ID returned by the poll response.
912
+ * Instance ID returned by the poll response.
935
913
  */
936
- workflowID: string;
914
+ instanceID: string;
937
915
  /**
938
916
  * Optional worker identity (the same `clientID` used to poll).
939
- * When supplied, the completion is applied only if this worker
940
- * still holds the job's lock; a stale worker whose lease lapsed
941
- * and whose job a peer re-acquired is rejected as a no-op.
942
- * Omit for the legacy unchecked behavior.
917
+ * When supplied, a worker that no longer holds the job's lock
918
+ * gets 409 and its result is discarded. Repeating the report
919
+ * this worker last made on the job answers 200 again and changes
920
+ * nothing. Without it, the completion applies to an open job no
921
+ * worker holds a live lock on, as a completion from the console
922
+ * does.
943
923
  *
944
924
  */
945
925
  clientID?: string;
@@ -955,6 +935,15 @@ export class DefaultService {
955
935
  },
956
936
  body: requestBody,
957
937
  mediaType: 'application/json',
938
+ errors: {
939
+ 404: `The instance is running and has no job with this execution key.`,
940
+ 409: `The result was discarded. This worker no longer holds the job: its
941
+ lock ran out, another worker holds or completed it, or the job
942
+ failed or was cancelled. Without a \`clientID\`, a worker holds a live
943
+ lock on the job, named in the message, or the job already ended. The
944
+ message says when it was cancelled.
945
+ `,
946
+ },
958
947
  });
959
948
  }
960
949
  }