@inflector/aura 0.6.0 → 0.6.2

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,45 +1,99 @@
1
1
  export declare const AuraPayments: (url: string, workspace: string) => {
2
- OpenPortal: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
3
- redirect?: boolean | undefined;
4
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
5
- query?: Record<string, any> | undefined;
6
- fetchOptions?: FetchOptions | undefined;
7
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
8
- url: string;
9
- redirect: boolean;
10
- }, {
11
- code?: string | undefined;
12
- message?: string | undefined;
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<{
15
- query?: Record<string, any> | undefined;
16
- fetchOptions?: FetchOptions | undefined;
17
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("@polar-sh/sdk/models/components/customerstate.js").CustomerState, {
18
- code?: string | undefined;
19
- message?: string | undefined;
20
- }, FetchOptions["throw"] extends true ? true : false>>;
21
- GetSubs: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
22
- referenceId?: string | undefined;
2
+ readonly OpenPortal: () => Promise<{
3
+ data: {
4
+ url: string;
5
+ redirect: boolean;
6
+ };
7
+ error: null;
8
+ } | {
9
+ data: null;
10
+ error: {
11
+ code?: string | undefined | undefined;
12
+ message?: string | undefined | undefined;
13
+ status: number;
14
+ statusText: string;
15
+ };
16
+ }>;
17
+ readonly GetState: () => Promise<{
18
+ data: import("@polar-sh/sdk/models/components/customerstate.js").CustomerState;
19
+ error: null;
20
+ } | {
21
+ data: null;
22
+ error: {
23
+ code?: string | undefined | undefined;
24
+ message?: string | undefined | undefined;
25
+ status: number;
26
+ statusText: string;
27
+ };
28
+ }>;
29
+ readonly GetOrders: (args_0?: import("better-auth").Prettify<{
30
+ query?: {
31
+ page?: number | undefined;
32
+ limit?: number | undefined;
33
+ productBillingType?: "recurring" | "one_time" | undefined;
34
+ } | undefined;
35
+ fetchOptions?: import("better-auth").ClientFetchOption<never, Partial<{
36
+ page?: number | undefined;
37
+ limit?: number | undefined;
38
+ productBillingType?: "recurring" | "one_time" | undefined;
39
+ }> & Record<string, any>, Record<string, any> | undefined> | undefined;
40
+ }> | undefined, args_1?: import("better-auth").ClientFetchOption<never, Partial<{
23
41
  page?: number | undefined;
24
42
  limit?: number | undefined;
25
- active?: boolean | undefined;
26
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
43
+ productBillingType?: "recurring" | "one_time" | undefined;
44
+ }> & Record<string, any>, Record<string, any> | undefined> | undefined) => Promise<{
45
+ data: NonNullable<import("@polar-sh/sdk/models/operations/customerportalorderslist.js").CustomerPortalOrdersListResponse & {
46
+ next: import("@polar-sh/sdk/types/operations.js").Paginator<import("@polar-sh/sdk/models/operations/customerportalorderslist.js").CustomerPortalOrdersListResponse>;
47
+ "~next"?: {
48
+ page: number;
49
+ } | undefined;
50
+ [Symbol.asyncIterator]: () => AsyncIterableIterator<import("@polar-sh/sdk/models/operations/customerportalorderslist.js").CustomerPortalOrdersListResponse>;
51
+ }>;
52
+ error: null;
53
+ } | {
54
+ data: null;
55
+ error: {
56
+ code?: string | undefined | undefined;
57
+ message?: string | undefined | undefined;
58
+ status: number;
59
+ statusText: string;
60
+ };
61
+ }>;
62
+ readonly GetSubs: (args_0?: import("better-auth").Prettify<{
27
63
  query?: {
28
64
  referenceId?: string | undefined;
29
65
  page?: number | undefined;
30
66
  limit?: number | undefined;
31
67
  active?: boolean | undefined;
32
68
  } | undefined;
33
- fetchOptions?: FetchOptions | undefined;
34
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<import("@polar-sh/sdk/types/operations.js").PageIterator<import("@polar-sh/sdk/models/operations/subscriptionslist.js").SubscriptionsListResponse, {
35
- page: number;
36
- }> | import("@polar-sh/sdk/types/operations.js").PageIterator<import("@polar-sh/sdk/models/operations/customerportalsubscriptionslist.js").CustomerPortalSubscriptionsListResponse, {
37
- page: number;
38
- }>>, {
39
- code?: string | undefined;
40
- message?: string | undefined;
41
- }, FetchOptions["throw"] extends true ? true : false>>;
42
- Checkout: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
69
+ fetchOptions?: import("better-auth").ClientFetchOption<never, Partial<{
70
+ referenceId?: string | undefined;
71
+ page?: number | undefined;
72
+ limit?: number | undefined;
73
+ active?: boolean | undefined;
74
+ }> & Record<string, any>, Record<string, any> | undefined> | undefined;
75
+ }> | undefined, args_1?: import("better-auth").ClientFetchOption<never, Partial<{
76
+ referenceId?: string | undefined;
77
+ page?: number | undefined;
78
+ limit?: number | undefined;
79
+ active?: boolean | undefined;
80
+ }> & Record<string, any>, Record<string, any> | undefined> | undefined) => Promise<{
81
+ data: NonNullable<import("@polar-sh/sdk/types/operations.js").PageIterator<import("@polar-sh/sdk/models/operations/subscriptionslist.js").SubscriptionsListResponse, {
82
+ page: number;
83
+ }> | import("@polar-sh/sdk/types/operations.js").PageIterator<import("@polar-sh/sdk/models/operations/customerportalsubscriptionslist.js").CustomerPortalSubscriptionsListResponse, {
84
+ page: number;
85
+ }>>;
86
+ error: null;
87
+ } | {
88
+ data: null;
89
+ error: {
90
+ code?: string | undefined | undefined;
91
+ message?: string | undefined | undefined;
92
+ status: number;
93
+ statusText: string;
94
+ };
95
+ }>;
96
+ readonly Checkout: (args_0?: import("better-auth").Prettify<{
43
97
  returnUrl?: string | undefined;
44
98
  products?: string | string[] | undefined;
45
99
  slug?: string | undefined;
@@ -54,7 +108,24 @@ export declare const AuraPayments: (url: string, workspace: string) => {
54
108
  allowTrial?: boolean | undefined;
55
109
  trialInterval?: "day" | "week" | "month" | "year" | undefined;
56
110
  trialIntervalCount?: number | undefined;
57
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
111
+ } & {
112
+ fetchOptions?: import("better-auth").ClientFetchOption<Partial<{
113
+ returnUrl?: string | undefined;
114
+ products?: string | string[] | undefined;
115
+ slug?: string | undefined;
116
+ referenceId?: string | undefined;
117
+ customFieldData?: Record<string, string | number | boolean> | undefined;
118
+ metadata?: Record<string, string | number | boolean> | undefined;
119
+ allowDiscountCodes?: boolean | undefined;
120
+ discountId?: string | undefined;
121
+ redirect?: boolean | undefined;
122
+ embedOrigin?: string | undefined;
123
+ successUrl?: string | undefined;
124
+ allowTrial?: boolean | undefined;
125
+ trialInterval?: "day" | "week" | "month" | "year" | undefined;
126
+ trialIntervalCount?: number | undefined;
127
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
128
+ }> | undefined, args_1?: import("better-auth").ClientFetchOption<Partial<{
58
129
  returnUrl?: string | undefined;
59
130
  products?: string | string[] | undefined;
60
131
  slug?: string | undefined;
@@ -69,15 +140,89 @@ export declare const AuraPayments: (url: string, workspace: string) => {
69
140
  allowTrial?: boolean | undefined;
70
141
  trialInterval?: "day" | "week" | "month" | "year" | undefined;
71
142
  trialIntervalCount?: number | undefined;
72
- } & {
73
- fetchOptions?: FetchOptions | undefined;
74
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
75
- url: string;
76
- redirect: boolean;
77
- }, {
78
- code?: string | undefined;
79
- message?: string | undefined;
80
- }, 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>;
143
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined) => Promise<{
144
+ data: {
145
+ url: string;
146
+ redirect: boolean;
147
+ };
148
+ error: null;
149
+ } | {
150
+ data: null;
151
+ error: {
152
+ code?: string | undefined | undefined;
153
+ message?: string | undefined | undefined;
154
+ status: number;
155
+ statusText: string;
156
+ };
157
+ }>;
158
+ readonly CheckoutEmbedded: (data: Omit<{
159
+ returnUrl?: string | undefined;
160
+ products?: string | string[] | undefined;
161
+ slug?: string | undefined;
162
+ referenceId?: string | undefined;
163
+ customFieldData?: Record<string, string | number | boolean> | undefined;
164
+ metadata?: Record<string, string | number | boolean> | undefined;
165
+ allowDiscountCodes?: boolean | undefined;
166
+ discountId?: string | undefined;
167
+ redirect?: boolean | undefined;
168
+ embedOrigin?: string | undefined;
169
+ successUrl?: string | undefined;
170
+ allowTrial?: boolean | undefined;
171
+ trialInterval?: "day" | "week" | "month" | "year" | undefined;
172
+ trialIntervalCount?: number | undefined;
173
+ }, "redirect" | "embedOrigin">, fetchOptions?: {
174
+ cache?: RequestCache | undefined;
175
+ credentials?: RequestCredentials | undefined;
176
+ headers?: (HeadersInit & (HeadersInit | {
177
+ accept: "application/json" | "text/plain" | "application/octet-stream";
178
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
179
+ authorization: "Bearer" | "Basic";
180
+ })) | undefined;
181
+ integrity?: string | undefined;
182
+ keepalive?: boolean | undefined;
183
+ method?: string | undefined;
184
+ mode?: RequestMode | undefined;
185
+ priority?: RequestPriority | undefined;
186
+ redirect?: RequestRedirect | undefined;
187
+ referrer?: string | undefined;
188
+ referrerPolicy?: ReferrerPolicy | undefined;
189
+ signal?: (AbortSignal | null) | undefined;
190
+ window?: null | undefined;
191
+ onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
192
+ onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
193
+ onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
194
+ onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
195
+ onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
196
+ hookOptions?: {
197
+ cloneResponse?: boolean;
198
+ } | undefined;
199
+ timeout?: number | undefined;
200
+ customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
201
+ plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
202
+ baseURL?: string | undefined;
203
+ throw?: boolean | undefined;
204
+ auth?: ({
205
+ type: "Bearer";
206
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
207
+ } | {
208
+ type: "Basic";
209
+ username: string | (() => string | undefined) | undefined;
210
+ password: string | (() => string | undefined) | undefined;
211
+ } | {
212
+ type: "Custom";
213
+ prefix: string | (() => string | undefined) | undefined;
214
+ value: string | (() => string | undefined) | undefined;
215
+ }) | undefined;
216
+ body?: any;
217
+ query?: any;
218
+ params?: any;
219
+ duplex?: "full" | "half" | undefined;
220
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
221
+ retry?: import("@better-fetch/fetch").RetryOptions | undefined;
222
+ retryAttempt?: number | undefined;
223
+ output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
224
+ errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
225
+ disableValidation?: boolean | undefined;
226
+ } | undefined) => Promise<import("@polar-sh/checkout/embed").PolarEmbedCheckout>;
82
227
  };
83
228
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAiBysjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAApwjB,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(),
14
+ GetState: () => authClient.customer.state(),
15
+ GetOrders: (...args) => authClient.customer.orders.list(...args),
16
+ GetSubs: (...args) => authClient.customer.subscriptions.list(...args),
17
+ Checkout: (...args) => authClient.checkout(...args),
18
+ CheckoutEmbedded: (...args) => authClient.checkoutEmbed(...args),
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.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",