@cloudhal/core-contracts 0.4.0 → 0.6.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.
- package/dist/src/generated/content-entry.d.ts +1 -1
- package/dist/src/generated/content-entry.js +1 -1
- package/dist/src/generated/index.d.ts +1 -1
- package/dist/src/generated/index.js +1 -1
- package/dist/src/generated/page.d.ts +193 -0
- package/dist/src/generated/page.js +217 -0
- package/dist/src/generated/schemas.d.ts +2351 -923
- package/dist/src/generated/schemas.js +944 -31
- package/dist/src/generated/section.d.ts +187 -0
- package/dist/src/generated/section.js +211 -0
- package/dist/src/generated/site.d.ts +531 -0
- package/dist/src/generated/site.js +571 -0
- package/dist/src/generated/validators.js +5852 -1661
- package/package.json +1 -1
- package/schemas/common.schema.json +50 -0
- package/schemas/content-entry.schema.json +1 -1
- package/schemas/section.schema.json +9 -1
- package/schemas/site.schema.json +553 -0
package/package.json
CHANGED
|
@@ -177,6 +177,56 @@
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
|
+
"FieldCondition": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"description": "RFC-0042: one condition on a typed field of the listed collection. `value` is read by the field's type: a number, YYYY-MM-DD, an RFC 3339 instant, true/false, an option value, or `now`. `values` only with `in`.",
|
|
183
|
+
"additionalProperties": false,
|
|
184
|
+
"required": ["field", "op"],
|
|
185
|
+
"properties": {
|
|
186
|
+
"field": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "A field key (site.schema.json FieldKey's pattern, repeated).",
|
|
189
|
+
"pattern": "^[a-z][A-Za-z0-9]{0,39}$"
|
|
190
|
+
},
|
|
191
|
+
"op": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"enum": ["eq", "ne", "lt", "lte", "gt", "gte", "in", "set", "unset"]
|
|
194
|
+
},
|
|
195
|
+
"value": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"minLength": 1,
|
|
198
|
+
"maxLength": 100
|
|
199
|
+
},
|
|
200
|
+
"values": {
|
|
201
|
+
"type": "array",
|
|
202
|
+
"minItems": 1,
|
|
203
|
+
"maxItems": 20,
|
|
204
|
+
"uniqueItems": true,
|
|
205
|
+
"items": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"minLength": 1,
|
|
208
|
+
"maxLength": 100
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"FieldOrder": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"description": "RFC-0042: order a listing by a number, date or datetime field. Entries without a value sort last.",
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"required": ["field", "direction"],
|
|
218
|
+
"properties": {
|
|
219
|
+
"field": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"description": "A field key (site.schema.json FieldKey's pattern, repeated).",
|
|
222
|
+
"pattern": "^[a-z][A-Za-z0-9]{0,39}$"
|
|
223
|
+
},
|
|
224
|
+
"direction": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"enum": ["asc", "desc"]
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
180
230
|
"TimeZone": {
|
|
181
231
|
"type": "string",
|
|
182
232
|
"description": "IANA time zone name from the tz database (RFC-0008), e.g. Europe/Istanbul, America/Argentina/Buenos_Aires, Etc/GMT+3 or UTC. Wall-clock times a person enters are kept with their zone, so the instant is recomputed when governments change the rules. The pattern bounds the shape only; writers also check the name against the runtime's Intl zone list.",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"body": { "$ref": "#/$defs/Body" },
|
|
36
36
|
"fields": {
|
|
37
37
|
"type": "object",
|
|
38
|
-
"description": "Collection-specific values; any JSON.",
|
|
38
|
+
"description": "Collection-specific values, keyed by field. A collection with typed fields (RFC-0041, Site.collections.<key>.fields) checks each value against its definition on write; otherwise any JSON. An absent key means no value.",
|
|
39
39
|
"additionalProperties": true
|
|
40
40
|
},
|
|
41
41
|
"tags": {
|
|
@@ -61,7 +61,15 @@
|
|
|
61
61
|
"description": "Filter expression over term assignments (RFC-0002), e.g. 'category:news+tag:ai' or 'category:news>*'.",
|
|
62
62
|
"minLength": 1,
|
|
63
63
|
"maxLength": 512
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
|
+
"where": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"description": "RFC-0042: conditions on the collection's list fields, ANDed.",
|
|
68
|
+
"minItems": 1,
|
|
69
|
+
"maxItems": 4,
|
|
70
|
+
"items": { "$ref": "common.schema.json#/$defs/FieldCondition" }
|
|
71
|
+
},
|
|
72
|
+
"orderBy": { "$ref": "common.schema.json#/$defs/FieldOrder" }
|
|
65
73
|
}
|
|
66
74
|
},
|
|
67
75
|
{
|
package/schemas/site.schema.json
CHANGED
|
@@ -104,9 +104,163 @@
|
|
|
104
104
|
"type": "string",
|
|
105
105
|
"description": "RFC-0040: default order where none is given (Studio's list, entry queries without sort, MCP list_entries). Absent: newest.",
|
|
106
106
|
"enum": ["newest", "oldest", "title"]
|
|
107
|
+
},
|
|
108
|
+
"fields": {
|
|
109
|
+
"type": "array",
|
|
110
|
+
"description": "RFC-0041: the collection's typed custom fields, in form order. Values live in ContentEntry.fields under each key. At most 200 per site and unique keys (checked in code).",
|
|
111
|
+
"minItems": 1,
|
|
112
|
+
"maxItems": 30,
|
|
113
|
+
"items": {
|
|
114
|
+
"$ref": "#/$defs/FieldDefinition"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"listFields": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"description": "RFC-0042: fields that listings, queries, Studio columns and MCP may filter and sort by, in column order. Keys of this collection's fields (checked in code).",
|
|
120
|
+
"minItems": 1,
|
|
121
|
+
"maxItems": 4,
|
|
122
|
+
"uniqueItems": true,
|
|
123
|
+
"items": {
|
|
124
|
+
"$ref": "#/$defs/FieldKey"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"expiry": {
|
|
128
|
+
"$ref": "#/$defs/CollectionExpiry"
|
|
129
|
+
},
|
|
130
|
+
"structuredData": {
|
|
131
|
+
"$ref": "#/$defs/StructuredDataPreset"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"CollectionExpiry": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"description": "RFC-0042: a time gate every entry derives from one of its date or datetime fields, checked at render time like Availability.until. A date ends at the start of the next day in the site's time zone.",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": ["field", "action"],
|
|
140
|
+
"properties": {
|
|
141
|
+
"field": {
|
|
142
|
+
"$ref": "#/$defs/FieldKey"
|
|
143
|
+
},
|
|
144
|
+
"action": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "unlist: the page stays, the entry leaves listings, feeds, the sitemap and search. hide: every public route answers 404.",
|
|
147
|
+
"enum": ["unlist", "hide"]
|
|
148
|
+
},
|
|
149
|
+
"afterMinutes": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"description": "Grace after the field's instant. Absent: 0.",
|
|
152
|
+
"minimum": 0,
|
|
153
|
+
"maximum": 10080
|
|
107
154
|
}
|
|
108
155
|
}
|
|
109
156
|
},
|
|
157
|
+
"StructuredDataPreset": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"description": "RFC-0042: the JSON-LD type an entry page emits in place of BlogPosting, with its properties mapped to value sources. Paths, fitting field types and required properties are a closed table in code (@cloudhal/core-ts/structured-data).",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"required": ["type", "properties"],
|
|
162
|
+
"properties": {
|
|
163
|
+
"type": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"enum": ["Event", "JobPosting", "Product", "Recipe"]
|
|
166
|
+
},
|
|
167
|
+
"properties": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"description": "Keyed by property path, e.g. startDate or location.address.addressLocality.",
|
|
170
|
+
"propertyNames": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"pattern": "^[a-z][A-Za-z]{0,39}(\\.[a-z][A-Za-z]{0,39}){0,2}$"
|
|
173
|
+
},
|
|
174
|
+
"minProperties": 1,
|
|
175
|
+
"maxProperties": 40,
|
|
176
|
+
"additionalProperties": {
|
|
177
|
+
"$ref": "#/$defs/StructuredDataSource"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"StructuredDataSource": {
|
|
183
|
+
"description": "RFC-0042: where one JSON-LD property's value comes from, discriminated by `kind`.",
|
|
184
|
+
"oneOf": [
|
|
185
|
+
{
|
|
186
|
+
"title": "FieldValueSource",
|
|
187
|
+
"type": "object",
|
|
188
|
+
"description": "A typed field of this collection, converted by its type.",
|
|
189
|
+
"additionalProperties": false,
|
|
190
|
+
"required": ["kind", "field"],
|
|
191
|
+
"properties": {
|
|
192
|
+
"kind": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": ["field"]
|
|
195
|
+
},
|
|
196
|
+
"field": {
|
|
197
|
+
"$ref": "#/$defs/FieldKey"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"title": "EntryValueSource",
|
|
203
|
+
"type": "object",
|
|
204
|
+
"description": "A built-in property of the entry.",
|
|
205
|
+
"additionalProperties": false,
|
|
206
|
+
"required": ["kind", "property"],
|
|
207
|
+
"properties": {
|
|
208
|
+
"kind": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"enum": ["entry"]
|
|
211
|
+
},
|
|
212
|
+
"property": {
|
|
213
|
+
"$ref": "#/$defs/EntryValueProperty"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"title": "SiteValueSource",
|
|
219
|
+
"type": "object",
|
|
220
|
+
"description": "A property of the site.",
|
|
221
|
+
"additionalProperties": false,
|
|
222
|
+
"required": ["kind", "property"],
|
|
223
|
+
"properties": {
|
|
224
|
+
"kind": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"enum": ["site"]
|
|
227
|
+
},
|
|
228
|
+
"property": {
|
|
229
|
+
"$ref": "#/$defs/SiteValueProperty"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"title": "ConstantValueSource",
|
|
235
|
+
"type": "object",
|
|
236
|
+
"description": "A plain-text constant: no control characters, no markup meaning; vocabulary-checked on enum paths (in code).",
|
|
237
|
+
"additionalProperties": false,
|
|
238
|
+
"required": ["kind", "value"],
|
|
239
|
+
"properties": {
|
|
240
|
+
"kind": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"enum": ["constant"]
|
|
243
|
+
},
|
|
244
|
+
"value": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"minLength": 1,
|
|
247
|
+
"maxLength": 200,
|
|
248
|
+
"pattern": "^[^\\x00-\\x1F\\x7F]+$"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
"EntryValueProperty": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"description": "RFC-0042: entry properties a structured-data property may read.",
|
|
257
|
+
"enum": ["title", "summary", "body", "coverImage", "url", "publishedAt", "updatedAt"]
|
|
258
|
+
},
|
|
259
|
+
"SiteValueProperty": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"description": "RFC-0042: site properties a structured-data property may read.",
|
|
262
|
+
"enum": ["name", "url", "logo"]
|
|
263
|
+
},
|
|
110
264
|
"CollectionLabel": {
|
|
111
265
|
"type": "object",
|
|
112
266
|
"additionalProperties": false,
|
|
@@ -117,6 +271,405 @@
|
|
|
117
271
|
"description": { "type": "string", "maxLength": 1000 }
|
|
118
272
|
}
|
|
119
273
|
},
|
|
274
|
+
"FieldDefinition": {
|
|
275
|
+
"description": "RFC-0041: one typed custom field of a collection, discriminated by `type`.",
|
|
276
|
+
"oneOf": [
|
|
277
|
+
{
|
|
278
|
+
"title": "TextField",
|
|
279
|
+
"type": "object",
|
|
280
|
+
"description": "Plain text: a string of at most maxLength characters.",
|
|
281
|
+
"additionalProperties": false,
|
|
282
|
+
"required": ["key", "type", "labels", "localized"],
|
|
283
|
+
"properties": {
|
|
284
|
+
"key": {
|
|
285
|
+
"$ref": "#/$defs/FieldKey"
|
|
286
|
+
},
|
|
287
|
+
"type": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"enum": ["text"]
|
|
290
|
+
},
|
|
291
|
+
"labels": {
|
|
292
|
+
"$ref": "#/$defs/FieldLabels"
|
|
293
|
+
},
|
|
294
|
+
"localized": {
|
|
295
|
+
"type": "boolean",
|
|
296
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
297
|
+
},
|
|
298
|
+
"requiredToPublish": {
|
|
299
|
+
"type": "boolean",
|
|
300
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
301
|
+
},
|
|
302
|
+
"migration": {
|
|
303
|
+
"$ref": "#/$defs/FieldMigration"
|
|
304
|
+
},
|
|
305
|
+
"maxLength": {
|
|
306
|
+
"type": "integer",
|
|
307
|
+
"description": "Absent: 5000.",
|
|
308
|
+
"minimum": 1,
|
|
309
|
+
"maximum": 5000
|
|
310
|
+
},
|
|
311
|
+
"multiline": {
|
|
312
|
+
"type": "boolean",
|
|
313
|
+
"description": "Line breaks allowed. Absent: false."
|
|
314
|
+
},
|
|
315
|
+
"searchable": {
|
|
316
|
+
"type": "boolean",
|
|
317
|
+
"description": "Its words go into site search. Absent: false."
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"title": "RichTextField",
|
|
323
|
+
"type": "object",
|
|
324
|
+
"description": "Cloudhal Markdown v1 (ADR-0028), at most 50 000 characters.",
|
|
325
|
+
"additionalProperties": false,
|
|
326
|
+
"required": ["key", "type", "labels", "localized"],
|
|
327
|
+
"properties": {
|
|
328
|
+
"key": {
|
|
329
|
+
"$ref": "#/$defs/FieldKey"
|
|
330
|
+
},
|
|
331
|
+
"type": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"enum": ["richText"]
|
|
334
|
+
},
|
|
335
|
+
"labels": {
|
|
336
|
+
"$ref": "#/$defs/FieldLabels"
|
|
337
|
+
},
|
|
338
|
+
"localized": {
|
|
339
|
+
"type": "boolean",
|
|
340
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
341
|
+
},
|
|
342
|
+
"requiredToPublish": {
|
|
343
|
+
"type": "boolean",
|
|
344
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
345
|
+
},
|
|
346
|
+
"migration": {
|
|
347
|
+
"$ref": "#/$defs/FieldMigration"
|
|
348
|
+
},
|
|
349
|
+
"searchable": {
|
|
350
|
+
"type": "boolean",
|
|
351
|
+
"description": "Its words go into site search. Absent: false."
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"title": "NumberField",
|
|
357
|
+
"type": "object",
|
|
358
|
+
"description": "A finite number.",
|
|
359
|
+
"additionalProperties": false,
|
|
360
|
+
"required": ["key", "type", "labels", "localized"],
|
|
361
|
+
"properties": {
|
|
362
|
+
"key": {
|
|
363
|
+
"$ref": "#/$defs/FieldKey"
|
|
364
|
+
},
|
|
365
|
+
"type": {
|
|
366
|
+
"type": "string",
|
|
367
|
+
"enum": ["number"]
|
|
368
|
+
},
|
|
369
|
+
"labels": {
|
|
370
|
+
"$ref": "#/$defs/FieldLabels"
|
|
371
|
+
},
|
|
372
|
+
"localized": {
|
|
373
|
+
"type": "boolean",
|
|
374
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
375
|
+
},
|
|
376
|
+
"requiredToPublish": {
|
|
377
|
+
"type": "boolean",
|
|
378
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
379
|
+
},
|
|
380
|
+
"migration": {
|
|
381
|
+
"$ref": "#/$defs/FieldMigration"
|
|
382
|
+
},
|
|
383
|
+
"integer": {
|
|
384
|
+
"type": "boolean",
|
|
385
|
+
"description": "Whole numbers only. Absent: false."
|
|
386
|
+
},
|
|
387
|
+
"minimum": {
|
|
388
|
+
"type": "number"
|
|
389
|
+
},
|
|
390
|
+
"maximum": {
|
|
391
|
+
"type": "number"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"title": "BooleanField",
|
|
397
|
+
"type": "object",
|
|
398
|
+
"description": "true or false; absent reads as false, so it cannot be required to publish.",
|
|
399
|
+
"additionalProperties": false,
|
|
400
|
+
"required": ["key", "type", "labels", "localized"],
|
|
401
|
+
"properties": {
|
|
402
|
+
"key": {
|
|
403
|
+
"$ref": "#/$defs/FieldKey"
|
|
404
|
+
},
|
|
405
|
+
"type": {
|
|
406
|
+
"type": "string",
|
|
407
|
+
"enum": ["boolean"]
|
|
408
|
+
},
|
|
409
|
+
"labels": {
|
|
410
|
+
"$ref": "#/$defs/FieldLabels"
|
|
411
|
+
},
|
|
412
|
+
"localized": {
|
|
413
|
+
"type": "boolean",
|
|
414
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
415
|
+
},
|
|
416
|
+
"migration": {
|
|
417
|
+
"$ref": "#/$defs/FieldMigration"
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"title": "DateField",
|
|
423
|
+
"type": "object",
|
|
424
|
+
"description": "A calendar day without a zone (YYYY-MM-DD).",
|
|
425
|
+
"additionalProperties": false,
|
|
426
|
+
"required": ["key", "type", "labels", "localized"],
|
|
427
|
+
"properties": {
|
|
428
|
+
"key": {
|
|
429
|
+
"$ref": "#/$defs/FieldKey"
|
|
430
|
+
},
|
|
431
|
+
"type": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"enum": ["date"]
|
|
434
|
+
},
|
|
435
|
+
"labels": {
|
|
436
|
+
"$ref": "#/$defs/FieldLabels"
|
|
437
|
+
},
|
|
438
|
+
"localized": {
|
|
439
|
+
"type": "boolean",
|
|
440
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
441
|
+
},
|
|
442
|
+
"requiredToPublish": {
|
|
443
|
+
"type": "boolean",
|
|
444
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
445
|
+
},
|
|
446
|
+
"migration": {
|
|
447
|
+
"$ref": "#/$defs/FieldMigration"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"title": "DateTimeField",
|
|
453
|
+
"type": "object",
|
|
454
|
+
"description": "An instant with the zone it was entered in: {at, timeZone} (RFC-0008 §9.1).",
|
|
455
|
+
"additionalProperties": false,
|
|
456
|
+
"required": ["key", "type", "labels", "localized"],
|
|
457
|
+
"properties": {
|
|
458
|
+
"key": {
|
|
459
|
+
"$ref": "#/$defs/FieldKey"
|
|
460
|
+
},
|
|
461
|
+
"type": {
|
|
462
|
+
"type": "string",
|
|
463
|
+
"enum": ["datetime"]
|
|
464
|
+
},
|
|
465
|
+
"labels": {
|
|
466
|
+
"$ref": "#/$defs/FieldLabels"
|
|
467
|
+
},
|
|
468
|
+
"localized": {
|
|
469
|
+
"type": "boolean",
|
|
470
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
471
|
+
},
|
|
472
|
+
"requiredToPublish": {
|
|
473
|
+
"type": "boolean",
|
|
474
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
475
|
+
},
|
|
476
|
+
"migration": {
|
|
477
|
+
"$ref": "#/$defs/FieldMigration"
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"title": "UrlField",
|
|
483
|
+
"type": "object",
|
|
484
|
+
"description": "A link: https, http, mailto, tel, a site-relative path or a #fragment; at most 2048 characters.",
|
|
485
|
+
"additionalProperties": false,
|
|
486
|
+
"required": ["key", "type", "labels", "localized"],
|
|
487
|
+
"properties": {
|
|
488
|
+
"key": {
|
|
489
|
+
"$ref": "#/$defs/FieldKey"
|
|
490
|
+
},
|
|
491
|
+
"type": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"enum": ["url"]
|
|
494
|
+
},
|
|
495
|
+
"labels": {
|
|
496
|
+
"$ref": "#/$defs/FieldLabels"
|
|
497
|
+
},
|
|
498
|
+
"localized": {
|
|
499
|
+
"type": "boolean",
|
|
500
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
501
|
+
},
|
|
502
|
+
"requiredToPublish": {
|
|
503
|
+
"type": "boolean",
|
|
504
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
505
|
+
},
|
|
506
|
+
"migration": {
|
|
507
|
+
"$ref": "#/$defs/FieldMigration"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"title": "ImageField",
|
|
513
|
+
"type": "object",
|
|
514
|
+
"description": "An image Asset of the same site, by id (asset_…).",
|
|
515
|
+
"additionalProperties": false,
|
|
516
|
+
"required": ["key", "type", "labels", "localized"],
|
|
517
|
+
"properties": {
|
|
518
|
+
"key": {
|
|
519
|
+
"$ref": "#/$defs/FieldKey"
|
|
520
|
+
},
|
|
521
|
+
"type": {
|
|
522
|
+
"type": "string",
|
|
523
|
+
"enum": ["image"]
|
|
524
|
+
},
|
|
525
|
+
"labels": {
|
|
526
|
+
"$ref": "#/$defs/FieldLabels"
|
|
527
|
+
},
|
|
528
|
+
"localized": {
|
|
529
|
+
"type": "boolean",
|
|
530
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
531
|
+
},
|
|
532
|
+
"requiredToPublish": {
|
|
533
|
+
"type": "boolean",
|
|
534
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
535
|
+
},
|
|
536
|
+
"migration": {
|
|
537
|
+
"$ref": "#/$defs/FieldMigration"
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"title": "SelectField",
|
|
543
|
+
"type": "object",
|
|
544
|
+
"description": "One of a closed list of options, or several when multiple.",
|
|
545
|
+
"additionalProperties": false,
|
|
546
|
+
"required": ["key", "type", "labels", "localized", "options"],
|
|
547
|
+
"properties": {
|
|
548
|
+
"key": {
|
|
549
|
+
"$ref": "#/$defs/FieldKey"
|
|
550
|
+
},
|
|
551
|
+
"type": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"enum": ["select"]
|
|
554
|
+
},
|
|
555
|
+
"labels": {
|
|
556
|
+
"$ref": "#/$defs/FieldLabels"
|
|
557
|
+
},
|
|
558
|
+
"localized": {
|
|
559
|
+
"type": "boolean",
|
|
560
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
561
|
+
},
|
|
562
|
+
"requiredToPublish": {
|
|
563
|
+
"type": "boolean",
|
|
564
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
565
|
+
},
|
|
566
|
+
"migration": {
|
|
567
|
+
"$ref": "#/$defs/FieldMigration"
|
|
568
|
+
},
|
|
569
|
+
"options": {
|
|
570
|
+
"type": "array",
|
|
571
|
+
"minItems": 1,
|
|
572
|
+
"maxItems": 50,
|
|
573
|
+
"items": {
|
|
574
|
+
"$ref": "#/$defs/FieldOption"
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"multiple": {
|
|
578
|
+
"type": "boolean",
|
|
579
|
+
"description": "The value is a list of option values. Absent: false."
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
"FieldKey": {
|
|
586
|
+
"type": "string",
|
|
587
|
+
"description": "The field's key in ContentEntry.fields: lower camelCase, a JavaScript identifier. Unique in its collection; built-in entry property names are reserved (checked in code).",
|
|
588
|
+
"pattern": "^[a-z][A-Za-z0-9]{0,39}$"
|
|
589
|
+
},
|
|
590
|
+
"FieldLabels": {
|
|
591
|
+
"type": "object",
|
|
592
|
+
"description": "The field's label and help per locale. Missing a locale: the default locale's, then the key.",
|
|
593
|
+
"propertyNames": {
|
|
594
|
+
"$ref": "common.schema.json#/$defs/Locale"
|
|
595
|
+
},
|
|
596
|
+
"minProperties": 1,
|
|
597
|
+
"additionalProperties": {
|
|
598
|
+
"$ref": "#/$defs/FieldLabel"
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
"FieldLabel": {
|
|
602
|
+
"type": "object",
|
|
603
|
+
"additionalProperties": false,
|
|
604
|
+
"required": ["label"],
|
|
605
|
+
"properties": {
|
|
606
|
+
"label": {
|
|
607
|
+
"type": "string",
|
|
608
|
+
"minLength": 1,
|
|
609
|
+
"maxLength": 100
|
|
610
|
+
},
|
|
611
|
+
"help": {
|
|
612
|
+
"type": "string",
|
|
613
|
+
"maxLength": 300
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
"FieldOption": {
|
|
618
|
+
"type": "object",
|
|
619
|
+
"description": "One option of a select field. Values are unique in the field (checked in code).",
|
|
620
|
+
"additionalProperties": false,
|
|
621
|
+
"required": ["value", "labels"],
|
|
622
|
+
"properties": {
|
|
623
|
+
"value": {
|
|
624
|
+
"$ref": "common.schema.json#/$defs/Slug",
|
|
625
|
+
"description": "Stored in entries, never shown."
|
|
626
|
+
},
|
|
627
|
+
"labels": {
|
|
628
|
+
"type": "object",
|
|
629
|
+
"propertyNames": {
|
|
630
|
+
"$ref": "common.schema.json#/$defs/Locale"
|
|
631
|
+
},
|
|
632
|
+
"minProperties": 1,
|
|
633
|
+
"additionalProperties": {
|
|
634
|
+
"type": "string",
|
|
635
|
+
"minLength": 1,
|
|
636
|
+
"maxLength": 100
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
"FieldMigration": {
|
|
642
|
+
"type": "object",
|
|
643
|
+
"description": "RFC-0041 §6: present only while a field operation rewrites entries.",
|
|
644
|
+
"additionalProperties": false,
|
|
645
|
+
"required": ["id"],
|
|
646
|
+
"properties": {
|
|
647
|
+
"id": {
|
|
648
|
+
"$ref": "common.schema.json#/$defs/Id",
|
|
649
|
+
"description": "The operation's \"before\" snapshot."
|
|
650
|
+
},
|
|
651
|
+
"fromKey": {
|
|
652
|
+
"$ref": "#/$defs/FieldKey"
|
|
653
|
+
},
|
|
654
|
+
"fromType": {
|
|
655
|
+
"type": "string",
|
|
656
|
+
"enum": [
|
|
657
|
+
"text",
|
|
658
|
+
"richText",
|
|
659
|
+
"number",
|
|
660
|
+
"boolean",
|
|
661
|
+
"date",
|
|
662
|
+
"datetime",
|
|
663
|
+
"url",
|
|
664
|
+
"image",
|
|
665
|
+
"select"
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
"fromLocalized": {
|
|
669
|
+
"type": "boolean"
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
},
|
|
120
673
|
"Brand": {
|
|
121
674
|
"type": "object",
|
|
122
675
|
"description": "The site's logo and social links (RFC-0025 \u00a71), shared by the header, the footer and SEO.",
|