@xano/developer-mcp 1.0.20 → 1.0.22
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.
- package/README.md +100 -19
- package/dist/index.js +4 -227
- package/dist/meta_api_docs/format.d.ts +16 -1
- package/dist/meta_api_docs/format.js +24 -6
- package/dist/meta_api_docs/format.test.d.ts +1 -0
- package/dist/meta_api_docs/format.test.js +274 -0
- package/dist/meta_api_docs/index.test.d.ts +1 -0
- package/dist/meta_api_docs/index.test.js +128 -0
- package/dist/meta_api_docs/types.test.d.ts +1 -0
- package/dist/meta_api_docs/types.test.js +132 -0
- package/dist/run_api_docs/format.d.ts +1 -0
- package/dist/run_api_docs/format.js +3 -170
- package/dist/run_api_docs/format.test.d.ts +1 -0
- package/dist/run_api_docs/format.test.js +86 -0
- package/dist/run_api_docs/index.test.d.ts +1 -0
- package/dist/run_api_docs/index.test.js +127 -0
- package/dist/templates/init-workspace.js +4 -4
- package/dist/templates/xanoscript-index.d.ts +3 -1
- package/dist/templates/xanoscript-index.js +54 -51
- package/dist/xanoscript.d.ts +41 -0
- package/dist/xanoscript.js +261 -0
- package/dist/xanoscript.test.d.ts +1 -0
- package/dist/xanoscript.test.js +303 -0
- package/dist/xanoscript_docs/README.md +53 -37
- package/dist/xanoscript_docs/agents.md +1 -1
- package/dist/xanoscript_docs/apis.md +6 -3
- package/dist/xanoscript_docs/branch.md +239 -0
- package/dist/xanoscript_docs/functions.md +6 -6
- package/dist/xanoscript_docs/integrations.md +43 -1
- package/dist/xanoscript_docs/middleware.md +321 -0
- package/dist/xanoscript_docs/performance.md +1 -1
- package/dist/xanoscript_docs/realtime.md +113 -1
- package/dist/xanoscript_docs/tasks.md +2 -2
- package/dist/xanoscript_docs/tools.md +3 -3
- package/dist/xanoscript_docs/types.md +25 -8
- package/dist/xanoscript_docs/workspace.md +209 -0
- package/dist/xanoscript_docs_auto/README.md +119 -0
- package/dist/xanoscript_docs_auto/agents.md +446 -0
- package/dist/xanoscript_docs_auto/apis.md +517 -0
- package/dist/xanoscript_docs_auto/control-flow.md +543 -0
- package/dist/xanoscript_docs_auto/database.md +551 -0
- package/dist/xanoscript_docs_auto/debugging.md +527 -0
- package/dist/xanoscript_docs_auto/filters.md +464 -0
- package/dist/xanoscript_docs_auto/functions.md +431 -0
- package/dist/xanoscript_docs_auto/integrations.md +657 -0
- package/dist/xanoscript_docs_auto/mcp-servers.md +408 -0
- package/dist/xanoscript_docs_auto/operators.md +368 -0
- package/dist/xanoscript_docs_auto/syntax.md +287 -0
- package/dist/xanoscript_docs_auto/tables.md +447 -0
- package/dist/xanoscript_docs_auto/tasks.md +479 -0
- package/dist/xanoscript_docs_auto/testing.md +574 -0
- package/dist/xanoscript_docs_auto/tools.md +485 -0
- package/dist/xanoscript_docs_auto/triggers.md +595 -0
- package/dist/xanoscript_docs_auto/types.md +323 -0
- package/dist/xanoscript_docs_auto/variables.md +462 -0
- package/dist/xanoscript_docs_auto/version.json +5 -0
- package/package.json +6 -2
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/*.xs"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Filters Reference
|
|
6
|
+
|
|
7
|
+
Complete reference for all pipe filters in XanoScript.
|
|
8
|
+
|
|
9
|
+
## Quick Reference
|
|
10
|
+
|
|
11
|
+
| Category | Filters |
|
|
12
|
+
|----------|---------|
|
|
13
|
+
| String | `trim`, `lower`, `upper`, `strlen`, `substr`, `split`, `replace` |
|
|
14
|
+
| Array | `first`, `last`, `count`, `map`, `filter`, `find`, `reduce` |
|
|
15
|
+
| Object | `get`, `set`, `unset`, `has`, `keys`, `values`, `entries` |
|
|
16
|
+
| Math | `add`, `subtract`, `floor`, `ceil`, `round`, `abs` |
|
|
17
|
+
| Type | `to_int`, `to_text`, `is_null`, `is_array`, `is_object` |
|
|
18
|
+
| Date | `format_timestamp`, `transform_timestamp`, `timestamp_year` |
|
|
19
|
+
| Encoding | `json_encode`, `base64_encode`, `url_encode` |
|
|
20
|
+
| Security | `md5`, `sha256`, `encrypt`, `decrypt` |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## String Filters
|
|
25
|
+
|
|
26
|
+
### Basic String Operations
|
|
27
|
+
|
|
28
|
+
| Filter | Example | Result |
|
|
29
|
+
|--------|---------|--------|
|
|
30
|
+
| `trim` | `" hi "\|trim` | `"hi"` |
|
|
31
|
+
| `ltrim` | `" hi"\|ltrim` | `"hi"` |
|
|
32
|
+
| `rtrim` | `"hi "\|rtrim` | `"hi"` |
|
|
33
|
+
| `to_lower` | `"Hello"\|to_lower` | `"hello"` |
|
|
34
|
+
| `to_upper` | `"Hello"\|to_upper` | `"HELLO"` |
|
|
35
|
+
| `capitalize` | `"hello world"\|capitalize` | `"Hello World"` |
|
|
36
|
+
| `strlen` | `"hello"\|strlen` | `5` |
|
|
37
|
+
|
|
38
|
+
### Substring Operations
|
|
39
|
+
|
|
40
|
+
| Filter | Example | Result |
|
|
41
|
+
|--------|---------|--------|
|
|
42
|
+
| `substr` | `"hello"\|substr:1:3` | `"ell"` |
|
|
43
|
+
| `split` | `"a,b,c"\|split:","` | `["a","b","c"]` |
|
|
44
|
+
| `replace` | `"hello"\|replace:"l":"x"` | `"hexxo"` |
|
|
45
|
+
| `concat` | `"a"\|concat:"b":"-"` | `"a-b"` |
|
|
46
|
+
|
|
47
|
+
### String Checks
|
|
48
|
+
|
|
49
|
+
| Filter | Example | Result |
|
|
50
|
+
|--------|---------|--------|
|
|
51
|
+
| `contains` | `"hello"\|contains:"ell"` | `true` |
|
|
52
|
+
| `starts_with` | `"hello"\|starts_with:"he"` | `true` |
|
|
53
|
+
| `ends_with` | `"hello"\|ends_with:"lo"` | `true` |
|
|
54
|
+
| `icontains` | `"Hello"\|icontains:"ELL"` | `true` |
|
|
55
|
+
| `istarts_with` | `"Hello"\|istarts_with:"HE"` | `true` |
|
|
56
|
+
| `iends_with` | `"Hello"\|iends_with:"LO"` | `true` |
|
|
57
|
+
|
|
58
|
+
### Regex Operations
|
|
59
|
+
|
|
60
|
+
```xs
|
|
61
|
+
// Check if matches
|
|
62
|
+
"/pattern/"|regex_matches:"subject"
|
|
63
|
+
|
|
64
|
+
// Get first match
|
|
65
|
+
"/(\w+)/"|regex_get_first_match:"hello world" // "hello"
|
|
66
|
+
|
|
67
|
+
// Get all matches
|
|
68
|
+
"/\w+/"|regex_get_all_matches:"hello world" // ["hello", "world"]
|
|
69
|
+
|
|
70
|
+
// Replace with regex
|
|
71
|
+
"/\s+/"|regex_replace:"-":"hello world" // "hello-world"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### String Escaping
|
|
75
|
+
|
|
76
|
+
| Filter | Description |
|
|
77
|
+
|--------|-------------|
|
|
78
|
+
| `addslashes` | Escape quotes and backslashes |
|
|
79
|
+
| `escape` | HTML escape |
|
|
80
|
+
| `text_escape` | Escape for text output |
|
|
81
|
+
| `regex_quote` | Escape regex special characters |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Array Filters
|
|
86
|
+
|
|
87
|
+
### Array Access
|
|
88
|
+
|
|
89
|
+
| Filter | Example | Result |
|
|
90
|
+
|--------|---------|--------|
|
|
91
|
+
| `first` | `[1,2,3]\|first` | `1` |
|
|
92
|
+
| `last` | `[1,2,3]\|last` | `3` |
|
|
93
|
+
| `count` | `[1,2,3]\|count` | `3` |
|
|
94
|
+
| `slice` | `[1,2,3,4]\|slice:1:2` | `[2,3]` |
|
|
95
|
+
|
|
96
|
+
### Array Modification
|
|
97
|
+
|
|
98
|
+
| Filter | Example | Result |
|
|
99
|
+
|--------|---------|--------|
|
|
100
|
+
| `push` | `[1,2]\|push:3` | `[1,2,3]` |
|
|
101
|
+
| `pop` | `[1,2,3]\|pop` | `3` |
|
|
102
|
+
| `unshift` | `[1,2]\|unshift:0` | `[0,1,2]` |
|
|
103
|
+
| `shift` | `[1,2,3]\|shift` | `1` |
|
|
104
|
+
| `reverse` | `[1,2,3]\|reverse` | `[3,2,1]` |
|
|
105
|
+
| `unique` | `[1,1,2,2]\|unique` | `[1,2]` |
|
|
106
|
+
| `flatten` | `[[1,2],[3]]\|flatten` | `[1,2,3]` |
|
|
107
|
+
| `shuffle` | `[1,2,3]\|shuffle` | Random order |
|
|
108
|
+
|
|
109
|
+
### Array Combining
|
|
110
|
+
|
|
111
|
+
| Filter | Example | Result |
|
|
112
|
+
|--------|---------|--------|
|
|
113
|
+
| `merge` | `[1,2]\|merge:[3,4]` | `[1,2,3,4]` |
|
|
114
|
+
| `diff` | `[1,2,3]\|diff:[2]` | `[1,3]` |
|
|
115
|
+
| `intersect` | `[1,2,3]\|intersect:[2,3,4]` | `[2,3]` |
|
|
116
|
+
| `join` | `["a","b"]\|join:","` | `"a,b"` |
|
|
117
|
+
|
|
118
|
+
### Functional Array Operations
|
|
119
|
+
|
|
120
|
+
```xs
|
|
121
|
+
// Map - transform each element
|
|
122
|
+
[1,2,3]|map:$$*2 // [2,4,6]
|
|
123
|
+
[{v:1},{v:2}]|map:$$.v // [1,2]
|
|
124
|
+
|
|
125
|
+
// Filter - keep matching elements
|
|
126
|
+
[1,2,3,4]|filter:$$>2 // [3,4]
|
|
127
|
+
[1,2,3,4]|filter:$$%2==0 // [2,4]
|
|
128
|
+
|
|
129
|
+
// Find - first matching element
|
|
130
|
+
[{id:1},{id:2}]|find:$$.id==2 // {id:2}
|
|
131
|
+
|
|
132
|
+
// FindIndex - index of first match
|
|
133
|
+
[{id:1},{id:2}]|findIndex:$$.id==2 // 1
|
|
134
|
+
|
|
135
|
+
// Some - any element matches?
|
|
136
|
+
[1,2,3]|some:$$>2 // true
|
|
137
|
+
|
|
138
|
+
// Every - all elements match?
|
|
139
|
+
[2,4,6]|every:$$%2==0 // true
|
|
140
|
+
|
|
141
|
+
// Reduce - accumulate to single value
|
|
142
|
+
[1,2,3,4]|reduce:$$+$result:0 // 10
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Array Grouping
|
|
146
|
+
|
|
147
|
+
```xs
|
|
148
|
+
// Group by property
|
|
149
|
+
[{g:"a",v:1},{g:"b",v:2},{g:"a",v:3}]|index_by:g
|
|
150
|
+
// {"a":[{g:"a",v:1},{g:"a",v:3}],"b":[{g:"b",v:2}]}
|
|
151
|
+
|
|
152
|
+
// Sort
|
|
153
|
+
[{n:"z"},{n:"a"}]|sort:n:text:false // Ascending
|
|
154
|
+
[{n:"z"},{n:"a"}]|sort:n:text:true // Descending
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Array Filtering by Type
|
|
158
|
+
|
|
159
|
+
| Filter | Description |
|
|
160
|
+
|--------|-------------|
|
|
161
|
+
| `filter_empty` | Remove empty values |
|
|
162
|
+
| `filter_empty_text` | Remove empty strings |
|
|
163
|
+
| `filter_empty_array` | Remove empty arrays |
|
|
164
|
+
| `filter_empty_object` | Remove empty objects |
|
|
165
|
+
| `filter_null` | Remove null values |
|
|
166
|
+
| `filter_zero` | Remove zero values |
|
|
167
|
+
| `filter_false` | Remove false values |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Object Filters
|
|
172
|
+
|
|
173
|
+
### Property Access
|
|
174
|
+
|
|
175
|
+
| Filter | Example | Result |
|
|
176
|
+
|--------|---------|--------|
|
|
177
|
+
| `get` | `{a:1}\|get:"a"` | `1` |
|
|
178
|
+
| `set` | `{a:1}\|set:"b":2` | `{a:1,b:2}` |
|
|
179
|
+
| `unset` | `{a:1,b:2}\|unset:"b"` | `{a:1}` |
|
|
180
|
+
| `has` | `{a:1}\|has:"a"` | `true` |
|
|
181
|
+
|
|
182
|
+
### Object Transformation
|
|
183
|
+
|
|
184
|
+
| Filter | Example | Result |
|
|
185
|
+
|--------|---------|--------|
|
|
186
|
+
| `keys` | `{a:1,b:2}\|keys` | `["a","b"]` |
|
|
187
|
+
| `values` | `{a:1,b:2}\|values` | `[1,2]` |
|
|
188
|
+
| `entries` | `{a:1}\|entries` | `[{key:"a",value:1}]` |
|
|
189
|
+
| `pick` | `{a:1,b:2,c:3}\|pick:["a","c"]` | `{a:1,c:3}` |
|
|
190
|
+
| `unpick` | `{a:1,b:2,c:3}\|unpick:["b"]` | `{a:1,c:3}` |
|
|
191
|
+
|
|
192
|
+
### Conditional Set
|
|
193
|
+
|
|
194
|
+
```xs
|
|
195
|
+
{a:1}|set_conditional:"b":2:true // {a:1,b:2} if condition true
|
|
196
|
+
{a:1}|set_ifnotempty:"b":"val" // Set only if val not empty
|
|
197
|
+
{a:1}|set_ifnotnull:"b":$var // Set only if $var not null
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Math Filters
|
|
203
|
+
|
|
204
|
+
### Basic Math
|
|
205
|
+
|
|
206
|
+
| Filter | Example | Result |
|
|
207
|
+
|--------|---------|--------|
|
|
208
|
+
| `add` | `10\|add:5` | `15` |
|
|
209
|
+
| `subtract` | `10\|subtract:3` | `7` |
|
|
210
|
+
| `multiply` | `10\|multiply:2` | `20` |
|
|
211
|
+
| `divide` | `10\|divide:2` | `5` |
|
|
212
|
+
| `modulus` | `10\|modulus:3` | `1` |
|
|
213
|
+
|
|
214
|
+
### Rounding
|
|
215
|
+
|
|
216
|
+
| Filter | Example | Result |
|
|
217
|
+
|--------|---------|--------|
|
|
218
|
+
| `floor` | `2.7\|floor` | `2` |
|
|
219
|
+
| `ceil` | `2.3\|ceil` | `3` |
|
|
220
|
+
| `round` | `2.567\|round:2` | `2.57` |
|
|
221
|
+
| `abs` | `-5\|abs` | `5` |
|
|
222
|
+
|
|
223
|
+
### Advanced Math
|
|
224
|
+
|
|
225
|
+
| Filter | Example | Result |
|
|
226
|
+
|--------|---------|--------|
|
|
227
|
+
| `sqrt` | `9\|sqrt` | `3` |
|
|
228
|
+
| `pow` | `2\|pow:3` | `8` |
|
|
229
|
+
| `min` | `5\|min:3` | `3` |
|
|
230
|
+
| `max` | `5\|max:10` | `10` |
|
|
231
|
+
|
|
232
|
+
### Array Math
|
|
233
|
+
|
|
234
|
+
```xs
|
|
235
|
+
[1,2,3,4]|sum // 10
|
|
236
|
+
[1,2,3,4]|avg // 2.5
|
|
237
|
+
[1,2,3,4]|product // 24
|
|
238
|
+
[5,2,8,1]|array_min // 1
|
|
239
|
+
[5,2,8,1]|array_max // 8
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Trigonometry
|
|
243
|
+
|
|
244
|
+
`sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `deg2rad`, `rad2deg`, `sinh`, `cosh`, `tanh`
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Type Filters
|
|
249
|
+
|
|
250
|
+
### Type Conversion
|
|
251
|
+
|
|
252
|
+
| Filter | Example | Result |
|
|
253
|
+
|--------|---------|--------|
|
|
254
|
+
| `to_int` | `"123"\|to_int` | `123` |
|
|
255
|
+
| `to_decimal` | `"1.5"\|to_decimal` | `1.5` |
|
|
256
|
+
| `to_text` | `123\|to_text` | `"123"` |
|
|
257
|
+
| `to_bool` | `"true"\|to_bool` | `true` |
|
|
258
|
+
|
|
259
|
+
### Type Checking
|
|
260
|
+
|
|
261
|
+
| Filter | Example | Result |
|
|
262
|
+
|--------|---------|--------|
|
|
263
|
+
| `is_null` | `null\|is_null` | `true` |
|
|
264
|
+
| `is_empty` | `[]\|is_empty` | `true` |
|
|
265
|
+
| `is_array` | `[1]\|is_array` | `true` |
|
|
266
|
+
| `is_object` | `{}\|is_object` | `true` |
|
|
267
|
+
| `is_int` | `1\|is_int` | `true` |
|
|
268
|
+
| `is_text` | `"a"\|is_text` | `true` |
|
|
269
|
+
| `is_decimal` | `1.5\|is_decimal` | `true` |
|
|
270
|
+
| `is_bool` | `true\|is_bool` | `true` |
|
|
271
|
+
|
|
272
|
+
### Null Handling
|
|
273
|
+
|
|
274
|
+
```xs
|
|
275
|
+
null|first_notnull:0 // 0
|
|
276
|
+
""|first_notempty:"default" // "default"
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Date/Time Filters
|
|
282
|
+
|
|
283
|
+
### Timestamp Parsing
|
|
284
|
+
|
|
285
|
+
| Filter | Example | Description |
|
|
286
|
+
|--------|---------|-------------|
|
|
287
|
+
| `to_timestamp` | `"now"\|to_timestamp` | Parse to timestamp |
|
|
288
|
+
| `to_ms` | `"now"\|to_ms` | Milliseconds since epoch |
|
|
289
|
+
| `to_seconds` | `"now"\|to_seconds` | Seconds since epoch |
|
|
290
|
+
|
|
291
|
+
### Timestamp Formatting
|
|
292
|
+
|
|
293
|
+
```xs
|
|
294
|
+
$ts|format_timestamp:"Y-m-d":"UTC"
|
|
295
|
+
$ts|format_timestamp:"Y-m-d H:i:s":"America/New_York"
|
|
296
|
+
$ts|format_timestamp:"F j, Y":"UTC" // "January 15, 2025"
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Timestamp Manipulation
|
|
300
|
+
|
|
301
|
+
```xs
|
|
302
|
+
$ts|transform_timestamp:"-7 days"
|
|
303
|
+
$ts|transform_timestamp:"+1 month"
|
|
304
|
+
$ts|transform_timestamp:"+2 hours"
|
|
305
|
+
$ts|add_secs_to_timestamp:3600 // Add 1 hour
|
|
306
|
+
$ts|add_ms_to_timestamp:1000 // Add 1 second
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Timestamp Parts
|
|
310
|
+
|
|
311
|
+
| Filter | Returns |
|
|
312
|
+
|--------|---------|
|
|
313
|
+
| `timestamp_year` | Year (e.g., 2025) |
|
|
314
|
+
| `timestamp_month` | Month (1-12) |
|
|
315
|
+
| `timestamp_day_of_month` | Day (1-31) |
|
|
316
|
+
| `timestamp_hour` | Hour (0-23) |
|
|
317
|
+
| `timestamp_minute` | Minute (0-59) |
|
|
318
|
+
| `timestamp_day_of_week` | Day (0=Sunday) |
|
|
319
|
+
| `timestamp_week` | Week number |
|
|
320
|
+
| `timestamp_day_of_year` | Day of year (1-366) |
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Encoding Filters
|
|
325
|
+
|
|
326
|
+
### JSON
|
|
327
|
+
|
|
328
|
+
```xs
|
|
329
|
+
{a:1}|json_encode // '{"a":1}'
|
|
330
|
+
'{"a":1}'|json_decode // {a:1}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Base64
|
|
334
|
+
|
|
335
|
+
```xs
|
|
336
|
+
"hello"|base64_encode // "aGVsbG8="
|
|
337
|
+
"aGVsbG8="|base64_decode // "hello"
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### URL
|
|
341
|
+
|
|
342
|
+
```xs
|
|
343
|
+
"hello world"|url_encode // "hello%20world"
|
|
344
|
+
"hello%20world"|url_decode // "hello world"
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Other
|
|
348
|
+
|
|
349
|
+
| Filter | Description |
|
|
350
|
+
|--------|-------------|
|
|
351
|
+
| `xml_decode` | Parse XML to object |
|
|
352
|
+
| `yaml_encode` | Object to YAML |
|
|
353
|
+
| `yaml_decode` | YAML to object |
|
|
354
|
+
| `hex2bin` | Hex string to binary |
|
|
355
|
+
| `bin2hex` | Binary to hex string |
|
|
356
|
+
| `csv_parse` | Parse CSV string |
|
|
357
|
+
| `csv_create` | Create CSV string |
|
|
358
|
+
| `querystring_parse` | Parse query string |
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## Security Filters
|
|
363
|
+
|
|
364
|
+
### Hashing
|
|
365
|
+
|
|
366
|
+
| Filter | Description |
|
|
367
|
+
|--------|-------------|
|
|
368
|
+
| `md5` | MD5 hash |
|
|
369
|
+
| `sha1` | SHA-1 hash |
|
|
370
|
+
| `sha256` | SHA-256 hash |
|
|
371
|
+
| `sha512` | SHA-512 hash |
|
|
372
|
+
| `hmac_sha256` | HMAC-SHA256 |
|
|
373
|
+
|
|
374
|
+
### Encryption
|
|
375
|
+
|
|
376
|
+
```xs
|
|
377
|
+
"data"|encrypt:"aes-256-cbc":"key":"iv"
|
|
378
|
+
$encrypted|decrypt:"aes-256-cbc":"key":"iv"
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### JWT
|
|
382
|
+
|
|
383
|
+
```xs
|
|
384
|
+
$payload|jws_encode:"HS256":"secret" // Sign
|
|
385
|
+
$token|jws_decode:"secret" // Verify and decode
|
|
386
|
+
|
|
387
|
+
$payload|jwe_encode:"A256GCM":"key" // Encrypt
|
|
388
|
+
$token|jwe_decode:"key" // Decrypt
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### ID Obfuscation
|
|
392
|
+
|
|
393
|
+
```xs
|
|
394
|
+
123|secureid_encode // Obfuscated ID
|
|
395
|
+
"obfuscated"|secureid_decode // Original ID
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### UUID Generation
|
|
399
|
+
|
|
400
|
+
```xs
|
|
401
|
+
|uuid // Generate UUID
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Database Query Filters
|
|
407
|
+
|
|
408
|
+
Special filters for `db.query` where clauses:
|
|
409
|
+
|
|
410
|
+
### String Operations
|
|
411
|
+
|
|
412
|
+
```xs
|
|
413
|
+
$db.user.name|to_lower == $input.name|to_lower
|
|
414
|
+
$db.product.sku|substr:0:3 == "SKU"
|
|
415
|
+
$db.name|unaccent ilike $input.search
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Array Operations
|
|
419
|
+
|
|
420
|
+
```xs
|
|
421
|
+
$db.tags|contains:"featured"
|
|
422
|
+
$db.categories|overlaps:["a","b"]
|
|
423
|
+
$db.items|length >= 3
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Vector Operations (AI/ML)
|
|
427
|
+
|
|
428
|
+
```xs
|
|
429
|
+
$db.embedding|cosine_similarity:$vec
|
|
430
|
+
$db.embedding|l2_distance_euclidean:$vec
|
|
431
|
+
$db.embedding|inner_product:$vec
|
|
432
|
+
$db.embedding|l1_distance_manhattan:$vec
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Geo Operations
|
|
436
|
+
|
|
437
|
+
```xs
|
|
438
|
+
$db.location|distance:$point // Distance in meters
|
|
439
|
+
$db.location|within:$point:5000 // Within 5km
|
|
440
|
+
$db.boundary|covers:$point // Polygon contains point
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### Timestamp Arithmetic
|
|
444
|
+
|
|
445
|
+
```xs
|
|
446
|
+
$db.created_at|timestamp_add_days:7
|
|
447
|
+
$db.expires_at|timestamp_subtract_hours:24
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## Chaining Filters
|
|
453
|
+
|
|
454
|
+
Combine multiple filters:
|
|
455
|
+
|
|
456
|
+
```xs
|
|
457
|
+
$input.email|trim|to_lower
|
|
458
|
+
|
|
459
|
+
$input.text|trim|substr:0:100|replace:" ":"-"|to_lower
|
|
460
|
+
|
|
461
|
+
$array|filter:$$.active|map:$$.name|join:", "
|
|
462
|
+
|
|
463
|
+
$data|json_encode|base64_encode
|
|
464
|
+
```
|