@convex-dev/better-auth 0.10.13 → 0.11.1
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/auth-options.d.ts.map +1 -1
- package/dist/auth-options.js +0 -2
- package/dist/auth-options.js.map +1 -1
- package/dist/client/adapter-utils.d.ts +10 -10
- package/dist/client/adapter-utils.d.ts.map +1 -1
- package/dist/client/adapter-utils.js +41 -32
- package/dist/client/adapter-utils.js.map +1 -1
- package/dist/client/adapter.d.ts +1 -1
- package/dist/client/adapter.d.ts.map +1 -1
- package/dist/client/adapter.js +113 -7
- package/dist/client/adapter.js.map +1 -1
- package/dist/client/create-api.d.ts +8 -7
- package/dist/client/create-api.d.ts.map +1 -1
- package/dist/client/create-api.js +1 -0
- package/dist/client/create-api.js.map +1 -1
- package/dist/client/create-client.d.ts +1 -1
- package/dist/client/create-client.d.ts.map +1 -1
- package/dist/client/create-client.js +8 -7
- package/dist/client/create-client.js.map +1 -1
- package/dist/client/create-schema.d.ts +0 -1
- package/dist/client/create-schema.d.ts.map +1 -1
- package/dist/client/create-schema.js +0 -1
- package/dist/client/create-schema.js.map +1 -1
- package/dist/component/_generated/api.d.ts +12 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +7407 -92
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/adapter.d.ts +8 -7
- package/dist/component/adapter.d.ts.map +1 -1
- package/dist/component/adapterTest.d.ts +1 -7
- package/dist/component/adapterTest.d.ts.map +1 -1
- package/dist/component/adapterTest.js +193 -390
- package/dist/component/adapterTest.js.map +1 -1
- package/dist/component/schema.d.ts +35 -74
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +16 -21
- package/dist/component/schema.js.map +1 -1
- package/dist/component/testProfiles/adapterAdditionalFields.d.ts +131 -0
- package/dist/component/testProfiles/adapterAdditionalFields.d.ts.map +1 -0
- package/dist/component/testProfiles/adapterAdditionalFields.js +5 -0
- package/dist/component/testProfiles/adapterAdditionalFields.js.map +1 -0
- package/dist/component/testProfiles/adapterOrganizationJoins.d.ts +131 -0
- package/dist/component/testProfiles/adapterOrganizationJoins.d.ts.map +1 -0
- package/dist/component/testProfiles/adapterOrganizationJoins.js +5 -0
- package/dist/component/testProfiles/adapterOrganizationJoins.js.map +1 -0
- package/dist/component/testProfiles/adapterPluginTable.d.ts +131 -0
- package/dist/component/testProfiles/adapterPluginTable.d.ts.map +1 -0
- package/dist/component/testProfiles/adapterPluginTable.js +5 -0
- package/dist/component/testProfiles/adapterPluginTable.js.map +1 -0
- package/dist/component/testProfiles/adapterRenameField.d.ts +131 -0
- package/dist/component/testProfiles/adapterRenameField.d.ts.map +1 -0
- package/dist/component/testProfiles/adapterRenameField.js +5 -0
- package/dist/component/testProfiles/adapterRenameField.js.map +1 -0
- package/dist/component/testProfiles/adapterRenameUserCustom.d.ts +131 -0
- package/dist/component/testProfiles/adapterRenameUserCustom.d.ts.map +1 -0
- package/dist/component/testProfiles/adapterRenameUserCustom.js +5 -0
- package/dist/component/testProfiles/adapterRenameUserCustom.js.map +1 -0
- package/dist/component/testProfiles/adapterRenameUserTable.d.ts +131 -0
- package/dist/component/testProfiles/adapterRenameUserTable.d.ts.map +1 -0
- package/dist/component/testProfiles/adapterRenameUserTable.js +5 -0
- package/dist/component/testProfiles/adapterRenameUserTable.js.map +1 -0
- package/dist/component/testProfiles/auth-options.profile-additional-fields.d.ts +3 -0
- package/dist/component/testProfiles/auth-options.profile-additional-fields.d.ts.map +1 -0
- package/dist/component/testProfiles/auth-options.profile-additional-fields.js +38 -0
- package/dist/component/testProfiles/auth-options.profile-additional-fields.js.map +1 -0
- package/dist/component/testProfiles/auth-options.profile-plugin-table.d.ts +3 -0
- package/dist/component/testProfiles/auth-options.profile-plugin-table.d.ts.map +1 -0
- package/dist/component/testProfiles/auth-options.profile-plugin-table.js +92 -0
- package/dist/component/testProfiles/auth-options.profile-plugin-table.js.map +1 -0
- package/dist/component/testProfiles/auth-options.profile-rename-joins.d.ts +6 -0
- package/dist/component/testProfiles/auth-options.profile-rename-joins.d.ts.map +1 -0
- package/dist/component/testProfiles/auth-options.profile-rename-joins.js +49 -0
- package/dist/component/testProfiles/auth-options.profile-rename-joins.js.map +1 -0
- package/dist/component/testProfiles/schema.profile-additional-fields.d.ts +227 -0
- package/dist/component/testProfiles/schema.profile-additional-fields.d.ts.map +1 -0
- package/dist/component/testProfiles/schema.profile-additional-fields.js +37 -0
- package/dist/component/testProfiles/schema.profile-additional-fields.js.map +1 -0
- package/dist/component/testProfiles/schema.profile-plugin-table.d.ts +450 -0
- package/dist/component/testProfiles/schema.profile-plugin-table.d.ts.map +1 -0
- package/dist/component/testProfiles/schema.profile-plugin-table.js +116 -0
- package/dist/component/testProfiles/schema.profile-plugin-table.js.map +1 -0
- package/dist/nextjs/index.d.ts.map +1 -1
- package/dist/nextjs/index.js +1 -0
- package/dist/nextjs/index.js.map +1 -1
- package/dist/plugins/convex/index.d.ts +131 -12
- package/dist/plugins/convex/index.d.ts.map +1 -1
- package/dist/plugins/convex/index.js +12 -5
- package/dist/plugins/convex/index.js.map +1 -1
- package/dist/plugins/cross-domain/client.d.ts +1 -1
- package/dist/plugins/cross-domain/index.d.ts +126 -1
- package/dist/plugins/cross-domain/index.d.ts.map +1 -1
- package/dist/plugins/cross-domain/index.js +10 -15
- package/dist/plugins/cross-domain/index.js.map +1 -1
- package/dist/react-start/index.d.ts.map +1 -1
- package/dist/react-start/index.js +1 -0
- package/dist/react-start/index.js.map +1 -1
- package/dist/test/adapter-factory/auth-flow.d.ts +42 -0
- package/dist/test/adapter-factory/auth-flow.d.ts.map +1 -0
- package/dist/test/adapter-factory/auth-flow.js +145 -0
- package/dist/test/adapter-factory/auth-flow.js.map +1 -0
- package/dist/test/adapter-factory/basic.d.ts +190 -0
- package/dist/test/adapter-factory/basic.d.ts.map +1 -0
- package/dist/test/adapter-factory/basic.js +2713 -0
- package/dist/test/adapter-factory/basic.js.map +1 -0
- package/dist/test/adapter-factory/convex-custom.d.ts +18 -0
- package/dist/test/adapter-factory/convex-custom.d.ts.map +1 -0
- package/dist/test/adapter-factory/convex-custom.js +610 -0
- package/dist/test/adapter-factory/convex-custom.js.map +1 -0
- package/dist/test/adapter-factory/index.d.ts +11 -0
- package/dist/test/adapter-factory/index.d.ts.map +1 -0
- package/dist/test/adapter-factory/index.js +11 -0
- package/dist/test/adapter-factory/index.js.map +1 -0
- package/dist/test/adapter-factory/joins.d.ts +18 -0
- package/dist/test/adapter-factory/joins.d.ts.map +1 -0
- package/dist/test/adapter-factory/joins.js +22 -0
- package/dist/test/adapter-factory/joins.js.map +1 -0
- package/dist/test/adapter-factory/number-id.d.ts +18 -0
- package/dist/test/adapter-factory/number-id.d.ts.map +1 -0
- package/dist/test/adapter-factory/number-id.js +36 -0
- package/dist/test/adapter-factory/number-id.js.map +1 -0
- package/dist/test/adapter-factory/profile-additional-fields.d.ts +71 -0
- package/dist/test/adapter-factory/profile-additional-fields.d.ts.map +1 -0
- package/dist/test/adapter-factory/profile-additional-fields.js +44 -0
- package/dist/test/adapter-factory/profile-additional-fields.js.map +1 -0
- package/dist/test/adapter-factory/profile-plugin-table.d.ts +19 -0
- package/dist/test/adapter-factory/profile-plugin-table.d.ts.map +1 -0
- package/dist/test/adapter-factory/profile-plugin-table.js +25 -0
- package/dist/test/adapter-factory/profile-plugin-table.js.map +1 -0
- package/dist/test/adapter-factory/profile-rename-joins.d.ts +73 -0
- package/dist/test/adapter-factory/profile-rename-joins.d.ts.map +1 -0
- package/dist/test/adapter-factory/profile-rename-joins.js +34 -0
- package/dist/test/adapter-factory/profile-rename-joins.js.map +1 -0
- package/dist/test/adapter-factory/transactions.d.ts +21 -0
- package/dist/test/adapter-factory/transactions.d.ts.map +1 -0
- package/dist/test/adapter-factory/transactions.js +28 -0
- package/dist/test/adapter-factory/transactions.js.map +1 -0
- package/dist/test/adapter-factory/uuid.d.ts +18 -0
- package/dist/test/adapter-factory/uuid.d.ts.map +1 -0
- package/dist/test/adapter-factory/uuid.js +58 -0
- package/dist/test/adapter-factory/uuid.js.map +1 -0
- package/dist/utils/index.d.ts +18 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +8 -4
- package/src/auth-options.ts +0 -2
- package/src/client/adapter-utils.ts +80 -73
- package/src/client/adapter.test.ts +2 -74
- package/src/client/adapter.ts +142 -7
- package/src/client/create-api.ts +1 -0
- package/src/client/create-client.ts +14 -6
- package/src/client/create-schema.ts +0 -1
- package/src/component/_generated/api.ts +12 -0
- package/src/component/_generated/component.ts +19454 -215
- package/src/component/adapterTest.ts +250 -466
- package/src/component/schema.ts +21 -26
- package/src/component/testProfiles/adapterAdditionalFields.ts +13 -0
- package/src/component/testProfiles/adapterOrganizationJoins.ts +13 -0
- package/src/component/testProfiles/adapterPluginTable.ts +13 -0
- package/src/component/testProfiles/adapterRenameField.ts +13 -0
- package/src/component/testProfiles/adapterRenameUserCustom.ts +13 -0
- package/src/component/testProfiles/adapterRenameUserTable.ts +13 -0
- package/src/component/testProfiles/auth-options.profile-additional-fields.ts +39 -0
- package/src/component/testProfiles/auth-options.profile-plugin-table.ts +93 -0
- package/src/component/testProfiles/auth-options.profile-rename-joins.ts +54 -0
- package/src/component/testProfiles/schema.profile-additional-fields.ts +39 -0
- package/src/component/testProfiles/schema.profile-plugin-table.ts +130 -0
- package/src/nextjs/index.ts +1 -0
- package/src/plugins/convex/index.test.ts +55 -0
- package/src/plugins/convex/index.ts +26 -11
- package/src/plugins/cross-domain/index.test.ts +67 -0
- package/src/plugins/cross-domain/index.ts +10 -21
- package/src/react-start/index.ts +1 -0
- package/src/test/adapter-factory/auth-flow.ts +170 -0
- package/src/test/adapter-factory/basic.ts +3190 -0
- package/src/test/adapter-factory/convex-custom.ts +706 -0
- package/src/test/adapter-factory/index.ts +10 -0
- package/src/test/adapter-factory/joins.ts +28 -0
- package/src/test/adapter-factory/number-id.ts +45 -0
- package/src/test/adapter-factory/profile-additional-fields.ts +84 -0
- package/src/test/adapter-factory/profile-plugin-table.ts +37 -0
- package/src/test/adapter-factory/profile-rename-joins.ts +67 -0
- package/src/test/adapter-factory/transactions.ts +38 -0
- package/src/test/adapter-factory/uuid.ts +67 -0
- package/src/utils/index.ts +25 -3
package/src/client/create-api.ts
CHANGED
|
@@ -124,6 +124,7 @@ export const createApi = <Schema extends SchemaDefinition<any, any>>(
|
|
|
124
124
|
...Object.keys(schema.tables).map((model) => v.literal(model))
|
|
125
125
|
),
|
|
126
126
|
where: v.optional(v.array(adapterWhereValidator)),
|
|
127
|
+
select: v.optional(v.array(v.string())),
|
|
127
128
|
limit: v.optional(v.number()),
|
|
128
129
|
sortBy: v.optional(
|
|
129
130
|
v.object({
|
|
@@ -402,18 +402,26 @@ export const createClient = <
|
|
|
402
402
|
? { allowedOrigins: [], allowedHeaders: [], exposedHeaders: [] }
|
|
403
403
|
: opts.cors;
|
|
404
404
|
let trustedOriginsOption:
|
|
405
|
-
| string[]
|
|
406
|
-
| ((
|
|
405
|
+
| (string | null | undefined)[]
|
|
406
|
+
| ((
|
|
407
|
+
request?: Request
|
|
408
|
+
) =>
|
|
409
|
+
| (string | null | undefined)[]
|
|
410
|
+
| Promise<(string | null | undefined)[]>)
|
|
407
411
|
| undefined;
|
|
408
412
|
const cors = corsRouter(http, {
|
|
409
413
|
allowedOrigins: async (request) => {
|
|
410
|
-
|
|
414
|
+
const resolvedTrustedOrigins =
|
|
411
415
|
trustedOriginsOption ??
|
|
412
416
|
(await staticAuth.$context).options.trustedOrigins ??
|
|
413
417
|
[];
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
418
|
+
trustedOriginsOption = resolvedTrustedOrigins;
|
|
419
|
+
const rawOrigins = Array.isArray(resolvedTrustedOrigins)
|
|
420
|
+
? resolvedTrustedOrigins
|
|
421
|
+
: await resolvedTrustedOrigins(request);
|
|
422
|
+
const trustedOrigins = rawOrigins.filter(
|
|
423
|
+
(origin): origin is string => typeof origin === "string"
|
|
424
|
+
);
|
|
417
425
|
return trustedOrigins
|
|
418
426
|
.map((origin) =>
|
|
419
427
|
// Strip trailing wildcards, unsupported for allowedOrigins
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
import type * as adapter from "../adapter.js";
|
|
12
12
|
import type * as adapterTest from "../adapterTest.js";
|
|
13
|
+
import type * as testProfiles_adapterAdditionalFields from "../testProfiles/adapterAdditionalFields.js";
|
|
14
|
+
import type * as testProfiles_adapterOrganizationJoins from "../testProfiles/adapterOrganizationJoins.js";
|
|
15
|
+
import type * as testProfiles_adapterPluginTable from "../testProfiles/adapterPluginTable.js";
|
|
16
|
+
import type * as testProfiles_adapterRenameField from "../testProfiles/adapterRenameField.js";
|
|
17
|
+
import type * as testProfiles_adapterRenameUserCustom from "../testProfiles/adapterRenameUserCustom.js";
|
|
18
|
+
import type * as testProfiles_adapterRenameUserTable from "../testProfiles/adapterRenameUserTable.js";
|
|
13
19
|
|
|
14
20
|
import type {
|
|
15
21
|
ApiFromModules,
|
|
@@ -21,6 +27,12 @@ import { anyApi, componentsGeneric } from "convex/server";
|
|
|
21
27
|
const fullApi: ApiFromModules<{
|
|
22
28
|
adapter: typeof adapter;
|
|
23
29
|
adapterTest: typeof adapterTest;
|
|
30
|
+
"testProfiles/adapterAdditionalFields": typeof testProfiles_adapterAdditionalFields;
|
|
31
|
+
"testProfiles/adapterOrganizationJoins": typeof testProfiles_adapterOrganizationJoins;
|
|
32
|
+
"testProfiles/adapterPluginTable": typeof testProfiles_adapterPluginTable;
|
|
33
|
+
"testProfiles/adapterRenameField": typeof testProfiles_adapterRenameField;
|
|
34
|
+
"testProfiles/adapterRenameUserCustom": typeof testProfiles_adapterRenameUserCustom;
|
|
35
|
+
"testProfiles/adapterRenameUserTable": typeof testProfiles_adapterRenameUserTable;
|
|
24
36
|
}> = anyApi as any;
|
|
25
37
|
|
|
26
38
|
/**
|