@shoppexio/storefront 1.0.105 → 1.0.107

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/customer.cjs CHANGED
@@ -20069,7 +20069,39 @@ var customerPortalSubscriptionSummarySchema = external_exports.object({
20069
20069
  }),
20070
20070
  // The open renewal's hosted checkout ("Pay now"). Optional until the backend
20071
20071
  // that sends it is deployed: a storefront script can reach buyers first.
20072
- renewal_checkout_url: nullableStringSchema.optional()
20072
+ renewal_checkout_url: nullableStringSchema.optional(),
20073
+ // When an unpaid renewal's hold ends the subscription, and the renewal to pay now
20074
+ // (me.routes.ts dashboard wire). Optional for the same deploy order.
20075
+ hold_ends_at: nullableStringSchema.optional(),
20076
+ // Set to end without renewing (cancelled at the period end, or a voided renewal): the instant
20077
+ // it ends; null while it renews. Buyer surfaces read it for "Ends" over "Renews". Same deploy order.
20078
+ ends_at: nullableStringSchema.optional(),
20079
+ open_renewal: external_exports.object({
20080
+ uniqid: external_exports.string(),
20081
+ amount: external_exports.string(),
20082
+ currency: external_exports.string(),
20083
+ pay_by: external_exports.string(),
20084
+ pay_url: external_exports.string(),
20085
+ interval: external_exports.string(),
20086
+ interval_count: external_exports.number()
20087
+ }).nullable().optional(),
20088
+ // The pause policy (me.routes.ts, buyerPauseView): the open pause, the lengths a new pause
20089
+ // can take, or the yearly limit. Optional for the same deploy order.
20090
+ pause: external_exports.object({
20091
+ state: external_exports.enum(["scheduled", "paused"]),
20092
+ starts_at: external_exports.string(),
20093
+ resume_at: nullableStringSchema,
20094
+ reason: external_exports.enum(["taking_a_break", "too_expensive", "not_using", "not_working", "other"]).nullable()
20095
+ }).nullable().optional(),
20096
+ pause_options: external_exports.object({
20097
+ starts_at: external_exports.string(),
20098
+ lengths: external_exports.array(external_exports.object({ days: external_exports.union([external_exports.literal(7), external_exports.literal(14), external_exports.literal(30), external_exports.literal(60), external_exports.literal(90)]), resume_at: external_exports.string() })),
20099
+ reason_enabled: external_exports.boolean(),
20100
+ pauses_left_after: external_exports.number()
20101
+ }).nullable().optional(),
20102
+ pause_limit: external_exports.object({ pauses_per_year: external_exports.number(), available_again_at: external_exports.string() }).nullable().optional(),
20103
+ // The Discord roles a pause takes ([] none); null when not known. Optional for deploy order.
20104
+ pause_access_roles: external_exports.array(external_exports.string()).nullable().optional()
20073
20105
  });
20074
20106
  var customerLoyaltySchema = external_exports.object({
20075
20107
  enabled: external_exports.boolean(),
@@ -20986,11 +21018,15 @@ var HeadlessCustomerClient = class {
20986
21018
  schema: customerPortalSubscriptionCancelSchema
20987
21019
  });
20988
21020
  }
20989
- pauseSubscription(subscriptionId) {
21021
+ /** Pauses from `pause_options.starts_at`; a scheduled pause is called off with `resumeSubscription`. */
21022
+ pauseSubscription(subscriptionId, options = {}) {
20990
21023
  return this.request(`/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
20991
21024
  method: "POST",
20992
21025
  authenticated: true,
20993
- body: {},
21026
+ body: {
21027
+ ...options.lengthDays === void 0 ? {} : { length_days: options.lengthDays },
21028
+ ...options.reason === void 0 ? {} : { reason: options.reason }
21029
+ },
20994
21030
  schema: customerPortalSubscriptionStatusSchema
20995
21031
  });
20996
21032
  }