@quantumbpm/sdk 1.3.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 (128) 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 +81 -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 +8 -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 +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/DecisionSummary.d.ts +2 -2
  47. package/dist/generated/models/DecisionSummary.js +1 -1
  48. package/dist/generated/models/DecisionVersion.d.ts +25 -0
  49. package/dist/generated/models/DecisionVersion.js +3 -0
  50. package/dist/generated/models/DecisionVersionList.d.ts +7 -0
  51. package/dist/generated/models/DecisionVersionList.js +3 -0
  52. package/dist/generated/models/Definition.d.ts +16 -8
  53. package/dist/generated/models/Definition.js +1 -1
  54. package/dist/generated/models/Error.d.ts +4 -4
  55. package/dist/generated/models/Error.js +3 -3
  56. package/dist/generated/models/EvaluateStoredRequest.d.ts +5 -6
  57. package/dist/generated/models/EvaluateStoredRequest.js +1 -1
  58. package/dist/generated/models/EvaluationResult.d.ts +6 -0
  59. package/dist/generated/models/EvaluationResult.js +1 -1
  60. package/dist/generated/models/Execution.d.ts +30 -9
  61. package/dist/generated/models/Execution.js +1 -1
  62. package/dist/generated/models/ExternalJob.d.ts +8 -8
  63. package/dist/generated/models/ExternalJob.js +1 -1
  64. package/dist/generated/models/StartBpmnInstanceRequest.d.ts +6 -2
  65. package/dist/generated/models/StartBpmnInstanceRequest.js +1 -1
  66. package/dist/generated/models/SuspendBpmnInstanceRequest.d.ts +1 -1
  67. package/dist/generated/models/SuspendBpmnInstanceRequest.js +1 -1
  68. package/dist/generated/models/UpdateDefinitionRequest.d.ts +1 -5
  69. package/dist/generated/models/UpdateDefinitionRequest.js +1 -1
  70. package/dist/generated/models/UserTask.d.ts +15 -11
  71. package/dist/generated/models/UserTask.js +1 -1
  72. package/dist/generated/services/BpmnService.d.ts +183 -87
  73. package/dist/generated/services/BpmnService.js +267 -121
  74. package/dist/generated/services/DefaultService.d.ts +106 -113
  75. package/dist/generated/services/DefaultService.js +127 -164
  76. package/dist/index.d.ts +8 -8
  77. package/dist/index.js +7 -7
  78. package/dist/tracing.js +2 -2
  79. package/dist/workers.d.ts +2 -2
  80. package/dist/workers.js +4 -3
  81. package/package.json +2 -4
  82. package/src/auth.test.ts +128 -0
  83. package/src/auth.ts +67 -64
  84. package/src/bpmn.ts +128 -43
  85. package/src/dmn.ts +0 -19
  86. package/src/generated/RawClient.ts +1 -1
  87. package/src/generated/core/OpenAPI.ts +1 -1
  88. package/src/generated/index.ts +8 -2
  89. package/src/generated/models/BpmnActivityState.ts +90 -0
  90. package/src/generated/models/BpmnElementStatistics.ts +41 -0
  91. package/src/generated/models/BpmnExternalJobPaginatedResponse.ts +2 -2
  92. package/src/generated/models/BpmnHistoryPage.ts +20 -0
  93. package/src/generated/models/BpmnIncident.ts +11 -17
  94. package/src/generated/models/BpmnIncidentRecord.ts +7 -13
  95. package/src/generated/models/BpmnIncidentRecordPaginatedResponse.ts +2 -2
  96. package/src/generated/models/BpmnInstance.ts +14 -29
  97. package/src/generated/models/BpmnInstancePaginatedResponse.ts +2 -2
  98. package/src/generated/models/BpmnInstanceState.ts +31 -14
  99. package/src/generated/models/BpmnInstanceStatus.ts +14 -0
  100. package/src/generated/models/BpmnProcessDefinition.ts +5 -5
  101. package/src/generated/models/BpmnProcessVersion.ts +9 -9
  102. package/src/generated/models/BpmnUserTaskPaginatedResponse.ts +2 -2
  103. package/src/generated/models/CorrelationKeys.ts +7 -6
  104. package/src/generated/models/CreateDefinitionRequest.ts +1 -5
  105. package/src/generated/models/CursorPage.ts +17 -0
  106. package/src/generated/models/DecisionSummary.ts +2 -2
  107. package/src/generated/models/DecisionVersion.ts +30 -0
  108. package/src/generated/models/DecisionVersionList.ts +12 -0
  109. package/src/generated/models/Definition.ts +16 -8
  110. package/src/generated/models/Error.ts +4 -4
  111. package/src/generated/models/EvaluateStoredRequest.ts +5 -6
  112. package/src/generated/models/EvaluationResult.ts +6 -0
  113. package/src/generated/models/Execution.ts +30 -9
  114. package/src/generated/models/ExternalJob.ts +8 -8
  115. package/src/generated/models/StartBpmnInstanceRequest.ts +6 -2
  116. package/src/generated/models/SuspendBpmnInstanceRequest.ts +1 -1
  117. package/src/generated/models/UpdateDefinitionRequest.ts +1 -5
  118. package/src/generated/models/UserTask.ts +15 -11
  119. package/src/generated/services/BpmnService.ts +320 -137
  120. package/src/generated/services/DefaultService.ts +147 -192
  121. package/src/index.test.ts +74 -31
  122. package/src/index.ts +13 -6
  123. package/src/tracing.ts +1 -1
  124. package/src/workers.test.ts +2 -3
  125. package/src/workers.ts +5 -4
  126. package/dist/generated/models/CreateProjectRequest.d.ts +0 -9
  127. package/dist/generated/models/CreateProjectRequest.js +0 -3
  128. 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,28 +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
