@lowdefy/build 4.0.0-rc.9 → 4.0.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 +2 -3
- package/dist/build/addDefaultPages/addDefaultPages.js +2 -2
- package/dist/build/addKeys.js +56 -14
- package/dist/build/{validateApp.js → buildApp.js} +10 -4
- package/dist/build/buildAuth/buildAuth.js +17 -2
- package/dist/build/buildAuth/buildAuthPlugins.js +5 -5
- package/dist/build/buildAuth/buildPageAuth.js +2 -2
- package/dist/build/buildAuth/getPageRoles.js +2 -2
- package/dist/build/buildAuth/getProtectedPages.js +2 -2
- package/dist/build/buildAuth/validateAuthConfig.js +2 -2
- package/dist/build/buildConnections.js +2 -2
- package/dist/build/buildImports/buildIconImports.js +6 -4
- package/dist/build/buildImports/buildImports.js +2 -2
- package/dist/build/buildImports/buildImportsDev.js +4 -4
- package/dist/build/buildImports/buildImportsProd.js +2 -2
- package/dist/build/buildImports/buildStyleImports.js +2 -2
- package/dist/build/buildImports/defaultIconsDev.js +1 -1
- package/dist/build/buildImports/defaultIconsProd.js +1 -1
- package/dist/build/buildMenu.js +4 -4
- package/dist/build/buildPages/buildBlock/buildBlock.js +1 -1
- package/dist/build/buildPages/buildBlock/buildEvents.js +2 -2
- package/dist/build/buildPages/buildBlock/buildRequests.js +2 -2
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +3 -3
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +2 -2
- package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/setBlockId.js +2 -2
- package/dist/build/buildPages/buildBlock/validateBlock.js +2 -2
- package/dist/build/buildPages/buildPage.js +2 -7
- package/dist/build/buildPages/buildPages.js +2 -2
- package/dist/build/buildPages/buildTestPage.js +2 -2
- package/dist/build/buildRefs/buildRefs.js +2 -2
- package/dist/build/buildRefs/evaluateBuildOperators.js +3 -3
- package/dist/build/buildRefs/getConfigFile.js +2 -2
- package/dist/build/buildRefs/getKey.js +2 -2
- package/dist/build/buildRefs/getRefContent.js +2 -2
- package/dist/build/buildRefs/getRefPath.js +1 -1
- package/dist/build/buildRefs/getRefsFromFile.js +1 -1
- package/dist/build/buildRefs/getUserJavascriptFunction.js +2 -2
- package/dist/build/buildRefs/makeRefDefinition.js +1 -1
- package/dist/build/buildRefs/parseNunjucks.js +1 -1
- package/dist/build/buildRefs/parseRefContent.js +3 -3
- package/dist/build/buildRefs/populateRefs.js +2 -2
- package/dist/build/buildRefs/recursiveBuild.js +3 -3
- package/dist/build/buildRefs/runRefResolver.js +2 -2
- package/dist/build/buildRefs/runTransformer.js +2 -2
- package/dist/build/buildTypes.js +13 -5
- package/dist/build/cleanBuildDirectory.js +2 -2
- package/dist/build/copyPublicFolder.js +2 -2
- package/dist/build/testSchema.js +3 -3
- package/dist/build/updateServerPackageJson.js +2 -2
- package/dist/build/validateConfig.js +2 -2
- package/dist/build/writeApp.js +3 -5
- package/dist/build/writeAuth.js +3 -5
- package/dist/build/writeConfig.js +3 -5
- package/dist/build/writeConnections.js +3 -5
- package/dist/build/writeGlobal.js +3 -5
- package/dist/build/writeMaps.js +4 -8
- package/dist/build/writeMenus.js +3 -5
- package/dist/build/writePages.js +4 -6
- package/dist/build/writePluginImports/generateImportFile.js +2 -2
- package/dist/build/writePluginImports/writeActionImports.js +2 -2
- package/dist/build/writePluginImports/writeAuthImports.js +2 -2
- 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 +2 -2
- package/dist/build/writePluginImports/writePluginImports.js +2 -2
- package/dist/build/writePluginImports/writeStyleImports.js +2 -2
- package/dist/build/writeRequests.js +4 -6
- package/dist/build/writeTypes.js +3 -5
- package/dist/createContext.js +3 -2
- package/dist/defaultTypesMap.js +685 -644
- package/dist/index.js +3 -3
- package/dist/lowdefySchema.js +18 -0
- package/dist/scripts/generateDefaultTypes.js +3 -2
- package/dist/scripts/run.js +6 -6
- 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 +1 -1
- package/dist/test/buildRefs/testBuildRefsTransform.js +1 -1
- package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +1 -1
- package/dist/test/testContext.js +5 -2
- package/dist/utils/countOperators.js +2 -2
- package/dist/utils/createCheckDuplicateId.js +5 -5
- package/dist/utils/createCounter.js +1 -1
- package/dist/utils/createPluginTypesMap.js +3 -3
- package/dist/utils/formatErrorMessage.js +4 -4
- package/dist/utils/makeId.js +5 -2
- package/dist/utils/readConfigFile.js +2 -2
- package/dist/utils/writeBuildArtifact.js +2 -2
- package/package.json +52 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import buildBlock from './buildBlock/buildBlock.js';
|
|
17
17
|
import createCheckDuplicateId from '../../utils/createCheckDuplicateId.js';
|
|
18
18
|
import createCounter from '../../utils/createCounter.js';
|
|
19
|
-
function buildPage({ page
|
|
19
|
+
function buildPage({ page, index, context, checkDuplicatePageId }) {
|
|
20
20
|
if (type.isUndefined(page.id)) {
|
|
21
21
|
throw new Error(`Page id missing at page ${index}.`);
|
|
22
22
|
}
|
|
@@ -28,14 +28,12 @@ function buildPage({ page , index , context , checkDuplicatePageId }) {
|
|
|
28
28
|
});
|
|
29
29
|
page.pageId = page.id;
|
|
30
30
|
const requests = [];
|
|
31
|
-
const operators = new Set();
|
|
32
31
|
buildBlock(page, {
|
|
33
32
|
auth: page.auth,
|
|
34
33
|
blockIdCounter: createCounter(),
|
|
35
34
|
checkDuplicateRequestId: createCheckDuplicateId({
|
|
36
35
|
message: 'Duplicate requestId "{{ id }}" on page "{{ pageId }}".'
|
|
37
36
|
}),
|
|
38
|
-
operators,
|
|
39
37
|
pageId: page.pageId,
|
|
40
38
|
requests,
|
|
41
39
|
typeCounters: context.typeCounters
|
|
@@ -43,8 +41,5 @@ function buildPage({ page , index , context , checkDuplicatePageId }) {
|
|
|
43
41
|
// set page.id since buildBlock sets id as well.
|
|
44
42
|
page.id = `page:${page.pageId}`;
|
|
45
43
|
page.requests = requests;
|
|
46
|
-
page.operators = [
|
|
47
|
-
...operators
|
|
48
|
-
];
|
|
49
44
|
}
|
|
50
45
|
export default buildPage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import buildPage from './buildPage.js';
|
|
17
17
|
import createCheckDuplicateId from '../../utils/createCheckDuplicateId.js';
|
|
18
|
-
function buildPages({ components
|
|
18
|
+
function buildPages({ components, context }) {
|
|
19
19
|
const pages = type.isArray(components.pages) ? components.pages : [];
|
|
20
20
|
const checkDuplicatePageId = createCheckDuplicateId({
|
|
21
21
|
message: 'Duplicate pageId "{{ id }}".'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import buildAuth from '../buildAuth/buildAuth.js';
|
|
17
17
|
import buildPages from './buildPages.js';
|
|
18
18
|
import createContext from '../../createContext.js';
|
|
19
|
-
function buildTestPage({ pageConfig
|
|
19
|
+
function buildTestPage({ pageConfig }) {
|
|
20
20
|
const context = createContext({
|
|
21
21
|
customTypesMap: {},
|
|
22
22
|
directories: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import recursiveBuild from './recursiveBuild.js';
|
|
16
16
|
import makeRefDefinition from './makeRefDefinition.js';
|
|
17
17
|
import evaluateBuildOperators from './evaluateBuildOperators.js';
|
|
18
|
-
async function buildRefs({ context
|
|
18
|
+
async function buildRefs({ context }) {
|
|
19
19
|
const refDef = makeRefDefinition('lowdefy.yaml', null, context.refMap);
|
|
20
20
|
let components = await recursiveBuild({
|
|
21
21
|
context,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { BuildParser } from '@lowdefy/operators';
|
|
16
16
|
import operators from '@lowdefy/operators-js/operators/build';
|
|
17
|
-
async function evaluateBuildOperators({ context
|
|
17
|
+
async function evaluateBuildOperators({ context, input, refDef }) {
|
|
18
18
|
const operatorsParser = new BuildParser({
|
|
19
19
|
env: process.env,
|
|
20
20
|
operators
|
|
21
21
|
});
|
|
22
|
-
const { output
|
|
22
|
+
const { output, errors } = operatorsParser.parse({
|
|
23
23
|
input,
|
|
24
24
|
location: refDef.path ?? refDef.resolver,
|
|
25
25
|
operatorPrefix: '_build.'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 { type } from '@lowdefy/helpers';
|
|
16
|
-
async function getConfigFile({ context
|
|
16
|
+
async function getConfigFile({ context, refDef, referencedFrom }) {
|
|
17
17
|
if (!type.isString(refDef.path)) {
|
|
18
18
|
throw new Error(`Invalid _ref definition ${JSON.stringify({
|
|
19
19
|
_ref: refDef.original
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 { get } from '@lowdefy/helpers';
|
|
16
|
-
function getKey({ input
|
|
16
|
+
function getKey({ input, refDef }) {
|
|
17
17
|
if (refDef.key) {
|
|
18
18
|
return get(input, refDef.key, {
|
|
19
19
|
default: null
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import getConfigFile from './getConfigFile.js';
|
|
16
16
|
import parseRefContent from './parseRefContent.js';
|
|
17
17
|
import runRefResolver from './runRefResolver.js';
|
|
18
|
-
async function getRefContent({ context
|
|
18
|
+
async function getRefContent({ context, refDef, referencedFrom }) {
|
|
19
19
|
let content;
|
|
20
20
|
if (refDef.path === 'lowdefy.yaml' || refDef.path === 'lowdefy.yml') {
|
|
21
21
|
content = await getConfigFile({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { pathToFileURL } from 'url';
|
|
17
|
-
async function getUserJavascriptFunction({ context
|
|
17
|
+
async function getUserJavascriptFunction({ context, filePath }) {
|
|
18
18
|
try {
|
|
19
19
|
return (await import(pathToFileURL(path.join(context.directories.config, filePath)))).default;
|
|
20
20
|
} catch (error) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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,8 +17,8 @@ import { getFileExtension, getFileSubExtension } from '@lowdefy/node-utils';
|
|
|
17
17
|
import JSON5 from 'json5';
|
|
18
18
|
import YAML from 'yaml';
|
|
19
19
|
import parseNunjucks from './parseNunjucks.js';
|
|
20
|
-
function parseRefContent({ content
|
|
21
|
-
const { path
|
|
20
|
+
function parseRefContent({ content, refDef }) {
|
|
21
|
+
const { path, vars } = refDef;
|
|
22
22
|
if (type.isString(path)) {
|
|
23
23
|
let ext = getFileExtension(path);
|
|
24
24
|
if (ext === 'njk') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -34,7 +34,7 @@ function refReviver(key, value) {
|
|
|
34
34
|
}
|
|
35
35
|
return value;
|
|
36
36
|
}
|
|
37
|
-
function populateRefs({ parsedFiles
|
|
37
|
+
function populateRefs({ parsedFiles, refDef, toPopulate }) {
|
|
38
38
|
return JSON.parse(JSON.stringify(toPopulate), refReviver.bind({
|
|
39
39
|
parsedFiles,
|
|
40
40
|
vars: refDef.vars
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 getRefContent from './getRefContent.js';
|
|
|
19
19
|
import getRefsFromFile from './getRefsFromFile.js';
|
|
20
20
|
import populateRefs from './populateRefs.js';
|
|
21
21
|
import runTransformer from './runTransformer.js';
|
|
22
|
-
async function recursiveBuild({ context
|
|
22
|
+
async function recursiveBuild({ context, refDef, count, referencedFrom }) {
|
|
23
23
|
// TODO: Maybe it would be better to detect a cycle, since this is the real issue here?
|
|
24
24
|
if (count > 10000) {
|
|
25
25
|
throw new Error(`Maximum recursion depth of references exceeded.`);
|
|
@@ -29,7 +29,7 @@ async function recursiveBuild({ context , refDef , count , referencedFrom }) {
|
|
|
29
29
|
refDef,
|
|
30
30
|
referencedFrom
|
|
31
31
|
});
|
|
32
|
-
const { foundRefs
|
|
32
|
+
const { foundRefs, fileContentBuiltRefs } = getRefsFromFile(fileContent, refDef.id, context.refMap);
|
|
33
33
|
const parsedFiles = {};
|
|
34
34
|
// Since we can have references in the variables of a reference, we need to first parse
|
|
35
35
|
// the deeper nodes, so we can use those parsed files in references higher in the tree.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import getUserJavascriptFunction from './getUserJavascriptFunction.js';
|
|
17
|
-
async function runRefResolver({ context
|
|
17
|
+
async function runRefResolver({ context, refDef, referencedFrom }) {
|
|
18
18
|
const resolverFn = await getUserJavascriptFunction({
|
|
19
19
|
context,
|
|
20
20
|
filePath: refDef.resolver || context.refResolver
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 getUserJavascriptFunction from './getUserJavascriptFunction.js';
|
|
16
|
-
async function runTransformer({ context
|
|
16
|
+
async function runTransformer({ context, input, refDef }) {
|
|
17
17
|
if (refDef.transformer) {
|
|
18
18
|
const transformerFn = await getUserJavascriptFunction({
|
|
19
19
|
context,
|
package/dist/build/buildTypes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import basicTypes from '@lowdefy/blocks-basic/types';
|
|
16
16
|
import loaderTypes from '@lowdefy/blocks-loaders/types';
|
|
17
|
-
function buildTypeClass(context, { counter
|
|
17
|
+
function buildTypeClass(context, { counter, definitions, store, typeClass, warnIfMissing = false }) {
|
|
18
18
|
const counts = counter.getCounts();
|
|
19
19
|
Object.keys(counts).forEach((typeName)=>{
|
|
20
20
|
if (!definitions[typeName]) {
|
|
21
21
|
if (warnIfMissing) {
|
|
22
|
+
if (typeName === '_id') {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
22
25
|
context.logger.warn(`${typeClass} type "${typeName}" was used but is not defined.`);
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
@@ -32,8 +35,8 @@ function buildTypeClass(context, { counter , definitions , store , typeClass , w
|
|
|
32
35
|
};
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
|
-
function buildTypes({ components
|
|
36
|
-
const { typeCounters
|
|
38
|
+
function buildTypes({ components, context }) {
|
|
39
|
+
const { typeCounters } = context;
|
|
37
40
|
// Add Mandatory Types
|
|
38
41
|
// Add operators used by form validation
|
|
39
42
|
typeCounters.operators.client.increment('_not');
|
|
@@ -41,7 +44,12 @@ function buildTypes({ components , context }) {
|
|
|
41
44
|
// Add loaders and basic
|
|
42
45
|
basicTypes.blocks.forEach((block)=>typeCounters.blocks.increment(block));
|
|
43
46
|
loaderTypes.blocks.forEach((block)=>typeCounters.blocks.increment(block));
|
|
44
|
-
|
|
47
|
+
// Used for DisplayMessage in @lowdefy/client
|
|
48
|
+
typeCounters.blocks.increment('Message');
|
|
49
|
+
// Used by license-invalid page
|
|
50
|
+
typeCounters.blocks.increment('Button');
|
|
51
|
+
typeCounters.blocks.increment('Result');
|
|
52
|
+
typeCounters.operators.client.increment('_get');
|
|
45
53
|
components.types = {
|
|
46
54
|
actions: {},
|
|
47
55
|
auth: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 { cleanDirectory } from '@lowdefy/node-utils';
|
|
16
|
-
async function cleanBuildDirectory({ context
|
|
16
|
+
async function cleanBuildDirectory({ context }) {
|
|
17
17
|
await cleanDirectory(context.directories.build);
|
|
18
18
|
}
|
|
19
19
|
export default cleanBuildDirectory;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import fs from 'fs';
|
|
17
17
|
import { cleanDirectory, copyFileOrDirectory } from '@lowdefy/node-utils';
|
|
18
|
-
async function copyPublicFolder({ context
|
|
18
|
+
async function copyPublicFolder({ context }) {
|
|
19
19
|
if (context.directories.config === context.directories.server) return;
|
|
20
20
|
await cleanDirectory(path.resolve(context.directories.server, 'public'));
|
|
21
21
|
await copyFileOrDirectory(path.resolve(context.directories.server, 'public_default'), path.resolve(context.directories.server, 'public'));
|
package/dist/build/testSchema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/ import { validate } from '@lowdefy/ajv';
|
|
16
16
|
import lowdefySchema from '../lowdefySchema.js';
|
|
17
17
|
import formatErrorMessage from '../utils/formatErrorMessage.js';
|
|
18
|
-
function testSchema({ components
|
|
19
|
-
const { valid
|
|
18
|
+
function testSchema({ components, context }) {
|
|
19
|
+
const { valid, errors } = validate({
|
|
20
20
|
schema: lowdefySchema,
|
|
21
21
|
data: components,
|
|
22
22
|
returnErrors: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { readFile, writeFile } from '@lowdefy/node-utils';
|
|
17
|
-
async function updateServerPackageJson({ components
|
|
17
|
+
async function updateServerPackageJson({ components, context }) {
|
|
18
18
|
const filePath = path.join(context.directories.server, 'package.json');
|
|
19
19
|
const packageJsonContent = await readFile(filePath);
|
|
20
20
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
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 { type } from '@lowdefy/helpers';
|
|
16
|
-
function validateConfig({ components
|
|
16
|
+
function validateConfig({ components }) {
|
|
17
17
|
if (type.isNone(components.config)) {
|
|
18
18
|
components.config = {};
|
|
19
19
|
}
|
package/dist/build/writeApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 writeApp({ components
|
|
17
|
-
await context.writeBuildArtifact('app.json', serializer.serializeToString(components.app ?? {}
|
|
18
|
-
space: 2
|
|
19
|
-
}));
|
|
16
|
+
async function writeApp({ components, context }) {
|
|
17
|
+
await context.writeBuildArtifact('app.json', serializer.serializeToString(components.app ?? {}));
|
|
20
18
|
}
|
|
21
19
|
export default writeApp;
|
package/dist/build/writeAuth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 writeAuth({ components
|
|
17
|
-
await context.writeBuildArtifact('auth.json', serializer.serializeToString(components.auth ?? {}
|
|
18
|
-
space: 2
|
|
19
|
-
}));
|
|
16
|
+
async function writeAuth({ components, context }) {
|
|
17
|
+
await context.writeBuildArtifact('auth.json', serializer.serializeToString(components.auth ?? {}));
|
|
20
18
|
}
|
|
21
19
|
export default writeAuth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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 writeConfig({ components
|
|
17
|
-
await context.writeBuildArtifact('config.json', serializer.serializeToString(components.config ?? {}
|
|
18
|
-
space: 2
|
|
19
|
-
}));
|
|
16
|
+
async function writeConfig({ components, context }) {
|
|
17
|
+
await context.writeBuildArtifact('config.json', serializer.serializeToString(components.config ?? {}));
|
|
20
18
|
}
|
|
21
19
|
export default writeConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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,15 +13,13 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type, serializer } from '@lowdefy/helpers';
|
|
16
|
-
async function writeConnections({ components
|
|
16
|
+
async function writeConnections({ components, context }) {
|
|
17
17
|
if (type.isNone(components.connections)) return;
|
|
18
18
|
if (!type.isArray(components.connections)) {
|
|
19
19
|
throw new Error(`Connections is not an array.`);
|
|
20
20
|
}
|
|
21
21
|
const writePromises = components.connections.map(async (connection)=>{
|
|
22
|
-
await context.writeBuildArtifact(`connections/${connection.connectionId}.json`, serializer.serializeToString(connection
|
|
23
|
-
space: 2
|
|
24
|
-
}));
|
|
22
|
+
await context.writeBuildArtifact(`connections/${connection.connectionId}.json`, serializer.serializeToString(connection));
|
|
25
23
|
});
|
|
26
24
|
return Promise.all(writePromises);
|
|
27
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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,15 +13,13 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type, serializer } from '@lowdefy/helpers';
|
|
16
|
-
async function writeGlobal({ components
|
|
16
|
+
async function writeGlobal({ components, context }) {
|
|
17
17
|
if (type.isNone(components.global)) {
|
|
18
18
|
components.global = {};
|
|
19
19
|
}
|
|
20
20
|
if (!type.isObject(components.global)) {
|
|
21
21
|
throw new Error('Global is not an object.');
|
|
22
22
|
}
|
|
23
|
-
await context.writeBuildArtifact('global.json', serializer.serializeToString(components.global
|
|
24
|
-
space: 2
|
|
25
|
-
}));
|
|
23
|
+
await context.writeBuildArtifact('global.json', serializer.serializeToString(components.global));
|
|
26
24
|
}
|
|
27
25
|
export default writeGlobal;
|
package/dist/build/writeMaps.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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,14 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { serializer, type } from '@lowdefy/helpers';
|
|
16
|
-
async function writeMaps({ context
|
|
16
|
+
async function writeMaps({ context }) {
|
|
17
17
|
if (!type.isObject(context.keyMap)) {
|
|
18
18
|
throw new Error('keyMap is not an object.');
|
|
19
19
|
}
|
|
20
20
|
if (!type.isObject(context.refMap)) {
|
|
21
21
|
throw new Error('refMap is not an object.');
|
|
22
22
|
}
|
|
23
|
-
await context.writeBuildArtifact('keyMap.json', serializer.serializeToString(context.keyMap
|
|
24
|
-
|
|
25
|
-
}));
|
|
26
|
-
await context.writeBuildArtifact('refMap.json', serializer.serializeToString(context.refMap, {
|
|
27
|
-
space: 0
|
|
28
|
-
}));
|
|
23
|
+
await context.writeBuildArtifact('keyMap.json', serializer.serializeToString(context.keyMap));
|
|
24
|
+
await context.writeBuildArtifact('refMap.json', serializer.serializeToString(context.refMap));
|
|
29
25
|
}
|
|
30
26
|
export default writeMaps;
|
package/dist/build/writeMenus.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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,12 +13,10 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type, serializer } from '@lowdefy/helpers';
|
|
16
|
-
async function writeMenus({ components
|
|
16
|
+
async function writeMenus({ components, context }) {
|
|
17
17
|
if (!type.isArray(components.menus)) {
|
|
18
18
|
throw new Error('Menus is not an array.');
|
|
19
19
|
}
|
|
20
|
-
await context.writeBuildArtifact('menus.json', serializer.serializeToString(components.menus
|
|
21
|
-
space: 2
|
|
22
|
-
}));
|
|
20
|
+
await context.writeBuildArtifact('menus.json', serializer.serializeToString(components.menus));
|
|
23
21
|
}
|
|
24
22
|
export default writeMenus;
|
package/dist/build/writePages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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,12 +13,10 @@
|
|
|
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 writePage({ page
|
|
17
|
-
await context.writeBuildArtifact(`pages/${page.pageId}/${page.pageId}.json`, serializer.serializeToString(page ?? {}
|
|
18
|
-
space: 2
|
|
19
|
-
}));
|
|
16
|
+
async function writePage({ page, context }) {
|
|
17
|
+
await context.writeBuildArtifact(`pages/${page.pageId}/${page.pageId}.json`, serializer.serializeToString(page ?? {}));
|
|
20
18
|
}
|
|
21
|
-
async function writePages({ components
|
|
19
|
+
async function writePages({ components, context }) {
|
|
22
20
|
const writePromises = components.pages.map((page)=>writePage({
|
|
23
21
|
page,
|
|
24
22
|
context
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
{{ import.typeName }},
|
|
22
22
|
{% endfor -%}
|
|
23
23
|
};`;
|
|
24
|
-
function generateImportFile({ imports
|
|
24
|
+
function generateImportFile({ imports, importPath }) {
|
|
25
25
|
const templateFn = nunjucksFunction(template);
|
|
26
26
|
return templateFn({
|
|
27
27
|
imports,
|