@lowdefy/build 4.0.0-rc.9 → 4.0.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 (95) hide show
  1. package/dist/build/addDefaultPages/404.js +2 -3
  2. package/dist/build/addDefaultPages/addDefaultPages.js +2 -2
  3. package/dist/build/addKeys.js +56 -14
  4. package/dist/build/{validateApp.js → buildApp.js} +10 -4
  5. package/dist/build/buildAuth/buildAuth.js +17 -2
  6. package/dist/build/buildAuth/buildAuthPlugins.js +5 -5
  7. package/dist/build/buildAuth/buildPageAuth.js +2 -2
  8. package/dist/build/buildAuth/getPageRoles.js +2 -2
  9. package/dist/build/buildAuth/getProtectedPages.js +2 -2
  10. package/dist/build/buildAuth/validateAuthConfig.js +2 -2
  11. package/dist/build/buildConnections.js +2 -2
  12. package/dist/build/buildImports/buildIconImports.js +6 -4
  13. package/dist/build/buildImports/buildImports.js +2 -2
  14. package/dist/build/buildImports/buildImportsDev.js +4 -4
  15. package/dist/build/buildImports/buildImportsProd.js +2 -2
  16. package/dist/build/buildImports/buildStyleImports.js +2 -2
  17. package/dist/build/buildImports/defaultIconsDev.js +1 -1
  18. package/dist/build/buildImports/defaultIconsProd.js +1 -1
  19. package/dist/build/buildMenu.js +4 -4
  20. package/dist/build/buildPages/buildBlock/buildBlock.js +1 -1
  21. package/dist/build/buildPages/buildBlock/buildEvents.js +2 -2
  22. package/dist/build/buildPages/buildBlock/buildRequests.js +2 -2
  23. package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
  24. package/dist/build/buildPages/buildBlock/countBlockOperators.js +3 -3
  25. package/dist/build/buildPages/buildBlock/countBlockTypes.js +2 -2
  26. package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +1 -1
  27. package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
  28. package/dist/build/buildPages/buildBlock/setBlockId.js +2 -2
  29. package/dist/build/buildPages/buildBlock/validateBlock.js +2 -2
  30. package/dist/build/buildPages/buildPage.js +2 -7
  31. package/dist/build/buildPages/buildPages.js +2 -2
  32. package/dist/build/buildPages/buildTestPage.js +2 -2
  33. package/dist/build/buildRefs/buildRefs.js +2 -2
  34. package/dist/build/buildRefs/evaluateBuildOperators.js +3 -3
  35. package/dist/build/buildRefs/getConfigFile.js +2 -2
  36. package/dist/build/buildRefs/getKey.js +2 -2
  37. package/dist/build/buildRefs/getRefContent.js +2 -2
  38. package/dist/build/buildRefs/getRefPath.js +1 -1
  39. package/dist/build/buildRefs/getRefsFromFile.js +1 -1
  40. package/dist/build/buildRefs/getUserJavascriptFunction.js +2 -2
  41. package/dist/build/buildRefs/makeRefDefinition.js +1 -1
  42. package/dist/build/buildRefs/parseNunjucks.js +1 -1
  43. package/dist/build/buildRefs/parseRefContent.js +3 -3
  44. package/dist/build/buildRefs/populateRefs.js +2 -2
  45. package/dist/build/buildRefs/recursiveBuild.js +3 -3
  46. package/dist/build/buildRefs/runRefResolver.js +2 -2
  47. package/dist/build/buildRefs/runTransformer.js +2 -2
  48. package/dist/build/buildTypes.js +13 -5
  49. package/dist/build/cleanBuildDirectory.js +2 -2
  50. package/dist/build/copyPublicFolder.js +2 -2
  51. package/dist/build/testSchema.js +3 -3
  52. package/dist/build/updateServerPackageJson.js +2 -2
  53. package/dist/build/validateConfig.js +2 -2
  54. package/dist/build/writeApp.js +3 -5
  55. package/dist/build/writeAuth.js +3 -5
  56. package/dist/build/writeConfig.js +3 -5
  57. package/dist/build/writeConnections.js +3 -5
  58. package/dist/build/writeGlobal.js +3 -5
  59. package/dist/build/writeMaps.js +4 -8
  60. package/dist/build/writeMenus.js +3 -5
  61. package/dist/build/writePages.js +4 -6
  62. package/dist/build/writePluginImports/generateImportFile.js +2 -2
  63. package/dist/build/writePluginImports/writeActionImports.js +2 -2
  64. package/dist/build/writePluginImports/writeAuthImports.js +2 -2
  65. package/dist/build/writePluginImports/writeBlockImports.js +2 -2
  66. package/dist/build/writePluginImports/writeConnectionImports.js +2 -2
  67. package/dist/build/writePluginImports/writeIconImports.js +2 -2
  68. package/dist/build/writePluginImports/writeOperatorImports.js +2 -2
  69. package/dist/build/writePluginImports/writePluginImports.js +2 -2
  70. package/dist/build/writePluginImports/writeStyleImports.js +2 -2
  71. package/dist/build/writeRequests.js +4 -6
  72. package/dist/build/writeTypes.js +3 -5
  73. package/dist/createContext.js +3 -2
  74. package/dist/defaultTypesMap.js +673 -632
  75. package/dist/index.js +3 -3
  76. package/dist/lowdefySchema.js +18 -0
  77. package/dist/scripts/generateDefaultTypes.js +3 -2
  78. package/dist/scripts/run.js +6 -6
  79. package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +1 -1
  80. package/dist/test/buildRefs/testBuildRefsErrorResolver.js +1 -1
  81. package/dist/test/buildRefs/testBuildRefsNullResolver.js +1 -1
  82. package/dist/test/buildRefs/testBuildRefsParsingResolver.js +1 -1
  83. package/dist/test/buildRefs/testBuildRefsResolver.js +1 -1
  84. package/dist/test/buildRefs/testBuildRefsTransform.js +1 -1
  85. package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +1 -1
  86. package/dist/test/testContext.js +5 -2
  87. package/dist/utils/countOperators.js +2 -2
  88. package/dist/utils/createCheckDuplicateId.js +5 -5
  89. package/dist/utils/createCounter.js +1 -1
  90. package/dist/utils/createPluginTypesMap.js +3 -3
  91. package/dist/utils/formatErrorMessage.js +4 -4
  92. package/dist/utils/makeId.js +5 -2
  93. package/dist/utils/readConfigFile.js +2 -2
  94. package/dist/utils/writeBuildArtifact.js +2 -2
  95. package/package.json +52 -53
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import generateImportFile from './generateImportFile.js';
16
- async function writeActionImports({ components , context }) {
16
+ async function writeActionImports({ components, context }) {
17
17
  await context.writeBuildArtifact('plugins/actions.js', generateImportFile({
18
18
  imports: components.imports.actions,
19
19
  importPath: 'actions'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import generateImportFile from './generateImportFile.js';
16
- async function writeAuthImports({ components , context }) {
16
+ async function writeAuthImports({ components, context }) {
17
17
  await context.writeBuildArtifact('plugins/auth/adapters.js', generateImportFile({
18
18
  imports: components.imports.auth.adapters,
19
19
  importPath: 'auth/adapters'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import generateImportFile from './generateImportFile.js';
16
- async function writeBlockImports({ components , context }) {
16
+ async function writeBlockImports({ components, context }) {
17
17
  await context.writeBuildArtifact('plugins/blocks.js', generateImportFile({
18
18
  imports: components.imports.blocks,
19
19
  importPath: 'blocks'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import generateImportFile from './generateImportFile.js';
16
- async function writeConnectionImports({ components , context }) {
16
+ async function writeConnectionImports({ components, context }) {
17
17
  await context.writeBuildArtifact('plugins/connections.js', generateImportFile({
18
18
  imports: components.imports.connections,
19
19
  importPath: 'connections'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -22,7 +22,7 @@ export default {
22
22
  {{ icon }},{% endfor %}
23
23
  {%- endfor %}
24
24
  };`;
25
- async function writeIconImports({ components , context }) {
25
+ async function writeIconImports({ components, context }) {
26
26
  const templateFn = nunjucksFunction(template);
27
27
  await context.writeBuildArtifact('plugins/icons.js', templateFn({
28
28
  packages: components.imports.icons
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import generateImportFile from './generateImportFile.js';
16
- async function writeOperatorImports({ components , context }) {
16
+ async function writeOperatorImports({ components, context }) {
17
17
  await context.writeBuildArtifact('plugins/operators/client.js', generateImportFile({
18
18
  imports: components.imports.operators.client,
19
19
  importPath: 'operators/client'
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -19,7 +19,7 @@ import writeConnectionImports from './writeConnectionImports.js';
19
19
  import writeIconImports from './writeIconImports.js';
20
20
  import writeOperatorImports from './writeOperatorImports.js';
21
21
  import writeStyleImports from './writeStyleImports.js';
22
- async function writePluginImports({ components , context }) {
22
+ async function writePluginImports({ components, context }) {
23
23
  await writeActionImports({
24
24
  components,
25
25
  context
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -24,7 +24,7 @@ const template = `@import '@lowdefy/layout/style.less';
24
24
  @import '../../public/styles.less';
25
25
  {% endif %}
26
26
  `;
27
- async function writeStyleImports({ components , context }) {
27
+ async function writeStyleImports({ components, context }) {
28
28
  const templateFn = nunjucksFunction(template);
29
29
  await context.writeBuildArtifact('plugins/styles.less', templateFn({
30
30
  styles: components.imports.styles,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,18 +13,16 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { serializer } from '@lowdefy/helpers';
16
- async function writeRequestsOnPage({ page , context }) {
16
+ async function writeRequestsOnPage({ page, context }) {
17
17
  return Promise.all(page.requests.map(async (request)=>{
18
- await context.writeBuildArtifact(`pages/${page.pageId}/requests/${request.requestId}.json`, serializer.serializeToString(request ?? {}, {
19
- space: 2
20
- }));
18
+ await context.writeBuildArtifact(`pages/${page.pageId}/requests/${request.requestId}.json`, serializer.serializeToString(request ?? {}));
21
19
  delete request.properties;
22
20
  delete request.type;
23
21
  delete request.connectionId;
24
22
  delete request.auth;
25
23
  }));
26
24
  }
27
- async function writeRequests({ components , context }) {
25
+ async function writeRequests({ components, context }) {
28
26
  const writePromises = components.pages.map((page)=>writeRequestsOnPage({
29
27
  page,
30
28
  context
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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.
@@ -13,9 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { serializer } from '@lowdefy/helpers';
16
- async function writeTypes({ components , context }) {
17
- await context.writeBuildArtifact('types.json', serializer.serializeToString(components.types ?? {}, {
18
- space: 2
19
- }));
16
+ async function writeTypes({ components, context }) {
17
+ await context.writeBuildArtifact('types.json', serializer.serializeToString(components.types ?? {}));
20
18
  }
21
19
  export default writeTypes;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-console */ /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,9 +17,10 @@ import createCounter from './utils/createCounter.js';
17
17
  import createReadConfigFile from './utils/readConfigFile.js';
18
18
  import createWriteBuildArtifact from './utils/writeBuildArtifact.js';
19
19
  import defaultTypesMap from './defaultTypesMap.js';
20
- function createContext({ customTypesMap , directories , logger , refResolver , stage ='prod' }) {
20
+ function createContext({ customTypesMap, directories, entitlements = [], logger, refResolver, stage = 'prod' }) {
21
21
  const context = {
22
22
  directories,
23
+ entitlements,
23
24
  keyMap: {},
24
25
  logger,
25
26
  readConfigFile: createReadConfigFile({