@better-auth/i18n 1.6.27 → 1.6.29

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,5 @@
1
- import { t as i18n } from "./index-CPhyYdbZ.mjs";
1
+ import { t as i18n } from "./index-CJ7rDBMd.mjs";
2
+
2
3
  //#region src/client.d.ts
3
4
  /**
4
5
  * i18n client plugin for Better Auth
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-B4oCeoTU.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BMIyP1cB.mjs";
2
2
  //#region src/client.ts
3
3
  /**
4
4
  * i18n client plugin for Better Auth
@@ -1,4 +1,5 @@
1
1
  import { BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, UnionToIntersection } from "@better-auth/core";
2
+
2
3
  //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
3
4
  //#region src/standard-schema.d.ts
4
5
  /** The Standard Schema interface. */
@@ -55,7 +56,7 @@ declare namespace StandardSchemaV1 {
55
56
  type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
56
57
  /** Infers the output type of a Standard Schema. */
57
58
  type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
58
- }
59
+ } //#endregion
59
60
  //#endregion
60
61
  //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/error.d.mts
61
62
  declare const statusCodes: {
@@ -133,7 +134,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
133
134
  cause?: unknown;
134
135
  } & Record<string, any>) | undefined, headers?: HeadersInit | undefined, statusCode?: number | undefined) => InternalAPIError & {
135
136
  errorStack: string | undefined;
136
- };
137
+ }; //#endregion
137
138
  //#endregion
138
139
  //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
139
140
  //#region src/openapi.d.ts
@@ -327,7 +328,10 @@ interface EndpointBaseOptions {
327
328
  * A callback to run before a validation error is thrown
328
329
  * You can customize the validation error message by throwing your own APIError
329
330
  */
330
- onValidationError?: ({ issues, message }: {
331
+ onValidationError?: ({
332
+ issues,
333
+ message
334
+ }: {
331
335
  message: string;
332
336
  issues: readonly StandardSchemaV1.Issue[];
333
337
  }) => void | Promise<void>;
@@ -372,20 +376,20 @@ type EndpointBodyMethodOptions = {
372
376
  type EndpointOptions = EndpointBaseOptions & EndpointBodyMethodOptions;
373
377
  //#endregion
374
378
  //#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/context.d.mts
375
- type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = Options["metadata"] extends {
379
+ type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = (Options["metadata"] extends {
376
380
  $Infer: {
377
381
  body: infer B;
378
382
  };
379
- } ? B : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["body"]> : undefined> = undefined extends Body ? {
383
+ } ? B : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["body"]> : undefined)> = undefined extends Body ? {
380
384
  body?: Body;
381
385
  } : {
382
386
  body: Body;
383
387
  };
384
- type InferQueryInput<Options extends EndpointOptions | MiddlewareOptions, Query = Options["metadata"] extends {
388
+ type InferQueryInput<Options extends EndpointOptions | MiddlewareOptions, Query = (Options["metadata"] extends {
385
389
  $Infer: {
386
390
  query: infer Query;
387
391
  };
388
- } ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["query"]> : Record<string, any> | undefined> = undefined extends Query ? {
392
+ } ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["query"]> : Record<string, any> | undefined)> = undefined extends Query ? {
389
393
  query?: Query;
390
394
  } : {
391
395
  query: Query;
@@ -413,15 +417,15 @@ type MiddlewareFunction = (...args: never[]) => Promise<unknown>;
413
417
  type MiddlewareHandler = (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<unknown>;
414
418
  type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends MiddlewareFunction = MiddlewareHandler> = Handler & {
415
419
  options: Options;
416
- };
420
+ }; //#endregion
417
421
  //#endregion
418
422
  //#region src/types.d.ts
419
423
  type ALL_PLUGIN_ERROR_CODE_KEYS = keyof UnionToIntersection<{ [Key in Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]: BetterAuthPluginRegistry<unknown, unknown>[Key] extends {
420
424
  creator: infer C;
421
425
  } ? C extends ((...args: any[]) => infer P) ? P extends {
422
426
  $ERROR_CODES: infer E;
423
- } ? E : {} : {} : {}; }[Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]>;
424
- type InternalTranslationDictionary = Partial<{ [Key in ALL_PLUGIN_ERROR_CODE_KEYS]: string; }>;
427
+ } ? E : {} : {} : {} }[Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]>;
428
+ type InternalTranslationDictionary = Partial<{ [Key in ALL_PLUGIN_ERROR_CODE_KEYS]: string }>;
425
429
  /**
426
430
  * Translation dictionary mapping error codes to translated messages
427
431
  */
@@ -442,7 +446,7 @@ interface I18nOptions<Locales extends string[]> {
442
446
  * fr: { USER_NOT_FOUND: "Utilisateur non trouvé" }
443
447
  * }
444
448
  */
445
- translations: { [Locale in Locales[number]]: TranslationDictionary; };
449
+ translations: { [Locale in Locales[number]]: TranslationDictionary };
446
450
  /**
447
451
  * Default/fallback locale when detection fails
448
452
  * @default "en"
@@ -514,7 +518,7 @@ declare const i18n: <Locales extends string[]>(options: I18nOptions<Locales>) =>
514
518
  }[];
515
519
  };
516
520
  options: {
517
- translations: { [Locale in Locales[number]]: TranslationDictionary; };
521
+ translations: { [Locale in Locales[number]]: TranslationDictionary };
518
522
  defaultLocale: Locales[number];
519
523
  detection: LocaleDetectionStrategy[];
520
524
  localeCookie: string;
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as TranslationDictionary, n as I18nOptions, r as LocaleDetectionStrategy, t as i18n } from "./index-CPhyYdbZ.mjs";
2
- export { type I18nOptions, type LocaleDetectionStrategy, type TranslationDictionary, i18n };
1
+ import { i as TranslationDictionary, n as I18nOptions, r as LocaleDetectionStrategy, t as i18n } from "./index-CJ7rDBMd.mjs";
2
+ export { I18nOptions, LocaleDetectionStrategy, TranslationDictionary, i18n };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-B4oCeoTU.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BMIyP1cB.mjs";
2
2
  import { APIError, createAuthMiddleware, isAPIError } from "better-auth/api";
3
3
  import { parseCookies } from "better-auth/cookies";
4
4
  //#region src/index.ts
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.6.27";
3
+ const PACKAGE_VERSION = "1.6.29";
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.6.27",
3
+ "version": "1.6.29",
4
4
  "description": "i18n plugin for Better Auth - translate error messages",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,13 +50,13 @@
50
50
  }
51
51
  },
52
52
  "devDependencies": {
53
- "tsdown": "0.22.7",
54
- "@better-auth/core": "1.6.27",
55
- "better-auth": "1.6.27"
53
+ "tsdown": "0.21.10",
54
+ "@better-auth/core": "1.6.29",
55
+ "better-auth": "1.6.29"
56
56
  },
57
57
  "peerDependencies": {
58
- "@better-auth/core": "^1.6.27",
59
- "better-auth": "^1.6.27"
58
+ "@better-auth/core": "^1.6.29",
59
+ "better-auth": "^1.6.29"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsdown",