-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathBlockConfig.json
292 lines (292 loc) Β· 11.2 KB
/
BlockConfig.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/BlockConfig.json",
"type": "object",
"title": "BlockConfig",
"description": "BlockConfig determines the Block properties",
"required": [
"name",
"type",
"configurations"
],
"properties": {
"name": {
"$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockName"
},
"type": {
"$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockType"
},
"configurations": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"title": "Block configurations",
"description": "Block configurations",
"items": {
"type": "object",
"required": [
"version"
],
"properties": {
"version": {
"$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BasicSemVer"
},
"endpoint": {
"type": "object",
"required": [
"url",
"method",
"cachePolicy",
"parameters",
"ui"
],
"properties": {
"url": {
"type": "string",
"title": "Block http URL",
"description": "The HTTP(S) address the CMS will call to retrieve the BlockJSON",
"examples": ["http://my.domain.com/blockprovider/block"]
},
"method": {
"type": "string",
"title": "block http method",
"description": "Only GET and POST are supported right now",
"enum": ["GET", "POST"],
"examples": ["GET", "POST"]
},
"cachePolicy": {
"type": "string",
"title": "Block cache policy",
"description": "Defines the Block data cache policy : PURE (cache one hour), IMPURE (cache few minutes), IMPURE_WITHOUT_STALE (cache few minutes, and guarantees no outdated data) or NO_CACHE (at your own risk)",
"default": false,
"examples": ["PURE", "IMPURE", "IMPURE_WITHOUT_STALE", "NO_CACHE"]
},
"compliantWithLastModifiedHeader": {
"type": "boolean",
"title": "Block is compliant with lastModified header",
"description": "Indicate if the block is compliant with the LastModified Header (leading to a 304 status)",
"default": false
},
"parameters": {
"type": "array",
"title": "The parameters needed to send a valid HTTP Block call.",
"description": "Paramètres HTTP à positionner lors des appels au endpoint",
"items": {
"$ref": "http://swagger.io/v2/schema.json#/definitions/parameter"
}
},
"consumes": {
"type": "array",
"title": "A list of MIME types the API can consume.",
"description": "A list of MIME types the API can consume. Only 'application/json' is supported right now.",
"items": {
"type": "string",
"title": "MIME type",
"description": "MIME type the API can consume"
}
},
"ui": {
"$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/UISchema"
}
}
},
"rpc": {
"type": "object",
"description" : "RPC defines admin a/o rendering endpoint (please contact Ouest France for further explanations on this feature)",
"properties": {
"view": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"title": "Block RPC view HTTP url",
"description": "The HTTP(S) address the CMS will call to request the block view RPC endpoint",
"examples": ["http://my.domain.com/blockprovider/block/rpc/view"]
}
}
},
"admin": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"title": "Block RPC admin HTTP url",
"description": "The HTTP(S) address the CMS will call to request the block admin RPC endpoint",
"examples": [
"http://my.domain.com/blockprovider/block/rpc/admin"
]
},
"hooks": {
"type": "array",
"uniqueItems": true,
"minItems": 0,
"maxItems": 10,
"items": {
"type": "string",
"title": "Standard methods handled by the Block RPC endpoint",
"description": "Standard methods handled by the Block RPC endpoint",
"enum": ["$before-save","$after-save"],
"examples": ["$before-save"]
}
}
}
}
}
},
"templates": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"engine",
"source",
"targetFormat",
"position"
],
"properties": {
"name": {
"type": "string",
"title": "Template name",
"description": "Template name (so users can differentiate templates in the front client)",
"examples": [
"default",
"christmas"
]
},
"position": {
"type": "string",
"title": "Template position",
"description": "The position where the CMS will render the block in the page. (placeholder value means the block must to be render in a page placeholder)",
"enum": ["placeholder", "head-top", "head-bottom", "body-top", "body-bottom"]
},
"engine": {
"$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockTemplateEngine"
},
"targetFormat": {
"$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockTemplateTargetFormat"
},
"source": {
"type": "string",
"title": "Template source",
"description": "Inlined template content",
"examples": [
"<section>Hello {{ name }}</section>"
]
},
"assets": {
"type": "object",
"properties": {
"sharedJs": {
"type": "array",
"items": {
"title": "Shared JS assets",
"description": "JS Library or shared JS in page",
"type": "string"
}
},
"sharedCss": {
"type": "array",
"items": {
"title": "Shared css assets",
"description": "css Library or shared css in page",
"type": "string"
}
},
"js": {
"type": "array",
"items": {
"title": "Js assets",
"description": "JS URL",
"type": "string"
}
},
"css": {
"type": "array",
"items": {
"title": "Css assets",
"description": "CSS URL",
"type": "string"
}
},
"fonts": {
"type": "array",
"items": {
"title": "Fonts assets",
"description": "Font URL",
"type": "string"
}
},
"images": {
"type": "array",
"items": {
"title": "Images assets",
"description": "Image URL - this type of assets if deprecated - please do not use it",
"type": "string"
}
}
}
}
}
}
},
"external": {
"type": "object",
"required": [],
"properties": {
"data": {
"type": "array",
"items": {
"type": "string",
"title": "External parameter",
"description" : "External parameter exposed by the Block (ie. exposed to the other Blocks of the page)"
}
},
"headers": {
"type": "array",
"items": {
"type": "string",
"title": "Header",
"description": "Header to set in the HTTP Response (only managed by Site-typed Blocks)"
}
},
"head": {
"type": "array",
"items": {
"type": "object",
"title": "Head HTML tag",
"description": "HTML Tag to position in the <head> section of the page (only managed by Site-typed Blocks)",
"properties": {
"tag": {
"type": "string",
"title": "Tag",
"description": "Tag name"
},
"attributes": {
"type": "string",
"title": "Attributes",
"description": "Attributes"
}
}
}
}
}
},
"documentation": {
"type": "object",
"properties": {
"url": {
"type": "string",
"title": "Block documentation HTTP url",
"description": "The HTTP(S) address of the block documentation",
"examples": ["https://my.domain.com/documentation"]
}
}
}
}
}
}
}
}