@servicenow/sdk-build-plugins 3.0.3 → 4.0.1

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 (359) hide show
  1. package/dist/acl-plugin.d.ts +19 -0
  2. package/dist/acl-plugin.js +210 -0
  3. package/dist/acl-plugin.js.map +1 -0
  4. package/dist/application-menu-plugin.d.ts +18 -0
  5. package/dist/application-menu-plugin.js +104 -0
  6. package/dist/application-menu-plugin.js.map +1 -0
  7. package/dist/arrow-function-plugin.d.ts +16 -0
  8. package/dist/arrow-function-plugin.js +107 -0
  9. package/dist/arrow-function-plugin.js.map +1 -0
  10. package/dist/atf/step-configs.d.ts +39 -0
  11. package/dist/atf/step-configs.js +2334 -0
  12. package/dist/atf/step-configs.js.map +1 -0
  13. package/dist/atf/test-plugin.d.ts +4 -0
  14. package/dist/atf/test-plugin.js +600 -0
  15. package/dist/atf/test-plugin.js.map +1 -0
  16. package/dist/basic-syntax-plugin.d.ts +2 -0
  17. package/dist/basic-syntax-plugin.js +636 -0
  18. package/dist/basic-syntax-plugin.js.map +1 -0
  19. package/dist/business-rule-plugin.d.ts +3 -0
  20. package/dist/business-rule-plugin.js +205 -0
  21. package/dist/business-rule-plugin.js.map +1 -0
  22. package/dist/call-expression-plugin.d.ts +2 -0
  23. package/dist/call-expression-plugin.js +175 -0
  24. package/dist/call-expression-plugin.js.map +1 -0
  25. package/dist/client-script-plugin.d.ts +29 -0
  26. package/dist/client-script-plugin.js +164 -0
  27. package/dist/client-script-plugin.js.map +1 -0
  28. package/dist/column/column-helper.d.ts +12 -0
  29. package/dist/column/column-helper.js +84 -0
  30. package/dist/column/column-helper.js.map +1 -0
  31. package/dist/column/column-to-record.d.ts +3 -0
  32. package/dist/column/column-to-record.js +105 -0
  33. package/dist/column/column-to-record.js.map +1 -0
  34. package/dist/column-plugin.d.ts +8 -0
  35. package/dist/column-plugin.js +453 -0
  36. package/dist/column-plugin.js.map +1 -0
  37. package/dist/cross-scope-privilege-plugin.d.ts +15 -0
  38. package/dist/cross-scope-privilege-plugin.js +82 -0
  39. package/dist/cross-scope-privilege-plugin.js.map +1 -0
  40. package/dist/html-import-plugin.d.ts +2 -0
  41. package/dist/html-import-plugin.js +72 -0
  42. package/dist/html-import-plugin.js.map +1 -0
  43. package/dist/index.d.ts +37 -21
  44. package/dist/index.js +40 -45
  45. package/dist/index.js.map +1 -1
  46. package/dist/json-plugin.d.ts +15 -0
  47. package/dist/json-plugin.js +104 -0
  48. package/dist/json-plugin.js.map +1 -0
  49. package/dist/list-plugin.d.ts +2 -0
  50. package/dist/list-plugin.js +191 -0
  51. package/dist/list-plugin.js.map +1 -0
  52. package/dist/now-config-plugin.d.ts +4 -0
  53. package/dist/now-config-plugin.js +154 -0
  54. package/dist/now-config-plugin.js.map +1 -0
  55. package/dist/now-id-plugin.d.ts +11 -0
  56. package/dist/now-id-plugin.js +71 -0
  57. package/dist/now-id-plugin.js.map +1 -0
  58. package/dist/now-include-plugin.d.ts +16 -0
  59. package/dist/now-include-plugin.js +118 -0
  60. package/dist/now-include-plugin.js.map +1 -0
  61. package/dist/now-ref-plugin.d.ts +2 -0
  62. package/dist/now-ref-plugin.js +43 -0
  63. package/dist/now-ref-plugin.js.map +1 -0
  64. package/dist/now-unresolved-plugin.d.ts +2 -0
  65. package/dist/now-unresolved-plugin.js +32 -0
  66. package/dist/now-unresolved-plugin.js.map +1 -0
  67. package/dist/package-json-plugin.d.ts +2 -0
  68. package/dist/package-json-plugin.js +70 -0
  69. package/dist/package-json-plugin.js.map +1 -0
  70. package/dist/property-plugin.d.ts +2 -0
  71. package/dist/property-plugin.js +105 -0
  72. package/dist/property-plugin.js.map +1 -0
  73. package/dist/record-plugin.d.ts +43 -0
  74. package/dist/record-plugin.js +147 -0
  75. package/dist/record-plugin.js.map +1 -0
  76. package/dist/repack/index.d.ts +1 -0
  77. package/dist/repack/index.js +10 -2
  78. package/dist/repack/index.js.map +1 -1
  79. package/dist/repack/lint/Rules.d.ts +1 -1
  80. package/dist/repack/lint/Rules.js +7 -3
  81. package/dist/repack/lint/Rules.js.map +1 -1
  82. package/dist/repack/lint/index.js +1 -1
  83. package/dist/rest-api-plugin.d.ts +2 -0
  84. package/dist/rest-api-plugin.js +469 -0
  85. package/dist/rest-api-plugin.js.map +1 -0
  86. package/dist/role-plugin.d.ts +2 -0
  87. package/dist/role-plugin.js +117 -0
  88. package/dist/role-plugin.js.map +1 -0
  89. package/dist/script-action-plugin.d.ts +2 -0
  90. package/dist/script-action-plugin.js +62 -0
  91. package/dist/script-action-plugin.js.map +1 -0
  92. package/dist/script-include-plugin.d.ts +2 -0
  93. package/dist/script-include-plugin.js +102 -0
  94. package/dist/script-include-plugin.js.map +1 -0
  95. package/dist/server-module-plugin/index.d.ts +14 -0
  96. package/dist/server-module-plugin/index.js +378 -0
  97. package/dist/server-module-plugin/index.js.map +1 -0
  98. package/dist/server-module-plugin/sbom-builder.d.ts +45 -0
  99. package/dist/server-module-plugin/sbom-builder.js +179 -0
  100. package/dist/server-module-plugin/sbom-builder.js.map +1 -0
  101. package/dist/service-portal/angular-provider-plugin.d.ts +2 -0
  102. package/dist/service-portal/angular-provider-plugin.js +78 -0
  103. package/dist/service-portal/angular-provider-plugin.js.map +1 -0
  104. package/dist/service-portal/dependency-plugin.d.ts +2 -0
  105. package/dist/service-portal/dependency-plugin.js +235 -0
  106. package/dist/service-portal/dependency-plugin.js.map +1 -0
  107. package/dist/service-portal/widget-plugin.d.ts +6 -0
  108. package/dist/service-portal/widget-plugin.js +230 -0
  109. package/dist/service-portal/widget-plugin.js.map +1 -0
  110. package/dist/static-content-plugin.d.ts +2 -0
  111. package/dist/static-content-plugin.js +272 -0
  112. package/dist/static-content-plugin.js.map +1 -0
  113. package/dist/table-plugin.d.ts +3 -0
  114. package/dist/table-plugin.js +1324 -0
  115. package/dist/table-plugin.js.map +1 -0
  116. package/dist/ui-action-plugin.d.ts +2 -0
  117. package/dist/ui-action-plugin.js +291 -0
  118. package/dist/ui-action-plugin.js.map +1 -0
  119. package/dist/ui-page-plugin.d.ts +2 -0
  120. package/dist/ui-page-plugin.js +165 -0
  121. package/dist/ui-page-plugin.js.map +1 -0
  122. package/dist/user-preference-plugin.d.ts +15 -0
  123. package/dist/user-preference-plugin.js +63 -0
  124. package/dist/user-preference-plugin.js.map +1 -0
  125. package/dist/utils.d.ts +17 -0
  126. package/dist/utils.js +72 -0
  127. package/dist/utils.js.map +1 -0
  128. package/dist/view-plugin.d.ts +2 -0
  129. package/dist/view-plugin.js +45 -0
  130. package/dist/view-plugin.js.map +1 -0
  131. package/package.json +17 -13
  132. package/src/acl-plugin.ts +256 -0
  133. package/src/application-menu-plugin.ts +109 -0
  134. package/src/arrow-function-plugin.ts +127 -0
  135. package/src/atf/step-configs.ts +2384 -0
  136. package/src/atf/test-plugin.ts +739 -0
  137. package/src/basic-syntax-plugin.ts +729 -0
  138. package/src/business-rule-plugin.ts +266 -0
  139. package/src/call-expression-plugin.ts +202 -0
  140. package/src/client-script-plugin.ts +179 -0
  141. package/src/column/column-helper.ts +119 -0
  142. package/src/column/column-to-record.ts +131 -0
  143. package/src/column-plugin.ts +506 -0
  144. package/src/cross-scope-privilege-plugin.ts +82 -0
  145. package/src/html-import-plugin.ts +79 -0
  146. package/src/index.ts +39 -21
  147. package/src/json-plugin.ts +128 -0
  148. package/src/list-plugin.ts +222 -0
  149. package/src/now-config-plugin.ts +194 -0
  150. package/src/now-id-plugin.ts +78 -0
  151. package/src/now-include-plugin.ts +140 -0
  152. package/src/now-ref-plugin.ts +48 -0
  153. package/src/now-unresolved-plugin.ts +30 -0
  154. package/src/package-json-plugin.ts +87 -0
  155. package/src/property-plugin.ts +118 -0
  156. package/src/record-plugin.ts +171 -0
  157. package/src/repack/index.ts +10 -1
  158. package/src/repack/lint/Rules.ts +5 -4
  159. package/src/repack/lint/index.ts +1 -1
  160. package/src/rest-api-plugin.ts +658 -0
  161. package/src/role-plugin.ts +128 -0
  162. package/src/script-action-plugin.ts +63 -0
  163. package/src/script-include-plugin.ts +110 -0
  164. package/src/server-module-plugin/index.ts +470 -0
  165. package/src/server-module-plugin/sbom-builder.ts +183 -0
  166. package/src/service-portal/angular-provider-plugin.ts +83 -0
  167. package/src/service-portal/dependency-plugin.ts +284 -0
  168. package/src/service-portal/widget-plugin.ts +263 -0
  169. package/src/static-content-plugin.ts +254 -0
  170. package/src/table-plugin.ts +1698 -0
  171. package/src/ui-action-plugin.ts +324 -0
  172. package/src/ui-page-plugin.ts +168 -0
  173. package/src/user-preference-plugin.ts +62 -0
  174. package/src/utils.ts +69 -0
  175. package/src/view-plugin.ts +46 -0
  176. package/dist/AttachmentPlugin.d.ts +0 -254
  177. package/dist/AttachmentPlugin.js +0 -220
  178. package/dist/AttachmentPlugin.js.map +0 -1
  179. package/dist/BusinessRulePlugin.d.ts +0 -30
  180. package/dist/BusinessRulePlugin.js +0 -149
  181. package/dist/BusinessRulePlugin.js.map +0 -1
  182. package/dist/CrossScopePrivilegePlugin.d.ts +0 -35
  183. package/dist/CrossScopePrivilegePlugin.js +0 -80
  184. package/dist/CrossScopePrivilegePlugin.js.map +0 -1
  185. package/dist/DefaultPlugin.d.ts +0 -86
  186. package/dist/DefaultPlugin.js +0 -226
  187. package/dist/DefaultPlugin.js.map +0 -1
  188. package/dist/HtmlTemplatePlugin.d.ts +0 -21
  189. package/dist/HtmlTemplatePlugin.js +0 -29
  190. package/dist/HtmlTemplatePlugin.js.map +0 -1
  191. package/dist/IdPlugin.d.ts +0 -28
  192. package/dist/IdPlugin.js +0 -68
  193. package/dist/IdPlugin.js.map +0 -1
  194. package/dist/IncludePlugin.d.ts +0 -34
  195. package/dist/IncludePlugin.js +0 -155
  196. package/dist/IncludePlugin.js.map +0 -1
  197. package/dist/JsonPlugin.d.ts +0 -28
  198. package/dist/JsonPlugin.js +0 -69
  199. package/dist/JsonPlugin.js.map +0 -1
  200. package/dist/ListPlugin.d.ts +0 -93
  201. package/dist/ListPlugin.js +0 -456
  202. package/dist/ListPlugin.js.map +0 -1
  203. package/dist/NowConfigPlugin.d.ts +0 -45
  204. package/dist/NowConfigPlugin.js +0 -64
  205. package/dist/NowConfigPlugin.js.map +0 -1
  206. package/dist/PackageJsonPlugin.d.ts +0 -34
  207. package/dist/PackageJsonPlugin.js +0 -63
  208. package/dist/PackageJsonPlugin.js.map +0 -1
  209. package/dist/PropertyPlugin.d.ts +0 -51
  210. package/dist/PropertyPlugin.js +0 -181
  211. package/dist/PropertyPlugin.js.map +0 -1
  212. package/dist/ScriptTemplatePlugin.d.ts +0 -13
  213. package/dist/ScriptTemplatePlugin.js +0 -55
  214. package/dist/ScriptTemplatePlugin.js.map +0 -1
  215. package/dist/ServerModulePlugin.d.ts +0 -75
  216. package/dist/ServerModulePlugin.js +0 -368
  217. package/dist/ServerModulePlugin.js.map +0 -1
  218. package/dist/UserPreferencePlugin.d.ts +0 -19
  219. package/dist/UserPreferencePlugin.js +0 -32
  220. package/dist/UserPreferencePlugin.js.map +0 -1
  221. package/dist/aclAndRole/AclPlugin.d.ts +0 -82
  222. package/dist/aclAndRole/AclPlugin.js +0 -262
  223. package/dist/aclAndRole/AclPlugin.js.map +0 -1
  224. package/dist/aclAndRole/RolePlugin.d.ts +0 -66
  225. package/dist/aclAndRole/RolePlugin.js +0 -179
  226. package/dist/aclAndRole/RolePlugin.js.map +0 -1
  227. package/dist/aclAndRole/Util.d.ts +0 -3
  228. package/dist/aclAndRole/Util.js +0 -90
  229. package/dist/aclAndRole/Util.js.map +0 -1
  230. package/dist/app/ApplicationMenuPlugin.d.ts +0 -34
  231. package/dist/app/ApplicationMenuPlugin.js +0 -112
  232. package/dist/app/ApplicationMenuPlugin.js.map +0 -1
  233. package/dist/db/ColumnPlugins.d.ts +0 -750
  234. package/dist/db/ColumnPlugins.js +0 -114
  235. package/dist/db/ColumnPlugins.js.map +0 -1
  236. package/dist/db/DBUtils.d.ts +0 -2
  237. package/dist/db/DBUtils.js +0 -27
  238. package/dist/db/DBUtils.js.map +0 -1
  239. package/dist/db/DocumentationPlugin.d.ts +0 -67
  240. package/dist/db/DocumentationPlugin.js +0 -258
  241. package/dist/db/DocumentationPlugin.js.map +0 -1
  242. package/dist/db/LicensingPlugin.d.ts +0 -60
  243. package/dist/db/LicensingPlugin.js +0 -117
  244. package/dist/db/LicensingPlugin.js.map +0 -1
  245. package/dist/db/RecordPlugin.d.ts +0 -133
  246. package/dist/db/RecordPlugin.js +0 -337
  247. package/dist/db/RecordPlugin.js.map +0 -1
  248. package/dist/db/TablePlugin.d.ts +0 -231
  249. package/dist/db/TablePlugin.js +0 -1630
  250. package/dist/db/TablePlugin.js.map +0 -1
  251. package/dist/db/index.d.ts +0 -6
  252. package/dist/db/index.js +0 -32
  253. package/dist/db/index.js.map +0 -1
  254. package/dist/scriptedRESTAPI/RESTDeserializationUtils.d.ts +0 -10
  255. package/dist/scriptedRESTAPI/RESTDeserializationUtils.js +0 -373
  256. package/dist/scriptedRESTAPI/RESTDeserializationUtils.js.map +0 -1
  257. package/dist/scriptedRESTAPI/RESTSerializationUtils.d.ts +0 -13
  258. package/dist/scriptedRESTAPI/RESTSerializationUtils.js +0 -177
  259. package/dist/scriptedRESTAPI/RESTSerializationUtils.js.map +0 -1
  260. package/dist/scriptedRESTAPI/RestApiPlugin.d.ts +0 -81
  261. package/dist/scriptedRESTAPI/RestApiPlugin.js +0 -345
  262. package/dist/scriptedRESTAPI/RestApiPlugin.js.map +0 -1
  263. package/dist/scriptedRESTAPI/RestSchemaUtils.d.ts +0 -190
  264. package/dist/scriptedRESTAPI/RestSchemaUtils.js +0 -53
  265. package/dist/scriptedRESTAPI/RestSchemaUtils.js.map +0 -1
  266. package/dist/scriptedRESTAPI/RestUtils.d.ts +0 -69
  267. package/dist/scriptedRESTAPI/RestUtils.js +0 -497
  268. package/dist/scriptedRESTAPI/RestUtils.js.map +0 -1
  269. package/dist/scripts/ClientScriptPlugin.d.ts +0 -64
  270. package/dist/scripts/ClientScriptPlugin.js +0 -170
  271. package/dist/scripts/ClientScriptPlugin.js.map +0 -1
  272. package/dist/scripts/scriptUtils.d.ts +0 -1
  273. package/dist/scripts/scriptUtils.js +0 -9
  274. package/dist/scripts/scriptUtils.js.map +0 -1
  275. package/dist/uxf/ExperiencePlugin.d.ts +0 -45
  276. package/dist/uxf/ExperiencePlugin.js +0 -61
  277. package/dist/uxf/ExperiencePlugin.js.map +0 -1
  278. package/dist/uxf/RoutesPlugin.d.ts +0 -29
  279. package/dist/uxf/RoutesPlugin.js +0 -181
  280. package/dist/uxf/RoutesPlugin.js.map +0 -1
  281. package/dist/uxf/UxfFormulaParser/cleanUxValue.d.ts +0 -4
  282. package/dist/uxf/UxfFormulaParser/cleanUxValue.js +0 -65
  283. package/dist/uxf/UxfFormulaParser/cleanUxValue.js.map +0 -1
  284. package/dist/uxf/UxfFormulaParser/grammerParser/api.d.ts +0 -189
  285. package/dist/uxf/UxfFormulaParser/grammerParser/api.js +0 -158
  286. package/dist/uxf/UxfFormulaParser/grammerParser/api.js.map +0 -1
  287. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.d.ts +0 -13
  288. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +0 -604
  289. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js.map +0 -1
  290. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.d.ts +0 -12
  291. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js +0 -551
  292. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js.map +0 -1
  293. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.d.ts +0 -31
  294. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +0 -64
  295. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js.map +0 -1
  296. package/dist/uxf/UxfFormulaParser/index.d.ts +0 -3
  297. package/dist/uxf/UxfFormulaParser/index.js +0 -11
  298. package/dist/uxf/UxfFormulaParser/index.js.map +0 -1
  299. package/dist/uxf/UxfFormulaParser/parser.d.ts +0 -8
  300. package/dist/uxf/UxfFormulaParser/parser.js +0 -87
  301. package/dist/uxf/UxfFormulaParser/parser.js.map +0 -1
  302. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.d.ts +0 -8
  303. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js +0 -17
  304. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js.map +0 -1
  305. package/dist/uxf/constants.d.ts +0 -2
  306. package/dist/uxf/constants.js +0 -8
  307. package/dist/uxf/constants.js.map +0 -1
  308. package/dist/uxf/index.d.ts +0 -2
  309. package/dist/uxf/index.js +0 -11
  310. package/dist/uxf/index.js.map +0 -1
  311. package/dist/uxf/tectonicIdGenerator.d.ts +0 -12
  312. package/dist/uxf/tectonicIdGenerator.js +0 -79
  313. package/dist/uxf/tectonicIdGenerator.js.map +0 -1
  314. package/src/AttachmentPlugin.ts +0 -268
  315. package/src/BusinessRulePlugin.ts +0 -238
  316. package/src/CrossScopePrivilegePlugin.ts +0 -115
  317. package/src/DefaultPlugin.ts +0 -288
  318. package/src/HtmlTemplatePlugin.ts +0 -31
  319. package/src/IdPlugin.ts +0 -74
  320. package/src/IncludePlugin.ts +0 -206
  321. package/src/JsonPlugin.ts +0 -76
  322. package/src/ListPlugin.ts +0 -570
  323. package/src/NowConfigPlugin.ts +0 -69
  324. package/src/PackageJsonPlugin.ts +0 -68
  325. package/src/PropertyPlugin.ts +0 -237
  326. package/src/ScriptTemplatePlugin.ts +0 -53
  327. package/src/ServerModulePlugin.ts +0 -480
  328. package/src/UserPreferencePlugin.ts +0 -45
  329. package/src/aclAndRole/AclPlugin.ts +0 -420
  330. package/src/aclAndRole/RolePlugin.ts +0 -254
  331. package/src/aclAndRole/Util.ts +0 -113
  332. package/src/app/ApplicationMenuPlugin.ts +0 -165
  333. package/src/db/ColumnPlugins.ts +0 -114
  334. package/src/db/DBUtils.ts +0 -36
  335. package/src/db/DocumentationPlugin.ts +0 -316
  336. package/src/db/LicensingPlugin.ts +0 -138
  337. package/src/db/RecordPlugin.ts +0 -459
  338. package/src/db/TablePlugin.ts +0 -2072
  339. package/src/db/index.ts +0 -6
  340. package/src/scriptedRESTAPI/RESTDeserializationUtils.ts +0 -419
  341. package/src/scriptedRESTAPI/RESTSerializationUtils.ts +0 -228
  342. package/src/scriptedRESTAPI/RestApiPlugin.ts +0 -469
  343. package/src/scriptedRESTAPI/RestSchemaUtils.ts +0 -72
  344. package/src/scriptedRESTAPI/RestUtils.ts +0 -569
  345. package/src/scripts/ClientScriptPlugin.ts +0 -257
  346. package/src/scripts/scriptUtils.ts +0 -5
  347. package/src/uxf/ExperiencePlugin.ts +0 -67
  348. package/src/uxf/RoutesPlugin.ts +0 -211
  349. package/src/uxf/UxfFormulaParser/cleanUxValue.ts +0 -73
  350. package/src/uxf/UxfFormulaParser/grammerParser/api.js +0 -166
  351. package/src/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +0 -606
  352. package/src/uxf/UxfFormulaParser/grammerParser/grammarParser.js +0 -551
  353. package/src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +0 -65
  354. package/src/uxf/UxfFormulaParser/index.ts +0 -4
  355. package/src/uxf/UxfFormulaParser/parser.ts +0 -64
  356. package/src/uxf/UxfFormulaParser/utils/getErrorMsg.ts +0 -13
  357. package/src/uxf/constants.ts +0 -4
  358. package/src/uxf/index.ts +0 -2
  359. package/src/uxf/tectonicIdGenerator.ts +0 -78
