@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
@@ -1,606 +0,0 @@
1
- // Copied from sn-uxf-formula-parser-library - https://code.devsnc.com/dev/uxf-formula-parser
2
-
3
- /**
4
- * https://code.devsnc.com/dev/uxf-formula-parser/blob/ci/master/src/uxf-formula-parser/grammar-parser/clientTransformMap.js
5
- */
6
-
7
- /**
8
- * @typedef ClientTransformDefinition
9
- * @type {object}
10
- * @property {string} name
11
- * @property {string} Type
12
- * @property {number} argCount
13
- * @property {string} documentation
14
- * @property {Array<string>} args
15
- * @property {string} insertText
16
- * @property {string|function} returnType
17
- */
18
-
19
- const filterLikeSignature = ['array', 'string', 'any']
20
- const emptyLikeSignature = ['array', 'string']
21
- const oneofLikeSignature = ['array', 'string', 'array']
22
-
23
- /**
24
- * @type {Object<string, ClientTransformDefinition>}
25
- */
26
- export default {
27
- LEN: {
28
- name: 'LEN',
29
- type: 'CLIENT_TRANSFORM',
30
- argCount: 1,
31
- insertText: 'LEN(${1:list})',
32
- documentation: 'Length of list',
33
- args: ['array'],
34
- returnType: 'number',
35
- },
36
- IF: {
37
- name: 'IF',
38
- type: 'CLIENT_TRANSFORM',
39
- argCount: 3,
40
- insertText: 'IF(${1:if}, ${2:then}, ${3:else})',
41
- documentation: 'If-Then-Else Statement',
42
- args: ['boolean', 'any', 'any'],
43
- returnType: (uxValue, getReturnTypeFromUxValue) =>
44
- getReturnTypeFromUxValue(uxValue.transform?.operands?.container?.[0]),
45
- },
46
- CONCAT: {
47
- name: 'CONCAT',
48
- type: 'CLIENT_TRANSFORM',
49
- argCount: 'any',
50
- insertText: 'CONCAT(${1:values})',
51
- documentation: 'Concatenate values together',
52
- args: ['string', '>string'],
53
- returnType: 'string',
54
- },
55
- RANGE: {
56
- name: 'RANGE',
57
- type: 'CLIENT_TRANSFORM',
58
- argCount: 2,
59
- insertText: 'RANGE(${1:from}, ${2:to})',
60
- documentation: '',
61
- args: ['number', 'number'],
62
- returnType: 'array',
63
- },
64
- EMPTY: {
65
- name: 'EMPTY',
66
- type: 'CLIENT_TRANSFORM',
67
- argCount: 1,
68
- insertText: 'EMPTY(${1:value})',
69
- documentation: '',
70
- args: ['any'],
71
- returnType: 'boolean',
72
- },
73
- PICK: {
74
- name: 'PICK',
75
- type: 'CLIENT_TRANSFORM',
76
- argCount: 2,
77
- insertText: 'PICK(${1:array}, ${2:field})',
78
- documentation: '',
79
- args: ['array', 'string'],
80
- returnType: 'any',
81
- },
82
- WHERE_EQ: {
83
- name: 'WHERE_EQ',
84
- type: 'CLIENT_TRANSFORM',
85
- argCount: 3,
86
- insertText: 'WHERE_EQ(${1:array}, ${2:field}, ${3:value})',
87
- documentation: '',
88
- args: filterLikeSignature,
89
- returnType: 'array',
90
- },
91
- WHERE_NEQ: {
92
- name: 'WHERE_NEQ',
93
- type: 'CLIENT_TRANSFORM',
94
- argCount: 3,
95
- insertText: 'WHERE_NEQ(${1:array}, ${2:field}, ${3:value})',
96
- documentation: '',
97
- args: filterLikeSignature,
98
- returnType: 'array',
99
- },
100
- WHERE_GT: {
101
- name: 'WHERE_GT',
102
- type: 'CLIENT_TRANSFORM',
103
- argCount: 3,
104
- insertText: 'WHERE_GT(${1:array}, ${2:field}, ${3:value})',
105
- documentation: '',
106
- args: filterLikeSignature,
107
- returnType: 'array',
108
- },
109
- WHERE_GTE: {
110
- name: 'WHERE_GTE',
111
- type: 'CLIENT_TRANSFORM',
112
- argCount: 3,
113
- insertText: 'WHERE_GTE(${1:array}, ${2:field}, ${3:value})',
114
- documentation: '',
115
- args: filterLikeSignature,
116
- returnType: 'array',
117
- },
118
- WHERE_LT: {
119
- name: 'WHERE_LT',
120
- type: 'CLIENT_TRANSFORM',
121
- argCount: 3,
122
- insertText: 'WHERE_LT(${1:array}, ${2:field}, ${3:value})',
123
- documentation: '',
124
- args: filterLikeSignature,
125
- returnType: 'array',
126
- },
127
- WHERE_LTE: {
128
- name: 'WHERE_LTE',
129
- type: 'CLIENT_TRANSFORM',
130
- argCount: 3,
131
- insertText: 'WHERE_LTE(${1:array}, ${2:field}, ${3:value})',
132
- documentation: '',
133
- args: filterLikeSignature,
134
- returnType: 'array',
135
- },
136
- WHERE_EMPTY: {
137
- name: 'WHERE_EMPTY',
138
- type: 'CLIENT_TRANSFORM',
139
- argCount: 2,
140
- insertText: 'WHERE_EMPTY(${1:array}, ${2:field})',
141
- documentation: '',
142
- args: emptyLikeSignature,
143
- returnType: 'array',
144
- },
145
- WHERE_NOTEMPTY: {
146
- name: 'WHERE_NOTEMPTY',
147
- type: 'CLIENT_TRANSFORM',
148
- argCount: 2,
149
- insertText: 'WHERE_NOTEMPTY(${1:array}, ${2:field})',
150
- documentation: '',
151
- args: emptyLikeSignature,
152
- returnType: 'array',
153
- },
154
- WHERE_ONEOF: {
155
- name: 'WHERE_ONEOF',
156
- type: 'CLIENT_TRANSFORM',
157
- argCount: 3,
158
- insertText: 'WHERE_ONEOF(${1:array}, ${2:field}, ${3:options})',
159
- documentation: '',
160
- args: oneofLikeSignature,
161
- returnType: 'array',
162
- },
163
- WHERE_NOTONEOF: {
164
- name: 'WHERE_NOTONEOF',
165
- type: 'CLIENT_TRANSFORM',
166
- argCount: 3,
167
- insertText: 'WHERE_NOTONEOF(${1:array}, ${2:field}, ${3:options})',
168
- documentation: '',
169
- args: oneofLikeSignature,
170
- returnType: 'array',
171
- },
172
- ANY_EQ: {
173
- name: 'ANY_EQ',
174
- type: 'CLIENT_TRANSFORM',
175
- argCount: 3,
176
- insertText: 'ANY_EQ(${1:array}, ${2:field}, ${3:value})',
177
- documentation: '',
178
- args: filterLikeSignature,
179
- returnType: 'boolean',
180
- },
181
- ANY_NEQ: {
182
- name: 'ANY_NEQ',
183
- type: 'CLIENT_TRANSFORM',
184
- argCount: 3,
185
- insertText: 'ANY_NEQ(${1:array}, ${2:field}, ${3:value})',
186
- documentation: '',
187
- args: filterLikeSignature,
188
- returnType: 'boolean',
189
- },
190
- ANY_GT: {
191
- name: 'ANY_GT',
192
- type: 'CLIENT_TRANSFORM',
193
- argCount: 3,
194
- insertText: 'ANY_GT(${1:array}, ${2:field}, ${3:value})',
195
- documentation: '',
196
- args: filterLikeSignature,
197
- returnType: 'boolean',
198
- },
199
- ANY_GTE: {
200
- name: 'ANY_GTE',
201
- type: 'CLIENT_TRANSFORM',
202
- argCount: 3,
203
- insertText: 'ANY_GTE(${1:array}, ${2:field}, ${3:value})',
204
- documentation: '',
205
- args: filterLikeSignature,
206
- returnType: 'boolean',
207
- },
208
- ANY_LT: {
209
- name: 'ANY_LT',
210
- type: 'CLIENT_TRANSFORM',
211
- argCount: 3,
212
- insertText: 'ANY_LT(${1:array}, ${2:field}, ${3:value})',
213
- documentation: '',
214
- args: filterLikeSignature,
215
- returnType: 'boolean',
216
- },
217
- ANY_LTE: {
218
- name: 'ANY_LTE',
219
- type: 'CLIENT_TRANSFORM',
220
- argCount: 3,
221
- insertText: 'ANY_LTE(${1:array}, ${2:field}, ${3:value})',
222
- documentation: '',
223
- args: filterLikeSignature,
224
- returnType: 'boolean',
225
- },
226
- ANY_EMPTY: {
227
- name: 'ANY_EMPTY',
228
- type: 'CLIENT_TRANSFORM',
229
- argCount: 2,
230
- insertText: 'ANY_EMPTY(${1:array}, ${2:field})',
231
- documentation: '',
232
- args: emptyLikeSignature,
233
- returnType: 'boolean',
234
- },
235
- ANY_NOTEMPTY: {
236
- name: 'ANY_NOTEMPTY',
237
- type: 'CLIENT_TRANSFORM',
238
- argCount: 2,
239
- insertText: 'ANY_NOTEMPTY(${1:array}, ${2:field})',
240
- documentation: '',
241
- args: emptyLikeSignature,
242
- returnType: 'boolean',
243
- },
244
- ANY_ONEOF: {
245
- name: 'ANY_ONEOF',
246
- type: 'CLIENT_TRANSFORM',
247
- argCount: 3,
248
- insertText: 'ANY_ONEOF(${1:array}, ${2:field}, ${3:options})',
249
- documentation: '',
250
- args: oneofLikeSignature,
251
- returnType: 'boolean',
252
- },
253
- ANY_NOTONEOF: {
254
- name: 'ANY_NOTONEOF',
255
- type: 'CLIENT_TRANSFORM',
256
- argCount: 3,
257
- insertText: 'ANY_NOTONEOF(${1:array}, ${2:field}, ${3:options})',
258
- documentation: '',
259
- args: oneofLikeSignature,
260
- returnType: 'boolean',
261
- },
262
- ALL_EQ: {
263
- name: 'ALL_EQ',
264
- type: 'CLIENT_TRANSFORM',
265
- argCount: 3,
266
- insertText: 'ALL_EQ(${1:array}, ${2:field}, ${3:value})',
267
- documentation: '',
268
- args: filterLikeSignature,
269
- returnType: 'boolean',
270
- },
271
- ALL_NEQ: {
272
- name: 'ALL_NEQ',
273
- type: 'CLIENT_TRANSFORM',
274
- argCount: 3,
275
- insertText: 'ALL_NEQ(${1:array}, ${2:field}, ${3:value})',
276
- documentation: '',
277
- args: filterLikeSignature,
278
- returnType: 'boolean',
279
- },
280
- ALL_GT: {
281
- name: 'ALL_GT',
282
- type: 'CLIENT_TRANSFORM',
283
- argCount: 3,
284
- insertText: 'ALL_GT(${1:array}, ${2:field}, ${3:value})',
285
- documentation: '',
286
- args: filterLikeSignature,
287
- returnType: 'boolean',
288
- },
289
- ALL_GTE: {
290
- name: 'ALL_GTE',
291
- type: 'CLIENT_TRANSFORM',
292
- argCount: 3,
293
- insertText: 'ALL_GTE(${1:array}, ${2:field}, ${3:value})',
294
- documentation: '',
295
- args: filterLikeSignature,
296
- returnType: 'boolean',
297
- },
298
- ALL_LT: {
299
- name: 'ALL_LT',
300
- type: 'CLIENT_TRANSFORM',
301
- argCount: 3,
302
- insertText: 'ALL_LT(${1:array}, ${2:field}, ${3:value})',
303
- documentation: '',
304
- args: filterLikeSignature,
305
- returnType: 'boolean',
306
- },
307
- ALL_LTE: {
308
- name: 'ALL_LTE',
309
- type: 'CLIENT_TRANSFORM',
310
- argCount: 3,
311
- insertText: 'ALL_LTE(${1:array}, ${2:field}, ${3:value})',
312
- documentation: '',
313
- args: filterLikeSignature,
314
- returnType: 'boolean',
315
- },
316
- ALL_EMPTY: {
317
- name: 'ALL_EMPTY',
318
- type: 'CLIENT_TRANSFORM',
319
- argCount: 2,
320
- insertText: 'ALL_EMPTY(${1:array}, ${2:field})',
321
- documentation: '',
322
- args: emptyLikeSignature,
323
- returnType: 'boolean',
324
- },
325
- ALL_NOTEMPTY: {
326
- name: 'ALL_NOTEMPTY',
327
- type: 'CLIENT_TRANSFORM',
328
- argCount: 2,
329
- insertText: 'ALL_NOTEMPTY(${1:array}, ${2:field})',
330
- documentation: '',
331
- args: emptyLikeSignature,
332
- returnType: 'boolean',
333
- },
334
- ALL_ONEOF: {
335
- name: 'ALL_ONEOF',
336
- type: 'CLIENT_TRANSFORM',
337
- argCount: 3,
338
- insertText: 'ALL_ONEOF(${1:array}, ${2:field}, ${3:options})',
339
- documentation: '',
340
- args: oneofLikeSignature,
341
- returnType: 'boolean',
342
- },
343
- ALL_NOTONEOF: {
344
- name: 'ALL_NOTONEOF',
345
- type: 'CLIENT_TRANSFORM',
346
- argCount: 3,
347
- insertText: 'ALL_NOTONEOF(${1:array}, ${2:field}, ${3:options})',
348
- documentation: '',
349
- args: oneofLikeSignature,
350
- returnType: 'boolean',
351
- },
352
- SUM: {
353
- name: 'SUM',
354
- type: 'CLIENT_TRANSFORM',
355
- argCount: 1,
356
- insertText: 'SUM(${1:array})',
357
- documentation: '',
358
- args: ['array'],
359
- returnType: 'number',
360
- },
361
- TRANSLATE: {
362
- name: 'TRANSLATE',
363
- type: 'CLIENT_TRANSFORM',
364
- argCount: 1,
365
- insertText: 'TRANSLATE(${1:text})',
366
- documentation: 'Make text translatable',
367
- args: ['string'],
368
- returnType: 'string',
369
- },
370
- LASTINDEXOF: {
371
- name: 'LASTINDEXOF',
372
- type: 'CLIENT_TRANSFORM',
373
- argCount: 2,
374
- insertText: 'LASTINDEXOF(${1:stringOrArray}, ${2:value})',
375
- documentation: 'Find the last index where the value occurs in the string or array',
376
- args: ['any', 'any'],
377
- returnType: 'number',
378
- },
379
- INDEXOF: {
380
- name: 'INDEXOF',
381
- type: 'CLIENT_TRANSFORM',
382
- argCount: 2,
383
- insertText: 'INDEXOF(${1:stringOrArray}, ${2:value})',
384
- documentation: 'Find the first index where the value occurs in the string or array',
385
- args: ['any', 'any'],
386
- returnType: 'number',
387
- },
388
- INCLUDES: {
389
- name: 'INCLUDES',
390
- type: 'CLIENT_TRANSFORM',
391
- argCount: 2,
392
- insertText: 'LASTINDEXOF(${1:stringOrArray}, ${2:value})',
393
- documentation: 'Returns true if the value occurs in the string or array, otherwise false',
394
- args: ['any', 'any'],
395
- returnType: 'boolean',
396
- },
397
- SLICE: {
398
- name: 'SLICE',
399
- type: 'CLIENT_TRANSFORM',
400
- argCount: 3,
401
- insertText: 'SLICE(${1:stringOrArray}, ${2:start}, ${3:end})',
402
- documentation: `
403
- Returns a part of the string or array, from the index specified in start
404
- and ending in the index specified in end. If end is not specified, it will be the end of the
405
- string or array. Note that the index starts at 0, not 1.
406
- `.trim(),
407
- args: ['any', 'number', 'number'],
408
- returnType: 'any',
409
- },
410
- /* TODO(anthony-bullard): Uncomment when Formula Builder is ready for advanced transforms
411
- FIND: {
412
- name: 'FIND',
413
- type: 'CLIENT_TRANSFORM',
414
- argCount: 2,
415
- insertText: 'FIND(${1:array}, ${2:predicate})',
416
- documentation: `
417
- Returns the first item in the array that matches the predicate. The predicate should resolve to a
418
- boolean (true/false) value. Use the @vars.it binding to access the current item being evaluated.
419
- `.trim(),
420
- args: ['array', 'any'],
421
- returnType: 'any'
422
- },
423
- MAP: {
424
- name: 'MAP',
425
- type: 'CLIENT_TRANSFORM',
426
- argCount: 2,
427
- insertText: 'MAP(${1:array}, ${2:mapping})',
428
- documentation: `
429
- Returns a new array, with an item for every item in the original array using mapping. Use the
430
- @vars.it binding to access the current item from the original array.
431
- `.trim(),
432
- args: ['array', 'any'],
433
- returnType: 'array'
434
- },
435
- REDUCE: {
436
- name: 'REDUCE',
437
- type: 'CLIENT_TRANSFORM',
438
- argCount: 3,
439
- insertText: 'REDUCE(${1:array}, ${2:start}, ${3:mapping}',
440
- documentation: `
441
- Returns a new value based on evaluating the mapping on each item from the array as well as the
442
- result from start for the first item or the result of the previous evaluation of mapping. The
443
- current item can be accessed in mapping with the @vars.it binding and the accumulated value is accessed
444
- from the @vars.acc binding.
445
- `.trim(),
446
- args: ['array', 'any', 'any'],
447
- returnType: 'any'
448
- },
449
- LET: {
450
- name: 'LET',
451
- type: 'CLIENT_TRANSFORM',
452
- argCount: 3,
453
- insertText: 'LET(${1:name}, ${2:value}, ${3:expression})',
454
- documentation: `
455
- Sets the value of a @var binding of the provided name to value and then evaluates expressions such
456
- that that binding is valid. LET("a", 5, @vars.a + 1) would return 6.
457
- `.trim(),
458
- args: ['string', 'any', 'any'],
459
- returnType: 'any'
460
- },
461
- */
462
- REPLACE: {
463
- name: 'REPLACE',
464
- type: 'CLIENT_TRANSFORM',
465
- argCount: 3,
466
- insertText: 'REPLACE(${1:string}, ${2:match}, ${3:replacement})',
467
- documentation: `
468
- Replaces the first occurrence of match with replacement in string.
469
- `.trim(),
470
- args: ['string', 'string', 'string'],
471
- returnType: 'string',
472
- },
473
- REPLACEALL: {
474
- name: 'REPLACEALL',
475
- type: 'CLIENT_TRANSFORM',
476
- argCount: 3,
477
- insertText: 'REPLACEALL(${1:string}, ${2:match}, ${3:replacement})',
478
- documentation: `
479
- Replaces the first occurrence of match with replacement in string.
480
- `.trim(),
481
- args: ['string', 'string', 'string'],
482
- returnType: 'string',
483
- },
484
- TRIM: {
485
- name: 'TRIM',
486
- type: 'CLIENT_TRANSFORM',
487
- argCount: 1,
488
- insertText: 'TRIM(${1:string})',
489
- documentation: `
490
- Removes all spaces and other whitespace from the start and end of the string
491
- `.trim(),
492
- args: ['string'],
493
- returnType: 'string',
494
- },
495
- TRIMSTART: {
496
- name: 'TRIMSTART',
497
- type: 'CLIENT_TRANSFORM',
498
- argCount: 1,
499
- insertText: 'TRIMSTART(${1:string})',
500
- documentation: `
501
- Removes all spaces and other whitespace from the start of the string
502
- `.trim(),
503
- args: ['string'],
504
- returnType: 'string',
505
- },
506
- TRIMEND: {
507
- name: 'TRIMEND',
508
- type: 'CLIENT_TRANSFORM',
509
- argCount: 1,
510
- insertText: 'TRIMEND(${1:string})',
511
- documentation: `
512
- Removes all spaces and other whitespace from the end of the string
513
- `.trim(),
514
- args: ['string'],
515
- returnType: 'string',
516
- },
517
- UPPERCASE: {
518
- name: 'UPPERCASE',
519
- type: 'CLIENT_TRANSFORM',
520
- argCount: 1,
521
- insertText: 'UPPERCASE(${1:string})',
522
- documentation: `
523
- Returns a new string with all characters in uppercase.
524
- `.trim(),
525
- args: ['string'],
526
- returnType: 'string',
527
- },
528
- LOWERCASE: {
529
- name: 'LOWERCASE',
530
- type: 'CLIENT_TRANSFORM',
531
- argCount: 1,
532
- insertText: 'LOWERCASE(${1:string})',
533
- documentation: `
534
- Returns a new string with all characters in lowercase.
535
- `.trim(),
536
- args: ['string'],
537
- returnType: 'string',
538
- },
539
- KEYS: {
540
- name: 'KEYS',
541
- type: 'CLIENT_TRANSFORM',
542
- argCount: 1,
543
- insertText: 'KEYS(${1:object})',
544
- documentation: `
545
- Returns an array of all the keys found in the object.
546
- `.trim(),
547
- args: ['object'],
548
- returnType: 'array',
549
- },
550
- VALUES: {
551
- name: 'VALUES',
552
- type: 'CLIENT_TRANSFORM',
553
- argCount: 1,
554
- insertText: 'VALUES(${1:object})',
555
- documentation: `
556
- Returns an array of all the values found in the object
557
- `.trim(),
558
- args: ['object'],
559
- returnType: 'array',
560
- },
561
- ENTRIES: {
562
- name: 'ENTRIES',
563
- type: 'CLIENT_TRANSFORM',
564
- argCount: 1,
565
- insertText: 'ENTRIES(${1:object})',
566
- documentation: `
567
- Returns an array for each key/value pair in an object that is an array like [key, value].
568
- `.trim(),
569
- args: ['object'],
570
- returnType: 'array',
571
- },
572
- WITH: {
573
- name: 'WITH',
574
- type: 'CLIENT_TRANSFORM',
575
- argCount: 3,
576
- insertText: 'WITH(${1:object}, ${2:key}, ${3:value}',
577
- documentation: `
578
- Returns a new object that consists of the given object plus a new key/value pair comprised of
579
- key and value.
580
- `.trim(),
581
- args: ['object', 'string', 'any'],
582
- returnType: 'object',
583
- },
584
- DEBUG: {
585
- name: 'DEBUG',
586
- type: 'CLIENT_TRANSFORM',
587
- argCount: 2,
588
- insertText: 'DEBUG(${1:message}, ${2:value})',
589
- documentation: `
590
- Logs out the given message and returns the given value
591
- `.trim(),
592
- args: ['string', 'any'],
593
- returnType: 'any',
594
- },
595
- GET: {
596
- name: 'GET',
597
- type: 'CLIENT_TRANSFORM',
598
- argCount: 2,
599
- insertText: 'GET(${1:object}, ${2:path}',
600
- documentation: `
601
- Returns the value found by dotwalking object using the path segments provided.
602
- `.trim(),
603
- args: ['object', '>string'],
604
- returnType: 'any',
605
- },
606
- }