@rytass/bpm-core-client 0.17.2 → 0.17.4
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 +28 -0
- package/package.json +2 -2
- package/src/lib/form/form-data-source-errors.d.ts +12 -9
- package/src/lib/form/form-data-source-errors.js +59 -18
- package/src/lib/form/form-data-source-errors.js.map +1 -1
- package/src/lib/template/index.d.ts +1 -0
- package/src/lib/template/index.js +1 -0
- package/src/lib/template/index.js.map +1 -1
- package/src/lib/template/workflow-lint-errors.d.ts +23 -0
- package/src/lib/template/workflow-lint-errors.js +201 -0
- package/src/lib/template/workflow-lint-errors.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## 0.17.4 (2026-10-19)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **form:** translate DataSource error copy per language ([787e7a3](https://github.com/Rytass/BPMCore/commit/787e7a3))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Chia Yu Pai @fantasywind
|
|
10
|
+
|
|
11
|
+
## 0.17.3 (2026-10-19)
|
|
12
|
+
|
|
13
|
+
### 🚀 Features
|
|
14
|
+
|
|
15
|
+
- **react:** add a BPM message language provider ([355b15c](https://github.com/Rytass/BPMCore/commit/355b15c))
|
|
16
|
+
- **template:** translate publish lint lines per language ([60fa7bc](https://github.com/Rytass/BPMCore/commit/60fa7bc))
|
|
17
|
+
- **client:** translate structural publish-lint lines into designer copy ([490339c](https://github.com/Rytass/BPMCore/commit/490339c))
|
|
18
|
+
|
|
19
|
+
### 🩹 Fixes
|
|
20
|
+
|
|
21
|
+
- **template:** address review of the lint translation ([26d7a54](https://github.com/Rytass/BPMCore/commit/26d7a54))
|
|
22
|
+
- **client:** cover blank node labels and never throw while translating lint ([0a8b3af](https://github.com/Rytass/BPMCore/commit/0a8b3af))
|
|
23
|
+
|
|
24
|
+
### ❤️ Thank You
|
|
25
|
+
|
|
26
|
+
- Chia Yu Pai @fantasywind
|
|
27
|
+
- Kai-Chieh Yang
|
|
28
|
+
|
|
1
29
|
## 0.17.2 (2026-10-18)
|
|
2
30
|
|
|
3
31
|
### 🚀 Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/bpm-core-client",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
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.17.
|
|
76
|
+
"@rytass/bpm-core-shared": "^0.17.4"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"tslib": "^2.8.1"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WorkflowLintLanguage } from '../template/workflow-lint-errors';
|
|
1
2
|
/**
|
|
2
3
|
* Stable error codes raised by the BPM form DataSource GraphQL surface.
|
|
3
4
|
*
|
|
@@ -15,16 +16,18 @@ export type FormDataSourceErrorCode = (typeof FORM_DATA_SOURCE_ERROR_CODES)[numb
|
|
|
15
16
|
*/
|
|
16
17
|
export declare function readFormDataSourceErrorCode(error: unknown): FormDataSourceErrorCode | null;
|
|
17
18
|
/**
|
|
18
|
-
* Maps a rejected request to display copy
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* rather than leaking the
|
|
19
|
+
* Maps a rejected request to display copy in `language` (Traditional Chinese
|
|
20
|
+
* by default). Returns `null` only when the failure is not a DataSource error
|
|
21
|
+
* at all, so callers can fall back to their own message; an unrecognised
|
|
22
|
+
* `FORM_DATA_SOURCE_*` code still yields readable copy rather than leaking the
|
|
23
|
+
* code itself.
|
|
22
24
|
*/
|
|
23
|
-
export declare function readFormDataSourceErrorMessage(error: unknown): string | null;
|
|
25
|
+
export declare function readFormDataSourceErrorMessage(error: unknown, language?: WorkflowLintLanguage): string | null;
|
|
24
26
|
/**
|
|
25
27
|
* Rewrites a publish-lint line such as
|
|
26
|
-
* `schema.fields[1].dataSource FORM_DATA_SOURCE_MISSING` into readable copy
|
|
27
|
-
* while keeping the field path that
|
|
28
|
-
* without a DataSource code are
|
|
28
|
+
* `schema.fields[1].dataSource FORM_DATA_SOURCE_MISSING` into readable copy in
|
|
29
|
+
* `language` (Traditional Chinese by default) while keeping the field path that
|
|
30
|
+
* tells the designer where to look. Lines without a DataSource code are
|
|
31
|
+
* returned unchanged.
|
|
29
32
|
*/
|
|
30
|
-
export declare function readFormSchemaLintMessage(error: string): string;
|
|
33
|
+
export declare function readFormSchemaLintMessage(error: string, language?: WorkflowLintLanguage): string;
|
|
@@ -4,6 +4,7 @@ exports.FORM_DATA_SOURCE_ERROR_CODES = void 0;
|
|
|
4
4
|
exports.readFormDataSourceErrorCode = readFormDataSourceErrorCode;
|
|
5
5
|
exports.readFormDataSourceErrorMessage = readFormDataSourceErrorMessage;
|
|
6
6
|
exports.readFormSchemaLintMessage = readFormSchemaLintMessage;
|
|
7
|
+
const workflow_lint_errors_1 = require("../template/workflow-lint-errors");
|
|
7
8
|
/**
|
|
8
9
|
* Stable error codes raised by the BPM form DataSource GraphQL surface.
|
|
9
10
|
*
|
|
@@ -30,7 +31,7 @@ exports.FORM_DATA_SOURCE_ERROR_CODES = [
|
|
|
30
31
|
'FORM_DATA_SOURCE_VERSION_MISSING',
|
|
31
32
|
'FORM_DATA_SOURCE_WAITING_FOR_DEPENDENCIES',
|
|
32
33
|
];
|
|
33
|
-
const
|
|
34
|
+
const ZH_ERROR_MESSAGES = {
|
|
34
35
|
FORM_DATA_SOURCE_FIELD_NOT_DYNAMIC: '此欄位不是動態選項欄位。',
|
|
35
36
|
FORM_DATA_SOURCE_INVALID_BINDING: '選項查詢條件不正確,請重新確認表單內容。',
|
|
36
37
|
FORM_DATA_SOURCE_INVALID_DESCRIPTOR: '選項來源設定不正確,請聯絡系統管理員。',
|
|
@@ -48,6 +49,28 @@ const ERROR_MESSAGES = {
|
|
|
48
49
|
FORM_DATA_SOURCE_VERSION_MISSING: '選項來源版本已不存在,請聯絡系統管理員。',
|
|
49
50
|
FORM_DATA_SOURCE_WAITING_FOR_DEPENDENCIES: '請先填寫相依欄位。',
|
|
50
51
|
};
|
|
52
|
+
const EN_ERROR_MESSAGES = {
|
|
53
|
+
FORM_DATA_SOURCE_FIELD_NOT_DYNAMIC: 'This field does not use dynamic options.',
|
|
54
|
+
FORM_DATA_SOURCE_INVALID_BINDING: 'The option query is not valid. Check the form content and try again.',
|
|
55
|
+
FORM_DATA_SOURCE_INVALID_DESCRIPTOR: 'The option source is not set up correctly. Contact your system administrator.',
|
|
56
|
+
FORM_DATA_SOURCE_INVALID_PROVIDER_RESULT: 'The option source returned invalid data. Contact your system administrator.',
|
|
57
|
+
FORM_DATA_SOURCE_MISSING: 'The option source no longer exists. Contact your system administrator.',
|
|
58
|
+
FORM_DATA_SOURCE_PARAMETER_LIMIT_EXCEEDED: 'The option query is too large. Shorten the form content.',
|
|
59
|
+
FORM_DATA_SOURCE_PROVIDER_FAILURE: 'The option source is not responding. Try again later.',
|
|
60
|
+
FORM_DATA_SOURCE_RESULT_LIMIT_EXCEEDED: 'There are more options than allowed. Narrow the search.',
|
|
61
|
+
FORM_DATA_SOURCE_RUNTIME_CONTEXT_FORBIDDEN: 'You do not have permission to look up options for this field.',
|
|
62
|
+
FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED: 'This option source does not support search.',
|
|
63
|
+
FORM_DATA_SOURCE_SEARCH_TOO_SHORT: 'Type more characters to search.',
|
|
64
|
+
FORM_DATA_SOURCE_TIMEOUT: 'The option source took too long to respond. Try again later.',
|
|
65
|
+
FORM_DATA_SOURCE_UNSUPPORTED_CONTROL: 'This option source does not support this field type.',
|
|
66
|
+
FORM_DATA_SOURCE_VALUE_NOT_RESOLVED: 'A selected option is no longer valid. Select again.',
|
|
67
|
+
FORM_DATA_SOURCE_VERSION_MISSING: 'The option source version no longer exists. Contact your system administrator.',
|
|
68
|
+
FORM_DATA_SOURCE_WAITING_FOR_DEPENDENCIES: 'Fill in the fields this one depends on first.',
|
|
69
|
+
};
|
|
70
|
+
const ERROR_MESSAGES = {
|
|
71
|
+
en: EN_ERROR_MESSAGES,
|
|
72
|
+
'zh-TW': ZH_ERROR_MESSAGES,
|
|
73
|
+
};
|
|
51
74
|
/**
|
|
52
75
|
* Token-bounded so `XFORM_DATA_SOURCE_TIMEOUT` is not mistaken for a code, and
|
|
53
76
|
* digit-tolerant so a future code is still recognised as one of ours.
|
|
@@ -83,7 +106,19 @@ const LINT_MESSAGE_PATTERN = /(?:^|; )(?:schema\.|descriptor\.)/u;
|
|
|
83
106
|
* know yet — a newer core against an older client. Without it the raw code
|
|
84
107
|
* would reach the screen.
|
|
85
108
|
*/
|
|
86
|
-
const
|
|
109
|
+
const UNKNOWN_CODE_MESSAGES = {
|
|
110
|
+
en: 'Something went wrong with the option source. Try again later or contact your system administrator.',
|
|
111
|
+
'zh-TW': '選項來源發生問題,請稍後再試或聯絡系統管理員。',
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* A plain JavaScript host can pass any string; fall back to the default
|
|
115
|
+
* language rather than answer `undefined`.
|
|
116
|
+
*/
|
|
117
|
+
function readLanguage(language) {
|
|
118
|
+
return workflow_lint_errors_1.WORKFLOW_LINT_LANGUAGES.includes(language)
|
|
119
|
+
? language
|
|
120
|
+
: workflow_lint_errors_1.DEFAULT_WORKFLOW_LINT_LANGUAGE;
|
|
121
|
+
}
|
|
87
122
|
/**
|
|
88
123
|
* Extracts the DataSource error code carried by a rejected request, whether it
|
|
89
124
|
* arrives as the bare code, a GraphQL error message, or an `Error` wrapping
|
|
@@ -102,17 +137,21 @@ function readFormDataSourceErrorCode(error) {
|
|
|
102
137
|
: null;
|
|
103
138
|
}
|
|
104
139
|
/**
|
|
105
|
-
* Maps a rejected request to display copy
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* rather than leaking the
|
|
140
|
+
* Maps a rejected request to display copy in `language` (Traditional Chinese
|
|
141
|
+
* by default). Returns `null` only when the failure is not a DataSource error
|
|
142
|
+
* at all, so callers can fall back to their own message; an unrecognised
|
|
143
|
+
* `FORM_DATA_SOURCE_*` code still yields readable copy rather than leaking the
|
|
144
|
+
* code itself.
|
|
109
145
|
*/
|
|
110
|
-
function readFormDataSourceErrorMessage(error) {
|
|
146
|
+
function readFormDataSourceErrorMessage(error, language = workflow_lint_errors_1.DEFAULT_WORKFLOW_LINT_LANGUAGE) {
|
|
111
147
|
const code = readFormDataSourceErrorCode(error);
|
|
148
|
+
const resolvedLanguage = readLanguage(language);
|
|
112
149
|
if (code) {
|
|
113
|
-
return ERROR_MESSAGES[code];
|
|
150
|
+
return ERROR_MESSAGES[resolvedLanguage][code];
|
|
114
151
|
}
|
|
115
|
-
return readsAsFormDataSourceCode(error)
|
|
152
|
+
return readsAsFormDataSourceCode(error)
|
|
153
|
+
? UNKNOWN_CODE_MESSAGES[resolvedLanguage]
|
|
154
|
+
: null;
|
|
116
155
|
}
|
|
117
156
|
/**
|
|
118
157
|
* True when the failure carries a `FORM_DATA_SOURCE_*` token, including codes
|
|
@@ -128,25 +167,27 @@ function readsAsFormDataSourceCode(error) {
|
|
|
128
167
|
}
|
|
129
168
|
/**
|
|
130
169
|
* Rewrites a publish-lint line such as
|
|
131
|
-
* `schema.fields[1].dataSource FORM_DATA_SOURCE_MISSING` into readable copy
|
|
132
|
-
* while keeping the field path that
|
|
133
|
-
* without a DataSource code are
|
|
170
|
+
* `schema.fields[1].dataSource FORM_DATA_SOURCE_MISSING` into readable copy in
|
|
171
|
+
* `language` (Traditional Chinese by default) while keeping the field path that
|
|
172
|
+
* tells the designer where to look. Lines without a DataSource code are
|
|
173
|
+
* returned unchanged.
|
|
134
174
|
*/
|
|
135
|
-
function readFormSchemaLintMessage(error) {
|
|
175
|
+
function readFormSchemaLintMessage(error, language = workflow_lint_errors_1.DEFAULT_WORKFLOW_LINT_LANGUAGE) {
|
|
176
|
+
const resolvedLanguage = readLanguage(language);
|
|
136
177
|
// A publish failure joins several lint lines, so map every code-bearing
|
|
137
178
|
// occurrence and leave all prose — including author-chosen names that look like
|
|
138
179
|
// codes — exactly as the backend wrote it.
|
|
139
|
-
const mapped = error.replace(LINT_LINE_CODE_PATTERN, (_match, separator, path, code) => `${separator}${path} ${readCodeMessage(code)}`);
|
|
180
|
+
const mapped = error.replace(LINT_LINE_CODE_PATTERN, (_match, separator, path, code) => `${separator}${path} ${readCodeMessage(code, resolvedLanguage)}`);
|
|
140
181
|
if (LINT_MESSAGE_PATTERN.test(error)) {
|
|
141
182
|
return mapped;
|
|
142
183
|
}
|
|
143
184
|
// Not lint output: the message is a bare code or wraps one (for example
|
|
144
185
|
// `GraphQL error: FORM_DATA_SOURCE_TIMEOUT`), so map it as a whole.
|
|
145
|
-
return readFormDataSourceErrorMessage(error) ?? error;
|
|
186
|
+
return readFormDataSourceErrorMessage(error, resolvedLanguage) ?? error;
|
|
146
187
|
}
|
|
147
|
-
function readCodeMessage(code) {
|
|
188
|
+
function readCodeMessage(code, language) {
|
|
148
189
|
return exports.FORM_DATA_SOURCE_ERROR_CODES.includes(code)
|
|
149
|
-
? ERROR_MESSAGES[code]
|
|
150
|
-
:
|
|
190
|
+
? ERROR_MESSAGES[language][code]
|
|
191
|
+
: UNKNOWN_CODE_MESSAGES[language];
|
|
151
192
|
}
|
|
152
193
|
//# sourceMappingURL=form-data-source-errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-data-source-errors.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/form/form-data-source-errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"form-data-source-errors.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/form/form-data-source-errors.ts"],"names":[],"mappings":";;;AAuKA,kEAeC;AASD,wEAcC;AAwBD,8DAqBC;AA1PD,2EAI0C;AAE1C;;;;;;;GAOG;AACU,QAAA,4BAA4B,GAAG;IAC1C,oCAAoC;IACpC,kCAAkC;IAClC,qCAAqC;IACrC,0CAA0C;IAC1C,0BAA0B;IAC1B,2CAA2C;IAC3C,mCAAmC;IACnC,wCAAwC;IACxC,4CAA4C;IAC5C,uCAAuC;IACvC,mCAAmC;IACnC,0BAA0B;IAC1B,sCAAsC;IACtC,qCAAqC;IACrC,kCAAkC;IAClC,2CAA2C;CACnC,CAAC;AAKX,MAAM,iBAAiB,GAAsD;IAC3E,kCAAkC,EAAE,cAAc;IAClD,gCAAgC,EAC9B,sBAAsB;IACxB,mCAAmC,EACjC,qBAAqB;IACvB,wCAAwC,EACtC,wBAAwB;IAC1B,wBAAwB,EAAE,oBAAoB;IAC9C,yCAAyC,EACvC,mBAAmB;IACrB,iCAAiC,EAC/B,mBAAmB;IACrB,sCAAsC,EACpC,mBAAmB;IACrB,0CAA0C,EAAE,eAAe;IAC3D,qCAAqC,EAAE,aAAa;IACpD,iCAAiC,EAAE,YAAY;IAC/C,wBAAwB,EAAE,iBAAiB;IAC3C,oCAAoC,EAClC,kBAAkB;IACpB,mCAAmC,EAAE,kBAAkB;IACvD,gCAAgC,EAC9B,sBAAsB;IACxB,yCAAyC,EAAE,WAAW;CACvD,CAAC;AAEF,MAAM,iBAAiB,GAAsD;IAC3E,kCAAkC,EAChC,0CAA0C;IAC5C,gCAAgC,EAC9B,sEAAsE;IACxE,mCAAmC,EACjC,+EAA+E;IACjF,wCAAwC,EACtC,6EAA6E;IAC/E,wBAAwB,EACtB,wEAAwE;IAC1E,yCAAyC,EACvC,0DAA0D;IAC5D,iCAAiC,EAC/B,uDAAuD;IACzD,sCAAsC,EACpC,y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E,oEAAoE;IACpE,OAAO,8BAA8B,CAAC,KAAK,EAAE,gBAAgB,CAAC,IAAI,KAAK,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,QAA8B;IACnE,OAAQ,oCAAkD,CAAC,QAAQ,CAAC,IAAI,CAAC;QACvE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,IAA+B,CAAC;QAC3D,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./template-api"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./workflow-webhook-endpoint-api"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./workflow-lint-errors"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/template/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,0EAAgD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/template/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,0EAAgD;AAChD,iEAAuC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
2
|
+
/** Languages `readWorkflowLintMessage` can rewrite the publish lint into. */
|
|
3
|
+
export type WorkflowLintLanguage = 'en' | 'zh-TW';
|
|
4
|
+
export declare const DEFAULT_WORKFLOW_LINT_LANGUAGE: WorkflowLintLanguage;
|
|
5
|
+
export declare const WORKFLOW_LINT_LANGUAGES: readonly WorkflowLintLanguage[];
|
|
6
|
+
/**
|
|
7
|
+
* Rewrites the structural lines of a publish-lint failure into designer copy
|
|
8
|
+
* in `language` (Traditional Chinese by default).
|
|
9
|
+
*
|
|
10
|
+
* The backend lint (`lintWorkflowDefinition`) speaks in node ids —
|
|
11
|
+
* `workflow.nodes.exclusiveGateway_1 exclusive split requires at least two
|
|
12
|
+
* outgoing edges` — and joins every failing line with `'; '`. The designer
|
|
13
|
+
* already holds the definition it just submitted, so it can name the node the
|
|
14
|
+
* way the canvas does and say how to fix it.
|
|
15
|
+
*
|
|
16
|
+
* The backend message itself stays untouched: hosts may match it, and only the
|
|
17
|
+
* screen needs the translation. Every line is rebuilt from the definition with
|
|
18
|
+
* the same `WORKFLOW_LINT_MESSAGES` the backend writes with, and replaced only
|
|
19
|
+
* on an exact, segment-bounded match, so a line this module does not know — a
|
|
20
|
+
* CEL error, a webhook code, a form path — or a node id that does not belong
|
|
21
|
+
* to this definition is returned exactly as the backend wrote it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readWorkflowLintMessage(message: string, definition: WorkflowDefinition | null | undefined, language?: WorkflowLintLanguage): string;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WORKFLOW_LINT_LANGUAGES = exports.DEFAULT_WORKFLOW_LINT_LANGUAGE = void 0;
|
|
4
|
+
exports.readWorkflowLintMessage = readWorkflowLintMessage;
|
|
5
|
+
const workflow_graph_1 = require("@rytass/bpm-core-shared/workflow-graph");
|
|
6
|
+
exports.DEFAULT_WORKFLOW_LINT_LANGUAGE = 'zh-TW';
|
|
7
|
+
exports.WORKFLOW_LINT_LANGUAGES = [
|
|
8
|
+
'zh-TW',
|
|
9
|
+
'en',
|
|
10
|
+
];
|
|
11
|
+
// Node types are looked up in a Map, not an object literal: the lint only
|
|
12
|
+
// checks that a node type is a non-empty string, so a draft can carry
|
|
13
|
+
// `constructor` or `toString`, which an object lookup would answer with a
|
|
14
|
+
// prototype function.
|
|
15
|
+
//
|
|
16
|
+
// The designer's own labels are Chinese whatever the language, so the English
|
|
17
|
+
// copy names each field and node type with its on-screen label beside it.
|
|
18
|
+
const WORKFLOW_LINT_COPY = {
|
|
19
|
+
en: {
|
|
20
|
+
blankNodeLabel: (typeLabel) => `A "${typeLabel}" node has no display name. Select it, fill in "Display name" (顯示名稱), then publish again.`,
|
|
21
|
+
cycle: (name) => `The connections around "${name}" form a loop, so the flow would keep coming back. Remove the connection that closes the loop.`,
|
|
22
|
+
endEventMissing: 'The flow needs at least one "End" (結束) node.',
|
|
23
|
+
exclusiveSplitDefaultEdge: (name) => `One outgoing connection of the condition split "${name}" must have "Otherwise take this path" (其他情況走這條) turned on, so the flow has somewhere to go when no condition matches.`,
|
|
24
|
+
exclusiveSplitOutgoingEdges: (name) => `The condition split "${name}" needs at least two outgoing connections, one of them with "Otherwise take this path" (其他情況走這條) turned on.`,
|
|
25
|
+
noPathToEnd: (name) => `"${name}" has no path to "End" (結束), so the flow would get stuck there. Connect it to the next node or to "End".`,
|
|
26
|
+
nodeTypeLabels: new Map([
|
|
27
|
+
['endEvent', 'End (結束)'],
|
|
28
|
+
['exclusiveGateway', 'Condition split (條件分流)'],
|
|
29
|
+
['parallelGateway', 'Parallel (並行處理)'],
|
|
30
|
+
['serviceTask', 'System (系統)'],
|
|
31
|
+
['startEvent', 'Start (開始)'],
|
|
32
|
+
['userTask', 'Approval (簽核)'],
|
|
33
|
+
]),
|
|
34
|
+
notifyOutgoingEdge: (name) => `The notify node "${name}" cannot have outgoing connections (it only sends a notice; the flow does not continue from it). Delete the connection leaving it.`,
|
|
35
|
+
parallelJoinIncomingEdges: (name) => `The parallel join "${name}" needs at least two incoming connections.`,
|
|
36
|
+
startEventCount: 'The flow needs exactly one "Start" (開始) node.',
|
|
37
|
+
unknownNodeType: 'Unknown type',
|
|
38
|
+
unreachableNode: (name) => `"${name}" cannot be reached from "Start" (開始), so the flow never gets there. Make sure a chain of connections leads to it from "Start".`,
|
|
39
|
+
},
|
|
40
|
+
'zh-TW': {
|
|
41
|
+
blankNodeLabel: (typeLabel) => `有一個「${typeLabel}」節點沒有顯示名稱。請點選該節點,在「顯示名稱」填入名稱後再發布。`,
|
|
42
|
+
cycle: (name) => `節點「${name}」所在的連線繞成了迴圈,流程會一直繞回來。請移除造成迴圈的那條連線。`,
|
|
43
|
+
endEventMissing: '流程至少要有一個「結束」節點。',
|
|
44
|
+
exclusiveSplitDefaultEdge: (name) => `條件分流「${name}」的輸出連線中,要有一條開啟「其他情況走這條」,其他條件都不符合時流程才有路可走。`,
|
|
45
|
+
exclusiveSplitOutgoingEdges: (name) => `條件分流「${name}」往下至少要有兩條連線,且其中一條要開啟「其他情況走這條」。`,
|
|
46
|
+
noPathToEnd: (name) => `節點「${name}」往下接不到「結束」,流程走到這裡會卡住。請從它拉一條連線到下一個節點或「結束」。`,
|
|
47
|
+
// The canvas's own labels, so the copy names a node type the way the
|
|
48
|
+
// designer and the AI toolset do.
|
|
49
|
+
nodeTypeLabels: new Map(Object.entries(workflow_graph_1.WORKFLOW_NODE_TYPE_LABELS)),
|
|
50
|
+
notifyOutgoingEdge: (name) => `知會節點「${name}」不能往下接連線(知會只負責通知,流程不會從它繼續)。請刪除從它拉出的連線。`,
|
|
51
|
+
parallelJoinIncomingEdges: (name) => `並行處理「${name}」至少要有兩條連線匯入。`,
|
|
52
|
+
startEventCount: '流程必須有一個「開始」節點,而且只能有一個。',
|
|
53
|
+
unknownNodeType: '未知類型',
|
|
54
|
+
unreachableNode: (name) => `從「開始」走不到節點「${name}」,流程永遠不會到這一關。請確認從「開始」一路都有連線接到它。`,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Rewrites the structural lines of a publish-lint failure into designer copy
|
|
59
|
+
* in `language` (Traditional Chinese by default).
|
|
60
|
+
*
|
|
61
|
+
* The backend lint (`lintWorkflowDefinition`) speaks in node ids —
|
|
62
|
+
* `workflow.nodes.exclusiveGateway_1 exclusive split requires at least two
|
|
63
|
+
* outgoing edges` — and joins every failing line with `'; '`. The designer
|
|
64
|
+
* already holds the definition it just submitted, so it can name the node the
|
|
65
|
+
* way the canvas does and say how to fix it.
|
|
66
|
+
*
|
|
67
|
+
* The backend message itself stays untouched: hosts may match it, and only the
|
|
68
|
+
* screen needs the translation. Every line is rebuilt from the definition with
|
|
69
|
+
* the same `WORKFLOW_LINT_MESSAGES` the backend writes with, and replaced only
|
|
70
|
+
* on an exact, segment-bounded match, so a line this module does not know — a
|
|
71
|
+
* CEL error, a webhook code, a form path — or a node id that does not belong
|
|
72
|
+
* to this definition is returned exactly as the backend wrote it.
|
|
73
|
+
*/
|
|
74
|
+
function readWorkflowLintMessage(message, definition, language = exports.DEFAULT_WORKFLOW_LINT_LANGUAGE) {
|
|
75
|
+
// A plain JavaScript host can pass any string; fall back rather than throw
|
|
76
|
+
// inside the caller's error handler.
|
|
77
|
+
const copy = exports.WORKFLOW_LINT_LANGUAGES.includes(language)
|
|
78
|
+
? WORKFLOW_LINT_COPY[language]
|
|
79
|
+
: WORKFLOW_LINT_COPY[exports.DEFAULT_WORKFLOW_LINT_LANGUAGE];
|
|
80
|
+
// Unreadable entries are skipped one by one below; this is the last resort
|
|
81
|
+
// for a draft that throws on read (a getter or a Proxy), which shows the
|
|
82
|
+
// backend message rather than nothing.
|
|
83
|
+
try {
|
|
84
|
+
const translations = readFirstWins(readWorkflowLintTranslations(definition, copy));
|
|
85
|
+
// Split on the backend's own separator and swap whole lines only, so a
|
|
86
|
+
// line that merely contains a known one — a CEL error quoting it, say — is
|
|
87
|
+
// left as written.
|
|
88
|
+
return message
|
|
89
|
+
.split('; ')
|
|
90
|
+
.map((segment) => translations.get(segment) ?? segment)
|
|
91
|
+
.join('; ');
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return message;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A Map keyed by the first entry for each key. Duplicate node ids are a lint
|
|
99
|
+
* error of their own, and the line then names the first node with that id.
|
|
100
|
+
*/
|
|
101
|
+
function readFirstWins(entries) {
|
|
102
|
+
return new Map([...entries].reverse());
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* This runs inside the callers' error handlers, after they have cleared the
|
|
106
|
+
* previous error, so it should not throw (`readWorkflowLintMessage` still
|
|
107
|
+
* catches anything that does): a draft saved by the AI toolset or the API is
|
|
108
|
+
* not linted on save and may be malformed. A node or edge it cannot
|
|
109
|
+
* read is skipped on its own, which leaves that line as the backend wrote it
|
|
110
|
+
* while every readable one is still translated.
|
|
111
|
+
*/
|
|
112
|
+
function readWorkflowLintTranslations(definition, copy) {
|
|
113
|
+
const entries = Array.isArray(definition?.nodes)
|
|
114
|
+
? definition.nodes
|
|
115
|
+
: [];
|
|
116
|
+
const edges = Array.isArray(definition?.edges)
|
|
117
|
+
? definition.edges
|
|
118
|
+
: [];
|
|
119
|
+
// The shape lint names a node by its index in the submitted array, so the
|
|
120
|
+
// index is taken before unreadable entries are dropped.
|
|
121
|
+
const indexedNodes = entries.flatMap((node, index) => isReadableNode(node) ? [[node, index]] : []);
|
|
122
|
+
const nodesById = readFirstWins(indexedNodes.map(([node]) => [
|
|
123
|
+
node.id,
|
|
124
|
+
node,
|
|
125
|
+
]));
|
|
126
|
+
const nodeTranslations = indexedNodes.flatMap(([node, index]) => readNodeTranslations(node, index, copy));
|
|
127
|
+
const edgeTranslations = edges
|
|
128
|
+
.filter(isReadableEdge)
|
|
129
|
+
.flatMap((edge) => {
|
|
130
|
+
const source = nodesById.get(edge.source);
|
|
131
|
+
return source
|
|
132
|
+
? [
|
|
133
|
+
[
|
|
134
|
+
workflow_graph_1.WORKFLOW_LINT_MESSAGES.notifyOutgoingEdge(edge.id),
|
|
135
|
+
copy.notifyOutgoingEdge(readNodeName(source, copy)),
|
|
136
|
+
],
|
|
137
|
+
]
|
|
138
|
+
: [];
|
|
139
|
+
});
|
|
140
|
+
return [
|
|
141
|
+
[workflow_graph_1.WORKFLOW_LINT_MESSAGES.startEventCount(), copy.startEventCount],
|
|
142
|
+
[workflow_graph_1.WORKFLOW_LINT_MESSAGES.endEventMissing(), copy.endEventMissing],
|
|
143
|
+
...nodeTranslations,
|
|
144
|
+
...edgeTranslations,
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
function readNodeTranslations(node, index, copy) {
|
|
148
|
+
const name = readNodeName(node, copy);
|
|
149
|
+
return [
|
|
150
|
+
[
|
|
151
|
+
// The shape lint names the node by array index, the one thing the
|
|
152
|
+
// canvas never shows, and the label it would use is the blank one.
|
|
153
|
+
workflow_graph_1.WORKFLOW_LINT_MESSAGES.blankNodeLabel(index),
|
|
154
|
+
copy.blankNodeLabel(readNodeTypeLabel(node, copy)),
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
workflow_graph_1.WORKFLOW_LINT_MESSAGES.exclusiveSplitOutgoingEdges(node.id),
|
|
158
|
+
copy.exclusiveSplitOutgoingEdges(name),
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
workflow_graph_1.WORKFLOW_LINT_MESSAGES.exclusiveSplitDefaultEdge(node.id),
|
|
162
|
+
copy.exclusiveSplitDefaultEdge(name),
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
workflow_graph_1.WORKFLOW_LINT_MESSAGES.parallelJoinIncomingEdges(node.id),
|
|
166
|
+
copy.parallelJoinIncomingEdges(name),
|
|
167
|
+
],
|
|
168
|
+
[
|
|
169
|
+
workflow_graph_1.WORKFLOW_LINT_MESSAGES.unreachableNode(node.id),
|
|
170
|
+
copy.unreachableNode(name),
|
|
171
|
+
],
|
|
172
|
+
[workflow_graph_1.WORKFLOW_LINT_MESSAGES.noPathToEnd(node.id), copy.noPathToEnd(name)],
|
|
173
|
+
[workflow_graph_1.WORKFLOW_LINT_MESSAGES.cycle(node.id), copy.cycle(name)],
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
function isReadableNode(node) {
|
|
177
|
+
return (typeof node === 'object' &&
|
|
178
|
+
node !== null &&
|
|
179
|
+
typeof node.id === 'string');
|
|
180
|
+
}
|
|
181
|
+
function isReadableEdge(edge) {
|
|
182
|
+
return (typeof edge === 'object' &&
|
|
183
|
+
edge !== null &&
|
|
184
|
+
typeof edge.id === 'string' &&
|
|
185
|
+
typeof edge.source === 'string');
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The name the canvas shows for a node. A blank label falls back to the node
|
|
189
|
+
* type, never the id: the id is what the designer cannot see.
|
|
190
|
+
*/
|
|
191
|
+
function readNodeName(node, copy) {
|
|
192
|
+
const label = node.data
|
|
193
|
+
?.label;
|
|
194
|
+
return typeof label === 'string' && label.trim()
|
|
195
|
+
? label.trim()
|
|
196
|
+
: readNodeTypeLabel(node, copy);
|
|
197
|
+
}
|
|
198
|
+
function readNodeTypeLabel(node, copy) {
|
|
199
|
+
return copy.nodeTypeLabels.get(node.type) ?? copy.unknownNodeType;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=workflow-lint-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-lint-errors.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/template/workflow-lint-errors.ts"],"names":[],"mappings":";;;AAqHA,0DA6BC;AA7ID,2EAGgD;AAKnC,QAAA,8BAA8B,GAAyB,OAAO,CAAC;AAE/D,QAAA,uBAAuB,GAAoC;IACtE,OAAO;IACP,IAAI;CACL,CAAC;AAiBF,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,sBAAsB;AACtB,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,MAAM,kBAAkB,GAEpB;IACF,EAAE,EAAE;QACF,cAAc,EAAE,CAAC,SAAS,EAAU,EAAE,CACpC,MAAM,SAAS,2FAA2F;QAC5G,KAAK,EAAE,CAAC,IAAI,EAAU,EAAE,CACtB,2BAA2B,IAAI,gGAAgG;QACjI,eAAe,EAAE,8CAA8C;QAC/D,yBAAyB,EAAE,CAAC,IAAI,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