@lowdefy/build 4.5.2 → 4.6.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.
- package/dist/build/addDefaultPages/404.js +1 -1
- package/dist/build/addDefaultPages/addDefaultPages.js +10 -4
- package/dist/build/addKeys.js +85 -29
- package/dist/build/buildApi/buildApi.js +27 -8
- package/dist/build/buildApi/buildEndpoint.js +7 -1
- package/dist/build/buildApi/buildRoutine/buildControl.js +1 -1
- package/dist/build/buildApi/buildRoutine/buildRoutine.js +1 -1
- package/dist/build/buildApi/buildRoutine/buildStep.js +1 -1
- package/dist/build/buildApi/buildRoutine/controlTypes.js +34 -11
- package/dist/build/buildApi/buildRoutine/countControl.js +1 -1
- package/dist/build/buildApi/buildRoutine/countStepTypes.js +2 -2
- package/dist/build/buildApi/buildRoutine/setStepId.js +1 -1
- package/dist/build/buildApi/buildRoutine/validateStep.js +30 -9
- package/dist/build/buildApi/validateEndpoint.js +36 -7
- package/dist/build/buildApi/validateStepReferences.js +65 -0
- package/dist/build/buildApp.js +1 -1
- package/dist/build/buildAuth/buildApiAuth.js +7 -3
- package/dist/build/buildAuth/buildAuth.js +7 -4
- package/dist/build/buildAuth/buildAuthPlugins.js +42 -13
- package/dist/build/buildAuth/buildPageAuth.js +14 -3
- package/dist/build/buildAuth/getApiRoles.js +1 -1
- package/dist/build/buildAuth/getPageRoles.js +1 -1
- package/dist/build/buildAuth/getProtectedApi.js +1 -1
- package/dist/build/buildAuth/getProtectedPages.js +1 -1
- package/dist/build/buildAuth/validateAuthConfig.js +39 -5
- package/dist/build/buildAuth/validateMutualExclusivity.js +13 -5
- package/dist/build/buildConnections.js +23 -24
- package/dist/build/buildImports/buildIconImports.js +1 -1
- package/dist/build/buildImports/buildImports.js +1 -1
- package/dist/build/buildImports/buildImportsDev.js +1 -1
- package/dist/build/buildImports/buildImportsProd.js +1 -1
- package/dist/build/buildImports/buildStyleImports.js +1 -1
- package/dist/build/buildImports/defaultIconsDev.js +1 -1
- package/dist/build/buildImports/defaultIconsProd.js +1 -1
- package/dist/build/buildJs/generateJsFile.js +1 -1
- package/dist/build/buildJs/jsMapParser.js +1 -1
- package/dist/build/buildJs/writeJs.js +1 -1
- package/dist/build/buildLogger.js +41 -0
- package/dist/build/buildMenu.js +36 -12
- package/dist/build/buildPages/buildBlock/buildBlock.js +1 -1
- package/dist/build/buildPages/buildBlock/buildEvents.js +79 -9
- package/dist/build/buildPages/buildBlock/buildRequests.js +38 -8
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +6 -2
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +2 -2
- package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +6 -2
- package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +6 -2
- package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
- package/dist/build/buildPages/buildBlock/validateBlock.js +25 -7
- package/dist/build/buildPages/buildPage.js +35 -6
- package/dist/build/buildPages/validateLinkReferences.js +33 -0
- package/dist/build/buildPages/validatePayloadReferences.js +59 -0
- package/dist/build/buildPages/validateRequestReferences.js +33 -0
- package/dist/build/buildPages/validateServerStateReferences.js +41 -0
- package/dist/build/buildPages/validateStateReferences.js +79 -0
- package/dist/build/buildRefs/buildRefs.js +20 -3
- package/dist/build/buildRefs/createRefReviver.js +28 -0
- package/dist/build/buildRefs/evaluateBuildOperators.js +26 -7
- package/dist/build/buildRefs/evaluateStaticOperators.js +56 -0
- package/dist/build/buildRefs/getConfigFile.js +25 -6
- package/dist/build/buildRefs/getKey.js +1 -1
- package/dist/build/buildRefs/getRefContent.js +1 -1
- package/dist/build/buildRefs/getRefPath.js +1 -1
- package/dist/build/buildRefs/getRefsFromFile.js +9 -4
- package/dist/build/buildRefs/getUserJavascriptFunction.js +18 -4
- package/dist/build/buildRefs/makeRefDefinition.js +10 -5
- package/dist/build/buildRefs/parseNunjucks.js +1 -1
- package/dist/build/buildRefs/parseRefContent.js +100 -6
- package/dist/build/buildRefs/populateRefs.js +75 -13
- package/dist/build/buildRefs/recursiveBuild.js +66 -18
- package/dist/build/buildRefs/runRefResolver.js +11 -3
- package/dist/build/buildRefs/runTransformer.js +7 -3
- package/dist/build/buildTypes.js +22 -7
- package/dist/build/cleanBuildDirectory.js +1 -1
- package/dist/build/collectDynamicIdentifiers.js +35 -0
- package/dist/build/collectTypeNames.js +36 -0
- package/dist/build/copyPublicFolder.js +1 -1
- package/dist/build/{buildJs → full}/buildJs.js +3 -3
- package/dist/build/full/buildPages.js +87 -0
- package/dist/build/{buildPages → full}/buildTestPage.js +15 -3
- package/dist/build/{updateServerPackageJson.js → full/updateServerPackageJson.js} +1 -1
- package/dist/build/{writePages.js → full/writePages.js} +1 -1
- package/dist/build/{writeRequests.js → full/writeRequests.js} +11 -3
- package/dist/build/{writeTypes.js → full/writeTypes.js} +1 -1
- package/dist/build/jit/addInstalledTypes.js +51 -0
- package/dist/build/jit/buildJsShallow.js +41 -0
- package/dist/build/jit/buildPageJit.js +252 -0
- package/dist/build/jit/buildShallowPages.js +90 -0
- package/dist/build/jit/createPageRegistry.js +80 -0
- package/dist/build/jit/detectMissingPluginPackages.js +62 -0
- package/dist/build/jit/getRefPositions.js +38 -0
- package/dist/build/jit/isPageContentPath.js +24 -0
- package/dist/build/jit/pageContentKeys.js +26 -0
- package/dist/build/jit/shallowBuild.js +245 -0
- package/dist/build/jit/stripPageContent.js +23 -0
- package/dist/build/jit/updateServerPackageJsonJit.js +33 -0
- package/dist/build/jit/validatePageTypes.js +73 -0
- package/dist/build/jit/writePageJit.js +44 -0
- package/dist/build/jit/writePageRegistry.js +23 -0
- package/dist/build/jit/writeSourcelessPages.js +23 -0
- package/dist/build/testSchema.js +45 -7
- package/dist/build/validateConfig.js +2 -2
- package/dist/build/validateOperatorsDynamic.js +28 -0
- package/dist/build/writeApi.js +1 -1
- package/dist/build/writeApp.js +1 -1
- package/dist/build/writeAuth.js +1 -1
- package/dist/build/writeConfig.js +1 -1
- package/dist/build/writeConnections.js +1 -1
- package/dist/build/writeGlobal.js +1 -1
- package/dist/build/writeLogger.js +19 -0
- package/dist/build/writeMaps.js +1 -1
- package/dist/build/writeMenus.js +1 -1
- package/dist/build/writePluginImports/generateImportFile.js +1 -1
- package/dist/build/writePluginImports/writeActionImports.js +1 -1
- package/dist/build/writePluginImports/writeActionSchemaMap.js +42 -0
- package/dist/build/writePluginImports/writeAuthImports.js +1 -1
- package/dist/build/writePluginImports/writeBlockImports.js +1 -1
- package/dist/build/writePluginImports/writeBlockSchemaMap.js +42 -0
- package/dist/build/writePluginImports/writeConnectionImports.js +1 -1
- package/dist/build/writePluginImports/writeIconImports.js +1 -1
- package/dist/build/writePluginImports/writeOperatorImports.js +1 -1
- package/dist/build/writePluginImports/writeOperatorSchemaMap.js +49 -0
- package/dist/build/writePluginImports/writePluginImports.js +16 -1
- package/dist/build/writePluginImports/writeStyleImports.js +1 -1
- package/dist/createContext.js +16 -4
- package/dist/defaultTypesMap.js +479 -457
- package/dist/index.js +188 -127
- package/dist/indexDev.js +18 -0
- package/dist/lowdefySchema.js +589 -0
- package/dist/scripts/generateDefaultTypes.js +2 -1
- package/dist/scripts/run.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsAsyncFunction.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsErrorResolver.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsNullResolver.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsParsingResolver.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsResolver.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsTransform.js +1 -1
- package/dist/{test → test-utils}/buildRefs/testBuildRefsTransformIdentity.js +1 -1
- package/dist/test-utils/buildRefs/testJitPageResolver.js +24 -0
- package/dist/test-utils/createTestLogger.js +36 -0
- package/dist/test-utils/parseTestYaml.js +126 -0
- package/dist/test-utils/runBuild.js +228 -0
- package/dist/test-utils/runBuildForSnapshots.js +704 -0
- package/dist/{test → test-utils}/testContext.js +12 -2
- package/dist/utils/collectExceptions.js +34 -0
- package/dist/utils/countOperators.js +31 -12
- package/dist/utils/createBuildHandleError.js +38 -0
- package/dist/utils/createCheckDuplicateId.js +15 -9
- package/dist/utils/createCounter.js +16 -3
- package/dist/utils/createHandleWarning.js +41 -0
- package/dist/utils/createPluginTypesMap.js +1 -1
- package/dist/utils/extractOperatorKey.js +36 -0
- package/dist/utils/findConfigKey.js +37 -0
- package/dist/utils/findSimilarString.js +53 -0
- package/dist/utils/logCollectedErrors.js +30 -0
- package/dist/utils/makeId.js +13 -8
- package/dist/utils/preserveMetaProperties.js +27 -0
- package/dist/utils/readConfigFile.js +1 -1
- package/dist/utils/setNonEnumerableProperty.js +23 -0
- package/dist/utils/traverseConfig.js +43 -0
- package/dist/utils/tryBuildStep.js +46 -0
- package/dist/utils/writeBuildArtifact.js +1 -1
- package/package.json +46 -41
- package/dist/build/buildPages/buildPages.js +0 -31
- package/dist/utils/formatErrorMessage.js +0 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/build",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -38,20 +38,22 @@
|
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|
|
40
40
|
".": "./dist/index.js",
|
|
41
|
-
"./
|
|
41
|
+
"./dev": "./dist/indexDev.js",
|
|
42
|
+
"./buildTestPage": "./dist/build/full/buildTestPage.js"
|
|
42
43
|
},
|
|
43
44
|
"files": [
|
|
44
45
|
"dist/*"
|
|
45
46
|
],
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@lowdefy/ajv": "4.
|
|
48
|
-
"@lowdefy/blocks-basic": "4.
|
|
49
|
-
"@lowdefy/blocks-loaders": "4.
|
|
50
|
-
"@lowdefy/
|
|
51
|
-
"@lowdefy/
|
|
52
|
-
"@lowdefy/
|
|
53
|
-
"@lowdefy/
|
|
54
|
-
"@lowdefy/operators
|
|
48
|
+
"@lowdefy/ajv": "4.6.0",
|
|
49
|
+
"@lowdefy/blocks-basic": "4.6.0",
|
|
50
|
+
"@lowdefy/blocks-loaders": "4.6.0",
|
|
51
|
+
"@lowdefy/errors": "4.6.0",
|
|
52
|
+
"@lowdefy/helpers": "4.6.0",
|
|
53
|
+
"@lowdefy/node-utils": "4.6.0",
|
|
54
|
+
"@lowdefy/nunjucks": "4.6.0",
|
|
55
|
+
"@lowdefy/operators": "4.6.0",
|
|
56
|
+
"@lowdefy/operators-js": "4.6.0",
|
|
55
57
|
"ajv": "8.12.0",
|
|
56
58
|
"json5": "2.2.3",
|
|
57
59
|
"yaml": "2.3.4",
|
|
@@ -59,40 +61,43 @@
|
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@jest/globals": "28.1.3",
|
|
62
|
-
"@lowdefy/actions-core": "4.
|
|
63
|
-
"@lowdefy/actions-pdf-make": "4.
|
|
64
|
-
"@lowdefy/blocks-aggrid": "4.
|
|
65
|
-
"@lowdefy/blocks-algolia": "4.
|
|
66
|
-
"@lowdefy/blocks-antd": "4.
|
|
67
|
-
"@lowdefy/blocks-color-selectors": "4.
|
|
68
|
-
"@lowdefy/blocks-echarts": "4.
|
|
69
|
-
"@lowdefy/blocks-google-maps": "4.
|
|
70
|
-
"@lowdefy/blocks-markdown": "4.
|
|
71
|
-
"@lowdefy/blocks-qr": "4.
|
|
72
|
-
"@lowdefy/connection-axios-http": "4.
|
|
73
|
-
"@lowdefy/connection-elasticsearch": "4.
|
|
74
|
-
"@lowdefy/connection-
|
|
75
|
-
"@lowdefy/connection-
|
|
76
|
-
"@lowdefy/connection-
|
|
77
|
-
"@lowdefy/connection-
|
|
78
|
-
"@lowdefy/connection-
|
|
79
|
-
"@lowdefy/connection-
|
|
80
|
-
"@lowdefy/
|
|
81
|
-
"@lowdefy/operators-
|
|
82
|
-
"@lowdefy/operators-
|
|
83
|
-
"@lowdefy/operators-
|
|
84
|
-
"@lowdefy/operators-
|
|
85
|
-
"@lowdefy/operators-
|
|
86
|
-
"@lowdefy/operators-
|
|
87
|
-
"@lowdefy/operators-
|
|
88
|
-
"@lowdefy/
|
|
89
|
-
"@lowdefy/plugin-
|
|
90
|
-
"@lowdefy/plugin-
|
|
91
|
-
"@lowdefy/plugin-
|
|
64
|
+
"@lowdefy/actions-core": "4.6.0",
|
|
65
|
+
"@lowdefy/actions-pdf-make": "4.6.0",
|
|
66
|
+
"@lowdefy/blocks-aggrid": "4.6.0",
|
|
67
|
+
"@lowdefy/blocks-algolia": "4.6.0",
|
|
68
|
+
"@lowdefy/blocks-antd": "4.6.0",
|
|
69
|
+
"@lowdefy/blocks-color-selectors": "4.6.0",
|
|
70
|
+
"@lowdefy/blocks-echarts": "4.6.0",
|
|
71
|
+
"@lowdefy/blocks-google-maps": "4.6.0",
|
|
72
|
+
"@lowdefy/blocks-markdown": "4.6.0",
|
|
73
|
+
"@lowdefy/blocks-qr": "4.6.0",
|
|
74
|
+
"@lowdefy/connection-axios-http": "4.6.0",
|
|
75
|
+
"@lowdefy/connection-elasticsearch": "4.6.0",
|
|
76
|
+
"@lowdefy/connection-test": "4.6.0",
|
|
77
|
+
"@lowdefy/connection-google-sheets": "4.6.0",
|
|
78
|
+
"@lowdefy/connection-knex": "4.6.0",
|
|
79
|
+
"@lowdefy/connection-mongodb": "4.6.0",
|
|
80
|
+
"@lowdefy/connection-redis": "4.6.0",
|
|
81
|
+
"@lowdefy/connection-sendgrid": "4.6.0",
|
|
82
|
+
"@lowdefy/connection-stripe": "4.6.0",
|
|
83
|
+
"@lowdefy/operators-change-case": "4.6.0",
|
|
84
|
+
"@lowdefy/operators-diff": "4.6.0",
|
|
85
|
+
"@lowdefy/operators-jsonata": "4.6.0",
|
|
86
|
+
"@lowdefy/operators-moment": "4.6.0",
|
|
87
|
+
"@lowdefy/operators-mql": "4.6.0",
|
|
88
|
+
"@lowdefy/operators-nunjucks": "4.6.0",
|
|
89
|
+
"@lowdefy/operators-uuid": "4.6.0",
|
|
90
|
+
"@lowdefy/operators-yaml": "4.6.0",
|
|
91
|
+
"@lowdefy/plugin-auth0": "4.6.0",
|
|
92
|
+
"@lowdefy/plugin-aws": "4.6.0",
|
|
93
|
+
"@lowdefy/plugin-csv": "4.6.0",
|
|
94
|
+
"@lowdefy/plugin-next-auth": "4.6.0",
|
|
92
95
|
"@swc/cli": "0.1.63",
|
|
93
96
|
"@swc/core": "1.3.99",
|
|
94
97
|
"@swc/jest": "0.2.29",
|
|
95
|
-
"
|
|
98
|
+
"@lowdefy/logger": "4.6.0",
|
|
99
|
+
"jest": "28.1.3",
|
|
100
|
+
"pino": "8.16.2"
|
|
96
101
|
},
|
|
97
102
|
"publishConfig": {
|
|
98
103
|
"access": "public"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-2024 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 { type } from '@lowdefy/helpers';
|
|
16
|
-
import buildPage from './buildPage.js';
|
|
17
|
-
import createCheckDuplicateId from '../../utils/createCheckDuplicateId.js';
|
|
18
|
-
function buildPages({ components, context }) {
|
|
19
|
-
const pages = type.isArray(components.pages) ? components.pages : [];
|
|
20
|
-
const checkDuplicatePageId = createCheckDuplicateId({
|
|
21
|
-
message: 'Duplicate pageId "{{ id }}".'
|
|
22
|
-
});
|
|
23
|
-
pages.map((page, index)=>buildPage({
|
|
24
|
-
page,
|
|
25
|
-
index,
|
|
26
|
-
context,
|
|
27
|
-
checkDuplicatePageId
|
|
28
|
-
}));
|
|
29
|
-
return components;
|
|
30
|
-
}
|
|
31
|
-
export default buildPages;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2024 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 { get, type } from '@lowdefy/helpers';
|
|
16
|
-
function formatArrayKey({ index, object }) {
|
|
17
|
-
if (type.isObject(object) && (!type.isNone(object.id) || !type.isNone(object.type))) {
|
|
18
|
-
const objectId = type.isNone(object.id) ? '_ERROR_MISSING_ID_' : object.id;
|
|
19
|
-
const objectType = type.isNone(object.type) ? '_ERROR_MISSING_TYPE_' : object.type;
|
|
20
|
-
return `[${index}:${objectId}:${objectType}]`;
|
|
21
|
-
}
|
|
22
|
-
return `[${index}]`;
|
|
23
|
-
}
|
|
24
|
-
function recursiveFormatPath({ data, instancePath, formattedPath = '', gap = '', root = false }) {
|
|
25
|
-
if (instancePath.length === 0) return formattedPath;
|
|
26
|
-
const key = instancePath.shift();
|
|
27
|
-
const newData = get(data, key);
|
|
28
|
-
let newPath;
|
|
29
|
-
if (type.isArray(data)) {
|
|
30
|
-
gap += ' ';
|
|
31
|
-
newPath = `${formattedPath}
|
|
32
|
-
${gap}- ${formatArrayKey({
|
|
33
|
-
index: key,
|
|
34
|
-
object: newData
|
|
35
|
-
})}`;
|
|
36
|
-
} else {
|
|
37
|
-
newPath = `${formattedPath}${root ? '- ' : '.'}${key}`;
|
|
38
|
-
}
|
|
39
|
-
return recursiveFormatPath({
|
|
40
|
-
data: newData,
|
|
41
|
-
instancePath,
|
|
42
|
-
formattedPath: newPath,
|
|
43
|
-
gap
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function formatErrorMessage({ error, components }) {
|
|
47
|
-
const formattedPath = recursiveFormatPath({
|
|
48
|
-
data: components,
|
|
49
|
-
instancePath: error.instancePath.split('/').slice(1),
|
|
50
|
-
root: true
|
|
51
|
-
});
|
|
52
|
-
return `Schema Error
|
|
53
|
-
${error.message}
|
|
54
|
-
${formattedPath}`;
|
|
55
|
-
}
|
|
56
|
-
export default formatErrorMessage;
|