mailschema 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,329 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mailschema.org/schemas/forms-0.1.schema.json",
4
+ "title": "MailSchema form fields 0.1",
5
+ "description": "Shared, immutable blocks for types that collect values: a closed subset of JSON Schema based on Model Context Protocol elicitation, with HTML autofill field names.",
6
+ "$defs": {
7
+ "fieldName": {
8
+ "type": "string",
9
+ "pattern": "^[a-z][A-Za-z0-9]{0,63}$"
10
+ },
11
+ "text": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 2000,
15
+ "pattern": "[^\\t\\n\\u000b\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]"
16
+ },
17
+ "autocomplete": {
18
+ "type": "string",
19
+ "maxLength": 200,
20
+ "pattern": "^(?:section-[a-z0-9-]+ )?(?:(?:shipping|billing) )?(?:(?:home|work|mobile|fax|pager) )?[a-z][a-z0-9-]*$",
21
+ "not": {
22
+ "pattern": "(?:^| )(?:current-password|new-password|one-time-code|cc-[a-z-]+)$"
23
+ }
24
+ },
25
+ "choice": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "const": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 200
33
+ },
34
+ "title": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 240,
38
+ "pattern": "[^\\t\\n\\u000b\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]"
39
+ }
40
+ },
41
+ "required": ["const", "title"]
42
+ },
43
+ "choices": {
44
+ "type": "array",
45
+ "items": {
46
+ "$ref": "#/$defs/choice"
47
+ },
48
+ "minItems": 1,
49
+ "maxItems": 100
50
+ },
51
+ "textField": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "properties": {
55
+ "type": {
56
+ "const": "string"
57
+ },
58
+ "title": {
59
+ "$ref": "#/$defs/text"
60
+ },
61
+ "description": {
62
+ "$ref": "#/$defs/text"
63
+ },
64
+ "minLength": {
65
+ "type": "integer",
66
+ "minimum": 0,
67
+ "maximum": 12000
68
+ },
69
+ "maxLength": {
70
+ "type": "integer",
71
+ "minimum": 1,
72
+ "maximum": 12000
73
+ },
74
+ "format": {
75
+ "enum": ["email", "uri", "date", "date-time"]
76
+ },
77
+ "default": {
78
+ "type": "string",
79
+ "maxLength": 12000
80
+ },
81
+ "autocomplete": {
82
+ "$ref": "#/$defs/autocomplete"
83
+ }
84
+ },
85
+ "required": ["type", "title"]
86
+ },
87
+ "numberField": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "properties": {
91
+ "type": {
92
+ "enum": ["number", "integer"]
93
+ },
94
+ "title": {
95
+ "$ref": "#/$defs/text"
96
+ },
97
+ "description": {
98
+ "$ref": "#/$defs/text"
99
+ },
100
+ "minimum": {
101
+ "type": "integer",
102
+ "minimum": -9007199254740991,
103
+ "maximum": 9007199254740991
104
+ },
105
+ "maximum": {
106
+ "type": "integer",
107
+ "minimum": -9007199254740991,
108
+ "maximum": 9007199254740991
109
+ },
110
+ "default": {
111
+ "type": "integer",
112
+ "minimum": -9007199254740991,
113
+ "maximum": 9007199254740991
114
+ },
115
+ "autocomplete": {
116
+ "$ref": "#/$defs/autocomplete"
117
+ }
118
+ },
119
+ "required": ["type", "title"]
120
+ },
121
+ "booleanField": {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "properties": {
125
+ "type": {
126
+ "const": "boolean"
127
+ },
128
+ "title": {
129
+ "$ref": "#/$defs/text"
130
+ },
131
+ "description": {
132
+ "$ref": "#/$defs/text"
133
+ },
134
+ "default": {
135
+ "type": "boolean"
136
+ }
137
+ },
138
+ "required": ["type", "title"]
139
+ },
140
+ "choiceField": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "properties": {
144
+ "type": {
145
+ "const": "string"
146
+ },
147
+ "title": {
148
+ "$ref": "#/$defs/text"
149
+ },
150
+ "description": {
151
+ "$ref": "#/$defs/text"
152
+ },
153
+ "oneOf": {
154
+ "$ref": "#/$defs/choices"
155
+ },
156
+ "default": {
157
+ "type": "string",
158
+ "maxLength": 200
159
+ },
160
+ "autocomplete": {
161
+ "$ref": "#/$defs/autocomplete"
162
+ }
163
+ },
164
+ "required": ["type", "title", "oneOf"]
165
+ },
166
+ "choicesField": {
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "properties": {
170
+ "type": {
171
+ "const": "array"
172
+ },
173
+ "title": {
174
+ "$ref": "#/$defs/text"
175
+ },
176
+ "description": {
177
+ "$ref": "#/$defs/text"
178
+ },
179
+ "items": {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "properties": {
183
+ "anyOf": {
184
+ "$ref": "#/$defs/choices"
185
+ }
186
+ },
187
+ "required": ["anyOf"]
188
+ },
189
+ "minItems": {
190
+ "type": "integer",
191
+ "minimum": 0,
192
+ "maximum": 100
193
+ },
194
+ "maxItems": {
195
+ "type": "integer",
196
+ "minimum": 1,
197
+ "maximum": 100
198
+ },
199
+ "uniqueItems": {
200
+ "const": true
201
+ },
202
+ "default": {
203
+ "type": "array",
204
+ "items": {
205
+ "type": "string",
206
+ "maxLength": 200
207
+ },
208
+ "maxItems": 100,
209
+ "uniqueItems": true
210
+ }
211
+ },
212
+ "required": ["type", "title", "items", "uniqueItems"]
213
+ },
214
+ "fields": {
215
+ "type": "object",
216
+ "additionalProperties": false,
217
+ "properties": {
218
+ "type": {
219
+ "const": "object"
220
+ },
221
+ "properties": {
222
+ "type": "object",
223
+ "minProperties": 1,
224
+ "maxProperties": 50,
225
+ "propertyNames": {
226
+ "$ref": "#/$defs/fieldName"
227
+ },
228
+ "additionalProperties": {
229
+ "oneOf": [
230
+ {
231
+ "$ref": "#/$defs/textField"
232
+ },
233
+ {
234
+ "$ref": "#/$defs/numberField"
235
+ },
236
+ {
237
+ "$ref": "#/$defs/booleanField"
238
+ },
239
+ {
240
+ "$ref": "#/$defs/choiceField"
241
+ },
242
+ {
243
+ "$ref": "#/$defs/choicesField"
244
+ }
245
+ ]
246
+ }
247
+ },
248
+ "required": {
249
+ "type": "array",
250
+ "items": {
251
+ "$ref": "#/$defs/fieldName"
252
+ },
253
+ "uniqueItems": true,
254
+ "maxItems": 50
255
+ }
256
+ },
257
+ "required": ["type", "properties"]
258
+ },
259
+ "choiceFields": {
260
+ "type": "object",
261
+ "additionalProperties": false,
262
+ "properties": {
263
+ "type": {
264
+ "const": "object"
265
+ },
266
+ "properties": {
267
+ "type": "object",
268
+ "minProperties": 1,
269
+ "maxProperties": 50,
270
+ "propertyNames": {
271
+ "$ref": "#/$defs/fieldName"
272
+ },
273
+ "additionalProperties": {
274
+ "oneOf": [
275
+ {
276
+ "$ref": "#/$defs/booleanField"
277
+ },
278
+ {
279
+ "$ref": "#/$defs/choiceField"
280
+ },
281
+ {
282
+ "$ref": "#/$defs/choicesField"
283
+ }
284
+ ]
285
+ }
286
+ },
287
+ "required": {
288
+ "type": "array",
289
+ "items": {
290
+ "$ref": "#/$defs/fieldName"
291
+ },
292
+ "uniqueItems": true,
293
+ "maxItems": 50
294
+ }
295
+ },
296
+ "required": ["type", "properties"]
297
+ },
298
+ "fieldValues": {
299
+ "type": "object",
300
+ "maxProperties": 50,
301
+ "propertyNames": {
302
+ "$ref": "#/$defs/fieldName"
303
+ },
304
+ "additionalProperties": {
305
+ "anyOf": [
306
+ {
307
+ "type": "string",
308
+ "maxLength": 12000
309
+ },
310
+ {
311
+ "type": "number"
312
+ },
313
+ {
314
+ "type": "boolean"
315
+ },
316
+ {
317
+ "type": "array",
318
+ "items": {
319
+ "type": "string",
320
+ "maxLength": 200
321
+ },
322
+ "maxItems": 100,
323
+ "uniqueItems": true
324
+ }
325
+ ]
326
+ }
327
+ }
328
+ }
329
+ }