@inflector/aura 0.6.0 → 0.6.1

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.
@@ -1,5 +1,5 @@
1
1
  export declare const AuraPayments: (url: string, workspace: string) => {
2
- OpenPortal: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
2
+ readonly OpenPortal: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
3
3
  redirect?: boolean | undefined;
4
4
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
5
5
  query?: Record<string, any> | undefined;
@@ -11,14 +11,35 @@ export declare const AuraPayments: (url: string, workspace: string) => {
11
11
  code?: string | undefined;
12
12
  message?: string | undefined;
13
13
  }, FetchOptions["throw"] extends true ? true : false>>;
14
- GetSate: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
14
+ readonly GetState: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
15
15
  query?: Record<string, any> | undefined;
16
16
  fetchOptions?: FetchOptions | undefined;
17
17
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("@polar-sh/sdk/models/components/customerstate.js").CustomerState, {
18
18
  code?: string | undefined;
19
19
  message?: string | undefined;
20
20
  }, FetchOptions["throw"] extends true ? true : false>>;
21
- GetSubs: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
21
+ readonly GetOrders: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
22
+ page?: number | undefined;
23
+ limit?: number | undefined;
24
+ productBillingType?: "recurring" | "one_time" | undefined;
25
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
26
+ query?: {
27
+ page?: number | undefined;
28
+ limit?: number | undefined;
29
+ productBillingType?: "recurring" | "one_time" | undefined;
30
+ } | undefined;
31
+ fetchOptions?: FetchOptions | undefined;
32
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<import("@polar-sh/sdk/models/operations/customerportalorderslist.js").CustomerPortalOrdersListResponse & {
33
+ next: import("@polar-sh/sdk/types/operations.js").Paginator<import("@polar-sh/sdk/models/operations/customerportalorderslist.js").CustomerPortalOrdersListResponse>;
34
+ "~next"?: {
35
+ page: number;
36
+ } | undefined;
37
+ [Symbol.asyncIterator]: () => AsyncIterableIterator<import("@polar-sh/sdk/models/operations/customerportalorderslist.js").CustomerPortalOrdersListResponse>;
38
+ }>, {
39
+ code?: string | undefined;
40
+ message?: string | undefined;
41
+ }, FetchOptions["throw"] extends true ? true : false>>;
42
+ readonly GetSubs: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
22
43
  referenceId?: string | undefined;
23
44
  page?: number | undefined;
24
45
  limit?: number | undefined;
@@ -39,7 +60,7 @@ export declare const AuraPayments: (url: string, workspace: string) => {
39
60
  code?: string | undefined;
40
61
  message?: string | undefined;
41
62
  }, FetchOptions["throw"] extends true ? true : false>>;
42
- Checkout: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
63
+ readonly Checkout: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
43
64
  returnUrl?: string | undefined;
44
65
  products?: string | string[] | undefined;
45
66
  slug?: string | undefined;
@@ -78,6 +99,6 @@ export declare const AuraPayments: (url: string, workspace: string) => {
78
99
  code?: string | undefined;
79
100
  message?: string | undefined;
80
101
  }, FetchOptions["throw"] extends true ? true : false>>;
81
- CheckoutEmbeded: (data: Omit<import("@polar-sh/better-auth").CheckoutParams, "redirect" | "embedOrigin">, fetchOptions?: import("@better-fetch/fetch").BetterFetchOption) => Promise<import("@polar-sh/checkout/embed").PolarEmbedCheckout>;
102
+ readonly CheckoutEmbedded: (data: Omit<import("@polar-sh/better-auth").CheckoutParams, "redirect" | "embedOrigin">, fetchOptions?: import("@better-fetch/fetch").BetterFetchOption) => Promise<import("@polar-sh/checkout/embed").PolarEmbedCheckout>;
82
103
  };
83
104
  //# sourceMappingURL=payments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../src/payments.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB1D,CAAA"}
1
+ {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../src/payments.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkB1D,CAAA"}
package/dist/payments.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { createAuthClient } from "better-auth/client";
2
2
  import { polarClient } from "@polar-sh/better-auth/client";
3
- // export const AuraAuth = (workspace: string) => {
4
3
  export const AuraPayments = (url, workspace) => {
5
4
  const authClient = createAuthClient({
6
5
  // baseURL: `${window.location.origin}/api/auth/${workspace}`,
@@ -11,10 +10,11 @@ export const AuraPayments = (url, workspace) => {
11
10
  },
12
11
  });
13
12
  return {
14
- OpenPortal: authClient.customer.portal,
15
- GetSate: authClient.customer.state,
16
- GetSubs: authClient.customer.subscriptions.list,
17
- Checkout: authClient.checkout,
18
- CheckoutEmbeded: authClient.checkoutEmbed
13
+ OpenPortal: authClient.customer.portal.bind(authClient.customer),
14
+ GetState: authClient.customer.state.bind(authClient.customer),
15
+ GetOrders: authClient.customer.orders.list.bind(authClient.customer.orders),
16
+ GetSubs: authClient.customer.subscriptions.list.bind(authClient.customer.subscriptions),
17
+ Checkout: authClient.checkout.bind(authClient),
18
+ CheckoutEmbedded: authClient.checkoutEmbed.bind(authClient),
19
19
  };
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflector/aura",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",