@nocobase/plugin-flow-engine 2.1.0-alpha.13 → 2.1.0-alpha.15

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 (661) hide show
  1. package/dist/ai/ai-employees/nathan/index.js +1 -112
  2. package/dist/ai/ai-employees/nathan/prompt.md +132 -0
  3. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextApis.js +2 -2
  4. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextEnvs.js +2 -2
  5. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextVars.js +2 -2
  6. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/lintAndTestJS.js +2 -2
  7. package/dist/client/index.js +1 -1
  8. package/dist/externalVersion.js +10 -13
  9. package/dist/locale/en-US.json +1 -0
  10. package/dist/locale/index.d.ts +2 -0
  11. package/dist/locale/zh-CN.json +1 -0
  12. package/dist/node_modules/ses/package.json +1 -1
  13. package/dist/node_modules/zod/package.json +1 -1
  14. package/dist/server/flow-surfaces/action-scope.d.ts +37 -0
  15. package/dist/server/flow-surfaces/action-scope.js +146 -0
  16. package/dist/server/flow-surfaces/builder.d.ts +209 -0
  17. package/dist/server/flow-surfaces/builder.js +858 -0
  18. package/dist/server/flow-surfaces/catalog.d.ts +65 -0
  19. package/dist/server/flow-surfaces/catalog.js +2766 -0
  20. package/dist/server/flow-surfaces/chart-config.d.ts +121 -0
  21. package/dist/server/flow-surfaces/chart-config.js +1394 -0
  22. package/dist/server/flow-surfaces/compiler.d.ts +22 -0
  23. package/dist/server/flow-surfaces/compiler.js +1129 -0
  24. package/dist/server/flow-surfaces/configure-options.d.ts +23 -0
  25. package/dist/server/flow-surfaces/configure-options.js +671 -0
  26. package/dist/server/flow-surfaces/constants.d.ts +13 -0
  27. package/dist/server/flow-surfaces/constants.js +137 -0
  28. package/dist/server/flow-surfaces/context.d.ts +72 -0
  29. package/dist/server/flow-surfaces/context.js +556 -0
  30. package/dist/server/flow-surfaces/contract-guard.d.ts +19 -0
  31. package/dist/server/flow-surfaces/contract-guard.js +411 -0
  32. package/dist/server/flow-surfaces/errors.d.ts +47 -0
  33. package/dist/server/flow-surfaces/errors.js +145 -0
  34. package/dist/server/flow-surfaces/executor.d.ts +13 -0
  35. package/dist/server/flow-surfaces/executor.js +97 -0
  36. package/dist/server/flow-surfaces/field-semantics.d.ts +15 -0
  37. package/dist/server/flow-surfaces/field-semantics.js +80 -0
  38. package/dist/server/{flow-schema-registry → flow-surfaces}/index.d.ts +3 -2
  39. package/dist/server/flow-surfaces/index.js +352 -0
  40. package/dist/server/flow-surfaces/locator.d.ts +28 -0
  41. package/dist/server/flow-surfaces/locator.js +238 -0
  42. package/dist/server/flow-surfaces/placement.d.ts +33 -0
  43. package/dist/server/flow-surfaces/placement.js +192 -0
  44. package/dist/server/flow-surfaces/route-sync.d.ts +47 -0
  45. package/dist/server/flow-surfaces/route-sync.js +392 -0
  46. package/dist/server/flow-surfaces/service.d.ts +530 -0
  47. package/dist/server/flow-surfaces/service.js +7736 -0
  48. package/dist/server/flow-surfaces/support-matrix.d.ts +28 -0
  49. package/dist/server/flow-surfaces/support-matrix.js +246 -0
  50. package/dist/server/flow-surfaces/surface-context.d.ts +51 -0
  51. package/dist/server/flow-surfaces/surface-context.js +356 -0
  52. package/dist/server/flow-surfaces/types.d.ts +192 -0
  53. package/dist/server/index.d.ts +1 -1
  54. package/dist/server/index.js +6 -4
  55. package/dist/server/plugin.d.ts +0 -3
  56. package/dist/server/plugin.js +7 -36
  57. package/dist/server/repository.d.ts +9 -68
  58. package/dist/server/repository.js +106 -420
  59. package/dist/server/server.d.ts +0 -7
  60. package/dist/server/server.js +53 -23
  61. package/dist/server/variables/resolve.d.ts +21 -0
  62. package/dist/server/variables/resolve.js +79 -0
  63. package/dist/swagger/flow-surfaces.d.ts +3186 -0
  64. package/dist/swagger/flow-surfaces.js +4320 -0
  65. package/dist/swagger/index.d.ts +2837 -810
  66. package/dist/swagger/index.js +14 -696
  67. package/package.json +2 -4
  68. package/dist/node_modules/ajv/.runkit_example.js +0 -23
  69. package/dist/node_modules/ajv/LICENSE +0 -22
  70. package/dist/node_modules/ajv/dist/2019.d.ts +0 -19
  71. package/dist/node_modules/ajv/dist/2019.js +0 -61
  72. package/dist/node_modules/ajv/dist/2020.d.ts +0 -19
  73. package/dist/node_modules/ajv/dist/2020.js +0 -55
  74. package/dist/node_modules/ajv/dist/ajv.d.ts +0 -18
  75. package/dist/node_modules/ajv/dist/ajv.js +0 -7
  76. package/dist/node_modules/ajv/dist/compile/codegen/code.d.ts +0 -40
  77. package/dist/node_modules/ajv/dist/compile/codegen/code.js +0 -156
  78. package/dist/node_modules/ajv/dist/compile/codegen/index.d.ts +0 -79
  79. package/dist/node_modules/ajv/dist/compile/codegen/index.js +0 -697
  80. package/dist/node_modules/ajv/dist/compile/codegen/scope.d.ts +0 -79
  81. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +0 -143
  82. package/dist/node_modules/ajv/dist/compile/errors.d.ts +0 -13
  83. package/dist/node_modules/ajv/dist/compile/errors.js +0 -123
  84. package/dist/node_modules/ajv/dist/compile/index.d.ts +0 -80
  85. package/dist/node_modules/ajv/dist/compile/index.js +0 -242
  86. package/dist/node_modules/ajv/dist/compile/jtd/parse.d.ts +0 -4
  87. package/dist/node_modules/ajv/dist/compile/jtd/parse.js +0 -350
  88. package/dist/node_modules/ajv/dist/compile/jtd/serialize.d.ts +0 -4
  89. package/dist/node_modules/ajv/dist/compile/jtd/serialize.js +0 -236
  90. package/dist/node_modules/ajv/dist/compile/jtd/types.d.ts +0 -6
  91. package/dist/node_modules/ajv/dist/compile/jtd/types.js +0 -14
  92. package/dist/node_modules/ajv/dist/compile/names.d.ts +0 -20
  93. package/dist/node_modules/ajv/dist/compile/names.js +0 -28
  94. package/dist/node_modules/ajv/dist/compile/ref_error.d.ts +0 -6
  95. package/dist/node_modules/ajv/dist/compile/ref_error.js +0 -12
  96. package/dist/node_modules/ajv/dist/compile/resolve.d.ts +0 -12
  97. package/dist/node_modules/ajv/dist/compile/resolve.js +0 -155
  98. package/dist/node_modules/ajv/dist/compile/rules.d.ts +0 -28
  99. package/dist/node_modules/ajv/dist/compile/rules.js +0 -26
  100. package/dist/node_modules/ajv/dist/compile/util.d.ts +0 -40
  101. package/dist/node_modules/ajv/dist/compile/util.js +0 -178
  102. package/dist/node_modules/ajv/dist/compile/validate/applicability.d.ts +0 -6
  103. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +0 -19
  104. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +0 -4
  105. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -50
  106. package/dist/node_modules/ajv/dist/compile/validate/dataType.d.ts +0 -17
  107. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +0 -203
  108. package/dist/node_modules/ajv/dist/compile/validate/defaults.d.ts +0 -2
  109. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +0 -35
  110. package/dist/node_modules/ajv/dist/compile/validate/index.d.ts +0 -42
  111. package/dist/node_modules/ajv/dist/compile/validate/index.js +0 -520
  112. package/dist/node_modules/ajv/dist/compile/validate/keyword.d.ts +0 -8
  113. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +0 -124
  114. package/dist/node_modules/ajv/dist/compile/validate/subschema.d.ts +0 -47
  115. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +0 -81
  116. package/dist/node_modules/ajv/dist/core.d.ts +0 -174
  117. package/dist/node_modules/ajv/dist/core.js +0 -618
  118. package/dist/node_modules/ajv/dist/jtd.d.ts +0 -47
  119. package/dist/node_modules/ajv/dist/jtd.js +0 -72
  120. package/dist/node_modules/ajv/dist/refs/data.json +0 -13
  121. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +0 -2
  122. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +0 -28
  123. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +0 -53
  124. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +0 -17
  125. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +0 -57
  126. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +0 -14
  127. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +0 -37
  128. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +0 -90
  129. package/dist/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +0 -39
  130. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +0 -2
  131. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +0 -30
  132. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +0 -48
  133. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +0 -17
  134. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +0 -51
  135. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +0 -14
  136. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +0 -37
  137. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +0 -15
  138. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +0 -90
  139. package/dist/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +0 -55
  140. package/dist/node_modules/ajv/dist/refs/json-schema-draft-06.json +0 -137
  141. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json +0 -151
  142. package/dist/node_modules/ajv/dist/refs/json-schema-secure.json +0 -88
  143. package/dist/node_modules/ajv/dist/refs/jtd-schema.d.ts +0 -3
  144. package/dist/node_modules/ajv/dist/refs/jtd-schema.js +0 -118
  145. package/dist/node_modules/ajv/dist/runtime/equal.d.ts +0 -6
  146. package/dist/node_modules/ajv/dist/runtime/equal.js +0 -7
  147. package/dist/node_modules/ajv/dist/runtime/parseJson.d.ts +0 -18
  148. package/dist/node_modules/ajv/dist/runtime/parseJson.js +0 -185
  149. package/dist/node_modules/ajv/dist/runtime/quote.d.ts +0 -5
  150. package/dist/node_modules/ajv/dist/runtime/quote.js +0 -30
  151. package/dist/node_modules/ajv/dist/runtime/re2.d.ts +0 -6
  152. package/dist/node_modules/ajv/dist/runtime/re2.js +0 -6
  153. package/dist/node_modules/ajv/dist/runtime/timestamp.d.ts +0 -5
  154. package/dist/node_modules/ajv/dist/runtime/timestamp.js +0 -42
  155. package/dist/node_modules/ajv/dist/runtime/ucs2length.d.ts +0 -5
  156. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +0 -24
  157. package/dist/node_modules/ajv/dist/runtime/uri.d.ts +0 -6
  158. package/dist/node_modules/ajv/dist/runtime/uri.js +0 -6
  159. package/dist/node_modules/ajv/dist/runtime/validation_error.d.ts +0 -7
  160. package/dist/node_modules/ajv/dist/runtime/validation_error.js +0 -11
  161. package/dist/node_modules/ajv/dist/standalone/index.d.ts +0 -6
  162. package/dist/node_modules/ajv/dist/standalone/index.js +0 -90
  163. package/dist/node_modules/ajv/dist/standalone/instance.d.ts +0 -12
  164. package/dist/node_modules/ajv/dist/standalone/instance.js +0 -35
  165. package/dist/node_modules/ajv/dist/types/index.d.ts +0 -183
  166. package/dist/node_modules/ajv/dist/types/index.js +0 -3
  167. package/dist/node_modules/ajv/dist/types/json-schema.d.ts +0 -125
  168. package/dist/node_modules/ajv/dist/types/json-schema.js +0 -3
  169. package/dist/node_modules/ajv/dist/types/jtd-schema.d.ts +0 -174
  170. package/dist/node_modules/ajv/dist/types/jtd-schema.js +0 -3
  171. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +0 -8
  172. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -49
  173. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +0 -6
  174. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -106
  175. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +0 -3
  176. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -23
  177. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +0 -4
  178. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -12
  179. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +0 -7
  180. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -95
  181. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +0 -21
  182. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -85
  183. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +0 -3
  184. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +0 -11
  185. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +0 -6
  186. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -66
  187. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +0 -13
  188. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -44
  189. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +0 -5
  190. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -52
  191. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +0 -6
  192. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -30
  193. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +0 -4
  194. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -26
  195. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +0 -6
  196. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -60
  197. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +0 -3
  198. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -75
  199. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +0 -3
  200. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -12
  201. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +0 -3
  202. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -54
  203. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +0 -6
  204. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -38
  205. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +0 -3
  206. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -13
  207. package/dist/node_modules/ajv/dist/vocabularies/code.d.ts +0 -17
  208. package/dist/node_modules/ajv/dist/vocabularies/code.js +0 -131
  209. package/dist/node_modules/ajv/dist/vocabularies/core/id.d.ts +0 -3
  210. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +0 -10
  211. package/dist/node_modules/ajv/dist/vocabularies/core/index.d.ts +0 -3
  212. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +0 -16
  213. package/dist/node_modules/ajv/dist/vocabularies/core/ref.d.ts +0 -8
  214. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +0 -122
  215. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +0 -5
  216. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -104
  217. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +0 -10
  218. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -9
  219. package/dist/node_modules/ajv/dist/vocabularies/draft2020.d.ts +0 -3
  220. package/dist/node_modules/ajv/dist/vocabularies/draft2020.js +0 -23
  221. package/dist/node_modules/ajv/dist/vocabularies/draft7.d.ts +0 -3
  222. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +0 -17
  223. package/dist/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +0 -5
  224. package/dist/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +0 -30
  225. package/dist/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +0 -5
  226. package/dist/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +0 -51
  227. package/dist/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +0 -3
  228. package/dist/node_modules/ajv/dist/vocabularies/dynamic/index.js +0 -9
  229. package/dist/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +0 -3
  230. package/dist/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +0 -16
  231. package/dist/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +0 -3
  232. package/dist/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +0 -10
  233. package/dist/node_modules/ajv/dist/vocabularies/errors.d.ts +0 -9
  234. package/dist/node_modules/ajv/dist/vocabularies/errors.js +0 -3
  235. package/dist/node_modules/ajv/dist/vocabularies/format/format.d.ts +0 -8
  236. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +0 -92
  237. package/dist/node_modules/ajv/dist/vocabularies/format/index.d.ts +0 -3
  238. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +0 -6
  239. package/dist/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +0 -6
  240. package/dist/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +0 -71
  241. package/dist/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +0 -5
  242. package/dist/node_modules/ajv/dist/vocabularies/jtd/elements.js +0 -24
  243. package/dist/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +0 -6
  244. package/dist/node_modules/ajv/dist/vocabularies/jtd/enum.js +0 -43
  245. package/dist/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +0 -9
  246. package/dist/node_modules/ajv/dist/vocabularies/jtd/error.js +0 -20
  247. package/dist/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +0 -10
  248. package/dist/node_modules/ajv/dist/vocabularies/jtd/index.js +0 -29
  249. package/dist/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +0 -5
  250. package/dist/node_modules/ajv/dist/vocabularies/jtd/metadata.js +0 -25
  251. package/dist/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +0 -4
  252. package/dist/node_modules/ajv/dist/vocabularies/jtd/nullable.js +0 -22
  253. package/dist/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +0 -3
  254. package/dist/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +0 -15
  255. package/dist/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +0 -22
  256. package/dist/node_modules/ajv/dist/vocabularies/jtd/properties.js +0 -149
  257. package/dist/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +0 -4
  258. package/dist/node_modules/ajv/dist/vocabularies/jtd/ref.js +0 -67
  259. package/dist/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +0 -10
  260. package/dist/node_modules/ajv/dist/vocabularies/jtd/type.js +0 -69
  261. package/dist/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +0 -3
  262. package/dist/node_modules/ajv/dist/vocabularies/jtd/union.js +0 -12
  263. package/dist/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +0 -5
  264. package/dist/node_modules/ajv/dist/vocabularies/jtd/values.js +0 -51
  265. package/dist/node_modules/ajv/dist/vocabularies/metadata.d.ts +0 -3
  266. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +0 -18
  267. package/dist/node_modules/ajv/dist/vocabularies/next.d.ts +0 -3
  268. package/dist/node_modules/ajv/dist/vocabularies/next.js +0 -8
  269. package/dist/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +0 -3
  270. package/dist/node_modules/ajv/dist/vocabularies/unevaluated/index.js +0 -7
  271. package/dist/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +0 -6
  272. package/dist/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +0 -40
  273. package/dist/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +0 -6
  274. package/dist/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +0 -65
  275. package/dist/node_modules/ajv/dist/vocabularies/validation/const.d.ts +0 -6
  276. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +0 -25
  277. package/dist/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +0 -5
  278. package/dist/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +0 -12
  279. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +0 -8
  280. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -48
  281. package/dist/node_modules/ajv/dist/vocabularies/validation/index.d.ts +0 -16
  282. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +0 -33
  283. package/dist/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +0 -3
  284. package/dist/node_modules/ajv/dist/vocabularies/validation/limitContains.js +0 -15
  285. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +0 -3
  286. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -24
  287. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +0 -3
  288. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -27
  289. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +0 -11
  290. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -27
  291. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +0 -3
  292. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -24
  293. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +0 -8
  294. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -26
  295. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +0 -8
  296. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -33
  297. package/dist/node_modules/ajv/dist/vocabularies/validation/required.d.ts +0 -8
  298. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +0 -79
  299. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +0 -9
  300. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -64
  301. package/dist/node_modules/ajv/lib/2019.ts +0 -81
  302. package/dist/node_modules/ajv/lib/2020.ts +0 -75
  303. package/dist/node_modules/ajv/lib/ajv.ts +0 -70
  304. package/dist/node_modules/ajv/lib/compile/codegen/code.ts +0 -169
  305. package/dist/node_modules/ajv/lib/compile/codegen/index.ts +0 -852
  306. package/dist/node_modules/ajv/lib/compile/codegen/scope.ts +0 -215
  307. package/dist/node_modules/ajv/lib/compile/errors.ts +0 -184
  308. package/dist/node_modules/ajv/lib/compile/index.ts +0 -324
  309. package/dist/node_modules/ajv/lib/compile/jtd/parse.ts +0 -411
  310. package/dist/node_modules/ajv/lib/compile/jtd/serialize.ts +0 -277
  311. package/dist/node_modules/ajv/lib/compile/jtd/types.ts +0 -16
  312. package/dist/node_modules/ajv/lib/compile/names.ts +0 -27
  313. package/dist/node_modules/ajv/lib/compile/ref_error.ts +0 -13
  314. package/dist/node_modules/ajv/lib/compile/resolve.ts +0 -149
  315. package/dist/node_modules/ajv/lib/compile/rules.ts +0 -50
  316. package/dist/node_modules/ajv/lib/compile/util.ts +0 -213
  317. package/dist/node_modules/ajv/lib/compile/validate/applicability.ts +0 -22
  318. package/dist/node_modules/ajv/lib/compile/validate/boolSchema.ts +0 -47
  319. package/dist/node_modules/ajv/lib/compile/validate/dataType.ts +0 -230
  320. package/dist/node_modules/ajv/lib/compile/validate/defaults.ts +0 -32
  321. package/dist/node_modules/ajv/lib/compile/validate/index.ts +0 -582
  322. package/dist/node_modules/ajv/lib/compile/validate/keyword.ts +0 -171
  323. package/dist/node_modules/ajv/lib/compile/validate/subschema.ts +0 -135
  324. package/dist/node_modules/ajv/lib/core.ts +0 -892
  325. package/dist/node_modules/ajv/lib/jtd.ts +0 -132
  326. package/dist/node_modules/ajv/lib/refs/data.json +0 -13
  327. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +0 -28
  328. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +0 -53
  329. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +0 -17
  330. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +0 -57
  331. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +0 -14
  332. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +0 -37
  333. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +0 -90
  334. package/dist/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +0 -39
  335. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +0 -30
  336. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +0 -48
  337. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +0 -17
  338. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +0 -51
  339. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +0 -14
  340. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +0 -37
  341. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +0 -15
  342. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +0 -90
  343. package/dist/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +0 -55
  344. package/dist/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -137
  345. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -151
  346. package/dist/node_modules/ajv/lib/refs/json-schema-secure.json +0 -88
  347. package/dist/node_modules/ajv/lib/refs/jtd-schema.ts +0 -130
  348. package/dist/node_modules/ajv/lib/runtime/equal.ts +0 -7
  349. package/dist/node_modules/ajv/lib/runtime/parseJson.ts +0 -177
  350. package/dist/node_modules/ajv/lib/runtime/quote.ts +0 -31
  351. package/dist/node_modules/ajv/lib/runtime/re2.ts +0 -6
  352. package/dist/node_modules/ajv/lib/runtime/timestamp.ts +0 -46
  353. package/dist/node_modules/ajv/lib/runtime/ucs2length.ts +0 -20
  354. package/dist/node_modules/ajv/lib/runtime/uri.ts +0 -6
  355. package/dist/node_modules/ajv/lib/runtime/validation_error.ts +0 -13
  356. package/dist/node_modules/ajv/lib/standalone/index.ts +0 -100
  357. package/dist/node_modules/ajv/lib/standalone/instance.ts +0 -36
  358. package/dist/node_modules/ajv/lib/types/index.ts +0 -244
  359. package/dist/node_modules/ajv/lib/types/json-schema.ts +0 -187
  360. package/dist/node_modules/ajv/lib/types/jtd-schema.ts +0 -273
  361. package/dist/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +0 -56
  362. package/dist/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +0 -118
  363. package/dist/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +0 -22
  364. package/dist/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +0 -14
  365. package/dist/node_modules/ajv/lib/vocabularies/applicator/contains.ts +0 -109
  366. package/dist/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +0 -112
  367. package/dist/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +0 -11
  368. package/dist/node_modules/ajv/lib/vocabularies/applicator/if.ts +0 -80
  369. package/dist/node_modules/ajv/lib/vocabularies/applicator/index.ts +0 -53
  370. package/dist/node_modules/ajv/lib/vocabularies/applicator/items.ts +0 -59
  371. package/dist/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +0 -36
  372. package/dist/node_modules/ajv/lib/vocabularies/applicator/not.ts +0 -38
  373. package/dist/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +0 -82
  374. package/dist/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +0 -91
  375. package/dist/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +0 -12
  376. package/dist/node_modules/ajv/lib/vocabularies/applicator/properties.ts +0 -57
  377. package/dist/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +0 -50
  378. package/dist/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +0 -13
  379. package/dist/node_modules/ajv/lib/vocabularies/code.ts +0 -168
  380. package/dist/node_modules/ajv/lib/vocabularies/core/id.ts +0 -10
  381. package/dist/node_modules/ajv/lib/vocabularies/core/index.ts +0 -16
  382. package/dist/node_modules/ajv/lib/vocabularies/core/ref.ts +0 -129
  383. package/dist/node_modules/ajv/lib/vocabularies/discriminator/index.ts +0 -113
  384. package/dist/node_modules/ajv/lib/vocabularies/discriminator/types.ts +0 -12
  385. package/dist/node_modules/ajv/lib/vocabularies/draft2020.ts +0 -23
  386. package/dist/node_modules/ajv/lib/vocabularies/draft7.ts +0 -17
  387. package/dist/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +0 -31
  388. package/dist/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +0 -51
  389. package/dist/node_modules/ajv/lib/vocabularies/dynamic/index.ts +0 -9
  390. package/dist/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +0 -14
  391. package/dist/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +0 -10
  392. package/dist/node_modules/ajv/lib/vocabularies/errors.ts +0 -18
  393. package/dist/node_modules/ajv/lib/vocabularies/format/format.ts +0 -120
  394. package/dist/node_modules/ajv/lib/vocabularies/format/index.ts +0 -6
  395. package/dist/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +0 -89
  396. package/dist/node_modules/ajv/lib/vocabularies/jtd/elements.ts +0 -32
  397. package/dist/node_modules/ajv/lib/vocabularies/jtd/enum.ts +0 -45
  398. package/dist/node_modules/ajv/lib/vocabularies/jtd/error.ts +0 -23
  399. package/dist/node_modules/ajv/lib/vocabularies/jtd/index.ts +0 -37
  400. package/dist/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +0 -24
  401. package/dist/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +0 -21
  402. package/dist/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +0 -15
  403. package/dist/node_modules/ajv/lib/vocabularies/jtd/properties.ts +0 -184
  404. package/dist/node_modules/ajv/lib/vocabularies/jtd/ref.ts +0 -76
  405. package/dist/node_modules/ajv/lib/vocabularies/jtd/type.ts +0 -75
  406. package/dist/node_modules/ajv/lib/vocabularies/jtd/union.ts +0 -12
  407. package/dist/node_modules/ajv/lib/vocabularies/jtd/values.ts +0 -58
  408. package/dist/node_modules/ajv/lib/vocabularies/metadata.ts +0 -17
  409. package/dist/node_modules/ajv/lib/vocabularies/next.ts +0 -8
  410. package/dist/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +0 -7
  411. package/dist/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +0 -47
  412. package/dist/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +0 -85
  413. package/dist/node_modules/ajv/lib/vocabularies/validation/const.ts +0 -28
  414. package/dist/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +0 -23
  415. package/dist/node_modules/ajv/lib/vocabularies/validation/enum.ts +0 -54
  416. package/dist/node_modules/ajv/lib/vocabularies/validation/index.ts +0 -49
  417. package/dist/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +0 -16
  418. package/dist/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +0 -26
  419. package/dist/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +0 -30
  420. package/dist/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +0 -42
  421. package/dist/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +0 -26
  422. package/dist/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +0 -34
  423. package/dist/node_modules/ajv/lib/vocabularies/validation/pattern.ts +0 -39
  424. package/dist/node_modules/ajv/lib/vocabularies/validation/required.ts +0 -98
  425. package/dist/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +0 -79
  426. package/dist/node_modules/ajv/package.json +0 -1
  427. package/dist/server/flow-models/action-handlers.d.ts +0 -26
  428. package/dist/server/flow-models/action-handlers.js +0 -209
  429. package/dist/server/flow-models/http-error-adapter.d.ts +0 -10
  430. package/dist/server/flow-models/http-error-adapter.js +0 -58
  431. package/dist/server/flow-models/mutate-executor.d.ts +0 -17
  432. package/dist/server/flow-models/mutate-executor.js +0 -309
  433. package/dist/server/flow-models/repository-internals/duplicate-helpers.d.ts +0 -12
  434. package/dist/server/flow-models/repository-internals/duplicate-helpers.js +0 -121
  435. package/dist/server/flow-models/repository-internals/ensure-lock.d.ts +0 -15
  436. package/dist/server/flow-models/repository-internals/ensure-lock.js +0 -117
  437. package/dist/server/flow-models/repository-internals/errors.d.ts +0 -21
  438. package/dist/server/flow-models/repository-internals/errors.js +0 -78
  439. package/dist/server/flow-models/schema-contribution-collector.d.ts +0 -28
  440. package/dist/server/flow-models/schema-contribution-collector.js +0 -238
  441. package/dist/server/flow-models/validation-facade.d.ts +0 -29
  442. package/dist/server/flow-models/validation-facade.js +0 -181
  443. package/dist/server/flow-schema-contributions/actions/aclCheck.d.ts +0 -10
  444. package/dist/server/flow-schema-contributions/actions/aclCheck.js +0 -46
  445. package/dist/server/flow-schema-contributions/actions/aclCheckRefresh.d.ts +0 -10
  446. package/dist/server/flow-schema-contributions/actions/aclCheckRefresh.js +0 -46
  447. package/dist/server/flow-schema-contributions/actions/actionLinkageRules.d.ts +0 -10
  448. package/dist/server/flow-schema-contributions/actions/actionLinkageRules.js +0 -48
  449. package/dist/server/flow-schema-contributions/actions/confirm.d.ts +0 -10
  450. package/dist/server/flow-schema-contributions/actions/confirm.js +0 -73
  451. package/dist/server/flow-schema-contributions/actions/customVariable.d.ts +0 -10
  452. package/dist/server/flow-schema-contributions/actions/customVariable.js +0 -76
  453. package/dist/server/flow-schema-contributions/actions/dataScope.d.ts +0 -10
  454. package/dist/server/flow-schema-contributions/actions/dataScope.js +0 -79
  455. package/dist/server/flow-schema-contributions/actions/detailsFieldLinkageRules.d.ts +0 -10
  456. package/dist/server/flow-schema-contributions/actions/detailsFieldLinkageRules.js +0 -62
  457. package/dist/server/flow-schema-contributions/actions/fieldLinkageRules.d.ts +0 -10
  458. package/dist/server/flow-schema-contributions/actions/fieldLinkageRules.js +0 -62
  459. package/dist/server/flow-schema-contributions/actions/filterFormDefaultValues.d.ts +0 -10
  460. package/dist/server/flow-schema-contributions/actions/filterFormDefaultValues.js +0 -80
  461. package/dist/server/flow-schema-contributions/actions/formAssignRules.d.ts +0 -10
  462. package/dist/server/flow-schema-contributions/actions/formAssignRules.js +0 -62
  463. package/dist/server/flow-schema-contributions/actions/index.d.ts +0 -31
  464. package/dist/server/flow-schema-contributions/actions/index.js +0 -117
  465. package/dist/server/flow-schema-contributions/actions/layout.d.ts +0 -10
  466. package/dist/server/flow-schema-contributions/actions/layout.js +0 -68
  467. package/dist/server/flow-schema-contributions/actions/linkageRulesRefresh.d.ts +0 -10
  468. package/dist/server/flow-schema-contributions/actions/linkageRulesRefresh.js +0 -50
  469. package/dist/server/flow-schema-contributions/actions/navigateToURL.d.ts +0 -10
  470. package/dist/server/flow-schema-contributions/actions/navigateToURL.js +0 -82
  471. package/dist/server/flow-schema-contributions/actions/openView.d.ts +0 -10
  472. package/dist/server/flow-schema-contributions/actions/openView.js +0 -68
  473. package/dist/server/flow-schema-contributions/actions/refreshTargetBlocks.d.ts +0 -10
  474. package/dist/server/flow-schema-contributions/actions/refreshTargetBlocks.js +0 -56
  475. package/dist/server/flow-schema-contributions/actions/runjs.d.ts +0 -10
  476. package/dist/server/flow-schema-contributions/actions/runjs.js +0 -55
  477. package/dist/server/flow-schema-contributions/actions/setTargetDataScope.d.ts +0 -10
  478. package/dist/server/flow-schema-contributions/actions/setTargetDataScope.js +0 -59
  479. package/dist/server/flow-schema-contributions/actions/showMessage.d.ts +0 -10
  480. package/dist/server/flow-schema-contributions/actions/showMessage.js +0 -69
  481. package/dist/server/flow-schema-contributions/actions/showNotification.d.ts +0 -10
  482. package/dist/server/flow-schema-contributions/actions/showNotification.js +0 -76
  483. package/dist/server/flow-schema-contributions/actions/sortingRule.d.ts +0 -10
  484. package/dist/server/flow-schema-contributions/actions/sortingRule.js +0 -67
  485. package/dist/server/flow-schema-contributions/field-models.d.ts +0 -12
  486. package/dist/server/flow-schema-contributions/field-models.js +0 -693
  487. package/dist/server/flow-schema-contributions/index.d.ts +0 -13
  488. package/dist/server/flow-schema-contributions/index.js +0 -64
  489. package/dist/server/flow-schema-contributions/models/ActionBulkEditModel.d.ts +0 -10
  490. package/dist/server/flow-schema-contributions/models/ActionBulkEditModel.js +0 -382
  491. package/dist/server/flow-schema-contributions/models/ActionBulkUpdateModel.d.ts +0 -10
  492. package/dist/server/flow-schema-contributions/models/ActionBulkUpdateModel.js +0 -169
  493. package/dist/server/flow-schema-contributions/models/ActionCustomRequestModel.d.ts +0 -11
  494. package/dist/server/flow-schema-contributions/models/ActionCustomRequestModel.js +0 -115
  495. package/dist/server/flow-schema-contributions/models/ActionDuplicateModel.d.ts +0 -10
  496. package/dist/server/flow-schema-contributions/models/ActionDuplicateModel.js +0 -169
  497. package/dist/server/flow-schema-contributions/models/ActionExportModel.d.ts +0 -10
  498. package/dist/server/flow-schema-contributions/models/ActionExportModel.js +0 -141
  499. package/dist/server/flow-schema-contributions/models/ActionImportModel.d.ts +0 -10
  500. package/dist/server/flow-schema-contributions/models/ActionImportModel.js +0 -122
  501. package/dist/server/flow-schema-contributions/models/ActionModel.d.ts +0 -10
  502. package/dist/server/flow-schema-contributions/models/ActionModel.js +0 -202
  503. package/dist/server/flow-schema-contributions/models/AddChildActionModel.d.ts +0 -10
  504. package/dist/server/flow-schema-contributions/models/AddChildActionModel.js +0 -47
  505. package/dist/server/flow-schema-contributions/models/AddNewActionModel.d.ts +0 -10
  506. package/dist/server/flow-schema-contributions/models/AddNewActionModel.js +0 -93
  507. package/dist/server/flow-schema-contributions/models/AssignFormGridModel.d.ts +0 -10
  508. package/dist/server/flow-schema-contributions/models/AssignFormGridModel.js +0 -82
  509. package/dist/server/flow-schema-contributions/models/AssignFormItemModel.d.ts +0 -10
  510. package/dist/server/flow-schema-contributions/models/AssignFormItemModel.js +0 -80
  511. package/dist/server/flow-schema-contributions/models/AssignFormModel.d.ts +0 -10
  512. package/dist/server/flow-schema-contributions/models/AssignFormModel.js +0 -122
  513. package/dist/server/flow-schema-contributions/models/BasePageTabModel.d.ts +0 -10
  514. package/dist/server/flow-schema-contributions/models/BasePageTabModel.js +0 -71
  515. package/dist/server/flow-schema-contributions/models/BlockGridCardModel.d.ts +0 -10
  516. package/dist/server/flow-schema-contributions/models/BlockGridCardModel.js +0 -449
  517. package/dist/server/flow-schema-contributions/models/BlockGridModel.d.ts +0 -10
  518. package/dist/server/flow-schema-contributions/models/BlockGridModel.js +0 -81
  519. package/dist/server/flow-schema-contributions/models/BlockIframeModel.d.ts +0 -10
  520. package/dist/server/flow-schema-contributions/models/BlockIframeModel.js +0 -143
  521. package/dist/server/flow-schema-contributions/models/BlockListModel.d.ts +0 -10
  522. package/dist/server/flow-schema-contributions/models/BlockListModel.js +0 -435
  523. package/dist/server/flow-schema-contributions/models/BlockMarkdownModel.d.ts +0 -10
  524. package/dist/server/flow-schema-contributions/models/BlockMarkdownModel.js +0 -108
  525. package/dist/server/flow-schema-contributions/models/BlockWorkbenchModel.d.ts +0 -10
  526. package/dist/server/flow-schema-contributions/models/BlockWorkbenchModel.js +0 -173
  527. package/dist/server/flow-schema-contributions/models/BulkDeleteActionModel.d.ts +0 -10
  528. package/dist/server/flow-schema-contributions/models/BulkDeleteActionModel.js +0 -47
  529. package/dist/server/flow-schema-contributions/models/ChildPageModel.d.ts +0 -10
  530. package/dist/server/flow-schema-contributions/models/ChildPageModel.js +0 -106
  531. package/dist/server/flow-schema-contributions/models/ChildPageTabModel.d.ts +0 -10
  532. package/dist/server/flow-schema-contributions/models/ChildPageTabModel.js +0 -114
  533. package/dist/server/flow-schema-contributions/models/CommentsModel.d.ts +0 -10
  534. package/dist/server/flow-schema-contributions/models/CommentsModel.js +0 -255
  535. package/dist/server/flow-schema-contributions/models/CreateFormModel.d.ts +0 -10
  536. package/dist/server/flow-schema-contributions/models/CreateFormModel.js +0 -54
  537. package/dist/server/flow-schema-contributions/models/DataVisualizationModel.d.ts +0 -10
  538. package/dist/server/flow-schema-contributions/models/DataVisualizationModel.js +0 -240
  539. package/dist/server/flow-schema-contributions/models/DeleteActionModel.d.ts +0 -10
  540. package/dist/server/flow-schema-contributions/models/DeleteActionModel.js +0 -47
  541. package/dist/server/flow-schema-contributions/models/DetailsBlockModel.d.ts +0 -10
  542. package/dist/server/flow-schema-contributions/models/DetailsBlockModel.js +0 -179
  543. package/dist/server/flow-schema-contributions/models/DetailsGridModel.d.ts +0 -10
  544. package/dist/server/flow-schema-contributions/models/DetailsGridModel.js +0 -82
  545. package/dist/server/flow-schema-contributions/models/DetailsItemModel.d.ts +0 -10
  546. package/dist/server/flow-schema-contributions/models/DetailsItemModel.js +0 -77
  547. package/dist/server/flow-schema-contributions/models/EditActionModel.d.ts +0 -10
  548. package/dist/server/flow-schema-contributions/models/EditActionModel.js +0 -93
  549. package/dist/server/flow-schema-contributions/models/EditFormModel.d.ts +0 -10
  550. package/dist/server/flow-schema-contributions/models/EditFormModel.js +0 -103
  551. package/dist/server/flow-schema-contributions/models/ExpandCollapseActionModel.d.ts +0 -10
  552. package/dist/server/flow-schema-contributions/models/ExpandCollapseActionModel.js +0 -47
  553. package/dist/server/flow-schema-contributions/models/FieldAttachmentUrlModel.d.ts +0 -10
  554. package/dist/server/flow-schema-contributions/models/FieldAttachmentUrlModel.js +0 -87
  555. package/dist/server/flow-schema-contributions/models/FieldCodeModel.d.ts +0 -10
  556. package/dist/server/flow-schema-contributions/models/FieldCodeModel.js +0 -99
  557. package/dist/server/flow-schema-contributions/models/FieldFormulaModel.d.ts +0 -10
  558. package/dist/server/flow-schema-contributions/models/FieldFormulaModel.js +0 -152
  559. package/dist/server/flow-schema-contributions/models/FieldMarkdownVditorModel.d.ts +0 -10
  560. package/dist/server/flow-schema-contributions/models/FieldMarkdownVditorModel.js +0 -92
  561. package/dist/server/flow-schema-contributions/models/FieldSequenceModel.d.ts +0 -10
  562. package/dist/server/flow-schema-contributions/models/FieldSequenceModel.js +0 -60
  563. package/dist/server/flow-schema-contributions/models/FieldSortModel.d.ts +0 -10
  564. package/dist/server/flow-schema-contributions/models/FieldSortModel.js +0 -87
  565. package/dist/server/flow-schema-contributions/models/FileManagerModel.d.ts +0 -10
  566. package/dist/server/flow-schema-contributions/models/FileManagerModel.js +0 -115
  567. package/dist/server/flow-schema-contributions/models/FilterActionModel.d.ts +0 -10
  568. package/dist/server/flow-schema-contributions/models/FilterActionModel.js +0 -57
  569. package/dist/server/flow-schema-contributions/models/FilterFormBlockModel.d.ts +0 -10
  570. package/dist/server/flow-schema-contributions/models/FilterFormBlockModel.js +0 -155
  571. package/dist/server/flow-schema-contributions/models/FilterFormCollapseActionModel.d.ts +0 -10
  572. package/dist/server/flow-schema-contributions/models/FilterFormCollapseActionModel.js +0 -85
  573. package/dist/server/flow-schema-contributions/models/FilterFormCustomFieldModel.d.ts +0 -10
  574. package/dist/server/flow-schema-contributions/models/FilterFormCustomFieldModel.js +0 -89
  575. package/dist/server/flow-schema-contributions/models/FilterFormGridModel.d.ts +0 -10
  576. package/dist/server/flow-schema-contributions/models/FilterFormGridModel.js +0 -82
  577. package/dist/server/flow-schema-contributions/models/FilterFormItemModel.d.ts +0 -10
  578. package/dist/server/flow-schema-contributions/models/FilterFormItemModel.js +0 -77
  579. package/dist/server/flow-schema-contributions/models/FilterFormJSActionModel.d.ts +0 -10
  580. package/dist/server/flow-schema-contributions/models/FilterFormJSActionModel.js +0 -108
  581. package/dist/server/flow-schema-contributions/models/FilterFormResetActionModel.d.ts +0 -10
  582. package/dist/server/flow-schema-contributions/models/FilterFormResetActionModel.js +0 -87
  583. package/dist/server/flow-schema-contributions/models/FilterFormSubmitActionModel.d.ts +0 -10
  584. package/dist/server/flow-schema-contributions/models/FilterFormSubmitActionModel.js +0 -87
  585. package/dist/server/flow-schema-contributions/models/FormAssociationItemModel.d.ts +0 -10
  586. package/dist/server/flow-schema-contributions/models/FormAssociationItemModel.js +0 -78
  587. package/dist/server/flow-schema-contributions/models/FormBlockModel.d.ts +0 -10
  588. package/dist/server/flow-schema-contributions/models/FormBlockModel.js +0 -45
  589. package/dist/server/flow-schema-contributions/models/FormGridModel.d.ts +0 -10
  590. package/dist/server/flow-schema-contributions/models/FormGridModel.js +0 -67
  591. package/dist/server/flow-schema-contributions/models/FormItemModel.d.ts +0 -10
  592. package/dist/server/flow-schema-contributions/models/FormItemModel.js +0 -77
  593. package/dist/server/flow-schema-contributions/models/FormSubmitActionModel.d.ts +0 -10
  594. package/dist/server/flow-schema-contributions/models/FormSubmitActionModel.js +0 -87
  595. package/dist/server/flow-schema-contributions/models/JSActionModel.d.ts +0 -10
  596. package/dist/server/flow-schema-contributions/models/JSActionModel.js +0 -65
  597. package/dist/server/flow-schema-contributions/models/JSBlockModel.d.ts +0 -10
  598. package/dist/server/flow-schema-contributions/models/JSBlockModel.js +0 -90
  599. package/dist/server/flow-schema-contributions/models/JSCollectionActionModel.d.ts +0 -10
  600. package/dist/server/flow-schema-contributions/models/JSCollectionActionModel.js +0 -47
  601. package/dist/server/flow-schema-contributions/models/JSColumnModel.d.ts +0 -10
  602. package/dist/server/flow-schema-contributions/models/JSColumnModel.js +0 -100
  603. package/dist/server/flow-schema-contributions/models/JSFormActionModel.d.ts +0 -10
  604. package/dist/server/flow-schema-contributions/models/JSFormActionModel.js +0 -47
  605. package/dist/server/flow-schema-contributions/models/JSItemModel.d.ts +0 -10
  606. package/dist/server/flow-schema-contributions/models/JSItemModel.js +0 -87
  607. package/dist/server/flow-schema-contributions/models/JSRecordActionModel.d.ts +0 -10
  608. package/dist/server/flow-schema-contributions/models/JSRecordActionModel.js +0 -47
  609. package/dist/server/flow-schema-contributions/models/LinkActionModel.d.ts +0 -10
  610. package/dist/server/flow-schema-contributions/models/LinkActionModel.js +0 -47
  611. package/dist/server/flow-schema-contributions/models/MapModel.d.ts +0 -10
  612. package/dist/server/flow-schema-contributions/models/MapModel.js +0 -427
  613. package/dist/server/flow-schema-contributions/models/PageModel.d.ts +0 -10
  614. package/dist/server/flow-schema-contributions/models/PageModel.js +0 -159
  615. package/dist/server/flow-schema-contributions/models/PageTabModel.d.ts +0 -10
  616. package/dist/server/flow-schema-contributions/models/PageTabModel.js +0 -69
  617. package/dist/server/flow-schema-contributions/models/PopupActionModel.d.ts +0 -10
  618. package/dist/server/flow-schema-contributions/models/PopupActionModel.js +0 -92
  619. package/dist/server/flow-schema-contributions/models/PopupCollectionActionModel.d.ts +0 -10
  620. package/dist/server/flow-schema-contributions/models/PopupCollectionActionModel.js +0 -119
  621. package/dist/server/flow-schema-contributions/models/RefreshActionModel.d.ts +0 -10
  622. package/dist/server/flow-schema-contributions/models/RefreshActionModel.js +0 -47
  623. package/dist/server/flow-schema-contributions/models/RootPageModel.d.ts +0 -10
  624. package/dist/server/flow-schema-contributions/models/RootPageModel.js +0 -124
  625. package/dist/server/flow-schema-contributions/models/RootPageTabModel.d.ts +0 -10
  626. package/dist/server/flow-schema-contributions/models/RootPageTabModel.js +0 -69
  627. package/dist/server/flow-schema-contributions/models/RouteModel.d.ts +0 -10
  628. package/dist/server/flow-schema-contributions/models/RouteModel.js +0 -121
  629. package/dist/server/flow-schema-contributions/models/TableActionsColumnModel.d.ts +0 -10
  630. package/dist/server/flow-schema-contributions/models/TableActionsColumnModel.js +0 -93
  631. package/dist/server/flow-schema-contributions/models/TableBlockModel.d.ts +0 -10
  632. package/dist/server/flow-schema-contributions/models/TableBlockModel.js +0 -254
  633. package/dist/server/flow-schema-contributions/models/TableColumnModel.d.ts +0 -10
  634. package/dist/server/flow-schema-contributions/models/TableColumnModel.js +0 -77
  635. package/dist/server/flow-schema-contributions/models/TableCustomColumnModel.d.ts +0 -10
  636. package/dist/server/flow-schema-contributions/models/TableCustomColumnModel.js +0 -66
  637. package/dist/server/flow-schema-contributions/models/UiTemplatesModel.d.ts +0 -10
  638. package/dist/server/flow-schema-contributions/models/UiTemplatesModel.js +0 -130
  639. package/dist/server/flow-schema-contributions/models/UpdateRecordActionModel.d.ts +0 -10
  640. package/dist/server/flow-schema-contributions/models/UpdateRecordActionModel.js +0 -173
  641. package/dist/server/flow-schema-contributions/models/ViewActionModel.d.ts +0 -10
  642. package/dist/server/flow-schema-contributions/models/ViewActionModel.js +0 -123
  643. package/dist/server/flow-schema-contributions/models/index.d.ts +0 -71
  644. package/dist/server/flow-schema-contributions/models/index.js +0 -371
  645. package/dist/server/flow-schema-contributions/shared.d.ts +0 -501
  646. package/dist/server/flow-schema-contributions/shared.js +0 -1649
  647. package/dist/server/flow-schema-registry/FlowSchemaRegistry.d.ts +0 -154
  648. package/dist/server/flow-schema-registry/FlowSchemaRegistry.js +0 -1424
  649. package/dist/server/flow-schema-registry/flow-schema-registry/fieldBinding.d.ts +0 -32
  650. package/dist/server/flow-schema-registry/flow-schema-registry/fieldBinding.js +0 -159
  651. package/dist/server/flow-schema-registry/flow-schema-registry/modelPatches.d.ts +0 -16
  652. package/dist/server/flow-schema-registry/flow-schema-registry/modelPatches.js +0 -226
  653. package/dist/server/flow-schema-registry/flow-schema-registry/schemaInference.d.ts +0 -17
  654. package/dist/server/flow-schema-registry/flow-schema-registry/schemaInference.js +0 -204
  655. package/dist/server/flow-schema-registry/flow-schema-registry/utils.d.ts +0 -25
  656. package/dist/server/flow-schema-registry/flow-schema-registry/utils.js +0 -278
  657. package/dist/server/flow-schema-registry/index.js +0 -32
  658. package/dist/server/flow-schema-registry/types.d.ts +0 -244
  659. package/dist/server/flow-schema-service.d.ts +0 -87
  660. package/dist/server/flow-schema-service.js +0 -963
  661. /package/dist/server/{flow-schema-registry → flow-surfaces}/types.js +0 -0
