shipmail-cli 0.1.5 → 0.1.6
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 +4 -1
- package/dist/cli.js +25 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ shipmail newsletters preflight nws_123
|
|
|
55
55
|
shipmail newsletters schedule nws_123 --scheduled-at 2026-08-01T09:00:00.000Z
|
|
56
56
|
shipmail newsletter-assets list --kind image
|
|
57
57
|
shipmail newsletter-assets upload ./hero.png --content-type image/png
|
|
58
|
+
shipmail newsletter-assets register-url https://cdn.shipmail.to/newsletter-images/org_123/hero.png
|
|
58
59
|
|
|
59
60
|
# Manage webhooks
|
|
60
61
|
shipmail webhooks create \
|
|
@@ -63,6 +64,8 @@ shipmail webhooks create \
|
|
|
63
64
|
shipmail webhooks deliveries whk_123 --status failed
|
|
64
65
|
```
|
|
65
66
|
|
|
67
|
+
`newsletter-assets list` includes current newsletter media storage usage in the JSON response.
|
|
68
|
+
|
|
66
69
|
## Generic API Command
|
|
67
70
|
|
|
68
71
|
The `api` command reaches every Shipmail REST endpoint, including endpoints that do not have a shorthand command yet.
|
|
@@ -91,6 +94,6 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
|
|
|
91
94
|
- `suppressions list|remove`
|
|
92
95
|
- `newsletter-domains list`
|
|
93
96
|
- `newsletters create|update|preview|preflight|test-send|schedule|cancel|resume`
|
|
94
|
-
- `newsletter-assets list|upload`
|
|
97
|
+
- `newsletter-assets list|upload|register-url`
|
|
95
98
|
|
|
96
99
|
Run `shipmail --help` for flags and examples.
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "shipmail";
|
|
13
13
|
|
|
14
14
|
// src/version.ts
|
|
15
|
-
var VERSION = "0.1.
|
|
15
|
+
var VERSION = "0.1.6";
|
|
16
16
|
|
|
17
17
|
// src/cli.ts
|
|
18
18
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -343,6 +343,7 @@ Usage:
|
|
|
343
343
|
shipmail newsletters resume <id>
|
|
344
344
|
shipmail newsletter-assets list [--kind image|video] [--q text] [--limit 25] [--cursor cur]
|
|
345
345
|
shipmail newsletter-assets upload <file> [--filename name] [--content-type type]
|
|
346
|
+
shipmail newsletter-assets register-url <url> [--filename name] [--thumbnail-url url]
|
|
346
347
|
shipmail newsletter-domains list [--limit 25] [--cursor cur]
|
|
347
348
|
shipmail audiences list [--limit 25] [--cursor cur]
|
|
348
349
|
shipmail audiences create <name> --consent-source "Signup form" [--description "..."]
|
|
@@ -355,6 +356,7 @@ Usage:
|
|
|
355
356
|
shipmail audiences subscribers by-email <audience-id> <email>
|
|
356
357
|
shipmail audiences subscribers update <audience-id> <subscriber-id> [--name "..."]
|
|
357
358
|
shipmail audiences subscribers unsubscribe <audience-id> <subscriber-id>
|
|
359
|
+
shipmail audiences subscribers resubscribe <audience-id> <subscriber-id> --consent-source "Signup form"
|
|
358
360
|
shipmail audiences subscribers remove <audience-id> <subscriber-id>
|
|
359
361
|
|
|
360
362
|
Global options:
|
|
@@ -777,6 +779,17 @@ async function runSubscribers(client, parsed, out) {
|
|
|
777
779
|
);
|
|
778
780
|
return;
|
|
779
781
|
}
|
|
782
|
+
if (action === "resubscribe") {
|
|
783
|
+
writeJson(
|
|
784
|
+
out,
|
|
785
|
+
await client.audiences.subscribers.resubscribe(
|
|
786
|
+
audienceId,
|
|
787
|
+
requirePositional(parsed.positional, 4, "subscriber id"),
|
|
788
|
+
{ consent_source: getRequiredString(parsed.options, "consent-source") }
|
|
789
|
+
)
|
|
790
|
+
);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
780
793
|
if (action === "remove") {
|
|
781
794
|
const subscriberId = requirePositional(parsed.positional, 4, "subscriber id");
|
|
782
795
|
await client.audiences.subscribers.remove(audienceId, subscriberId);
|
|
@@ -948,6 +961,17 @@ async function runNewsletterAssets(client, parsed, out) {
|
|
|
948
961
|
);
|
|
949
962
|
return;
|
|
950
963
|
}
|
|
964
|
+
if (subcommand === "register-url") {
|
|
965
|
+
writeJson(
|
|
966
|
+
out,
|
|
967
|
+
await client.newsletters.assets.registerFromUrl({
|
|
968
|
+
url: requirePositional(parsed.positional, 2, "url"),
|
|
969
|
+
filename: getString(parsed.options, "filename"),
|
|
970
|
+
thumbnail_url: getString(parsed.options, "thumbnail-url")
|
|
971
|
+
})
|
|
972
|
+
);
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
951
975
|
throw new CliUsageError("Unknown newsletter-assets command.");
|
|
952
976
|
}
|
|
953
977
|
function writeError(err, errOut) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipmail-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Official CLI for the ShipMail API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"shipmail": "0.1.
|
|
44
|
+
"shipmail": "0.1.29"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.4.0",
|