@lowdefy/build 4.0.0-alpha.1 → 4.0.0-alpha.12

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.
Files changed (90) hide show
  1. package/dist/build/addDefaultPages/404.js +37 -42
  2. package/dist/build/addDefaultPages/addDefaultPages.js +7 -3
  3. package/dist/build/buildAuth/buildAuth.js +10 -29
  4. package/dist/build/buildAuth/buildAuthPlugins.js +78 -0
  5. package/dist/build/buildAuth/buildPageAuth.js +50 -0
  6. package/dist/build/buildAuth/getPageRoles.js +3 -4
  7. package/dist/build/buildAuth/getProtectedPages.js +6 -6
  8. package/dist/build/buildAuth/validateAuthConfig.js +61 -0
  9. package/dist/build/buildConnections.js +2 -3
  10. package/dist/build/buildImports/buildIconImports.js +87 -0
  11. package/dist/build/buildImports/buildImports.js +30 -0
  12. package/dist/build/buildImports/buildImportsDev.js +103 -0
  13. package/dist/build/buildImports/buildImportsProd.js +54 -0
  14. package/dist/build/buildImports/buildStyleImports.js +28 -0
  15. package/dist/build/buildImports/defaultIconsDev.js +584 -0
  16. package/dist/build/buildImports/defaultIconsProd.js +21 -0
  17. package/dist/build/buildMenu.js +1 -1
  18. package/dist/build/buildPages/buildBlock/buildBlock.js +6 -2
  19. package/dist/build/buildPages/buildBlock/buildEvents.js +5 -2
  20. package/dist/build/buildPages/buildBlock/buildRequests.js +2 -3
  21. package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
  22. package/dist/build/buildPages/buildBlock/countBlockOperators.js +4 -6
  23. package/dist/build/buildPages/buildBlock/countBlockTypes.js +18 -0
  24. package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +35 -0
  25. package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
  26. package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
  27. package/dist/build/buildPages/buildBlock/validateBlock.js +2 -3
  28. package/dist/build/buildPages/buildPage.js +1 -1
  29. package/dist/build/buildPages/buildPages.js +1 -1
  30. package/dist/build/buildRefs/buildRefs.js +3 -3
  31. package/dist/build/buildRefs/evaluateBuildOperators.js +35 -0
  32. package/dist/build/buildRefs/getConfigFile.js +1 -1
  33. package/dist/build/buildRefs/getRefContent.js +2 -2
  34. package/dist/build/buildRefs/getRefPath.js +1 -1
  35. package/dist/build/buildRefs/getRefsFromFile.js +1 -1
  36. package/dist/build/buildRefs/getUserJavascriptFunction.js +7 -4
  37. package/dist/build/buildRefs/makeRefDefinition.js +2 -3
  38. package/dist/build/buildRefs/parseNunjucks.js +1 -1
  39. package/dist/build/buildRefs/parseRefContent.js +3 -3
  40. package/dist/build/buildRefs/populateRefs.js +1 -1
  41. package/dist/build/buildRefs/recursiveBuild.js +10 -5
  42. package/dist/build/buildRefs/runRefResolver.js +1 -1
  43. package/dist/build/buildRefs/runTransformer.js +8 -4
  44. package/dist/build/buildTypes.js +72 -43
  45. package/dist/build/cleanBuildDirectory.js +2 -2
  46. package/dist/build/copyPublicFolder.js +23 -0
  47. package/dist/build/testSchema.js +3 -4
  48. package/dist/build/updateServerPackageJson.js +49 -0
  49. package/dist/build/validateApp.js +3 -5
  50. package/dist/build/validateConfig.js +8 -28
  51. package/dist/build/writeApp.js +2 -6
  52. package/dist/build/writeAuth.js +18 -0
  53. package/dist/build/writeConfig.js +2 -6
  54. package/dist/build/writeConnections.js +2 -5
  55. package/dist/build/writeGlobal.js +3 -7
  56. package/dist/build/writeMenus.js +2 -5
  57. package/dist/build/writePages.js +3 -14
  58. package/dist/build/writePluginImports/generateImportFile.js +31 -0
  59. package/dist/build/writePluginImports/writeActionImports.js +22 -0
  60. package/dist/build/writePluginImports/writeAuthImports.js +30 -0
  61. package/dist/build/writePluginImports/writeBlockImports.js +6 -23
  62. package/dist/build/writePluginImports/writeConnectionImports.js +6 -23
  63. package/dist/build/writePluginImports/writeIconImports.js +31 -0
  64. package/dist/build/writePluginImports/writeOperatorImports.js +26 -0
  65. package/dist/build/writePluginImports/writePluginImports.js +52 -0
  66. package/dist/build/writePluginImports/writeStyleImports.js +28 -0
  67. package/dist/build/writeRequests.js +3 -8
  68. package/dist/build/writeTypes.js +2 -5
  69. package/dist/defaultTypesMap.json +1874 -0
  70. package/dist/index.js +126 -112
  71. package/dist/lowdefySchema.js +173 -79
  72. package/dist/scripts/generateDefaultTypes.js +47 -75
  73. package/dist/scripts/run.js +14 -12
  74. package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +3 -6
  75. package/dist/test/buildRefs/testBuildRefsErrorResolver.js +2 -2
  76. package/dist/test/buildRefs/testBuildRefsNullResolver.js +2 -2
  77. package/dist/test/buildRefs/testBuildRefsParsingResolver.js +2 -2
  78. package/dist/test/buildRefs/testBuildRefsResolver.js +2 -2
  79. package/dist/test/buildRefs/testBuildRefsTransform.js +2 -2
  80. package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +2 -2
  81. package/dist/test/testContext.js +12 -19
  82. package/dist/utils/countOperators.js +1 -1
  83. package/dist/utils/createCheckDuplicateId.js +1 -1
  84. package/dist/utils/createCounter.js +1 -1
  85. package/dist/utils/createPluginTypesMap.js +106 -0
  86. package/dist/utils/formatErrorMessage.js +2 -2
  87. package/dist/utils/{files/readConfigFile.js → readConfigFile.js} +3 -3
  88. package/dist/utils/{files/writeBuildArtifact.js → writeBuildArtifact.js} +4 -7
  89. package/package.json +48 -16
  90. package/dist/defaultTypes.json +0 -60
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-console */ /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -12,24 +12,30 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import { readFile } from '@lowdefy/node-utils';
15
+ */ import { fileURLToPath } from 'url';
16
+ import { mergeObjects } from '@lowdefy/helpers';
17
+ import { readFile } from '@lowdefy/node-utils';
16
18
  import createCounter from './utils/createCounter.js';
