pocketsflow 1.0.1 → 1.1.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 CHANGED
@@ -168,6 +168,10 @@ const updated = await pocketsflow.discounts.update('discount_id', {
168
168
 
169
169
  // Delete a discount
170
170
  await pocketsflow.discounts.delete('discount_id');
171
+
172
+ // Validate a code against a product, and check whether a product has any
173
+ const applied = await pocketsflow.discounts.apply('SAVE20', 'product_id');
174
+ const has = await pocketsflow.discounts.checkProduct('product_id');
171
175
  ```
172
176
 
173
177
  ### Upsells
@@ -200,25 +204,151 @@ const updated = await pocketsflow.upsells.update('upsell_id', {
200
204
  await pocketsflow.upsells.delete('upsell_id');
201
205
  ```
202
206
 
203
- ### Subscriptions
207
+ ### Subscription Offers
208
+
209
+ Your subscription **offers** — the recurring products you sell.
210
+
211
+ ```typescript
212
+ // List all subscription offers
213
+ const offers = await pocketsflow.subscriptionOffers.list();
214
+
215
+ // Get one offer
216
+ const offer = await pocketsflow.subscriptionOffers.get('offer_id');
217
+ ```
218
+
219
+ ### Subscribers
220
+
221
+ Your **buyers** — people with a membership in one of your offers. `id` accepts
222
+ either the subscriber's `_id` or its Whop membership id.
204
223
 
205
224
  ```typescript
206
- // List subscription customers
207
- const subscriptions = await pocketsflow.subscriptions.list({
225
+ // List subscribers
226
+ const { subscribers, pagination } = await pocketsflow.subscribers.list({
227
+ status: 'active',
208
228
  page: 1,
209
229
  pageSize: 20,
210
230
  });
211
231
 
212
- // Get a subscription
213
- const subscription = await pocketsflow.subscriptions.get('subscription_id');
232
+ // Get a subscriber with full payment history
233
+ const detail = await pocketsflow.subscribers.get('subscriber_id');
234
+ console.log(detail.payments); // initial charge + every renewal
214
235
 
215
- // Cancel a subscription
216
- await pocketsflow.subscriptions.cancel('stripe_subscription_id');
236
+ // Pass `live` to also fetch the authoritative membership from Whop.
237
+ // The lookup degrades gracefully and never fails the request.
238
+ const live = await pocketsflow.subscribers.get('subscriber_id', { live: true });
239
+
240
+ // Manage a membership
241
+ await pocketsflow.subscribers.cancel('subscriber_id');
242
+ await pocketsflow.subscribers.pause('subscriber_id');
243
+ await pocketsflow.subscribers.resume('subscriber_id');
244
+ ```
245
+
246
+ The native subscriber portal is driven by the `subscriptionId` + `subscriberId`
247
+ pair, which is itself the capability — these endpoints need no API key:
248
+
249
+ ```typescript
250
+ const data = await pocketsflow.subscribers.portal('offer_id', 'subscriber_id');
251
+ await pocketsflow.subscribers.portalCancel('subscriber_id');
252
+ await pocketsflow.subscribers.portalResume('subscriber_id');
253
+ ```
254
+
255
+ ### Payments
256
+
257
+ The unified ledger — one-time purchases **and** subscription payments (the
258
+ initial charge plus every renewal).
259
+
260
+ ```typescript
261
+ // List payments
262
+ const { payments, pagination } = await pocketsflow.payments.list({
263
+ type: 'subscription', // 'one_time' | 'subscription' | 'all' (default)
264
+ startDate: '2026-01-01',
265
+ pageSize: 50,
266
+ });
267
+
268
+ // Get one payment, with its product or offer, customer, and Whop payload
269
+ const payment = await pocketsflow.payments.get('payment_id');
270
+ ```
271
+
272
+ ### Subscriptions (legacy)
217
273
 
218
- // Refund a subscription
274
+ Kept for v1 compatibility. Prefer `subscribers` and `subscriptionOffers` above —
275
+ they cover pause/resume and filtering, which these do not. Note `cancel` and
276
+ `refund` here key off the **Stripe** subscription id.
277
+
278
+ ```typescript
279
+ const subscriptions = await pocketsflow.subscriptions.list({ page: 1 });
280
+ const subscription = await pocketsflow.subscriptions.get('subscription_id');
281
+ await pocketsflow.subscriptions.cancel('stripe_subscription_id');
219
282
  await pocketsflow.subscriptions.refund('stripe_subscription_id');
220
283
  ```
221
284
 
285
+ ### Link in Bio
286
+
287
+ ```typescript
288
+ // Get your page
289
+ const page = await pocketsflow.creatorPages.get();
290
+
291
+ // Create one (fails if you already have a page — use update)
292
+ const created = await pocketsflow.creatorPages.create({
293
+ creatorName: 'Jane',
294
+ creatorBio: 'I make things',
295
+ regularLinks: [{ title: 'My site', url: 'https://example.com', order: 0 }],
296
+ });
297
+
298
+ // Partial update
299
+ const updated = await pocketsflow.creatorPages.update({ creatorBio: 'Updated' });
300
+
301
+ // Usernames
302
+ await pocketsflow.creatorPages.checkUsername('jane');
303
+ await pocketsflow.creatorPages.updateUsername('jane');
304
+
305
+ await pocketsflow.creatorPages.delete();
306
+ ```
307
+
308
+ ### Images
309
+
310
+ ```typescript
311
+ import { readFile } from 'node:fs/promises';
312
+
313
+ const { imageUrl } = await pocketsflow.images.upload(
314
+ await readFile('./cover.png'),
315
+ 'cover.png'
316
+ );
317
+ ```
318
+
319
+ ### Newsletters
320
+
321
+ ```typescript
322
+ // Send a one-off email to up to 100 recipients (requires a verified sender)
323
+ const result = await pocketsflow.newsletters.send({
324
+ to: ['a@example.com', 'b@example.com'],
325
+ subject: 'Hello',
326
+ html: '<h1>Hi there</h1>',
327
+ });
328
+ console.log(result.id, result.accepted);
329
+
330
+ // Posts
331
+ const posts = await pocketsflow.newsletters.posts.list();
332
+ const post = await pocketsflow.newsletters.posts.create({
333
+ name: 'March update',
334
+ subject: 'What shipped in March',
335
+ preview: 'New features inside',
336
+ fromName: 'Jane',
337
+ contentHtml: '<p>...</p>',
338
+ });
339
+ await pocketsflow.newsletters.posts.update(post._id, { subject: 'Revised' });
340
+ await pocketsflow.newsletters.posts.send(post._id);
341
+ await pocketsflow.newsletters.posts.delete(post._id);
342
+
343
+ // Subscribers
344
+ const subs = await pocketsflow.newsletters.subscribers.list();
345
+ await pocketsflow.newsletters.subscribers.get('subscriber_id');
346
+ await pocketsflow.newsletters.subscribers.delete('subscriber_id');
347
+ ```
348
+
349
+ A post needs `subject`, `preview`, `fromName` and `contentHtml` before it can
350
+ leave `draft`. Posts that have already been sent cannot be edited.
351
+
222
352
  ### Webhooks
223
353
 
224
354
  ```typescript
package/dist/index.d.mts CHANGED
@@ -281,6 +281,273 @@ interface Subscription {
281
281
  interface ListSubscriptionsParams extends PaginationParams, DateRangeParams {
282
282
  status?: 'active' | 'canceled' | 'paused';
283
283
  }
284
+ /** A subscription OFFER — a recurring product you sell. */
285
+ interface SubscriptionOffer {
286
+ _id: string;
287
+ userId: string;
288
+ name: string;
289
+ description?: string;
290
+ price: number;
291
+ currency?: string;
292
+ frequency: 'weekly' | 'monthly' | 'yearly';
293
+ published?: boolean;
294
+ slug?: string;
295
+ thumbnail?: string;
296
+ testMode: boolean;
297
+ createdAt: string;
298
+ updatedAt?: string;
299
+ }
300
+ /** Whop-sourced live membership status. */
301
+ type SubscriberStatus = 'incomplete' | 'incomplete_expired' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'succeeded' | 'refunded' | 'paused';
302
+ /** A subscriber — a buyer's membership in one of your subscription offers. */
303
+ interface Subscriber {
304
+ _id: string;
305
+ buyerEmail: string;
306
+ /** Native portal link. The id pair is the capability — no login required. */
307
+ portalUrl?: string;
308
+ status: SubscriberStatus;
309
+ active: boolean;
310
+ /** The Whop PLAN id for this subscriber */
311
+ whopSubscriptionId?: string;
312
+ /** The Whop MEMBERSHIP id — drives the native portal cancel/resume actions */
313
+ whopMembershipId?: string;
314
+ cancelAtPeriodEnd?: boolean;
315
+ subscriptionId: string;
316
+ firstName?: string;
317
+ lastName?: string;
318
+ country?: string;
319
+ createdAt: string;
320
+ /** The joined subscription offer */
321
+ subscription?: {
322
+ _id: string;
323
+ name: string;
324
+ price: number;
325
+ frequency: 'weekly' | 'monthly' | 'yearly';
326
+ } | null;
327
+ }
328
+ interface ListSubscribersParams extends PaginationParams {
329
+ status?: SubscriberStatus;
330
+ buyerEmail?: string;
331
+ /** Alias for buyerEmail */
332
+ email?: string;
333
+ /** Filter by subscription offer id */
334
+ subscriptionId?: string;
335
+ }
336
+ interface SubscribersResponse {
337
+ subscribers: Subscriber[];
338
+ pagination: {
339
+ totalCount: number;
340
+ totalPages: number;
341
+ currentPage: number;
342
+ pageSize: number;
343
+ hasMore: boolean;
344
+ };
345
+ }
346
+ interface SubscriberDetail {
347
+ subscriber: Subscriber;
348
+ /** The subscription offer */
349
+ subscription: SubscriptionOffer | null;
350
+ /** The buyer's customer record */
351
+ customer: Customer | null;
352
+ status: SubscriberStatus;
353
+ /** Every subscription payment (initial + renewals) for this subscriber */
354
+ payments: Payment[];
355
+ /** Only present when `live: true` — null if the live lookup failed */
356
+ whopMembership?: Record<string, any> | null;
357
+ }
358
+ /** Native subscriber portal payload (no authentication required). */
359
+ interface SubscriberPortalData {
360
+ subscription?: SubscriptionOffer | null;
361
+ subscriber?: Subscriber | null;
362
+ payments?: Payment[];
363
+ [key: string]: any;
364
+ }
365
+ /**
366
+ * A single payment (a `Sale`). Covers BOTH one-time product purchases
367
+ * (`isSubscription: false`) and subscription payments — the initial charge and
368
+ * every renewal (`isSubscription: true`).
369
+ */
370
+ interface Payment {
371
+ _id: string;
372
+ isSubscription: boolean;
373
+ /** Subscription payments only: `initial` activates the membership, `renewal` after */
374
+ billingReason?: 'initial' | 'renewal';
375
+ /** Charged amount (after tax), in the payment currency */
376
+ amount: number;
377
+ grossAmount?: number;
378
+ amountBeforeTax?: number;
379
+ taxAmount?: number;
380
+ currency: string;
381
+ buyerEmail: string;
382
+ firstName?: string;
383
+ lastName?: string;
384
+ isRefunded: boolean;
385
+ isDisputed: boolean;
386
+ /** Empty on subscription payments — use `subscriptionId` instead */
387
+ productId?: string;
388
+ /** Empty on one-time product purchases */
389
+ subscriptionId?: string;
390
+ whopPaymentId?: string;
391
+ whopPlanId?: string;
392
+ whopMembershipId?: string;
393
+ createdAt: string;
394
+ }
395
+ interface ListPaymentsParams extends PaginationParams, DateRangeParams {
396
+ /** `one_time`, `subscription`, or `all` (default) */
397
+ type?: 'one_time' | 'subscription' | 'all';
398
+ productId?: string;
399
+ /** Filter by subscription offer id */
400
+ subscriptionId?: string;
401
+ }
402
+ interface PaymentsResponse {
403
+ payments: Payment[];
404
+ pagination: {
405
+ totalCount: number;
406
+ totalPages: number;
407
+ currentPage: number;
408
+ pageSize: number;
409
+ hasMore: boolean;
410
+ };
411
+ }
412
+ interface PaymentDetail {
413
+ payment: Payment & {
414
+ /** Net to the seller (amountBeforeTax − affiliateCut − stripeFee) */
415
+ net?: number;
416
+ /** Processor fee (Stripe or PayPal) */
417
+ fee?: number;
418
+ /** The raw stored Whop payment payload captured on the webhook */
419
+ metadata?: Record<string, any>;
420
+ };
421
+ /** One-time purchases only; null for subscription payments */
422
+ product: Product | null;
423
+ /** Subscription payments only; null for one-time purchases */
424
+ subscription: SubscriptionOffer | null;
425
+ customer: Customer | null;
426
+ whop?: Record<string, any>;
427
+ /** Only present when `live: true` — null if the live lookup failed */
428
+ whopLive?: Record<string, any> | null;
429
+ }
430
+ interface CreatorPageLink {
431
+ title?: string;
432
+ url?: string;
433
+ order?: number;
434
+ [key: string]: any;
435
+ }
436
+ interface CreatorPage {
437
+ _id: string;
438
+ userId: string;
439
+ creatorName?: string;
440
+ creatorBio?: string;
441
+ username?: string;
442
+ socialLinks?: CreatorPageLink[];
443
+ regularLinks?: CreatorPageLink[];
444
+ theme?: string;
445
+ themeV2?: Record<string, any>;
446
+ gaMeasurementId?: string;
447
+ subscriberForm?: Record<string, any>;
448
+ bookingEnabled?: boolean;
449
+ bookingButtonLabel?: string;
450
+ template?: string;
451
+ createdAt: string;
452
+ updatedAt?: string;
453
+ }
454
+ interface CreateCreatorPageParams {
455
+ creatorName?: string;
456
+ creatorBio?: string;
457
+ username?: string;
458
+ socialLinks?: CreatorPageLink[];
459
+ regularLinks?: CreatorPageLink[];
460
+ theme?: string;
461
+ themeV2?: Record<string, any>;
462
+ gaMeasurementId?: string;
463
+ subscriberForm?: Record<string, any>;
464
+ bookingEnabled?: boolean;
465
+ bookingButtonLabel?: string;
466
+ template?: string;
467
+ }
468
+ type UpdateCreatorPageParams = CreateCreatorPageParams;
469
+ interface UploadImageResponse {
470
+ imageUrl: string;
471
+ }
472
+ type NewsletterPostStatus = 'draft' | 'scheduled' | 'sending' | 'sent' | 'failed' | 'automation';
473
+ interface NewsletterPost {
474
+ _id: string;
475
+ creatorId: string;
476
+ name: string;
477
+ subject?: string;
478
+ preview?: string;
479
+ fromName?: string;
480
+ fromEmail: string;
481
+ replyToEmail?: string;
482
+ contentHtml?: string;
483
+ contentJson?: any;
484
+ status: NewsletterPostStatus;
485
+ scheduledAt?: string;
486
+ scheduledTimezone?: string;
487
+ sentAt?: string;
488
+ sendToAll?: boolean;
489
+ tags?: string[];
490
+ subscriberIds?: string[];
491
+ source?: 'dashboard' | 'api';
492
+ createdAt: string;
493
+ updatedAt: string;
494
+ }
495
+ interface CreateNewsletterPostParams {
496
+ /** Internal post name (required) */
497
+ name: string;
498
+ /** Required before the post can leave `draft` */
499
+ subject?: string;
500
+ /** Required before the post can leave `draft` */
501
+ preview?: string;
502
+ /** Required before the post can leave `draft` */
503
+ fromName?: string;
504
+ /** Defaults to your configured sender */
505
+ fromEmail?: string;
506
+ replyToEmail?: string;
507
+ /** Required before the post can leave `draft` */
508
+ contentHtml?: string;
509
+ contentJson?: any;
510
+ status?: NewsletterPostStatus;
511
+ scheduledAt?: string;
512
+ scheduledTimezone?: string;
513
+ sendToAll?: boolean;
514
+ tags?: string[];
515
+ subscriberIds?: string[];
516
+ }
517
+ type UpdateNewsletterPostParams = Partial<CreateNewsletterPostParams>;
518
+ interface SendNewsletterPostResponse {
519
+ message: string;
520
+ post: NewsletterPost;
521
+ }
522
+ interface SendEmailParams {
523
+ /** Recipient(s) — 1 to 100 addresses */
524
+ to: string | string[];
525
+ subject: string;
526
+ /** Required unless `text` is provided */
527
+ html?: string;
528
+ /** Used to generate `html` when `html` is omitted */
529
+ text?: string;
530
+ fromName?: string;
531
+ replyTo?: string;
532
+ preview?: string;
533
+ }
534
+ interface SendEmailResponse {
535
+ /** The id of the post created for this send */
536
+ id: string;
537
+ /** Recipients the send was accepted for */
538
+ accepted: string[];
539
+ status: 'sent';
540
+ }
541
+ interface NewsletterSubscriber {
542
+ _id: string;
543
+ userId: string;
544
+ email: string;
545
+ name?: string;
546
+ status: 'active' | 'unsubscribed';
547
+ tags?: string[];
548
+ createdAt: string;
549
+ updatedAt: string;
550
+ }
284
551
  interface Webhook {
285
552
  _id: string;
286
553
  userId: string;
@@ -380,6 +647,12 @@ declare class Pocketsflow {
380
647
  discounts: DiscountsResource;
381
648
  upsells: UpsellsResource;
382
649
  subscriptions: SubscriptionsResource;
650
+ subscriptionOffers: SubscriptionOffersResource;
651
+ subscribers: SubscribersResource;
652
+ payments: PaymentsResource;
653
+ creatorPages: CreatorPagesResource;
654
+ images: ImagesResource;
655
+ newsletters: NewslettersResource;
383
656
  webhooks: WebhooksResource;
384
657
  users: UsersResource;
385
658
  checkout: CheckoutResource;
@@ -453,6 +726,10 @@ declare class DiscountsResource {
453
726
  delete(id: string): Promise<{
454
727
  message: string;
455
728
  }>;
729
+ /** Validate a discount code against a product and get the resulting price */
730
+ apply(discountCode: string, productId: string): Promise<any>;
731
+ /** Check whether a product has any discounts */
732
+ checkProduct(productId: string): Promise<any>;
456
733
  }
457
734
  declare class UpsellsResource {
458
735
  private client;
@@ -470,6 +747,14 @@ declare class UpsellsResource {
470
747
  message: string;
471
748
  }>;
472
749
  }
750
+ /**
751
+ * Legacy subscriber access via the Orders endpoints, kept for v1 compatibility.
752
+ *
753
+ * Prefer `subscribers` (buyers) and `subscriptionOffers` (the recurring
754
+ * products you sell) — they cover pause/resume and filtering, which these do
755
+ * not. Note `cancel`/`refund` here key off the Stripe subscription id, whereas
756
+ * `subscribers.cancel` accepts the subscriber `_id` or Whop membership id.
757
+ */
473
758
  declare class SubscriptionsResource {
474
759
  private client;
475
760
  constructor(client: Pocketsflow);
@@ -486,6 +771,156 @@ declare class SubscriptionsResource {
486
771
  message: string;
487
772
  }>;
488
773
  }
774
+ /**
775
+ * Your subscription OFFERS — the recurring products you sell.
776
+ * To work with your buyers instead, use `subscribers`.
777
+ */
778
+ declare class SubscriptionOffersResource {
779
+ private client;
780
+ constructor(client: Pocketsflow);
781
+ /** List all subscription offers */
782
+ list(): Promise<SubscriptionOffer[]>;
783
+ /** Get a subscription offer by ID */
784
+ get(id: string): Promise<SubscriptionOffer>;
785
+ }
786
+ /**
787
+ * Your subscribers — buyers with a membership in one of your subscription
788
+ * offers. `id` accepts either the subscriber's `_id` or its Whop membership id.
789
+ */
790
+ declare class SubscribersResource {
791
+ private client;
792
+ constructor(client: Pocketsflow);
793
+ /** List subscribers */
794
+ list(params?: ListSubscribersParams): Promise<SubscribersResponse>;
795
+ /**
796
+ * Get a subscriber with its full payment history.
797
+ * Pass `live` to also fetch the authoritative membership from Whop; the
798
+ * lookup degrades gracefully and never fails the request.
799
+ */
800
+ get(id: string, options?: {
801
+ live?: boolean;
802
+ }): Promise<SubscriberDetail>;
803
+ /** Cancel a subscriber's subscription */
804
+ cancel(id: string): Promise<{
805
+ success: boolean;
806
+ message?: string;
807
+ }>;
808
+ /** Pause a subscriber's subscription */
809
+ pause(id: string): Promise<{
810
+ success: boolean;
811
+ message?: string;
812
+ }>;
813
+ /** Resume a paused subscription */
814
+ resume(id: string): Promise<{
815
+ success: boolean;
816
+ message?: string;
817
+ }>;
818
+ /**
819
+ * Read the native subscriber portal payload. The `subscriptionId` +
820
+ * `subscriberId` pair is itself the capability — these portal endpoints are
821
+ * unauthenticated, so the API key is not required to call them.
822
+ */
823
+ portal(subscriptionId: string, subscriberId: string): Promise<SubscriberPortalData>;
824
+ /** Cancel a membership through the native portal */
825
+ portalCancel(subscriberId: string): Promise<{
826
+ success?: boolean;
827
+ message?: string;
828
+ }>;
829
+ /** Resume a pending cancellation through the native portal */
830
+ portalResume(subscriberId: string): Promise<{
831
+ success?: boolean;
832
+ message?: string;
833
+ }>;
834
+ }
835
+ /**
836
+ * The unified payment ledger — one-time purchases AND subscription payments
837
+ * (the initial charge plus every renewal).
838
+ */
839
+ declare class PaymentsResource {
840
+ private client;
841
+ constructor(client: Pocketsflow);
842
+ /** List payments */
843
+ list(params?: ListPaymentsParams): Promise<PaymentsResponse>;
844
+ /**
845
+ * Get a payment by ID. Pass `live` to also fetch the authoritative payment
846
+ * from Whop; the lookup degrades gracefully and never fails the request.
847
+ */
848
+ get(id: string, options?: {
849
+ live?: boolean;
850
+ }): Promise<PaymentDetail>;
851
+ }
852
+ /** Your Link in Bio page. */
853
+ declare class CreatorPagesResource {
854
+ private client;
855
+ constructor(client: Pocketsflow);
856
+ /** Get your Link in Bio page */
857
+ get(): Promise<CreatorPage>;
858
+ /** Create your Link in Bio page. Fails if one already exists — use `update`. */
859
+ create(params: CreateCreatorPageParams): Promise<CreatorPage>;
860
+ /** Update your Link in Bio page (partial) */
861
+ update(params: UpdateCreatorPageParams): Promise<CreatorPage>;
862
+ /** Delete your Link in Bio page */
863
+ delete(): Promise<{
864
+ message: string;
865
+ }>;
866
+ /** Check whether a username is available */
867
+ checkUsername(username: string): Promise<any>;
868
+ /** Set your Link in Bio username */
869
+ updateUsername(username: string): Promise<CreatorPage>;
870
+ }
871
+ /** Image uploads. */
872
+ declare class ImagesResource {
873
+ private client;
874
+ constructor(client: Pocketsflow);
875
+ /**
876
+ * Upload an image and get back its hosted URL.
877
+ *
878
+ * `file` accepts anything FormData can hold — a Blob/File, or a Buffer in
879
+ * Node 18+. `filename` is used when the value carries no name of its own.
880
+ */
881
+ upload(file: Blob | Uint8Array | ArrayBuffer, filename?: string): Promise<UploadImageResponse>;
882
+ }
883
+ /** Newsletter posts and subscribers. */
884
+ declare class NewslettersResource {
885
+ private client;
886
+ posts: NewsletterPostsResource;
887
+ subscribers: NewsletterSubscribersResource;
888
+ constructor(client: Pocketsflow);
889
+ /**
890
+ * Send a one-off email to up to 100 recipients.
891
+ * Requires a verified sender email. Either `html` or `text` must be given.
892
+ */
893
+ send(params: SendEmailParams): Promise<SendEmailResponse>;
894
+ }
895
+ declare class NewsletterPostsResource {
896
+ private client;
897
+ constructor(client: Pocketsflow);
898
+ /** List all posts, newest first */
899
+ list(): Promise<NewsletterPost[]>;
900
+ /** Get a post by ID */
901
+ get(id: string): Promise<NewsletterPost>;
902
+ /**
903
+ * Create a post. Leaving `draft` requires `subject`, `preview`, `fromName`
904
+ * and `contentHtml` to be set.
905
+ */
906
+ create(params: CreateNewsletterPostParams): Promise<NewsletterPost>;
907
+ /** Update a post. Posts that have already been sent cannot be edited. */
908
+ update(id: string, params: UpdateNewsletterPostParams): Promise<NewsletterPost>;
909
+ /** Delete a post */
910
+ delete(id: string): Promise<NewsletterPost>;
911
+ /** Queue a post for sending to its subscribers */
912
+ send(id: string): Promise<SendNewsletterPostResponse>;
913
+ }
914
+ declare class NewsletterSubscribersResource {
915
+ private client;
916
+ constructor(client: Pocketsflow);
917
+ /** List all subscribers, newest first */
918
+ list(): Promise<NewsletterSubscriber[]>;
919
+ /** Get a subscriber by ID */
920
+ get(id: string): Promise<NewsletterSubscriber>;
921
+ /** Remove a subscriber */
922
+ delete(id: string): Promise<NewsletterSubscriber>;
923
+ }
489
924
  declare class WebhooksResource {
490
925
  private client;
491
926
  constructor(client: Pocketsflow);
@@ -531,4 +966,4 @@ declare class RefundsResource {
531
966
  create(params: CreateRefundParams): Promise<Refund>;
532
967
  }
533
968
 
534
- export { type ApiError, type CheckoutSession, type CreateCheckoutParams, type CreateDiscountParams, type CreateProductParams, type CreateRefundParams, type CreateUpsellParams, type CreateVariantParams, type CreateWebhookParams, type Customer, type DateRangeParams, type Discount, type ListCustomersParams, type ListOrdersParams, type ListReviewsParams, type ListSubscriptionsParams, type Order, type OrdersResponse, type PaginatedResponse, type PaginationParams, Pocketsflow, type PocketsflowConfig, PocketsflowError, type Product, type ProductFile, type ProductVariant, type Refund, type Review, type Subscription, type UpdateDiscountParams, type UpdateProductParams, type UpdateUpsellParams, type UpdateUserParams, type UpdateWebhookParams, type Upsell, type UpsellsResponse, type User, type Webhook, type WebhookEvent };
969
+ export { type ApiError, type CheckoutSession, type CreateCheckoutParams, type CreateCreatorPageParams, type CreateDiscountParams, type CreateNewsletterPostParams, type CreateProductParams, type CreateRefundParams, type CreateUpsellParams, type CreateVariantParams, type CreateWebhookParams, type CreatorPage, type CreatorPageLink, type Customer, type DateRangeParams, type Discount, type ListCustomersParams, type ListOrdersParams, type ListPaymentsParams, type ListReviewsParams, type ListSubscribersParams, type ListSubscriptionsParams, type NewsletterPost, type NewsletterPostStatus, type NewsletterSubscriber, type Order, type OrdersResponse, type PaginatedResponse, type PaginationParams, type Payment, type PaymentDetail, type PaymentsResponse, Pocketsflow, type PocketsflowConfig, PocketsflowError, type Product, type ProductFile, type ProductVariant, type Refund, type Review, type SendEmailParams, type SendEmailResponse, type SendNewsletterPostResponse, type Subscriber, type SubscriberDetail, type SubscriberPortalData, type SubscriberStatus, type SubscribersResponse, type Subscription, type SubscriptionOffer, type UpdateCreatorPageParams, type UpdateDiscountParams, type UpdateNewsletterPostParams, type UpdateProductParams, type UpdateUpsellParams, type UpdateUserParams, type UpdateWebhookParams, type UploadImageResponse, type Upsell, type UpsellsResponse, type User, type Webhook, type WebhookEvent };