626
  * @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
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.
687
634
  * @returns BpmnInstancePaginatedResponse OK
688
635
  * @throws ApiError
689
636
  */
690
637
  public listBpmnInstances(
691
638
  projectId: string,
692
- definitionId?: string,
693
- status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED' | 'TIMED_OUT',
639
+ status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED',
694
640
  hasIncident?: boolean,
695
641
  suspended?: boolean,
696
642
  createdAfter?: string,
697
643
  businessId?: string,
698
644
  processId?: string,
699
- page?: number,
700
- pageSize?: number,
645
+ version?: number,
646
+ draft?: boolean,
647
+ cursor?: string,
648
+ limit?: number,
701
649
  ): CancelablePromise<BpmnInstancePaginatedResponse> {
702
650
  return this.httpRequest.request({
703
651
  method: 'GET',
@@ -706,26 +654,29 @@ export class DefaultService {
706
654
  'projectID': projectId,
707
655
  },
708
656
  query: {
709
- 'definitionID': definitionId,
710
657
  'status': status,
711
658
  'hasIncident': hasIncident,
712
659
  'suspended': suspended,
713
660
  'createdAfter': createdAfter,
714
661
  'businessId': businessId,
715
662
  'processId': processId,
716
- 'page': page,
717
- 'pageSize': pageSize,
663
+ 'version': version,
664
+ 'draft': draft,
665
+ 'cursor': cursor,
666
+ 'limit': limit,
718
667
  },
719
668
  });
720
669
  }
721
670
  /**
722
671
  * 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.
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.
726
676
  *
727
- * A process from a resource that is not deployed yet is refused with a
728
- * 400. Drafts only start test instances, see `StartBpmnTestInstance`.
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`.
729
680
  *
730
681
  * @param projectId
731
682
  * @param requestBody
@@ -737,9 +688,9 @@ export class DefaultService {
737
688
  requestBody: StartBpmnInstanceRequest,
738
689
  ): CancelablePromise<{
739
690
  /**
740
- * Stable execution identifier of the new instance.
691
+ * Identifier of the new instance.
741
692
  */
