@lowdefy/build 4.0.0-alpha.8 → 4.0.0-rc.0

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 (91) hide show
  1. package/dist/build/addDefaultPages/404.js +1 -1
  2. package/dist/build/addDefaultPages/addDefaultPages.js +3 -4
  3. package/dist/build/buildAuth/buildAuth.js +12 -28
  4. package/dist/build/buildAuth/buildAuthPlugins.js +71 -0
  5. package/dist/build/buildAuth/buildPageAuth.js +50 -0
  6. package/dist/build/buildAuth/getPageRoles.js +2 -2
  7. package/dist/build/buildAuth/getProtectedPages.js +7 -9
  8. package/dist/build/buildAuth/validateAuthConfig.js +64 -0
  9. package/dist/build/buildConnections.js +2 -2
  10. package/dist/build/{buildIcons.js → buildImports/buildIconImports.js} +16 -24
  11. package/dist/build/buildImports/buildImports.js +30 -0
  12. package/dist/build/buildImports/buildImportsDev.js +106 -0
  13. package/dist/build/buildImports/buildImportsProd.js +54 -0
  14. package/dist/build/{buildStyles.js → buildImports/buildStyleImports.js} +8 -12
  15. package/dist/build/buildImports/defaultIconsDev.js +584 -0
  16. package/dist/build/buildImports/defaultIconsProd.js +21 -0
  17. package/dist/build/buildMenu.js +10 -14
  18. package/dist/build/buildPages/buildBlock/buildBlock.js +8 -4
  19. package/dist/build/buildPages/buildBlock/buildEvents.js +8 -7
  20. package/dist/build/buildPages/buildBlock/buildRequests.js +1 -1
  21. package/dist/build/buildPages/buildBlock/buildSubBlocks.js +3 -8
  22. package/dist/build/buildPages/buildBlock/countBlockOperators.js +2 -2
  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 +3 -3
  29. package/dist/build/buildPages/buildPages.js +4 -6
  30. package/dist/build/buildPages/buildTestPage.js +46 -0
  31. package/dist/build/buildRefs/buildRefs.js +11 -5
  32. package/dist/build/buildRefs/evaluateBuildOperators.js +3 -4
  33. package/dist/build/buildRefs/getConfigFile.js +2 -2
  34. package/dist/build/buildRefs/getRefContent.js +1 -1
  35. package/dist/build/buildRefs/getRefPath.js +1 -1
  36. package/dist/build/buildRefs/getRefsFromFile.js +1 -1
  37. package/dist/build/buildRefs/getUserJavascriptFunction.js +3 -2
  38. package/dist/build/buildRefs/makeRefDefinition.js +2 -1
  39. package/dist/build/buildRefs/parseNunjucks.js +1 -1
  40. package/dist/build/buildRefs/parseRefContent.js +9 -4
  41. package/dist/build/buildRefs/populateRefs.js +4 -4
  42. package/dist/build/buildRefs/recursiveBuild.js +6 -6
  43. package/dist/build/buildRefs/runRefResolver.js +1 -1
  44. package/dist/build/buildRefs/runTransformer.js +1 -1
  45. package/dist/build/buildTypes.js +39 -2
  46. package/dist/build/cleanBuildDirectory.js +1 -1
  47. package/dist/build/copyPublicFolder.js +1 -1
  48. package/dist/build/testSchema.js +5 -7
  49. package/dist/build/updateServerPackageJson.js +5 -1
  50. package/dist/build/validateApp.js +2 -2
  51. package/dist/build/validateConfig.js +2 -29
  52. package/dist/build/writeApp.js +1 -1
  53. package/dist/build/writeAuth.js +18 -0
  54. package/dist/build/writeConfig.js +1 -1
  55. package/dist/build/writeConnections.js +1 -1
  56. package/dist/build/writeGlobal.js +1 -1
  57. package/dist/build/writeMenus.js +1 -1
  58. package/dist/build/writePages.js +2 -3
  59. package/dist/build/writePluginImports/generateImportFile.js +2 -7
  60. package/dist/build/writePluginImports/writeActionImports.js +2 -2
  61. package/dist/build/writePluginImports/writeAuthImports.js +34 -0
  62. package/dist/build/writePluginImports/writeBlockImports.js +2 -2
  63. package/dist/build/writePluginImports/writeConnectionImports.js +2 -2
  64. package/dist/build/writePluginImports/writeIconImports.js +2 -2
  65. package/dist/build/writePluginImports/writeOperatorImports.js +5 -5
  66. package/dist/build/writePluginImports/writePluginImports.js +52 -0
  67. package/dist/build/writePluginImports/writeStyleImports.js +10 -3
  68. package/dist/build/writeRequests.js +2 -3
  69. package/dist/build/writeTypes.js +1 -1
  70. package/dist/createContext.js +55 -0
  71. package/dist/{defaultTypesMap.json → defaultTypesMap.js} +989 -388
  72. package/dist/index.js +20 -78
  73. package/dist/lowdefySchema.js +177 -68
  74. package/dist/scripts/generateDefaultTypes.js +22 -4
  75. package/dist/scripts/run.js +5 -4
  76. package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +1 -1
  77. package/dist/test/buildRefs/testBuildRefsErrorResolver.js +1 -1
  78. package/dist/test/buildRefs/testBuildRefsNullResolver.js +1 -1
  79. package/dist/test/buildRefs/testBuildRefsParsingResolver.js +1 -1
  80. package/dist/test/buildRefs/testBuildRefsResolver.js +2 -2
  81. package/dist/test/buildRefs/testBuildRefsTransform.js +1 -1
  82. package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +1 -1
  83. package/dist/test/testContext.js +8 -2
  84. package/dist/utils/countOperators.js +1 -1
  85. package/dist/utils/createCheckDuplicateId.js +1 -1
  86. package/dist/utils/createCounter.js +1 -1
  87. package/dist/utils/createPluginTypesMap.js +29 -1
  88. package/dist/utils/formatErrorMessage.js +1 -1
  89. package/dist/utils/readConfigFile.js +5 -2
  90. package/dist/utils/writeBuildArtifact.js +1 -1
  91. package/package.json +55 -44
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,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 { mergeObjects } from '@lowdefy/helpers';
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 buildIcons from './build/buildIcons.js';
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 writeActionImports from './build/writePluginImports/writeActionImports.js';
38
- import writeBlockImports from './build/writePluginImports/writeBlockImports.js';
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 = await createContext(options);
42
+ const context = createContext(options);
81
43
  const components = await buildRefs({
82
44
  context
83
45
  });
