@usethrottle/auth 0.6.1 → 0.8.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.
@@ -99,7 +99,10 @@ interface Order {
99
99
  billingAddress: unknown | null;
100
100
  shippingAddress: unknown | null;
101
101
  discountCode: string | null;
102
+ /** Set only when the order is linked to exactly one subscription. Read `subscriptionIds`. */
102
103
  subscriptionId: string | null;
104
+ /** Every subscription this order created, in line order. One cart can hold several. */
105
+ subscriptionIds: string[];
103
106
  /**
104
107
  * The invoice raised for this order, when one exists. Resolved on the
105
108
  * detail read only — the list would need a lookup per row.
@@ -123,6 +126,8 @@ interface OrderLineItem {
123
126
  discountAmount: number;
124
127
  total: number;
125
128
  imageUrl: string | null;
129
+ /** The subscription this line created, or null for a one-time line. */
130
+ subscriptionId: string | null;
126
131
  }
127
132
  /**
128
133
  * What `getOrder` returns. Deliberately NOT folded into `Order`: the list route
@@ -178,6 +183,21 @@ interface Subscription {
178
183
  totalPayments: number | null;
179
184
  paymentsMade: number;
180
185
  completedAt: string | null;
186
+ /** Installment plans only: every payment in order; dueAt is an estimate. */
187
+ paymentSchedule?: Array<{
188
+ index: number;
189
+ amount: number;
190
+ discount: number;
191
+ net: number;
192
+ intervalUnit: string | null;
193
+ intervalCount: number | null;
194
+ status: 'paid' | 'due' | 'upcoming';
195
+ dueAt: string | null;
196
+ }> | null;
197
+ /** Installment plans only: the sum of every payment's net amount. */
198
+ scheduleTotal?: number | null;
199
+ /** Installment plans only: what the next payment will charge; null once complete. */
200
+ nextPaymentAmount?: number | null;
181
201
  amount: number;
182
202
  quantity: number;
183
203
  currency: string;
@@ -99,7 +99,10 @@ interface Order {
99
99
  billingAddress: unknown | null;
100
100
  shippingAddress: unknown | null;
101
101
  discountCode: string | null;
102
+ /** Set only when the order is linked to exactly one subscription. Read `subscriptionIds`. */
102
103
  subscriptionId: string | null;
104
+ /** Every subscription this order created, in line order. One cart can hold several. */
105
+ subscriptionIds: string[];
103
106
  /**
104
107
  * The invoice raised for this order, when one exists. Resolved on the
105
108
  * detail read only — the list would need a lookup per row.
@@ -123,6 +126,8 @@ interface OrderLineItem {
123
126
  discountAmount: number;
124
127
  total: number;
125
128
  imageUrl: string | null;
129
+ /** The subscription this line created, or null for a one-time line. */
130
+ subscriptionId: string | null;
126
131
  }
127
132
  /**
128
133
  * What `getOrder` returns. Deliberately NOT folded into `Order`: the list route
@@ -178,6 +183,21 @@ interface Subscription {
178
183
  totalPayments: number | null;
179
184
  paymentsMade: number;
180
185
  completedAt: string | null;
186
+ /** Installment plans only: every payment in order; dueAt is an estimate. */
187
+ paymentSchedule?: Array<{
188
+ index: number;
189
+ amount: number;
190
+ discount: number;
191
+ net: number;
192
+ intervalUnit: string | null;
193
+ intervalCount: number | null;
194
+ status: 'paid' | 'due' | 'upcoming';
195
+ dueAt: string | null;
196
+ }> | null;
197
+ /** Installment plans only: the sum of every payment's net amount. */
198
+ scheduleTotal?: number | null;
199
+ /** Installment plans only: what the next payment will charge; null once complete. */
200
+ nextPaymentAmount?: number | null;
181
201
  amount: number;
182
202
  quantity: number;
183
203
  currency: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/auth",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "Buyer authentication for Throttle storefronts — headless core, React hooks, and drop-in forms.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",