@better-auth/i18n 1.6.23 → 1.6.25
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
package/dist/client.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, UnionToIntersection } from "@better-auth/core";
|
|
2
|
-
|
|
3
2
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
|
|
4
3
|
//#region src/standard-schema.d.ts
|
|
5
4
|
/** The Standard Schema interface. */
|
|
@@ -56,7 +55,7 @@ declare namespace StandardSchemaV1 {
|
|
|
56
55
|
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
57
56
|
/** Infers the output type of a Standard Schema. */
|
|
58
57
|
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
59
|
-
}
|
|
58
|
+
}
|
|
60
59
|
//#endregion
|
|
61
60
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.d.mts
|
|
62
61
|
declare const statusCodes: {
|
|
@@ -134,7 +133,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
|
|
|
134
133
|
cause?: unknown;
|
|
135
134
|
} & Record<string, any>) | undefined, headers?: HeadersInit | undefined, statusCode?: number | undefined) => InternalAPIError & {
|
|
136
135
|
errorStack: string | undefined;
|
|
137
|
-
};
|
|
136
|
+
};
|
|
138
137
|
//#endregion
|
|
139
138
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
|
|
140
139
|
//#region src/openapi.d.ts
|
|
@@ -328,10 +327,7 @@ interface EndpointBaseOptions {
|
|
|
328
327
|
* A callback to run before a validation error is thrown
|
|
329
328
|
* You can customize the validation error message by throwing your own APIError
|
|
330
329
|
*/
|
|
331
|
-
onValidationError?: ({
|
|
332
|
-
issues,
|
|
333
|
-
message
|
|
334
|
-
}: {
|
|
330
|
+
onValidationError?: ({ issues, message }: {
|
|
335
331
|
message: string;
|
|
336
332
|
issues: readonly StandardSchemaV1.Issue[];
|
|
337
333
|
}) => void | Promise<void>;
|
|
@@ -385,7 +381,7 @@ type MiddlewareInputContext<Options extends MiddlewareOptions> = InferBodyInput<
|
|
|
385
381
|
};
|
|
386
382
|
type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends (inputCtx: any) => Promise<any> = any> = Handler & {
|
|
387
383
|
options: Options;
|
|
388
|
-
};
|
|
384
|
+
};
|
|
389
385
|
//#endregion
|
|
390
386
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/context.d.mts
|
|
391
387
|
type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = (Options["metadata"] extends {
|
|
@@ -422,8 +418,8 @@ type ALL_PLUGIN_ERROR_CODE_KEYS = keyof UnionToIntersection<{ [Key in Exclude<Be
|
|
|
422
418
|
creator: infer C;
|
|
423
419
|
} ? C extends ((...args: any[]) => infer P) ? P extends {
|
|
424
420
|
$ERROR_CODES: infer E;
|
|
425
|
-
} ? E : {} : {} : {} }[Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]>;
|
|
426
|
-
type InternalTranslationDictionary = Partial<{ [Key in ALL_PLUGIN_ERROR_CODE_KEYS]: string }>;
|
|
421
|
+
} ? E : {} : {} : {}; }[Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]>;
|
|
422
|
+
type InternalTranslationDictionary = Partial<{ [Key in ALL_PLUGIN_ERROR_CODE_KEYS]: string; }>;
|
|
427
423
|
/**
|
|
428
424
|
* Translation dictionary mapping error codes to translated messages
|
|
429
425
|
*/
|
|
@@ -444,7 +440,7 @@ interface I18nOptions<Locales extends string[]> {
|
|
|
444
440
|
* fr: { USER_NOT_FOUND: "Utilisateur non trouvé" }
|
|
445
441
|
* }
|
|
446
442
|
*/
|
|
447
|
-
translations: { [Locale in Locales[number]]: TranslationDictionary };
|
|
443
|
+
translations: { [Locale in Locales[number]]: TranslationDictionary; };
|
|
448
444
|
/**
|
|
449
445
|
* Default/fallback locale when detection fails
|
|
450
446
|
* @default "en"
|
|
@@ -516,7 +512,7 @@ declare const i18n: <Locales extends string[]>(options: I18nOptions<Locales>) =>
|
|
|
516
512
|
}[];
|
|
517
513
|
};
|
|
518
514
|
options: {
|
|
519
|
-
translations: { [Locale in Locales[number]]: TranslationDictionary };
|
|
515
|
+
translations: { [Locale in Locales[number]]: TranslationDictionary; };
|
|
520
516
|
defaultLocale: Locales[number];
|
|
521
517
|
detection: LocaleDetectionStrategy[];
|
|
522
518
|
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-
|
|
2
|
-
export { I18nOptions, LocaleDetectionStrategy, TranslationDictionary, i18n };
|
|
1
|
+
import { i as TranslationDictionary, n as I18nOptions, r as LocaleDetectionStrategy, t as i18n } from "./index-DB9G0sAf.mjs";
|
|
2
|
+
export { type I18nOptions, type LocaleDetectionStrategy, type TranslationDictionary, i18n };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-Bbx2FRPo.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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/i18n",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.25",
|
|
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.
|
|
54
|
-
"@better-auth/core": "1.6.
|
|
55
|
-
"better-auth": "1.6.
|
|
53
|
+
"tsdown": "0.22.7",
|
|
54
|
+
"@better-auth/core": "1.6.25",
|
|
55
|
+
"better-auth": "1.6.25"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@better-auth/core": "^1.6.
|
|
59
|
-
"better-auth": "^1.6.
|
|
58
|
+
"@better-auth/core": "^1.6.25",
|
|
59
|
+
"better-auth": "^1.6.25"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsdown",
|