zitejs 0.10.0-start.20 → 0.10.0-start.21

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.
Files changed (60) hide show
  1. package/dist/cjs/auth/actions.d.ts +28 -0
  2. package/dist/cjs/auth/actions.js +93 -0
  3. package/dist/cjs/auth/client.d.ts +357 -0
  4. package/dist/cjs/auth/client.js +66 -0
  5. package/dist/cjs/auth/index.d.ts +2 -249
  6. package/dist/cjs/auth/index.js +11 -114
  7. package/dist/cjs/auth/index.test.js +18 -0
  8. package/dist/cjs/auth/profileUpdates.d.ts +9 -0
  9. package/dist/cjs/auth/profileUpdates.js +11 -0
  10. package/dist/cjs/check/start/sourceRules.js +70 -21
  11. package/dist/cjs/integrations/rules.js +5 -3
  12. package/dist/cjs/runtime/index.d.ts +54 -15
  13. package/dist/cjs/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
  14. package/dist/cjs/runtime/sendEmailParamsTypes.test-d.js +33 -0
  15. package/dist/cjs/sync/lib.js +10 -5
  16. package/dist/cjs/sync/lib.test.js +10 -0
  17. package/dist/esm/auth/actions.d.ts +28 -0
  18. package/dist/esm/auth/actions.js +55 -0
  19. package/dist/esm/auth/client.d.ts +357 -0
  20. package/dist/esm/auth/client.js +62 -0
  21. package/dist/esm/auth/index.d.ts +2 -249
  22. package/dist/esm/auth/index.js +2 -109
  23. package/dist/esm/auth/index.test.js +18 -0
  24. package/dist/esm/auth/profileUpdates.d.ts +9 -0
  25. package/dist/esm/auth/profileUpdates.js +6 -0
  26. package/dist/esm/check/start/sourceRules.js +70 -21
  27. package/dist/esm/integrations/rules.js +5 -3
  28. package/dist/esm/runtime/index.d.ts +54 -15
  29. package/dist/esm/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
  30. package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +31 -0
  31. package/dist/esm/start/airtable/dispatch.js +3 -3
  32. package/dist/esm/start/airtable/formulas.d.ts +1 -1
  33. package/dist/esm/start/airtable/formulas.js +12 -10
  34. package/dist/esm/start/airtable/index.d.ts +2 -2
  35. package/dist/esm/start/describe.d.ts +8 -1
  36. package/dist/esm/start/describe.js +5 -3
  37. package/dist/esm/start/factories.test-d.d.ts +2 -1
  38. package/dist/esm/start/host.d.ts +2 -2
  39. package/dist/esm/start/index.d.ts +1 -1
  40. package/dist/esm/start/index.js +4 -2
  41. package/dist/esm/start/outbound.d.ts +2 -2
  42. package/dist/esm/start/outbound.js +3 -1
  43. package/dist/esm/start/router.d.ts +7 -0
  44. package/dist/esm/start/router.js +35 -0
  45. package/dist/esm/start/runLog.d.ts +2 -2
  46. package/dist/esm/start/scope.d.ts +3 -3
  47. package/dist/esm/start/server.d.ts +3 -3
  48. package/dist/esm/start/server.js +2 -1
  49. package/dist/esm/start/types.d.ts +1 -1
  50. package/dist/esm/start/version.d.ts +1 -1
  51. package/dist/esm/start/version.js +1 -1
  52. package/dist/esm/start/vite.js +3 -3
  53. package/dist/esm/start/workflow.d.ts +6 -2
  54. package/dist/esm/start/workflow.js +9 -2
  55. package/dist/esm/start/workflow.test-d.js +10 -1
  56. package/dist/esm/start/workflowRun.d.ts +5 -0
  57. package/dist/esm/start/workflowRun.js +11 -1
  58. package/dist/esm/sync/lib.js +10 -5
  59. package/dist/esm/sync/lib.test.js +10 -0
  60. package/package.json +1 -1
@@ -48,9 +48,9 @@ export type FilterOperators<V> = FilterCondition<V> | V;
48
48
  * object, the whole `{ equals: … }` is taken as the value, and the filter
49
49
  * fails.
50
50
  *
51
- * One operator per field on this path — `formulas.ts` reads
52
- * `Object.keys(condition)[0]` and drops the rest, unlike the Zite DB filter
53
- * builder which iterates them all.
51
+ * One operator per field on this path — `formulas.ts` reads the first key that
52
+ * is an operator and drops the rest, unlike the Zite DB filter builder which
53
+ * iterates them all.
54
54
  */
