@servicenow/sdk-build-plugins 4.1.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/dist/acl-plugin.js +22 -4
  2. package/dist/acl-plugin.js.map +1 -1
  3. package/dist/applicability-plugin.d.ts +2 -0
  4. package/dist/applicability-plugin.js +72 -0
  5. package/dist/applicability-plugin.js.map +1 -0
  6. package/dist/application-menu-plugin.js +1 -0
  7. package/dist/application-menu-plugin.js.map +1 -1
  8. package/dist/atf/step-configs.d.ts +13 -12
  9. package/dist/atf/step-configs.js.map +1 -1
  10. package/dist/atf/test-plugin.d.ts +1 -1
  11. package/dist/atf/test-plugin.js +13 -7
  12. package/dist/atf/test-plugin.js.map +1 -1
  13. package/dist/basic-syntax-plugin.js +58 -14
  14. package/dist/basic-syntax-plugin.js.map +1 -1
  15. package/dist/business-rule-plugin.js +1 -0
  16. package/dist/business-rule-plugin.js.map +1 -1
  17. package/dist/call-expression-plugin.js +1 -107
  18. package/dist/call-expression-plugin.js.map +1 -1
  19. package/dist/claims-plugin.js +1 -1
  20. package/dist/claims-plugin.js.map +1 -1
  21. package/dist/client-script-plugin.js +5 -17
  22. package/dist/client-script-plugin.js.map +1 -1
  23. package/dist/column/column-helper.d.ts +1 -1
  24. package/dist/column/column-helper.js +46 -2
  25. package/dist/column/column-helper.js.map +1 -1
  26. package/dist/column/column-to-record.js +6 -4
  27. package/dist/column/column-to-record.js.map +1 -1
  28. package/dist/column-plugin.js +107 -28
  29. package/dist/column-plugin.js.map +1 -1
  30. package/dist/dashboard/dashboard-component-property-defaults.d.ts +152 -0
  31. package/dist/dashboard/dashboard-component-property-defaults.js +264 -0
  32. package/dist/dashboard/dashboard-component-property-defaults.js.map +1 -0
  33. package/dist/dashboard/dashboard-component-resolver.d.ts +13 -0
  34. package/dist/dashboard/dashboard-component-resolver.js +69 -0
  35. package/dist/dashboard/dashboard-component-resolver.js.map +1 -0
  36. package/dist/dashboard/dashboard-plugin.d.ts +12 -0
  37. package/dist/dashboard/dashboard-plugin.js +397 -0
  38. package/dist/dashboard/dashboard-plugin.js.map +1 -0
  39. package/dist/data-plugin.d.ts +6 -0
  40. package/dist/data-plugin.js +156 -0
  41. package/dist/data-plugin.js.map +1 -0
  42. package/dist/email-notification-plugin.d.ts +2 -0
  43. package/dist/email-notification-plugin.js +541 -0
  44. package/dist/email-notification-plugin.js.map +1 -0
  45. package/dist/flow/constants/flow-plugin-constants.d.ts +58 -0
  46. package/dist/flow/constants/flow-plugin-constants.js +70 -0
  47. package/dist/flow/constants/flow-plugin-constants.js.map +1 -0
  48. package/dist/flow/flow-logic/flow-logic-constants.d.ts +38 -0
  49. package/dist/flow/flow-logic/flow-logic-constants.js +118 -0
  50. package/dist/flow/flow-logic/flow-logic-constants.js.map +1 -0
  51. package/dist/flow/flow-logic/flow-logic-diagnostics.d.ts +19 -0
  52. package/dist/flow/flow-logic/flow-logic-diagnostics.js +503 -0
  53. package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -0
  54. package/dist/flow/flow-logic/flow-logic-plugin-helpers.d.ts +62 -0
  55. package/dist/flow/flow-logic/flow-logic-plugin-helpers.js +2092 -0
  56. package/dist/flow/flow-logic/flow-logic-plugin-helpers.js.map +1 -0
  57. package/dist/flow/flow-logic/flow-logic-plugin.d.ts +52 -0
  58. package/dist/flow/flow-logic/flow-logic-plugin.js +283 -0
  59. package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -0
  60. package/dist/flow/flow-logic/flow-logic-shapes.d.ts +104 -0
  61. package/dist/flow/flow-logic/flow-logic-shapes.js +201 -0
  62. package/dist/flow/flow-logic/flow-logic-shapes.js.map +1 -0
  63. package/dist/flow/plugins/approval-rules-plugin.d.ts +2 -0
  64. package/dist/flow/plugins/approval-rules-plugin.js +49 -0
  65. package/dist/flow/plugins/approval-rules-plugin.js.map +1 -0
  66. package/dist/flow/plugins/flow-action-definition-plugin.d.ts +2 -0
  67. package/dist/flow/plugins/flow-action-definition-plugin.js +286 -0
  68. package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -0
  69. package/dist/flow/plugins/flow-data-pill-plugin.d.ts +9 -0
  70. package/dist/flow/plugins/flow-data-pill-plugin.js +212 -0
  71. package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -0
  72. package/dist/flow/plugins/flow-definition-plugin.d.ts +2 -0
  73. package/dist/flow/plugins/flow-definition-plugin.js +1668 -0
  74. package/dist/flow/plugins/flow-definition-plugin.js.map +1 -0
  75. package/dist/flow/plugins/flow-diagnostics-plugin.d.ts +26 -0
  76. package/dist/flow/plugins/flow-diagnostics-plugin.js +217 -0
  77. package/dist/flow/plugins/flow-diagnostics-plugin.js.map +1 -0
  78. package/dist/flow/plugins/flow-instance-plugin.d.ts +12 -0
  79. package/dist/flow/plugins/flow-instance-plugin.js +930 -0
  80. package/dist/flow/plugins/flow-instance-plugin.js.map +1 -0
  81. package/dist/flow/plugins/flow-trigger-instance-plugin.d.ts +2 -0
  82. package/dist/flow/plugins/flow-trigger-instance-plugin.js +324 -0
  83. package/dist/flow/plugins/flow-trigger-instance-plugin.js.map +1 -0
  84. package/dist/flow/plugins/inline-script-plugin.d.ts +39 -0
  85. package/dist/flow/plugins/inline-script-plugin.js +80 -0
  86. package/dist/flow/plugins/inline-script-plugin.js.map +1 -0
  87. package/dist/flow/plugins/step-definition-plugin.d.ts +5 -0
  88. package/dist/flow/plugins/step-definition-plugin.js +71 -0
  89. package/dist/flow/plugins/step-definition-plugin.js.map +1 -0
  90. package/dist/flow/plugins/step-instance-plugin.d.ts +31 -0
  91. package/dist/flow/plugins/step-instance-plugin.js +339 -0
  92. package/dist/flow/plugins/step-instance-plugin.js.map +1 -0
  93. package/dist/flow/plugins/trigger-plugin.d.ts +2 -0
  94. package/dist/flow/plugins/trigger-plugin.js +96 -0
  95. package/dist/flow/plugins/trigger-plugin.js.map +1 -0
  96. package/dist/flow/plugins/wfa-datapill-plugin.d.ts +15 -0
  97. package/dist/flow/plugins/wfa-datapill-plugin.js +178 -0
  98. package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -0
  99. package/dist/flow/utils/approval-rules-processor.d.ts +13 -0
  100. package/dist/flow/utils/approval-rules-processor.js +267 -0
  101. package/dist/flow/utils/approval-rules-processor.js.map +1 -0
  102. package/dist/flow/utils/built-in-complex-objects.d.ts +19 -0
  103. package/dist/flow/utils/built-in-complex-objects.js +62 -0
  104. package/dist/flow/utils/built-in-complex-objects.js.map +1 -0
  105. package/dist/flow/utils/complex-object-resolver.d.ts +8 -0
  106. package/dist/flow/utils/complex-object-resolver.js +614 -0
  107. package/dist/flow/utils/complex-object-resolver.js.map +1 -0
  108. package/dist/flow/utils/complex-objects.d.ts +36 -0
  109. package/dist/flow/utils/complex-objects.js +481 -0
  110. package/dist/flow/utils/complex-objects.js.map +1 -0
  111. package/dist/flow/utils/data-pill-shapes.d.ts +58 -0
  112. package/dist/flow/utils/data-pill-shapes.js +135 -0
  113. package/dist/flow/utils/data-pill-shapes.js.map +1 -0
  114. package/dist/flow/utils/datapill-transformer.d.ts +110 -0
  115. package/dist/flow/utils/datapill-transformer.js +503 -0
  116. package/dist/flow/utils/datapill-transformer.js.map +1 -0
  117. package/dist/flow/utils/flow-constants.d.ts +65 -0
  118. package/dist/flow/utils/flow-constants.js +223 -0
  119. package/dist/flow/utils/flow-constants.js.map +1 -0
  120. package/dist/flow/utils/flow-io-to-record.d.ts +44 -0
  121. package/dist/flow/utils/flow-io-to-record.js +409 -0
  122. package/dist/flow/utils/flow-io-to-record.js.map +1 -0
  123. package/dist/flow/utils/flow-shapes.d.ts +161 -0
  124. package/dist/flow/utils/flow-shapes.js +255 -0
  125. package/dist/flow/utils/flow-shapes.js.map +1 -0
  126. package/dist/flow/utils/flow-to-xml.d.ts +16 -0
  127. package/dist/flow/utils/flow-to-xml.js +237 -0
  128. package/dist/flow/utils/flow-to-xml.js.map +1 -0
  129. package/dist/flow/utils/flow-variable-processor.d.ts +51 -0
  130. package/dist/flow/utils/flow-variable-processor.js +69 -0
  131. package/dist/flow/utils/flow-variable-processor.js.map +1 -0
  132. package/dist/flow/utils/label-cache-parser.d.ts +7 -0
  133. package/dist/flow/utils/label-cache-parser.js +24 -0
  134. package/dist/flow/utils/label-cache-parser.js.map +1 -0
  135. package/dist/flow/utils/label-cache-processor.d.ts +119 -0
  136. package/dist/flow/utils/label-cache-processor.js +719 -0
  137. package/dist/flow/utils/label-cache-processor.js.map +1 -0
  138. package/dist/flow/utils/pill-string-parser.d.ts +88 -0
  139. package/dist/flow/utils/pill-string-parser.js +306 -0
  140. package/dist/flow/utils/pill-string-parser.js.map +1 -0
  141. package/dist/flow/utils/schema-to-flow-object.d.ts +22 -0
  142. package/dist/flow/utils/schema-to-flow-object.js +318 -0
  143. package/dist/flow/utils/schema-to-flow-object.js.map +1 -0
  144. package/dist/flow/utils/utils.d.ts +117 -0
  145. package/dist/flow/utils/utils.js +345 -0
  146. package/dist/flow/utils/utils.js.map +1 -0
  147. package/dist/import-sets-plugin.d.ts +2 -0
  148. package/dist/import-sets-plugin.js +412 -0
  149. package/dist/import-sets-plugin.js.map +1 -0
  150. package/dist/index.d.ts +24 -1
  151. package/dist/index.js +25 -1
  152. package/dist/index.js.map +1 -1
  153. package/dist/json-plugin.d.ts +4 -4
  154. package/dist/json-plugin.js +21 -7
  155. package/dist/json-plugin.js.map +1 -1
  156. package/dist/list-plugin.js +83 -1
  157. package/dist/list-plugin.js.map +1 -1
  158. package/dist/now-attach-plugin.d.ts +36 -0
  159. package/dist/now-attach-plugin.js +320 -0
  160. package/dist/now-attach-plugin.js.map +1 -0
  161. package/dist/now-config-plugin.js +3 -0
  162. package/dist/now-config-plugin.js.map +1 -1
  163. package/dist/now-include-plugin.js +7 -1
  164. package/dist/now-include-plugin.js.map +1 -1
  165. package/dist/package-json-plugin.js +2 -2
  166. package/dist/package-json-plugin.js.map +1 -1
  167. package/dist/record-plugin.d.ts +35 -0
  168. package/dist/record-plugin.js +109 -23
  169. package/dist/record-plugin.js.map +1 -1
  170. package/dist/repack/index.d.ts +2 -0
  171. package/dist/repack/index.js +8 -0
  172. package/dist/repack/index.js.map +1 -1
  173. package/dist/repack/lint/Rules.js.map +1 -1
  174. package/dist/rest-api-plugin.js +81 -74
  175. package/dist/rest-api-plugin.js.map +1 -1
  176. package/dist/role-plugin.js +1 -0
  177. package/dist/role-plugin.js.map +1 -1
  178. package/dist/server-module-plugin/index.js +53 -6
  179. package/dist/server-module-plugin/index.js.map +1 -1
  180. package/dist/service-catalog/catalog-clientscript-plugin.d.ts +2 -0
  181. package/dist/service-catalog/catalog-clientscript-plugin.js +117 -0
  182. package/dist/service-catalog/catalog-clientscript-plugin.js.map +1 -0
  183. package/dist/service-catalog/catalog-item-plugin.d.ts +2 -0
  184. package/dist/service-catalog/catalog-item-plugin.js +115 -0
  185. package/dist/service-catalog/catalog-item-plugin.js.map +1 -0
  186. package/dist/service-catalog/catalog-ui-policy-plugin.d.ts +2 -0
  187. package/dist/service-catalog/catalog-ui-policy-plugin.js +266 -0
  188. package/dist/service-catalog/catalog-ui-policy-plugin.js.map +1 -0
  189. package/dist/service-catalog/index.d.ts +5 -0
  190. package/dist/service-catalog/index.js +22 -0
  191. package/dist/service-catalog/index.js.map +1 -0
  192. package/dist/service-catalog/record-to-shape.d.ts +6 -0
  193. package/dist/service-catalog/record-to-shape.js +93 -0
  194. package/dist/service-catalog/record-to-shape.js.map +1 -0
  195. package/dist/service-catalog/sc-record-producer-plugin.d.ts +2 -0
  196. package/dist/service-catalog/sc-record-producer-plugin.js +139 -0
  197. package/dist/service-catalog/sc-record-producer-plugin.js.map +1 -0
  198. package/dist/service-catalog/service-catalog-base.d.ts +311 -0
  199. package/dist/service-catalog/service-catalog-base.js +542 -0
  200. package/dist/service-catalog/service-catalog-base.js.map +1 -0
  201. package/dist/service-catalog/service-catalog-diagnostics.d.ts +45 -0
  202. package/dist/service-catalog/service-catalog-diagnostics.js +169 -0
  203. package/dist/service-catalog/service-catalog-diagnostics.js.map +1 -0
  204. package/dist/service-catalog/shape-to-record.d.ts +7 -0
  205. package/dist/service-catalog/shape-to-record.js +232 -0
  206. package/dist/service-catalog/shape-to-record.js.map +1 -0
  207. package/dist/service-catalog/utils.d.ts +313 -0
  208. package/dist/service-catalog/utils.js +1144 -0
  209. package/dist/service-catalog/utils.js.map +1 -0
  210. package/dist/service-catalog/variable-helper.d.ts +43 -0
  211. package/dist/service-catalog/variable-helper.js +92 -0
  212. package/dist/service-catalog/variable-helper.js.map +1 -0
  213. package/dist/service-catalog/variable-set-plugin.d.ts +2 -0
  214. package/dist/service-catalog/variable-set-plugin.js +175 -0
  215. package/dist/service-catalog/variable-set-plugin.js.map +1 -0
  216. package/dist/service-catalog/variables-transform.d.ts +139 -0
  217. package/dist/service-catalog/variables-transform.js +403 -0
  218. package/dist/service-catalog/variables-transform.js.map +1 -0
  219. package/dist/service-portal/widget-plugin.js +4 -1
  220. package/dist/service-portal/widget-plugin.js.map +1 -1
  221. package/dist/sla/sla-validators.d.ts +61 -0
  222. package/dist/sla/sla-validators.js +224 -0
  223. package/dist/sla/sla-validators.js.map +1 -0
  224. package/dist/sla-plugin.d.ts +5 -0
  225. package/dist/sla-plugin.js +280 -0
  226. package/dist/sla-plugin.js.map +1 -0
  227. package/dist/static-content-plugin.d.ts +1 -0
  228. package/dist/static-content-plugin.js +4 -3
  229. package/dist/static-content-plugin.js.map +1 -1
  230. package/dist/table-plugin.js +49 -4
  231. package/dist/table-plugin.js.map +1 -1
  232. package/dist/ui-page-plugin.js +2 -1
  233. package/dist/ui-page-plugin.js.map +1 -1
  234. package/dist/ui-policy-plugin.d.ts +2 -0
  235. package/dist/ui-policy-plugin.js +405 -0
  236. package/dist/ui-policy-plugin.js.map +1 -0
  237. package/dist/utils.d.ts +19 -1
  238. package/dist/utils.js +40 -0
  239. package/dist/utils.js.map +1 -1
  240. package/dist/ux-list-menu-config-plugin.d.ts +2 -0
  241. package/dist/ux-list-menu-config-plugin.js +292 -0
  242. package/dist/ux-list-menu-config-plugin.js.map +1 -0
  243. package/dist/view-plugin.js +1 -1
  244. package/dist/view-plugin.js.map +1 -1
  245. package/dist/workspace-plugin/chrome-tab.d.ts +2 -0
  246. package/dist/workspace-plugin/chrome-tab.js +46 -0
  247. package/dist/workspace-plugin/chrome-tab.js.map +1 -0
  248. package/dist/workspace-plugin/constants.d.ts +52 -0
  249. package/dist/workspace-plugin/constants.js +56 -0
  250. package/dist/workspace-plugin/constants.js.map +1 -0
  251. package/dist/workspace-plugin/fluent-utils.d.ts +9 -0
  252. package/dist/workspace-plugin/fluent-utils.js +60 -0
  253. package/dist/workspace-plugin/fluent-utils.js.map +1 -0
  254. package/dist/workspace-plugin/page.d.ts +8 -0
  255. package/dist/workspace-plugin/page.js +108 -0
  256. package/dist/workspace-plugin/page.js.map +1 -0
  257. package/dist/workspace-plugin/screen.d.ts +1 -0
  258. package/dist/workspace-plugin/screen.js +38 -0
  259. package/dist/workspace-plugin/screen.js.map +1 -0
  260. package/dist/workspace-plugin/templates/index.d.ts +10 -0
  261. package/dist/workspace-plugin/templates/index.js +20 -0
  262. package/dist/workspace-plugin/templates/index.js.map +1 -0
  263. package/dist/workspace-plugin/templates/record-page-composition.d.ts +1 -0
  264. package/dist/workspace-plugin/templates/record-page-composition.js +4043 -0
  265. package/dist/workspace-plugin/templates/record-page-composition.js.map +1 -0
  266. package/dist/workspace-plugin/templates/record-page-data.d.ts +1 -0
  267. package/dist/workspace-plugin/templates/record-page-data.js +527 -0
  268. package/dist/workspace-plugin/templates/record-page-data.js.map +1 -0
  269. package/dist/workspace-plugin/templates/record-page-interalEventMappings.d.ts +1 -0
  270. package/dist/workspace-plugin/templates/record-page-interalEventMappings.js +39 -0
  271. package/dist/workspace-plugin/templates/record-page-interalEventMappings.js.map +1 -0
  272. package/dist/workspace-plugin/templates/record-page-layoutModel.d.ts +1 -0
  273. package/dist/workspace-plugin/templates/record-page-layoutModel.js +55 -0
  274. package/dist/workspace-plugin/templates/record-page-layoutModel.js.map +1 -0
  275. package/dist/workspace-plugin/templates/record-page-properties.d.ts +1 -0
  276. package/dist/workspace-plugin/templates/record-page-properties.js +135 -0
  277. package/dist/workspace-plugin/templates/record-page-properties.js.map +1 -0
  278. package/dist/workspace-plugin/templates/record-page.d.ts +3 -0
  279. package/dist/workspace-plugin/templates/record-page.js +8 -0
  280. package/dist/workspace-plugin/templates/record-page.js.map +1 -0
  281. package/dist/workspace-plugin.d.ts +2 -0
  282. package/dist/workspace-plugin.js +453 -0
  283. package/dist/workspace-plugin.js.map +1 -0
  284. package/package.json +10 -12
  285. package/src/_types/eslint-plugin-es-x.d.ts +17 -0
  286. package/src/_types/md5.js.d.ts +8 -0
  287. package/src/acl-plugin.ts +33 -10
  288. package/src/applicability-plugin.ts +82 -0
  289. package/src/application-menu-plugin.ts +1 -0
  290. package/src/atf/step-configs.ts +14 -12
  291. package/src/atf/test-plugin.ts +46 -24
  292. package/src/basic-syntax-plugin.ts +71 -14
  293. package/src/business-rule-plugin.ts +9 -5
  294. package/src/call-expression-plugin.ts +2 -130
  295. package/src/claims-plugin.ts +1 -1
  296. package/src/client-script-plugin.ts +8 -22
  297. package/src/column/column-helper.ts +65 -3
  298. package/src/column/column-to-record.ts +6 -4
  299. package/src/column-plugin.ts +142 -40
  300. package/src/dashboard/dashboard-component-property-defaults.ts +277 -0
  301. package/src/dashboard/dashboard-component-resolver.ts +69 -0
  302. package/src/dashboard/dashboard-plugin.ts +450 -0
  303. package/src/data-plugin.ts +194 -0
  304. package/src/email-notification-plugin.ts +850 -0
  305. package/src/flow/constants/flow-plugin-constants.ts +79 -0
  306. package/src/flow/flow-logic/flow-logic-constants.ts +120 -0
  307. package/src/flow/flow-logic/flow-logic-diagnostics.ts +591 -0
  308. package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +2550 -0
  309. package/src/flow/flow-logic/flow-logic-plugin.ts +337 -0
  310. package/src/flow/flow-logic/flow-logic-shapes.ts +215 -0
  311. package/src/flow/plugins/approval-rules-plugin.ts +48 -0
  312. package/src/flow/plugins/flow-action-definition-plugin.ts +295 -0
  313. package/src/flow/plugins/flow-data-pill-plugin.ts +258 -0
  314. package/src/flow/plugins/flow-definition-plugin.ts +2173 -0
  315. package/src/flow/plugins/flow-diagnostics-plugin.ts +280 -0
  316. package/src/flow/plugins/flow-instance-plugin.ts +1148 -0
  317. package/src/flow/plugins/flow-trigger-instance-plugin.ts +426 -0
  318. package/src/flow/plugins/inline-script-plugin.ts +83 -0
  319. package/src/flow/plugins/step-definition-plugin.ts +67 -0
  320. package/src/flow/plugins/step-instance-plugin.ts +431 -0
  321. package/src/flow/plugins/trigger-plugin.ts +95 -0
  322. package/src/flow/plugins/wfa-datapill-plugin.ts +213 -0
  323. package/src/flow/utils/approval-rules-processor.ts +298 -0
  324. package/src/flow/utils/built-in-complex-objects.ts +81 -0
  325. package/src/flow/utils/complex-object-resolver.ts +875 -0
  326. package/src/flow/utils/complex-objects.ts +656 -0
  327. package/src/flow/utils/data-pill-shapes.ts +165 -0
  328. package/src/flow/utils/datapill-transformer.ts +632 -0
  329. package/src/flow/utils/flow-constants.ts +276 -0
  330. package/src/flow/utils/flow-io-to-record.ts +533 -0
  331. package/src/flow/utils/flow-shapes.ts +296 -0
  332. package/src/flow/utils/flow-to-xml.ts +318 -0
  333. package/src/flow/utils/flow-variable-processor.ts +100 -0
  334. package/src/flow/utils/label-cache-parser.ts +37 -0
  335. package/src/flow/utils/label-cache-processor.ts +870 -0
  336. package/src/flow/utils/pill-string-parser.ts +375 -0
  337. package/src/flow/utils/schema-to-flow-object.ts +385 -0
  338. package/src/flow/utils/utils.ts +395 -0
  339. package/src/import-sets-plugin.ts +542 -0
  340. package/src/index.ts +25 -1
  341. package/src/json-plugin.ts +31 -12
  342. package/src/list-plugin.ts +91 -1
  343. package/src/now-attach-plugin.ts +403 -0
  344. package/src/now-config-plugin.ts +6 -2
  345. package/src/now-include-plugin.ts +8 -1
  346. package/src/package-json-plugin.ts +3 -3
  347. package/src/record-plugin.ts +126 -30
  348. package/src/repack/index.ts +14 -0
  349. package/src/repack/lint/Rules.ts +1 -10
  350. package/src/rest-api-plugin.ts +106 -100
  351. package/src/role-plugin.ts +1 -0
  352. package/src/server-module-plugin/index.ts +74 -22
  353. package/src/service-catalog/catalog-clientscript-plugin.ts +140 -0
  354. package/src/service-catalog/catalog-item-plugin.ts +162 -0
  355. package/src/service-catalog/catalog-ui-policy-plugin.ts +324 -0
  356. package/src/service-catalog/index.ts +5 -0
  357. package/src/service-catalog/record-to-shape.ts +109 -0
  358. package/src/service-catalog/sc-record-producer-plugin.ts +201 -0
  359. package/src/service-catalog/service-catalog-base.ts +600 -0
  360. package/src/service-catalog/service-catalog-diagnostics.ts +251 -0
  361. package/src/service-catalog/shape-to-record.ts +275 -0
  362. package/src/service-catalog/utils.ts +1362 -0
  363. package/src/service-catalog/variable-helper.ts +135 -0
  364. package/src/service-catalog/variable-set-plugin.ts +197 -0
  365. package/src/service-catalog/variables-transform.ts +438 -0
  366. package/src/service-portal/widget-plugin.ts +4 -1
  367. package/src/sla/sla-validators.ts +331 -0
  368. package/src/sla-plugin.ts +358 -0
  369. package/src/static-content-plugin.ts +2 -2
  370. package/src/table-plugin.ts +66 -9
  371. package/src/ui-page-plugin.ts +2 -1
  372. package/src/ui-policy-plugin.ts +505 -0
  373. package/src/utils.ts +50 -1
  374. package/src/ux-list-menu-config-plugin.ts +312 -0
  375. package/src/view-plugin.ts +1 -1
  376. package/src/workspace-plugin/chrome-tab.ts +44 -0
  377. package/src/workspace-plugin/constants.ts +53 -0
  378. package/src/workspace-plugin/fluent-utils.ts +60 -0
  379. package/src/workspace-plugin/page.ts +139 -0
  380. package/src/workspace-plugin/screen.ts +34 -0
  381. package/src/workspace-plugin/templates/index.ts +17 -0
  382. package/src/workspace-plugin/templates/record-page-composition.ts +4051 -0
  383. package/src/workspace-plugin/templates/record-page-data.ts +523 -0
  384. package/src/workspace-plugin/templates/record-page-interalEventMappings.ts +35 -0
  385. package/src/workspace-plugin/templates/record-page-layoutModel.ts +51 -0
  386. package/src/workspace-plugin/templates/record-page-properties.ts +131 -0
  387. package/src/workspace-plugin/templates/record-page.ts +6 -0
  388. package/src/workspace-plugin.ts +574 -0
