@xano/developer-mcp 1.0.6 → 1.0.8
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 +12 -0
- package/dist/index.js +7 -1
- package/package.json +1 -1
- package/xanoscript_docs/README.md +34 -24
- package/xanoscript_docs/agents.md +12 -12
- package/xanoscript_docs/apis.md +14 -14
- package/xanoscript_docs/database.md +27 -27
- package/xanoscript_docs/ephemeral.md +2 -2
- package/xanoscript_docs/frontend.md +2 -2
- package/xanoscript_docs/functions.md +8 -8
- package/xanoscript_docs/integrations.md +5 -5
- package/xanoscript_docs/mcp-servers.md +7 -7
- package/xanoscript_docs/syntax.md +48 -48
- package/xanoscript_docs/tables.md +7 -7
- package/xanoscript_docs/tasks.md +1 -1
- package/xanoscript_docs/triggers.md +359 -57
- package/xanoscript_docs/types.md +15 -15
|
@@ -44,24 +44,24 @@ var $total { value = `$input.qty * $input.price` }
|
|
|
44
44
|
|
|
45
45
|
### Comparison
|
|
46
46
|
```xs
|
|
47
|
-
$a == $b
|
|
48
|
-
$a != $b
|
|
49
|
-
$a > $b
|
|
50
|
-
$a >= $b
|
|
51
|
-
$a < $b
|
|
52
|
-
$a <= $b
|
|
47
|
+
$a == $b // Equal
|
|
48
|
+
$a != $b // Not equal
|
|
49
|
+
$a > $b // Greater than
|
|
50
|
+
$a >= $b // Greater or equal
|
|
51
|
+
$a < $b // Less than
|
|
52
|
+
$a <= $b // Less or equal
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### Logical
|
|
56
56
|
```xs
|
|
57
|
-
$a && $b
|
|
58
|
-
$a || $b
|
|
59
|
-
!$a
|
|
57
|
+
$a && $b // AND
|
|
58
|
+
$a || $b // OR
|
|
59
|
+
!$a // NOT
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
### Null-Safe Comparisons (DB Queries)
|
|
63
63
|
```xs
|
|
64
|
-
|
|
64
|
+
// In db.query where clauses - ignore condition if value is null
|
|
65
65
|
$db.post.category ==? $input.category
|
|
66
66
|
$db.post.date >=? $input.start_date
|
|
67
67
|
```
|
|
@@ -88,11 +88,11 @@ $db.post.date >=? $input.start_date
|
|
|
88
88
|
|
|
89
89
|
### Array Math
|
|
90
90
|
```xs
|
|
91
|
-
[1,2,3,4]|sum
|
|
92
|
-
[1,2,3,4]|avg
|
|
93
|
-
[1,2,3,4]|product
|
|
94
|
-
[5,2,8,1]|array_min
|
|
95
|
-
[5,2,8,1]|array_max
|
|
91
|
+
[1,2,3,4]|sum // 10
|
|
92
|
+
[1,2,3,4]|avg // 2.5
|
|
93
|
+
[1,2,3,4]|product // 24
|
|
94
|
+
[5,2,8,1]|array_min // 1
|
|
95
|
+
[5,2,8,1]|array_max // 8
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
### Trigonometry
|
|
@@ -123,10 +123,10 @@ $db.post.date >=? $input.start_date
|
|
|
123
123
|
|
|
124
124
|
### Regex
|
|
125
125
|
```xs
|
|
126
|
-
"/pattern/"|regex_matches:"subject"
|
|
127
|
-
"/(\w+)/"|regex_get_first_match:"test"
|
|
128
|
-
"/\w+/"|regex_get_all_matches:"a b c"
|
|
129
|
-
"/\s+/"|regex_replace:"-":"a b"
|
|
126
|
+
"/pattern/"|regex_matches:"subject" // Boolean match
|
|
127
|
+
"/(\w+)/"|regex_get_first_match:"test" // First match
|
|
128
|
+
"/\w+/"|regex_get_all_matches:"a b c" // All matches
|
|
129
|
+
"/\s+/"|regex_replace:"-":"a b" // Replace: "a-b"
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
---
|
|
@@ -155,36 +155,36 @@ $db.post.date >=? $input.start_date
|
|
|
155
155
|
|
|
156
156
|
### Functional Operations
|
|
157
157
|
```xs
|
|
158
|
-
|
|
159
|
-
[{v:1},{v:2}]|map:$$.v*2
|
|
158
|
+
// Map - transform each element
|
|
159
|
+
[{v:1},{v:2}]|map:$$.v*2 // [2,4]
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
[1,2,3,4]|filter:$$%2==0
|
|
161
|
+
// Filter - keep matching elements
|
|
162
|
+
[1,2,3,4]|filter:$$%2==0 // [2,4]
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
[{id:1},{id:2}]|find:$$.id==2
|
|
164
|
+
// Find - first matching element
|
|
165
|
+
[{id:1},{id:2}]|find:$$.id==2 // {id:2}
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
[{id:1},{id:2}]|findIndex:$$.id==2
|
|
167
|
+
// FindIndex - index of first match
|
|
168
|
+
[{id:1},{id:2}]|findIndex:$$.id==2 // 1
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
[1,2,3]|some:$$>2
|
|
170
|
+
// Some - any element matches?
|
|
171
|
+
[1,2,3]|some:$$>2 // true
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
[2,4,6]|every:$$%2==0
|
|
173
|
+
// Every - all elements match?
|
|
174
|
+
[2,4,6]|every:$$%2==0 // true
|
|
175
175
|
|
|
176
|
-
|
|
177
|
-
[1,2,3,4]|reduce:$$+$result:0
|
|
176
|
+
// Reduce - accumulate to single value
|
|
177
|
+
[1,2,3,4]|reduce:$$+$result:0 // 10
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
### Grouping & Indexing
|
|
181
181
|
```xs
|
|
182
|
-
|
|
182
|
+
// Group by property
|
|
183
183
|
[{g:"a",v:1},{g:"b",v:2},{g:"a",v:3}]|index_by:g
|
|
184
|
-
|
|
184
|
+
// {"a":[{g:"a",v:1},{g:"a",v:3}],"b":[{g:"b",v:2}]}
|
|
185
185
|
|
|
186
|
-
|
|
187
|
-
[{n:"z"},{n:"a"}]|sort:n:text:false
|
|
186
|
+
// Sort
|
|
187
|
+
[{n:"z"},{n:"a"}]|sort:n:text:false // Ascending by n
|
|
188
188
|
```
|
|
189
189
|
|
|
190
190
|
---
|
|
@@ -205,9 +205,9 @@ $db.post.date >=? $input.start_date
|
|
|
205
205
|
|
|
206
206
|
### Conditional Set
|
|
207
207
|
```xs
|
|
208
|
-
{a:1}|set_conditional:"b":2:true
|
|
209
|
-
{a:1}|set_ifnotempty:"b":"val"
|
|
210
|
-
{a:1}|set_ifnotnull:"b":$var
|
|
208
|
+
{a:1}|set_conditional:"b":2:true // {a:1,b:2} if condition true
|
|
209
|
+
{a:1}|set_ifnotempty:"b":"val" // Set only if val not empty
|
|
210
|
+
{a:1}|set_ifnotnull:"b":$var // Set only if $var not null
|
|
211
211
|
```
|
|
212
212
|
|
|
213
213
|
---
|
|
@@ -229,8 +229,8 @@ $db.post.date >=? $input.start_date
|
|
|
229
229
|
|
|
230
230
|
### Null Handling
|
|
231
231
|
```xs
|
|
232
|
-
null|first_notnull:0
|
|
233
|
-
""|first_notempty:"default"
|
|
232
|
+
null|first_notnull:0 // 0
|
|
233
|
+
""|first_notempty:"default" // "default"
|
|
234
234
|
```
|
|
235
235
|
|
|
236
236
|
---
|
|
@@ -249,12 +249,12 @@ null|first_notnull:0 # 0
|
|
|
249
249
|
|
|
250
250
|
### Timestamp Parts
|
|
251
251
|
```xs
|
|
252
|
-
$ts|timestamp_year
|
|
253
|
-
$ts|timestamp_month
|
|
254
|
-
$ts|timestamp_day_of_month
|
|
255
|
-
$ts|timestamp_hour
|
|
256
|
-
$ts|timestamp_minute
|
|
257
|
-
$ts|timestamp_day_of_week
|
|
252
|
+
$ts|timestamp_year // Year
|
|
253
|
+
$ts|timestamp_month // Month (1-12)
|
|
254
|
+
$ts|timestamp_day_of_month // Day (1-31)
|
|
255
|
+
$ts|timestamp_hour // Hour (0-23)
|
|
256
|
+
$ts|timestamp_minute // Minute (0-59)
|
|
257
|
+
$ts|timestamp_day_of_week // Day (0=Sunday)
|
|
258
258
|
```
|
|
259
259
|
|
|
260
260
|
---
|
|
@@ -10,9 +10,9 @@ Database table definitions in XanoScript.
|
|
|
10
10
|
|
|
11
11
|
```xs
|
|
12
12
|
table "<name>" {
|
|
13
|
-
auth = false
|
|
13
|
+
auth = false // true if used for authentication
|
|
14
14
|
schema {
|
|
15
|
-
int id
|
|
15
|
+
int id // Primary key (required)
|
|
16
16
|
text name filters=trim
|
|
17
17
|
timestamp created_at?=now
|
|
18
18
|
}
|
|
@@ -72,10 +72,10 @@ schema {
|
|
|
72
72
|
### Optional & Defaults
|
|
73
73
|
```xs
|
|
74
74
|
schema {
|
|
75
|
-
text nickname?
|
|
76
|
-
timestamp created_at?=now
|
|
77
|
-
bool is_active?=true
|
|
78
|
-
int status?=0
|
|
75
|
+
text nickname? // Optional, no default
|
|
76
|
+
timestamp created_at?=now // Optional, defaults to current time
|
|
77
|
+
bool is_active?=true // Optional, defaults to true
|
|
78
|
+
int status?=0 // Optional, defaults to 0
|
|
79
79
|
}
|
|
80
80
|
```
|
|
81
81
|
|
|
@@ -139,7 +139,7 @@ schema {
|
|
|
139
139
|
### Vector Fields
|
|
140
140
|
```xs
|
|
141
141
|
schema {
|
|
142
|
-
vector embedding
|
|
142
|
+
vector embedding // For AI/ML embeddings
|
|
143
143
|
}
|
|
144
144
|
```
|
|
145
145
|
|