@waffo/pancake-ts 0.21.0 → 0.22.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/dist/index.d.cts CHANGED
@@ -351,7 +351,9 @@ interface NotificationSettings {
351
351
  emailSubscriptionRevoked: boolean;
352
352
  emailSubscriptionPastDue: boolean;
353
353
  emailTrialStarted: boolean;
354
+ /** Customer email sent before a paid trial ends — merchant-writable, per store */
354
355
  emailTrialEnding: boolean;
356
+ /** Customer email sent before a renewal is charged — merchant-writable, per store */
355
357
  emailUpcomingCharge: boolean;
356
358
  /** One toggle for all three plan-change customer emails (scheduled / failed / applied) */
357
359
  emailSubscriptionPlanChanged: boolean;
@@ -372,17 +374,23 @@ interface NotificationSettings {
372
374
  /**
373
375
  * Merchant-writable subset of {@link NotificationSettings}.
374
376
  *
375
- * Every `notify*` toggle, plus `emailUpcomingCharge` the renewal reminder is the
376
- * one consumer email a merchant may switch off, and switching it off silences it
377
- * for every billing period in that store, yearly plans included.
377
+ * Every `notify*` toggle, plus the two customer reminders a merchant may switch off:
378
+ * `emailUpcomingCharge` (renewal) and `emailTrialEnding` (trial ending). Switching
379
+ * either off silences it for every buyer of that store `emailUpcomingCharge` for
380
+ * every billing period, yearly plans included, and `emailTrialEnding` for every paid
381
+ * trial. Both are decided per store; there is no per-recipient form of them.
378
382
  *
379
383
  * Every other consumer-email toggle (`email*`) is managed by the PANCAKE
380
384
  * platform and **not** writable from this SDK; the `update-store` endpoint silently
381
385
  * drops them and names them in the response's `warnings`. Payout result
382
386
  * notifications are platform-managed and always delivered — they have no toggle
383
387
  * key. Use this type for any merchant-side update.
388
+ *
389
+ * Passing `notificationSettings: null` to `update-store` clears every key in this
390
+ * type back to its default (on), both reminders included. Send a partial update
391
+ * carrying only the keys you want to change to keep a reminder switched off.
384
392
  */
385
- type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback" | "notifyRefundSucceeded" | "emailUpcomingCharge">;
393
+ type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback" | "notifyRefundSucceeded" | "emailUpcomingCharge" | "emailTrialEnding">;
386
394
  /**
387
395
  * Single-theme checkout page styling.
388
396
  * @see docs/api-reference/endpoints/stores/overview.mdx
@@ -453,7 +461,10 @@ interface UpdateStoreParams {
453
461
  status?: EntityStatus;
454
462
  /** Store logo URL (set to `null` to remove) */
455
463
  logo?: string | null;
456
- /** Notification preferences (partial update — omitted fields keep existing values, set to `null` to clear all) */
464
+ /**
465
+ * Notification preferences (partial update — omitted fields keep existing values,
466
+ * set to `null` to clear all merchant-writable keys back to their default of on)
467
+ */
457
468
  notificationSettings?: Partial<MerchantWritableNotificationSettings> | null;
458
469
  /** Checkout page theme configuration (partial update — omitted fields keep existing values, set to `null` to clear all) */
459
470
  checkoutSettings?: Partial<CheckoutSettings> | null;
@@ -1124,6 +1135,8 @@ interface WebhookEventData {
1124
1135
  paymentFailureReason?: string;
1125
1136
  /** Payment date (ISO 8601 date, e.g., "2026-04-18") */
1126
1137
  paymentDate?: string;
1138
+ /** Billing period this event refers to, as reported by the payment channel; see the webhook docs for the full semantics. */
1139
+ periodNumber?: number;
1127
1140
  /** Billing period: "weekly", "monthly", "quarterly", "yearly" */
1128
1141
  billingPeriod?: string;
1129
1142
  /** Current billing period start date (ISO 8601, e.g., "2026-04-01") */
@@ -1898,6 +1911,12 @@ declare class StoresResource {
1898
1911
  * partial updates: omitted sub-fields keep existing values, `null` clears a
1899
1912
  * field. Pass the entire settings object as `null` to clear all fields.
1900
1913
  *
1914
+ * `notificationSettings` accepts the merchant-writable keys only — every
1915
+ * `notify*` toggle plus the two customer reminders `emailUpcomingCharge` and
1916
+ * `emailTrialEnding`. Other `email*` keys are dropped and named in `warnings`.
1917
+ * Passing `notificationSettings: null` clears the writable keys back to their
1918
+ * default of on, so send a partial update to keep a reminder switched off.
1919
+ *
1901
1920
  * **BREAKING (2026-05)**: the legacy `webhookSettings` parameter is removed.
1902
1921
  * Use `client.webhooks.add / update / remove` to manage webhook endpoints,
1903
1922
  * and query the configured webhook list via GraphQL `Store.storeWebhooks`.
@@ -1916,7 +1935,14 @@ declare class StoresResource {
1916
1935
  * // Toggle a notification preference
1917
1936
  * const { store } = await client.stores.update({
1918
1937
  * id: "STO_xxx",
1919
- * notificationSettings: { emailOrderConfirmation: false },
1938
+ * notificationSettings: { notifyNewOrders: false },
1939
+ * });
1940
+ *
1941
+ * @example
1942
+ * // Stop reminding this store's buyers that their trial is about to end
1943
+ * const { store } = await client.stores.update({
1944
+ * id: "STO_xxx",
1945
+ * notificationSettings: { emailTrialEnding: false },
1920
1946
  * });
1921
1947
  */
1922
1948
  update(params: UpdateStoreParams): Promise<{
package/dist/index.d.ts CHANGED
@@ -351,7 +351,9 @@ interface NotificationSettings {
351
351
  emailSubscriptionRevoked: boolean;
352
352
  emailSubscriptionPastDue: boolean;
353
353
  emailTrialStarted: boolean;
354
+ /** Customer email sent before a paid trial ends — merchant-writable, per store */
354
355
  emailTrialEnding: boolean;
356
+ /** Customer email sent before a renewal is charged — merchant-writable, per store */
355
357
  emailUpcomingCharge: boolean;
356
358
  /** One toggle for all three plan-change customer emails (scheduled / failed / applied) */
357
359
  emailSubscriptionPlanChanged: boolean;
@@ -372,17 +374,23 @@ interface NotificationSettings {
372
374
  /**
373
375
  * Merchant-writable subset of {@link NotificationSettings}.
374
376
  *
375
- * Every `notify*` toggle, plus `emailUpcomingCharge` the renewal reminder is the
376
- * one consumer email a merchant may switch off, and switching it off silences it
377
- * for every billing period in that store, yearly plans included.
377
+ * Every `notify*` toggle, plus the two customer reminders a merchant may switch off:
378
+ * `emailUpcomingCharge` (renewal) and `emailTrialEnding` (trial ending). Switching
379
+ * either off silences it for every buyer of that store `emailUpcomingCharge` for
380
+ * every billing period, yearly plans included, and `emailTrialEnding` for every paid
381
+ * trial. Both are decided per store; there is no per-recipient form of them.
378
382
  *
379
383
  * Every other consumer-email toggle (`email*`) is managed by the PANCAKE
380
384
  * platform and **not** writable from this SDK; the `update-store` endpoint silently
381
385
  * drops them and names them in the response's `warnings`. Payout result
382
386
  * notifications are platform-managed and always delivered — they have no toggle
383
387
  * key. Use this type for any merchant-side update.
388
+ *
389
+ * Passing `notificationSettings: null` to `update-store` clears every key in this
390
+ * type back to its default (on), both reminders included. Send a partial update
391
+ * carrying only the keys you want to change to keep a reminder switched off.
384
392
  */
385
- type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback" | "notifyRefundSucceeded" | "emailUpcomingCharge">;
393
+ type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback" | "notifyRefundSucceeded" | "emailUpcomingCharge" | "emailTrialEnding">;
386
394
  /**
387
395
  * Single-theme checkout page styling.
388
396
  * @see docs/api-reference/endpoints/stores/overview.mdx
@@ -453,7 +461,10 @@ interface UpdateStoreParams {
453
461
  status?: EntityStatus;
454
462
  /** Store logo URL (set to `null` to remove) */
455
463
  logo?: string | null;
456
- /** Notification preferences (partial update — omitted fields keep existing values, set to `null` to clear all) */
464
+ /**
465
+ * Notification preferences (partial update — omitted fields keep existing values,
466
+ * set to `null` to clear all merchant-writable keys back to their default of on)
467
+ */
457
468
  notificationSettings?: Partial<MerchantWritableNotificationSettings> | null;
458
469
  /** Checkout page theme configuration (partial update — omitted fields keep existing values, set to `null` to clear all) */
459
470
  checkoutSettings?: Partial<CheckoutSettings> | null;
@@ -1124,6 +1135,8 @@ interface WebhookEventData {
1124
1135
  paymentFailureReason?: string;
1125
1136
  /** Payment date (ISO 8601 date, e.g., "2026-04-18") */
1126
1137
  paymentDate?: string;
1138
+ /** Billing period this event refers to, as reported by the payment channel; see the webhook docs for the full semantics. */
1139
+ periodNumber?: number;
1127
1140
  /** Billing period: "weekly", "monthly", "quarterly", "yearly" */
1128
1141
  billingPeriod?: string;
1129
1142
  /** Current billing period start date (ISO 8601, e.g., "2026-04-01") */
@@ -1898,6 +1911,12 @@ declare class StoresResource {
1898
1911
  * partial updates: omitted sub-fields keep existing values, `null` clears a
1899
1912
  * field. Pass the entire settings object as `null` to clear all fields.
1900
1913
  *
1914
+ * `notificationSettings` accepts the merchant-writable keys only — every
1915
+ * `notify*` toggle plus the two customer reminders `emailUpcomingCharge` and
1916
+ * `emailTrialEnding`. Other `email*` keys are dropped and named in `warnings`.
1917
+ * Passing `notificationSettings: null` clears the writable keys back to their
1918
+ * default of on, so send a partial update to keep a reminder switched off.
1919
+ *
1901
1920
  * **BREAKING (2026-05)**: the legacy `webhookSettings` parameter is removed.
1902
1921
  * Use `client.webhooks.add / update / remove` to manage webhook endpoints,
1903
1922
  * and query the configured webhook list via GraphQL `Store.storeWebhooks`.
@@ -1916,7 +1935,14 @@ declare class StoresResource {
1916
1935
  * // Toggle a notification preference
1917
1936
  * const { store } = await client.stores.update({
1918
1937
  * id: "STO_xxx",
1919
- * notificationSettings: { emailOrderConfirmation: false },
1938
+ * notificationSettings: { notifyNewOrders: false },
1939
+ * });
1940
+ *
1941
+ * @example
1942
+ * // Stop reminding this store's buyers that their trial is about to end
1943
+ * const { store } = await client.stores.update({
1944
+ * id: "STO_xxx",
1945
+ * notificationSettings: { emailTrialEnding: false },
1920
1946
  * });
1921
1947
  */
1922
1948
  update(params: UpdateStoreParams): Promise<{
package/dist/index.js CHANGED
@@ -880,6 +880,12 @@ var StoresResource = class {
880
880
  * partial updates: omitted sub-fields keep existing values, `null` clears a
881
881
  * field. Pass the entire settings object as `null` to clear all fields.
882
882
  *
883
+ * `notificationSettings` accepts the merchant-writable keys only — every
884
+ * `notify*` toggle plus the two customer reminders `emailUpcomingCharge` and
885
+ * `emailTrialEnding`. Other `email*` keys are dropped and named in `warnings`.
886
+ * Passing `notificationSettings: null` clears the writable keys back to their
887
+ * default of on, so send a partial update to keep a reminder switched off.
888
+ *
883
889
  * **BREAKING (2026-05)**: the legacy `webhookSettings` parameter is removed.
884
890
  * Use `client.webhooks.add / update / remove` to manage webhook endpoints,
885
891
  * and query the configured webhook list via GraphQL `Store.storeWebhooks`.
@@ -898,7 +904,14 @@ var StoresResource = class {
898
904
  * // Toggle a notification preference
899
905
  * const { store } = await client.stores.update({
900
906
  * id: "STO_xxx",
901
- * notificationSettings: { emailOrderConfirmation: false },
907
+ * notificationSettings: { notifyNewOrders: false },
908
+ * });
909
+ *
910
+ * @example
911
+ * // Stop reminding this store's buyers that their trial is about to end
912
+ * const { store } = await client.stores.update({
913
+ * id: "STO_xxx",
914
+ * notificationSettings: { emailTrialEnding: false },
902
915
  * });
903
916
  */
904
917
  async update(params) {