@inflector/aura 0.6.1 → 0.6.3
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/bin.d.ts.map +1 -1
- package/dist/bin.js +15 -1
- package/dist/function.d.ts.map +1 -1
- package/dist/function.js +72 -96
- package/dist/payments.d.ts +184 -60
- package/dist/payments.d.ts.map +1 -1
- package/dist/payments.js +6 -6
- package/package.json +1 -1
package/dist/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAmLA,wBAAgB,KAAK,CAAC,MAAM,UAAQ,QAgDnC;AA0aD,wBAAsB,GAAG,
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAmLA,wBAAgB,KAAK,CAAC,MAAM,UAAQ,QAgDnC;AA0aD,wBAAsB,GAAG,kBAyFxB"}
|
package/dist/bin.js
CHANGED
|
@@ -582,11 +582,25 @@ export async function dev() {
|
|
|
582
582
|
changeOrigin: true,
|
|
583
583
|
secure: false,
|
|
584
584
|
configure(proxy, _options) {
|
|
585
|
-
proxy.on("proxyReq", (proxyReq,
|
|
585
|
+
proxy.on("proxyReq", (proxyReq, _req, _res) => {
|
|
586
586
|
if (AURA_KEY) {
|
|
587
587
|
proxyReq.setHeader("Authorization", `Bearer ${AURA_KEY}`);
|
|
588
588
|
}
|
|
589
589
|
});
|
|
590
|
+
// Handle proxy errors so requests don't stay pending forever
|
|
591
|
+
proxy.on("error", (err, _req, res) => {
|
|
592
|
+
if (res && !res.headersSent) {
|
|
593
|
+
const isTimeout = err.code === "ECONNRESET" ||
|
|
594
|
+
err.code === "ETIMEDOUT" ||
|
|
595
|
+
err.code === "ESOCKETTIMEDOUT";
|
|
596
|
+
const statusCode = isTimeout ? 504 : 502;
|
|
597
|
+
const message = isTimeout
|
|
598
|
+
? "Upstream request timed out"
|
|
599
|
+
: "Upstream proxy failed";
|
|
600
|
+
res.writeHead(statusCode, { "Content-Type": "application/json" });
|
|
601
|
+
res.end(JSON.stringify({ error: message }));
|
|
602
|
+
}
|
|
603
|
+
});
|
|
590
604
|
},
|
|
591
605
|
},
|
|
592
606
|
},
|
package/dist/function.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../src/function.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACvB,GAAG,
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../src/function.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACvB,GAAG,CAuHL"}
|
package/dist/function.js
CHANGED
|
@@ -10,7 +10,6 @@ export function createFunctionHandler(workspace, functionsFolder) {
|
|
|
10
10
|
get(_, prop) {
|
|
11
11
|
return createNestedProxy([...path, prop]);
|
|
12
12
|
},
|
|
13
|
-
// 1. Remove 'async' here to prevent native Promise wrapping
|
|
14
13
|
apply(_, __, args) {
|
|
15
14
|
const url = [window.location.origin, "api", "fn", workspace, ...path].join("/");
|
|
16
15
|
const isFormData = args != null && args.length === 1 && args[0] instanceof FormData;
|
|
@@ -20,109 +19,86 @@ export function createFunctionHandler(workspace, functionsFolder) {
|
|
|
20
19
|
};
|
|
21
20
|
if (!isFormData)
|
|
22
21
|
headers["Content-Type"] = "application/json";
|
|
23
|
-
//
|
|
24
|
-
|
|
22
|
+
// Return a real Promise — created once, settled once.
|
|
23
|
+
// This prevents the re-triggering bug where the old thenable
|
|
24
|
+
// would re-execute fetch on every .then()/.await call.
|
|
25
|
+
const resultPromise = fetch(url, {
|
|
25
26
|
method: "POST",
|
|
26
27
|
body,
|
|
27
28
|
headers,
|
|
28
29
|
credentials: "include",
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
data: parsedData,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
// Or emit raw string if parsing fails
|
|
83
|
-
onFulfilled({
|
|
84
|
-
event: eventName,
|
|
85
|
-
data: message,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
30
|
+
})
|
|
31
|
+
.then(async (response) => {
|
|
32
|
+
const contentType = response.headers.get("Content-Type") || "";
|
|
33
|
+
// ─────────────────────────────────────────────
|
|
34
|
+
// Reject on HTTP errors before processing body
|
|
35
|
+
// ─────────────────────────────────────────────
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
let errorMessage = `Request failed with status ${response.status}`;
|
|
38
|
+
try {
|
|
39
|
+
const errorBody = await response.text();
|
|
40
|
+
if (errorBody)
|
|
41
|
+
errorMessage += `: ${errorBody}`;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// ignore body read errors
|
|
45
|
+
}
|
|
46
|
+
throw new Error(errorMessage);
|
|
47
|
+
}
|
|
48
|
+
// ─────────────────────────────────────────────
|
|
49
|
+
// SSE PATH
|
|
50
|
+
// ─────────────────────────────────────────────
|
|
51
|
+
if (contentType.includes("text/event-stream")) {
|
|
52
|
+
if (!response.body) {
|
|
53
|
+
throw new Error("SSE response body is null");
|
|
54
|
+
}
|
|
55
|
+
const reader = response.body.getReader();
|
|
56
|
+
const decoder = new TextDecoder("utf-8");
|
|
57
|
+
let buffer = "";
|
|
58
|
+
const events = [];
|
|
59
|
+
while (true) {
|
|
60
|
+
const { value, done } = await reader.read();
|
|
61
|
+
if (done)
|
|
62
|
+
break;
|
|
63
|
+
buffer += decoder.decode(value, { stream: true });
|
|
64
|
+
// Split by SSE message delimiter
|
|
65
|
+
const parts = buffer.split("\n\n");
|
|
66
|
+
buffer = parts.pop() || ""; // Keep incomplete chunk
|
|
67
|
+
for (const part of parts) {
|
|
68
|
+
if (!part.trim())
|
|
69
|
+
continue;
|
|
70
|
+
const lines = part.split("\n");
|
|
71
|
+
let eventName = "message"; // Default SSE event type
|
|
72
|
+
const dataLines = [];
|
|
73
|
+
for (const line of lines) {
|
|
74
|
+
if (line.startsWith("event: ")) {
|
|
75
|
+
eventName = line.replace(/^event: /, "").trim();
|
|
76
|
+
}
|
|
77
|
+
else if (line.startsWith("data: ")) {
|
|
78
|
+
dataLines.push(line.replace(/^data: /, ""));
|
|
90
79
|
}
|
|
91
80
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
const message = dataLines.join("\n");
|
|
82
|
+
if (message) {
|
|
83
|
+
try {
|
|
84
|
+
const parsedData = JSON.parse(message);
|
|
85
|
+
events.push({ event: eventName, data: parsedData });
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
events.push({ event: eventName, data: message });
|
|
89
|
+
}
|
|
95
90
|
}
|
|
96
91
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
onRejected(err);
|
|
108
|
-
});
|
|
109
|
-
// Return 'this' to allow chaining
|
|
110
|
-
return thenable;
|
|
111
|
-
},
|
|
112
|
-
catch(onRejected) {
|
|
113
|
-
return thenable.then(() => { }, onRejected);
|
|
114
|
-
},
|
|
115
|
-
finally(onFinally) {
|
|
116
|
-
return thenable.then((value) => {
|
|
117
|
-
onFinally?.();
|
|
118
|
-
return value;
|
|
119
|
-
}, (err) => {
|
|
120
|
-
onFinally?.();
|
|
121
|
-
throw err;
|
|
122
|
-
});
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
return thenable;
|
|
92
|
+
}
|
|
93
|
+
return events.length === 1 ? events[0] : events;
|
|
94
|
+
}
|
|
95
|
+
// ─────────────────────────────────────────────
|
|
96
|
+
// NORMAL JSON PATH
|
|
97
|
+
// ─────────────────────────────────────────────
|
|
98
|
+
const data = await response.json();
|
|
99
|
+
return data.data ?? data;
|
|
100
|
+
});
|
|
101
|
+
return resultPromise;
|
|
126
102
|
},
|
|
127
103
|
});
|
|
128
104
|
}
|
package/dist/payments.d.ts
CHANGED
|
@@ -1,66 +1,99 @@
|
|
|
1
1
|
export declare const AuraPayments: (url: string, workspace: string) => {
|
|
2
|
-
readonly OpenPortal:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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<{
|
|
26
30
|
query?: {
|
|
27
31
|
page?: number | undefined;
|
|
28
32
|
limit?: number | undefined;
|
|
29
33
|
productBillingType?: "recurring" | "one_time" | undefined;
|
|
30
34
|
} | undefined;
|
|
31
|
-
fetchOptions?:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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<{
|
|
43
|
-
referenceId?: string | 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<{
|
|
44
41
|
page?: number | undefined;
|
|
45
42
|
limit?: number | undefined;
|
|
46
|
-
|
|
47
|
-
}> & Record<string, any>, Record<string, any> | undefined
|
|
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<{
|
|
48
63
|
query?: {
|
|
49
64
|
referenceId?: string | undefined;
|
|
50
65
|
page?: number | undefined;
|
|
51
66
|
limit?: number | undefined;
|
|
52
67
|
active?: boolean | undefined;
|
|
53
68
|
} | undefined;
|
|
54
|
-
fetchOptions?:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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<{
|
|
64
97
|
returnUrl?: string | undefined;
|
|
65
98
|
products?: string | string[] | undefined;
|
|
66
99
|
slug?: string | undefined;
|
|
@@ -75,7 +108,24 @@ export declare const AuraPayments: (url: string, workspace: string) => {
|
|
|
75
108
|
allowTrial?: boolean | undefined;
|
|
76
109
|
trialInterval?: "day" | "week" | "month" | "year" | undefined;
|
|
77
110
|
trialIntervalCount?: number | undefined;
|
|
78
|
-
}
|
|
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<{
|
|
79
129
|
returnUrl?: string | undefined;
|
|
80
130
|
products?: string | string[] | undefined;
|
|
81
131
|
slug?: string | undefined;
|
|
@@ -90,15 +140,89 @@ export declare const AuraPayments: (url: string, workspace: string) => {
|
|
|
90
140
|
allowTrial?: boolean | undefined;
|
|
91
141
|
trialInterval?: "day" | "week" | "month" | "year" | undefined;
|
|
92
142
|
trialIntervalCount?: number | undefined;
|
|
93
|
-
} & {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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>;
|
|
103
227
|
};
|
|
104
228
|
//# sourceMappingURL=payments.d.ts.map
|
package/dist/payments.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../src/payments.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM
|
|
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
|
@@ -10,11 +10,11 @@ export const AuraPayments = (url, workspace) => {
|
|
|
10
10
|
},
|
|
11
11
|
});
|
|
12
12
|
return {
|
|
13
|
-
OpenPortal: authClient.customer.portal
|
|
14
|
-
GetState: authClient.customer.state
|
|
15
|
-
GetOrders: authClient.customer.orders.list
|
|
16
|
-
GetSubs: authClient.customer.subscriptions.list
|
|
17
|
-
Checkout: authClient.checkout
|
|
18
|
-
CheckoutEmbedded: 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
|
};
|