@xano/developer-mcp 1.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 (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +261 -0
  3. package/api_docs/addon.md +193 -0
  4. package/api_docs/agent.md +154 -0
  5. package/api_docs/api_group.md +236 -0
  6. package/api_docs/authentication.md +68 -0
  7. package/api_docs/file.md +190 -0
  8. package/api_docs/function.md +217 -0
  9. package/api_docs/history.md +263 -0
  10. package/api_docs/index.md +104 -0
  11. package/api_docs/mcp_server.md +139 -0
  12. package/api_docs/middleware.md +205 -0
  13. package/api_docs/realtime.md +153 -0
  14. package/api_docs/table.md +151 -0
  15. package/api_docs/task.md +191 -0
  16. package/api_docs/tool.md +216 -0
  17. package/api_docs/triggers.md +344 -0
  18. package/api_docs/workspace.md +246 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +495 -0
  21. package/package.json +49 -0
  22. package/xanoscript_docs/README.md +1 -0
  23. package/xanoscript_docs/api_query_examples.md +1255 -0
  24. package/xanoscript_docs/api_query_guideline.md +129 -0
  25. package/xanoscript_docs/build_from_lovable.md +715 -0
  26. package/xanoscript_docs/db_query_guideline.md +427 -0
  27. package/xanoscript_docs/ephemeral_environment_guideline.md +529 -0
  28. package/xanoscript_docs/expression_guideline.md +1086 -0
  29. package/xanoscript_docs/frontend_guideline.md +67 -0
  30. package/xanoscript_docs/function_examples.md +1406 -0
  31. package/xanoscript_docs/function_guideline.md +130 -0
  32. package/xanoscript_docs/functions.md +2155 -0
  33. package/xanoscript_docs/input_guideline.md +227 -0
  34. package/xanoscript_docs/mcp_server_examples.md +36 -0
  35. package/xanoscript_docs/mcp_server_guideline.md +69 -0
  36. package/xanoscript_docs/query_filter.md +489 -0
  37. package/xanoscript_docs/table_examples.md +586 -0
  38. package/xanoscript_docs/table_guideline.md +137 -0
  39. package/xanoscript_docs/task_examples.md +511 -0
  40. package/xanoscript_docs/task_guideline.md +103 -0
  41. package/xanoscript_docs/tips_and_tricks.md +144 -0
  42. package/xanoscript_docs/tool_examples.md +69 -0
  43. package/xanoscript_docs/tool_guideline.md +139 -0
  44. package/xanoscript_docs/unit_testing_guideline.md +328 -0
  45. package/xanoscript_docs/version.json +3 -0
  46. package/xanoscript_docs/workspace.md +17 -0
@@ -0,0 +1,1086 @@
1
+ # XanoScript Expression Guidelines
2
+
3
+ This document provides a complete reference for all XanoScript expressions. Each entry includes a description, usage example, and expected result.
4
+
5
+ These expressions can be combined using the pipe `|` operator to create powerful data transformations.
6
+
7
+ ```xs
8
+ var $foo {
9
+ value = (10|add:5)|mul:2 # Result: 30
10
+ }
11
+ ```
12
+
13
+ or applied on returned values
14
+
15
+ ```xs
16
+ db.query "users" {
17
+ ...
18
+ } as $username|first|get:"name"|to_upper
19
+ ```
20
+
21
+ ## Comparison
22
+
23
+ Comparison operators are used to compare two values. The result of a comparison is a boolean value, either `true` or `false`.
24
+
25
+ - **Example**: `$a == $b` → `true` if `$a` is equal to `$b`, `false` otherwise.
26
+ - **Example**: `$a != $b` → `true` if `$a` is not equal to `$b`, `false` otherwise.
27
+ - **Example**: `$a > $b` → `true` if `$a` is greater than `$b`, `false` otherwise.
28
+ - **Example**: `$a < $b` → `true` if `$a` is less than `$b`, `false` otherwise.
29
+ - **Example**: `$a >= $b` → `true` if `$a` is greater than or equal to `$b`, `false` otherwise.
30
+ - **Example**: `$a <= $b` → `true` if `$a` is less than or equal to `$b`, `false` otherwise.
31
+
32
+ ```xs
33
+ var $is_equal {
34
+ value = $input.a == $input.b
35
+ }
36
+ ```
37
+
38
+ Comparison operators can be combined with additional expressions for more complex logic. When combining expressions, use parentheses to ensure the correct order of operations so filters are applied as intended.
39
+
40
+ ```xs
41
+ var $is_greater {
42
+ value = ($input.a|floor) > ($input.b|rad2deg|ceil)
43
+ }
44
+ ```
45
+
46
+ Expressions can also be used in conditionals
47
+
48
+ ```xs
49
+ conditional {
50
+ if ($input.status == "active" && $input.age > 18) {
51
+ debug.log { value = "Active adult" }
52
+ } elseif ($input.status == "active" && $input.age <= 18) {
53
+ debug.log { value = "Active minor" }
54
+ } elseif ($input.status == "inactive" && $input.age > 18) {
55
+ debug.log { value = "Inactive adult" }
56
+ } else {
57
+ debug.log { value = "Inactive minor" }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ## Math Expressions
63
+
64
+ - **deg2rad**
65
+ Convert degrees to radians.
66
+ Example: `180|deg2rad`
67
+ Result: `3.141592...`
68
+
69
+ - **rad2deg**
70
+ Convert radians to degrees.
71
+ Example: `3.141592|rad2deg`
72
+ Result: `180`
73
+
74
+ - **number_format**
75
+ Format a number with decimal and thousands separators.
76
+ Example: `31253212.141592|number_format:2:.:,`
77
+ Result: `"31,253,212.14"`
78
+
79
+ - **sin**
80
+ Calculates the sine of the supplied value in radians.
81
+ Example: `3.14159|sin`
82
+ Result: `0`
83
+
84
+ - **asin**
85
+ Calculates the arc sine of the supplied value in radians.
86
+ Example: `1|asin`
87
+ Result: `1.57079...`
88
+
89
+ - **asinh**
90
+ Calculates the inverse hyperbolic sine of the supplied value in radians.
91
+ Example: `1|asinh`
92
+ Result: `0.88137...`
93
+
94
+ - **cos**
95
+ Calculates the cosine of the supplied value in radians.
96
+ Example: `1|cos`
97
+ Result: `0.54030...`
98
+
99
+ - **acos**
100
+ Calculates the arc cosine of the supplied value in radians.
101
+ Example: `1|acos`
102
+ Result: `0`
103
+
104
+ - **acosh**
105
+ Calculates the inverse hyperbolic cosine of the supplied value in radians.
106
+ Example: `11.592|acosh`
107
+ Result: `3.14159...`
108
+
109
+ - **tan**
110
+ Calculates the tangent of the supplied value in radians.
111
+ Example: `0.785398|tan`
112
+ Result: `1`
113
+
114
+ - **atan**
115
+ Calculates the arc tangent of the supplied value in radians.
116
+ Example: `1|atan`
117
+ Result: `0.78539...`
118
+
119
+ - **atanh**
120
+ Calculates the inverse hyperbolic tangent of the supplied value in radians.
121
+ Example: `0.6666|atanh`
122
+ Result: `0.80470...`
123
+
124
+ - **floor**
125
+ Round a decimal down to its integer equivalent.
126
+ Example: `2.5|floor`
127
+ Result: `2`
128
+
129
+ - **ceil**
130
+ Round a decimal up to its integer equivalent.
131
+ Example: `2.5|ceil`
132
+ Result: `3`
133
+
134
+ - **round**
135
+ Round a decimal with optional precision.
136
+ Example: `2.5432|round:1`
137
+ Result: `3`
138
+
139
+ - **abs**
140
+ Returns the absolute value.
141
+ Example: `-10|abs`
142
+ Result: `10`
143
+
144
+ - **sqrt**
145
+ Returns the square root of the value.
146
+ Example: `9|sqrt`
147
+ Result: `3`
148
+
149
+ - **exp**
150
+ Returns the exponent of mathematical expression "e".
151
+ Example: `0|exp`
152
+ Result: `1`
153
+
154
+ - **log**
155
+ Returns the logarithm with a custom base.
156
+ Example: `2|log:2`
157
+ Result: `1`
158
+
159
+ - **log10**
160
+ Returns the Base-10 logarithm.
161
+ Example: `100|log10`
162
+ Result: `2`
163
+
164
+ - **ln**
165
+ Returns the natural logarithm.
166
+ Example: `10|ln`
167
+ Result: `2.30258...`
168
+
169
+ - **pow**
170
+ Returns the value raised to the power of exp.
171
+ Example: `10|pow:2`
172
+ Result: `100`
173
+
174
+ - **min**
175
+ Returns the min of the values of the array.
176
+ Example: `[1,2,3]|array_min`
177
+ Result: `1`
178
+
179
+ - **max**
180
+ Returns the max of the values of the array.
181
+ Example: `[1,2,3]|max`
182
+ Result: `3`
183
+
184
+ - **min**
185
+ Returns the min both values.
186
+ Example: `1|min:0`
187
+ Result: `0`
188
+
189
+ - **max**
190
+ Returns the max both values.
191
+ Example: `5|max:20`
192
+ Result: `20`
193
+
194
+ - **sum**
195
+ Returns the sum of the values of the array.
196
+ Example: `[1,2,3,4]|sum`
197
+ Result: `10`
198
+
199
+ - **avg**
200
+ Returns the average of the values of the array.
201
+ Example: `[1,2,3,4]|avg`
202
+ Result: `2.5`
203
+
204
+ - **product**
205
+ Returns the product of the values of the array.
206
+ Example: `[1,2,3,4]|product`
207
+ Result: `24`
208
+
209
+ - **add**
210
+ Add 2 values together and return the answer.
211
+ Example: `2|add:3`
212
+ Result: `5`
213
+
214
+ - **subtract**
215
+ Subtract 2 values together and return the answer.
216
+ Example: `2|subtract:3`
217
+ Result: `-1`
218
+
219
+ - **multiply**
220
+ Multiply 2 values together and return the answer.
221
+ Example: `2|multiply:3`
222
+ Result: `6`
223
+
224
+ - **modulus**
225
+ Modulus 2 values together and return the answer.
226
+ Example: `20|modulus:3`
227
+ Result: `2`
228
+
229
+ - **divide**
230
+ Divide 2 values together and return the answer.
231
+ Example: `20|divide:4`
232
+ Result: `5`
233
+
234
+ - **bitwise_and**
235
+ Bitwise AND 2 values together and return the answer.
236
+ Example: `7|bitwise_and:3`
237
+ Result: `3`
238
+
239
+ - **bitwise_or**
240
+ Bitwise OR 2 values together and return the answer.
241
+ Example: `7|bitwise_or:9`
242
+ Result: `15`
243
+
244
+ - **bitwise_xor**
245
+ Bitwise XOR 2 values together and return the answer.
246
+ Example: `7|bitwise_xor:9`
247
+ Result: `14`
248
+
249
+ ## Array Expressions
250
+
251
+ - **first**
252
+ Get the first entry of an array.
253
+ Example: `["five","six","seven"]|first`
254
+ Result: `"five"`
255
+
256
+ - **last**
257
+ Get the last entry of an array.
258
+ Example: `["five","six","seven"]|last`
259
+ Result: `"seven"`
260
+
261
+ - **count**
262
+ Return the number of items in an object/array.
263
+ Example: `["five","six","seven"]|count`
264
+ Result: `3`
265
+
266
+ - **range**
267
+ Returns array of values between the specified start/stop.
268
+ Example: `|range:10:15`
269
+ Result: `[10,11,12,13,14,15]`
270
+
271
+ - **reverse**
272
+ Returns values of an array in reverse order.
273
+ Example: `[12,13,14,15]|reverse`
274
+ Result: `[15,14,13,12]`
275
+
276
+ - **unique**
277
+ Returns unique values of an array.
278
+ Example: `[12,13,13,12,11]|unique`
279
+ Result: `[12,13,11]`
280
+
281
+ - **safe_array**
282
+ Always returns an array. Uses the existing value if it is an array or creates an array of one element.
283
+ Example: `12|safe_array`
284
+ Result: `[12]`
285
+
286
+ - **flatten**
287
+ Flattens a multidimensional array into a single level array of values.
288
+ Example: `[1,[2,3],[[4,5]]]|flatten`
289
+ Result: `[1,2,3,4,5]`
290
+
291
+ - **filter_empty**
292
+ Returns a new array with only entries that are not empty ("", null, 0, "0", false, [], {}).
293
+ Example: `[{a:1, b:null}, {a:0, b:4}]|filter_empty:a`
294
+ Result: `[{a:1, b:null}]`
295
+
296
+ - **sort**
297
+ Sort an array of elements with an optional path inside the element.
298
+ Example: `[{v:"a", e:20}, {v:"z", e:10}]|sort:v:text:true`
299
+ Result: `[{v:"z", e:10}, {v:"a", e:20}]`
300
+
301
+ - **shuffle**
302
+ Shuffles the order of the entries in the array.
303
+ Example: `[1,2,3,4]|shuffle`
304
+ Result: `[3,2,4,1]`
305
+
306
+ - **diff**
307
+ Return the entries from the first array that are not in the second array. Only values are used for matching.
308
+ Example: `[1,2,3,4]|diff:[3,2]`
309
+ Result: `[1,4]`
310
+
311
+ - **diff_assoc**
312
+ Return the entries from the first array that are not in the second array. Values and keys are used for matching.
313
+ Example: `[{"a": "green"},{"b": "brown"},{"c":"blue"},"red"]|diff_assoc:[{"a":"green"}, "yellow", "red"]`
314
+ Result: `[{a: "green",b: "brown", "red"]`
315
+
316
+ - **intersect**
317
+ Return the entries from the first array that are also present in the second array. Only values are used for matching.
318
+ Example: `[1,2,3,4]|intersect:[3,2]`
319
+ Result: `[2,3]`
320
+
321
+ - **intersect_assoc**
322
+ Return the entries from the first array that are also present in the second array. Values and keys are used for matching.
323
+ Example: `[{"a": "green"},{"b": "brown"},{"c":"blue"},"red"]|intersect_assoc:[{"a":"green"},{"b":"yellow"},"blue","red"]`
324
+ Result: `[{a: "green",b: "brown", "red"]`
325
+
326
+ - **merge**
327
+ Merge the first level of elements of both arrays together and return the new array.
328
+ Example: `[1,2,3]|merge:["a","b","c"]`
329
+ Result: `[1,2,3,"a","b","c"]`
330
+
331
+ - **merge_recursive**
332
+ Merge the elements from all levels of both arrays together and return the new array.
333
+ Example: `{color:{favorite: ["red"]}}|merge_recursive:{color: {favorite: ["green","blue"]}}`
334
+ Result: `{"color":{"favorite": ["red","green","blue"]}}`
335
+
336
+ - **index_by**
337
+ Create a new array indexed off of the value of each item's path.
338
+ Example: `[{id:1,g:"x"},{id:2,g:"y"},{id:3,g:"x"}]|index_by:g`
339
+ Result: `{"x": [{"id":1,"g":"x"},{"id":3,"g":"x"}], "y": [{"id":2,"g":"y"}]}`
340
+
341
+ - **push**
342
+ Push an element on to the end of an array and return the new array.
343
+ Example: `[1,2,3]|push:"a"`
344
+ Result: `[1,2,3,"a"]`
345
+
346
+ - **pop**
347
+ Pops the last element of the array off and returns it.
348
+ Example: `[1,2,3]|pop`
349
+ Result: `3`
350
+
351
+ - **unshift**
352
+ Push an element to the beginning of an array and return the new array.
353
+ Example: `[1,2,3]|unshift:0`
354
+ Result: `[0,1,2,3]`
355
+
356
+ - **shift**
357
+ Shifts the first element of the array off and returns it.
358
+ Example: `[1,2,3]|shift`
359
+ Result: `1`
360
+
361
+ - **remove**
362
+ Remove any elements from the array that match the supplied value and then return the new array.
363
+ Example: `[{v:1},{v:2},{v:3}]|remove:{v:2}`
364
+ Result: `[{v:1},{v:3}]`
365
+
366
+ - **append**
367
+ Push an element on to the end of an array within an object and return the updated object.
368
+ Example: `[1,2,3]|append:4`
369
+ Result: `[1,2,3,4]`
370
+
371
+ - **prepend**
372
+ Push an element on to the beginning of an array within an object and return the updated object.
373
+ Example: `[1,2,3]|prepend:0`
374
+ Result: `[0,1,2,3]`
375
+
376
+ - **slice**
377
+ Extract a section from an array.
378
+ Example: `[1,2,3,4,5]|slice:2:2`
379
+ Result: `[3,4]`
380
+
381
+ - **map**
382
+ Creates a new array with the results of calling a provided function on every element in the calling array.
383
+ Example: `[{value: 2}, {value: 5}]|map:$$.value*2`
384
+ Result: `double each value => [4,10]`
385
+
386
+ - **filter**
387
+ Filters the elements of an array based on the code block returning true to keep the element or false to skip it.
388
+ Example: `[{value: 2}, {value: 5}]|filter:$$.value%2==0`
389
+ Result: `only even values => [{value:2}]`
390
+
391
+ - **some**
392
+ Checks if at least one element in the array passes the test implemented by the provided function.
393
+ Example: `[{value: 2}, {value: 5}]|some:$$.value%2==0`
394
+ Result: `at least one value is even => true`
395
+
396
+ - **every**
397
+ Checks if all elements in the array pass the test implemented by the provided function.
398
+ Example: `[{value: 2}, {value: 6}]|every:$$.value%2==0`
399
+ Result: `all values are even => true`
400
+
401
+ - **find**
402
+ Finds if all elements in the array pass the test implemented by the provided function.
403
+ Example: `[{id: 1}, {id: 2}, {id: 3}]|find:$$.id==2`
404
+ Result: `returns {id:2}`
405
+
406
+ - **findIndex**
407
+ Finds the index of the first element in the array that passes the test implemented by the provided function.
408
+ Example: `[{id: 1}, {id: 2}, {id: 3}]|findIndex:$$.id==2`
409
+ Result: `returns 1`
410
+
411
+ - **reduce**
412
+ Reduces the array to a single value using the code block to combine each element of the array.
413
+ Example: `[1,2,3,4,5]|reduce:$$+$result:10`
414
+ Result: `returns 25`
415
+
416
+ - **pick**
417
+ Pick keys from the object to create a new object of just those keys.
418
+ Example: `{a:1,b:2,c:3}|pick:[a,c]`
419
+ Result: `returns {a:1,c:3}`
420
+
421
+ - **unpick**
422
+ Remove keys from the object to create a new object of the remaining keys.
423
+ Example: `{a:1,b:2,c:3}|unpick:[a,c]`
424
+ Result: `returns {b:2}`
425
+
426
+ ## String/Text Expressions
427
+
428
+ - **addslashes**
429
+ Adds a backslash to the following characters: single quote, double quote, backslash, and null character.
430
+ Example: `'he said "Hi!"'|addslashes`
431
+ Result: `"he said \\"Hi!\\""`
432
+
433
+ - **escape**
434
+ Converts special characters into their escaped variants. Ex: \t for tabs and \n for newlines.
435
+ Example: `'he said\n- "Hi!"'|escape`
436
+ Result: `"he said \\n-\\\"Hi!\\\""`
437
+
438
+ - **list_encodings**
439
+ List support character encodings.
440
+ Example: `|list_encodings`
441
+ Result: `["UTF-8", "ISO-8859-1", ...]`
442
+
443
+ - **detect_encoding**
444
+ Detect the character encoding of the supplied text.
445
+ Example: `"étude"|detect_encoding`
446
+ Result: `UTF-8`
447
+
448
+ - **to_utf8**
449
+ Convert the supplied text from its binary form (ISO-8859-1) to UTF-8.
450
+ Example: `"�tudes"|to_utf8`
451
+ Result: `"études"`
452
+
453
+ - **from_utf8**
454
+ Convert the supplied text from UTF-8 to its binary form (ISO-8859-1).
455
+ Example: `"études"|from_utf8`
456
+ Result: `"�tudes"`
457
+
458
+ - **convert_encoding**
459
+ Convert the character encoding of the supplied text.
460
+ Example: `"études"|convert_encoding:"ISO-8859-1":"UTF-8"`
461
+ Result: `"�tudes"`
462
+
463
+ - **to_lower**
464
+ Converts all characters to lower case and returns the result.
465
+ Example: `"Epic Battle"|to_lower`
466
+ Result: `"epic battle"`
467
+
468
+ - **to_upper**
469
+ Converts all characters to upper case and returns the result.
470
+ Example: `"Epic Battle"|to_upper`
471
+ Result: `"EPIC BATTLE"`
472
+
473
+ - **trim**
474
+ Trim whitespace or other characters from both sides and return the result.
475
+ Example: `" Epic Battle "|trim`
476
+ Result: `"Epic Battle"`
477
+
478
+ - **ltrim**
479
+ Trim whitespace or other characters from the left side and return the result.
480
+ Example: `" Epic Battle "|ltrim`
481
+ Result: `"Epic Battle "`
482
+
483
+ - **rtrim**
484
+ Trim whitespace or other characters from the right return the result.
485
+ Example: `" Epic Battle "|rtrim`
486
+ Result: `" Epic Battle"`
487
+
488
+ - **capitalize**
489
+ Converts the first letter of each word to a capital letter.
490
+ Example: `"epic battle"|capitalize`
491
+ Result: `"Epic Battle"`
492
+
493
+ - **substr**
494
+ Extracts a section of text.
495
+ Example: `"Epic Battle"|substr:5:6`
496
+ Result: `"Battle"`
497
+
498
+ - **split**
499
+ Splits text into an array of text and returns the result.
500
+ Example: `"Epic Battle"|split:" "`
501
+ Result: `["Epic","Battle"]`
502
+
503
+ - **join**
504
+ Joins an array into a text string via the separator and returns the result.
505
+ Example: `["Epic","Battle"]|join:" "`
506
+ Result: `"Epic Battle"`
507
+
508
+ - **array_slice**
509
+ Extract a section from an array.
510
+ Example: `[1,2,3,4,5]|array_slice:2:2`
511
+ Result: `[3,4]`
512
+
513
+ - **strlen**
514
+ Returns the number of characters.
515
+ Example: `"Epic Battle"|strlen`
516
+ Result: `11`
517
+
518
+ - **strip_html**
519
+ Removes HTML tags from a string.
520
+ Example: `"<p>Epic Battle</p>"|strip_html`
521
+ Result: `"Epic Battle"`
522
+
523
+ - **unaccent**
524
+ Removes accents from characters.
525
+ Example: `"études"|unaccent`
526
+ Result: `"etudes"`
527
+
528
+ - **index**
529
+ Returns the index of the case-sensitive expression or false if it can't be found.
530
+ Example: `"Epic Battle"|index:"Battle"`
531
+ Result: `5`
532
+
533
+ - **iindex**
534
+ Returns the index of the case-insensitive expression or false if it can't be found.
535
+ Example: `"Epic Battle"|iindex:"battle"`
536
+ Result: `5`
537
+
538
+ - **starts_with**
539
+ Returns whether or not the expression is present at the beginning.
540
+ Example: `"Epic Battle"|starts_with:"Epic"`
541
+ Result: `true`
542
+
543
+ - **istarts_with**
544
+ Returns whether or not the case-insensitive expression is present at the beginning.
545
+ Example: `"Epic Battle"|istarts_with:"epic"`
546
+ Result: `true`
547
+
548
+ - **ends_with**
549
+ Returns whether or not the expression is present at the end.
550
+ Example: `"Epic Battle"|ends_with:"Battle"`
551
+ Result: `true`
552
+
553
+ - **iends_with**
554
+ Returns whether or not the case-insensitive expression is present at the end.
555
+ Example: `"Epic Battle"|iends_with:"battle"`
556
+ Result: `true`
557
+
558
+ - **contains**
559
+ Returns whether or not the expression is found.
560
+ Example: `"Epic Battle"|contains:"Battle"`
561
+ Result: `true`
562
+
563
+ - **icontains**
564
+ Returns whether or not the case-insensitive expression is found.
565
+ Example: `"Epic Battle"|icontains:"battle"`
566
+ Result: `true`
567
+
568
+ - **concat**
569
+ Concatenates two values together.
570
+ Example: `"Hello" | concat:"World!":" - "`
571
+ Result: `"Hello - World!"`
572
+
573
+ - **sprintf**
574
+ Formats text with variable substitution.
575
+ Example: `"Hello %s, you have %d new messages"|sprintf:"Bob":5`
576
+ Result: `"Hello Bob, you have 5 new messages"`
577
+
578
+ - **replace**
579
+ Replace all occurrences of a text phrase with another.
580
+ Example: `"Hella World"|replace:"o":"a"`
581
+ Result: `"Hella Warld"`
582
+
583
+ - **regex_matches**
584
+ Tests if a regular expression matches the supplied subject text.
585
+ Example: `"/^a.*c$/"|regex_matches:"abbbbc"`
586
+ Result: `true`
587
+
588
+ - **regex_get_first_match**
589
+ Return the first set of matches performed by a regular expression on the supplied subject text.
590
+ Example: `"/(\\w+)@(\\w+).(\\w+)/"|regex_get_first_match:"test@example.com"`
591
+ Result: `["test@example.com","test","example","com"]`
592
+
593
+ - **regex_get_all_matches**
594
+ Return all matches performed by a regular expression on the supplied subject text.
595
+ Example: `"/\\b\\w+@\\w+.\\w+\\b/"|regex_get_all_matches:"test@example.com"`
596
+ Result: `[["test@example.com"]]`
597
+
598
+ - **regex_quote**
599
+ Update the supplied text value to be properly escaped for regular expressions.
600
+ Example: `"Hello. How are you?"|regex_quote:"/"`
601
+ Result: `"Hello\\. How are you\\?"`
602
+
603
+ - **regex_replace**
604
+ Perform a regular expression search and replace on the supplied subject text.
605
+ Example: `"/\\s+/"|regex_replace:"-":"Hello World"`
606
+ Result: `"Hello-World"`
607
+
608
+ ## Object/Manipulation Expressions
609
+
610
+ - **set**
611
+ Sets a value at the path within the object and returns the updated object.
612
+ Example: `{"fizz":"buzz"}|set:"foo":"bar"`
613
+ Result: `{"fizz": "buzz","foo":"bar"}`
614
+
615
+ - **set_conditional**
616
+ Sets a value at the path within the object and returns the updated object, if the conditional expression is true.
617
+ Example: `{'fizz':'buzz'}|set_conditional:'foo':'bar':2==1+1`
618
+ Result: `{'fizz':'buzz','foo':'bar'}`
619
+
620
+ - **set_ifnotempty**
621
+ Sets a value (if it is not empty: "", null, 0, "0", false, [], {}) at the path within the object and returns the updated object.
622
+ Example: `{'fizz':'buzz'}|set_ifnotempty:'foo':'bar'`
623
+ Result: `{'fizz':'buzz','foo':'bar'}`
624
+
625
+ - **set_ifnotnull**
626
+ Sets a value (if it is not null) at the path within the object and returns the updated object.
627
+ Example: `{'fizz':'buzz'}|set_ifnotnull:'foo':'bar'`
628
+ Result: `{'fizz':'buzz','foo':'bar'}`
629
+
630
+ - **first_notnull**
631
+ Returns the first value that is not null.
632
+ Example: `null|first_notnull:0`
633
+ Result: `0`
634
+
635
+ - **first_notempty**
636
+ Returns the first value that is not empty - i.e. not ("", null, 0, "0", false, [], {}).
637
+ Example: `""|first_notempty:1`
638
+ Result: `1`
639
+
640
+ - **unset**
641
+ Removes a value at the path within the object and returns the updated object.
642
+ Example: `{'fizz':'buzz','foo':'bar'}|unset:'foo'`
643
+ Result: `{'fizz':'buzz'}`
644
+
645
+ - **transform**
646
+ Processes an expression with local data bound to the $this variable.
647
+ Example: `2|transform:$$+3"`
648
+ Result:`5`
649
+
650
+ - **get**
651
+ Returns the value of an object at the specified path.
652
+ Example: `{'fizz':'buzz'}|get:'fizz'`
653
+ Result: `"buzz"`
654
+
655
+ - **has**
656
+ Returns the existence of whether or not something is present in the object at the specified path.
657
+ Example: `{'fizz':'buzz'}|has:'fizz'`
658
+ Result: `true`
659
+
660
+ - **fill**
661
+ Create an array of a certain size with a default value.
662
+ Example: `"v"|fill:0:6`
663
+ Result: `["v","v","v","v","v","v"]`
664
+
665
+ - **fill_keys**
666
+ Create an array of keys with a default value.
667
+ Example: `key|fill_keys:["a","b","c"]`
668
+ Result: `{"a":"key","b":"key","c":"key"}`
669
+
670
+ - **keys**
671
+ Get the property keys of an object/array as a numerically indexed array.
672
+ Example: `{"a":1,"b":2,"c":3}|keys`
673
+ Result: `["a","b","c"]`
674
+
675
+ - **values**
676
+ Get the property values of an object/array as a numerically indexed array.
677
+ Example: `{"a":1,"b":2,"c":3}|values`
678
+ Result: `[1,2,3]`
679
+
680
+ - **entries**
681
+ Get the property entries of an object/array as a numerically indexed array of key/value pairs.
682
+ Example: `{"a":1,"b":2,"c":3}|entries`
683
+ Result: `[{key:"a",value:1},{key:"b",value:2},{key:"c",value:3}]`
684
+
685
+ - **create_object**
686
+ Creates an object based on a list of keys and a list of values.
687
+ Example: `["a","b","c"]|create_object:[1,2,3]`
688
+ Result: `{"a":1,"b":2,"c":3}`
689
+
690
+ - **create_object_from_entries**
691
+ Creates an object based on an array of key/value pairs. (i.e. same result as the entries filter).
692
+ Example: `[{key:"a",value:1},{key:"b",value:2},{key:"c",value:3}]|create_object_from_entries`
693
+ Result: `{"a":1,"b":2,"c":3}`
694
+
695
+ ## Date/Time/Timestamp Expressions
696
+
697
+ - **to_timestamp**
698
+ Converts a text expression (now, next friday, Jan 1 2000) to timestamp compatible format.
699
+ Example: `"next friday"|to_timestamp:"America/Los_Angeles"`
700
+ Result: `1758265200000`
701
+
702
+ - **to_ms**
703
+ Converts a text expression (now, next friday, Jan 1 2000) to the number of milliseconds since the unix epoch.
704
+ Example: `"next friday"|to_ms:"America/Los_Angeles"`
705
+ Result: `1758265200000`
706
+
707
+ - **to_seconds**
708
+ Converts a text expression (now, next friday, Jan 1 2000) to the number of seconds since the unix epoch.
709
+ Example: `"next friday"|to_seconds:"America/Los_Angeles"`
710
+ Result: `1758265200`
711
+
712
+ - **to_minutes**
713
+ Converts a text expression (now, next friday, Jan 1 2000) to the number of minutes since the unix epoch.
714
+ Example: `"next friday"|to_minutes:"America/Los_Angeles"`
715
+ Result: `29304420`
716
+
717
+ - **to_hours**
718
+ Converts a text expression (now, next friday, Jan 1 2000) to the number of hours since the unix epoch.
719
+ Example: `"next friday"|to_hours:"America/Los_Angeles"`
720
+ Result: `488407`
721
+
722
+ - **to_days**
723
+ Converts a text expression (now, next friday, Jan 1 2000) to the number of days since the unix epoch.
724
+ Example: `"next friday"|to_days:"America/Los_Angeles"`
725
+ Result: `20350`
726
+
727
+ - **parse_timestamp**
728
+ Parse a timestamp from a flexible format.
729
+ Example: `"2023-08-15 13:45:30"|parse_timestamp:"Y-m-d H:i:s":"America/Los_Angeles"`
730
+ Result: `"1692132330000"`
731
+
732
+ - **format_timestamp**
733
+ Converts a timestamp into a human readable formatted date based on the supplied format.
734
+ Example: `"1692132330000"|format_timestamp:"Y-m-d H:i:s":"America/New_York"`
735
+ Result: `"2023-08-15 16:45:30"`
736
+
737
+ - **transform_timestamp**
738
+ Takes a timestamp and applies a relative transformation to it. Ex. -7 days, last Monday, first day of this month.
739
+ Example: `"2023-08-15T20:45:30.000Z"|transform_timestamp:"-7 days":"America/Los_Angeles"`
740
+ Result: `"1691527530000"`
741
+
742
+ - **add_secs_to_timestamp**
743
+ Add seconds to a timestamp. (negative values are ok)
744
+ Example: `1691527530000|add_secs_to_timestamp:60`
745
+ Result: `1691527590000`
746
+
747
+ - **add_ms_to_timestamp**
748
+ Add milliseconds to a timestamp. (negative values are ok)
749
+ Example: `monday|add_ms_to_timestamp:500`
750
+ Result: `1758499200500`
751
+
752
+ ## Comparison/Logical Expressions
753
+
754
+ - **equals**
755
+ Returns a boolean if both values are equal.
756
+ Example: `4|equals:4`
757
+ Result: `true`
758
+
759
+ - **not_equals**
760
+ Returns a boolean if both values are not equal.
761
+ Example: `4|not_equals:4`
762
+ Result: `false`
763
+
764
+ - **greater_than**
765
+ Returns a boolean if the left value is greater than the right value.
766
+ Example: `4|greater_than:2`
767
+ Result: `true`
768
+
769
+ - **greater_than_or_equal**
770
+ Returns a boolean if the left value is greater than or equal to the right value.
771
+ Example: `4|greater_than_or_equal:2`
772
+ Result: `true`
773
+
774
+ - **less_than**
775
+ Returns a boolean if the left value is less than the right value.
776
+ Example: `4|less_than:2`
777
+ Result: `false`
778
+
779
+ - **less_than_or_equal**
780
+ Returns a boolean if the left value is less than or equal to the right value.
781
+ Example: `4|less_than_or_equal:2`
782
+ Result: `false`
783
+
784
+ - **odd**
785
+ Returns whether or not the value is odd.
786
+ Example: `4|odd`
787
+ Result: `false`
788
+
789
+ - **even**
790
+ Returns whether or not the value is even.
791
+ Example: `4|even`
792
+ Result: `true`
793
+
794
+ - **in**
795
+ Returns whether or not the value is in the array.
796
+ Example: `[1,2,3]|in:3`
797
+ Result: `true`
798
+
799
+ - **not**
800
+ Returns the opposite of the existing value evaluated as a boolean.
801
+ Example: `true|not`
802
+ Result: `false`
803
+
804
+ - **bitwise_not**
805
+ Returns the existing value with its bits flipped.
806
+ Example: `8|bitwise_not`
807
+ Result: `-9`
808
+
809
+ - **is_null**
810
+ Returns whether or not the value is null.
811
+ Example: `8|is_null`
812
+ Result: `false`
813
+
814
+ - **is_empty**
815
+ Returns whether or not the value is empty ("", null, 0, "0", false, [], {}).
816
+ Example: `[]|is_empty`
817
+ Result: `true`
818
+
819
+ - **is_object**
820
+ Returns whether or not the value is an object.
821
+ Example: `{id:2, value:3, size:4}|is_object`
822
+ Result: `true`
823
+
824
+ - **is_array**
825
+ Returns whether or not the value is a numerical indexed array.
826
+ Example: `[1,2,3]|is_array`
827
+ Result: `true`
828
+
829
+ - **is_int**
830
+ Returns whether or not the value is an integer.
831
+ Example: `123|is_int`
832
+ Result: `true`
833
+
834
+ - **is_decimal**
835
+ Returns whether or not the value is a decimal value.
836
+ Example: `123.45|is_decimal`
837
+ Result: `true`
838
+
839
+ - **is_bool**
840
+ Returns whether or not the value is a boolean.
841
+ Example: `false|is_bool`
842
+ Result: `true`
843
+
844
+ - **is_text**
845
+ Returns whether or not the value is text.
846
+ Example: `"213"|is_text`
847
+ Result: `true`
848
+
849
+ ## Security/Crypto Expressions
850
+
851
+ - **encrypt**
852
+ Encrypts the value and returns the result in raw binary form.
853
+ Example: `"hello"|encrypt:"aes-192-cbc":"1494AX6XJUsDe51kF9S9sA==":"27222b6032574bad"`
854
+ Result: `"���Z �r|5���~�l"`
855
+
856
+ - **decrypt**
857
+ Decrypts the value and returns the result.
858
+ Example: `"...encrypted..."|decrypt:"aes-192-cbc":"1494AX6XJUsDe51kF9S9sA==":"27222b6032574bad"`
859
+ Result: `"hello"`
860
+
861
+ - **jws_encode**
862
+ Encodes the value and returns the result as a JWS token.
863
+ Example: `"hello"|jws_encode:{sub: "1234567890",name: "John Doe",admin: true,iat: 1516239022}:"a-string-secret-at-least-256-bits-long":HS256`
864
+ Result: `"...encrypted..."`
865
+
866
+ - **jws_decode**
867
+ Decodes the JWS token and returns the result.
868
+ Example: `"eyJzd...ZYw"|jws_decode:{}:"a-string-secret-at-least-256-bits-long":HS256`
869
+ Result: `"hello"`
870
+
871
+ - **jwe_encode**
872
+ Encodes the value and returns the result as a JWE token.
873
+ Example: `"hello"|jwe_encode:{sub: "1234567890",name: "John Doe",admin: true,iat: 1516239022}:"a-string-secret-at-least-256-bits-long":"A256KW":"A256CBC-HS512"`
874
+ Result: `"...encrypted..."`
875
+
876
+ - **jwe_decode**
877
+ Decodes the JWE token and returns the result.
878
+ Example: `"eyJ...Xw"|jwe_decode:{}:"a-string-secret-at-least-256-bits-long":"A256KW":"A256CBC-HS512"`
879
+ Result: `"hello"`
880
+
881
+ - **secureid_encode**
882
+ Returns an encrypted version of the id.
883
+ Example: `12345|secureid_encode:"my_salt"`
884
+ Result: `"ZlV3Lg.-0-UZyQ9xQk"`
885
+
886
+ - **secureid_decode**
887
+ Returns the id of the original encode.
888
+ Example: `"ZlV3Lg.-0-UZyQ9xQk"|secureid_decode:"my_salt"`
889
+ Result: `12345`
890
+
891
+ - **md5**
892
+ Returns a MD5 signature representation of the value.
893
+ Example: `"some_message"|md5`
894
+ Result: `"af8a2aae147de3350f6c0f1a075ede5d"`
895
+
896
+ - **sha1**
897
+ Returns a SHA1 signature representation of the value.
898
+ Example: `"some_message"|sha1`
899
+ Result: `"33a374032... (truncated) ..."`
900
+
901
+ - **sha256**
902
+ Returns a SHA256 signature representation of the value.
903
+ Example: `"some_message"|sha256`
904
+ Result: `"6cc869f10009fa1... (truncated) ..."`
905
+
906
+ - **sha384**
907
+ Returns a SHA384 signature representation of the value.
908
+ Example: `"some_message"|sha384`
909
+ Result: `"17a7717060650457... (truncated) ..."`
910
+
911
+ - **sha512**
912
+ Returns a SHA512 signature representation of the value.
913
+ Example: `"some_message"|sha512`
914
+ Result: `"40aaa4e84e7d98e472d240f1c84298de... (truncated) ..."`
915
+
916
+ - **hmac_md5**
917
+ Returns a MD5 signature representation of the value using a shared secret via the HMAC method.
918
+ Example: `"some_message"|hmac_md5:MY_SECRET_KEY`
919
+ Result: `"c4c1007ea935001cc7734b360395fb1d"`
920
+
921
+ - **hmac_sha1**
922
+ Returns a SHA1 signature representation of the value using a shared secret via the HMAC method.
923
+ Example: `"some_message"|hmac_sha1:MY_SECRET_KEY`
924
+ Result: `"83b48df25eda2... (truncated) ..."`
925
+
926
+ - **hmac_sha256**
927
+ Returns a SHA256 signature representation of the value using a shared secret via the HMAC method.
928
+ Example: `"some_message"|hmac_sha256:MY_SECRET_KEY`
929
+ Result: `"3e18fc78d5326e5... (truncated) ..."`
930
+
931
+ - **hmac_sha384**
932
+ Returns a SHA384 signature representation of the value using a shared secret via the HMAC method.
933
+ Example: `"some_message"|hmac_sha384:MY_SECRET_KEY`
934
+ Result: `"60818f7b6e6... (truncated) ..."`
935
+
936
+ - **hmac_sha512**
937
+ Returns a SHA512 signature representation of the value using a shared secret via the HMAC method.
938
+ Example: `"some_message"|hmac_sha512:MY_SECRET_KEY`
939
+ Result: `"880c17f6d5fa9e1ea3b7... (truncated) ..."`
940
+
941
+ - **create_uid**
942
+ Returns a unique 64bit unsigned int value seeded off the value.
943
+ Example: `|create_uid`
944
+ Result: `14567891234567890`
945
+
946
+ - **uuid**
947
+ Returns a universally unique identifier.
948
+ Example: `|uuid`
949
+ Result: `"550e8400-e29b-41d4-a716-446655440000"`
950
+
951
+ ## Transform/Type Conversion Expressions
952
+
953
+ - **to_expr**
954
+ Converts text into an expression, processes it, and returns the result.
955
+ Example: `"(2 + 1) % 2"|to_expr`
956
+ Result: `1`
957
+
958
+ - **to_text**
959
+ Converts integer, decimal, or bool types to text and returns the result.
960
+ Example: `1.344|to_text`
961
+ Result: `"1.344"`
962
+
963
+ - **to_int**
964
+ Converts text, decimal, or bool types to an integer and returns the result.
965
+ Example: `"133.45 kg"|to_int`
966
+ Result: `133`
967
+
968
+ - **to_decimal**
969
+ Converts text, integer, or bool types to a decimal and returns the result.
970
+ Example: `"133.45 kg"|to_decimal`
971
+ Result: `133.45`
972
+
973
+ - **to_bool**
974
+ Converts text, integer, or decimal types to a bool and returns the result.
975
+ Example: `"true"|to_bool`
976
+ Result: `true`
977
+
978
+ - **json_decode**
979
+ Decodes the value represented as json and returns the result.
980
+ Example: `'{"a":1,"b":2,"c":3}'|json_decode`
981
+ Result: `{"a":1,"b":2,"c":3}`
982
+
983
+ - **json_encode**
984
+ Encodes the value and returns the result as json text.
985
+ Example: `{"a":1,"b":2,"c":3}|json_encode`
986
+ Result: `'{"a":1,"b":2,"c":3}'`
987
+
988
+ - **xml_decode**
989
+ Decodes XML and returns the result.
990
+ Example: `"<root><a>1</a><b>2</b><c>3</c></root>"|xml_decode`
991
+ Result: `{ "root": { "@attributes": [], "value": [ { "a": { "@attributes": [], "value": "1" } }, { "b": { "@attributes": [], "value": "2" } } ] } }`
992
+
993
+ - **yaml_decode**
994
+ Decodes the value represented as yaml and returns the result.
995
+ Example: `"a: 1\nb: 2\nc: 3"|yaml_decode`
996
+ Result: `{"a":1,"b":2,"c":3}`
997
+
998
+ - **yaml_encode**
999
+ Encodes the value and returns the result as yaml text.
1000
+ Example: `{"a":1,"b":2,"c":3}|yaml_encode`
1001
+ Result: `'a: 1\nb: 2\nc: 3\n'`
1002
+
1003
+ - **hex2bin**
1004
+ Converts a hex value into its binary equivalent.
1005
+ Example: `"68656c6c6f"|hex2bin`
1006
+ Result: `"hello"`
1007
+
1008
+ - **bin2hex**
1009
+ Converts a binary value into its hex equivalent.
1010
+ Example: `"hello"|bin2hex`
1011
+ Result: `"68656c6c6f"`
1012
+
1013
+ - **dechex**
1014
+ Converts a decimal value into its hex equivalent.
1015
+ Example: `"255"|dechex`
1016
+ Result: `"ff"`
1017
+
1018
+ - **hexdec**
1019
+ Converts a hex value into its decimal equivalent.
1020
+ Example: `"ff"|hexdec`
1021
+ Result: `"255"`
1022
+
1023
+ - **decbin**
1024
+ Converts a decimal value into its binary string (i.e. 01010) equivalent.
1025
+ Example: `"10"|decbin`
1026
+ Result: `"1010"`
1027
+
1028
+ - **bindec**
1029
+ Converts a binary string (i.e. 01010) into its decimal equivalent.
1030
+ Example: `"1010"|bindec`
1031
+ Result: `"10"`
1032
+
1033
+ - **decoct**
1034
+ Converts a decimal value into its octal equivalent.
1035
+ Example: `"10"|decoct`
1036
+ Result: `"12"`
1037
+
1038
+ - **octdec**
1039
+ Converts an octal value into its decimal equivalent.
1040
+ Example: `"12"|octdec`
1041
+ Result: `"10"`
1042
+
1043
+ - **base_convert**
1044
+ Converts a value between two bases.
1045
+ Example: `"ff"|base_convert:16:10`
1046
+ Result: `"255"`
1047
+
1048
+ - **base64_decode**
1049
+ Decodes the value represented as base64 text and returns the result.
1050
+ Example: `"aGVsbG8="|base64_decode`
1051
+ Result: `"hello"`
1052
+
1053
+ - **base64_encode**
1054
+ Encodes the value and returns the result as base64 text.
1055
+ Example: `"hello"|base64_encode`
1056
+ Result: `"aGVsbG8="`
1057
+
1058
+ - **base64_decode_urlsafe**
1059
+ Decodes the value represented as base64 urlsafe text and returns the result.
1060
+ Example: `"aGVsbG8_"|base64_decode_urlsafe`
1061
+ Result: `"hello?"`
1062
+
1063
+ - **base64_encode_urlsafe**
1064
+ Encodes the value and returns the result as base64 urlsafe text.
1065
+ Example: `"hello?"|base64_encode_urlsafe`
1066
+ Result: `"aGVsbG8_"`
1067
+
1068
+ - **url_decode**
1069
+ Decodes the value represented as a url encoded value.
1070
+ Example: `"Hello%2C%20World%21"|url_decode`
1071
+ Result: `"Hello, World!"`
1072
+
1073
+ - **url_decode_rfc3986**
1074
+ Decodes the value represented as a url encoded value using the RFC 3986 specification.
1075
+ Example: `"Hello%2C%20World%21"|url_decode_rfc3986`
1076
+ Result: `"Hello, World!"`
1077
+
1078
+ - **url_encode**
1079
+ Encodes the value and returns the result as a url encoded value.
1080
+ Example: `"Hello, World!"|url_encode`
1081
+ Result: `"Hello%2C%20World%21"`
1082
+
1083
+ - **url_encode_rfc3986**
1084
+ Encodes the value and returns the result as a url encoded value using the RFC 3986 specification.
1085
+ Example: `"Hello, World!"|url_encode_rfc3986`
1086
+ Result: `"Hello%2C%20World%21"`