@xano/developer-mcp 1.0.31 → 1.0.33
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 +172 -9
- package/dist/cli_docs/topics/workspace.js +50 -6
- package/dist/index.d.ts +8 -0
- package/dist/index.js +14 -286
- package/dist/lib.d.ts +53 -0
- package/dist/lib.js +71 -0
- package/dist/tools/cli_docs.d.ts +40 -0
- package/dist/tools/cli_docs.js +68 -0
- package/dist/tools/index.d.ts +91 -0
- package/dist/tools/index.js +104 -0
- package/dist/tools/mcp_version.d.ts +45 -0
- package/dist/tools/mcp_version.js +94 -0
- package/dist/tools/meta_api_docs.d.ts +41 -0
- package/dist/tools/meta_api_docs.js +69 -0
- package/dist/tools/run_api_docs.d.ts +46 -0
- package/dist/tools/run_api_docs.js +69 -0
- package/dist/tools/types.d.ts +18 -0
- package/dist/tools/types.js +17 -0
- package/dist/tools/validate_xanoscript.d.ts +68 -0
- package/dist/tools/validate_xanoscript.js +114 -0
- package/dist/tools/xanoscript_docs.d.ts +72 -0
- package/dist/tools/xanoscript_docs.js +129 -0
- package/dist/xanoscript_docs/README.md +67 -31
- package/dist/xanoscript_docs/addons.md +2 -2
- package/dist/xanoscript_docs/agents.md +2 -2
- package/dist/xanoscript_docs/apis.md +9 -7
- package/dist/xanoscript_docs/branch.md +5 -4
- package/dist/xanoscript_docs/database.md +1 -1
- package/dist/xanoscript_docs/functions.md +2 -2
- package/dist/xanoscript_docs/integrations.md +1 -1
- package/dist/xanoscript_docs/mcp-servers.md +12 -12
- package/dist/xanoscript_docs/performance.md +1 -1
- package/dist/xanoscript_docs/realtime.md +1 -1
- package/dist/xanoscript_docs/run.md +15 -14
- package/dist/xanoscript_docs/schema.md +1 -1
- package/dist/xanoscript_docs/security.md +1 -1
- package/dist/xanoscript_docs/streaming.md +114 -92
- package/dist/xanoscript_docs/tables.md +1 -1
- package/dist/xanoscript_docs/tasks.md +16 -8
- package/dist/xanoscript_docs/testing.md +1 -1
- package/dist/xanoscript_docs/tools.md +1 -1
- package/dist/xanoscript_docs/triggers.md +1 -1
- package/dist/xanoscript_docs/types.md +1 -1
- package/dist/xanoscript_docs/workspace.md +6 -5
- package/package.json +22 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "
|
|
2
|
+
applyTo: "agent/**/*.xs"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Agents
|
|
@@ -186,7 +186,7 @@ agent "Classifier" {
|
|
|
186
186
|
|
|
187
187
|
## Tools
|
|
188
188
|
|
|
189
|
-
Reference tools by name from `
|
|
189
|
+
Reference tools by name from `tool/` directory:
|
|
190
190
|
|
|
191
191
|
```xs
|
|
192
192
|
tools = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "
|
|
2
|
+
applyTo: "api/**/*.xs"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# APIs
|
|
@@ -77,16 +77,18 @@ api_group Authentication {
|
|
|
77
77
|
### File Structure
|
|
78
78
|
|
|
79
79
|
```
|
|
80
|
-
|
|
80
|
+
api/
|
|
81
81
|
├── users/
|
|
82
|
-
│ ├── api_group.xs
|
|
83
|
-
│ ├──
|
|
84
|
-
│ └──
|
|
82
|
+
│ ├── api_group.xs # Defines group (canonical = "myapp-users")
|
|
83
|
+
│ ├── list_get.xs # GET /myapp-users/list
|
|
84
|
+
│ └── by_id_get.xs # GET /myapp-users/{id}
|
|
85
85
|
└── products/
|
|
86
|
-
├── api_group.xs
|
|
87
|
-
└──
|
|
86
|
+
├── api_group.xs # Defines group (canonical = "myapp-products")
|
|
87
|
+
└── search_get.xs # GET /myapp-products/search
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
**Naming convention:** Endpoint files use `{name}_{verb}.xs` format (e.g., `list_get.xs`, `create_post.xs`).
|
|
91
|
+
|
|
90
92
|
Full URL: `/<canonical>/<query name>` (e.g., `/myapp-users/profile`)
|
|
91
93
|
|
|
92
94
|
---
|
|
@@ -222,10 +222,11 @@ Branch configuration files are typically named `branch.xs` and placed at the wor
|
|
|
222
222
|
|
|
223
223
|
```
|
|
224
224
|
project/
|
|
225
|
-
├── branch.xs
|
|
226
|
-
├──
|
|
227
|
-
├──
|
|
228
|
-
|
|
225
|
+
├── branch.xs # Branch configuration
|
|
226
|
+
├── workspace/
|
|
227
|
+
├── table/
|
|
228
|
+
├── function/
|
|
229
|
+
└── api/
|
|
229
230
|
```
|
|
230
231
|
|
|
231
232
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "
|
|
2
|
+
applyTo: "function/**/*.xs"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Functions
|
|
@@ -62,7 +62,7 @@ function "calculate_total" {
|
|
|
62
62
|
Functions can be organized in subfolders:
|
|
63
63
|
|
|
64
64
|
```
|
|
65
|
-
|
|
65
|
+
function/
|
|
66
66
|
├── math/
|
|
67
67
|
│ ├── add.xs
|
|
68
68
|
│ └── multiply.xs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "
|
|
2
|
+
applyTo: "mcp_server/**/*.xs"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# MCP Servers
|
|
@@ -52,7 +52,7 @@ mcp_server "Customer Support" {
|
|
|
52
52
|
|
|
53
53
|
## Tools Block
|
|
54
54
|
|
|
55
|
-
Reference tools from `
|
|
55
|
+
Reference tools from `tool/` directory by name:
|
|
56
56
|
|
|
57
57
|
```xs
|
|
58
58
|
tools = [
|
|
@@ -62,7 +62,7 @@ tools = [
|
|
|
62
62
|
]
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
Tool names must exactly match `.xs` file names in `
|
|
65
|
+
Tool names must exactly match `.xs` file names in `tool/`.
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
@@ -146,19 +146,19 @@ mcp_server "CRM" {
|
|
|
146
146
|
|
|
147
147
|
### By Domain
|
|
148
148
|
```
|
|
149
|
-
|
|
150
|
-
├── support.xs
|
|
151
|
-
├── ecommerce.xs
|
|
152
|
-
├── analytics.xs
|
|
153
|
-
└── admin.xs
|
|
149
|
+
mcp_server/
|
|
150
|
+
├── support.xs # Customer support tools
|
|
151
|
+
├── ecommerce.xs # Store management
|
|
152
|
+
├── analytics.xs # Reporting and metrics
|
|
153
|
+
└── admin.xs # Administrative functions
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
### By Access Level
|
|
157
157
|
```
|
|
158
|
-
|
|
159
|
-
├── public.xs
|
|
160
|
-
├── authenticated.xs
|
|
161
|
-
└── admin.xs
|
|
158
|
+
mcp_server/
|
|
159
|
+
├── public.xs # Public-facing tools
|
|
160
|
+
├── authenticated.xs # Requires auth
|
|
161
|
+
└── admin.xs # Admin-only tools
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
---
|
|
@@ -16,9 +16,9 @@ Define job and service configurations for the Xano Job Runner.
|
|
|
16
16
|
### Directory Structure
|
|
17
17
|
```
|
|
18
18
|
run.xs
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
table/
|
|
20
|
+
function/
|
|
21
|
+
api/
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
---
|
|
@@ -216,9 +216,9 @@ function "process_data" {
|
|
|
216
216
|
|
|
217
217
|
```
|
|
218
218
|
run.xs
|
|
219
|
-
|
|
219
|
+
table/
|
|
220
220
|
└── users.xs
|
|
221
|
-
|
|
221
|
+
function/
|
|
222
222
|
└── migrate_users.xs
|
|
223
223
|
```
|
|
224
224
|
|
|
@@ -235,7 +235,7 @@ run.job "Data Migration" {
|
|
|
235
235
|
}
|
|
236
236
|
```
|
|
237
237
|
|
|
238
|
-
###
|
|
238
|
+
### table/users.xs
|
|
239
239
|
```xs
|
|
240
240
|
table users {
|
|
241
241
|
auth = false
|
|
@@ -255,7 +255,7 @@ table users {
|
|
|
255
255
|
}
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
###
|
|
258
|
+
### function/migrate_users.xs
|
|
259
259
|
```xs
|
|
260
260
|
function "migrate_users" {
|
|
261
261
|
input {
|
|
@@ -287,12 +287,13 @@ function "migrate_users" {
|
|
|
287
287
|
|
|
288
288
|
```
|
|
289
289
|
run.xs
|
|
290
|
-
|
|
290
|
+
table/
|
|
291
291
|
└── event.xs
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
├──
|
|
295
|
-
|
|
292
|
+
api/
|
|
293
|
+
└── events/
|
|
294
|
+
├── api_group.xs
|
|
295
|
+
├── list_get.xs
|
|
296
|
+
└── add_post.xs
|
|
296
297
|
```
|
|
297
298
|
|
|
298
299
|
### run.xs
|
|
@@ -306,7 +307,7 @@ run.service "Event Tracker" {
|
|
|
306
307
|
}
|
|
307
308
|
```
|
|
308
309
|
|
|
309
|
-
###
|
|
310
|
+
### table/event.xs
|
|
310
311
|
```xs
|
|
311
312
|
table event {
|
|
312
313
|
auth = false
|
|
@@ -322,7 +323,7 @@ table event {
|
|
|
322
323
|
}
|
|
323
324
|
```
|
|
324
325
|
|
|
325
|
-
###
|
|
326
|
+
### api/events/list_get.xs
|
|
326
327
|
```xs
|
|
327
328
|
query list verb=GET {
|
|
328
329
|
api_group = "events"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "
|
|
2
|
+
applyTo: "function/**/*.xs, api/**/*.xs"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Streaming Operations
|
|
@@ -8,32 +8,35 @@ Stream data from files, requests, and to API responses.
|
|
|
8
8
|
|
|
9
9
|
## Quick Reference
|
|
10
10
|
|
|
11
|
-
| Operation
|
|
12
|
-
|
|
13
|
-
| `stream.from_csv`
|
|
14
|
-
| `stream.from_jsonl`
|
|
15
|
-
| `stream.from_request` | Stream HTTP request body
|
|
16
|
-
| `api.stream`
|
|
11
|
+
| Operation | Purpose | Input |
|
|
12
|
+
| --------------------- | ------------------------- | -------------- |
|
|
13
|
+
| `stream.from_csv` | Parse CSV stream | File or string |
|
|
14
|
+
| `stream.from_jsonl` | Parse JSONL stream | File or string |
|
|
15
|
+
| `stream.from_request` | Stream HTTP request body | Request |
|
|
16
|
+
| `api.stream` | Stream response to client | Data |
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
## stream.from_csv
|
|
21
21
|
|
|
22
|
-
Parse CSV data as a stream
|
|
22
|
+
Parse CSV data as a stream. Returns a stream value (like a generator) that is then iterated with `foreach`.
|
|
23
23
|
|
|
24
24
|
```xs
|
|
25
25
|
stream.from_csv {
|
|
26
26
|
value = $input.csv_file
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} as $
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
separator = ","
|
|
28
|
+
enclosure = '"'
|
|
29
|
+
escape_char = '"'
|
|
30
|
+
} as $stream
|
|
31
|
+
|
|
32
|
+
foreach ($stream) {
|
|
33
|
+
each as $row {
|
|
34
|
+
db.add "import_record" {
|
|
35
|
+
data = {
|
|
36
|
+
name: $row.name,
|
|
37
|
+
email: $row.email,
|
|
38
|
+
created_at: now
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -41,13 +44,13 @@ stream.from_csv {
|
|
|
41
44
|
|
|
42
45
|
### Parameters
|
|
43
46
|
|
|
44
|
-
| Parameter
|
|
45
|
-
|
|
46
|
-
| `value`
|
|
47
|
-
| `headers`
|
|
48
|
-
| `
|
|
49
|
-
| `enclosure`
|
|
50
|
-
| `
|
|
47
|
+
| Parameter | Type | Default | Description |
|
|
48
|
+
| ------------- | --------- | -------- | -------------------------- |
|
|
49
|
+
| `value` | file/text | required | CSV file or string |
|
|
50
|
+
| `headers` | bool | `true` | First row contains headers |
|
|
51
|
+
| `separator` | text | `,` | Field separator |
|
|
52
|
+
| `enclosure` | text | `"` | Field enclosure character |
|
|
53
|
+
| `escape_char` | text | `"` | Escape character |
|
|
51
54
|
|
|
52
55
|
### With Custom Headers
|
|
53
56
|
|
|
@@ -55,10 +58,14 @@ stream.from_csv {
|
|
|
55
58
|
stream.from_csv {
|
|
56
59
|
value = $input.file
|
|
57
60
|
headers = false
|
|
58
|
-
} as $
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
} as $stream
|
|
62
|
+
|
|
63
|
+
foreach ($stream) {
|
|
64
|
+
each as $row {
|
|
65
|
+
// Access by index: $row.0, $row.1, etc.
|
|
66
|
+
var $name { value = $row.0 }
|
|
67
|
+
var $email { value = $row.1 }
|
|
68
|
+
}
|
|
62
69
|
}
|
|
63
70
|
```
|
|
64
71
|
|
|
@@ -66,18 +73,21 @@ stream.from_csv {
|
|
|
66
73
|
|
|
67
74
|
## stream.from_jsonl
|
|
68
75
|
|
|
69
|
-
Parse JSON Lines (newline-delimited JSON) as a stream.
|
|
76
|
+
Parse JSON Lines (newline-delimited JSON) as a stream. Returns a stream value iterated with `foreach`.
|
|
70
77
|
|
|
71
78
|
```xs
|
|
72
79
|
stream.from_jsonl {
|
|
73
80
|
value = $input.jsonl_file
|
|
74
|
-
} as $
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
} as $stream
|
|
82
|
+
|
|
83
|
+
foreach ($stream) {
|
|
84
|
+
each as $record {
|
|
85
|
+
db.add "event" {
|
|
86
|
+
data = {
|
|
87
|
+
event_type: $record.type,
|
|
88
|
+
payload: $record.data,
|
|
89
|
+
timestamp: $record.ts
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
}
|
|
@@ -85,9 +95,9 @@ stream.from_jsonl {
|
|
|
85
95
|
|
|
86
96
|
### Parameters
|
|
87
97
|
|
|
88
|
-
| Parameter | Type
|
|
89
|
-
|
|
90
|
-
| `value`
|
|
98
|
+
| Parameter | Type | Default | Description |
|
|
99
|
+
| --------- | --------- | -------- | -------------------- |
|
|
100
|
+
| `value` | file/text | required | JSONL file or string |
|
|
91
101
|
|
|
92
102
|
### Example JSONL Format
|
|
93
103
|
|
|
@@ -101,24 +111,27 @@ stream.from_jsonl {
|
|
|
101
111
|
|
|
102
112
|
## stream.from_request
|
|
103
113
|
|
|
104
|
-
Stream the incoming HTTP request body for large uploads.
|
|
114
|
+
Stream the incoming HTTP request body for large uploads. Returns a stream value iterated with `foreach`.
|
|
105
115
|
|
|
106
116
|
```xs
|
|
107
117
|
stream.from_request {
|
|
108
118
|
format = "jsonl"
|
|
109
|
-
} as $
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
} as $stream
|
|
120
|
+
|
|
121
|
+
foreach ($stream) {
|
|
122
|
+
each as $record {
|
|
123
|
+
db.add "log" { data = $record }
|
|
124
|
+
}
|
|
112
125
|
}
|
|
113
126
|
```
|
|
114
127
|
|
|
115
128
|
### Parameters
|
|
116
129
|
|
|
117
|
-
| Parameter
|
|
118
|
-
|
|
119
|
-
| `format`
|
|
120
|
-
| `headers`
|
|
121
|
-
| `
|
|
130
|
+
| Parameter | Type | Options | Description |
|
|
131
|
+
| ----------- | ---- | --------------------- | --------------- |
|
|
132
|
+
| `format` | text | `jsonl`, `csv`, `raw` | Body format |
|
|
133
|
+
| `headers` | bool | `true` (csv) | CSV has headers |
|
|
134
|
+
| `separator` | text | `,` (csv) | CSV separator |
|
|
122
135
|
|
|
123
136
|
### Raw Chunks
|
|
124
137
|
|
|
@@ -126,11 +139,14 @@ stream.from_request {
|
|
|
126
139
|
stream.from_request {
|
|
127
140
|
format = "raw"
|
|
128
141
|
chunk_size = 8192
|
|
129
|
-
} as $
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
142
|
+
} as $stream
|
|
143
|
+
|
|
144
|
+
foreach ($stream) {
|
|
145
|
+
each as $chunk {
|
|
146
|
+
storage.append_file {
|
|
147
|
+
pathname = "uploads/large_file.bin"
|
|
148
|
+
data = $chunk
|
|
149
|
+
}
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
152
|
```
|
|
@@ -207,12 +223,12 @@ query "live_updates" {
|
|
|
207
223
|
|
|
208
224
|
### Parameters
|
|
209
225
|
|
|
210
|
-
| Parameter
|
|
211
|
-
|
|
212
|
-
| `format`
|
|
213
|
-
| `value`
|
|
214
|
-
| `headers`
|
|
215
|
-
| `filename` | text
|
|
226
|
+
| Parameter | Type | Options | Description |
|
|
227
|
+
| ---------- | ------ | ---------------------------- | --------------------------- |
|
|
228
|
+
| `format` | text | `jsonl`, `csv`, `sse`, `raw` | Stream format |
|
|
229
|
+
| `value` | stream | optional | Data source for jsonl/csv |
|
|
230
|
+
| `headers` | text[] | optional | CSV column headers |
|
|
231
|
+
| `filename` | text | optional | Suggested download filename |
|
|
216
232
|
|
|
217
233
|
---
|
|
218
234
|
|
|
@@ -222,31 +238,35 @@ query "live_updates" {
|
|
|
222
238
|
|
|
223
239
|
```xs
|
|
224
240
|
function "import_large_csv" {
|
|
225
|
-
input {
|
|
226
|
-
file csv_file
|
|
227
|
-
}
|
|
241
|
+
input { file csv_file }
|
|
228
242
|
stack {
|
|
229
243
|
var $processed { value = 0 }
|
|
230
244
|
var $errors { value = [] }
|
|
231
245
|
|
|
232
246
|
stream.from_csv {
|
|
233
247
|
value = $input.csv_file
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
248
|
+
separator = ","
|
|
249
|
+
enclosure = '"'
|
|
250
|
+
escape_char = '"'
|
|
251
|
+
} as $stream
|
|
252
|
+
|
|
253
|
+
foreach ($stream) {
|
|
254
|
+
each as $row {
|
|
255
|
+
try_catch {
|
|
256
|
+
try {
|
|
257
|
+
db.add "record" {
|
|
258
|
+
data = {
|
|
259
|
+
name: $row.name|trim,
|
|
260
|
+
email: $row.email|trim|lower,
|
|
261
|
+
created_at: now
|
|
262
|
+
}
|
|
243
263
|
}
|
|
264
|
+
math.add $processed { value = 1 }
|
|
244
265
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
value = $errors|push:{ row: $processed, error: $error.message }
|
|
266
|
+
catch {
|
|
267
|
+
var.update $errors {
|
|
268
|
+
value = $errors|push:{ row: $processed, error: $error.message }
|
|
269
|
+
}
|
|
250
270
|
}
|
|
251
271
|
}
|
|
252
272
|
}
|
|
@@ -260,26 +280,28 @@ function "import_large_csv" {
|
|
|
260
280
|
|
|
261
281
|
```xs
|
|
262
282
|
function "etl_events" {
|
|
263
|
-
input {
|
|
264
|
-
file events_file
|
|
265
|
-
}
|
|
283
|
+
input { file events_file }
|
|
266
284
|
stack {
|
|
267
285
|
stream.from_jsonl {
|
|
268
286
|
value = $input.events_file
|
|
269
|
-
} as $
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
287
|
+
} as $stream
|
|
288
|
+
|
|
289
|
+
foreach ($stream) {
|
|
290
|
+
each as $event {
|
|
291
|
+
// Transform
|
|
292
|
+
var $transformed {
|
|
293
|
+
value = {
|
|
294
|
+
event_type: $event.type|to_lower,
|
|
295
|
+
user_id: $event.user_id|to_int,
|
|
296
|
+
metadata: $event.data|json_encode,
|
|
297
|
+
occurred_at: $event.timestamp|to_timestamp
|
|
298
|
+
}
|
|
277
299
|
}
|
|
278
|
-
}
|
|
279
300
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
301
|
+
// Load
|
|
302
|
+
db.add "processed_event" {
|
|
303
|
+
data = $transformed
|
|
304
|
+
}
|
|
283
305
|
}
|
|
284
306
|
}
|
|
285
307
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "
|
|
2
|
+
applyTo: "task/**/*.xs"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Tasks
|
|
@@ -17,13 +17,14 @@ task "<name>" {
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
### Common Frequencies
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
20
|
+
|
|
21
|
+
| Interval | Seconds |
|
|
22
|
+
| --------- | ------- |
|
|
23
|
+
| 1 minute | 60 |
|
|
24
|
+
| 5 minutes | 300 |
|
|
25
|
+
| 1 hour | 3600 |
|
|
26
|
+
| Daily | 86400 |
|
|
27
|
+
| Weekly | 604800 |
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -57,11 +58,13 @@ task "daily_cleanup" {
|
|
|
57
58
|
## Schedule Configuration
|
|
58
59
|
|
|
59
60
|
### Single Event
|
|
61
|
+
|
|
60
62
|
```xs
|
|
61
63
|
schedule = [{starts_on: 2025-06-15 09:00:00+0000, freq: 86400}]
|
|
62
64
|
```
|
|
63
65
|
|
|
64
66
|
### With End Date
|
|
67
|
+
|
|
65
68
|
```xs
|
|
66
69
|
schedule = [{
|
|
67
70
|
starts_on: 2025-01-01 08:00:00+0000,
|
|
@@ -71,6 +74,7 @@ schedule = [{
|
|
|
71
74
|
```
|
|
72
75
|
|
|
73
76
|
### Multiple Schedules
|
|
77
|
+
|
|
74
78
|
```xs
|
|
75
79
|
schedule = [
|
|
76
80
|
{starts_on: 2025-01-01 09:00:00+0000, freq: 86400},
|
|
@@ -83,6 +87,7 @@ schedule = [
|
|
|
83
87
|
## Common Patterns
|
|
84
88
|
|
|
85
89
|
### Data Aggregation
|
|
90
|
+
|
|
86
91
|
```xs
|
|
87
92
|
task "hourly_stats" {
|
|
88
93
|
description = "Aggregate hourly statistics"
|
|
@@ -106,6 +111,7 @@ task "hourly_stats" {
|
|
|
106
111
|
```
|
|
107
112
|
|
|
108
113
|
### Cleanup Job
|
|
114
|
+
|
|
109
115
|
```xs
|
|
110
116
|
task "cleanup_temp_files" {
|
|
111
117
|
description = "Delete temporary files older than 24 hours"
|
|
@@ -131,6 +137,7 @@ task "cleanup_temp_files" {
|
|
|
131
137
|
```
|
|
132
138
|
|
|
133
139
|
### Notification Job
|
|
140
|
+
|
|
134
141
|
```xs
|
|
135
142
|
task "daily_digest" {
|
|
136
143
|
description = "Send daily digest emails"
|
|
@@ -166,6 +173,7 @@ task "daily_digest" {
|
|
|
166
173
|
```
|
|
167
174
|
|
|
168
175
|
### External API Sync
|
|
176
|
+
|
|
169
177
|
```xs
|
|
170
178
|
task "sync_exchange_rates" {
|
|
171
179
|
description = "Sync currency exchange rates every hour"
|