17
- import createReadConfigFile from './utils/files/readConfigFile.js';
18
- import createWriteBuildArtifact from './utils/files/writeBuildArtifact.js';
19
+ import createPluginTypesMap from './utils/createPluginTypesMap.js';
20
+ import createReadConfigFile from './utils/readConfigFile.js';
21
+ import createWriteBuildArtifact from './utils/writeBuildArtifact.js';
19
22
  import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
20
23
  import buildAuth from './build/buildAuth/buildAuth.js';
21
24
  import buildConnections from './build/buildConnections.js';
25
+ import buildImports from './build/buildImports/buildImports.js';
22
26
  import buildMenu from './build/buildMenu.js';
23
27
  import buildPages from './build/buildPages/buildPages.js';
24
28
  import buildRefs from './build/buildRefs/buildRefs.js';
25
29
  import buildTypes from './build/buildTypes.js';
26
30
  import cleanBuildDirectory from './build/cleanBuildDirectory.js';
31
+ import copyPublicFolder from './build/copyPublicFolder.js';
27
32
  import testSchema from './build/testSchema.js';
28
33
  import validateApp from './build/validateApp.js';
29
34
  import validateConfig from './build/validateConfig.js';
35
+ import updateServerPackageJson from './build/updateServerPackageJson.js';
30
36
  import writeApp from './build/writeApp.js';
31
- import writeBlockImports from './build/writePluginImports/writeBlockImports.js';
32
- import writeConnectionImports from './build/writePluginImports/writeConnectionImports.js';
37
+ import writeAuth from './build/writeAuth.js';
38
+ import writePluginImports from './build/writePluginImports/writePluginImports.js';
33
39
  import writeConfig from './build/writeConfig.js';
34
40
  import writeConnections from './build/writeConnections.js';
35
41
  import writeGlobal from './build/writeGlobal.js';
@@ -37,17 +43,23 @@ import writeMenus from './build/writeMenus.js';
37
43
  import writePages from './build/writePages.js';
