@lowdefy/build 3.23.2 → 4.0.0-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.
Files changed (96) hide show
  1. package/dist/build/addDefaultPages/404.js +51 -0
  2. package/dist/build/addDefaultPages/addDefaultPages.js +44 -0
  3. package/dist/build/buildAuth/buildAuth.js +50 -0
  4. package/dist/build/buildAuth/getPageRoles.js +33 -0
  5. package/dist/build/buildAuth/getProtectedPages.js +30 -0
  6. package/dist/build/buildConnections.js +46 -0
  7. package/dist/build/buildIcons.js +91 -0
  8. package/dist/build/buildMenu.js +122 -0
  9. package/dist/build/buildPages/buildBlock/buildBlock.js +35 -0
  10. package/dist/build/buildPages/buildBlock/buildEvents.js +75 -0
  11. package/dist/build/buildPages/buildBlock/buildRequests.js +51 -0
  12. package/dist/build/buildPages/buildBlock/buildSubBlocks.js +35 -0
  13. package/dist/build/buildPages/buildBlock/countBlockOperators.js +31 -0
  14. package/dist/build/buildPages/buildBlock/countBlockTypes.js +18 -0
  15. package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +35 -0
  16. package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +25 -0
  17. package/dist/build/buildPages/buildBlock/setBlockId.js +20 -0
  18. package/dist/build/buildPages/buildBlock/validateBlock.js +38 -0
  19. package/dist/build/buildPages/buildPage.js +50 -0
  20. package/dist/build/buildPages/buildPages.js +33 -0
  21. package/dist/build/buildRefs/buildRefs.js +26 -0
  22. package/dist/build/buildRefs/evaluateBuildOperators.js +35 -0
  23. package/dist/build/buildRefs/getConfigFile.js +28 -0
  24. package/dist/build/buildRefs/getRefContent.js +44 -0
  25. package/dist/build/buildRefs/getRefPath.js +30 -0
  26. package/dist/build/buildRefs/getRefsFromFile.js +37 -0
  27. package/dist/build/buildRefs/getUserJavascriptFunction.js +24 -0
  28. package/dist/build/buildRefs/makeRefDefinition.js +30 -0
  29. package/dist/build/buildRefs/parseNunjucks.js +20 -0
  30. package/dist/build/buildRefs/parseRefContent.js +37 -0
  31. package/dist/build/buildRefs/populateRefs.js +43 -0
  32. package/dist/build/buildRefs/recursiveBuild.js +68 -0
  33. package/dist/build/buildRefs/runRefResolver.js +33 -0
  34. package/dist/build/buildRefs/runTransformer.js +30 -0
  35. package/dist/build/buildStyles.js +29 -0
  36. package/dist/build/buildTypes.js +96 -0
  37. package/dist/build/cleanBuildDirectory.js +19 -0
  38. package/dist/build/copyPublicFolder.js +23 -0
  39. package/dist/build/testSchema.js +34 -0
  40. package/dist/build/updateServerPackageJson.js +46 -0
  41. package/dist/build/validateApp.js +34 -0
  42. package/dist/build/validateConfig.js +57 -0
  43. package/dist/build/writeApp.js +18 -0
  44. package/dist/build/writeConfig.js +18 -0
  45. package/dist/build/writeConnections.js +26 -0
  46. package/dist/build/writeGlobal.js +25 -0
  47. package/dist/build/writeMenus.js +22 -0
  48. package/dist/build/writePages.js +26 -0
  49. package/dist/build/writePluginImports/generateImportFile.js +36 -0
  50. package/dist/build/writePluginImports/writeActionImports.js +22 -0
  51. package/dist/build/writePluginImports/writeBlockImports.js +22 -0
  52. package/dist/build/writePluginImports/writeConnectionImports.js +22 -0
  53. package/dist/build/writePluginImports/writeIconImports.js +31 -0
  54. package/dist/build/writePluginImports/writeOperatorImports.js +26 -0
  55. package/dist/build/writePluginImports/writeStyleImports.js +28 -0
  56. package/dist/build/writeRequests.js +32 -0
  57. package/dist/build/writeTypes.js +18 -0
  58. package/dist/defaultTypesMap.json +1598 -0
  59. package/dist/index.js +197 -1
  60. package/dist/lowdefySchema.js +747 -0
  61. package/dist/scripts/generateDefaultTypes.js +72 -0
  62. package/dist/scripts/run.js +32 -0
  63. package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +22 -0
  64. package/dist/test/buildRefs/testBuildRefsErrorResolver.js +18 -0
  65. package/dist/test/buildRefs/testBuildRefsNullResolver.js +19 -0
  66. package/dist/test/buildRefs/testBuildRefsParsingResolver.js +39 -0
  67. package/dist/test/buildRefs/testBuildRefsResolver.js +23 -0
  68. package/dist/test/buildRefs/testBuildRefsTransform.js +25 -0
  69. package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +21 -0
  70. package/dist/test/testContext.js +48 -0
  71. package/dist/utils/countOperators.js +30 -0
  72. package/dist/utils/createCheckDuplicateId.js +31 -0
  73. package/dist/utils/createCounter.js +33 -0
  74. package/dist/utils/createPluginTypesMap.js +85 -0
  75. package/dist/utils/formatErrorMessage.js +56 -0
  76. package/dist/utils/readConfigFile.js +24 -0
  77. package/dist/utils/writeBuildArtifact.js +23 -0
  78. package/package.json +55 -23
  79. package/dist/138.index.js +0 -2
  80. package/dist/138.index.js.LICENSE.txt +0 -3
  81. package/dist/231.index.js +0 -1
  82. package/dist/319.index.js +0 -1
  83. package/dist/35.index.js +0 -1
  84. package/dist/422.index.js +0 -1
  85. package/dist/443.index.js +0 -1
  86. package/dist/449.index.js +0 -1
  87. package/dist/5.index.js +0 -2
  88. package/dist/5.index.js.LICENSE.txt +0 -1
  89. package/dist/564.index.js +0 -1
  90. package/dist/569.index.js +0 -1
  91. package/dist/625.index.js +0 -1
  92. package/dist/693.index.js +0 -2
  93. package/dist/693.index.js.LICENSE.txt +0 -1
  94. package/dist/734.index.js +0 -1
  95. package/dist/904.index.js +0 -1
  96. package/dist/remoteEntry.js +0 -1
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import generateImportFile from './generateImportFile.js';
16
+ async function writeActionImports({ components , context }) {
17
+ await context.writeBuildArtifact('plugins/actions.js', generateImportFile({
18
+ types: components.types.actions,
19
+ importPath: 'actions'
20
+ }));
21
+ }
22
+ export default writeActionImports;
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import generateImportFile from './generateImportFile.js';
16
+ async function writeBlockImports({ components , context }) {
17
+ await context.writeBuildArtifact('plugins/blocks.js', generateImportFile({
18
+ types: components.types.blocks,
19
+ importPath: 'blocks'
20
+ }));
21
+ }
22
+ export default writeBlockImports;
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import generateImportFile from './generateImportFile.js';
16
+ async function writeConnectionImports({ components , context }) {
17
+ await context.writeBuildArtifact('plugins/connections.js', generateImportFile({
18
+ types: components.types.connections,
19
+ importPath: 'connections'
20
+ }));
21
+ }
22
+ export default writeConnectionImports;
@@ -0,0 +1,31 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { nunjucksFunction } from '@lowdefy/nunjucks';
16
+ const template = `{%- for package in packages -%}
17
+ {% if package.icons.length %}import { {% for icon in package.icons -%}{% if not loop.last -%} {{ icon }}, {% else -%} {{ icon }} } from '{{ package.package }}';
18
+ {% endif -%}{% endfor %}{% endif %}{% endfor -%}
19
+ export default {
20
+ {%- for package in packages -%}
21
+ {%- for icon in package.icons %}
22
+ {{ icon }},{% endfor %}
23
+ {%- endfor %}
24
+ };`;
25
+ async function writeIconImports({ components , context }) {
26
+ const templateFn = nunjucksFunction(template);
27
+ await context.writeBuildArtifact('plugins/icons.js', templateFn({
28
+ packages: components.icons
29
+ }));
30
+ }
31
+ export default writeIconImports;
@@ -0,0 +1,26 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import generateImportFile from './generateImportFile.js';
16
+ async function writeOperatorImports({ components , context }) {
17
+ await context.writeBuildArtifact('plugins/operatorsClient.js', generateImportFile({
18
+ types: components.types.operators.client,
19
+ importPath: 'operators/client'
20
+ }));
21
+ await context.writeBuildArtifact('plugins/operatorsServer.js', generateImportFile({
22
+ types: components.types.operators.server,
23
+ importPath: 'operators/server'
24
+ }));
25
+ }
26
+ export default writeOperatorImports;
@@ -0,0 +1,28 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { nunjucksFunction } from '@lowdefy/nunjucks';
16
+ const template = `@import '@lowdefy/layout/style.less';
17
+ @import '@lowdefy/client/style.less';
18
+ {% for style in styles -%}
19
+ @import '{{ style }}';
20
+ {% endfor -%}
21
+ `;
22
+ async function writeStyleImports({ components , context }) {
23
+ const templateFn = nunjucksFunction(template);
24
+ await context.writeBuildArtifact('plugins/styles.less', templateFn({
25
+ styles: components.styles
26
+ }));
27
+ }
28
+ export default writeStyleImports;
@@ -0,0 +1,32 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ async function writeRequestsOnPage({ page , context }) {
16
+ return Promise.all(page.requests.map(async (request)=>{
17
+ await context.writeBuildArtifact(`pages/${page.pageId}/requests/${request.requestId}.json`, JSON.stringify(request, null, 2));
18
+ delete request.properties;
19
+ delete request.type;
20
+ delete request.connectionId;
21
+ delete request.auth;
22
+ }));
23
+ }
24
+ async function writeRequests({ components , context }) {
25
+ const writePromises = components.pages.map((page)=>writeRequestsOnPage({
26
+ page,
27
+ context
28
+ })
29
+ );
30
+ return Promise.all(writePromises);
31
+ }
32
+ export default writeRequests;
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ async function writeTypes({ components , context }) {
16
+ await context.writeBuildArtifact('types.json', JSON.stringify(components.types, null, 2));
17
+ }
18
+ export default writeTypes;