@xano/developer-mcp 1.0.21 → 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 -242
- 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/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 +2 -0
- package/dist/xanoscript_docs/agents.md +1 -1
- package/dist/xanoscript_docs/functions.md +4 -4
- package/dist/xanoscript_docs/integrations.md +43 -1
- package/dist/xanoscript_docs/performance.md +1 -1
- package/dist/xanoscript_docs/tasks.md +2 -2
- package/dist/xanoscript_docs/tools.md +2 -2
- 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,323 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/*.xs"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Data Types
|
|
6
|
+
|
|
7
|
+
XanoScript supports a rich type system for defining inputs, variables, and database columns.
|
|
8
|
+
|
|
9
|
+
## Quick Reference
|
|
10
|
+
|
|
11
|
+
| Type | Description | Example |
|
|
12
|
+
|------|-------------|---------|
|
|
13
|
+
| `text` | String data | `"hello world"` |
|
|
14
|
+
| `email` | Email address format | `"user@example.com"` |
|
|
15
|
+
| `password` | Password field (sensitive) | (user input) |
|
|
16
|
+
| `int` | Integer number | `42`, `-5` |
|
|
17
|
+
| `decimal` | Floating-point number | `3.14`, `99.99` |
|
|
18
|
+
| `bool` | Boolean value | `true`, `false` |
|
|
19
|
+
| `date` | Date value | `2025-01-15` |
|
|
20
|
+
| `time` | Time value | `14:30:00` |
|
|
21
|
+
| `timestamp` | Date and time | `2025-01-15 14:30:00+0000` |
|
|
22
|
+
| `json` | JSON object/array | `{name: "John"}` |
|
|
23
|
+
| `file` | File resource | (uploaded file) |
|
|
24
|
+
| `uuid` | UUID identifier | (auto-generated) |
|
|
25
|
+
| `array` | Array of values | `[1, 2, 3]` |
|
|
26
|
+
| `object` | Key-value object | `{key: value}` |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Input Block Types
|
|
31
|
+
|
|
32
|
+
Define input parameters with types and validation:
|
|
33
|
+
|
|
34
|
+
```xs
|
|
35
|
+
input {
|
|
36
|
+
text name filters=trim|min:1|max:100
|
|
37
|
+
email user_email filters=trim|lower
|
|
38
|
+
int age filters=min:0|max:150
|
|
39
|
+
decimal price filters=min:0
|
|
40
|
+
bool is_active
|
|
41
|
+
timestamp created_at
|
|
42
|
+
json metadata
|
|
43
|
+
file avatar
|
|
44
|
+
array tags
|
|
45
|
+
object preferences
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Optional Parameters
|
|
50
|
+
|
|
51
|
+
Add `?` after type name for optional fields:
|
|
52
|
+
|
|
53
|
+
```xs
|
|
54
|
+
input {
|
|
55
|
+
text name // Required
|
|
56
|
+
text? nickname // Optional
|
|
57
|
+
int? age // Optional integer
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Default Values
|
|
62
|
+
|
|
63
|
+
```xs
|
|
64
|
+
input {
|
|
65
|
+
int page default=1
|
|
66
|
+
int per_page default=20
|
|
67
|
+
text sort default="created_at"
|
|
68
|
+
bool ascending default=true
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Array Types
|
|
73
|
+
|
|
74
|
+
Specify array element types:
|
|
75
|
+
|
|
76
|
+
```xs
|
|
77
|
+
input {
|
|
78
|
+
array<text> tags // Array of strings
|
|
79
|
+
array<int> ids // Array of integers
|
|
80
|
+
array<object> items // Array of objects
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Input Validation Filters
|
|
87
|
+
|
|
88
|
+
Apply filters to validate and transform input:
|
|
89
|
+
|
|
90
|
+
### Validation Filters
|
|
91
|
+
|
|
92
|
+
| Filter | Description | Example |
|
|
93
|
+
|--------|-------------|---------|
|
|
94
|
+
| `min:<value>` | Minimum value/length | `min:1` |
|
|
95
|
+
| `max:<value>` | Maximum value/length | `max:100` |
|
|
96
|
+
| `startsWith:<prefix>` | Must start with prefix | `startsWith:SKU-` |
|
|
97
|
+
| `pattern:<regex>` | Regex pattern match | `pattern:^[A-Z]+$` |
|
|
98
|
+
| `pattern:<regex>:<error>` | Regex with custom error | `pattern:^\\d{5}$:Invalid ZIP` |
|
|
99
|
+
| `prevent:<phrase>` | Blacklist phrase | `prevent:spam` |
|
|
100
|
+
| `ok:<chars>` | Whitelist characters | `ok:abc123` |
|
|
101
|
+
| `alphaOk` | Only alphabetic characters | `alphaOk` |
|
|
102
|
+
| `digitOk` | Only numeric characters | `digitOk` |
|
|
103
|
+
| `minAlpha:<count>` | Minimum alphabetic chars | `minAlpha:2` |
|
|
104
|
+
| `minDigit:<count>` | Minimum digits | `minDigit:1` |
|
|
105
|
+
| `minSpecial:<count>` | Minimum special chars | `minSpecial:1` |
|
|
106
|
+
|
|
107
|
+
### Transformation Filters
|
|
108
|
+
|
|
109
|
+
| Filter | Description | Example |
|
|
110
|
+
|--------|-------------|---------|
|
|
111
|
+
| `trim` | Remove whitespace | `trim` |
|
|
112
|
+
| `lower` | Convert to lowercase | `lower` |
|
|
113
|
+
| `upper` | Convert to uppercase | `upper` |
|
|
114
|
+
| `ltrim` | Remove left whitespace | `ltrim` |
|
|
115
|
+
| `rtrim` | Remove right whitespace | `rtrim` |
|
|
116
|
+
|
|
117
|
+
### Chaining Filters
|
|
118
|
+
|
|
119
|
+
```xs
|
|
120
|
+
input {
|
|
121
|
+
text email filters=trim|lower
|
|
122
|
+
text username filters=trim|min:3|max:20|alphaOk
|
|
123
|
+
password pwd filters=min:8|minAlpha:1|minDigit:1|minSpecial:1
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Type Conversion Filters
|
|
130
|
+
|
|
131
|
+
Convert between types at runtime:
|
|
132
|
+
|
|
133
|
+
| Filter | Description | Example |
|
|
134
|
+
|--------|-------------|---------|
|
|
135
|
+
| `to_int` | Convert to integer | `"123"\|to_int` |
|
|
136
|
+
| `to_decimal` | Convert to decimal | `"1.5"\|to_decimal` |
|
|
137
|
+
| `to_text` | Convert to string | `123\|to_text` |
|
|
138
|
+
| `to_bool` | Convert to boolean | `"true"\|to_bool` |
|
|
139
|
+
| `to_timestamp` | Parse to timestamp | `"now"\|to_timestamp` |
|
|
140
|
+
| `to_ms` | Milliseconds since epoch | `"now"\|to_ms` |
|
|
141
|
+
| `to_seconds` | Seconds since epoch | `"now"\|to_seconds` |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Type Checking Filters
|
|
146
|
+
|
|
147
|
+
Test value types:
|
|
148
|
+
|
|
149
|
+
| Filter | Example | Result |
|
|
150
|
+
|--------|---------|--------|
|
|
151
|
+
| `is_null` | `null\|is_null` | `true` |
|
|
152
|
+
| `is_empty` | `[]\|is_empty` | `true` |
|
|
153
|
+
| `is_array` | `[1]\|is_array` | `true` |
|
|
154
|
+
| `is_object` | `{}\|is_object` | `true` |
|
|
155
|
+
| `is_int` | `1\|is_int` | `true` |
|
|
156
|
+
| `is_text` | `"a"\|is_text` | `true` |
|
|
157
|
+
| `is_decimal` | `1.5\|is_decimal` | `true` |
|
|
158
|
+
| `is_bool` | `true\|is_bool` | `true` |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## JSON Type
|
|
163
|
+
|
|
164
|
+
The `json` type accepts objects and arrays:
|
|
165
|
+
|
|
166
|
+
```xs
|
|
167
|
+
input {
|
|
168
|
+
json settings // Any JSON value
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Access nested properties
|
|
172
|
+
var $theme { value = $input.settings.theme }
|
|
173
|
+
var $colors { value = $input.settings.colors|first }
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### JSON Operations
|
|
177
|
+
|
|
178
|
+
```xs
|
|
179
|
+
// Encode/decode
|
|
180
|
+
$obj|json_encode // Object to JSON string
|
|
181
|
+
$str|json_decode // JSON string to object
|
|
182
|
+
|
|
183
|
+
// Property access
|
|
184
|
+
$obj|get:"key" // Get property
|
|
185
|
+
$obj|set:"key":"value" // Set property
|
|
186
|
+
$obj|unset:"key" // Remove property
|
|
187
|
+
$obj|has:"key" // Check property exists
|
|
188
|
+
|
|
189
|
+
// Object manipulation
|
|
190
|
+
$obj|keys // Get all keys
|
|
191
|
+
$obj|values // Get all values
|
|
192
|
+
$obj|entries // Get key-value pairs
|
|
193
|
+
$obj|pick:["a","b"] // Keep only specified keys
|
|
194
|
+
$obj|unpick:["c"] // Remove specified keys
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## File Type
|
|
200
|
+
|
|
201
|
+
Handle file uploads and resources:
|
|
202
|
+
|
|
203
|
+
```xs
|
|
204
|
+
input {
|
|
205
|
+
file avatar // File upload
|
|
206
|
+
file? document // Optional file
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// File properties
|
|
210
|
+
$input.avatar.name // Original filename
|
|
211
|
+
$input.avatar.mime // MIME type
|
|
212
|
+
$input.avatar.size // Size in bytes
|
|
213
|
+
$input.avatar.path // Storage path
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### File Operations
|
|
217
|
+
|
|
218
|
+
```xs
|
|
219
|
+
// Create file resource
|
|
220
|
+
storage.create_file_resource {
|
|
221
|
+
name = "document.pdf"
|
|
222
|
+
content = $file_content
|
|
223
|
+
} as $file
|
|
224
|
+
|
|
225
|
+
// Read file
|
|
226
|
+
storage.read_file_resource {
|
|
227
|
+
path = $input.file.path
|
|
228
|
+
} as $content
|
|
229
|
+
|
|
230
|
+
// Delete file
|
|
231
|
+
storage.delete_file {
|
|
232
|
+
path = $file_path
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Image with metadata
|
|
236
|
+
storage.create_image {
|
|
237
|
+
name = "photo.jpg"
|
|
238
|
+
content = $image_data
|
|
239
|
+
} as $image
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Timestamp Type
|
|
245
|
+
|
|
246
|
+
Date and time handling:
|
|
247
|
+
|
|
248
|
+
```xs
|
|
249
|
+
input {
|
|
250
|
+
timestamp start_date
|
|
251
|
+
timestamp? end_date
|
|
252
|
+
date birth_date
|
|
253
|
+
time meeting_time
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Timestamp Formats
|
|
258
|
+
|
|
259
|
+
```xs
|
|
260
|
+
// Current time
|
|
261
|
+
now // Current timestamp
|
|
262
|
+
|
|
263
|
+
// Format timestamp
|
|
264
|
+
$ts|format_timestamp:"Y-m-d":"UTC"
|
|
265
|
+
$ts|format_timestamp:"Y-m-d H:i:s":"America/New_York"
|
|
266
|
+
|
|
267
|
+
// Transform timestamp
|
|
268
|
+
$ts|transform_timestamp:"-7 days"
|
|
269
|
+
$ts|transform_timestamp:"+1 month"
|
|
270
|
+
$ts|add_secs_to_timestamp:3600
|
|
271
|
+
|
|
272
|
+
// Extract parts
|
|
273
|
+
$ts|timestamp_year // Year
|
|
274
|
+
$ts|timestamp_month // Month (1-12)
|
|
275
|
+
$ts|timestamp_day_of_month // Day (1-31)
|
|
276
|
+
$ts|timestamp_hour // Hour (0-23)
|
|
277
|
+
$ts|timestamp_minute // Minute (0-59)
|
|
278
|
+
$ts|timestamp_day_of_week // Day (0=Sunday)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Array Type
|
|
284
|
+
|
|
285
|
+
Arrays with element type specification:
|
|
286
|
+
|
|
287
|
+
```xs
|
|
288
|
+
input {
|
|
289
|
+
array items // Generic array
|
|
290
|
+
array<text> tags // String array
|
|
291
|
+
array<int> scores // Integer array
|
|
292
|
+
array<object> products // Object array
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Array Operations
|
|
297
|
+
|
|
298
|
+
```xs
|
|
299
|
+
// Access elements
|
|
300
|
+
$arr|first // First element
|
|
301
|
+
$arr|last // Last element
|
|
302
|
+
$arr|count // Length
|
|
303
|
+
$arr|slice:1:3 // Elements 1-3
|
|
304
|
+
|
|
305
|
+
// Modify arrays
|
|
306
|
+
$arr|push:$item // Add to end
|
|
307
|
+
$arr|unshift:$item // Add to start
|
|
308
|
+
$arr|pop // Remove from end
|
|
309
|
+
$arr|shift // Remove from start
|
|
310
|
+
$arr|merge:$other // Combine arrays
|
|
311
|
+
$arr|unique // Remove duplicates
|
|
312
|
+
$arr|reverse // Reverse order
|
|
313
|
+
$arr|shuffle // Random order
|
|
314
|
+
|
|
315
|
+
// Functional operations
|
|
316
|
+
$arr|map:$$.value // Transform elements
|
|
317
|
+
$arr|filter:$$.active // Filter elements
|
|
318
|
+
$arr|find:$$.id==1 // Find first match
|
|
319
|
+
$arr|findIndex:$$.id==1 // Find index
|
|
320
|
+
$arr|some:$$.valid // Any match?
|
|
321
|
+
$arr|every:$$.valid // All match?
|
|
322
|
+
$arr|reduce:$$+$result:0 // Reduce to value
|
|
323
|
+
```
|