@servicenow/sdk-build-plugins 2.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 (166) hide show
  1. package/dist/AttachmentPlugin.d.ts +253 -0
  2. package/dist/AttachmentPlugin.js +216 -0
  3. package/dist/AttachmentPlugin.js.map +1 -0
  4. package/dist/BusinessRulePlugin.d.ts +56 -0
  5. package/dist/BusinessRulePlugin.js +171 -0
  6. package/dist/BusinessRulePlugin.js.map +1 -0
  7. package/dist/CrossScopePrivilegePlugin.d.ts +22 -0
  8. package/dist/CrossScopePrivilegePlugin.js +42 -0
  9. package/dist/CrossScopePrivilegePlugin.js.map +1 -0
  10. package/dist/DefaultPlugin.d.ts +71 -0
  11. package/dist/DefaultPlugin.js +238 -0
  12. package/dist/DefaultPlugin.js.map +1 -0
  13. package/dist/IdPlugin.d.ts +17 -0
  14. package/dist/IdPlugin.js +45 -0
  15. package/dist/IdPlugin.js.map +1 -0
  16. package/dist/ListPlugin.d.ts +91 -0
  17. package/dist/ListPlugin.js +398 -0
  18. package/dist/ListPlugin.js.map +1 -0
  19. package/dist/PropertyPlugin.d.ts +122 -0
  20. package/dist/PropertyPlugin.js +165 -0
  21. package/dist/PropertyPlugin.js.map +1 -0
  22. package/dist/ScriptTemplatePlugin.d.ts +31 -0
  23. package/dist/ScriptTemplatePlugin.js +208 -0
  24. package/dist/ScriptTemplatePlugin.js.map +1 -0
  25. package/dist/UserPreferencePlugin.d.ts +16 -0
  26. package/dist/UserPreferencePlugin.js +30 -0
  27. package/dist/UserPreferencePlugin.js.map +1 -0
  28. package/dist/aclAndRole/AclPlugin.d.ts +117 -0
  29. package/dist/aclAndRole/AclPlugin.js +285 -0
  30. package/dist/aclAndRole/AclPlugin.js.map +1 -0
  31. package/dist/aclAndRole/RolePlugin.d.ts +58 -0
  32. package/dist/aclAndRole/RolePlugin.js +152 -0
  33. package/dist/aclAndRole/RolePlugin.js.map +1 -0
  34. package/dist/aclAndRole/Util.d.ts +3 -0
  35. package/dist/aclAndRole/Util.js +106 -0
  36. package/dist/aclAndRole/Util.js.map +1 -0
  37. package/dist/app/ApplicationMenuPlugin.d.ts +32 -0
  38. package/dist/app/ApplicationMenuPlugin.js +106 -0
  39. package/dist/app/ApplicationMenuPlugin.js.map +1 -0
  40. package/dist/atf/ATFComposer.d.ts +492 -0
  41. package/dist/atf/ATFComposer.js +2717 -0
  42. package/dist/atf/ATFComposer.js.map +1 -0
  43. package/dist/atf/TestPlugin.d.ts +31 -0
  44. package/dist/atf/TestPlugin.js +95 -0
  45. package/dist/atf/TestPlugin.js.map +1 -0
  46. package/dist/atf/index.d.ts +1 -0
  47. package/dist/atf/index.js +9 -0
  48. package/dist/atf/index.js.map +1 -0
  49. package/dist/db/ColumnPlugins.d.ts +278 -0
  50. package/dist/db/ColumnPlugins.js +112 -0
  51. package/dist/db/ColumnPlugins.js.map +1 -0
  52. package/dist/db/RecordPlugin.d.ts +208 -0
  53. package/dist/db/RecordPlugin.js +287 -0
  54. package/dist/db/RecordPlugin.js.map +1 -0
  55. package/dist/db/TablePlugin.d.ts +742 -0
  56. package/dist/db/TablePlugin.js +1249 -0
  57. package/dist/db/TablePlugin.js.map +1 -0
  58. package/dist/db/index.d.ts +3 -0
  59. package/dist/db/index.js +27 -0
  60. package/dist/db/index.js.map +1 -0
  61. package/dist/index.d.ts +16 -0
  62. package/dist/index.js +51 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/scriptedRESTAPI/RESTDeserializationUtils.d.ts +12 -0
  65. package/dist/scriptedRESTAPI/RESTDeserializationUtils.js +371 -0
  66. package/dist/scriptedRESTAPI/RESTDeserializationUtils.js.map +1 -0
  67. package/dist/scriptedRESTAPI/RESTSerializationUtils.d.ts +15 -0
  68. package/dist/scriptedRESTAPI/RESTSerializationUtils.js +177 -0
  69. package/dist/scriptedRESTAPI/RESTSerializationUtils.js.map +1 -0
  70. package/dist/scriptedRESTAPI/RestApiPlugin.d.ts +144 -0
  71. package/dist/scriptedRESTAPI/RestApiPlugin.js +318 -0
  72. package/dist/scriptedRESTAPI/RestApiPlugin.js.map +1 -0
  73. package/dist/scriptedRESTAPI/RestSchemaUtils.d.ts +190 -0
  74. package/dist/scriptedRESTAPI/RestSchemaUtils.js +53 -0
  75. package/dist/scriptedRESTAPI/RestSchemaUtils.js.map +1 -0
  76. package/dist/scriptedRESTAPI/RestUtils.d.ts +75 -0
  77. package/dist/scriptedRESTAPI/RestUtils.js +469 -0
  78. package/dist/scriptedRESTAPI/RestUtils.js.map +1 -0
  79. package/dist/scripts/ClientScriptPlugin.d.ts +43 -0
  80. package/dist/scripts/ClientScriptPlugin.js +190 -0
  81. package/dist/scripts/ClientScriptPlugin.js.map +1 -0
  82. package/dist/scripts/scriptUtils.d.ts +15 -0
  83. package/dist/scripts/scriptUtils.js +83 -0
  84. package/dist/scripts/scriptUtils.js.map +1 -0
  85. package/dist/uxf/ExperiencePlugin.d.ts +22 -0
  86. package/dist/uxf/ExperiencePlugin.js +55 -0
  87. package/dist/uxf/ExperiencePlugin.js.map +1 -0
  88. package/dist/uxf/RoutesPlugin.d.ts +22 -0
  89. package/dist/uxf/RoutesPlugin.js +176 -0
  90. package/dist/uxf/RoutesPlugin.js.map +1 -0
  91. package/dist/uxf/UxfFormulaParser/cleanUxValue.d.ts +4 -0
  92. package/dist/uxf/UxfFormulaParser/cleanUxValue.js +65 -0
  93. package/dist/uxf/UxfFormulaParser/cleanUxValue.js.map +1 -0
  94. package/dist/uxf/UxfFormulaParser/grammerParser/api.d.ts +189 -0
  95. package/dist/uxf/UxfFormulaParser/grammerParser/api.js +158 -0
  96. package/dist/uxf/UxfFormulaParser/grammerParser/api.js.map +1 -0
  97. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.d.ts +13 -0
  98. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +604 -0
  99. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js.map +1 -0
  100. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.d.ts +12 -0
  101. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
  102. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js.map +1 -0
  103. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.d.ts +31 -0
  104. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +64 -0
  105. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js.map +1 -0
  106. package/dist/uxf/UxfFormulaParser/index.d.ts +3 -0
  107. package/dist/uxf/UxfFormulaParser/index.js +11 -0
  108. package/dist/uxf/UxfFormulaParser/index.js.map +1 -0
  109. package/dist/uxf/UxfFormulaParser/parser.d.ts +8 -0
  110. package/dist/uxf/UxfFormulaParser/parser.js +87 -0
  111. package/dist/uxf/UxfFormulaParser/parser.js.map +1 -0
  112. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.d.ts +8 -0
  113. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js +17 -0
  114. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js.map +1 -0
  115. package/dist/uxf/constants.d.ts +2 -0
  116. package/dist/uxf/constants.js +8 -0
  117. package/dist/uxf/constants.js.map +1 -0
  118. package/dist/uxf/index.d.ts +2 -0
  119. package/dist/uxf/index.js +11 -0
  120. package/dist/uxf/index.js.map +1 -0
  121. package/dist/uxf/tectonicIdGenerator.d.ts +12 -0
  122. package/dist/uxf/tectonicIdGenerator.js +102 -0
  123. package/dist/uxf/tectonicIdGenerator.js.map +1 -0
  124. package/license +9 -0
  125. package/package.json +42 -0
  126. package/src/AttachmentPlugin.ts +262 -0
  127. package/src/BusinessRulePlugin.ts +251 -0
  128. package/src/CrossScopePrivilegePlugin.ts +54 -0
  129. package/src/DefaultPlugin.ts +272 -0
  130. package/src/IdPlugin.ts +47 -0
  131. package/src/ListPlugin.ts +497 -0
  132. package/src/PropertyPlugin.ts +218 -0
  133. package/src/ScriptTemplatePlugin.ts +223 -0
  134. package/src/UserPreferencePlugin.ts +36 -0
  135. package/src/aclAndRole/AclPlugin.ts +410 -0
  136. package/src/aclAndRole/RolePlugin.ts +225 -0
  137. package/src/aclAndRole/Util.ts +104 -0
  138. package/src/app/ApplicationMenuPlugin.ts +158 -0
  139. package/src/atf/ATFComposer.ts +3356 -0
  140. package/src/atf/TestPlugin.ts +119 -0
  141. package/src/atf/index.ts +1 -0
  142. package/src/db/ColumnPlugins.ts +117 -0
  143. package/src/db/RecordPlugin.ts +391 -0
  144. package/src/db/TablePlugin.ts +1581 -0
  145. package/src/db/index.ts +3 -0
  146. package/src/index.ts +16 -0
  147. package/src/scriptedRESTAPI/RESTDeserializationUtils.ts +410 -0
  148. package/src/scriptedRESTAPI/RESTSerializationUtils.ts +227 -0
  149. package/src/scriptedRESTAPI/RestApiPlugin.ts +438 -0
  150. package/src/scriptedRESTAPI/RestSchemaUtils.ts +72 -0
  151. package/src/scriptedRESTAPI/RestUtils.ts +507 -0
  152. package/src/scripts/ClientScriptPlugin.ts +251 -0
  153. package/src/scripts/scriptUtils.ts +81 -0
  154. package/src/uxf/ExperiencePlugin.ts +64 -0
  155. package/src/uxf/RoutesPlugin.ts +215 -0
  156. package/src/uxf/UxfFormulaParser/cleanUxValue.ts +73 -0
  157. package/src/uxf/UxfFormulaParser/grammerParser/api.js +166 -0
  158. package/src/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +606 -0
  159. package/src/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
  160. package/src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +65 -0
  161. package/src/uxf/UxfFormulaParser/index.ts +4 -0
  162. package/src/uxf/UxfFormulaParser/parser.ts +64 -0
  163. package/src/uxf/UxfFormulaParser/utils/getErrorMsg.ts +13 -0
  164. package/src/uxf/constants.ts +4 -0
  165. package/src/uxf/index.ts +2 -0
  166. package/src/uxf/tectonicIdGenerator.ts +81 -0
@@ -0,0 +1,606 @@
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
+ }