@botpress/cli 2.1.1 → 2.1.3

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 (385) hide show
  1. package/.turbo/turbo-build.log +22 -0
  2. package/dist/api/bot-body.js +89 -0
  3. package/dist/api/bot-body.js.map +7 -0
  4. package/dist/api/client.js +169 -0
  5. package/dist/api/client.js.map +7 -0
  6. package/dist/api/find-previous-version.js +66 -0
  7. package/dist/api/find-previous-version.js.map +7 -0
  8. package/dist/api/find-previous-version.test.js +76 -0
  9. package/dist/api/find-previous-version.test.js.map +7 -0
  10. package/dist/api/index.js +23 -0
  11. package/dist/api/index.js.map +7 -0
  12. package/dist/api/integration-body.js +146 -0
  13. package/dist/api/integration-body.js.map +7 -0
  14. package/dist/api/interface-body.js +95 -0
  15. package/dist/api/interface-body.js.map +7 -0
  16. package/dist/api/paging.js +42 -0
  17. package/dist/api/paging.js.map +7 -0
  18. package/dist/api/plugin-body.js +84 -0
  19. package/dist/api/plugin-body.js.map +7 -0
  20. package/dist/api/types.js +17 -0
  21. package/dist/api/types.js.map +7 -0
  22. package/dist/chat/index.js +211 -0
  23. package/dist/chat/index.js.map +7 -0
  24. package/dist/code-generation/bot-implementation/bot-implementation.js +116 -0
  25. package/dist/code-generation/bot-implementation/bot-implementation.js.map +7 -0
  26. package/dist/code-generation/bot-implementation/bot-plugins/index.js +80 -0
  27. package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +7 -0
  28. package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +129 -0
  29. package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +7 -0
  30. package/dist/code-generation/bot-implementation/bot-typings/actions-module.js +88 -0
  31. package/dist/code-generation/bot-implementation/bot-typings/actions-module.js.map +7 -0
  32. package/dist/code-generation/bot-implementation/bot-typings/events-module.js +63 -0
  33. package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +7 -0
  34. package/dist/code-generation/bot-implementation/bot-typings/index.js +109 -0
  35. package/dist/code-generation/bot-implementation/bot-typings/index.js.map +7 -0
  36. package/dist/code-generation/bot-implementation/bot-typings/states-module.js +64 -0
  37. package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +7 -0
  38. package/dist/code-generation/bot-implementation/index.js +66 -0
  39. package/dist/code-generation/bot-implementation/index.js.map +7 -0
  40. package/dist/code-generation/consts.js +45 -0
  41. package/dist/code-generation/consts.js.map +7 -0
  42. package/dist/code-generation/generators.js +81 -0
  43. package/dist/code-generation/generators.js.map +7 -0
  44. package/dist/code-generation/index.js +49 -0
  45. package/dist/code-generation/index.js.map +7 -0
  46. package/dist/code-generation/integration-implementation/index.js +70 -0
  47. package/dist/code-generation/integration-implementation/index.js.map +7 -0
  48. package/dist/code-generation/integration-implementation/integration-implementation.js +114 -0
  49. package/dist/code-generation/integration-implementation/integration-implementation.js.map +7 -0
  50. package/dist/code-generation/integration-implementation/integration-secret.js +78 -0
  51. package/dist/code-generation/integration-implementation/integration-secret.js.map +7 -0
  52. package/dist/code-generation/integration-implementation/integration-typings/actions-module.js +88 -0
  53. package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +7 -0
  54. package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +107 -0
  55. package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +7 -0
  56. package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js +62 -0
  57. package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +7 -0
  58. package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js +70 -0
  59. package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +7 -0
  60. package/dist/code-generation/integration-implementation/integration-typings/entities-module.js +63 -0
  61. package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +7 -0
  62. package/dist/code-generation/integration-implementation/integration-typings/events-module.js +63 -0
  63. package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +7 -0
  64. package/dist/code-generation/integration-implementation/integration-typings/index.js +128 -0
  65. package/dist/code-generation/integration-implementation/integration-typings/index.js.map +7 -0
  66. package/dist/code-generation/integration-implementation/integration-typings/states-module.js +64 -0
  67. package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +7 -0
  68. package/dist/code-generation/integration-package/index.js +94 -0
  69. package/dist/code-generation/integration-package/index.js.map +7 -0
  70. package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +88 -0
  71. package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +7 -0
  72. package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +107 -0
  73. package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +7 -0
  74. package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +63 -0
  75. package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +7 -0
  76. package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +70 -0
  77. package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +7 -0
  78. package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +63 -0
  79. package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +7 -0
  80. package/dist/code-generation/integration-package/integration-package-definition/events-module.js +66 -0
  81. package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +7 -0
  82. package/dist/code-generation/integration-package/integration-package-definition/index.js +140 -0
  83. package/dist/code-generation/integration-package/integration-package-definition/index.js.map +7 -0
  84. package/dist/code-generation/integration-package/integration-package-definition/states-module.js +66 -0
  85. package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +7 -0
  86. package/dist/code-generation/integration-package/integration-package-definition/typings.js +17 -0
  87. package/dist/code-generation/integration-package/integration-package-definition/typings.js.map +7 -0
  88. package/dist/code-generation/interface-implementation/index.js +29 -0
  89. package/dist/code-generation/interface-implementation/index.js.map +7 -0
  90. package/dist/code-generation/interface-implementation/integration-typings/actions-module.js +88 -0
  91. package/dist/code-generation/interface-implementation/integration-typings/actions-module.js.map +7 -0
  92. package/dist/code-generation/interface-implementation/integration-typings/channels-module.js +107 -0
  93. package/dist/code-generation/interface-implementation/integration-typings/channels-module.js.map +7 -0
  94. package/dist/code-generation/interface-implementation/integration-typings/entities-module.js +63 -0
  95. package/dist/code-generation/interface-implementation/integration-typings/entities-module.js.map +7 -0
  96. package/dist/code-generation/interface-implementation/integration-typings/events-module.js +63 -0
  97. package/dist/code-generation/interface-implementation/integration-typings/events-module.js.map +7 -0
  98. package/dist/code-generation/interface-implementation/integration-typings/index.js +121 -0
  99. package/dist/code-generation/interface-implementation/integration-typings/index.js.map +7 -0
  100. package/dist/code-generation/interface-package/index.js +94 -0
  101. package/dist/code-generation/interface-package/index.js.map +7 -0
  102. package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +88 -0
  103. package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +7 -0
  104. package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +98 -0
  105. package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +7 -0
  106. package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +63 -0
  107. package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +7 -0
  108. package/dist/code-generation/interface-package/interface-package-definition/events-module.js +66 -0
  109. package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +7 -0
  110. package/dist/code-generation/interface-package/interface-package-definition/index.js +104 -0
  111. package/dist/code-generation/interface-package/interface-package-definition/index.js.map +7 -0
  112. package/dist/code-generation/interface-package/interface-package-definition/typings.js +17 -0
  113. package/dist/code-generation/interface-package/interface-package-definition/typings.js.map +7 -0
  114. package/dist/code-generation/module.js +183 -0
  115. package/dist/code-generation/module.js.map +7 -0
  116. package/dist/code-generation/plugin-implementation/index.js +60 -0
  117. package/dist/code-generation/plugin-implementation/index.js.map +7 -0
  118. package/dist/code-generation/plugin-implementation/plugin-implementation.js +90 -0
  119. package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +7 -0
  120. package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js +88 -0
  121. package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js.map +7 -0
  122. package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js +61 -0
  123. package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js.map +7 -0
  124. package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js +63 -0
  125. package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js.map +7 -0
  126. package/dist/code-generation/plugin-implementation/plugin-typings/index.js +150 -0
  127. package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +7 -0
  128. package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js +64 -0
  129. package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js.map +7 -0
  130. package/dist/code-generation/plugin-package/index.js +151 -0
  131. package/dist/code-generation/plugin-package/index.js.map +7 -0
  132. package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js +88 -0
  133. package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js.map +7 -0
  134. package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js +56 -0
  135. package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js.map +7 -0
  136. package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js +66 -0
  137. package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js.map +7 -0
  138. package/dist/code-generation/plugin-package/plugin-package-definition/index.js +107 -0
  139. package/dist/code-generation/plugin-package/plugin-package-definition/index.js.map +7 -0
  140. package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js +66 -0
  141. package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js.map +7 -0
  142. package/dist/code-generation/plugin-package/plugin-package-definition/typings.js +17 -0
  143. package/dist/code-generation/plugin-package/plugin-package-definition/typings.js.map +7 -0
  144. package/dist/code-generation/strings.js +115 -0
  145. package/dist/code-generation/strings.js.map +7 -0
  146. package/dist/code-generation/typings.js +17 -0
  147. package/dist/code-generation/typings.js.map +7 -0
  148. package/dist/command-definitions.js +85 -0
  149. package/dist/command-definitions.js.map +7 -0
  150. package/dist/command-implementations/add-command.js +262 -0
  151. package/dist/command-implementations/add-command.js.map +7 -0
  152. package/dist/command-implementations/base-command.js +69 -0
  153. package/dist/command-implementations/base-command.js.map +7 -0
  154. package/dist/command-implementations/bot-commands.js +117 -0
  155. package/dist/command-implementations/bot-commands.js.map +7 -0
  156. package/dist/command-implementations/build-command.js +53 -0
  157. package/dist/command-implementations/build-command.js.map +7 -0
  158. package/dist/command-implementations/bundle-command.js +87 -0
  159. package/dist/command-implementations/bundle-command.js.map +7 -0
  160. package/dist/command-implementations/chat-command.js +152 -0
  161. package/dist/command-implementations/chat-command.js.map +7 -0
  162. package/dist/command-implementations/deploy-command.js +503 -0
  163. package/dist/command-implementations/deploy-command.js.map +7 -0
  164. package/dist/command-implementations/dev-command.js +345 -0
  165. package/dist/command-implementations/dev-command.js.map +7 -0
  166. package/dist/command-implementations/gen-command.js +110 -0
  167. package/dist/command-implementations/gen-command.js.map +7 -0
  168. package/dist/command-implementations/global-command.js +137 -0
  169. package/dist/command-implementations/global-command.js.map +7 -0
  170. package/dist/command-implementations/index.js +105 -0
  171. package/dist/command-implementations/index.js.map +7 -0
  172. package/dist/command-implementations/init-command.js +162 -0
  173. package/dist/command-implementations/init-command.js.map +7 -0
  174. package/dist/command-implementations/integration-commands.js +130 -0
  175. package/dist/command-implementations/integration-commands.js.map +7 -0
  176. package/dist/command-implementations/interface-commands.js +110 -0
  177. package/dist/command-implementations/interface-commands.js.map +7 -0
  178. package/dist/command-implementations/lint-command.js +151 -0
  179. package/dist/command-implementations/lint-command.js.map +7 -0
  180. package/dist/command-implementations/login-command.js +82 -0
  181. package/dist/command-implementations/login-command.js.map +7 -0
  182. package/dist/command-implementations/logout-command.js +35 -0
  183. package/dist/command-implementations/logout-command.js.map +7 -0
  184. package/dist/command-implementations/plugin-commands.js +111 -0
  185. package/dist/command-implementations/plugin-commands.js.map +7 -0
  186. package/dist/command-implementations/project-command.js +383 -0
  187. package/dist/command-implementations/project-command.js.map +7 -0
  188. package/dist/command-implementations/read-command.js +70 -0
  189. package/dist/command-implementations/read-command.js.map +7 -0
  190. package/dist/command-implementations/serve-command.js +68 -0
  191. package/dist/command-implementations/serve-command.js.map +7 -0
  192. package/dist/command-tree.js +60 -0
  193. package/dist/command-tree.js.map +7 -0
  194. package/dist/config.js +352 -0
  195. package/dist/config.js.map +7 -0
  196. package/dist/consts.js +127 -0
  197. package/dist/consts.js.map +7 -0
  198. package/dist/errors.js +202 -0
  199. package/dist/errors.js.map +7 -0
  200. package/dist/index.js +51 -0
  201. package/dist/index.js.map +7 -0
  202. package/dist/init.js +50 -0
  203. package/dist/init.js.map +7 -0
  204. package/dist/linter/base-linter.js +75 -0
  205. package/dist/linter/base-linter.js.map +7 -0
  206. package/dist/linter/base-linter.test.js +187 -0
  207. package/dist/linter/base-linter.test.js.map +7 -0
  208. package/dist/linter/bot-linter.js +35 -0
  209. package/dist/linter/bot-linter.js.map +7 -0
  210. package/dist/linter/integration-linter.js +35 -0
  211. package/dist/linter/integration-linter.js.map +7 -0
  212. package/dist/linter/interface-linter.js +35 -0
  213. package/dist/linter/interface-linter.js.map +7 -0
  214. package/dist/linter/ruleset-tests/bot.ruleset.test.js +358 -0
  215. package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +7 -0
  216. package/dist/linter/ruleset-tests/common.js +37 -0
  217. package/dist/linter/ruleset-tests/common.js.map +7 -0
  218. package/dist/linter/ruleset-tests/integration.ruleset.test.js +887 -0
  219. package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +7 -0
  220. package/dist/linter/ruleset-tests/interface.ruleset.test.js +383 -0
  221. package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +7 -0
  222. package/dist/linter/rulesets/bot.ruleset.js +191 -0
  223. package/dist/linter/rulesets/bot.ruleset.js.map +7 -0
  224. package/dist/linter/rulesets/integration.ruleset.js +378 -0
  225. package/dist/linter/rulesets/integration.ruleset.js.map +7 -0
  226. package/dist/linter/rulesets/interface.ruleset.js +157 -0
  227. package/dist/linter/rulesets/interface.ruleset.js.map +7 -0
  228. package/dist/linter/spectral-functions.js +36 -0
  229. package/dist/linter/spectral-functions.js.map +7 -0
  230. package/dist/logger/base-logger.js +170 -0
  231. package/dist/logger/base-logger.js.map +7 -0
  232. package/dist/logger/index.js +86 -0
  233. package/dist/logger/index.js.map +7 -0
  234. package/dist/package-ref.js +107 -0
  235. package/dist/package-ref.js.map +7 -0
  236. package/dist/package-ref.test.js +109 -0
  237. package/dist/package-ref.test.js.map +7 -0
  238. package/dist/register-yargs.js +91 -0
  239. package/dist/register-yargs.js.map +7 -0
  240. package/dist/root.js +41 -0
  241. package/dist/root.js.map +7 -0
  242. package/dist/sdk/index.js +22 -0
  243. package/dist/sdk/index.js.map +7 -0
  244. package/dist/sdk/resolve-bot-interfaces.js +43 -0
  245. package/dist/sdk/resolve-bot-interfaces.js.map +7 -0
  246. package/dist/sdk/resolve-integration-interfaces.js +161 -0
  247. package/dist/sdk/resolve-integration-interfaces.js.map +7 -0
  248. package/dist/sdk/validate-bot.js +88 -0
  249. package/dist/sdk/validate-bot.js.map +7 -0
  250. package/dist/sdk/validate-integration.js +72 -0
  251. package/dist/sdk/validate-integration.js.map +7 -0
  252. package/dist/typings.js +17 -0
  253. package/dist/typings.js.map +7 -0
  254. package/dist/utils/cache-utils.js +104 -0
  255. package/dist/utils/cache-utils.js.map +7 -0
  256. package/dist/utils/case-utils.js +84 -0
  257. package/dist/utils/case-utils.js.map +7 -0
  258. package/dist/utils/case-utils.test.js +75 -0
  259. package/dist/utils/case-utils.test.js.map +7 -0
  260. package/dist/utils/esbuild-utils.js +92 -0
  261. package/dist/utils/esbuild-utils.js.map +7 -0
  262. package/dist/utils/event-emitter.js +63 -0
  263. package/dist/utils/event-emitter.js.map +7 -0
  264. package/dist/utils/file-watcher.js +73 -0
  265. package/dist/utils/file-watcher.js.map +7 -0
  266. package/dist/utils/guard-utils.js +32 -0
  267. package/dist/utils/guard-utils.js.map +7 -0
  268. package/dist/utils/id-utils.js +59 -0
  269. package/dist/utils/id-utils.js.map +7 -0
  270. package/dist/utils/index.js +99 -0
  271. package/dist/utils/index.js.map +7 -0
  272. package/dist/utils/object-utils.js +32 -0
  273. package/dist/utils/object-utils.js.map +7 -0
  274. package/dist/utils/path-utils.js +106 -0
  275. package/dist/utils/path-utils.js.map +7 -0
  276. package/dist/utils/path-utils.test.js +72 -0
  277. package/dist/utils/path-utils.test.js.map +7 -0
  278. package/dist/utils/pkgjson-utils.js +57 -0
  279. package/dist/utils/pkgjson-utils.js.map +7 -0
  280. package/dist/utils/promise-utils.js +36 -0
  281. package/dist/utils/promise-utils.js.map +7 -0
  282. package/dist/utils/promise-utils.test.js +14 -0
  283. package/dist/utils/promise-utils.test.js.map +7 -0
  284. package/dist/utils/prompt-utils.js +105 -0
  285. package/dist/utils/prompt-utils.js.map +7 -0
  286. package/dist/utils/record-utils.js +118 -0
  287. package/dist/utils/record-utils.js.map +7 -0
  288. package/dist/utils/record-utils.test.js +38 -0
  289. package/dist/utils/record-utils.test.js.map +7 -0
  290. package/dist/utils/require-utils.js +90 -0
  291. package/dist/utils/require-utils.js.map +7 -0
  292. package/dist/utils/require-utils.test.js +54 -0
  293. package/dist/utils/require-utils.test.js.map +7 -0
  294. package/dist/utils/schema-utils.js +64 -0
  295. package/dist/utils/schema-utils.js.map +7 -0
  296. package/dist/utils/schema-utils.test.js +50 -0
  297. package/dist/utils/schema-utils.test.js.map +7 -0
  298. package/dist/utils/semver-utils.js +45 -0
  299. package/dist/utils/semver-utils.js.map +7 -0
  300. package/dist/utils/string-utils.js +42 -0
  301. package/dist/utils/string-utils.js.map +7 -0
  302. package/dist/utils/template-utils.js +51 -0
  303. package/dist/utils/template-utils.js.map +7 -0
  304. package/dist/utils/tunnel-utils.js +129 -0
  305. package/dist/utils/tunnel-utils.js.map +7 -0
  306. package/dist/utils/type-utils.js +17 -0
  307. package/dist/utils/type-utils.js.map +7 -0
  308. package/dist/utils/url-utils.js +67 -0
  309. package/dist/utils/url-utils.js.map +7 -0
  310. package/dist/worker/child-entrypoint.js +58 -0
  311. package/dist/worker/child-entrypoint.js.map +7 -0
  312. package/dist/worker/child-wrapper.js +119 -0
  313. package/dist/worker/child-wrapper.js.map +7 -0
  314. package/dist/worker/config.js +44 -0
  315. package/dist/worker/config.js.map +7 -0
  316. package/dist/worker/index.js +32 -0
  317. package/dist/worker/index.js.map +7 -0
  318. package/dist/worker/is-child.js +55 -0
  319. package/dist/worker/is-child.js.map +7 -0
  320. package/dist/worker/worker-state.js +71 -0
  321. package/dist/worker/worker-state.js.map +7 -0
  322. package/dist/worker/worker.js +91 -0
  323. package/dist/worker/worker.js.map +7 -0
  324. package/package.json +3 -3
  325. package/templates/empty-bot/.botpress/implementation/index.ts +50 -0
  326. package/templates/empty-bot/.botpress/implementation/plugins/index.ts +11 -0
  327. package/templates/empty-bot/.botpress/implementation/typings/actions/index.ts +6 -0
  328. package/templates/empty-bot/.botpress/implementation/typings/events/index.ts +6 -0
  329. package/templates/empty-bot/.botpress/implementation/typings/index.ts +20 -0
  330. package/templates/empty-bot/.botpress/implementation/typings/integrations/index.ts +6 -0
  331. package/templates/empty-bot/.botpress/implementation/typings/states/index.ts +6 -0
  332. package/templates/empty-bot/.botpress/index.ts +5 -0
  333. package/templates/empty-bot/package.json +2 -2
  334. package/templates/empty-integration/.botpress/implementation/index.ts +57 -0
  335. package/templates/empty-integration/.botpress/implementation/typings/actions/index.ts +6 -0
  336. package/templates/empty-integration/.botpress/implementation/typings/channels/index.ts +6 -0
  337. package/templates/empty-integration/.botpress/implementation/typings/configuration/index.ts +2 -0
  338. package/templates/empty-integration/.botpress/implementation/typings/configurations/index.ts +6 -0
  339. package/templates/empty-integration/.botpress/implementation/typings/entities/index.ts +6 -0
  340. package/templates/empty-integration/.botpress/implementation/typings/events/index.ts +6 -0
  341. package/templates/empty-integration/.botpress/implementation/typings/index.ts +31 -0
  342. package/templates/empty-integration/.botpress/implementation/typings/states/index.ts +6 -0
  343. package/templates/empty-integration/.botpress/index.ts +2 -0
  344. package/templates/empty-integration/.botpress/secrets/index.ts +6 -0
  345. package/templates/empty-integration/package.json +2 -2
  346. package/templates/empty-plugin/.botpress/implementation/index.ts +35 -0
  347. package/templates/empty-plugin/.botpress/implementation/typings/actions/index.ts +6 -0
  348. package/templates/empty-plugin/.botpress/implementation/typings/configuration/index.ts +2 -0
  349. package/templates/empty-plugin/.botpress/implementation/typings/events/index.ts +6 -0
  350. package/templates/empty-plugin/.botpress/implementation/typings/index.ts +26 -0
  351. package/templates/empty-plugin/.botpress/implementation/typings/integrations/index.ts +6 -0
  352. package/templates/empty-plugin/.botpress/implementation/typings/interfaces/index.ts +6 -0
  353. package/templates/empty-plugin/.botpress/implementation/typings/states/index.ts +6 -0
  354. package/templates/empty-plugin/.botpress/index.ts +1 -0
  355. package/templates/empty-plugin/package.json +1 -1
  356. package/templates/hello-world/.botpress/implementation/index.ts +57 -0
  357. package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/index.ts +12 -0
  358. package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/input.ts +5 -0
  359. package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/output.ts +5 -0
  360. package/templates/hello-world/.botpress/implementation/typings/actions/index.ts +9 -0
  361. package/templates/hello-world/.botpress/implementation/typings/channels/index.ts +6 -0
  362. package/templates/hello-world/.botpress/implementation/typings/configuration/index.ts +2 -0
  363. package/templates/hello-world/.botpress/implementation/typings/configurations/index.ts +6 -0
  364. package/templates/hello-world/.botpress/implementation/typings/entities/index.ts +6 -0
  365. package/templates/hello-world/.botpress/implementation/typings/events/index.ts +6 -0
  366. package/templates/hello-world/.botpress/implementation/typings/index.ts +31 -0
  367. package/templates/hello-world/.botpress/implementation/typings/states/index.ts +6 -0
  368. package/templates/hello-world/.botpress/index.ts +2 -0
  369. package/templates/hello-world/.botpress/secrets/index.ts +6 -0
  370. package/templates/hello-world/package.json +2 -2
  371. package/templates/webhook-message/.botpress/implementation/index.ts +57 -0
  372. package/templates/webhook-message/.botpress/implementation/typings/actions/index.ts +6 -0
  373. package/templates/webhook-message/.botpress/implementation/typings/channels/index.ts +9 -0
  374. package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/index.ts +12 -0
  375. package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/index.ts +9 -0
  376. package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/text.ts +5 -0
  377. package/templates/webhook-message/.botpress/implementation/typings/configuration/index.ts +8 -0
  378. package/templates/webhook-message/.botpress/implementation/typings/configurations/index.ts +6 -0
  379. package/templates/webhook-message/.botpress/implementation/typings/entities/index.ts +6 -0
  380. package/templates/webhook-message/.botpress/implementation/typings/events/index.ts +6 -0
  381. package/templates/webhook-message/.botpress/implementation/typings/index.ts +31 -0
  382. package/templates/webhook-message/.botpress/implementation/typings/states/index.ts +6 -0
  383. package/templates/webhook-message/.botpress/index.ts +2 -0
  384. package/templates/webhook-message/.botpress/secrets/index.ts +6 -0
  385. package/templates/webhook-message/package.json +2 -2
