shipmail-cli 0.4.2 → 0.4.5

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.
Files changed (3) hide show
  1. package/README.md +14 -4
  2. package/dist/cli.js +46 -13
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -50,6 +50,7 @@ shipmail messages send \
50
50
  --source-rfc-message-id '<crm-123@example.com>'
51
51
 
52
52
  shipmail messages list --client-reference crm-123
53
+ shipmail messages analytics --updated-after 2026-07-01T00:00:00Z --limit 100
53
54
  shipmail messages reply msg_123 --to user@example.com --text "Thanks"
54
55
 
55
56
  # Stage a raw file, then pass the returned sat_... ID when sending
@@ -97,11 +98,11 @@ shipmail reply-scans create --mailbox-id 550e8400-e29b-41d4-a716-446655440000 --
97
98
  shipmail reply-scans status rsc_123
98
99
  shipmail reply-scans results rsc_123 --limit 100
99
100
 
100
- # Find newsletter sending domain IDs, then create a draft with blocks
101
- shipmail newsletter-domains list
101
+ # Find reusable sender identity IDs, then create a draft with blocks
102
+ shipmail newsletter-sender-identities list
102
103
  shipmail newsletters create \
103
104
  --audience-id aud_123 \
104
- --newsletter-domain-id nwsdom_456 \
105
+ --sender-identity-id nwsid_456 \
105
106
  --name "July changelog" \
106
107
  --subject "What shipped in July" \
107
108
  --blocks @blocks.json
@@ -154,7 +155,7 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
154
155
  - `mailboxes list|create|get|suspend|resume|forwarding|forwarding-add|forwarding-remove|app-passwords|folders|identities|stage-attachment|prepare-attachment-upload`
155
156
  - `inbox list|message|threads|thread|thread-state|draft|send-draft|reply-message|reply-thread|update|move`
156
157
  - `reply-scans create|status|results`
157
- - `messages send|list|get|reply` (test keys also support `--sandbox-outcome`)
158
+ - `messages send|list|analytics|get|reply` (test keys also support `--sandbox-outcome`)
158
159
  - `scheduled-messages list|get|update|cancel`
159
160
  - `mailboxes sandbox-inbound`
160
161
  - `webhooks list|create|test|deliveries|replay-delivery`
@@ -162,6 +163,7 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
162
163
  - `audiences list|create|get|update|delete`
163
164
  - `audiences feed get|update|rotate|revoke`
164
165
  - `audiences subscribers add|list|get|by-email|update|unsubscribe|resubscribe|remove`
166
+ - `newsletter-sender-identities list`
165
167
  - `newsletter-domains list`
166
168
  - `newsletters create|update|preview|preflight|test-send|schedule|cancel|resume`
167
169
  - `newsletter-assets list|upload|register-url`
@@ -169,4 +171,12 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
169
171
  - `partner credential-grants list|consume`
170
172
  - `partner usage`
171
173
 
174
+ Configure a publisher-owned Atom self URL and the number of recent issues:
175
+
176
+ ```bash
177
+ shipmail audiences feed update aud_123 \
178
+ --canonical-url https://example.com/feed.xml \
179
+ --entry-limit 25
180
+ ```
181
+
172
182
  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.2";
17
+ var VERSION = "0.4.5";
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 newsletter_domain_id = getRequiredString(options, "newsletter-domain-id");
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
- newsletter_domain_id,
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 newsletter_domain_id = getString(options, "newsletter-domain-id");
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
- ...newsletter_domain_id ? { newsletter_domain_id } : {},
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 } : {},
@@ -367,6 +363,7 @@ Usage:
367
363
  shipmail inbox move <mailbox-id> <message-id> (--target-role archive | --target-folder-id fld)
368
364
  shipmail messages send --mailbox-id mbx --to user@example.com --subject "Hi" --text "Hello" [--sandbox-outcome delivered|bounced|complained] [--client-reference crm-123] [--metadata JSON|@file] [--source-rfc-message-id '<crm-123@example.com>'] [--header 'X-CRM-ID: 123']
369
365
  shipmail messages list (--mailbox-id mbx | --client-reference crm-123) [--limit 25] [--cursor cur]
366
+ shipmail messages analytics [--updated-after ISO] [--updated-before ISO] [--limit 100] [--cursor cur]
370
367
  shipmail messages get <message-id>
371
368
  shipmail messages reply <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--client-reference crm-reply-123]
372
369
  shipmail scheduled-messages list [--include-held] [--search text] [--limit 100]
@@ -383,7 +380,7 @@ Usage:
383
380
  shipmail suppressions remove <email>
384
381
  shipmail newsletters create \\
385
382
  --audience-id aud_123 \\
386
- --newsletter-domain-id nwsdom_456 \\
383
+ --sender-identity-id nwsid_456 \\
387
384
  --name "July changelog" \\
388
385
  --subject "What shipped in July" \\
389
386
  --blocks @blocks.json \\
@@ -398,6 +395,7 @@ Usage:
398
395
  shipmail newsletter-assets list [--kind image|video] [--q text] [--limit 25] [--cursor cur]
399
396
  shipmail newsletter-assets upload <file> [--filename name] [--content-type type]
400
397
  shipmail newsletter-assets register-url <url> [--filename name] [--thumbnail-url url]
