@quantumbpm/sdk 2.0.0 → 2.2.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.
- package/README.md +12 -2
- package/dist/bpmn.d.ts +7 -4
- package/dist/bpmn.js +8 -4
- package/dist/dmn.d.ts +14 -1
- package/dist/dmn.js +17 -2
- package/dist/generated/RawClient.js +2 -2
- package/dist/generated/core/OpenAPI.js +2 -2
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/index.js +4 -2
- package/dist/generated/models/DecisionKind.d.ts +10 -0
- package/dist/generated/models/DecisionKind.js +19 -0
- package/dist/generated/models/DecisionSummary.d.ts +6 -4
- package/dist/generated/models/DecisionSummary.js +1 -1
- package/dist/generated/models/Execution.d.ts +7 -0
- package/dist/generated/models/Execution.js +1 -1
- package/dist/generated/models/HitRule.d.ts +4 -0
- package/dist/generated/models/HitRule.js +1 -1
- package/dist/generated/models/PaginatedExecutionsResponse.d.ts +2 -2
- package/dist/generated/models/PaginatedExecutionsResponse.js +1 -1
- package/dist/generated/services/BpmnService.d.ts +8 -6
- package/dist/generated/services/BpmnService.js +12 -6
- package/dist/generated/services/DefaultService.d.ts +9 -6
- package/dist/generated/services/DefaultService.js +14 -9
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/bpmn.ts +7 -5
- package/src/dmn.ts +21 -1
- package/src/generated/RawClient.ts +1 -1
- package/src/generated/core/OpenAPI.ts +1 -1
- package/src/generated/index.ts +1 -1
- package/src/generated/models/DecisionKind.ts +14 -0
- package/src/generated/models/DecisionSummary.ts +6 -4
- package/src/generated/models/Execution.ts +7 -0
- package/src/generated/models/HitRule.ts +4 -0
- package/src/generated/models/PaginatedExecutionsResponse.ts +2 -2
- package/src/generated/services/BpmnService.ts +14 -6
- package/src/generated/services/DefaultService.ts +16 -9
- package/src/index.test.ts +31 -0
- package/src/index.ts +1 -1
- package/dist/generated/models/BpmnInstanceChildrenResponse.d.ts +0 -7
- package/dist/generated/models/BpmnInstanceChildrenResponse.js +0 -3
- package/src/generated/models/BpmnInstanceChildrenResponse.ts +0 -12
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { BpmnActivityState } from '../models/BpmnActivityState';
|
|
6
6
|
import type { BpmnHistoryPage } from '../models/BpmnHistoryPage';
|
|
7
7
|
import type { BpmnIncidentRecordPaginatedResponse } from '../models/BpmnIncidentRecordPaginatedResponse';
|
|
8
|
-
import type {
|
|
8
|
+
import type { BpmnInstancePaginatedResponse } from '../models/BpmnInstancePaginatedResponse';
|
|
9
9
|
import type { BpmnProcessSummaryPaginatedResponse } from '../models/BpmnProcessSummaryPaginatedResponse';
|
|
10
10
|
import type { BpmnProcessVersion } from '../models/BpmnProcessVersion';
|
|
11
11
|
import type { BpmnProcessVersionPaginatedResponse } from '../models/BpmnProcessVersionPaginatedResponse';
|
|
@@ -344,19 +344,23 @@ export class BpmnService {
|
|
|
344
344
|
}
|
|
345
345
|
/**
|
|
346
346
|
* List child instances of a BPMN instance
|
|
347
|
-
* Returns instances that this instance spawned via CallActivity elements
|
|
348
|
-
* Useful for navigating into a multi-level process hierarchy
|
|
349
|
-
* can be discovered via `parentInstanceID` on the child).
|
|
347
|
+
* Returns instances that this instance spawned via CallActivity elements,
|
|
348
|
+
* newest first. Useful for navigating into a multi-level process hierarchy
|
|
349
|
+
* (parents can be discovered via `parentInstanceID` on the child).
|
|
350
350
|
*
|
|
351
351
|
* @param projectId
|
|
352
352
|
* @param instanceId
|
|
353
|
-
* @
|
|
353
|
+
* @param cursor The `nextCursor` of the page before, absent for the first page.
|
|
354
|
+
* @param limit Most instances per page, 20 by default and 100 at most.
|
|
355
|
+
* @returns BpmnInstancePaginatedResponse OK
|
|
354
356
|
* @throws ApiError
|
|
355
357
|
*/
|
|
356
358
|
public getBpmnInstanceChildren(
|
|
357
359
|
projectId: string,
|
|
358
360
|
instanceId: string,
|
|
359
|
-
|
|
361
|
+
cursor?: string,
|
|
362
|
+
limit?: number,
|
|
363
|
+
): CancelablePromise<BpmnInstancePaginatedResponse> {
|
|
360
364
|
return this.httpRequest.request({
|
|
361
365
|
method: 'GET',
|
|
362
366
|
url: '/projects/{projectID}/bpmn/instances/{instanceID}/children',
|
|
@@ -364,6 +368,10 @@ export class BpmnService {
|
|
|
364
368
|
'projectID': projectId,
|
|
365
369
|
'instanceID': instanceId,
|
|
366
370
|
},
|
|
371
|
+
query: {
|
|
372
|
+
'cursor': cursor,
|
|
373
|
+
'limit': limit,
|
|
374
|
+
},
|
|
367
375
|
});
|
|
368
376
|
}
|
|
369
377
|
/**
|
|
@@ -468,9 +468,10 @@ export class DefaultService {
|
|
|
468
468
|
}
|
|
469
469
|
/**
|
|
470
470
|
* List decisions
|
|
471
|
-
* Returns one row per deployed decision
|
|
472
|
-
* version and with the definition that version
|
|
473
|
-
* picking a target
|
|
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.
|
|
474
475
|
*
|
|
475
476
|
* @param projectId
|
|
476
477
|
* @param page Page number (1-indexed)
|
|
@@ -538,10 +539,12 @@ export class DefaultService {
|
|
|
538
539
|
* @param projectId
|
|
539
540
|
* @param definitionsId Filter by DMN `<definitions id>` (XML id).
|
|
540
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`.
|
|
541
544
|
* @param businessId Exact-match filter on the caller-supplied correlation key.
|
|
542
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.
|
|
543
|
-
* @param page
|
|
544
|
-
* @param
|
|
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.
|
|
545
548
|
* @returns PaginatedExecutionsResponse OK
|
|
546
549
|
* @throws ApiError
|
|
547
550
|
*/
|
|
@@ -549,10 +552,12 @@ export class DefaultService {
|
|
|
549
552
|
projectId: string,
|
|
550
553
|
definitionsId?: string,
|
|
551
554
|
version?: number,
|
|
555
|
+
instanceId?: string,
|
|
556
|
+
executionKey?: string,
|
|
552
557
|
businessId?: string,
|
|
553
558
|
startDate?: string,
|
|
554
|
-
|
|
555
|
-
|
|
559
|
+
cursor?: string,
|
|
560
|
+
limit?: number,
|
|
556
561
|
): CancelablePromise<PaginatedExecutionsResponse> {
|
|
557
562
|
return this.httpRequest.request({
|
|
558
563
|
method: 'GET',
|
|
@@ -563,10 +568,12 @@ export class DefaultService {
|
|
|
563
568
|
query: {
|
|
564
569
|
'definitionsID': definitionsId,
|
|
565
570
|
'version': version,
|
|
571
|
+
'instanceID': instanceId,
|
|
572
|
+
'executionKey': executionKey,
|
|
566
573
|
'businessId': businessId,
|
|
567
574
|
'startDate': startDate,
|
|
568
|
-
'
|
|
569
|
-
'
|
|
575
|
+
'cursor': cursor,
|
|
576
|
+
'limit': limit,
|
|
570
577
|
},
|
|
571
578
|
errors: {
|
|
572
579
|
400: `Bad Request`,
|
package/src/index.test.ts
CHANGED
|
@@ -254,3 +254,34 @@ describe('DmnClient businessId threading', () => {
|
|
|
254
254
|
expect(bodies[0]?.businessId).toBe('ORDER-42');
|
|
255
255
|
});
|
|
256
256
|
});
|
|
257
|
+
|
|
258
|
+
describe('DmnClient definitions', () => {
|
|
259
|
+
test('createDefinition and deployDefinition call the project endpoints', async () => {
|
|
260
|
+
const calls: unknown[][] = [];
|
|
261
|
+
const draft = { id: 'def-uuid', isDeployed: false };
|
|
262
|
+
const deployed = { id: 'def-uuid', isDeployed: true, version: 3 };
|
|
263
|
+
const fakeRaw = {
|
|
264
|
+
default: {
|
|
265
|
+
createDefinition: (...args: unknown[]) => {
|
|
266
|
+
calls.push(['create', ...args]);
|
|
267
|
+
return Promise.resolve(draft);
|
|
268
|
+
},
|
|
269
|
+
deployDefinition: (...args: unknown[]) => {
|
|
270
|
+
calls.push(['deploy', ...args]);
|
|
271
|
+
return Promise.resolve(deployed);
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
} as never;
|
|
275
|
+
const projectId = '00000000-0000-0000-0000-000000000001';
|
|
276
|
+
const { DmnClient } = await import('./dmn');
|
|
277
|
+
const client = new DmnClient(fakeRaw, projectId);
|
|
278
|
+
|
|
279
|
+
expect(await client.createDefinition('rating.dmn', '<definitions/>')).toBe(draft);
|
|
280
|
+
expect(await client.deployDefinition('def-uuid')).toBe(deployed);
|
|
281
|
+
|
|
282
|
+
expect(calls).toEqual([
|
|
283
|
+
['create', projectId, { name: 'rating.dmn', xml: '<definitions/>' }],
|
|
284
|
+
['deploy', projectId, 'def-uuid'],
|
|
285
|
+
]);
|
|
286
|
+
});
|
|
287
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -94,6 +94,7 @@ export {
|
|
|
94
94
|
EvaluateOptions,
|
|
95
95
|
DesignOptions,
|
|
96
96
|
} from './dmn';
|
|
97
|
+
export type { Definition } from './dmn';
|
|
97
98
|
export {
|
|
98
99
|
BpmnClient,
|
|
99
100
|
PageOptions,
|
|
@@ -110,7 +111,6 @@ export type {
|
|
|
110
111
|
BpmnActivityState,
|
|
111
112
|
BpmnHistoryPage,
|
|
112
113
|
BpmnInstancePaginatedResponse,
|
|
113
|
-
BpmnInstanceChildrenResponse,
|
|
114
114
|
BpmnInstanceState,
|
|
115
115
|
BpmnProcessSummaryPaginatedResponse,
|
|
116
116
|
BpmnProcessVersion,
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQnBtbkluc3RhbmNlQ2hpbGRyZW5SZXNwb25zZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9nZW5lcmF0ZWQvbW9kZWxzL0JwbW5JbnN0YW5jZUNoaWxkcmVuUmVzcG9uc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qIGdlbmVyYXRlZCB1c2luZyBvcGVuYXBpLXR5cGVzY3JpcHQtY29kZWdlbiAtLSBkbyBub3QgZWRpdCAqL1xuLyogaXN0YW5idWwgaWdub3JlIGZpbGUgKi9cbi8qIHRzbGludDpkaXNhYmxlICovXG4vKiBlc2xpbnQtZGlzYWJsZSAqL1xuaW1wb3J0IHR5cGUgeyBCcG1uSW5zdGFuY2UgfSBmcm9tICcuL0JwbW5JbnN0YW5jZSc7XG4vKipcbiAqIENoaWxkIGluc3RhbmNlcyBzcGF3bmVkIGJ5IGEgcGFyZW50IGluc3RhbmNlIHZpYSBDYWxsQWN0aXZpdHkgZWxlbWVudHMuXG4gKi9cbmV4cG9ydCB0eXBlIEJwbW5JbnN0YW5jZUNoaWxkcmVuUmVzcG9uc2UgPSB7XG4gICAgY2hpbGRyZW46IEFycmF5PEJwbW5JbnN0YW5jZT47XG59O1xuXG4iXX0=
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
-
/* istanbul ignore file */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
import type { BpmnInstance } from './BpmnInstance';
|
|
6
|
-
/**
|
|
7
|
-
* Child instances spawned by a parent instance via CallActivity elements.
|
|
8
|
-
*/
|
|
9
|
-
export type BpmnInstanceChildrenResponse = {
|
|
10
|
-
children: Array<BpmnInstance>;
|
|
11
|
-
};
|
|
12
|
-
|