@better-auth/i18n 1.7.0-rc.3 → 1.7.0-rc.5

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/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as i18n } from "./index-DE9mahtb.mjs";
1
+ import { t as i18n } from "./index-C6yBmeTT.mjs";
2
2
  //#region src/client.d.ts
3
3
  /**
4
4
  * i18n client plugin for Better Auth
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-xoFrTW0m.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-CwxXc1Y6.mjs";
2
2
  //#region src/client.ts
3
3
  /**
4
4
  * i18n client plugin for Better Auth
@@ -1,6 +1,6 @@
1
1
  import { E as TranslationDictionary, T as LocaleDetectionStrategy, w as I18nOptions } from "./index-BQCZ4CCj.mjs";
2
2
  import { GenericEndpointContext } from "@better-auth/core";
3
- //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
3
+ //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
4
4
  //#region src/standard-schema.d.ts
5
5
  /** The Standard Schema interface. */
6
6
  interface StandardSchemaV1<Input = unknown, Output = Input> {
@@ -58,7 +58,7 @@ declare namespace StandardSchemaV1 {
58
58
  type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
59
59
  }
60
60
  //#endregion
61
- //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.d.mts
61
+ //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/error.d.mts
62
62
  declare const statusCodes: {
63
63
  OK: number;
64
64
  CREATED: number;
@@ -136,7 +136,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
136
136
  errorStack: string | undefined;
137
137
  };
138
138
  //#endregion
139
- //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
139
+ //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
140
140
  //#region src/openapi.d.ts
141
141
  type OpenAPISchemaType = "string" | "number" | "integer" | "boolean" | "array" | "object";
142
142
  interface OpenAPIParameter {
@@ -158,7 +158,7 @@ interface OpenAPIParameter {
158
158
  };
159
159
  }
160
160
  //#endregion
161
- //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
161
+ //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
162
162
  //#region src/endpoint.d.ts
163
163
  interface EndpointBaseOptions {
164
164
  /**
@@ -316,7 +316,7 @@ interface EndpointBaseOptions {
316
316
  /**
317
317
  * List of middlewares to use
318
318
  */
319
- use?: Middleware[];
319
+ use?: MiddlewareHandler[];
320
320
  /**
321
321
  * A callback to run before any API error is throw or returned
322
322
  *
@@ -372,33 +372,21 @@ type EndpointBodyMethodOptions = {
372
372
  };
373
373
  type EndpointOptions = EndpointBaseOptions & EndpointBodyMethodOptions;
374
374
  //#endregion
375
- //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
376
- //#region src/middleware.d.ts
377
- interface MiddlewareOptions extends Omit<EndpointOptions, "method"> {}
378
- type MiddlewareInputContext<Options extends MiddlewareOptions> = InferBodyInput<Options> & InferQueryInput<Options> & InferRequestInput<Options> & InferHeadersInput<Options> & {
379
- asResponse?: boolean;
380
- returnHeaders?: boolean;
381
- use?: Middleware[];
382
- };
383
- type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends (inputCtx: any) => Promise<any> = any> = Handler & {
384
- options: Options;
385
- };
386
- //#endregion
387
- //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/context.d.mts
388
- type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = (Options["metadata"] extends {
375
+ //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/context.d.mts
376
+ type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = Options["metadata"] extends {
389
377
  $Infer: {
390
378
  body: infer B;
391
379
  };
392
- } ? B : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["body"]> : undefined)> = undefined extends Body ? {
380
+ } ? B : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["body"]> : undefined> = undefined extends Body ? {
393
381
  body?: Body;
394
382
  } : {
395
383
  body: Body;
396
384
  };
397
- type InferQueryInput<Options extends EndpointOptions | MiddlewareOptions, Query = (Options["metadata"] extends {
385
+ type InferQueryInput<Options extends EndpointOptions | MiddlewareOptions, Query = Options["metadata"] extends {
398
386
  $Infer: {
399
387
  query: infer Query;
400
388
  };
401
- } ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["query"]> : Record<string, any> | undefined)> = undefined extends Query ? {
389
+ } ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["query"]> : Record<string, any> | undefined> = undefined extends Query ? {
402
390
  query?: Query;
403
391
  } : {
404
392
  query: Query;
@@ -414,6 +402,20 @@ type InferHeadersInput<Option extends EndpointOptions | MiddlewareOptions> = Opt
414
402
  headers?: HeadersInit;
415
403
  };
416
404
  //#endregion
405
+ //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
406
+ //#region src/middleware.d.ts
407
+ interface MiddlewareOptions extends Omit<EndpointOptions, "method"> {}
408
+ type MiddlewareInputContext<Options extends MiddlewareOptions> = InferBodyInput<Options> & InferQueryInput<Options> & InferRequestInput<Options> & InferHeadersInput<Options> & {
409
+ asResponse?: boolean;
410
+ returnHeaders?: boolean;
411
+ use?: MiddlewareHandler[];
412
+ };
413
+ type MiddlewareFunction = (...args: never[]) => Promise<unknown>;
414
+ type MiddlewareHandler = (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<unknown>;
415
+ type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends MiddlewareFunction = MiddlewareHandler> = Handler & {
416
+ options: Options;
417
+ };
418
+ //#endregion
417
419
  //#region src/index.d.ts
418
420
  declare module "@better-auth/core" {
419
421
  interface BetterAuthPluginRegistry<AuthOptions, Options> {
@@ -451,7 +453,7 @@ declare const i18n: <Locales extends string[]>(options: I18nOptions<Locales>) =>
451
453
  hooks: {
452
454
  after: {
453
455
  matcher: () => true;
454
- handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
456
+ handler: Middleware<MiddlewareOptions, (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>>;
455
457
  }[];
456
458
  };
457
459
  options: {
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as i18n } from "./index-DE9mahtb.mjs";
1
+ import { t as i18n } from "./index-C6yBmeTT.mjs";
2
2
  import { E as TranslationDictionary, T as LocaleDetectionStrategy, t as index_d_exports, w as I18nOptions } from "./index-BQCZ4CCj.mjs";
3
3
  export { type I18nOptions, type LocaleDetectionStrategy, type TranslationDictionary, i18n, index_d_exports as locales };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-xoFrTW0m.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-CwxXc1Y6.mjs";
2
2
  import { t as locales_exports } from "./locales-Bf12c6T-.mjs";
3
3
  import { APIError, createAuthMiddleware, isAPIError } from "better-auth/api";
4
4
  import { parseCookies } from "better-auth/cookies";
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.7.0-rc.3";
3
+ const PACKAGE_VERSION = "1.7.0-rc.5";
4
4
  //#endregion
5
5
  export { PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/i18n",
3
- "version": "1.7.0-rc.3",
3
+ "version": "1.7.0-rc.5",
4
4
  "description": "i18n plugin for Better Auth - translate error messages",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -59,12 +59,12 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "tsdown": "0.22.7",
62
- "@better-auth/core": "1.7.0-rc.3",
63
- "better-auth": "1.7.0-rc.3"
62
+ "@better-auth/core": "1.7.0-rc.5",
63
+ "better-auth": "1.7.0-rc.5"
64
64
  },
65
65
  "peerDependencies": {
66
- "better-auth": "^1.7.0-rc.3",
67
- "@better-auth/core": "^1.7.0-rc.3"
66
+ "@better-auth/core": "^1.7.0-rc.5",
67
+ "better-auth": "^1.7.0-rc.5"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsdown",