@azx-pbc/axiom-builder 0.0.0-stage → 0.0.1
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 +648 -2
- package/dist/cards/selectors.d.ts +70 -0
- package/dist/cards/selectors.d.ts.map +1 -0
- package/dist/cards/selectors.js +194 -0
- package/dist/cards/selectors.js.map +1 -0
- package/dist/definition.d.ts +36 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +48 -0
- package/dist/definition.js.map +1 -0
- package/dist/evidence/cases.d.ts +44 -0
- package/dist/evidence/cases.d.ts.map +1 -0
- package/dist/evidence/cases.js +578 -0
- package/dist/evidence/cases.js.map +1 -0
- package/dist/evidence/repairs.d.ts +99 -0
- package/dist/evidence/repairs.d.ts.map +1 -0
- package/dist/evidence/repairs.js +181 -0
- package/dist/evidence/repairs.js.map +1 -0
- package/dist/evidence/summary.d.ts +35 -0
- package/dist/evidence/summary.d.ts.map +1 -0
- package/dist/evidence/summary.js +38 -0
- package/dist/evidence/summary.js.map +1 -0
- package/dist/i18n/gaps.d.ts +3 -0
- package/dist/i18n/gaps.d.ts.map +1 -0
- package/dist/i18n/gaps.js +2 -0
- package/dist/i18n/gaps.js.map +1 -0
- package/dist/i18n/message-slots.d.ts +19 -0
- package/dist/i18n/message-slots.d.ts.map +1 -0
- package/dist/i18n/message-slots.js +101 -0
- package/dist/i18n/message-slots.js.map +1 -0
- package/dist/i18n/text-locale.d.ts +13 -0
- package/dist/i18n/text-locale.d.ts.map +1 -0
- package/dist/i18n/text-locale.js +14 -0
- package/dist/i18n/text-locale.js.map +1 -0
- package/dist/i18n/translations.d.ts +56 -0
- package/dist/i18n/translations.d.ts.map +1 -0
- package/dist/i18n/translations.js +103 -0
- package/dist/i18n/translations.js.map +1 -0
- package/dist/impact/references.d.ts +143 -0
- package/dist/impact/references.d.ts.map +1 -0
- package/dist/impact/references.js +429 -0
- package/dist/impact/references.js.map +1 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/preview/compile-preview.d.ts +67 -0
- package/dist/preview/compile-preview.d.ts.map +1 -0
- package/dist/preview/compile-preview.js +286 -0
- package/dist/preview/compile-preview.js.map +1 -0
- package/dist/preview/handle.d.ts +119 -0
- package/dist/preview/handle.d.ts.map +1 -0
- package/dist/preview/handle.js +2 -0
- package/dist/preview/handle.js.map +1 -0
- package/dist/preview/held.d.ts +39 -0
- package/dist/preview/held.d.ts.map +1 -0
- package/dist/preview/held.js +15 -0
- package/dist/preview/held.js.map +1 -0
- package/dist/preview/measurement.d.ts +5 -0
- package/dist/preview/measurement.d.ts.map +1 -0
- package/dist/preview/measurement.js +18 -0
- package/dist/preview/measurement.js.map +1 -0
- package/dist/publish/build.d.ts +33 -0
- package/dist/publish/build.d.ts.map +1 -0
- package/dist/publish/build.js +15 -0
- package/dist/publish/build.js.map +1 -0
- package/dist/publish/diff.d.ts +208 -0
- package/dist/publish/diff.d.ts.map +1 -0
- package/dist/publish/diff.js +227 -0
- package/dist/publish/diff.js.map +1 -0
- package/dist/publish/review.d.ts +41 -0
- package/dist/publish/review.d.ts.map +1 -0
- package/dist/publish/review.js +22 -0
- package/dist/publish/review.js.map +1 -0
- package/dist/schema/dataset-input.d.ts +30 -0
- package/dist/schema/dataset-input.d.ts.map +1 -0
- package/dist/schema/dataset-input.js +58 -0
- package/dist/schema/dataset-input.js.map +1 -0
- package/dist/schema/dataset.d.ts +166 -0
- package/dist/schema/dataset.d.ts.map +1 -0
- package/dist/schema/dataset.js +281 -0
- package/dist/schema/dataset.js.map +1 -0
- package/dist/schema/declarations.d.ts +15 -0
- package/dist/schema/declarations.d.ts.map +1 -0
- package/dist/schema/declarations.js +47 -0
- package/dist/schema/declarations.js.map +1 -0
- package/dist/schema/document.d.ts +504 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +337 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/error.d.ts +15 -0
- package/dist/schema/error.d.ts.map +1 -0
- package/dist/schema/error.js +18 -0
- package/dist/schema/error.js.map +1 -0
- package/dist/schema/field-id.d.ts +8 -0
- package/dist/schema/field-id.d.ts.map +1 -0
- package/dist/schema/field-id.js +47 -0
- package/dist/schema/field-id.js.map +1 -0
- package/dist/schema/layout.d.ts +118 -0
- package/dist/schema/layout.d.ts.map +1 -0
- package/dist/schema/layout.js +101 -0
- package/dist/schema/layout.js.map +1 -0
- package/dist/schema/palette.d.ts +103 -0
- package/dist/schema/palette.d.ts.map +1 -0
- package/dist/schema/palette.js +140 -0
- package/dist/schema/palette.js.map +1 -0
- package/dist/schema/read.d.ts +49 -0
- package/dist/schema/read.d.ts.map +1 -0
- package/dist/schema/read.js +942 -0
- package/dist/schema/read.js.map +1 -0
- package/dist/store/apply-dataset.d.ts +14 -0
- package/dist/store/apply-dataset.d.ts.map +1 -0
- package/dist/store/apply-dataset.js +513 -0
- package/dist/store/apply-dataset.js.map +1 -0
- package/dist/store/apply.d.ts +37 -0
- package/dist/store/apply.d.ts.map +1 -0
- package/dist/store/apply.js +2269 -0
- package/dist/store/apply.js.map +1 -0
- package/dist/store/candidate.d.ts +37 -0
- package/dist/store/candidate.d.ts.map +1 -0
- package/dist/store/candidate.js +178 -0
- package/dist/store/candidate.js.map +1 -0
- package/dist/store/commands/coverage.d.ts +58 -0
- package/dist/store/commands/coverage.d.ts.map +1 -0
- package/dist/store/commands/coverage.js +354 -0
- package/dist/store/commands/coverage.js.map +1 -0
- package/dist/store/commands/dataset.d.ts +26 -0
- package/dist/store/commands/dataset.d.ts.map +1 -0
- package/dist/store/commands/dataset.js +368 -0
- package/dist/store/commands/dataset.js.map +1 -0
- package/dist/store/commands/document.d.ts +21 -0
- package/dist/store/commands/document.d.ts.map +1 -0
- package/dist/store/commands/document.js +160 -0
- package/dist/store/commands/document.js.map +1 -0
- package/dist/store/commands/field.d.ts +32 -0
- package/dist/store/commands/field.d.ts.map +1 -0
- package/dist/store/commands/field.js +572 -0
- package/dist/store/commands/field.js.map +1 -0
- package/dist/store/commands/layout.d.ts +16 -0
- package/dist/store/commands/layout.d.ts.map +1 -0
- package/dist/store/commands/layout.js +70 -0
- package/dist/store/commands/layout.js.map +1 -0
- package/dist/store/commands/parse.d.ts +19 -0
- package/dist/store/commands/parse.d.ts.map +1 -0
- package/dist/store/commands/parse.js +328 -0
- package/dist/store/commands/parse.js.map +1 -0
- package/dist/store/commands/readers.d.ts +198 -0
- package/dist/store/commands/readers.d.ts.map +1 -0
- package/dist/store/commands/readers.js +711 -0
- package/dist/store/commands/readers.js.map +1 -0
- package/dist/store/commands/rule.d.ts +24 -0
- package/dist/store/commands/rule.d.ts.map +1 -0
- package/dist/store/commands/rule.js +379 -0
- package/dist/store/commands/rule.js.map +1 -0
- package/dist/store/commands/shapes.d.ts +900 -0
- package/dist/store/commands/shapes.d.ts.map +1 -0
- package/dist/store/commands/shapes.js +166 -0
- package/dist/store/commands/shapes.js.map +1 -0
- package/dist/store/commands/suggestions.d.ts +37 -0
- package/dist/store/commands/suggestions.d.ts.map +1 -0
- package/dist/store/commands/suggestions.js +177 -0
- package/dist/store/commands/suggestions.js.map +1 -0
- package/dist/store/commands.d.ts +16 -0
- package/dist/store/commands.d.ts.map +1 -0
- package/dist/store/commands.js +13 -0
- package/dist/store/commands.js.map +1 -0
- package/dist/store/dataset-candidate.d.ts +33 -0
- package/dist/store/dataset-candidate.d.ts.map +1 -0
- package/dist/store/dataset-candidate.js +31 -0
- package/dist/store/dataset-candidate.js.map +1 -0
- package/dist/store/dataset-pin.d.ts +93 -0
- package/dist/store/dataset-pin.d.ts.map +1 -0
- package/dist/store/dataset-pin.js +86 -0
- package/dist/store/dataset-pin.js.map +1 -0
- package/dist/store/dataset-store.d.ts +96 -0
- package/dist/store/dataset-store.d.ts.map +1 -0
- package/dist/store/dataset-store.js +112 -0
- package/dist/store/dataset-store.js.map +1 -0
- package/dist/store/history.d.ts +149 -0
- package/dist/store/history.d.ts.map +1 -0
- package/dist/store/history.js +173 -0
- package/dist/store/history.js.map +1 -0
- package/dist/store/measurement.d.ts +5 -0
- package/dist/store/measurement.d.ts.map +1 -0
- package/dist/store/measurement.js +20 -0
- package/dist/store/measurement.js.map +1 -0
- package/dist/store/notify.d.ts +11 -0
- package/dist/store/notify.d.ts.map +1 -0
- package/dist/store/notify.js +26 -0
- package/dist/store/notify.js.map +1 -0
- package/dist/store/published.d.ts +50 -0
- package/dist/store/published.d.ts.map +1 -0
- package/dist/store/published.js +27 -0
- package/dist/store/published.js.map +1 -0
- package/dist/store/refusals.d.ts +175 -0
- package/dist/store/refusals.d.ts.map +1 -0
- package/dist/store/refusals.js +160 -0
- package/dist/store/refusals.js.map +1 -0
- package/dist/store/steps.d.ts +14 -0
- package/dist/store/steps.d.ts.map +1 -0
- package/dist/store/steps.js +124 -0
- package/dist/store/steps.js.map +1 -0
- package/dist/store/store.d.ts +142 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +136 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/unchanged.d.ts +12 -0
- package/dist/store/unchanged.d.ts.map +1 -0
- package/dist/store/unchanged.js +35 -0
- package/dist/store/unchanged.js.map +1 -0
- package/dist/visual/emit.d.ts +21 -0
- package/dist/visual/emit.d.ts.map +1 -0
- package/dist/visual/emit.js +133 -0
- package/dist/visual/emit.js.map +1 -0
- package/dist/visual/parse.d.ts +32 -0
- package/dist/visual/parse.d.ts.map +1 -0
- package/dist/visual/parse.js +330 -0
- package/dist/visual/parse.js.map +1 -0
- package/dist/visual/project.d.ts +40 -0
- package/dist/visual/project.d.ts.map +1 -0
- package/dist/visual/project.js +349 -0
- package/dist/visual/project.js.map +1 -0
- package/dist/visual/represent.d.ts +50 -0
- package/dist/visual/represent.d.ts.map +1 -0
- package/dist/visual/represent.js +66 -0
- package/dist/visual/represent.js.map +1 -0
- package/dist/visual/vocabulary.d.ts +121 -0
- package/dist/visual/vocabulary.d.ts.map +1 -0
- package/dist/visual/vocabulary.js +32 -0
- package/dist/visual/vocabulary.js.map +1 -0
- package/package.json +52 -3
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { CompareNode, LiteralNode, PathNode } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* The closed visual vocabulary a When/Then rule editor shows.
|
|
4
|
+
*
|
|
5
|
+
* A visual expression is the parsed AST's own shape under a narrower type: every leaf family
|
|
6
|
+
* carries the AST nodes it stands for, never text and never a second spelling of one. Emission
|
|
7
|
+
* is therefore exact by construction — a `ScalarVisualValue` is a literal or a path, so
|
|
8
|
+
* rebuilding the tree returns the very nodes the projection read.
|
|
9
|
+
*
|
|
10
|
+
* This module is data only: it declares the union, the closed operator vocabularies and the
|
|
11
|
+
* predicates that read one token as a member of one, and defines no traversal and no spelling.
|
|
12
|
+
* `project.ts` recognises a tree as one of these forms, `emit.ts` turns one back into a tree, and
|
|
13
|
+
* `parse.ts` narrows an untrusted value at the store's command boundary.
|
|
14
|
+
*/
|
|
15
|
+
/** The comparison operators that compare one value; `in` compares against a list instead. */
|
|
16
|
+
export type OrderedComparison = Exclude<CompareNode['op'], 'in'>;
|
|
17
|
+
/** A literal or a declared path: what a comparison, a check or a window operand may be. */
|
|
18
|
+
export type ScalarVisualValue = LiteralNode | PathNode;
|
|
19
|
+
/** A list of scalar values, which is the `in` operator's right-hand side. */
|
|
20
|
+
export interface VisualList {
|
|
21
|
+
readonly kind: 'list';
|
|
22
|
+
readonly items: readonly ScalarVisualValue[];
|
|
23
|
+
}
|
|
24
|
+
/** Every value position: a literal, a declared path, or a closed list of them. */
|
|
25
|
+
export type VisualValue = ScalarVisualValue | VisualList;
|
|
26
|
+
/** Two or more operands: the printer has no source for a one-operand connective. */
|
|
27
|
+
type ConnectiveOperands = readonly [VisualExpr, VisualExpr, ...VisualExpr[]];
|
|
28
|
+
/** Every form a rule's expression may take in the visual editor. */
|
|
29
|
+
export type VisualExpr = {
|
|
30
|
+
readonly kind: 'and';
|
|
31
|
+
readonly args: ConnectiveOperands;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: 'or';
|
|
34
|
+
readonly args: ConnectiveOperands;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'not';
|
|
37
|
+
readonly operand: VisualExpr;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: 'comparison';
|
|
40
|
+
readonly op: OrderedComparison;
|
|
41
|
+
readonly left: ScalarVisualValue;
|
|
42
|
+
readonly right: ScalarVisualValue;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'membership';
|
|
45
|
+
readonly left: ScalarVisualValue;
|
|
46
|
+
readonly candidates: VisualList;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'text_match';
|
|
49
|
+
readonly op: TextMatchOperator;
|
|
50
|
+
readonly subject: ScalarVisualValue;
|
|
51
|
+
readonly text: ScalarVisualValue;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'check';
|
|
54
|
+
readonly check: PresenceCheck;
|
|
55
|
+
readonly path: PathNode;
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: 'format_check';
|
|
58
|
+
readonly check: FormatCheck;
|
|
59
|
+
readonly value: ScalarVisualValue;
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'unique_value';
|
|
62
|
+
readonly array: PathNode;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: 'unique_member';
|
|
65
|
+
readonly array: PathNode;
|
|
66
|
+
readonly member: PathNode;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: 'count';
|
|
69
|
+
readonly path: PathNode;
|
|
70
|
+
readonly op: OrderedComparison;
|
|
71
|
+
readonly count: ScalarVisualValue;
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: 'date_window';
|
|
74
|
+
readonly span: DateSpan;
|
|
75
|
+
readonly op: OrderedComparison;
|
|
76
|
+
readonly from: ScalarVisualValue;
|
|
77
|
+
readonly to: ScalarVisualValue;
|
|
78
|
+
readonly amount: ScalarVisualValue;
|
|
79
|
+
} | {
|
|
80
|
+
readonly kind: 'capability';
|
|
81
|
+
readonly cap: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* A rule's expression as an editor holds it.
|
|
85
|
+
*
|
|
86
|
+
* A rule inside the vocabulary is shown as the visual form. A rule outside it — a `defaultCompute`
|
|
87
|
+
* writer, an aggregate, a comprehension, arithmetic, or source that does not parse — is the
|
|
88
|
+
* advanced arm carrying the source the author stored, unchanged, which is what makes a visual
|
|
89
|
+
* edit unable to rewrite an advanced formula.
|
|
90
|
+
*/
|
|
91
|
+
export type RuleExpression = {
|
|
92
|
+
readonly mode: 'visual';
|
|
93
|
+
readonly visual: VisualExpr;
|
|
94
|
+
} | {
|
|
95
|
+
readonly mode: 'advanced';
|
|
96
|
+
readonly source: string;
|
|
97
|
+
};
|
|
98
|
+
/** The operators a text match may state, as the runtime's call vocabulary spells them. */
|
|
99
|
+
export declare const TEXT_MATCH_OPERATORS: readonly ['contains', 'starts_with', 'ends_with', 'ascii_match'];
|
|
100
|
+
export type TextMatchOperator = (typeof TEXT_MATCH_OPERATORS)[number];
|
|
101
|
+
/** The one-path presence checks the vocabulary states. */
|
|
102
|
+
export declare const PRESENCE_CHECKS: readonly ['empty', 'present', 'absent'];
|
|
103
|
+
export type PresenceCheck = (typeof PRESENCE_CHECKS)[number];
|
|
104
|
+
/** The format checks a declared string value may carry. */
|
|
105
|
+
export declare const FORMAT_CHECKS: readonly ['is_email', 'is_phone', 'is_url'];
|
|
106
|
+
export type FormatCheck = (typeof FORMAT_CHECKS)[number];
|
|
107
|
+
/** The span a date window measures. */
|
|
108
|
+
export declare const DATE_SPANS: readonly ['days_between', 'months_between'];
|
|
109
|
+
export type DateSpan = (typeof DATE_SPANS)[number];
|
|
110
|
+
/** The ordered comparisons, so a boundary read and the projection share one list. */
|
|
111
|
+
export declare const ORDERED_COMPARISONS: readonly ['==', '!=', '<', '<=', '>', '>='];
|
|
112
|
+
/** Whether a call operator names one of the presence checks. */
|
|
113
|
+
export declare function isPresenceCheck(value: string): value is PresenceCheck;
|
|
114
|
+
/** Whether a call operator names one of the format checks. */
|
|
115
|
+
export declare function isFormatCheck(value: string): value is FormatCheck;
|
|
116
|
+
/** Whether a call operator names one of the text matches. */
|
|
117
|
+
export declare function isTextMatchOperator(value: string): value is TextMatchOperator;
|
|
118
|
+
/** Whether a call operator names one of the date spans. */
|
|
119
|
+
export declare function isDateSpan(value: string): value is DateSpan;
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/visual/vocabulary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEjF;;;;;;;;;;;;GAYG;AAEH,6FAA6F;AAC7F,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAEjE,2FAA2F;AAC3F,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC9C;AAED,kFAAkF;AAClF,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEzD,oFAAoF;AACpF,KAAK,kBAAkB,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;AAE7E,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CA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;AAC3D,eAAO,MAAM,aAAa,YAAI,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,uCAAuC;AACvC,eAAO,MAAM,UAAU,YAAI,cAAc,EAAE,gBAAgB,CAAU,CAAC;AACtE,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,YAAI,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAE/E,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAErE;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAEjE;AAED,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE7E;AAED,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAE3D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The operators a text match may state, as the runtime's call vocabulary spells them. */
|
|
2
|
+
export const TEXT_MATCH_OPERATORS = [
|
|
3
|
+
'contains',
|
|
4
|
+
'starts_with',
|
|
5
|
+
'ends_with',
|
|
6
|
+
'ascii_match',
|
|
7
|
+
];
|
|
8
|
+
/** The one-path presence checks the vocabulary states. */
|
|
9
|
+
export const PRESENCE_CHECKS = ['empty', 'present', 'absent'];
|
|
10
|
+
/** The format checks a declared string value may carry. */
|
|
11
|
+
export const FORMAT_CHECKS = ['is_email', 'is_phone', 'is_url'];
|
|
12
|
+
/** The span a date window measures. */
|
|
13
|
+
export const DATE_SPANS = ['days_between', 'months_between'];
|
|
14
|
+
/** The ordered comparisons, so a boundary read and the projection share one list. */
|
|
15
|
+
export const ORDERED_COMPARISONS = ['==', '!=', '<', '<=', '>', '>='];
|
|
16
|
+
/** Whether a call operator names one of the presence checks. */
|
|
17
|
+
export function isPresenceCheck(value) {
|
|
18
|
+
return PRESENCE_CHECKS.some((check) => check === value);
|
|
19
|
+
}
|
|
20
|
+
/** Whether a call operator names one of the format checks. */
|
|
21
|
+
export function isFormatCheck(value) {
|
|
22
|
+
return FORMAT_CHECKS.some((check) => check === value);
|
|
23
|
+
}
|
|
24
|
+
/** Whether a call operator names one of the text matches. */
|
|
25
|
+
export function isTextMatchOperator(value) {
|
|
26
|
+
return TEXT_MATCH_OPERATORS.some((op) => op === value);
|
|
27
|
+
}
|
|
28
|
+
/** Whether a call operator names one of the date spans. */
|
|
29
|
+
export function isDateSpan(value) {
|
|
30
|
+
return DATE_SPANS.some((span) => span === value);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/visual/vocabulary.ts"],"names":[],"mappings":"AA4FA,0FAA0F;AAC1F,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU;IACV,aAAa;IACb,WAAW;IACX,aAAa;CACL,CAAC;AAGX,0DAA0D;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAGvE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AAGzE,uCAAuC;AACvC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,gBAAgB,CAAU,CAAC;AAGtE,qFAAqF;AACrF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAE/E,gEAAgE;AAChE,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import type { CompareNode, LiteralNode, PathNode } from '@azx-pbc/axiom-runtime';\n\n/**\n * The closed visual vocabulary a When/Then rule editor shows.\n *\n * A visual expression is the parsed AST's own shape under a narrower type: every leaf family\n * carries the AST nodes it stands for, never text and never a second spelling of one. Emission\n * is therefore exact by construction — a `ScalarVisualValue` is a literal or a path, so\n * rebuilding the tree returns the very nodes the projection read.\n *\n * This module is data only: it declares the union, the closed operator vocabularies and the\n * predicates that read one token as a member of one, and defines no traversal and no spelling.\n * `project.ts` recognises a tree as one of these forms, `emit.ts` turns one back into a tree, and\n * `parse.ts` narrows an untrusted value at the store's command boundary.\n */\n\n/** The comparison operators that compare one value; `in` compares against a list instead. */\nexport type OrderedComparison = Exclude<CompareNode['op'], 'in'>;\n\n/** A literal or a declared path: what a comparison, a check or a window operand may be. */\nexport type ScalarVisualValue = LiteralNode | PathNode;\n\n/** A list of scalar values, which is the `in` operator's right-hand side. */\nexport interface VisualList {\n readonly kind: 'list';\n readonly items: readonly ScalarVisualValue[];\n}\n\n/** Every value position: a literal, a declared path, or a closed list of them. */\nexport type VisualValue = ScalarVisualValue | VisualList;\n\n/** Two or more operands: the printer has no source for a one-operand connective. */\ntype ConnectiveOperands = readonly [VisualExpr, VisualExpr, ...VisualExpr[]];\n\n/** Every form a rule's expression may take in the visual editor. */\nexport type VisualExpr =\n | { readonly kind: 'and'; readonly args: ConnectiveOperands }\n | { readonly kind: 'or'; readonly args: ConnectiveOperands }\n | { readonly kind: 'not'; readonly operand: VisualExpr }\n | {\n readonly kind: 'comparison';\n readonly op: OrderedComparison;\n readonly left: ScalarVisualValue;\n readonly right: ScalarVisualValue;\n }\n | {\n readonly kind: 'membership';\n readonly left: ScalarVisualValue;\n readonly candidates: VisualList;\n }\n | {\n readonly kind: 'text_match';\n readonly op: TextMatchOperator;\n readonly subject: ScalarVisualValue;\n readonly text: ScalarVisualValue;\n }\n | { readonly kind: 'check'; readonly check: PresenceCheck; readonly path: PathNode }\n | {\n readonly kind: 'format_check';\n readonly check: FormatCheck;\n readonly value: ScalarVisualValue;\n }\n | { readonly kind: 'unique_value'; readonly array: PathNode }\n | { readonly kind: 'unique_member'; readonly array: PathNode; readonly member: PathNode }\n | {\n readonly kind: 'count';\n readonly path: PathNode;\n readonly op: OrderedComparison;\n readonly count: ScalarVisualValue;\n }\n | {\n readonly kind: 'date_window';\n readonly span: DateSpan;\n readonly op: OrderedComparison;\n readonly from: ScalarVisualValue;\n readonly to: ScalarVisualValue;\n readonly amount: ScalarVisualValue;\n }\n | { readonly kind: 'capability'; readonly cap: string };\n\n/**\n * A rule's expression as an editor holds it.\n *\n * A rule inside the vocabulary is shown as the visual form. A rule outside it — a `defaultCompute`\n * writer, an aggregate, a comprehension, arithmetic, or source that does not parse — is the\n * advanced arm carrying the source the author stored, unchanged, which is what makes a visual\n * edit unable to rewrite an advanced formula.\n */\nexport type RuleExpression =\n | { readonly mode: 'visual'; readonly visual: VisualExpr }\n | { readonly mode: 'advanced'; readonly source: string };\n\n/** The operators a text match may state, as the runtime's call vocabulary spells them. */\nexport const TEXT_MATCH_OPERATORS = [\n 'contains',\n 'starts_with',\n 'ends_with',\n 'ascii_match',\n] as const;\nexport type TextMatchOperator = (typeof TEXT_MATCH_OPERATORS)[number];\n\n/** The one-path presence checks the vocabulary states. */\nexport const PRESENCE_CHECKS = ['empty', 'present', 'absent'] as const;\nexport type PresenceCheck = (typeof PRESENCE_CHECKS)[number];\n\n/** The format checks a declared string value may carry. */\nexport const FORMAT_CHECKS = ['is_email', 'is_phone', 'is_url'] as const;\nexport type FormatCheck = (typeof FORMAT_CHECKS)[number];\n\n/** The span a date window measures. */\nexport const DATE_SPANS = ['days_between', 'months_between'] as const;\nexport type DateSpan = (typeof DATE_SPANS)[number];\n\n/** The ordered comparisons, so a boundary read and the projection share one list. */\nexport const ORDERED_COMPARISONS = ['==', '!=', '<', '<=', '>', '>='] as const;\n\n/** Whether a call operator names one of the presence checks. */\nexport function isPresenceCheck(value: string): value is PresenceCheck {\n return PRESENCE_CHECKS.some((check) => check === value);\n}\n\n/** Whether a call operator names one of the format checks. */\nexport function isFormatCheck(value: string): value is FormatCheck {\n return FORMAT_CHECKS.some((check) => check === value);\n}\n\n/** Whether a call operator names one of the text matches. */\nexport function isTextMatchOperator(value: string): value is TextMatchOperator {\n return TEXT_MATCH_OPERATORS.some((op) => op === value);\n}\n\n/** Whether a call operator names one of the date spans. */\nexport function isDateSpan(value: string): value is DateSpan {\n return DATE_SPANS.some((span) => span === value);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azx-pbc/axiom-builder",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A framework-free, browser-safe document builder: commands over immutable snapshots, the compiler's own refusals for what cannot be a draft, translation gaps, and a compile preview that exposes no artifact.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "AZX, PBC",
|
|
7
|
+
"homepage": "https://github.com/AZX-PBC-OSS/axiom",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/AZX-PBC-OSS/axiom/issues"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"axiom",
|
|
13
|
+
"authoring",
|
|
14
|
+
"form-builder",
|
|
15
|
+
"headless",
|
|
16
|
+
"schema",
|
|
17
|
+
"localization"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=24"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/AZX-PBC-OSS/axiom.git",
|
|
25
|
+
"directory": "packages/builder"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"provenance": true
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"type": "module",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"browser": "./dist/index.js",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@azx-pbc/axiom-compiler": "0.0.1",
|
|
47
|
+
"@azx-pbc/axiom-runtime": "0.0.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"vitest": "5.1.2"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"check:publish": "publint && attw --pack . --profile esm-only"
|
|
54
|
+
}
|
|
6
55
|
}
|