better-convex 0.10.3 → 0.11.0
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/aggregate/index.d.ts +4 -1
- package/dist/auth/http/index.d.ts +3 -2
- package/dist/auth/http/index.js +3 -2
- package/dist/auth/index.d.ts +89 -18728
- package/dist/auth/index.js +194 -53
- package/dist/auth/nextjs/index.d.ts +2 -1
- package/dist/auth/nextjs/index.js +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/{codegen-69-_7r9o.mjs → codegen-8sQ2Ymz3.mjs} +37 -93
- package/dist/{create-schema-BsN0jL5S.js → create-schema-BOPznRpP.js} +0 -1
- package/dist/{create-schema-orm-OcyA0apQ.js → create-schema-orm-CZMm2FW2.js} +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/plugins/index.d.ts +4 -4
- package/dist/plugins/ratelimit/index.d.ts +4 -1
- package/dist/{procedure-caller-kZJx_hmP.d.ts → procedure-caller-Cg6bxkDQ.d.ts} +20 -5
- package/dist/server/index.d.ts +3 -2
- package/dist/server/index.js +22 -1
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-BCECnxsG.d.ts → where-clause-compiler-CUzMH_BM.d.ts} +4 -1
- package/package.json +3 -3
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../validators-BcQFm1oY.js";
|
|
2
|
+
import { Jn as ConvexTextBuilderInitial, Ot as ConvexCustomBuilderInitial, in as ConvexTableWithColumns, vt as ConvexNumberBuilderInitial, xt as ConvexIdBuilderInitial } from "../where-clause-compiler-CUzMH_BM.js";
|
|
3
|
+
import "../query-context-ji7By8u0.js";
|
|
4
|
+
import "../orm/index.js";
|
|
2
5
|
import * as convex_values0 from "convex/values";
|
|
3
6
|
import { GenericId, Infer, Value } from "convex/values";
|
|
4
7
|
import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
|
|
@@ -31,17 +31,18 @@ declare function authMiddleware(getAuth: GetAuth<unknown, {
|
|
|
31
31
|
}>, opts?: AuthMiddlewareOptions): MiddlewareHandler;
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/auth/registerRoutes.d.ts
|
|
34
|
+
type TrustedOriginsOption = (string | null | undefined)[] | ((request?: Request) => (string | null | undefined)[] | Promise<(string | null | undefined)[]>);
|
|
34
35
|
type AuthRouteContract = {
|
|
35
36
|
$context: Promise<{
|
|
36
37
|
options: {
|
|
37
|
-
trustedOrigins?:
|
|
38
|
+
trustedOrigins?: TrustedOriginsOption;
|
|
38
39
|
};
|
|
39
40
|
}>;
|
|
40
41
|
handler: (request: Request) => Promise<Response>;
|
|
41
42
|
options: {
|
|
42
43
|
basePath?: string;
|
|
43
44
|
baseURL?: string;
|
|
44
|
-
trustedOrigins?:
|
|
45
|
+
trustedOrigins?: TrustedOriginsOption;
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
48
|
declare const registerRoutes: (http: HttpRouter, getAuth: GetAuth<unknown, AuthRouteContract>, opts?: {
|
package/dist/auth/http/index.js
CHANGED
|
@@ -377,8 +377,9 @@ const registerRoutes = (http, getAuth, opts = {}) => {
|
|
|
377
377
|
enforceAllowOrigins: false,
|
|
378
378
|
exposedHeaders: ["Set-Better-Auth-Cookie"].concat(corsOpts.exposedHeaders ?? []),
|
|
379
379
|
allowedOrigins: async (request) => {
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
const resolvedTrustedOrigins = trustedOriginsOption ?? (await staticAuth.$context).options.trustedOrigins ?? [];
|
|
381
|
+
trustedOriginsOption = resolvedTrustedOrigins;
|
|
382
|
+
return (Array.isArray(resolvedTrustedOrigins) ? resolvedTrustedOrigins : await resolvedTrustedOrigins(request) ?? []).filter((origin) => typeof origin === "string").map((origin) => origin.endsWith("*") && origin.length > 1 ? origin.slice(0, -1) : origin).concat(corsOpts.allowedOrigins ?? []);
|
|
382
383
|
}
|
|
383
384
|
});
|
|
384
385
|
cors.route({
|