@formspec/constraints 0.1.0-alpha.7
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/README.md +265 -0
- package/dist/__tests__/loader.test.d.ts +2 -0
- package/dist/__tests__/loader.test.d.ts.map +1 -0
- package/dist/__tests__/loader.test.js +133 -0
- package/dist/__tests__/loader.test.js.map +1 -0
- package/dist/__tests__/validators.test.d.ts +2 -0
- package/dist/__tests__/validators.test.d.ts.map +1 -0
- package/dist/__tests__/validators.test.js +404 -0
- package/dist/__tests__/validators.test.js.map +1 -0
- package/dist/browser.d.ts +51 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +65 -0
- package/dist/browser.js.map +1 -0
- package/dist/constraints.d.ts +544 -0
- package/dist/defaults.d.ts +15 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +106 -0
- package/dist/defaults.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +81 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +140 -0
- package/dist/loader.js.map +1 -0
- package/dist/types.d.ts +200 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validators/field-options.d.ts +49 -0
- package/dist/validators/field-options.d.ts.map +1 -0
- package/dist/validators/field-options.js +79 -0
- package/dist/validators/field-options.js.map +1 -0
- package/dist/validators/field-types.d.ts +38 -0
- package/dist/validators/field-types.d.ts.map +1 -0
- package/dist/validators/field-types.js +93 -0
- package/dist/validators/field-types.js.map +1 -0
- package/dist/validators/formspec.d.ts +54 -0
- package/dist/validators/formspec.d.ts.map +1 -0
- package/dist/validators/formspec.js +152 -0
- package/dist/validators/formspec.js.map +1 -0
- package/dist/validators/index.d.ts +5 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +5 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/layout.d.ts +39 -0
- package/dist/validators/layout.d.ts.map +1 -0
- package/dist/validators/layout.js +107 -0
- package/dist/validators/layout.js.map +1 -0
- package/formspec.schema.json +245 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# @formspec/constraints
|
|
2
|
+
|
|
3
|
+
Define and enforce constraints on which FormSpec DSL features are allowed in your project.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The constraints package lets you restrict which parts of the FormSpec DSL can be used. This is useful for:
|
|
8
|
+
|
|
9
|
+
- **Standardization**: Enforce consistent form patterns across a team
|
|
10
|
+
- **Compatibility**: Restrict to features your renderer supports
|
|
11
|
+
- **Simplicity**: Keep forms simple by disallowing complex nesting or conditionals
|
|
12
|
+
- **Linting**: Catch constraint violations at development time via ESLint
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @formspec/constraints
|
|
18
|
+
# or
|
|
19
|
+
pnpm add @formspec/constraints
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
Create a `.formspec.yml` file in your project root:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
constraints:
|
|
28
|
+
fieldTypes:
|
|
29
|
+
text: off # Allow text fields
|
|
30
|
+
number: off # Allow number fields
|
|
31
|
+
boolean: off # Allow boolean fields
|
|
32
|
+
staticEnum: off # Allow static enums
|
|
33
|
+
dynamicEnum: warn # Warn on dynamic enums
|
|
34
|
+
dynamicSchema: error # Disallow dynamic schemas
|
|
35
|
+
array: off # Allow arrays
|
|
36
|
+
object: off # Allow objects
|
|
37
|
+
|
|
38
|
+
layout:
|
|
39
|
+
group: off # Allow groups
|
|
40
|
+
conditionals: off # Allow when() conditionals
|
|
41
|
+
maxNestingDepth: 3 # Max nesting depth (0 = flat only)
|
|
42
|
+
|
|
43
|
+
fieldOptions:
|
|
44
|
+
label: off
|
|
45
|
+
placeholder: off
|
|
46
|
+
required: off
|
|
47
|
+
minValue: off
|
|
48
|
+
maxValue: off
|
|
49
|
+
minItems: off
|
|
50
|
+
maxItems: off
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Severity Levels
|
|
54
|
+
|
|
55
|
+
Each constraint can be set to:
|
|
56
|
+
|
|
57
|
+
| Severity | Behavior |
|
|
58
|
+
|----------|----------|
|
|
59
|
+
| `"off"` | Feature is allowed (default) |
|
|
60
|
+
| `"warn"` | Emit warning but allow |
|
|
61
|
+
| `"error"` | Disallow - fail validation |
|
|
62
|
+
|
|
63
|
+
## Constraint Categories
|
|
64
|
+
|
|
65
|
+
### Field Types (`fieldTypes`)
|
|
66
|
+
|
|
67
|
+
Control which DSL field builders are allowed:
|
|
68
|
+
|
|
69
|
+
| Constraint | DSL Function |
|
|
70
|
+
|------------|--------------|
|
|
71
|
+
| `text` | `field.text()` |
|
|
72
|
+
| `number` | `field.number()` |
|
|
73
|
+
| `boolean` | `field.boolean()` |
|
|
74
|
+
| `staticEnum` | `field.enum()` |
|
|
75
|
+
| `dynamicEnum` | `field.dynamicEnum()` |
|
|
76
|
+
| `dynamicSchema` | `field.dynamicSchema()` |
|
|
77
|
+
| `array` | `field.array()`, `field.arrayWithConfig()` |
|
|
78
|
+
| `object` | `field.object()`, `field.objectWithConfig()` |
|
|
79
|
+
|
|
80
|
+
### Layout (`layout`)
|
|
81
|
+
|
|
82
|
+
Control structure and nesting:
|
|
83
|
+
|
|
84
|
+
| Constraint | Description |
|
|
85
|
+
|------------|-------------|
|
|
86
|
+
| `group` | `group()` visual grouping |
|
|
87
|
+
| `conditionals` | `when()` conditional visibility |
|
|
88
|
+
| `maxNestingDepth` | Maximum depth for nested objects/arrays |
|
|
89
|
+
|
|
90
|
+
### Field Options (`fieldOptions`)
|
|
91
|
+
|
|
92
|
+
Control which field configuration options are allowed:
|
|
93
|
+
|
|
94
|
+
| Constraint | Description |
|
|
95
|
+
|------------|-------------|
|
|
96
|
+
| `label` | Field label text |
|
|
97
|
+
| `placeholder` | Input placeholder |
|
|
98
|
+
| `required` | Required field validation |
|
|
99
|
+
| `minValue`, `maxValue` | Number field constraints |
|
|
100
|
+
| `minItems`, `maxItems` | Array length constraints |
|
|
101
|
+
|
|
102
|
+
### UI Schema (`uiSchema`)
|
|
103
|
+
|
|
104
|
+
Control JSON Forms-specific features:
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
constraints:
|
|
108
|
+
uiSchema:
|
|
109
|
+
layouts:
|
|
110
|
+
VerticalLayout: off
|
|
111
|
+
HorizontalLayout: off
|
|
112
|
+
Group: off
|
|
113
|
+
Categorization: error # Disallow tabbed interfaces
|
|
114
|
+
Category: error
|
|
115
|
+
rules:
|
|
116
|
+
enabled: off
|
|
117
|
+
effects:
|
|
118
|
+
SHOW: off
|
|
119
|
+
HIDE: off
|
|
120
|
+
ENABLE: warn
|
|
121
|
+
DISABLE: warn
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Programmatic Usage
|
|
125
|
+
|
|
126
|
+
### Loading Configuration
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import { loadConfig, mergeWithDefaults } from "@formspec/constraints";
|
|
130
|
+
|
|
131
|
+
// Load from .formspec.yml (searches up directory tree)
|
|
132
|
+
const config = await loadConfig();
|
|
133
|
+
|
|
134
|
+
// Or load from specific path
|
|
135
|
+
const config = await loadConfig("/path/to/.formspec.yml");
|
|
136
|
+
|
|
137
|
+
// Merge with defaults to get fully resolved config
|
|
138
|
+
const resolved = mergeWithDefaults(config.constraints);
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Validating Forms
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import { validateFormSpec } from "@formspec/constraints";
|
|
145
|
+
import { formspec, field, when, is } from "@formspec/dsl";
|
|
146
|
+
|
|
147
|
+
const form = formspec(
|
|
148
|
+
field.text("name"),
|
|
149
|
+
field.dynamicEnum("country", "fetch_countries"),
|
|
150
|
+
when(is("country", "US"),
|
|
151
|
+
field.text("state"),
|
|
152
|
+
),
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
const result = validateFormSpec(form, resolved);
|
|
156
|
+
|
|
157
|
+
if (!result.valid) {
|
|
158
|
+
for (const issue of result.issues) {
|
|
159
|
+
console.log(`${issue.severity}: ${issue.message}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Validation Result
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
interface ValidationResult {
|
|
168
|
+
valid: boolean; // true if no errors (warnings OK)
|
|
169
|
+
issues: ValidationIssue[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface ValidationIssue {
|
|
173
|
+
code: string; // e.g., "FIELD_TYPE_NOT_ALLOWED"
|
|
174
|
+
message: string; // Human-readable description
|
|
175
|
+
severity: "error" | "warning";
|
|
176
|
+
category: "fieldTypes" | "layout" | "uiSchema" | "fieldOptions" | "controlOptions";
|
|
177
|
+
path?: string; // JSON pointer to issue location
|
|
178
|
+
fieldName?: string; // Affected field name
|
|
179
|
+
fieldType?: string; // Affected field type
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## ESLint Integration
|
|
184
|
+
|
|
185
|
+
Use `@formspec/eslint-plugin` to catch constraint violations at development time:
|
|
186
|
+
|
|
187
|
+
```javascript
|
|
188
|
+
// eslint.config.js
|
|
189
|
+
import formspec from "@formspec/eslint-plugin";
|
|
190
|
+
|
|
191
|
+
export default [
|
|
192
|
+
{
|
|
193
|
+
plugins: { formspec },
|
|
194
|
+
rules: {
|
|
195
|
+
// Enforce allowed field types from .formspec.yml
|
|
196
|
+
"formspec/constraints-allowed-field-types": "error",
|
|
197
|
+
// Enforce allowed layouts from .formspec.yml
|
|
198
|
+
"formspec/constraints-allowed-layouts": "error",
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
];
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The ESLint rules automatically load constraints from your `.formspec.yml` file.
|
|
205
|
+
|
|
206
|
+
## Example Configurations
|
|
207
|
+
|
|
208
|
+
### Simple Forms Only
|
|
209
|
+
|
|
210
|
+
Restrict to flat forms with basic field types:
|
|
211
|
+
|
|
212
|
+
```yaml
|
|
213
|
+
constraints:
|
|
214
|
+
fieldTypes:
|
|
215
|
+
array: error
|
|
216
|
+
object: error
|
|
217
|
+
dynamicEnum: error
|
|
218
|
+
dynamicSchema: error
|
|
219
|
+
layout:
|
|
220
|
+
conditionals: error
|
|
221
|
+
maxNestingDepth: 0
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### JSON Forms Compatible
|
|
225
|
+
|
|
226
|
+
Restrict to features supported by standard JSON Forms renderers:
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
constraints:
|
|
230
|
+
fieldTypes:
|
|
231
|
+
dynamicSchema: error # Not supported by JSON Forms
|
|
232
|
+
uiSchema:
|
|
233
|
+
layouts:
|
|
234
|
+
Categorization: warn # May not be supported by all renderers
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Warn on Advanced Features
|
|
238
|
+
|
|
239
|
+
Allow all features but warn on complex ones:
|
|
240
|
+
|
|
241
|
+
```yaml
|
|
242
|
+
constraints:
|
|
243
|
+
fieldTypes:
|
|
244
|
+
dynamicEnum: warn
|
|
245
|
+
dynamicSchema: warn
|
|
246
|
+
array: warn
|
|
247
|
+
object: warn
|
|
248
|
+
layout:
|
|
249
|
+
conditionals: warn
|
|
250
|
+
maxNestingDepth: 2
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## JSON Schema
|
|
254
|
+
|
|
255
|
+
A JSON Schema for `.formspec.yml` is available for editor autocompletion:
|
|
256
|
+
|
|
257
|
+
```yaml
|
|
258
|
+
# .formspec.yml
|
|
259
|
+
# yaml-language-server: $schema=node_modules/@formspec/constraints/formspec.schema.json
|
|
260
|
+
|
|
261
|
+
constraints:
|
|
262
|
+
fieldTypes:
|
|
263
|
+
text: off
|
|
264
|
+
# ... autocomplete available
|
|
265
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/loader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { loadConfigFromString, defineConstraints } from "../index.js";
|
|
3
|
+
describe("loadConfigFromString", () => {
|
|
4
|
+
it("parses YAML with constraints section", () => {
|
|
5
|
+
const yaml = `
|
|
6
|
+
constraints:
|
|
7
|
+
fieldTypes:
|
|
8
|
+
dynamicEnum: error
|
|
9
|
+
dynamicSchema: error
|
|
10
|
+
layout:
|
|
11
|
+
group: error
|
|
12
|
+
conditionals: warn
|
|
13
|
+
`;
|
|
14
|
+
const config = loadConfigFromString(yaml);
|
|
15
|
+
expect(config.fieldTypes.dynamicEnum).toBe("error");
|
|
16
|
+
expect(config.fieldTypes.dynamicSchema).toBe("error");
|
|
17
|
+
expect(config.layout.group).toBe("error");
|
|
18
|
+
expect(config.layout.conditionals).toBe("warn");
|
|
19
|
+
});
|
|
20
|
+
it("applies defaults for missing values", () => {
|
|
21
|
+
const yaml = `
|
|
22
|
+
constraints:
|
|
23
|
+
fieldTypes:
|
|
24
|
+
dynamicEnum: error
|
|
25
|
+
`;
|
|
26
|
+
const config = loadConfigFromString(yaml);
|
|
27
|
+
expect(config.fieldTypes.dynamicEnum).toBe("error");
|
|
28
|
+
expect(config.fieldTypes.text).toBe("off");
|
|
29
|
+
expect(config.fieldTypes.number).toBe("off");
|
|
30
|
+
expect(config.layout.group).toBe("off");
|
|
31
|
+
});
|
|
32
|
+
it("handles empty YAML", () => {
|
|
33
|
+
const config = loadConfigFromString("");
|
|
34
|
+
// Should return all defaults
|
|
35
|
+
expect(config.fieldTypes.text).toBe("off");
|
|
36
|
+
expect(config.layout.group).toBe("off");
|
|
37
|
+
});
|
|
38
|
+
it("handles YAML with only comments", () => {
|
|
39
|
+
const yaml = `
|
|
40
|
+
# This is a comment
|
|
41
|
+
# Another comment
|
|
42
|
+
`;
|
|
43
|
+
const config = loadConfigFromString(yaml);
|
|
44
|
+
expect(config.fieldTypes.text).toBe("off");
|
|
45
|
+
});
|
|
46
|
+
it("parses nested uiSchema constraints", () => {
|
|
47
|
+
const yaml = `
|
|
48
|
+
constraints:
|
|
49
|
+
uiSchema:
|
|
50
|
+
layouts:
|
|
51
|
+
VerticalLayout: off
|
|
52
|
+
HorizontalLayout: error
|
|
53
|
+
Group: error
|
|
54
|
+
rules:
|
|
55
|
+
enabled: error
|
|
56
|
+
`;
|
|
57
|
+
const config = loadConfigFromString(yaml);
|
|
58
|
+
expect(config.uiSchema.layouts.VerticalLayout).toBe("off");
|
|
59
|
+
expect(config.uiSchema.layouts.HorizontalLayout).toBe("error");
|
|
60
|
+
expect(config.uiSchema.layouts.Group).toBe("error");
|
|
61
|
+
expect(config.uiSchema.rules.enabled).toBe("error");
|
|
62
|
+
});
|
|
63
|
+
it("parses fieldOptions constraints", () => {
|
|
64
|
+
const yaml = `
|
|
65
|
+
constraints:
|
|
66
|
+
fieldOptions:
|
|
67
|
+
minItems: error
|
|
68
|
+
maxItems: error
|
|
69
|
+
placeholder: warn
|
|
70
|
+
`;
|
|
71
|
+
const config = loadConfigFromString(yaml);
|
|
72
|
+
expect(config.fieldOptions.minItems).toBe("error");
|
|
73
|
+
expect(config.fieldOptions.maxItems).toBe("error");
|
|
74
|
+
expect(config.fieldOptions.placeholder).toBe("warn");
|
|
75
|
+
expect(config.fieldOptions.label).toBe("off");
|
|
76
|
+
});
|
|
77
|
+
it("parses maxNestingDepth as number", () => {
|
|
78
|
+
const yaml = `
|
|
79
|
+
constraints:
|
|
80
|
+
layout:
|
|
81
|
+
maxNestingDepth: 2
|
|
82
|
+
`;
|
|
83
|
+
const config = loadConfigFromString(yaml);
|
|
84
|
+
expect(config.layout.maxNestingDepth).toBe(2);
|
|
85
|
+
});
|
|
86
|
+
it("throws on invalid YAML structure", () => {
|
|
87
|
+
const yaml = `
|
|
88
|
+
- this
|
|
89
|
+
- is
|
|
90
|
+
- an array
|
|
91
|
+
`;
|
|
92
|
+
expect(() => loadConfigFromString(yaml)).toThrow();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
describe("defineConstraints", () => {
|
|
96
|
+
it("creates config from object literal", () => {
|
|
97
|
+
const config = defineConstraints({
|
|
98
|
+
fieldTypes: {
|
|
99
|
+
dynamicEnum: "error",
|
|
100
|
+
array: "warn",
|
|
101
|
+
},
|
|
102
|
+
layout: {
|
|
103
|
+
group: "error",
|
|
104
|
+
maxNestingDepth: 1,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
expect(config.fieldTypes.dynamicEnum).toBe("error");
|
|
108
|
+
expect(config.fieldTypes.array).toBe("warn");
|
|
109
|
+
expect(config.fieldTypes.text).toBe("off"); // default
|
|
110
|
+
expect(config.layout.group).toBe("error");
|
|
111
|
+
expect(config.layout.maxNestingDepth).toBe(1);
|
|
112
|
+
});
|
|
113
|
+
it("handles empty config", () => {
|
|
114
|
+
const config = defineConstraints({});
|
|
115
|
+
// All defaults
|
|
116
|
+
expect(config.fieldTypes.text).toBe("off");
|
|
117
|
+
expect(config.layout.group).toBe("off");
|
|
118
|
+
expect(config.uiSchema.layouts.VerticalLayout).toBe("off");
|
|
119
|
+
});
|
|
120
|
+
it("handles partial nested config", () => {
|
|
121
|
+
const config = defineConstraints({
|
|
122
|
+
uiSchema: {
|
|
123
|
+
rules: {
|
|
124
|
+
enabled: "error",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
expect(config.uiSchema.rules.enabled).toBe("error");
|
|
129
|
+
expect(config.uiSchema.rules.effects.SHOW).toBe("off"); // default
|
|
130
|
+
expect(config.uiSchema.layouts.VerticalLayout).toBe("off"); // default
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=loader.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.test.js","sourceRoot":"","sources":["../../src/__tests__/loader.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEtE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,IAAI,GAAG;;;;;;;;CAQhB,CAAC;QACE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE1C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,IAAI,GAAG;;;;CAIhB,CAAC;QACE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE1C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,MAA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