shipmail 0.2.2 → 0.3.0
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 +42 -3
- package/dist/index.cjs +87 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +253 -169
- package/dist/index.d.ts +253 -169
- package/dist/index.js +87 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -620,7 +620,9 @@ var Mailboxes = class extends ApiResource {
|
|
|
620
620
|
folder_id: params?.folder_id,
|
|
621
621
|
folder_role: params?.folder_role,
|
|
622
622
|
search_text: params?.search_text,
|
|
623
|
-
|
|
623
|
+
cursor: params?.cursor,
|
|
624
|
+
after: params?.after,
|
|
625
|
+
before: params?.before,
|
|
624
626
|
limit: params?.limit,
|
|
625
627
|
has_keyword: params?.has_keyword,
|
|
626
628
|
not_keyword: params?.not_keyword
|
|
@@ -628,6 +630,29 @@ var Mailboxes = class extends ApiResource {
|
|
|
628
630
|
methodOptions: options
|
|
629
631
|
});
|
|
630
632
|
}
|
|
633
|
+
getInboxMessage(id, messageId, options) {
|
|
634
|
+
return this.client.request({
|
|
635
|
+
method: "GET",
|
|
636
|
+
path: `/mailboxes/${encodeURIComponent(id)}/inbox/messages/${encodeURIComponent(messageId)}`,
|
|
637
|
+
methodOptions: options
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
listInboxThreads(id, params, options) {
|
|
641
|
+
return this.client.request({
|
|
642
|
+
method: "GET",
|
|
643
|
+
path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads`,
|
|
644
|
+
query: {
|
|
645
|
+
reply_state: params?.reply_state,
|
|
646
|
+
sort_by: params?.sort_by,
|
|
647
|
+
order: params?.order,
|
|
648
|
+
after: params?.after,
|
|
649
|
+
before: params?.before,
|
|
650
|
+
cursor: params?.cursor,
|
|
651
|
+
limit: params?.limit
|
|
652
|
+
},
|
|
653
|
+
methodOptions: options
|
|
654
|
+
});
|
|
655
|
+
}
|
|
631
656
|
getInboxThread(id, threadId, options) {
|
|
632
657
|
return this.client.request({
|
|
633
658
|
method: "GET",
|
|
@@ -635,6 +660,29 @@ var Mailboxes = class extends ApiResource {
|
|
|
635
660
|
methodOptions: options
|
|
636
661
|
});
|
|
637
662
|
}
|
|
663
|
+
updateInboxThreadReplyState(id, threadId, params, options) {
|
|
664
|
+
return this.client.request({
|
|
665
|
+
method: "PATCH",
|
|
666
|
+
path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads/${encodeURIComponent(threadId)}`,
|
|
667
|
+
body: params,
|
|
668
|
+
methodOptions: options
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
createInboxReplyDraft(id, threadId, params, options) {
|
|
672
|
+
return this.client.request({
|
|
673
|
+
method: "POST",
|
|
674
|
+
path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads/${encodeURIComponent(threadId)}/drafts`,
|
|
675
|
+
body: params,
|
|
676
|
+
methodOptions: options
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
sendInboxReplyDraft(id, threadId, draftId, options) {
|
|
680
|
+
return this.client.request({
|
|
681
|
+
method: "POST",
|
|
682
|
+
path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads/${encodeURIComponent(threadId)}/drafts/${encodeURIComponent(draftId)}/send`,
|
|
683
|
+
methodOptions: options
|
|
684
|
+
});
|
|
685
|
+
}
|
|
638
686
|
replyToInboxMessage(id, messageId, params, options) {
|
|
639
687
|
return this.client.request({
|
|
640
688
|
method: "POST",
|
|
@@ -715,21 +763,6 @@ var Mailboxes = class extends ApiResource {
|
|
|
715
763
|
methodOptions: options
|
|
716
764
|
});
|
|
717
765
|
}
|
|
718
|
-
getRules(id, options) {
|
|
719
|
-
return this.client.request({
|
|
720
|
-
method: "GET",
|
|
721
|
-
path: `/mailboxes/${encodeURIComponent(id)}/rules`,
|
|
722
|
-
methodOptions: options
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
updateRules(id, params, options) {
|
|
726
|
-
return this.client.request({
|
|
727
|
-
method: "PUT",
|
|
728
|
-
path: `/mailboxes/${encodeURIComponent(id)}/rules`,
|
|
729
|
-
body: params,
|
|
730
|
-
methodOptions: options
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
766
|
listForwarding(id, options) {
|
|
734
767
|
return this.client.request({
|
|
735
768
|
method: "GET",
|
|
@@ -1093,6 +1126,33 @@ var Partner = class extends ApiResource {
|
|
|
1093
1126
|
}
|
|
1094
1127
|
};
|
|
1095
1128
|
|
|
1129
|
+
// src/resources/reply-scans.ts
|
|
1130
|
+
var ReplyScans = class extends ApiResource {
|
|
1131
|
+
create(params, options) {
|
|
1132
|
+
return this.client.request({
|
|
1133
|
+
method: "POST",
|
|
1134
|
+
path: "/reply-scans",
|
|
1135
|
+
body: params,
|
|
1136
|
+
methodOptions: options
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
get(id, options) {
|
|
1140
|
+
return this.client.request({
|
|
1141
|
+
method: "GET",
|
|
1142
|
+
path: `/reply-scans/${encodeURIComponent(id)}`,
|
|
1143
|
+
methodOptions: options
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
listResults(id, params, options) {
|
|
1147
|
+
return this.client.request({
|
|
1148
|
+
method: "GET",
|
|
1149
|
+
path: `/reply-scans/${encodeURIComponent(id)}/results`,
|
|
1150
|
+
query: { cursor: params?.cursor, limit: params?.limit },
|
|
1151
|
+
methodOptions: options
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1096
1156
|
// src/resources/status.ts
|
|
1097
1157
|
var Status = class extends ApiResource {
|
|
1098
1158
|
get(options) {
|
|
@@ -1276,7 +1336,7 @@ var Webhooks = class extends ApiResource {
|
|
|
1276
1336
|
};
|
|
1277
1337
|
|
|
1278
1338
|
// src/version.ts
|
|
1279
|
-
var VERSION = "0.
|
|
1339
|
+
var VERSION = "0.3.0";
|
|
1280
1340
|
|
|
1281
1341
|
// src/client.ts
|
|
1282
1342
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -1337,6 +1397,7 @@ var ShipMailClient = class {
|
|
|
1337
1397
|
this.messages = new Messages(this);
|
|
1338
1398
|
this.newsletters = new Newsletters(this);
|
|
1339
1399
|
this.partner = new Partner(this);
|
|
1400
|
+
this.replyScans = new ReplyScans(this);
|
|
1340
1401
|
this.suppressions = new Suppressions(this);
|
|
1341
1402
|
this.threads = new Threads(this);
|
|
1342
1403
|
this.webhooks = new Webhooks(this);
|
|
@@ -1447,7 +1508,7 @@ var WEBHOOK_EVENT_TYPES = [
|
|
|
1447
1508
|
"message.delivered",
|
|
1448
1509
|
"message.bounced",
|
|
1449
1510
|
"message.complained",
|
|
1450
|
-
"
|
|
1511
|
+
"thread.needs_reply",
|
|
1451
1512
|
"domain.verified",
|
|
1452
1513
|
"domain.verification_failed",
|
|
1453
1514
|
"domain.degraded",
|
|
@@ -1469,7 +1530,14 @@ var MESSAGE_STATUSES = [
|
|
|
1469
1530
|
"suppressed",
|
|
1470
1531
|
"cancelled"
|
|
1471
1532
|
];
|
|
1472
|
-
var MESSAGE_SOURCES = [
|
|
1533
|
+
var MESSAGE_SOURCES = [
|
|
1534
|
+
"api",
|
|
1535
|
+
"newsletter",
|
|
1536
|
+
"dashboard",
|
|
1537
|
+
"inbound",
|
|
1538
|
+
"smtp",
|
|
1539
|
+
"assistant"
|
|
1540
|
+
];
|
|
1473
1541
|
var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed"];
|
|
1474
1542
|
|
|
1475
1543
|
// src/webhook-verification.ts
|