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.
Files changed (139) hide show
  1. package/README.md +14 -0
  2. package/bin/yida.js +107 -18
  3. package/lib/app/create-app.js +12 -1
  4. package/lib/app/create-form/args.js +13 -0
  5. package/lib/app/create-form.js +154 -67
  6. package/lib/app/create-page.js +45 -9
  7. package/lib/app/get-schema.js +65 -14
  8. package/lib/app/import-app.js +92 -41
  9. package/lib/app/publish.js +289 -556
  10. package/lib/app/schema-field-resolution.js +370 -0
  11. package/lib/app/services/app-reader.js +85 -0
  12. package/lib/app/services/app-service.js +235 -0
  13. package/lib/app/services/canvas-page-compiler.js +91 -0
  14. package/lib/app/services/canvas-page-schema-builder.js +149 -0
  15. package/lib/app/services/field-bindings.js +68 -0
  16. package/lib/app/services/form-compiler.js +1922 -0
  17. package/lib/app/services/form-mode-service.js +182 -0
  18. package/lib/app/services/form-schema-patcher.js +333 -0
  19. package/lib/app/services/form-schema-reader.js +59 -0
  20. package/lib/app/services/form-service.js +379 -0
  21. package/lib/app/services/form-validation.js +562 -0
  22. package/lib/app/services/native-page-compiler.js +92 -0
  23. package/lib/app/services/native-page-schema-builder.js +428 -0
  24. package/lib/app/services/page-resource-service.js +185 -0
  25. package/lib/app/update-app.js +18 -6
  26. package/lib/auth/token-auth.js +34 -3
  27. package/lib/auth/token-store.js +22 -4
  28. package/lib/bridge/bridge.js +37 -5
  29. package/lib/core/agent-capabilities.js +5 -3
  30. package/lib/core/command-manifest.js +40 -0
  31. package/lib/core/doctor.js +15 -4
  32. package/lib/core/env-cmd.js +1 -1
  33. package/lib/core/env.js +7 -6
  34. package/lib/core/legacy-schema-guard.js +408 -0
  35. package/lib/core/locales/en.js +8 -46
  36. package/lib/core/locales/zh.js +8 -46
  37. package/lib/core/sample.js +1 -1
  38. package/lib/core/utils.js +334 -66
  39. package/lib/core/yida-client.js +104 -3
  40. package/lib/formula/evaluate.js +8 -66
  41. package/lib/formula/field-refs.js +83 -0
  42. package/lib/process/configure-process.js +44 -1992
  43. package/lib/process/create-process.js +54 -87
  44. package/lib/process/services/process-compiler.js +2056 -0
  45. package/lib/process/services/process-reader.js +232 -0
  46. package/lib/process/services/process-resource-service.js +571 -0
  47. package/lib/process/services/process-service.js +122 -0
  48. package/lib/process/services/process-stage-checkpoint.js +246 -0
  49. package/lib/report/append.js +7 -26
  50. package/lib/report/http.js +31 -5
  51. package/lib/report/index.js +10 -2
  52. package/lib/samples/yida-canvas-custom-page/business-list.canvas.jsx +63 -14
  53. package/lib/samples/yida-canvas-custom-page/dashboard-overview.canvas.jsx +176 -32
  54. package/lib/samples/yida-canvas-custom-page/data-management.canvas.jsx +228 -14
  55. package/lib/samples/yida-canvas-custom-page/split-pane-detail.canvas.jsx +204 -8
  56. package/lib/schema/adapters/app-adapter.js +210 -0
  57. package/lib/schema/adapters/form-adapter.js +1362 -0
  58. package/lib/schema/adapters/keys.js +19 -0
  59. package/lib/schema/adapters/page-adapter.js +566 -0
  60. package/lib/schema/adapters/process-adapter.js +519 -0
  61. package/lib/schema/applier.js +1878 -0
  62. package/lib/schema/apply-store.js +1083 -0
  63. package/lib/schema/command.js +645 -0
  64. package/lib/schema/dependency-graph.js +83 -0
  65. package/lib/schema/errors.js +481 -0
  66. package/lib/schema/hash.js +9 -0
  67. package/lib/schema/manifest-limits.js +177 -0
  68. package/lib/schema/manifest-loader.js +309 -0
  69. package/lib/schema/manifest-schema-v1.json +193 -0
  70. package/lib/schema/normalize-manifest.js +281 -0
  71. package/lib/schema/page-canvas-foundation.js +447 -0
  72. package/lib/schema/page-data-source-builder.js +561 -0
  73. package/lib/schema/page-foundation.js +556 -0
  74. package/lib/schema/page-source-loader.js +314 -0
  75. package/lib/schema/planner.js +691 -0
  76. package/lib/schema/remote-dispatch-boundary.js +39 -0
  77. package/lib/schema/remote-missing.js +21 -0
  78. package/lib/schema/remote-reader.js +189 -0
  79. package/lib/schema/resource-registry.js +157 -0
  80. package/lib/schema/server-revision.js +71 -0
  81. package/lib/schema/sort.js +28 -0
  82. package/lib/schema/state-store.js +589 -0
  83. package/package.json +2 -2
  84. package/scripts/postinstall.js +8 -12
  85. package/scripts/validate-package-size.js +1 -1
  86. package/yida-skills/SKILL.md +114 -29
  87. package/yida-skills/references/schema-as-code-phase1.md +99 -0
  88. package/yida-skills/references/setup-and-env.md +59 -59
  89. package/yida-skills/references/task-retrospective.md +6 -6
  90. package/yida-skills/skills/yida-app/SKILL.md +60 -14
  91. package/yida-skills/skills/yida-canvas-custom-page/SKILL.md +18 -7
  92. package/yida-skills/skills/yida-canvas-custom-page/references/data-bridge-guide.md +3 -3
  93. package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +7 -1
  94. package/yida-skills/skills/yida-create-app/SKILL.md +21 -3
  95. package/yida-skills/skills/yida-create-form-page/SKILL.md +19 -1
  96. package/yida-skills/skills/yida-create-page/SKILL.md +16 -3
  97. package/yida-skills/skills/yida-create-process/SKILL.md +100 -4
  98. package/yida-skills/skills/yida-custom-page/SKILL.md +19 -4
  99. package/yida-skills/skills/yida-dashboard/SKILL.md +1 -1
  100. package/yida-skills/skills/yida-dashboard/references/pitfalls.md +1 -1
  101. package/yida-skills/skills/yida-get-schema/SKILL.md +49 -5
  102. package/yida-skills/skills/yida-i18n/SKILL.md +1 -1
  103. package/yida-skills/skills/yida-integration/SKILL.md +7 -1
  104. package/yida-skills/skills/yida-login/SKILL.md +50 -99
  105. package/yida-skills/skills/yida-page-config/SKILL.md +7 -1
  106. package/yida-skills/skills/yida-page-uiux/references/app/blueprint.md +0 -1
  107. package/yida-skills/skills/yida-page-uiux/references/app/navigation-patterns.md +0 -1
  108. package/yida-skills/skills/yida-page-uiux/references/app/role-journey.md +0 -1
  109. package/yida-skills/skills/yida-page-uiux/references/dashboard/app-blueprint.md +0 -1
  110. package/yida-skills/skills/yida-page-uiux/references/dashboard/chart-contracts.md +0 -1
  111. package/yida-skills/skills/yida-page-uiux/references/dashboard/component-contracts.md +0 -1
  112. package/yida-skills/skills/yida-page-uiux/references/dashboard/layout-patterns.md +0 -1
  113. package/yida-skills/skills/yida-page-uiux/references/dashboard/theme-recipes.md +0 -1
  114. package/yida-skills/skills/yida-page-uiux/references/detail/object-narrative.md +0 -1
  115. package/yida-skills/skills/yida-page-uiux/references/detail/section-patterns.md +0 -1
  116. package/yida-skills/skills/yida-page-uiux/references/detail/timeline-and-related.md +0 -1
  117. package/yida-skills/skills/yida-page-uiux/references/landing/assets-workflow.md +0 -1
  118. package/yida-skills/skills/yida-page-uiux/references/landing/industry-playbooks.md +0 -1
  119. package/yida-skills/skills/yida-page-uiux/references/landing/research-levels.md +0 -1
  120. package/yida-skills/skills/yida-page-uiux/references/landing/section-patterns.md +0 -1
  121. package/yida-skills/skills/yida-page-uiux/references/list/drawer-detail.md +0 -1
  122. package/yida-skills/skills/yida-page-uiux/references/list/empty-loading-error.md +0 -1
  123. package/yida-skills/skills/yida-page-uiux/references/list/filter-patterns.md +0 -1
  124. package/yida-skills/skills/yida-page-uiux/references/list/table-patterns.md +0 -1
  125. package/yida-skills/skills/yida-page-uiux/references/scenes/screen.md +0 -1
  126. package/yida-skills/skills/yida-page-uiux/references/workbench/entry-patterns.md +0 -1
  127. package/yida-skills/skills/yida-page-uiux/references/workbench/portal-layouts.md +0 -1
  128. package/yida-skills/skills/yida-page-uiux/references/workbench/task-feed.md +0 -1
  129. package/yida-skills/skills/yida-page-uiux/workflow/output-decision-block.md +1 -1
  130. package/yida-skills/skills/yida-process-rule/SKILL.md +35 -1
  131. package/yida-skills/skills/yida-publish-page/SKILL.md +46 -4
  132. package/yida-skills/skills/yida-report/SKILL.md +7 -1
  133. package/yida-skills/skills-index.json +14 -46
  134. package/yida-skills/skills/large-file-write/SKILL.md +0 -93
  135. package/yida-skills/skills/large-file-write/references/write-patterns.md +0 -147
  136. package/yida-skills/skills/large-file-write/scripts/write.js +0 -157
  137. package/yida-skills/skills/sls-log-workbench/SKILL.md +0 -134
  138. package/yida-skills/skills/sls-log-workbench/references/workbench-reference.md +0 -130
  139. package/yida-skills/skills/sls-log-workbench/sls-query.js +0 -295
