openyida 2026.7.19 → 2026.7.21
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/README.md +14 -0
- package/bin/yida.js +107 -18
- package/lib/app/create-app.js +12 -1
- package/lib/app/create-form/args.js +13 -0
- package/lib/app/create-form.js +154 -67
- package/lib/app/create-page.js +45 -9
- package/lib/app/get-schema.js +65 -14
- package/lib/app/import-app.js +92 -41
- package/lib/app/publish.js +289 -556
- package/lib/app/schema-field-resolution.js +370 -0
- package/lib/app/services/app-reader.js +85 -0
- package/lib/app/services/app-service.js +235 -0
- package/lib/app/services/canvas-page-compiler.js +91 -0
- package/lib/app/services/canvas-page-schema-builder.js +149 -0
- package/lib/app/services/field-bindings.js +68 -0
- package/lib/app/services/form-compiler.js +1922 -0
- package/lib/app/services/form-mode-service.js +182 -0
- package/lib/app/services/form-schema-patcher.js +333 -0
- package/lib/app/services/form-schema-reader.js +59 -0
- package/lib/app/services/form-service.js +379 -0
- package/lib/app/services/form-validation.js +562 -0
- package/lib/app/services/native-page-compiler.js +92 -0
- package/lib/app/services/native-page-schema-builder.js +428 -0
- package/lib/app/services/page-resource-service.js +185 -0
- package/lib/app/update-app.js +18 -6
- package/lib/auth/token-auth.js +34 -3
- package/lib/auth/token-store.js +22 -4
- package/lib/bridge/bridge.js +37 -5
- package/lib/core/agent-capabilities.js +5 -3
- package/lib/core/command-manifest.js +40 -0
- package/lib/core/doctor.js +15 -4
- package/lib/core/env-cmd.js +1 -1
- package/lib/core/env.js +7 -6
- package/lib/core/legacy-schema-guard.js +408 -0
- package/lib/core/locales/en.js +8 -46
- package/lib/core/locales/zh.js +8 -46
- package/lib/core/sample.js +1 -1
- package/lib/core/utils.js +334 -66
- package/lib/core/yida-client.js +104 -3
- package/lib/formula/evaluate.js +8 -66
- package/lib/formula/field-refs.js +83 -0
- package/lib/process/configure-process.js +44 -1992
- package/lib/process/create-process.js +54 -87
- package/lib/process/services/process-compiler.js +2056 -0
- package/lib/process/services/process-reader.js +232 -0
- package/lib/process/services/process-resource-service.js +571 -0
- package/lib/process/services/process-service.js +122 -0
- package/lib/process/services/process-stage-checkpoint.js +246 -0
- package/lib/report/append.js +7 -26
- package/lib/report/http.js +31 -5
- package/lib/report/index.js +10 -2
- package/lib/samples/yida-canvas-custom-page/business-list.canvas.jsx +63 -14
- package/lib/samples/yida-canvas-custom-page/dashboard-overview.canvas.jsx +176 -32
- package/lib/samples/yida-canvas-custom-page/data-management.canvas.jsx +228 -14
- package/lib/samples/yida-canvas-custom-page/split-pane-detail.canvas.jsx +204 -8
- package/lib/schema/adapters/app-adapter.js +210 -0
- package/lib/schema/adapters/form-adapter.js +1362 -0
- package/lib/schema/adapters/keys.js +19 -0
- package/lib/schema/adapters/page-adapter.js +566 -0
- package/lib/schema/adapters/process-adapter.js +519 -0
- package/lib/schema/applier.js +1878 -0
- package/lib/schema/apply-store.js +1083 -0
- package/lib/schema/command.js +645 -0
- package/lib/schema/dependency-graph.js +83 -0
- package/lib/schema/errors.js +481 -0
- package/lib/schema/hash.js +9 -0
- package/lib/schema/manifest-limits.js +177 -0
- package/lib/schema/manifest-loader.js +309 -0
- package/lib/schema/manifest-schema-v1.json +193 -0
- package/lib/schema/normalize-manifest.js +281 -0
- package/lib/schema/page-canvas-foundation.js +447 -0
- package/lib/schema/page-data-source-builder.js +561 -0
- package/lib/schema/page-foundation.js +556 -0
- package/lib/schema/page-source-loader.js +314 -0
- package/lib/schema/planner.js +691 -0
- package/lib/schema/remote-dispatch-boundary.js +39 -0
- package/lib/schema/remote-missing.js +21 -0
- package/lib/schema/remote-reader.js +189 -0
- package/lib/schema/resource-registry.js +157 -0
- package/lib/schema/server-revision.js +71 -0
- package/lib/schema/sort.js +28 -0
- package/lib/schema/state-store.js +589 -0
- package/package.json +2 -2
- package/scripts/postinstall.js +8 -12
- package/scripts/validate-package-size.js +1 -1
- package/yida-skills/SKILL.md +114 -29
- package/yida-skills/references/schema-as-code-phase1.md +99 -0
- package/yida-skills/references/setup-and-env.md +59 -59
- package/yida-skills/references/task-retrospective.md +6 -6
- package/yida-skills/skills/yida-app/SKILL.md +60 -14
- package/yida-skills/skills/yida-canvas-custom-page/SKILL.md +18 -7
- package/yida-skills/skills/yida-canvas-custom-page/references/data-bridge-guide.md +3 -3
- package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +7 -1
- package/yida-skills/skills/yida-create-app/SKILL.md +21 -3
- package/yida-skills/skills/yida-create-form-page/SKILL.md +19 -1
- package/yida-skills/skills/yida-create-page/SKILL.md +16 -3
- package/yida-skills/skills/yida-create-process/SKILL.md +100 -4
- package/yida-skills/skills/yida-custom-page/SKILL.md +19 -4
- package/yida-skills/skills/yida-dashboard/SKILL.md +1 -1
- package/yida-skills/skills/yida-dashboard/references/pitfalls.md +1 -1
- package/yida-skills/skills/yida-get-schema/SKILL.md +49 -5
- package/yida-skills/skills/yida-i18n/SKILL.md +1 -1
- package/yida-skills/skills/yida-integration/SKILL.md +7 -1
- package/yida-skills/skills/yida-login/SKILL.md +50 -99
- package/yida-skills/skills/yida-page-config/SKILL.md +7 -1
- package/yida-skills/skills/yida-page-uiux/references/app/blueprint.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/app/navigation-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/app/role-journey.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/dashboard/app-blueprint.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/dashboard/chart-contracts.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/dashboard/component-contracts.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/dashboard/layout-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/dashboard/theme-recipes.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/detail/object-narrative.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/detail/section-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/detail/timeline-and-related.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/landing/assets-workflow.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/landing/industry-playbooks.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/landing/research-levels.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/landing/section-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/list/drawer-detail.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/list/empty-loading-error.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/list/filter-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/list/table-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/scenes/screen.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/workbench/entry-patterns.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/workbench/portal-layouts.md +0 -1
- package/yida-skills/skills/yida-page-uiux/references/workbench/task-feed.md +0 -1
- package/yida-skills/skills/yida-page-uiux/workflow/output-decision-block.md +1 -1
- package/yida-skills/skills/yida-process-rule/SKILL.md +35 -1
- package/yida-skills/skills/yida-publish-page/SKILL.md +46 -4
- package/yida-skills/skills/yida-report/SKILL.md +7 -1
- package/yida-skills/skills-index.json +14 -46
- package/yida-skills/skills/large-file-write/SKILL.md +0 -93
- package/yida-skills/skills/large-file-write/references/write-patterns.md +0 -147
- package/yida-skills/skills/large-file-write/scripts/write.js +0 -157
- package/yida-skills/skills/sls-log-workbench/SKILL.md +0 -134
- package/yida-skills/skills/sls-log-workbench/references/workbench-reference.md +0 -130
- package/yida-skills/skills/sls-log-workbench/sls-query.js +0 -295
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
const { compileCanvasLocal } = require('../canvas-compile');
|
|
5
|
+
const { schemaError } = require('../../schema/errors');
|
|
6
|
+
const { isLoadedPageSource } = require('../../schema/page-source-loader');
|
|
7
|
+
|
|
8
|
+
const CANVAS_PAGE_PROFILE = 'canvas/default';
|
|
9
|
+
const COMPILED_CANVAS_PAGES = new WeakSet();
|
|
10
|
+
|
|
11
|
+
function compileCanvasPageSource(loadedSource) {
|
|
12
|
+
if (!isLoadedPageSource(loadedSource)) {
|
|
13
|
+
compilerError('SCHEMA_PAGE_SOURCE_INVALID', 'Canvas page compiler requires a trusted page source.');
|
|
14
|
+
}
|
|
15
|
+
if (typeof loadedSource.source !== 'string' || loadedSource.source.trim() === '') {
|
|
16
|
+
compilerError('SCHEMA_PAGE_SOURCE_COMPILE_FAILED', 'Canvas page source did not pass local validation.', {
|
|
17
|
+
stage: 'canvas',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let canvasResult;
|
|
22
|
+
try {
|
|
23
|
+
canvasResult = compileCanvasLocal(loadedSource.source);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
compilerError('SCHEMA_PAGE_SOURCE_COMPILE_FAILED', 'Canvas page source could not be compiled.', {
|
|
26
|
+
stage: 'canvas',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (
|
|
31
|
+
!canvasResult ||
|
|
32
|
+
typeof canvasResult.runtimeCode !== 'string' ||
|
|
33
|
+
!canvasResult.runtimeCode ||
|
|
34
|
+
!/\bYidaComp\b/.test(canvasResult.runtimeCode) ||
|
|
35
|
+
typeof canvasResult.importedModules !== 'string' ||
|
|
36
|
+
!isJsonArrayString(canvasResult.importedModules)
|
|
37
|
+
) {
|
|
38
|
+
compilerError('SCHEMA_PAGE_SOURCE_COMPILE_FAILED', 'Canvas page output did not match the runtime contract.', {
|
|
39
|
+
stage: 'canvas',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const result = Object.freeze({
|
|
44
|
+
compiledHash: createCanvasCompiledHash(
|
|
45
|
+
canvasResult.runtimeCode,
|
|
46
|
+
canvasResult.importedModules
|
|
47
|
+
),
|
|
48
|
+
importedModules: canvasResult.importedModules,
|
|
49
|
+
inputHash: loadedSource.sourceHash,
|
|
50
|
+
profile: CANVAS_PAGE_PROFILE,
|
|
51
|
+
runtimeCode: canvasResult.runtimeCode,
|
|
52
|
+
source: loadedSource.source,
|
|
53
|
+
sourceHash: createSha256(loadedSource.source),
|
|
54
|
+
});
|
|
55
|
+
COMPILED_CANVAS_PAGES.add(result);
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function isCompiledCanvasPage(value) {
|
|
60
|
+
return !!(value && typeof value === 'object' && COMPILED_CANVAS_PAGES.has(value));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function createCanvasCompiledHash(runtimeCode, importedModules) {
|
|
64
|
+
return createSha256(JSON.stringify({
|
|
65
|
+
importedModules: String(importedModules || ''),
|
|
66
|
+
runtimeCode: String(runtimeCode || ''),
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isJsonArrayString(value) {
|
|
71
|
+
try {
|
|
72
|
+
return Array.isArray(JSON.parse(value));
|
|
73
|
+
} catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function createSha256(value) {
|
|
79
|
+
return 'sha256:' + crypto.createHash('sha256').update(value).digest('hex');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function compilerError(code, message, details) {
|
|
83
|
+
throw schemaError(code, message, details ? { details } : undefined);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports = {
|
|
87
|
+
CANVAS_PAGE_PROFILE,
|
|
88
|
+
compileCanvasPageSource,
|
|
89
|
+
createCanvasCompiledHash,
|
|
90
|
+
isCompiledCanvasPage,
|
|
91
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
createNodeIdGenerator,
|
|
5
|
+
generateSuffix,
|
|
6
|
+
getGlobalDataSourceFitConfig,
|
|
7
|
+
} = require('./native-page-schema-builder');
|
|
8
|
+
|
|
9
|
+
const CANVAS_ACTIONS_SOURCE = 'export function didMount() {}';
|
|
10
|
+
const CANVAS_ACTIONS_COMPILED = '"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.didMount=didMount;function didMount(){}';
|
|
11
|
+
|
|
12
|
+
function buildCanvasPageSchemaContent(sourceCode, runtimeCode, importedModules, formUuid, options = {}) {
|
|
13
|
+
return JSON.stringify(buildCanvasPageSchemaObject(
|
|
14
|
+
sourceCode,
|
|
15
|
+
runtimeCode,
|
|
16
|
+
importedModules,
|
|
17
|
+
formUuid,
|
|
18
|
+
options
|
|
19
|
+
));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function buildCanvasPageSchemaObject(sourceCode, runtimeCode, importedModules, formUuid, options = {}) {
|
|
23
|
+
const nextNodeId = resolveSchemaBuilderDependency(
|
|
24
|
+
options.nextNodeId,
|
|
25
|
+
createNodeIdGenerator,
|
|
26
|
+
'nextNodeId'
|
|
27
|
+
);
|
|
28
|
+
const nextSuffix = resolveSchemaBuilderDependency(
|
|
29
|
+
options.nextSuffix,
|
|
30
|
+
() => generateSuffix,
|
|
31
|
+
'nextSuffix'
|
|
32
|
+
);
|
|
33
|
+
const constructorCode = "function constructor() {\nvar module = { exports: {} };\nvar _this = this;\nthis.__initMethods__(module.exports, module);\nObject.keys(module.exports).forEach(function(item) {\n if(typeof module.exports[item] === 'function'){\n _this[item] = module.exports[item];\n }\n});\n\n}";
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
schemaType: 'superform',
|
|
37
|
+
schemaVersion: '5.0',
|
|
38
|
+
pages: [
|
|
39
|
+
{
|
|
40
|
+
utils: [
|
|
41
|
+
{
|
|
42
|
+
name: 'legaoBuiltin',
|
|
43
|
+
type: 'npm',
|
|
44
|
+
content: { package: '@ali/vu-legao-builtin', version: '3.0.0', exportName: 'legaoBuiltin' },
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'yidaPlugin',
|
|
48
|
+
type: 'npm',
|
|
49
|
+
content: { package: '@ali/vu-yida-plugin', version: '1.1.0', exportName: 'yidaPlugin' },
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
componentsMap: [
|
|
53
|
+
{ package: '@ali/vc-deep-yida', version: '1.5.169', componentName: 'YidaCodeCanvas' },
|
|
54
|
+
{ package: '@ali/vc-deep-yida', version: '1.5.169', componentName: 'RootHeader' },
|
|
55
|
+
{ package: '@ali/vc-deep-yida', version: '1.5.169', componentName: 'RootContent' },
|
|
56
|
+
{ package: '@ali/vc-deep-yida', version: '1.5.169', componentName: 'RootFooter' },
|
|
57
|
+
{ package: '@ali/vc-deep-yida', version: '1.5.169', componentName: 'Page' },
|
|
58
|
+
],
|
|
59
|
+
componentsTree: [
|
|
60
|
+
{
|
|
61
|
+
componentName: 'Page',
|
|
62
|
+
id: nextNodeId(),
|
|
63
|
+
props: {
|
|
64
|
+
contentBgColor: 'white',
|
|
65
|
+
pageStyle: { backgroundColor: '#f2f3f5' },
|
|
66
|
+
contentMargin: '0',
|
|
67
|
+
contentPadding: '0',
|
|
68
|
+
showTitle: false,
|
|
69
|
+
contentPaddingMobile: '0',
|
|
70
|
+
templateVersion: '1.0.0',
|
|
71
|
+
contentMarginMobile: '0',
|
|
72
|
+
className: 'page_' + nextSuffix(),
|
|
73
|
+
contentBgColorMobile: 'white',
|
|
74
|
+
},
|
|
75
|
+
condition: true,
|
|
76
|
+
css: 'body{background-color:#f2f3f5}.vc-page-yida-page{--yida-form-content-padding:0;--yida-form-content-margin:0;--yida-layout-padding:0}.vc-deep-container-entry.vc-rootcontent{padding:0!important;margin-top:0!important;margin-right:0!important;margin-bottom:0!important;margin-left:0!important}',
|
|
77
|
+
methods: {
|
|
78
|
+
__initMethods__: {
|
|
79
|
+
type: 'js',
|
|
80
|
+
source: 'function (exports, module) { /*set actions code here*/ }',
|
|
81
|
+
compiled: 'function (exports, module) { /*set actions code here*/ }',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
dataSource: {
|
|
85
|
+
offline: [],
|
|
86
|
+
globalConfig: getGlobalDataSourceFitConfig(),
|
|
87
|
+
online: [],
|
|
88
|
+
list: [],
|
|
89
|
+
sync: true,
|
|
90
|
+
},
|
|
91
|
+
lifeCycles: {
|
|
92
|
+
constructor: { type: 'js', compiled: constructorCode, source: constructorCode },
|
|
93
|
+
componentWillUnmount: '',
|
|
94
|
+
componentDidMount: { name: 'didMount', id: 'didMount', params: {}, type: 'actionRef' },
|
|
95
|
+
},
|
|
96
|
+
hidden: false,
|
|
97
|
+
title: '',
|
|
98
|
+
isLocked: false,
|
|
99
|
+
conditionGroup: '',
|
|
100
|
+
children: [
|
|
101
|
+
{
|
|
102
|
+
componentName: 'YidaCodeCanvas',
|
|
103
|
+
id: nextNodeId(),
|
|
104
|
+
props: {
|
|
105
|
+
code: sourceCode,
|
|
106
|
+
runtimeCode,
|
|
107
|
+
pageType: 'application',
|
|
108
|
+
isWebCCompiled: true,
|
|
109
|
+
componentProps: {},
|
|
110
|
+
importedModules: importedModules || '',
|
|
111
|
+
},
|
|
112
|
+
condition: true,
|
|
113
|
+
hidden: false,
|
|
114
|
+
title: '',
|
|
115
|
+
isLocked: false,
|
|
116
|
+
conditionGroup: '',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
id: formUuid,
|
|
122
|
+
connectComponent: [],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
actions: {
|
|
126
|
+
module: { compiled: CANVAS_ACTIONS_COMPILED, source: CANVAS_ACTIONS_SOURCE },
|
|
127
|
+
type: 'FUNCTION',
|
|
128
|
+
list: [{ id: 'didMount', title: 'didMount' }],
|
|
129
|
+
},
|
|
130
|
+
config: { connectComponent: [] },
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function resolveSchemaBuilderDependency(value, createDefault, property) {
|
|
135
|
+
if (value === undefined) {
|
|
136
|
+
return createDefault();
|
|
137
|
+
}
|
|
138
|
+
if (typeof value !== 'function') {
|
|
139
|
+
throw new TypeError(`buildCanvasPageSchemaContent ${property} must be a function`);
|
|
140
|
+
}
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
module.exports = Object.freeze({
|
|
145
|
+
CANVAS_ACTIONS_COMPILED,
|
|
146
|
+
CANVAS_ACTIONS_SOURCE,
|
|
147
|
+
buildCanvasPageSchemaContent,
|
|
148
|
+
buildCanvasPageSchemaObject,
|
|
149
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { normalizeSchemaFields } = require('../schema-field-resolution');
|
|
4
|
+
|
|
5
|
+
function normalizeSchemaResult(schemaResult) {
|
|
6
|
+
if (schemaResult && schemaResult.content) {
|
|
7
|
+
return schemaResult;
|
|
8
|
+
}
|
|
9
|
+
return { content: schemaResult || {} };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function normalizeExpectedBinding(value) {
|
|
13
|
+
if (typeof value === 'string') {
|
|
14
|
+
return { fieldId: value };
|
|
15
|
+
}
|
|
16
|
+
if (value && typeof value === 'object') {
|
|
17
|
+
const fieldId = value.fieldId || value.id || value.value || '';
|
|
18
|
+
return Object.assign({}, value, { fieldId: String(fieldId || '') });
|
|
19
|
+
}
|
|
20
|
+
return { fieldId: '' };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function verifyFieldBindings(schemaResult, expectedBindings, options) {
|
|
24
|
+
const expectedComponentTypes = options && options.expectedComponentTypes || {};
|
|
25
|
+
const fields = normalizeSchemaFields(normalizeSchemaResult(schemaResult));
|
|
26
|
+
const fieldsById = new Map();
|
|
27
|
+
fields.forEach(function (field) {
|
|
28
|
+
if (field.fieldId) {
|
|
29
|
+
fieldsById.set(field.fieldId, field);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const verification = {
|
|
34
|
+
verified: [],
|
|
35
|
+
missing: [],
|
|
36
|
+
mismatched: [],
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
Object.keys(expectedBindings || {}).forEach(function (semanticPath) {
|
|
40
|
+
const expected = normalizeExpectedBinding(expectedBindings[semanticPath]);
|
|
41
|
+
const fieldId = expected.fieldId;
|
|
42
|
+
const expectedComponentType = expected.componentType || expected.componentName || expectedComponentTypes[semanticPath] || '';
|
|
43
|
+
|
|
44
|
+
if (!fieldId || !fieldsById.has(fieldId)) {
|
|
45
|
+
verification.missing.push({ semanticPath, fieldId });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const actual = fieldsById.get(fieldId);
|
|
50
|
+
if (expectedComponentType && actual.componentType !== expectedComponentType) {
|
|
51
|
+
verification.mismatched.push({
|
|
52
|
+
semanticPath,
|
|
53
|
+
fieldId,
|
|
54
|
+
expectedComponentType,
|
|
55
|
+
actualComponentType: actual.componentType,
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
verification.verified.push(semanticPath);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return verification;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = {
|
|
67
|
+
verifyFieldBindings,
|
|
68
|
+
};
|