@lunora/react 1.0.0-alpha.73 → 1.0.0-alpha.75
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/payment.d.mts +13 -4
- package/dist/payment.d.ts +13 -4
- package/package.json +4 -4
package/dist/payment.d.mts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Stable provider identifier. Mirror of `@lunora/payment`'s `ProviderId` — the
|
|
4
|
+
* value is persisted verbatim, so an app branching on it must see every provider
|
|
5
|
+
* that has an adapter, not just the two that shipped first.
|
|
6
|
+
*/
|
|
7
|
+
type ProviderId = "autumn" | "creem" | "dodopayments" | "polar" | "stripe";
|
|
2
8
|
/**
|
|
3
9
|
* Client-safe mirror of `@lunora/payment`'s `Subscription`. Re-declared here
|
|
4
10
|
* (rather than imported) so this React entry never pulls in the server-only
|
|
5
|
-
* `@lunora/payment` module graph — the kit stays React + DOM only.
|
|
6
|
-
*
|
|
11
|
+
* `@lunora/payment` module graph — the kit stays React + DOM only.
|
|
12
|
+
* `__tests__/payment-mirror.test.ts` fails when this drifts from
|
|
13
|
+
* `packages/payment/src/types.ts`.
|
|
7
14
|
*/
|
|
8
15
|
interface Subscription {
|
|
9
16
|
readonly cancelAtPeriodEnd: boolean;
|
|
10
17
|
readonly createdAt: number;
|
|
11
18
|
readonly currentPeriodEnd?: number;
|
|
19
|
+
/** Start of the current billing period — the window metered usage is summed over. */
|
|
20
|
+
readonly currentPeriodStart?: number;
|
|
12
21
|
readonly id: string;
|
|
13
22
|
readonly priceId: string;
|
|
14
|
-
readonly provider:
|
|
23
|
+
readonly provider: ProviderId;
|
|
15
24
|
readonly quantity: number;
|
|
16
25
|
readonly referenceId: string;
|
|
17
26
|
readonly state: "active" | "canceled" | "past_due" | "paused" | "trialing";
|
|
@@ -81,4 +90,4 @@ declare const CheckoutButton: ({ onCheckout, ...rest }: CheckoutButtonProps) =>
|
|
|
81
90
|
* returned URL, disabling itself while the request is in flight.
|
|
82
91
|
*/
|
|
83
92
|
declare const CustomerPortalButton: ({ onPortal, ...rest }: CustomerPortalButtonProps) => ReactNode;
|
|
84
|
-
export { CheckoutButton, type CheckoutButtonProps, CustomerPortalButton, type CustomerPortalButtonProps, type RedirectTarget, type RedirectTrigger, type Subscription, type UseCheckoutResult, useCheckout };
|
|
93
|
+
export { CheckoutButton, type CheckoutButtonProps, CustomerPortalButton, type CustomerPortalButtonProps, type ProviderId, type RedirectTarget, type RedirectTrigger, type Subscription, type UseCheckoutResult, useCheckout };
|
package/dist/payment.d.ts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Stable provider identifier. Mirror of `@lunora/payment`'s `ProviderId` — the
|
|
4
|
+
* value is persisted verbatim, so an app branching on it must see every provider
|
|
5
|
+
* that has an adapter, not just the two that shipped first.
|
|
6
|
+
*/
|
|
7
|
+
type ProviderId = "autumn" | "creem" | "dodopayments" | "polar" | "stripe";
|
|
2
8
|
/**
|
|
3
9
|
* Client-safe mirror of `@lunora/payment`'s `Subscription`. Re-declared here
|
|
4
10
|
* (rather than imported) so this React entry never pulls in the server-only
|
|
5
|
-
* `@lunora/payment` module graph — the kit stays React + DOM only.
|
|
6
|
-
*
|
|
11
|
+
* `@lunora/payment` module graph — the kit stays React + DOM only.
|
|
12
|
+
* `__tests__/payment-mirror.test.ts` fails when this drifts from
|
|
13
|
+
* `packages/payment/src/types.ts`.
|
|
7
14
|
*/
|
|
8
15
|
interface Subscription {
|
|
9
16
|
readonly cancelAtPeriodEnd: boolean;
|
|
10
17
|
readonly createdAt: number;
|
|
11
18
|
readonly currentPeriodEnd?: number;
|
|
19
|
+
/** Start of the current billing period — the window metered usage is summed over. */
|
|
20
|
+
readonly currentPeriodStart?: number;
|
|
12
21
|
readonly id: string;
|
|
13
22
|
readonly priceId: string;
|
|
14
|
-
readonly provider:
|
|
23
|
+
readonly provider: ProviderId;
|
|
15
24
|
readonly quantity: number;
|
|
16
25
|
readonly referenceId: string;
|
|
17
26
|
readonly state: "active" | "canceled" | "past_due" | "paused" | "trialing";
|
|
@@ -81,4 +90,4 @@ declare const CheckoutButton: ({ onCheckout, ...rest }: CheckoutButtonProps) =>
|
|
|
81
90
|
* returned URL, disabling itself while the request is in flight.
|
|
82
91
|
*/
|
|
83
92
|
declare const CustomerPortalButton: ({ onPortal, ...rest }: CustomerPortalButtonProps) => ReactNode;
|
|
84
|
-
export { CheckoutButton, type CheckoutButtonProps, CustomerPortalButton, type CustomerPortalButtonProps, type RedirectTarget, type RedirectTrigger, type Subscription, type UseCheckoutResult, useCheckout };
|
|
93
|
+
export { CheckoutButton, type CheckoutButtonProps, CustomerPortalButton, type CustomerPortalButtonProps, type ProviderId, type RedirectTarget, type RedirectTrigger, type Subscription, type UseCheckoutResult, useCheckout };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/react",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.75",
|
|
4
4
|
"description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@lunora/client": "1.0.0-alpha.
|
|
61
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
62
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
60
|
+
"@lunora/client": "1.0.0-alpha.70",
|
|
61
|
+
"@lunora/errors": "1.0.0-alpha.28",
|
|
62
|
+
"@lunora/ratelimit": "1.0.0-alpha.34",
|
|
63
63
|
"@visulima/storage-client": "1.0.2"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|