742
- workflowID?: string;
693
+ instanceID?: string;
743
694
  }> {
744
695
  return this.httpRequest.request({
745
696
  method: 'POST',
@@ -759,31 +710,28 @@ export class DefaultService {
759
710
  }
760
711
  /**
761
712
  * 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.
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`.
766
716
  *
767
717
  * @param projectId
768
- * @param workflowId
718
+ * @param instanceId
769
719
  * @returns BpmnInstanceState OK
770
720
  * @throws ApiError
771
721
  */
772
722
  public getBpmnInstance(
773
723
  projectId: string,
774
- workflowId: string,
724
+ instanceId: string,
775
725
  ): CancelablePromise<BpmnInstanceState> {
776
726
  return this.httpRequest.request({
777
727
  method: 'GET',
778
- url: '/projects/{projectID}/bpmn/instances/{workflowID}',
728
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}',
779
729
  path: {
780
730
  'projectID': projectId,
781
- 'workflowID': workflowId,
731
+ 'instanceID': instanceId,
782
732
  },
783
733
  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
- `,
734
+ 404: `Not Found`,
787
735
  },
788
736
  });
789
737
  }
@@ -793,47 +741,48 @@ export class DefaultService {
793
741
  * child instances. Cancellation is best-effort - handlers in flight may
794
742
  * still complete before the cancel propagates. Cancelled instances move
795
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.
796
746
  *
797
747
  * @param projectId
798
- * @param workflowId
748
+ * @param instanceId
799
749
  * @returns void
800
750
  * @throws ApiError
801
751
  */
802
752
  public cancelBpmnInstance(
803
753
  projectId: string,
804
- workflowId: string,
754
+ instanceId: string,
805
755
  ): CancelablePromise<void> {
806
756
  return this.httpRequest.request({
807
757
  method: 'DELETE',
808
- url: '/projects/{projectID}/bpmn/instances/{workflowID}',
758
+ url: '/projects/{projectID}/bpmn/instances/{instanceID}',
809
759
  path: {
810
760
  'projectID': projectId,
811
- 'workflowID': workflowId,
761
+ 'instanceID': instanceId,
812
762
  },
813
763
  errors: {
814
764
  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.`,
765
+ 404: `No instance has this ID.`,
816
766
  },
817
767
  });
818
768
  }
819
769
  /**
820
770
  * List external jobs
821
771
  * 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.
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.
825
777
  *
826
778
  * @param projectId
827
779
  * @param taskType Filter jobs by task type
828
780
  * @param status Filter jobs by status
829
- * @param workflowId Filter jobs by workflow ID
781
+ * @param instanceId Only this instance's jobs. A test run's jobs list only by its instance.
830
782
  * @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
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.
837
786
  * @returns BpmnExternalJobPaginatedResponse OK
838
787
  * @throws ApiError
839
788
  */
@@ -841,11 +790,11 @@ export class DefaultService {
841
790
  projectId: string,
842
791
  taskType?: string,
843
792
  status?: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
844
- workflowId?: string,
793
+ instanceId?: string,
845
794
  businessId?: string,
846
795
  createdAfter?: string,
847
- page?: number,
848
- pageSize?: number,
796
+ cursor?: string,
797
+ limit?: number,
849
798
  ): CancelablePromise<BpmnExternalJobPaginatedResponse> {
850
799
  return this.httpRequest.request({
851
800
  method: 'GET',
@@ -856,11 +805,11 @@ export class DefaultService {
856
805
  query: {
857
806
  'taskType': taskType,
858
807
  'status': status,
859
- 'workflowID': workflowId,
808
+ 'instanceID': instanceId,
860
809
  'businessId': businessId,
861
810
  'createdAfter': createdAfter,
862
- 'page': page,
863
- 'pageSize': pageSize,
811
+ 'cursor': cursor,
812
+ 'limit': limit,
864
813
  },
865
814
  });
866
815
  }
@@ -870,7 +819,7 @@ export class DefaultService {
870
819
  * jobs (up to `maxJobs`) as soon as any are available, or `204 No Content`
871
820
  * when the timeout elapses with no work. Each returned job is locked to
872
821
  * 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
822
+ * most the server's `ENGINE_JOB_MAX_HOLD` (30m by default) in total. Finish
874
823
  * with `Complete` or `ThrowError`. A lock that runs out costs the job a
875
824
  * retry, and with no retries left it raises an incident.
876
825
  *
@@ -899,7 +848,7 @@ export class DefaultService {
899
848
  /**
900
849
  * Extend the lock on an acquired job
901
850
  * 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.
851
+ * `lockDuration`, up to `ENGINE_JOB_MAX_HOLD` after the job was handed out.
903
852
  * SDK workers send it at half of the lock the poll granted
904
853
  * (`lockExpiresAt`) while a handler runs.
905
854
  * Other workers cannot claim the job while the lock holds.
@@ -932,7 +881,7 @@ export class DefaultService {
932
881
  mediaType: 'application/json',
933
882
  errors: {
934
883
  400: `An empty \`clientID\`, or a \`lockDuration\` that is not a Go duration.`,
935
- 404: `No job has this execution key.`,
884
+ 404: `No job has this execution key, or its instance has ended. Stop working on it.`,
936
885
  409: `This worker no longer holds the job. Its lock ran out, another
937
886
  worker holds it, or the job has finished. Stop working on it. The
938
887
  message says when the job was cancelled.
@@ -945,7 +894,9 @@ export class DefaultService {
945
894
  * Finalizes an acquired external job successfully. The supplied
946
895
  * `variables` are merged into the originating instance's scope and the
947
896
  * process resumes after the service task. Idempotent on the executionKey:
948
- * 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.
949
900
  *
950
901
  * @param projectId
951
902
  * @param executionKey
@@ -958,15 +909,17 @@ export class DefaultService {
958
909
  executionKey: string,
959
910
  requestBody: {
960
911
  /**
961
- * Workflow ID returned by the poll response.
912
+ * Instance ID returned by the poll response.
962
913
  */
963
- workflowID: string;
914
+ instanceID: string;
964
915
  /**
965
916
  * Optional worker identity (the same `clientID` used to poll).
966
917
  * 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.
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.
970
923
  *
971
924
  */
972
925
  clientID?: string;
@@ -983,10 +936,12 @@ export class DefaultService {
983
936
  body: requestBody,
984
937
  mediaType: 'application/json',
985
938
  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.
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.
990
945
  `,
991
946
  },
992
947
  });