@lowdefy/build 5.5.0 → 5.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/buildAgents.js +9 -1
- package/dist/build/buildAuth/buildAgentAuth.js +56 -0
- package/dist/build/buildAuth/buildAuth.js +9 -0
- package/dist/build/buildAuth/getAgentRoles.js +39 -0
- package/dist/build/buildAuth/getProtectedAgents.js +29 -0
- package/dist/build/buildAuth/rejectReservedEntityIds.js +52 -0
- package/dist/build/buildPages/buildBlock/buildEvents.js +11 -1
- package/dist/build/buildPages/buildBlock/validateBlock.js +12 -1
- package/dist/build/buildRefs/getKey.js +16 -5
- package/dist/build/buildRefs/rebaseModuleRefPaths.js +34 -0
- package/dist/build/buildRefs/walker.js +26 -15
- package/dist/build/fetchModules.js +18 -4
- package/dist/build/jit/buildPageJit.js +18 -0
- package/dist/build/registerModules.js +25 -19
- package/dist/build/writeI18n.js +8 -1
- package/dist/build/writePluginImports/writeGlobalsCss.js +0 -1
- package/dist/defaultTypesMap.js +410 -385
- package/dist/test-utils/runBuild.js +8 -0
- package/dist/utils/logCollectedErrors.js +38 -10
- package/dist/utils/validateId.js +11 -0
- package/package.json +50 -50
|
@@ -112,7 +112,15 @@ import createTestLogger from './createTestLogger.js';
|
|
|
112
112
|
package: '@lowdefy/blocks-basic'
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
+
agents: {
|
|
116
|
+
ClaudeAgent: {
|
|
117
|
+
package: '@lowdefy/connection-anthropic'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
115
120
|
connections: {
|
|
121
|
+
Anthropic: {
|
|
122
|
+
package: '@lowdefy/connection-anthropic'
|
|
123
|
+
},
|
|
116
124
|
AxiosHttp: {
|
|
117
125
|
package: '@lowdefy/connection-axios-http'
|
|
118
126
|
},
|
|
@@ -12,19 +12,47 @@
|
|
|
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 { BuildError, LowdefyInternalError } from '@lowdefy/errors';
|
|
15
|
+
*/ import { BuildError, LowdefyInternalError, resolveErrorLocation } from '@lowdefy/errors';
|
|
16
16
|
function logCollectedErrors(context) {
|
|
17
17
|
if (context.errors.length === 0) return;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
let loggedCount = 0;
|
|
19
|
+
const seenSourceMessages = new Set();
|
|
20
|
+
for (const err of context.errors){
|
|
21
|
+
const lowdefyErr = err.isLowdefyError ? err : new LowdefyInternalError(err.message, {
|
|
22
|
+
cause: err
|
|
23
|
+
});
|
|
24
|
+
// handleError resolves the location and logs in one step, so the location
|
|
25
|
+
// has to be resolved here to decide whether the entry is worth logging at
|
|
26
|
+
// all. Resolution is pure, so handleError repeating it yields the same
|
|
27
|
+
// location. Resolution reads author-supplied data (keyMap entries, refMap
|
|
28
|
+
// paths), so a malformed entry can throw; the whole error report is worth
|
|
29
|
+
// more than one error's source line, so a failure leaves the error
|
|
30
|
+
// unlocated here and handleError logs it with its own guarded resolution.
|
|
31
|
+
let location = null;
|
|
32
|
+
try {
|
|
33
|
+
location = resolveErrorLocation(lowdefyErr, {
|
|
34
|
+
keyMap: context.keyMap,
|
|
35
|
+
refMap: context.refMap,
|
|
36
|
+
configDirectory: context.directories?.config
|
|
24
37
|
});
|
|
25
|
-
|
|
38
|
+
} catch {
|
|
39
|
+
location = null;
|
|
26
40
|
}
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
// Two build steps can report the same config line: buildAuth reaches page,
|
|
42
|
+
// endpoint and agent ids before validateId does, and both gates give the
|
|
43
|
+
// same message. Two genuinely distinct errors never share both a resolved
|
|
44
|
+
// source line and a message, so that pair is safe to collapse. Without a
|
|
45
|
+
// resolved source line there is no such evidence - the message alone would
|
|
46
|
+
// collapse distinct internal errors and under-count the failures - so
|
|
47
|
+
// unlocated errors are always reported.
|
|
48
|
+
if (location?.source) {
|
|
49
|
+
const dedupKey = `${location.source}\n${lowdefyErr.message}`;
|
|
50
|
+
if (seenSourceMessages.has(dedupKey)) continue;
|
|
51
|
+
seenSourceMessages.add(dedupKey);
|
|
52
|
+
}
|
|
53
|
+
context.handleError(lowdefyErr);
|
|
54
|
+
loggedCount += 1;
|
|
55
|
+
}
|
|
56
|
+
throw new BuildError(`Build failed with ${loggedCount} error(s). See above for details.`);
|
|
29
57
|
}
|
|
30
58
|
export default logCollectedErrors;
|
package/dist/utils/validateId.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { ConfigError } from '@lowdefy/errors';
|
|
16
|
+
import { isReserved } from '@lowdefy/helpers';
|
|
16
17
|
const validIdPattern = /^[A-Za-z0-9\-_/:]+$/;
|
|
17
18
|
function validateId({ id, field, location, configKey }) {
|
|
18
19
|
if (!validIdPattern.test(id)) {
|
|
@@ -20,5 +21,15 @@ function validateId({ id, field, location, configKey }) {
|
|
|
20
21
|
configKey
|
|
21
22
|
});
|
|
22
23
|
}
|
|
24
|
+
// The pattern above admits every reserved name - underscores and letters are in its allowed set.
|
|
25
|
+
// A reserved id re-parents the plain-object registries that key on it - the engine's `requests`
|
|
26
|
+
// and `requestConfig` maps, and the connection/websocket/notification/endpoint maps - so reject
|
|
27
|
+
// it here where the config location is still in hand. Block ids do not reach this gate: they are
|
|
28
|
+
// dot-paths, so the pattern above excludes them and they carry their own per-segment check.
|
|
29
|
+
if (isReserved(id)) {
|
|
30
|
+
throw new ConfigError(`${field} "${id}"${location ? ` at ${location}` : ''} is a reserved name and cannot be used as an id.`, {
|
|
31
|
+
configKey
|
|
32
|
+
});
|
|
33
|
+
}
|
|
23
34
|
}
|
|
24
35
|
export default validateId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/build",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"dist/*"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@lowdefy/ai-utils": "5.
|
|
49
|
-
"@lowdefy/ajv": "5.
|
|
50
|
-
"@lowdefy/block-utils": "5.
|
|
51
|
-
"@lowdefy/blocks-basic": "5.
|
|
52
|
-
"@lowdefy/blocks-loaders": "5.
|
|
53
|
-
"@lowdefy/errors": "5.
|
|
54
|
-
"@lowdefy/helpers": "5.
|
|
55
|
-
"@lowdefy/node-utils": "5.
|
|
56
|
-
"@lowdefy/nunjucks": "5.
|
|
57
|
-
"@lowdefy/operators": "5.
|
|
58
|
-
"@lowdefy/operators-js": "5.
|
|
48
|
+
"@lowdefy/ai-utils": "5.6.0",
|
|
49
|
+
"@lowdefy/ajv": "5.6.0",
|
|
50
|
+
"@lowdefy/block-utils": "5.6.0",
|
|
51
|
+
"@lowdefy/blocks-basic": "5.6.0",
|
|
52
|
+
"@lowdefy/blocks-loaders": "5.6.0",
|
|
53
|
+
"@lowdefy/errors": "5.6.0",
|
|
54
|
+
"@lowdefy/helpers": "5.6.0",
|
|
55
|
+
"@lowdefy/node-utils": "5.6.0",
|
|
56
|
+
"@lowdefy/nunjucks": "5.6.0",
|
|
57
|
+
"@lowdefy/operators": "5.6.0",
|
|
58
|
+
"@lowdefy/operators-js": "5.6.0",
|
|
59
59
|
"ajv": "8.12.0",
|
|
60
60
|
"json5": "2.2.3",
|
|
61
61
|
"picomatch": "4.0.1",
|
|
@@ -66,44 +66,44 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@jest/globals": "28.1.3",
|
|
69
|
-
"@lowdefy/actions-core": "5.
|
|
70
|
-
"@lowdefy/actions-pdf-make": "5.
|
|
71
|
-
"@lowdefy/blocks-aggrid": "5.
|
|
72
|
-
"@lowdefy/blocks-antd": "5.
|
|
73
|
-
"@lowdefy/blocks-antd-x": "5.
|
|
74
|
-
"@lowdefy/blocks-diff": "5.
|
|
75
|
-
"@lowdefy/blocks-echarts": "5.
|
|
76
|
-
"@lowdefy/blocks-google-maps": "5.
|
|
77
|
-
"@lowdefy/blocks-markdown": "5.
|
|
78
|
-
"@lowdefy/blocks-qr": "5.
|
|
79
|
-
"@lowdefy/blocks-tiptap": "5.
|
|
80
|
-
"@lowdefy/connection-ai-gateway": "5.
|
|
81
|
-
"@lowdefy/connection-anthropic": "5.
|
|
82
|
-
"@lowdefy/connection-axios-http": "5.
|
|
83
|
-
"@lowdefy/connection-elasticsearch": "5.
|
|
84
|
-
"@lowdefy/connection-google": "5.
|
|
85
|
-
"@lowdefy/connection-google-sheets": "5.
|
|
86
|
-
"@lowdefy/connection-knex": "5.
|
|
87
|
-
"@lowdefy/connection-mcp": "5.
|
|
88
|
-
"@lowdefy/connection-mongodb": "5.
|
|
89
|
-
"@lowdefy/connection-openai": "5.
|
|
90
|
-
"@lowdefy/connection-redis": "5.
|
|
91
|
-
"@lowdefy/connection-sendgrid": "5.
|
|
92
|
-
"@lowdefy/connection-stripe": "5.
|
|
93
|
-
"@lowdefy/connection-test": "5.
|
|
94
|
-
"@lowdefy/logger": "5.
|
|
95
|
-
"@lowdefy/operators-change-case": "5.
|
|
96
|
-
"@lowdefy/operators-dayjs": "5.
|
|
97
|
-
"@lowdefy/operators-diff": "5.
|
|
98
|
-
"@lowdefy/operators-jsonata": "5.
|
|
99
|
-
"@lowdefy/operators-mql": "5.
|
|
100
|
-
"@lowdefy/operators-nunjucks": "5.
|
|
101
|
-
"@lowdefy/operators-uuid": "5.
|
|
102
|
-
"@lowdefy/operators-yaml": "5.
|
|
103
|
-
"@lowdefy/plugin-auth0": "5.
|
|
104
|
-
"@lowdefy/plugin-aws": "5.
|
|
105
|
-
"@lowdefy/plugin-csv": "5.
|
|
106
|
-
"@lowdefy/plugin-next-auth": "5.
|
|
69
|
+
"@lowdefy/actions-core": "5.6.0",
|
|
70
|
+
"@lowdefy/actions-pdf-make": "5.6.0",
|
|
71
|
+
"@lowdefy/blocks-aggrid": "5.6.0",
|
|
72
|
+
"@lowdefy/blocks-antd": "5.6.0",
|
|
73
|
+
"@lowdefy/blocks-antd-x": "5.6.0",
|
|
74
|
+
"@lowdefy/blocks-diff": "5.6.0",
|
|
75
|
+
"@lowdefy/blocks-echarts": "5.6.0",
|
|
76
|
+
"@lowdefy/blocks-google-maps": "5.6.0",
|
|
77
|
+
"@lowdefy/blocks-markdown": "5.6.0",
|
|
78
|
+
"@lowdefy/blocks-qr": "5.6.0",
|
|
79
|
+
"@lowdefy/blocks-tiptap": "5.6.0",
|
|
80
|
+
"@lowdefy/connection-ai-gateway": "5.6.0",
|
|
81
|
+
"@lowdefy/connection-anthropic": "5.6.0",
|
|
82
|
+
"@lowdefy/connection-axios-http": "5.6.0",
|
|
83
|
+
"@lowdefy/connection-elasticsearch": "5.6.0",
|
|
84
|
+
"@lowdefy/connection-google": "5.6.0",
|
|
85
|
+
"@lowdefy/connection-google-sheets": "5.6.0",
|
|
86
|
+
"@lowdefy/connection-knex": "5.6.0",
|
|
87
|
+
"@lowdefy/connection-mcp": "5.6.0",
|
|
88
|
+
"@lowdefy/connection-mongodb": "5.6.0",
|
|
89
|
+
"@lowdefy/connection-openai": "5.6.0",
|
|
90
|
+
"@lowdefy/connection-redis": "5.6.0",
|
|
91
|
+
"@lowdefy/connection-sendgrid": "5.6.0",
|
|
92
|
+
"@lowdefy/connection-stripe": "5.6.0",
|
|
93
|
+
"@lowdefy/connection-test": "5.6.0",
|
|
94
|
+
"@lowdefy/logger": "5.6.0",
|
|
95
|
+
"@lowdefy/operators-change-case": "5.6.0",
|
|
96
|
+
"@lowdefy/operators-dayjs": "5.6.0",
|
|
97
|
+
"@lowdefy/operators-diff": "5.6.0",
|
|
98
|
+
"@lowdefy/operators-jsonata": "5.6.0",
|
|
99
|
+
"@lowdefy/operators-mql": "5.6.0",
|
|
100
|
+
"@lowdefy/operators-nunjucks": "5.6.0",
|
|
101
|
+
"@lowdefy/operators-uuid": "5.6.0",
|
|
102
|
+
"@lowdefy/operators-yaml": "5.6.0",
|
|
103
|
+
"@lowdefy/plugin-auth0": "5.6.0",
|
|
104
|
+
"@lowdefy/plugin-aws": "5.6.0",
|
|
105
|
+
"@lowdefy/plugin-csv": "5.6.0",
|
|
106
|
+
"@lowdefy/plugin-next-auth": "5.6.0",
|
|
107
107
|
"@swc/cli": "0.8.0",
|
|
108
108
|
"@swc/core": "1.15.18",
|
|
109
109
|
"@swc/jest": "0.2.39",
|