@better-auth/i18n 1.7.0-rc.1 → 1.7.0-rc.2
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 +1 -2
- package/dist/client.mjs +1 -1
- package/dist/{index-CYmtmQve.d.mts → index-BQCZ4CCj.d.mts} +3 -4
- package/dist/{index-CMj6OYMa.d.mts → index-DE9mahtb.d.mts} +6 -10
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/locales/index.d.mts +1 -1
- package/dist/locales/index.mjs +1 -1
- package/dist/{locales-CSRpG5Mc.mjs → locales-Bf12c6T-.mjs} +1 -1
- package/dist/{version-Bqn64AX6.mjs → version-m-Zfjx6T.mjs} +1 -1
- package/package.json +6 -6
- /package/dist/{chunk-CfYAbeIz.mjs → rolldown-runtime-D7D4PA-g.mjs} +0 -0
package/dist/client.d.mts
CHANGED
package/dist/client.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, UnionToIntersection } from "@better-auth/core";
|
|
2
|
-
|
|
3
2
|
//#region src/types.d.ts
|
|
4
3
|
type ALL_PLUGIN_ERROR_CODE_KEYS = keyof UnionToIntersection<{ [Key in Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]: BetterAuthPluginRegistry<unknown, unknown>[Key] extends {
|
|
5
4
|
creator: infer C;
|
|
6
5
|
} ? C extends ((...args: any[]) => infer P) ? P extends {
|
|
7
6
|
$ERROR_CODES: infer E;
|
|
8
|
-
} ? E : {} : {} : {} }[Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]>;
|
|
9
|
-
type InternalTranslationDictionary = Partial<{ [Key in ALL_PLUGIN_ERROR_CODE_KEYS]: string }>;
|
|
7
|
+
} ? E : {} : {} : {}; }[Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]>;
|
|
8
|
+
type InternalTranslationDictionary = Partial<{ [Key in ALL_PLUGIN_ERROR_CODE_KEYS]: string; }>;
|
|
10
9
|
/**
|
|
11
10
|
* Translation dictionary mapping error codes to translated messages
|
|
12
11
|
*/
|
|
@@ -27,7 +26,7 @@ interface I18nOptions<Locales extends string[]> {
|
|
|
27
26
|
* fr: { USER_NOT_FOUND: "Utilisateur non trouvé" }
|
|
28
27
|
* }
|
|
29
28
|
*/
|
|
30
|
-
translations: { [Locale in Locales[number]]: TranslationDictionary };
|
|
29
|
+
translations: { [Locale in Locales[number]]: TranslationDictionary; };
|
|
31
30
|
/**
|
|
32
31
|
* Default/fallback locale when detection fails
|
|
33
32
|
* @default "en"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { E as TranslationDictionary, T as LocaleDetectionStrategy, w as I18nOptions } from "./index-
|
|
1
|
+
import { E as TranslationDictionary, T as LocaleDetectionStrategy, w as I18nOptions } from "./index-BQCZ4CCj.mjs";
|
|
2
2
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
3
|
-
|
|
4
3
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
|
|
5
4
|
//#region src/standard-schema.d.ts
|
|
6
5
|
/** The Standard Schema interface. */
|
|
@@ -57,7 +56,7 @@ declare namespace StandardSchemaV1 {
|
|
|
57
56
|
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
58
57
|
/** Infers the output type of a Standard Schema. */
|
|
59
58
|
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
60
|
-
}
|
|
59
|
+
}
|
|
61
60
|
//#endregion
|
|
62
61
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.d.mts
|
|
63
62
|
declare const statusCodes: {
|
|
@@ -135,7 +134,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
|
|
|
135
134
|
cause?: unknown;
|
|
136
135
|
} & Record<string, any>) | undefined, headers?: HeadersInit | undefined, statusCode?: number | undefined) => InternalAPIError & {
|
|
137
136
|
errorStack: string | undefined;
|
|
138
|
-
};
|
|
137
|
+
};
|
|
139
138
|
//#endregion
|
|
140
139
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
|
|
141
140
|
//#region src/openapi.d.ts
|
|
@@ -329,10 +328,7 @@ interface EndpointBaseOptions {
|
|
|
329
328
|
* A callback to run before a validation error is thrown
|
|
330
329
|
* You can customize the validation error message by throwing your own APIError
|
|
331
330
|
*/
|
|
332
|
-
onValidationError?: ({
|
|
333
|
-
issues,
|
|
334
|
-
message
|
|
335
|
-
}: {
|
|
331
|
+
onValidationError?: ({ issues, message }: {
|
|
336
332
|
message: string;
|
|
337
333
|
issues: readonly StandardSchemaV1.Issue[];
|
|
338
334
|
}) => void | Promise<void>;
|
|
@@ -386,7 +382,7 @@ type MiddlewareInputContext<Options extends MiddlewareOptions> = InferBodyInput<
|
|
|
386
382
|
};
|
|
387
383
|
type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends (inputCtx: any) => Promise<any> = any> = Handler & {
|
|
388
384
|
options: Options;
|
|
389
|
-
};
|
|
385
|
+
};
|
|
390
386
|
//#endregion
|
|
391
387
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/context.d.mts
|
|
392
388
|
type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = (Options["metadata"] extends {
|
|
@@ -459,7 +455,7 @@ declare const i18n: <Locales extends string[]>(options: I18nOptions<Locales>) =>
|
|
|
459
455
|
}[];
|
|
460
456
|
};
|
|
461
457
|
options: {
|
|
462
|
-
translations: { [Locale in Locales[number]]: TranslationDictionary };
|
|
458
|
+
translations: { [Locale in Locales[number]]: TranslationDictionary; };
|
|
463
459
|
defaultLocale: Locales[number];
|
|
464
460
|
detection: LocaleDetectionStrategy[];
|
|
465
461
|
localeCookie: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as i18n } from "./index-
|
|
2
|
-
import { E as TranslationDictionary, T as LocaleDetectionStrategy, t as index_d_exports, w as I18nOptions } from "./index-
|
|
3
|
-
export { I18nOptions, LocaleDetectionStrategy, TranslationDictionary, i18n, index_d_exports as locales };
|
|
1
|
+
import { t as i18n } from "./index-DE9mahtb.mjs";
|
|
2
|
+
import { E as TranslationDictionary, T as LocaleDetectionStrategy, t as index_d_exports, w as I18nOptions } from "./index-BQCZ4CCj.mjs";
|
|
3
|
+
export { type I18nOptions, type LocaleDetectionStrategy, type TranslationDictionary, i18n, index_d_exports as locales };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
2
|
-
import { t as locales_exports } from "./locales-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-m-Zfjx6T.mjs";
|
|
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";
|
|
5
5
|
//#region src/index.ts
|
package/dist/locales/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as ar, S as bn, _ as fr, a as tr, b as en, c as ru, d as nl, f as ko, g as hi, h as id, i as uk, l as pt, m as it, n as zh, o as th, p as ja, r as vi, s as sv, u as pl, v as fa, x as de, y as es } from "../index-
|
|
1
|
+
import { C as ar, S as bn, _ as fr, a as tr, b as en, c as ru, d as nl, f as ko, g as hi, h as id, i as uk, l as pt, m as it, n as zh, o as th, p as ja, r as vi, s as sv, u as pl, v as fa, x as de, y as es } from "../index-BQCZ4CCj.mjs";
|
|
2
2
|
export { ar, bn, de, en, es, fa, fr, hi, id, it, ja, ko, nl, pl, pt, ru, sv, th, tr, uk, vi, zh };
|
package/dist/locales/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as ar, S as bn, _ as fr, a as tr, b as en, c as ru, d as nl, f as ko, g as hi, h as id, i as uk, l as pt, m as it, n as zh, o as th, p as ja, r as vi, s as sv, u as pl, v as fa, x as de, y as es } from "../locales-
|
|
1
|
+
import { C as ar, S as bn, _ as fr, a as tr, b as en, c as ru, d as nl, f as ko, g as hi, h as id, i as uk, l as pt, m as it, n as zh, o as th, p as ja, r as vi, s as sv, u as pl, v as fa, x as de, y as es } from "../locales-Bf12c6T-.mjs";
|
|
2
2
|
export { ar, bn, de, en, es, fa, fr, hi, id, it, ja, ko, nl, pl, pt, ru, sv, th, tr, uk, vi, zh };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/i18n",
|
|
3
|
-
"version": "1.7.0-rc.
|
|
3
|
+
"version": "1.7.0-rc.2",
|
|
4
4
|
"description": "i18n plugin for Better Auth - translate error messages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"tsdown": "0.
|
|
62
|
-
"@better-auth/core": "1.7.0-rc.
|
|
63
|
-
"better-auth": "1.7.0-rc.
|
|
61
|
+
"tsdown": "0.22.7",
|
|
62
|
+
"@better-auth/core": "1.7.0-rc.2",
|
|
63
|
+
"better-auth": "1.7.0-rc.2"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@better-auth/core": "^1.7.0-rc.
|
|
67
|
-
"better-auth": "^1.7.0-rc.
|
|
66
|
+
"@better-auth/core": "^1.7.0-rc.2",
|
|
67
|
+
"better-auth": "^1.7.0-rc.2"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsdown",
|
|
File without changes
|