@waffo/pancake-ts 0.20.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/CHANGELOG.md +13 -0
- package/README.md +14 -4
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -7
- package/dist/index.d.ts +42 -7
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/docs/api-reference.md +17 -18
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -351,10 +351,14 @@ 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;
|
|
360
|
+
/** Customer email sent when a refund on their payment completes */
|
|
361
|
+
emailRefundSucceeded: boolean;
|
|
358
362
|
notifyNewOrders: boolean;
|
|
359
363
|
notifyNewSubscriptions: boolean;
|
|
360
364
|
notifySubscriptionCanceled: boolean;
|
|
@@ -364,16 +368,29 @@ interface NotificationSettings {
|
|
|
364
368
|
notifySubscriptionUncanceled: boolean;
|
|
365
369
|
notifySubscriptionPlanChanged: boolean;
|
|
366
370
|
notifyChargeback: boolean;
|
|
371
|
+
/** Merchant notification sent when a refund on a payment completes */
|
|
372
|
+
notifyRefundSucceeded: boolean;
|
|
367
373
|
}
|
|
368
374
|
/**
|
|
369
375
|
* Merchant-writable subset of {@link NotificationSettings}.
|
|
370
376
|
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
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.
|
|
382
|
+
*
|
|
383
|
+
* Every other consumer-email toggle (`email*`) is managed by the PANCAKE
|
|
384
|
+
* platform and **not** writable from this SDK; the `update-store` endpoint silently
|
|
385
|
+
* drops them and names them in the response's `warnings`. Payout result
|
|
386
|
+
* notifications are platform-managed and always delivered — they have no toggle
|
|
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.
|
|
375
392
|
*/
|
|
376
|
-
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback">;
|
|
393
|
+
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback" | "notifyRefundSucceeded" | "emailUpcomingCharge" | "emailTrialEnding">;
|
|
377
394
|
/**
|
|
378
395
|
* Single-theme checkout page styling.
|
|
379
396
|
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
@@ -444,7 +461,10 @@ interface UpdateStoreParams {
|
|
|
444
461
|
status?: EntityStatus;
|
|
445
462
|
/** Store logo URL (set to `null` to remove) */
|
|
446
463
|
logo?: string | null;
|
|
447
|
-
/**
|
|
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
|
+
*/
|
|
448
468
|
notificationSettings?: Partial<MerchantWritableNotificationSettings> | null;
|
|
449
469
|
/** Checkout page theme configuration (partial update — omitted fields keep existing values, set to `null` to clear all) */
|
|
450
470
|
checkoutSettings?: Partial<CheckoutSettings> | null;
|
|
@@ -1115,6 +1135,8 @@ interface WebhookEventData {
|
|
|
1115
1135
|
paymentFailureReason?: string;
|
|
1116
1136
|
/** Payment date (ISO 8601 date, e.g., "2026-04-18") */
|
|
1117
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;
|
|
1118
1140
|
/** Billing period: "weekly", "monthly", "quarterly", "yearly" */
|
|
1119
1141
|
billingPeriod?: string;
|
|
1120
1142
|
/** Current billing period start date (ISO 8601, e.g., "2026-04-01") */
|
|
@@ -1889,6 +1911,12 @@ declare class StoresResource {
|
|
|
1889
1911
|
* partial updates: omitted sub-fields keep existing values, `null` clears a
|
|
1890
1912
|
* field. Pass the entire settings object as `null` to clear all fields.
|
|
1891
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
|
+
*
|
|
1892
1920
|
* **BREAKING (2026-05)**: the legacy `webhookSettings` parameter is removed.
|
|
1893
1921
|
* Use `client.webhooks.add / update / remove` to manage webhook endpoints,
|
|
1894
1922
|
* and query the configured webhook list via GraphQL `Store.storeWebhooks`.
|
|
@@ -1907,7 +1935,14 @@ declare class StoresResource {
|
|
|
1907
1935
|
* // Toggle a notification preference
|
|
1908
1936
|
* const { store } = await client.stores.update({
|
|
1909
1937
|
* id: "STO_xxx",
|
|
1910
|
-
* notificationSettings: {
|
|
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 },
|
|
1911
1946
|
* });
|
|
1912
1947
|
*/
|
|
1913
1948
|
update(params: UpdateStoreParams): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -351,10 +351,14 @@ 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;
|
|
360
|
+
/** Customer email sent when a refund on their payment completes */
|
|
361
|
+
emailRefundSucceeded: boolean;
|
|
358
362
|
notifyNewOrders: boolean;
|
|
359
363
|
notifyNewSubscriptions: boolean;
|
|
360
364
|
notifySubscriptionCanceled: boolean;
|
|
@@ -364,16 +368,29 @@ interface NotificationSettings {
|
|
|
364
368
|
notifySubscriptionUncanceled: boolean;
|
|
365
369
|
notifySubscriptionPlanChanged: boolean;
|
|
366
370
|
notifyChargeback: boolean;
|
|
371
|
+
/** Merchant notification sent when a refund on a payment completes */
|
|
372
|
+
notifyRefundSucceeded: boolean;
|
|
367
373
|
}
|
|
368
374
|
/**
|
|
369
375
|
* Merchant-writable subset of {@link NotificationSettings}.
|
|
370
376
|
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
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.
|
|
382
|
+
*
|
|
383
|
+
* Every other consumer-email toggle (`email*`) is managed by the PANCAKE
|
|
384
|
+
* platform and **not** writable from this SDK; the `update-store` endpoint silently
|
|
385
|
+
* drops them and names them in the response's `warnings`. Payout result
|
|
386
|
+
* notifications are platform-managed and always delivered — they have no toggle
|
|
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.
|
|
375
392
|
*/
|
|
376
|
-
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback">;
|
|
393
|
+
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback" | "notifyRefundSucceeded" | "emailUpcomingCharge" | "emailTrialEnding">;
|
|
377
394
|
/**
|
|
378
395
|
* Single-theme checkout page styling.
|
|
379
396
|
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
@@ -444,7 +461,10 @@ interface UpdateStoreParams {
|
|
|
444
461
|
status?: EntityStatus;
|
|
445
462
|
/** Store logo URL (set to `null` to remove) */
|
|
446
463
|
logo?: string | null;
|
|
447
|
-
/**
|
|
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
|
+
*/
|
|
448
468
|
notificationSettings?: Partial<MerchantWritableNotificationSettings> | null;
|
|
449
469
|
/** Checkout page theme configuration (partial update — omitted fields keep existing values, set to `null` to clear all) */
|
|
450
470
|
checkoutSettings?: Partial<CheckoutSettings> | null;
|
|
@@ -1115,6 +1135,8 @@ interface WebhookEventData {
|
|
|
1115
1135
|
paymentFailureReason?: string;
|
|
1116
1136
|
/** Payment date (ISO 8601 date, e.g., "2026-04-18") */
|
|
1117
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;
|
|
1118
1140
|
/** Billing period: "weekly", "monthly", "quarterly", "yearly" */
|
|
1119
1141
|
billingPeriod?: string;
|
|
1120
1142
|
/** Current billing period start date (ISO 8601, e.g., "2026-04-01") */
|
|
@@ -1889,6 +1911,12 @@ declare class StoresResource {
|
|
|
1889
1911
|
* partial updates: omitted sub-fields keep existing values, `null` clears a
|
|
1890
1912
|
* field. Pass the entire settings object as `null` to clear all fields.
|
|
1891
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
|
+
*
|
|
1892
1920
|
* **BREAKING (2026-05)**: the legacy `webhookSettings` parameter is removed.
|
|
1893
1921
|
* Use `client.webhooks.add / update / remove` to manage webhook endpoints,
|
|
1894
1922
|
* and query the configured webhook list via GraphQL `Store.storeWebhooks`.
|
|
@@ -1907,7 +1935,14 @@ declare class StoresResource {
|
|
|
1907
1935
|
* // Toggle a notification preference
|
|
1908
1936
|
* const { store } = await client.stores.update({
|
|
1909
1937
|
* id: "STO_xxx",
|
|
1910
|
-
* notificationSettings: {
|
|
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 },
|
|
1911
1946
|
* });
|
|
1912
1947
|
*/
|
|
1913
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: {
|
|
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) {
|