@rytass/bpm-core-shared 0.18.1 → 0.20.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 +46 -0
- package/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/expression-function.d.ts +33 -0
- package/src/lib/expression-function.js +18 -0
- package/src/lib/expression-function.js.map +1 -0
- package/src/lib/expression-usage-point.d.ts +72 -0
- package/src/lib/expression-usage-point.js +130 -0
- package/src/lib/expression-usage-point.js.map +1 -0
- package/src/lib/form.d.ts +24 -0
- package/src/lib/form.js +23 -1
- package/src/lib/form.js.map +1 -1
- package/src/lib/workflow-graph.d.ts +11 -1
- package/src/lib/workflow-graph.js +51 -9
- package/src/lib/workflow-graph.js.map +1 -1
- package/src/lib/workflow-toolset.d.ts +38 -1
- package/src/lib/workflow-toolset.js +208 -1
- package/src/lib/workflow-toolset.js.map +1 -1
- package/src/lib/workflow.d.ts +26 -1
- package/src/lib/workflow.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
## 0.20.0 (2026-11-08)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **workflow-chat:** require a BPM API session for /api/chat ([9906851](https://github.com/Rytass/BPMCore/commit/9906851))
|
|
6
|
+
- ⚠️ **form-data-source:** pass a binding's position explicitly and lint NOTIFY expressions ([9987b12](https://github.com/Rytass/BPMCore/commit/9987b12))
|
|
7
|
+
- **form-data-source:** bind DataSource and webhook parameters to expressions ([c2b18d3](https://github.com/Rytass/BPMCore/commit/c2b18d3))
|
|
8
|
+
- **designer:** write, preview and upgrade expressions in the designer ([ec36bb7](https://github.com/Rytass/BPMCore/commit/ec36bb7))
|
|
9
|
+
- **template:** lint expressions against their AST at publish ([61d07f5](https://github.com/Rytass/BPMCore/commit/61d07f5))
|
|
10
|
+
- **expression-function:** register host and built-in functions ([f8763b4](https://github.com/Rytass/BPMCore/commit/f8763b4))
|
|
11
|
+
- **expression-function:** define the function registry contract ([31e7e16](https://github.com/Rytass/BPMCore/commit/31e7e16))
|
|
12
|
+
- **condition:** evaluate expressions under a budget with sanitized errors ([38ef1f8](https://github.com/Rytass/BPMCore/commit/38ef1f8))
|
|
13
|
+
|
|
14
|
+
### 🩹 Fixes
|
|
15
|
+
|
|
16
|
+
- **form-data-source:** take a new pick over an expired EXPRESSION value ([3499115](https://github.com/Rytass/BPMCore/commit/3499115))
|
|
17
|
+
- **condition:** check cel-v2 function argument types and log engine warm-up ([0834758](https://github.com/Rytass/BPMCore/commit/0834758))
|
|
18
|
+
- **workflow-engine:** send webhooks after the transaction commits ([d74aba6](https://github.com/Rytass/BPMCore/commit/d74aba6))
|
|
19
|
+
|
|
20
|
+
### ⚠️ Breaking Changes
|
|
21
|
+
|
|
22
|
+
- **form-data-source:** pass a binding's position explicitly and lint NOTIFY expressions ([9987b12](https://github.com/Rytass/BPMCore/commit/9987b12))
|
|
23
|
+
FormDataSourceService.searchFormFieldOptions takes a
|
|
24
|
+
required position instead of optional rowValues, and the
|
|
25
|
+
NotifyWebhookBindingSource union gains an EXPRESSION member, so an
|
|
26
|
+
exhaustive switch over from.kind needs a new case.
|
|
27
|
+
|
|
28
|
+
### ❤️ Thank You
|
|
29
|
+
|
|
30
|
+
- Chia Yu Pai @fantasywind
|
|
31
|
+
|
|
32
|
+
## 0.19.0 (2026-11-04)
|
|
33
|
+
|
|
34
|
+
### 🩹 Fixes
|
|
35
|
+
|
|
36
|
+
- **bpm-core:** read form attachments from file_upload fields only ([e9cd71a](https://github.com/Rytass/BPMCore/commit/e9cd71a))
|
|
37
|
+
- **bpm-core-react:** list file_upload files as the host holds them, in pick order ([20bf634](https://github.com/Rytass/BPMCore/commit/20bf634))
|
|
38
|
+
- **bpm-core:** refuse a form attachment the case may not take ([4710a23](https://github.com/Rytass/BPMCore/commit/4710a23))
|
|
39
|
+
- **bpm-core:** bind a free attachment only for the members who file the case ([ecd9d76](https://github.com/Rytass/BPMCore/commit/ecd9d76))
|
|
40
|
+
- **bpm-core-react:** list every attachment a file_upload value holds ([da7ee9b](https://github.com/Rytass/BPMCore/commit/da7ee9b))
|
|
41
|
+
- **bpm-core:** release form attachments a resubmit no longer refers to ([2580381](https://github.com/Rytass/BPMCore/commit/2580381))
|
|
42
|
+
|
|
43
|
+
### ❤️ Thank You
|
|
44
|
+
|
|
45
|
+
- Chia Yu Pai @fantasywind
|
|
46
|
+
|
|
1
47
|
## 0.18.1 (2026-11-01)
|
|
2
48
|
|
|
3
49
|
### 🚀 Features
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./lib/condition"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/expression-function"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/expression-usage-point"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./lib/field-access"), exports);
|
|
6
8
|
tslib_1.__exportStar(require("./lib/field-access-lint"), exports);
|
|
7
9
|
tslib_1.__exportStar(require("./lib/field-access-matrix"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/shared/src/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,6DAAmC;AACnC,kEAAwC;AACxC,oEAA0C;AAC1C,qDAA2B;AAC3B,yDAA+B;AAC/B,6DAAmC;AACnC,uDAA6B;AAC7B,yDAA+B;AAC/B,+DAAqC;AACrC,iEAAuC;AACvC,iEAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/shared/src/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,oEAA0C;AAC1C,uEAA6C;AAC7C,6DAAmC;AACnC,kEAAwC;AACxC,oEAA0C;AAC1C,qDAA2B;AAC3B,yDAA+B;AAC/B,6DAAmC;AACnC,uDAA6B;AAC7B,yDAA+B;AAC/B,+DAAqC;AACrC,iEAAuC;AACvC,iEAAuC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value types an expression function declares for its parameters and its
|
|
3
|
+
* result (ADR 22 §3.5). They name CEL types; `dyn` accepts any JSON value.
|
|
4
|
+
*/
|
|
5
|
+
export type BPMExpressionValueType = 'bool' | 'double' | 'dyn' | 'int' | 'list' | 'map' | 'null' | 'string';
|
|
6
|
+
/** A JSON value as an expression function receives and returns it. */
|
|
7
|
+
export type BPMExpressionValue = boolean | number | string | null | readonly BPMExpressionValue[] | {
|
|
8
|
+
readonly [key: string]: BPMExpressionValue;
|
|
9
|
+
};
|
|
10
|
+
export interface BPMExpressionFunctionParameter {
|
|
11
|
+
readonly description?: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly type: BPMExpressionValueType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* What the designer, the catalog and the publish lint may know about a
|
|
17
|
+
* function: everything except its handler. The browser only ever sees this.
|
|
18
|
+
*/
|
|
19
|
+
export interface BPMExpressionFunctionDescriptor {
|
|
20
|
+
/** `true` for the nine core functions (`round` … `upper`). */
|
|
21
|
+
readonly builtIn: boolean;
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
/** Host functions carry their version: `erp_costBand_v1`. Built-ins do not. */
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly parameters: readonly BPMExpressionFunctionParameter[];
|
|
27
|
+
readonly returnType: BPMExpressionValueType;
|
|
28
|
+
}
|
|
29
|
+
/** The names the core reserves for its built-in functions (ADR 22 §3.5). */
|
|
30
|
+
export declare const BPM_BUILT_IN_EXPRESSION_FUNCTION_NAMES: readonly ["abs", "ceil", "floor", "lower", "max", "min", "round", "trim", "upper"];
|
|
31
|
+
export type BPMBuiltInExpressionFunctionName = (typeof BPM_BUILT_IN_EXPRESSION_FUNCTION_NAMES)[number];
|
|
32
|
+
/** Host function names: lower camel segments joined by `_`, ending in `_vN`. */
|
|
33
|
+
export declare const BPM_EXPRESSION_FUNCTION_NAME_PATTERN: RegExp;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BPM_EXPRESSION_FUNCTION_NAME_PATTERN = exports.BPM_BUILT_IN_EXPRESSION_FUNCTION_NAMES = void 0;
|
|
4
|
+
/** The names the core reserves for its built-in functions (ADR 22 §3.5). */
|
|
5
|
+
exports.BPM_BUILT_IN_EXPRESSION_FUNCTION_NAMES = [
|
|
6
|
+
'abs',
|
|
7
|
+
'ceil',
|
|
8
|
+
'floor',
|
|
9
|
+
'lower',
|
|
10
|
+
'max',
|
|
11
|
+
'min',
|
|
12
|
+
'round',
|
|
13
|
+
'trim',
|
|
14
|
+
'upper',
|
|
15
|
+
];
|
|
16
|
+
/** Host function names: lower camel segments joined by `_`, ending in `_vN`. */
|
|
17
|
+
exports.BPM_EXPRESSION_FUNCTION_NAME_PATTERN = /^[a-z][A-Za-z0-9]*(_[A-Za-z0-9]+)*_v[0-9]+$/u;
|
|
18
|
+
//# sourceMappingURL=expression-function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-function.js","sourceRoot":"","sources":["../../../../../libs/shared/src/lib/expression-function.ts"],"names":[],"mappings":";;;AAqCA,4EAA4E;AAC/D,QAAA,sCAAsC,GAAG;IACpD,KAAK;IACL,MAAM;IACN,OAAO;IACP,OAAO;IACP,KAAK;IACL,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;CACC,CAAC;AAKX,gFAAgF;AACnE,QAAA,oCAAoC,GAC/C,8CAA8C,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an expression is evaluated, and so what it may read (docs/24 §2.3).
|
|
3
|
+
* Each use point has its own root list; they are deliberately not merged.
|
|
4
|
+
*/
|
|
5
|
+
export declare const EXPRESSION_USAGE_POINTS: readonly ["INITIATOR_POLICY", "ENTRY_CONDITION", "FLOW_CONDITION", "APPROVER_RESOLVER", "SERVICE_FORM_FIELD_VALUE", "WEBHOOK_PAYLOAD", "DELEGATION_CONDITION", "DATA_SOURCE_BINDING", "NOTIFY_WEBHOOK_BINDING"];
|
|
6
|
+
export type ExpressionUsagePoint = (typeof EXPRESSION_USAGE_POINTS)[number];
|
|
7
|
+
/**
|
|
8
|
+
* The root identifiers each use point evaluates with. Mirrors what the engine
|
|
9
|
+
* hands over at each point (workflow-engine `buildInitiatorPolicyContext`,
|
|
10
|
+
* `buildWorkflowExpressionContext`, the edge `lastDecision`, the delegation
|
|
11
|
+
* `principal`), so the lint refuses exactly what could only fail at run time.
|
|
12
|
+
*/
|
|
13
|
+
export declare const EXPRESSION_ROOT_IDENTIFIERS_BY_USAGE_POINT: Readonly<Record<ExpressionUsagePoint, readonly string[]>>;
|
|
14
|
+
/**
|
|
15
|
+
* Use points that may only call the built-in functions (docs/24 §1: bindings
|
|
16
|
+
* get host functions later, if ever; widening is additive, narrowing is not).
|
|
17
|
+
*/
|
|
18
|
+
export declare const EXPRESSION_USAGE_POINTS_WITHOUT_HOST_FUNCTIONS: readonly ExpressionUsagePoint[];
|
|
19
|
+
export declare const isExpressionUsagePoint: (value: unknown) => value is ExpressionUsagePoint;
|
|
20
|
+
export declare const allowsHostExpressionFunctions: (usagePoint: ExpressionUsagePoint) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Lint findings that refuse a publish (docs/24 §2.2). Publish, the preview's
|
|
23
|
+
* LINT mode and the NOTIFY catalog share this one list.
|
|
24
|
+
*/
|
|
25
|
+
export declare const EXPRESSION_LINT_ERROR_CODES: readonly ["EXPR_PARSE_FAILED", "EXPR_ROOT_NOT_ALLOWED", "EXPR_WHOLE_FORM_REFERENCE", "EXPR_COMPUTED_KEY", "EXPR_RESERVED_PATH_SEGMENT", "EXPR_COMPLEXITY_EXCEEDED", "EXPR_COMPREHENSION_NESTING", "EXPR_FIELD_UNKNOWN", "EXPR_FIELD_TYPE_MISMATCH", "EXPR_RESULT_TYPE_MISMATCH", "EXPR_FUNCTION_NOT_REGISTERED", "EXPR_FUNCTION_NOT_ALLOWED"];
|
|
26
|
+
/**
|
|
27
|
+
* Lint findings that only warn. `EXPR_DIVISOR_IS_FIELD` is the warning
|
|
28
|
+
* docs/24 §2.1 asks for (a `double` divided by a zero field is `Infinity` in
|
|
29
|
+
* cel-v2, which a comparison quietly turns into a routing decision; P1 P35).
|
|
30
|
+
* `EXPR_LAST_DECISION_UNAVAILABLE` is an edge condition that reads
|
|
31
|
+
* `lastDecision` on an edge leaving a node without tasks (a gateway, a
|
|
32
|
+
* service task, the start): no decision is made there, so it is always
|
|
33
|
+
* `null` at run time (Phase 23 P2 live finding, P4).
|
|
34
|
+
*/
|
|
35
|
+
export declare const EXPRESSION_LINT_WARNING_CODES: readonly ["EXPR_OPTIONAL_FIELD_WITHOUT_HAS", "EXPR_OR_ABSORBS_ERROR", "EXPR_HAS_NESTED_PARENT", "EXPR_APPROVER_READS_FORM", "EXPR_HIDDEN_FIELD_COPIED", "EXPR_DIVISOR_IS_FIELD", "EXPR_LAST_DECISION_UNAVAILABLE"];
|
|
36
|
+
export type ExpressionLintErrorCode = (typeof EXPRESSION_LINT_ERROR_CODES)[number];
|
|
37
|
+
export type ExpressionLintWarningCode = (typeof EXPRESSION_LINT_WARNING_CODES)[number];
|
|
38
|
+
export type ExpressionLintCode = ExpressionLintErrorCode | ExpressionLintWarningCode;
|
|
39
|
+
export type ExpressionLintSeverity = 'ERROR' | 'WARNING';
|
|
40
|
+
/**
|
|
41
|
+
* One finding. `subject` names what the finding is about (a field key, a
|
|
42
|
+
* root, a function) and is only ever an identifier: anything else is dropped
|
|
43
|
+
* when the line is written, so a user-chosen key can never carry the `'; '`
|
|
44
|
+
* the publish lint joins lines with.
|
|
45
|
+
*/
|
|
46
|
+
export interface ExpressionLintIssue {
|
|
47
|
+
readonly code: ExpressionLintCode;
|
|
48
|
+
readonly label: string;
|
|
49
|
+
readonly severity: ExpressionLintSeverity;
|
|
50
|
+
readonly subject?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const EXPRESSION_LINT_SUBJECT_PATTERN: RegExp;
|
|
53
|
+
export declare const isExpressionLintCode: (value: unknown) => value is ExpressionLintCode;
|
|
54
|
+
export declare const readExpressionLintSeverity: (code: ExpressionLintCode) => ExpressionLintSeverity;
|
|
55
|
+
/**
|
|
56
|
+
* The publish-lint line for a finding: `<label>: <code>` or
|
|
57
|
+
* `<label>: <code> <subject>`. The designer parses it back with
|
|
58
|
+
* {@link parseExpressionLintLine} to show its own copy.
|
|
59
|
+
*/
|
|
60
|
+
export declare const formatExpressionLintIssue: (issue: ExpressionLintIssue) => string;
|
|
61
|
+
export interface ParsedExpressionLintLine {
|
|
62
|
+
readonly code: ExpressionLintCode;
|
|
63
|
+
readonly label: string;
|
|
64
|
+
readonly subject: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** The parts of a line {@link formatExpressionLintIssue} wrote, or `null`. */
|
|
67
|
+
export declare const parseExpressionLintLine: (line: string) => ParsedExpressionLintLine | null;
|
|
68
|
+
/**
|
|
69
|
+
* The publish-lint line for a definition whose `expressionDialect` this
|
|
70
|
+
* version does not know (Phase 23 P2). Shared so the designer can match it.
|
|
71
|
+
*/
|
|
72
|
+
export declare const UNKNOWN_EXPRESSION_DIALECT_LINT_MESSAGE = "workflow.expressionDialect must be cel-legacy or cel-v2";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNKNOWN_EXPRESSION_DIALECT_LINT_MESSAGE = exports.parseExpressionLintLine = exports.formatExpressionLintIssue = exports.readExpressionLintSeverity = exports.isExpressionLintCode = exports.EXPRESSION_LINT_SUBJECT_PATTERN = exports.EXPRESSION_LINT_WARNING_CODES = exports.EXPRESSION_LINT_ERROR_CODES = exports.allowsHostExpressionFunctions = exports.isExpressionUsagePoint = exports.EXPRESSION_USAGE_POINTS_WITHOUT_HOST_FUNCTIONS = exports.EXPRESSION_ROOT_IDENTIFIERS_BY_USAGE_POINT = exports.EXPRESSION_USAGE_POINTS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Where an expression is evaluated, and so what it may read (docs/24 §2.3).
|
|
6
|
+
* Each use point has its own root list; they are deliberately not merged.
|
|
7
|
+
*/
|
|
8
|
+
exports.EXPRESSION_USAGE_POINTS = [
|
|
9
|
+
'INITIATOR_POLICY',
|
|
10
|
+
'ENTRY_CONDITION',
|
|
11
|
+
'FLOW_CONDITION',
|
|
12
|
+
'APPROVER_RESOLVER',
|
|
13
|
+
'SERVICE_FORM_FIELD_VALUE',
|
|
14
|
+
'WEBHOOK_PAYLOAD',
|
|
15
|
+
'DELEGATION_CONDITION',
|
|
16
|
+
'DATA_SOURCE_BINDING',
|
|
17
|
+
'NOTIFY_WEBHOOK_BINDING',
|
|
18
|
+
];
|
|
19
|
+
const INSTANCE_ROOTS = [
|
|
20
|
+
'env',
|
|
21
|
+
'form',
|
|
22
|
+
'formData',
|
|
23
|
+
'initiator',
|
|
24
|
+
'instance',
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* The root identifiers each use point evaluates with. Mirrors what the engine
|
|
28
|
+
* hands over at each point (workflow-engine `buildInitiatorPolicyContext`,
|
|
29
|
+
* `buildWorkflowExpressionContext`, the edge `lastDecision`, the delegation
|
|
30
|
+
* `principal`), so the lint refuses exactly what could only fail at run time.
|
|
31
|
+
*/
|
|
32
|
+
exports.EXPRESSION_ROOT_IDENTIFIERS_BY_USAGE_POINT = {
|
|
33
|
+
APPROVER_RESOLVER: INSTANCE_ROOTS,
|
|
34
|
+
DATA_SOURCE_BINDING: ['form', 'row'],
|
|
35
|
+
DELEGATION_CONDITION: [...INSTANCE_ROOTS, 'principal'],
|
|
36
|
+
ENTRY_CONDITION: INSTANCE_ROOTS,
|
|
37
|
+
FLOW_CONDITION: [...INSTANCE_ROOTS, 'lastDecision'],
|
|
38
|
+
INITIATOR_POLICY: ['env', 'initiator', 'subject'],
|
|
39
|
+
NOTIFY_WEBHOOK_BINDING: ['form'],
|
|
40
|
+
SERVICE_FORM_FIELD_VALUE: INSTANCE_ROOTS,
|
|
41
|
+
WEBHOOK_PAYLOAD: INSTANCE_ROOTS,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Use points that may only call the built-in functions (docs/24 §1: bindings
|
|
45
|
+
* get host functions later, if ever; widening is additive, narrowing is not).
|
|
46
|
+
*/
|
|
47
|
+
exports.EXPRESSION_USAGE_POINTS_WITHOUT_HOST_FUNCTIONS = ['DATA_SOURCE_BINDING', 'NOTIFY_WEBHOOK_BINDING'];
|
|
48
|
+
const isExpressionUsagePoint = (value) => typeof value === 'string' &&
|
|
49
|
+
exports.EXPRESSION_USAGE_POINTS.includes(value);
|
|
50
|
+
exports.isExpressionUsagePoint = isExpressionUsagePoint;
|
|
51
|
+
const allowsHostExpressionFunctions = (usagePoint) => !exports.EXPRESSION_USAGE_POINTS_WITHOUT_HOST_FUNCTIONS.includes(usagePoint);
|
|
52
|
+
exports.allowsHostExpressionFunctions = allowsHostExpressionFunctions;
|
|
53
|
+
/**
|
|
54
|
+
* Lint findings that refuse a publish (docs/24 §2.2). Publish, the preview's
|
|
55
|
+
* LINT mode and the NOTIFY catalog share this one list.
|
|
56
|
+
*/
|
|
57
|
+
exports.EXPRESSION_LINT_ERROR_CODES = [
|
|
58
|
+
'EXPR_PARSE_FAILED',
|
|
59
|
+
'EXPR_ROOT_NOT_ALLOWED',
|
|
60
|
+
'EXPR_WHOLE_FORM_REFERENCE',
|
|
61
|
+
'EXPR_COMPUTED_KEY',
|
|
62
|
+
'EXPR_RESERVED_PATH_SEGMENT',
|
|
63
|
+
'EXPR_COMPLEXITY_EXCEEDED',
|
|
64
|
+
'EXPR_COMPREHENSION_NESTING',
|
|
65
|
+
'EXPR_FIELD_UNKNOWN',
|
|
66
|
+
'EXPR_FIELD_TYPE_MISMATCH',
|
|
67
|
+
'EXPR_RESULT_TYPE_MISMATCH',
|
|
68
|
+
'EXPR_FUNCTION_NOT_REGISTERED',
|
|
69
|
+
'EXPR_FUNCTION_NOT_ALLOWED',
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* Lint findings that only warn. `EXPR_DIVISOR_IS_FIELD` is the warning
|
|
73
|
+
* docs/24 §2.1 asks for (a `double` divided by a zero field is `Infinity` in
|
|
74
|
+
* cel-v2, which a comparison quietly turns into a routing decision; P1 P35).
|
|
75
|
+
* `EXPR_LAST_DECISION_UNAVAILABLE` is an edge condition that reads
|
|
76
|
+
* `lastDecision` on an edge leaving a node without tasks (a gateway, a
|
|
77
|
+
* service task, the start): no decision is made there, so it is always
|
|
78
|
+
* `null` at run time (Phase 23 P2 live finding, P4).
|
|
79
|
+
*/
|
|
80
|
+
exports.EXPRESSION_LINT_WARNING_CODES = [
|
|
81
|
+
'EXPR_OPTIONAL_FIELD_WITHOUT_HAS',
|
|
82
|
+
'EXPR_OR_ABSORBS_ERROR',
|
|
83
|
+
'EXPR_HAS_NESTED_PARENT',
|
|
84
|
+
'EXPR_APPROVER_READS_FORM',
|
|
85
|
+
'EXPR_HIDDEN_FIELD_COPIED',
|
|
86
|
+
'EXPR_DIVISOR_IS_FIELD',
|
|
87
|
+
'EXPR_LAST_DECISION_UNAVAILABLE',
|
|
88
|
+
];
|
|
89
|
+
exports.EXPRESSION_LINT_SUBJECT_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/u;
|
|
90
|
+
const EXPRESSION_LINT_CODES = [
|
|
91
|
+
...exports.EXPRESSION_LINT_ERROR_CODES,
|
|
92
|
+
...exports.EXPRESSION_LINT_WARNING_CODES,
|
|
93
|
+
];
|
|
94
|
+
const isExpressionLintCode = (value) => typeof value === 'string' && EXPRESSION_LINT_CODES.includes(value);
|
|
95
|
+
exports.isExpressionLintCode = isExpressionLintCode;
|
|
96
|
+
const readExpressionLintSeverity = (code) => exports.EXPRESSION_LINT_WARNING_CODES.includes(code)
|
|
97
|
+
? 'WARNING'
|
|
98
|
+
: 'ERROR';
|
|
99
|
+
exports.readExpressionLintSeverity = readExpressionLintSeverity;
|
|
100
|
+
/**
|
|
101
|
+
* The publish-lint line for a finding: `<label>: <code>` or
|
|
102
|
+
* `<label>: <code> <subject>`. The designer parses it back with
|
|
103
|
+
* {@link parseExpressionLintLine} to show its own copy.
|
|
104
|
+
*/
|
|
105
|
+
const formatExpressionLintIssue = (issue) => issue.subject !== undefined &&
|
|
106
|
+
exports.EXPRESSION_LINT_SUBJECT_PATTERN.test(issue.subject)
|
|
107
|
+
? `${issue.label}: ${issue.code} ${issue.subject}`
|
|
108
|
+
: `${issue.label}: ${issue.code}`;
|
|
109
|
+
exports.formatExpressionLintIssue = formatExpressionLintIssue;
|
|
110
|
+
const EXPRESSION_LINT_LINE_PATTERN = /^(.+): (EXPR_[A-Z_]+)(?: ([A-Za-z_][A-Za-z0-9_]*))?$/u;
|
|
111
|
+
/** The parts of a line {@link formatExpressionLintIssue} wrote, or `null`. */
|
|
112
|
+
const parseExpressionLintLine = (line) => {
|
|
113
|
+
var _a;
|
|
114
|
+
const match = EXPRESSION_LINT_LINE_PATTERN.exec(line);
|
|
115
|
+
if (!match || !(0, exports.isExpressionLintCode)(match[2])) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
code: match[2],
|
|
120
|
+
label: match[1],
|
|
121
|
+
subject: (_a = match[3]) !== null && _a !== void 0 ? _a : null,
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
exports.parseExpressionLintLine = parseExpressionLintLine;
|
|
125
|
+
/**
|
|
126
|
+
* The publish-lint line for a definition whose `expressionDialect` this
|
|
127
|
+
* version does not know (Phase 23 P2). Shared so the designer can match it.
|
|
128
|
+
*/
|
|
129
|
+
exports.UNKNOWN_EXPRESSION_DIALECT_LINT_MESSAGE = 'workflow.expressionDialect must be cel-legacy or cel-v2';
|
|
130
|
+
//# sourceMappingURL=expression-usage-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-usage-point.js","sourceRoot":"","sources":["../../../../../libs/shared/src/lib/expression-usage-point.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,uBAAuB,GAAG;IACrC,kBAAkB;IAClB,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,0BAA0B;IAC1B,iBAAiB;IACjB,sBAAsB;IACtB,qBAAqB;IACrB,wBAAwB;CAChB,CAAC;AAIX,MAAM,cAAc,GAAG;IACrB,KAAK;IACL,MAAM;IACN,UAAU;IACV,WAAW;IACX,UAAU;CACF,CAAC;AAEX;;;;;GAKG;AACU,QAAA,0CAA0C,GAEnD;IACF,iBAAiB,EAAE,cAAc;IACjC,mBAAmB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;IACpC,oBAAoB,EAAE,CAAC,GAAG,cAAc,EAAE,WAAW,CAAC;IACtD,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,CAAC,GAAG,cAAc,EAAE,cAAc,CAAC;IACnD,gBAAgB,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC;IACjD,sBAAsB,EAAE,CAAC,MAAM,CAAC;IAChC,wBAAwB,EAAE,cAAc;IACxC,eAAe,EAAE,cAAc;CAChC,CAAC;AAEF;;;GAGG;AACU,QAAA,8CAA8C,GACzD,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAAC;AAE7C,MAAM,sBAAsB,GAAG,CACpC,KAAc,EACiB,EAAE,CACjC,OAAO,KAAK,KAAK,QAAQ;IACxB,+BAA6C,CAAC,QAAQ,CAAC,KAAK,CAAC,CA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C,KAAK,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE;IAClD,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;AANzB,QAAA,yBAAyB,6BAMA;AAQtC,MAAM,4BAA4B,GAChC,uDAAuD,CAAC;AAE1D,8EAA8E;AACvE,MAAM,uBAAuB,GAAG,CACrC,IAAY,EACqB,EAAE;;IACnC,MAAM,KAAK,GAAG,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEtD,IAAI,CAAC,KAAK,IAAI,CAAC,IAAA,4BAAoB,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACf,OAAO,EAAE,MAAA,KAAK,CAAC,CAAC,CAAC,mCAAI,IAAI;KAC1B,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,uBAAuB,2BAclC;AAEF;;;GAGG;AACU,QAAA,uCAAuC,GAClD,yDAAyD,CAAC"}
|
package/src/lib/form.d.ts
CHANGED
|
@@ -72,7 +72,24 @@ export type FormDataSourceBindingSource = {
|
|
|
72
72
|
} | {
|
|
73
73
|
readonly columnKey: string;
|
|
74
74
|
readonly kind: 'ROW_FIELD';
|
|
75
|
+
} | {
|
|
76
|
+
/**
|
|
77
|
+
* A cel-v2 expression over `form` (and `row` inside a table column)
|
|
78
|
+
* whose result fills the parameter (ADR 22 §3.7). Always cel-v2, built-in
|
|
79
|
+
* functions only; evaluated only by the backend, from the stored schema.
|
|
80
|
+
*/
|
|
81
|
+
readonly expression: string;
|
|
82
|
+
readonly kind: 'EXPRESSION';
|
|
75
83
|
};
|
|
84
|
+
/** Every `FormDataSourceBindingSource` kind this version understands. */
|
|
85
|
+
export declare const FORM_DATA_SOURCE_BINDING_KINDS: readonly ["CONSTANT", "EXPRESSION", "FIELD", "ROW_FIELD"];
|
|
86
|
+
export type FormDataSourceBindingKind = (typeof FORM_DATA_SOURCE_BINDING_KINDS)[number];
|
|
87
|
+
/**
|
|
88
|
+
* Whether `kind` is a binding source this version understands. A schema
|
|
89
|
+
* written by a newer version may carry one it does not; readers must treat
|
|
90
|
+
* that binding as unusable instead of guessing (docs/24 §2.8).
|
|
91
|
+
*/
|
|
92
|
+
export declare const isFormDataSourceBindingKind: (kind: unknown) => kind is FormDataSourceBindingKind;
|
|
76
93
|
export interface FormDataSourceBinding {
|
|
77
94
|
readonly from: FormDataSourceBindingSource;
|
|
78
95
|
readonly parameter: string;
|
|
@@ -114,6 +131,13 @@ export type FormDataSourceValueSnapshot = {
|
|
|
114
131
|
};
|
|
115
132
|
export type FormDataSourceValueSnapshots = Readonly<Record<string, FormDataSourceValueSnapshot>>;
|
|
116
133
|
export type BooleanFieldDefinition = BaseFormFieldDefinition<'boolean'>;
|
|
134
|
+
/**
|
|
135
|
+
* Leads the message of a submission the server refuses because a
|
|
136
|
+
* `file_upload` value names an attachment the case may not take: one uploaded
|
|
137
|
+
* by someone other than its applicant, or one that belongs to another case.
|
|
138
|
+
* A client matches it to show its own copy instead of the server's text.
|
|
139
|
+
*/
|
|
140
|
+
export declare const ATTACHMENT_NOT_BINDABLE_ERROR_CODE = "ATTACHMENT_NOT_BINDABLE";
|
|
117
141
|
export type FileUploadFieldDefinition = BaseFormFieldDefinition<'file_upload'> & {
|
|
118
142
|
readonly acceptedMimeTypes?: readonly string[];
|
|
119
143
|
readonly maxFiles?: number;
|
package/src/lib/form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TEXT_FIELD_PATTERN_ERROR_MESSAGE_MAX_LENGTH = exports.TEXT_FIELD_PATTERN_MAX_LENGTH = exports.TEXT_FIELD_PATTERN_TIME_BUDGET_MS = exports.FORM_TABLE_MAX_ROWS = exports.TABLE_COLUMN_FIELD_TYPES = void 0;
|
|
3
|
+
exports.TEXT_FIELD_PATTERN_ERROR_MESSAGE_MAX_LENGTH = exports.TEXT_FIELD_PATTERN_MAX_LENGTH = exports.TEXT_FIELD_PATTERN_TIME_BUDGET_MS = exports.FORM_TABLE_MAX_ROWS = exports.TABLE_COLUMN_FIELD_TYPES = exports.ATTACHMENT_NOT_BINDABLE_ERROR_CODE = exports.isFormDataSourceBindingKind = exports.FORM_DATA_SOURCE_BINDING_KINDS = void 0;
|
|
4
4
|
exports.isFormOptionFieldDefinition = isFormOptionFieldDefinition;
|
|
5
5
|
exports.isMemberFieldDefinition = isMemberFieldDefinition;
|
|
6
6
|
exports.isOrgUnitFieldDefinition = isOrgUnitFieldDefinition;
|
|
@@ -21,6 +21,28 @@ exports.isFormDataSourceFieldDefinition = isFormDataSourceFieldDefinition;
|
|
|
21
21
|
exports.isFormStaticOptionFieldDefinition = isFormStaticOptionFieldDefinition;
|
|
22
22
|
exports.readFormFieldSelectionMode = readFormFieldSelectionMode;
|
|
23
23
|
exports.normalizeFormDefinitionSchema = normalizeFormDefinitionSchema;
|
|
24
|
+
/** Every `FormDataSourceBindingSource` kind this version understands. */
|
|
25
|
+
exports.FORM_DATA_SOURCE_BINDING_KINDS = [
|
|
26
|
+
'CONSTANT',
|
|
27
|
+
'EXPRESSION',
|
|
28
|
+
'FIELD',
|
|
29
|
+
'ROW_FIELD',
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Whether `kind` is a binding source this version understands. A schema
|
|
33
|
+
* written by a newer version may carry one it does not; readers must treat
|
|
34
|
+
* that binding as unusable instead of guessing (docs/24 §2.8).
|
|
35
|
+
*/
|
|
36
|
+
const isFormDataSourceBindingKind = (kind) => typeof kind === 'string' &&
|
|
37
|
+
exports.FORM_DATA_SOURCE_BINDING_KINDS.includes(kind);
|
|
38
|
+
exports.isFormDataSourceBindingKind = isFormDataSourceBindingKind;
|
|
39
|
+
/**
|
|
40
|
+
* Leads the message of a submission the server refuses because a
|
|
41
|
+
* `file_upload` value names an attachment the case may not take: one uploaded
|
|
42
|
+
* by someone other than its applicant, or one that belongs to another case.
|
|
43
|
+
* A client matches it to show its own copy instead of the server's text.
|
|
44
|
+
*/
|
|
45
|
+
exports.ATTACHMENT_NOT_BINDABLE_ERROR_CODE = 'ATTACHMENT_NOT_BINDABLE';
|
|
24
46
|
/**
|
|
25
47
|
* The column types the structural lint accepts. `text` is listed without
|
|
26
48
|
* `textarea` on purpose — {@link TextFieldDefinition} covers both, and only
|
package/src/lib/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../../libs/shared/src/lib/form.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../../libs/shared/src/lib/form.ts"],"names":[],"mappings":";;;AAwSA,kEASC;AAED,0DAIC;AAED,4DAIC;AAGD,gDAEC;AAQD,8CASC;AAMD,8CAaC;AA2CD,0DAqBC;AAiFD,4EA2BC;AAeD,0DA4CC;AAED,wDAIC;AAED,wDAMC;AAED,oDAUC;AAED,kDASC;AASD,oDAIC;AAOD,wDAIC;AAQD,kDAEC;AAED,0EAQC;AAED,8EAQC;AAED,gEAYC;AAED,sEAOC;AAvkBD,yEAAyE;AAC5D,QAAA,8BAA8B,GAAG;IAC5C,UAAU;IACV,YAAY;IACZ,OAAO;IACP,WAAW;CACsD,CAAC;AAKpE;;;;GAIG;AACI,MAAM,2BAA2B,GAAG,CACzC,IAAa,EACsB,EAAE,CACrC,OAAO,IAAI,KAAK,QAAQ;IACvB,sCAAoD,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAJ1D,QAAA,2BAA2B,+BAI+B;AAmEvE;;;;;GAKG;AACU,QAAA,kCAAkC,GAAG,yBAAyB,CAAC;AAsC5E;;;;GAIG;AACU,QAAA,wBAAwB,GACnC;IACE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AAI,EAAE,MAAA,KAAK,CAAC,IAAI,mCAAI,QAAQ,IAC5B;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,8BAA8B,CACrC,MAA6B;;IAE7B,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAC/D,uCACK,MAAM,KACT,IAAI,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,QAAQ,IAC7B;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -49,6 +49,16 @@ export declare const WORKFLOW_EXPRESSION_LABELS: Readonly<{
|
|
|
49
49
|
nodeApproverResolverExpression: (nodeId: string) => string;
|
|
50
50
|
nodeEntryCondition: (nodeId: string) => string;
|
|
51
51
|
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Node types whose completion records a decision, which is what `lastDecision`
|
|
54
|
+
* reads on the edges leaving them. Every other node (a gateway, a service
|
|
55
|
+
* task, the start) has no task, so on its outgoing edges `lastDecision` is
|
|
56
|
+
* always `null` at run time; the expression lint warns about reading it there
|
|
57
|
+
* (`EXPR_LAST_DECISION_UNAVAILABLE`).
|
|
58
|
+
*/
|
|
59
|
+
export declare const WORKFLOW_DECISION_NODE_TYPES: readonly WorkflowNode['type'][];
|
|
60
|
+
/** Whether an edge leaving a node of this type has a `lastDecision` to read. */
|
|
61
|
+
export declare function hasWorkflowLastDecision(nodeType: string): boolean;
|
|
52
62
|
/**
|
|
53
63
|
* The structural lines of the backend publish lint (`lintWorkflowDefinition`
|
|
54
64
|
* in `@rytass/bpm-core-nestjs-module`). The backend writes them from here and
|
|
@@ -311,7 +321,7 @@ export declare const NOTIFY_WEBHOOK_TARGET_LIMIT = 10;
|
|
|
311
321
|
export declare const NOTIFY_WEBHOOK_ENDPOINT_VERSION_MAX = 2147483647;
|
|
312
322
|
export declare const NOTIFY_WEBHOOK_CONTEXT_PATHS: readonly NotifyWebhookContextPath[];
|
|
313
323
|
export type NotifyWebhookTargetIdFactory = () => string;
|
|
314
|
-
export type NotifyWebhookStructureIssueCode = 'BINDING_CONSTANT_INVALID' | 'BINDING_CONTEXT_PATH_INVALID' | 'BINDING_FIELD_KEY_REQUIRED' | 'BINDING_INVALID' | 'BINDING_PARAMETER_DUPLICATE' | 'BINDING_PARAMETER_REQUIRED' | 'BINDING_SOURCE_INVALID' | 'BINDINGS_NOT_ARRAY' | 'ENDPOINT_KEY_REQUIRED' | 'ENDPOINT_VERSION_INVALID' | 'TARGET_ID_DUPLICATE' | 'TARGET_ID_REQUIRED' | 'TARGET_INVALID' | 'TARGET_LIMIT_EXCEEDED' | 'UNKNOWN_PROPERTY' | 'WEBHOOKS_NOT_ARRAY';
|
|
324
|
+
export type NotifyWebhookStructureIssueCode = 'BINDING_CONSTANT_INVALID' | 'BINDING_CONTEXT_PATH_INVALID' | 'BINDING_EXPRESSION_REQUIRED' | 'BINDING_FIELD_KEY_REQUIRED' | 'BINDING_INVALID' | 'BINDING_PARAMETER_DUPLICATE' | 'BINDING_PARAMETER_REQUIRED' | 'BINDING_SOURCE_INVALID' | 'BINDINGS_NOT_ARRAY' | 'ENDPOINT_KEY_REQUIRED' | 'ENDPOINT_VERSION_INVALID' | 'TARGET_ID_DUPLICATE' | 'TARGET_ID_REQUIRED' | 'TARGET_INVALID' | 'TARGET_LIMIT_EXCEEDED' | 'UNKNOWN_PROPERTY' | 'WEBHOOKS_NOT_ARRAY';
|
|
315
325
|
/**
|
|
316
326
|
* A registry-independent shape problem in a NOTIFY node's `webhooks`.
|
|
317
327
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NOTIFY_WEBHOOK_CONTEXT_PATHS = exports.NOTIFY_WEBHOOK_ENDPOINT_VERSION_MAX = exports.NOTIFY_WEBHOOK_TARGET_LIMIT = exports.DEFAULT_MANAGER_RESOLVER = exports.CONDITION_OPERATORS_REQUIRING_VALUE = exports.DEFAULT_QUORUM_THRESHOLD = exports.DEFAULT_SLA_CONFIG = exports.SLA_TIMEOUT_ACTION_OPTIONS = exports.SLA_CALENDAR_MODE_OPTIONS = exports.SLA_DURATION_UNIT_OPTIONS = exports.CONDITION_OPERATOR_OPTIONS = exports.WORKFLOW_LINT_MESSAGES = exports.WORKFLOW_EXPRESSION_LABELS = exports.APPLICANT_FIELD_CONDITION_RULES = exports.APPROVER_FILLED_FORM_RULES = exports.WORKFLOW_NODE_TYPE_LABELS = exports.WORKFLOW_OUTPUT_HANDLE_ID = exports.WORKFLOW_INPUT_HANDLE_ID = exports.EXCLUDE_INITIATOR_WHEN_EMPTY_VALUES = void 0;
|
|
3
|
+
exports.NOTIFY_WEBHOOK_CONTEXT_PATHS = exports.NOTIFY_WEBHOOK_ENDPOINT_VERSION_MAX = exports.NOTIFY_WEBHOOK_TARGET_LIMIT = exports.DEFAULT_MANAGER_RESOLVER = exports.CONDITION_OPERATORS_REQUIRING_VALUE = exports.DEFAULT_QUORUM_THRESHOLD = exports.DEFAULT_SLA_CONFIG = exports.SLA_TIMEOUT_ACTION_OPTIONS = exports.SLA_CALENDAR_MODE_OPTIONS = exports.SLA_DURATION_UNIT_OPTIONS = exports.CONDITION_OPERATOR_OPTIONS = exports.WORKFLOW_LINT_MESSAGES = exports.WORKFLOW_DECISION_NODE_TYPES = exports.WORKFLOW_EXPRESSION_LABELS = exports.APPLICANT_FIELD_CONDITION_RULES = exports.APPROVER_FILLED_FORM_RULES = exports.WORKFLOW_NODE_TYPE_LABELS = exports.WORKFLOW_OUTPUT_HANDLE_ID = exports.WORKFLOW_INPUT_HANDLE_ID = exports.EXCLUDE_INITIATOR_WHEN_EMPTY_VALUES = void 0;
|
|
4
|
+
exports.hasWorkflowLastDecision = hasWorkflowLastDecision;
|
|
4
5
|
exports.composeSlaDuration = composeSlaDuration;
|
|
5
6
|
exports.composeQuorumThreshold = composeQuorumThreshold;
|
|
6
7
|
exports.readDesignTimeApproverCount = readDesignTimeApproverCount;
|
|
@@ -122,6 +123,18 @@ exports.WORKFLOW_EXPRESSION_LABELS = Object.freeze({
|
|
|
122
123
|
nodeApproverResolverExpression: (nodeId) => `workflow.nodes.${nodeId}.data.approverResolver.expression`,
|
|
123
124
|
nodeEntryCondition: (nodeId) => `workflow.nodes.${nodeId}.data.entryCondition`,
|
|
124
125
|
});
|
|
126
|
+
/**
|
|
127
|
+
* Node types whose completion records a decision, which is what `lastDecision`
|
|
128
|
+
* reads on the edges leaving them. Every other node (a gateway, a service
|
|
129
|
+
* task, the start) has no task, so on its outgoing edges `lastDecision` is
|
|
130
|
+
* always `null` at run time; the expression lint warns about reading it there
|
|
131
|
+
* (`EXPR_LAST_DECISION_UNAVAILABLE`).
|
|
132
|
+
*/
|
|
133
|
+
exports.WORKFLOW_DECISION_NODE_TYPES = Object.freeze(['userTask']);
|
|
134
|
+
/** Whether an edge leaving a node of this type has a `lastDecision` to read. */
|
|
135
|
+
function hasWorkflowLastDecision(nodeType) {
|
|
136
|
+
return exports.WORKFLOW_DECISION_NODE_TYPES.includes(nodeType);
|
|
137
|
+
}
|
|
125
138
|
/**
|
|
126
139
|
* The structural lines of the backend publish lint (`lintWorkflowDefinition`
|
|
127
140
|
* in `@rytass/bpm-core-nestjs-module`). The backend writes them from here and
|
|
@@ -1111,11 +1124,20 @@ function readNotifyWebhookTargetCatalogIssues({ endpoint, formFields, target, })
|
|
|
1111
1124
|
? []
|
|
1112
1125
|
: [createNotifyWebhookCatalogIssue('CONSTANT_INCOMPATIBLE', typed)];
|
|
1113
1126
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1127
|
+
if (from.kind === 'CONTEXT') {
|
|
1128
|
+
// Every CONTEXT path resolves to a string, so anything but a string
|
|
1129
|
+
// or an opaque json parameter is a mistake the author should see.
|
|
1130
|
+
return parameter.type === 'string' || parameter.type === 'json'
|
|
1131
|
+
? []
|
|
1132
|
+
: [createNotifyWebhookCatalogIssue('CONTEXT_INCOMPATIBLE', typed)];
|
|
1133
|
+
}
|
|
1134
|
+
if (from.kind === 'EXPRESSION') {
|
|
1135
|
+
// The browser never parses CEL (docs/24 §2.5): whether the result
|
|
1136
|
+
// fits the parameter is the backend publish lint's call
|
|
1137
|
+
// (`EXPR_RESULT_TYPE_MISMATCH`), against the same endpoint.
|
|
1138
|
+
return [];
|
|
1139
|
+
}
|
|
1140
|
+
return rejectUnknownNotifyWebhookSource(from);
|
|
1119
1141
|
});
|
|
1120
1142
|
return [...requiredIssues, ...bindingIssues];
|
|
1121
1143
|
}
|
|
@@ -1147,6 +1169,12 @@ function readNotifyWebhookCatalogIssueMessage({ endpointLabel, issue, nodeLabel,
|
|
|
1147
1169
|
return `${target}的${parameter}無法使用案件資訊(案件資訊皆為文字)。`;
|
|
1148
1170
|
}
|
|
1149
1171
|
}
|
|
1172
|
+
function rejectUnknownNotifyWebhookSource(from) {
|
|
1173
|
+
void from;
|
|
1174
|
+
// Unreachable for a structurally valid target; a kind this version does not
|
|
1175
|
+
// know is never read as some other kind.
|
|
1176
|
+
return [];
|
|
1177
|
+
}
|
|
1150
1178
|
function createNotifyWebhookCatalogIssue(code, location = {}) {
|
|
1151
1179
|
var _a, _b, _c, _d, _e;
|
|
1152
1180
|
return {
|
|
@@ -1245,10 +1273,14 @@ const BINDING_PROPERTIES = ['from', 'parameter'];
|
|
|
1245
1273
|
const SOURCE_PROPERTIES = {
|
|
1246
1274
|
CONSTANT: ['kind', 'value'],
|
|
1247
1275
|
CONTEXT: ['kind', 'path'],
|
|
1276
|
+
EXPRESSION: ['expression', 'kind'],
|
|
1248
1277
|
FIELD: ['fieldKey', 'kind'],
|
|
1249
1278
|
};
|
|
1250
1279
|
function isNotifyWebhookSourceKind(value) {
|
|
1251
|
-
return value === 'CONSTANT' ||
|
|
1280
|
+
return (value === 'CONSTANT' ||
|
|
1281
|
+
value === 'CONTEXT' ||
|
|
1282
|
+
value === 'EXPRESSION' ||
|
|
1283
|
+
value === 'FIELD');
|
|
1252
1284
|
}
|
|
1253
1285
|
function readUnknownProperties(value, allowed, prefix) {
|
|
1254
1286
|
// A key holding `undefined` disappears in JSON, so the backend never sees
|
|
@@ -1281,6 +1313,14 @@ function readNotifyWebhookSourceIssues(source, location) {
|
|
|
1281
1313
|
? []
|
|
1282
1314
|
: [createNotifyWebhookIssue('BINDING_CONSTANT_INVALID', location)];
|
|
1283
1315
|
}
|
|
1316
|
+
// Only the shape: a non-blank string. Roots, fields, functions and the
|
|
1317
|
+
// result type are the backend publish lint's (ADR 22 §3.7).
|
|
1318
|
+
if (source['kind'] === 'EXPRESSION') {
|
|
1319
|
+
const expression = source['expression'];
|
|
1320
|
+
return typeof expression === 'string' && expression.trim()
|
|
1321
|
+
? []
|
|
1322
|
+
: [createNotifyWebhookIssue('BINDING_EXPRESSION_REQUIRED', location)];
|
|
1323
|
+
}
|
|
1284
1324
|
return [createNotifyWebhookIssue('BINDING_SOURCE_INVALID', location)];
|
|
1285
1325
|
}
|
|
1286
1326
|
function createNotifyWebhookIssue(code, location = {}) {
|
|
@@ -1297,7 +1337,7 @@ function isPlainRecord(value) {
|
|
|
1297
1337
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1298
1338
|
}
|
|
1299
1339
|
function readNotifyWebhookIssueMessage(issue, nodeLabel) {
|
|
1300
|
-
var _a, _b, _c, _d, _e;
|
|
1340
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1301
1341
|
const target = issue.targetIndex === null
|
|
1302
1342
|
? `知會節點「${nodeLabel}」`
|
|
1303
1343
|
: `知會節點「${nodeLabel}」的第 ${issue.targetIndex + 1} 個 Webhook`;
|
|
@@ -1317,8 +1357,10 @@ function readNotifyWebhookIssueMessage(issue, nodeLabel) {
|
|
|
1317
1357
|
return `${target}的參數「${(_c = issue.parameter) !== null && _c !== void 0 ? _c : ''}」需要選擇案件資訊。`;
|
|
1318
1358
|
case 'BINDING_CONSTANT_INVALID':
|
|
1319
1359
|
return `${target}的參數「${(_d = issue.parameter) !== null && _d !== void 0 ? _d : ''}」固定值格式錯誤。`;
|
|
1360
|
+
case 'BINDING_EXPRESSION_REQUIRED':
|
|
1361
|
+
return `${target}的參數「${(_e = issue.parameter) !== null && _e !== void 0 ? _e : ''}」需要填寫運算式。`;
|
|
1320
1362
|
case 'UNKNOWN_PROPERTY':
|
|
1321
|
-
return `${target}包含不支援的設定「${(
|
|
1363
|
+
return `${target}包含不支援的設定「${(_f = issue.property) !== null && _f !== void 0 ? _f : ''}」,請移除後重新新增。`;
|
|
1322
1364
|
default:
|
|
1323
1365
|
return `${target}設定格式錯誤,請移除後重新新增。`;
|
|
1324
1366
|
}
|