@squiz/dx-json-schema-lib 1.16.0 → 1.21.1-alpha.10
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/.npm/_logs/{2023-02-27T22_59_15_807Z-debug-0.log → 2023-03-09T00_01_12_827Z-debug-0.log} +14 -14
- package/lib/JsonValidationService.js +8 -0
- package/lib/JsonValidationService.js.map +1 -1
- package/lib/JsonValidationService.spec.js +44 -0
- package/lib/JsonValidationService.spec.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/manifest/v1/DxContentMetaSchema.json +116 -1
- package/lib/manifest/v1/MatrixAssetSchema.json +370 -0
- package/lib/manifest/v1/__test__/schemas/inputStringWithFormat.json +29 -0
- package/lib/manifest/v1/subSchemas.d.ts +2 -1
- package/lib/manifest/v1/subSchemas.js +3 -1
- package/lib/manifest/v1/subSchemas.js.map +1 -1
- package/lib/manifest/v1/v1.d.ts +400 -2
- package/lib/manifest/v1/v1.json +48 -0
- package/lib/validators/customFormatValidators.d.ts +2 -0
- package/lib/validators/customFormatValidators.js +14 -0
- package/lib/validators/customFormatValidators.js.map +1 -0
- package/lib/validators/utils/matrixAssetValidator.d.ts +2 -0
- package/lib/validators/utils/matrixAssetValidator.js +11 -0
- package/lib/validators/utils/matrixAssetValidator.js.map +1 -0
- package/lib/validators/utils/matrixAssetValidator.spec.d.ts +1 -0
- package/lib/validators/utils/matrixAssetValidator.spec.js +43 -0
- package/lib/validators/utils/matrixAssetValidator.spec.js.map +1 -0
- package/package.json +2 -2
- package/src/JsonValidationService.spec.ts +62 -0
- package/src/JsonValidationService.ts +9 -1
- package/src/index.ts +2 -0
- package/src/manifest/v1/DxContentMetaSchema.json +116 -1
- package/src/manifest/v1/MatrixAssetSchema.json +371 -0
- package/src/manifest/v1/__test__/schemas/inputStringWithFormat.json +29 -0
- package/src/manifest/v1/subSchemas.ts +2 -1
- package/src/manifest/v1/v1.json +48 -0
- package/src/manifest/v1/v1.ts +640 -2
- package/src/validators/customFormatValidators.ts +15 -0
- package/src/validators/utils/matrixAssetValidator.spec.ts +49 -0
- package/src/validators/utils/matrixAssetValidator.ts +8 -0
- package/tsconfig.tsbuildinfo +1 -1
@@ -4,6 +4,7 @@ import { SchemaValidationError } from './errors/SchemaValidationError';
|
|
4
4
|
import validManifest from './manifest/v1/__test__/schemas/validComponent.json';
|
5
5
|
import validManifestJson from './manifest/v1/__test__/schemas/validComponentJson.json';
|
6
6
|
import { FormattedText } from './formatted-text/v1/formattedText';
|
7
|
+
import inputStringWithFormat from './manifest/v1/__test__/schemas/inputStringWithFormat.json';
|
7
8
|
import { JSONSchema } from 'json-schema-library';
|
8
9
|
import { PrimitiveType, ResolvableType, TypeResolver } from './jsonTypeResolution/arbitraryTypeResolution';
|
9
10
|
|
@@ -59,6 +60,11 @@ describe('JsonValidationService', () => {
|
|
59
60
|
'failed validation: Invalid manifest version',
|
60
61
|
);
|
61
62
|
});
|
63
|
+
|
64
|
+
it('should return true for a valid manifest with a string format MatrixAssetUri', () => {
|
65
|
+
const result = jsonValidationService.validateManifest(inputStringWithFormat, 'v1');
|
66
|
+
expect(result).toBe(true);
|
67
|
+
});
|
62
68
|
});
|
63
69
|
|
64
70
|
describe('validateContentSchema', () => {
|
@@ -141,6 +147,62 @@ describe('JsonValidationService', () => {
|
|
141
147
|
});
|
142
148
|
|
143
149
|
describe('validateComponentInput', () => {
|
150
|
+
describe('matrix-asset-uri input', () => {
|
151
|
+
const functionInputSchema = {
|
152
|
+
type: 'object',
|
153
|
+
|
154
|
+
properties: {
|
155
|
+
'matrix-asset': { type: 'string', format: 'matrix-asset-uri', matrixAssetTypes: ['image'] },
|
156
|
+
},
|
157
|
+
|
158
|
+
required: ['matrix-asset'],
|
159
|
+
};
|
160
|
+
it('should return true for valid a string with matrix-asset-uri format', () => {
|
161
|
+
const validMatrixAssetUri = 'matrix-asset://canary.uat.matrix.squiz.cloud/abc123';
|
162
|
+
expect(
|
163
|
+
jsonValidationService.validateComponentInput(functionInputSchema, {
|
164
|
+
'matrix-asset': validMatrixAssetUri,
|
165
|
+
}),
|
166
|
+
).toEqual(true);
|
167
|
+
});
|
168
|
+
it('should throw error for invalid matrix-asset-uri format', () => {
|
169
|
+
const invalidMatrixAssetUri = 'not-valid://canary.uat.matrix.squiz.cloud//abc123';
|
170
|
+
expectToThrowErrorMatchingTypeAndMessage(
|
171
|
+
() => {
|
172
|
+
jsonValidationService.validateComponentInput(functionInputSchema, {
|
173
|
+
'matrix-asset': invalidMatrixAssetUri,
|
174
|
+
});
|
175
|
+
},
|
176
|
+
SchemaValidationError,
|
177
|
+
`failed validation: value "not-valid://canary.uat.matrix.squiz.cloud//abc123" isn't a valid matrix asset uri`,
|
178
|
+
);
|
179
|
+
});
|
180
|
+
it('should throw error for invalid matrix-asset-uri type number', () => {
|
181
|
+
const invalidMatrixAssetUri = 1234;
|
182
|
+
expectToThrowErrorMatchingTypeAndMessage(
|
183
|
+
() => {
|
184
|
+
jsonValidationService.validateComponentInput(functionInputSchema, {
|
185
|
+
'matrix-asset': invalidMatrixAssetUri,
|
186
|
+
});
|
187
|
+
},
|
188
|
+
SchemaValidationError,
|
189
|
+
'failed validation: Expected `1234` (number) in `#/matrix-asset` to be of type `string`',
|
190
|
+
);
|
191
|
+
});
|
192
|
+
it('should throw error for invalid matrix-asset-uri which does not contain correct number of parts', () => {
|
193
|
+
const invalidMatrixAssetUri = 'matrix://';
|
194
|
+
expectToThrowErrorMatchingTypeAndMessage(
|
195
|
+
() => {
|
196
|
+
jsonValidationService.validateComponentInput(functionInputSchema, {
|
197
|
+
'matrix-asset': invalidMatrixAssetUri,
|
198
|
+
});
|
199
|
+
},
|
200
|
+
SchemaValidationError,
|
201
|
+
`failed validation: value "matrix://" isn't a valid matrix asset uri`,
|
202
|
+
);
|
203
|
+
});
|
204
|
+
});
|
205
|
+
|
144
206
|
describe('FormattedText input', () => {
|
145
207
|
it('should handle type as an array', () => {
|
146
208
|
const functionInputSchema = {
|
@@ -3,6 +3,8 @@ import JSONQuery, { Input } from '@sagold/json-query';
|
|
3
3
|
import DxComponentInputSchema from './manifest/v1/DxComponentInputSchema.json';
|
4
4
|
import DxComponentIcons from './manifest/v1/DxComponentIcons.json';
|
5
5
|
import DxContentMetaSchema from './manifest/v1/DxContentMetaSchema.json';
|
6
|
+
import MatrixAssetSchema from './manifest/v1/MatrixAssetSchema.json';
|
7
|
+
|
6
8
|
import Draft07Schema from './manifest/v1/Draft-07.json';
|
7
9
|
|
8
10
|
import FormattedText from './formatted-text/v1/formattedText.json';
|
@@ -13,14 +15,18 @@ import { Draft07, JSONError, JSONSchema, Draft, DraftConfig, isJSONError } from
|
|
13
15
|
|
14
16
|
import { draft07Config } from 'json-schema-library';
|
15
17
|
import { MANIFEST_MODELS } from '.';
|
18
|
+
import { customFormatValidators } from './validators/customFormatValidators';
|
16
19
|
import { AnyPrimitiveType, AnyResolvableType, TypeResolver } from './jsonTypeResolution/arbitraryTypeResolution';
|
17
20
|
import { JsonResolutionError } from './errors/JsonResolutionError';
|
18
21
|
|
19
22
|
const defaultConfig: DraftConfig = {
|
20
23
|
...draft07Config,
|
24
|
+
validateFormat: {
|
25
|
+
...draft07Config.validateFormat,
|
26
|
+
...customFormatValidators,
|
27
|
+
},
|
21
28
|
errors: {
|
22
29
|
...draft07Config.errors,
|
23
|
-
|
24
30
|
enumError(data) {
|
25
31
|
let values = '[]';
|
26
32
|
|
@@ -119,6 +125,7 @@ const v1Schema = new Draft07(v1, defaultConfig);
|
|
119
125
|
v1Schema.addRemoteSchema('DxComponentInputSchema.json/DxContentMetaSchema.json', DxContentMetaSchema);
|
120
126
|
v1Schema.addRemoteSchema('/DxComponentInputSchema.json', ComponentInputSchema.getSchema());
|
121
127
|
v1Schema.addRemoteSchema('/DxComponentIcons.json', DxComponentIcons);
|
128
|
+
v1Schema.addRemoteSchema('/MatrixAssetSchema.json', MatrixAssetSchema);
|
122
129
|
v1Schema.addRemoteSchema('http://json-schema.org/draft-07/schema', Draft07Schema);
|
123
130
|
v1Schema.addRemoteSchema('http://json-schema.org/draft-07/schema#', Draft07Schema);
|
124
131
|
|
@@ -139,6 +146,7 @@ export const ManifestV1MetaSchema: MetaSchemaInput = {
|
|
139
146
|
'DxComponentInputSchema.json/DxContentMetaSchema.json': DxContentMetaSchema,
|
140
147
|
'/DxComponentInputSchema.json': DxComponentInputSchema,
|
141
148
|
'/DxComponentIcons.json': DxComponentIcons,
|
149
|
+
'/MatrixAssetSchema.json': MatrixAssetSchema,
|
142
150
|
'http://json-schema.org/draft-07/schema': Draft07Schema,
|
143
151
|
'http://json-schema.org/draft-07/schema#': Draft07Schema,
|
144
152
|
},
|
package/src/index.ts
CHANGED
@@ -140,7 +140,34 @@
|
|
140
140
|
}
|
141
141
|
]
|
142
142
|
},
|
143
|
-
"format": {
|
143
|
+
"format": {
|
144
|
+
"type": "string",
|
145
|
+
"enum": [
|
146
|
+
"date-time",
|
147
|
+
"email",
|
148
|
+
"hostname",
|
149
|
+
"ipv4",
|
150
|
+
"ipv6",
|
151
|
+
"json-pointer",
|
152
|
+
"matrix-asset-uri",
|
153
|
+
"multi-line",
|
154
|
+
"password",
|
155
|
+
"phone",
|
156
|
+
"regex",
|
157
|
+
"relative-json-pointer",
|
158
|
+
"uri-reference",
|
159
|
+
"uri-template",
|
160
|
+
"uri",
|
161
|
+
"uuid"
|
162
|
+
]
|
163
|
+
},
|
164
|
+
"matrixAssetTypes": {
|
165
|
+
"type": "array",
|
166
|
+
"items": {
|
167
|
+
"type": "string",
|
168
|
+
"$ref": "#/matrixAssetEnum"
|
169
|
+
}
|
170
|
+
},
|
144
171
|
"contentMediaType": { "type": "string" },
|
145
172
|
"contentEncoding": { "type": "string" },
|
146
173
|
"if": { "$ref": "#" },
|
@@ -161,5 +188,93 @@
|
|
161
188
|
},
|
162
189
|
"required": ["required"]
|
163
190
|
}
|
191
|
+
},
|
192
|
+
"matrixAssetEnum": {
|
193
|
+
"enum": [
|
194
|
+
"audioFile",
|
195
|
+
"bodycopyContainer",
|
196
|
+
"bodycopyDiv",
|
197
|
+
"calendarEventsSearchPage",
|
198
|
+
"contentContainerTemplate",
|
199
|
+
"contentTypeMarkdown",
|
200
|
+
"contentTypeNestContent",
|
201
|
+
"contentTypeRawHtml",
|
202
|
+
"contentTypeSnippet",
|
203
|
+
"contentTypeWysiwyg",
|
204
|
+
"cssFileFolder",
|
205
|
+
"cssFile",
|
206
|
+
"customForm",
|
207
|
+
"dataRecord",
|
208
|
+
"designAreaAssetLineage",
|
209
|
+
"designAreaBody",
|
210
|
+
"designAreaMenuNormal",
|
211
|
+
"designAreaNestContent",
|
212
|
+
"designCssCustomisation",
|
213
|
+
"designCss",
|
214
|
+
"designCustomisation",
|
215
|
+
"designScss",
|
216
|
+
"design",
|
217
|
+
"docx",
|
218
|
+
"excelDoc",
|
219
|
+
"file",
|
220
|
+
"folder",
|
221
|
+
"gitBridge",
|
222
|
+
"googleAnalyticsConnector",
|
223
|
+
"googleAnalyticsView",
|
224
|
+
"image",
|
225
|
+
"jsFileFolder",
|
226
|
+
"jsFile",
|
227
|
+
"jsonWebToken",
|
228
|
+
"layoutManager",
|
229
|
+
"layout",
|
230
|
+
"link",
|
231
|
+
"metadataFieldDate",
|
232
|
+
"metadataFieldRelatedAsset",
|
233
|
+
"metadataFieldSelect",
|
234
|
+
"metadataFieldText",
|
235
|
+
"metadataFieldWysiwyg",
|
236
|
+
"metadataSchema",
|
237
|
+
"metadataSection",
|
238
|
+
"newsItem",
|
239
|
+
"oauthAccountManager",
|
240
|
+
"pageAccountManager",
|
241
|
+
"pageAssetListing",
|
242
|
+
"pageCalendarEventsSearch",
|
243
|
+
"pageCalendar",
|
244
|
+
"pagePasswordReset",
|
245
|
+
"pageRemoteContent",
|
246
|
+
"pageRestResourceJs",
|
247
|
+
"pageRestResourceOauthSession",
|
248
|
+
"pageRestResourceOauthTwoLegged",
|
249
|
+
"pageRestResource",
|
250
|
+
"pageSiteMap",
|
251
|
+
"pageStandard",
|
252
|
+
"paintLayoutBodycopy",
|
253
|
+
"paintLayoutPage",
|
254
|
+
"pdfFile",
|
255
|
+
"pdf",
|
256
|
+
"persona",
|
257
|
+
"powerpointDoc",
|
258
|
+
"pptx",
|
259
|
+
"redirectPage",
|
260
|
+
"regex",
|
261
|
+
"regularExpression",
|
262
|
+
"rtfFile",
|
263
|
+
"samlAccountManager",
|
264
|
+
"saml2Acs",
|
265
|
+
"saml2Sls",
|
266
|
+
"searchPage",
|
267
|
+
"site",
|
268
|
+
"textFile",
|
269
|
+
"TriggerTypes?",
|
270
|
+
"userGroup",
|
271
|
+
"wordDoc",
|
272
|
+
"workflowSchema",
|
273
|
+
"workflowStepCondition",
|
274
|
+
"workflowStep",
|
275
|
+
"workflowStream",
|
276
|
+
"xlsx",
|
277
|
+
"xmlFile"
|
278
|
+
]
|
164
279
|
}
|
165
280
|
}
|
@@ -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
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "../../v1.json",
|
3
|
+
"description": "t",
|
4
|
+
"displayName": "t",
|
5
|
+
"name": "test",
|
6
|
+
"namespace": "other",
|
7
|
+
"mainFunction": "main",
|
8
|
+
"version": "1.0.4",
|
9
|
+
"environment": [],
|
10
|
+
"functions": [
|
11
|
+
{
|
12
|
+
"entry": "main.js",
|
13
|
+
"name": "main",
|
14
|
+
"output": {
|
15
|
+
"responseType": "html"
|
16
|
+
},
|
17
|
+
"input": {
|
18
|
+
"type": "object",
|
19
|
+
"properties": {
|
20
|
+
"prop": {
|
21
|
+
"type": "string",
|
22
|
+
"format": "matrix-asset-uri"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"required": []
|
26
|
+
}
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -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 };
|