shipmail 0.4.5 → 0.4.8

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 CHANGED
@@ -372,7 +372,6 @@ message.sent
372
372
  message.delivered
373
373
  message.bounced
374
374
  message.complained
375
- thread.needs_reply
376
375
  mailbox.rule_matched
377
376
  domain.verified
378
377
  domain.verification_failed
@@ -410,6 +409,17 @@ await shipmail.audiences.subscribers.add(audience.id, {
410
409
  email_address: "jane@example.com",
411
410
  merge_fields: { plan: "pro" },
412
411
  });
412
+
413
+ await shipmail.audiences.feeds.update(audience.id, {
414
+ enabled: true,
415
+ title: "Release notes",
416
+ canonical_url: "https://example.com/feed.xml",
417
+ entry_limit: 25,
418
+ });
419
+ // Graceful migration: the current URL redirects to the replacement.
420
+ await shipmail.audiences.feeds.rotate(audience.id);
421
+ // Leaked URL: immediately invalidate both current and previous URLs.
422
+ await shipmail.audiences.feeds.revoke(audience.id);
413
423
  ```
414
424
 
415
425
  ## Newsletters
package/dist/index.cjs CHANGED
@@ -232,6 +232,40 @@ var ApiResource = class {
232
232
  function base(audienceId) {
233
233
  return `/audiences/${encodeURIComponent(audienceId)}/subscribers`;
234
234
  }
235
+ function feedBase(audienceId) {
236
+ return `/audiences/${encodeURIComponent(audienceId)}/feed`;
237
+ }
238
+ var AudienceFeeds = class extends ApiResource {
239
+ get(audienceId, options) {
240
+ return this.client.request({
241
+ method: "GET",
242
+ path: feedBase(audienceId),
243
+ methodOptions: options
244
+ });
245
+ }
246
+ update(audienceId, params, options) {
247
+ return this.client.request({
248
+ method: "PATCH",
249
+ path: feedBase(audienceId),
250
+ body: params,
251
+ methodOptions: options
252
+ });
253
+ }
254
+ rotate(audienceId, options) {
255
+ return this.client.request({
256
+ method: "POST",
257
+ path: `${feedBase(audienceId)}/rotate`,
258
+ methodOptions: options
259
+ });
260
+ }
261
+ revoke(audienceId, options) {
262
+ return this.client.request({
263
+ method: "POST",
264
+ path: `${feedBase(audienceId)}/revoke`,
265
+ methodOptions: options
266
+ });
267
+ }
268
+ };
235
269
  var Subscribers = class extends ApiResource {
236
270
  add(audienceId, params, options) {
237
271
  return this.client.request({
@@ -317,6 +351,7 @@ var Subscribers = class extends ApiResource {
317
351
  var Audiences = class extends ApiResource {
318
352
  constructor(client) {
319
353
  super(client);
354
+ this.feeds = new AudienceFeeds(client);
320
355
  this.subscribers = new Subscribers(client);
321
356
  }
322
357
  create(params, options) {
@@ -1504,7 +1539,7 @@ var Webhooks = class extends ApiResource {
1504
1539
  };
1505
1540
 
1506
1541
  // src/version.ts
1507
- var VERSION = "0.4.5";
1542
+ var VERSION = "0.4.8";
1508
1543
 
1509
1544
  // src/client.ts
1510
1545
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -1678,7 +1713,6 @@ var WEBHOOK_EVENT_TYPES = [
1678
1713
  "message.delivered",
1679
1714
  "message.bounced",
1680
1715
  "message.complained",
1681
- "thread.needs_reply",
1682
1716
  "mailbox.rule_matched",
1683
1717
  "domain.verified",
1684
1718
  "domain.verification_failed",