@openrails/billing-ui 0.233.2 → 0.235.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 +51 -0
- package/README.md +18 -14
- package/dist/account/account-billing.d.ts +6 -3
- package/dist/account/change-card-dialog.d.ts +5 -2
- package/dist/account/payment-methods-panel.d.ts +6 -3
- package/dist/client/client.d.ts +33 -17
- package/dist/client/errors.d.ts +1 -4
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +150 -147
- package/dist/client/generated/wire.d.ts +204 -49
- package/dist/client/index.d.ts +2 -2
- package/dist/client/types.d.ts +131 -42
- package/dist/{client-DXUPzA8C.js → client-BpzCZes3.js} +93 -51
- package/dist/client-BpzCZes3.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/{config-BQELtBh4.js → config-qLcHvK0Q.js} +13 -13
- package/dist/config-qLcHvK0Q.js.map +1 -0
- package/dist/i18n/context.d.ts +1 -1
- package/dist/i18n/messages.d.ts +1 -1
- package/dist/index.js +184 -177
- package/dist/index.js.map +1 -1
- package/dist/locales/de.js +5 -4
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +5 -4
- package/dist/locales/en.js +5 -4
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +5 -4
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +5 -4
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +5 -4
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +5 -4
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/context.d.ts +6 -5
- package/dist/react/hooks.d.ts +10 -10
- package/dist/react.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/dist/client-DXUPzA8C.js.map +0 -1
- package/dist/config-BQELtBh4.js.map +0 -1
package/dist/react/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SendSolanaTransaction } from '../client/client';
|
|
1
|
+
import { SendSolanaTransaction, SubscriptionChangeInput } from '../client/client';
|
|
2
2
|
import { BillingError } from '../client/errors';
|
|
3
|
-
import { NewCard, Payment, PaymentMethod, Product, Subscription,
|
|
3
|
+
import { NewCard, Payment, PaymentMethod, Product, Subscription, SubscriptionChange } from '../client/types';
|
|
4
4
|
export type ActionResult = Promise<BillingError | null>;
|
|
5
5
|
/** `signing` and `confirming` are a wallet step's stages. */
|
|
6
|
-
export type SubscriptionAction = "cancel" | "resume" | "payment_method" | "
|
|
6
|
+
export type SubscriptionAction = "cancel" | "resume" | "payment_method" | "change" | "signing" | "confirming";
|
|
7
7
|
export interface SubscriptionsOptions {
|
|
8
8
|
/** Server filter; default `all`. */
|
|
9
9
|
status?: string;
|
|
@@ -25,16 +25,16 @@ export interface SubscriptionsState {
|
|
|
25
25
|
*/
|
|
26
26
|
cancel: (subscriptionId: string, reason: string, sendTransaction?: SendSolanaTransaction) => ActionResult;
|
|
27
27
|
resume: (subscriptionId: string) => ActionResult;
|
|
28
|
-
|
|
28
|
+
/** `null` makes the subscription follow the default card. */
|
|
29
|
+
setPaymentMethod: (subscriptionId: string, paymentMethodId: string | null) => ActionResult;
|
|
29
30
|
/**
|
|
30
31
|
* Resolves to the change, whose `status` may still be `processing` or
|
|
31
32
|
* `requires_action`, or to the error. A Solana change is signed with
|
|
32
33
|
* `sendTransaction` and resolves once the chain confirms it.
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
|
-
priceId: string;
|
|
35
|
+
changeSubscription: (subscriptionId: string, input: SubscriptionChangeInput & {
|
|
36
36
|
idempotencyKey: string;
|
|
37
|
-
}, sendTransaction?: SendSolanaTransaction) => Promise<
|
|
37
|
+
}, sendTransaction?: SendSolanaTransaction) => Promise<SubscriptionChange | BillingError>;
|
|
38
38
|
}
|
|
39
39
|
export declare function useSubscriptions(options?: SubscriptionsOptions): SubscriptionsState;
|
|
40
40
|
export interface ProductsState {
|
|
@@ -49,7 +49,7 @@ export interface ProductsState {
|
|
|
49
49
|
export declare function useProducts(options?: {
|
|
50
50
|
limit?: number;
|
|
51
51
|
}): ProductsState;
|
|
52
|
-
export type PaymentMethodAction = "remove" | "
|
|
52
|
+
export type PaymentMethodAction = "remove" | "default";
|
|
53
53
|
export interface PaymentMethodsState {
|
|
54
54
|
methods: PaymentMethod[] | null;
|
|
55
55
|
loading: boolean;
|
|
@@ -59,8 +59,8 @@ export interface PaymentMethodsState {
|
|
|
59
59
|
adding: boolean;
|
|
60
60
|
add: (card: NewCard) => ActionResult;
|
|
61
61
|
remove: (paymentMethodId: string) => ActionResult;
|
|
62
|
-
/** Makes the card the
|
|
63
|
-
|
|
62
|
+
/** Makes the card the default for the currency. */
|
|
63
|
+
setDefault: (paymentMethodId: string, currency: string) => ActionResult;
|
|
64
64
|
}
|
|
65
65
|
export declare function usePaymentMethods(): PaymentMethodsState;
|
|
66
66
|
export interface PaymentsOptions {
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "./config-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "./config-qLcHvK0Q.js";
|
|
2
2
|
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
3
3
|
import { jsx as g } from "react/jsx-runtime";
|
|
4
4
|
//#region src/react/provider.tsx
|