shipmail-cli 0.4.0 → 0.4.1

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 +1 -0
  2. package/dist/cli.js +27 -5
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -34,6 +34,7 @@ shipmail mailboxes resume mbx_123
34
34
  shipmail mailboxes forwarding-add mbx_123 --destination owner@example.net
35
35
  shipmail mailboxes forwarding mbx_123
36
36
  shipmail mailboxes forwarding-remove mbx_123 fwd_123
37
+ shipmail mailboxes rules mbx_123
37
38
  shipmail mailboxes app-passwords list mbx_123
38
39
  shipmail mailboxes app-passwords create mbx_123 --name "Desktop mail" --expires-at 2026-10-01T00:00:00Z
39
40
  shipmail mailboxes app-passwords revoke mbx_123 appwd_123
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.0";
17
+ var VERSION = "0.4.1";
18
18
 
19
19
  // src/cli.ts
20
20
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -179,6 +179,12 @@ function parseArchiveVisibility(options) {
179
179
  if (value === "private" || value === "public") return value;
180
180
  throw new CliUsageError("--archive-visibility must be private or public.");
181
181
  }
182
+ function parseStylingMode(options) {
183
+ const value = getString(options, "styling-mode");
184
+ if (value === void 0) return void 0;
185
+ if (value === "styled" || value === "plain") return value;
186
+ throw new CliUsageError("--styling-mode must be styled or plain.");
187
+ }
182
188
  async function newsletterCreateParams(options) {
183
189
  const audience_id = getRequiredString(options, "audience-id");
184
190
  const newsletter_domain_id = getRequiredString(options, "newsletter-domain-id");
@@ -195,6 +201,7 @@ async function newsletterCreateParams(options) {
195
201
  }
196
202
  const send_window_hours = getNumber(options, "send-window-hours");
197
203
  const archive_visibility = parseArchiveVisibility(options);
204
+ const styling_mode = parseStylingMode(options);
198
205
  const preview_text = getString(options, "preview-text");
199
206
  const from_name = getString(options, "from-name");
200
207
  return {
@@ -208,7 +215,8 @@ async function newsletterCreateParams(options) {
208
215
  ...body_html !== void 0 ? { body_html } : {},
209
216
  ...body_text !== void 0 ? { body_text } : {},
210
217
  ...send_window_hours !== void 0 ? { send_window_hours } : {},
211
- ...archive_visibility !== void 0 ? { archive_visibility } : {}
218
+ ...archive_visibility !== void 0 ? { archive_visibility } : {},
219
+ ...styling_mode !== void 0 ? { styling_mode } : {}
212
220
  };
213
221
  }
214
222
  async function newsletterUpdateParams(options) {
@@ -220,6 +228,7 @@ async function newsletterUpdateParams(options) {
220
228
  const from_name = getString(options, "from-name");
221
229
  const send_window_hours = getNumber(options, "send-window-hours");
222
230
  const archive_visibility = parseArchiveVisibility(options);
231
+ const styling_mode = parseStylingMode(options);
223
232
  const blocksInput = getString(options, "blocks");
224
233
  const bodyHtmlInput = getString(options, "body-html");
225
234
  const bodyTextInput = getString(options, "body-text");
@@ -237,7 +246,8 @@ async function newsletterUpdateParams(options) {
237
246
  ...body_html !== void 0 ? { body_html } : {},
238
247
  ...body_text !== void 0 ? { body_text } : {},
239
248
  ...send_window_hours !== void 0 ? { send_window_hours } : {},
240
- ...archive_visibility !== void 0 ? { archive_visibility } : {}
249
+ ...archive_visibility !== void 0 ? { archive_visibility } : {},
250
+ ...styling_mode !== void 0 ? { styling_mode } : {}
241
251
  };
242
252
  if (Object.keys(params).length === 0) {
243
253
  throw new CliUsageError("Provide at least one field to update.");
@@ -337,6 +347,7 @@ Usage:
337
347
  shipmail mailboxes app-passwords revoke <id> <app-password-id>
338
348
  shipmail mailboxes folders <id>
339
349
  shipmail mailboxes identities <id>
350
+ shipmail mailboxes rules <id>
340
351
  shipmail mailboxes forwarding <id>
341
352
  shipmail mailboxes forwarding-add <id> --destination owner@example.com
342
353
  shipmail mailboxes forwarding-remove <id> <forwarding-id>
@@ -375,8 +386,9 @@ Usage:
375
386
  --newsletter-domain-id nwsdom_456 \\
376
387
  --name "July changelog" \\
377
388
  --subject "What shipped in July" \\
378
- --blocks @blocks.json
379
- shipmail newsletters update nws_789 --subject "Updated subject" --blocks @blocks-v2.json
389
+ --blocks @blocks.json \\
390
+ [--styling-mode styled|plain]
391
+ shipmail newsletters update nws_789 --subject "Updated subject" --blocks @blocks-v2.json [--styling-mode styled|plain]
380
392
  shipmail newsletters preview <id>
381
393
  shipmail newsletters preflight <id>
382
394
  shipmail newsletters test-send <id> --recipient-email owner@example.com
@@ -427,6 +439,9 @@ Booking page conferencing:
427
439
  --conferencing-provider <zoom|google_meet> Create a meeting for every booking.
428
440
  --conferencing-provider none Stop creating meeting links on update.
429
441
 
442
+ Newsletter styling:
443
+ --styling-mode <styled|plain> styled applies Shipmail's email theme. plain sends your HTML without injected styles, width, or centering, so the reader's email client styles it.
444
+
430
445
  Global options:
431
446
  --api-key <key> API key. Defaults to SHIPMAIL_API_KEY.
432
447
  --base-url <url> API base URL. Defaults to SHIPMAIL_BASE_URL or ${DEFAULT_BASE_URL}.
@@ -744,6 +759,13 @@ async function runMailboxes(client, parsed, out) {
744
759
  );
745
760
  return;
746
761
  }
762
+ if (subcommand === "rules") {
763
+ writeJson(
764
+ out,
765
+ await client.mailboxes.getRules(requirePositional(parsed.positional, 2, "mailbox id"))
766
+ );
767
+ return;
768
+ }
747
769
  if (subcommand === "forwarding") {
748
770
  writeJson(
749
771
  out,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipmail-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
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.4.1"
44
+ "shipmail": "0.4.4"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",