@quantumbpm/sdk 1.3.0 → 2.1.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 (140) hide show
  1. package/README.md +57 -34
  2. package/dist/auth.d.ts +19 -14
  3. package/dist/auth.js +62 -84
  4. package/dist/bpmn.d.ts +86 -23
  5. package/dist/bpmn.js +66 -34
  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 -3
  11. package/dist/generated/index.js +10 -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 +11 -17
  21. package/dist/generated/models/BpmnIncident.js +7 -11
  22. package/dist/generated/models/BpmnIncidentRecord.d.ts +7 -13
  23. package/dist/generated/models/BpmnIncidentRecord.js +4 -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 +14 -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 +31 -14
  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/CorrelationKeys.d.ts +7 -6
  41. package/dist/generated/models/CorrelationKeys.js +1 -1
  42. package/dist/generated/models/CreateDefinitionRequest.d.ts +1 -5
  43. package/dist/generated/models/CreateDefinitionRequest.js +1 -1
  44. package/dist/generated/models/CursorPage.d.ts +12 -0
  45. package/dist/generated/models/CursorPage.js +3 -0
  46. package/dist/generated/models/DecisionKind.d.ts +10 -0
  47. package/dist/generated/models/DecisionKind.js +19 -0
  48. package/dist/generated/models/DecisionSummary.d.ts +8 -6
  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 +4 -4
  57. package/dist/generated/models/Error.js +3 -3
  58. package/dist/generated/models/EvaluateStoredRequest.d.ts +5 -6
  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 +37 -9
  63. package/dist/generated/models/Execution.js +1 -1
  64. package/dist/generated/models/ExternalJob.d.ts +8 -8
  65. package/dist/generated/models/ExternalJob.js +1 -1
  66. package/dist/generated/models/HitRule.d.ts +4 -0
  67. package/dist/generated/models/HitRule.js +1 -1
  68. package/dist/generated/models/PaginatedExecutionsResponse.d.ts +2 -2
  69. package/dist/generated/models/PaginatedExecutionsResponse.js +1 -1
  70. package/dist/generated/models/StartBpmnInstanceRequest.d.ts +6 -2
  71. package/dist/generated/models/StartBpmnInstanceRequest.js +1 -1
  72. package/dist/generated/models/SuspendBpmnInstanceRequest.d.ts +1 -1
  73. package/dist/generated/models/SuspendBpmnInstanceRequest.js +1 -1
  74. package/dist/generated/models/UpdateDefinitionRequest.d.ts +1 -5
  75. package/dist/generated/models/UpdateDefinitionRequest.js +1 -1
  76. package/dist/generated/models/UserTask.d.ts +15 -11
  77. package/dist/generated/models/UserTask.js +1 -1
  78. package/dist/generated/services/BpmnService.d.ts +189 -91
  79. package/dist/generated/services/BpmnService.js +276 -124
  80. package/dist/generated/services/DefaultService.d.ts +111 -115
  81. package/dist/generated/services/DefaultService.js +136 -168
  82. package/dist/index.d.ts +8 -8
  83. package/dist/index.js +7 -7
  84. package/dist/tracing.js +2 -2
  85. package/dist/workers.d.ts +2 -2
  86. package/dist/workers.js +4 -3
  87. package/package.json +2 -4
  88. package/src/auth.test.ts +128 -0
  89. package/src/auth.ts +67 -64
  90. package/src/bpmn.ts +133 -46
  91. package/src/dmn.ts +0 -19
  92. package/src/generated/RawClient.ts +1 -1
  93. package/src/generated/core/OpenAPI.ts +1 -1
  94. package/src/generated/index.ts +9 -3
  95. package/src/generated/models/BpmnActivityState.ts +90 -0
  96. package/src/generated/models/BpmnElementStatistics.ts +41 -0
  97. package/src/generated/models/BpmnExternalJobPaginatedResponse.ts +2 -2
  98. package/src/generated/models/BpmnHistoryPage.ts +20 -0
  99. package/src/generated/models/BpmnIncident.ts +11 -17
  100. package/src/generated/models/BpmnIncidentRecord.ts +7 -13
  101. package/src/generated/models/BpmnIncidentRecordPaginatedResponse.ts +2 -2
  102. package/src/generated/models/BpmnInstance.ts +14 -29
  103. package/src/generated/models/BpmnInstancePaginatedResponse.ts +2 -2
  104. package/src/generated/models/BpmnInstanceState.ts +31 -14
  105. package/src/generated/models/BpmnInstanceStatus.ts +14 -0
  106. package/src/generated/models/BpmnProcessDefinition.ts +5 -5
  107. package/src/generated/models/BpmnProcessVersion.ts +9 -9
  108. package/src/generated/models/BpmnUserTaskPaginatedResponse.ts +2 -2
  109. package/src/generated/models/CorrelationKeys.ts +7 -6
  110. package/src/generated/models/CreateDefinitionRequest.ts +1 -5
  111. package/src/generated/models/CursorPage.ts +17 -0
  112. package/src/generated/models/DecisionKind.ts +14 -0
  113. package/src/generated/models/DecisionSummary.ts +8 -6
  114. package/src/generated/models/DecisionVersion.ts +30 -0
  115. package/src/generated/models/DecisionVersionList.ts +12 -0
  116. package/src/generated/models/Definition.ts +16 -8
  117. package/src/generated/models/Error.ts +4 -4
  118. package/src/generated/models/EvaluateStoredRequest.ts +5 -6
  119. package/src/generated/models/EvaluationResult.ts +6 -0
  120. package/src/generated/models/Execution.ts +37 -9
  121. package/src/generated/models/ExternalJob.ts +8 -8
  122. package/src/generated/models/HitRule.ts +4 -0
  123. package/src/generated/models/PaginatedExecutionsResponse.ts +2 -2
  124. package/src/generated/models/StartBpmnInstanceRequest.ts +6 -2
  125. package/src/generated/models/SuspendBpmnInstanceRequest.ts +1 -1
  126. package/src/generated/models/UpdateDefinitionRequest.ts +1 -5
  127. package/src/generated/models/UserTask.ts +15 -11
  128. package/src/generated/services/BpmnService.ts +333 -142
  129. package/src/generated/services/DefaultService.ts +160 -198
  130. package/src/index.test.ts +74 -31
  131. package/src/index.ts +13 -7
  132. package/src/tracing.ts +1 -1
  133. package/src/workers.test.ts +2 -3
  134. package/src/workers.ts +5 -4
  135. package/dist/generated/models/BpmnInstanceChildrenResponse.d.ts +0 -7
  136. package/dist/generated/models/BpmnInstanceChildrenResponse.js +0 -3
  137. package/dist/generated/models/CreateProjectRequest.d.ts +0 -9
  138. package/dist/generated/models/CreateProjectRequest.js +0 -3
  139. package/src/generated/models/BpmnInstanceChildrenResponse.ts +0 -12
  140. 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,101 @@ 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 or decision service in the
