@better-auth/i18n 1.6.26 → 1.6.27
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,5 @@
|
|
|
1
1
|
import { BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, UnionToIntersection } from "@better-auth/core";
|
|
2
|
-
//#region ../../node_modules/.pnpm/better-call@1.
|
|
2
|
+
//#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
|
|
3
3
|
//#region src/standard-schema.d.ts
|
|
4
4
|
/** The Standard Schema interface. */
|
|
5
5
|
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
@@ -57,7 +57,7 @@ declare namespace StandardSchemaV1 {
|
|
|
57
57
|
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
|
-
//#region ../../node_modules/.pnpm/better-call@1.
|
|
60
|
+
//#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/error.d.mts
|
|
61
61
|
declare const statusCodes: {
|
|
62
62
|
OK: number;
|
|
63
63
|
CREATED: number;
|
|
@@ -135,7 +135,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
|
|
|
135
135
|
errorStack: string | undefined;
|
|
136
136
|
};
|
|
137
137
|
//#endregion
|
|
138
|
-
//#region ../../node_modules/.pnpm/better-call@1.
|
|
138
|
+
//#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
|
|
139
139
|
//#region src/openapi.d.ts
|
|
140
140
|
type OpenAPISchemaType = "string" | "number" | "integer" | "boolean" | "array" | "object";
|
|
141
141
|
interface OpenAPIParameter {
|
|
@@ -157,7 +157,7 @@ interface OpenAPIParameter {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
//#endregion
|
|
160
|
-
//#region ../../node_modules/.pnpm/better-call@1.
|
|
160
|
+
//#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
|
|
161
161
|
//#region src/endpoint.d.ts
|
|
162
162
|
interface EndpointBaseOptions {
|
|
163
163
|
/**
|
|
@@ -315,7 +315,7 @@ interface EndpointBaseOptions {
|
|
|
315
315
|
/**
|
|
316
316
|
* List of middlewares to use
|
|
317
317
|
*/
|
|
318
|
-
use?:
|
|
318
|
+
use?: MiddlewareHandler[];
|
|
319
319
|
/**
|
|
320
320
|
* A callback to run before any API error is throw or returned
|
|
321
321
|
*
|
|
@@ -371,33 +371,21 @@ type EndpointBodyMethodOptions = {
|
|
|
371
371
|
};
|
|
372
372
|
type EndpointOptions = EndpointBaseOptions & EndpointBodyMethodOptions;
|
|
373
373
|
//#endregion
|
|
374
|
-
//#region ../../node_modules/.pnpm/better-call@1.
|
|
375
|
-
|
|
376
|
-
interface MiddlewareOptions extends Omit<EndpointOptions, "method"> {}
|
|
377
|
-
type MiddlewareInputContext<Options extends MiddlewareOptions> = InferBodyInput<Options> & InferQueryInput<Options> & InferRequestInput<Options> & InferHeadersInput<Options> & {
|
|
378
|
-
asResponse?: boolean;
|
|
379
|
-
returnHeaders?: boolean;
|
|
380
|
-
use?: Middleware[];
|
|
381
|
-
};
|
|
382
|
-
type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends (inputCtx: any) => Promise<any> = any> = Handler & {
|
|
383
|
-
options: Options;
|
|
384
|
-
};
|
|
385
|
-
//#endregion
|
|
386
|
-
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/context.d.mts
|
|
387
|
-
type InferBodyInput<Options extends EndpointOptions | MiddlewareOptions, Body = (Options["metadata"] extends {
|
|
374
|
+
//#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 {
|
|
388
376
|
$Infer: {
|
|
389
377
|
body: infer B;
|
|
390
378
|
};
|
|
391
|
-
} ? B : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["body"]> : undefined
|
|
379
|
+
} ? B : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["body"]> : undefined> = undefined extends Body ? {
|
|
392
380
|
body?: Body;
|
|
393
381
|
} : {
|
|
394
382
|
body: Body;
|
|
395
383
|
};
|
|
396
|
-
type InferQueryInput<Options extends EndpointOptions | MiddlewareOptions, Query =
|
|
384
|
+
type InferQueryInput<Options extends EndpointOptions | MiddlewareOptions, Query = Options["metadata"] extends {
|
|
397
385
|
$Infer: {
|
|
398
386
|
query: infer Query;
|
|
399
387
|
};
|
|
400
|
-
} ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["query"]> : Record<string, any> | undefined
|
|
388
|
+
} ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Options["query"]> : Record<string, any> | undefined> = undefined extends Query ? {
|
|
401
389
|
query?: Query;
|
|
402
390
|
} : {
|
|
403
391
|
query: Query;
|
|
@@ -413,6 +401,20 @@ type InferHeadersInput<Option extends EndpointOptions | MiddlewareOptions> = Opt
|
|
|
413
401
|
headers?: HeadersInit;
|
|
414
402
|
};
|
|
415
403
|
//#endregion
|
|
404
|
+
//#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
|
|
405
|
+
//#region src/middleware.d.ts
|
|
406
|
+
interface MiddlewareOptions extends Omit<EndpointOptions, "method"> {}
|
|
407
|
+
type MiddlewareInputContext<Options extends MiddlewareOptions> = InferBodyInput<Options> & InferQueryInput<Options> & InferRequestInput<Options> & InferHeadersInput<Options> & {
|
|
408
|
+
asResponse?: boolean;
|
|
409
|
+
returnHeaders?: boolean;
|
|
410
|
+
use?: MiddlewareHandler[];
|
|
411
|
+
};
|
|
412
|
+
type MiddlewareFunction = (...args: never[]) => Promise<unknown>;
|
|
413
|
+
type MiddlewareHandler = (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<unknown>;
|
|
414
|
+
type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler extends MiddlewareFunction = MiddlewareHandler> = Handler & {
|
|
415
|
+
options: Options;
|
|
416
|
+
};
|
|
417
|
+
//#endregion
|
|
416
418
|
//#region src/types.d.ts
|
|
417
419
|
type ALL_PLUGIN_ERROR_CODE_KEYS = keyof UnionToIntersection<{ [Key in Exclude<BetterAuthPluginRegistryIdentifier, "i18n">]: BetterAuthPluginRegistry<unknown, unknown>[Key] extends {
|
|
418
420
|
creator: infer C;
|
|
@@ -508,7 +510,7 @@ declare const i18n: <Locales extends string[]>(options: I18nOptions<Locales>) =>
|
|
|
508
510
|
hooks: {
|
|
509
511
|
after: {
|
|
510
512
|
matcher: () => true;
|
|
511
|
-
handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void
|
|
513
|
+
handler: Middleware<MiddlewareOptions, (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>>;
|
|
512
514
|
}[];
|
|
513
515
|
};
|
|
514
516
|
options: {
|
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-
|
|
1
|
+
import { i as TranslationDictionary, n as I18nOptions, r as LocaleDetectionStrategy, t as i18n } from "./index-CPhyYdbZ.mjs";
|
|
2
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-B4oCeoTU.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.27",
|
|
4
4
|
"description": "i18n plugin for Better Auth - translate error messages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"tsdown": "0.22.7",
|
|
54
|
-
"@better-auth/core": "1.6.
|
|
55
|
-
"better-auth": "1.6.
|
|
54
|
+
"@better-auth/core": "1.6.27",
|
|
55
|
+
"better-auth": "1.6.27"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@better-auth/core": "^1.6.
|
|
59
|
-
"better-auth": "^1.6.
|
|
58
|
+
"@better-auth/core": "^1.6.27",
|
|
59
|
+
"better-auth": "^1.6.27"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsdown",
|