shipmail-cli 0.4.2 → 0.4.4
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 +12 -3
- package/dist/cli.js +33 -13
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -97,11 +97,11 @@ shipmail reply-scans create --mailbox-id 550e8400-e29b-41d4-a716-446655440000 --
|
|
|
97
97
|
shipmail reply-scans status rsc_123
|
|
98
98
|
shipmail reply-scans results rsc_123 --limit 100
|
|
99
99
|
|
|
100
|
-
# Find
|
|
101
|
-
shipmail newsletter-
|
|
100
|
+
# Find reusable sender identity IDs, then create a draft with blocks
|
|
101
|
+
shipmail newsletter-sender-identities list
|
|
102
102
|
shipmail newsletters create \
|
|
103
103
|
--audience-id aud_123 \
|
|
104
|
-
--
|
|
104
|
+
--sender-identity-id nwsid_456 \
|
|
105
105
|
--name "July changelog" \
|
|
106
106
|
--subject "What shipped in July" \
|
|
107
107
|
--blocks @blocks.json
|
|
@@ -162,6 +162,7 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
|
|
|
162
162
|
- `audiences list|create|get|update|delete`
|
|
163
163
|
- `audiences feed get|update|rotate|revoke`
|
|
164
164
|
- `audiences subscribers add|list|get|by-email|update|unsubscribe|resubscribe|remove`
|
|
165
|
+
- `newsletter-sender-identities list`
|
|
165
166
|
- `newsletter-domains list`
|
|
166
167
|
- `newsletters create|update|preview|preflight|test-send|schedule|cancel|resume`
|
|
167
168
|
- `newsletter-assets list|upload|register-url`
|
|
@@ -169,4 +170,12 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
|
|
|
169
170
|
- `partner credential-grants list|consume`
|
|
170
171
|
- `partner usage`
|
|
171
172
|
|
|
173
|
+
Configure a publisher-owned Atom self URL and the number of recent issues:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
shipmail audiences feed update aud_123 \
|
|
177
|
+
--canonical-url https://example.com/feed.xml \
|
|
178
|
+
--entry-limit 25
|
|
179
|
+
```
|
|
180
|
+
|
|
172
181
|
Run `shipmail --help` for flags and examples.
|
package/dist/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "shipmail";
|
|
15
15
|
|
|
16
16
|
// src/version.ts
|
|
17
|
-
var VERSION = "0.4.
|
|
17
|
+
var VERSION = "0.4.4";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -187,7 +187,7 @@ function parseStylingMode(options) {
|
|
|
187
187
|
}
|
|
188
188
|
async function newsletterCreateParams(options) {
|
|
189
189
|
const audience_id = getRequiredString(options, "audience-id");
|
|
190
|
-
const
|
|
190
|
+
const sender_identity_id = getRequiredString(options, "sender-identity-id");
|
|
191
191
|
const name = getRequiredString(options, "name");
|
|
192
192
|
const subject = getRequiredString(options, "subject");
|
|
193
193
|
const blocksInput = getString(options, "blocks");
|
|
@@ -203,14 +203,12 @@ async function newsletterCreateParams(options) {
|
|
|
203
203
|
const archive_visibility = parseArchiveVisibility(options);
|
|
204
204
|
const styling_mode = parseStylingMode(options);
|
|
205
205
|
const preview_text = getString(options, "preview-text");
|
|
206
|
-
const from_name = getString(options, "from-name");
|
|
207
206
|
return {
|
|
208
207
|
audience_id,
|
|
209
|
-
|
|
208
|
+
sender_identity_id,
|
|
210
209
|
name,
|
|
211
210
|
subject,
|
|
212
211
|
...preview_text !== void 0 ? { preview_text } : {},
|
|
213
|
-
...from_name !== void 0 ? { from_name } : {},
|
|
214
212
|
...blocks ? { blocks } : {},
|
|
215
213
|
...body_html !== void 0 ? { body_html } : {},
|
|
216
214
|
...body_text !== void 0 ? { body_text } : {},
|
|
@@ -221,11 +219,10 @@ async function newsletterCreateParams(options) {
|
|
|
221
219
|
}
|
|
222
220
|
async function newsletterUpdateParams(options) {
|
|
223
221
|
const audience_id = getString(options, "audience-id");
|
|
224
|
-
const
|
|
222
|
+
const sender_identity_id = getString(options, "sender-identity-id");
|
|
225
223
|
const name = getString(options, "name");
|
|
226
224
|
const subject = getString(options, "subject");
|
|
227
225
|
const preview_text = getString(options, "preview-text");
|
|
228
|
-
const from_name = getString(options, "from-name");
|
|
229
226
|
const send_window_hours = getNumber(options, "send-window-hours");
|
|
230
227
|
const archive_visibility = parseArchiveVisibility(options);
|
|
231
228
|
const styling_mode = parseStylingMode(options);
|
|
@@ -237,11 +234,10 @@ async function newsletterUpdateParams(options) {
|
|
|
237
234
|
const body_text = bodyTextInput ? await readTextInput(bodyTextInput) : void 0;
|
|
238
235
|
const params = {
|
|
239
236
|
...audience_id ? { audience_id } : {},
|
|
240
|
-
...
|
|
237
|
+
...sender_identity_id ? { sender_identity_id } : {},
|
|
241
238
|
...name ? { name } : {},
|
|
242
239
|
...subject ? { subject } : {},
|
|
243
240
|
...preview_text !== void 0 ? { preview_text } : {},
|
|
244
|
-
...from_name !== void 0 ? { from_name } : {},
|
|
245
241
|
...blocks ? { blocks } : {},
|
|
246
242
|
...body_html !== void 0 ? { body_html } : {},
|
|
247
243
|
...body_text !== void 0 ? { body_text } : {},
|
|
@@ -383,7 +379,7 @@ Usage:
|
|
|
383
379
|
shipmail suppressions remove <email>
|
|
384
380
|
shipmail newsletters create \\
|
|
385
381
|
--audience-id aud_123 \\
|
|
386
|
-
--
|
|
382
|
+
--sender-identity-id nwsid_456 \\
|
|
387
383
|
--name "July changelog" \\
|
|
388
384
|
--subject "What shipped in July" \\
|
|
389
385
|
--blocks @blocks.json \\
|
|
@@ -398,6 +394,7 @@ Usage:
|
|
|
398
394
|
shipmail newsletter-assets list [--kind image|video] [--q text] [--limit 25] [--cursor cur]
|
|
399
395
|
shipmail newsletter-assets upload <file> [--filename name] [--content-type type]
|
|
400
396
|
shipmail newsletter-assets register-url <url> [--filename name] [--thumbnail-url url]
|
|
397
|
+
shipmail newsletter-sender-identities list [--limit 25] [--cursor cur]
|
|
401
398
|
shipmail newsletter-domains list [--limit 25] [--cursor cur]
|
|
402
399
|
shipmail audiences list [--limit 25] [--cursor cur]
|
|
403
400
|
shipmail audiences create <name> --consent-source "Signup form" [--description "..."]
|
|
@@ -405,7 +402,7 @@ Usage:
|
|
|
405
402
|
shipmail audiences update <id> [--name "..."] [--description "..."]
|
|
406
403
|
shipmail audiences delete <id>
|
|
407
404
|
shipmail audiences feed get <audience-id>
|
|
408
|
-
shipmail audiences feed update <audience-id> [--enabled true|false] [--title "..."] [--subtitle "..."] [--site-url https://...] [--author-name "..."] [--icon-url https://...] [--idempotency-key key]
|
|
405
|
+
shipmail audiences feed update <audience-id> [--enabled true|false] [--title "..."] [--subtitle "..."] [--site-url https://...] [--canonical-url https://...] [--author-name "..."] [--icon-url https://...] [--entry-limit 10..100] [--idempotency-key key]
|
|
409
406
|
shipmail audiences feed rotate <audience-id> [--idempotency-key key]
|
|
410
407
|
shipmail audiences feed revoke <audience-id> [--idempotency-key key]
|
|
411
408
|
shipmail audiences subscribers add <audience-id> <email> [--name "Jane"] [--consent-source "..."]
|
|
@@ -1335,9 +1332,14 @@ function audienceFeedUpdateParams(options) {
|
|
|
1335
1332
|
const title = getString(options, "title");
|
|
1336
1333
|
const subtitle = getString(options, "subtitle");
|
|
1337
1334
|
const siteUrl = getString(options, "site-url");
|
|
1335
|
+
const canonicalUrl = getString(options, "canonical-url");
|
|
1338
1336
|
const authorName = getString(options, "author-name");
|
|
1339
1337
|
const iconUrl = getString(options, "icon-url");
|
|
1340
|
-
|
|
1338
|
+
const entryLimit = getNumber(options, "entry-limit");
|
|
1339
|
+
if (entryLimit !== void 0 && (entryLimit < 10 || entryLimit > 100)) {
|
|
1340
|
+
throw new CliUsageError("--entry-limit must be between 10 and 100.");
|
|
1341
|
+
}
|
|
1342
|
+
if (enabled === void 0 && title === void 0 && subtitle === void 0 && siteUrl === void 0 && canonicalUrl === void 0 && authorName === void 0 && iconUrl === void 0 && entryLimit === void 0) {
|
|
1341
1343
|
throw new CliUsageError("Provide at least one feed setting to update.");
|
|
1342
1344
|
}
|
|
1343
1345
|
return {
|
|
@@ -1345,8 +1347,10 @@ function audienceFeedUpdateParams(options) {
|
|
|
1345
1347
|
...title !== void 0 ? { title } : {},
|
|
1346
1348
|
...subtitle !== void 0 ? { subtitle } : {},
|
|
1347
1349
|
...siteUrl !== void 0 ? { site_url: siteUrl } : {},
|
|
1350
|
+
...canonicalUrl !== void 0 ? { canonical_url: canonicalUrl } : {},
|
|
1348
1351
|
...authorName !== void 0 ? { author_name: authorName } : {},
|
|
1349
|
-
...iconUrl !== void 0 ? { icon_url: iconUrl } : {}
|
|
1352
|
+
...iconUrl !== void 0 ? { icon_url: iconUrl } : {},
|
|
1353
|
+
...entryLimit !== void 0 ? { entry_limit: entryLimit } : {}
|
|
1350
1354
|
};
|
|
1351
1355
|
}
|
|
1352
1356
|
async function runAudienceFeed(client, parsed, out) {
|
|
@@ -1453,6 +1457,20 @@ async function runNewsletterDomains(client, parsed, out) {
|
|
|
1453
1457
|
}
|
|
1454
1458
|
throw new CliUsageError("Unknown newsletter-domains command.");
|
|
1455
1459
|
}
|
|
1460
|
+
async function runNewsletterSenderIdentities(client, parsed, out) {
|
|
1461
|
+
const subcommand = parsed.positional[1];
|
|
1462
|
+
if (subcommand === "list") {
|
|
1463
|
+
writeJson(
|
|
1464
|
+
out,
|
|
1465
|
+
await client.newsletters.senderIdentities.list({
|
|
1466
|
+
cursor: getString(parsed.options, "cursor"),
|
|
1467
|
+
limit: getNumber(parsed.options, "limit")
|
|
1468
|
+
})
|
|
1469
|
+
);
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
throw new CliUsageError("Unknown newsletter-sender-identities command.");
|
|
1473
|
+
}
|
|
1456
1474
|
async function runNewsletters(client, parsed, out) {
|
|
1457
1475
|
const subcommand = parsed.positional[1];
|
|
1458
1476
|
if (subcommand === "create") {
|
|
@@ -1973,6 +1991,8 @@ async function runCli(argv, options = {}) {
|
|
|
1973
1991
|
else if (command === "suppressions") await runSuppressions(client, parsed, out);
|
|
1974
1992
|
else if (command === "newsletters") await runNewsletters(client, parsed, out);
|
|
1975
1993
|
else if (command === "newsletter-assets") await runNewsletterAssets(client, parsed, out);
|
|
1994
|
+
else if (command === "newsletter-sender-identities")
|
|
1995
|
+
await runNewsletterSenderIdentities(client, parsed, out);
|
|
1976
1996
|
else if (command === "newsletter-domains") await runNewsletterDomains(client, parsed, out);
|
|
1977
1997
|
else if (command === "audiences") await runAudiences(client, parsed, out);
|
|
1978
1998
|
else if (command === "calendar") await runCalendar(client, parsed, out);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipmail-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Official CLI for the ShipMail API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"homepage": "https://shipmail.to/docs/cli",
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/
|
|
34
|
+
"url": "git+https://github.com/shipmail-to/Shipmail.git",
|
|
35
35
|
"directory": "packages/shipmail-cli"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"shipmail": "0.4.
|
|
44
|
+
"shipmail": "0.4.9"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.4.0",
|