@usethrottle/subscriptions 1.2.0 → 1.3.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.
@@ -24,9 +24,25 @@ interface Subscription {
24
24
  pausedAt?: string | null;
25
25
  cancelledAt?: string | null;
26
26
  metadata: Record<string, unknown>;
27
+ /**
28
+ * Address renewals are quoted against, frozen at signup. A renewal has no
29
+ * cart and no shipping address, so without this snapshot there is nothing for
30
+ * a tax provider to quote and the renewal bills untaxed.
31
+ */
32
+ taxAddressSnapshot?: SubscriptionTaxAddress | null;
33
+ /** `checkout` when captured at signup, `manual` once a merchant edited it. */
34
+ taxAddressSource?: 'checkout' | 'manual' | null;
27
35
  createdAt?: string;
28
36
  updatedAt?: string;
29
37
  }
38
+ interface SubscriptionTaxAddress {
39
+ addressLine1?: string | null;
40
+ addressLine2?: string | null;
41
+ city?: string | null;
42
+ stateProvince?: string | null;
43
+ postalCode?: string | null;
44
+ countryCode?: string | null;
45
+ }
30
46
  interface Customer {
31
47
  id: string;
32
48
  externalId?: string | null;
@@ -285,4 +301,4 @@ declare class ThrottleSubscriptionsError extends ThrottleError {
285
301
  });
286
302
  }
287
303
 
288
- export { type CancelSubscriptionInput as C, type DunningBannerProps as D, type ListSubscriptionsParams as L, type MutationState as M, type PaginatedSubscriptions as P, type QueryOptions as Q, type RecurringIntent as R, type SubscriptionProviderProps as S, type TrialEligibilityResult as T, type UpdateSubscriptionInput as U, type SubscriptionsClientContract as a, type SubscriptionFetcher as b, type Subscription as c, type ChangePlanInput as d, type CheckoutSession as e, type CreateCheckoutSessionInput as f, type CreateSubscriptionInput as g, type Customer as h, type QueryState as i, type CustomerPaymentMethod as j, type TrialEligibilityInput as k, type SubscriptionStatusBadgeProps as l, type TrialCountdownProps as m, type SubscriptionStatus as n, type CheckoutCollectInput as o, type CheckoutCustomerInput as p, type Pagination as q, type SubscriptionInterval as r, type SubscriptionSort as s, SubscriptionsClient as t, type SubscriptionsClientOptions as u, type ThrottleEnvelope as v, ThrottleSubscriptionsError as w, type TrialEligibilityReason as x, createSubscriptionsClient as y };
304
+ export { type CancelSubscriptionInput as C, type DunningBannerProps as D, type ListSubscriptionsParams as L, type MutationState as M, type PaginatedSubscriptions as P, type QueryOptions as Q, type RecurringIntent as R, type Subscription as S, type ThrottleEnvelope as T, type UpdateSubscriptionInput as U, type ChangePlanInput as a, type CheckoutCollectInput as b, type CheckoutCustomerInput as c, type CheckoutSession as d, type CreateCheckoutSessionInput as e, type CreateSubscriptionInput as f, type Customer as g, type CustomerPaymentMethod as h, type Pagination as i, type QueryState as j, type SubscriptionFetcher as k, type SubscriptionInterval as l, type SubscriptionProviderProps as m, type SubscriptionSort as n, type SubscriptionStatus as o, type SubscriptionStatusBadgeProps as p, type SubscriptionTaxAddress as q, SubscriptionsClient as r, type SubscriptionsClientContract as s, type SubscriptionsClientOptions as t, ThrottleSubscriptionsError as u, type TrialCountdownProps as v, type TrialEligibilityInput as w, type TrialEligibilityReason as x, type TrialEligibilityResult as y, createSubscriptionsClient as z };
@@ -24,9 +24,25 @@ interface Subscription {
24
24
  pausedAt?: string | null;
25
25
  cancelledAt?: string | null;
26
26
  metadata: Record<string, unknown>;
27
+ /**
28
+ * Address renewals are quoted against, frozen at signup. A renewal has no
29
+ * cart and no shipping address, so without this snapshot there is nothing for
30
+ * a tax provider to quote and the renewal bills untaxed.
31
+ */
32
+ taxAddressSnapshot?: SubscriptionTaxAddress | null;
33
+ /** `checkout` when captured at signup, `manual` once a merchant edited it. */
34
+ taxAddressSource?: 'checkout' | 'manual' | null;
27
35
  createdAt?: string;
28
36
  updatedAt?: string;
29
37
  }
