@servicenow/sdk-build-plugins 4.4.1 → 4.6.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 (337) hide show
  1. package/dist/acl-plugin.js +54 -4
  2. package/dist/acl-plugin.js.map +1 -1
  3. package/dist/applicability-plugin.js +2 -0
  4. package/dist/applicability-plugin.js.map +1 -1
  5. package/dist/application-menu-plugin.js +2 -0
  6. package/dist/application-menu-plugin.js.map +1 -1
  7. package/dist/arrow-function-plugin.d.ts +6 -1
  8. package/dist/arrow-function-plugin.js +105 -12
  9. package/dist/arrow-function-plugin.js.map +1 -1
  10. package/dist/atf/test-plugin.js +2 -0
  11. package/dist/atf/test-plugin.js.map +1 -1
  12. package/dist/basic-syntax-plugin.js +20 -0
  13. package/dist/basic-syntax-plugin.js.map +1 -1
  14. package/dist/call-expression-plugin.js +1 -0
  15. package/dist/call-expression-plugin.js.map +1 -1
  16. package/dist/claims-plugin.js +1 -0
  17. package/dist/claims-plugin.js.map +1 -1
  18. package/dist/client-script-plugin.js +1 -0
  19. package/dist/client-script-plugin.js.map +1 -1
  20. package/dist/column-plugin.js +4 -7
  21. package/dist/column-plugin.js.map +1 -1
  22. package/dist/cross-scope-privilege-plugin.js +1 -0
  23. package/dist/cross-scope-privilege-plugin.js.map +1 -1
  24. package/dist/dashboard/dashboard-plugin.js +2 -0
  25. package/dist/dashboard/dashboard-plugin.js.map +1 -1
  26. package/dist/data-plugin.js +1 -0
  27. package/dist/data-plugin.js.map +1 -1
  28. package/dist/email-notification-plugin.js +9 -13
  29. package/dist/email-notification-plugin.js.map +1 -1
  30. package/dist/flow/constants/flow-plugin-constants.d.ts +1 -1
  31. package/dist/flow/constants/flow-plugin-constants.js +1 -1
  32. package/dist/flow/constants/flow-plugin-constants.js.map +1 -1
  33. package/dist/flow/flow-logic/flow-logic-diagnostics.js +5 -5
  34. package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -1
  35. package/dist/flow/flow-logic/flow-logic-plugin-helpers.d.ts +82 -2
  36. package/dist/flow/flow-logic/flow-logic-plugin-helpers.js +48 -40
  37. package/dist/flow/flow-logic/flow-logic-plugin-helpers.js.map +1 -1
  38. package/dist/flow/flow-logic/flow-logic-plugin.js +1 -0
  39. package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -1
  40. package/dist/flow/plugins/approval-rules-plugin.js +1 -0
  41. package/dist/flow/plugins/approval-rules-plugin.js.map +1 -1
  42. package/dist/flow/plugins/flow-action-definition-plugin.js +1232 -55
  43. package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -1
  44. package/dist/flow/plugins/flow-data-pill-plugin.js +6 -2
  45. package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -1
  46. package/dist/flow/plugins/flow-definition-plugin.js +23 -44
  47. package/dist/flow/plugins/flow-definition-plugin.js.map +1 -1
  48. package/dist/flow/plugins/flow-diagnostics-plugin.d.ts +2 -2
  49. package/dist/flow/plugins/flow-diagnostics-plugin.js +3 -2
  50. package/dist/flow/plugins/flow-diagnostics-plugin.js.map +1 -1
  51. package/dist/flow/plugins/flow-instance-plugin.js +136 -34
  52. package/dist/flow/plugins/flow-instance-plugin.js.map +1 -1
  53. package/dist/flow/plugins/flow-trigger-instance-plugin.js +1 -0
  54. package/dist/flow/plugins/flow-trigger-instance-plugin.js.map +1 -1
  55. package/dist/flow/plugins/inline-script-plugin.js +1 -0
  56. package/dist/flow/plugins/inline-script-plugin.js.map +1 -1
  57. package/dist/flow/plugins/step-definition-plugin.js +4 -2
  58. package/dist/flow/plugins/step-definition-plugin.js.map +1 -1
  59. package/dist/flow/plugins/step-instance-plugin.d.ts +9 -1
  60. package/dist/flow/plugins/step-instance-plugin.js +649 -135
  61. package/dist/flow/plugins/step-instance-plugin.js.map +1 -1
  62. package/dist/flow/plugins/trigger-plugin.js +2 -0
  63. package/dist/flow/plugins/trigger-plugin.js.map +1 -1
  64. package/dist/flow/plugins/wfa-datapill-plugin.js +21 -5
  65. package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -1
  66. package/dist/flow/post-install.d.ts +2 -0
  67. package/dist/flow/post-install.js +59 -0
  68. package/dist/flow/post-install.js.map +1 -0
  69. package/dist/flow/utils/complex-object-resolver.js +4 -1
  70. package/dist/flow/utils/complex-object-resolver.js.map +1 -1
  71. package/dist/flow/utils/complex-objects.js +5 -3
  72. package/dist/flow/utils/complex-objects.js.map +1 -1
  73. package/dist/flow/utils/flow-constants.d.ts +90 -2
  74. package/dist/flow/utils/flow-constants.js +430 -7
  75. package/dist/flow/utils/flow-constants.js.map +1 -1
  76. package/dist/flow/utils/flow-io-to-record.d.ts +1 -1
  77. package/dist/flow/utils/flow-io-to-record.js +37 -16
  78. package/dist/flow/utils/flow-io-to-record.js.map +1 -1
  79. package/dist/flow/utils/flow-shapes.js +4 -0
  80. package/dist/flow/utils/flow-shapes.js.map +1 -1
  81. package/dist/flow/utils/flow-to-xml.d.ts +3 -2
  82. package/dist/flow/utils/flow-to-xml.js +3 -4
  83. package/dist/flow/utils/flow-to-xml.js.map +1 -1
  84. package/dist/flow/utils/label-cache-parser.d.ts +9 -2
  85. package/dist/flow/utils/label-cache-parser.js +32 -4
  86. package/dist/flow/utils/label-cache-parser.js.map +1 -1
  87. package/dist/flow/utils/label-cache-processor.d.ts +5 -0
  88. package/dist/flow/utils/label-cache-processor.js +14 -2
  89. package/dist/flow/utils/label-cache-processor.js.map +1 -1
  90. package/dist/flow/utils/pill-shape-helpers.d.ts +15 -0
  91. package/dist/flow/utils/pill-shape-helpers.js +35 -0
  92. package/dist/flow/utils/pill-shape-helpers.js.map +1 -0
  93. package/dist/flow/utils/pill-string-parser.js +1 -0
  94. package/dist/flow/utils/pill-string-parser.js.map +1 -1
  95. package/dist/flow/utils/schema-to-flow-object.d.ts +6 -1
  96. package/dist/flow/utils/schema-to-flow-object.js +131 -15
  97. package/dist/flow/utils/schema-to-flow-object.js.map +1 -1
  98. package/dist/flow/utils/service-catalog.js +5 -1
  99. package/dist/flow/utils/service-catalog.js.map +1 -1
  100. package/dist/flow/utils/utils.d.ts +1 -0
  101. package/dist/flow/utils/utils.js +6 -1
  102. package/dist/flow/utils/utils.js.map +1 -1
  103. package/dist/form-plugin.d.ts +2 -0
  104. package/dist/form-plugin.js +1132 -0
  105. package/dist/form-plugin.js.map +1 -0
  106. package/dist/html-import-plugin.js +1 -0
  107. package/dist/html-import-plugin.js.map +1 -1
  108. package/dist/import-sets-plugin.js +2 -0
  109. package/dist/import-sets-plugin.js.map +1 -1
  110. package/dist/inbound-email-action-plugin.d.ts +10 -0
  111. package/dist/inbound-email-action-plugin.js +128 -0
  112. package/dist/inbound-email-action-plugin.js.map +1 -0
  113. package/dist/index.d.ts +13 -0
  114. package/dist/index.js +17 -1
  115. package/dist/index.js.map +1 -1
  116. package/dist/instance-scan-plugin.d.ts +2 -0
  117. package/dist/instance-scan-plugin.js +293 -0
  118. package/dist/instance-scan-plugin.js.map +1 -0
  119. package/dist/json-plugin.js +1 -0
  120. package/dist/json-plugin.js.map +1 -1
  121. package/dist/list-plugin.js +1 -0
  122. package/dist/list-plugin.js.map +1 -1
  123. package/dist/now-attach-plugin.js +1 -0
  124. package/dist/now-attach-plugin.js.map +1 -1
  125. package/dist/now-config-plugin.js +659 -51
  126. package/dist/now-config-plugin.js.map +1 -1
  127. package/dist/now-id-plugin.js +1 -0
  128. package/dist/now-id-plugin.js.map +1 -1
  129. package/dist/now-include-plugin.js +1 -0
  130. package/dist/now-include-plugin.js.map +1 -1
  131. package/dist/now-ref-plugin.js +1 -0
  132. package/dist/now-ref-plugin.js.map +1 -1
  133. package/dist/now-unresolved-plugin.js +1 -0
  134. package/dist/now-unresolved-plugin.js.map +1 -1
  135. package/dist/package-json-plugin.js +1 -0
  136. package/dist/package-json-plugin.js.map +1 -1
  137. package/dist/property-plugin.js +3 -1
  138. package/dist/property-plugin.js.map +1 -1
  139. package/dist/record-plugin.d.ts +37 -0
  140. package/dist/record-plugin.js +47 -3
  141. package/dist/record-plugin.js.map +1 -1
  142. package/dist/repack/lint/Rules.d.ts +11 -2
  143. package/dist/repack/lint/Rules.js +160 -16
  144. package/dist/repack/lint/Rules.js.map +1 -1
  145. package/dist/repack/lint/index.d.ts +10 -5
  146. package/dist/repack/lint/index.js +76 -50
  147. package/dist/repack/lint/index.js.map +1 -1
  148. package/dist/rest-api-plugin.js +22 -1
  149. package/dist/rest-api-plugin.js.map +1 -1
  150. package/dist/role-plugin.js +1 -0
  151. package/dist/role-plugin.js.map +1 -1
  152. package/dist/schedule-script/index.d.ts +1 -0
  153. package/dist/schedule-script/index.js +18 -0
  154. package/dist/schedule-script/index.js.map +1 -0
  155. package/dist/schedule-script/scheduled-script-plugin.d.ts +2 -0
  156. package/dist/schedule-script/scheduled-script-plugin.js +556 -0
  157. package/dist/schedule-script/scheduled-script-plugin.js.map +1 -0
  158. package/dist/schedule-script/timeZoneConverter.d.ts +61 -0
  159. package/dist/schedule-script/timeZoneConverter.js +170 -0
  160. package/dist/schedule-script/timeZoneConverter.js.map +1 -0
  161. package/dist/script-action-plugin.js +2 -0
  162. package/dist/script-action-plugin.js.map +1 -1
  163. package/dist/script-include-plugin.js +2 -0
  164. package/dist/script-include-plugin.js.map +1 -1
  165. package/dist/server-module-plugin/index.js +13 -2
  166. package/dist/server-module-plugin/index.js.map +1 -1
  167. package/dist/service-catalog/catalog-clientscript-plugin.js +2 -0
  168. package/dist/service-catalog/catalog-clientscript-plugin.js.map +1 -1
  169. package/dist/service-catalog/catalog-item-plugin.js +2 -0
  170. package/dist/service-catalog/catalog-item-plugin.js.map +1 -1
  171. package/dist/service-catalog/catalog-ui-policy-plugin.js +2 -0
  172. package/dist/service-catalog/catalog-ui-policy-plugin.js.map +1 -1
  173. package/dist/service-catalog/sc-record-producer-plugin.js +2 -0
  174. package/dist/service-catalog/sc-record-producer-plugin.js.map +1 -1
  175. package/dist/service-catalog/service-catalog-base.d.ts +18 -18
  176. package/dist/service-catalog/service-catalog-base.js +22 -22
  177. package/dist/service-catalog/service-catalog-base.js.map +1 -1
  178. package/dist/service-catalog/service-catalog-diagnostics.d.ts +6 -0
  179. package/dist/service-catalog/service-catalog-diagnostics.js +20 -0
  180. package/dist/service-catalog/service-catalog-diagnostics.js.map +1 -1
  181. package/dist/service-catalog/shape-to-record.js +7 -2
  182. package/dist/service-catalog/shape-to-record.js.map +1 -1
  183. package/dist/service-catalog/variable-set-plugin.js +2 -0
  184. package/dist/service-catalog/variable-set-plugin.js.map +1 -1
  185. package/dist/service-portal/angular-provider-plugin.js +2 -0
  186. package/dist/service-portal/angular-provider-plugin.js.map +1 -1
  187. package/dist/service-portal/dependency-plugin.js +5 -31
  188. package/dist/service-portal/dependency-plugin.js.map +1 -1
  189. package/dist/service-portal/header-footer-plugin.d.ts +2 -0
  190. package/dist/service-portal/header-footer-plugin.js +50 -0
  191. package/dist/service-portal/header-footer-plugin.js.map +1 -0
  192. package/dist/service-portal/menu-plugin.d.ts +2 -0
  193. package/dist/service-portal/menu-plugin.js +334 -0
  194. package/dist/service-portal/menu-plugin.js.map +1 -0
  195. package/dist/service-portal/page-plugin.d.ts +2 -0
  196. package/dist/service-portal/page-plugin.js +681 -0
  197. package/dist/service-portal/page-plugin.js.map +1 -0
  198. package/dist/service-portal/page-route-map-plugin.d.ts +2 -0
  199. package/dist/service-portal/page-route-map-plugin.js +114 -0
  200. package/dist/service-portal/page-route-map-plugin.js.map +1 -0
  201. package/dist/service-portal/portal-plugin.d.ts +2 -0
  202. package/dist/service-portal/portal-plugin.js +309 -0
  203. package/dist/service-portal/portal-plugin.js.map +1 -0
  204. package/dist/service-portal/theme-plugin.d.ts +2 -0
  205. package/dist/service-portal/theme-plugin.js +112 -0
  206. package/dist/service-portal/theme-plugin.js.map +1 -0
  207. package/dist/service-portal/utils.d.ts +46 -0
  208. package/dist/service-portal/utils.js +331 -0
  209. package/dist/service-portal/utils.js.map +1 -0
  210. package/dist/service-portal/widget-plugin.js +10 -182
  211. package/dist/service-portal/widget-plugin.js.map +1 -1
  212. package/dist/sla-plugin.js +2 -0
  213. package/dist/sla-plugin.js.map +1 -1
  214. package/dist/static-content-plugin.js +5 -0
  215. package/dist/static-content-plugin.js.map +1 -1
  216. package/dist/table-plugin.js +191 -26
  217. package/dist/table-plugin.js.map +1 -1
  218. package/dist/ui-action-plugin.js +3 -4
  219. package/dist/ui-action-plugin.js.map +1 -1
  220. package/dist/ui-page-plugin.js +101 -21
  221. package/dist/ui-page-plugin.js.map +1 -1
  222. package/dist/ui-policy-plugin.js +1 -0
  223. package/dist/ui-policy-plugin.js.map +1 -1
  224. package/dist/user-preference-plugin.js +2 -0
  225. package/dist/user-preference-plugin.js.map +1 -1
  226. package/dist/utils.d.ts +20 -2
  227. package/dist/utils.js +34 -3
  228. package/dist/utils.js.map +1 -1
  229. package/dist/ux-list-menu-config-plugin.js +2 -0
  230. package/dist/ux-list-menu-config-plugin.js.map +1 -1
  231. package/dist/view-plugin.js +9 -3
  232. package/dist/view-plugin.js.map +1 -1
  233. package/dist/workspace-plugin.js +41 -36
  234. package/dist/workspace-plugin.js.map +1 -1
  235. package/package.json +11 -11
  236. package/src/_types/eslint-community-eslint-utils.d.ts +15 -0
  237. package/src/acl-plugin.ts +97 -8
  238. package/src/applicability-plugin.ts +2 -0
  239. package/src/application-menu-plugin.ts +2 -0
  240. package/src/arrow-function-plugin.ts +128 -13
  241. package/src/atf/test-plugin.ts +2 -0
  242. package/src/basic-syntax-plugin.ts +21 -0
  243. package/src/call-expression-plugin.ts +1 -0
  244. package/src/claims-plugin.ts +1 -0
  245. package/src/client-script-plugin.ts +2 -1
  246. package/src/column-plugin.ts +4 -8
  247. package/src/cross-scope-privilege-plugin.ts +2 -1
  248. package/src/dashboard/dashboard-plugin.ts +2 -0
  249. package/src/data-plugin.ts +1 -0
  250. package/src/email-notification-plugin.ts +3 -23
  251. package/src/flow/constants/flow-plugin-constants.ts +1 -1
  252. package/src/flow/flow-logic/flow-logic-diagnostics.ts +5 -6
  253. package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +47 -45
  254. package/src/flow/flow-logic/flow-logic-plugin.ts +1 -0
  255. package/src/flow/plugins/approval-rules-plugin.ts +1 -0
  256. package/src/flow/plugins/flow-action-definition-plugin.ts +1584 -62
  257. package/src/flow/plugins/flow-data-pill-plugin.ts +6 -2
  258. package/src/flow/plugins/flow-definition-plugin.ts +22 -51
  259. package/src/flow/plugins/flow-diagnostics-plugin.ts +3 -2
  260. package/src/flow/plugins/flow-instance-plugin.ts +201 -36
  261. package/src/flow/plugins/flow-trigger-instance-plugin.ts +1 -0
  262. package/src/flow/plugins/inline-script-plugin.ts +1 -0
  263. package/src/flow/plugins/step-definition-plugin.ts +4 -2
  264. package/src/flow/plugins/step-instance-plugin.ts +772 -155
  265. package/src/flow/plugins/trigger-plugin.ts +2 -0
  266. package/src/flow/plugins/wfa-datapill-plugin.ts +26 -5
  267. package/src/flow/post-install.ts +93 -0
  268. package/src/flow/utils/complex-object-resolver.ts +4 -1
  269. package/src/flow/utils/complex-objects.ts +11 -3
  270. package/src/flow/utils/flow-constants.ts +451 -6
  271. package/src/flow/utils/flow-io-to-record.ts +43 -17
  272. package/src/flow/utils/flow-shapes.ts +4 -0
  273. package/src/flow/utils/flow-to-xml.ts +4 -4
  274. package/src/flow/utils/label-cache-parser.ts +33 -4
  275. package/src/flow/utils/label-cache-processor.ts +14 -2
  276. package/src/flow/utils/pill-shape-helpers.ts +42 -0
  277. package/src/flow/utils/pill-string-parser.ts +1 -0
  278. package/src/flow/utils/schema-to-flow-object.ts +183 -15
  279. package/src/flow/utils/service-catalog.ts +5 -2
  280. package/src/flow/utils/utils.ts +12 -1
  281. package/src/form-plugin.ts +1409 -0
  282. package/src/html-import-plugin.ts +1 -0
  283. package/src/import-sets-plugin.ts +2 -0
  284. package/src/inbound-email-action-plugin.ts +145 -0
  285. package/src/index.ts +13 -0
  286. package/src/instance-scan-plugin.ts +313 -0
  287. package/src/json-plugin.ts +1 -0
  288. package/src/list-plugin.ts +2 -1
  289. package/src/now-attach-plugin.ts +1 -0
  290. package/src/now-config-plugin.ts +833 -53
  291. package/src/now-id-plugin.ts +1 -0
  292. package/src/now-include-plugin.ts +1 -0
  293. package/src/now-ref-plugin.ts +1 -0
  294. package/src/now-unresolved-plugin.ts +1 -0
  295. package/src/package-json-plugin.ts +1 -0
  296. package/src/property-plugin.ts +6 -1
  297. package/src/record-plugin.ts +56 -6
  298. package/src/repack/lint/Rules.ts +171 -22
  299. package/src/repack/lint/index.ts +80 -56
  300. package/src/rest-api-plugin.ts +28 -2
  301. package/src/role-plugin.ts +2 -1
  302. package/src/schedule-script/index.ts +1 -0
  303. package/src/schedule-script/scheduled-script-plugin.ts +690 -0
  304. package/src/schedule-script/timeZoneConverter.ts +188 -0
  305. package/src/script-action-plugin.ts +2 -0
  306. package/src/script-include-plugin.ts +2 -0
  307. package/src/server-module-plugin/index.ts +14 -2
  308. package/src/service-catalog/catalog-clientscript-plugin.ts +2 -0
  309. package/src/service-catalog/catalog-item-plugin.ts +2 -0
  310. package/src/service-catalog/catalog-ui-policy-plugin.ts +2 -0
  311. package/src/service-catalog/sc-record-producer-plugin.ts +2 -0
  312. package/src/service-catalog/service-catalog-base.ts +22 -22
  313. package/src/service-catalog/service-catalog-diagnostics.ts +30 -0
  314. package/src/service-catalog/shape-to-record.ts +8 -2
  315. package/src/service-catalog/variable-set-plugin.ts +2 -0
  316. package/src/service-portal/angular-provider-plugin.ts +2 -0
  317. package/src/service-portal/dependency-plugin.ts +6 -53
  318. package/src/service-portal/header-footer-plugin.ts +57 -0
  319. package/src/service-portal/menu-plugin.ts +413 -0
  320. package/src/service-portal/page-plugin.ts +805 -0
  321. package/src/service-portal/page-route-map-plugin.ts +124 -0
  322. package/src/service-portal/portal-plugin.ts +342 -0
  323. package/src/service-portal/theme-plugin.ts +135 -0
  324. package/src/service-portal/utils.ts +470 -0
  325. package/src/service-portal/widget-plugin.ts +18 -224
  326. package/src/sla-plugin.ts +2 -0
  327. package/src/static-content-plugin.ts +4 -0
  328. package/src/table-plugin.ts +228 -37
  329. package/src/ui-action-plugin.ts +3 -8
  330. package/src/ui-page-plugin.ts +110 -21
  331. package/src/ui-policy-plugin.ts +2 -1
  332. package/src/user-preference-plugin.ts +2 -0
  333. package/src/utils.ts +42 -2
  334. package/src/ux-list-menu-config-plugin.ts +2 -0
  335. package/src/view-plugin.ts +11 -4
  336. package/src/workspace-plugin.ts +45 -43
  337. package/src/_types/eslint-plugin-es-x.d.ts +0 -17