398
+ shipmail newsletter-sender-identities list [--limit 25] [--cursor cur]
401
399
  shipmail newsletter-domains list [--limit 25] [--cursor cur]
402
400
  shipmail audiences list [--limit 25] [--cursor cur]
403
401
  shipmail audiences create <name> --consent-source "Signup form" [--description "..."]
@@ -405,7 +403,7 @@ Usage:
405
403
  shipmail audiences update <id> [--name "..."] [--description "..."]
406
404
  shipmail audiences delete <id>
407
405
  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]
406
+ 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
407
  shipmail audiences feed rotate <audience-id> [--idempotency-key key]
410
408
  shipmail audiences feed revoke <audience-id> [--idempotency-key key]
411
409
  shipmail audiences subscribers add <audience-id> <email> [--name "Jane"] [--consent-source "..."]
@@ -1082,6 +1080,18 @@ async function runMessages(client, parsed, out) {
1082
1080
  );
1083
1081
  return;
1084
1082
  }
1083
+ if (subcommand === "analytics") {
1084
+ writeJson(
1085
+ out,
1086
+ await client.messages.listAnalytics({
1087
+ updated_after: getString(parsed.options, "updated-after"),
1088
+ updated_before: getString(parsed.options, "updated-before"),
1089
+ cursor: getString(parsed.options, "cursor"),
1090
+ limit: getNumber(parsed.options, "limit")
1091
+ })
1092
+ );
1093
+ return;
1094
+ }
1085
1095
  if (subcommand === "reply") {
1086
1096
  writeJson(
1087
1097
  out,
@@ -1335,9 +1345,14 @@ function audienceFeedUpdateParams(options) {
1335
1345
  const title = getString(options, "title");
1336
1346
  const subtitle = getString(options, "subtitle");
1337
1347
  const siteUrl = getString(options, "site-url");
1348
+ const canonicalUrl = getString(options, "canonical-url");
1338
1349
  const authorName = getString(options, "author-name");
1339
1350
  const iconUrl = getString(options, "icon-url");
1340
- if (enabled === void 0 && title === void 0 && subtitle === void 0 && siteUrl === void 0 && authorName === void 0 && iconUrl === void 0) {
1351
+ const entryLimit = getNumber(options, "entry-limit");
1352
+ if (entryLimit !== void 0 && (entryLimit < 10 || entryLimit > 100)) {
1353
+ throw new CliUsageError("--entry-limit must be between 10 and 100.");
1354
+ }
1355
+ 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
1356
  throw new CliUsageError("Provide at least one feed setting to update.");
1342
1357
  }
1343
1358
  return {
@@ -1345,8 +1360,10 @@ function audienceFeedUpdateParams(options) {
1345
1360
  ...title !== void 0 ? { title } : {},
1346
1361
  ...subtitle !== void 0 ? { subtitle } : {},
1347
1362
  ...siteUrl !== void 0 ? { site_url: siteUrl } : {},
1363
+ ...canonicalUrl !== void 0 ? { canonical_url: canonicalUrl } : {},
1348
1364
  ...authorName !== void 0 ? { author_name: authorName } : {},
1349
- ...iconUrl !== void 0 ? { icon_url: iconUrl } : {}
1365
+ ...iconUrl !== void 0 ? { icon_url: iconUrl } : {},
1366
+ ...entryLimit !== void 0 ? { entry_limit: entryLimit } : {}
1350
1367
  };
1351
1368
  }
1352
1369
  async function runAudienceFeed(client, parsed, out) {
@@ -1453,6 +1470,20 @@ async function runNewsletterDomains(client, parsed, out) {
1453
1470
  }
1454
1471
  throw new CliUsageError("Unknown newsletter-domains command.");
1455
1472
  }
1473
+ async function runNewsletterSenderIdentities(client, parsed, out) {
1474
+ const subcommand = parsed.positional[1];
1475
+ if (subcommand === "list") {
1476
+ writeJson(
1477
+ out,
1478
+ await client.newsletters.senderIdentities.list({
1479
+ cursor: getString(parsed.options, "cursor"),
1480
+ limit: getNumber(parsed.options, "limit")
1481
+ })
1482
+ );
1483
+ return;
1484
+ }
1485
+ throw new CliUsageError("Unknown newsletter-sender-identities command.");
1486
+ }
1456
1487
  async function runNewsletters(client, parsed, out) {
1457
1488
  const subcommand = parsed.positional[1];
1458
1489
  if (subcommand === "create") {
@@ -1973,6 +2004,8 @@ async function runCli(argv, options = {}) {
1973
2004
  else if (command === "suppressions") await runSuppressions(client, parsed, out);
1974
2005
  else if (command === "newsletters") await runNewsletters(client, parsed, out);
1975
2006
  else if (command === "newsletter-assets") await runNewsletterAssets(client, parsed, out);
2007
+ else if (command === "newsletter-sender-identities")
2008
+ await runNewsletterSenderIdentities(client, parsed, out);
1976
2009
  else if (command === "newsletter-domains") await runNewsletterDomains(client, parsed, out);
1977
2010
  else if (command === "audiences") await runAudiences(client, parsed, out);
1978
2011
  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.2",
3
+ "version": "0.4.5",
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/jcoulaud/ShipMail.git",
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.6"
44
+ "shipmail": "0.4.10"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",