package/src/index.ts CHANGED
@@ -1,21 +1,39 @@
1
- export * from './db'
2
- export * from './uxf'
3
- export { default as DefaultPlugin } from './DefaultPlugin'
4
- export { default as ApplicationMenuPlugin } from './app/ApplicationMenuPlugin'
5
- export { default as PropertyPlugin } from './PropertyPlugin'
6
- export { default as RestApiPlugin, RestApiPluginTechDebt } from './scriptedRESTAPI/RestApiPlugin'
7
- export { default as UserPreferencePlugin } from './UserPreferencePlugin'
8
- export { default as CrossScopePrivilegePlugin } from './CrossScopePrivilegePlugin'
9
- export { default as ClientScriptPlugin } from './scripts/ClientScriptPlugin'
10
- export { default as BusinessRulePlugin } from './BusinessRulePlugin'
11
- export { default as ListPluginPlugin } from './ListPlugin'
12
- export { default as RolePlugin } from './aclAndRole/RolePlugin'
13
- export { default as AclPlugin } from './aclAndRole/AclPlugin'
14
- export { default as ScriptTemplatePlugin } from './ScriptTemplatePlugin'
15
- export { default as IdPlugin } from './IdPlugin'
16
- export { default as JsonPlugin } from './JsonPlugin'
17
- export { default as HtmlTemplatePlugin } from './HtmlTemplatePlugin'
18
- export { default as NowConfigPlugin } from './NowConfigPlugin'
19
- export { default as PackageJsonPlugin } from './PackageJsonPlugin'
20
- export { default as ServerModulePlugin } from './ServerModulePlugin'
21
- export { default as IncludePlugin } from './IncludePlugin'
1
+ export * from './application-menu-plugin'
2
+ export * from './basic-syntax-plugin'
3
+ export * from './call-expression-plugin'
4
+ export * from './client-script-plugin'
5
+ export * from './cross-scope-privilege-plugin'
6
+ export * from './record-plugin'
7
+ export * from './now-id-plugin'
8
+ export * from './now-ref-plugin'
9
+ export * from './now-unresolved-plugin'
10
+ export * from './property-plugin'
11
+ export * from './role-plugin'
12
+ export * from './acl-plugin'
13
+ export * from './server-module-plugin'
14
+ export * from './view-plugin'
15
+ export * from './json-plugin'
16
+ export * from './now-config-plugin'
17
+ export * from './package-json-plugin'
18
+ export * from './business-rule-plugin'
19
+ export * from './user-preference-plugin'
20
+ export * from './now-include-plugin'
21
+ export * from './table-plugin'
22
+ export * from './column-plugin'
23
+ export * from './ui-page-plugin'
24
+ export * from './list-plugin'
25
+ export * from './ui-action-plugin'
26
+ export * from './script-include-plugin'
27
+ export * from './arrow-function-plugin'
28
+ export * from './atf/test-plugin'
29
+ export * from './service-portal/widget-plugin'
30
+ export * from './service-portal/dependency-plugin'
31
+ export * from './service-portal/angular-provider-plugin'
32
+ export * from './rest-api-plugin'
33
+ export * from './html-import-plugin'
34
+ export * from './static-content-plugin'
35
+ export * from './script-action-plugin'
36
+
37
+ // non-plugins
38
+ export * from './atf/step-configs'
39
+ export { REPACK_OUTPUT_DIR } from './repack'
@@ -0,0 +1,128 @@
1
+ import {
2
+ ts,
3
+ JSON5,
4
+ CallExpressionShape,
5
+ type ObjectShape,
6
+ Plugin,
7
+ Shape,
8
+ type Source,
9
+ SourceFileShape,
10
+ StringShape,
11
+ } from '@servicenow/sdk-build-core'
12
+
13
+ export class JsonStringifyShape extends CallExpressionShape {
14
+ constructor({ source, json }: { source: Source; json: NonNullable<object> | ObjectShape }) {
15
+ super({ source, callee: 'JSON.stringify', args: [json] })
16
+ }
17
+
18
+ getJson(): ObjectShape {
19
+ return this.getArgument(0).asObject()
20
+ }
21
+
22
+ override getValue(): string {
23
+ return JSON.stringify(this.getJson().getValue())
24
+ }
25
+ }
26
+
27
+ export class JsonFileShape extends SourceFileShape {
28
+ private readonly json: ObjectShape
29
+
30
+ constructor(file: SourceFileShape, json: ObjectShape) {
31
+ super({ file: file.getSource() })
32
+ this.json = json
33
+ }
34
+
35
+ getJson(): ObjectShape {
36
+ return this.json
37
+ }
38
+ }
39
+
40
+ export const JsonPlugin = Plugin.create({
41
+ name: 'JsonPlugin',
42
+ shapes: [
43
+ {
44
+ shape: SourceFileShape,
45
+ fileTypes: ['json'],
46
+ toSubclass(file) {
47
+ const rawContent = file.getContent().trim()
48
+ const jsonContent = rawContent || '{}'
49
+
50
+ let json: ObjectShape
51
+ try {
52
+ json = Shape.from(
53
+ file.getSource().getFirstDescendantByKind(ts.SyntaxKind.ObjectLiteralExpression) ?? file,
54
+ JSON5.parse(jsonContent)
55
+ ).asObject('Expected JSON file content to be a JSON object')
56
+ } catch (e) {
57
+ throw new Error(`Failed to parse JSON content from file (${file.getPath()})`, { cause: e })
58
+ }
59
+
60
+ return {
61
+ success: true,
62
+ value: new JsonFileShape(file, json),
63
+ }
64
+ },
65
+ },
66
+ {
67
+ shape: CallExpressionShape,
68
+ fileTypes: ['fluent'],
69
+ toSubclass(callExpression, { diagnostics }) {
70
+ if (callExpression.getCallee() !== 'JSON.stringify') {
71
+ return { success: false }
72
+ }
73
+
74
+ if (callExpression.getArguments().length > 1) {
75
+ diagnostics.error(
76
+ callExpression.getArgument(1),
77
+ 'Additional arguments to JSON.stringify are not supported'
78
+ )
79
+ return { success: false }
80
+ }
81
+
82
+ const arg = callExpression.getArgument(0)
83
+ if (!arg.isObject() && !arg.is(JsonFileShape)) {
84
+ diagnostics.error(arg, 'Argument to JSON.stringify must be an object or an import from a JSON file')
85
+ return { success: false }
86
+ }
87
+
88
+ return {
89
+ success: true,
90
+ value: new JsonStringifyShape({
91
+ source: callExpression,
92
+ json: arg.if(JsonFileShape)?.getJson() ?? arg,
93
+ }),
94
+ }
95
+ },
96
+ },
97
+ {
98
+ shape: StringShape,
99
+ async commit(shape, target, { logger, transform, commit }) {
100
+ const result = await transform.toShape(target)
101
+ if (!result.success) {
102
+ return { success: false }
103
+ }
104
+
105
+ const { value: targetShape } = result
106
+ if (targetShape.is(JsonStringifyShape)) {
107
+ await commit(shape, targetShape.getJson().getOriginalNode())
108
+ return { success: true }
109
+ }
110
+
111
+ if (!targetShape.isObject() && !targetShape.is(JsonFileShape)) {
112
+ return { success: false }
113
+ }
114
+
115
+ let json: ObjectShape
116
+ try {
117
+ json = Shape.from(shape, JSON5.parse(shape.getValue())).asObject()
118
+ } catch (e) {
119
+ logger.info('Incoming string value could not be parsed as JSON and will overwrite the node')
120
+ return { success: false }
121
+ }
122
+
123
+ await commit(json, (targetShape.if(JsonFileShape)?.getJson() ?? targetShape).getOriginalNode())
124
+ return { success: true }
125
+ },
126
+ },
127
+ ],
128
+ })
@@ -0,0 +1,222 @@
1
+ import {
2
+ CallExpressionShape,
3
+ Plugin,
4
+ IdentifierShape,
5
+ Record,
6
+ StringShape,
7
+ type ObjectShape,
8
+ type Diagnostics,
9
+ } from '@servicenow/sdk-build-core'
10
+ import { create } from 'xmlbuilder2'
11
+ import { generateDeprecatedDiagnostics } from './utils'
12
+
13
+ const DEFAULT_VIEW = 'Default view'
14
+ const listElementAliases = {
15
+ averageValue: ['average_value'],
16
+ maxValue: ['max_value'],
17
+ minValue: ['min_value'],
18
+ }
19
+
20
+ function generateListColumnProps(column: ObjectShape, index: number, diagnostics: Diagnostics) {
21
+ const props = column
22
+ .withAliasedKeys(listElementAliases)
23
+ .transform(({ $ }) => ({
24
+ element: $.from('element'),
25
+ position: $.from('position').map((p) => (p.ifUndefined() ? index : p)),
26
+ max_value: $.from('maxValue'),
27
+ min_value: $.from('minValue'),
28
+ average_value: $.from('averageValue'),
29
+ sum: $,
30
+ }))
31
+ .properties()
32
+ generateDeprecatedDiagnostics(column, diagnostics)
33
+ return props
34
+ }
35
+
36
+ export const ListPlugin = Plugin.create({
37
+ name: 'ListPlugin',
38
+ records: {
39
+ sys_ui_list: {
40
+ coalesce: ['name', 'view', 'sys_domain', 'element', 'relationship', 'parent'],
41
+ relationships: {
42
+ sys_ui_list_element: {
43
+ via: 'list_id',
44
+ descendant: true,
45
+ },
46
+ sys_ui_view: {
47
+ via: 'view',
48
+ inverse: true,
49
+ },
50
+ },
51
+ toShape(record, { descendants }) {
52
+ return {
53
+ success: true,
54
+ value: new CallExpressionShape({
55
+ source: record,
56
+ callee: 'List',
57
+ args: [
58
+ record.transform(({ $ }) => ({
59
+ table: $.from('name').map((n) => n.ifString()?.getValue() ?? ''),
60
+ view: $.map((v) =>
61
+ v.equals(DEFAULT_VIEW)
62
+ ? new IdentifierShape({ source: record, name: 'default_view' })
63
+ : (v.ifString() ?? v.toRecordId())
64
+ ),
65
+ parent: $.def(''),
66
+ relationship: $.def(''),
67
+ columns: $.val(
68
+ descendants
69
+ .query('sys_ui_list_element')
70
+ .sort(
71
+ (a, b) =>
72
+ a.get('position').toNumber().getValue() -
73
+ b.get('position').toNumber().getValue()
74
+ )
75
+ .map((element) => {
76
+ const averageValue = element.get('average_value').equals('true')
77
+ const maxValue = element.get('max_value').equals('true')
78
+ const minValue = element.get('min_value').equals('true')
79
+ const sum = element.get('sum').equals('true')
80
+
81
+ if (!averageValue && !minValue && !maxValue && !sum) {
82
+ // Element can be represented as a simple string because it does not have any special configuration
83
+ return element.get('element')
84
+ } else {
85
+ // Element has special configuration, so we need to return an object
86
+ return element
87
+ .transform(({ $ }) => ({
88
+ element: $.from('element'),
89
+ averageValue: $.val(averageValue || undefined),
90
+ maxValue: $.val(maxValue || undefined),
91
+ minValue: $.val(minValue || undefined),
92
+ sum: $.val(sum || undefined),
93
+ }))
94
+ .withAliasedKeys(listElementAliases)
95
+ }
96
+ })
97
+ ),
98
+ })),
99
+ ],
100
+ }),
101
+ }
102
+ },
103
+ toFile(list, { config, descendants }) {
104
+ if (!list.has('name')) {
105
+ // Probably generated from a deleted key
106
+ return { success: false }
107
+ }
108
+
109
+ const listName = list.get('name').asString().getValue()
110
+ const xml = create().ele('record_update')
111
+ const root = xml.ele('sys_ui_list', { table: listName })
112
+
113
+ descendants.query('sys_ui_list_element').forEach((element) => {
114
+ const child = root.ele('sys_ui_list_element', { action: 'INSERT_OR_UPDATE' })
115
+ child.ele('sys_id').txt(element.getId().getValue())
116
+ child
117
+ .ele('list_id', { display_value: listName, ...list.getId().resolveKeys() })
118
+ .txt(list.getId().getValue())
119
+
120
+ for (const prop of ['element', 'position', 'min_value', 'max_value', 'average_value', 'sum']) {
121
+ element
122
+ .get(prop)
123
+ .ifDefined()
124
+ ?.toString()
125
+ .pipe((p) => child.ele(prop).txt(p.getValue()))
126
+ }
127
+ })
128
+
129
+ const child = root.ele('sys_ui_list', { action: 'INSERT_OR_UPDATE' })
130
+ child.ele('sys_id').txt(list.getId().getValue())
131
+ child.ele('sys_scope', { display_value: config.scope }).txt(config.scopeId)
132
+
133
+ const view = list.get('view').toRecordId()
134
+ child.ele('view', view.resolveKeys()).txt(view.getValue())
135
+
136
+ const name = list.get('name')
137
+ if (name.isDefined()) {
138
+ child.ele('name').txt(name.asString().getValue())
139
+ }
140
+
141
+ const parent = list.get('parent')
142
+ if (parent.isDefined()) {
143
+ child.ele('parent').txt(parent.asString().getValue())
144
+ }
145
+
146
+ const relationship = list.get('relationship')
147
+ if (relationship.isDefined()) {
148
+ child
149
+ .ele('relationship', relationship.ifRecord()?.getId().resolveKeys())
150
+ .txt(relationship.ifString()?.getValue() ?? relationship.asRecord().getId().getValue())
151
+ }
152
+
153
+ return {
154
+ success: true,
155
+ value: {
156
+ name: `sys_ui_list_${list.getId().getValue()}.xml`,
157
+ category: list.getInstallCategory(),
158
+ content: xml.end({ prettyPrint: true }),
159
+ },
160
+ }
161
+ },
162
+ },
163
+ sys_ui_list_element: {
164
+ coalesce: ['list_id', 'element'],
165
+ },
166
+ },
167
+ shapes: [
168
+ {
169
+ shape: CallExpressionShape,
170
+ fileTypes: ['fluent'],
171
+ async toRecord(callExpression, { factory, diagnostics }) {
172
+ if (callExpression.getCallee() !== 'List') {
173
+ return { success: false }
174
+ }
175
+
176
+ const arg = callExpression.getArgument(0).asObject()
177
+ const columns = arg.get('columns').ifArray()?.getElements() ?? []
178
+ const list = factory.createRecord({
179
+ source: callExpression,
180
+ table: 'sys_ui_list',
181
+ explicitId: arg.get('$id'),
182
+ properties: arg.transform(({ $ }) => ({
183
+ name: $.from('table'),
184
+ view: $.map((v) =>
185
+ v.ifString()
186
+ ? factory.createReference({
187
+ source: v,
188
+ table: 'sys_ui_view',
189
+ keys: {
190
+ name: v,
191
+ },
192
+ })
193
+ : v
194
+ ),
195
+ parent: $,
196
+ relationship: $.map((v) => v.if([Record, StringShape])),
197
+ sys_domain: $.val('global'), // TODO: Domain support?
198
+ })),
199
+ })
200
+
201
+ return {
202
+ success: true,
203
+ value: list.with(
204
+ ...columns.map((column, index) =>
205
+ factory.createRecord({
206
+ source: callExpression,
207
+ table: 'sys_ui_list_element',
208
+ properties: {
209
+ list_id: list,
210
+ position: index,
211
+ ...(column.isString()
212
+ ? { element: column }
213
+ : generateListColumnProps(column.asObject(), index, diagnostics)),
214
+ },
215
+ })
216
+ )
217
+ ),
218
+ }
219
+ },
220
+ },
221
+ ],
222
+ })
@@ -0,0 +1,194 @@
1
+ import { NowConfig, ObjectShape, Plugin, Shape } from '@servicenow/sdk-build-core'
2
+
3
+ import { JsonFileShape } from './json-plugin'
4
+
5
+ export class NowConfigShape extends ObjectShape {}
6
+
7
+ export const NowConfigPlugin = Plugin.create({
8
+ name: 'NowConfigPlugin',
9
+ files: [
10
+ {
11
+ matcher: /\Wnow\.config\.json$/,
12
+ entryPoint: true,
13
+ },
14
+ ],
15
+ records: {
16
+ sys_app: {
17
+ toShape(record, { packageJson }) {
18
+ const { name: packageName } = packageJson
19
+
20
+ return {
21
+ success: true,
22
+ value: new NowConfigShape({
23
+ source: record,
24
+ properties: record.transform(({ $ }) => ({
25
+ name: $.toString().def(packageName),
26
+ active: $.toBoolean().def(true),
27
+ accessControls: $.from(
28
+ 'scoped_administration',
29
+ 'restrict_table_access',
30
+ 'can_edit_in_studio',
31
+ 'runtime_access_tracking',
32
+ 'private',
33
+ 'trackable',
34
+ 'uninstall_blocked',
35
+ 'hide_on_ui',
36
+ 'user_role'
37
+ )
38
+ .def({
39
+ scopedAdministration: false,
40
+ restrictTableAccess: false,
41
+ canEditInStudio: true,
42
+ runtimeAccessTracking: 'permissive',
43
+ private: false,
44
+ trackable: true,
45
+ uninstallBlocked: false,
46
+ hideOnUI: false,
47
+ userRole: '',
48
+ })
49
+ .map(
50
+ (
51
+ scoped_administration,
52
+ restrict_table_access,
53
+ can_edit_in_studio,
54
+ runtime_access_tracking,
55
+ p,
56
+ trackable,
57
+ uninstall_blocked,
58
+ hide_on_ui,
59
+ user_role
60
+ ) => ({
61
+ scopedAdministration: scoped_administration.ifBoolean()?.toBoolean(),
62
+ restrictTableAccess: restrict_table_access.ifBoolean()?.toBoolean(),
63
+ canEditInStudio: can_edit_in_studio.ifBoolean()?.toBoolean(),
64
+ runtimeAccessTracking:
65
+ runtime_access_tracking.toString().getValue() === ''
66
+ ? 'none'
67
+ : runtime_access_tracking.toString(),
68
+ private: p.ifBoolean()?.toBoolean(),
69
+ trackable: trackable.ifBoolean()?.toBoolean(),
70
+ uninstallBlocked: uninstall_blocked.ifBoolean()?.toBoolean(),
71
+ hideOnUI: hide_on_ui.ifBoolean()?.toBoolean(),
72
+ userRole: user_role.toString(),
73
+ })
74
+ ),
75
+ licensing: $.from(
76
+ 'licensable',
77
+ 'enforce_license',
78
+ 'license_model',
79
+ 'subscription_entitlement',
80
+ 'license_category'
81
+ )
82
+ .def({
83
+ licensable: true,
84
+ enforceLicense: 'log',
85
+ licenseModel: 'none',
86
+ subscriptionEntitlement: '',
87
+ licenseCategory: 'none',
88
+ })
89
+ .map(
90
+ (
91
+ licensable,
92
+ enforce_license,
93
+ license_model,
94
+ subscription_entitlement,
95
+ license_category
96
+ ) => ({
97
+ licensable: licensable.ifBoolean()?.toBoolean(),
98
+ enforceLicense: enforce_license.toString().getValue()
99
+ ? enforce_license.toString()
100
+ : 'log',
101
+ licenseModel: license_model.toString().getValue()
102
+ ? license_model.toString()
103
+ : 'none',
104
+ subscriptionEntitlement: subscription_entitlement.toString(),
105
+ licenseCategory: license_category.toString().getValue()
106
+ ? license_category.toString()
107
+ : 'none',
108
+ })
109
+ ),
110
+
111
+ jsLevel: $.from('js_level').toString().def('es_latest'),
112
+ menu: $.toString().def(''),
113
+ description: $.from('short_description').toString().def(''),
114
+ logo: $.toString().def(''),
115
+ guidedSetupGuid: $.from('guided_setup_guid').toString().def(''),
116
+ installedAsDependency: $.from('installed_as_dependency').toBoolean().def(false),
117
+ })),
118
+ }),
119
+ }
120
+ },
121
+ },
122
+ },
123
+ shapes: [
124
+ {
125
+ shape: JsonFileShape,
126
+ toRecord(file, { factory, config: rawConfig, packageJson }) {
127
+ if (file.getBaseName() !== NowConfig.FILE_NAME) {
128
+ return { success: false }
129
+ }
130
+
131
+ const config = Shape.from(file.getJson(), rawConfig).asObject()
132
+ const scope = config.get('scope').asString().getValue()
133
+
134
+ const { name: packageName, version } = packageJson
135
+ const name = config.get('name').isDefined() ? config.get('name').asString().getValue() : packageName
136
+
137
+ const accessControls = config.get('accessControls').ifDefined()?.asObject()
138
+ const licensing = config.get('licensing').ifDefined()?.asObject()
139
+
140
+ return {
141
+ success: true,
142
+ value: factory.createRecord({
143
+ source: config,
144
+ table: 'sys_app',
145
+ properties: config.transform(({ $ }) => ({
146
+ active: $.toBoolean().def(true),
147
+ scoped_administration: $.val(accessControls?.get('scopedAdministration'))
148
+ .toBoolean()
149
+ .def(false),
150
+ can_edit_in_studio: $.val(accessControls?.get('canEditInStudio')).toBoolean().def(true),
151
+ js_level: $.from('jsLevel').toString().def('es_latest'),
152
+ restrict_table_access: $.val(accessControls?.get('restrictTableAccess'))
153
+ .toBoolean()
154
+ .def(false),
155
+ runtime_access_tracking: $.map(() => {
156
+ const rac = accessControls?.get('runtimeAccessTracking').getValue()
157
+ if (!rac) {
158
+ return 'permissive'
159
+ } else if (rac === 'none') {
160
+ return undefined
161
+ }
162
+ return rac
163
+ }),
164
+ licensable: $.val(licensing?.get('licensable')).toBoolean().def(true),
165
+ enforce_license: $.val(licensing?.get('enforceLicense')).toString().def('log'),
166
+ license_model: $.val(licensing?.get('licenseModel')).toString().def('none'),
167
+ menu: $.toString().def(''),
168
+ user_role: $.val(accessControls?.get('userRole')).toString().def(''),
169
+ short_description: $.from('description').toString().def(''),
170
+ logo: $.toString().def(''),
171
+ guided_setup_guid: $.from('guidedSetupGuid').toString().def(''),
172
+ subscription_entitlement: $.val(licensing?.get('subscriptionEntitlement'))
173
+ .toString()
174
+ .def(''),
175
+ private: $.val(accessControls?.get('private')).toBoolean().def(false),
176
+ trackable: $.val(accessControls?.get('trackable')).toBoolean().def(true),
177
+ uninstall_blocked: $.val(accessControls?.get('uninstallBlocked')).toBoolean().def(false),
178
+ hide_on_ui: $.val(accessControls?.get('hideOnUI')).toBoolean().def(false),
179
+ installed_as_dependency: $.toBoolean().def(false),
180
+ license_category: $.val(licensing?.get('licenseCategory')).toString().def('none'),
181
+
182
+ scope: $.val(scope),
183
+ package_json: $.val(`${scope}/${packageName}/${version}/package.json`),
184
+ name: $.val(name),
185
+ source: $.val(scope),
186
+ sys_id: $.from('scopeId'),
187
+ version: $.val(version),
188
+ })),
189
+ }),
190
+ }
191
+ },
192
+ },
193
+ ],
194
+ })