@@ -25,6 +25,7 @@ const getDeclarationAndModuleSpecifierIfHtml = (node: ts.Node): [ts.ImportDeclar
25
25
 
26
26
  export const HtmlImportPlugin = Plugin.create({
27
27
  name: 'HtmlImportPlugin',
28
+ docs: [],
28
29
  shapes: [
29
30
  {
30
31
  shape: StringShape,
@@ -9,6 +9,7 @@ import {
9
9
  import { NowIdShape } from './now-id-plugin'
10
10
  import { ModuleFunctionShape } from './server-module-plugin'
11
11
  import { NowIncludeShape } from './now-include-plugin'
12
+ import { createSdkDocEntry } from './utils'
12
13
 
13
14
  // ============================================================================
14
15
  // CONSTANTS & CONFIGURATION
@@ -223,6 +224,7 @@ async function mapTransformScriptsToShape(scripts: Record[], transform: Transfor
223
224
 
224
225
  export const ImportSetPlugin = Plugin.create({
225
226
  name: 'ImportSetPlugin',
227
+ docs: [createSdkDocEntry('ImportSet', ['sys_transform_map'])],
226
228
  records: {
227
229
  sys_transform_entry: {
228
230
  coalesce: ['map', 'target_field'],
@@ -0,0 +1,145 @@
1
+ import { CallExpressionShape, Plugin, isGUID, type Shape, type ShapeTransform } from '@servicenow/sdk-build-core'
2
+ import { NowIdShape } from './now-id-plugin'
3
+ import { NowIncludeShape } from './now-include-plugin'
4
+ import { ModuleFunctionShape } from './server-module-plugin'
5
+ import { createSdkDocEntry, showGuidFieldDiagnostic } from './utils'
6
+ import { parseString, convertRolesToString } from './service-catalog/utils'
7
+
8
+ /**
9
+ * Plugin for handling Inbound Email Action records (sysevent_in_email_action).
10
+ *
11
+ * Default Behavior:
12
+ * - When reading from XML: If 'action' field is missing or empty, defaults to 'record_action'
13
+ * - When writing to Fluent: The 'action' field is required in the type definition for proper
14
+ * discriminated union type narrowing
15
+ */
16
+ export const InboundEmailActionPlugin = Plugin.create({
17
+ name: 'InboundEmailActionPlugin',
18
+ docs: [createSdkDocEntry('InboundEmailAction', ['sysevent_in_email_action'])],
19
+ records: {
20
+ sysevent_in_email_action: {
21
+ async toShape(record, { transform }) {
22
+ const actionType = record.get('action').getValue() || 'record_action'
23
+
24
+ // Process script
25
+ const script = await NowIncludeShape.fromRecord(record, record.get('script'), transform)
26
+
27
+ return {
28
+ success: true,
29
+ value: new CallExpressionShape({
30
+ source: record,
31
+ callee: 'InboundEmailAction',
32
+ args: [
33
+ record.transform(({ $ }) => {
34
+ const props: Record<string, ShapeTransform | undefined> = {
35
+ $id: $.val(NowIdShape.from(record)),
36
+ name: $,
37
+ description: $.def(''),
38
+ type: $.def('new'),
39
+ action: $.val(actionType),
40
+ active: $.toBoolean().def(false),
41
+ order: $.toNumber().def(100),
42
+ eventName: $.from('event_name').def('email.read'),
43
+ stopProcessing: $.from('stop_processing').toBoolean().def(false),
44
+ conditionScript: $.from('condition_script').def(''),
45
+ filterCondition: $.from('filter_condition').def(''),
46
+ from: $.def(''),
47
+ requiredRoles: $.from('required_roles')
48
+ .map((v: Shape) => parseString(v))
49
+ .def([]),
50
+ }
51
+
52
+ props['replyEmail'] = $.from('reply_email').def('')
53
+ props['table'] = $.def('')
54
+ props['script'] = $.val(script).def('')
55
+ props['fieldAction'] = $.from('template').def('')
56
+ props['assignmentOperator'] = $.from('assignment_operator').def('')
57
+
58
+ return props
59
+ }),
60
+ ],
61
+ }),
62
+ }
63
+ },
64
+ },
65
+ },
66
+ shapes: [
67
+ {
68
+ shape: CallExpressionShape,
69
+ fileTypes: ['fluent'],
70
+ async toRecord(callExpression, { factory, diagnostics }) {
71
+ if (callExpression.getCallee() !== 'InboundEmailAction') {
72
+ return { success: false }
73
+ }
74
+
75
+ const args = callExpression.getArgument(0).asObject()
76
+
77
+ // Get action type to validate field restrictions
78
+ const actionArg = args.get('action')
79
+ const actionType = actionArg?.getValue() ?? 'record_action'
80
+
81
+ // Validate that fieldAction can only be used when table is set (for record_action)
82
+ if (actionType === 'record_action') {
83
+ const tableArg = args.get('table')
84
+ const fieldActionArg = args.get('fieldAction')
85
+ const hasTable = tableArg?.isDefined() && !tableArg.toString().isEmpty()
86
+ const hasFieldAction = fieldActionArg?.isDefined() && !fieldActionArg.toString().isEmpty()
87
+
88
+ if (hasFieldAction && !hasTable) {
89
+ diagnostics.error(
90
+ fieldActionArg,
91
+ `Field 'fieldAction' can only be used when 'table' is specified.`
92
+ )
93
+ }
94
+ }
95
+
96
+ // Validate the 'from' field: must be a GUID string or a Record<'sys_user'>
97
+ const fromArg = args.get('from')
98
+ if (fromArg?.isDefined()) {
99
+ // Validate that if it's a string, it must be a valid GUID
100
+ if (fromArg.isString() && !fromArg.isRecord()) {
101
+ const fromStr = fromArg.asString().getValue()
102
+ if (fromStr !== '' && !isGUID(fromStr)) {
103
+ showGuidFieldDiagnostic(fromArg, 'from', 'sys_user', diagnostics)
104
+ }
105
+ }
106
+ }
107
+
108
+ const record = await factory.createRecord({
109
+ source: callExpression,
110
+ table: 'sysevent_in_email_action',
111
+ explicitId: args.get('$id'),
112
+ properties: args.transform(({ $ }) => ({
113
+ name: $,
114
+ description: $.def(''),
115
+ table: $,
116
+ type: $.def('new'),
117
+ action: $.def('record_action'),
118
+ active: $.toBoolean().def(false),
119
+ order: $.toNumber().def(100),
120
+ event_name: $.from('eventName').def('email.read'),
121
+ stop_processing: $.from('stopProcessing').toBoolean().def(false),
122
+ script: $.map(
123
+ (v: Shape) =>
124
+ v
125
+ .if(ModuleFunctionShape)
126
+ ?.toString(
127
+ (n) => `${n}({{PARAMS}})`,
128
+ ['current', 'event', 'email', 'logger', 'classifier']
129
+ ) ?? v
130
+ ).toCdata(),
131
+ condition_script: $.from('conditionScript').toCdata().def(''),
132
+ filter_condition: $.from('filterCondition').def(''),
133
+ template: $.from('fieldAction').toCdata().def(''),
134
+ from: $.toString(),
135
+ reply_email: $.from('replyEmail').toCdata().def(''),
136
+ required_roles: $.from('requiredRoles').map(convertRolesToString).def(''),
137
+ assignment_operator: $.from('assignmentOperator').def(''),
138
+ })),
139
+ })
140
+
141
+ return { success: true, value: record }
142
+ },
143
+ },
144
+ ],
145
+ })
package/src/index.ts CHANGED
@@ -24,16 +24,24 @@ export * from './data-plugin'
24
24
  export * from './ui-page-plugin'
25
25
  export * from './list-plugin'
26
26
  export * from './ui-action-plugin'
27
+ export * from './form-plugin'
27
28
  export * from './script-include-plugin'
28
29
  export * from './arrow-function-plugin'
29
30
  export * from './atf/test-plugin'
30
31
  export * from './service-portal/widget-plugin'
31
32
  export * from './service-portal/dependency-plugin'
32
33
  export * from './service-portal/angular-provider-plugin'
34
+ export * from './service-portal/portal-plugin'
35
+ export * from './service-portal/page-plugin'
36
+ export * from './service-portal/theme-plugin'
37
+ export * from './service-portal/menu-plugin'
38
+ export * from './service-portal/header-footer-plugin'
39
+ export * from './service-portal/page-route-map-plugin'
33
40
  export * from './rest-api-plugin'
34
41
  export * from './html-import-plugin'
35
42
  export * from './static-content-plugin'
36
43
  export * from './script-action-plugin'
44
+ export * from './schedule-script'
37
45
  export * from './claims-plugin'
38
46
  export * from './flow/plugins/flow-action-definition-plugin'
39
47
  export * from './flow/plugins/wfa-datapill-plugin'
@@ -52,12 +60,17 @@ export * from './import-sets-plugin'
52
60
  export * from './now-attach-plugin'
53
61
  export * from './sla-plugin'
54
62
  export * from './email-notification-plugin'
63
+ export * from './inbound-email-action-plugin'
55
64
 
56
65
  export * from './service-catalog'
57
66
  export * from './ux-list-menu-config-plugin'
58
67
  export * from './workspace-plugin'
59
68
  export * from './dashboard/dashboard-plugin'
60
69
  export * from './applicability-plugin'
70
+ export * from './instance-scan-plugin'
61
71
  // non-plugins
62
72
  export * from './atf/step-configs'
63
73
  export { REPACK_OUTPUT_DIR, checkModuleExists, resolveModule } from './repack'
74
+ export { FlowLogicValueProcessor } from './flow/flow-logic/flow-logic-plugin-helpers'
75
+ export { FLOW_LOGIC } from './flow/flow-logic/flow-logic-constants'
76
+ export { FlowActivationTask } from './flow/post-install'
@@ -0,0 +1,313 @@
1
+ import { CallExpressionShape, Plugin, type Record, type Context } from '@servicenow/sdk-build-core'
2
+ import { ModuleFunctionShape } from './server-module-plugin'
3
+ import { NowIdShape } from './now-id-plugin'
4
+ import { NowIncludeShape } from './now-include-plugin'
5
+ import { createSdkDocEntry } from './utils'
6
+
7
+ const SCAN_COLUMN_TYPE_CHECK = 'scan_column_type_check'
8
+ const SCAN_LINTER_CHECK = 'scan_linter_check'
9
+ const SCAN_SCRIPT_ONLY_CHECK = 'scan_script_only_check'
10
+ const SCAN_TABLE_CHECK = 'scan_table_check'
11
+
12
+ export const InstanceScanPlugin = Plugin.create({
13
+ name: 'InstanceScanPlugin',
14
+ docs: [
15
+ createSdkDocEntry('ColumnTypeCheck', [SCAN_COLUMN_TYPE_CHECK]),
16
+ createSdkDocEntry('LinterCheck', [SCAN_LINTER_CHECK]),
17
+ createSdkDocEntry('ScriptOnlyCheck', [SCAN_SCRIPT_ONLY_CHECK]),
18
+ createSdkDocEntry('TableCheck', [SCAN_TABLE_CHECK]),
19
+ ],
20
+
21
+ records: {
22
+ [SCAN_COLUMN_TYPE_CHECK]: {
23
+ getUpdateName(record: Record, _context: Context) {
24
+ return { success: true, value: `${SCAN_COLUMN_TYPE_CHECK}_${record.getId().getValue()}` }
25
+ },
26
+ async toShape(record, { transform }) {
27
+ const script = await NowIncludeShape.fromRecord(record, record.get('script'), transform)
28
+
29
+ return {
30
+ success: true,
31
+ value: new CallExpressionShape({
32
+ source: record,
33
+ callee: 'ColumnTypeCheck',
34
+ args: [
35
+ record.transform(({ $ }) => ({
36
+ $id: $.val(NowIdShape.from(record)),
37
+ name: $,
38
+ active: $.toBoolean().def(true),
39
+ category: $,
40
+ priority: $,
41
+ script: $.val(script).def(''),
42
+ shortDescription: $.from('short_description'),
43
+ description: $.def(''),
44
+ resolutionDetails: $.from('resolution_details').def(''),
45
+ documentationUrl: $.from('documentation_url').def(''),
46
+ scoreMin: $.from('score_min').toNumber().def(0),
47
+ scoreMax: $.from('score_max').toNumber().def(100),
48
+ scoreScale: $.from('score_scale').toNumber().def(1),
49
+ runCondition: $.from('run_condition').def(''),
50
+ findingType: $.from('finding_type').def('scan_finding'),
51
+ columnType: $.from('column_type'),
52
+ })),
53
+ ],
54
+ }),
55
+ }
56
+ },
57
+ },
58
+ [SCAN_LINTER_CHECK]: {
59
+ getUpdateName(record: Record, _context: Context) {
60
+ return { success: true, value: `${SCAN_LINTER_CHECK}_${record.getId().getValue()}` }
61
+ },
62
+ async toShape(record, { transform }) {
63
+ const script = await NowIncludeShape.fromRecord(record, record.get('script'), transform)
64
+
65
+ return {
66
+ success: true,
67
+ value: new CallExpressionShape({
68
+ source: record,
69
+ callee: 'LinterCheck',
70
+ args: [
71
+ record.transform(({ $ }) => ({
72
+ $id: $.val(NowIdShape.from(record)),
73
+ name: $,
74
+ active: $.toBoolean().def(true),
75
+ category: $,
76
+ priority: $,
77
+ script: $.val(script).def(''),
78
+ shortDescription: $.from('short_description'),
79
+ description: $.def(''),
80
+ resolutionDetails: $.from('resolution_details').def(''),
81
+ documentationUrl: $.from('documentation_url').def(''),
82
+ scoreMin: $.from('score_min').toNumber().def(0),
83
+ scoreMax: $.from('score_max').toNumber().def(100),
84
+ scoreScale: $.from('score_scale').toNumber().def(1),
85
+ runCondition: $.from('run_condition').def(''),
86
+ findingType: $.from('finding_type').def('scan_finding'),
87
+ })),
88
+ ],
89
+ }),
90
+ }
91
+ },
92
+ },
93
+ [SCAN_SCRIPT_ONLY_CHECK]: {
94
+ getUpdateName(record: Record, _context: Context) {
95
+ return { success: true, value: `${SCAN_SCRIPT_ONLY_CHECK}_${record.getId().getValue()}` }
96
+ },
97
+ async toShape(record, { transform }) {
98
+ const script = await NowIncludeShape.fromRecord(record, record.get('script'), transform)
99
+
100
+ return {
101
+ success: true,
102
+ value: new CallExpressionShape({
103
+ source: record,
104
+ callee: 'ScriptOnlyCheck',
105
+ args: [
106
+ record.transform(({ $ }) => ({
107
+ $id: $.val(NowIdShape.from(record)),
108
+ name: $,
109
+ active: $.toBoolean().def(true),
110
+ category: $,
111
+ priority: $,
112
+ script: $.val(script).def(''),
113
+ shortDescription: $.from('short_description'),
114
+ description: $.def(''),
115
+ resolutionDetails: $.from('resolution_details').def(''),
116
+ documentationUrl: $.from('documentation_url').def(''),
117
+ scoreMin: $.from('score_min').toNumber().def(0),
118
+ scoreMax: $.from('score_max').toNumber().def(100),
119
+ scoreScale: $.from('score_scale').toNumber().def(1),
120
+ runCondition: $.from('run_condition').def(''),
121
+ findingType: $.from('finding_type').def('scan_finding'),
122
+ })),
123
+ ],
124
+ }),
125
+ }
126
+ },
127
+ },
128
+ [SCAN_TABLE_CHECK]: {
129
+ getUpdateName(record: Record, _context: Context) {
130
+ return { success: true, value: `${SCAN_TABLE_CHECK}_${record.getId().getValue()}` }
131
+ },
132
+ async toShape(record, { transform }) {
133
+ const script = await NowIncludeShape.fromRecord(record, record.get('script'), transform)
134
+
135
+ return {
136
+ success: true,
137
+ value: new CallExpressionShape({
138
+ source: record,
139
+ callee: 'TableCheck',
140
+ args: [
141
+ record.transform(({ $ }) => ({
142
+ $id: $.val(NowIdShape.from(record)),
143
+ name: $,
144
+ active: $.toBoolean().def(true),
145
+ category: $,
146
+ priority: $,
147
+ script: $.val(script).def(''),
148
+ shortDescription: $.from('short_description'),
149
+ description: $.def(''),
150
+ resolutionDetails: $.from('resolution_details').def(''),
151
+ documentationUrl: $.from('documentation_url').def(''),
152
+ scoreMin: $.from('score_min').toNumber().def(0),
153
+ scoreMax: $.from('score_max').toNumber().def(100),
154
+ scoreScale: $.from('score_scale').toNumber().def(1),
155
+ runCondition: $.from('run_condition').def(''),
156
+ findingType: $.from('finding_type').def('scan_finding'),
157
+ table: $,
158
+ advanced: $.toBoolean().def(false),
159
+ conditions: $.def(''),
160
+ useManifest: $.from('use_manifest').toBoolean().def(false),
161
+ })),
162
+ ],
163
+ }),
164
+ }
165
+ },
166
+ },
167
+ },
168
+
169
+ shapes: [
170
+ {
171
+ shape: CallExpressionShape,
172
+ fileTypes: ['fluent'],
173
+ async toRecord(source, { factory }) {
174
+ if (source.getCallee() === 'ColumnTypeCheck') {
175
+ const arg = source.getArgument(0).asObject()
176
+ const record = await factory.createRecord({
177
+ source,
178
+ table: SCAN_COLUMN_TYPE_CHECK,
179
+ explicitId: arg.get('$id'),
180
+ properties: arg.transform(({ $ }) => ({
181
+ name: $,
182
+ active: $.toBoolean().def(true),
183
+ category: $,
184
+ priority: $,
185
+ script: $.map(
186
+ (v) =>
187
+ v
188
+ .if(ModuleFunctionShape)
189
+ ?.toString((n) => `${n}({{PARAMS}})`, ['engine', 'current', 'columnValue']) ?? v
190
+ )
191
+ .toCdata()
192
+ .def(''),
193
+ short_description: $.from('shortDescription'),
194
+ description: $.def(''),
195
+ resolution_details: $.from('resolutionDetails').def(''),
196
+ documentation_url: $.from('documentationUrl').def(''),
197
+ score_min: $.from('scoreMin').toNumber().def(0),
198
+ score_max: $.from('scoreMax').toNumber().def(100),
199
+ score_scale: $.from('scoreScale').toNumber().def(1),
200
+ run_condition: $.from('runCondition').def(''),
201
+ finding_type: $.from('findingType').def('scan_finding'),
202
+ column_type: $.from('columnType'),
203
+ })),
204
+ })
205
+ return { success: true, value: record }
206
+ }
207
+
208
+ if (source.getCallee() === 'LinterCheck') {
209
+ const arg = source.getArgument(0).asObject()
210
+ const record = await factory.createRecord({
211
+ source,
212
+ table: SCAN_LINTER_CHECK,
213
+ explicitId: arg.get('$id'),
214
+ properties: arg.transform(({ $ }) => ({
215
+ name: $,
216
+ active: $.toBoolean().def(true),
217
+ category: $,
218
+ priority: $,
219
+ script: $.map(
220
+ (v) =>
221
+ v
222
+ .if(ModuleFunctionShape)
223
+ ?.toString((n) => `${n}({{PARAMS}})`, ['engine', 'current', 'rootNode']) ?? v
224
+ )
225
+ .toCdata()
226
+ .def(''),
227
+ short_description: $.from('shortDescription'),
228
+ description: $.def(''),
229
+ resolution_details: $.from('resolutionDetails').def(''),
230
+ documentation_url: $.from('documentationUrl').def(''),
231
+ score_min: $.from('scoreMin').toNumber().def(0),
232
+ score_max: $.from('scoreMax').toNumber().def(100),
233
+ score_scale: $.from('scoreScale').toNumber().def(1),
234
+ run_condition: $.from('runCondition').def(''),
235
+ finding_type: $.from('findingType').def('scan_finding'),
236
+ })),
237
+ })
238
+ return { success: true, value: record }
239
+ }
240
+
241
+ if (source.getCallee() === 'ScriptOnlyCheck') {
242
+ const arg = source.getArgument(0).asObject()
243
+ const record = await factory.createRecord({
244
+ source,
245
+ table: SCAN_SCRIPT_ONLY_CHECK,
246
+ explicitId: arg.get('$id'),
247
+ properties: arg.transform(({ $ }) => ({
248
+ name: $,
249
+ active: $.toBoolean().def(true),
250
+ category: $,
251
+ priority: $,
252
+ script: $.map(
253
+ (v) => v.if(ModuleFunctionShape)?.toString((n) => `${n}({{PARAMS}})`, ['engine']) ?? v
254
+ )
255
+ .toCdata()
256
+ .def(''),
257
+ short_description: $.from('shortDescription'),
258
+ description: $.def(''),
259
+ resolution_details: $.from('resolutionDetails').def(''),
260
+ documentation_url: $.from('documentationUrl').def(''),
261
+ score_min: $.from('scoreMin').toNumber().def(0),
262
+ score_max: $.from('scoreMax').toNumber().def(100),
263
+ score_scale: $.from('scoreScale').toNumber().def(1),
264
+ run_condition: $.from('runCondition').def(''),
265
+ finding_type: $.from('findingType').def('scan_finding'),
266
+ })),
267
+ })
268
+ return { success: true, value: record }
269
+ }
270
+
271
+ if (source.getCallee() === 'TableCheck') {
272
+ const arg = source.getArgument(0).asObject()
273
+
274
+ const record = await factory.createRecord({
275
+ source,
276
+ table: SCAN_TABLE_CHECK,
277
+ explicitId: arg.get('$id'),
278
+ properties: arg.transform(({ $ }) => ({
279
+ name: $,
280
+ active: $.toBoolean().def(true),
281
+ category: $,
282
+ priority: $,
283
+ script: $.map(
284
+ (v) =>
285
+ v
286
+ .if(ModuleFunctionShape)
287
+ ?.toString((n) => `${n}({{PARAMS}})`, ['engine', 'current']) ?? v
288
+ )
289
+ .toCdata()
290
+ .def(''),
291
+ short_description: $.from('shortDescription'),
292
+ description: $.def(''),
293
+ resolution_details: $.from('resolutionDetails').def(''),
294
+ documentation_url: $.from('documentationUrl').def(''),
295
+ score_min: $.from('scoreMin').toNumber().def(0),
296
+ score_max: $.from('scoreMax').toNumber().def(100),
297
+ score_scale: $.from('scoreScale').toNumber().def(1),
298
+ run_condition: $.from('runCondition').def(''),
299
+ finding_type: $.from('findingType').def('scan_finding'),
300
+ table: $,
301
+ advanced: $.toBoolean().def(false),
302
+ conditions: $.def(''),
303
+ use_manifest: $.from('useManifest').toBoolean().def(false),
304
+ })),
305
+ })
306
+ return { success: true, value: record }
307
+ }
308
+
309
+ return { success: false }
310
+ },
311
+ },
312
+ ],
313
+ })
@@ -49,6 +49,7 @@ export class JsonFileShape extends SourceFileShape {
49
49
 
50
50
  export const JsonPlugin = Plugin.create({
51
51
  name: 'JsonPlugin',
52
+ docs: [],
52
53
  shapes: [
53
54
  {
54
55
  shape: SourceFileShape,
@@ -9,7 +9,7 @@ import {
9
9
  Database,
10
10
  } from '@servicenow/sdk-build-core'
11
11
  import { create } from 'xmlbuilder2'
12
- import { generateDeprecatedDiagnostics } from './utils'
12
+ import { createSdkDocEntry, generateDeprecatedDiagnostics } from './utils'
13
13
 
14
14
  const DEFAULT_VIEW = 'Default view'
15
15
  const listElementAliases = {
@@ -65,6 +65,7 @@ function getListUpdateName(list: Record): string {
65
65
 
66
66
  export const ListPlugin = Plugin.create({
67
67
  name: 'ListPlugin',
68
+ docs: [createSdkDocEntry('List', ['sys_ui_list'])],
68
69
  records: {
69
70
  sys_ui_list: {
70
71
  composite: true,
@@ -211,6 +211,7 @@ export class NowAttachShape extends CallExpressionShape implements AssociateReco
211
211
 
212
212
  export const NowAttachPlugin = Plugin.create({
213
213
  name: 'NowAttachPlugin',
214
+ docs: [],
214
215
  records: {
215
216
  '*': {
216
217
  async toFile(record, { config, database, factory, transform }) {