@@ -24,7 +24,12 @@ import {
24
24
  remove,
25
25
  isFluentFile,
26
26
  path as pathModule,
27
+ Record as DBRecord,
28
+ asDataHelper,
29
+ isValidNode,
27
30
  } from '@servicenow/sdk-build-core'
31
+ import { isDataHelper } from './data-plugin'
32
+ import { getCallExpressionName } from './utils'
28
33
 
29
34
  export const BasicSyntaxPlugin = Plugin.create({
30
35
  name: 'BasicSyntaxPlugin',
@@ -61,7 +66,7 @@ export const BasicSyntaxPlugin = Plugin.create({
61
66
  shape: Shape,
62
67
  getTarget(shape, { compiler, project, config }) {
63
68
  const source = shape.getOriginalSource()
64
- if (ts.Node.isNode(source)) {
69
+ if (isValidNode(source)) {
65
70
  return { success: true, value: source }
66
71
  }
67
72
 
@@ -70,8 +75,34 @@ export const BasicSyntaxPlugin = Plugin.create({
70
75
  return { success: false }
71
76
  }
72
77
 
73
- const name = pathModule.basename(source.path).replace(RegExp(`${pathModule.extname(source.path)}$`), '')
74
- const file = compiler.getOrCreateSourceFile(project.resolvePath(config.generatedDir, `${name}.now.ts`))
78
+ const { generatedDir, taxonomy } = config
79
+ const tableName =
80
+ shape.getSource() instanceof DBRecord ? (shape.getSource() as DBRecord).getTable() : undefined
81
+
82
+ const dir =
83
+ tableName && taxonomy.mapping[tableName]
84
+ ? pathModule.join(generatedDir, taxonomy.mapping[tableName])
85
+ : generatedDir
86
+
87
+ let name = pathModule.basename(source.path).replace(RegExp(`${pathModule.extname(source.path)}$`), '')
88
+ if (!name) {
89
+ const id =
90
+ shape.getSource() instanceof DBRecord
91
+ ? (shape.getSource() as DBRecord).getId().getValue()
92
+ : undefined
93
+ name = `${tableName}_${id}`
94
+ }
95
+
96
+ if (project.isTypesGenerationMode()) {
97
+ // In types generation mode, use the exported variable name as the file name
98
+ // Scope directory is already set via per-scope Project rootDir
99
+ if (shape.is(VariableStatementShape) && shape.isExported()) {
100
+ name = shape.getVariableName().getName()
101
+ }
102
+ }
103
+ const file = compiler.getOrCreateSourceFile(
104
+ project.resolvePath(project.getRootDir(), dir, `${name}.now.ts`)
105
+ )
75
106
  const statement = project
76
107
  .addFile(file.getFilePath(), { resolveDependencies: false })
77
108
  .addStatement(shape.getCode())
@@ -167,6 +198,16 @@ export const BasicSyntaxPlugin = Plugin.create({
167
198
  // Turn the number back into a string and compare with the original string to avoid
168
199
  // lossy conversions due to floating point precision or other factors
169
200
  return number.getValue().toString() === shape.getValue() ? number : undefined
201
+ } else if (isDataHelper(target)) {
202
+ if (!ts.Node.isCallExpression(target)) {
203
+ return undefined
204
+ }
205
+ const helperName = getCallExpressionName(target)
206
+ const timeZone = target
207
+ .getArguments()[1]
208
+ ?.asKind(ts.SyntaxKind.StringLiteral)
209
+ ?.getLiteralValue()
210
+ return asDataHelper(helperName, shape, timeZone)
170
211
  } else {
171
212
  return undefined
172
213
  }
@@ -272,7 +313,7 @@ export const BasicSyntaxPlugin = Plugin.create({
272
313
  const existingPropKey = [...shape.getAliases(name), name].find((aliasedKey) =>
273
314
  existingNames.has(aliasedKey)
274
315
  )
275
- if (existingPropKey) {
316
+ if (existingPropKey !== undefined) {
276
317
  if (existingPropKey !== name) {
277
318
  target
278
319
  .getPropertyOrThrow(existingPropKey)
@@ -280,6 +321,7 @@ export const BasicSyntaxPlugin = Plugin.create({
280
321
  .getNameNode()
281
322
  .replaceWithText(name)
282
323
  }
324
+
283
325
  await commit(value, existingNames.get(existingPropKey) as ts.Expression)
284
326
  } else if (!value.equals(shape.getDefault(name))) {
285
327
  propsToAdd.push({
@@ -318,35 +360,50 @@ export const BasicSyntaxPlugin = Plugin.create({
318
360
  {
319
361
  shape: VariableStatementShape,
320
362
  async commit(shape, target, { commit }) {
321
- if (!ts.Node.isVariableStatement(target)) {
322
- const parentStatement = target.getParentIfKind(ts.SyntaxKind.ExpressionStatement)
323
- if (ts.Node.isCallExpression(target) && parentStatement) {
324
- parentStatement.replaceWithText(shape.getCode())
325
- return { success: true }
326
- }
363
+ // If target is ExpressionStatement, replace it directly
364
+ if (ts.Node.isExpressionStatement(target)) {
327
365
  target.replaceWithText(shape.getCode())
328
366
  return { success: true }
329
367
  }
330
368
 
331
- if (target.isExported() !== shape.isExported()) {
332
- target.setIsExported(shape.isExported())
369
+ // If target is CallExpression, check parent type
370
+ if (ts.Node.isCallExpression(target)) {
371
+ const expressionStatement = target.getParentIfKind(ts.SyntaxKind.ExpressionStatement)
372
+ if (expressionStatement) {
373
+ expressionStatement.replaceWithText(shape.getCode())
374
+ return { success: true }
375
+ }
376
+ }
377
+
378
+ // Get VariableStatement for in-place updates (either from CallExpression ancestor or target itself)
379
+ const variableStatement = ts.Node.isVariableStatement(target)
380
+ ? target
381
+ : target.getFirstAncestorByKindOrThrow(ts.SyntaxKind.VariableStatement)
382
+
383
+ // Update export modifier if needed
384
+ if (variableStatement.isExported() !== shape.isExported()) {
385
+ variableStatement.setIsExported(shape.isExported())
333
386
  }
334
387
 
335
- const [declaration, otherDeclaration] = target.getDeclarations()
388
+ // Get the variable declaration
389
+ const [declaration, otherDeclaration] = variableStatement.getDeclarations()
336
390
  if (!declaration) {
337
- throw new Error(`Variable statement is missing a declaration: ${target.getFullText()}`)
391
+ throw new Error(`Variable statement is missing a declaration: ${variableStatement.getFullText()}`)
338
392
  }
339
393
 
394
+ // Remove duplicate declarations
340
395
  if (otherDeclaration) {
341
396
  removeReferences(otherDeclaration)
342
397
  remove(otherDeclaration)
343
398
  }
344
399
 
400
+ // Update variable name if changed
345
401
  const variableName = shape.getVariableName()
346
402
  if (declaration.getName() !== variableName.getName()) {
347
403
  await commit(variableName, declaration.getNameNode())
348
404
  }
349
405
 
406
+ // Update initializer
350
407
  await commit(shape.getInitializer(), declaration.getInitializerOrThrow())
351
408
  return { success: true }
352
409
  },
@@ -1,16 +1,19 @@
1
1
  import { CallExpressionShape, type ObjectShape, Plugin, type ArrayShape, type Shape } from '@servicenow/sdk-build-core'
2
2
  import { ModuleFunctionShape } from './server-module-plugin'
3
3
  import { NowIdShape } from './now-id-plugin'
4
- import { generateDeprecatedDiagnostics } from './utils'
4
+ import { createSdkDocEntry, generateDeprecatedDiagnostics } from './utils'
5
5
  import { NowIncludeShape } from './now-include-plugin'
6
6
 
7
7
  // Similar to lodash's groupBy, but simply stores the last element of each group
8
8
  function groupByExistence<T>(collection: T[] | undefined, keyProvider: (element: T) => string): { [key: string]: T } {
9
9
  return (
10
- collection?.reduce((groups, e) => {
11
- groups[keyProvider(e)] = e
12
- return groups
13
- }, {}) ?? {}
10
+ collection?.reduce(
11
+ (groups, e) => {
12
+ groups[keyProvider(e)] = e
13
+ return groups
14
+ },
15
+ {} as { [key: string]: T }
16
+ ) ?? {}
14
17
  )
15
18
  }
16
19
 
@@ -42,6 +45,7 @@ const brAliases = {
42
45
 
43
46
  export const BusinessRulePlugin = Plugin.create({
44
47
  name: 'BusinessRulePlugin',
48
+ docs: [createSdkDocEntry('BusinessRule', ['sys_script'])],
45
49
  records: {
46
50
  sys_script: {
47
51
  async toShape(record, { transform }) {
@@ -1,5 +1,4 @@
1
- import { ts, Plugin, CallExpressionShape, type Shape, type Compiler } from '@servicenow/sdk-build-core'
2
- import { Record } from '@servicenow/sdk-core/runtime/db'
1
+ import { ts, Plugin, CallExpressionShape, type Shape } from '@servicenow/sdk-build-core'
3
2
  import { getCallExpressionName } from './utils'
4
3
 
5
4
  export const CallExpressionPlugin = Plugin.create({
@@ -34,7 +33,7 @@ export const CallExpressionPlugin = Plugin.create({
34
33
  shapes: [
35
34
  {
36
35
  shape: CallExpressionShape,
37
- async commit(shape, target, { commit, compiler }) {
36
+ async commit(shape, target, { commit }) {
38
37
  if (target.isKind(ts.SyntaxKind.ExpressionStatement)) {
39
38
  target = target.getExpression()
40
39
  }
@@ -68,135 +67,8 @@ export const CallExpressionPlugin = Plugin.create({
68
67
  target.addArguments(argumentsToAdd)
69
68
  }
70
69
 
71
- if (shape.getCallee() === Record.name) {
72
- fixCallExpressionArgTypes(compiler, target)
73
- }
74
-
75
70
  return { success: true }
76
71
  },
77
72
  },
78
73
  ],
79
74
  })
80
-
81
- function fixCallExpressionArgTypes(compiler: Compiler, node: ts.CallExpression) {
82
- if (node.wasForgotten()) {
83
- return
84
- }
85
-
86
- node.getSourceFile().fixMissingImports()
87
- const signature = compiler.getTypeChecker().getResolvedSignature(node)
88
- if (!signature) {
89
- return
90
- }
91
-
92
- signature.getParameters().forEach((param, idx) => {
93
- const argType = param.getTypeAtLocation(node)
94
- const argNode = node.getArguments()[idx]?.asKind(ts.SyntaxKind.ObjectLiteralExpression)
95
- if (!argType || !argNode) {
96
- return
97
- }
98
- fixCallExpressionArgType(node, argNode, argType)
99
- })
100
- }
101
-
102
- function fixCallExpressionArgType(
103
- node: ts.CallExpression,
104
- argNode: ts.ObjectLiteralExpression | ts.PropertyAssignment,
105
- argType: ts.Type
106
- ) {
107
- if (argNode.getType().isObject()) {
108
- const objectLiteral = argNode.isKind(ts.SyntaxKind.ObjectLiteralExpression)
109
- ? argNode
110
- : argNode.getInitializerIfKind(ts.SyntaxKind.ObjectLiteralExpression)
111
- argType.getApparentProperties().forEach((prop) => {
112
- const propNode = objectLiteral?.getProperty(prop.getName())?.asKind(ts.SyntaxKind.PropertyAssignment)
113
- if (!propNode) {
114
- return
115
- }
116
- fixCallExpressionArgType(node, propNode, prop.getTypeAtLocation(node))
117
- })
118
- } else if (argNode.isKind(ts.SyntaxKind.PropertyAssignment)) {
119
- const nodeType = argNode.getType()
120
- if (
121
- nodeType.isAssignableTo(argType) ||
122
- canAssignString(argNode, argType) ||
123
- canCastAndAssignBoolean(argNode, argType) ||
124
- canCastAndAssignNumber(argNode, argType)
125
- ) {
126
- return
127
- }
128
-
129
- // cast 'as any' for other types
130
- const argValue = argNode.getInitializer()?.getText()
131
- argNode.setInitializer(`${argValue} as any`)
132
- }
133
- }
134
-
135
- function canCastAndAssignBoolean(argNode: ts.PropertyAssignment, argType: ts.Type): boolean {
136
- const booleanTypes = getBooleanTypes(argType)
137
- const booleanValue = getBooleanValue(argNode)
138
- if (booleanValue && booleanTypes.length > 0) {
139
- const isAssignable = booleanTypes.some((type) => {
140
- return (
141
- (type.isBoolean() && (booleanValue === 'true' || booleanValue === 'false')) ||
142
- type.getText() === booleanValue
143
- )
144
- })
145
- if (isAssignable) {
146
- argNode.setInitializer(`${booleanValue}`)
147
- return true
148
- }
149
- }
150
- return false
151
- }
152
-
153
- function canCastAndAssignNumber(argNode: ts.PropertyAssignment, argType: ts.Type): boolean {
154
- const numberTypes = getNumberTypes(argType)
155
- const numberValue = getNumberValue(argNode)
156
- if (numberValue && numberTypes.length > 0) {
157
- const isAssignable = numberTypes.some((type) => {
158
- return type.isNumber() || `${type.getLiteralValue()}` === numberValue
159
- })
160
- if (isAssignable) {
161
- argNode.setInitializer(`${numberValue}`)
162
- return true
163
- }
164
- }
165
- return false
166
- }
167
-
168
- function canAssignString(argNode: ts.PropertyAssignment, argType: ts.Type): boolean {
169
- const stringTypes = getStringTypes(argType)
170
- const stringValue = getStringValue(argNode)
171
- return stringTypes.some((type) => {
172
- return type.isString() || type.getLiteralValue() === stringValue
173
- })
174
- }
175
-
176
- function getBooleanValue(argNode: ts.PropertyAssignment): string | undefined {
177
- return argNode.getInitializerIfKind(ts.SyntaxKind.StringLiteral)?.getLiteralValue()
178
- }
179
-
180
- function getBooleanTypes(argType: ts.Type) {
181
- const type = argType.isUnion() ? argType.getUnionTypes() : [argType]
182
- return type.filter((type) => type.isBoolean() || type.isBooleanLiteral())
183
- }
184
-
185
- function getNumberValue(argNode: ts.PropertyAssignment): string | undefined {
186
- const numStrVal = argNode.getInitializerIfKind(ts.SyntaxKind.StringLiteral)?.getLiteralValue()
187
- return numStrVal && !isNaN(Number(numStrVal)) ? `${numStrVal}` : undefined
188
- }
189
-
190
- function getNumberTypes(argType: ts.Type) {
191
- const type = argType.isUnion() ? argType.getUnionTypes() : [argType]
192
- return type.filter((type) => type.isNumber() || type.isNumberLiteral())
193
- }
194
-
195
- function getStringValue(argNode: ts.PropertyAssignment): string | undefined {
196
- return argNode.getInitializerIfKind(ts.SyntaxKind.StringLiteral)?.getLiteralValue()
197
- }
198
-
199
- function getStringTypes(argType: ts.Type) {
200
- const type = argType.isUnion() ? argType.getUnionTypes() : [argType]
201
- return type.filter((type) => type.isString() || type.isStringLiteral())
202
- }
@@ -59,7 +59,7 @@ export const ClaimsPlugin = Plugin.create({
59
59
  return { success: false }
60
60
  }
61
61
 
62
- const allClaims = file.getJson()
62
+ const allClaims = file.getJson().asObject()
63
63
  const records: Record[] = []
64
64
  for (const [updateName, claims] of allClaims.entries()) {
65
65
  for (const claim of claims
@@ -1,6 +1,7 @@
1
- import { type Compiler, ts, CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
1
+ import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from './now-id-plugin'
3
- import { generateDeprecatedDiagnostics } from './utils'
3
+ import { generateDeprecatedDiagnostics, validateClientSideScript } from './utils'
4
+ import { NowIncludeShape } from './now-include-plugin'
4
5
 
5
6
  enum UITypeMapping {
6
7
  desktop = 0,
@@ -45,7 +46,8 @@ export const ClientScriptPlugin = Plugin.create({
45
46
  name: 'ClientScriptPlugin',
46
47
  records: {
47
48
  sys_script_client: {
48
- toShape(record) {
49
+ async toShape(record, { transform }) {
50
+ const script = await NowIncludeShape.fromRecord(record, record.get('script'), transform)
49
51
  return {
50
52
  success: true,
51
53
  value: new CallExpressionShape({
@@ -59,7 +61,7 @@ export const ClientScriptPlugin = Plugin.create({
59
61
  table: $,
60
62
  appliesExtended: $.from('applies_extended').toBoolean().def(false),
61
63
  isolateScript: $.from('isolate_script').toBoolean().def(false),
62
- script: $,
64
+ script: $.val(script),
63
65
  name: $,
64
66
  description: $.def(''),
65
67
  messages: $.def(''),
@@ -110,7 +112,7 @@ export const ClientScriptPlugin = Plugin.create({
110
112
  )
111
113
  }
112
114
 
113
- if (script && !validateClientSideScripts(script, compiler)) {
115
+ if (script && !validateClientSideScript(script, compiler)) {
114
116
  diagnostics.error(
115
117
  clientScript.get('script'),
116
118
  `Client side scripts cannot import or require modules.`
@@ -147,17 +149,6 @@ export const ClientScriptPlugin = Plugin.create({
147
149
  ],
148
150
  })
149
151
 
150
- function validateClientSideScripts(script: string, compiler: Compiler) {
151
- const source = compiler.createSourceFile('tmp-file.ts', script)
152
- const importDeclarations = source.getDescendantsOfKind(ts.SyntaxKind.ImportDeclaration)
153
- const requireCalls = source.getDescendantsOfKind(ts.SyntaxKind.CallExpression).filter((callExpression) => {
154
- return isRequire(callExpression)
155
- })
156
- const isValid = !(importDeclarations.length > 0 || requireCalls.length > 0)
157
- compiler.removeSourceFile(source)
158
- return isValid
159
- }
160
-
161
152
  function getUITypeFromId(id: number) {
162
153
  const type = UITypeMapping[id]
163
154
  if (!type) {
@@ -168,12 +159,7 @@ function getUITypeFromId(id: number) {
168
159
 
169
160
  function getUITypeId(value: string) {
170
161
  if (value in UITypeMapping) {
171
- return UITypeMapping[value]
162
+ return UITypeMapping[value as keyof typeof UITypeMapping]
172
163
  }
173
164
  throw Error('Invalid ui_type found in xml')
174
165
  }
175
-
176
- function isRequire(callExpression: ts.CallExpression): boolean {
177
- const expression = callExpression.getExpression()
178
- return ts.Node.isIdentifier(expression) && expression.getText() === 'require'
179
- }
@@ -1,5 +1,6 @@
1
1
  import { CallExpressionShape, Shape } from '@servicenow/sdk-build-core'
2
2
  import {
3
+ ApprovalRulesColumn,
3
4
  BasicDateTimeColumn,
4
5
  BasicImageColumn,
5
6
  BooleanColumn,
@@ -8,25 +9,42 @@ import {
8
9
  ConditionsColumn,
9
10
  DateColumn,
10
11
  DateTimeColumn,
12
+ DayOfWeekColumn,
13
+ DaysOfWeekColumn,
11
14
  DecimalColumn,
12
15
  DocumentIdColumn,
13
16
  DomainIdColumn,
14
17
  DomainPathColumn,
15
18
  DueDateColumn,
19
+ DurationColumn,
20
+ EmailColumn,
21
+ FieldListColumn,
16
22
  FieldNameColumn,
23
+ FloatColumn,
24
+ GuidColumn,
25
+ HtmlColumn,
17
26
  IntegerColumn,
18
27
  IntegerDateColumn,
28
+ JsonColumn,
19
29
  ListColumn,
30
+ MultiLineTextColumn,
31
+ NameValuePairsColumn,
20
32
  OtherDateColumn,
33
+ Password2Column,
21
34
  RadioColumn,
35
+ RecordsColumn,
22
36
  ReferenceColumn,
23
37
  ScheduleDateTimeColumn,
24
38
  ScriptColumn,
39
+ SlushBucketColumn,
25
40
  StringColumn,
26
41
  SystemClassNameColumn,
27
42
  TableNameColumn,
43
+ TemplateValueColumn,
44
+ TimeColumn,
28
45
  TranslatedFieldColumn,
29
46
  TranslatedTextColumn,
47
+ UrlColumn,
30
48
  UserRolesColumn,
31
49
  VersionColumn,
32
50
  } from '@servicenow/sdk-core/runtime/db'
@@ -61,6 +79,25 @@ export const COLUMN_TYPE_TO_API: Record<string, string> = {
61
79
  version: VersionColumn.name,
62
80
  glide_list: ListColumn.name,
63
81
  image: BasicImageColumn.name,
82
+ // New column types
83
+ GUID: GuidColumn.name,
84
+ password2: Password2Column.name,
85
+ json: JsonColumn.name,
86
+ url: UrlColumn.name,
87
+ email: EmailColumn.name,
88
+ html: HtmlColumn.name,
89
+ float: FloatColumn.name,
90
+ glide_duration: DurationColumn.name,
91
+ glide_time: TimeColumn.name,
92
+ field_list: FieldListColumn.name,
93
+ records: RecordsColumn.name,
94
+ slushbucket: SlushBucketColumn.name,
95
+ name_values: NameValuePairsColumn.name,
96
+ approval_rules: ApprovalRulesColumn.name,
97
+ multi_two_lines: MultiLineTextColumn.name,
98
+ template_value: TemplateValueColumn.name,
99
+ day_of_week: DayOfWeekColumn.name,
100
+ days_of_week: DaysOfWeekColumn.name,
64
101
  }
65
102
 
66
103
  export const COLUMN_API_TO_TYPE = Object.fromEntries(
@@ -87,25 +124,50 @@ export function addFieldsToColumn(
87
124
  })
88
125
  }
89
126
 
90
- export function getDefaultMaxLength(columnType: string): number {
127
+ export function getDefaultMaxLength(columnType: string | undefined): number {
91
128
  switch (columnType) {
92
129
  case 'conditions':
93
130
  case 'glide_list':
131
+ case 'json':
132
+ case 'name_values':
133
+ case 'multi_two_lines':
94
134
  return 4000
135
+ case 'template_value':
136
+ return 65000
137
+ case 'script':
138
+ return 8000
139
+ case 'html':
140
+ return 65536
95
141
  case 'decimal':
96
142
  return 20
143
+ case 'float':
144
+ return 15
97
145
  case 'domain_id':
98
146
  case 'document_id':
99
147
  case 'reference':
148
+ case 'GUID':
100
149
  return 32
150
+ case 'string_full_utf8':
101
151
  case 'domain_path':
102
152
  case 'user_roles':
153
+ case 'password2':
154
+ case 'email':
103
155
  return 255
104
- case 'script':
105
- return 8000
156
+ case 'url':
157
+ case 'records':
158
+ return 1024
106
159
  case 'table_name':
107
160
  case 'field_name':
108
161
  return 80
162
+ case 'glide_duration':
163
+ return 20
164
+ case 'glide_time':
165
+ return 8
166
+ case 'field_list':
167
+ case 'approval_rules':
168
+ return 1024
169
+ case 'slushbucket':
170
+ return 4000
109
171
  default:
110
172
  /**
111
173
  * For types mentioned below it default to 40 on instance
@@ -28,6 +28,7 @@ export async function getDocumentationRecords(
28
28
  name: $.from('table'),
29
29
  element: $.val(columnName),
30
30
  language: $.def('en'),
31
+ hint: $.def(''),
31
32
  label: $.val(documentation.ifDefined() ?? columnName),
32
33
  plural: $.val(
33
34
  generatePlural(
@@ -52,7 +53,7 @@ export async function getDocumentationRecords(
52
53
  name: $.val(column.get('table')),
53
54
  element: $.val(column.get('name')),
54
55
  language: $,
55
- hint: $,
56
+ hint: $.def(''),
56
57
  help: $,
57
58
  label: $,
58
59
  plural: $,
@@ -78,6 +79,7 @@ export async function getDocumentationRecords(
78
79
  name: $.from('table'),
79
80
  element: $.val(columnName),
80
81
  language: $.def('en'),
82
+ hint: $.def(''),
81
83
  label: $.val(documentation.ifDefined() ?? columnName),
82
84
  plural: $.val(
83
85
  generatePlural(documentation.ifDefined()?.asString().getValue() ?? columnName.asString().getValue())
@@ -100,9 +102,7 @@ export async function getChoiceRecords(
100
102
  }
101
103
 
102
104
  const records: Record[] = []
103
- for (const choiceValue of Object.keys(choiceArg.getValue())) {
104
- // TODO Should have proper type here
105
- const choice = choiceArg.get(choiceValue)
105
+ for (const [idx, [choiceValue, choice]] of Object.entries(choiceArg.properties()).entries()) {
106
106
  if (choice.isObject()) {
107
107
  generateDeprecatedDiagnostics(choice.withAliasedKeys(aliasedKeys), diagnostics)
108
108
  }
@@ -116,6 +116,8 @@ export async function getChoiceRecords(
116
116
  element: column.get('name').asString().getValue(),
117
117
  label: choice,
118
118
  value: choiceValue,
119
+ sequence: idx + 1,
120
+ language: 'en',
119
121
  }
120
122
  : choice.asObject().transform(({ $ }) => ({
121
123
  name: $.val(column.get('table')),