@lowdefy/build 4.0.0-alpha.9 → 4.0.0-rc.1
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/dist/build/addDefaultPages/404.js +4 -4
- package/dist/build/addDefaultPages/addDefaultPages.js +3 -4
- package/dist/build/buildAuth/buildAuth.js +12 -28
- package/dist/build/buildAuth/buildAuthPlugins.js +71 -0
- package/dist/build/buildAuth/buildPageAuth.js +50 -0
- package/dist/build/buildAuth/getPageRoles.js +2 -2
- package/dist/build/buildAuth/getProtectedPages.js +7 -9
- package/dist/build/buildAuth/validateAuthConfig.js +64 -0
- package/dist/build/buildConnections.js +2 -2
- package/dist/build/{buildIcons.js → buildImports/buildIconImports.js} +26 -29
- package/dist/build/buildImports/buildImports.js +30 -0
- package/dist/build/buildImports/buildImportsDev.js +106 -0
- package/dist/build/buildImports/buildImportsProd.js +54 -0
- package/dist/build/{buildStyles.js → buildImports/buildStyleImports.js} +8 -12
- package/dist/build/buildImports/defaultIconsDev.js +584 -0
- package/dist/build/buildImports/defaultIconsProd.js +21 -0
- package/dist/build/buildMenu.js +11 -15
- package/dist/build/buildPages/buildBlock/buildBlock.js +3 -3
- package/dist/build/buildPages/buildBlock/buildEvents.js +8 -7
- package/dist/build/buildPages/buildBlock/buildRequests.js +1 -1
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +3 -8
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +1 -1
- package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +9 -9
- package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
- package/dist/build/buildPages/buildBlock/validateBlock.js +1 -1
- package/dist/build/buildPages/buildPage.js +3 -3
- package/dist/build/buildPages/buildPages.js +4 -6
- package/dist/build/buildPages/buildTestPage.js +46 -0
- package/dist/build/buildRefs/buildRefs.js +11 -5
- package/dist/build/buildRefs/evaluateBuildOperators.js +3 -4
- package/dist/build/buildRefs/getConfigFile.js +2 -2
- package/dist/build/buildRefs/getKey.js +24 -0
- package/dist/build/buildRefs/getRefContent.js +1 -1
- package/dist/build/buildRefs/getRefPath.js +1 -1
- package/dist/build/buildRefs/getRefsFromFile.js +1 -1
- package/dist/build/buildRefs/getUserJavascriptFunction.js +3 -2
- package/dist/build/buildRefs/makeRefDefinition.js +2 -1
- package/dist/build/buildRefs/parseNunjucks.js +1 -1
- package/dist/build/buildRefs/parseRefContent.js +4 -4
- package/dist/build/buildRefs/populateRefs.js +4 -4
- package/dist/build/buildRefs/recursiveBuild.js +9 -5
- package/dist/build/buildRefs/runRefResolver.js +1 -1
- package/dist/build/buildRefs/runTransformer.js +1 -1
- package/dist/build/buildTypes.js +33 -5
- package/dist/build/cleanBuildDirectory.js +1 -1
- package/dist/build/copyPublicFolder.js +7 -4
- package/dist/build/testSchema.js +5 -7
- package/dist/build/updateServerPackageJson.js +5 -1
- package/dist/build/validateApp.js +2 -2
- package/dist/build/validateConfig.js +2 -29
- package/dist/build/writeApp.js +1 -1
- package/dist/build/writeAuth.js +18 -0
- package/dist/build/writeConfig.js +1 -1
- package/dist/build/writeConnections.js +1 -1
- package/dist/build/writeGlobal.js +1 -1
- package/dist/build/writeMenus.js +1 -1
- package/dist/build/writePages.js +2 -3
- package/dist/build/writePluginImports/generateImportFile.js +2 -7
- package/dist/build/writePluginImports/writeActionImports.js +2 -2
- package/dist/build/writePluginImports/writeAuthImports.js +34 -0
- package/dist/build/writePluginImports/writeBlockImports.js +2 -2
- package/dist/build/writePluginImports/writeConnectionImports.js +2 -2
- package/dist/build/writePluginImports/writeIconImports.js +2 -2
- package/dist/build/writePluginImports/writeOperatorImports.js +5 -5
- package/dist/build/writePluginImports/writePluginImports.js +52 -0
- package/dist/build/writePluginImports/writeStyleImports.js +9 -3
- package/dist/build/writeRequests.js +2 -3
- package/dist/build/writeTypes.js +1 -1
- package/dist/createContext.js +55 -0
- package/dist/{defaultTypesMap.json → defaultTypesMap.js} +922 -405
- package/dist/index.js +20 -78
- package/dist/lowdefySchema.js +176 -68
- package/dist/scripts/generateDefaultTypes.js +21 -3
- package/dist/scripts/run.js +5 -4
- package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +1 -1
- package/dist/test/buildRefs/testBuildRefsErrorResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsNullResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsParsingResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsTransform.js +1 -1
- package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +1 -1
- package/dist/test/testContext.js +8 -2
- package/dist/utils/countOperators.js +1 -1
- package/dist/utils/createCheckDuplicateId.js +1 -1
- package/dist/utils/createCounter.js +1 -1
- package/dist/utils/createPluginTypesMap.js +29 -1
- package/dist/utils/formatErrorMessage.js +1 -1
- package/dist/utils/readConfigFile.js +5 -2
- package/dist/utils/writeBuildArtifact.js +1 -1
- package/package.json +56 -45
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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,20 +12,15 @@
|
|
|
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
|
|
16
|
-
import { readFile } from '@lowdefy/node-utils';
|
|
17
|
-
import createCounter from './utils/createCounter.js';
|
|
15
|
+
*/ import createContext from './createContext.js';
|
|
18
16
|
import createPluginTypesMap from './utils/createPluginTypesMap.js';
|
|
19
|
-
import createReadConfigFile from './utils/readConfigFile.js';
|
|
20
|
-
import createWriteBuildArtifact from './utils/writeBuildArtifact.js';
|
|
21
17
|
import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
|
|
22
18
|
import buildAuth from './build/buildAuth/buildAuth.js';
|
|
23
19
|
import buildConnections from './build/buildConnections.js';
|
|
24
|
-
import
|
|
20
|
+
import buildImports from './build/buildImports/buildImports.js';
|
|
25
21
|
import buildMenu from './build/buildMenu.js';
|
|
26
22
|
import buildPages from './build/buildPages/buildPages.js';
|
|
27
23
|
import buildRefs from './build/buildRefs/buildRefs.js';
|
|
28
|
-
import buildStyles from './build/buildStyles.js';
|
|
29
24
|
import buildTypes from './build/buildTypes.js';
|
|
30
25
|
import cleanBuildDirectory from './build/cleanBuildDirectory.js';
|
|
31
26
|
import copyPublicFolder from './build/copyPublicFolder.js';
|
|
@@ -34,105 +29,68 @@ import validateApp from './build/validateApp.js';
|
|
|
34
29
|
import validateConfig from './build/validateConfig.js';
|
|
35
30
|
import updateServerPackageJson from './build/updateServerPackageJson.js';
|
|
36
31
|
import writeApp from './build/writeApp.js';
|
|
37
|
-
import
|
|
38
|
-
import
|
|
32
|
+
import writeAuth from './build/writeAuth.js';
|
|
33
|
+
import writePluginImports from './build/writePluginImports/writePluginImports.js';
|
|
39
34
|
import writeConfig from './build/writeConfig.js';
|
|
40
|
-
import writeConnectionImports from './build/writePluginImports/writeConnectionImports.js';
|
|
41
35
|
import writeConnections from './build/writeConnections.js';
|
|
42
36
|
import writeGlobal from './build/writeGlobal.js';
|
|
43
|
-
import writeIconImports from './build/writePluginImports/writeIconImports.js';
|
|
44
37
|
import writeMenus from './build/writeMenus.js';
|
|
45
|
-
import writeOperatorImports from './build/writePluginImports/writeOperatorImports.js';
|
|
46
38
|
import writePages from './build/writePages.js';
|
|
47
39
|
import writeRequests from './build/writeRequests.js';
|
|
48
|
-
import writeStyleImports from './build/writePluginImports/writeStyleImports.js';
|
|
49
40
|
import writeTypes from './build/writeTypes.js';
|
|
50
|
-
async function createContext({ customTypesMap , directories , logger , refResolver }) {
|
|
51
|
-
const defaultTypesMap = JSON.parse(await readFile(new URL('./defaultTypesMap.json', import.meta.url).pathname));
|
|
52
|
-
const context = {
|
|
53
|
-
directories,
|
|
54
|
-
logger,
|
|
55
|
-
readConfigFile: createReadConfigFile({
|
|
56
|
-
directories
|
|
57
|
-
}),
|
|
58
|
-
refResolver,
|
|
59
|
-
typeCounters: {
|
|
60
|
-
actions: createCounter(),
|
|
61
|
-
blocks: createCounter(),
|
|
62
|
-
connections: createCounter(),
|
|
63
|
-
requests: createCounter(),
|
|
64
|
-
operators: {
|
|
65
|
-
client: createCounter(),
|
|
66
|
-
server: createCounter()
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
typesMap: mergeObjects([
|
|
70
|
-
defaultTypesMap,
|
|
71
|
-
customTypesMap
|
|
72
|
-
]),
|
|
73
|
-
writeBuildArtifact: createWriteBuildArtifact({
|
|
74
|
-
directories
|
|
75
|
-
})
|
|
76
|
-
};
|
|
77
|
-
return context;
|
|
78
|
-
}
|
|
79
41
|
async function build(options) {
|
|
80
|
-
const context =
|
|
42
|
+
const context = createContext(options);
|
|
81
43
|
const components = await buildRefs({
|
|
82
44
|
context
|
|
83
45
|
});
|
|
84
|
-
|
|
46
|
+
testSchema({
|
|
85
47
|
components,
|
|
86
48
|
context
|
|
87
49
|
});
|
|
88
|
-
|
|
50
|
+
validateApp({
|
|
89
51
|
components,
|
|
90
52
|
context
|
|
91
53
|
});
|
|
92
|
-
|
|
54
|
+
validateConfig({
|
|
93
55
|
components,
|
|
94
56
|
context
|
|
95
57
|
});
|
|
96
|
-
|
|
58
|
+
addDefaultPages({
|
|
97
59
|
components,
|
|
98
60
|
context
|
|
99
61
|
});
|
|
100
|
-
|
|
62
|
+
buildAuth({
|
|
101
63
|
components,
|
|
102
64
|
context
|
|
103
65
|
});
|
|
104
|
-
|
|
66
|
+
buildConnections({
|
|
105
67
|
components,
|
|
106
68
|
context
|
|
107
69
|
});
|
|
108
|
-
|
|
70
|
+
buildPages({
|
|
109
71
|
components,
|
|
110
72
|
context
|
|
111
73
|
});
|
|
112
|
-
|
|
74
|
+
buildMenu({
|
|
113
75
|
components,
|
|
114
76
|
context
|
|
115
77
|
});
|
|
116
|
-
|
|
78
|
+
buildTypes({
|
|
117
79
|
components,
|
|
118
80
|
context
|
|
119
81
|
});
|
|
120
|
-
|
|
121
|
-
components,
|
|
122
|
-
context
|
|
123
|
-
});
|
|
124
|
-
await buildStyles({
|
|
82
|
+
buildImports({
|
|
125
83
|
components,
|
|
126
84
|
context
|
|
127
85
|
});
|
|
128
86
|
await cleanBuildDirectory({
|
|
129
87
|
context
|
|
130
88
|
});
|
|
131
|
-
await
|
|
89
|
+
await writeApp({
|
|
132
90
|
components,
|
|
133
91
|
context
|
|
134
92
|
});
|
|
135
|
-
await
|
|
93
|
+
await writeAuth({
|
|
136
94
|
components,
|
|
137
95
|
context
|
|
138
96
|
});
|
|
@@ -164,23 +122,7 @@ async function build(options) {
|
|
|
164
122
|
components,
|
|
165
123
|
context
|
|
166
124
|
});
|
|
167
|
-
await
|
|
168
|
-
components,
|
|
169
|
-
context
|
|
170
|
-
});
|
|
171
|
-
await writeConnectionImports({
|
|
172
|
-
components,
|
|
173
|
-
context
|
|
174
|
-
});
|
|
175
|
-
await writeOperatorImports({
|
|
176
|
-
components,
|
|
177
|
-
context
|
|
178
|
-
});
|
|
179
|
-
await writeStyleImports({
|
|
180
|
-
components,
|
|
181
|
-
context
|
|
182
|
-
});
|
|
183
|
-
await writeIconImports({
|
|
125
|
+
await writePluginImports({
|
|
184
126
|
components,
|
|
185
127
|
context
|
|
186
128
|
});
|
|
@@ -193,5 +135,5 @@ async function build(options) {
|
|
|
193
135
|
context
|
|
194
136
|
});
|
|
195
137
|
}
|
|
196
|
-
export {
|
|
138
|
+
export { createPluginTypesMap };
|
|
197
139
|
export default build;
|
package/dist/lowdefySchema.js
CHANGED
|
@@ -72,36 +72,141 @@ export default {
|
|
|
72
72
|
type: 'object',
|
|
73
73
|
additionalProperties: false,
|
|
74
74
|
errorMessage: {
|
|
75
|
-
type: 'App "
|
|
75
|
+
type: 'App "auth" should be an object.'
|
|
76
76
|
},
|
|
77
77
|
properties: {
|
|
78
|
-
|
|
78
|
+
advanced: {
|
|
79
79
|
type: 'object',
|
|
80
|
-
additionalProperties: false,
|
|
81
|
-
errorMessage: {
|
|
82
|
-
type: 'App "config.auth.openId" should be an object.'
|
|
83
|
-
},
|
|
84
80
|
properties: {
|
|
85
|
-
|
|
81
|
+
cookies: {
|
|
82
|
+
type: 'object'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
adapter: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
required: [
|
|
89
|
+
'id',
|
|
90
|
+
'type'
|
|
91
|
+
],
|
|
92
|
+
properties: {
|
|
93
|
+
id: {
|
|
86
94
|
type: 'string',
|
|
87
|
-
description: '.',
|
|
88
95
|
errorMessage: {
|
|
89
|
-
type: '
|
|
96
|
+
type: 'Auth adapter "id" should be a string.'
|
|
90
97
|
}
|
|
91
98
|
},
|
|
92
|
-
|
|
99
|
+
type: {
|
|
93
100
|
type: 'string',
|
|
94
|
-
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.',
|
|
95
101
|
errorMessage: {
|
|
96
|
-
type: '
|
|
102
|
+
type: 'Auth adapter "type" should be a string.'
|
|
97
103
|
}
|
|
98
104
|
},
|
|
99
|
-
|
|
105
|
+
properties: {
|
|
106
|
+
type: 'object'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
errorMessage: {
|
|
110
|
+
type: 'Auth adapter should be an object.',
|
|
111
|
+
required: {
|
|
112
|
+
id: 'Auth adapter should have required property "id".',
|
|
113
|
+
type: 'Auth adapter should have required property "type".'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
authPages: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
additionalProperties: false,
|
|
120
|
+
properties: {
|
|
121
|
+
signIn: {
|
|
100
122
|
type: 'string',
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
default: '/auth/signin'
|
|
124
|
+
},
|
|
125
|
+
signOut: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
default: '/auth/signout'
|
|
128
|
+
},
|
|
129
|
+
error: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'Error code passed in query string as ?error=',
|
|
132
|
+
default: '/auth/error'
|
|
133
|
+
},
|
|
134
|
+
verifyRequest: {
|
|
135
|
+
type: 'string',
|
|
136
|
+
description: 'Used for check email message',
|
|
137
|
+
default: '/auth/verify-request'
|
|
138
|
+
},
|
|
139
|
+
newUser: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
description: 'New users will be directed here on first sign in (leave the property out if not of interest)',
|
|
142
|
+
default: '/auth/new-user'
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
callbacks: {
|
|
147
|
+
type: 'array',
|
|
148
|
+
items: {
|
|
149
|
+
type: 'object',
|
|
150
|
+
required: [
|
|
151
|
+
'id',
|
|
152
|
+
'type'
|
|
153
|
+
],
|
|
154
|
+
properties: {
|
|
155
|
+
id: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
errorMessage: {
|
|
158
|
+
type: 'Auth callback "id" should be a string.'
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
type: {
|
|
162
|
+
type: 'string',
|
|
163
|
+
errorMessage: {
|
|
164
|
+
type: 'Auth callback "type" should be a string.'
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
properties: {
|
|
168
|
+
type: 'object'
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
errorMessage: {
|
|
172
|
+
type: 'Auth callback should be an object.',
|
|
173
|
+
required: {
|
|
174
|
+
id: 'Auth callback should have required property "id".',
|
|
175
|
+
type: 'Auth callback should have required property "type".'
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
events: {
|
|
181
|
+
type: 'array',
|
|
182
|
+
items: {
|
|
183
|
+
type: 'object',
|
|
184
|
+
required: [
|
|
185
|
+
'id',
|
|
186
|
+
'type'
|
|
187
|
+
],
|
|
188
|
+
properties: {
|
|
189
|
+
id: {
|
|
190
|
+
type: 'string',
|
|
191
|
+
errorMessage: {
|
|
192
|
+
type: 'Auth event "id" should be a string.'
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
type: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
errorMessage: {
|
|
198
|
+
type: 'Auth event "type" should be a string.'
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
properties: {
|
|
202
|
+
type: 'object'
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
errorMessage: {
|
|
206
|
+
type: 'Auth event should be an object.',
|
|
207
|
+
required: {
|
|
208
|
+
id: 'Auth event should have required property "id".',
|
|
209
|
+
type: 'Auth event should have required property "type".'
|
|
105
210
|
}
|
|
106
211
|
}
|
|
107
212
|
}
|
|
@@ -119,13 +224,13 @@ export default {
|
|
|
119
224
|
'boolean'
|
|
120
225
|
],
|
|
121
226
|
errorMessage: {
|
|
122
|
-
type: 'App "
|
|
227
|
+
type: 'App "auth.pages.protected.$" should be an array of strings.'
|
|
123
228
|
},
|
|
124
229
|
items: {
|
|
125
230
|
type: 'string',
|
|
126
231
|
description: 'Page ids for which authentication is required. When specified, all unspecified pages will be public.',
|
|
127
232
|
errorMessage: {
|
|
128
|
-
type: 'App "
|
|
233
|
+
type: 'App "auth.pages.protected.$" should be an array of strings.'
|
|
129
234
|
}
|
|
130
235
|
}
|
|
131
236
|
},
|
|
@@ -135,13 +240,13 @@ export default {
|
|
|
135
240
|
'boolean'
|
|
136
241
|
],
|
|
137
242
|
errorMessage: {
|
|
138
|
-
type: 'App "
|
|
243
|
+
type: 'App "auth.pages.public.$" should be an array of strings.'
|
|
139
244
|
},
|
|
140
245
|
items: {
|
|
141
246
|
type: 'string',
|
|
142
247
|
description: 'Page ids for which authentication is not required. When specified, all unspecified pages will be protected.',
|
|
143
248
|
errorMessage: {
|
|
144
|
-
type: 'App "
|
|
249
|
+
type: 'App "auth.pages.public.$" should be an array of strings.'
|
|
145
250
|
}
|
|
146
251
|
}
|
|
147
252
|
},
|
|
@@ -154,46 +259,58 @@ export default {
|
|
|
154
259
|
type: 'string'
|
|
155
260
|
},
|
|
156
261
|
errorMessage: {
|
|
157
|
-
type: 'App "
|
|
262
|
+
type: 'App "auth.pages.roles.[role]" should be an array of strings.'
|
|
158
263
|
}
|
|
159
264
|
}
|
|
160
265
|
},
|
|
161
266
|
errorMessage: {
|
|
162
|
-
type: 'App "
|
|
267
|
+
type: 'App "auth.pages.roles" should be an object.'
|
|
163
268
|
}
|
|
164
269
|
}
|
|
165
270
|
}
|
|
166
271
|
},
|
|
167
|
-
|
|
168
|
-
type: '
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
'
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
272
|
+
providers: {
|
|
273
|
+
type: 'array',
|
|
274
|
+
items: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
required: [
|
|
277
|
+
'id',
|
|
278
|
+
'type'
|
|
279
|
+
],
|
|
280
|
+
properties: {
|
|
281
|
+
id: {
|
|
282
|
+
type: 'string',
|
|
283
|
+
errorMessage: {
|
|
284
|
+
type: 'Auth provider "id" should be a string.'
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
type: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
errorMessage: {
|
|
290
|
+
type: 'Auth provider "type" should be a string.'
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
properties: {
|
|
294
|
+
type: 'object'
|
|
183
295
|
}
|
|
184
296
|
},
|
|
185
|
-
|
|
186
|
-
type:
|
|
187
|
-
|
|
188
|
-
'
|
|
189
|
-
|
|
190
|
-
default: '5min',
|
|
191
|
-
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)',
|
|
192
|
-
errorMessage: {
|
|
193
|
-
type: 'App "config.auth.jwt.loginStateExpiresIn" should be a string or number.'
|
|
297
|
+
errorMessage: {
|
|
298
|
+
type: 'Auth provider should be an object.',
|
|
299
|
+
required: {
|
|
300
|
+
id: 'Auth provider should have required property "id".',
|
|
301
|
+
type: 'Auth provider should have required property "type".'
|
|
194
302
|
}
|
|
195
303
|
}
|
|
196
304
|
}
|
|
305
|
+
},
|
|
306
|
+
session: {
|
|
307
|
+
type: 'object'
|
|
308
|
+
},
|
|
309
|
+
theme: {
|
|
310
|
+
type: 'object'
|
|
311
|
+
},
|
|
312
|
+
userFields: {
|
|
313
|
+
type: 'object'
|
|
197
314
|
}
|
|
198
315
|
}
|
|
199
316
|
},
|
|
@@ -323,7 +440,7 @@ export default {
|
|
|
323
440
|
}
|
|
324
441
|
}
|
|
325
442
|
}
|
|
326
|
-
}
|
|
443
|
+
}
|
|
327
444
|
]
|
|
328
445
|
}
|
|
329
446
|
},
|
|
@@ -487,7 +604,7 @@ export default {
|
|
|
487
604
|
},
|
|
488
605
|
{
|
|
489
606
|
$ref: '#/definitions/menuLink'
|
|
490
|
-
}
|
|
607
|
+
}
|
|
491
608
|
]
|
|
492
609
|
},
|
|
493
610
|
menuLink: {
|
|
@@ -645,9 +762,18 @@ export default {
|
|
|
645
762
|
type: 'App "license" should be a string.'
|
|
646
763
|
}
|
|
647
764
|
},
|
|
765
|
+
version: {
|
|
766
|
+
type: 'string',
|
|
767
|
+
errorMessage: {
|
|
768
|
+
type: 'App "version" should be a string.'
|
|
769
|
+
}
|
|
770
|
+
},
|
|
648
771
|
app: {
|
|
649
772
|
$ref: '#/definitions/app'
|
|
650
773
|
},
|
|
774
|
+
auth: {
|
|
775
|
+
$ref: '#/definitions/authConfig'
|
|
776
|
+
},
|
|
651
777
|
cli: {
|
|
652
778
|
type: 'object',
|
|
653
779
|
errorMessage: {
|
|
@@ -661,9 +787,6 @@ export default {
|
|
|
661
787
|
},
|
|
662
788
|
additionalProperties: false,
|
|
663
789
|
properties: {
|
|
664
|
-
auth: {
|
|
665
|
-
$ref: '#/definitions/authConfig'
|
|
666
|
-
},
|
|
667
790
|
basePath: {
|
|
668
791
|
type: 'string',
|
|
669
792
|
description: 'App base path to apply to all routes. Base path must start with "/".',
|
|
@@ -677,21 +800,6 @@ export default {
|
|
|
677
800
|
errorMessage: {
|
|
678
801
|
type: 'App "config.homePageId" should be a string.'
|
|
679
802
|
}
|
|
680
|
-
},
|
|
681
|
-
theme: {
|
|
682
|
-
type: 'object',
|
|
683
|
-
errorMessage: {
|
|
684
|
-
type: 'App "config.theme" should be an object.'
|
|
685
|
-
},
|
|
686
|
-
properties: {
|
|
687
|
-
lessVariables: {
|
|
688
|
-
type: 'object',
|
|
689
|
-
description: 'App theme less variables.',
|
|
690
|
-
errorMessage: {
|
|
691
|
-
type: 'App "config.theme.lessVariables" should be an object.'
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
803
|
}
|
|
696
804
|
}
|
|
697
805
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
|
-
Copyright 2020-
|
|
3
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
4
4
|
|
|
5
5
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
you may not use this file except in compliance with the License.
|
|
@@ -18,12 +18,16 @@ import { readFile, writeFile } from '@lowdefy/node-utils';
|
|
|
18
18
|
import createPluginTypesMap from '../utils/createPluginTypesMap.js';
|
|
19
19
|
const defaultPackages = [
|
|
20
20
|
'@lowdefy/actions-core',
|
|
21
|
+
'@lowdefy/actions-pdf-make',
|
|
22
|
+
'@lowdefy/blocks-aggrid',
|
|
21
23
|
'@lowdefy/blocks-antd',
|
|
22
24
|
'@lowdefy/blocks-basic',
|
|
23
25
|
'@lowdefy/blocks-color-selectors',
|
|
24
26
|
'@lowdefy/blocks-echarts',
|
|
27
|
+
'@lowdefy/blocks-google-maps',
|
|
25
28
|
'@lowdefy/blocks-loaders',
|
|
26
29
|
'@lowdefy/blocks-markdown',
|
|
30
|
+
'@lowdefy/blocks-qr',
|
|
27
31
|
'@lowdefy/connection-axios-http',
|
|
28
32
|
'@lowdefy/connection-elasticsearch',
|
|
29
33
|
'@lowdefy/connection-google-sheets',
|
|
@@ -35,15 +39,26 @@ const defaultPackages = [
|
|
|
35
39
|
'@lowdefy/operators-change-case',
|
|
36
40
|
'@lowdefy/operators-diff',
|
|
37
41
|
'@lowdefy/operators-js',
|
|
42
|
+
'@lowdefy/operators-moment',
|
|
38
43
|
'@lowdefy/operators-mql',
|
|
39
44
|
'@lowdefy/operators-nunjucks',
|
|
40
45
|
'@lowdefy/operators-uuid',
|
|
41
|
-
'@lowdefy/operators-yaml',
|
|
46
|
+
'@lowdefy/operators-yaml',
|
|
47
|
+
'@lowdefy/plugin-auth0',
|
|
48
|
+
'@lowdefy/plugin-aws',
|
|
49
|
+
'@lowdefy/plugin-csv',
|
|
50
|
+
'@lowdefy/plugin-next-auth'
|
|
42
51
|
];
|
|
43
52
|
async function generateDefaultTypesMap() {
|
|
44
53
|
const packageFile = JSON.parse(await readFile(path.resolve(process.cwd(), './package.json')));
|
|
45
54
|
const defaultTypesMap = {
|
|
46
55
|
actions: {},
|
|
56
|
+
auth: {
|
|
57
|
+
adapters: {},
|
|
58
|
+
callbacks: {},
|
|
59
|
+
events: {},
|
|
60
|
+
providers: {}
|
|
61
|
+
},
|
|
47
62
|
blocks: {},
|
|
48
63
|
connections: {},
|
|
49
64
|
icons: {},
|
|
@@ -67,6 +82,9 @@ async function generateDefaultTypesMap() {
|
|
|
67
82
|
version
|
|
68
83
|
});
|
|
69
84
|
}));
|
|
70
|
-
await writeFile(path.resolve(process.cwd(), './dist/defaultTypesMap.
|
|
85
|
+
await writeFile(path.resolve(process.cwd(), './dist/defaultTypesMap.js'), `const defaultTypesMap = ${JSON.stringify(defaultTypesMap, null, 2)};
|
|
86
|
+
|
|
87
|
+
export default defaultTypesMap;
|
|
88
|
+
`);
|
|
71
89
|
}
|
|
72
90
|
generateDefaultTypesMap();
|
package/dist/scripts/run.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
|
-
Copyright 2020-
|
|
3
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
4
4
|
|
|
5
5
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
you may not use this file except in compliance with the License.
|
|
@@ -20,13 +20,14 @@ import build from '../index.js';
|
|
|
20
20
|
const argv = yargs(hideBin(process.argv)).argv;
|
|
21
21
|
async function run() {
|
|
22
22
|
await build({
|
|
23
|
-
logger: console,
|
|
24
|
-
refResolver: argv.refResolver || process.env.LOWDEFY_BUILD_REF_RESOLVER,
|
|
25
23
|
directories: {
|
|
26
24
|
build: path.resolve(argv.buildDirectory || process.env.LOWDEFY_DIRECTORY_BUILD || path.join(process.cwd(), 'build')),
|
|
27
25
|
config: path.resolve(argv.configDirectory || process.env.LOWDEFY_DIRECTORY_CONFIG || process.cwd()),
|
|
28
26
|
server: path.resolve(argv.serverDirectory || process.env.LOWDEFY_DIRECTORY_SERVER || process.cwd())
|
|
29
|
-
}
|
|
27
|
+
},
|
|
28
|
+
logger: console,
|
|
29
|
+
refResolver: argv.refResolver || process.env.LOWDEFY_BUILD_REF_RESOLVER,
|
|
30
|
+
stage: argv.stage || process.env.LOWDEFY_BUILD_STAGE || 'prod'
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
run();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
resolved: true,
|
|
18
18
|
path,
|
|
19
19
|
vars,
|
|
20
|
-
|
|
20
|
+
stage: context.stage
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export default resolver;
|