@uninspired/auth-client 0.0.13 → 0.0.15
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/cjs/index.js +215 -2
- package/dist/cjs/index.js.map +9 -5
- package/dist/esm/index.js +188 -2
- package/dist/esm/index.js.map +9 -5
- package/dist/types/index.d.ts +67 -60
- package/package.json +4 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,217 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
6
|
+
var __toCommonJS = (from) => {
|
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
|
8
|
+
if (entry)
|
|
9
|
+
return entry;
|
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
}));
|
|
16
|
+
__moduleCache.set(from, entry);
|
|
17
|
+
return entry;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, {
|
|
22
|
+
get: all[name],
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
|
26
|
+
});
|
|
27
|
+
};
|
|
2
28
|
|
|
3
|
-
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var exports_src = {};
|
|
31
|
+
__export(exports_src, {
|
|
32
|
+
makeUsBetterAuthClient: () => makeUsBetterAuthClient,
|
|
33
|
+
makeRedirectIntent: () => makeRedirectIntent,
|
|
34
|
+
makePublicClient: () => makePublicClient,
|
|
35
|
+
makeMailingListClient: () => makeMailingListClient,
|
|
36
|
+
makeLoginUrl: () => makeLoginUrl,
|
|
37
|
+
makeCheckoutUrl: () => makeCheckoutUrl,
|
|
38
|
+
makeCheckoutClient: () => makeCheckoutClient,
|
|
39
|
+
makeAppClient: () => makeAppClient,
|
|
40
|
+
hasUserSubscribed: () => hasUserSubscribed,
|
|
41
|
+
hasUserPurchased: () => hasUserPurchased,
|
|
42
|
+
formatPrice: () => formatPrice
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(exports_src);
|
|
45
|
+
|
|
46
|
+
// src/clients/publicClient.ts
|
|
47
|
+
var import_client = require("hono/client");
|
|
48
|
+
var makePublicClient = (baseURL, options) => {
|
|
49
|
+
return import_client.hc(baseURL, options);
|
|
50
|
+
};
|
|
51
|
+
// src/clients/appClient.ts
|
|
52
|
+
var import_client2 = require("hono/client");
|
|
53
|
+
var makeAppClient = (baseURL, options) => {
|
|
54
|
+
return import_client2.hc(baseURL, {
|
|
55
|
+
...options,
|
|
56
|
+
fetch: (url, init) => (options?.fetch ?? fetch)(url, {
|
|
57
|
+
...init,
|
|
58
|
+
credentials: "include",
|
|
59
|
+
headers: {
|
|
60
|
+
...init.headers,
|
|
61
|
+
"Content-Type": "application/json"
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
// src/clients/authClient.ts
|
|
67
|
+
var import_plugins = require("better-auth/client/plugins");
|
|
68
|
+
var import_react = require("better-auth/react");
|
|
69
|
+
var makeUsBetterAuthClient = (baseURL) => {
|
|
70
|
+
return import_react.createAuthClient({
|
|
71
|
+
baseURL,
|
|
72
|
+
plugins: [
|
|
73
|
+
import_plugins.customSessionClient(),
|
|
74
|
+
import_plugins.magicLinkClient(),
|
|
75
|
+
import_plugins.emailOTPClient(),
|
|
76
|
+
import_plugins.passkeyClient()
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
// src/clients/checkoutClient.ts
|
|
81
|
+
var import_client3 = require("hono/client");
|
|
82
|
+
var makeCheckoutClient = (baseURL, options) => {
|
|
83
|
+
return import_client3.hc(baseURL, {
|
|
84
|
+
...options,
|
|
85
|
+
fetch: (url, init) => (options?.fetch ?? fetch)(url, {
|
|
86
|
+
...init,
|
|
87
|
+
credentials: "include",
|
|
88
|
+
headers: {
|
|
89
|
+
...init.headers,
|
|
90
|
+
"Content-Type": "application/json"
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
// src/clients/mailingListClient.ts
|
|
96
|
+
var import_client4 = require("hono/client");
|
|
97
|
+
var makeMailingListClient = (baseURL, publicKey, options) => {
|
|
98
|
+
return import_client4.hc(baseURL, {
|
|
99
|
+
...options,
|
|
100
|
+
headers: {
|
|
101
|
+
...options?.headers,
|
|
102
|
+
"X-Public-Key": publicKey
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
// src/utils/intent.ts
|
|
107
|
+
function makeLoginUrl(apiUrl, redirectUrl, appName) {
|
|
108
|
+
const url = new URL("/login", apiUrl);
|
|
109
|
+
if (redirectUrl) {
|
|
110
|
+
url.searchParams.set("intent", makeRedirectIntent(redirectUrl, appName));
|
|
111
|
+
}
|
|
112
|
+
return url.toString();
|
|
113
|
+
}
|
|
114
|
+
function noop(...args) {}
|
|
115
|
+
function makeCheckoutUrl(apiUrl, priceId, productId, discountCode, loginUrl, pricingUrl, successUrl) {
|
|
116
|
+
const obj = {
|
|
117
|
+
priceId,
|
|
118
|
+
productId,
|
|
119
|
+
discountCode,
|
|
120
|
+
loginUrl,
|
|
121
|
+
pricingUrl,
|
|
122
|
+
successUrl
|
|
123
|
+
};
|
|
124
|
+
noop(obj);
|
|
125
|
+
const url = new URL("/auth/checkout", apiUrl);
|
|
126
|
+
url.searchParams.set("priceId", priceId);
|
|
127
|
+
url.searchParams.set("productId", productId);
|
|
128
|
+
if (discountCode) {
|
|
129
|
+
url.searchParams.set("discountCode", discountCode);
|
|
130
|
+
}
|
|
131
|
+
if (loginUrl) {
|
|
132
|
+
url.searchParams.set("loginUrl", loginUrl);
|
|
133
|
+
}
|
|
134
|
+
if (pricingUrl) {
|
|
135
|
+
url.searchParams.set("pricingUrl", pricingUrl);
|
|
136
|
+
}
|
|
137
|
+
if (successUrl) {
|
|
138
|
+
url.searchParams.set("successUrl", successUrl);
|
|
139
|
+
}
|
|
140
|
+
return url.toString();
|
|
141
|
+
}
|
|
142
|
+
function makeRedirectIntent(redirectUrl, appName) {
|
|
143
|
+
const obj = {
|
|
144
|
+
type: "redirect",
|
|
145
|
+
redirectUrl,
|
|
146
|
+
appName
|
|
147
|
+
};
|
|
148
|
+
return JSON.stringify(obj);
|
|
149
|
+
}
|
|
150
|
+
// src/utils/purchase.ts
|
|
151
|
+
function hasUserPurchased(sessionData, productId) {
|
|
152
|
+
if (!sessionData)
|
|
153
|
+
return false;
|
|
154
|
+
return sessionData.products.transactions.some((transaction) => {
|
|
155
|
+
transaction.productId === productId && transaction.status;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function hasUserSubscribed(sessionData, productId) {
|
|
159
|
+
if (!sessionData)
|
|
160
|
+
return false;
|
|
161
|
+
return sessionData.products.subscriptions.some((subscription) => {
|
|
162
|
+
subscription.productId === productId && subscription.status;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// ../utils/src/intent.ts
|
|
166
|
+
var import_zod = require("zod");
|
|
167
|
+
var checkoutIntentSchema = import_zod.z.object({
|
|
168
|
+
type: import_zod.z.literal("checkout"),
|
|
169
|
+
priceId: import_zod.z.string(),
|
|
170
|
+
productId: import_zod.z.string(),
|
|
171
|
+
discountCode: import_zod.z.string().optional(),
|
|
172
|
+
loginUrl: import_zod.z.url().optional(),
|
|
173
|
+
pricingUrl: import_zod.z.url().optional(),
|
|
174
|
+
successUrl: import_zod.z.url().optional()
|
|
175
|
+
});
|
|
176
|
+
var redirectIntentSchema = import_zod.z.object({
|
|
177
|
+
type: import_zod.z.literal("redirect"),
|
|
178
|
+
redirectUrl: import_zod.z.url(),
|
|
179
|
+
appName: import_zod.z.string().optional()
|
|
180
|
+
});
|
|
181
|
+
var intentSchema = import_zod.z.discriminatedUnion("type", [
|
|
182
|
+
checkoutIntentSchema,
|
|
183
|
+
redirectIntentSchema
|
|
184
|
+
]);
|
|
185
|
+
var intentSearchSchema = import_zod.z.object({
|
|
186
|
+
intent: intentSchema.optional()
|
|
187
|
+
});
|
|
188
|
+
// ../utils/src/checkout.ts
|
|
189
|
+
var import_zod2 = require("zod");
|
|
190
|
+
var checkoutSearchSchema = import_zod2.z.object({
|
|
191
|
+
priceId: import_zod2.z.string(),
|
|
192
|
+
productId: import_zod2.z.string(),
|
|
193
|
+
discountCode: import_zod2.z.string().optional(),
|
|
194
|
+
loginUrl: import_zod2.z.url().optional(),
|
|
195
|
+
pricingUrl: import_zod2.z.url().optional(),
|
|
196
|
+
successUrl: import_zod2.z.url().optional()
|
|
197
|
+
});
|
|
198
|
+
// ../utils/src/price.ts
|
|
199
|
+
function formatPrice(amountStr, currencyCode) {
|
|
200
|
+
const amount = parseInt(amountStr);
|
|
201
|
+
if (!amount || !currencyCode)
|
|
202
|
+
return null;
|
|
203
|
+
const formatter = new Intl.NumberFormat("en-US", {
|
|
204
|
+
style: "currency",
|
|
205
|
+
currency: currencyCode
|
|
206
|
+
});
|
|
207
|
+
const parts = formatter.formatToParts(amount);
|
|
208
|
+
const fractionDigits = parts.find((part) => part.type === "fraction")?.value.length || 0;
|
|
209
|
+
const divisor = Math.pow(10, fractionDigits);
|
|
210
|
+
return new Intl.NumberFormat("en-US", {
|
|
211
|
+
style: "currency",
|
|
212
|
+
currency: currencyCode
|
|
213
|
+
}).format(amount / divisor);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
//# debugId=17DF4CE27BA42D7364756E2164756E21
|
|
4
217
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/clients/publicClient.ts", "../../src/clients/appClient.ts", "../../src/clients/authClient.ts", "../../src/clients/checkoutClient.ts", "../../src/clients/mailingListClient.ts", "../../src/utils/intent.ts"],
|
|
3
|
+
"sources": ["../../src/clients/publicClient.ts", "../../src/clients/appClient.ts", "../../src/clients/authClient.ts", "../../src/clients/checkoutClient.ts", "../../src/clients/mailingListClient.ts", "../../src/utils/intent.ts", "../../src/utils/purchase.ts", "../../../utils/src/intent.ts", "../../../utils/src/checkout.ts", "../../../utils/src/price.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { PublicRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type PublicClient = ReturnType<typeof hc<PublicRouter>>;\n\nexport const makePublicClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): PublicClient => {\n return hc<PublicRouter>(baseURL, options);\n};\n",
|
|
6
6
|
"import type { AppRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type AppClient = ReturnType<typeof hc<AppRouter>>;\n\nexport const makeAppClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): AppClient => {\n return hc<AppRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n",
|
|
7
|
-
"import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type { Auth } from \"@us-accounts/api\";\n\nexport const makeUsBetterAuthClient = (baseURL: string) => {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n};\n",
|
|
7
|
+
"import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type { Auth } from \"@us-accounts/api\";\n\nexport const makeUsBetterAuthClient = (baseURL: string) => {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n};\n\nexport type AuthClient = ReturnType<typeof makeUsBetterAuthClient>;\n",
|
|
8
8
|
"import type { CheckoutRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;\n\nexport const makeCheckoutClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): CheckoutClient => {\n return hc<CheckoutRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n",
|
|
9
9
|
"import type { MailingListRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type MailingListClient = ReturnType<typeof hc<MailingListRouter>>;\n\nexport const makeMailingListClient = (\n baseURL: string,\n publicKey: string,\n options?: ClientRequestOptions,\n): MailingListClient => {\n return hc<MailingListRouter>(baseURL, {\n ...options,\n headers: {\n ...options?.headers,\n \"X-Public-Key\": publicKey,\n },\n });\n};\n",
|
|
10
|
-
"import type { CheckoutSearch, RedirectIntent } from \"@us-accounts/utils\";\n\nexport function makeLoginUrl(\n apiUrl: string,\n redirectUrl?: string,\n appName?: string,\n) {\n const url = new URL(\"/login\", apiUrl);\n if (redirectUrl) {\n url.searchParams.set(\"intent\", makeRedirectIntent(redirectUrl, appName));\n }\n return url.toString();\n}\n\nfunction noop(...args: any[]) {\n // Do nothing\n}\n\nexport function makeCheckoutUrl(\n apiUrl: string,\n priceId: string,\n productId: string,\n discountCode?: string,\n loginUrl?: string,\n pricingUrl?: string,\n successUrl?: string,\n) {\n const obj = {\n priceId,\n productId,\n discountCode,\n loginUrl,\n pricingUrl,\n successUrl,\n } satisfies CheckoutSearch;\n noop(obj);\n\n const url = new URL(\"/auth/checkout\", apiUrl);\n url.searchParams.set(\"priceId\", priceId);\n url.searchParams.set(\"productId\", productId);\n if (discountCode) {\n url.searchParams.set(\"discountCode\", discountCode);\n }\n if (loginUrl) {\n url.searchParams.set(\"loginUrl\", loginUrl);\n }\n if (pricingUrl) {\n url.searchParams.set(\"pricingUrl\", pricingUrl);\n }\n if (successUrl) {\n url.searchParams.set(\"successUrl\", successUrl);\n }\n return url.toString();\n}\n\nexport function makeRedirectIntent(\n redirectUrl: string,\n appName?: string,\n): string {\n const obj = {\n type: \"redirect\",\n redirectUrl,\n appName,\n } satisfies RedirectIntent;\n\n return JSON.stringify(obj);\n}\n"
|
|
10
|
+
"import type { CheckoutSearch, RedirectIntent } from \"@us-accounts/utils\";\n\nexport function makeLoginUrl(\n apiUrl: string,\n redirectUrl?: string,\n appName?: string,\n) {\n const url = new URL(\"/login\", apiUrl);\n if (redirectUrl) {\n url.searchParams.set(\"intent\", makeRedirectIntent(redirectUrl, appName));\n }\n return url.toString();\n}\n\nfunction noop(...args: any[]) {\n // Do nothing\n}\n\nexport function makeCheckoutUrl(\n apiUrl: string,\n priceId: string,\n productId: string,\n discountCode?: string,\n loginUrl?: string,\n pricingUrl?: string,\n successUrl?: string,\n) {\n const obj = {\n priceId,\n productId,\n discountCode,\n loginUrl,\n pricingUrl,\n successUrl,\n } satisfies CheckoutSearch;\n noop(obj);\n\n const url = new URL(\"/auth/checkout\", apiUrl);\n url.searchParams.set(\"priceId\", priceId);\n url.searchParams.set(\"productId\", productId);\n if (discountCode) {\n url.searchParams.set(\"discountCode\", discountCode);\n }\n if (loginUrl) {\n url.searchParams.set(\"loginUrl\", loginUrl);\n }\n if (pricingUrl) {\n url.searchParams.set(\"pricingUrl\", pricingUrl);\n }\n if (successUrl) {\n url.searchParams.set(\"successUrl\", successUrl);\n }\n return url.toString();\n}\n\nexport function makeRedirectIntent(\n redirectUrl: string,\n appName?: string,\n): string {\n const obj = {\n type: \"redirect\",\n redirectUrl,\n appName,\n } satisfies RedirectIntent;\n\n return JSON.stringify(obj);\n}\n",
|
|
11
|
+
"import type { AuthClient } from \"../clients/authClient\";\n\nexport type SessionData = ReturnType<AuthClient[\"useSession\"]>[\"data\"];\n\nexport function hasUserPurchased(\n sessionData: SessionData,\n productId: string,\n): boolean {\n if (!sessionData) return false;\n return sessionData.products.transactions.some((transaction) => {\n transaction.productId === productId && transaction.status === \"completed\";\n });\n}\n\nexport function hasUserSubscribed(\n sessionData: SessionData,\n productId: string,\n): boolean {\n if (!sessionData) return false;\n return sessionData.products.subscriptions.some((subscription) => {\n subscription.productId === productId && subscription.status === \"active\";\n });\n}\n",
|
|
12
|
+
"import { z } from \"zod\";\n\nexport const checkoutIntentSchema = z.object({\n type: z.literal(\"checkout\"),\n priceId: z.string(),\n productId: z.string(),\n discountCode: z.string().optional(),\n loginUrl: z.url().optional(),\n pricingUrl: z.url().optional(),\n successUrl: z.url().optional(),\n});\nexport type CheckoutIntent = z.infer<typeof checkoutIntentSchema>;\n\nexport const redirectIntentSchema = z.object({\n type: z.literal(\"redirect\"),\n redirectUrl: z.url(),\n appName: z.string().optional(),\n});\nexport type RedirectIntent = z.infer<typeof redirectIntentSchema>;\n\nexport const intentSchema = z.discriminatedUnion(\"type\", [\n checkoutIntentSchema,\n redirectIntentSchema,\n]);\nexport type Intent = z.infer<typeof intentSchema>;\n\nexport const intentSearchSchema = z.object({\n intent: intentSchema.optional(),\n});\n",
|
|
13
|
+
"import { z } from \"zod\";\n\nexport const checkoutSearchSchema = z.object({\n priceId: z.string(),\n productId: z.string(),\n discountCode: z.string().optional(),\n loginUrl: z.url().optional(),\n pricingUrl: z.url().optional(),\n successUrl: z.url().optional(),\n});\n\nexport type CheckoutSearch = z.infer<typeof checkoutSearchSchema>;\n",
|
|
14
|
+
"export function formatPrice(amountStr: string, currencyCode: string) {\n const amount = parseInt(amountStr);\n\n if (!amount || !currencyCode) return null;\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: currencyCode,\n });\n\n const parts = formatter.formatToParts(amount);\n const fractionDigits =\n parts.find((part) => part.type === \"fraction\")?.value.length || 0;\n\n // Calculate the divisor based on decimal places\n const divisor = Math.pow(10, fractionDigits);\n\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: currencyCode,\n }).format(amount / divisor);\n}\n"
|
|
11
15
|
],
|
|
12
|
-
"mappings": "
|
|
13
|
-
"debugId": "
|
|
16
|
+
"mappings": "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",
|
|
17
|
+
"debugId": "17DF4CE27BA42D7364756E2164756E21",
|
|
14
18
|
"names": []
|
|
15
19
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,190 @@
|
|
|
1
|
-
|
|
1
|
+
// src/clients/publicClient.ts
|
|
2
|
+
import { hc } from "hono/client";
|
|
3
|
+
var makePublicClient = (baseURL, options) => {
|
|
4
|
+
return hc(baseURL, options);
|
|
5
|
+
};
|
|
6
|
+
// src/clients/appClient.ts
|
|
7
|
+
import { hc as hc2 } from "hono/client";
|
|
8
|
+
var makeAppClient = (baseURL, options) => {
|
|
9
|
+
return hc2(baseURL, {
|
|
10
|
+
...options,
|
|
11
|
+
fetch: (url, init) => (options?.fetch ?? fetch)(url, {
|
|
12
|
+
...init,
|
|
13
|
+
credentials: "include",
|
|
14
|
+
headers: {
|
|
15
|
+
...init.headers,
|
|
16
|
+
"Content-Type": "application/json"
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
// src/clients/authClient.ts
|
|
22
|
+
import {
|
|
23
|
+
customSessionClient,
|
|
24
|
+
magicLinkClient,
|
|
25
|
+
emailOTPClient,
|
|
26
|
+
passkeyClient
|
|
27
|
+
} from "better-auth/client/plugins";
|
|
28
|
+
import { createAuthClient } from "better-auth/react";
|
|
29
|
+
var makeUsBetterAuthClient = (baseURL) => {
|
|
30
|
+
return createAuthClient({
|
|
31
|
+
baseURL,
|
|
32
|
+
plugins: [
|
|
33
|
+
customSessionClient(),
|
|
34
|
+
magicLinkClient(),
|
|
35
|
+
emailOTPClient(),
|
|
36
|
+
passkeyClient()
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
// src/clients/checkoutClient.ts
|
|
41
|
+
import { hc as hc3 } from "hono/client";
|
|
42
|
+
var makeCheckoutClient = (baseURL, options) => {
|
|
43
|
+
return hc3(baseURL, {
|
|
44
|
+
...options,
|
|
45
|
+
fetch: (url, init) => (options?.fetch ?? fetch)(url, {
|
|
46
|
+
...init,
|
|
47
|
+
credentials: "include",
|
|
48
|
+
headers: {
|
|
49
|
+
...init.headers,
|
|
50
|
+
"Content-Type": "application/json"
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
// src/clients/mailingListClient.ts
|
|
56
|
+
import { hc as hc4 } from "hono/client";
|
|
57
|
+
var makeMailingListClient = (baseURL, publicKey, options) => {
|
|
58
|
+
return hc4(baseURL, {
|
|
59
|
+
...options,
|
|
60
|
+
headers: {
|
|
61
|
+
...options?.headers,
|
|
62
|
+
"X-Public-Key": publicKey
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
// src/utils/intent.ts
|
|
67
|
+
function makeLoginUrl(apiUrl, redirectUrl, appName) {
|
|
68
|
+
const url = new URL("/login", apiUrl);
|
|
69
|
+
if (redirectUrl) {
|
|
70
|
+
url.searchParams.set("intent", makeRedirectIntent(redirectUrl, appName));
|
|
71
|
+
}
|
|
72
|
+
return url.toString();
|
|
73
|
+
}
|
|
74
|
+
function noop(...args) {}
|
|
75
|
+
function makeCheckoutUrl(apiUrl, priceId, productId, discountCode, loginUrl, pricingUrl, successUrl) {
|
|
76
|
+
const obj = {
|
|
77
|
+
priceId,
|
|
78
|
+
productId,
|
|
79
|
+
discountCode,
|
|
80
|
+
loginUrl,
|
|
81
|
+
pricingUrl,
|
|
82
|
+
successUrl
|
|
83
|
+
};
|
|
84
|
+
noop(obj);
|
|
85
|
+
const url = new URL("/auth/checkout", apiUrl);
|
|
86
|
+
url.searchParams.set("priceId", priceId);
|
|
87
|
+
url.searchParams.set("productId", productId);
|
|
88
|
+
if (discountCode) {
|
|
89
|
+
url.searchParams.set("discountCode", discountCode);
|
|
90
|
+
}
|
|
91
|
+
if (loginUrl) {
|
|
92
|
+
url.searchParams.set("loginUrl", loginUrl);
|
|
93
|
+
}
|
|
94
|
+
if (pricingUrl) {
|
|
95
|
+
url.searchParams.set("pricingUrl", pricingUrl);
|
|
96
|
+
}
|
|
97
|
+
if (successUrl) {
|
|
98
|
+
url.searchParams.set("successUrl", successUrl);
|
|
99
|
+
}
|
|
100
|
+
return url.toString();
|
|
101
|
+
}
|
|
102
|
+
function makeRedirectIntent(redirectUrl, appName) {
|
|
103
|
+
const obj = {
|
|
104
|
+
type: "redirect",
|
|
105
|
+
redirectUrl,
|
|
106
|
+
appName
|
|
107
|
+
};
|
|
108
|
+
return JSON.stringify(obj);
|
|
109
|
+
}
|
|
110
|
+
// src/utils/purchase.ts
|
|
111
|
+
function hasUserPurchased(sessionData, productId) {
|
|
112
|
+
if (!sessionData)
|
|
113
|
+
return false;
|
|
114
|
+
return sessionData.products.transactions.some((transaction) => {
|
|
115
|
+
transaction.productId === productId && transaction.status;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function hasUserSubscribed(sessionData, productId) {
|
|
119
|
+
if (!sessionData)
|
|
120
|
+
return false;
|
|
121
|
+
return sessionData.products.subscriptions.some((subscription) => {
|
|
122
|
+
subscription.productId === productId && subscription.status;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// ../utils/src/intent.ts
|
|
126
|
+
import { z } from "zod";
|
|
127
|
+
var checkoutIntentSchema = z.object({
|
|
128
|
+
type: z.literal("checkout"),
|
|
129
|
+
priceId: z.string(),
|
|
130
|
+
productId: z.string(),
|
|
131
|
+
discountCode: z.string().optional(),
|
|
132
|
+
loginUrl: z.url().optional(),
|
|
133
|
+
pricingUrl: z.url().optional(),
|
|
134
|
+
successUrl: z.url().optional()
|
|
135
|
+
});
|
|
136
|
+
var redirectIntentSchema = z.object({
|
|
137
|
+
type: z.literal("redirect"),
|
|
138
|
+
redirectUrl: z.url(),
|
|
139
|
+
appName: z.string().optional()
|
|
140
|
+
});
|
|
141
|
+
var intentSchema = z.discriminatedUnion("type", [
|
|
142
|
+
checkoutIntentSchema,
|
|
143
|
+
redirectIntentSchema
|
|
144
|
+
]);
|
|
145
|
+
var intentSearchSchema = z.object({
|
|
146
|
+
intent: intentSchema.optional()
|
|
147
|
+
});
|
|
148
|
+
// ../utils/src/checkout.ts
|
|
149
|
+
import { z as z2 } from "zod";
|
|
150
|
+
var checkoutSearchSchema = z2.object({
|
|
151
|
+
priceId: z2.string(),
|
|
152
|
+
productId: z2.string(),
|
|
153
|
+
discountCode: z2.string().optional(),
|
|
154
|
+
loginUrl: z2.url().optional(),
|
|
155
|
+
pricingUrl: z2.url().optional(),
|
|
156
|
+
successUrl: z2.url().optional()
|
|
157
|
+
});
|
|
158
|
+
// ../utils/src/price.ts
|
|
159
|
+
function formatPrice(amountStr, currencyCode) {
|
|
160
|
+
const amount = parseInt(amountStr);
|
|
161
|
+
if (!amount || !currencyCode)
|
|
162
|
+
return null;
|
|
163
|
+
const formatter = new Intl.NumberFormat("en-US", {
|
|
164
|
+
style: "currency",
|
|
165
|
+
currency: currencyCode
|
|
166
|
+
});
|
|
167
|
+
const parts = formatter.formatToParts(amount);
|
|
168
|
+
const fractionDigits = parts.find((part) => part.type === "fraction")?.value.length || 0;
|
|
169
|
+
const divisor = Math.pow(10, fractionDigits);
|
|
170
|
+
return new Intl.NumberFormat("en-US", {
|
|
171
|
+
style: "currency",
|
|
172
|
+
currency: currencyCode
|
|
173
|
+
}).format(amount / divisor);
|
|
174
|
+
}
|
|
175
|
+
export {
|
|
176
|
+
makeUsBetterAuthClient,
|
|
177
|
+
makeRedirectIntent,
|
|
178
|
+
makePublicClient,
|
|
179
|
+
makeMailingListClient,
|
|
180
|
+
makeLoginUrl,
|
|
181
|
+
makeCheckoutUrl,
|
|
182
|
+
makeCheckoutClient,
|
|
183
|
+
makeAppClient,
|
|
184
|
+
hasUserSubscribed,
|
|
185
|
+
hasUserPurchased,
|
|
186
|
+
formatPrice
|
|
187
|
+
};
|
|
2
188
|
|
|
3
|
-
//# debugId=
|
|
189
|
+
//# debugId=1E563DF9859782D164756E2164756E21
|
|
4
190
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/clients/publicClient.ts", "../../src/clients/appClient.ts", "../../src/clients/authClient.ts", "../../src/clients/checkoutClient.ts", "../../src/clients/mailingListClient.ts", "../../src/utils/intent.ts"],
|
|
3
|
+
"sources": ["../../src/clients/publicClient.ts", "../../src/clients/appClient.ts", "../../src/clients/authClient.ts", "../../src/clients/checkoutClient.ts", "../../src/clients/mailingListClient.ts", "../../src/utils/intent.ts", "../../src/utils/purchase.ts", "../../../utils/src/intent.ts", "../../../utils/src/checkout.ts", "../../../utils/src/price.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { PublicRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type PublicClient = ReturnType<typeof hc<PublicRouter>>;\n\nexport const makePublicClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): PublicClient => {\n return hc<PublicRouter>(baseURL, options);\n};\n",
|
|
6
6
|
"import type { AppRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type AppClient = ReturnType<typeof hc<AppRouter>>;\n\nexport const makeAppClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): AppClient => {\n return hc<AppRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n",
|
|
7
|
-
"import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type { Auth } from \"@us-accounts/api\";\n\nexport const makeUsBetterAuthClient = (baseURL: string) => {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n};\n",
|
|
7
|
+
"import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type { Auth } from \"@us-accounts/api\";\n\nexport const makeUsBetterAuthClient = (baseURL: string) => {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n};\n\nexport type AuthClient = ReturnType<typeof makeUsBetterAuthClient>;\n",
|
|
8
8
|
"import type { CheckoutRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;\n\nexport const makeCheckoutClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): CheckoutClient => {\n return hc<CheckoutRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n",
|
|
9
9
|
"import type { MailingListRouter } from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type MailingListClient = ReturnType<typeof hc<MailingListRouter>>;\n\nexport const makeMailingListClient = (\n baseURL: string,\n publicKey: string,\n options?: ClientRequestOptions,\n): MailingListClient => {\n return hc<MailingListRouter>(baseURL, {\n ...options,\n headers: {\n ...options?.headers,\n \"X-Public-Key\": publicKey,\n },\n });\n};\n",
|
|
10
|
-
"import type { CheckoutSearch, RedirectIntent } from \"@us-accounts/utils\";\n\nexport function makeLoginUrl(\n apiUrl: string,\n redirectUrl?: string,\n appName?: string,\n) {\n const url = new URL(\"/login\", apiUrl);\n if (redirectUrl) {\n url.searchParams.set(\"intent\", makeRedirectIntent(redirectUrl, appName));\n }\n return url.toString();\n}\n\nfunction noop(...args: any[]) {\n // Do nothing\n}\n\nexport function makeCheckoutUrl(\n apiUrl: string,\n priceId: string,\n productId: string,\n discountCode?: string,\n loginUrl?: string,\n pricingUrl?: string,\n successUrl?: string,\n) {\n const obj = {\n priceId,\n productId,\n discountCode,\n loginUrl,\n pricingUrl,\n successUrl,\n } satisfies CheckoutSearch;\n noop(obj);\n\n const url = new URL(\"/auth/checkout\", apiUrl);\n url.searchParams.set(\"priceId\", priceId);\n url.searchParams.set(\"productId\", productId);\n if (discountCode) {\n url.searchParams.set(\"discountCode\", discountCode);\n }\n if (loginUrl) {\n url.searchParams.set(\"loginUrl\", loginUrl);\n }\n if (pricingUrl) {\n url.searchParams.set(\"pricingUrl\", pricingUrl);\n }\n if (successUrl) {\n url.searchParams.set(\"successUrl\", successUrl);\n }\n return url.toString();\n}\n\nexport function makeRedirectIntent(\n redirectUrl: string,\n appName?: string,\n): string {\n const obj = {\n type: \"redirect\",\n redirectUrl,\n appName,\n } satisfies RedirectIntent;\n\n return JSON.stringify(obj);\n}\n"
|
|
10
|
+
"import type { CheckoutSearch, RedirectIntent } from \"@us-accounts/utils\";\n\nexport function makeLoginUrl(\n apiUrl: string,\n redirectUrl?: string,\n appName?: string,\n) {\n const url = new URL(\"/login\", apiUrl);\n if (redirectUrl) {\n url.searchParams.set(\"intent\", makeRedirectIntent(redirectUrl, appName));\n }\n return url.toString();\n}\n\nfunction noop(...args: any[]) {\n // Do nothing\n}\n\nexport function makeCheckoutUrl(\n apiUrl: string,\n priceId: string,\n productId: string,\n discountCode?: string,\n loginUrl?: string,\n pricingUrl?: string,\n successUrl?: string,\n) {\n const obj = {\n priceId,\n productId,\n discountCode,\n loginUrl,\n pricingUrl,\n successUrl,\n } satisfies CheckoutSearch;\n noop(obj);\n\n const url = new URL(\"/auth/checkout\", apiUrl);\n url.searchParams.set(\"priceId\", priceId);\n url.searchParams.set(\"productId\", productId);\n if (discountCode) {\n url.searchParams.set(\"discountCode\", discountCode);\n }\n if (loginUrl) {\n url.searchParams.set(\"loginUrl\", loginUrl);\n }\n if (pricingUrl) {\n url.searchParams.set(\"pricingUrl\", pricingUrl);\n }\n if (successUrl) {\n url.searchParams.set(\"successUrl\", successUrl);\n }\n return url.toString();\n}\n\nexport function makeRedirectIntent(\n redirectUrl: string,\n appName?: string,\n): string {\n const obj = {\n type: \"redirect\",\n redirectUrl,\n appName,\n } satisfies RedirectIntent;\n\n return JSON.stringify(obj);\n}\n",
|
|
11
|
+
"import type { AuthClient } from \"../clients/authClient\";\n\nexport type SessionData = ReturnType<AuthClient[\"useSession\"]>[\"data\"];\n\nexport function hasUserPurchased(\n sessionData: SessionData,\n productId: string,\n): boolean {\n if (!sessionData) return false;\n return sessionData.products.transactions.some((transaction) => {\n transaction.productId === productId && transaction.status === \"completed\";\n });\n}\n\nexport function hasUserSubscribed(\n sessionData: SessionData,\n productId: string,\n): boolean {\n if (!sessionData) return false;\n return sessionData.products.subscriptions.some((subscription) => {\n subscription.productId === productId && subscription.status === \"active\";\n });\n}\n",
|
|
12
|
+
"import { z } from \"zod\";\n\nexport const checkoutIntentSchema = z.object({\n type: z.literal(\"checkout\"),\n priceId: z.string(),\n productId: z.string(),\n discountCode: z.string().optional(),\n loginUrl: z.url().optional(),\n pricingUrl: z.url().optional(),\n successUrl: z.url().optional(),\n});\nexport type CheckoutIntent = z.infer<typeof checkoutIntentSchema>;\n\nexport const redirectIntentSchema = z.object({\n type: z.literal(\"redirect\"),\n redirectUrl: z.url(),\n appName: z.string().optional(),\n});\nexport type RedirectIntent = z.infer<typeof redirectIntentSchema>;\n\nexport const intentSchema = z.discriminatedUnion(\"type\", [\n checkoutIntentSchema,\n redirectIntentSchema,\n]);\nexport type Intent = z.infer<typeof intentSchema>;\n\nexport const intentSearchSchema = z.object({\n intent: intentSchema.optional(),\n});\n",
|
|
13
|
+
"import { z } from \"zod\";\n\nexport const checkoutSearchSchema = z.object({\n priceId: z.string(),\n productId: z.string(),\n discountCode: z.string().optional(),\n loginUrl: z.url().optional(),\n pricingUrl: z.url().optional(),\n successUrl: z.url().optional(),\n});\n\nexport type CheckoutSearch = z.infer<typeof checkoutSearchSchema>;\n",
|
|
14
|
+
"export function formatPrice(amountStr: string, currencyCode: string) {\n const amount = parseInt(amountStr);\n\n if (!amount || !currencyCode) return null;\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: currencyCode,\n });\n\n const parts = formatter.formatToParts(amount);\n const fractionDigits =\n parts.find((part) => part.type === \"fraction\")?.value.length || 0;\n\n // Calculate the divisor based on decimal places\n const divisor = Math.pow(10, fractionDigits);\n\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: currencyCode,\n }).format(amount / divisor);\n}\n"
|
|
11
15
|
],
|
|
12
|
-
"mappings": "AACA,
|
|
13
|
-
"debugId": "
|
|
16
|
+
"mappings": "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",
|
|
17
|
+
"debugId": "1E563DF9859782D164756E2164756E21",
|
|
14
18
|
"names": []
|
|
15
19
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ declare const appRouter: hono_hono_base.HonoBase<{
|
|
|
94
94
|
input: {
|
|
95
95
|
param: {
|
|
96
96
|
subscriptionId: string;
|
|
97
|
-
action: "
|
|
97
|
+
action: "update" | "cancel";
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
100
|
output: undefined;
|
|
@@ -268,9 +268,9 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
268
268
|
callbackUrl: string;
|
|
269
269
|
};
|
|
270
270
|
};
|
|
271
|
-
output: "
|
|
271
|
+
output: "Could not send email";
|
|
272
272
|
outputFormat: "text";
|
|
273
|
-
status:
|
|
273
|
+
status: 500;
|
|
274
274
|
} | {
|
|
275
275
|
input: {
|
|
276
276
|
json: {
|
|
@@ -279,9 +279,9 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
279
279
|
callbackUrl: string;
|
|
280
280
|
};
|
|
281
281
|
};
|
|
282
|
-
output: "
|
|
282
|
+
output: "Contact already subscribed";
|
|
283
283
|
outputFormat: "text";
|
|
284
|
-
status:
|
|
284
|
+
status: 400;
|
|
285
285
|
} | {
|
|
286
286
|
input: {
|
|
287
287
|
json: {
|
|
@@ -290,9 +290,9 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
290
290
|
callbackUrl: string;
|
|
291
291
|
};
|
|
292
292
|
};
|
|
293
|
-
output: "
|
|
293
|
+
output: "Success";
|
|
294
294
|
outputFormat: "text";
|
|
295
|
-
status:
|
|
295
|
+
status: 200;
|
|
296
296
|
};
|
|
297
297
|
};
|
|
298
298
|
} & {
|
|
@@ -304,9 +304,9 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
304
304
|
email: string;
|
|
305
305
|
};
|
|
306
306
|
};
|
|
307
|
-
output:
|
|
308
|
-
outputFormat: "
|
|
309
|
-
status:
|
|
307
|
+
output: "Invalid opt-in token";
|
|
308
|
+
outputFormat: "text";
|
|
309
|
+
status: 400;
|
|
310
310
|
} | {
|
|
311
311
|
input: {
|
|
312
312
|
query: {
|
|
@@ -314,7 +314,7 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
314
314
|
email: string;
|
|
315
315
|
};
|
|
316
316
|
};
|
|
317
|
-
output: "
|
|
317
|
+
output: "Contact does not exist";
|
|
318
318
|
outputFormat: "text";
|
|
319
319
|
status: 400;
|
|
320
320
|
} | {
|
|
@@ -324,9 +324,9 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
324
324
|
email: string;
|
|
325
325
|
};
|
|
326
326
|
};
|
|
327
|
-
output: "
|
|
327
|
+
output: "Could not opt in contact";
|
|
328
328
|
outputFormat: "text";
|
|
329
|
-
status:
|
|
329
|
+
status: 500;
|
|
330
330
|
} | {
|
|
331
331
|
input: {
|
|
332
332
|
query: {
|
|
@@ -334,9 +334,9 @@ declare const mailingListRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
334
334
|
email: string;
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
|
-
output:
|
|
338
|
-
outputFormat: "
|
|
339
|
-
status:
|
|
337
|
+
output: undefined;
|
|
338
|
+
outputFormat: "redirect";
|
|
339
|
+
status: 302;
|
|
340
340
|
};
|
|
341
341
|
};
|
|
342
342
|
} & {
|
|
@@ -377,8 +377,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
377
377
|
mode?: undici_types.RequestMode | undefined;
|
|
378
378
|
method?: string | undefined;
|
|
379
379
|
headers?: any;
|
|
380
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
381
380
|
keepalive?: boolean | undefined;
|
|
381
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
382
382
|
integrity?: string | undefined;
|
|
383
383
|
signal?: (AbortSignal | null) | undefined;
|
|
384
384
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -448,8 +448,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
448
448
|
mode?: undici_types.RequestMode | undefined;
|
|
449
449
|
method?: string | undefined;
|
|
450
450
|
headers?: any;
|
|
451
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
452
451
|
keepalive?: boolean | undefined;
|
|
452
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
453
453
|
integrity?: string | undefined;
|
|
454
454
|
signal?: (AbortSignal | null) | undefined;
|
|
455
455
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -527,8 +527,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
527
527
|
mode?: undici_types.RequestMode | undefined;
|
|
528
528
|
method?: string | undefined;
|
|
529
529
|
headers?: any;
|
|
530
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
531
530
|
keepalive?: boolean | undefined;
|
|
531
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
532
532
|
integrity?: string | undefined;
|
|
533
533
|
signal?: (AbortSignal | null) | undefined;
|
|
534
534
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -594,8 +594,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
594
594
|
mode?: undici_types.RequestMode | undefined;
|
|
595
595
|
method?: string | undefined;
|
|
596
596
|
headers?: any;
|
|
597
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
598
597
|
keepalive?: boolean | undefined;
|
|
598
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
599
599
|
integrity?: string | undefined;
|
|
600
600
|
signal?: (AbortSignal | null) | undefined;
|
|
601
601
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -681,8 +681,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
681
681
|
mode?: undici_types.RequestMode | undefined;
|
|
682
682
|
method?: string | undefined;
|
|
683
683
|
headers?: any;
|
|
684
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
685
684
|
keepalive?: boolean | undefined;
|
|
685
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
686
686
|
integrity?: string | undefined;
|
|
687
687
|
signal?: (AbortSignal | null) | undefined;
|
|
688
688
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -755,8 +755,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
755
755
|
mode?: undici_types.RequestMode | undefined;
|
|
756
756
|
method?: string | undefined;
|
|
757
757
|
headers?: any;
|
|
758
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
759
758
|
keepalive?: boolean | undefined;
|
|
759
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
760
760
|
integrity?: string | undefined;
|
|
761
761
|
signal?: (AbortSignal | null) | undefined;
|
|
762
762
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -818,8 +818,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
818
818
|
mode?: undici_types.RequestMode | undefined;
|
|
819
819
|
method?: string | undefined;
|
|
820
820
|
headers?: any;
|
|
821
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
822
821
|
keepalive?: boolean | undefined;
|
|
822
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
823
823
|
integrity?: string | undefined;
|
|
824
824
|
signal?: (AbortSignal | null) | undefined;
|
|
825
825
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -885,8 +885,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
885
885
|
mode?: undici_types.RequestMode | undefined;
|
|
886
886
|
method?: string | undefined;
|
|
887
887
|
headers?: any;
|
|
888
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
889
888
|
keepalive?: boolean | undefined;
|
|
889
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
890
890
|
integrity?: string | undefined;
|
|
891
891
|
signal?: (AbortSignal | null) | undefined;
|
|
892
892
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -950,8 +950,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
950
950
|
mode?: undici_types.RequestMode | undefined;
|
|
951
951
|
method?: string | undefined;
|
|
952
952
|
headers?: any;
|
|
953
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
954
953
|
keepalive?: boolean | undefined;
|
|
954
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
955
955
|
integrity?: string | undefined;
|
|
956
956
|
signal?: (AbortSignal | null) | undefined;
|
|
957
957
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1014,8 +1014,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1014
1014
|
mode?: undici_types.RequestMode | undefined;
|
|
1015
1015
|
method?: string | undefined;
|
|
1016
1016
|
headers?: any;
|
|
1017
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1018
1017
|
keepalive?: boolean | undefined;
|
|
1018
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1019
1019
|
integrity?: string | undefined;
|
|
1020
1020
|
signal?: (AbortSignal | null) | undefined;
|
|
1021
1021
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1074,8 +1074,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1074
1074
|
mode?: undici_types.RequestMode | undefined;
|
|
1075
1075
|
method?: string | undefined;
|
|
1076
1076
|
headers?: any;
|
|
1077
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1078
1077
|
keepalive?: boolean | undefined;
|
|
1078
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1079
1079
|
integrity?: string | undefined;
|
|
1080
1080
|
signal?: (AbortSignal | null) | undefined;
|
|
1081
1081
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1137,8 +1137,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1137
1137
|
mode?: undici_types.RequestMode | undefined;
|
|
1138
1138
|
method?: string | undefined;
|
|
1139
1139
|
headers?: any;
|
|
1140
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1141
1140
|
keepalive?: boolean | undefined;
|
|
1141
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1142
1142
|
integrity?: string | undefined;
|
|
1143
1143
|
signal?: (AbortSignal | null) | undefined;
|
|
1144
1144
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1209,8 +1209,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1209
1209
|
mode?: undici_types.RequestMode | undefined;
|
|
1210
1210
|
method?: string | undefined;
|
|
1211
1211
|
headers?: any;
|
|
1212
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1213
1212
|
keepalive?: boolean | undefined;
|
|
1213
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1214
1214
|
integrity?: string | undefined;
|
|
1215
1215
|
signal?: (AbortSignal | null) | undefined;
|
|
1216
1216
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1267,8 +1267,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1267
1267
|
mode?: undici_types.RequestMode | undefined;
|
|
1268
1268
|
method?: string | undefined;
|
|
1269
1269
|
headers?: any;
|
|
1270
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1271
1270
|
keepalive?: boolean | undefined;
|
|
1271
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1272
1272
|
integrity?: string | undefined;
|
|
1273
1273
|
signal?: (AbortSignal | null) | undefined;
|
|
1274
1274
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1328,8 +1328,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1328
1328
|
mode?: undici_types.RequestMode | undefined;
|
|
1329
1329
|
method?: string | undefined;
|
|
1330
1330
|
headers?: any;
|
|
1331
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1332
1331
|
keepalive?: boolean | undefined;
|
|
1332
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1333
1333
|
integrity?: string | undefined;
|
|
1334
1334
|
signal?: (AbortSignal | null) | undefined;
|
|
1335
1335
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1393,8 +1393,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1393
1393
|
mode?: undici_types.RequestMode | undefined;
|
|
1394
1394
|
method?: string | undefined;
|
|
1395
1395
|
headers?: any;
|
|
1396
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1397
1396
|
keepalive?: boolean | undefined;
|
|
1397
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1398
1398
|
integrity?: string | undefined;
|
|
1399
1399
|
signal?: (AbortSignal | null) | undefined;
|
|
1400
1400
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1497,8 +1497,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1497
1497
|
mode?: undici_types.RequestMode | undefined;
|
|
1498
1498
|
method?: string | undefined;
|
|
1499
1499
|
headers?: any;
|
|
1500
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1501
1500
|
keepalive?: boolean | undefined;
|
|
1501
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1502
1502
|
integrity?: string | undefined;
|
|
1503
1503
|
signal?: (AbortSignal | null) | undefined;
|
|
1504
1504
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1556,8 +1556,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1556
1556
|
mode?: undici_types.RequestMode | undefined;
|
|
1557
1557
|
method?: string | undefined;
|
|
1558
1558
|
headers?: any;
|
|
1559
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1560
1559
|
keepalive?: boolean | undefined;
|
|
1560
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1561
1561
|
integrity?: string | undefined;
|
|
1562
1562
|
signal?: (AbortSignal | null) | undefined;
|
|
1563
1563
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1635,8 +1635,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1635
1635
|
mode?: undici_types.RequestMode | undefined;
|
|
1636
1636
|
method?: string | undefined;
|
|
1637
1637
|
headers?: any;
|
|
1638
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1639
1638
|
keepalive?: boolean | undefined;
|
|
1639
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1640
1640
|
integrity?: string | undefined;
|
|
1641
1641
|
signal?: (AbortSignal | null) | undefined;
|
|
1642
1642
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1698,8 +1698,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1698
1698
|
mode?: undici_types.RequestMode | undefined;
|
|
1699
1699
|
method?: string | undefined;
|
|
1700
1700
|
headers?: any;
|
|
1701
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1702
1701
|
keepalive?: boolean | undefined;
|
|
1702
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1703
1703
|
integrity?: string | undefined;
|
|
1704
1704
|
signal?: (AbortSignal | null) | undefined;
|
|
1705
1705
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1763,8 +1763,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1763
1763
|
mode?: undici_types.RequestMode | undefined;
|
|
1764
1764
|
method?: string | undefined;
|
|
1765
1765
|
headers?: any;
|
|
1766
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1767
1766
|
keepalive?: boolean | undefined;
|
|
1767
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1768
1768
|
integrity?: string | undefined;
|
|
1769
1769
|
signal?: (AbortSignal | null) | undefined;
|
|
1770
1770
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1839,8 +1839,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1839
1839
|
mode?: undici_types.RequestMode | undefined;
|
|
1840
1840
|
method?: string | undefined;
|
|
1841
1841
|
headers?: any;
|
|
1842
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1843
1842
|
keepalive?: boolean | undefined;
|
|
1843
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1844
1844
|
integrity?: string | undefined;
|
|
1845
1845
|
signal?: (AbortSignal | null) | undefined;
|
|
1846
1846
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1902,8 +1902,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1902
1902
|
mode?: undici_types.RequestMode | undefined;
|
|
1903
1903
|
method?: string | undefined;
|
|
1904
1904
|
headers?: any;
|
|
1905
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1906
1905
|
keepalive?: boolean | undefined;
|
|
1906
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1907
1907
|
integrity?: string | undefined;
|
|
1908
1908
|
signal?: (AbortSignal | null) | undefined;
|
|
1909
1909
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -1965,8 +1965,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
1965
1965
|
mode?: undici_types.RequestMode | undefined;
|
|
1966
1966
|
method?: string | undefined;
|
|
1967
1967
|
headers?: any;
|
|
1968
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
1969
1968
|
keepalive?: boolean | undefined;
|
|
1969
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
1970
1970
|
integrity?: string | undefined;
|
|
1971
1971
|
signal?: (AbortSignal | null) | undefined;
|
|
1972
1972
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2039,8 +2039,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2039
2039
|
mode?: undici_types.RequestMode | undefined;
|
|
2040
2040
|
method?: string | undefined;
|
|
2041
2041
|
headers?: any;
|
|
2042
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2043
2042
|
keepalive?: boolean | undefined;
|
|
2043
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2044
2044
|
integrity?: string | undefined;
|
|
2045
2045
|
signal?: (AbortSignal | null) | undefined;
|
|
2046
2046
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2106,8 +2106,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2106
2106
|
mode?: undici_types.RequestMode | undefined;
|
|
2107
2107
|
method?: string | undefined;
|
|
2108
2108
|
headers?: any;
|
|
2109
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2110
2109
|
keepalive?: boolean | undefined;
|
|
2110
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2111
2111
|
integrity?: string | undefined;
|
|
2112
2112
|
signal?: (AbortSignal | null) | undefined;
|
|
2113
2113
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2169,8 +2169,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2169
2169
|
mode?: undici_types.RequestMode | undefined;
|
|
2170
2170
|
method?: string | undefined;
|
|
2171
2171
|
headers?: any;
|
|
2172
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2173
2172
|
keepalive?: boolean | undefined;
|
|
2173
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2174
2174
|
integrity?: string | undefined;
|
|
2175
2175
|
signal?: (AbortSignal | null) | undefined;
|
|
2176
2176
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2233,8 +2233,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2233
2233
|
mode?: undici_types.RequestMode | undefined;
|
|
2234
2234
|
method?: string | undefined;
|
|
2235
2235
|
headers?: any;
|
|
2236
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2237
2236
|
keepalive?: boolean | undefined;
|
|
2237
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2238
2238
|
integrity?: string | undefined;
|
|
2239
2239
|
signal?: (AbortSignal | null) | undefined;
|
|
2240
2240
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2296,8 +2296,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2296
2296
|
mode?: undici_types.RequestMode | undefined;
|
|
2297
2297
|
method?: string | undefined;
|
|
2298
2298
|
headers?: any;
|
|
2299
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2300
2299
|
keepalive?: boolean | undefined;
|
|
2300
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2301
2301
|
integrity?: string | undefined;
|
|
2302
2302
|
signal?: (AbortSignal | null) | undefined;
|
|
2303
2303
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2357,8 +2357,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2357
2357
|
mode?: undici_types.RequestMode | undefined;
|
|
2358
2358
|
method?: string | undefined;
|
|
2359
2359
|
headers?: any;
|
|
2360
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2361
2360
|
keepalive?: boolean | undefined;
|
|
2361
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2362
2362
|
integrity?: string | undefined;
|
|
2363
2363
|
signal?: (AbortSignal | null) | undefined;
|
|
2364
2364
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2415,8 +2415,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2415
2415
|
mode?: undici_types.RequestMode | undefined;
|
|
2416
2416
|
method?: string | undefined;
|
|
2417
2417
|
headers?: any;
|
|
2418
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2419
2418
|
keepalive?: boolean | undefined;
|
|
2419
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2420
2420
|
integrity?: string | undefined;
|
|
2421
2421
|
signal?: (AbortSignal | null) | undefined;
|
|
2422
2422
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2473,8 +2473,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2473
2473
|
mode?: undici_types.RequestMode | undefined;
|
|
2474
2474
|
method?: string | undefined;
|
|
2475
2475
|
headers?: any;
|
|
2476
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2477
2476
|
keepalive?: boolean | undefined;
|
|
2477
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2478
2478
|
integrity?: string | undefined;
|
|
2479
2479
|
signal?: (AbortSignal | null) | undefined;
|
|
2480
2480
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2559,8 +2559,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2559
2559
|
mode?: undici_types.RequestMode | undefined;
|
|
2560
2560
|
method?: string | undefined;
|
|
2561
2561
|
headers?: any;
|
|
2562
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2563
2562
|
keepalive?: boolean | undefined;
|
|
2563
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2564
2564
|
integrity?: string | undefined;
|
|
2565
2565
|
signal?: (AbortSignal | null) | undefined;
|
|
2566
2566
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2623,8 +2623,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2623
2623
|
mode?: undici_types.RequestMode | undefined;
|
|
2624
2624
|
method?: string | undefined;
|
|
2625
2625
|
headers?: any;
|
|
2626
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2627
2626
|
keepalive?: boolean | undefined;
|
|
2627
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2628
2628
|
integrity?: string | undefined;
|
|
2629
2629
|
signal?: (AbortSignal | null) | undefined;
|
|
2630
2630
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2689,8 +2689,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2689
2689
|
mode?: undici_types.RequestMode | undefined;
|
|
2690
2690
|
method?: string | undefined;
|
|
2691
2691
|
headers?: any;
|
|
2692
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2693
2692
|
keepalive?: boolean | undefined;
|
|
2693
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2694
2694
|
integrity?: string | undefined;
|
|
2695
2695
|
signal?: (AbortSignal | null) | undefined;
|
|
2696
2696
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2752,8 +2752,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2752
2752
|
mode?: undici_types.RequestMode | undefined;
|
|
2753
2753
|
method?: string | undefined;
|
|
2754
2754
|
headers?: any;
|
|
2755
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2756
2755
|
keepalive?: boolean | undefined;
|
|
2756
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2757
2757
|
integrity?: string | undefined;
|
|
2758
2758
|
signal?: (AbortSignal | null) | undefined;
|
|
2759
2759
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2815,8 +2815,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2815
2815
|
mode?: undici_types.RequestMode | undefined;
|
|
2816
2816
|
method?: string | undefined;
|
|
2817
2817
|
headers?: any;
|
|
2818
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2819
2818
|
keepalive?: boolean | undefined;
|
|
2819
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2820
2820
|
integrity?: string | undefined;
|
|
2821
2821
|
signal?: (AbortSignal | null) | undefined;
|
|
2822
2822
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2883,8 +2883,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2883
2883
|
mode?: undici_types.RequestMode | undefined;
|
|
2884
2884
|
method?: string | undefined;
|
|
2885
2885
|
headers?: any;
|
|
2886
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2887
2886
|
keepalive?: boolean | undefined;
|
|
2887
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2888
2888
|
integrity?: string | undefined;
|
|
2889
2889
|
signal?: (AbortSignal | null) | undefined;
|
|
2890
2890
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -2946,8 +2946,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
2946
2946
|
mode?: undici_types.RequestMode | undefined;
|
|
2947
2947
|
method?: string | undefined;
|
|
2948
2948
|
headers?: any;
|
|
2949
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
2950
2949
|
keepalive?: boolean | undefined;
|
|
2950
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
2951
2951
|
integrity?: string | undefined;
|
|
2952
2952
|
signal?: (AbortSignal | null) | undefined;
|
|
2953
2953
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -3036,8 +3036,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
3036
3036
|
mode?: undici_types.RequestMode | undefined;
|
|
3037
3037
|
method?: string | undefined;
|
|
3038
3038
|
headers?: any;
|
|
3039
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
3040
3039
|
keepalive?: boolean | undefined;
|
|
3040
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
3041
3041
|
integrity?: string | undefined;
|
|
3042
3042
|
signal?: (AbortSignal | null) | undefined;
|
|
3043
3043
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -3098,8 +3098,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
3098
3098
|
mode?: undici_types.RequestMode | undefined;
|
|
3099
3099
|
method?: string | undefined;
|
|
3100
3100
|
headers?: any;
|
|
3101
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
3102
3101
|
keepalive?: boolean | undefined;
|
|
3102
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
3103
3103
|
integrity?: string | undefined;
|
|
3104
3104
|
signal?: (AbortSignal | null) | undefined;
|
|
3105
3105
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -3163,8 +3163,8 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
3163
3163
|
mode?: undici_types.RequestMode | undefined;
|
|
3164
3164
|
method?: string | undefined;
|
|
3165
3165
|
headers?: any;
|
|
3166
|
-
redirect?: undici_types.RequestRedirect | undefined;
|
|
3167
3166
|
keepalive?: boolean | undefined;
|
|
3167
|
+
redirect?: undici_types.RequestRedirect | undefined;
|
|
3168
3168
|
integrity?: string | undefined;
|
|
3169
3169
|
signal?: (AbortSignal | null) | undefined;
|
|
3170
3170
|
credentials?: undici_types.RequestCredentials | undefined;
|
|
@@ -3537,6 +3537,7 @@ declare const makeUsBetterAuthClient: (baseURL: string) => {
|
|
|
3537
3537
|
USER_ALREADY_HAS_PASSWORD: string;
|
|
3538
3538
|
};
|
|
3539
3539
|
};
|
|
3540
|
+
type AuthClient = ReturnType<typeof makeUsBetterAuthClient>;
|
|
3540
3541
|
|
|
3541
3542
|
type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;
|
|
3542
3543
|
declare const makeCheckoutClient: (baseURL: string, options?: ClientRequestOptions) => CheckoutClient;
|
|
@@ -3548,5 +3549,11 @@ declare function makeLoginUrl(apiUrl: string, redirectUrl?: string, appName?: st
|
|
|
3548
3549
|
declare function makeCheckoutUrl(apiUrl: string, priceId: string, productId: string, discountCode?: string, loginUrl?: string, pricingUrl?: string, successUrl?: string): string;
|
|
3549
3550
|
declare function makeRedirectIntent(redirectUrl: string, appName?: string): string;
|
|
3550
3551
|
|
|
3551
|
-
|
|
3552
|
-
|
|
3552
|
+
type SessionData = ReturnType<AuthClient["useSession"]>["data"];
|
|
3553
|
+
declare function hasUserPurchased(sessionData: SessionData, productId: string): boolean;
|
|
3554
|
+
declare function hasUserSubscribed(sessionData: SessionData, productId: string): boolean;
|
|
3555
|
+
|
|
3556
|
+
declare function formatPrice(amountStr: string, currencyCode: string): string | null;
|
|
3557
|
+
|
|
3558
|
+
export { formatPrice, hasUserPurchased, hasUserSubscribed, makeAppClient, makeCheckoutClient, makeCheckoutUrl, makeLoginUrl, makeMailingListClient, makePublicClient, makeRedirectIntent, makeUsBetterAuthClient };
|
|
3559
|
+
export type { AppClient, AuthClient, CheckoutClient, MailingListClient, PublicClient, SessionData };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uninspired/auth-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Auth client for Uninspired Studio Products",
|
|
5
5
|
"author": "Chris Kolb <chris@uninspired.studio>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/bun": "latest",
|
|
20
|
+
"@types/semver": "^7.7.1",
|
|
20
21
|
"@us-accounts/api": "workspace:*",
|
|
21
22
|
"@us-accounts/utils": "workspace:*",
|
|
22
23
|
"rollup": "^4.52.5",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"better-auth": "^1.3.12",
|
|
33
|
-
"hono": "^4.9.8"
|
|
34
|
+
"hono": "^4.9.8",
|
|
35
|
+
"zod": "^4"
|
|
34
36
|
}
|
|
35
37
|
}
|