@@ -0,0 +1,379 @@
1
+ 'use strict';
2
+
3
+ const querystring = require('querystring');
4
+ const { httpPost, requestWithAutoLogin } = require('../../core/utils');
5
+ const { normalizeFormulaFieldRefs } = require('../../formula/evaluate');
6
+ const { compileFormDefinition, i18n } = require('./form-compiler');
7
+ const { readFormSchema, createFormServiceError } = require('./form-schema-reader');
8
+ const { verifyFieldBindings } = require('./field-bindings');
9
+ const { patchManagedFormSchema } = require('./form-schema-patcher');
10
+ const {
11
+ createServerRevisionConflict,
12
+ isSaveFormSchemaRevisionConflict,
13
+ requireSchemaServerRevision,
14
+ } = require('../../schema/server-revision');
15
+ const {
16
+ dispatchRemotePrimitive,
17
+ hasRemoteDispatchBoundary,
18
+ } = require('../../schema/remote-dispatch-boundary');
19
+ const { isTokenAuthRef } = require('../../core/yida-client');
20
+
21
+ function resolveAuthRef(context) {
22
+ return context && context.authRef ? context.authRef : context;
23
+ }
24
+
25
+ function buildFormDesignApiPath(appType, apiName, options = {}) {
26
+ const { prefix = '', namespace = 'dingtalk', addTimestamp = false } = options;
27
+ const prefixPath = prefix ? `/${prefix}` : '';
28
+ const timestamp = addTimestamp ? `?_stamp=${Date.now()}` : '';
29
+ return `/${namespace}/web/${appType}${prefixPath}/query/formdesign/${apiName}.json${timestamp}`;
30
+ }
31
+
32
+ function postFormDesign(auth, appType, apiName, params, options, request = httpPost) {
33
+ const postData = querystring.stringify(
34
+ Object.assign({ _csrf_token: auth.csrfToken }, params)
35
+ );
36
+ const formUuid = params && params.formUuid;
37
+ const referer = formUuid
38
+ ? `${auth.baseUrl}/alibaba/web/${params.appType || appType || ''}/design/pageDesigner?formUuid=${formUuid}`
39
+ : auth.baseUrl + '/';
40
+ return request(
41
+ auth.baseUrl,
42
+ buildFormDesignApiPath(appType, apiName, options),
43
+ postData,
44
+ auth.cookies,
45
+ { referer }
46
+ );
47
+ }
48
+
49
+ function sanitizeServiceResult(result) {
50
+ if (!result || typeof result !== 'object') {
51
+ return result || null;
52
+ }
53
+ const sanitized = {};
54
+ ['success', 'errorMsg', 'errorCode', 'code', 'message', '__httpStatus', '__nonJsonResponse', '__emptyBody'].forEach(function (key) {
55
+ if (Object.prototype.hasOwnProperty.call(result, key)) {
56
+ sanitized[key] = result[key];
57
+ }
58
+ });
59
+ return sanitized;
60
+ }
61
+
62
+ function assertSuccess(result, code, details) {
63
+ if (result && result.success !== false && !result.__needLogin && !result.__csrfExpired) {
64
+ return result;
65
+ }
66
+ const message = result ? result.errorMsg || 'request failed' : 'request failed';
67
+ throw createFormServiceError(message, code, Object.assign({ result: sanitizeServiceResult(result) }, details));
68
+ }
69
+
70
+ function assertConfigSuccess(result, details) {
71
+ if (result && result.success) {
72
+ return result;
73
+ }
74
+ if (isAcceptedNonJsonConfigResponse(result)) {
75
+ return {
76
+ success: true,
77
+ acceptedNonJsonResponse: true,
78
+ acceptedEmptyResponse: result.__emptyBody === true,
79
+ };
80
+ }
81
+ const message = result ? result.errorMsg || 'config update failed' : 'config update failed';
82
+ throw createFormServiceError(message, 'FORM_CONFIG_UPDATE_FAILED', Object.assign({
83
+ result: sanitizeServiceResult(result),
84
+ }, details));
85
+ }
86
+
87
+ function isAcceptedNonJsonConfigResponse(result) {
88
+ return !!(
89
+ result &&
90
+ result.success === false &&
91
+ result.__httpStatus === 200 &&
92
+ result.__nonJsonResponse === true &&
93
+ !result.__needLogin &&
94
+ !result.__csrfExpired &&
95
+ result.errorCode === undefined &&
96
+ result.code === undefined
97
+ );
98
+ }
99
+
100
+ function assertFieldBindingVerification(verification, details) {
101
+ const missing = verification && Array.isArray(verification.missing) ? verification.missing : [];
102
+ const mismatched = verification && Array.isArray(verification.mismatched) ? verification.mismatched : [];
103
+ if (missing.length === 0 && mismatched.length === 0) {
104
+ return verification;
105
+ }
106
+ throw createFormServiceError('field binding verification failed', 'FORM_FIELD_BINDING_VERIFICATION_FAILED', Object.assign({
107
+ missing,
108
+ mismatched,
109
+ }, details));
110
+ }
111
+
112
+ function normalizeTitlePayload(input) {
113
+ if (input.titleI18n && typeof input.titleI18n === 'object') {
114
+ return JSON.stringify(input.titleI18n);
115
+ }
116
+ const definition = input.definition && typeof input.definition === 'object' ? input.definition : {};
117
+ const title = input.formTitle || input.title || definition.title || '';
118
+ return JSON.stringify(i18n(title));
119
+ }
120
+
121
+ async function createBlankForm(context, input) {
122
+ const authRef = resolveAuthRef(context);
123
+ const services = context && context.services || {};
124
+ const request = services.httpPost || httpPost;
125
+ const requestWithAutoLoginImpl = services.requestWithAutoLogin || requestWithAutoLogin;
126
+ const appType = input && input.appType;
127
+ const send = auth => postFormDesign(auth, appType, 'saveFormSchemaInfo', {
128
+ formType: input && input.formType || 'receipt',
129
+ title: normalizeTitlePayload(input || {}),
130
+ }, undefined, request);
131
+ const result = hasRemoteDispatchBoundary(context)
132
+ ? await dispatchRemotePrimitive(context, () => send(requireSchemaWriteAuth(authRef, { appType })))
133
+ : await requestWithAutoLoginImpl(send, authRef);
134
+ assertSuccess(result, 'FORM_CREATE_BLANK_FAILED', { appType });
135
+ const formUuid = result.content && result.content.formUuid || result.content;
136
+ if (!formUuid) {
137
+ throw createFormServiceError('missing formUuid in create blank form response', 'FORM_CREATE_BLANK_FAILED', {
138
+ appType,
139
+ result,
140
+ });
141
+ }
142
+ return { formUuid, createResult: result };
143
+ }
144
+
145
+ async function saveFormSchema(context, input) {
146
+ const authRef = resolveAuthRef(context);
147
+ const appType = input && input.appType;
148
+ const formUuid = input && input.formUuid;
149
+ const schema = input && input.schema;
150
+ const serverRevision = requireSchemaServerRevision(
151
+ { gmtModified: input && input.serverRevision },
152
+ () => createFormServiceError(
153
+ 'remote Schema revision is missing or invalid',
154
+ 'FORM_SAVE_SCHEMA_PRECHECK_FAILED',
155
+ { appType, formUuid }
156
+ )
157
+ );
158
+ const fixedFormulaRefs = input && input.normalizeFormulaRefs === false
159
+ ? 0
160
+ : normalizeFormulaFieldRefs(schema);
161
+ requireSchemaWriteAuth(authRef, { appType, formUuid });
162
+ const request = context && context.services && context.services.httpPost || httpPost;
163
+ const result = await dispatchRemotePrimitive(context, () => postFormDesign(authRef, appType, 'saveFormSchema', {
164
+ appType,
165
+ formUuid,
166
+ content: JSON.stringify(schema),
167
+ schemaVersion: input && input.schemaVersion || 'V5',
168
+ prefix: '_view',
169
+ gmtModified: serverRevision,
170
+ }, { prefix: '_view' }, request));
171
+ if (isSaveFormSchemaRevisionConflict(result)) {
172
+ throw createServerRevisionConflict('form');
173
+ }
174
+ assertSuccess(result, 'FORM_SAVE_SCHEMA_FAILED', { appType, formUuid });
175
+ return { saveResult: result, fixedFormulaRefs };
176
+ }
177
+
178
+ function requireSchemaWriteAuth(authRef, details) {
179
+ if (!authRef || typeof authRef.baseUrl !== 'string' || authRef.baseUrl.length === 0) {
180
+ throw createFormServiceError(
181
+ 'Schema write authentication is not ready',
182
+ 'FORM_SAVE_SCHEMA_PRECHECK_FAILED',
183
+ details
184
+ );
185
+ }
186
+ if (isTokenAuthRef(authRef)) {
187
+ return authRef;
188
+ }
189
+ if (
190
+ typeof authRef.csrfToken !== 'string' ||
191
+ authRef.csrfToken.length === 0 ||
192
+ !Array.isArray(authRef.cookies)
193
+ ) {
194
+ throw createFormServiceError(
195
+ 'Schema write authentication is not ready',
196
+ 'FORM_SAVE_SCHEMA_PRECHECK_FAILED',
197
+ details
198
+ );
199
+ }
200
+ return authRef;
201
+ }
202
+
203
+ async function updateFormConfig(context, input) {
204
+ const authRef = resolveAuthRef(context);
205
+ const services = context && context.services || {};
206
+ const request = services.httpPost || httpPost;
207
+ const requestWithAutoLoginImpl = services.requestWithAutoLogin || requestWithAutoLogin;
208
+ const appType = input && input.appType;
209
+ const formUuid = input && input.formUuid;
210
+ const version = input && input.version !== undefined ? input.version : 1;
211
+ const value = input && input.value !== undefined ? input.value : 0;
212
+ const send = function (auth) {
213
+ const postData = querystring.stringify({
214
+ _csrf_token: auth.csrfToken,
215
+ formUuid,
216
+ version,
217
+ configType: 'MINI_RESOURCE',
218
+ value,
219
+ });
220
+ return request(
221
+ auth.baseUrl,
222
+ buildFormDesignApiPath(appType, 'updateFormConfig'),
223
+ postData,
224
+ auth.cookies
225
+ );
226
+ };
227
+ const result = hasRemoteDispatchBoundary(context)
228
+ ? await dispatchRemotePrimitive(context, () => send(requireSchemaWriteAuth(authRef, { appType, formUuid })))
229
+ : await requestWithAutoLoginImpl(send, authRef);
230
+ let configResult = result;
231
+ if (input && input.strict) {
232
+ configResult = assertConfigSuccess(result, { appType, formUuid });
233
+ }
234
+ return { configResult };
235
+ }
236
+
237
+ async function saveFormSchemaAndConfig(context, input) {
238
+ const saveResult = await saveFormSchema(context, input);
239
+ const configResult = await updateFormConfig(context, Object.assign({}, input, { strict: true }));
240
+ return Object.assign({}, saveResult, configResult);
241
+ }
242
+
243
+ async function createFormResource(context, input) {
244
+ const blank = await callWithDispatchBoundary(context, () => createBlankForm(context, input));
245
+ const compiled = compileFormDefinition(input.definition || input, Object.assign({}, input, {
246
+ formUuid: blank.formUuid,
247
+ }));
248
+ if (typeof context.checkpointCreateIdentity === 'function') {
249
+ await context.checkpointCreateIdentity({
250
+ appType: input.appType,
251
+ formUuid: blank.formUuid,
252
+ fieldBindings: compiled.fieldBindings,
253
+ fieldBindingComponents: compiled.fieldBindingComponents,
254
+ });
255
+ }
256
+ return resumeFormResource(context, Object.assign({}, input, {
257
+ compiled,
258
+ createResult: blank.createResult,
259
+ formUuid: blank.formUuid,
260
+ }));
261
+ }
262
+
263
+ async function resumeFormResource(context, input) {
264
+ const currentSchemaResult = input.currentSchemaResult || await callWithDispatchBoundary(
265
+ context,
266
+ () => readFormSchema(context, {
267
+ appType: input.appType,
268
+ formUuid: input.formUuid,
269
+ })
270
+ );
271
+ const compiled = input.compiled || compileFormDefinition(input.definition || input, Object.assign({}, input, {
272
+ formUuid: input.formUuid,
273
+ }));
274
+ const saveResult = await callWithDispatchBoundary(
275
+ context,
276
+ () => saveFormSchema(context, Object.assign({}, input, {
277
+ schema: compiled.schema,
278
+ serverRevision: requireSchemaServerRevision(currentSchemaResult),
279
+ }))
280
+ );
281
+ const configResult = await callWithDispatchBoundary(
282
+ context,
283
+ () => updateFormConfig(context, Object.assign({}, input, { strict: true }))
284
+ );
285
+ const schemaResult = await callWithDispatchBoundary(context, () => readFormSchema(context, {
286
+ appType: input.appType,
287
+ formUuid: input.formUuid,
288
+ }));
289
+ const verification = verifyFieldBindings(schemaResult, compiled.fieldBindings, {
290
+ expectedComponentTypes: compiled.fieldBindingComponents,
291
+ });
292
+ assertFieldBindingVerification(verification, {
293
+ appType: input.appType,
294
+ formUuid: input.formUuid,
295
+ });
296
+
297
+ return {
298
+ appType: input.appType,
299
+ formUuid: input.formUuid,
300
+ schema: compiled.schema,
301
+ fieldBindings: compiled.fieldBindings,
302
+ fieldBindingComponents: compiled.fieldBindingComponents,
303
+ verification,
304
+ createResult: input.createResult,
305
+ saveResult: saveResult.saveResult,
306
+ configResult: configResult.configResult,
307
+ schemaResult,
308
+ };
309
+ }
310
+
311
+ function prepareFormResourceUpdate(input) {
312
+ const compiled = compileFormDefinition(input.definition || input, Object.assign({}, input, {
313
+ appType: input.appType,
314
+ existingBindings: input.existingBindings,
315
+ formUuid: input.formUuid,
316
+ }));
317
+ const schema = patchManagedFormSchema(input.currentSchemaResult, compiled, {
318
+ existingBindings: input.existingBindings,
319
+ });
320
+ return { compiled, schema };
321
+ }
322
+
323
+ async function updateFormResource(context, input) {
324
+ const prepared = input.prepared || prepareFormResourceUpdate(input);
325
+ const saveResult = await callWithDispatchBoundary(context, () => saveFormSchema(context, Object.assign({}, input, {
326
+ schema: prepared.schema,
327
+ serverRevision: input.serverRevision,
328
+ })));
329
+ const configResult = await callWithDispatchBoundary(
330
+ context,
331
+ () => updateFormConfig(context, Object.assign({}, input, { strict: true }))
332
+ );
333
+ const schemaResult = await callWithDispatchBoundary(context, () => readFormSchema(context, {
334
+ appType: input.appType,
335
+ formUuid: input.formUuid,
336
+ }));
337
+ const verification = verifyFieldBindings(schemaResult, prepared.compiled.fieldBindings, {
338
+ expectedComponentTypes: prepared.compiled.fieldBindingComponents,
339
+ });
340
+ assertFieldBindingVerification(verification, {
341
+ appType: input.appType,
342
+ formUuid: input.formUuid,
343
+ });
344
+
345
+ return {
346
+ appType: input.appType,
347
+ formUuid: input.formUuid,
348
+ schema: prepared.schema,
349
+ fieldBindings: prepared.compiled.fieldBindings,
350
+ fieldBindingComponents: prepared.compiled.fieldBindingComponents,
351
+ verification,
352
+ saveResult: saveResult.saveResult,
353
+ configResult: configResult.configResult,
354
+ schemaResult,
355
+ };
356
+ }
357
+
358
+ async function callWithDispatchBoundary(context, callback) {
359
+ if (typeof context.assertRemoteDispatchBoundary === 'function') {
360
+ context.assertRemoteDispatchBoundary('before');
361
+ }
362
+ const result = await callback();
363
+ if (typeof context.assertRemoteDispatchBoundary === 'function') {
364
+ context.assertRemoteDispatchBoundary('after');
365
+ }
366
+ return result;
367
+ }
368
+
369
+ module.exports = {
370
+ buildFormDesignApiPath,
371
+ createBlankForm,
372
+ saveFormSchema,
373
+ updateFormConfig,
374
+ saveFormSchemaAndConfig,
375
+ createFormResource,
376
+ resumeFormResource,
377
+ prepareFormResourceUpdate,
378
+ updateFormResource,
379
+ };