wawesome 0.6.0 → 0.8.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.
- package/README.md +85 -2
- package/dist/index.mjs +1063 -109
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,6 +106,11 @@ npx wawesome deploy
|
|
|
106
106
|
| `npx wawesome logs [func]` | List recent past invocations for a function |
|
|
107
107
|
| `npx wawesome logs --invocation <id>` | Fetch full stdout/stderr log body for a specific invocation |
|
|
108
108
|
| `npx wawesome logs <func> --follow` | Follow live output (waits for the next invocation if needed) |
|
|
109
|
+
| `npx wawesome invoke [func]` | Fire a function run immediately and follow its output live |
|
|
110
|
+
| `npx wawesome cron [func]` | List schedules for a function or app |
|
|
111
|
+
| `npx wawesome cron pause <name>` | Pause a schedule by name (survives future deploys) |
|
|
112
|
+
| `npx wawesome cron resume <name>` | Resume a paused schedule (no backfill) |
|
|
113
|
+
| `npx wawesome cron history [func]` | Read background run history for scheduled and manual runs |
|
|
109
114
|
| `npx wawesome version list` | List version history for the current function |
|
|
110
115
|
| `npx wawesome version switch <v>` | Roll back or promote a specific function version |
|
|
111
116
|
| `npx wawesome env list` | View environment variables for the current app |
|
|
@@ -203,6 +208,77 @@ exponential back-off (up to 3 retries). Non-recoverable errors like authenticati
|
|
|
203
208
|
|
|
204
209
|
---
|
|
205
210
|
|
|
211
|
+
## ⚡ Manual Invocation
|
|
212
|
+
|
|
213
|
+
Fire a background run of a Function immediately without waiting for a schedule tick or deploying code:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Invoke the function in the current directory and follow its output
|
|
217
|
+
npx wawesome invoke
|
|
218
|
+
|
|
219
|
+
# Invoke a specific function by name
|
|
220
|
+
npx wawesome invoke my-function
|
|
221
|
+
|
|
222
|
+
# Send custom HTTP method and request body
|
|
223
|
+
npx wawesome invoke -m POST -d '{"event":"audit"}'
|
|
224
|
+
|
|
225
|
+
# Fire without following live output
|
|
226
|
+
npx wawesome invoke --no-follow
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## ⏰ Schedules & Cron Management
|
|
232
|
+
|
|
233
|
+
Manage recurring Schedules and inspect background run history directly from your terminal.
|
|
234
|
+
|
|
235
|
+
### 1. List Schedules
|
|
236
|
+
|
|
237
|
+
List a Function's Schedules with expression, state, and next run in UTC:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# List schedules for the function in the current directory
|
|
241
|
+
npx wawesome cron
|
|
242
|
+
|
|
243
|
+
# List schedules for a specific function
|
|
244
|
+
npx wawesome cron list my-function
|
|
245
|
+
|
|
246
|
+
# List schedules across all functions in an App
|
|
247
|
+
npx wawesome cron list --app my-app
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The output clearly distinguishes the three off-states:
|
|
251
|
+
- `paused`: stopped by a user, resumable with `wawesome cron resume <name>`
|
|
252
|
+
- `not in this config file`: disabled because it was removed from configuration, resumable only by declaring it again in code
|
|
253
|
+
- `suspended`: suspended by the non-payment ladder, resumable only after settling workspace balance
|
|
254
|
+
|
|
255
|
+
### 2. Pause and Resume Schedules
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Pause a schedule by name (stops queued ticks and survives future deploys)
|
|
259
|
+
npx wawesome cron pause nightly-reconcile
|
|
260
|
+
|
|
261
|
+
# Pause with an optional reason for incident context
|
|
262
|
+
npx wawesome cron pause nightly-reconcile --reason "database maintenance"
|
|
263
|
+
|
|
264
|
+
# Resume a paused schedule (recomputes next run from now, no catch-up backfilling)
|
|
265
|
+
npx wawesome cron resume nightly-reconcile
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 3. Read Run History
|
|
269
|
+
|
|
270
|
+
Inspect past scheduled and manual runs, showing when each run was due, when it started, pool delay, and how it ended:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# View run history for the current function
|
|
274
|
+
npx wawesome cron history
|
|
275
|
+
|
|
276
|
+
# Filter run history by state (pending, running, dispatched, skipped, missed, cancelled, lost, failed)
|
|
277
|
+
npx wawesome cron history my-function --state failed
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
206
282
|
## ⚙️ Configuration & Custom Gateway
|
|
207
283
|
|
|
208
284
|
### `wawesome-function.json`
|
|
@@ -220,6 +296,12 @@ Every project directory includes a `wawesome-function.json` file generated durin
|
|
|
220
296
|
`app` is the App this Function is deployed into, and it is client-facing — every deploy from this
|
|
221
297
|
directory is scoped to it.
|
|
222
298
|
|
|
299
|
+
`function` is the address. Changing it does not rename anything: your Function's URL is built from
|
|
300
|
+
its name, so the next deploy lands on a Function of its own and the old one stays live at the old
|
|
301
|
+
URL, serving the code its callers already hold. The CLI remembers where this directory last
|
|
302
|
+
deployed and asks before that happens, naming both URLs. If you meant it, delete the old Function
|
|
303
|
+
from the dashboard once nothing calls it.
|
|
304
|
+
|
|
223
305
|
Add `"assets"` to deploy static files beside your code:
|
|
224
306
|
|
|
225
307
|
```json
|
|
@@ -330,8 +412,9 @@ curl -X POST http://localhost:3000/x/my-tenant-slug/default-app/nightly-reconcil
|
|
|
330
412
|
-H "x-wawesome-trigger: schedule"
|
|
331
413
|
```
|
|
332
414
|
|
|
333
|
-
|
|
334
|
-
|
|
415
|
+
Production strips the reserved header namespace inbound, so the same header against your App's own
|
|
416
|
+
hostname reaches nothing that reads it: the run is a `caller`'s, and a private Function is a 404
|
|
417
|
+
either way. Skipping your own authorization for a `schedule` run therefore opens nothing.
|
|
335
418
|
|
|
336
419
|
Making a Function private takes nothing but the deploy. Making it public again does not: deleting
|
|
337
420
|
the line is refused, and the deploy tells you so having written nothing.
|