@@ -0,0 +1,887 @@
1
+ "use strict";
2
+ var import_vitest = require("vitest");
3
+ var import_integration = require("../rulesets/integration.ruleset");
4
+ var import_common = require("./common");
5
+ const describeRule = (0, import_common.createDescribeRule)()(import_integration.INTEGRATION_RULESET);
6
+ const EMPTY_STRING = "";
7
+ const TRUTHY_STRING = "truthy";
8
+ const ACTION_NAME = "actionName";
9
+ const EVENT_NAME = "eventName";
10
+ const CONFIG_NAME = "configName";
11
+ const PARAM_NAME = "paramName";
12
+ const PROPERTIES_PARAM = "properties";
13
+ const PARAM_NAMES = [PARAM_NAME, PROPERTIES_PARAM];
14
+ const TAG_NAME = "tagName";
15
+ const CHANNEL_NAME = "channelName";
16
+ const STATE_NAME = "stateName";
17
+ const SECRET_NAME = "SECRET_NAME";
18
+ const MESSAGE_TYPE = "text";
19
+ const ZUI = "x-zui";
20
+ const LEGACY_ZUI = "ui";
21
+ describeRule("integration-title-must-be-present", (lint) => {
22
+ (0, import_vitest.test)("missing title should trigger", async () => {
23
+ const definition = {};
24
+ const results = await lint(definition);
25
+ (0, import_vitest.expect)(results).toHaveLength(1);
26
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
27
+ });
28
+ (0, import_vitest.test)("empty title should trigger", async () => {
29
+ const definition = { title: EMPTY_STRING };
30
+ const results = await lint(definition);
31
+ (0, import_vitest.expect)(results).toHaveLength(1);
32
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["title"]);
33
+ });
34
+ (0, import_vitest.test)("valid title should not trigger", async () => {
35
+ const definition = { title: TRUTHY_STRING };
36
+ const results = await lint(definition);
37
+ (0, import_vitest.expect)(results).toHaveLength(0);
38
+ });
39
+ });
40
+ describeRule("integration-description-must-be-present", (lint) => {
41
+ (0, import_vitest.test)("missing description should trigger", async () => {
42
+ const definition = {};
43
+ const results = await lint(definition);
44
+ (0, import_vitest.expect)(results).toHaveLength(1);
45
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
46
+ });
47
+ (0, import_vitest.test)("empty description should trigger", async () => {
48
+ const definition = { description: EMPTY_STRING };
49
+ const results = await lint(definition);
50
+ (0, import_vitest.expect)(results).toHaveLength(1);
51
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["description"]);
52
+ });
53
+ (0, import_vitest.test)("valid description should not trigger", async () => {
54
+ const definition = { description: TRUTHY_STRING };
55
+ const results = await lint(definition);
56
+ (0, import_vitest.expect)(results).toHaveLength(0);
57
+ });
58
+ });
59
+ describeRule("integration-must-have-an-icon", (lint) => {
60
+ (0, import_vitest.test)("missing icon should trigger", async () => {
61
+ const definition = {};
62
+ const results = await lint(definition);
63
+ (0, import_vitest.expect)(results).toHaveLength(1);
64
+ (0, import_vitest.expect)(results[0]?.message).toContain("icon");
65
+ });
66
+ (0, import_vitest.test)("empty icon should trigger", async () => {
67
+ const definition = { icon: EMPTY_STRING };
68
+ const results = await lint(definition);
69
+ (0, import_vitest.expect)(results).toHaveLength(1);
70
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["icon"]);
71
+ });
72
+ (0, import_vitest.test)("valid icon should not trigger", async () => {
73
+ const definition = { icon: TRUTHY_STRING };
74
+ const results = await lint(definition);
75
+ (0, import_vitest.expect)(results).toHaveLength(0);
76
+ });
77
+ });
78
+ describeRule("integration-must-have-a-readme-file", (lint) => {
79
+ (0, import_vitest.test)("missing readme should trigger", async () => {
80
+ const definition = {};
81
+ const results = await lint(definition);
82
+ (0, import_vitest.expect)(results).toHaveLength(1);
83
+ (0, import_vitest.expect)(results[0]?.message).toContain("readme");
84
+ });
85
+ (0, import_vitest.test)("empty readme should trigger", async () => {
86
+ const definition = { readme: EMPTY_STRING };
87
+ const results = await lint(definition);
88
+ (0, import_vitest.expect)(results).toHaveLength(1);
89
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["readme"]);
90
+ });
91
+ (0, import_vitest.test)("valid readme should not trigger", async () => {
92
+ const definition = { readme: TRUTHY_STRING };
93
+ const results = await lint(definition);
94
+ (0, import_vitest.expect)(results).toHaveLength(0);
95
+ });
96
+ });
97
+ describeRule("actions-should-have-a-title", (lint) => {
98
+ (0, import_vitest.test)("missing title should trigger", async () => {
99
+ const definition = { actions: { [ACTION_NAME]: {} } };
100
+ const results = await lint(definition);
101
+ (0, import_vitest.expect)(results).toHaveLength(1);
102
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME]);
103
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
104
+ });
105
+ (0, import_vitest.test)("empty title should trigger", async () => {
106
+ const definition = { actions: { [ACTION_NAME]: { title: EMPTY_STRING } } };
107
+ const results = await lint(definition);
108
+ (0, import_vitest.expect)(results).toHaveLength(1);
109
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "title"]);
110
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
111
+ });
112
+ (0, import_vitest.test)("valid title should not trigger", async () => {
113
+ const definition = { actions: { [ACTION_NAME]: { title: TRUTHY_STRING } } };
114
+ const results = await lint(definition);
115
+ (0, import_vitest.expect)(results).toHaveLength(0);
116
+ });
117
+ });
118
+ describeRule("actions-must-have-a-description", (lint) => {
119
+ (0, import_vitest.test)("missing description should trigger", async () => {
120
+ const definition = { actions: { [ACTION_NAME]: {} } };
121
+ const results = await lint(definition);
122
+ (0, import_vitest.expect)(results).toHaveLength(1);
123
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME]);
124
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
125
+ });
126
+ (0, import_vitest.test)("empty description should trigger", async () => {
127
+ const definition = {
128
+ actions: { [ACTION_NAME]: { description: EMPTY_STRING } }
129
+ };
130
+ const results = await lint(definition);
131
+ (0, import_vitest.expect)(results).toHaveLength(1);
132
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "description"]);
133
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
134
+ });
135
+ (0, import_vitest.test)("valid description should not trigger", async () => {
136
+ const definition = {
137
+ actions: { [ACTION_NAME]: { description: TRUTHY_STRING } }
138
+ };
139
+ const results = await lint(definition);
140
+ (0, import_vitest.expect)(results).toHaveLength(0);
141
+ });
142
+ });
143
+ describeRule("action-inputparams-should-have-a-title", (lint) => {
144
+ import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
145
+ const definition = {
146
+ actions: { [ACTION_NAME]: { input: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } } }
147
+ };
148
+ const results = await lint(definition);
149
+ (0, import_vitest.expect)(results).toHaveLength(1);
150
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties", paramName, ZUI]);
151
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
152
+ });
153
+ import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
154
+ const definition = {
155
+ actions: {
156
+ [ACTION_NAME]: { input: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } } }
157
+ }
158
+ };
159
+ const results = await lint(definition);
160
+ (0, import_vitest.expect)(results).toHaveLength(1);
161
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties", paramName, ZUI, "title"]);
162
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
163
+ });
164
+ import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
165
+ const definition = {
166
+ actions: {
167
+ [ACTION_NAME]: { input: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } } }
168
+ }
169
+ };
170
+ const results = await lint(definition);
171
+ (0, import_vitest.expect)(results).toHaveLength(0);
172
+ });
173
+ });
174
+ describeRule("action-inputparams-must-have-a-description", (lint) => {
175
+ import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
176
+ const definition = {
177
+ actions: { [ACTION_NAME]: { input: { schema: { properties: { [paramName]: {} } } } } }
178
+ };
179
+ const results = await lint(definition);
180
+ (0, import_vitest.expect)(results).toHaveLength(1);
181
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties", paramName]);
182
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
183
+ });
184
+ import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
185
+ const definition = {
186
+ actions: {
187
+ [ACTION_NAME]: { input: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } } }
188
+ }
189
+ };
190
+ const results = await lint(definition);
191
+ (0, import_vitest.expect)(results).toHaveLength(1);
192
+ (0, import_vitest.expect)(results[0]?.path).toEqual([
193
+ "actions",
194
+ ACTION_NAME,
195
+ "input",
196
+ "schema",
197
+ "properties",
198
+ paramName,
199
+ "description"
200
+ ]);
201
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
202
+ });
203
+ import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
204
+ const definition = {
205
+ actions: {
206
+ [ACTION_NAME]: { input: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } } }
207
+ }
208
+ };
209
+ const results = await lint(definition);
210
+ (0, import_vitest.expect)(results).toHaveLength(0);
211
+ });
212
+ });
213
+ describeRule("action-outputparams-should-have-a-title", (lint) => {
214
+ import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
215
+ const definition = {
216
+ actions: { [ACTION_NAME]: { output: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } } }
217
+ };
218
+ const results = await lint(definition);
219
+ (0, import_vitest.expect)(results).toHaveLength(1);
220
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "output", "schema", "properties", paramName, ZUI]);
221
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
222
+ });
223
+ import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
224
+ const definition = {
225
+ actions: {
226
+ [ACTION_NAME]: { output: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } } }
227
+ }
228
+ };
229
+ const results = await lint(definition);
230
+ (0, import_vitest.expect)(results).toHaveLength(1);
231
+ (0, import_vitest.expect)(results[0]?.path).toEqual([
232
+ "actions",
233
+ ACTION_NAME,
234
+ "output",
235
+ "schema",
236
+ "properties",
237
+ paramName,
238
+ ZUI,
239
+ "title"
240
+ ]);
241
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
242
+ });
243
+ import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
244
+ const definition = {
245
+ actions: {
246
+ [ACTION_NAME]: { output: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } } }
247
+ }
248
+ };
249
+ const results = await lint(definition);
250
+ (0, import_vitest.expect)(results).toHaveLength(0);
251
+ });
252
+ });
253
+ describeRule("action-outputparams-must-have-a-description", (lint) => {
254
+ import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
255
+ const definition = {
256
+ actions: { [ACTION_NAME]: { output: { schema: { properties: { [paramName]: {} } } } } }
257
+ };
258
+ const results = await lint(definition);
259
+ (0, import_vitest.expect)(results).toHaveLength(1);
260
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "output", "schema", "properties", paramName]);
261
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
262
+ });
263
+ import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
264
+ const definition = {
265
+ actions: {
266
+ [ACTION_NAME]: { output: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } } }
267
+ }
268
+ };
269
+ const results = await lint(definition);
270
+ (0, import_vitest.expect)(results).toHaveLength(1);
271
+ (0, import_vitest.expect)(results[0]?.path).toEqual([
272
+ "actions",
273
+ ACTION_NAME,
274
+ "output",
275
+ "schema",
276
+ "properties",
277
+ paramName,
278
+ "description"
279
+ ]);
280
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
281
+ });
282
+ import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
283
+ const definition = {
284
+ actions: {
285
+ [ACTION_NAME]: { output: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } } }
286
+ }
287
+ };
288
+ const results = await lint(definition);
289
+ (0, import_vitest.expect)(results).toHaveLength(0);
290
+ });
291
+ });
292
+ describeRule("event-outputparams-should-have-title", (lint) => {
293
+ import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
294
+ const definition = {
295
+ events: { [EVENT_NAME]: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } }
296
+ };
297
+ const results = await lint(definition);
298
+ (0, import_vitest.expect)(results).toHaveLength(1);
299
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName, ZUI]);
300
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
301
+ });
302
+ import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
303
+ const definition = {
304
+ events: {
305
+ [EVENT_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } }
306
+ }
307
+ };
308
+ const results = await lint(definition);
309
+ (0, import_vitest.expect)(results).toHaveLength(1);
310
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName, ZUI, "title"]);
311
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
312
+ });
313
+ import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
314
+ const definition = {
315
+ events: {
316
+ [EVENT_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } }
317
+ }
318
+ };
319
+ const results = await lint(definition);
320
+ (0, import_vitest.expect)(results).toHaveLength(0);
321
+ });
322
+ });
323
+ describeRule("event-outputparams-must-have-description", (lint) => {
324
+ import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
325
+ const definition = {
326
+ events: { [EVENT_NAME]: { schema: { properties: { [paramName]: {} } } } }
327
+ };
328
+ const results = await lint(definition);
329
+ (0, import_vitest.expect)(results).toHaveLength(1);
330
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName]);
331
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
332
+ });
333
+ import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
334
+ const definition = {
335
+ events: {
336
+ [EVENT_NAME]: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } }
337
+ }
338
+ };
339
+ const results = await lint(definition);
340
+ (0, import_vitest.expect)(results).toHaveLength(1);
341
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName, "description"]);
342
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
343
+ });
344
+ import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
345
+ const definition = {
346
+ events: {
347
+ [EVENT_NAME]: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } }
348
+ }
349
+ };
350
+ const results = await lint(definition);
351
+ (0, import_vitest.expect)(results).toHaveLength(0);
352
+ });
353
+ });
354
+ describeRule("events-must-have-a-title", (lint) => {
355
+ (0, import_vitest.test)("missing title should trigger", async () => {
356
+ const definition = { events: { [EVENT_NAME]: {} } };
357
+ const results = await lint(definition);
358
+ (0, import_vitest.expect)(results).toHaveLength(1);
359
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME]);
360
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
361
+ });
362
+ (0, import_vitest.test)("empty title should trigger", async () => {
363
+ const definition = { events: { [EVENT_NAME]: { title: EMPTY_STRING } } };
364
+ const results = await lint(definition);
365
+ (0, import_vitest.expect)(results).toHaveLength(1);
366
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "title"]);
367
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
368
+ });
369
+ (0, import_vitest.test)("valid title should not trigger", async () => {
370
+ const definition = { events: { [EVENT_NAME]: { title: TRUTHY_STRING } } };
371
+ const results = await lint(definition);
372
+ (0, import_vitest.expect)(results).toHaveLength(0);
373
+ });
374
+ });
375
+ describeRule("events-must-have-a-description", (lint) => {
376
+ (0, import_vitest.test)("missing description should trigger", async () => {
377
+ const definition = { events: { [EVENT_NAME]: {} } };
378
+ const results = await lint(definition);
379
+ (0, import_vitest.expect)(results).toHaveLength(1);
380
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME]);
381
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
382
+ });
383
+ (0, import_vitest.test)("empty description should trigger", async () => {
384
+ const definition = { events: { [EVENT_NAME]: { description: EMPTY_STRING } } };
385
+ const results = await lint(definition);
386
+ (0, import_vitest.expect)(results).toHaveLength(1);
387
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "description"]);
388
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
389
+ });
390
+ (0, import_vitest.test)("valid description should not trigger", async () => {
391
+ const definition = {
392
+ events: { [EVENT_NAME]: { description: TRUTHY_STRING } }
393
+ };
394
+ const results = await lint(definition);
395
+ (0, import_vitest.expect)(results).toHaveLength(0);
396
+ });
397
+ });
398
+ describeRule("configuration-fields-must-have-a-title", (lint) => {
399
+ import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
400
+ const definition = {
401
+ configuration: { schema: { properties: { [paramName]: { [ZUI]: {} } } } }
402
+ };
403
+ const results = await lint(definition);
404
+ (0, import_vitest.expect)(results).toHaveLength(1);
405
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName, ZUI]);
406
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
407
+ });
408
+ import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
409
+ const definition = {
410
+ configuration: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } }
411
+ };
412
+ const results = await lint(definition);
413
+ (0, import_vitest.expect)(results).toHaveLength(1);
414
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName, ZUI, "title"]);
415
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
416
+ });
417
+ import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
418
+ const definition = {
419
+ configuration: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } }
420
+ };
421
+ const results = await lint(definition);
422
+ (0, import_vitest.expect)(results).toHaveLength(0);
423
+ });
424
+ });
425
+ describeRule("configuration-fields-must-have-a-description", (lint) => {
426
+ import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
427
+ const definition = {
428
+ configuration: { schema: { properties: { [paramName]: {} } } }
429
+ };
430
+ const results = await lint(definition);
431
+ (0, import_vitest.expect)(results).toHaveLength(1);
432
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName]);
433
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
434
+ });
435
+ import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
436
+ const definition = {
437
+ configuration: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } }
438
+ };
439
+ const results = await lint(definition);
440
+ (0, import_vitest.expect)(results).toHaveLength(1);
441
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName, "description"]);
442
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
443
+ });
444
+ import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
445
+ const definition = {
446
+ configuration: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } }
447
+ };
448
+ const results = await lint(definition);
449
+ (0, import_vitest.expect)(results).toHaveLength(0);
450
+ });
451
+ });
452
+ describeRule("multiple-configurations-must-have-a-title", (lint) => {
453
+ (0, import_vitest.test)("missing title should trigger", async () => {
454
+ const definition = {
455
+ configurations: { [CONFIG_NAME]: {} }
456
+ };
457
+ const results = await lint(definition);
458
+ (0, import_vitest.expect)(results).toHaveLength(1);
459
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME]);
460
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
461
+ });
462
+ (0, import_vitest.test)("empty title should trigger", async () => {
463
+ const definition = {
464
+ configurations: { [CONFIG_NAME]: { title: EMPTY_STRING } }
465
+ };
466
+ const results = await lint(definition);
467
+ (0, import_vitest.expect)(results).toHaveLength(1);
468
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "title"]);
469
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
470
+ });
471
+ (0, import_vitest.test)("valid title should not trigger", async () => {
472
+ const definition = {
473
+ configurations: { [CONFIG_NAME]: { title: TRUTHY_STRING } }
474
+ };
475
+ const results = await lint(definition);
476
+ (0, import_vitest.expect)(results).toHaveLength(0);
477
+ });
478
+ });
479
+ describeRule("multiple-configurations-must-have-a-description", (lint) => {
480
+ (0, import_vitest.test)("missing description should trigger", async () => {
481
+ const definition = {
482
+ configurations: { [CONFIG_NAME]: {} }
483
+ };
484
+ const results = await lint(definition);
485
+ (0, import_vitest.expect)(results).toHaveLength(1);
486
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME]);
487
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
488
+ });
489
+ (0, import_vitest.test)("empty description should trigger", async () => {
490
+ const definition = {
491
+ configurations: { [CONFIG_NAME]: { description: EMPTY_STRING } }
492
+ };
493
+ const results = await lint(definition);
494
+ (0, import_vitest.expect)(results).toHaveLength(1);
495
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "description"]);
496
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
497
+ });
498
+ (0, import_vitest.test)("valid description should not trigger", async () => {
499
+ const definition = {
500
+ configurations: { [CONFIG_NAME]: { description: TRUTHY_STRING } }
501
+ };
502
+ const results = await lint(definition);
503
+ (0, import_vitest.expect)(results).toHaveLength(0);
504
+ });
505
+ });
506
+ describeRule("multipes-configurations-fields-must-have-a-title", (lint) => {
507
+ import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
508
+ const definition = {
509
+ configurations: { [CONFIG_NAME]: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } }
510
+ };
511
+ const results = await lint(definition);
512
+ (0, import_vitest.expect)(results).toHaveLength(1);
513
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName, ZUI]);
514
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
515
+ });
516
+ import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
517
+ const definition = {
518
+ configurations: {
519
+ [CONFIG_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } }
520
+ }
521
+ };
522
+ const results = await lint(definition);
523
+ (0, import_vitest.expect)(results).toHaveLength(1);
524
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName, ZUI, "title"]);
525
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
526
+ });
527
+ import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
528
+ const definition = {
529
+ configurations: {
530
+ [CONFIG_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } }
531
+ }
532
+ };
533
+ const results = await lint(definition);
534
+ (0, import_vitest.expect)(results).toHaveLength(0);
535
+ });
536
+ });
537
+ describeRule("multipes-configurations-fields-must-have-a-description", (lint) => {
538
+ import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
539
+ const definition = {
540
+ configurations: { [CONFIG_NAME]: { schema: { properties: { [paramName]: {} } } } }
541
+ };
542
+ const results = await lint(definition);
543
+ (0, import_vitest.expect)(results).toHaveLength(1);
544
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName]);
545
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
546
+ });
547
+ import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
548
+ const definition = {
549
+ configurations: {
550
+ [CONFIG_NAME]: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } }
551
+ }
552
+ };
553
+ const results = await lint(definition);
554
+ (0, import_vitest.expect)(results).toHaveLength(1);
555
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName, "description"]);
556
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
557
+ });
558
+ import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
559
+ const definition = {
560
+ configurations: {
561
+ [CONFIG_NAME]: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } }
562
+ }
563
+ };
564
+ const results = await lint(definition);
565
+ (0, import_vitest.expect)(results).toHaveLength(0);
566
+ });
567
+ });
568
+ describeRule("user-tags-should-have-a-title", (lint) => {
569
+ (0, import_vitest.test)("missing title should trigger", async () => {
570
+ const definition = { user: { tags: { [TAG_NAME]: {} } } };
571
+ const results = await lint(definition);
572
+ (0, import_vitest.expect)(results).toHaveLength(1);
573
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["user", "tags", TAG_NAME]);
574
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
575
+ });
576
+ (0, import_vitest.test)("empty title should trigger", async () => {
577
+ const definition = { user: { tags: { [TAG_NAME]: { title: EMPTY_STRING } } } };
578
+ const results = await lint(definition);
579
+ (0, import_vitest.expect)(results).toHaveLength(1);
580
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["user", "tags", TAG_NAME, "title"]);
581
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
582
+ });
583
+ (0, import_vitest.test)("valid title should not trigger", async () => {
584
+ const definition = {
585
+ user: { tags: { [TAG_NAME]: { title: TRUTHY_STRING } } }
586
+ };
587
+ const results = await lint(definition);
588
+ (0, import_vitest.expect)(results).toHaveLength(0);
589
+ });
590
+ });
591
+ describeRule("user-tags-must-have-a-description", (lint) => {
592
+ (0, import_vitest.test)("missing description should trigger", async () => {
593
+ const definition = { user: { tags: { [TAG_NAME]: {} } } };
594
+ const results = await lint(definition);
595
+ (0, import_vitest.expect)(results).toHaveLength(1);
596
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["user", "tags", TAG_NAME]);
597
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
598
+ });
599
+ (0, import_vitest.test)("empty description should trigger", async () => {
600
+ const definition = {
601
+ user: { tags: { [TAG_NAME]: { description: EMPTY_STRING } } }
602
+ };
603
+ const results = await lint(definition);
604
+ (0, import_vitest.expect)(results).toHaveLength(1);
605
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["user", "tags", TAG_NAME, "description"]);
606
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
607
+ });
608
+ (0, import_vitest.test)("valid description should not trigger", async () => {
609
+ const definition = {
610
+ user: { tags: { [TAG_NAME]: { description: TRUTHY_STRING } } }
611
+ };
612
+ const results = await lint(definition);
613
+ (0, import_vitest.expect)(results).toHaveLength(0);
614
+ });
615
+ });
616
+ describeRule("channels-should-have-a-title", (lint) => {
617
+ (0, import_vitest.test)("missing title should trigger", async () => {
618
+ const definition = { channels: { [CHANNEL_NAME]: {} } };
619
+ const results = await lint(definition);
620
+ (0, import_vitest.expect)(results).toHaveLength(1);
621
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME]);
622
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
623
+ });
624
+ (0, import_vitest.test)("empty title should trigger", async () => {
625
+ const definition = { channels: { [CHANNEL_NAME]: { title: EMPTY_STRING } } };
626
+ const results = await lint(definition);
627
+ (0, import_vitest.expect)(results).toHaveLength(1);
628
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "title"]);
629
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
630
+ });
631
+ (0, import_vitest.test)("valid title should not trigger", async () => {
632
+ const definition = { channels: { [CHANNEL_NAME]: { title: TRUTHY_STRING } } };
633
+ const results = await lint(definition);
634
+ (0, import_vitest.expect)(results).toHaveLength(0);
635
+ });
636
+ });
637
+ describeRule("channels-must-have-a-description", (lint) => {
638
+ (0, import_vitest.test)("missing description should trigger", async () => {
639
+ const definition = { channels: { [CHANNEL_NAME]: {} } };
640
+ const results = await lint(definition);
641
+ (0, import_vitest.expect)(results).toHaveLength(1);
642
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME]);
643
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
644
+ });
645
+ (0, import_vitest.test)("empty description should trigger", async () => {
646
+ const definition = {
647
+ channels: { [CHANNEL_NAME]: { description: EMPTY_STRING } }
648
+ };
649
+ const results = await lint(definition);
650
+ (0, import_vitest.expect)(results).toHaveLength(1);
651
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "description"]);
652
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
653
+ });
654
+ (0, import_vitest.test)("valid description should not trigger", async () => {
655
+ const definition = {
656
+ channels: { [CHANNEL_NAME]: { description: TRUTHY_STRING } }
657
+ };
658
+ const results = await lint(definition);
659
+ (0, import_vitest.expect)(results).toHaveLength(0);
660
+ });
661
+ });
662
+ describeRule("channels-conversation-tags-should-have-a-title", (lint) => {
663
+ (0, import_vitest.test)("missing title should trigger", async () => {
664
+ const definition = {
665
+ channels: { [CHANNEL_NAME]: { conversation: { tags: { [TAG_NAME]: {} } } } }
666
+ };
667
+ const results = await lint(definition);
668
+ (0, import_vitest.expect)(results).toHaveLength(1);
669
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "conversation", "tags", TAG_NAME]);
670
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
671
+ });
672
+ (0, import_vitest.test)("empty title should trigger", async () => {
673
+ const definition = {
674
+ channels: { [CHANNEL_NAME]: { conversation: { tags: { [TAG_NAME]: { title: EMPTY_STRING } } } } }
675
+ };
676
+ const results = await lint(definition);
677
+ (0, import_vitest.expect)(results).toHaveLength(1);
678
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "conversation", "tags", TAG_NAME, "title"]);
679
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
680
+ });
681
+ (0, import_vitest.test)("valid title should not trigger", async () => {
682
+ const definition = {
683
+ channels: { [CHANNEL_NAME]: { conversation: { tags: { [TAG_NAME]: { title: TRUTHY_STRING } } } } }
684
+ };
685
+ const results = await lint(definition);
686
+ (0, import_vitest.expect)(results).toHaveLength(0);
687
+ });
688
+ });
689
+ describeRule("channels-conversation-tags-must-have-a-description", (lint) => {
690
+ (0, import_vitest.test)("missing description should trigger", async () => {
691
+ const definition = {
692
+ channels: { [CHANNEL_NAME]: { conversation: { tags: { [TAG_NAME]: {} } } } }
693
+ };
694
+ const results = await lint(definition);
695
+ (0, import_vitest.expect)(results).toHaveLength(1);
696
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "conversation", "tags", TAG_NAME]);
697
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
698
+ });
699
+ (0, import_vitest.test)("empty description should trigger", async () => {
700
+ const definition = {
701
+ channels: { [CHANNEL_NAME]: { conversation: { tags: { [TAG_NAME]: { description: EMPTY_STRING } } } } }
702
+ };
703
+ const results = await lint(definition);
704
+ (0, import_vitest.expect)(results).toHaveLength(1);
705
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "conversation", "tags", TAG_NAME, "description"]);
706
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
707
+ });
708
+ (0, import_vitest.test)("valid description should not trigger", async () => {
709
+ const definition = {
710
+ channels: { [CHANNEL_NAME]: { conversation: { tags: { [TAG_NAME]: { description: TRUTHY_STRING } } } } }
711
+ };
712
+ const results = await lint(definition);
713
+ (0, import_vitest.expect)(results).toHaveLength(0);
714
+ });
715
+ });
716
+ describeRule("channels-message-tags-should-have-a-title", (lint) => {
717
+ (0, import_vitest.test)("missing title should trigger", async () => {
718
+ const definition = {
719
+ channels: { [CHANNEL_NAME]: { message: { tags: { [TAG_NAME]: {} } } } }
720
+ };
721
+ const results = await lint(definition);
722
+ (0, import_vitest.expect)(results).toHaveLength(1);
723
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "message", "tags", TAG_NAME]);
724
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
725
+ });
726
+ (0, import_vitest.test)("empty title should trigger", async () => {
727
+ const definition = {
728
+ channels: { [CHANNEL_NAME]: { message: { tags: { [TAG_NAME]: { title: EMPTY_STRING } } } } }
729
+ };
730
+ const results = await lint(definition);
731
+ (0, import_vitest.expect)(results).toHaveLength(1);
732
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "message", "tags", TAG_NAME, "title"]);
733
+ (0, import_vitest.expect)(results[0]?.message).toContain("title");
734
+ });
735
+ (0, import_vitest.test)("valid title should not trigger", async () => {
736
+ const definition = {
737
+ channels: { [CHANNEL_NAME]: { message: { tags: { [TAG_NAME]: { title: TRUTHY_STRING } } } } }
738
+ };
739
+ const results = await lint(definition);
740
+ (0, import_vitest.expect)(results).toHaveLength(0);
741
+ });
742
+ });
743
+ describeRule("channels-message-tags-must-have-a-description", (lint) => {
744
+ (0, import_vitest.test)("missing description should trigger", async () => {
745
+ const definition = {
746
+ channels: { [CHANNEL_NAME]: { message: { tags: { [TAG_NAME]: {} } } } }
747
+ };
748
+ const results = await lint(definition);
749
+ (0, import_vitest.expect)(results).toHaveLength(1);
750
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "message", "tags", TAG_NAME]);
751
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
752
+ });
753
+ (0, import_vitest.test)("empty description should trigger", async () => {
754
+ const definition = {
755
+ channels: { [CHANNEL_NAME]: { message: { tags: { [TAG_NAME]: { description: EMPTY_STRING } } } } }
756
+ };
757
+ const results = await lint(definition);
758
+ (0, import_vitest.expect)(results).toHaveLength(1);
759
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["channels", CHANNEL_NAME, "message", "tags", TAG_NAME, "description"]);
760
+ (0, import_vitest.expect)(results[0]?.message).toContain("description");
761
+ });
762
+ (0, import_vitest.test)("valid description should not trigger", async () => {
763
+ const definition = {
764
+ channels: { [CHANNEL_NAME]: { message: { tags: { [TAG_NAME]: { description: TRUTHY_STRING } } } } }
765
+ };
766
+ const results = await lint(definition);
767
+ (0, import_vitest.expect)(results).toHaveLength(0);
768
+ });
769
+ });
770
+ describeRule("legacy-zui-title-should-be-removed", (lint) => {
771
+ import_vitest.test.each(PARAM_NAMES)("legacy zui title should trigger (%s)", async (paramName) => {
772
+ const definition = {
773
+ actions: {
774
+ [ACTION_NAME]: { input: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } }
775
+ },
776
+ configuration: {
777
+ [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } },
778
+ schema: {}
779
+ },
780
+ events: { [EVENT_NAME]: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } },
781
+ channels: {
782
+ [CHANNEL_NAME]: {
783
+ messages: { [MESSAGE_TYPE]: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } }
784
+ }
785
+ },
786
+ states: { [STATE_NAME]: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } }
787
+ };
788
+ const results = await lint(definition);
789
+ (0, import_vitest.expect)(results).toHaveLength(5);
790
+ (0, import_vitest.expect)(results[0]?.message).toContain(".title()");
791
+ });
792
+ });
793
+ describeRule("legacy-zui-examples-should-be-removed", (lint) => {
794
+ import_vitest.test.each(PARAM_NAMES)("legacy zui examples should trigger (%s)", async (paramName) => {
795
+ const definition = {
796
+ actions: {
797
+ [ACTION_NAME]: { input: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } }
798
+ },
799
+ configuration: {
800
+ [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } },
801
+ schema: {}
802
+ },
803
+ events: { [EVENT_NAME]: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } },
804
+ channels: {
805
+ [CHANNEL_NAME]: {
806
+ messages: { [MESSAGE_TYPE]: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } }
807
+ }
808
+ },
809
+ states: { [STATE_NAME]: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } }
810
+ };
811
+ const results = await lint(definition);
812
+ (0, import_vitest.expect)(results).toHaveLength(5);
813
+ (0, import_vitest.expect)(results[0]?.message).toContain("examples");
814
+ });
815
+ });
816
+ describeRule("state-fields-should-have-title", (lint) => {
817
+ import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
818
+ const definition = {
819
+ states: { [STATE_NAME]: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } }
820
+ };
821
+ const results = await lint(definition);
822
+ (0, import_vitest.expect)(results).toHaveLength(1);
823
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName, ZUI]);
824
+ });
825
+ import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
826
+ const definition = {
827
+ states: { [STATE_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } } }
828
+ };
829
+ const results = await lint(definition);
830
+ (0, import_vitest.expect)(results).toHaveLength(1);
831
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName, ZUI, "title"]);
832
+ });
833
+ import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
834
+ const definition = {
835
+ states: { [STATE_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } } }
836
+ };
837
+ const results = await lint(definition);
838
+ (0, import_vitest.expect)(results).toHaveLength(0);
839
+ });
840
+ });
841
+ describeRule("state-fields-must-have-description", (lint) => {
842
+ import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
843
+ const definition = {
844
+ states: { [STATE_NAME]: { schema: { properties: { [paramName]: {} } } } }
845
+ };
846
+ const results = await lint(definition);
847
+ (0, import_vitest.expect)(results).toHaveLength(1);
848
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName]);
849
+ });
850
+ import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
851
+ const definition = {
852
+ states: { [STATE_NAME]: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } } }
853
+ };
854
+ const results = await lint(definition);
855
+ (0, import_vitest.expect)(results).toHaveLength(1);
856
+ (0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName, "description"]);
857
+ });
858
+ import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
859
+ const definition = {
860
+ states: { [STATE_NAME]: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } } }
861
+ };
862
+ const results = await lint(definition);
863
+ (0, import_vitest.expect)(results).toHaveLength(0);
864
+ });
865
+ });
866
+ describeRule("secrets-must-have-a-description", (lint) => {
867
+ (0, import_vitest.test)("missing description should trigger", async () => {
868
+ const definition = { secrets: { [SECRET_NAME]: {} } };
869
+ const results = await lint(definition);
870
+ (0, import_vitest.expect)(results).toHaveLength(1);
871
+ });
872
+ (0, import_vitest.test)("empty description should trigger", async () => {
873
+ const definition = {
874
+ secrets: { [SECRET_NAME]: { description: EMPTY_STRING } }
875
+ };
876
+ const results = await lint(definition);
877
+ (0, import_vitest.expect)(results).toHaveLength(1);
878
+ });
879
+ (0, import_vitest.test)("valid description should not trigger", async () => {
880
+ const definition = {
881
+ secrets: { [SECRET_NAME]: { description: TRUTHY_STRING } }
882
+ };
883
+ const results = await lint(definition);
884
+ (0, import_vitest.expect)(results).toHaveLength(0);
885
+ });
886
+ });
887
+ //# sourceMappingURL=integration.ruleset.test.js.map