84
- await testSchema({
46
+ testSchema({
85
47
  components,
86
48
  context
87
49
  });
88
- await validateApp({
50
+ validateApp({
89
51
  components,
90
52
  context
91
53
  });
92
- await validateConfig({
54
+ validateConfig({
93
55
  components,
94
56
  context
95
57
  });
96
- await addDefaultPages({
58
+ addDefaultPages({
97
59
  components,
98
60
  context
99
61
  });
100
- await buildAuth({
62
+ buildAuth({
101
63
  components,
102
64
  context
103
65
  });
104
- await buildConnections({
66
+ buildConnections({
105
67
  components,
106
68
  context
107
69
  });
108
- await buildPages({
70
+ buildPages({
109
71
  components,
110
72
  context
111
73
  });
112
- await buildMenu({
74
+ buildMenu({
113
75
  components,
114
76
  context
115
77
  });
116
- await buildTypes({
78
+ buildTypes({
117
79
  components,
118
80
  context
119
81
  });
120
- await buildIcons({
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 writeActionImports({
89
+ await writeApp({
132
90
  components,
133
91
  context
134
92
  });
135
- await writeApp({
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 writeBlockImports({
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 { createContext, createPluginTypesMap };
138
+ export { createPluginTypesMap };
197
139
  export default build;
@@ -72,36 +72,141 @@ export default {
72
72
  type: 'object',
73
73
  additionalProperties: false,
74
74
  errorMessage: {
75
- type: 'App "config.auth" should be an object.'
75
+ type: 'App "auth" should be an object.'
76
76
  },
77
77
  properties: {
78
- openId: {
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
- rolesField: {
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: 'App "config.auth.openId.rolesField" should be a string.'
96
+ type: 'Auth adapter "id" should be a string.'
90
97
  }
91
98
  },
92
- logoutRedirectUri: {
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: 'App "config.auth.openId.logoutRedirectUri" should be a string.'
102
+ type: 'Auth adapter "type" should be a string.'
97
103
  }
98
104
  },
99
- scope: {
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: {
122
+ type: 'string',
123
+ default: '/auth/signin'
124
+ },
125
+ signOut: {
100
126
  type: 'string',
101
- description: 'The OpenID Connect scope to request.',
102
- default: 'openid profile email',
103
- errorMessage: {
104
- type: 'App "config.auth.openId.scope" should be a 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 "config.auth.pages.protected.$" should be an array of strings.'
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 "config.auth.pages.protected.$" should be an array of strings.'
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 "config.auth.pages.public.$" should be an array of strings.'
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 "config.auth.pages.public.$" should be an array of strings.'
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 "config.auth.pages.roles.[role]" should be an array of strings.'
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 "config.auth.pages.roles" should be an object.'
267
+ type: 'App "auth.pages.roles" should be an object.'
163
268
  }
164
269
  }
165
270
  }
166
271
  },
167
- jwt: {
168
- type: 'object',
169
- additionalProperties: false,
170
- errorMessage: {
171
- type: 'App "config.auth.jwt" should be an object.'
172
- },
173
- properties: {
174
- expiresIn: {
175
- type: [
176
- 'string',
177
- 'number'
178
- ],
179
- default: '4h',
180
- 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)',
181
- errorMessage: {
182
- type: 'App "config.auth.jwt.expiresIn" should be a string or number.'
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
- loginStateExpiresIn: {
186
- type: [
187
- 'string',
188
- 'number'
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
  },
@@ -232,10 +349,10 @@ export default {
232
349
  type: 'Block "layout" should be an object.'
233
350
  }
234
351
  },
235
- loading: {
352
+ skeleton: {
236
353
  type: 'object',
237
354
  errorMessage: {
238
- type: 'Block "loading" should be an object.'
355
+ type: 'Block "skeleton" should be an object.'
239
356
  }
240
357
  },
241
358
  style: {
@@ -245,6 +362,7 @@ export default {
245
362
  }
246
363
  },
247
364
  visible: {},
365
+ loading: {},
248
366
  blocks: {
249
367
  type: 'array',
250
368
  items: {
@@ -644,9 +762,18 @@ export default {
644
762
  type: 'App "license" should be a string.'
645
763
  }
646
764
  },
765
+ version: {
766
+ type: 'string',
767
+ errorMessage: {
768
+ type: 'App "version" should be a string.'
769
+ }
770
+ },
647
771
  app: {
648
772
  $ref: '#/definitions/app'
649
773
  },
774
+ auth: {
775
+ $ref: '#/definitions/authConfig'
776
+ },
650
777
  cli: {
651
778
  type: 'object',
652
779
  errorMessage: {
@@ -660,9 +787,6 @@ export default {
660
787
  },
661
788
  additionalProperties: false,
662
789
  properties: {
663
- auth: {
664
- $ref: '#/definitions/authConfig'
665
- },
666
790
  basePath: {
667
791
  type: 'string',
668
792
  description: 'App base path to apply to all routes. Base path must start with "/".',
@@ -676,21 +800,6 @@ export default {
676
800
  errorMessage: {
677
801
  type: 'App "config.homePageId" should be a string.'
678
802
  }
679
- },
680
- theme: {
681
- type: 'object',
682
- errorMessage: {
683
- type: 'App "config.theme" should be an object.'
684
- },
685
- properties: {
686
- lessVariables: {
687
- type: 'object',
688
- description: 'App theme less variables.',
689
- errorMessage: {
690
- type: 'App "config.theme.lessVariables" should be an object.'
691
- }
692
- }
693
- }
694
803
  }
695
804
  }
696
805
  },
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
- Copyright 2020-2021 Lowdefy, Inc
3
+ Copyright 2020-2022 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: {},
@@ -59,7 +74,7 @@ async function generateDefaultTypesMap() {
59
74
  };
60
75
  await Promise.all(defaultPackages.map(async (packageName)=>{
61
76
  const { default: types } = await import(`${packageName}/types`);
62
- const version = packageFile.devDependencies[packageName];
77
+ const version = packageFile.devDependencies[packageName] || packageFile.dependencies[packageName];
63
78
  createPluginTypesMap({
64
79
  packageTypes: types,
65
80
  typesMap: defaultTypesMap,
@@ -67,6 +82,9 @@ async function generateDefaultTypesMap() {
67
82
  version
68
83
  });
69
84
  }));
70
- await writeFile(path.resolve(process.cwd(), './dist/defaultTypesMap.json'), JSON.stringify(defaultTypesMap, null, 2));
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();
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
- Copyright 2020-2021 Lowdefy, Inc
3
+ Copyright 2020-2022 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-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.
@@ -1,5 +1,5 @@
1
1
  /*
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.
@@ -1,5 +1,5 @@
1
1
  /*
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.
@@ -1,5 +1,5 @@
1
1
  /*
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.
@@ -1,5 +1,5 @@
1
1
  /*
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.
@@ -17,7 +17,7 @@
17
17
  resolved: true,
18
18
  path,
19
19
  vars,
20
- contextId: context.id
20
+ stage: context.stage
21
21
  };
22
22
  }
23
23
  export default resolver;