@azx-pbc/axiom-form-builder 0.0.0-stage → 0.0.6
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/LICENSE +21 -0
- package/README.md +231 -2
- package/dist/bridge/index.d.ts +12 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +10 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/inspector-commands.d.ts +55 -0
- package/dist/bridge/inspector-commands.d.ts.map +1 -0
- package/dist/bridge/inspector-commands.js +532 -0
- package/dist/bridge/inspector-commands.js.map +1 -0
- package/dist/bridge/rule-context.d.ts +57 -0
- package/dist/bridge/rule-context.d.ts.map +1 -0
- package/dist/bridge/rule-context.js +302 -0
- package/dist/bridge/rule-context.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector.d.ts +125 -0
- package/dist/inspector.d.ts.map +1 -0
- package/dist/inspector.js +2 -0
- package/dist/inspector.js.map +1 -0
- package/dist/reference/ReferencePicker.d.ts +59 -0
- package/dist/reference/ReferencePicker.d.ts.map +1 -0
- package/dist/reference/ReferencePicker.js +145 -0
- package/dist/reference/ReferencePicker.js.map +1 -0
- package/dist/reference/index.d.ts +13 -0
- package/dist/reference/index.d.ts.map +1 -0
- package/dist/reference/index.js +11 -0
- package/dist/reference/index.js.map +1 -0
- package/dist/reference/token.d.ts +44 -0
- package/dist/reference/token.d.ts.map +1 -0
- package/dist/reference/token.js +141 -0
- package/dist/reference/token.js.map +1 -0
- package/dist/reference/types.d.ts +49 -0
- package/dist/reference/types.d.ts.map +1 -0
- package/dist/reference/types.js +2 -0
- package/dist/reference/types.js.map +1 -0
- package/dist/rules/ConditionEditor.d.ts +38 -0
- package/dist/rules/ConditionEditor.d.ts.map +1 -0
- package/dist/rules/ConditionEditor.js +79 -0
- package/dist/rules/ConditionEditor.js.map +1 -0
- package/dist/rules/RuleBuilder.d.ts +76 -0
- package/dist/rules/RuleBuilder.d.ts.map +1 -0
- package/dist/rules/RuleBuilder.js +336 -0
- package/dist/rules/RuleBuilder.js.map +1 -0
- package/dist/rules/RuleList.d.ts +45 -0
- package/dist/rules/RuleList.d.ts.map +1 -0
- package/dist/rules/RuleList.js +62 -0
- package/dist/rules/RuleList.js.map +1 -0
- package/dist/rules/RuleMessageEditor.d.ts +38 -0
- package/dist/rules/RuleMessageEditor.d.ts.map +1 -0
- package/dist/rules/RuleMessageEditor.js +38 -0
- package/dist/rules/RuleMessageEditor.js.map +1 -0
- package/dist/rules/ValidationEditor.d.ts +60 -0
- package/dist/rules/ValidationEditor.d.ts.map +1 -0
- package/dist/rules/ValidationEditor.js +299 -0
- package/dist/rules/ValidationEditor.js.map +1 -0
- package/dist/rules/condition.d.ts +12 -0
- package/dist/rules/condition.d.ts.map +1 -0
- package/dist/rules/condition.js +46 -0
- package/dist/rules/condition.js.map +1 -0
- package/dist/rules/expression.d.ts +57 -0
- package/dist/rules/expression.d.ts.map +1 -0
- package/dist/rules/expression.js +286 -0
- package/dist/rules/expression.js.map +1 -0
- package/dist/rules/index.d.ts +28 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +19 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/messages.d.ts +64 -0
- package/dist/rules/messages.d.ts.map +1 -0
- package/dist/rules/messages.js +114 -0
- package/dist/rules/messages.js.map +1 -0
- package/dist/rules/operators.d.ts +25 -0
- package/dist/rules/operators.d.ts.map +1 -0
- package/dist/rules/operators.js +128 -0
- package/dist/rules/operators.js.map +1 -0
- package/dist/rules/sentence.d.ts +151 -0
- package/dist/rules/sentence.d.ts.map +1 -0
- package/dist/rules/sentence.js +527 -0
- package/dist/rules/sentence.js.map +1 -0
- package/dist/rules/templates.d.ts +163 -0
- package/dist/rules/templates.d.ts.map +1 -0
- package/dist/rules/templates.js +560 -0
- package/dist/rules/templates.js.map +1 -0
- package/dist/rules/types.d.ts +209 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +2 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/rules/validation-editor-api.d.ts +12 -0
- package/dist/rules/validation-editor-api.d.ts.map +1 -0
- package/dist/rules/validation-editor-api.js +12 -0
- package/dist/rules/validation-editor-api.js.map +1 -0
- package/dist/rules/validation.d.ts +27 -0
- package/dist/rules/validation.d.ts.map +1 -0
- package/dist/rules/validation.js +184 -0
- package/dist/rules/validation.js.map +1 -0
- package/dist/styles.css +900 -0
- package/package.json +65 -3
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The validation operators, in the order a person reads them.
|
|
3
|
+
*
|
|
4
|
+
* The ids are the vocabulary the rules vocabulary and the inspector share; the labels are the
|
|
5
|
+
* package's English defaults and every one is overridable. `satisfies` makes a missing or extra
|
|
6
|
+
* operator a compile error rather than a silent hole in the editor.
|
|
7
|
+
*/
|
|
8
|
+
const VALIDATION_OPERATOR_DEFINITIONS = [
|
|
9
|
+
{ id: 'is_empty', label: 'is empty', arity: 'none' },
|
|
10
|
+
{ id: 'is_not_empty', label: 'is not empty', arity: 'none' },
|
|
11
|
+
{ id: 'equals', label: 'equals', arity: 'one' },
|
|
12
|
+
{ id: 'not_equals', label: 'does not equal', arity: 'one' },
|
|
13
|
+
{ id: 'greater_than', label: 'greater than', arity: 'one' },
|
|
14
|
+
{ id: 'less_than', label: 'less than', arity: 'one' },
|
|
15
|
+
{ id: 'greater_or_equal', label: 'greater than or equal', arity: 'one' },
|
|
16
|
+
{ id: 'less_or_equal', label: 'less than or equal', arity: 'one' },
|
|
17
|
+
{ id: 'contains', label: 'contains', arity: 'one' },
|
|
18
|
+
{ id: 'starts_with', label: 'starts with', arity: 'one' },
|
|
19
|
+
{ id: 'ends_with', label: 'ends with', arity: 'one' },
|
|
20
|
+
{ id: 'one_of', label: 'is one of', arity: 'list' },
|
|
21
|
+
{ id: 'not_one_of', label: 'is not one of', arity: 'list' },
|
|
22
|
+
{ id: 'between', label: 'between', arity: 'two' },
|
|
23
|
+
{ id: 'matches_pattern', label: 'matches pattern', arity: 'pattern' },
|
|
24
|
+
];
|
|
25
|
+
/** The operator ids in reading order. */
|
|
26
|
+
const VALIDATION_OPERATOR_IDS = VALIDATION_OPERATOR_DEFINITIONS.map((definition) => definition.id);
|
|
27
|
+
const DEFINITIONS_BY_ID = new Map(VALIDATION_OPERATOR_DEFINITIONS.map((definition) => [definition.id, definition]));
|
|
28
|
+
/** The definition for one operator. */
|
|
29
|
+
export function validationOperatorDefinition(operator) {
|
|
30
|
+
const definition = DEFINITIONS_BY_ID.get(operator);
|
|
31
|
+
if (definition === undefined) {
|
|
32
|
+
// The union is closed and the map is built from it, so this is a broken invariant rather than
|
|
33
|
+
// an author's mistake.
|
|
34
|
+
throw new Error(`no definition for validation operator ${operator}`);
|
|
35
|
+
}
|
|
36
|
+
return definition;
|
|
37
|
+
}
|
|
38
|
+
/** The comparison operator one validation operator emits, or `undefined` for a call-shaped one. */
|
|
39
|
+
export function comparisonOperatorOf(operator) {
|
|
40
|
+
switch (operator) {
|
|
41
|
+
case 'equals':
|
|
42
|
+
return '==';
|
|
43
|
+
case 'not_equals':
|
|
44
|
+
return '!=';
|
|
45
|
+
case 'greater_than':
|
|
46
|
+
return '>';
|
|
47
|
+
case 'less_than':
|
|
48
|
+
return '<';
|
|
49
|
+
case 'greater_or_equal':
|
|
50
|
+
return '>=';
|
|
51
|
+
case 'less_or_equal':
|
|
52
|
+
return '<=';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const ORDERABLE = new Set([
|
|
56
|
+
'string',
|
|
57
|
+
'integer',
|
|
58
|
+
'decimal',
|
|
59
|
+
'money',
|
|
60
|
+
'date',
|
|
61
|
+
'instant',
|
|
62
|
+
]);
|
|
63
|
+
const EQUATABLE = new Set([
|
|
64
|
+
'string',
|
|
65
|
+
'boolean',
|
|
66
|
+
'integer',
|
|
67
|
+
'decimal',
|
|
68
|
+
'money',
|
|
69
|
+
'date',
|
|
70
|
+
'instant',
|
|
71
|
+
]);
|
|
72
|
+
/** Whether an operator is offered for a field's primitive. */
|
|
73
|
+
export function operatorApplies(operator, primitive) {
|
|
74
|
+
switch (operator) {
|
|
75
|
+
case 'is_empty':
|
|
76
|
+
case 'is_not_empty':
|
|
77
|
+
// Presence is the one operator every declaration carries: `empty()` and `present()` are
|
|
78
|
+
// typed over any operand, so the primitive registry cannot withhold them.
|
|
79
|
+
return true;
|
|
80
|
+
case 'equals':
|
|
81
|
+
case 'not_equals':
|
|
82
|
+
return EQUATABLE.has(primitive);
|
|
83
|
+
case 'greater_than':
|
|
84
|
+
case 'less_than':
|
|
85
|
+
case 'greater_or_equal':
|
|
86
|
+
case 'less_or_equal':
|
|
87
|
+
case 'between':
|
|
88
|
+
return ORDERABLE.has(primitive);
|
|
89
|
+
case 'contains':
|
|
90
|
+
case 'starts_with':
|
|
91
|
+
case 'ends_with':
|
|
92
|
+
case 'matches_pattern':
|
|
93
|
+
return primitive === 'string';
|
|
94
|
+
case 'one_of':
|
|
95
|
+
case 'not_one_of':
|
|
96
|
+
return EQUATABLE.has(primitive);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/** The operators the editor offers for one field, in reading order. */
|
|
100
|
+
export function operatorsForField(field) {
|
|
101
|
+
if (field === undefined)
|
|
102
|
+
return VALIDATION_OPERATOR_IDS;
|
|
103
|
+
return VALIDATION_OPERATOR_IDS.filter((operator) => operatorApplies(operator, field.primitive));
|
|
104
|
+
}
|
|
105
|
+
/** The first operator a field may use, and the one a field change falls back to. */
|
|
106
|
+
export function defaultOperatorFor(field) {
|
|
107
|
+
const [first] = operatorsForField(field);
|
|
108
|
+
return first ?? 'equals';
|
|
109
|
+
}
|
|
110
|
+
/** Whether a field can stand in as the right-hand operand of an operator over `primitive`. */
|
|
111
|
+
export function operandFieldCompatible(operator, primitive, candidate) {
|
|
112
|
+
switch (operator) {
|
|
113
|
+
case 'one_of':
|
|
114
|
+
case 'not_one_of':
|
|
115
|
+
// A list operand may name a field only when that field carries a list of the same domain.
|
|
116
|
+
return (candidate.primitive === 'array' &&
|
|
117
|
+
candidate.itemPrimitive !== undefined &&
|
|
118
|
+
EQUATABLE.has(primitive) &&
|
|
119
|
+
candidate.itemPrimitive === primitive);
|
|
120
|
+
case 'is_empty':
|
|
121
|
+
case 'is_not_empty':
|
|
122
|
+
case 'matches_pattern':
|
|
123
|
+
return false;
|
|
124
|
+
default:
|
|
125
|
+
return candidate.primitive === primitive;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=operators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/rules/operators.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,MAAM,+BAA+B,GAA4C;IAC/E,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE;IACpD,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5D,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE;IAC/C,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE;IAC3D,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE;IAC3D,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE;IACrD,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK,EAAE;IACxE,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE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Y;YACf,OAAO,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAAC,KAA4B;IAC5D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,uBAAuB,CAAC;IACxD,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,kBAAkB,CAAC,KAA4B;IAC7D,MAAM,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,KAAK,IAAI,QAAQ,CAAC;AAC3B,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,sBAAsB,CACpC,QAA4B,EAC5B,SAAoB,EACpB,SAAoB;IAEpB,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,YAAY;YACf,0FAA0F;YAC1F,OAAO,CACL,SAAS,CAAC,SAAS,KAAK,OAAO;gBAC/B,SAAS,CAAC,aAAa,KAAK,SAAS;gBACrC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;gBACxB,SAAS,CAAC,aAAa,KAAK,SAAS,CACtC,CAAC;QACJ,KAAK,UAAU,CAAC;QAChB,KAAK,cAAc,CAAC;QACpB,KAAK,iBAAiB;YACpB,OAAO,KAAK,CAAC;QACf;YACE,OAAO,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC;IAC7C,CAAC;AACH,CAAC","sourcesContent":["import type { Primitive } from '@azx-pbc/axiom-runtime';\nimport type { ComparisonValidationOperator, RuleField, ValidationOperator } from './types.js';\n\n/** How many operands an operator's editor shows. */\ntype OperatorArity = 'none' | 'one' | 'two' | 'list' | 'pattern';\n\n/** One operator's label and the editor shape it needs. */\nexport interface ValidationOperatorDefinition {\n readonly id: ValidationOperator;\n /** The owner's own phrase; a host may override every label through the editor's `labels`. */\n readonly label: string;\n readonly arity: OperatorArity;\n}\n\n/**\n * The validation operators, in the order a person reads them.\n *\n * The ids are the vocabulary the rules vocabulary and the inspector share; the labels are the\n * package's English defaults and every one is overridable. `satisfies` makes a missing or extra\n * operator a compile error rather than a silent hole in the editor.\n */\nconst VALIDATION_OPERATOR_DEFINITIONS: readonly ValidationOperatorDefinition[] = [\n { id: 'is_empty', label: 'is empty', arity: 'none' },\n { id: 'is_not_empty', label: 'is not empty', arity: 'none' },\n { id: 'equals', label: 'equals', arity: 'one' },\n { id: 'not_equals', label: 'does not equal', arity: 'one' },\n { id: 'greater_than', label: 'greater than', arity: 'one' },\n { id: 'less_than', label: 'less than', arity: 'one' },\n { id: 'greater_or_equal', label: 'greater than or equal', arity: 'one' },\n { id: 'less_or_equal', label: 'less than or equal', arity: 'one' },\n { id: 'contains', label: 'contains', arity: 'one' },\n { id: 'starts_with', label: 'starts with', arity: 'one' },\n { id: 'ends_with', label: 'ends with', arity: 'one' },\n { id: 'one_of', label: 'is one of', arity: 'list' },\n { id: 'not_one_of', label: 'is not one of', arity: 'list' },\n { id: 'between', label: 'between', arity: 'two' },\n { id: 'matches_pattern', label: 'matches pattern', arity: 'pattern' },\n] as const satisfies readonly ValidationOperatorDefinition[];\n\n/** The operator ids in reading order. */\nconst VALIDATION_OPERATOR_IDS: readonly ValidationOperator[] = VALIDATION_OPERATOR_DEFINITIONS.map(\n (definition) => definition.id,\n);\n\nconst DEFINITIONS_BY_ID: ReadonlyMap<ValidationOperator, ValidationOperatorDefinition> = new Map(\n VALIDATION_OPERATOR_DEFINITIONS.map((definition) => [definition.id, definition]),\n);\n\n/** The definition for one operator. */\nexport function validationOperatorDefinition(\n operator: ValidationOperator,\n): ValidationOperatorDefinition {\n const definition = DEFINITIONS_BY_ID.get(operator);\n if (definition === undefined) {\n // The union is closed and the map is built from it, so this is a broken invariant rather than\n // an author's mistake.\n throw new Error(`no definition for validation operator ${operator}`);\n }\n return definition;\n}\n\n/** The comparison operator one validation operator emits, or `undefined` for a call-shaped one. */\nexport function comparisonOperatorOf(\n operator: ComparisonValidationOperator,\n): '==' | '!=' | '<' | '<=' | '>' | '>=' {\n switch (operator) {\n case 'equals':\n return '==';\n case 'not_equals':\n return '!=';\n case 'greater_than':\n return '>';\n case 'less_than':\n return '<';\n case 'greater_or_equal':\n return '>=';\n case 'less_or_equal':\n return '<=';\n }\n}\n\nconst ORDERABLE: ReadonlySet<Primitive> = new Set([\n 'string',\n 'integer',\n 'decimal',\n 'money',\n 'date',\n 'instant',\n]);\n\nconst EQUATABLE: ReadonlySet<Primitive> = new Set([\n 'string',\n 'boolean',\n 'integer',\n 'decimal',\n 'money',\n 'date',\n 'instant',\n]);\n\n/** Whether an operator is offered for a field's primitive. */\nexport function operatorApplies(operator: ValidationOperator, primitive: Primitive): boolean {\n switch (operator) {\n case 'is_empty':\n case 'is_not_empty':\n // Presence is the one operator every declaration carries: `empty()` and `present()` are\n // typed over any operand, so the primitive registry cannot withhold them.\n return true;\n case 'equals':\n case 'not_equals':\n return EQUATABLE.has(primitive);\n case 'greater_than':\n case 'less_than':\n case 'greater_or_equal':\n case 'less_or_equal':\n case 'between':\n return ORDERABLE.has(primitive);\n case 'contains':\n case 'starts_with':\n case 'ends_with':\n case 'matches_pattern':\n return primitive === 'string';\n case 'one_of':\n case 'not_one_of':\n return EQUATABLE.has(primitive);\n }\n}\n\n/** The operators the editor offers for one field, in reading order. */\nexport function operatorsForField(field: RuleField | undefined): readonly ValidationOperator[] {\n if (field === undefined) return VALIDATION_OPERATOR_IDS;\n return VALIDATION_OPERATOR_IDS.filter((operator) => operatorApplies(operator, field.primitive));\n}\n\n/** The first operator a field may use, and the one a field change falls back to. */\nexport function defaultOperatorFor(field: RuleField | undefined): ValidationOperator {\n const [first] = operatorsForField(field);\n return first ?? 'equals';\n}\n\n/** Whether a field can stand in as the right-hand operand of an operator over `primitive`. */\nexport function operandFieldCompatible(\n operator: ValidationOperator,\n primitive: Primitive,\n candidate: RuleField,\n): boolean {\n switch (operator) {\n case 'one_of':\n case 'not_one_of':\n // A list operand may name a field only when that field carries a list of the same domain.\n return (\n candidate.primitive === 'array' &&\n candidate.itemPrimitive !== undefined &&\n EQUATABLE.has(primitive) &&\n candidate.itemPrimitive === primitive\n );\n case 'is_empty':\n case 'is_not_empty':\n case 'matches_pattern':\n return false;\n default:\n return candidate.primitive === primitive;\n }\n}\n"]}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { ReadableRule, RuleContext } from './types.js';
|
|
2
|
+
/** The comparison word a condition sentence uses. */
|
|
3
|
+
type ComparisonWord = 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'greater_or_equal' | 'less_or_equal';
|
|
4
|
+
/** A condition rendered as clauses; `raw` is the source of a shape the recogniser does not know. */
|
|
5
|
+
type ConditionSentence = {
|
|
6
|
+
readonly kind: 'compare';
|
|
7
|
+
readonly left: string;
|
|
8
|
+
readonly operator: ComparisonWord;
|
|
9
|
+
readonly right: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'text';
|
|
12
|
+
readonly left: string;
|
|
13
|
+
readonly operator: 'contains' | 'starts_with' | 'ends_with';
|
|
14
|
+
readonly right: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'empty';
|
|
17
|
+
readonly operand: string;
|
|
18
|
+
readonly negated: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'between';
|
|
21
|
+
readonly value: string;
|
|
22
|
+
readonly lower: string;
|
|
23
|
+
readonly upper: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'membership';
|
|
26
|
+
readonly value: string;
|
|
27
|
+
readonly candidates: string;
|
|
28
|
+
readonly negated: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'pattern';
|
|
31
|
+
readonly value: string;
|
|
32
|
+
readonly pattern: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: 'unique';
|
|
35
|
+
readonly table: string;
|
|
36
|
+
readonly column: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: 'not';
|
|
39
|
+
readonly operand: ConditionSentence;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'and' | 'or';
|
|
42
|
+
readonly operands: readonly ConditionSentence[];
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'raw';
|
|
45
|
+
readonly source: string;
|
|
46
|
+
};
|
|
47
|
+
/** How a compute rule calculates its field. */
|
|
48
|
+
type CalculationSentence = {
|
|
49
|
+
readonly kind: 'total';
|
|
50
|
+
readonly column: string;
|
|
51
|
+
readonly table: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'count';
|
|
54
|
+
readonly table: string;
|
|
55
|
+
readonly condition: ConditionSentence;
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: 'any' | 'all';
|
|
58
|
+
readonly table: string;
|
|
59
|
+
readonly condition: ConditionSentence;
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'formula';
|
|
62
|
+
readonly source: string;
|
|
63
|
+
};
|
|
64
|
+
/** One rule as the English sentence it means. */
|
|
65
|
+
export type RuleSentence = {
|
|
66
|
+
readonly kind: 'required';
|
|
67
|
+
readonly field: string;
|
|
68
|
+
readonly condition?: ConditionSentence;
|
|
69
|
+
} | {
|
|
70
|
+
readonly kind: 'visible';
|
|
71
|
+
readonly fields: readonly string[];
|
|
72
|
+
readonly hidden: boolean;
|
|
73
|
+
readonly condition?: ConditionSentence;
|
|
74
|
+
} | {
|
|
75
|
+
readonly kind: 'compute';
|
|
76
|
+
readonly field: string;
|
|
77
|
+
readonly calculation: CalculationSentence;
|
|
78
|
+
} | {
|
|
79
|
+
readonly kind: 'check';
|
|
80
|
+
readonly condition: ConditionSentence;
|
|
81
|
+
} | {
|
|
82
|
+
readonly kind: 'unique';
|
|
83
|
+
readonly table: string;
|
|
84
|
+
readonly column: string;
|
|
85
|
+
} | {
|
|
86
|
+
readonly kind: 'gate';
|
|
87
|
+
readonly conditions: readonly ConditionSentence[];
|
|
88
|
+
readonly activeWhen?: ConditionSentence;
|
|
89
|
+
} | {
|
|
90
|
+
readonly kind: 'screen';
|
|
91
|
+
readonly field?: string;
|
|
92
|
+
readonly condition: ConditionSentence;
|
|
93
|
+
} | {
|
|
94
|
+
readonly kind: 'enable';
|
|
95
|
+
readonly field: string;
|
|
96
|
+
readonly condition: ConditionSentence;
|
|
97
|
+
} | {
|
|
98
|
+
readonly kind: 'default';
|
|
99
|
+
readonly field: string;
|
|
100
|
+
readonly source: string;
|
|
101
|
+
} | {
|
|
102
|
+
readonly kind: 'advanced';
|
|
103
|
+
};
|
|
104
|
+
/** The chrome and grammar the renderer uses; every member is overridable by a host. */
|
|
105
|
+
export interface RuleSentenceLabels {
|
|
106
|
+
readonly and: string;
|
|
107
|
+
readonly or: string;
|
|
108
|
+
readonly not: string;
|
|
109
|
+
readonly always: string;
|
|
110
|
+
readonly advanced: string;
|
|
111
|
+
readonly listAnd: (items: readonly string[]) => string;
|
|
112
|
+
readonly operator: Readonly<Record<ComparisonWord | 'contains' | 'starts_with' | 'ends_with', string>>;
|
|
113
|
+
readonly required: (field: string) => string;
|
|
114
|
+
readonly requiredWhen: (field: string, condition: string) => string;
|
|
115
|
+
readonly visibleAlways: (fields: string) => string;
|
|
116
|
+
readonly visibleWhen: (fields: string, condition: string) => string;
|
|
117
|
+
readonly hiddenWhen: (fields: string, condition: string) => string;
|
|
118
|
+
readonly calculateTotal: (field: string, column: string, table: string) => string;
|
|
119
|
+
readonly calculateCount: (field: string, table: string, condition: string) => string;
|
|
120
|
+
readonly calculateAny: (field: string, table: string, condition: string) => string;
|
|
121
|
+
readonly calculateAll: (field: string, table: string, condition: string) => string;
|
|
122
|
+
readonly calculateFormula: (field: string, source: string) => string;
|
|
123
|
+
readonly check: (condition: string) => string;
|
|
124
|
+
readonly unique: (column: string, table: string) => string;
|
|
125
|
+
readonly gate: (conditions: readonly string[]) => string;
|
|
126
|
+
readonly gateWhen: (conditions: readonly string[], activeWhen: string) => string;
|
|
127
|
+
readonly screen: (field: string | undefined, condition: string) => string;
|
|
128
|
+
readonly enable: (field: string, condition: string) => string;
|
|
129
|
+
readonly default: (field: string, source: string) => string;
|
|
130
|
+
readonly isNot: (operand: string) => string;
|
|
131
|
+
readonly isEmpty: (operand: string) => string;
|
|
132
|
+
readonly isNotEmpty: (operand: string) => string;
|
|
133
|
+
readonly isBetween: (value: string, lower: string, upper: string) => string;
|
|
134
|
+
readonly isOneOf: (value: string, candidates: string) => string;
|
|
135
|
+
readonly isNotOneOf: (value: string, candidates: string) => string;
|
|
136
|
+
readonly matches: (value: string, pattern: string) => string;
|
|
137
|
+
readonly noDuplicate: (column: string, table: string) => string;
|
|
138
|
+
}
|
|
139
|
+
/** The package's English defaults; a host passes its own object to localise every sentence. */
|
|
140
|
+
export declare const DEFAULT_RULE_SENTENCE_LABELS: RuleSentenceLabels;
|
|
141
|
+
/**
|
|
142
|
+
* Reads one rule as the sentence it means, or the catalogue's advanced sentence when the rule's
|
|
143
|
+
* shape is not one this reader recognises.
|
|
144
|
+
*/
|
|
145
|
+
export declare function deriveRuleSentence(rule: ReadableRule, context: RuleContext): RuleSentence;
|
|
146
|
+
/** Renders one rule sentence; a host may pass its own labels to localise every phrase. */
|
|
147
|
+
export declare function renderRuleSentence(sentence: RuleSentence, labels?: RuleSentenceLabels): string;
|
|
148
|
+
/** The one-line sentence for a rule, with the package's default English chrome. */
|
|
149
|
+
export declare function ruleSentence(rule: ReadableRule, context: RuleContext, labels?: RuleSentenceLabels): string;
|
|
150
|
+
export {};
|
|
151
|
+
//# sourceMappingURL=sentence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentence.d.ts","sourceRoot":"","sources":["../../src/rules/sentence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D,qDAAqD;AACrD,KAA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