@simplepush/cli 0.1.1 → 0.2.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 +27 -0
- package/dist/main.mjs +896 -264
- package/dist/main.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ bunx @simplepush/cli events --since 24h
|
|
|
18
18
|
```
|
|
19
19
|
sp task Send a task, optionally wait for the first completion.
|
|
20
20
|
sp subtask Append a follow-up to an existing task via its append token.
|
|
21
|
+
sp cancel Withdraw a pending task, subtask, or task group you sent.
|
|
21
22
|
sp notify Send a fire-and-forget notification.
|
|
22
23
|
sp collect Collect replies, inputs, or submissions as bounded NDJSON.
|
|
23
24
|
sp download Download one file a collect line referenced, by its ids.
|
|
@@ -69,6 +70,23 @@ sp notify -t ops --content "Restart the staging cluster?" -c "Approve,Deny" \
|
|
|
69
70
|
--format json | sp collect
|
|
70
71
|
```
|
|
71
72
|
|
|
73
|
+
### Cancel what you no longer need
|
|
74
|
+
|
|
75
|
+
`sp cancel` withdraws a pending send; the id's prefix picks what: `tsk_` one task, `sub_` one follow-up (the chain stays live), `grptsk_` every still-pending member of a group. Recipients see the card flip to canceled, and a running `sp collect` counts the member as done.
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
sp cancel tsk_0198…
|
|
79
|
+
|
|
80
|
+
# tear down the rest of a group after the first useful answer
|
|
81
|
+
sp cancel grptsk_0198… --reason answered --note "already handled"
|
|
82
|
+
# → {"type":"canceled","groupId":"grptsk_…","canceled":2,"skipped":1}
|
|
83
|
+
|
|
84
|
+
# replace a follow-up with a corrected one (same chain only)
|
|
85
|
+
sp cancel sub_0198… --reason superseded --superseded-by sub_0199…
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Already-answered members are skipped, never failed; re-canceling is a no-op. With an API token it cancels a personal send, without one it uses the org session. `--note` is sealed under the org master key automatically on org cancels; on personal cancels pass `-p "pw@topic"` (topic send) or a bare `-p "pw"` (send to your own devices) to seal it.
|
|
89
|
+
|
|
72
90
|
### Download the files people upload
|
|
73
91
|
|
|
74
92
|
`--save-files` downloads every collected file (photos, voice recordings, file uploads, reply and submission files) into a directory as it streams in, decrypted and checksum-verified. Each file object on the NDJSON line gains a `path` with the saved location.
|
|
@@ -137,6 +155,15 @@ sp subtask --append-token "$TOKEN" \
|
|
|
137
155
|
-a "accept=Accept:primary,deny=Deny:destructive"
|
|
138
156
|
```
|
|
139
157
|
|
|
158
|
+
Collect its answers like any send: pipe the `sent` line, or collect after the fact by pairing the parent task id with the subtask id in `--instance` (a subtask's events arrive on the parent task, so the id needs both halves):
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
sp subtask --append-token "$TOKEN" --format json \
|
|
162
|
+
--text-input "ETA?" | sp collect --inputs
|
|
163
|
+
|
|
164
|
+
sp collect --instance tsk_0198…/sub_0198… --since 24h
|
|
165
|
+
```
|
|
166
|
+
|
|
140
167
|
### Watch your account live, or replay history
|
|
141
168
|
|
|
142
169
|
```sh
|