38
+ interface SubscriptionTaxAddress {
39
+ addressLine1?: string | null;
40
+ addressLine2?: string | null;
41
+ city?: string | null;
42
+ stateProvince?: string | null;
43
+ postalCode?: string | null;
44
+ countryCode?: string | null;
45
+ }
30
46
  interface Customer {
31
47
  id: string;
32
48
  externalId?: string | null;
@@ -285,4 +301,4 @@ declare class ThrottleSubscriptionsError extends ThrottleError {
285
301
  });
286
302
  }
287
303
 
288
- export { type CancelSubscriptionInput as C, type DunningBannerProps as D, type ListSubscriptionsParams as L, type MutationState as M, type PaginatedSubscriptions as P, type QueryOptions as Q, type RecurringIntent as R, type SubscriptionProviderProps as S, type TrialEligibilityResult as T, type UpdateSubscriptionInput as U, type SubscriptionsClientContract as a, type SubscriptionFetcher as b, type Subscription as c, type ChangePlanInput as d, type CheckoutSession as e, type CreateCheckoutSessionInput as f, type CreateSubscriptionInput as g, type Customer as h, type QueryState as i, type CustomerPaymentMethod as j, type TrialEligibilityInput as k, type SubscriptionStatusBadgeProps as l, type TrialCountdownProps as m, type SubscriptionStatus as n, type CheckoutCollectInput as o, type CheckoutCustomerInput as p, type Pagination as q, type SubscriptionInterval as r, type SubscriptionSort as s, SubscriptionsClient as t, type SubscriptionsClientOptions as u, type ThrottleEnvelope as v, ThrottleSubscriptionsError as w, type TrialEligibilityReason as x, createSubscriptionsClient as y };
304
+ export { type CancelSubscriptionInput as C, type DunningBannerProps as D, type ListSubscriptionsParams as L, type MutationState as M, type PaginatedSubscriptions as P, type QueryOptions as Q, type RecurringIntent as R, type Subscription as S, type ThrottleEnvelope as T, type UpdateSubscriptionInput as U, type ChangePlanInput as a, type CheckoutCollectInput as b, type CheckoutCustomerInput as c, type CheckoutSession as d, type CreateCheckoutSessionInput as e, type CreateSubscriptionInput as f, type Customer as g, type CustomerPaymentMethod as h, type Pagination as i, type QueryState as j, type SubscriptionFetcher as k, type SubscriptionInterval as l, type SubscriptionProviderProps as m, type SubscriptionSort as n, type SubscriptionStatus as o, type SubscriptionStatusBadgeProps as p, type SubscriptionTaxAddress as q, SubscriptionsClient as r, type SubscriptionsClientContract as s, type SubscriptionsClientOptions as t, ThrottleSubscriptionsError as u, type TrialCountdownProps as v, type TrialEligibilityInput as w, type TrialEligibilityReason as x, type TrialEligibilityResult as y, createSubscriptionsClient as z };
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SubscriptionProviderProps, a as SubscriptionsClientContract, b as SubscriptionFetcher, M as MutationState, c as Subscription, C as CancelSubscriptionInput, d as ChangePlanInput, e as CheckoutSession, f as CreateCheckoutSessionInput, g as CreateSubscriptionInput, Q as QueryOptions, h as Customer, i as QueryState, j as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, T as TrialEligibilityResult, k as TrialEligibilityInput, U as UpdateSubscriptionInput, D as DunningBannerProps, l as SubscriptionStatusBadgeProps, m as TrialCountdownProps, n as SubscriptionStatus } from './errors-BR8lr8_6.cjs';
2
- export { o as CheckoutCollectInput, p as CheckoutCustomerInput, q as Pagination, R as RecurringIntent, r as SubscriptionInterval, s as SubscriptionSort, t as SubscriptionsClient, u as SubscriptionsClientOptions, v as ThrottleEnvelope, w as ThrottleSubscriptionsError, x as TrialEligibilityReason, y as createSubscriptionsClient } from './errors-BR8lr8_6.cjs';
1
+ import { m as SubscriptionProviderProps, s as SubscriptionsClientContract, k as SubscriptionFetcher, M as MutationState, S as Subscription, C as CancelSubscriptionInput, a as ChangePlanInput, d as CheckoutSession, e as CreateCheckoutSessionInput, f as CreateSubscriptionInput, Q as QueryOptions, g as Customer, j as QueryState, h as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, y as TrialEligibilityResult, w as TrialEligibilityInput, U as UpdateSubscriptionInput, D as DunningBannerProps, p as SubscriptionStatusBadgeProps, v as TrialCountdownProps, o as SubscriptionStatus } from './errors-B9wUUp4m.cjs';
2
+ export { b as CheckoutCollectInput, c as CheckoutCustomerInput, i as Pagination, R as RecurringIntent, l as SubscriptionInterval, n as SubscriptionSort, q as SubscriptionTaxAddress, r as SubscriptionsClient, t as SubscriptionsClientOptions, T as ThrottleEnvelope, u as ThrottleSubscriptionsError, x as TrialEligibilityReason, z as createSubscriptionsClient } from './errors-B9wUUp4m.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode } from 'react';
5
5
  export { ThrottleError, isThrottleError } from '@usethrottle/errors';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SubscriptionProviderProps, a as SubscriptionsClientContract, b as SubscriptionFetcher, M as MutationState, c as Subscription, C as CancelSubscriptionInput, d as ChangePlanInput, e as CheckoutSession, f as CreateCheckoutSessionInput, g as CreateSubscriptionInput, Q as QueryOptions, h as Customer, i as QueryState, j as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, T as TrialEligibilityResult, k as TrialEligibilityInput, U as UpdateSubscriptionInput, D as DunningBannerProps, l as SubscriptionStatusBadgeProps, m as TrialCountdownProps, n as SubscriptionStatus } from './errors-BR8lr8_6.js';
