shipmail-cli 0.4.4 → 0.4.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 ShipMail
3
+ Copyright (c) 2025 Shipmail
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
@@ -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`
package/dist/cli.js CHANGED
@@ -8,13 +8,13 @@ import { env as processEnv, exit, stderr, stdout } from "process";
8
8
  import { fileURLToPath } from "url";
9
9
  import {
10
10
  CONFERENCING_PROVIDER_IDS,
11
- ShipMailClient,
12
- ShipMailError,
11
+ ShipmailClient,
12
+ ShipmailError,
13
13
  WEBHOOK_EVENT_TYPES
14
14
  } from "shipmail";
15
15
 
16
16
  // src/version.ts
17
- var VERSION = "0.4.4";
17
+ var VERSION = "0.4.6";
18
18
 
19
19
  // src/cli.ts
20
20
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -143,7 +143,7 @@ function createClient(parsed, options) {
143
143
  organizationId: organizationId(parsed, env),
144
144
  ...options.fetch ? { fetch: options.fetch } : {}
145
145
  };
146
- return new ShipMailClient(config);
146
+ return new ShipmailClient(config);
147
147
  }
148
148
  function writeJson(out, value) {
149
149
  out.write(`${JSON.stringify(value, null, 2)}
@@ -278,7 +278,7 @@ async function rawApiRequest(parsed, runOptions, method, path, body, authRequire
278
278
  }
279
279
  const targetOrganizationId = organizationId(parsed, env);
280
280
  if (targetOrganizationId) {
281
- headers["X-ShipMail-Organization-Id"] = targetOrganizationId;
281
+ headers["X-Shipmail-Organization-Id"] = targetOrganizationId;
282
282
  }
283
283
  let requestBody;
284
284
  if (body !== void 0) {
@@ -363,6 +363,7 @@ Usage:
363
363
  shipmail inbox move <mailbox-id> <message-id> (--target-role archive | --target-folder-id fld)
364
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']
365
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]
366
367
  shipmail messages get <message-id>
367
368
  shipmail messages reply <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--client-reference crm-reply-123]
368
369
  shipmail scheduled-messages list [--include-held] [--search text] [--limit 100]
@@ -1079,6 +1080,18 @@ async function runMessages(client, parsed, out) {
1079
1080
  );
1080
1081
  return;
1081
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
+ }
1082
1095
  if (subcommand === "reply") {
1083
1096
  writeJson(
1084
1097
  out,
@@ -1929,7 +1942,7 @@ ${JSON.stringify(err.body, null, 2)}
1929
1942
  `);
1930
1943
  return;
1931
1944
  }
1932
- if (err instanceof ShipMailError) {
1945
+ if (err instanceof ShipmailError) {
1933
1946
  const shipmailError = err;
1934
1947
  const status = shipmailError.status !== void 0 ? ` (HTTP ${shipmailError.status})` : "";
1935
1948
  const requestId = shipmailError.requestId ? ` request_id=${shipmailError.requestId}` : "";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shipmail-cli",
3
- "version": "0.4.4",
4
- "description": "Official CLI for the ShipMail API",
3
+ "version": "0.4.6",
4
+ "description": "Official CLI for the Shipmail API",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "shipmail": "dist/cli.js"
@@ -26,7 +26,7 @@
26
26
  "domain",
27
27
  "terminal"
28
28
  ],
29
- "author": "ShipMail",
29
+ "author": "Shipmail",
30
30
  "license": "MIT",
31
31
  "homepage": "https://shipmail.to/docs/cli",
32
32
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "shipmail": "0.4.9"
44
+ "shipmail": "0.4.13"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",