shipmail 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/README.md CHANGED
@@ -410,6 +410,15 @@ await shipmail.audiences.subscribers.add(audience.id, {
410
410
  email_address: "jane@example.com",
411
411
  merge_fields: { plan: "pro" },
412
412
  });
413
+
414
+ await shipmail.audiences.feeds.update(audience.id, {
415
+ enabled: true,
416
+ title: "Release notes",
417
+ });
418
+ // Graceful migration: the current URL redirects to the replacement.
419
+ await shipmail.audiences.feeds.rotate(audience.id);
420
+ // Leaked URL: immediately invalidate both current and previous URLs.
421
+ await shipmail.audiences.feeds.revoke(audience.id);
413
422
  ```
414
423
 
415
424
  ## 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.4";
1542
+ var VERSION = "0.4.6";
1508
1543
 
1509
1544
  // src/client.ts
1510
1545
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";