@@ -1,1424 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var FlowSchemaRegistry_exports = {};
38
- __export(FlowSchemaRegistry_exports, {
39
- FlowSchemaRegistry: () => FlowSchemaRegistry
40
- });
41
- module.exports = __toCommonJS(FlowSchemaRegistry_exports);
42
- var import_lodash = __toESM(require("lodash"));
43
- var import_fieldBinding = require("./flow-schema-registry/fieldBinding");
44
- var import_modelPatches = require("./flow-schema-registry/modelPatches");
45
- var import_schemaInference = require("./flow-schema-registry/schemaInference");
46
- var import_utils = require("./flow-schema-registry/utils");
47
- class FlowSchemaRegistry {
48
- modelSchemas = /* @__PURE__ */ new Map();
49
- actionSchemas = /* @__PURE__ */ new Map();
50
- fieldBindingContexts = /* @__PURE__ */ new Map();
51
- fieldBindings = /* @__PURE__ */ new Map();
52
- resolvedModelCache = /* @__PURE__ */ new Map();
53
- modelSnapshotSchemaCache = /* @__PURE__ */ new Map();
54
- compactModelSnapshotSchemaCache = /* @__PURE__ */ new Map();
55
- modelSchemaHashCache = /* @__PURE__ */ new Map();
56
- compactModelSchemaHashCache = /* @__PURE__ */ new Map();
57
- modelDocumentCache = /* @__PURE__ */ new Map();
58
- modelLocalDynamicHintsCache = /* @__PURE__ */ new Map();
59
- publicModelDocumentCache = /* @__PURE__ */ new Map();
60
- publicTreeRoots = /* @__PURE__ */ new Set();
61
- slotUseExpansions = /* @__PURE__ */ new Map();
62
- invalidateDerivedCaches() {
63
- this.resolvedModelCache.clear();
64
- this.modelSnapshotSchemaCache.clear();
65
- this.compactModelSnapshotSchemaCache.clear();
66
- this.modelSchemaHashCache.clear();
67
- this.compactModelSchemaHashCache.clear();
68
- this.modelDocumentCache.clear();
69
- this.modelLocalDynamicHintsCache.clear();
70
- this.publicModelDocumentCache.clear();
71
- }
72
- registerAction(action) {
73
- var _a, _b, _c, _d;
74
- const name = String((action == null ? void 0 : action.name) || "").trim();
75
- if (!name) return;
76
- const previous = this.actionSchemas.get(name);
77
- const inferred = (0, import_schemaInference.inferParamsSchemaFromUiSchema)(name, action.uiSchema, `actions.${name}`);
78
- const mergedSchema = (0, import_utils.mergeSchemas)(action.paramsSchema || inferred.schema, action.paramsSchemaPatch);
79
- const explicit = !!action.paramsSchema || !!action.paramsSchemaPatch;
80
- const coverageStatus = explicit ? inferred.schema ? "mixed" : "manual" : inferred.coverage;
81
- const docs = (0, import_utils.normalizeSchemaDocs)({
82
- ...previous == null ? void 0 : previous.docs,
83
- ...action.schemaDocs,
84
- examples: ((_a = action.schemaDocs) == null ? void 0 : _a.examples) || ((_b = previous == null ? void 0 : previous.docs) == null ? void 0 : _b.examples),
85
- dynamicHints: [...((_c = previous == null ? void 0 : previous.docs) == null ? void 0 : _c.dynamicHints) || [], ...((_d = action.schemaDocs) == null ? void 0 : _d.dynamicHints) || []]
86
- });
87
- this.actionSchemas.set(name, {
88
- name,
89
- title: action.title,
90
- definition: action,
91
- schema: mergedSchema,
92
- coverage: {
93
- status: mergedSchema ? coverageStatus : "unresolved",
94
- source: (previous == null ? void 0 : previous.coverage.source) || "official",
95
- strict: previous == null ? void 0 : previous.coverage.strict
96
- },
97
- docs,
98
- dynamicHints: (0, import_utils.normalizeSchemaHints)([
99
- ...(previous == null ? void 0 : previous.dynamicHints) || [],
100
- ...inferred.hints || [],
101
- ...docs.dynamicHints || []
102
- ])
103
- });
104
- this.invalidateDerivedCaches();
105
- }
106
- registerActions(actions) {
107
- for (const action of Object.values(actions || {})) {
108
- this.registerAction(action);
109
- }
110
- }
111
- registerActionContribution(contribution) {
112
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
113
- const name = String((contribution == null ? void 0 : contribution.name) || "").trim();
114
- if (!name) return;
115
- const previous = this.actionSchemas.get(name);
116
- const docs = (0, import_utils.normalizeSchemaDocs)({
117
- ...previous == null ? void 0 : previous.docs,
118
- ...contribution.docs,
119
- examples: ((_a = contribution.docs) == null ? void 0 : _a.examples) || ((_b = previous == null ? void 0 : previous.docs) == null ? void 0 : _b.examples),
120
- dynamicHints: [...((_c = previous == null ? void 0 : previous.docs) == null ? void 0 : _c.dynamicHints) || [], ...((_d = contribution.docs) == null ? void 0 : _d.dynamicHints) || []],
121
- commonPatterns: ((_e = contribution.docs) == null ? void 0 : _e.commonPatterns) || ((_f = previous == null ? void 0 : previous.docs) == null ? void 0 : _f.commonPatterns),
122
- antiPatterns: ((_g = contribution.docs) == null ? void 0 : _g.antiPatterns) || ((_h = previous == null ? void 0 : previous.docs) == null ? void 0 : _h.antiPatterns),
123
- minimalExample: ((_i = contribution.docs) == null ? void 0 : _i.minimalExample) !== void 0 ? contribution.docs.minimalExample : (_j = previous == null ? void 0 : previous.docs) == null ? void 0 : _j.minimalExample
124
- });
125
- this.actionSchemas.set(name, {
126
- name,
127
- title: contribution.title || (previous == null ? void 0 : previous.title),
128
- definition: previous == null ? void 0 : previous.definition,
129
- schema: contribution.paramsSchema ? import_lodash.default.cloneDeep(contribution.paramsSchema) : previous == null ? void 0 : previous.schema,
130
- docs,
131
- coverage: {
132
- status: contribution.paramsSchema ? "manual" : (previous == null ? void 0 : previous.coverage.status) || "unresolved",
133
- source: contribution.source || (previous == null ? void 0 : previous.coverage.source) || "official",
134
- strict: contribution.strict ?? (previous == null ? void 0 : previous.coverage.strict)
135
- },
136
- dynamicHints: (0, import_utils.normalizeSchemaHints)([...(previous == null ? void 0 : previous.dynamicHints) || [], ...docs.dynamicHints || []])
137
- });
138
- this.invalidateDerivedCaches();
139
- }
140
- registerActionContributions(contributions) {
141
- const values = Array.isArray(contributions) ? contributions : Object.values(contributions || {});
142
- for (const contribution of values) {
143
- this.registerActionContribution(contribution);
144
- }
145
- }
146
- registerFieldBindingContext(contribution, fallbackName) {
147
- const normalized = (0, import_fieldBinding.normalizeFieldBindingContextContribution)(contribution, fallbackName);
148
- if (!normalized) {
149
- return;
150
- }
151
- const previous = this.fieldBindingContexts.get(normalized.name);
152
- this.fieldBindingContexts.set(normalized.name, {
153
- name: normalized.name,
154
- inherits: import_lodash.default.uniq([...(previous == null ? void 0 : previous.inherits) || [], ...normalized.inherits])
155
- });
156
- this.invalidateDerivedCaches();
157
- }
158
- registerFieldBindingContexts(contributions) {
159
- if (!contributions) {
160
- return;
161
- }
162
- if (Array.isArray(contributions)) {
163
- for (const contribution of contributions) {
164
- this.registerFieldBindingContext(contribution);
165
- }
166
- return;
167
- }
168
- for (const [name, contribution] of Object.entries(contributions)) {
169
- if (!contribution) {
170
- continue;
171
- }
172
- this.registerFieldBindingContext(contribution, name);
173
- }
174
- }
175
- registerFieldBinding(contribution, source = "official") {
176
- const normalized = (0, import_fieldBinding.normalizeFieldBindingContribution)(contribution, source);
177
- if (!normalized) {
178
- return;
179
- }
180
- const bindings = this.fieldBindings.get(normalized.context) || [];
181
- bindings.push(normalized);
182
- this.fieldBindings.set(normalized.context, bindings);
183
- this.invalidateDerivedCaches();
184
- }
185
- registerFieldBindings(contributions, source = "official") {
186
- if (!contributions) {
187
- return;
188
- }
189
- if (Array.isArray(contributions)) {
190
- for (const contribution of contributions) {
191
- this.registerFieldBinding(contribution, source);
192
- }
193
- return;
194
- }
195
- for (const [context, contribution] of Object.entries(contributions)) {
196
- if (!contribution) {
197
- continue;
198
- }
199
- const items = Array.isArray(contribution) ? contribution : [contribution];
200
- for (const item of items) {
201
- this.registerFieldBinding(
202
- {
203
- ...item,
204
- context: item.context || context
205
- },
206
- source
207
- );
208
- }
209
- }
210
- }
211
- registerModel(use, options) {
212
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
213
- const name = String(use || "").trim();
214
- if (!name) return;
215
- const previous = this.modelSchemas.get(name);
216
- this.modelSchemas.set(name, {
217
- use: name,
218
- title: options.title || (previous == null ? void 0 : previous.title),
219
- modelClass: options.modelClass || (previous == null ? void 0 : previous.modelClass),
220
- stepParamsSchema: options.stepParamsSchema || (previous == null ? void 0 : previous.stepParamsSchema),
221
- flowRegistrySchema: options.flowRegistrySchema || (previous == null ? void 0 : previous.flowRegistrySchema),
222
- subModelSlots: (0, import_modelPatches.normalizeSubModelSlots)(options.subModelSlots || (previous == null ? void 0 : previous.subModelSlots)),
223
- flowRegistrySchemaPatch: options.flowRegistrySchemaPatch || (previous == null ? void 0 : previous.flowRegistrySchemaPatch),
224
- examples: options.examples || (previous == null ? void 0 : previous.examples) || [],
225
- docs: (0, import_utils.normalizeSchemaDocs)({
226
- ...previous == null ? void 0 : previous.docs,
227
- ...options.docs,
228
- examples: ((_a = options.docs) == null ? void 0 : _a.examples) || ((_b = previous == null ? void 0 : previous.docs) == null ? void 0 : _b.examples),
229
- dynamicHints: [...((_c = previous == null ? void 0 : previous.docs) == null ? void 0 : _c.dynamicHints) || [], ...((_d = options.docs) == null ? void 0 : _d.dynamicHints) || []],
230
- commonPatterns: ((_e = options.docs) == null ? void 0 : _e.commonPatterns) || ((_f = previous == null ? void 0 : previous.docs) == null ? void 0 : _f.commonPatterns),
231
- antiPatterns: ((_g = options.docs) == null ? void 0 : _g.antiPatterns) || ((_h = previous == null ? void 0 : previous.docs) == null ? void 0 : _h.antiPatterns),
232
- minimalExample: ((_i = options.docs) == null ? void 0 : _i.minimalExample) !== void 0 ? options.docs.minimalExample : (_j = previous == null ? void 0 : previous.docs) == null ? void 0 : _j.minimalExample
233
- }),
234
- skeleton: options.skeleton !== void 0 ? import_lodash.default.cloneDeep(options.skeleton) : previous == null ? void 0 : previous.skeleton,
235
- dynamicHints: (0, import_utils.normalizeSchemaHints)([...(previous == null ? void 0 : previous.dynamicHints) || [], ...options.dynamicHints || []]),
236
- coverage: options.coverage || (previous == null ? void 0 : previous.coverage) || { status: "unresolved", source: "third-party" },
237
- exposure: options.exposure ?? (previous == null ? void 0 : previous.exposure) ?? "public",
238
- abstract: options.abstract ?? (previous == null ? void 0 : previous.abstract) ?? false,
239
- allowDirectUse: options.allowDirectUse ?? (previous == null ? void 0 : previous.allowDirectUse) ?? true,
240
- suggestedUses: (0, import_utils.normalizeStringArray)(options.suggestedUses || (previous == null ? void 0 : previous.suggestedUses))
241
- });
242
- this.invalidateDerivedCaches();
243
- }
244
- registerModelContribution(contribution) {
245
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
246
- const use = String((contribution == null ? void 0 : contribution.use) || "").trim();
247
- if (!use) return;
248
- const previous = this.modelSchemas.get(use);
249
- const hasSchemaContribution = !!contribution.stepParamsSchema || !!contribution.flowRegistrySchema || !!contribution.flowRegistrySchemaPatch || !!contribution.subModelSlots;
250
- const docs = (0, import_utils.normalizeSchemaDocs)({
251
- ...previous == null ? void 0 : previous.docs,
252
- ...contribution.docs,
253
- examples: contribution.examples || ((_a = contribution.docs) == null ? void 0 : _a.examples) || ((_b = previous == null ? void 0 : previous.docs) == null ? void 0 : _b.examples),
254
- dynamicHints: [...((_c = previous == null ? void 0 : previous.docs) == null ? void 0 : _c.dynamicHints) || [], ...((_d = contribution.docs) == null ? void 0 : _d.dynamicHints) || []],
255
- commonPatterns: ((_e = contribution.docs) == null ? void 0 : _e.commonPatterns) || ((_f = previous == null ? void 0 : previous.docs) == null ? void 0 : _f.commonPatterns),
256
- antiPatterns: ((_g = contribution.docs) == null ? void 0 : _g.antiPatterns) || ((_h = previous == null ? void 0 : previous.docs) == null ? void 0 : _h.antiPatterns),
257
- minimalExample: ((_i = contribution.docs) == null ? void 0 : _i.minimalExample) !== void 0 ? contribution.docs.minimalExample : (_j = previous == null ? void 0 : previous.docs) == null ? void 0 : _j.minimalExample
258
- });
259
- this.registerModel(use, {
260
- title: contribution.title,
261
- stepParamsSchema: contribution.stepParamsSchema ? import_lodash.default.cloneDeep(contribution.stepParamsSchema) : void 0,
262
- flowRegistrySchema: contribution.flowRegistrySchema ? import_lodash.default.cloneDeep(contribution.flowRegistrySchema) : void 0,
263
- subModelSlots: contribution.subModelSlots ? (0, import_modelPatches.normalizeSubModelSlots)(contribution.subModelSlots) : void 0,
264
- flowRegistrySchemaPatch: contribution.flowRegistrySchemaPatch ? import_lodash.default.cloneDeep(contribution.flowRegistrySchemaPatch) : void 0,
265
- examples: contribution.examples || docs.examples || [],
266
- docs,
267
- skeleton: contribution.skeleton,
268
- dynamicHints: [...contribution.dynamicHints || [], ...docs.dynamicHints || []],
269
- coverage: hasSchemaContribution ? {
270
- status: (previous == null ? void 0 : previous.coverage.status) === "auto" ? "mixed" : "manual",
271
- source: contribution.source || (previous == null ? void 0 : previous.coverage.source) || "official",
272
- strict: contribution.strict ?? (previous == null ? void 0 : previous.coverage.strict)
273
- } : (previous == null ? void 0 : previous.coverage) || {
274
- status: "unresolved",
275
- source: contribution.source || "official",
276
- strict: contribution.strict
277
- },
278
- exposure: contribution.exposure,
279
- abstract: contribution.abstract,
280
- allowDirectUse: contribution.allowDirectUse,
281
- suggestedUses: contribution.suggestedUses
282
- });
283
- }
284
- registerModelContributions(contributions) {
285
- const values = Array.isArray(contributions) ? contributions : Object.values(contributions || {});
286
- for (const contribution of values) {
287
- this.registerModelContribution(contribution);
288
- }
289
- }
290
- registerModelClass(use, modelClass) {
291
- var _a, _b;
292
- const meta = modelClass.meta || {};
293
- const schemaMeta = meta.schema || {};
294
- const inferredSlots = this.inferSubModelSlotsFromModelClass(use, modelClass);
295
- const inferredHints = this.collectModelDynamicHints(use, modelClass, meta);
296
- const hasManual = !!schemaMeta.stepParamsSchema || !!schemaMeta.flowRegistrySchema || !!schemaMeta.subModelSlots || !!schemaMeta.flowRegistrySchemaPatch;
297
- const hasAuto = !!Object.keys(inferredSlots).length;
298
- this.registerModel(use, {
299
- modelClass,
300
- title: (0, import_utils.toSchemaTitle)(meta.label, use),
301
- stepParamsSchema: schemaMeta.stepParamsSchema,
302
- flowRegistrySchema: schemaMeta.flowRegistrySchema,
303
- subModelSlots: Object.keys(schemaMeta.subModelSlots || {}).length ? schemaMeta.subModelSlots : inferredSlots,
304
- flowRegistrySchemaPatch: schemaMeta.flowRegistrySchemaPatch,
305
- examples: schemaMeta.examples || ((_a = schemaMeta.docs) == null ? void 0 : _a.examples) || [],
306
- docs: schemaMeta.docs,
307
- skeleton: schemaMeta.skeleton,
308
- dynamicHints: [...schemaMeta.dynamicHints || [], ...((_b = schemaMeta.docs) == null ? void 0 : _b.dynamicHints) || [], ...inferredHints],
309
- coverage: {
310
- status: hasManual && hasAuto ? "mixed" : hasManual ? "manual" : hasAuto ? "auto" : "unresolved",
311
- source: schemaMeta.source || "official",
312
- strict: schemaMeta.strict
313
- },
314
- exposure: schemaMeta.exposure,
315
- abstract: schemaMeta.abstract,
316
- allowDirectUse: schemaMeta.allowDirectUse,
317
- suggestedUses: schemaMeta.suggestedUses
318
- });
319
- }
320
- registerModels(models) {
321
- for (const [use, modelClass] of Object.entries(models || {})) {
322
- if (modelClass) {
323
- this.registerModelClass(use, modelClass);
324
- }
325
- }
326
- }
327
- registerInventory(inventory, _source) {
328
- if (!inventory) {
329
- return;
330
- }
331
- for (const use of (0, import_utils.normalizeStringArray)(inventory.publicTreeRoots)) {
332
- this.publicTreeRoots.add(use);
333
- }
334
- for (const item of inventory.slotUseExpansions || []) {
335
- const parentUse = String((item == null ? void 0 : item.parentUse) || "").trim();
336
- const slotKey = String((item == null ? void 0 : item.slotKey) || "").trim();
337
- const uses = (0, import_utils.normalizeStringArray)(item == null ? void 0 : item.uses);
338
- if (!parentUse || !slotKey || uses.length === 0) {
339
- continue;
340
- }
341
- const key = this.createSlotUseExpansionKey(parentUse, slotKey);
342
- this.slotUseExpansions.set(key, import_lodash.default.uniq([...this.slotUseExpansions.get(key) || [], ...uses]));
343
- }
344
- this.invalidateDerivedCaches();
345
- }
346
- resolveFieldBindingCandidates(context, options = {}) {
347
- const contextChain = this.resolveFieldBindingContextChain(context);
348
- const entries = contextChain.flatMap(
349
- (contextName, contextIndex) => (this.fieldBindings.get(contextName) || []).map((binding, bindingIndex) => ({
350
- binding,
351
- contextIndex,
352
- bindingIndex
353
- }))
354
- );
355
- const candidates = entries.filter(({ binding }) => (0, import_fieldBinding.matchesFieldBinding)(binding, options)).filter(({ binding }) => this.hasQueryableModel(binding.use)).sort((a, b) => {
356
- if (a.binding.isDefault !== b.binding.isDefault) {
357
- return a.binding.isDefault ? -1 : 1;
358
- }
359
- const aOrder = typeof a.binding.order === "number" ? a.binding.order : Number.MAX_SAFE_INTEGER;
360
- const bOrder = typeof b.binding.order === "number" ? b.binding.order : Number.MAX_SAFE_INTEGER;
361
- if (aOrder !== bOrder) {
362
- return aOrder - bOrder;
363
- }
364
- if (a.contextIndex !== b.contextIndex) {
365
- return a.contextIndex - b.contextIndex;
366
- }
367
- return a.bindingIndex - b.bindingIndex;
368
- }).map(({ binding }) => ({
369
- use: binding.use,
370
- defaultProps: binding.defaultProps === void 0 ? void 0 : import_lodash.default.cloneDeep(binding.defaultProps),
371
- compatibility: (0, import_fieldBinding.buildFieldModelCompatibility)(binding)
372
- }));
373
- return import_lodash.default.uniqBy(candidates, (candidate) => `${candidate.use}:${(0, import_utils.stableStringify)(candidate.compatibility)}`);
374
- }
375
- getAction(name) {
376
- return this.actionSchemas.get(name);
377
- }
378
- listActionNames() {
379
- return Array.from(this.actionSchemas.keys()).sort();
380
- }
381
- getModel(use) {
382
- return this.modelSchemas.get(use);
383
- }
384
- resolveFieldBindingContextChain(context, visited = /* @__PURE__ */ new Set()) {
385
- var _a;
386
- const name = String(context || "").trim();
387
- if (!name || visited.has(name)) {
388
- return [];
389
- }
390
- visited.add(name);
391
- const chain = [name];
392
- const inherits = ((_a = this.fieldBindingContexts.get(name)) == null ? void 0 : _a.inherits) || [];
393
- for (const inheritedContext of inherits) {
394
- for (const item of this.resolveFieldBindingContextChain(inheritedContext, visited)) {
395
- if (!chain.includes(item)) {
396
- chain.push(item);
397
- }
398
- }
399
- }
400
- return chain;
401
- }
402
- resolveModelSchemaRef(use, contextChain = []) {
403
- const name = String(use || "").trim();
404
- const cacheKey = `${name}::${(0, import_utils.stableStringify)(contextChain)}`;
405
- const cached = this.resolvedModelCache.get(cacheKey);
406
- if (cached) {
407
- return cached;
408
- }
409
- const registered = this.modelSchemas.get(name);
410
- const resolved = {
411
- use: name,
412
- title: (registered == null ? void 0 : registered.title) || name,
413
- modelClass: registered == null ? void 0 : registered.modelClass,
414
- stepParamsSchema: (registered == null ? void 0 : registered.stepParamsSchema) ? import_lodash.default.cloneDeep(registered.stepParamsSchema) : this.buildInferredStepParamsSchema(name),
415
- flowRegistrySchema: (registered == null ? void 0 : registered.flowRegistrySchema) ? import_lodash.default.cloneDeep(registered.flowRegistrySchema) : this.buildInferredFlowRegistrySchema(name),
416
- subModelSlots: (0, import_modelPatches.normalizeSubModelSlots)(registered == null ? void 0 : registered.subModelSlots),
417
- flowRegistrySchemaPatch: (registered == null ? void 0 : registered.flowRegistrySchemaPatch) ? import_lodash.default.cloneDeep(registered.flowRegistrySchemaPatch) : void 0,
418
- examples: import_lodash.default.cloneDeep((registered == null ? void 0 : registered.examples) || []),
419
- docs: (0, import_utils.normalizeSchemaDocs)(registered == null ? void 0 : registered.docs),
420
- skeleton: (registered == null ? void 0 : registered.skeleton) === void 0 ? void 0 : import_lodash.default.cloneDeep(registered.skeleton),
421
- dynamicHints: (0, import_utils.normalizeSchemaHints)(registered == null ? void 0 : registered.dynamicHints),
422
- coverage: (registered == null ? void 0 : registered.coverage) || { status: "unresolved", source: "third-party" },
423
- exposure: (registered == null ? void 0 : registered.exposure) || "public",
424
- abstract: (registered == null ? void 0 : registered.abstract) ?? false,
425
- allowDirectUse: (registered == null ? void 0 : registered.allowDirectUse) ?? true,
426
- suggestedUses: (0, import_utils.normalizeStringArray)(registered == null ? void 0 : registered.suggestedUses)
427
- };
428
- for (const contribution of this.collectContextPatches(name, contextChain)) {
429
- (0, import_modelPatches.applyModelSchemaPatch)(resolved, contribution.patch, contribution.source, contribution.strict);
430
- }
431
- const frozen = (0, import_utils.deepFreezePlainGraph)(resolved);
432
- this.resolvedModelCache.set(cacheKey, frozen);
433
- return frozen;
434
- }
435
- resolveModelSchema(use, contextChain = []) {
436
- return import_lodash.default.cloneDeep(this.resolveModelSchemaRef(use, contextChain));
437
- }
438
- isPublicModel(model) {
439
- return ((model == null ? void 0 : model.exposure) || "public") === "public";
440
- }
441
- isQueryableModel(model) {
442
- return !!model && model.abstract !== true;
443
- }
444
- getSuggestedUses(use) {
445
- var _a;
446
- const model = this.modelSchemas.get(String(use || "").trim());
447
- if ((_a = model == null ? void 0 : model.suggestedUses) == null ? void 0 : _a.length) {
448
- return (0, import_utils.normalizeStringArray)(model.suggestedUses);
449
- }
450
- return this.listModelUses({ directUseOnly: true }).filter((item) => item !== use).slice(0, 20);
451
- }
452
- hasQueryableModel(use) {
453
- const model = this.modelSchemas.get(String(use || "").trim());
454
- return this.isQueryableModel(model);
455
- }
456
- isDirectUseAllowed(use) {
457
- const model = this.modelSchemas.get(String(use || "").trim());
458
- return model ? this.isQueryableModel(model) && model.allowDirectUse !== false : true;
459
- }
460
- listPublicTreeRoots() {
461
- return Array.from(this.publicTreeRoots).sort();
462
- }
463
- listModelUses(options = {}) {
464
- const { publicOnly = false, directUseOnly = false, queryableOnly = false } = options;
465
- return Array.from(this.modelSchemas.values()).filter((model) => !publicOnly || this.isPublicModel(model) && this.isQueryableModel(model)).filter((model) => !queryableOnly || this.isQueryableModel(model)).filter((model) => !directUseOnly || this.isQueryableModel(model) && model.allowDirectUse !== false).map((model) => model.use).sort();
466
- }
467
- getSchemaBundle(uses) {
468
- return {
469
- items: (Array.isArray(uses) && uses.length > 0 ? uses.filter((use) => this.hasQueryableModel(use)) : []).map(
470
- (use) => this.buildBundleNode(use, [], /* @__PURE__ */ new Set())
471
- )
472
- };
473
- }
474
- getModelDocument(use, contextChain = []) {
475
- return import_lodash.default.cloneDeep(this.getModelDocumentRef(use, contextChain));
476
- }
477
- getModelDocumentRef(use, contextChain = []) {
478
- const cacheKey = this.createContextVisitKey(use, contextChain);
479
- const cached = this.modelDocumentCache.get(cacheKey);
480
- if (cached) {
481
- return cached;
482
- }
483
- const document = this.buildModelDocument(use, contextChain, /* @__PURE__ */ new Set());
484
- const frozen = (0, import_utils.deepFreezePlainGraph)(document);
485
- this.modelDocumentCache.set(cacheKey, frozen);
486
- return frozen;
487
- }
488
- getPublicModelDocument(use, options = {}) {
489
- return import_lodash.default.cloneDeep(this.getPublicModelDocumentRef(use, options));
490
- }
491
- getPublicModelDocumentRef(use, options = {}) {
492
- const detail = options.detail === "full" ? "full" : "compact";
493
- const contextChain = options.contextChain || [];
494
- const cacheKey = `${detail}::${this.createContextVisitKey(use, contextChain)}`;
495
- const cached = this.publicModelDocumentCache.get(cacheKey);
496
- if (cached) {
497
- return cached;
498
- }
499
- const document = detail === "full" ? this.buildFullPublicModelDocument(use, contextChain) : this.buildCompactPublicModelDocument(use, contextChain);
500
- const frozen = (0, import_utils.deepFreezePlainGraph)(document);
501
- this.publicModelDocumentCache.set(cacheKey, frozen);
502
- return frozen;
503
- }
504
- buildFullPublicModelDocument(use, contextChain) {
505
- const document = this.getModelDocumentRef(use, contextChain);
506
- return {
507
- use: document.use,
508
- title: document.title,
509
- jsonSchema: document.jsonSchema,
510
- dynamicHints: document.dynamicHints,
511
- minimalExample: document.minimalExample,
512
- commonPatterns: document.commonPatterns,
513
- antiPatterns: document.antiPatterns,
514
- hash: document.hash,
515
- source: document.source
516
- };
517
- }
518
- buildCompactPublicModelDocument(use, contextChain) {
519
- var _a, _b, _c, _d;
520
- const resolved = this.resolveModelSchemaRef(use, contextChain);
521
- const jsonSchema = this.buildCompactModelSnapshotSchemaRef(use, contextChain);
522
- const minimalExample = import_lodash.default.cloneDeep(
523
- ((_a = resolved == null ? void 0 : resolved.docs) == null ? void 0 : _a.minimalExample) ?? ((_b = resolved == null ? void 0 : resolved.examples) == null ? void 0 : _b[0]) ?? (resolved == null ? void 0 : resolved.skeleton) ?? (0, import_utils.buildSkeletonFromSchema)(jsonSchema)
524
- );
525
- return {
526
- use,
527
- title: (resolved == null ? void 0 : resolved.title) || use,
528
- jsonSchema,
529
- dynamicHints: [...this.getModelLocalDynamicHintsRef(use, contextChain)],
530
- minimalExample,
531
- commonPatterns: import_lodash.default.cloneDeep(((_c = resolved == null ? void 0 : resolved.docs) == null ? void 0 : _c.commonPatterns) || []),
532
- antiPatterns: import_lodash.default.cloneDeep(((_d = resolved == null ? void 0 : resolved.docs) == null ? void 0 : _d.antiPatterns) || []),
533
- hash: this.getCompactModelSchemaHash(use, contextChain),
534
- source: ((resolved == null ? void 0 : resolved.coverage) || { source: "third-party" }).source
535
- };
536
- }
537
- getModelLocalDynamicHintsRef(use, contextChain = []) {
538
- const cacheKey = this.createContextVisitKey(use, contextChain);
539
- const cached = this.modelLocalDynamicHintsCache.get(cacheKey);
540
- if (cached) {
541
- return cached;
542
- }
543
- const hints = this.buildModelLocalDynamicHints(use, contextChain);
544
- const frozen = (0, import_utils.deepFreezePlainGraph)(hints);
545
- this.modelLocalDynamicHintsCache.set(cacheKey, frozen);
546
- return frozen;
547
- }
548
- buildModelLocalDynamicHints(use, contextChain) {
549
- const resolved = this.resolveModelSchemaRef(use, contextChain);
550
- const baseCoverage = resolved.coverage || { status: "unresolved", source: "third-party" };
551
- const flowDiagnostics = this.collectFlowSchemaDiagnostics(use);
552
- const slotHints = Object.entries((resolved == null ? void 0 : resolved.subModelSlots) || {}).map(([slotKey, slot]) => {
553
- const allowedUses = this.resolveSlotAllowedUses(use, slotKey, slot);
554
- return (0, import_utils.createFlowHint)(
555
- {
556
- kind: slot.dynamic || slot.fieldBindingContext ? "dynamic-children" : "manual-schema-required",
557
- path: `${use}.subModels.${slotKey}`,
558
- message: slot.description || `${use}.subModels.${slotKey} accepts ${slot.type}${allowedUses.length ? `: ${allowedUses.join(", ")}` : ""}.`
559
- },
560
- {
561
- slotRules: {
562
- slotKey,
563
- type: slot.type,
564
- allowedUses
565
- }
566
- }
567
- );
568
- });
569
- const coverage = this.buildDocumentCoverage(baseCoverage, flowDiagnostics.statuses);
570
- return (0, import_utils.normalizeSchemaHints)([
571
- ...(resolved == null ? void 0 : resolved.dynamicHints) || [],
572
- ...slotHints,
573
- ...flowDiagnostics.hints,
574
- ...coverage.status === "unresolved" ? [
575
- (0, import_utils.createFlowHint)(
576
- {
577
- kind: "unresolved-model",
578
- path: use,
579
- message: `${use} has no registered server-safe schema contribution yet.`
580
- },
581
- {
582
- unresolvedReason: "missing-model-contribution",
583
- recommendedFallback: { use }
584
- }
585
- )
586
- ] : []
587
- ]);
588
- }
589
- getModelSchemaHash(use, contextChain = []) {
590
- const cacheKey = this.createContextVisitKey(use, contextChain);
591
- const cached = this.modelSchemaHashCache.get(cacheKey);
592
- if (cached) {
593
- return cached;
594
- }
595
- const hash = (0, import_utils.hashString)((0, import_utils.stableStringify)(this.buildModelSnapshotSchemaRef(use, contextChain)));
596
- this.modelSchemaHashCache.set(cacheKey, hash);
597
- return hash;
598
- }
599
- getCompactModelSchemaHash(use, contextChain = []) {
600
- const cacheKey = this.createContextVisitKey(use, contextChain);
601
- const cached = this.compactModelSchemaHashCache.get(cacheKey);
602
- if (cached) {
603
- return cached;
604
- }
605
- const hash = (0, import_utils.hashString)((0, import_utils.stableStringify)(this.buildCompactModelSnapshotSchemaRef(use, contextChain)));
606
- this.compactModelSchemaHashCache.set(cacheKey, hash);
607
- return hash;
608
- }
609
- createSlotUseExpansionKey(parentUse, slotKey) {
610
- return `${parentUse}::${slotKey}`;
611
- }
612
- getSlotUseExpansionUses(parentUse, slotKey) {
613
- return this.slotUseExpansions.get(this.createSlotUseExpansionKey(parentUse, slotKey)) || [];
614
- }
615
- resolveSlotAllowedUses(parentUse, slotKey, slot) {
616
- if (!slot) {
617
- return [];
618
- }
619
- if (slot.fieldBindingContext) {
620
- return import_lodash.default.uniq(this.resolveFieldBindingCandidates(slot.fieldBindingContext).map((candidate) => candidate.use));
621
- }
622
- return import_lodash.default.uniq([...(0, import_utils.collectAllowedUses)(slot), ...this.getSlotUseExpansionUses(parentUse, slotKey)]);
623
- }
624
- buildModelDocument(use, contextChain, visited) {
625
- var _a, _b, _c, _d;
626
- const resolved = this.resolveModelSchemaRef(use, contextChain);
627
- const baseCoverage = resolved.coverage || { status: "unresolved", source: "third-party" };
628
- const flowDiagnostics = this.collectFlowSchemaDiagnostics(use);
629
- const coverage = this.buildDocumentCoverage(baseCoverage, flowDiagnostics.statuses);
630
- const dynamicHints = (0, import_utils.normalizeSchemaHints)([
631
- ...this.getModelLocalDynamicHintsRef(use, contextChain),
632
- ...this.collectNestedDocumentHints(use, contextChain, visited)
633
- ]);
634
- const jsonSchema = this.buildModelSnapshotSchemaRef(use, contextChain);
635
- const skeleton = import_lodash.default.cloneDeep((resolved == null ? void 0 : resolved.skeleton) ?? (0, import_utils.buildSkeletonFromSchema)(jsonSchema));
636
- const minimalExample = import_lodash.default.cloneDeep(((_a = resolved == null ? void 0 : resolved.docs) == null ? void 0 : _a.minimalExample) ?? ((_b = resolved == null ? void 0 : resolved.examples) == null ? void 0 : _b[0]) ?? skeleton);
637
- const hash = this.getModelSchemaHash(use, contextChain);
638
- return {
639
- use,
640
- title: (resolved == null ? void 0 : resolved.title) || use,
641
- jsonSchema,
642
- coverage,
643
- dynamicHints,
644
- examples: (resolved == null ? void 0 : resolved.examples) || [],
645
- minimalExample,
646
- commonPatterns: import_lodash.default.cloneDeep(((_c = resolved == null ? void 0 : resolved.docs) == null ? void 0 : _c.commonPatterns) || []),
647
- antiPatterns: import_lodash.default.cloneDeep(((_d = resolved == null ? void 0 : resolved.docs) == null ? void 0 : _d.antiPatterns) || []),
648
- skeleton,
649
- hash,
650
- source: coverage.source
651
- };
652
- }
653
- buildBundleNode(use, contextChain, visited, compatibility) {
654
- const resolved = this.resolveModelSchemaRef(use, contextChain);
655
- const visitKey = this.createContextVisitKey(use, contextChain);
656
- const node = {
657
- use,
658
- title: (resolved == null ? void 0 : resolved.title) || use
659
- };
660
- if (compatibility) {
661
- node.compatibility = import_lodash.default.cloneDeep(compatibility);
662
- }
663
- if (visited.has(visitKey) || this.isContextCycle(use, contextChain)) {
664
- return node;
665
- }
666
- visited.add(visitKey);
667
- try {
668
- const subModelCatalog = this.buildBundleSubModelCatalog(use, resolved == null ? void 0 : resolved.subModelSlots, contextChain, visited);
669
- if (subModelCatalog && Object.keys(subModelCatalog).length > 0) {
670
- node.subModelCatalog = subModelCatalog;
671
- }
672
- return node;
673
- } finally {
674
- visited.delete(visitKey);
675
- }
676
- }
677
- buildBundleSubModelCatalog(parentUse, slots, contextChain, visited) {
678
- if (!slots || Object.keys(slots).length === 0) {
679
- return void 0;
680
- }
681
- const entries = Object.entries(slots).map(([slotKey, slot]) => {
682
- const edgeBase = {
683
- parentUse,
684
- slotKey
685
- };
686
- const fieldBindingCandidates = slot.fieldBindingContext ? this.resolveFieldBindingCandidates(slot.fieldBindingContext) : [];
687
- const allowedUses = fieldBindingCandidates.length > 0 ? import_lodash.default.uniq(fieldBindingCandidates.map((item) => item.use)) : this.resolveSlotAllowedUses(parentUse, slotKey, slot);
688
- const catalog = {
689
- type: slot.type,
690
- candidates: fieldBindingCandidates.length > 0 ? fieldBindingCandidates.map(
691
- (candidate) => this.buildBundleNode(
692
- candidate.use,
693
- [
694
- ...contextChain,
695
- {
696
- ...edgeBase,
697
- childUse: candidate.use
698
- }
699
- ],
700
- visited,
701
- candidate.compatibility
702
- )
703
- ) : allowedUses.map(
704
- (childUse) => this.buildBundleNode(
705
- childUse,
706
- [
707
- ...contextChain,
708
- {
709
- ...edgeBase,
710
- childUse
711
- }
712
- ],
713
- visited
714
- )
715
- )
716
- };
717
- if (slot.required !== void 0) {
718
- catalog.required = slot.required;
719
- }
720
- if (slot.type === "array" && typeof slot.minItems === "number") {
721
- catalog.minItems = slot.minItems;
722
- }
723
- if (allowedUses.length === 0) {
724
- catalog.open = true;
725
- }
726
- return [slotKey, catalog];
727
- });
728
- return entries.length ? Object.fromEntries(entries) : void 0;
729
- }
730
- createContextVisitKey(use, contextChain) {
731
- return `${use}::${(0, import_utils.stableStringify)(contextChain)}`;
732
- }
733
- isContextCycle(use, contextChain) {
734
- if (!contextChain.length) {
735
- return false;
736
- }
737
- const ancestorUses = [contextChain[0].parentUse, ...contextChain.slice(0, -1).map((edge) => edge.childUse)];
738
- return ancestorUses.includes(use);
739
- }
740
- buildModelSnapshotSchema(use, contextChain = []) {
741
- return import_lodash.default.cloneDeep(this.buildModelSnapshotSchemaRef(use, contextChain));
742
- }
743
- buildCompactModelSnapshotSchema(use, contextChain = []) {
744
- return import_lodash.default.cloneDeep(this.buildCompactModelSnapshotSchemaRef(use, contextChain));
745
- }
746
- buildModelSnapshotSchemaRef(use, contextChain = []) {
747
- const cacheKey = this.createContextVisitKey(use, contextChain);
748
- const cached = this.modelSnapshotSchemaCache.get(cacheKey);
749
- if (cached) {
750
- return cached;
751
- }
752
- const schema = this.buildModelSnapshotSchemaInternal(use, contextChain, /* @__PURE__ */ new Set());
753
- const frozen = (0, import_utils.deepFreezePlainGraph)(schema);
754
- this.modelSnapshotSchemaCache.set(cacheKey, frozen);
755
- return frozen;
756
- }
757
- buildCompactModelSnapshotSchemaRef(use, contextChain = []) {
758
- const cacheKey = this.createContextVisitKey(use, contextChain);
759
- const cached = this.compactModelSnapshotSchemaCache.get(cacheKey);
760
- if (cached) {
761
- return cached;
762
- }
763
- const schema = this.buildCompactModelSnapshotSchemaInternal(use, contextChain);
764
- const frozen = (0, import_utils.deepFreezePlainGraph)(schema);
765
- this.compactModelSnapshotSchemaCache.set(cacheKey, frozen);
766
- return frozen;
767
- }
768
- buildCompactModelSnapshotSchemaInternal(use, contextChain) {
769
- const resolved = this.resolveModelSchemaRef(use, contextChain);
770
- const subModelsSchema = this.buildCompactSubModelsSchemaFromSlots(use, resolved == null ? void 0 : resolved.subModelSlots, contextChain);
771
- return this.buildSnapshotShellSchema(use, resolved, subModelsSchema);
772
- }
773
- buildModelSnapshotSchemaInternal(use, contextChain, visited) {
774
- const resolved = this.resolveModelSchemaRef(use, contextChain);
775
- const visitKey = this.createContextVisitKey(use, contextChain);
776
- if (visited.has(visitKey) || this.isContextCycle(use, contextChain)) {
777
- return this.buildTruncatedSnapshotSchema(use, resolved);
778
- }
779
- visited.add(visitKey);
780
- try {
781
- return this.buildSnapshotSchemaFromResolved(use, resolved, contextChain, visited);
782
- } finally {
783
- visited.delete(visitKey);
784
- }
785
- }
786
- buildSnapshotSchemaFromResolved(use, resolved, contextChain, visited) {
787
- const subModelsSchema = this.buildSubModelsSchemaFromSlots(
788
- use || "",
789
- resolved == null ? void 0 : resolved.subModelSlots,
790
- contextChain,
791
- visited
792
- );
793
- return this.buildSnapshotShellSchema(use, resolved, subModelsSchema);
794
- }
795
- buildSnapshotShellSchema(use, resolved, subModelsSchema) {
796
- const flowRegistrySchema = (resolved == null ? void 0 : resolved.flowRegistrySchema) || { type: "object", additionalProperties: true };
797
- const stepParamsSchema = (resolved == null ? void 0 : resolved.stepParamsSchema) || { type: "object", additionalProperties: true };
798
- return {
799
- $schema: import_utils.JSON_SCHEMA_DRAFT_07,
800
- type: "object",
801
- properties: {
802
- uid: { type: "string" },
803
- use: use ? { const: use } : { type: "string" },
804
- async: { type: "boolean" },
805
- parentId: { type: "string" },
806
- subKey: { type: "string" },
807
- subType: { type: "string", enum: ["object", "array"] },
808
- sortIndex: { type: "number" },
809
- stepParams: stepParamsSchema,
810
- flowRegistry: (0, import_utils.mergeSchemas)(flowRegistrySchema, resolved == null ? void 0 : resolved.flowRegistrySchemaPatch) || {
811
- type: "object",
812
- additionalProperties: true
813
- },
814
- subModels: subModelsSchema
815
- },
816
- required: ["uid", "use"],
817
- additionalProperties: true
818
- };
819
- }
820
- buildTruncatedSnapshotSchema(use, resolved) {
821
- return this.buildSnapshotShellSchema(use, resolved, {
822
- type: "object",
823
- additionalProperties: true
824
- });
825
- }
826
- buildStaticFlowRegistrySchema(use, contextChain = []) {
827
- const resolved = this.resolveModelSchemaRef(use, contextChain);
828
- const schema = (0, import_utils.mergeSchemas)(resolved == null ? void 0 : resolved.flowRegistrySchema, resolved == null ? void 0 : resolved.flowRegistrySchemaPatch);
829
- if (schema) {
830
- return import_lodash.default.cloneDeep(schema);
831
- }
832
- return { type: "object", additionalProperties: true };
833
- }
834
- buildStaticStepParamsSchema(use, contextChain = []) {
835
- const resolved = this.resolveModelSchemaRef(use, contextChain);
836
- if (resolved == null ? void 0 : resolved.stepParamsSchema) {
837
- return import_lodash.default.cloneDeep(resolved.stepParamsSchema);
838
- }
839
- return { type: "object", additionalProperties: true };
840
- }
841
- buildSubModelsSchema(use, contextChain = []) {
842
- const resolved = this.resolveModelSchemaRef(use, contextChain);
843
- return this.buildSubModelsSchemaFromSlots(use, resolved == null ? void 0 : resolved.subModelSlots, contextChain, /* @__PURE__ */ new Set());
844
- }
845
- buildCompactSubModelsSchemaFromSlots(parentUse, slots, contextChain = []) {
846
- if (!slots || Object.keys(slots).length === 0) {
847
- return { type: "object", additionalProperties: true };
848
- }
849
- const properties = {};
850
- const required = [];
851
- for (const [slotKey, slot] of Object.entries(slots)) {
852
- const itemSchema = this.buildCompactSlotTargetSchema(parentUse, slotKey, slot, contextChain);
853
- properties[slotKey] = slot.type === "array" ? {
854
- type: "array",
855
- ...typeof slot.minItems === "number" ? { minItems: slot.minItems } : {},
856
- items: itemSchema
857
- } : itemSchema;
858
- if (slot.required) {
859
- required.push(slotKey);
860
- }
861
- }
862
- return {
863
- type: "object",
864
- properties,
865
- ...required.length ? { required } : {},
866
- additionalProperties: true
867
- };
868
- }
869
- buildSubModelsSchemaFromSlots(parentUse, slots, contextChain = [], visited) {
870
- if (!slots || Object.keys(slots).length === 0) {
871
- return { type: "object", additionalProperties: true };
872
- }
873
- const properties = {};
874
- const required = [];
875
- for (const [slotKey, slot] of Object.entries(slots)) {
876
- const itemSchema = this.buildSlotTargetSchema(parentUse, slotKey, slot, contextChain, visited);
877
- properties[slotKey] = slot.type === "array" ? {
878
- type: "array",
879
- ...typeof slot.minItems === "number" ? { minItems: slot.minItems } : {},
880
- items: itemSchema
881
- } : itemSchema;
882
- if (slot.required) {
883
- required.push(slotKey);
884
- }
885
- }
886
- return {
887
- type: "object",
888
- properties,
889
- ...required.length ? { required } : {},
890
- additionalProperties: true
891
- };
892
- }
893
- buildInferredFlowRegistrySchema(use) {
894
- var _a, _b;
895
- const registered = this.modelSchemas.get(use);
896
- const modelClass = registered == null ? void 0 : registered.modelClass;
897
- const flowsMap = (_b = (_a = modelClass == null ? void 0 : modelClass.globalFlowRegistry) == null ? void 0 : _a.getFlows) == null ? void 0 : _b.call(_a);
898
- if (!(flowsMap == null ? void 0 : flowsMap.size)) {
899
- return void 0;
900
- }
901
- const properties = {};
902
- for (const [flowKey, flowDef] of flowsMap.entries()) {
903
- const stepProperties = {};
904
- const steps = (flowDef == null ? void 0 : flowDef.steps) || {};
905
- for (const [stepKey, stepDef] of Object.entries(steps)) {
906
- stepProperties[stepKey] = this.buildStepDefinitionSchema(stepDef);
907
- }
908
- properties[flowKey] = {
909
- type: "object",
910
- properties: {
911
- key: { type: "string" },
912
- title: { type: "string" },
913
- manual: { type: "boolean" },
914
- sort: { type: "number" },
915
- on: this.buildFlowOnSchema(),
916
- steps: {
917
- type: "object",
918
- properties: stepProperties,
919
- additionalProperties: false
920
- }
921
- },
922
- additionalProperties: true
923
- };
924
- }
925
- return {
926
- type: "object",
927
- properties,
928
- additionalProperties: true
929
- };
930
- }
931
- buildInferredStepParamsSchema(use) {
932
- var _a, _b;
933
- const registered = this.modelSchemas.get(use);
934
- const modelClass = registered == null ? void 0 : registered.modelClass;
935
- const flowsMap = (_b = (_a = modelClass == null ? void 0 : modelClass.globalFlowRegistry) == null ? void 0 : _a.getFlows) == null ? void 0 : _b.call(_a);
936
- if (!(flowsMap == null ? void 0 : flowsMap.size)) {
937
- return void 0;
938
- }
939
- const properties = {};
940
- for (const [flowKey, flowDef] of flowsMap.entries()) {
941
- const stepProperties = {};
942
- const steps = (flowDef == null ? void 0 : flowDef.steps) || {};
943
- for (const [stepKey, stepDef] of Object.entries(steps)) {
944
- const resolved = this.resolveStepParamsSchema(stepDef, `${use}.${flowKey}.${stepKey}`);
945
- stepProperties[stepKey] = resolved.schema || { type: "object", additionalProperties: true };
946
- }
947
- properties[flowKey] = {
948
- type: "object",
949
- properties: stepProperties,
950
- additionalProperties: false
951
- };
952
- }
953
- return {
954
- type: "object",
955
- properties,
956
- additionalProperties: true
957
- };
958
- }
959
- buildFlowOnSchema() {
960
- return {
961
- anyOf: [
962
- { type: "string" },
963
- {
964
- type: "object",
965
- properties: {
966
- eventName: { type: "string" },
967
- defaultParams: { type: "object", additionalProperties: true },
968
- phase: {
969
- type: "string",
970
- enum: ["beforeAllFlows", "afterAllFlows", "beforeFlow", "afterFlow", "beforeStep", "afterStep"]
971
- },
972
- flowKey: { type: "string" },
973
- stepKey: { type: "string" }
974
- },
975
- required: ["eventName"],
976
- additionalProperties: true
977
- }
978
- ]
979
- };
980
- }
981
- buildStepDefinitionSchema(step) {
982
- return {
983
- type: "object",
984
- properties: {
985
- key: { type: "string" },
986
- flowKey: { type: "string" },
987
- title: { type: "string" },
988
- use: { type: "string" },
989
- sort: { type: "number" },
990
- preset: { type: "boolean" },
991
- isAwait: { type: "boolean" },
992
- manual: { type: "boolean" },
993
- on: this.buildFlowOnSchema(),
994
- defaultParams: { type: ["object", "array", "string", "number", "boolean", "null"] },
995
- paramsSchemaOverride: { type: "object", additionalProperties: true }
996
- },
997
- additionalProperties: true
998
- };
999
- }
1000
- resolveStepParamsSchema(step, path) {
1001
- var _a, _b, _c, _d;
1002
- if (step.paramsSchemaOverride) {
1003
- return {
1004
- schema: import_lodash.default.cloneDeep(step.paramsSchemaOverride),
1005
- hints: (0, import_utils.normalizeSchemaHints)((_a = step.schemaDocs) == null ? void 0 : _a.dynamicHints),
1006
- coverage: "manual"
1007
- };
1008
- }
1009
- if (step.use) {
1010
- const action = this.getAction(step.use);
1011
- if (action == null ? void 0 : action.schema) {
1012
- return {
1013
- schema: import_lodash.default.cloneDeep(action.schema),
1014
- hints: (0, import_utils.normalizeSchemaHints)([...action.dynamicHints || [], ...((_b = step.schemaDocs) == null ? void 0 : _b.dynamicHints) || []]),
1015
- coverage: action.coverage.status === "auto" || action.coverage.status === "manual" ? action.coverage.status : action.coverage.status === "unresolved" ? "unresolved" : "mixed"
1016
- };
1017
- }
1018
- return {
1019
- schema: { type: "object", additionalProperties: true },
1020
- hints: [
1021
- (0, import_utils.createFlowHint)(
1022
- {
1023
- kind: "unresolved-action",
1024
- path,
1025
- message: `${path} references unresolved action "${step.use}".`
1026
- },
1027
- {
1028
- unresolvedReason: "missing-action-contribution",
1029
- recommendedFallback: { use: step.use, params: {} }
1030
- }
1031
- ),
1032
- ...((_c = step.schemaDocs) == null ? void 0 : _c.dynamicHints) || []
1033
- ],
1034
- coverage: "unresolved"
1035
- };
1036
- }
1037
- const inferred = (0, import_schemaInference.inferParamsSchemaFromUiSchema)(path, step.uiSchema, path);
1038
- return {
1039
- schema: (0, import_utils.mergeSchemas)(inferred.schema, step.paramsSchemaPatch),
1040
- hints: (0, import_utils.normalizeSchemaHints)([...inferred.hints || [], ...((_d = step.schemaDocs) == null ? void 0 : _d.dynamicHints) || []]),
1041
- coverage: step.paramsSchemaPatch ? "mixed" : inferred.coverage
1042
- };
1043
- }
1044
- buildSlotTargetSchema(parentUse, slotKey, slot, contextChain, visited) {
1045
- var _a, _b;
1046
- if (slot.fieldBindingContext) {
1047
- const candidateUses = import_lodash.default.uniq(
1048
- this.resolveFieldBindingCandidates(slot.fieldBindingContext).map((item) => item.use)
1049
- );
1050
- if (candidateUses.length > 0) {
1051
- const candidateSchemas = candidateUses.map(
1052
- (use) => this.buildModelSnapshotSchemaInternal(
1053
- use,
1054
- [
1055
- ...contextChain,
1056
- {
1057
- parentUse,
1058
- slotKey,
1059
- childUse: use
1060
- }
1061
- ],
1062
- visited
1063
- )
1064
- );
1065
- if (slot.schema) {
1066
- return {
1067
- anyOf: [...candidateSchemas, import_lodash.default.cloneDeep(slot.schema)]
1068
- };
1069
- }
1070
- return candidateSchemas.length === 1 ? candidateSchemas[0] : { oneOf: candidateSchemas };
1071
- }
1072
- }
1073
- const allowedUses = this.resolveSlotAllowedUses(parentUse, slotKey, slot);
1074
- if (allowedUses.length > 0) {
1075
- const knownSchemas = allowedUses.map(
1076
- (use) => this.buildModelSnapshotSchemaInternal(
1077
- use,
1078
- [
1079
- ...contextChain,
1080
- {
1081
- parentUse,
1082
- slotKey,
1083
- childUse: use
1084
- }
1085
- ],
1086
- visited
1087
- )
1088
- );
1089
- if (slot.schema) {
1090
- return {
1091
- anyOf: [...knownSchemas, import_lodash.default.cloneDeep(slot.schema)]
1092
- };
1093
- }
1094
- if (knownSchemas.length === 1) {
1095
- return knownSchemas[0];
1096
- }
1097
- return {
1098
- oneOf: knownSchemas
1099
- };
1100
- }
1101
- if (slot.childSchemaPatch || ((_a = slot.descendantSchemaPatches) == null ? void 0 : _a.length)) {
1102
- return this.buildAnonymousSlotSnapshotSchema(parentUse, slotKey, slot, contextChain, visited);
1103
- }
1104
- if (slot.schema && !slot.childSchemaPatch && !((_b = slot.descendantSchemaPatches) == null ? void 0 : _b.length)) {
1105
- return import_lodash.default.cloneDeep(slot.schema);
1106
- }
1107
- return { type: "object", additionalProperties: true };
1108
- }
1109
- buildCompactSlotTargetSchema(parentUse, slotKey, slot, contextChain) {
1110
- var _a, _b;
1111
- if (slot.fieldBindingContext) {
1112
- const candidateUses = import_lodash.default.uniq(
1113
- this.resolveFieldBindingCandidates(slot.fieldBindingContext).map((item) => item.use)
1114
- );
1115
- if (candidateUses.length > 0) {
1116
- const candidateSchemas = candidateUses.map(
1117
- (use) => this.buildCompactSlotCandidateSchema(use, [
1118
- ...contextChain,
1119
- {
1120
- parentUse,
1121
- slotKey,
1122
- childUse: use
1123
- }
1124
- ])
1125
- );
1126
- if (slot.schema) {
1127
- return {
1128
- anyOf: [...candidateSchemas, import_lodash.default.cloneDeep(slot.schema)]
1129
- };
1130
- }
1131
- return candidateSchemas.length === 1 ? candidateSchemas[0] : { oneOf: candidateSchemas };
1132
- }
1133
- }
1134
- const allowedUses = this.resolveSlotAllowedUses(parentUse, slotKey, slot);
1135
- if (allowedUses.length > 0) {
1136
- const knownSchemas = allowedUses.map(
1137
- (use) => this.buildCompactSlotCandidateSchema(use, [
1138
- ...contextChain,
1139
- {
1140
- parentUse,
1141
- slotKey,
1142
- childUse: use
1143
- }
1144
- ])
1145
- );
1146
- if (slot.schema) {
1147
- return {
1148
- anyOf: [...knownSchemas, import_lodash.default.cloneDeep(slot.schema)]
1149
- };
1150
- }
1151
- return knownSchemas.length === 1 ? knownSchemas[0] : { oneOf: knownSchemas };
1152
- }
1153
- if (slot.childSchemaPatch || ((_a = slot.descendantSchemaPatches) == null ? void 0 : _a.length)) {
1154
- return this.buildCompactAnonymousSlotSnapshotSchema(parentUse, slotKey, slot);
1155
- }
1156
- if (slot.schema && !slot.childSchemaPatch && !((_b = slot.descendantSchemaPatches) == null ? void 0 : _b.length)) {
1157
- return import_lodash.default.cloneDeep(slot.schema);
1158
- }
1159
- return { type: "object", additionalProperties: true };
1160
- }
1161
- buildCompactSlotCandidateSchema(use, contextChain) {
1162
- const resolved = this.resolveModelSchemaRef(use, contextChain);
1163
- return this.buildTruncatedSnapshotSchema(use, resolved);
1164
- }
1165
- buildCompactAnonymousSlotSnapshotSchema(parentUse, slotKey, slot) {
1166
- const anonymousResolved = this.createAnonymousResolvedSchema(parentUse, slotKey, slot);
1167
- return this.buildTruncatedSnapshotSchema(void 0, anonymousResolved);
1168
- }
1169
- buildAnonymousSlotSnapshotSchema(parentUse, slotKey, slot, contextChain, visited) {
1170
- const anonymousResolved = this.createAnonymousResolvedSchema(parentUse, slotKey, slot);
1171
- return this.buildSnapshotSchemaFromResolved(
1172
- "",
1173
- anonymousResolved,
1174
- [
1175
- ...contextChain,
1176
- {
1177
- parentUse,
1178
- slotKey,
1179
- childUse: ""
1180
- }
1181
- ],
1182
- visited
1183
- );
1184
- }
1185
- createAnonymousResolvedSchema(parentUse, slotKey, slot) {
1186
- const anonymousResolved = {
1187
- use: "",
1188
- title: slot.description || `${parentUse || "AnonymousModel"}.${slotKey}`,
1189
- examples: [],
1190
- docs: (0, import_utils.normalizeSchemaDocs)(),
1191
- dynamicHints: [],
1192
- coverage: {
1193
- status: "unresolved",
1194
- source: "third-party"
1195
- },
1196
- exposure: "internal",
1197
- abstract: false,
1198
- allowDirectUse: true,
1199
- suggestedUses: []
1200
- };
1201
- const directPatch = (0, import_modelPatches.resolveChildSchemaPatch)(slot, "");
1202
- if (directPatch) {
1203
- (0, import_modelPatches.applyModelSchemaPatch)(anonymousResolved, directPatch, "third-party");
1204
- }
1205
- return anonymousResolved;
1206
- }
1207
- collectNestedDocumentHints(use, contextChain, visited) {
1208
- const visitKey = this.createContextVisitKey(use, contextChain);
1209
- if (visited.has(visitKey) || this.isContextCycle(use, contextChain)) {
1210
- return [];
1211
- }
1212
- visited.add(visitKey);
1213
- try {
1214
- const resolved = this.resolveModelSchemaRef(use, contextChain);
1215
- const hints = [];
1216
- for (const [slotKey, slot] of Object.entries(resolved.subModelSlots || {})) {
1217
- const childUses = this.resolveSlotAllowedUses(use, slotKey, slot);
1218
- for (const childUse of childUses) {
1219
- const childContext = [
1220
- ...contextChain,
1221
- {
1222
- parentUse: use,
1223
- slotKey,
1224
- childUse
1225
- }
1226
- ];
1227
- const childDocument = this.buildModelDocument(childUse, childContext, visited);
1228
- const basePath = `${use}.subModels.${slotKey}`;
1229
- hints.push(...childDocument.dynamicHints.map((hint) => this.prefixNestedHint(hint, basePath, childUse)));
1230
- }
1231
- }
1232
- return (0, import_utils.normalizeSchemaHints)(hints);
1233
- } finally {
1234
- visited.delete(visitKey);
1235
- }
1236
- }
1237
- prefixNestedHint(hint, basePath, childUse) {
1238
- if (!hint.path) {
1239
- return {
1240
- ...hint,
1241
- path: basePath
1242
- };
1243
- }
1244
- if (hint.path === childUse) {
1245
- return {
1246
- ...hint,
1247
- path: basePath
1248
- };
1249
- }
1250
- if (hint.path.startsWith(`${childUse}.`)) {
1251
- return {
1252
- ...hint,
1253
- path: `${basePath}.${hint.path.slice(childUse.length + 1)}`
1254
- };
1255
- }
1256
- return {
1257
- ...hint,
1258
- path: `${basePath}.${hint.path}`
1259
- };
1260
- }
1261
- collectContextPatches(use, contextChain) {
1262
- var _a;
1263
- if (!contextChain.length) {
1264
- return [];
1265
- }
1266
- const contributions = [];
1267
- const targetEdgeIndex = contextChain.length - 1;
1268
- for (let index = 0; index < contextChain.length; index++) {
1269
- const edge = contextChain[index];
1270
- const parentContext = contextChain.slice(0, index);
1271
- const parentResolved = this.resolveModelSchemaRef(edge.parentUse, parentContext);
1272
- const slot = (_a = parentResolved.subModelSlots) == null ? void 0 : _a[edge.slotKey];
1273
- if (!slot) {
1274
- continue;
1275
- }
1276
- const remainingEdges = contextChain.slice(index + 1);
1277
- for (const patch of slot.descendantSchemaPatches || []) {
1278
- if ((0, import_modelPatches.matchesDescendantSchemaPatch)(patch, remainingEdges)) {
1279
- contributions.push({
1280
- patch: patch.patch,
1281
- source: parentResolved.coverage.source,
1282
- strict: parentResolved.coverage.strict
1283
- });
1284
- }
1285
- }
1286
- if (index === targetEdgeIndex) {
1287
- const directPatch = (0, import_modelPatches.resolveChildSchemaPatch)(slot, use);
1288
- if (directPatch) {
1289
- contributions.push({
1290
- patch: directPatch,
1291
- source: parentResolved.coverage.source,
1292
- strict: parentResolved.coverage.strict
1293
- });
1294
- }
1295
- }
1296
- }
1297
- return contributions;
1298
- }
1299
- collectModelDynamicHints(use, modelClass, meta) {
1300
- const hints = [];
1301
- if (typeof meta.children === "function") {
1302
- hints.push(
1303
- (0, import_utils.createFlowHint)(
1304
- {
1305
- kind: "dynamic-children",
1306
- path: `${use}.meta.children`,
1307
- message: `${use} uses function-based children and only static slot hints are available.`
1308
- },
1309
- {
1310
- unresolvedReason: "function-children"
1311
- }
1312
- )
1313
- );
1314
- }
1315
- if (typeof meta.createModelOptions === "function") {
1316
- hints.push(
1317
- (0, import_utils.createFlowHint)(
1318
- {
1319
- kind: "dynamic-children",
1320
- path: `${use}.meta.createModelOptions`,
1321
- message: `${use} uses function-based createModelOptions and may need manual sub-model slot schema.`
1322
- },
1323
- {
1324
- unresolvedReason: "function-create-model-options"
1325
- }
1326
- )
1327
- );
1328
- }
1329
- if (typeof modelClass.defineChildren === "function") {
1330
- hints.push(
1331
- (0, import_utils.createFlowHint)(
1332
- {
1333
- kind: "dynamic-children",
1334
- path: `${use}.defineChildren`,
1335
- message: `${use} defines dynamic children. Schema generation only keeps static baseline.`
1336
- },
1337
- {
1338
- unresolvedReason: "runtime-define-children"
1339
- }
1340
- )
1341
- );
1342
- }
1343
- return hints;
1344
- }
1345
- collectFlowSchemaDiagnostics(use) {
1346
- var _a, _b, _c;
1347
- const registered = this.modelSchemas.get(use);
1348
- const modelClass = registered == null ? void 0 : registered.modelClass;
1349
- const flowsMap = (_b = (_a = modelClass == null ? void 0 : modelClass.globalFlowRegistry) == null ? void 0 : _a.getFlows) == null ? void 0 : _b.call(_a);
1350
- if (!(flowsMap == null ? void 0 : flowsMap.size)) {
1351
- return {
1352
- hints: [],
1353
- statuses: []
1354
- };
1355
- }
1356
- const hints = [];
1357
- const statuses = [];
1358
- for (const [flowKey, flowDef] of flowsMap.entries()) {
1359
- for (const [stepKey, stepDef] of Object.entries((flowDef == null ? void 0 : flowDef.steps) || {})) {
1360
- const resolved = this.resolveStepParamsSchema(stepDef, `${use}.${flowKey}.${stepKey}`);
1361
- if ((_c = resolved.hints) == null ? void 0 : _c.length) {
1362
- hints.push(...resolved.hints);
1363
- }
1364
- statuses.push(resolved.coverage);
1365
- }
1366
- }
1367
- return {
1368
- hints: (0, import_utils.normalizeSchemaHints)(hints),
1369
- statuses
1370
- };
1371
- }
1372
- buildDocumentCoverage(base, stepStatuses) {
1373
- const statuses = new Set([base.status, ...stepStatuses].filter(Boolean));
1374
- let status = base.status;
1375
- if (statuses.size > 1) {
1376
- statuses.delete("unresolved");
1377
- if (statuses.size === 0) {
1378
- status = "unresolved";
1379
- } else {
1380
- status = "mixed";
1381
- }
1382
- } else if (statuses.size === 1) {
1383
- status = Array.from(statuses)[0] || "unresolved";
1384
- }
1385
- return {
1386
- ...base,
1387
- status
1388
- };
1389
- }
1390
- inferSubModelSlotsFromModelClass(use, modelClass) {
1391
- const meta = (modelClass.meta || {}).schema;
1392
- if (meta == null ? void 0 : meta.subModelSlots) {
1393
- return import_lodash.default.cloneDeep(meta.subModelSlots);
1394
- }
1395
- const createModelOptions = (modelClass.meta || {}).createModelOptions;
1396
- if (!import_lodash.default.isPlainObject(createModelOptions) || !import_lodash.default.isPlainObject(createModelOptions.subModels)) {
1397
- return {};
1398
- }
1399
- const slots = {};
1400
- for (const [slotKey, slotValue] of Object.entries(createModelOptions.subModels || {})) {
1401
- if (Array.isArray(slotValue)) {
1402
- const first = slotValue[0];
1403
- slots[slotKey] = {
1404
- type: "array",
1405
- ...typeof (first == null ? void 0 : first.use) === "string" ? { use: first.use } : {}
1406
- };
1407
- } else if (import_lodash.default.isPlainObject(slotValue)) {
1408
- slots[slotKey] = {
1409
- type: "object",
1410
- ...slotValue.use ? { use: slotValue.use } : {}
1411
- };
1412
- } else {
1413
- slots[slotKey] = {
1414
- type: "object"
1415
- };
1416
- }
1417
- }
1418
- return slots;
1419
- }
1420
- }
1421
- // Annotate the CommonJS export names for ESM import in node:
1422
- 0 && (module.exports = {
1423
- FlowSchemaRegistry
1424
- });