deesse 0.1.11 → 0.1.13

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,4 +1,4 @@
1
- export declare const createAuthClient: () => {
1
+ export declare const authClient: {
2
2
  signOut: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
3
3
  query?: Record<string, any> | undefined;
4
4
  fetchOptions?: FetchOptions | undefined;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAuthClient = void 0;
3
+ exports.authClient = void 0;
4
4
  const react_1 = require("better-auth/react");
5
- const createAuthClient = () => (0, react_1.createAuthClient)();
6
- exports.createAuthClient = createAuthClient;
5
+ exports.authClient = (0, react_1.createAuthClient)();
@@ -0,0 +1,5 @@
1
+ import { Page, SidebarGroup, SidebarMenu, SidebarSubmenu } from "./types";
2
+ export declare const sidebarGroup: (group: SidebarGroup) => SidebarGroup;
3
+ export declare const sidebarMenu: (menu: SidebarMenu) => SidebarMenu;
4
+ export declare const sidebarSubmenu: (submenu: SidebarSubmenu) => SidebarSubmenu;
5
+ export declare const page: (page: Page) => Page;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.page = exports.sidebarSubmenu = exports.sidebarMenu = exports.sidebarGroup = void 0;
4
+ const sidebarGroup = (group) => {
5
+ return group;
6
+ };
7
+ exports.sidebarGroup = sidebarGroup;
8
+ const sidebarMenu = (menu) => {
9
+ return menu;
10
+ };
11
+ exports.sidebarMenu = sidebarMenu;
12
+ const sidebarSubmenu = (submenu) => {
13
+ return submenu;
14
+ };
15
+ exports.sidebarSubmenu = sidebarSubmenu;
16
+ const page = (page) => {
17
+ return page;
18
+ };
19
+ exports.page = page;
@@ -0,0 +1,17 @@
1
+ export type SidebarGroup = {
2
+ label: string;
3
+ collapsible: boolean;
4
+ children: SidebarMenu[];
5
+ };
6
+ export type SidebarMenu = {
7
+ children: (SidebarSubmenu | Page)[];
8
+ };
9
+ export type SidebarSubmenu = {
10
+ children: Page[];
11
+ };
12
+ export type Page = {
13
+ label: string;
14
+ href: string;
15
+ icon: React.ReactNode;
16
+ content: React.ReactNode;
17
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { Plugin, PluginConfig } from "./types";
2
+ export declare const plugin: (config: PluginConfig) => (() => Plugin);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.plugin = void 0;
4
+ const plugin = (config) => {
5
+ return () => config;
6
+ };
7
+ exports.plugin = plugin;
@@ -0,0 +1,8 @@
1
+ import { SidebarGroup, SidebarMenu } from "./admin/types";
2
+ export type PluginConfig = {
3
+ label: string;
4
+ admin?: {
5
+ sidebar: (SidebarGroup | SidebarMenu)[];
6
+ };
7
+ };
8
+ export type Plugin = PluginConfig;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deesse",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "The fullstack web framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,12 +40,16 @@
40
40
  "better-auth": "^1.4.3",
41
41
  "pg": "^8.16.3"
42
42
  },
43
+ "peerDependencies": {
44
+ "react": "^19.2.3"
45
+ },
43
46
  "devDependencies": {
44
47
  "@testing-library/dom": "^10.4.1",
45
48
  "@testing-library/user-event": "^14.6.1",
46
49
  "@types/jsdom": "^27.0.0",
47
50
  "@types/node": "^20.0.0",
48
51
  "@types/pg": "^8.15.6",
52
+ "@types/react": "^19.2.7",
49
53
  "@types/sinon": "^21.0.0",
50
54
  "@typescript-eslint/eslint-plugin": "^6.0.0",
51
55
  "@typescript-eslint/parser": "^6.0.0",
@@ -55,6 +59,7 @@
55
59
  "drizzle-orm": "^0.45.0",
56
60
  "eslint": "^8.0.0",
57
61
  "jsdom": "^27.2.0",
62
+ "react": "^19.2.3",
58
63
  "sinon": "^21.0.0",
59
64
  "typescript": "^5.0.0",
60
65
  "vitest": "^4.0.13"
@@ -1,688 +0,0 @@
1
- export declare const createAuthClient: () => {
2
- signIn: {
3
- social: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
4
- provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
5
- callbackURL?: string | undefined;
6
- newUserCallbackURL?: string | undefined;
7
- errorCallbackURL?: string | undefined;
8
- disableRedirect?: boolean | undefined;
9
- idToken?: {
10
- token: string;
11
- nonce?: string | undefined;
12
- accessToken?: string | undefined;
13
- refreshToken?: string | undefined;
14
- expiresAt?: number | undefined;
15
- } | undefined;
16
- scopes?: string[] | undefined;
17
- requestSignUp?: boolean | undefined;
18
- loginHint?: string | undefined;
19
- additionalData?: Record<string, any> | undefined;
20
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
21
- provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
22
- callbackURL?: string | undefined;
23
- newUserCallbackURL?: string | undefined;
24
- errorCallbackURL?: string | undefined;
25
- disableRedirect?: boolean | undefined;
26
- idToken?: {
27
- token: string;
28
- nonce?: string | undefined;
29
- accessToken?: string | undefined;
30
- refreshToken?: string | undefined;
31
- expiresAt?: number | undefined;
32
- } | undefined;
33
- scopes?: string[] | undefined;
34
- requestSignUp?: boolean | undefined;
35
- loginHint?: string | undefined;
36
- additionalData?: Record<string, any> | undefined;
37
- } & {
38
- fetchOptions?: FetchOptions | undefined;
39
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
40
- redirect: boolean;
41
- url: string;
42
- } | {
43
- redirect: boolean;
44
- token: string;
45
- url: undefined;
46
- user: {
47
- id: string;
48
- createdAt: Date;
49
- updatedAt: Date;
50
- email: string;
51
- emailVerified: boolean;
52
- name: string;
53
- image?: string | null | undefined | undefined;
54
- };
55
- }>, {
56
- code?: string | undefined;
57
- message?: string | undefined;
58
- }, FetchOptions["throw"] extends true ? true : false>>;
59
- };
60
- } & {
61
- signOut: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
62
- query?: Record<string, any> | undefined;
63
- fetchOptions?: FetchOptions | undefined;
64
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
65
- success: boolean;
66
- }, {
67
- code?: string | undefined;
68
- message?: string | undefined;
69
- }, FetchOptions["throw"] extends true ? true : false>>;
70
- } & {
71
- signUp: {
72
- email: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
73
- name: string;
74
- email: string;
75
- password: string;
76
- image?: string | undefined;
77
- callbackURL?: string | undefined;
78
- rememberMe?: boolean | undefined;
79
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
80
- email: string;
81
- name: string;
82
- password: string;
83
- image?: string | undefined;
84
- callbackURL?: string | undefined;
85
- fetchOptions?: FetchOptions | undefined;
86
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
87
- token: null;
88
- user: {
89
- id: string;
90
- createdAt: Date;
91
- updatedAt: Date;
92
- email: string;
93
- emailVerified: boolean;
94
- name: string;
95
- image?: string | null | undefined | undefined;
96
- };
97
- } | {
98
- token: string;
99
- user: {
100
- id: string;
101
- createdAt: Date;
102
- updatedAt: Date;
103
- email: string;
104
- emailVerified: boolean;
105
- name: string;
106
- image?: string | null | undefined | undefined;
107
- };
108
- }>, {
109
- code?: string | undefined;
110
- message?: string | undefined;
111
- }, FetchOptions["throw"] extends true ? true : false>>;
112
- };
113
- } & {
114
- signIn: {
115
- email: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
116
- email: string;
117
- password: string;
118
- callbackURL?: string | undefined;
119
- rememberMe?: boolean | undefined;
120
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
121
- email: string;
122
- password: string;
123
- callbackURL?: string | undefined;
124
- rememberMe?: boolean | undefined;
125
- } & {
126
- fetchOptions?: FetchOptions | undefined;
127
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
128
- redirect: boolean;
129
- token: string;
130
- url?: string | undefined;
131
- user: {
132
- id: string;
133
- createdAt: Date;
134
- updatedAt: Date;
135
- email: string;
136
- emailVerified: boolean;
137
- name: string;
138
- image?: string | null | undefined | undefined;
139
- };
140
- }, {
141
- code?: string | undefined;
142
- message?: string | undefined;
143
- }, FetchOptions["throw"] extends true ? true : false>>;
144
- };
145
- } & {
146
- resetPassword: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
147
- newPassword: string;
148
- token?: string | undefined;
149
- }> & Record<string, any>, Partial<{
150
- token?: string | undefined;
151
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
152
- newPassword: string;
153
- token?: string | undefined;
154
- } & {
155
- fetchOptions?: FetchOptions | undefined;
156
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
157
- status: boolean;
158
- }, {
159
- code?: string | undefined;
160
- message?: string | undefined;
161
- }, FetchOptions["throw"] extends true ? true : false>>;
162
- } & {
163
- verifyEmail: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<{
164
- token: string;
165
- callbackURL?: string | undefined;
166
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
167
- query: {
168
- token: string;
169
- callbackURL?: string | undefined;
170
- };
171
- fetchOptions?: FetchOptions | undefined;
172
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<void | {
173
- status: boolean;
174
- }>, {
175
- code?: string | undefined;
176
- message?: string | undefined;
177
- }, FetchOptions["throw"] extends true ? true : false>>;
178
- } & {
179
- sendVerificationEmail: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
180
- email: string;
181
- callbackURL?: string | undefined;
182
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
183
- email: string;
184
- callbackURL?: string | undefined;
185
- } & {
186
- fetchOptions?: FetchOptions | undefined;
187
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
188
- status: boolean;
189
- }, {
190
- code?: string | undefined;
191
- message?: string | undefined;
192
- }, FetchOptions["throw"] extends true ? true : false>>;
193
- } & {
194
- changeEmail: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
195
- newEmail: string;
196
- callbackURL?: string | undefined;
197
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
198
- newEmail: string;
199
- callbackURL?: string | undefined;
200
- } & {
201
- fetchOptions?: FetchOptions | undefined;
202
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
203
- status: boolean;
204
- }, {
205
- code?: string | undefined;
206
- message?: string | undefined;
207
- }, FetchOptions["throw"] extends true ? true : false>>;
208
- } & {
209
- changePassword: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
210
- newPassword: string;
211
- currentPassword: string;
212
- revokeOtherSessions?: boolean | undefined;
213
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
214
- newPassword: string;
215
- currentPassword: string;
216
- revokeOtherSessions?: boolean | undefined;
217
- } & {
218
- fetchOptions?: FetchOptions | undefined;
219
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
220
- token: string | null;
221
- user: {
222
- id: string;
223
- email: string;
224
- name: string;
225
- image: string | null | undefined;
226
- emailVerified: boolean;
227
- createdAt: Date;
228
- updatedAt: Date;
229
- };
230
- }, {
231
- code?: string | undefined;
232
- message?: string | undefined;
233
- }, FetchOptions["throw"] extends true ? true : false>>;
234
- } & {
235
- updateUser: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<Partial<{}> & {
236
- name?: string | undefined;
237
- image?: string | undefined;
238
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
239
- image?: (string | null) | undefined;
240
- name?: string | undefined;
241
- fetchOptions?: FetchOptions | undefined;
242
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
243
- status: boolean;
244
- }, {
245
- code?: string | undefined;
246
- message?: string | undefined;
247
- }, FetchOptions["throw"] extends true ? true : false>>;
248
- } & {
249
- deleteUser: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
250
- callbackURL?: string | undefined;
251
- password?: string | undefined;
252
- token?: string | undefined;
253
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
254
- callbackURL?: string | undefined;
255
- password?: string | undefined;
256
- token?: string | undefined;
257
- } & {
258
- fetchOptions?: FetchOptions | undefined;
259
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
260
- success: boolean;
261
- message: string;
262
- }, {
263
- code?: string | undefined;
264
- message?: string | undefined;
265
- }, FetchOptions["throw"] extends true ? true : false>>;
266
- } & {
267
- requestPasswordReset: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
268
- email: string;
269
- redirectTo?: string | undefined;
270
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
271
- email: string;
272
- redirectTo?: string | undefined;
273
- } & {
274
- fetchOptions?: FetchOptions | undefined;
275
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
276
- status: boolean;
277
- message: string;
278
- }, {
279
- code?: string | undefined;
280
- message?: string | undefined;
281
- }, FetchOptions["throw"] extends true ? true : false>>;
282
- } & {
283
- resetPassword: {
284
- ":token": <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<{
285
- callbackURL: string;
286
- }> & Record<string, any>, {
287
- token: string;
288
- }>>(data_0: import("better-auth/react").Prettify<{
289
- query: {
290
- callbackURL: string;
291
- };
292
- fetchOptions?: FetchOptions | undefined;
293
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
294
- code?: string | undefined;
295
- message?: string | undefined;
296
- }, FetchOptions["throw"] extends true ? true : false>>;
297
- };
298
- } & {
299
- listSessions: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
300
- query?: Record<string, any> | undefined;
301
- fetchOptions?: FetchOptions | undefined;
302
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth/react").Prettify<{
303
- id: string;
304
- createdAt: Date;
305
- updatedAt: Date;
306
- userId: string;
307
- expiresAt: Date;
308
- token: string;
309
- ipAddress?: string | null | undefined | undefined;
310
- userAgent?: string | null | undefined | undefined;
311
- }>[], {
312
- code?: string | undefined;
313
- message?: string | undefined;
314
- }, FetchOptions["throw"] extends true ? true : false>>;
315
- } & {
316
- revokeSession: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
317
- token: string;
318
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
319
- token: string;
320
- } & {
321
- fetchOptions?: FetchOptions | undefined;
322
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
323
- status: boolean;
324
- }, {
325
- code?: string | undefined;
326
- message?: string | undefined;
327
- }, FetchOptions["throw"] extends true ? true : false>>;
328
- } & {
329
- revokeSessions: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
330
- query?: Record<string, any> | undefined;
331
- fetchOptions?: FetchOptions | undefined;
332
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
333
- status: boolean;
334
- }, {
335
- code?: string | undefined;
336
- message?: string | undefined;
337
- }, FetchOptions["throw"] extends true ? true : false>>;
338
- } & {
339
- revokeOtherSessions: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
340
- query?: Record<string, any> | undefined;
341
- fetchOptions?: FetchOptions | undefined;
342
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
343
- status: boolean;
344
- }, {
345
- code?: string | undefined;
346
- message?: string | undefined;
347
- }, FetchOptions["throw"] extends true ? true : false>>;
348
- } & {
349
- linkSocial: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
350
- provider: unknown;
351
- callbackURL?: string | undefined;
352
- idToken?: {
353
- token: string;
354
- nonce?: string | undefined;
355
- accessToken?: string | undefined;
356
- refreshToken?: string | undefined;
357
- scopes?: string[] | undefined;
358
- } | undefined;
359
- requestSignUp?: boolean | undefined;
360
- scopes?: string[] | undefined;
361
- errorCallbackURL?: string | undefined;
362
- disableRedirect?: boolean | undefined;
363
- additionalData?: Record<string, any> | undefined;
364
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
365
- provider: unknown;
366
- callbackURL?: string | undefined;
367
- idToken?: {
368
- token: string;
369
- nonce?: string | undefined;
370
- accessToken?: string | undefined;
371
- refreshToken?: string | undefined;
372
- scopes?: string[] | undefined;
373
- } | undefined;
374
- requestSignUp?: boolean | undefined;
375
- scopes?: string[] | undefined;
376
- errorCallbackURL?: string | undefined;
377
- disableRedirect?: boolean | undefined;
378
- additionalData?: Record<string, any> | undefined;
379
- } & {
380
- fetchOptions?: FetchOptions | undefined;
381
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
382
- url: string;
383
- redirect: boolean;
384
- }, {
385
- code?: string | undefined;
386
- message?: string | undefined;
387
- }, FetchOptions["throw"] extends true ? true : false>>;
388
- } & {
389
- listAccounts: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
390
- query?: Record<string, any> | undefined;
391
- fetchOptions?: FetchOptions | undefined;
392
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
393
- id: string;
394
- providerId: string;
395
- createdAt: Date;
396
- updatedAt: Date;
397
- accountId: string;
398
- userId: string;
399
- scopes: string[];
400
- }[], {
401
- code?: string | undefined;
402
- message?: string | undefined;
403
- }, FetchOptions["throw"] extends true ? true : false>>;
404
- } & {
405
- deleteUser: {
406
- callback: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<{
407
- token: string;
408
- callbackURL?: string | undefined;
409
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
410
- query: {
411
- token: string;
412
- callbackURL?: string | undefined;
413
- };
414
- fetchOptions?: FetchOptions | undefined;
415
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
416
- success: boolean;
417
- message: string;
418
- }, {
419
- code?: string | undefined;
420
- message?: string | undefined;
421
- }, FetchOptions["throw"] extends true ? true : false>>;
422
- };
423
- } & {
424
- unlinkAccount: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
425
- providerId: string;
426
- accountId?: string | undefined;
427
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
428
- providerId: string;
429
- accountId?: string | undefined;
430
- } & {
431
- fetchOptions?: FetchOptions | undefined;
432
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
433
- status: boolean;
434
- }, {
435
- code?: string | undefined;
436
- message?: string | undefined;
437
- }, FetchOptions["throw"] extends true ? true : false>>;
438
- } & {
439
- refreshToken: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
440
- providerId: string;
441
- accountId?: string | undefined;
442
- userId?: string | undefined;
443
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
444
- providerId: string;
445
- accountId?: string | undefined;
446
- userId?: string | undefined;
447
- } & {
448
- fetchOptions?: FetchOptions | undefined;
449
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
450
- accessToken: string | undefined;
451
- refreshToken: string | undefined;
452
- accessTokenExpiresAt: Date | undefined;
453
- refreshTokenExpiresAt: Date | undefined;
454
- scope: string | null | undefined;
455
- idToken: string | null | undefined;
456
- providerId: string;
457
- accountId: string;
458
- }, {
459
- code?: string | undefined;
460
- message?: string | undefined;
461
- }, FetchOptions["throw"] extends true ? true : false>>;
462
- } & {
463
- getAccessToken: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
464
- providerId: string;
465
- accountId?: string | undefined;
466
- userId?: string | undefined;
467
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
468
- providerId: string;
469
- accountId?: string | undefined;
470
- userId?: string | undefined;
471
- } & {
472
- fetchOptions?: FetchOptions | undefined;
473
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
474
- accessToken: string;
475
- accessTokenExpiresAt: Date | undefined;
476
- scopes: string[];
477
- idToken: string | undefined;
478
- }, {
479
- code?: string | undefined;
480
- message?: string | undefined;
481
- }, FetchOptions["throw"] extends true ? true : false>>;
482
- } & {
483
- accountInfo: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<{
484
- accountId?: string | undefined;
485
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
486
- query?: {
487
- accountId?: string | undefined;
488
- } | undefined;
489
- fetchOptions?: FetchOptions | undefined;
490
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
491
- user: import("better-auth/*").OAuth2UserInfo;
492
- data: Record<string, any>;
493
- }, {
494
- code?: string | undefined;
495
- message?: string | undefined;
496
- }, FetchOptions["throw"] extends true ? true : false>>;
497
- } & {
498
- getSession: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<{
499
- disableCookieCache?: unknown;
500
- disableRefresh?: unknown;
501
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
502
- query?: {
503
- disableCookieCache?: unknown;
504
- disableRefresh?: unknown;
505
- } | undefined;
506
- fetchOptions?: FetchOptions | undefined;
507
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
508
- user: {
509
- id: string;
510
- createdAt: Date;
511
- updatedAt: Date;
512
- email: string;
513
- emailVerified: boolean;
514
- name: string;
515
- image?: string | null | undefined;
516
- };
517
- session: {
518
- id: string;
519
- createdAt: Date;
520
- updatedAt: Date;
521
- userId: string;
522
- expiresAt: Date;
523
- token: string;
524
- ipAddress?: string | null | undefined;
525
- userAgent?: string | null | undefined;
526
- };
527
- } | null, {
528
- code?: string | undefined;
529
- message?: string | undefined;
530
- }, FetchOptions["throw"] extends true ? true : false>>;
531
- } & {
532
- useSession: () => {
533
- data: {
534
- user: {
535
- id: string;
536
- createdAt: Date;
537
- updatedAt: Date;
538
- email: string;
539
- emailVerified: boolean;
540
- name: string;
541
- image?: string | null | undefined;
542
- };
543
- session: {
544
- id: string;
545
- createdAt: Date;
546
- updatedAt: Date;
547
- userId: string;
548
- expiresAt: Date;
549
- token: string;
550
- ipAddress?: string | null | undefined;
551
- userAgent?: string | null | undefined;
552
- };
553
- } | null;
554
- isPending: boolean;
555
- isRefetching: boolean;
556
- error: import("@better-fetch/fetch").BetterFetchError | null;
557
- refetch: (queryParams?: {
558
- query?: import("better-auth/*").SessionQueryParams;
559
- } | undefined) => Promise<void>;
560
- };
561
- $Infer: {
562
- Session: {
563
- user: {
564
- id: string;
565
- createdAt: Date;
566
- updatedAt: Date;
567
- email: string;
568
- emailVerified: boolean;
569
- name: string;
570
- image?: string | null | undefined;
571
- };
572
- session: {
573
- id: string;
574
- createdAt: Date;
575
- updatedAt: Date;
576
- userId: string;
577
- expiresAt: Date;
578
- token: string;
579
- ipAddress?: string | null | undefined;
580
- userAgent?: string | null | undefined;
581
- };
582
- };
583
- };
584
- $fetch: import("@better-fetch/fetch").BetterFetch<{
585
- plugins: (import("@better-fetch/fetch").BetterFetchPlugin | {
586
- id: string;
587
- name: string;
588
- hooks: {
589
- onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
590
- };
591
- } | {
592
- id: string;
593
- name: string;
594
- hooks: {
595
- onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): void;
596
- };
597
- } | {
598
- id: string;
599
- name: string;
600
- hooks: {
601
- onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
602
- onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
603
- 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;
604
- onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
605
- };
606
- })[];
607
- cache?: RequestCache | undefined;
608
- method: string;
609
- headers?: (HeadersInit & (HeadersInit | {
610
- accept: "application/json" | "text/plain" | "application/octet-stream";
611
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
612
- authorization: "Bearer" | "Basic";
613
- })) | undefined;
614
- redirect?: RequestRedirect | undefined;
615
- credentials?: RequestCredentials;
616
- integrity?: string | undefined;
617
- keepalive?: boolean | undefined;
618
- mode?: RequestMode | undefined;
619
- priority?: RequestPriority | undefined;
620
- referrer?: string | undefined;
621
- referrerPolicy?: ReferrerPolicy | undefined;
622
- signal?: (AbortSignal | null) | undefined;
623
- window?: null | undefined;
624
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
625
- hookOptions?: {
626
- cloneResponse?: boolean;
627
- } | undefined;
628
- timeout?: number | undefined;
629
- customFetchImpl: import("@better-fetch/fetch").FetchEsque;
630
- baseURL: string;
631
- throw?: boolean | undefined;
632
- auth?: ({
633
- type: "Bearer";
634
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
635
- } | {
636
- type: "Basic";
637
- username: string | (() => string | undefined) | undefined;
638
- password: string | (() => string | undefined) | undefined;
639
- } | {
640
- type: "Custom";
641
- prefix: string | (() => string | undefined) | undefined;
642
- value: string | (() => string | undefined) | undefined;
643
- }) | undefined;
644
- body?: any;
645
- query?: any;
646
- params?: any;
647
- duplex?: "full" | "half" | undefined;
648
- jsonParser: (text: string) => Promise<any> | any;
649
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
650
- retryAttempt?: number | undefined;
651
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
652
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
653
- disableValidation?: boolean | undefined;
654
- disableSignal?: boolean | undefined;
655
- }, unknown, unknown, {}>;
656
- $store: {
657
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
658
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
659
- atoms: Record<string, import("nanostores/atom").WritableAtom<any>>;
660
- };
661
- $ERROR_CODES: {
662
- readonly USER_NOT_FOUND: "User not found";
663
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
664
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
665
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
666
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
667
- readonly INVALID_PASSWORD: "Invalid password";
668
- readonly INVALID_EMAIL: "Invalid email";
669
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
670
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
671
- readonly PROVIDER_NOT_FOUND: "Provider not found";
672
- readonly INVALID_TOKEN: "Invalid token";
673
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
674
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
675
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
676
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
677
- readonly PASSWORD_TOO_SHORT: "Password too short";
678
- readonly PASSWORD_TOO_LONG: "Password too long";
679
- readonly USER_ALREADY_EXISTS: "User already exists.";
680
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
681
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
682
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
683
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
684
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
685
- readonly ACCOUNT_NOT_FOUND: "Account not found";
686
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
687
- };
688
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAuthClient = void 0;
4
- const react_1 = require("better-auth/react");
5
- const createAuthClient = () => (0, react_1.createAuthClient)();
6
- exports.createAuthClient = createAuthClient;