@squiz/dx-json-schema-lib 1.21.1-alpha.5 → 1.21.1-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,371 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "MatrixAssetSchema.json",
4
+ "title": "Matrix asset schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "description": "The asset ID."
10
+ },
11
+ "type": {
12
+ "type": "string",
13
+ "description": "The asset type code."
14
+ },
15
+ "type_name": {
16
+ "type": "string",
17
+ "description": "The asset type friendly name."
18
+ },
19
+ "version": {
20
+ "type": "string",
21
+ "description": "The asset semantic version."
22
+ },
23
+ "name": {
24
+ "type": "string",
25
+ "description": "The asset standard field name."
26
+ },
27
+ "short_name": {
28
+ "type": "string",
29
+ "description": "The asset standard field short name."
30
+ },
31
+ "status": {
32
+ "type": "object",
33
+ "description": "A object representing the asset status of the asset resource.",
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "id": {
37
+ "type": "integer",
38
+ "format": "int32",
39
+ "description": "The bitwise id of the asset status",
40
+ "enum": [1, 2, 4, 8, 16, 32, 64, 128, 256]
41
+ },
42
+ "code": {
43
+ "type": "string",
44
+ "description": "The type code of the asset status",
45
+ "enum": [
46
+ "archived",
47
+ "under_construction",
48
+ "pending_approval",
49
+ "approved",
50
+ "live",
51
+ "live_approval",
52
+ "editing",
53
+ "editing_approval",
54
+ "editing_approved"
55
+ ]
56
+ },
57
+ "name": {
58
+ "type": "string",
59
+ "description": "The description of the asset status",
60
+ "enum": [
61
+ "Archived",
62
+ "Under Construction",
63
+ "Pending Approval",
64
+ "Approved To Go Live",
65
+ "Live",
66
+ "Up For Review",
67
+ "Safe Editing",
68
+ "Safe Editing Pending Approval",
69
+ "Safe Edit Approved To Go Live"
70
+ ]
71
+ }
72
+ },
73
+ "required": ["id", "code"]
74
+ },
75
+ "created": {
76
+ "type": "object",
77
+ "description": "A object representing when the asset status was created.",
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "date": {
81
+ "type": ["string", "null"],
82
+ "format": "date-time",
83
+ "description": "The creation date of the asset in ISO 8601 format."
84
+ },
85
+ "user_id": {
86
+ "type": ["string", "null"],
87
+ "description": "The asset ID of the User that created the asset."
88
+ }
89
+ },
90
+ "required": ["date", "user_id"]
91
+ },
92
+ "updated": {
93
+ "type": "object",
94
+ "description": "A object representing when the asset status was last updated.",
95
+ "additionalProperties": false,
96
+ "properties": {
97
+ "date": {
98
+ "type": ["string", "null"],
99
+ "format": "date-time",
100
+ "description": "The last updated date of the asset in ISO 8601 format."
101
+ },
102
+ "user_id": {
103
+ "type": ["string", "null"],
104
+ "description": "The asset ID of the User that last updated the asset."
105
+ }
106
+ },
107
+ "required": ["date", "user_id"]
108
+ },
109
+ "published": {
110
+ "type": "object",
111
+ "description": "A object representing when the asset status was last published.",
112
+ "additionalProperties": false,
113
+ "properties": {
114
+ "date": {
115
+ "type": ["string", "null"],
116
+ "format": "date-time",
117
+ "description": "The last published date of the asset in ISO 8601 format."
118
+ },
119
+ "user_id": {
120
+ "type": ["string", "null"],
121
+ "description": "The asset ID of the User that last published the asset."
122
+ }
123
+ },
124
+ "required": ["date", "user_id"]
125
+ },
126
+ "status_changed": {
127
+ "type": "object",
128
+ "description": "A object representing when the asset status was last changed.",
129
+ "additionalProperties": false,
130
+ "properties": {
131
+ "date": {
132
+ "type": ["string", "null"],
133
+ "format": "date-time",
134
+ "description": "The last date the state of the asset was changed in ISO 8601 format."
135
+ },
136
+ "user_id": {
137
+ "type": ["string", "null"],
138
+ "description": "The asset ID of the User that last changed the asset status."
139
+ }
140
+ },
141
+ "required": ["date", "user_id"]
142
+ },
143
+ "url": {
144
+ "type": "string",
145
+ "description": "The primary URL for the asset.",
146
+ "example": "http://mydomain.net/page"
147
+ },
148
+ "urls": {
149
+ "type": "array",
150
+ "items": {
151
+ "type": "string"
152
+ },
153
+ "description": "All URLs for the asset including the primary URL.",
154
+ "example": ["http://mydomain.net/page", "http://seconddomain.net/blog"]
155
+ },
156
+ "attributes": {
157
+ "type": "object",
158
+ "description": "List of attributes for the asset in key-value form."
159
+ },
160
+ "metadata": {
161
+ "type": "object",
162
+ "nullable": true,
163
+ "additionalProperties": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "string"
167
+ }
168
+ },
169
+ "example": {
170
+ "foo": ["bar1", "bar2"],
171
+ "bar": ["foo"]
172
+ },
173
+ "description": "List of metadata values in key-value form."
174
+ },
175
+ "contents": {
176
+ "type": "string",
177
+ "description": "The contents for the asset (excluding file assets)."
178
+ },
179
+ "thumbnail": {
180
+ "type": "object",
181
+ "nullable": true,
182
+ "properties": {
183
+ "asset_id": {
184
+ "type": "string",
185
+ "description": "The asset ID of the Image asset of the file."
186
+ },
187
+ "url": {
188
+ "type": "string",
189
+ "description": "The accessible URL of the thumbnail image file."
190
+ },
191
+ "file_name": {
192
+ "type": "string",
193
+ "description": "The file name of the thumbnail image."
194
+ },
195
+ "width": {
196
+ "type": "integer",
197
+ "description": "The image file width in pixels."
198
+ },
199
+ "height": {
200
+ "type": "integer",
201
+ "description": "The image file height in pixels."
202
+ },
203
+ "file_type": {
204
+ "type": "string",
205
+ "description": "The file type of the image file, generally its extension."
206
+ },
207
+ "file_size": {
208
+ "type": "integer",
209
+ "description": "The file size in bytes"
210
+ },
211
+ "file_size_readable": {
212
+ "type": "integer",
213
+ "description": "The file size in human readable format"
214
+ },
215
+ "title": {
216
+ "type": "string",
217
+ "description": "The friendly name of the file asset"
218
+ },
219
+ "alt": {
220
+ "type": "string",
221
+ "description": "The alt attribute of the Image asset"
222
+ }
223
+ },
224
+ "description": "The thumbnail image associated with the asset, shows a subset data of an image or image variety.",
225
+ "example": {
226
+ "asset_id": "42",
227
+ "url": "http://mydomain.net/image.png",
228
+ "file_name": "image.png",
229
+ "width": 630,
230
+ "height": 630,
231
+ "file_type": "png",
232
+ "file_size": 40336,
233
+ "file_size_readable": "39.4 KB",
234
+ "title": "Company Logo",
235
+ "alt": "A company logo image"
236
+ }
237
+ },
238
+ "include_dependents": {
239
+ "type": "array",
240
+ "items": {
241
+ "$ref": "#"
242
+ },
243
+ "description": "All direct dependent child assets of the asset in normalized asset format."
244
+ },
245
+ "additional": {
246
+ "description": "Additional data of an arbitrary nature related to the requested asset, which may include derived information or special child asset information.",
247
+ "oneOf": [
248
+ {
249
+ "$ref": "#/definitions/AssetAdditional"
250
+ },
251
+ {
252
+ "$ref": "#/definitions/AssetFileAdditional"
253
+ },
254
+ {
255
+ "$ref": "#/definitions/AssetImageAdditional"
256
+ },
257
+ {
258
+ "$ref": "#/definitions/AssetCalendarEventAdditional"
259
+ }
260
+ ]
261
+ }
262
+ },
263
+ "required": [
264
+ "id",
265
+ "type",
266
+ "type_name",
267
+ "version",
268
+ "name",
269
+ "short_name",
270
+ "status",
271
+ "created",
272
+ "updated",
273
+ "published",
274
+ "url",
275
+ "urls",
276
+ "attributes"
277
+ ],
278
+
279
+ "definitions": {
280
+ "AssetAdditional": {
281
+ "title": "Asset additional info",
282
+ "type": "object",
283
+ "properties": {}
284
+ },
285
+ "AssetFileAdditional": {
286
+ "title": "File additional info",
287
+ "type": "object",
288
+ "properties": {
289
+ "file_info": {
290
+ "type": "object",
291
+ "properties": {
292
+ "file_name": {
293
+ "type": "string"
294
+ },
295
+ "size_readable": {
296
+ "type": "string"
297
+ },
298
+ "size_bytes": {
299
+ "type": "integer"
300
+ },
301
+ "width": {
302
+ "type": "integer",
303
+ "nullable": true
304
+ },
305
+ "height": {
306
+ "type": "integer",
307
+ "nullable": true
308
+ },
309
+ "modified_readable": {
310
+ "type": "string"
311
+ },
312
+ "modified_unix": {
313
+ "type": "integer"
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "example": {
319
+ "file_info": {
320
+ "file_name": "logo.png",
321
+ "size_readable": "6.2 MB",
322
+ "size_bytes": 6553070,
323
+ "width": 1200,
324
+ "height": 600,
325
+ "modified_readable": "Feb 3, 2023 12:26 PM",
326
+ "modified_unix": 1675387561
327
+ }
328
+ }
329
+ },
330
+ "AssetImageAdditional": {
331
+ "title": "Image additional info",
332
+ "properties": {
333
+ "varieties": {
334
+ "type": "array",
335
+ "items": {
336
+ "$ref": "#"
337
+ }
338
+ }
339
+ },
340
+ "allOf": [
341
+ {
342
+ "$ref": "#/definitions/AssetFileAdditional"
343
+ }
344
+ ]
345
+ },
346
+ "AssetCalendarEventAdditional": {
347
+ "title": "Calendar Event additional info",
348
+ "type": "object",
349
+ "properties": {
350
+ "event_info": {
351
+ "type": "object",
352
+ "properties": {
353
+ "duration": {
354
+ "type": "integer"
355
+ },
356
+ "frequency": {
357
+ "type": "string",
358
+ "nullable": true
359
+ }
360
+ }
361
+ }
362
+ },
363
+ "example": {
364
+ "event_info": {
365
+ "duration": 1800,
366
+ "frequency": "FREQ=DAILY;INTERVAL=1"
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
@@ -1,5 +1,6 @@
1
1
  import DxComponentIcons from './DxComponentIcons.json';
2
2
  import DxComponentInputSchema from './DxComponentInputSchema.json';
3
3
  import DxContentMetaSchema from './DxContentMetaSchema.json';
4
+ import MatrixAssetSchema from './MatrixAssetSchema.json';
4
5
 
5
- export { DxComponentIcons, DxComponentInputSchema, DxContentMetaSchema };
6
+ export { DxComponentIcons, DxComponentInputSchema, DxContentMetaSchema, MatrixAssetSchema };
@@ -366,6 +366,54 @@
366
366
  }
367
367
  }
368
368
  }
369
+ },
370
+ "mockedUris": {
371
+ "type": "object",
372
+ "description": "Mocked uri objects used in the preview",
373
+ "propertyNames": {
374
+ "type": "string",
375
+ "pattern": "^[a-z0-9_\\-]+:\\/\\/"
376
+ },
377
+ "additionalProperties": {
378
+ "type": "object",
379
+ "description": "Property for defining the mock URI object",
380
+ "properties": {
381
+ "type": {
382
+ "description": "An enum of 'file' or 'inline' for how the uri object is defined",
383
+ "enum": ["file", "inline"]
384
+ }
385
+ },
386
+ "required": ["type"],
387
+ "oneOf": [
388
+ {
389
+ "type": "object",
390
+ "properties": {
391
+ "type": {
392
+ "enum": ["file"]
393
+ },
394
+ "path": {
395
+ "type": "string",
396
+ "format": "uri-reference",
397
+ "description": "Path to uri object"
398
+ }
399
+ },
400
+ "required": ["type", "path"]
401
+ },
402
+ {
403
+ "type": "object",
404
+ "properties": {
405
+ "type": {
406
+ "enum": ["inline"]
407
+ },
408
+ "value": {
409
+ "$ref": "MatrixAssetSchema.json",
410
+ "description": "Inline URI object"
411
+ }
412
+ },
413
+ "required": ["type", "value"]
414
+ }
415
+ ]
416
+ }
369
417
  }
370
418
  },
371
419