2
- export { o as CheckoutCollectInput, p as CheckoutCustomerInput, q as Pagination, R as RecurringIntent, r as SubscriptionInterval, s as SubscriptionSort, t as SubscriptionsClient, u as SubscriptionsClientOptions, v as ThrottleEnvelope, w as ThrottleSubscriptionsError, x as TrialEligibilityReason, y as createSubscriptionsClient } from './errors-BR8lr8_6.js';
1
+ import { m as SubscriptionProviderProps, s as SubscriptionsClientContract, k as SubscriptionFetcher, M as MutationState, S as Subscription, C as CancelSubscriptionInput, a as ChangePlanInput, d as CheckoutSession, e as CreateCheckoutSessionInput, f as CreateSubscriptionInput, Q as QueryOptions, g as Customer, j as QueryState, h as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, y as TrialEligibilityResult, w as TrialEligibilityInput, U as UpdateSubscriptionInput, D as DunningBannerProps, p as SubscriptionStatusBadgeProps, v as TrialCountdownProps, o as SubscriptionStatus } from './errors-B9wUUp4m.js';
2
+ export { b as CheckoutCollectInput, c as CheckoutCustomerInput, i as Pagination, R as RecurringIntent, l as SubscriptionInterval, n as SubscriptionSort, q as SubscriptionTaxAddress, r as SubscriptionsClient, t as SubscriptionsClientOptions, T as ThrottleEnvelope, u as ThrottleSubscriptionsError, x as TrialEligibilityReason, z as createSubscriptionsClient } from './errors-B9wUUp4m.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode } from 'react';
5
5
  export { ThrottleError, isThrottleError } from '@usethrottle/errors';
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as Subscription } from './errors-BR8lr8_6.cjs';
2
- export { e as CheckoutSession, f as CreateCheckoutSessionInput, h as Customer, j as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, t as SubscriptionsClient, a as SubscriptionsClientContract, u as SubscriptionsClientOptions, w as ThrottleSubscriptionsError, k as TrialEligibilityInput, T as TrialEligibilityResult, y as createSubscriptionsClient } from './errors-BR8lr8_6.cjs';
1
+ import { S as Subscription } from './errors-B9wUUp4m.cjs';
2
+ export { d as CheckoutSession, e as CreateCheckoutSessionInput, g as Customer, h as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, r as SubscriptionsClient, s as SubscriptionsClientContract, t as SubscriptionsClientOptions, u as ThrottleSubscriptionsError, w as TrialEligibilityInput, y as TrialEligibilityResult, z as createSubscriptionsClient } from './errors-B9wUUp4m.cjs';
3
3
  import 'react';
4
4
  import '@usethrottle/errors';
5
5
 
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as Subscription } from './errors-BR8lr8_6.js';
2
- export { e as CheckoutSession, f as CreateCheckoutSessionInput, h as Customer, j as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, t as SubscriptionsClient, a as SubscriptionsClientContract, u as SubscriptionsClientOptions, w as ThrottleSubscriptionsError, k as TrialEligibilityInput, T as TrialEligibilityResult, y as createSubscriptionsClient } from './errors-BR8lr8_6.js';
1
+ import { S as Subscription } from './errors-B9wUUp4m.js';
2
+ export { d as CheckoutSession, e as CreateCheckoutSessionInput, g as Customer, h as CustomerPaymentMethod, L as ListSubscriptionsParams, P as PaginatedSubscriptions, r as SubscriptionsClient, s as SubscriptionsClientContract, t as SubscriptionsClientOptions, u as ThrottleSubscriptionsError, w as TrialEligibilityInput, y as TrialEligibilityResult, z as createSubscriptionsClient } from './errors-B9wUUp4m.js';
3
3
  import 'react';
4
4
  import '@usethrottle/errors';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/subscriptions",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "React hooks, server proxy helpers, and primitive components for Throttle subscriptions.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",