@rytass/bpm-core-client 0.22.0 → 0.24.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/CHANGELOG.md +68 -0
- package/package.json +2 -2
- package/src/lib/form/form-api.d.ts +5 -1
- package/src/lib/form/form-api.js +19 -4
- package/src/lib/form/form-api.js.map +1 -1
- package/src/lib/graphql-client.d.ts +10 -2
- package/src/lib/graphql-client.js +34 -3
- package/src/lib/graphql-client.js.map +1 -1
- package/src/lib/template/template-api.d.ts +23 -4
- package/src/lib/template/template-api.js +53 -4
- package/src/lib/template/template-api.js.map +1 -1
- package/src/lib/template/workflow-lint-errors.js +67 -24
- package/src/lib/template/workflow-lint-errors.js.map +1 -1
- package/src/lib/workflow/workflow-api.d.ts +63 -7
- package/src/lib/workflow/workflow-api.js +95 -12
- package/src/lib/workflow/workflow-api.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
|
+
## 0.24.0 (2026-11-14)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **bpm-core-client:** list stuck approval instances a page at a time ([9cdd7d49](https://github.com/Rytass/BPMCore/commit/9cdd7d49))
|
|
6
|
+
- **bpm-core:** page the stuck approval instance list ([6cd50975](https://github.com/Rytass/BPMCore/commit/6cd50975))
|
|
7
|
+
- **bpm-core-react:** mount the stuck approval instances page like the other admin pages ([fc19c298](https://github.com/Rytass/BPMCore/commit/fc19c298))
|
|
8
|
+
- **bpm-core:** let an administrator cancel an approval instance and tell its initiator ([03674ced](https://github.com/Rytass/BPMCore/commit/03674ced))
|
|
9
|
+
- let reassignMemberTasks take an optional list of task ids ([4b3c22a1](https://github.com/Rytass/BPMCore/commit/4b3c22a1))
|
|
10
|
+
- **bpm-core:** check a manager chain continuation at publish and translate its lint ([6662b051](https://github.com/Rytass/BPMCore/commit/6662b051))
|
|
11
|
+
|
|
12
|
+
### 🩹 Fixes
|
|
13
|
+
|
|
14
|
+
- **bpm-core:** tell the initiator of an administrator cancel only after it commits ([2fca97e7](https://github.com/Rytass/BPMCore/commit/2fca97e7))
|
|
15
|
+
- **bpm-core:** export the administrator cancel input like the other workflow inputs ([988981ae](https://github.com/Rytass/BPMCore/commit/988981ae))
|
|
16
|
+
|
|
17
|
+
### 🔥 Performance
|
|
18
|
+
|
|
19
|
+
- **workflow-engine:** index the ADVANCE_FAILED rows the stuck list reads ([2cf16d8d](https://github.com/Rytass/BPMCore/commit/2cf16d8d))
|
|
20
|
+
|
|
21
|
+
### ❤️ Thank You
|
|
22
|
+
|
|
23
|
+
- Chia Yu Pai @fantasywind
|
|
24
|
+
- Kai-Chieh Yang
|
|
25
|
+
|
|
26
|
+
## 0.23.0 (2026-11-14)
|
|
27
|
+
|
|
28
|
+
### 🚀 Features
|
|
29
|
+
|
|
30
|
+
- **form-data-source:** locate approver-fill VALUE_NOT_RESOLVED on its field or cell ([1a17907a](https://github.com/Rytass/BPMCore/commit/1a17907a))
|
|
31
|
+
- **bpm-core-client:** expose host error code on BPMGraphQLRequestError ([3a388721](https://github.com/Rytass/BPMCore/commit/3a388721))
|
|
32
|
+
- **bpm-core-react:** pass column-mode table access to approver fill ([c4fcb87d](https://github.com/Rytass/BPMCore/commit/c4fcb87d))
|
|
33
|
+
- **bpm-core-react:** add per-table access to form renderer ([98cd5208](https://github.com/Rytass/BPMCore/commit/98cd5208))
|
|
34
|
+
- **field-access:** reject publish when a table dependent column is not opened ([a4f64372](https://github.com/Rytass/BPMCore/commit/a4f64372))
|
|
35
|
+
- **field-access:** export dependency break helper for column fills ([d25212c6](https://github.com/Rytass/BPMCore/commit/d25212c6))
|
|
36
|
+
- **field-access:** lint per-column fill conflicts and approver data sources ([2d081bb2](https://github.com/Rytass/BPMCore/commit/2d081bb2))
|
|
37
|
+
- **field-access:** read per-column fill units for table fields ([996bffcc](https://github.com/Rytass/BPMCore/commit/996bffcc))
|
|
38
|
+
- **workflow-engine:** expose recordTaskAutoDecisionFailed on the engine token ([40d69180](https://github.com/Rytass/BPMCore/commit/40d69180))
|
|
39
|
+
- **instance-event:** expose admin list and retry resolvers ([4cbb84ac](https://github.com/Rytass/BPMCore/commit/4cbb84ac))
|
|
40
|
+
- **instance-event:** purge delivered rows past retention ([69d19f9a](https://github.com/Rytass/BPMCore/commit/69d19f9a))
|
|
41
|
+
- **instance-event:** schedule periodic delivery scans ([ac9b7dc3](https://github.com/Rytass/BPMCore/commit/ac9b7dc3))
|
|
42
|
+
- **instance-event:** deliver on commit via subscriber ([53641feb](https://github.com/Rytass/BPMCore/commit/53641feb))
|
|
43
|
+
- **instance-event:** add outbox delivery service ([b7ddcd3f](https://github.com/Rytass/BPMCore/commit/b7ddcd3f))
|
|
44
|
+
- **instance-event:** add outbox event writer ([fd891be4](https://github.com/Rytass/BPMCore/commit/fd891be4))
|
|
45
|
+
- **instance-event:** add lifecycle event outbox and observer wiring ([74dcdffd](https://github.com/Rytass/BPMCore/commit/74dcdffd))
|
|
46
|
+
- **workflow-engine:** add pre-decision host guard for submit, resubmit and decide ([8d450dd3](https://github.com/Rytass/BPMCore/commit/8d450dd3))
|
|
47
|
+
- **form:** add HOST_RULE issue reason with optional host code ([3d58779d](https://github.com/Rytass/BPMCore/commit/3d58779d))
|
|
48
|
+
- **template:** add key, hostManaged and launchMode to client SDK ([9b8e04fd](https://github.com/Rytass/BPMCore/commit/9b8e04fd))
|
|
49
|
+
- **form:** expose hostManaged and opt-in host filter in client ([1894240f](https://github.com/Rytass/BPMCore/commit/1894240f))
|
|
50
|
+
- **bpm-core-client:** drop the boolean REQUIRED lint message ([09123423](https://github.com/Rytass/BPMCore/commit/09123423))
|
|
51
|
+
- **instances:** filter approval instances by template key ([18d496c7](https://github.com/Rytass/BPMCore/commit/18d496c7))
|
|
52
|
+
- **conditions:** optionally read unfilled form fields as null ([958d3be6](https://github.com/Rytass/BPMCore/commit/958d3be6))
|
|
53
|
+
- **template:** add a HOST_ONLY launch mode to template versions ([d83db05e](https://github.com/Rytass/BPMCore/commit/d83db05e))
|
|
54
|
+
- **initiator:** let a host add customFields to the built snapshot ([609bc5ab](https://github.com/Rytass/BPMCore/commit/609bc5ab))
|
|
55
|
+
- **inbox:** filter inbox and approval history by template ([6870883a](https://github.com/Rytass/BPMCore/commit/6870883a))
|
|
56
|
+
- **migrations:** add the host integration round schema ([34eef9b2](https://github.com/Rytass/BPMCore/commit/34eef9b2))
|
|
57
|
+
|
|
58
|
+
### 🩹 Fixes
|
|
59
|
+
|
|
60
|
+
- **workflow-engine:** report only changed keys to the resubmit guard ([53d7bdb2](https://github.com/Rytass/BPMCore/commit/53d7bdb2))
|
|
61
|
+
- **workflow-lint:** translate the table dependent-column publish error ([2a2b72eb](https://github.com/Rytass/BPMCore/commit/2a2b72eb))
|
|
62
|
+
- **workflow-engine:** read grant units for summaries and keep whole-field writes ([2fa00549](https://github.com/Rytass/BPMCore/commit/2fa00549))
|
|
63
|
+
- **form:** select hostManaged in updateFormDefinition and readFormBuilder ([6563194c](https://github.com/Rytass/BPMCore/commit/6563194c))
|
|
64
|
+
|
|
65
|
+
### ❤️ Thank You
|
|
66
|
+
|
|
67
|
+
- Chia Yu Pai @fantasywind
|
|
68
|
+
|
|
1
69
|
## 0.22.0 (2026-11-13)
|
|
2
70
|
|
|
3
71
|
### 🚀 Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/bpm-core-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Framework-agnostic TypeScript client for the Rytass BPM approval workflow GraphQL surface: fetch-based GraphQL transport, REST auth client, pre-baked typed operations for organization, member, form, template, and workflow.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bpm",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@rytass/bpm-core-shared": "^0.
|
|
76
|
+
"@rytass/bpm-core-shared": "^0.24.0"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"tslib": "^2.8.1"
|
|
@@ -5,6 +5,8 @@ export interface FormDefinitionRecord {
|
|
|
5
5
|
readonly currentVersionNumber: number | null;
|
|
6
6
|
readonly currentVersionPublishedAt: string | null;
|
|
7
7
|
readonly description: string | null;
|
|
8
|
+
/** Read-only. Set by host code; forms with true are left out of lists by default. */
|
|
9
|
+
readonly hostManaged: boolean;
|
|
8
10
|
readonly id: string;
|
|
9
11
|
readonly name: string;
|
|
10
12
|
readonly updatedAt: string;
|
|
@@ -30,7 +32,9 @@ export interface FormSchemaLintResult {
|
|
|
30
32
|
readonly valid: boolean;
|
|
31
33
|
}
|
|
32
34
|
export declare function listFormDefinitions(): Promise<readonly FormDefinitionRecord[]>;
|
|
33
|
-
export declare function listFormDefinitionsPage({ page, pageSize, status, }: {
|
|
35
|
+
export declare function listFormDefinitionsPage({ includeHostManaged, page, pageSize, status, }: {
|
|
36
|
+
/** Pass true to include host-managed forms. Omitted by default, so the server keeps its exclusion. */
|
|
37
|
+
readonly includeHostManaged?: boolean;
|
|
34
38
|
readonly page: number;
|
|
35
39
|
readonly pageSize: number;
|
|
36
40
|
readonly status?: FormDefinitionListStatus | null;
|
package/src/lib/form/form-api.js
CHANGED
|
@@ -20,6 +20,7 @@ async function listFormDefinitions() {
|
|
|
20
20
|
currentVersionNumber
|
|
21
21
|
currentVersionPublishedAt
|
|
22
22
|
description
|
|
23
|
+
hostManaged
|
|
23
24
|
id
|
|
24
25
|
name
|
|
25
26
|
updatedAt
|
|
@@ -27,24 +28,36 @@ async function listFormDefinitions() {
|
|
|
27
28
|
}`);
|
|
28
29
|
return data.formDefinitions;
|
|
29
30
|
}
|
|
30
|
-
async function listFormDefinitionsPage({ page, pageSize, status, }) {
|
|
31
|
+
async function listFormDefinitionsPage({ includeHostManaged, page, pageSize, status, }) {
|
|
31
32
|
const data = await (0, graphql_client_1.requestGraphQl)(`query FormDefinitionsPage(
|
|
32
33
|
$page: Int!
|
|
33
34
|
$pageSize: Int!
|
|
34
35
|
$status: FormDefinitionListStatus
|
|
36
|
+
$includeHostManaged: Boolean
|
|
35
37
|
) {
|
|
36
|
-
formDefinitions(
|
|
38
|
+
formDefinitions(
|
|
39
|
+
page: $page
|
|
40
|
+
pageSize: $pageSize
|
|
41
|
+
status: $status
|
|
42
|
+
includeHostManaged: $includeHostManaged
|
|
43
|
+
) {
|
|
37
44
|
currentVersionCreatedAt
|
|
38
45
|
currentVersionId
|
|
39
46
|
currentVersionNumber
|
|
40
47
|
currentVersionPublishedAt
|
|
41
48
|
description
|
|
49
|
+
hostManaged
|
|
42
50
|
id
|
|
43
51
|
name
|
|
44
52
|
updatedAt
|
|
45
53
|
}
|
|
46
|
-
formDefinitionCount(status: $status)
|
|
47
|
-
}`, {
|
|
54
|
+
formDefinitionCount(status: $status, includeHostManaged: $includeHostManaged)
|
|
55
|
+
}`, {
|
|
56
|
+
page,
|
|
57
|
+
pageSize,
|
|
58
|
+
status: status ?? null,
|
|
59
|
+
...(includeHostManaged === true ? { includeHostManaged: true } : {}),
|
|
60
|
+
});
|
|
48
61
|
return {
|
|
49
62
|
forms: data.formDefinitions,
|
|
50
63
|
totalCount: data.formDefinitionCount,
|
|
@@ -74,6 +87,7 @@ async function updateFormDefinition(id, name) {
|
|
|
74
87
|
currentVersionNumber
|
|
75
88
|
currentVersionPublishedAt
|
|
76
89
|
description
|
|
90
|
+
hostManaged
|
|
77
91
|
id
|
|
78
92
|
name
|
|
79
93
|
updatedAt
|
|
@@ -95,6 +109,7 @@ async function readFormBuilder(formDefinitionId) {
|
|
|
95
109
|
currentVersionNumber
|
|
96
110
|
currentVersionPublishedAt
|
|
97
111
|
description
|
|
112
|
+
hostManaged
|
|
98
113
|
id
|
|
99
114
|
name
|
|
100
115
|
updatedAt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-api.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/form/form-api.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"form-api.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/form/form-api.ts"],"names":[],"mappings":";;AA0FA,kDAoBC;AAED,0DAoDC;AAED,oDAmBC;AAED,oDA4BC;AAED,0CAiCC;AAED,8DA2BC;AAED,oEAmBC;AAQD,oEA2BC;AAED,wCAoBC;AAED,sDAgDC;AAOD,kEAwBC;AAhbD,sDAAmD;AAoF5C,KAAK,UAAU,mBAAmB;IAGvC,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;;;;;;MAYE,CACH,CAAC;IAEF,OAAO,IAAI,CAAC,eAAe,CAAC;AAC9B,CAAC;AAEM,KAAK,UAAU,uBAAuB,CAAC,EAC5C,kBAAkB,EAClB,IAAI,EACJ,QAAQ,EACR,MAAM,GAOP;IAIC,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;;;;;;;;;;;;;;;;;MAuBE,EACF;QACE,IAAI;QACJ,QAAQ;QACR,MAAM,EAAE,MAAM,IAAI,IAAI;QACtB,GAAG,CAAC,kBAAkB,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CACF,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,eAAe;QAC3B,UAAU,EAAE,IAAI,CAAC,mBAAmB;KACrC,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,IAAY;IACrD,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;MAIE,EACF;QACE,KAAK,EAAE;YACL,iBAAiB,EAAE,IAAI;YACvB,WAAW,EAAE,IAAI;YACjB,IAAI;YACJ,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACnB;KACF,CACF,CAAC;IAEF,OAAO,IAAI,C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AE,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;QAC3D,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC;QAClD,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACvB,OAA0B;IAE1B,OAAO;QACL,GAAG,OAAO;QACV,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAyB;QAC9D,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAiB;KAC3D,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAC5B,IAAiC,EACjC,KAAa;IAEb,MAAM,MAAM,GAA0D;QACpE,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,MAAM;QACpB,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,MAAM;QAChB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,KAAK;KAChB,CAAC;IAEF,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -3,12 +3,20 @@ import { type FormDataIssue } from '@rytass/bpm-core-shared/form';
|
|
|
3
3
|
* A GraphQL operation the host refused. `message` is the host's message, as
|
|
4
4
|
* it has always been. `formDataIssues` lists the form values the host refused,
|
|
5
5
|
* one per value, with `path` addressing the field, row or cell; it is empty
|
|
6
|
-
* when the refusal was not about form data.
|
|
6
|
+
* when the refusal was not about form data. `code` is the host's stable error
|
|
7
|
+
* code (`extensions.originalError.code`), or `null`; `message` may be prose
|
|
8
|
+
* that changes, so callers that branch on a refusal read the code.
|
|
7
9
|
*/
|
|
8
10
|
export declare class BPMGraphQLRequestError extends Error {
|
|
11
|
+
readonly code: string | null;
|
|
9
12
|
readonly formDataIssues: readonly FormDataIssue[];
|
|
10
|
-
constructor(message: string, formDataIssues: readonly FormDataIssue[]);
|
|
13
|
+
constructor(message: string, formDataIssues: readonly FormDataIssue[], code?: string | null);
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* The stable error code a failed request carries, or `null` when it carries
|
|
17
|
+
* none. Duck-typed on `code`, like {@link readFormDataIssues}.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readRequestErrorCode(error: unknown): string | null;
|
|
12
20
|
/**
|
|
13
21
|
* The form data issues a failed request carries, or `[]` when it carries none.
|
|
14
22
|
* Duck-typed on `formDataIssues`, so an error from another copy of this
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BPMGraphQLRequestError = void 0;
|
|
4
|
+
exports.readRequestErrorCode = readRequestErrorCode;
|
|
4
5
|
exports.readFormDataIssues = readFormDataIssues;
|
|
5
6
|
exports.requestGraphQl = requestGraphQl;
|
|
6
7
|
exports.readGraphQlEndpoint = readGraphQlEndpoint;
|
|
@@ -13,16 +14,30 @@ const SAME_ORIGIN_GRAPHQL_ENDPOINT = '/graphql';
|
|
|
13
14
|
* A GraphQL operation the host refused. `message` is the host's message, as
|
|
14
15
|
* it has always been. `formDataIssues` lists the form values the host refused,
|
|
15
16
|
* one per value, with `path` addressing the field, row or cell; it is empty
|
|
16
|
-
* when the refusal was not about form data.
|
|
17
|
+
* when the refusal was not about form data. `code` is the host's stable error
|
|
18
|
+
* code (`extensions.originalError.code`), or `null`; `message` may be prose
|
|
19
|
+
* that changes, so callers that branch on a refusal read the code.
|
|
17
20
|
*/
|
|
18
21
|
class BPMGraphQLRequestError extends Error {
|
|
19
|
-
constructor(message, formDataIssues) {
|
|
22
|
+
constructor(message, formDataIssues, code = null) {
|
|
20
23
|
super(message);
|
|
21
24
|
this.name = 'BPMGraphQLRequestError';
|
|
25
|
+
this.code = code;
|
|
22
26
|
this.formDataIssues = formDataIssues;
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
exports.BPMGraphQLRequestError = BPMGraphQLRequestError;
|
|
30
|
+
/**
|
|
31
|
+
* The stable error code a failed request carries, or `null` when it carries
|
|
32
|
+
* none. Duck-typed on `code`, like {@link readFormDataIssues}.
|
|
33
|
+
*/
|
|
34
|
+
function readRequestErrorCode(error) {
|
|
35
|
+
if (typeof error !== 'object' || error === null) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const code = error.code;
|
|
39
|
+
return typeof code === 'string' && code.length > 0 ? code : null;
|
|
40
|
+
}
|
|
26
41
|
/**
|
|
27
42
|
* The form data issues a failed request carries, or `[]` when it carries none.
|
|
28
43
|
* Duck-typed on `formDataIssues`, so an error from another copy of this
|
|
@@ -56,6 +71,22 @@ function readGraphQlFormDataIssues(errors) {
|
|
|
56
71
|
});
|
|
57
72
|
return entries.every(form_1.isFormDataIssue) ? entries : [];
|
|
58
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* The host's `extensions.originalError.code` of the first error that carries
|
|
76
|
+
* one, or `null`.
|
|
77
|
+
*/
|
|
78
|
+
function readGraphQlErrorCode(errors) {
|
|
79
|
+
for (const error of errors) {
|
|
80
|
+
const original = error.extensions?.['originalError'];
|
|
81
|
+
const code = typeof original === 'object' && original !== null
|
|
82
|
+
? original['code']
|
|
83
|
+
: undefined;
|
|
84
|
+
if (typeof code === 'string' && code.length > 0) {
|
|
85
|
+
return code;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
59
90
|
/**
|
|
60
91
|
* Sends a single GraphQL operation to the BPM host and returns the typed data.
|
|
61
92
|
*
|
|
@@ -97,7 +128,7 @@ async function requestGraphQl(query, variables, options) {
|
|
|
97
128
|
}
|
|
98
129
|
const payload = (await response.json());
|
|
99
130
|
if (payload.errors?.length) {
|
|
100
|
-
throw new BPMGraphQLRequestError(payload.errors.map((error) => error.message).join('; '), readGraphQlFormDataIssues(payload.errors));
|
|
131
|
+
throw new BPMGraphQLRequestError(payload.errors.map((error) => error.message).join('; '), readGraphQlFormDataIssues(payload.errors), readGraphQlErrorCode(payload.errors));
|
|
101
132
|
}
|
|
102
133
|
if (!payload.data) {
|
|
103
134
|
throw new Error('GraphQL response did not include data');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../../../../libs/bpm-core-client/src/lib/graphql-client.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../../../../libs/bpm-core-client/src/lib/graphql-client.ts"],"names":[],"mappings":";;;AA8CA,oDAQC;AAOD,gDAaC;AAsFD,wCAiCC;AAYD,kDAYC;AAQD,sEAMC;AAvOD,uDAGsC;AACtC,mDAIyB;AAEzB,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAChE,MAAM,4BAA4B,GAAG,UAAU,CAAC;AAOhD;;;;;;;GAOG;AACH,MAAa,sBAAuB,SAAQ,KAAK;IAI/C,YACE,OAAe,EACf,cAAwC,EACxC,OAAsB,IAAI;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;CACF;AAdD,wDAcC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAI,KAAsC,CAAC,IAAI,CAAC;I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AAU,CAAC;QAClC,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC;AAC/C,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACzE,CAAC;AAED,SAAS,WAAW,CAAC,QAAuB;IAC1C,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,WAAW,CAAC;AAC9D,CAAC"}
|
|
@@ -6,11 +6,14 @@ export interface ApprovalTemplateRecord {
|
|
|
6
6
|
readonly categoryId: string | null;
|
|
7
7
|
readonly currentVersionId: string | null;
|
|
8
8
|
readonly description: string | null;
|
|
9
|
+
readonly hostManaged: boolean;
|
|
9
10
|
readonly id: string;
|
|
10
11
|
readonly isActive: boolean;
|
|
12
|
+
readonly key: string | null;
|
|
11
13
|
readonly name: string;
|
|
12
14
|
readonly updatedAt: string;
|
|
13
15
|
}
|
|
16
|
+
export type ApprovalTemplateLaunchMode = 'HOST_ONLY' | 'OPEN';
|
|
14
17
|
export type ApprovalTemplateListStatus = 'DRAFT' | 'PUBLISHED';
|
|
15
18
|
export type ApprovalTemplateActivationStatus = 'ACTIVE' | 'ALL' | 'INACTIVE';
|
|
16
19
|
export type ApprovalTemplateCategoryStatus = 'ACTIVE' | 'ALL' | 'INACTIVE';
|
|
@@ -28,6 +31,7 @@ export interface ApprovalTemplateVersionRecord {
|
|
|
28
31
|
readonly formDefinitionVersionId: string | null;
|
|
29
32
|
readonly id: string;
|
|
30
33
|
readonly initiatorPolicyCel: string | null;
|
|
34
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
31
35
|
readonly notificationConfigJson: string | null;
|
|
32
36
|
readonly publishedAt: string | null;
|
|
33
37
|
readonly slaDefaultsJson: string | null;
|
|
@@ -107,14 +111,21 @@ export interface ComposeApprovalTemplateWithFormResult {
|
|
|
107
111
|
readonly templateVersion: ApprovalTemplateVersionRecord;
|
|
108
112
|
}
|
|
109
113
|
export declare function listApprovalTemplates(): Promise<readonly ApprovalTemplateRecord[]>;
|
|
110
|
-
export declare function listApprovalTemplatesPage({ activationStatus, page, pageSize, searchText, status, categoryId, }: {
|
|
114
|
+
export declare function listApprovalTemplatesPage({ activationStatus, includeHostManaged, page, pageSize, searchText, status, categoryId, }: {
|
|
111
115
|
readonly activationStatus?: ApprovalTemplateActivationStatus | null;
|
|
112
116
|
readonly categoryId?: string | null;
|
|
117
|
+
/** Opt-in. Only `true` sends the flag; the server default leaves host-managed templates out. */
|
|
118
|
+
readonly includeHostManaged?: boolean;
|
|
113
119
|
readonly page: number;
|
|
114
120
|
readonly pageSize: number;
|
|
115
121
|
readonly searchText?: string;
|
|
116
122
|
readonly status?: ApprovalTemplateListStatus | null;
|
|
117
123
|
}): Promise<ApprovalTemplatesPage>;
|
|
124
|
+
/**
|
|
125
|
+
* Looks up the live template holding a host key. Rejects when none matches.
|
|
126
|
+
* Host-managed templates are returned; this lookup is not filtered by includeHostManaged.
|
|
127
|
+
*/
|
|
128
|
+
export declare function getApprovalTemplateByKey(key: string): Promise<ApprovalTemplateRecord>;
|
|
118
129
|
export declare function listApprovalTemplateCategoriesPage({ page, pageSize, searchText, status, }: {
|
|
119
130
|
readonly page: number;
|
|
120
131
|
readonly pageSize: number;
|
|
@@ -145,34 +156,42 @@ export declare function readTemplateDesigner(templateId: string): Promise<Templa
|
|
|
145
156
|
export declare function searchPublishedFormVersionOptions(searchText: string): Promise<readonly PublishedFormVersionOption[]>;
|
|
146
157
|
export declare function resolveMemberOptions(memberIds: readonly string[]): Promise<readonly MemberProfileRecord[]>;
|
|
147
158
|
export declare function searchMemberOptions(searchText: string): Promise<readonly MemberProfileRecord[]>;
|
|
148
|
-
export declare function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorPolicyCel, versionId, workflowDefinition, }: {
|
|
159
|
+
export declare function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorPolicyCel, launchMode, versionId, workflowDefinition, }: {
|
|
149
160
|
readonly formDefinitionVersionId: string | null;
|
|
150
161
|
readonly initiatorPolicyCel: string | null;
|
|
162
|
+
/** Omitted when undefined so the stored launch mode is kept. */
|
|
163
|
+
readonly launchMode?: ApprovalTemplateLaunchMode;
|
|
151
164
|
readonly versionId: string;
|
|
152
165
|
readonly workflowDefinition: WorkflowDefinition;
|
|
153
166
|
}): Promise<ApprovalTemplateVersionRecord>;
|
|
154
167
|
export declare function forkApprovalTemplate(templateId: string): Promise<ApprovalTemplateVersionRecord>;
|
|
155
168
|
export declare function publishApprovalTemplateVersion(versionId: string): Promise<ApprovalTemplateVersionRecord>;
|
|
156
169
|
export declare function rollbackApprovalTemplateVersion(versionId: string): Promise<ApprovalTemplateVersionRecord>;
|
|
157
|
-
export declare function dryRunApprovalWorkflow({ formData, initiatorMemberId, initiatorMetadataSnapshot, workflowDefinition, }: {
|
|
170
|
+
export declare function dryRunApprovalWorkflow({ formData, formSchema, initiatorMemberId, initiatorMetadataSnapshot, workflowDefinition, }: {
|
|
158
171
|
readonly formData: Readonly<Record<string, unknown>>;
|
|
172
|
+
/** Omitted when undefined; the server then dry-runs without a form schema. */
|
|
173
|
+
readonly formSchema?: FormDefinitionSchema;
|
|
159
174
|
readonly initiatorMemberId: string;
|
|
160
175
|
readonly initiatorMetadataSnapshot: Readonly<Record<string, unknown>> | null;
|
|
161
176
|
readonly workflowDefinition: WorkflowDefinition;
|
|
162
177
|
}): Promise<WorkflowDryRunResultRecord>;
|
|
163
|
-
export declare function composeApprovalTemplateWithForm({ category, categoryId, formDefinitionId, formDescription, formName, initiatorPolicyCel, notificationConfig, publish, schema, slaDefaults, templateDescription, templateId, templateName, uiSchema, workflowDefinition, }: {
|
|
178
|
+
export declare function composeApprovalTemplateWithForm({ category, categoryId, formDefinitionId, formDescription, formName, initiatorPolicyCel, launchMode, notificationConfig, publish, schema, slaDefaults, templateDescription, templateId, templateKey, templateName, uiSchema, workflowDefinition, }: {
|
|
164
179
|
readonly category: string | null;
|
|
165
180
|
readonly categoryId: string | null;
|
|
166
181
|
readonly formDefinitionId: string | null;
|
|
167
182
|
readonly formDescription: string | null;
|
|
168
183
|
readonly formName: string;
|
|
169
184
|
readonly initiatorPolicyCel: string | null;
|
|
185
|
+
/** Omitted when undefined so the stored launch mode is kept. */
|
|
186
|
+
readonly launchMode?: ApprovalTemplateLaunchMode;
|
|
170
187
|
readonly notificationConfig: Readonly<Record<string, unknown>> | null;
|
|
171
188
|
readonly publish: boolean;
|
|
172
189
|
readonly schema: FormDefinitionSchema;
|
|
173
190
|
readonly slaDefaults: Readonly<Record<string, unknown>> | null;
|
|
174
191
|
readonly templateDescription: string | null;
|
|
175
192
|
readonly templateId: string | null;
|
|
193
|
+
/** Host key used to find the template when templateId is absent. Omitted when undefined. */
|
|
194
|
+
readonly templateKey?: string | null;
|
|
176
195
|
readonly templateName: string;
|
|
177
196
|
readonly uiSchema: FormUiSchema;
|
|
178
197
|
readonly workflowDefinition: WorkflowDefinition;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listApprovalTemplates = listApprovalTemplates;
|
|
4
4
|
exports.listApprovalTemplatesPage = listApprovalTemplatesPage;
|
|
5
|
+
exports.getApprovalTemplateByKey = getApprovalTemplateByKey;
|
|
5
6
|
exports.listApprovalTemplateCategoriesPage = listApprovalTemplateCategoriesPage;
|
|
6
7
|
exports.createApprovalTemplate = createApprovalTemplate;
|
|
7
8
|
exports.activateApprovalTemplate = activateApprovalTemplate;
|
|
@@ -32,15 +33,17 @@ async function listApprovalTemplates() {
|
|
|
32
33
|
}
|
|
33
34
|
currentVersionId
|
|
34
35
|
description
|
|
36
|
+
hostManaged
|
|
35
37
|
id
|
|
36
38
|
isActive
|
|
39
|
+
key
|
|
37
40
|
name
|
|
38
41
|
updatedAt
|
|
39
42
|
}
|
|
40
43
|
}`);
|
|
41
44
|
return data.approvalTemplates;
|
|
42
45
|
}
|
|
43
|
-
async function listApprovalTemplatesPage({ activationStatus, page, pageSize, searchText, status, categoryId, }) {
|
|
46
|
+
async function listApprovalTemplatesPage({ activationStatus, includeHostManaged, page, pageSize, searchText, status, categoryId, }) {
|
|
44
47
|
const data = await (0, graphql_client_1.requestGraphQl)(`query ApprovalTemplatesPage(
|
|
45
48
|
$activationStatus: ApprovalTemplateActivationStatus
|
|
46
49
|
$page: Int
|
|
@@ -48,10 +51,12 @@ async function listApprovalTemplatesPage({ activationStatus, page, pageSize, sea
|
|
|
48
51
|
$searchText: String
|
|
49
52
|
$status: ApprovalTemplateListStatus
|
|
50
53
|
$categoryId: String
|
|
54
|
+
$includeHostManaged: Boolean
|
|
51
55
|
) {
|
|
52
56
|
approvalTemplates(
|
|
53
57
|
activationStatus: $activationStatus
|
|
54
58
|
categoryId: $categoryId
|
|
59
|
+
includeHostManaged: $includeHostManaged
|
|
55
60
|
page: $page
|
|
56
61
|
pageSize: $pageSize
|
|
57
62
|
searchText: $searchText
|
|
@@ -66,14 +71,17 @@ async function listApprovalTemplatesPage({ activationStatus, page, pageSize, sea
|
|
|
66
71
|
}
|
|
67
72
|
currentVersionId
|
|
68
73
|
description
|
|
74
|
+
hostManaged
|
|
69
75
|
id
|
|
70
76
|
isActive
|
|
77
|
+
key
|
|
71
78
|
name
|
|
72
79
|
updatedAt
|
|
73
80
|
}
|
|
74
81
|
approvalTemplateCount(
|
|
75
82
|
activationStatus: $activationStatus
|
|
76
83
|
categoryId: $categoryId
|
|
84
|
+
includeHostManaged: $includeHostManaged
|
|
77
85
|
searchText: $searchText
|
|
78
86
|
status: $status
|
|
79
87
|
)
|
|
@@ -84,12 +92,39 @@ async function listApprovalTemplatesPage({ activationStatus, page, pageSize, sea
|
|
|
84
92
|
pageSize,
|
|
85
93
|
searchText,
|
|
86
94
|
status: status ?? null,
|
|
95
|
+
...(includeHostManaged === true ? { includeHostManaged: true } : {}),
|
|
87
96
|
});
|
|
88
97
|
return {
|
|
89
98
|
templates: data.approvalTemplates,
|
|
90
99
|
totalCount: data.approvalTemplateCount,
|
|
91
100
|
};
|
|
92
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Looks up the live template holding a host key. Rejects when none matches.
|
|
104
|
+
* Host-managed templates are returned; this lookup is not filtered by includeHostManaged.
|
|
105
|
+
*/
|
|
106
|
+
async function getApprovalTemplateByKey(key) {
|
|
107
|
+
const data = await (0, graphql_client_1.requestGraphQl)(`query ApprovalTemplateByKey($key: String!) {
|
|
108
|
+
approvalTemplateByKey(key: $key) {
|
|
109
|
+
category
|
|
110
|
+
categoryId
|
|
111
|
+
categoryDetail {
|
|
112
|
+
id
|
|
113
|
+
isActive
|
|
114
|
+
name
|
|
115
|
+
}
|
|
116
|
+
currentVersionId
|
|
117
|
+
description
|
|
118
|
+
hostManaged
|
|
119
|
+
id
|
|
120
|
+
isActive
|
|
121
|
+
key
|
|
122
|
+
name
|
|
123
|
+
updatedAt
|
|
124
|
+
}
|
|
125
|
+
}`, { key });
|
|
126
|
+
return data.approvalTemplateByKey;
|
|
127
|
+
}
|
|
93
128
|
async function listApprovalTemplateCategoriesPage({ page, pageSize, searchText, status, }) {
|
|
94
129
|
const data = await (0, graphql_client_1.requestGraphQl)(`query ApprovalTemplateCategoriesPage(
|
|
95
130
|
$page: Int
|
|
@@ -203,8 +238,10 @@ async function readTemplateDesigner(templateId) {
|
|
|
203
238
|
}
|
|
204
239
|
currentVersionId
|
|
205
240
|
description
|
|
241
|
+
hostManaged
|
|
206
242
|
id
|
|
207
243
|
isActive
|
|
244
|
+
key
|
|
208
245
|
name
|
|
209
246
|
updatedAt
|
|
210
247
|
}
|
|
@@ -213,6 +250,7 @@ async function readTemplateDesigner(templateId) {
|
|
|
213
250
|
formDefinitionVersionId
|
|
214
251
|
id
|
|
215
252
|
initiatorPolicyCel
|
|
253
|
+
launchMode
|
|
216
254
|
notificationConfigJson
|
|
217
255
|
publishedAt
|
|
218
256
|
slaDefaultsJson
|
|
@@ -292,13 +330,14 @@ async function searchMemberOptions(searchText) {
|
|
|
292
330
|
}`, { searchText });
|
|
293
331
|
return data.searchMembers;
|
|
294
332
|
}
|
|
295
|
-
async function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorPolicyCel, versionId, workflowDefinition, }) {
|
|
333
|
+
async function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorPolicyCel, launchMode, versionId, workflowDefinition, }) {
|
|
296
334
|
const data = await (0, graphql_client_1.requestGraphQl)(`mutation UpdateApprovalTemplateDraft($input: UpdateApprovalTemplateDraftInput!) {
|
|
297
335
|
updateApprovalTemplateDraft(input: $input) {
|
|
298
336
|
archivedAt
|
|
299
337
|
formDefinitionVersionId
|
|
300
338
|
id
|
|
301
339
|
initiatorPolicyCel
|
|
340
|
+
launchMode
|
|
302
341
|
notificationConfigJson
|
|
303
342
|
publishedAt
|
|
304
343
|
slaDefaultsJson
|
|
@@ -311,6 +350,7 @@ async function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorP
|
|
|
311
350
|
input: {
|
|
312
351
|
formDefinitionVersionId,
|
|
313
352
|
initiatorPolicyCel,
|
|
353
|
+
...(launchMode === undefined ? {} : { launchMode }),
|
|
314
354
|
notificationConfigJson: null,
|
|
315
355
|
slaDefaultsJson: null,
|
|
316
356
|
versionId,
|
|
@@ -326,6 +366,7 @@ async function forkApprovalTemplate(templateId) {
|
|
|
326
366
|
formDefinitionVersionId
|
|
327
367
|
id
|
|
328
368
|
initiatorPolicyCel
|
|
369
|
+
launchMode
|
|
329
370
|
notificationConfigJson
|
|
330
371
|
publishedAt
|
|
331
372
|
slaDefaultsJson
|
|
@@ -344,6 +385,7 @@ async function publishApprovalTemplateVersion(versionId) {
|
|
|
344
385
|
formDefinitionVersionId
|
|
345
386
|
id
|
|
346
387
|
initiatorPolicyCel
|
|
388
|
+
launchMode
|
|
347
389
|
notificationConfigJson
|
|
348
390
|
publishedAt
|
|
349
391
|
slaDefaultsJson
|
|
@@ -362,6 +404,7 @@ async function rollbackApprovalTemplateVersion(versionId) {
|
|
|
362
404
|
formDefinitionVersionId
|
|
363
405
|
id
|
|
364
406
|
initiatorPolicyCel
|
|
407
|
+
launchMode
|
|
365
408
|
notificationConfigJson
|
|
366
409
|
publishedAt
|
|
367
410
|
slaDefaultsJson
|
|
@@ -373,7 +416,7 @@ async function rollbackApprovalTemplateVersion(versionId) {
|
|
|
373
416
|
}`, { versionId });
|
|
374
417
|
return parseVersionJson(data.rollbackApprovalTemplateVersion);
|
|
375
418
|
}
|
|
376
|
-
async function dryRunApprovalWorkflow({ formData, initiatorMemberId, initiatorMetadataSnapshot, workflowDefinition, }) {
|
|
419
|
+
async function dryRunApprovalWorkflow({ formData, formSchema, initiatorMemberId, initiatorMetadataSnapshot, workflowDefinition, }) {
|
|
377
420
|
const data = await (0, graphql_client_1.requestGraphQl)(`mutation DryRunApprovalWorkflow($input: DryRunApprovalWorkflowInput!) {
|
|
378
421
|
dryRunApprovalWorkflow(input: $input) {
|
|
379
422
|
errors
|
|
@@ -398,6 +441,9 @@ async function dryRunApprovalWorkflow({ formData, initiatorMemberId, initiatorMe
|
|
|
398
441
|
}`, {
|
|
399
442
|
input: {
|
|
400
443
|
formDataJson: JSON.stringify(formData),
|
|
444
|
+
...(formSchema === undefined
|
|
445
|
+
? {}
|
|
446
|
+
: { formSchemaJson: JSON.stringify(formSchema) }),
|
|
401
447
|
initiatorMemberId,
|
|
402
448
|
initiatorMetadataSnapshotJson: initiatorMetadataSnapshot
|
|
403
449
|
? JSON.stringify(initiatorMetadataSnapshot)
|
|
@@ -407,7 +453,7 @@ async function dryRunApprovalWorkflow({ formData, initiatorMemberId, initiatorMe
|
|
|
407
453
|
});
|
|
408
454
|
return data.dryRunApprovalWorkflow;
|
|
409
455
|
}
|
|
410
|
-
async function composeApprovalTemplateWithForm({ category, categoryId, formDefinitionId, formDescription, formName, initiatorPolicyCel, notificationConfig, publish, schema, slaDefaults, templateDescription, templateId, templateName, uiSchema, workflowDefinition, }) {
|
|
456
|
+
async function composeApprovalTemplateWithForm({ category, categoryId, formDefinitionId, formDescription, formName, initiatorPolicyCel, launchMode, notificationConfig, publish, schema, slaDefaults, templateDescription, templateId, templateKey, templateName, uiSchema, workflowDefinition, }) {
|
|
411
457
|
const data = await (0, graphql_client_1.requestGraphQl)(`mutation ComposeApprovalTemplateWithForm($input: ComposeApprovalTemplateWithFormInput!) {
|
|
412
458
|
composeApprovalTemplateWithForm(input: $input) {
|
|
413
459
|
formDefinition {
|
|
@@ -429,6 +475,7 @@ async function composeApprovalTemplateWithForm({ category, categoryId, formDefin
|
|
|
429
475
|
formDefinitionVersionId
|
|
430
476
|
id
|
|
431
477
|
initiatorPolicyCel
|
|
478
|
+
launchMode
|
|
432
479
|
notificationConfigJson
|
|
433
480
|
publishedAt
|
|
434
481
|
slaDefaultsJson
|
|
@@ -446,6 +493,7 @@ async function composeApprovalTemplateWithForm({ category, categoryId, formDefin
|
|
|
446
493
|
formDescription,
|
|
447
494
|
formName,
|
|
448
495
|
initiatorPolicyCel,
|
|
496
|
+
...(launchMode === undefined ? {} : { launchMode }),
|
|
449
497
|
notificationConfigJson: notificationConfig
|
|
450
498
|
? JSON.stringify(notificationConfig)
|
|
451
499
|
: null,
|
|
@@ -454,6 +502,7 @@ async function composeApprovalTemplateWithForm({ category, categoryId, formDefin
|
|
|
454
502
|
slaDefaultsJson: slaDefaults ? JSON.stringify(slaDefaults) : null,
|
|
455
503
|
templateDescription,
|
|
456
504
|
templateId,
|
|
505
|
+
...(templateKey === undefined ? {} : { templateKey }),
|
|
457
506
|
templateName,
|
|
458
507
|
uiSchemaJson: JSON.stringify(uiSchema),
|
|
459
508
|
workflowDefinitionJson: JSON.stringify(workflowDefinition),
|