@formspec/constraints 0.1.0-alpha.10 → 0.1.0-alpha.11

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/dist/defaults.js DELETED
@@ -1,106 +0,0 @@
1
- /**
2
- * Default constraint configuration that allows all features.
3
- * All constraints default to "off" (allowed).
4
- */
5
- export const DEFAULT_CONSTRAINTS = {
6
- fieldTypes: {
7
- text: "off",
8
- number: "off",
9
- boolean: "off",
10
- staticEnum: "off",
11
- dynamicEnum: "off",
12
- dynamicSchema: "off",
13
- array: "off",
14
- object: "off",
15
- },
16
- layout: {
17
- group: "off",
18
- conditionals: "off",
19
- maxNestingDepth: Infinity,
20
- },
21
- uiSchema: {
22
- layouts: {
23
- VerticalLayout: "off",
24
- HorizontalLayout: "off",
25
- Group: "off",
26
- Categorization: "off",
27
- Category: "off",
28
- },
29
- rules: {
30
- enabled: "off",
31
- effects: {
32
- SHOW: "off",
33
- HIDE: "off",
34
- ENABLE: "off",
35
- DISABLE: "off",
36
- },
37
- },
38
- },
39
- fieldOptions: {
40
- label: "off",
41
- placeholder: "off",
42
- required: "off",
43
- minValue: "off",
44
- maxValue: "off",
45
- minItems: "off",
46
- maxItems: "off",
47
- },
48
- controlOptions: {
49
- format: "off",
50
- readonly: "off",
51
- multi: "off",
52
- showUnfocusedDescription: "off",
53
- hideRequiredAsterisk: "off",
54
- custom: {},
55
- },
56
- };
57
- /**
58
- * Default FormSpec configuration.
59
- */
60
- export const DEFAULT_CONFIG = {
61
- constraints: DEFAULT_CONSTRAINTS,
62
- };
63
- /**
64
- * Merges user constraints with defaults, filling in any missing values.
65
- */
66
- export function mergeWithDefaults(config) {
67
- if (!config) {
68
- return DEFAULT_CONSTRAINTS;
69
- }
70
- return {
71
- fieldTypes: {
72
- ...DEFAULT_CONSTRAINTS.fieldTypes,
73
- ...config.fieldTypes,
74
- },
75
- layout: {
76
- ...DEFAULT_CONSTRAINTS.layout,
77
- ...config.layout,
78
- },
79
- uiSchema: {
80
- layouts: {
81
- ...DEFAULT_CONSTRAINTS.uiSchema.layouts,
82
- ...config.uiSchema?.layouts,
83
- },
84
- rules: {
85
- enabled: config.uiSchema?.rules?.enabled ?? DEFAULT_CONSTRAINTS.uiSchema.rules.enabled,
86
- effects: {
87
- ...DEFAULT_CONSTRAINTS.uiSchema.rules.effects,
88
- ...config.uiSchema?.rules?.effects,
89
- },
90
- },
91
- },
92
- fieldOptions: {
93
- ...DEFAULT_CONSTRAINTS.fieldOptions,
94
- ...config.fieldOptions,
95
- },
96
- controlOptions: {
97
- ...DEFAULT_CONSTRAINTS.controlOptions,
98
- ...config.controlOptions,
99
- custom: {
100
- ...DEFAULT_CONSTRAINTS.controlOptions.custom,
101
- ...config.controlOptions?.custom,
102
- },
103
- },
104
- };
105
- }
106
- //# sourceMappingURL=defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA6B;IAC3D,UAAU,EAAE;QACV,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;KACd;IACD,MAAM,EAAE;QACN,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,QAAQ;KAC1B;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,cAAc,EAAE,KAAK;YACrB,gBAAgB,EAAE,KAAK;YACvB,KAAK,EAAE,KAAK;YACZ,cAAc,EAAE,KAAK;YACrB,QAAQ,EAAE,KAAK;SAChB;QACD,KAAK,EAAE;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,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AAO;iBACnC;aACF;SACF;QACD,YAAY,EAAE;YACZ,GAAG,mBAAmB,CAAC,YAAY;YACnC,GAAG,MAAM,CAAC,YAAY;SACvB;QACD,cAAc,EAAE;YACd,GAAG,mBAAmB,CAAC,cAAc;YACrC,GAAG,MAAM,CAAC,cAAc;YACxB,MAAM,EAAE;gBACN,GAAG,mBAAmB,CAAC,cAAc,CAAC,MAAM;gBAC5C,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM;aACjC;SACF;KACF,CAAC;AACJ,CAAC"}
package/dist/loader.js DELETED
@@ -1,140 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { resolve, dirname } from "node:path";
3
- import { parse as parseYaml } from "yaml";
4
- import { mergeWithDefaults } from "./defaults.js";
5
- /**
6
- * Default config file names to search for (in order of priority).
7
- */
8
- const CONFIG_FILE_NAMES = [".formspec.yml", ".formspec.yaml", "formspec.yml"];
9
- /**
10
- * Searches for a config file in the given directory and optionally parent directories.
11
- */
12
- async function findConfigFile(startDir, searchParents) {
13
- let currentDir = resolve(startDir);
14
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- intentional infinite loop with break conditions
15
- while (true) {
16
- for (const fileName of CONFIG_FILE_NAMES) {
17
- const filePath = resolve(currentDir, fileName);
18
- try {
19
- await readFile(filePath);
20
- return filePath;
21
- }
22
- catch {
23
- // File doesn't exist, continue searching
24
- }
25
- }
26
- if (!searchParents) {
27
- break;
28
- }
29
- const parentDir = dirname(currentDir);
30
- // Reached filesystem root when dirname returns same path
31
- if (parentDir === currentDir) {
32
- break;
33
- }
34
- currentDir = parentDir;
35
- }
36
- return null;
37
- }
38
- /**
39
- * Parses a YAML config file and returns the FormSpecConfig.
40
- */
41
- async function parseConfigFile(filePath) {
42
- const content = await readFile(filePath, "utf-8");
43
- const parsed = parseYaml(content);
44
- if (parsed === null || parsed === undefined) {
45
- return {};
46
- }
47
- if (typeof parsed !== "object" || Array.isArray(parsed)) {
48
- throw new Error(`Invalid config file at ${filePath}: expected an object, got ${typeof parsed}`);
49
- }
50
- return parsed;
51
- }
52
- /**
53
- * Loads FormSpec constraint configuration from a .formspec.yml file.
54
- *
55
- * @param options - Options for loading configuration
56
- * @returns The loaded configuration with defaults applied
57
- *
58
- * @example
59
- * ```ts
60
- * // Load from current directory (searches for .formspec.yml)
61
- * const result = await loadConfig();
62
- *
63
- * // Load from specific directory
64
- * const result = await loadConfig({ cwd: '/path/to/project' });
65
- *
66
- * // Load from specific file
67
- * const result = await loadConfig({ configPath: '/path/to/config.yml' });
68
- * ```
69
- */
70
- export async function loadConfig(options = {}) {
71
- const { cwd = process.cwd(), configPath, searchParents = true } = options;
72
- let resolvedPath = null;
73
- if (configPath) {
74
- resolvedPath = resolve(cwd, configPath);
75
- try {
76
- await readFile(resolvedPath);
77
- }
78
- catch {
79
- throw new Error(`Config file not found at ${resolvedPath}`);
80
- }
81
- }
82
- else {
83
- resolvedPath = await findConfigFile(cwd, searchParents);
84
- }
85
- if (!resolvedPath) {
86
- return {
87
- config: mergeWithDefaults(undefined),
88
- configPath: null,
89
- found: false,
90
- };
91
- }
92
- const fileConfig = await parseConfigFile(resolvedPath);
93
- const config = mergeWithDefaults(fileConfig.constraints);
94
- return {
95
- config,
96
- configPath: resolvedPath,
97
- found: true,
98
- };
99
- }
100
- /**
101
- * Synchronously loads config from a pre-parsed YAML string.
102
- * Useful for testing or when config is already available.
103
- *
104
- * @param yamlContent - The YAML content to parse
105
- * @returns The parsed and merged configuration
106
- */
107
- export function loadConfigFromString(yamlContent) {
108
- const parsed = parseYaml(yamlContent);
109
- if (parsed === null || parsed === undefined) {
110
- return mergeWithDefaults(undefined);
111
- }
112
- if (typeof parsed !== "object" || Array.isArray(parsed)) {
113
- throw new Error(`Invalid config content: expected an object, got ${typeof parsed}`);
114
- }
115
- return mergeWithDefaults(parsed.constraints);
116
- }
117
- /**
118
- * Creates a constraint configuration directly from an object.
119
- * Useful for programmatic configuration without YAML.
120
- *
121
- * @param config - Partial constraint configuration
122
- * @returns Complete configuration with defaults applied
123
- *
124
- * @example
125
- * ```ts
126
- * const config = defineConstraints({
127
- * fieldTypes: {
128
- * dynamicEnum: 'error',
129
- * dynamicSchema: 'error',
130
- * },
131
- * layout: {
132
- * group: 'error',
133
- * },
134
- * });
135
- * ```
136
- */
137
- export function defineConstraints(config) {
138
- return mergeWithDefaults(config);
139
- }
140
- //# sourceMappingURL=loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,MAAM,iBAAiB,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAqC9E;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,QAAgB,EAAE,aAAsB;IACpE,IAAI,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEnC,0HAA0H;IAC1H,OAAO,IAAI,EAAE,CAAC;QACZ,KAAK,MAAM,QAAQ,IAAI,iBAAiB,EAAE,CAAC;YACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAC/C,IAAI,CAAC;gBACH,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACzB,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,MAAM,CAAC;gBACP,yCAAyC;YAC3C,CAAC;QACH,CAAC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM;QACR,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACtC,yDAAyD;QACzD,IAAI,SA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,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO;YACL,MAAM,EAAE,iBAAiB,CAAC,SAAS,CAAC;YACpC,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAEzD,OAAO;QACL,MAAM;QACN,UAAU,EAAE,YAAY;QACxB,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAsC,CAAC;IAE3E,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC5C,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,mDAAmD,OAAO,MAAM,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAwB;IACxD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC"}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,79 +0,0 @@
1
- /**
2
- * Validates field options against constraints.
3
- *
4
- * @param context - Information about the field and its options
5
- * @param constraints - Field option constraints
6
- * @returns Array of validation issues (empty if valid)
7
- */
8
- export function validateFieldOptions(context, constraints) {
9
- const issues = [];
10
- for (const option of context.presentOptions) {
11
- const severity = constraints[option];
12
- if (severity && severity !== "off") {
13
- issues.push(createFieldOptionIssue(context, option, severity));
14
- }
15
- }
16
- return issues;
17
- }
18
- /**
19
- * Creates a validation issue for a disallowed field option.
20
- */
21
- function createFieldOptionIssue(context, option, severity) {
22
- const path = context.path ?? context.fieldName;
23
- return {
24
- code: "DISALLOWED_FIELD_OPTION",
25
- message: `Field "${context.fieldName}" uses the "${option}" option, which is not allowed in this project`,
26
- severity: severity === "error" ? "error" : "warning",
27
- category: "fieldOptions",
28
- path,
29
- fieldName: context.fieldName,
30
- };
31
- }
32
- /**
33
- * Extracts which options are present on a field object.
34
- * Works with FormSpec field types.
35
- *
36
- * @param field - A field object with potential options
37
- * @returns Array of present option names
38
- */
39
- export function extractFieldOptions(field) {
40
- const options = [];
41
- if (field["label"] !== undefined)
42
- options.push("label");
43
- if (field["placeholder"] !== undefined)
44
- options.push("placeholder");
45
- if (field["required"] !== undefined)
46
- options.push("required");
47
- // NumberField uses "min"/"max" in core types, map to "minValue"/"maxValue" constraints
48
- if (field["min"] !== undefined || field["minValue"] !== undefined)
49
- options.push("minValue");
50
- if (field["max"] !== undefined || field["maxValue"] !== undefined)
51
- options.push("maxValue");
52
- if (field["minItems"] !== undefined)
53
- options.push("minItems");
54
- if (field["maxItems"] !== undefined)
55
- options.push("maxItems");
56
- return options;
57
- }
58
- /**
59
- * Checks if a specific field option is allowed.
60
- *
61
- * @param option - The option to check
62
- * @param constraints - Field option constraints
63
- * @returns true if allowed, false if disallowed
64
- */
65
- export function isFieldOptionAllowed(option, constraints) {
66
- const severity = constraints[option];
67
- return !severity || severity === "off";
68
- }
69
- /**
70
- * Gets the severity level for a field option.
71
- *
72
- * @param option - The option to check
73
- * @param constraints - Field option constraints
74
- * @returns Severity level, or "off" if not constrained
75
- */
76
- export function getFieldOptionSeverity(option, constraints) {
77
- return constraints[option] ?? "off";
78
- }
79
- //# sourceMappingURL=field-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-options.js","sourceRoot":"","sources":["../../src/validators/field-options.ts"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA4B,EAC5B,WAAmC;IAEnC,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5C,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,QAAQ,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAC7B,OAA4B,EAC5B,MAAmB,EACnB,QAAkB;IAElB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC;IAC/C,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EAAE,UAAU,OAAO,CAAC,SAAS,eAAe,MAAM,gDAAgD;QACzG,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QACpD,QAAQ,EAAE,cAAc;QACxB,IAAI;QACJ,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA8B;IAChE,MAAM,OAAO,GAAkB,EAAE,CAAC;IAElC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,KAAK,CAAC,aAAa,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACpE,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9D,uFAAuF;IACvF,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5F,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5F,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE9D,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAmB,EACnB,WAAmC;IAEnC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,IAAI,QAAQ,KAAK,KAAK,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAmB,EACnB,WAAmC;IAEnC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;AACtC,CAAC"}
@@ -1,93 +0,0 @@
1
- /**
2
- * Maps FormSpec field._field values to constraint config keys.
3
- */
4
- const FIELD_TYPE_MAP = {
5
- text: "text",
6
- number: "number",
7
- boolean: "boolean",
8
- enum: "staticEnum",
9
- dynamic_enum: "dynamicEnum",
10
- dynamic_schema: "dynamicSchema",
11
- array: "array",
12
- object: "object",
13
- };
14
- /**
15
- * Human-readable names for field types.
16
- */
17
- const FIELD_TYPE_NAMES = {
18
- text: "text field",
19
- number: "number field",
20
- boolean: "boolean field",
21
- enum: "static enum field",
22
- dynamic_enum: "dynamic enum field",
23
- dynamic_schema: "dynamic schema field",
24
- array: "array field",
25
- object: "object field",
26
- };
27
- /**
28
- * Validates a field type against constraints.
29
- *
30
- * @param context - Information about the field being validated
31
- * @param constraints - Field type constraints
32
- * @returns Array of validation issues (empty if valid)
33
- */
34
- export function validateFieldTypes(context, constraints) {
35
- const issues = [];
36
- const constraintKey = FIELD_TYPE_MAP[context.fieldType];
37
- if (!constraintKey) {
38
- // Unknown field type, skip validation
39
- return issues;
40
- }
41
- const severity = constraints[constraintKey];
42
- if (severity && severity !== "off") {
43
- const fieldTypeName = FIELD_TYPE_NAMES[context.fieldType] ?? context.fieldType;
44
- issues.push(createFieldTypeIssue(context, fieldTypeName, severity));
45
- }
46
- return issues;
47
- }
48
- /**
49
- * Creates a validation issue for a disallowed field type.
50
- */
51
- function createFieldTypeIssue(context, fieldTypeName, severity) {
52
- const path = context.path ?? context.fieldName;
53
- return {
54
- code: "DISALLOWED_FIELD_TYPE",
55
- message: `Field "${context.fieldName}" uses ${fieldTypeName}, which is not allowed in this project`,
56
- severity: severity === "error" ? "error" : "warning",
57
- category: "fieldTypes",
58
- path,
59
- fieldName: context.fieldName,
60
- fieldType: context.fieldType,
61
- };
62
- }
63
- /**
64
- * Checks if a field type is allowed by the constraints.
65
- * Useful for quick checks without generating issues.
66
- *
67
- * @param fieldType - The _field discriminator value
68
- * @param constraints - Field type constraints
69
- * @returns true if allowed, false if disallowed
70
- */
71
- export function isFieldTypeAllowed(fieldType, constraints) {
72
- const constraintKey = FIELD_TYPE_MAP[fieldType];
73
- if (!constraintKey) {
74
- return true; // Unknown types are allowed by default
75
- }
76
- const severity = constraints[constraintKey];
77
- return !severity || severity === "off";
78
- }
79
- /**
80
- * Gets the severity level for a field type.
81
- *
82
- * @param fieldType - The _field discriminator value
83
- * @param constraints - Field type constraints
84
- * @returns Severity level, or "off" if not constrained
85
- */
86
- export function getFieldTypeSeverity(fieldType, constraints) {
87
- const constraintKey = FIELD_TYPE_MAP[fieldType];
88
- if (!constraintKey) {
89
- return "off";
90
- }
91
- return constraints[constraintKey] ?? "off";
92
- }
93
- //# sourceMappingURL=field-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-types.js","sourceRoot":"","sources":["../../src/validators/field-types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,cAAc,GAA+C;IACjE,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,aAAa;IAC3B,cAAc,EAAE,eAAe;IAC/B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,gBAAgB,GAA2B;IAC/C,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,oBAAoB;IAClC,cAAc,EAAE,sBAAsB;IACtC,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,cAAc;CACvB,CAAC;AAcF;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAyB,EACzB,WAAiC;IAEjC,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,sCAAsC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IAC5C,IAAI,QAAQ,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACnC,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CA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,CAAC;AAC7C,CAAC"}
@@ -1,152 +0,0 @@
1
- import { mergeWithDefaults } from "../defaults.js";
2
- import { validateFieldTypes } from "./field-types.js";
3
- import { validateLayout } from "./layout.js";
4
- import { validateFieldOptions, extractFieldOptions } from "./field-options.js";
5
- /**
6
- * Validates FormSpec elements against constraints.
7
- *
8
- * This is the main entry point for validating a form specification
9
- * against a constraint configuration. It walks through all elements
10
- * and checks each one against the configured constraints.
11
- *
12
- * @param elements - FormSpec elements to validate
13
- * @param options - Validation options including constraints
14
- * @returns Validation result with all issues found
15
- *
16
- * @example
17
- * ```ts
18
- * import { formspec, field, group } from '@formspec/dsl';
19
- * import { validateFormSpecElements, defineConstraints } from '@formspec/constraints';
20
- *
21
- * const form = formspec(
22
- * group("Contact",
23
- * field.text("name"),
24
- * field.dynamicEnum("country", "countries"),
25
- * ),
26
- * );
27
- *
28
- * const result = validateFormSpecElements(form.elements, {
29
- * constraints: {
30
- * fieldTypes: { dynamicEnum: 'error' },
31
- * layout: { group: 'error' },
32
- * },
33
- * });
34
- *
35
- * if (!result.valid) {
36
- * console.error('Validation failed:', result.issues);
37
- * }
38
- * ```
39
- */
40
- export function validateFormSpecElements(elements, options = {}) {
41
- const constraints = mergeWithDefaults(options.constraints);
42
- const issues = [];
43
- // Walk through all elements
44
- walkElements(elements, constraints, issues, "", 0);
45
- return {
46
- valid: !issues.some((issue) => issue.severity === "error"),
47
- issues,
48
- };
49
- }
50
- /**
51
- * Validates a complete FormSpec against constraints.
52
- *
53
- * @param formSpec - The FormSpec to validate
54
- * @param options - Validation options including constraints
55
- * @returns Validation result with all issues found
56
- */
57
- export function validateFormSpec(formSpec, options = {}) {
58
- return validateFormSpecElements(formSpec.elements, options);
59
- }
60
- /**
61
- * Recursively walks through FormSpec elements and validates each one.
62
- */
63
- function walkElements(elements, constraints, issues, pathPrefix, depth) {
64
- for (const element of elements) {
65
- const elementPath = pathPrefix;
66
- if (element._type === "field") {
67
- validateField(element, constraints, issues, elementPath, depth);
68
- }
69
- else if (element._type === "group") {
70
- validateGroup(element, constraints, issues, elementPath, depth);
71
- }
72
- else {
73
- // element._type === "conditional"
74
- validateConditional(element, constraints, issues, elementPath, depth);
75
- }
76
- }
77
- }
78
- /**
79
- * Validates a field element.
80
- */
81
- function validateField(field, constraints, issues, pathPrefix, depth) {
82
- const fieldPath = pathPrefix ? `${pathPrefix}/${field.name}` : field.name;
83
- // Validate field type
84
- const fieldTypeIssues = validateFieldTypes({
85
- fieldType: field._field,
86
- fieldName: field.name,
87
- path: fieldPath,
88
- }, constraints.fieldTypes);
89
- issues.push(...fieldTypeIssues);
90
- // Validate field options
91
- const presentOptions = extractFieldOptions(field);
92
- if (presentOptions.length > 0) {
93
- const optionIssues = validateFieldOptions({
94
- fieldName: field.name,
95
- presentOptions,
96
- path: fieldPath,
97
- }, constraints.fieldOptions);
98
- issues.push(...optionIssues);
99
- }
100
- // Check nesting depth for array/object fields
101
- if (field._field === "array" || field._field === "object") {
102
- const layoutIssues = validateLayout({
103
- layoutType: "group", // Arrays/objects contribute to nesting depth
104
- depth: depth + 1,
105
- path: fieldPath,
106
- }, constraints.layout);
107
- // Only add nesting depth issues, not group issues
108
- issues.push(...layoutIssues.filter((issue) => issue.code === "EXCEEDED_NESTING_DEPTH"));
109
- // Recursively validate nested elements
110
- if (field._field === "array" && "items" in field) {
111
- walkElements(field.items, constraints, issues, `${fieldPath}[]`, depth + 1);
112
- }
113
- else if ("properties" in field) {
114
- // field._field === "object"
115
- walkElements(field.properties, constraints, issues, fieldPath, depth + 1);
116
- }
117
- }
118
- }
119
- /**
120
- * Validates a group element.
121
- */
122
- function validateGroup(group, constraints, issues, pathPrefix, depth) {
123
- const groupPath = pathPrefix ? `${pathPrefix}/[group:${group.label}]` : `[group:${group.label}]`;
124
- // Validate group usage
125
- const layoutIssues = validateLayout({
126
- layoutType: "group",
127
- label: group.label,
128
- depth,
129
- path: groupPath,
130
- }, constraints.layout);
131
- issues.push(...layoutIssues);
132
- // Recursively validate nested elements (groups don't increase nesting depth for schema)
133
- walkElements(group.elements, constraints, issues, pathPrefix, depth);
134
- }
135
- /**
136
- * Validates a conditional element.
137
- */
138
- function validateConditional(conditional, constraints, issues, pathPrefix, depth) {
139
- const condPath = pathPrefix
140
- ? `${pathPrefix}/[when:${conditional.field}=${String(conditional.value)}]`
141
- : `[when:${conditional.field}=${String(conditional.value)}]`;
142
- // Validate conditional usage
143
- const layoutIssues = validateLayout({
144
- layoutType: "conditional",
145
- depth,
146
- path: condPath,
147
- }, constraints.layout);
148
- issues.push(...layoutIssues);
149
- // Recursively validate nested elements
150
- walkElements(conditional.elements, constraints, issues, pathPrefix, depth);
151
- }
152
- //# sourceMappingURL=formspec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formspec.js","sourceRoot":"","sources":["../../src/validators/formspec.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAU/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,wBAAwB,CACtC,QAAgC,EAChC,UAAqC,EAAE;IAEvC,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,4BAA4B;IAC5B,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAEnD,OAAO;QACL,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC;QAC1D,MAAM;KACP,CAAC;AACJ,CAAC;AAED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AAC7E,CAAC"}
@@ -1,5 +0,0 @@
1
- export { validateFieldTypes } from "./field-types.js";
2
- export { validateLayout } from "./layout.js";
3
- export { validateFieldOptions } from "./field-options.js";
4
- export { validateFormSpecElements } from "./formspec.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAyB,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAA4B,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAkC,MAAM,eAAe,CAAC"}