38
44
  import writeRequests from './build/writeRequests.js';
39
45
  import writeTypes from './build/writeTypes.js';
40
- async function createContext(options) {
41
- const { blocksServerUrl , buildDirectory , cacheDirectory , configDirectory , logger , refResolver } = options;
42
- const defaultTypes = JSON.parse(await readFile(new URL('./defaultTypes.json', import.meta.url).pathname));
43
- // TODO: resolve custom plugin types
46
+ async function createContext({ customTypesMap , directories , logger , refResolver , stage ='prod' }) {
47
+ const defaultTypesMap = JSON.parse(await readFile(fileURLToPath(new URL('./defaultTypesMap.json', import.meta.url))));
44
48
  const context = {
45
- blocksServerUrl,
46
- buildDirectory,
47
- cacheDirectory,
48
- configDirectory,
49
+ directories,
50
+ logger,
51
+ readConfigFile: createReadConfigFile({
52
+ directories
53
+ }),
54
+ refResolver,
55
+ stage,
49
56
  typeCounters: {
50
57
  actions: createCounter(),
58
+ auth: {
59
+ callbacks: createCounter(),
60
+ events: createCounter(),
61
+ providers: createCounter()
62
+ },
51
63
  blocks: createCounter(),
52
64
  connections: createCounter(),
53
65
  requests: createCounter(),
@@ -56,110 +68,112 @@ async function createContext(options) {
56
68
  server: createCounter()
57
69
  }
58
70
  },
59
- logger,
60
- readConfigFile: createReadConfigFile({
61
- configDirectory
62
- }),
63
- refResolver,
64
- types: defaultTypes,
71
+ typesMap: mergeObjects([
72
+ defaultTypesMap,
73
+ customTypesMap
74
+ ]),
65
75
  writeBuildArtifact: createWriteBuildArtifact({
66
- buildDirectory
76
+ directories
67
77
  })
68
78
  };
69
79
  return context;
70
80
  }
71
81
  async function build(options) {
72
82
  const context = await createContext(options);
73
- try {
74
- const components = await buildRefs({
75
- context
76
- });
77
- await testSchema({
78
- components,
79
- context
80
- });
81
- await validateApp({
82
- components,
83
- context
84
- });
85
- await validateConfig({
86
- components,
87
- context
88
- });
89
- await addDefaultPages({
90
- components,
91
- context
92
- });
93
- await buildAuth({
94
- components,
95
- context
96
- });
97
- await buildConnections({
98
- components,
99
- context
100
- });
101
- await buildPages({
102
- components,
103
- context
104
- });
105
- await buildMenu({
106
- components,
107
- context
108
- });
109
- await buildTypes({
110
- components,
111
- context
112
- });
113
- await cleanBuildDirectory({
114
- context
115
- });
116
- await writeApp({
117
- components,
118
- context
119
- });
120
- await writeConnections({
121
- components,
122
- context
123
- });
124
- await writeRequests({
125
- components,
126
- context
127
- });
128
- await writePages({
129
- components,
130
- context
131
- });
132
- await writeConfig({
133
- components,
134
- context
135
- });
136
- await writeGlobal({
137
- components,
138
- context
139
- });
140
- await writeMenus({
141
- components,
142
- context
143
- });
144
- await writeTypes({
145
- components,
146
- context
147
- });
148
- await writeBlockImports({
149
- components,
150
- context
151
- });
152
- await writeConnectionImports({
153
- components,
154
- context
155
- });
156
- // TODO: write style file
157
- // TODO: write icons file
158
- // TODO: add plugins to package.json
159
- } catch (error) {
160
- context.logger.error(error);
161
- throw error;
162
- }
83
+ const components = await buildRefs({
84
+ context
85
+ });
86
+ await testSchema({
87
+ components,
88
+ context
89
+ });
90
+ await validateApp({
91
+ components,
92
+ context
93
+ });
94
+ await validateConfig({
95
+ components,
96
+ context
97
+ });
98
+ await addDefaultPages({
99
+ components,
100
+ context
101
+ });
102
+ await buildAuth({
103
+ components,
104
+ context
105
+ });
106
+ await buildConnections({
107
+ components,
108
+ context
109
+ });
110
+ await buildPages({
111
+ components,
112
+ context
113
+ });
114
+ await buildMenu({
115
+ components,
116
+ context
117
+ });
118
+ await buildTypes({
119
+ components,
120
+ context
121
+ });
122
+ await buildImports({
123
+ components,
124
+ context
125
+ });
126
+ await cleanBuildDirectory({
127
+ context
128
+ });
129
+ await writeApp({
130
+ components,
131
+ context
132
+ });
133
+ await writeAuth({
134
+ components,
135
+ context
136
+ });
137
+ await writeConnections({
138
+ components,
139
+ context
140
+ });
141
+ await writeRequests({
142
+ components,
143
+ context
144
+ });
145
+ await writePages({
146
+ components,
147
+ context
148
+ });
149
+ await writeConfig({
150
+ components,
151
+ context
152
+ });
153
+ await writeGlobal({
154
+ components,
155
+ context
156
+ });
157
+ await writeMenus({
158
+ components,
159
+ context
160
+ });
161
+ await writeTypes({
162
+ components,
163
+ context
164
+ });
165
+ await writePluginImports({
166
+ components,
167
+ context
168
+ });
169
+ await updateServerPackageJson({
170
+ components,
171
+ context
172
+ });
173
+ await copyPublicFolder({
174
+ components,
175
+ context
176
+ });
163
177
  }
164
- export { createContext };
178
+ export { createContext, createPluginTypesMap };
165
179
  export default build;
@@ -24,12 +24,9 @@ export default {
24
24
  type: 'Action "id" should be a string.'
25
25
  }
26
26
  },
