@cloudhal/core-contracts 0.3.3 → 0.3.5

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.
@@ -1,371 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cloudhal.dev/schemas/v1/menu.schema.json",
4
- "title": "Menu",
5
- "description": "A named navigation menu of a site (e.g. 'primary', 'footer', 'sidebar'): an ordered tree of items. Items point at pages, entries and terms by id, so renames and slug changes never break them; an item whose target is gone, retired or unpublished is hidden by the renderer, never rendered as a dead link (RFC-0003).",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": [
9
- "schemaVersion",
10
- "id",
11
- "siteId",
12
- "key",
13
- "maxDepth",
14
- "items",
15
- "rev",
16
- "createdAt",
17
- "updatedAt"
18
- ],
19
- "properties": {
20
- "schemaVersion": {
21
- "$ref": "#/$defs/SchemaVersion"
22
- },
23
- "id": {
24
- "$ref": "#/$defs/Id"
25
- },
26
- "siteId": {
27
- "$ref": "#/$defs/Id"
28
- },
29
- "key": {
30
- "$ref": "#/$defs/Slug",
31
- "description": "Where themes place the menu ('primary', 'footer', 'sidebar', …). Unique per site and immutable once created."
32
- },
33
- "maxDepth": {
34
- "type": "integer",
35
- "description": "Deepest level an item may sit at; top-level items are level 1. The store refuses deeper trees.",
36
- "minimum": 1,
37
- "maximum": 6
38
- },
39
- "items": {
40
- "type": "array",
41
- "description": "Top-level items in display order. Empty means the site deliberately shows no items here (a missing menu means the theme's derived default).",
42
- "items": {
43
- "$ref": "#/$defs/MenuItem"
44
- },
45
- "maxItems": 100
46
- },
47
- "rev": {
48
- "$ref": "#/$defs/Revision"
49
- },
50
- "createdAt": {
51
- "$ref": "#/$defs/Timestamp"
52
- },
53
- "updatedAt": {
54
- "$ref": "#/$defs/Timestamp"
55
- },
56
- "metadata": {
57
- "$ref": "#/$defs/Metadata"
58
- }
59
- },
60
- "$defs": {
61
- "Id": {
62
- "type": "string",
63
- "description": "Prefixed, URL-safe identifier, e.g. site_01HZX8K3Q9. The prefix names the entity kind; agents and the MCP server pass these as opaque handles.",
64
- "pattern": "^[a-z]+_[A-Za-z0-9]{6,32}$",
65
- "minLength": 8,
66
- "maxLength": 48
67
- },
68
- "Locale": {
69
- "type": "string",
70
- "description": "BCP 47 language tag, e.g. en, tr, en-US.",
71
- "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"
72
- },
73
- "MenuDisplay": {
74
- "type": "string",
75
- "description": "RFC-0025 25d (RFC-0003 amendment): how a top-level item with children opens in the header. `mega`: one wide panel, its children as columns (a group's children are the column's links).",
76
- "enum": [
77
- "mega"
78
- ]
79
- },
80
- "MenuItem": {
81
- "description": "One item, discriminated by `kind` (what it links to). Children, in display order, form the tree; an item has exactly one parent by construction, so the tree has no cycles.",
82
- "oneOf": [
83
- {
84
- "type": "object",
85
- "title": "PageMenuItem",
86
- "description": "Links to a page by id; the label falls back to the page title.",
87
- "additionalProperties": false,
88
- "required": [
89
- "id",
90
- "kind",
91
- "pageId"
92
- ],
93
- "properties": {
94
- "id": {
95
- "$ref": "#/$defs/Id"
96
- },
97
- "kind": {
98
- "type": "string",
99
- "enum": [
100
- "page"
101
- ]
102
- },
103
- "pageId": {
104
- "$ref": "#/$defs/Id"
105
- },
106
- "labels": {
107
- "$ref": "#/$defs/MenuLabels"
108
- },
109
- "display": {
110
- "$ref": "#/$defs/MenuDisplay"
111
- },
112
- "children": {
113
- "type": "array",
114
- "items": {
115
- "$ref": "#/$defs/MenuItem"
116
- },
117
- "minItems": 1,
118
- "maxItems": 100
119
- }
120
- }
121
- },
122
- {
123
- "type": "object",
124
- "title": "EntryMenuItem",
125
- "description": "Links to a content entry by id (at /<collection>/<slug>); the label falls back to the entry title.",
126
- "additionalProperties": false,
127
- "required": [
128
- "id",
129
- "kind",
130
- "entryId"
131
- ],
132
- "properties": {
133
- "id": {
134
- "$ref": "#/$defs/Id"
135
- },
136
- "kind": {
137
- "type": "string",
138
- "enum": [
139
- "contentEntry"
140
- ]
141
- },
142
- "entryId": {
143
- "$ref": "#/$defs/Id"
144
- },
145
- "labels": {
146
- "$ref": "#/$defs/MenuLabels"
147
- },
148
- "display": {
149
- "$ref": "#/$defs/MenuDisplay"
150
- },
151
- "children": {
152
- "type": "array",
153
- "items": {
154
- "$ref": "#/$defs/MenuItem"
155
- },
156
- "minItems": 1,
157
- "maxItems": 100
158
- }
159
- }
160
- },
161
- {
162
- "type": "object",
163
- "title": "TermMenuItem",
164
- "description": "Links to a term's archive by term id; the label falls back to the term name in the locale.",
165
- "additionalProperties": false,
166
- "required": [
167
- "id",
168
- "kind",
169
- "termId"
170
- ],
171
- "properties": {
172
- "id": {
173
- "$ref": "#/$defs/Id"
174
- },
175
- "kind": {
176
- "type": "string",
177
- "enum": [
178
- "term"
179
- ]
180
- },
181
- "termId": {
182
- "$ref": "#/$defs/Id"
183
- },
184
- "labels": {
185
- "$ref": "#/$defs/MenuLabels"
186
- },
187
- "display": {
188
- "$ref": "#/$defs/MenuDisplay"
189
- },
190
- "children": {
191
- "type": "array",
192
- "items": {
193
- "$ref": "#/$defs/MenuItem"
194
- },
195
- "minItems": 1,
196
- "maxItems": 100
197
- }
198
- }
199
- },
200
- {
201
- "type": "object",
202
- "title": "CollectionMenuItem",
203
- "description": "Links to the index of a content collection, wherever the theme serves it. Collections have no node and no title, so labels are required.",
204
- "additionalProperties": false,
205
- "required": [
206
- "id",
207
- "kind",
208
- "collection",
209
- "labels"
210
- ],
211
- "properties": {
212
- "id": {
213
- "$ref": "#/$defs/Id"
214
- },
215
- "kind": {
216
- "type": "string",
217
- "enum": [
218
- "collection"
219
- ]
220
- },
221
- "collection": {
222
- "$ref": "#/$defs/Slug"
223
- },
224
- "labels": {
225
- "$ref": "#/$defs/MenuLabels"
226
- },
227
- "display": {
228
- "$ref": "#/$defs/MenuDisplay"
229
- },
230
- "children": {
231
- "type": "array",
232
- "items": {
233
- "$ref": "#/$defs/MenuItem"
234
- },
235
- "minItems": 1,
236
- "maxItems": 100
237
- }
238
- }
239
- },
240
- {
241
- "type": "object",
242
- "title": "UrlMenuItem",
243
- "description": "Links to an external https URL. The host is ASCII (internationalised names in punycode) and carries no user-info, so a label cannot hide where the link goes.",
244
- "additionalProperties": false,
245
- "required": [
246
- "id",
247
- "kind",
248
- "href",
249
- "labels"
250
- ],
251
- "properties": {
252
- "id": {
253
- "$ref": "#/$defs/Id"
254
- },
255
- "kind": {
256
- "type": "string",
257
- "enum": [
258
- "url"
259
- ]
260
- },
261
- "href": {
262
- "type": "string",
263
- "pattern": "^https://[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?(?::[0-9]{1,5})?(?:[/?#][^\\s\\\\\\x00-\\x1F\\x7F]*)?$",
264
- "maxLength": 2048
265
- },
266
- "newTab": {
267
- "type": "boolean",
268
- "description": "Open in a new tab (rendered with rel=\"noopener noreferrer\")."
269
- },
270
- "labels": {
271
- "$ref": "#/$defs/MenuLabels"
272
- },
273
- "display": {
274
- "$ref": "#/$defs/MenuDisplay"
275
- },
276
- "children": {
277
- "type": "array",
278
- "items": {
279
- "$ref": "#/$defs/MenuItem"
280
- },
281
- "minItems": 1,
282
- "maxItems": 100
283
- }
284
- }
285
- },
286
- {
287
- "type": "object",
288
- "title": "GroupMenuItem",
289
- "description": "A label without a link that holds other items: a dropdown parent or a sidebar section heading. Hidden when none of its children is shown.",
290
- "additionalProperties": false,
291
- "required": [
292
- "id",
293
- "kind",
294
- "labels",
295
- "children"
296
- ],
297
- "properties": {
298
- "id": {
299
- "$ref": "#/$defs/Id"
300
- },
301
- "kind": {
302
- "type": "string",
303
- "enum": [
304
- "group"
305
- ]
306
- },
307
- "labels": {
308
- "$ref": "#/$defs/MenuLabels"
309
- },
310
- "display": {
311
- "$ref": "#/$defs/MenuDisplay"
312
- },
313
- "children": {
314
- "type": "array",
315
- "items": {
316
- "$ref": "#/$defs/MenuItem"
317
- },
318
- "minItems": 1,
319
- "maxItems": 100
320
- }
321
- }
322
- }
323
- ]
324
- },
325
- "MenuLabels": {
326
- "type": "object",
327
- "description": "Item label per locale; plain text, no control characters or surrounding whitespace. A locale without a label falls back to the default locale's label, then to the target's own title or name.",
328
- "propertyNames": {
329
- "$ref": "#/$defs/Locale"
330
- },
331
- "minProperties": 1,
332
- "additionalProperties": {
333
- "type": "string",
334
- "minLength": 1,
335
- "maxLength": 100,
336
- "pattern": "^[^\\s\\x00-\\x1F\\x7F](?:[^\\x00-\\x1F\\x7F]*[^\\s\\x00-\\x1F\\x7F])?$"
337
- }
338
- },
339
- "Metadata": {
340
- "type": "object",
341
- "description": "Free-form string-to-string map for extensions. Keys should be namespaced (e.g. cloudhal.source).",
342
- "additionalProperties": {
343
- "type": "string"
344
- }
345
- },
346
- "Revision": {
347
- "type": "integer",
348
- "description": "Monotonic per-node revision used for optimistic locking (compare-and-swap on write).",
349
- "minimum": 0
350
- },
351
- "SchemaVersion": {
352
- "type": "integer",
353
- "description": "Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.",
354
- "enum": [
355
- 1
356
- ]
357
- },
358
- "Slug": {
359
- "type": "string",
360
- "description": "Lower-case URL segment.",
361
- "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
362
- "minLength": 1,
363
- "maxLength": 128
364
- },
365
- "Timestamp": {
366
- "type": "string",
367
- "description": "RFC 3339 / ISO 8601 instant in UTC.",
368
- "format": "date-time"
369
- }
370
- }
371
- }