472
+ * project, at its latest version and with the definition that version
473
+ * came from. Useful for picking a target when wiring a BPMN
474
+ * BusinessRuleTask.
475
+ *
519
476
  * @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
477
  * @param page Page number (1-indexed)
525
478
  * @param pageSize Number of items per page (max 100)
526
- * @returns PaginatedExecutionsResponse OK
479
+ * @param q Optional case-insensitive substring match against decision name, decision id, or owning definition name.
480
+ * @returns PaginatedDecisionsResponse OK
527
481
  * @throws ApiError
528
482
  */
529
- public listExecutions(
483
+ public listDecisions(
530
484
  projectId: string,
531
- definitionId: string,
532
- definitionsId?: string,
533
- startDate?: string,
534
- businessId?: string,
535
485
  page: number = 1,
536
486
  pageSize: number = 20,
537
- ): CancelablePromise<PaginatedExecutionsResponse> {
487
+ q?: string,
488
+ ): CancelablePromise<PaginatedDecisionsResponse> {
538
489
  return this.httpRequest.request({
539
490
  method: 'GET',
540
- url: '/projects/{projectID}/dmn/definitions/{definitionID}/executions',
491
+ url: '/projects/{projectID}/dmn/decisions',
541
492
  path: {
542
493
  'projectID': projectId,
543
- 'definitionID': definitionId,
544
494
  },
545
495
  query: {
546
- 'definitionsID': definitionsId,
547
- 'startDate': startDate,
548
- 'businessId': businessId,
549
496
  'page': page,
550
497
  'pageSize': pageSize,
498
+ 'q': q,
551
499
  },
552
500
  errors: {
553
- 400: `Bad Request`,
554
- 404: `Not Found`,
555
501
  500: `Internal Server Error`,
556
502
  },
557
503
  });
558
504
  }
559
505
  /**
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.
506
+ * List a decision's deployed versions
507
+ * Returns every deployed version of a decision, the latest first, with
508
+ * the DMN definition version it came from. Decision versions count per
509
+ * decision id, and a BPMN BusinessRuleTask that binds a version names one
510
+ * of them.
564
511
  *
565
512
  * @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
513
+ * @param decisionId ID of the decision node from the DMN XML.
514
+ * @returns DecisionVersionList OK
570
515
  * @throws ApiError
571
516
  */
572
- public listDecisions(
517
+ public listDecisionVersions(
573
518
  projectId: string,
574
- page: number = 1,
575
- pageSize: number = 20,
576
- q?: string,
577
- ): CancelablePromise<PaginatedDecisionsResponse> {
519
+ decisionId: string,
520
+ ): CancelablePromise<DecisionVersionList> {
578
521
  return this.httpRequest.request({
579
522
  method: 'GET',
580
- url: '/projects/{projectID}/dmn/decisions',
523
+ url: '/projects/{projectID}/dmn/decisions/{decisionID}/versions',
581
524
  path: {
582
525
  'projectID': projectId,
583
- },
584
- query: {
585
- 'page': page,
586
- 'pageSize': pageSize,
587
- 'q': q,
526
+ 'decisionID': decisionId,
588
527
  },
589
528
  errors: {
590
529
  500: `Internal Server Error`,
@@ -593,23 +532,32 @@ export class DefaultService {
593
532
  }
594
533
  /**
595
534
  * List DMN executions across the project
596
- * Returns paginated execution history for the entire project, optionally filtered by DMN definition.
535
+ * Returns the project's recorded decision evaluations, newest first:
536
+ * those of `EvaluateByDefinitionsID` and of business rule tasks. A test
537
+ * run's evaluations are left out.
538
+ *
597
539
  * @param projectId
598
540
  * @param definitionsId Filter by DMN `<definitions id>` (XML id).
541
+ * @param version Only evaluations of this deployed version of `definitionsID`. Ignored without `definitionsID`.
542
+ * @param instanceId Only the evaluations of this process instance's business rule tasks.
543
+ * @param executionKey Only the evaluation of this business rule task execution, the `executionKey` of its entries in the instance history. Use it with `instanceID`.
599
544
  * @param businessId Exact-match filter on the caller-supplied correlation key.
600
545
  * @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
- * @param page Page number (1-indexed)
602
- * @param pageSize Number of items per page (max 100)
546
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
547
+ * @param limit Most executions per page, 20 by default and 100 at most.
603
548
  * @returns PaginatedExecutionsResponse OK
604
549
  * @throws ApiError
605
550
  */
606
551
  public listProjectExecutions(
607
552
  projectId: string,
608
553
  definitionsId?: string,
554
+ version?: number,
555
+ instanceId?: string,
556
+ executionKey?: string,
609
557
  businessId?: string,
610
558
  startDate?: string,
611
- page: number = 1,
612
- pageSize: number = 20,
559
+ cursor?: string,
560
+ limit?: number,
613
561
  ): CancelablePromise<PaginatedExecutionsResponse> {
614
562
  return this.httpRequest.request({
615
563
  method: 'GET',
@@ -619,10 +567,13 @@ export class DefaultService {
619
567
  },
620
568
  query: {
621
569
  'definitionsID': definitionsId,
570
+ 'version': version,
571
+ 'instanceID': instanceId,
572
+ 'executionKey': executionKey,
622
573
  'businessId': businessId,
623
574
  'startDate': startDate,
624
- 'page': page,
625
- 'pageSize': pageSize,
575
+ 'cursor': cursor,
576
+ 'limit': limit,
626
577
  },
627
578
  errors: {
628
579
  400: `Bad Request`,
@@ -633,7 +584,7 @@ export class DefaultService {
633
584
  }
634
585
  /**
635
586
  * Get a single DMN execution
636
- * Returns the inputs, outputs, and per-decision evaluation results for a single past execution.
587
+ * Returns the inputs and per-decision results of a single recorded evaluation.
637
588
  * @param projectId
638
589
  * @param executionId
639
590
  * @returns Execution OK
@@ -659,9 +610,8 @@ export class DefaultService {
659
610
  }
660
611
  /**
661
612
  * List BPMN instances
662
- * Returns paginated process instances in the project, optionally filtered by definition or status.
613
+ * Returns paginated process instances in the project, optionally filtered by process, version or status.
663
614
  * @param projectId
664
- * @param definitionId
665
615
  * @param status
666
616
  * @param hasIncident Filter by whether the instance has at least one unresolved incident.
667
617
  * Omit to return all instances regardless of incident status; pass
@@ -676,28 +626,33 @@ export class DefaultService {
676
626
  * at a time.
677
627
  *
678
628
  * @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
629
+ * recommended for monitoring views - ended instances stay until
630
+ * retention deletes them, and unfiltered queries grow linearly with
681
631
  * that history.
682
632
  *
683
633
  * @param businessId Prefix match on the caller-supplied correlation key set at start time.
684
- * @param processId Only instances of this process id, in any version. `definitionID` selects one version.
685
- * @param page
686
- * @param pageSize
634
+ * @param processId Only instances of this process id, in any version unless `version` names one.
635
+ * @param version Only instances of this version of `processId`. Ignored without `processId`.
636
+ * @param draft `true` keeps only test runs (see `StartBpmnTestInstance`), `false`
637
+ * leaves them out. Omit for both.
638
+ *
639
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
640
+ * @param limit Most instances per page, 20 by default and 100 at most.
687
641
  * @returns BpmnInstancePaginatedResponse OK
688
642
  * @throws ApiError
689
643
  */
690
644
  public listBpmnInstances(
691
645
  projectId: string,
692
- definitionId?: string,
693
- status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED' | 'TIMED_OUT',
646
+ status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED',
694
647
  hasIncident?: boolean,
695
648
  suspended?: boolean,
696
649
  createdAfter?: string,
697
650
  businessId?: string,
698
651
  processId?: string,
699
- page?: number,
700
- pageSize?: number,
652
+ version?: number,
653
+ draft?: boolean,
654
+ cursor?: string,
655
+ limit?: number,
701
656
  ): CancelablePromise<BpmnInstancePaginatedResponse> {
702
657
  return this.httpRequest.request({
703
658
  method: 'GET',
@@ -706,26 +661,29 @@ export class DefaultService {
706
661
  'projectID': projectId,
707
662
  },
708
663
  query: {
709
- 'definitionID': definitionId,
710
664
  'status': status,
711
665
  'hasIncident': hasIncident,
712
666
  'suspended': suspended,
713
667
  'createdAfter': createdAfter,
714
668
  'businessId': businessId,
715
669
  'processId': processId,
716
- 'page': page,
717
- 'pageSize': pageSize,
670
+ 'version': version,
671
+ 'draft': draft,
672
+ 'cursor': cursor,
673
+ 'limit': limit,
718
674
  },
719
675
  });
720
676
  }
721
677
  /**
722
678
  * Start a BPMN process instance
723
- * Starts a new instance of a deployed BPMN process. The returned
724
- * `workflowID` is the stable execution identifier - use it to fetch
725
- * state, send signals/messages, complete user tasks, etc.
679
+ * Starts a new instance of a deployed BPMN process, the latest version
680
+ * unless the request names one. The returned `instanceID` addresses the
681
+ * instance - use it to fetch state, send signals/messages, complete user
682
+ * tasks, etc.
726
683
  *
727
- * A process from a resource that is not deployed yet is refused with a
728
- * 400. Drafts only start test instances, see `StartBpmnTestInstance`.
684
+ * A process with no deployed version, or without the requested one,
685
+ * answers 404, also when it exists in a resource that is not deployed yet.
686
+ * Drafts only start test instances, see `StartBpmnTestInstance`.
729
687
  *
730
688
  * @param projectId
731
689
  * @param requestBody
@@ -737,9 +695,9 @@ export class DefaultService {
737
695
  requestBody: StartBpmnInstanceRequest,
738
696
  ): CancelablePromise<{
739
697
  /**
740
- * Stable execution identifier of the new instance.
698
+ * Identifier of the new instance.
741
699
  */
742
- workflowID?: string;
700
+ instanceID?: string;
743
701
  }> {
744
702
  return this.httpRequest.request({
745
703
  method: 'POST',
@@ -759,31 +717,28 @@ export class DefaultService {
759
717
  }
760
718
  /**
761
719
  * Get BPMN instance state
762
- * Returns the full runtime state of a process instance - current variables,
763
- * activity history, active scopes, and any unresolved incidents. Use this
764
- * to render dashboards or to drive operational decisions on a single
765
- * instance.
720
+ * Returns the runtime state of a process instance - current variables,
721
+ * active scopes, and any unresolved incidents. Its history is paged
722
+ * separately, see `GetBpmnInstanceHistory`.
766
723
  *
767
724
  * @param projectId
768
- * @param workflowId
725
+ * @param instanceId
769
726
  * @returns BpmnInstanceState OK
770
727
  * @throws ApiError
771
728
  */
772
729
  public getBpmnInstance(
773
730
  projectId: string,
774
- workflowId: string,
731
+ instanceId: string,
775
732
  ): CancelablePromise<BpmnInstanceState> {
776
733
  return this.httpRequest.request({
777
734
  method: 'GET',
778
- url: '/projects/{projectID}/bpmn/instances/{workflowID}',
735
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}',
779
736
  path: {
780
737
  'projectID': projectId,
781
- 'workflowID': workflowId,
738
+ 'instanceID': instanceId,
782
739
  },
783
740
  errors: {
784
- 503: `The instance is running but did not answer the state query, typically
785
- while Temporal retries a workflow task that timed out. Try again shortly.
786
- `,
741
+ 404: `Not Found`,
787
742
  },
788
743
  });
789
744
  }
@@ -793,47 +748,48 @@ export class DefaultService {
793
748
  * child instances. Cancellation is best-effort - handlers in flight may
794
749
  * still complete before the cancel propagates. Cancelled instances move
795
750
  * to status `CANCELED` and stop consuming further work.
751
+ * The cancel is recorded in the instance's history as a
752
+ * `CancelInstanceEvent` naming who cancelled it.
796
753
  *
797
754
  * @param projectId
798
- * @param workflowId
755
+ * @param instanceId
799
756
  * @returns void
800
757
  * @throws ApiError
801
758
  */
802
759
  public cancelBpmnInstance(
803
760
  projectId: string,
804
- workflowId: string,
761
+ instanceId: string,
805
762
  ): CancelablePromise<void> {
806
763
  return this.httpRequest.request({
807
764
  method: 'DELETE',
808
- url: '/projects/{projectID}/bpmn/instances/{workflowID}',
765
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}',
809
766
  path: {
810
767
  'projectID': projectId,
811
- 'workflowID': workflowId,
768
+ 'instanceID': instanceId,
812
769
  },
813
770
  errors: {
814
771
  400: `The instance is a call-activity child of a running instance. Cancel the root instance instead.`,
815
- 404: `No instance has this workflow ID.`,
772
+ 404: `No instance has this ID.`,
816
773
  },
817
774
  });
818
775
  }
819
776
  /**
820
777
  * List external jobs
821
778
  * Returns paginated external jobs in the project, with optional filters
822
- * by `taskType`, `status`, and originating instance. Use this to drive
823
- * a dashboard or to inspect a specific job's history. For pulling
824
- * pending work as a job worker, use `Poll` instead.
779
+ * by `taskType`, `status`, and originating instance. The list holds the
780
+ * pending jobs and the finished jobs of running instances. An instance's
781
+ * jobs leave the list when it ends, and its history keeps each job's task
782
+ * type, retries left and worker. For pulling pending work as a job
783
+ * worker, use `Poll` instead.
825
784
  *
826
785
  * @param projectId
827
786
  * @param taskType Filter jobs by task type
828
787
  * @param status Filter jobs by status
829
- * @param workflowId Filter jobs by workflow ID
788
+ * @param instanceId Only this instance's jobs. A test run's jobs list only by its instance.
830
789
  * @param businessId Prefix match on the caller-supplied correlation key.
831
- * @param createdAfter Only return jobs created at or after this timestamp. Strongly
832
- * recommended for monitoring views - completed-job records accumulate
833
- * indefinitely, and unfiltered queries grow linearly with that history.
834
- *
835
- * @param page
836
- * @param pageSize
790
+ * @param createdAfter Only return jobs created at or after this timestamp.
791
+ * @param cursor The `nextCursor` of the page before, absent for the first page.
792
+ * @param limit Most jobs per page, 20 by default and 100 at most.
837
793
  * @returns BpmnExternalJobPaginatedResponse OK
838
794
  * @throws ApiError
839
795
  */
@@ -841,11 +797,11 @@ export class DefaultService {
841
797
  projectId: string,
842
798
  taskType?: string,
843
799
  status?: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
844
- workflowId?: string,
800
+ instanceId?: string,
845
801
  businessId?: string,
846
802
  createdAfter?: string,
847
- page?: number,
848
- pageSize?: number,
803
+ cursor?: string,
804
+ limit?: number,
849
805
  ): CancelablePromise<BpmnExternalJobPaginatedResponse> {
850
806
  return this.httpRequest.request({
851
807
  method: 'GET',
@@ -856,11 +812,11 @@ export class DefaultService {
856
812
  query: {
857
813
  'taskType': taskType,
858
814
  'status': status,
859
- 'workflowID': workflowId,
815
+ 'instanceID': instanceId,
860
816
  'businessId': businessId,
861
817
  'createdAfter': createdAfter,
862
- 'page': page,
863
- 'pageSize': pageSize,
818
+ 'cursor': cursor,
819
+ 'limit': limit,
864
820
  },
865
821
  });
866
822
  }
@@ -870,7 +826,7 @@ export class DefaultService {
870
826
  * jobs (up to `maxJobs`) as soon as any are available, or `204 No Content`
871
827
  * when the timeout elapses with no work. Each returned job is locked to
872
828
  * the caller until `lockDuration` passes without a `Heartbeat`, and for at
873
- * most the server's `BPMN_JOB_MAX_HOLD` (30m by default) in total. Finish
829
+ * most the server's `ENGINE_JOB_MAX_HOLD` (30m by default) in total. Finish
874
830
  * with `Complete` or `ThrowError`. A lock that runs out costs the job a
875
831
  * retry, and with no retries left it raises an incident.
876
832
  *
@@ -899,7 +855,7 @@ export class DefaultService {
899
855
  /**
900
856
  * Extend the lock on an acquired job
901
857
  * Keeps the caller's lock on a job it acquired via `Poll` for another
902
- * `lockDuration`, up to `BPMN_JOB_MAX_HOLD` after the job was handed out.
858
+ * `lockDuration`, up to `ENGINE_JOB_MAX_HOLD` after the job was handed out.
903
859
  * SDK workers send it at half of the lock the poll granted
904
860
  * (`lockExpiresAt`) while a handler runs.
905
861
  * Other workers cannot claim the job while the lock holds.
@@ -932,7 +888,7 @@ export class DefaultService {
932
888
  mediaType: 'application/json',
933
889
  errors: {
934
890
  400: `An empty \`clientID\`, or a \`lockDuration\` that is not a Go duration.`,
935
- 404: `No job has this execution key.`,
891
+ 404: `No job has this execution key, or its instance has ended. Stop working on it.`,
936
892
  409: `This worker no longer holds the job. Its lock ran out, another
937
893
  worker holds it, or the job has finished. Stop working on it. The
938
894
  message says when the job was cancelled.
@@ -945,7 +901,9 @@ export class DefaultService {
945
901
  * Finalizes an acquired external job successfully. The supplied
946
902
  * `variables` are merged into the originating instance's scope and the
947
903
  * process resumes after the service task. Idempotent on the executionKey:
948
- * a second call with the same key after success is a no-op.
904
+ * a second call with the same key after success is a no-op. Once the
905
+ * instance has ended, any report on its jobs answers 200 and changes
906
+ * nothing.
949
907
  *
950
908
  * @param projectId
951
909
  * @param executionKey
@@ -958,15 +916,17 @@ export class DefaultService {
958
916
  executionKey: string,
959
917
  requestBody: {
960
918
  /**
961
- * Workflow ID returned by the poll response.
919
+ * Instance ID returned by the poll response.
962
920
  */
963
- workflowID: string;
921
+ instanceID: string;
964
922
  /**
965
923
  * Optional worker identity (the same `clientID` used to poll).
966
924
  * When supplied, a worker that no longer holds the job's lock
967
- * gets 409 and its result is discarded. Completing a job this
968
- * worker already completed answers 200 again. Omit for the
969
- * legacy unchecked behavior.
925
+ * gets 409 and its result is discarded. Repeating the report
926
+ * this worker last made on the job answers 200 again and changes
927
+ * nothing. Without it, the completion applies to an open job no
928
+ * worker holds a live lock on, as a completion from the console
929
+ * does.
970
930
  *
971
931
  */
972
932
  clientID?: string;
@@ -983,10 +943,12 @@ export class DefaultService {
983
943
  body: requestBody,
984
944
  mediaType: 'application/json',
985
945
  errors: {
986
- 404: `No job has this execution key.`,
987
- 409: `This worker no longer holds the job, so the result was discarded.
988
- Its lock ran out, another worker holds or completed it, or the job
989
- failed or was cancelled. The message says when it was cancelled.
946
+ 404: `The instance is running and has no job with this execution key.`,
947
+ 409: `The result was discarded. This worker no longer holds the job: its
948
+ lock ran out, another worker holds or completed it, or the job
949
+ failed or was cancelled. Without a \`clientID\`, a worker holds a live
950
+ lock on the job, named in the message, or the job already ended. The
951
+ message says when it was cancelled.
990
952
  `,
991
953
  },
992
954
  });