55
55
  export type AirtableFilterCondition<V> = FilterCondition<V> & {
56
56
  ilike?: V | V[];
@@ -257,7 +257,7 @@ export interface AirtableTableClient<T, TInput = T> {
257
257
  }): Promise<DeleteResult>;
258
258
  }
259
259
  export declare function createAirtableClient<T, TInput = T>(integrationId: string, className: string, implicitParams: Record<string, unknown>): AirtableTableClient<T, TInput>;
260
- /** A block of content in an email body. */
260
+ /** A block of the older `body` format. New emails are written with `html`. */
261
261
  export type EmailBlock = {
262
262
  type: "text";
263
263
  content: string;
@@ -266,11 +266,11 @@ export type EmailBlock = {
266
266
  label: string;
267
267
  href: string;
268
268
  alignment?: "left" | "center" | "right";
269
- /** A hex or `rgb()` color; defaults to the platform's button color. */
269
+ /** Hex colour, e.g. "#7c2d3a". Defaults to the platform blue. */
270
270
  backgroundColor?: string;
271
- /** A hex or `rgb()` color; defaults to white. */
271
+ /** Hex colour. Defaults to white. */
272
272
  textColor?: string;
273
- /** Corner radius in pixels; defaults to 6. */
273
+ /** Corner radius in pixels. Defaults to 6. */
274
274
  borderRadius?: number;
275
275
  } | {
276
276
  type: "image";
@@ -286,25 +286,23 @@ export type EmailBlock = {
286
286
  type: "divider";
287
287
  borderColor?: string;
288
288
  };
289
- export interface SendEmailParams {
289
+ interface SendEmailBaseParams {
290
290
  /** Recipient address(es). Must be valid emails — never placeholders like "me". */
291
291
  to: string | string[];
292
292
  subject: string;
293
- /** Email body as an array of content blocks. */
294
- body: EmailBlock[];
295
293
  cc?: string[];
296
294
  bcc?: string[];
297
295
  replyTo?: string;
298
- /** 'formatted' (default) for styled HTML, 'plain' for text-only. */
299
- layout?: "formatted" | "plain";
300
296
  /**
301
297
  * Text direction of the email. Use 'rtl' for right-to-left languages
302
298
  * (Hebrew, Arabic) — sets dir="rtl" on the email wrapper and right-aligns
303
- * text blocks. HTML like `<div dir="rtl">` inside text blocks is stripped
304
- * by the sanitizer and will NOT work. Defaults to 'ltr'.
299
+ * text. Defaults to 'ltr'.
305
300
  */
306
301
  direction?: "ltr" | "rtl";
307
- /** Custom logo shown above the email content (header area), for branding. */
302
+ /**
303
+ * Logo shown above the email content (header area), for branding. On an
304
+ * html email it replaces the brand kit's logo.
305
+ */
308
306
  logo?: {
309
307
  url: string;
310
308
  width?: number;
@@ -317,9 +315,50 @@ export interface SendEmailParams {
317
315
  contentType?: string;
318
316
  }[];
319
317
  }
318
+ /** An email written as HTML. */
319
+ export interface SendHtmlEmailParams extends SendEmailBaseParams {
320
+ /**
321
+ * Email-safe HTML: tables for layout, inline styles, `<a class="button">`
322
+ * for buttons. Sanitized and its `<style>` rules inlined at send time.
323
+ */
324
+ html: string;
325
+ /** Plain-text part. Generated from `html` when omitted. */
326
+ text?: string;
327
+ /**
328
+ * 'formatted' (default) puts the html in a card under the logo, in the
329
+ * app's brand kit; 'plain' drops the card and logo.
330
+ */
331
+ layout?: "formatted" | "plain";
332
+ /**
333
+ * Hex colour around the card, or behind a plain email's text as a sheet
334
+ * the width of its column. Defaults to the brand kit's.
335
+ */
336
+ background?: string;
337
+ /** Hex colour of the card in a formatted email. Defaults to the brand kit's. */
338
+ cardBackground?: string;
339
+ body?: never;
340
+ }
341
+ /**
342
+ * An email in the older block format. Existing emails keep working; new ones
343
+ * are written with `html`.
344
+ */
345
+ export interface SendBlocksEmailParams extends SendEmailBaseParams {
346
+ /** Email body as an array of content blocks. */
347
+ body: EmailBlock[];
348
+ /**
349
+ * 'formatted' (default) for styled HTML, 'plain' for text-only. HTML like
350
+ * `<div dir="rtl">` inside text blocks is stripped by the sanitizer.
351
+ */
352
+ layout?: "formatted" | "plain";
353
+ html?: never;
354
+ text?: never;
355
+ }
356
+ export type SendEmailParams = SendHtmlEmailParams | SendBlocksEmailParams;
320
357
  export interface SendEmailResult {
321
358
  success: boolean;
322
359
  messageId: string;
360
+ /** Problems that did not stop the send, e.g. an email large enough for Gmail to clip. */
361
+ warnings?: string[];
323
362
  }
324
363
  export interface EmailClient {
325
364
  send(params: SendEmailParams): Promise<SendEmailResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ (0, vitest_1.test)("an email is written as html or as blocks, not both", () => {
5
+ (0, vitest_1.expectTypeOf)({
6
+ to: "a@example.com",
7
+ subject: "Hi",
8
+ html: "<p>Hi</p>",
9
+ layout: "plain",
10
+ background: "#e8efe6",
11
+ }).toExtend();
12
+ (0, vitest_1.expectTypeOf)({
13
+ to: "a@example.com",
14
+ subject: "Hi",
15
+ body: [{ type: "text", content: "Hi" }],
16
+ }).toExtend();
17
+ (0, vitest_1.expectTypeOf)({
18
+ to: "a@example.com",
19
+ subject: "Hi",
20
+ html: "<p>Hi</p>",
21
+ body: [],
22
+ }).not.toExtend();
23
+ (0, vitest_1.expectTypeOf)({
24
+ to: "a@example.com",
25
+ subject: "Hi",
26
+ html: "<p>Hi</p>",
27
+ layout: "none",
28
+ }).not.toExtend();
29
+ (0, vitest_1.expectTypeOf)({
30
+ to: "a@example.com",
31
+ subject: "Hi",
32
+ }).not.toExtend();
33
+ });
@@ -532,8 +532,9 @@ function generateDbTs(inputSchema, { hasStartApps = false } = {}) {
532
532
  lines.push('// `not: null` means "is set". An empty `in: []` matches nothing; an', "// empty `notIn: []` applies no filter.");
533
533
  lines.push('// sort: [{ field: "fieldName", direction: "asc" | "desc" }]');
534
534
  lines.push("// limit defaults to 500, max 2000; offset is a row count (a number)");
535
- lines.push("// a filter value of `undefined` is REJECTED (it would query unfiltered", "// and match an arbitrary record). Check the value first.");
535
+ lines.push("// a filter value of `undefined` drops that filter and reads as if it weren't", "// there. Check the value first: `{ owner: user?.id }` signed out reads every row.");
536
536
  lines.push("// .findOne({ id?, filters?, fields? }) → T | undefined");
537
+ lines.push("// a filter value of `undefined`, or an `undefined` id with no filters, matches", "// no record and returns undefined");
537
538
  lines.push("// .create({ record }) → T");
538
539
  lines.push("// .update({ id, record }) → { id: string, fields: Partial<T> }");
539
540
  lines.push("// .delete({ id }) → { success: true, id: string }");
@@ -1410,18 +1411,22 @@ function generateEmailSdk(integrationId, runtime = "classic") {
1410
1411
  "// Always use 'zitejs/email' — never a relative path like '../../.zite/integrations/email'.",
1411
1412
  "// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.",
1412
1413
  "//",
1413
- "// await Email.send({ to, subject, body: [{ type: 'text', content: '...' }] })",
1414
- "// => { success: boolean; messageId: string }",
1414
+ "// await Email.send({ to, subject, html: '<p>...</p>' })",
1415
+ "// => { success: boolean; messageId: string; warnings?: string[] }",
1415
1416
  "//",
1416
- "// RTL languages (Hebrew, Arabic): pass direction: 'rtl' — dir attributes",
1417
- "// inside body text are stripped by the sanitizer and will not work.",
1417
+ "// Emails written before html support pass `body` (blocks) instead; they",
1418
+ "// keep working.",
1419
+ "//",
1420
+ "// RTL languages (Hebrew, Arabic): pass direction: 'rtl'.",
1418
1421
  "",
1419
1422
  "import { createEmailClient } from 'zitejs/runtime';",
1420
1423
  "",
1421
1424
  "export type {",
1422
1425
  " EmailBlock,",
1426
+ " SendBlocksEmailParams,",
1423
1427
  " SendEmailParams,",
1424
1428
  " SendEmailResult,",
1429
+ " SendHtmlEmailParams,",
1425
1430
  "} from 'zitejs/runtime';",
1426
1431
  "",
1427
1432
  `export const Email = createEmailClient(${tsSingleQuoted(integrationId)});`,
@@ -582,6 +582,16 @@ const appTypeErrors = (files, paths) => {
582
582
  const jira = await integrations.get('tickets');
583
583
  const cloudId: string = jira.cloudId;
584
584
  const siteUrl: string = jira.siteUrl;
585
+ `)).toEqual([
586
+ vitest_1.expect.stringContaining("Type 'string | undefined' is not assignable"),
587
+ ]);
588
+ });
589
+ (0, vitest_1.it)('types the Shopify storefront URL as always present and only its token as optional', () => {
590
+ const generated = (0, lib_js_1.generateIntegrationsIndex)([{ name: 'shopify', serviceType: 'shopify', perUser: false }], { reexportAirtable: false });
591
+ (0, vitest_1.expect)(typeErrorsIn(generated, `import { integrations } from 'zitejs/integrations';
592
+ const shop = await integrations.get('shopify');
593
+ const storefrontApiUrl: string = shop.storefrontApiUrl;
594
+ const storefrontAccessToken: string = shop.storefrontAccessToken;
585
595
  `)).toEqual([
586
596
  vitest_1.expect.stringContaining("Type 'string | undefined' is not assignable"),
587
597
  ]);
@@ -0,0 +1,28 @@
1
+ import { type ProfileChanges } from './profileUpdates.js';
2
+ export declare function loginWithRedirect(opts?: {
3
+ redirectUrl?: string;
4
+ /**
5
+ * @deprecated Ignored. There is one sign-in screen now — the server works out
6
+ * from the email whether it's a sign-in or a sign-up. Still accepted, because
7
+ * app source written before that change would otherwise stop typechecking on
8
+ * its next build, and a typecheck error fails the build outright.
9
+ */
10
+ initialView?: 'login' | 'signup';
11
+ }): void;
12
+ export declare function logout(opts?: {
13
+ returnTo?: string;
14
+ }): void;
15
+ export declare function updateProfile(data: ProfileChanges): Promise<{
16
+ data: {
17
+ status: boolean;
18
+ };
19
+ error: null;
20
+ } | {
21
+ data: null;
22
+ error: {
23
+ code?: string | undefined | undefined;
24
+ message?: string | undefined | undefined;
25
+ status: number;
26
+ statusText: string;
27
+ };
28
+ }>;
@@ -0,0 +1,55 @@
1
+ import { USAGE_TOKEN_QUERY_PARAM } from './constants.js';
2
+ import { browserPreviewClaim, PREVIEW_CLAIM_PARAM } from './previewClaim.js';
3
+ import { profileUpdated } from './profileUpdates.js';
4
+ export function loginWithRedirect(opts) {
5
+ if (window.location.pathname.startsWith('/auth/'))
6
+ return;
7
+ // Default to wherever the user already is, so a deep link survives the round
8
+ // trip through login without every app having to remember to pass it. Pass
9
+ // `redirectUrl` only to send them somewhere else instead.
10
+ //
11
+ // Resolved to an absolute URL either way, on purpose: better-auth
12
+ // character-checks a *relative* callbackURL — an encoded space, a fragment or
13
+ // any non-ASCII in the path fails its regex and the destination is dropped —
14
+ // but never inspects the path of an absolute one. Normalising here means a
15
+ // caller can pass whichever form reads best without having to know that.
16
+ const target = new URL(opts?.redirectUrl ?? window.location.href, window.location.href);
17
+ // Say nothing when there's nothing to say. The sign-in page already returns
18
+ // people to the app root when it isn't told otherwise, so naming the root
19
+ // spells out the default — and puts an encoded copy of the app's own URL in
20
+ // the address bar of every logged-out visitor to the front page, which is the
21
+ // common case. Only pass a destination when it IS one.
22
+ const isRoot = target.pathname === '/' && target.search === '' && target.hash === '';
23
+ const params = new URLSearchParams();
24
+ if (!isRoot)
25
+ params.set('redirectUrl', target.toString());
26
+ // The editor preview rides its usageToken on the app URL; the sign-in page
27
+ // only shows its editor surface ("Preview as" picker) when that token reaches
28
+ // it. Capturing the current URL carries it implicitly — but an explicit
29
+ // `redirectUrl` names a bare path, and would silently drop it. Forward it
30
+ // top-level either way, so how the app phrases its redirect can't decide
31
+ // whether the editor gets a preview. Published visitors never have one.
32
+ const usageToken = new URL(window.location.href).searchParams.get(USAGE_TOKEN_QUERY_PARAM) ??
33
+ window._ziteUsageToken;
34
+ if (usageToken)
35
+ params.set(USAGE_TOKEN_QUERY_PARAM, usageToken);
36
+ // A Start app's preview also needs its claim where the editor's frame dropped
37
+ // the cookie, as `loginHref()` sends it. Classic previews never have one.
38
+ const claim = browserPreviewClaim();
39
+ if (claim)
40
+ params.set(PREVIEW_CLAIM_PARAM, claim);
41
+ const query = params.toString();
42
+ window.location.href = query ? `/auth/login?${query}` : '/auth/login';
43
+ }
44
+ export function logout(opts) {
45
+ void import('./client.js').then(({ signOut }) => signOut().then(() => {
46
+ window.location.href = opts?.returnTo || '/';
47
+ }));
48
+ }
49
+ export async function updateProfile(data) {
50
+ const { authClient } = await import('./client.js');
51
+ const result = await authClient.updateUser(data);
52
+ if (!result.error)
53
+ profileUpdated(data);
54
+ return result;
55
+ }
@@ -0,0 +1,357 @@
1
+ import { loginWithRedirect, logout } from './actions.js';
2
+ import type { User } from './index.js';
3
+ export declare const authClient: import("better-auth/react").ReactAuthClient<{
4
+ baseURL: string;
5
+ plugins: ({
6
+ id: "magic-link";
7
+ version: string;
8
+ $InferServerPlugin: ReturnType<(options: import("better-auth/plugins").MagicLinkOptions) => {
9
+ id: "magic-link";
10
+ version: string;
11
+ endpoints: {
12
+ signInMagicLink: import("better-call").StrictEndpoint<"/sign-in/magic-link", {
13
+ method: "POST";
14
+ requireHeaders: true;
15
+ body: import("zod").ZodObject<{
16
+ email: import("zod").ZodEmail;
17
+ name: import("zod").ZodOptional<import("zod").ZodString>;
18
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
19
+ newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
20
+ errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
21
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
22
+ }, import("zod/v4/core").$strip>;
23
+ metadata: {
24
+ openapi: {
25
+ operationId: string;
26
+ description: string;
27
+ responses: {
28
+ 200: {
29
+ description: string;
30
+ content: {
31
+ "application/json": {
32
+ schema: {
33
+ type: "object";
34
+ properties: {
35
+ status: {
36
+ type: string;
37
+ };
38
+ };
39
+ };
40
+ };
41
+ };
42
+ };
43
+ };
44
+ };
45
+ };
46
+ }, {
47
+ status: boolean;
48
+ }>;
49
+ magicLinkVerify: import("better-call").StrictEndpoint<"/magic-link/verify", {
50
+ method: "GET";
51
+ query: import("zod").ZodObject<{
52
+ token: import("zod").ZodString;
53
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
54
+ errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
55
+ newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
56
+ }, import("zod/v4/core").$strip>;
57
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
58
+ requireHeaders: true;
59
+ metadata: {
60
+ openapi: {
61
+ operationId: string;
62
+ description: string;
63
+ responses: {
64
+ 200: {
65
+ description: string;
66
+ content: {
67
+ "application/json": {
68
+ schema: {
69
+ type: "object";
70
+ properties: {
71
+ session: {
72
+ $ref: string;
73
+ };
74
+ user: {
75
+ $ref: string;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ };
81
+ };
82
+ };
83
+ };
84
+ };
85
+ }, {
86
+ token: string;
87
+ user: {
88
+ id: string;
89
+ createdAt: Date;
90
+ updatedAt: Date;
91
+ email: string;
92
+ emailVerified: boolean;
93
+ name: string;
94
+ image?: string | null | undefined;
95
+ };
96
+ session: {
97
+ id: string;
98
+ createdAt: Date;
99
+ updatedAt: Date;
100
+ userId: string;
101
+ expiresAt: Date;
102
+ token: string;
103
+ ipAddress?: string | null | undefined;
104
+ userAgent?: string | null | undefined;
105
+ };
106
+ }>;
107
+ };
108
+ rateLimit: {
109
+ pathMatcher(path: string): boolean;
110
+ window: number;
111
+ max: number;
112
+ }[];
113
+ options: import("better-auth/plugins").MagicLinkOptions;
114
+ }>;
115
+ } | {
116
+ id: "additional-fields-client";
117
+ version: string;
118
+ $InferServerPlugin: {
119
+ id: "additional-fields-client";
120
+ version: string;
121
+ schema: {
122
+ user: {
123
+ fields: {
124
+ firstName: {
125
+ type: "string";
126
+ required: false;
127
+ };
128
+ lastName: {
129
+ type: "string";
130
+ required: false;
131
+ };
132
+ };
133
+ };
134
+ session: {
135
+ fields: {};
136
+ };
137
+ };
138
+ };
139
+ })[];
140
+ }>;
141
+ export declare const useSession: () => {
142
+ data: {
143
+ user: import("better-auth/react").StripEmptyObjects<{
144
+ id: string;
145
+ createdAt: Date;
146
+ updatedAt: Date;
147
+ email: string;
148
+ emailVerified: boolean;
149
+ name: string;
150
+ image?: string | null | undefined;
151
+ } & {} & {
152
+ firstName?: string | null | undefined;
153
+ lastName?: string | null | undefined;
154
+ }>;
155
+ session: import("better-auth/react").StripEmptyObjects<{
156
+ id: string;
157
+ createdAt: Date;
158
+ updatedAt: Date;
159
+ userId: string;
160
+ expiresAt: Date;
161
+ token: string;
162
+ ipAddress?: string | null | undefined;
163
+ userAgent?: string | null | undefined;
164
+ } & {} & {}>;
165
+ } | null;
166
+ isPending: boolean;
167
+ isRefetching: boolean;
168
+ error: import("@better-fetch/fetch").BetterFetchError | null;
169
+ refetch: (queryParams?: {
170
+ query?: import("better-auth").SessionQueryParams;
171
+ } | undefined) => Promise<void>;
172
+ };
173
+ /**
174
+ * `loginWithRedirect` and `logout` are returned as well as exported. The
175
+ * pre-monorepo `useAuth()` returned them, so app code that destructures them
176
+ * from the hook is common — and returning them here means the legacy compat
177
+ * shim is the only thing that has to know that, not every migrated app.
178
+ */
179
+ export declare function useAuth(): {
180
+ user: User | null;
181
+ isLoading: boolean;
182
+ loginWithRedirect: typeof loginWithRedirect;
183
+ logout: typeof logout;
184
+ };
185
+ export declare const signIn: {
186
+ magicLink: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
187
+ email: string;
188
+ name?: string | undefined;
189
+ callbackURL?: string | undefined;
190
+ newUserCallbackURL?: string | undefined;
191
+ errorCallbackURL?: string | undefined;
192
+ metadata?: Record<string, any> | undefined;
193
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
194
+ email: string;
195
+ name?: string | undefined;
196
+ callbackURL?: string | undefined;
197
+ newUserCallbackURL?: string | undefined;
198
+ errorCallbackURL?: string | undefined;
199
+ metadata?: Record<string, any> | 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
+ social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
210
+ provider: "salesforce" | "slack" | "linear" | "notion" | "linkedin" | "github" | "dropbox" | "line" | (string & {}) | "huggingface" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "kick" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
211
+ callbackURL?: string | undefined;
212
+ newUserCallbackURL?: string | undefined;
213
+ errorCallbackURL?: string | undefined;
214
+ disableRedirect?: boolean | undefined;
215
+ idToken?: {
216
+ token: string;
217
+ nonce?: string | undefined;
218
+ accessToken?: string | undefined;
219
+ refreshToken?: string | undefined;
220
+ expiresAt?: number | undefined;
221
+ user?: {
222
+ name?: {
223
+ firstName?: string | undefined;
224
+ lastName?: string | undefined;
225
+ } | undefined;
226
+ email?: string | undefined;
227
+ } | undefined;
228
+ } | undefined;
229
+ scopes?: string[] | undefined;
230
+ requestSignUp?: boolean | undefined;
231
+ loginHint?: string | undefined;
232
+ additionalData?: Record<string, any> | undefined;
233
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
234
+ provider: "salesforce" | "slack" | "linear" | "notion" | "linkedin" | "github" | "dropbox" | "line" | (string & {}) | "huggingface" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "kick" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
235
+ callbackURL?: string | undefined;
236
+ newUserCallbackURL?: string | undefined;
237
+ errorCallbackURL?: string | undefined;
238
+ disableRedirect?: boolean | undefined;
239
+ idToken?: {
240
+ token: string;
241
+ nonce?: string | undefined;
242
+ accessToken?: string | undefined;
243
+ refreshToken?: string | undefined;
244
+ expiresAt?: number | undefined;
245
+ user?: {
246
+ name?: {
247
+ firstName?: string | undefined;
248
+ lastName?: string | undefined;
249
+ } | undefined;
250
+ email?: string | undefined;
251
+ } | undefined;
252
+ } | undefined;
253
+ scopes?: string[] | undefined;
254
+ requestSignUp?: boolean | undefined;
255
+ loginHint?: string | undefined;
256
+ additionalData?: Record<string, any> | undefined;
257
+ } & {
258
+ fetchOptions?: FetchOptions | undefined;
259
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
260
+ redirect: boolean;
261
+ url: string;
262
+ } | (Omit<{
263
+ redirect: boolean;
264
+ token: string;
265
+ url: undefined;
266
+ user: {
267
+ id: string;
268
+ createdAt: Date;
269
+ updatedAt: Date;
270
+ email: string;
271
+ emailVerified: boolean;
272
+ name: string;
273
+ image?: string | null | undefined | undefined;
274
+ };
275
+ }, "user"> & {
276
+ user: import("better-auth/react").StripEmptyObjects<{
277
+ id: string;
278
+ createdAt: Date;
279
+ updatedAt: Date;
280
+ email: string;
281
+ emailVerified: boolean;
282
+ name: string;
283
+ image?: string | null | undefined;
284
+ } & {} & {
285
+ firstName?: string | null | undefined;
286
+ lastName?: string | null | undefined;
287
+ }>;
288
+ }), {
289
+ code?: string | undefined;
290
+ message?: string | undefined;
291
+ }, FetchOptions["throw"] extends true ? true : false>>;
292
+ } & {
293
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
294
+ email: string;
295
+ password: string;
296
+ callbackURL?: string | undefined;
297
+ rememberMe?: boolean | undefined;
298
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
299
+ email: string;
300
+ password: string;
301
+ callbackURL?: string | undefined;
302
+ rememberMe?: boolean | undefined;
303
+ } & {
304
+ fetchOptions?: FetchOptions | undefined;
305
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
306
+ redirect: boolean;
307
+ token: string;
308
+ url?: string | undefined;
309
+ user: {
310
+ id: string;
311
+ createdAt: Date;
312
+ updatedAt: Date;
313
+ email: string;
314
+ emailVerified: boolean;
315
+ name: string;
316
+ image?: string | null | undefined | undefined;
317
+ };
318
+ }, "user"> & {
319
+ user: import("better-auth/react").StripEmptyObjects<{
320
+ id: string;
321
+ createdAt: Date;
322
+ updatedAt: Date;
323
+ email: string;
324
+ emailVerified: boolean;
325
+ name: string;
326
+ image?: string | null | undefined;
327
+ } & {} & {
328
+ firstName?: string | null | undefined;
329
+ lastName?: string | null | undefined;
330
+ }>;
331
+ }, {
332
+ code?: string | undefined;
333
+ message?: string | undefined;
334
+ }, FetchOptions["throw"] extends true ? true : false>>;
335
+ };
336
+ export declare const 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<{
337
+ query?: Record<string, any> | undefined;
338
+ fetchOptions?: FetchOptions | undefined;
339
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
340
+ success: boolean;
341
+ }, {
342
+ code?: string | undefined;
343
+ message?: string | undefined;
344
+ }, FetchOptions["throw"] extends true ? true : false>>;
345
+ export declare const signUp: {
346
+ email: (data: {
347
+ email: string;
348
+ password: string;
349
+ name: string;
350
+ [key: string]: unknown;
351
+ }) => Promise<{
352
+ error?: {
353
+ message?: string;
354
+ } | null;
355
+ data?: unknown;
356
+ }>;
357
+ };