shipmail 0.5.1 → 0.5.3
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 +8 -6
- package/dist/index.cjs +16 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -4
- package/dist/index.d.ts +50 -4
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -199,12 +199,14 @@ const queue = await shipmail.mailboxes.listInboxThreads(mailboxId, {
|
|
|
199
199
|
after: "2025-07-20T00:00:00.000Z",
|
|
200
200
|
});
|
|
201
201
|
const candidate = queue.data[0];
|
|
202
|
-
|
|
202
|
+
// `conversation_id` is the ID to store. `thread_id` is deprecated: it still works and its
|
|
203
|
+
// value is unchanged, but the mail server can re-thread it when conversations merge.
|
|
204
|
+
const draft = await shipmail.mailboxes.createInboxReplyDraft(mailboxId, candidate.conversation_id, {
|
|
203
205
|
text: "Thanks for the note.",
|
|
204
206
|
expected_version: candidate.version,
|
|
205
207
|
});
|
|
206
208
|
// Apply your approval policy before sending. Stale versions fail with 409 without delivery.
|
|
207
|
-
await shipmail.mailboxes.sendInboxReplyDraft(mailboxId, candidate.
|
|
209
|
+
await shipmail.mailboxes.sendInboxReplyDraft(mailboxId, candidate.conversation_id, draft.id);
|
|
208
210
|
```
|
|
209
211
|
|
|
210
212
|
## Messages
|
|
@@ -432,7 +434,7 @@ await shipmail.audiences.feeds.revoke(audience.id);
|
|
|
432
434
|
import { readFile } from "node:fs/promises";
|
|
433
435
|
|
|
434
436
|
const senderIdentities = await shipmail.newsletters.senderIdentities.list({ limit: 25 });
|
|
435
|
-
const assets = await shipmail.newsletters.assets.list({ kind: "image", limit: 25 });
|
|
437
|
+
const assets = await shipmail.newsletters.assets.list({ kind: "image", q: "hero", limit: 25 });
|
|
436
438
|
const hero = await shipmail.newsletters.assets.upload({
|
|
437
439
|
filename: "hero.png",
|
|
438
440
|
content_type: "image/png",
|
|
@@ -468,8 +470,8 @@ const newsletter = await shipmail.newsletters.create({
|
|
|
468
470
|
{
|
|
469
471
|
type: "columns",
|
|
470
472
|
ratio: "50-50",
|
|
471
|
-
left: { title: "For teams",
|
|
472
|
-
right: { title: "For agents",
|
|
473
|
+
left: { title: "For teams", image_url: hero.url, image_fit: "natural" },
|
|
474
|
+
right: { title: "For agents", image_url: existingHero.url, image_fit: "contain" },
|
|
473
475
|
},
|
|
474
476
|
],
|
|
475
477
|
});
|
|
@@ -778,7 +780,7 @@ This is the recommended pattern for unit tests. No HTTP interception or mocking
|
|
|
778
780
|
## Links
|
|
779
781
|
|
|
780
782
|
- [Shipmail docs](https://shipmail.to/docs)
|
|
781
|
-
- [Quick start](https://shipmail.to/docs/quick-start)
|
|
783
|
+
- [Quick start](https://shipmail.to/docs/api/quick-start)
|
|
782
784
|
- [API reference](https://shipmail.to/docs/api)
|
|
783
785
|
- [TypeScript SDK guide](https://shipmail.to/docs/sdks/typescript)
|
|
784
786
|
- [`shipmail-mcp` (MCP server)](https://www.npmjs.com/package/shipmail-mcp)
|
package/dist/index.cjs
CHANGED
|
@@ -161,6 +161,18 @@ var InternalServerError = class extends ShipmailError {
|
|
|
161
161
|
this.name = "InternalServerError";
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
+
var ReconciliationRequiredError = class extends ShipmailError {
|
|
165
|
+
constructor(message, requestId, messageId) {
|
|
166
|
+
super(message, {
|
|
167
|
+
status: 409,
|
|
168
|
+
type: "reconciliation_required",
|
|
169
|
+
requestId,
|
|
170
|
+
retryable: false
|
|
171
|
+
});
|
|
172
|
+
this.name = "ReconciliationRequiredError";
|
|
173
|
+
this.messageId = messageId;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
164
176
|
var ConnectionError = class extends ShipmailError {
|
|
165
177
|
constructor(message) {
|
|
166
178
|
super(message, { retryable: true });
|
|
@@ -191,6 +203,8 @@ function mapErrorFromResponse(status, body, requestId) {
|
|
|
191
203
|
return new RateLimitError(error.message, { requestId: rid, retryAfter: error.retry_after });
|
|
192
204
|
case "conflict":
|
|
193
205
|
return new ConflictError(error.message, rid);
|
|
206
|
+
case "reconciliation_required":
|
|
207
|
+
return new ReconciliationRequiredError(error.message, rid, error.message_id);
|
|
194
208
|
case "internal_error":
|
|
195
209
|
return new InternalServerError(error.message, rid);
|
|
196
210
|
default:
|
|
@@ -1685,7 +1699,7 @@ var Webhooks = class extends ApiResource {
|
|
|
1685
1699
|
};
|
|
1686
1700
|
|
|
1687
1701
|
// src/version.ts
|
|
1688
|
-
var VERSION = "0.5.
|
|
1702
|
+
var VERSION = "0.5.3";
|
|
1689
1703
|
|
|
1690
1704
|
// src/client.ts
|
|
1691
1705
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -1956,6 +1970,7 @@ exports.NotFoundError = NotFoundError;
|
|
|
1956
1970
|
exports.Page = Page;
|
|
1957
1971
|
exports.QuotaExceededError = QuotaExceededError;
|
|
1958
1972
|
exports.RateLimitError = RateLimitError;
|
|
1973
|
+
exports.ReconciliationRequiredError = ReconciliationRequiredError;
|
|
1959
1974
|
exports.ShipmailClient = ShipmailClient;
|
|
1960
1975
|
exports.ShipmailError = ShipmailError;
|
|
1961
1976
|
exports.ValidationError = ValidationError;
|