@shoppexio/storefront 1.0.106 → 1.0.108

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
@@ -19821,6 +19821,23 @@ var customerPortalInvoiceDetailSchema = external_exports.object({
19821
19821
  currency: external_exports.string()
19822
19822
  }),
19823
19823
  currentPaymentAttemptId: nullableStringSchema,
19824
+ /**
19825
+ * The goods went to a gift recipient or wait for a reveal, so a delivered
19826
+ * line without `deliverySummary` was withheld, not empty. Optional so
19827
+ * payloads from before the field parse; absent states nothing.
19828
+ */
19829
+ deliveryWithheld: external_exports.boolean().optional(),
19830
+ /**
19831
+ * What became of money an expired order took: NONE when no payment is
19832
+ * recorded; null unless EXPIRED. Optional so payloads from before the field parse.
19833
+ */
19834
+ expiredPayment: external_exports.enum(["NONE", "IN_REVIEW", "HELD", "SETTLED", "REFUNDED"]).nullable().optional(),
19835
+ /**
19836
+ * When the paying attempt completed; null until one has. Kept on a disputed
19837
+ * or refunded order, so the status decides whether it reads as paid.
19838
+ * Optional so payloads from before the field parse.
19839
+ */
19840
+ paidAt: nullableStringSchema.optional(),
19824
19841
  lineItems: external_exports.array(external_exports.object({
19825
19842
  id: external_exports.string(),
19826
19843
  productTitle: external_exports.string(),
@@ -20081,7 +20098,42 @@ var customerPortalSubscriptionSummarySchema = external_exports.object({
20081
20098
  amount: external_exports.string(),
20082
20099
  currency: external_exports.string(),
20083
20100
  pay_by: external_exports.string(),
20084
- pay_url: external_exports.string()
20101
+ pay_url: external_exports.string(),
20102
+ interval: external_exports.string(),
20103
+ interval_count: external_exports.number()
20104
+ }).nullable().optional(),
20105
+ // The pause policy (me.routes.ts, buyerPauseView): the open pause, the lengths a new pause
20106
+ // can take, or the yearly limit. Optional for the same deploy order.
20107
+ pause: external_exports.object({
20108
+ state: external_exports.enum(["scheduled", "paused"]),
20109
+ starts_at: external_exports.string(),
20110
+ resume_at: nullableStringSchema,
20111
+ reason: external_exports.enum(["taking_a_break", "too_expensive", "not_using", "not_working", "other"]).nullable()
20112
+ }).nullable().optional(),
20113
+ pause_options: external_exports.object({
20114
+ starts_at: external_exports.string(),
20115
+ 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() })),
20116
+ reason_enabled: external_exports.boolean(),
20117
+ pauses_left_after: external_exports.number()
20118
+ }).nullable().optional(),
20119
+ pause_limit: external_exports.object({ pauses_per_year: external_exports.number(), available_again_at: external_exports.string() }).nullable().optional(),
20120
+ // The Discord roles a pause takes ([] none); null when not known. Optional for deploy order.
20121
+ pause_access_roles: external_exports.array(external_exports.string()).nullable().optional(),
20122
+ // The running coupon term (`SubscriptionCouponTermView`, loadSubscriptionCouponTermView); null
20123
+ // without one. Amounts are the renewal-pricing function's, in `currency`. Same deploy order.
20124
+ discount: external_exports.object({
20125
+ code: external_exports.string(),
20126
+ discount_type: external_exports.enum(["PERCENTAGE", "FIXED"]),
20127
+ discount_value: external_exports.string(),
20128
+ max_discount: nullableStringSchema,
20129
+ currency: external_exports.string(),
20130
+ duration: external_exports.enum(["ONCE", "REPEATING", "FOREVER"]),
20131
+ payments_total: external_exports.number().nullable(),
20132
+ payments_used: external_exports.number(),
20133
+ discounted_amount: external_exports.string(),
20134
+ full_amount: external_exports.string(),
20135
+ discount_amount: external_exports.string(),
20136
+ next_amount: external_exports.string()
20085
20137
  }).nullable().optional()
20086
20138
  });
20087
20139
  var customerLoyaltySchema = external_exports.object({
@@ -20367,7 +20419,17 @@ var customerPortalSubscriptionBillingHistorySchema = external_exports.object({
20367
20419
  status: external_exports.string(),
20368
20420
  gateway: external_exports.string(),
20369
20421
  created_at: external_exports.string(),
20370
- completed_at: external_exports.string()
20422
+ completed_at: external_exports.string(),
20423
+ // What the invoice billed, and the plan change it paid for
20424
+ // (SubscriptionService.getBillingHistory, BillingHistoryPlanChangeSchema).
20425
+ kind: external_exports.enum(["first_order", "renewal", "plan_change"]),
20426
+ plan_change: external_exports.object({
20427
+ from_plan_name: external_exports.string(),
20428
+ to_plan_name: external_exports.string(),
20429
+ source: external_exports.enum(["buyer", "merchant"]),
20430
+ days_left: external_exports.number().nullable(),
20431
+ days_total: external_exports.number().nullable()
20432
+ }).nullable()
20371
20433
  }))
20372
20434
  });
20373
20435
  var customerPortalSubscriptionCancelSchema = external_exports.object({
@@ -20999,11 +21061,15 @@ var HeadlessCustomerClient = class {
20999
21061
  schema: customerPortalSubscriptionCancelSchema
21000
21062
  });
21001
21063
  }
21002
- pauseSubscription(subscriptionId) {
21064
+ /** Pauses from `pause_options.starts_at`; a scheduled pause is called off with `resumeSubscription`. */
21065
+ pauseSubscription(subscriptionId, options = {}) {
21003
21066
  return this.request(`/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
21004
21067
  method: "POST",
21005
21068
  authenticated: true,
21006
- body: {},
21069
+ body: {
21070
+ ...options.lengthDays === void 0 ? {} : { length_days: options.lengthDays },
21071
+ ...options.reason === void 0 ? {} : { reason: options.reason }
21072
+ },
21007
21073
  schema: customerPortalSubscriptionStatusSchema
21008
21074
  });
21009
21075
  }