27
- messages: {
28
- },
29
- params: {
30
- },
31
- skip: {
32
- },
27
+ messages: {},
28
+ params: {},
29
+ skip: {},
33
30
  type: {
34
31
  type: 'string',
35
32
  errorMessage: {
@@ -75,36 +72,73 @@ export default {
75
72
  type: 'object',
76
73
  additionalProperties: false,
77
74
  errorMessage: {
78
- type: 'App "config.auth" should be an object.'
75
+ type: 'App "auth" should be an object.'
79
76
  },
80
77
  properties: {
81
- openId: {
82
- type: 'object',
83
- additionalProperties: false,
84
- errorMessage: {
85
- type: 'App "config.auth.openId" should be an object.'
86
- },
87
- properties: {
88
- rolesField: {
89
- type: 'string',
90
- description: '.',
91
- errorMessage: {
92
- type: 'App "config.auth.openId.rolesField" should be a string.'
78
+ callbacks: {
79
+ type: 'array',
80
+ items: {
81
+ type: 'object',
82
+ required: [
83
+ 'id',
84
+ 'type'
85
+ ],
86
+ properties: {
87
+ id: {
88
+ type: 'string',
89
+ errorMessage: {
90
+ type: 'Auth callback "id" should be a string.'
91
+ }
92
+ },
93
+ type: {
94
+ type: 'string',
95
+ errorMessage: {
96
+ type: 'Auth callback "type" should be a string.'
97
+ }
98
+ },
99
+ properties: {
100
+ type: 'object'
93
101
  }
94
102
  },
95
- logoutRedirectUri: {
96
- type: 'string',
97
- description: 'The URI to redirect the user to after logout. Can be a Nunjucks template string with client_id, host, id_token_hint, and openid_domain as template data.',
98
- errorMessage: {
99
- type: 'App "config.auth.openId.logoutRedirectUri" should be a string.'
103
+ errorMessage: {
104
+ type: 'Auth callback should be an object.',
105
+ required: {
106
+ id: 'Auth callback should have required property "id".',
107
+ type: 'Auth callback should have required property "type".'
108
+ }
109
+ }
110
+ }
111
+ },
112
+ events: {
113
+ type: 'array',
114
+ items: {
115
+ type: 'object',
116
+ required: [
117
+ 'id',
118
+ 'type'
119
+ ],
120
+ properties: {
121
+ id: {
122
+ type: 'string',
123
+ errorMessage: {
124
+ type: 'Auth event "id" should be a string.'
125
+ }
126
+ },
127
+ type: {
128
+ type: 'string',
129
+ errorMessage: {
130
+ type: 'Auth event "type" should be a string.'
131
+ }
132
+ },
133
+ properties: {
134
+ type: 'object'
100
135
  }
101
136
  },
102
- scope: {
103
- type: 'string',
104
- description: 'The OpenID Connect scope to request.',
105
- default: 'openid profile email',
106
- errorMessage: {
107
- type: 'App "config.auth.openId.scope" should be a string.'
137
+ errorMessage: {
138
+ type: 'Auth event should be an object.',
139
+ required: {
140
+ id: 'Auth event should have required property "id".',
141
+ type: 'Auth event should have required property "type".'
108
142
  }
109
143
  }
110
144
  }
@@ -122,13 +156,13 @@ export default {
122
156
  'boolean'
123
157
  ],
124
158
  errorMessage: {
125
- type: 'App "config.auth.pages.protected.$" should be an array of strings.'
159
+ type: 'App "auth.pages.protected.$" should be an array of strings.'
126
160
  },
127
161
  items: {
128
162
  type: 'string',
129
163
  description: 'Page ids for which authentication is required. When specified, all unspecified pages will be public.',
130
164
  errorMessage: {
131
- type: 'App "config.auth.pages.protected.$" should be an array of strings.'
165
+ type: 'App "auth.pages.protected.$" should be an array of strings.'
132
166
  }
133
167
  }
134
168
  },
@@ -138,13 +172,13 @@ export default {
138
172
  'boolean'
139
173
  ],
140
174
  errorMessage: {
141
- type: 'App "config.auth.pages.public.$" should be an array of strings.'
175
+ type: 'App "auth.pages.public.$" should be an array of strings.'
142
176
  },
143
177
  items: {
144
178
  type: 'string',
145
179
  description: 'Page ids for which authentication is not required. When specified, all unspecified pages will be protected.',
146
180
  errorMessage: {
147
- type: 'App "config.auth.pages.public.$" should be an array of strings.'
181
+ type: 'App "auth.pages.public.$" should be an array of strings.'
148
182
  }
149
183
  }
150
184
  },
@@ -157,46 +191,55 @@ export default {
157
191
  type: 'string'
158
192
  },
159
193
  errorMessage: {
160
- type: 'App "config.auth.pages.roles.[role]" should be an array of strings.'
194
+ type: 'App "auth.pages.roles.[role]" should be an array of strings.'
161
195
  }
162
196
  }
163
197
  },
164
198
  errorMessage: {
165
- type: 'App "config.auth.pages.roles" should be an object.'
199
+ type: 'App "auth.pages.roles" should be an object.'
166
200
  }
167
201
  }
168
202
  }
169
203
  },
170
- jwt: {
171
- type: 'object',
172
- additionalProperties: false,
173
- errorMessage: {
174
- type: 'App "config.auth.jwt" should be an object.'
175
- },
176
- properties: {
177
- expiresIn: {
178
- type: [
179
- 'string',
180
- 'number'
181
- ],
182
- default: '4h',
183
- description: 'The length of time a user token should be valid. Can be expressed as a number in seconds, or a vercel/ms string (https://github.com/vercel/ms)',
184
- errorMessage: {
185
- type: 'App "config.auth.jwt.expiresIn" should be a string or number.'
204
+ providers: {
205
+ type: 'array',
206
+ items: {
207
+ type: 'object',
208
+ required: [
209
+ 'id',
210
+ 'type'
211
+ ],
212
+ properties: {
213
+ id: {
214
+ type: 'string',
215
+ errorMessage: {
216
+ type: 'Auth provider "id" should be a string.'
217
+ }
218
+ },
219
+ type: {
220
+ type: 'string',
221
+ errorMessage: {
222
+ type: 'Auth provider "type" should be a string.'
223
+ }
224
+ },
225
+ properties: {
226
+ type: 'object'
186
227
  }
187
228
  },
188
- loginStateExpiresIn: {
189
- type: [
190
- 'string',
191
- 'number'
192
- ],
193
- default: '5min',
194
- description: 'The length of time an authorization request token should be valid. Can be expressed as a number in seconds, or a vercel/ms string (https://github.com/vercel/ms)',
195
- errorMessage: {
196
- type: 'App "config.auth.jwt.loginStateExpiresIn" should be a string or number.'
229
+ errorMessage: {
230
+ type: 'Auth provider should be an object.',
231
+ required: {
232
+ id: 'Auth provider should have required property "id".',
233
+ type: 'Auth provider should have required property "type".'
197
234
  }
198
235
  }
199
236
  }
237
+ },
238
+ session: {
239
+ type: 'object'
240
+ },
241
+ theme: {
242
+ type: 'object'
200
243
  }
201
244
  }
202
245
  },
@@ -235,10 +278,10 @@ export default {
235
278
  type: 'Block "layout" should be an object.'
236
279
  }
237
280
  },
238
- loading: {
281
+ skeleton: {
239
282
  type: 'object',
240
283
  errorMessage: {
241
- type: 'Block "loading" should be an object.'
284
+ type: 'Block "skeleton" should be an object.'
242
285
  }
243
286
  },
244
287
  style: {
@@ -247,8 +290,8 @@ export default {
247
290
  type: 'Block "style" should be an object.'
248
291
  }
249
292
  },
250
- visible: {
251
- },
293
+ visible: {},
294
+ loading: {},
252
295
  blocks: {
253
296
  type: 'array',
254
297
  items: {
@@ -267,8 +310,7 @@ export default {
267
310
  type: 'Block "requests" should be an array.'
268
311
  }
269
312
  },
270
- required: {
271
- },
313
+ required: {},
272
314
  validate: {
273
315
  type: 'array',
274
316
  items: {
@@ -541,6 +583,41 @@ export default {
541
583
  }
542
584
  }
543
585
  },
586
+ plugin: {
587
+ type: 'object',
588
+ additionalProperties: false,
589
+ required: [
590
+ 'name',
591
+ 'version'
592
+ ],
593
+ properties: {
594
+ name: {
595
+ type: 'string',
596
+ errorMessage: {
597
+ type: 'Plugin "name" should be a string.'
598
+ }
599
+ },
600
+ version: {
601
+ type: 'string',
602
+ errorMessage: {
603
+ type: 'Plugin "version" should be a string.'
604
+ }
605
+ },
606
+ typePrefix: {
607
+ type: 'string',
608
+ errorMessage: {
609
+ type: 'Plugin "typePrefix" should be a string.'
610
+ }
611
+ }
612
+ },
613
+ errorMessage: {
614
+ type: 'Plugin should be an object.',
615
+ required: {
616
+ name: 'Plugin should have required property "name".',
617
+ version: 'Plugin should have required property "version".'
618
+ }
619
+ }
620
+ },
544
621
  request: {
545
622
  type: 'object',
546
623
  additionalProperties: false,
@@ -617,6 +694,9 @@ export default {
617
694
  app: {
618
695
  $ref: '#/definitions/app'
619
696
  },
697
+ auth: {
698
+ $ref: '#/definitions/authConfig'
699
+ },
620
700
  cli: {
621
701
  type: 'object',
622
702
  errorMessage: {
@@ -630,6 +710,13 @@ export default {
630
710
  },
631
711
  additionalProperties: false,
632
712
  properties: {
713
+ basePath: {
714
+ type: 'string',
715
+ description: 'App base path to apply to all routes. Base path must start with "/".',
716
+ errorMessage: {
717
+ type: 'App "config.basePath" should be a string.'
718
+ }
719
+ },
633
720
  homePageId: {
634
721
  type: 'string',
635
722
  description: 'Page id to use as homepage. When visiting home route "/", the router will redirect to this page. If not provided, the first page in default or first menu will be used as the homePageId.',
@@ -637,23 +724,30 @@ export default {
637
724
  type: 'App "config.homePageId" should be a string.'
638
725
  }
639
726
  },
640
- auth: {
641
- $ref: '#/definitions/authConfig'
642
- }
643
- }
644
- },
645
- types: {
646
- type: 'object',
647
- patternProperties: {
648
- '^.*$': {
649
- url: 'string',
727
+ theme: {
728
+ type: 'object',
650
729
  errorMessage: {
651
- enum: 'Type "url" should be a string.'
730
+ type: 'App "config.theme" should be an object.'
731
+ },
732
+ properties: {
733
+ lessVariables: {
734
+ type: 'object',
735
+ description: 'App theme less variables.',
736
+ errorMessage: {
737
+ type: 'App "config.theme.lessVariables" should be an object.'
738
+ }
739
+ }
652
740
  }
653
741
  }
742
+ }
743
+ },
744
+ plugins: {
745
+ type: 'array',
746
+ items: {
747
+ $ref: '#/definitions/plugin'
654
748
  },
655
749
  errorMessage: {
656
- type: 'App "types" should be an object.'
750
+ type: 'App "plugins" should be an array.'
657
751
  }
658
752
  },
659
753
  global: {