@servicenow/sdk-build-plugins 3.0.2 → 4.0.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 (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 +37 -0
  11. package/dist/atf/step-configs.js +2236 -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 +591 -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 +157 -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 +2284 -0
  136. package/src/atf/test-plugin.ts +728 -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 +170 -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 +651 -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 -1628
  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 -2070
  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
@@ -1,34 +0,0 @@
1
- import { ts } from '@servicenow/sdk-project';
2
- import { FluentDiagnostic, StringData, Context } from '@servicenow/sdk-build-core';
3
- declare const _default: {
4
- readonly name: "Include";
5
- readonly extractors: {
6
- readonly raw: {
7
- readonly fluent: {
8
- readonly CallExpression: (node: ts.CallExpression<ts.ts.CallExpression>, context: Context) => {
9
- handled: false;
10
- diagnostics?: never;
11
- data?: never;
12
- } | {
13
- handled: true;
14
- diagnostics: FluentDiagnostic[];
15
- data: StringData<"">;
16
- } | {
17
- handled: true;
18
- diagnostics: never[];
19
- data: StringData<string>;
20
- };
21
- };
22
- };
23
- };
24
- readonly transformers: {
25
- readonly record: {
26
- readonly CallExpression: (document: import("@servicenow/sdk-build-core").Document<any, ts.CallExpression<ts.ts.CallExpression>> & {
27
- entity?: import("@servicenow/sdk-build-core").EntityData;
28
- node: ts.CallExpression<ts.ts.CallExpression>;
29
- } & import("@servicenow/sdk-build-core").Arranged, context: Context) => false;
30
- };
31
- };
32
- };
33
- export default _default;
34
- export declare function fieldHasNowIncludeCallExpression(objectLiteralExpression: ts.ObjectLiteralExpression, field: string): boolean;
@@ -1,155 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fieldHasNowIncludeCallExpression = fieldHasNowIncludeCallExpression;
4
- const sdk_project_1 = require("@servicenow/sdk-project");
5
- const sdk_build_core_1 = require("@servicenow/sdk-build-core");
6
- const sdk_project_2 = require("@servicenow/sdk-project");
7
- const db_1 = require("@servicenow/sdk-core/runtime/db");
8
- exports.default = (0, sdk_build_core_1.Plugin)({
9
- name: 'Include',
10
- extractors: {
11
- raw: {
12
- fluent: {
13
- CallExpression(node, context) {
14
- if (!(0, sdk_build_core_1.isNowIncludeCall)(node)) {
15
- return { handled: false };
16
- }
17
- const args = node.getArguments();
18
- const isStringLiteral = args[0]?.isKind(sdk_project_1.ts.SyntaxKind.StringLiteral);
19
- if (args[0] && !isStringLiteral) {
20
- return {
21
- handled: true,
22
- diagnostics: [new sdk_build_core_1.FluentDiagnostic(args[0], 'Invalid argument, String literal expected')],
23
- data: new sdk_build_core_1.StringData('', node),
24
- };
25
- }
26
- const filePath = args[0]?.asKind(sdk_project_1.ts.SyntaxKind.StringLiteral)?.getLiteralText();
27
- if (!filePath) {
28
- return {
29
- handled: true,
30
- diagnostics: [new sdk_build_core_1.FluentDiagnostic(args[0], 'File path cannot be empty')],
31
- data: new sdk_build_core_1.StringData('', node),
32
- };
33
- }
34
- const thisDir = sdk_project_2.path.dirname(node.getSourceFile().getFilePath());
35
- const resolvedPath = sdk_project_2.path.resolve(thisDir, filePath);
36
- if (!sdk_project_1.FileSystem.existsSync(context.fs, resolvedPath)) {
37
- return {
38
- handled: true,
39
- diagnostics: [new sdk_build_core_1.FluentDiagnostic(args[0], 'File not found')],
40
- data: new sdk_build_core_1.StringData('', node),
41
- };
42
- }
43
- const rootDir = sdk_project_2.path.resolve(context.app.rootDir);
44
- const relativePath = sdk_project_2.path.relative(rootDir, resolvedPath);
45
- if (relativePath.startsWith('..')) {
46
- return {
47
- handled: true,
48
- diagnostics: [new sdk_build_core_1.FluentDiagnostic(args[0], 'File not within project')],
49
- data: new sdk_build_core_1.StringData('', node),
50
- };
51
- }
52
- return {
53
- handled: true,
54
- diagnostics: [],
55
- data: new sdk_build_core_1.StringData(context.fs.readFileSync(resolvedPath).toString(), node, {
56
- needsCDATA: true,
57
- }),
58
- };
59
- },
60
- },
61
- },
62
- },
63
- transformers: {
64
- record: {
65
- CallExpression(document, context) {
66
- if (document.action === 'DELETE') {
67
- return false;
68
- }
69
- const { table } = document.data;
70
- const [args] = document.node.getArguments();
71
- if (!sdk_project_1.ts.Node.isObjectLiteralExpression(args)) {
72
- return false;
73
- }
74
- if (!document.changedData) {
75
- // If we aren't changing anything, no need to update Now.include
76
- // The root Plugin for the CallExpression should handle this
77
- return false;
78
- }
79
- const fluentFilePath = document.node.getSourceFile().getDirectory().getPath();
80
- args.getDescendantsOfKind(sdk_project_1.ts.SyntaxKind.CallExpression)
81
- .filter(sdk_build_core_1.isNowIncludeCall)
82
- .map((callExpression) => ({
83
- field: callExpression.getParentIfKind(sdk_project_1.ts.SyntaxKind.PropertyAssignment)?.getName(),
84
- path: callExpression?.getArguments()[0]?.asKind(sdk_project_1.ts.SyntaxKind.StringLiteral)?.getLiteralText(),
85
- }))
86
- .filter((includeData) => includeData.field && includeData.path)
87
- .forEach((includeData) => {
88
- const script = document.changedData.data?.[includeData.field];
89
- if (script) {
90
- const absolutePath = sdk_project_2.path.resolve(fluentFilePath, includeData.path);
91
- writeScriptToFile(context.compiler, absolutePath, script);
92
- }
93
- });
94
- const includePaths = (0, sdk_build_core_1.getIncludePaths)(context);
95
- // Only create a Now.include call on an initial fetch for certain tables
96
- if (!includePaths[table]) {
97
- return false;
98
- }
99
- let propertyObjectLiteral;
100
- if ((0, sdk_build_core_1.getCallExpressionName)(document.node) !== db_1.Record.name) {
101
- // Treat this as a root level property
102
- propertyObjectLiteral = args;
103
- }
104
- else {
105
- propertyObjectLiteral = (0, sdk_build_core_1.getOrCreatePropertyAssignment)(args, 'data', '{}').getInitializer();
106
- }
107
- const customIncludes = (0, sdk_build_core_1.calculateCustomPathsFromDocs)(context)[table]?.find((r) => r.guid === document.guid)?.fields || [];
108
- const propertyAssignments = getScriptFieldPropertyAssignments(customIncludes.map((i) => i.field), propertyObjectLiteral);
109
- for (const customInclude of customIncludes) {
110
- const script = document.changedData.data?.[customInclude.field];
111
- if (typeof script !== 'string') {
112
- continue;
113
- }
114
- if (sdk_project_2.path.parse(customInclude.path).base !== customInclude.path) {
115
- context.logger.error(`Custom include name for table ${table} and field ${customInclude.field} must be for filename only. Record ${document.guid}.`);
116
- continue;
117
- }
118
- const pa = propertyAssignments[customInclude.field];
119
- if (!pa) {
120
- const scriptFilePath = sdk_project_2.path.resolve(context.app.rootDir, context.app.config.generatedDir, customInclude.path);
121
- const relativeScriptDir = sdk_project_2.path.relative(fluentFilePath, scriptFilePath);
122
- (0, sdk_build_core_1.addCallExpressionToProperty)(propertyObjectLiteral, customInclude.field, `Now.include('${relativeScriptDir}')`);
123
- writeScriptToFile(context.compiler, scriptFilePath, script);
124
- }
125
- }
126
- return false;
127
- },
128
- },
129
- },
130
- });
131
- function writeScriptToFile(compiler, scriptFilePath, script) {
132
- const scriptDir = sdk_project_2.path.parse(scriptFilePath).dir;
133
- if (!compiler.getDirectory(scriptDir)) {
134
- compiler.addDirectoryAtPath(scriptDir, { recursive: true });
135
- }
136
- compiler.createSourceFile(scriptFilePath, script, {
137
- overwrite: true,
138
- scriptKind: sdk_project_1.FluentScriptKinds.IncludeFile,
139
- });
140
- }
141
- function getScriptFieldPropertyAssignments(fields, dataObjectLiteral) {
142
- return fields
143
- .map((field) => ({
144
- [field]: dataObjectLiteral.getProperty(field)?.asKind(sdk_project_1.ts.SyntaxKind.PropertyAssignment),
145
- }))
146
- .reduce((acc, field) => ({ ...acc, ...field }), {});
147
- }
148
- function fieldHasNowIncludeCallExpression(objectLiteralExpression, field) {
149
- const callExpression = objectLiteralExpression
150
- .getProperty(field)
151
- ?.asKind(sdk_project_1.ts.SyntaxKind.PropertyAssignment)
152
- ?.getInitializerIfKind(sdk_project_1.ts.SyntaxKind.CallExpression);
153
- return !!callExpression && (0, sdk_build_core_1.isNowIncludeCall)(callExpression);
154
- }
155
- //# sourceMappingURL=IncludePlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncludePlugin.js","sourceRoot":"","sources":["../src/IncludePlugin.ts"],"names":[],"mappings":";;AAsMA,4EAOC;AA7MD,yDAAqF;AACrF,+DAWmC;AACnC,yDAA8C;AAC9C,wDAAwD;AAExD,kBAAe,IAAA,uBAAM,EAAC;IAClB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE;QACR,GAAG,EAAE;YACD,MAAM,EAAE;gBACJ,cAAc,CAAC,IAAI,EAAE,OAAO;oBACxB,IAAI,CAAC,IAAA,iCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;wBAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;oBAC7B,CAAC;oBAED,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;oBAChC,MAAM,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;oBACpE,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;wBAC9B,OAAO;4BACH,OAAO,EAAE,IAAI;4BACb,WAAW,EAAE,C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CAAgC,CAAC,uBAAmD,EAAE,KAAa;IAC/G,MAAM,cAAc,GAAG,uBAAuB;SACzC,WAAW,CAAC,KAAK,CAAC;QACnB,EAAE,MAAM,CAAC,gBAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC;QAC1C,EAAE,oBAAoB,CAAC,gBAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;IAExD,OAAO,CAAC,CAAC,cAAc,IAAI,IAAA,iCAAgB,EAAC,cAAc,CAAC,CAAA;AAC/D,CAAC"}
@@ -1,28 +0,0 @@
1
- import { ts } from '@servicenow/sdk-project';
2
- import { FluentDiagnostic, StringData } from '@servicenow/sdk-build-core';
3
- declare const _default: {
4
- readonly name: "JSON";
5
- readonly extractors: {
6
- readonly raw: {
7
- readonly json: {
8
- readonly SourceFile: (node: ts.SourceFile, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").ExtractionResult;
9
- };
10
- readonly fluent: {
11
- readonly CallExpression: (node: ts.CallExpression<ts.ts.CallExpression>, context: import("@servicenow/sdk-build-core").Context) => {
12
- handled: false;
13
- diagnostics?: never;
14
- data?: never;
15
- } | {
16
- handled: true;
17
- diagnostics: FluentDiagnostic[];
18
- data?: never;
19
- } | {
20
- handled: true;
21
- diagnostics: FluentDiagnostic[];
22
- data: StringData<string>;
23
- };
24
- };
25
- };
26
- };
27
- };
28
- export default _default;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const sdk_project_1 = require("@servicenow/sdk-project");
4
- const sdk_build_core_1 = require("@servicenow/sdk-build-core");
5
- exports.default = (0, sdk_build_core_1.Plugin)({
6
- name: 'JSON',
7
- extractors: {
8
- raw: {
9
- json: {
10
- SourceFile(node, context) {
11
- const objectLiteral = node
12
- .getFirstChildIfKind(sdk_project_1.ts.SyntaxKind.SyntaxList)
13
- ?.getFirstChildIfKind(sdk_project_1.ts.SyntaxKind.ExpressionStatement)
14
- ?.getFirstChildIfKind(sdk_project_1.ts.SyntaxKind.ObjectLiteralExpression);
15
- return objectLiteral ? context.extractAst(objectLiteral) : { handled: false };
16
- },
17
- },
18
- fluent: {
19
- CallExpression(node, context) {
20
- const expression = node.getExpressionIfKind(sdk_project_1.ts.SyntaxKind.PropertyAccessExpression);
21
- if (!expression || expression.getText() !== 'JSON.stringify') {
22
- return {
23
- handled: false,
24
- };
25
- }
26
- const argument = node.getArguments()[0];
27
- if (!argument || !(0, sdk_project_1.isSupportedNode)(argument)) {
28
- return {
29
- handled: true,
30
- diagnostics: [new sdk_build_core_1.FluentDiagnostic(node, 'JSON.stringify must have an argument')],
31
- };
32
- }
33
- const secondArgument = node.getArguments()[1];
34
- if (secondArgument) {
35
- return {
36
- handled: true,
37
- diagnostics: [
38
- new sdk_build_core_1.FluentDiagnostic(secondArgument, 'Additional arguments to JSON.stringify are not supported'),
39
- ],
40
- };
41
- }
42
- const result = context.extractRaw(argument);
43
- if (!result.handled) {
44
- return {
45
- handled: true,
46
- diagnostics: [new sdk_build_core_1.FluentDiagnostic(argument, 'Unsupported JSON.stringify argument')],
47
- };
48
- }
49
- const data = result.data;
50
- if (!sdk_build_core_1.Data.isObject(data)) {
51
- return {
52
- handled: true,
53
- diagnostics: [
54
- ...result.diagnostics,
55
- new sdk_build_core_1.FluentDiagnostic(argument, 'Unsupported JSON.stringify argument'),
56
- ],
57
- };
58
- }
59
- return {
60
- handled: true,
61
- diagnostics: result.diagnostics,
62
- data: new sdk_build_core_1.StringData(JSON.stringify(data.getValue()), node),
63
- };
64
- },
65
- },
66
- },
67
- },
68
- });
69
- //# sourceMappingURL=JsonPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonPlugin.js","sourceRoot":"","sources":["../src/JsonPlugin.ts"],"names":[],"mappings":";;AAAA,yDAA6D;AAC7D,+DAAuF;AAEvF,kBAAe,IAAA,uBAAM,EAAC;IAClB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE;QACR,GAAG,EAAE;YACD,IAAI,E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J;yBACJ,CAAA;oBACL,CAAC;oBAED,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;oBAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBAClB,OAAO;4BACH,OAAO,EAAE,IAAI;4BACb,WAAW,EAAE,CAAC,IAAI,iCAAgB,CAAC,QAAQ,EAAE,qCAAqC,CAAC,CAAC;yBACvF,CAAA;oBACL,CAAC;oBAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;oBACxB,IAAI,CAAC,qBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;wBACvB,OAAO;4BACH,OAAO,EAAE,IAAI;4BACb,WAAW,EAAE;gCACT,GAAG,MAAM,CAAC,WAAW;gCACrB,IAAI,iCAAgB,CAAC,QAAQ,EAAE,qCAAqC,CAAC;6BACxE;yBACJ,CAAA;oBACL,CAAC;oBAED,OAAO;wBACH,OAAO,EAAE,IAAI;wBACb,WAAW,EAAE,MAAM,CAAC,WAAW;wBAC/B,IAAI,EAAE,IAAI,2BAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC;qBAC9D,CAAA;gBACL,CAAC;aACJ;SACJ;KACJ;CACJ,CAAC,CAAA"}
@@ -1,93 +0,0 @@
1
- import { List } from '@servicenow/sdk-core/runtime/ui';
2
- import { PrimitiveData, XmlData } from '@servicenow/sdk-build-core';
3
- import { RecordXmlSchema } from './db/RecordPlugin';
4
- import * as z from 'zod';
5
- import { Diagnostic, ts } from '@servicenow/sdk-project';
6
- type View = {
7
- id: string;
8
- name: string;
9
- title: string;
10
- };
11
- declare const _default: {
12
- readonly name: "List";
13
- readonly ownedTables: {
14
- readonly sys_ui_list: {
15
- readonly diagnosticLevel: Diagnostic.Level.Warn;
16
- };
17
- };
18
- readonly extractors: {
19
- readonly entity: {
20
- readonly fluent: {
21
- readonly CallExpression: (node: ts.CallExpression<ts.ts.CallExpression>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").ExtractionResult<import("@servicenow/sdk-build-core").EntityData<List<keyof Now.Internal.Tables>>>;
22
- };
23
- };
24
- readonly xml: (xml: import("@servicenow/sdk-build-core").Xml) => XmlData<{
25
- updateName: any;
26
- sys_id: any;
27
- view: {
28
- title: any;
29
- name: any;
30
- id: any;
31
- };
32
- elements: {}[];
33
- table: any;
34
- parent: any;
35
- relationship: {
36
- id: any;
37
- name: any;
38
- };
39
- }> | undefined;
40
- };
41
- readonly composers: {
42
- readonly entity: {
43
- readonly list: (entity: import("@servicenow/sdk-build-core").EntityData<Record<string, unknown>>, context: import("@servicenow/sdk-build-core").Context) => Promise<{
44
- kind: string;
45
- node: ts.CallExpression<ts.ts.CallExpression> | ts.StringLiteral | ts.SourceFile | ts.TypeAliasDeclaration | ts.TypeReferenceNode | ts.TypeLiteralNode | ts.PropertySignature | ts.TupleTypeNode | ts.FunctionExpression | ts.FunctionDeclaration | ts.ArrayLiteralExpression | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.Identifier | ts.VariableDeclaration | ts.ClassDeclaration | ts.ExportDeclaration | ts.ObjectLiteralExpression | ts.AsExpression | ts.ComputedPropertyName | ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.PropertyAccessExpression<ts.ts.PropertyAccessExpression> | ts.NoSubstitutionTemplateLiteral | ts.ExpressionStatement | ts.TaggedTemplateExpression | ts.ExportAssignment | ts.ElementAccessExpression<ts.ts.ElementAccessExpression> | ts.TemplateExpression | ts.ImportClause | ts.ImportSpecifier | ts.ImportDeclaration | ts.NamedImports | ts.VariableStatement | ts.VariableDeclarationList | ts.Node<ts.ts.PlusToken> | ts.Node<ts.ts.EndOfFileToken> | ts.Node<ts.ts.ExportKeyword> | ts.Node<ts.ts.KeywordTypeNode<ts.ts.SyntaxKind.AnyKeyword>> | ts.ModuleDeclaration | ts.ModuleBlock | ts.Block | ts.ParameterDeclaration | ts.Node<ts.ts.EqualsGreaterThanToken> | ts.ArrowFunction | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateSpan | ts.TemplateTail | ts.PrefixUnaryExpression;
46
- guid: string;
47
- data: {
48
- id: string;
49
- table: string;
50
- view: View;
51
- elements: unknown[];
52
- parent: string | undefined;
53
- relationship: string;
54
- };
55
- }>;
56
- };
57
- readonly xml: {
58
- readonly list: (xml: XmlData<PrimitiveData>) => {
59
- action: import("@servicenow/sdk-build-core").Action;
60
- kind: string;
61
- guid: string;
62
- data: {
63
- id: string;
64
- table: string;
65
- view: View;
66
- elements: SysUIListElementXml;
67
- parent: string | number | boolean | PrimitiveData | PrimitiveData[] | undefined;
68
- relationship: string | number | boolean | PrimitiveData | PrimitiveData[] | undefined;
69
- };
70
- };
71
- };
72
- };
73
- readonly transformers: {
74
- readonly list: {
75
- readonly CallExpression: (document: import("@servicenow/sdk-build-core").Document<any, ts.CallExpression<ts.ts.CallExpression>> & {
76
- entity?: import("@servicenow/sdk-build-core").EntityData;
77
- node: ts.CallExpression<ts.ts.CallExpression>;
78
- } & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => boolean;
79
- };
80
- };
81
- readonly generators: {
82
- readonly list: (document: import("@servicenow/sdk-build-core").UnlinkedDocument<"list"> & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").LinkedDocument<"list", ts.CallExpression<ts.ts.CallExpression>>;
83
- };
84
- readonly serializers: {
85
- readonly list: (document: import("@servicenow/sdk-build-core").Document<string> & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => {
86
- name: `${string}.xml`;
87
- directory: import("@servicenow/sdk-build-core").Directories;
88
- content: string;
89
- };
90
- };
91
- };
92
- export default _default;
93
- type SysUIListElementXml = z.infer<typeof RecordXmlSchema>[];