@lupinum/better-convex-nuxt 0.8.0-beta.40
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/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +201 -0
- package/README.md +151 -0
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/dist/module.d.mts +55 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +309 -0
- package/dist/runtime/auth/auth-identity.d.ts +31 -0
- package/dist/runtime/auth/auth-identity.js +21 -0
- package/dist/runtime/auth/better-auth-browser-adapter.d.ts +33 -0
- package/dist/runtime/auth/better-auth-browser-adapter.js +215 -0
- package/dist/runtime/auth/client-engine-types.d.ts +4 -0
- package/dist/runtime/auth/client-engine-types.js +0 -0
- package/dist/runtime/auth/integrated-client.d.ts +25 -0
- package/dist/runtime/auth/integrated-client.js +132 -0
- package/dist/runtime/auth/operation-tracker.d.ts +7 -0
- package/dist/runtime/auth/operation-tracker.js +14 -0
- package/dist/runtime/auth/session-synchronization.d.ts +23 -0
- package/dist/runtime/auth/session-synchronization.js +156 -0
- package/dist/runtime/auth/token-fetcher.d.ts +66 -0
- package/dist/runtime/auth/token-fetcher.js +131 -0
- package/dist/runtime/auth/validate-auth-client-definition.d.ts +12 -0
- package/dist/runtime/auth/validate-auth-client-definition.js +47 -0
- package/dist/runtime/auth-client/convex-client-plugin.d.ts +31 -0
- package/dist/runtime/auth-client/convex-client-plugin.js +14 -0
- package/dist/runtime/auth-client/definition-types.d.ts +6 -0
- package/dist/runtime/auth-client/definition-types.js +0 -0
- package/dist/runtime/auth-client/empty-definition.d.ts +2 -0
- package/dist/runtime/auth-client/empty-definition.js +2 -0
- package/dist/runtime/auth-client/index.d.ts +71 -0
- package/dist/runtime/auth-client/index.js +3 -0
- package/dist/runtime/cli/auth-schema.d.ts +2 -0
- package/dist/runtime/cli/auth-schema.js +169 -0
- package/dist/runtime/cli/convex.d.ts +11 -0
- package/dist/runtime/cli/convex.js +274 -0
- package/dist/runtime/composables/useConvex.d.ts +4 -0
- package/dist/runtime/composables/useConvex.js +9 -0
- package/dist/runtime/composables/useConvexAction.d.ts +4 -0
- package/dist/runtime/composables/useConvexAction.js +18 -0
- package/dist/runtime/composables/useConvexAttachment.d.ts +9 -0
- package/dist/runtime/composables/useConvexAttachment.js +14 -0
- package/dist/runtime/composables/useConvexAuth.d.ts +10 -0
- package/dist/runtime/composables/useConvexAuth.js +37 -0
- package/dist/runtime/composables/useConvexConfig.d.ts +12 -0
- package/dist/runtime/composables/useConvexConfig.js +7 -0
- package/dist/runtime/composables/useConvexConnectionState.d.ts +33 -0
- package/dist/runtime/composables/useConvexConnectionState.js +24 -0
- package/dist/runtime/composables/useConvexFileUpload.d.ts +169 -0
- package/dist/runtime/composables/useConvexFileUpload.js +198 -0
- package/dist/runtime/composables/useConvexMutation.d.ts +13 -0
- package/dist/runtime/composables/useConvexMutation.js +24 -0
- package/dist/runtime/composables/useConvexPaginatedQuery.d.ts +13 -0
- package/dist/runtime/composables/useConvexPaginatedQuery.js +256 -0
- package/dist/runtime/composables/useConvexQuery.d.ts +19 -0
- package/dist/runtime/composables/useConvexQuery.js +308 -0
- package/dist/runtime/convex-auth/adapter/create-adapter.d.ts +33 -0
- package/dist/runtime/convex-auth/adapter/create-adapter.js +308 -0
- package/dist/runtime/convex-auth/adapter/define-functions.d.ts +160 -0
- package/dist/runtime/convex-auth/adapter/define-functions.js +497 -0
- package/dist/runtime/convex-auth/adapter/generate-schema.d.ts +16 -0
- package/dist/runtime/convex-auth/adapter/generate-schema.js +332 -0
- package/dist/runtime/convex-auth/adapter/metadata.d.ts +44 -0
- package/dist/runtime/convex-auth/adapter/metadata.js +91 -0
- package/dist/runtime/convex-auth/adapter/query.d.ts +32 -0
- package/dist/runtime/convex-auth/adapter/query.js +275 -0
- package/dist/runtime/convex-auth/adapter/relationships.d.ts +20 -0
- package/dist/runtime/convex-auth/adapter/relationships.js +128 -0
- package/dist/runtime/convex-auth/component/_generated/api.js +5 -0
- package/dist/runtime/convex-auth/component/_generated/component.d.ts +116 -0
- package/dist/runtime/convex-auth/component/_generated/component.js +0 -0
- package/dist/runtime/convex-auth/component/_generated/dataModel.js +0 -0
- package/dist/runtime/convex-auth/component/_generated/server.js +16 -0
- package/dist/runtime/convex-auth/component/adapter.d.ts +142 -0
- package/dist/runtime/convex-auth/component/adapter.js +16 -0
- package/dist/runtime/convex-auth/component/convex.config.d.ts +2 -0
- package/dist/runtime/convex-auth/component/convex.config.js +3 -0
- package/dist/runtime/convex-auth/component/schema.d.ts +799 -0
- package/dist/runtime/convex-auth/component/schema.js +180 -0
- package/dist/runtime/convex-auth/component/schemaMetadata.d.ts +2094 -0
- package/dist/runtime/convex-auth/component/schemaMetadata.js +2161 -0
- package/dist/runtime/convex-auth/context.d.ts +5 -0
- package/dist/runtime/convex-auth/context.js +8 -0
- package/dist/runtime/convex-auth/create-auth-component.d.ts +41 -0
- package/dist/runtime/convex-auth/create-auth-component.js +157 -0
- package/dist/runtime/convex-auth/index.d.ts +11 -0
- package/dist/runtime/convex-auth/index.js +7 -0
- package/dist/runtime/convex-auth/internal-session.d.ts +2 -0
- package/dist/runtime/convex-auth/internal-session.js +1 -0
- package/dist/runtime/convex-auth/jwks-rotation.d.ts +58 -0
- package/dist/runtime/convex-auth/jwks-rotation.js +163 -0
- package/dist/runtime/convex-auth/oauth-live-access.d.ts +17 -0
- package/dist/runtime/convex-auth/oauth-live-access.js +78 -0
- package/dist/runtime/convex-auth/oauth-provider-compat.d.ts +10 -0
- package/dist/runtime/convex-auth/oauth-provider-compat.js +170 -0
- package/dist/runtime/convex-auth/oauth-resource.d.ts +39 -0
- package/dist/runtime/convex-auth/oauth-resource.js +118 -0
- package/dist/runtime/convex-auth/oauth-security.d.ts +82 -0
- package/dist/runtime/convex-auth/oauth-security.js +454 -0
- package/dist/runtime/convex-auth/origin.d.ts +4 -0
- package/dist/runtime/convex-auth/origin.js +9 -0
- package/dist/runtime/convex-auth/plugin.d.ts +18 -0
- package/dist/runtime/convex-auth/plugin.js +605 -0
- package/dist/runtime/convex-auth/provider.d.ts +2 -0
- package/dist/runtime/convex-auth/provider.js +11 -0
- package/dist/runtime/convex-auth/test.d.ts +410 -0
- package/dist/runtime/convex-auth/test.js +9 -0
- package/dist/runtime/convex-auth/types.d.ts +18 -0
- package/dist/runtime/convex-auth/types.js +0 -0
- package/dist/runtime/convex-auth/user-projection.d.ts +106 -0
- package/dist/runtime/convex-auth/user-projection.js +128 -0
- package/dist/runtime/devtools/auth-proxy-registry.d.ts +4 -0
- package/dist/runtime/devtools/auth-proxy-registry.js +47 -0
- package/dist/runtime/devtools/bridge-setup.d.ts +21 -0
- package/dist/runtime/devtools/bridge-setup.js +165 -0
- package/dist/runtime/devtools/path-utils.d.ts +2 -0
- package/dist/runtime/devtools/path-utils.js +12 -0
- package/dist/runtime/devtools/server.d.ts +2 -0
- package/dist/runtime/devtools/server.js +108 -0
- package/dist/runtime/devtools/setup-client.d.ts +16 -0
- package/dist/runtime/devtools/setup-client.js +43 -0
- package/dist/runtime/devtools/sink.d.ts +18 -0
- package/dist/runtime/devtools/sink.js +110 -0
- package/dist/runtime/devtools/transport.d.ts +16 -0
- package/dist/runtime/devtools/transport.js +149 -0
- package/dist/runtime/devtools/types.d.ts +167 -0
- package/dist/runtime/devtools/types.js +1 -0
- package/dist/runtime/devtools/ui/dist/200.html +1 -0
- package/dist/runtime/devtools/ui/dist/404.html +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/C4MASuCh.js +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/DJHkqtZq.js +3 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/DWwrCltl.js +2 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/DZ_UiYoH.js +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/_m9ujb-i.js +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/builds/latest.json +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/builds/meta/better-convex-nuxt-devtools.json +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/entry.DpFDKYZ5.css +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/error-404.DYUJo5xt.css +1 -0
- package/dist/runtime/devtools/ui/dist/_nuxt/error-500.DQdoJJXg.css +1 -0
- package/dist/runtime/devtools/ui/dist/convex-logo.svg +5 -0
- package/dist/runtime/devtools/ui/dist/index.html +1 -0
- package/dist/runtime/errors/index.d.ts +7 -0
- package/dist/runtime/errors/index.js +5 -0
- package/dist/runtime/middleware/convex-auth.global.d.ts +2 -0
- package/dist/runtime/middleware/convex-auth.global.js +31 -0
- package/dist/runtime/plugin.auth.client.d.ts +3 -0
- package/dist/runtime/plugin.auth.client.js +217 -0
- package/dist/runtime/plugin.client.d.ts +3 -0
- package/dist/runtime/plugin.client.js +43 -0
- package/dist/runtime/plugin.server.d.ts +12 -0
- package/dist/runtime/plugin.server.js +98 -0
- package/dist/runtime/plugins/convex-call-error-payload.d.ts +14 -0
- package/dist/runtime/plugins/convex-call-error-payload.js +12 -0
- package/dist/runtime/runtime-context.d.ts +26 -0
- package/dist/runtime/runtime-context.js +48 -0
- package/dist/runtime/server/api/auth/[...].d.ts +10 -0
- package/dist/runtime/server/api/auth/[...].js +509 -0
- package/dist/runtime/server/api/auth/authorization-server-metadata.d.ts +2 -0
- package/dist/runtime/server/api/auth/authorization-server-metadata.js +6 -0
- package/dist/runtime/server/api/auth/body-size.d.ts +15 -0
- package/dist/runtime/server/api/auth/body-size.js +179 -0
- package/dist/runtime/server/api/auth/headers.d.ts +6 -0
- package/dist/runtime/server/api/auth/headers.js +98 -0
- package/dist/runtime/server/api/auth/jwks.d.ts +2 -0
- package/dist/runtime/server/api/auth/jwks.js +6 -0
- package/dist/runtime/server/api/auth/security.d.ts +14 -0
- package/dist/runtime/server/api/auth/security.js +85 -0
- package/dist/runtime/server/api/release-fingerprint.d.ts +2 -0
- package/dist/runtime/server/api/release-fingerprint.js +36 -0
- package/dist/runtime/server/index.d.ts +1 -0
- package/dist/runtime/server/index.js +3 -0
- package/dist/runtime/server/plugins/runtime-config.d.ts +7 -0
- package/dist/runtime/server/plugins/runtime-config.js +7 -0
- package/dist/runtime/server/utils/auth-snapshot.d.ts +26 -0
- package/dist/runtime/server/utils/auth-snapshot.js +165 -0
- package/dist/runtime/server/utils/http.d.ts +16 -0
- package/dist/runtime/server/utils/http.js +133 -0
- package/dist/runtime/server/utils/server-convex-caller.d.ts +31 -0
- package/dist/runtime/server/utils/server-convex-caller.js +151 -0
- package/dist/runtime/server/utils/server-convex-options.d.ts +83 -0
- package/dist/runtime/server/utils/server-convex-options.js +69 -0
- package/dist/runtime/server/utils/signed-client-ip.d.ts +6 -0
- package/dist/runtime/server/utils/signed-client-ip.js +29 -0
- package/dist/runtime/server/utils/ssr-auth-headers.d.ts +26 -0
- package/dist/runtime/server/utils/ssr-auth-headers.js +49 -0
- package/dist/runtime/server/utils/token-exchange.d.ts +27 -0
- package/dist/runtime/server/utils/token-exchange.js +96 -0
- package/dist/runtime/shared/auth-cookie.d.ts +4 -0
- package/dist/runtime/shared/auth-cookie.js +25 -0
- package/dist/runtime/shared/auth-origin.d.ts +15 -0
- package/dist/runtime/shared/auth-origin.js +42 -0
- package/dist/runtime/shared/bounded-stream.d.ts +2 -0
- package/dist/runtime/shared/bounded-stream.js +50 -0
- package/dist/runtime/shared/client-ip.d.ts +21 -0
- package/dist/runtime/shared/client-ip.js +123 -0
- package/dist/runtime/shared/release-fingerprint.d.ts +5 -0
- package/dist/runtime/shared/release-fingerprint.js +17 -0
- package/dist/runtime/types.d.ts +19 -0
- package/dist/runtime/utils/auth-config.d.ts +24 -0
- package/dist/runtime/utils/auth-config.js +45 -0
- package/dist/runtime/utils/auth-contract.d.ts +22 -0
- package/dist/runtime/utils/auth-contract.js +0 -0
- package/dist/runtime/utils/auth-errors.d.ts +5 -0
- package/dist/runtime/utils/auth-errors.js +22 -0
- package/dist/runtime/utils/auth-identity-state.d.ts +4 -0
- package/dist/runtime/utils/auth-identity-state.js +8 -0
- package/dist/runtime/utils/auth-pending-state.d.ts +13 -0
- package/dist/runtime/utils/auth-pending-state.js +4 -0
- package/dist/runtime/utils/auth-pending.d.ts +10 -0
- package/dist/runtime/utils/auth-pending.js +30 -0
- package/dist/runtime/utils/auth-route-protection.d.ts +16 -0
- package/dist/runtime/utils/auth-route-protection.js +58 -0
- package/dist/runtime/utils/auth-status.d.ts +47 -0
- package/dist/runtime/utils/auth-status.js +8 -0
- package/dist/runtime/utils/bounded-convex-fetch.d.ts +18 -0
- package/dist/runtime/utils/bounded-convex-fetch.js +152 -0
- package/dist/runtime/utils/callable-devtools.d.ts +17 -0
- package/dist/runtime/utils/callable-devtools.js +49 -0
- package/dist/runtime/utils/callable-observer.d.ts +2 -0
- package/dist/runtime/utils/callable-observer.js +1 -0
- package/dist/runtime/utils/composable-scope.d.ts +2 -0
- package/dist/runtime/utils/composable-scope.js +8 -0
- package/dist/runtime/utils/config-defaults.d.ts +8 -0
- package/dist/runtime/utils/config-defaults.js +8 -0
- package/dist/runtime/utils/convex-cache.d.ts +68 -0
- package/dist/runtime/utils/convex-cache.js +47 -0
- package/dist/runtime/utils/convex-config.d.ts +16 -0
- package/dist/runtime/utils/convex-config.js +50 -0
- package/dist/runtime/utils/convex-shared.d.ts +67 -0
- package/dist/runtime/utils/convex-shared.js +134 -0
- package/dist/runtime/utils/identity-changed-error.d.ts +4 -0
- package/dist/runtime/utils/identity-changed-error.js +12 -0
- package/dist/runtime/utils/identity-key.d.ts +19 -0
- package/dist/runtime/utils/identity-key.js +10 -0
- package/dist/runtime/utils/integrated-auth-client.d.ts +5 -0
- package/dist/runtime/utils/integrated-auth-client.js +0 -0
- package/dist/runtime/utils/logger.d.ts +42 -0
- package/dist/runtime/utils/logger.js +190 -0
- package/dist/runtime/utils/mime-type.d.ts +33 -0
- package/dist/runtime/utils/mime-type.js +10 -0
- package/dist/runtime/utils/query-execution-gate.d.ts +47 -0
- package/dist/runtime/utils/query-execution-gate.js +63 -0
- package/dist/runtime/utils/query-execution.d.ts +8 -0
- package/dist/runtime/utils/query-execution.js +19 -0
- package/dist/runtime/utils/query-foundation.d.ts +20 -0
- package/dist/runtime/utils/query-foundation.js +39 -0
- package/dist/runtime/utils/query-state.d.ts +12 -0
- package/dist/runtime/utils/query-state.js +12 -0
- package/dist/runtime/utils/reactive-args.d.ts +5 -0
- package/dist/runtime/utils/reactive-args.js +42 -0
- package/dist/runtime/utils/runtime-config-normalize.d.ts +22 -0
- package/dist/runtime/utils/runtime-config-normalize.js +28 -0
- package/dist/runtime/utils/runtime-config.d.ts +4 -0
- package/dist/runtime/utils/runtime-config.js +8 -0
- package/dist/runtime/utils/sanitize-diagnostic.d.ts +6 -0
- package/dist/runtime/utils/sanitize-diagnostic.js +81 -0
- package/dist/runtime/utils/shared-helpers.d.ts +46 -0
- package/dist/runtime/utils/shared-helpers.js +139 -0
- package/dist/runtime/utils/site-url.d.ts +4 -0
- package/dist/runtime/utils/site-url.js +15 -0
- package/dist/runtime/utils/ssr-pagination-state.d.ts +3 -0
- package/dist/runtime/utils/ssr-pagination-state.js +3 -0
- package/dist/runtime/utils/types.d.ts +29 -0
- package/dist/runtime/utils/types.js +0 -0
- package/dist/runtime/utils/upload-core.d.ts +16 -0
- package/dist/runtime/utils/upload-core.js +116 -0
- package/dist/types.d.mts +21 -0
- package/package.json +253 -0
- package/security/upstream-convex-better-auth.json +477 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fingerprintAuthSchemaModels
|
|
3
|
+
} from "./metadata.js";
|
|
4
|
+
const explicitIndexes = {
|
|
5
|
+
invitation: [
|
|
6
|
+
{ fields: ["email", "organizationId", "status"] },
|
|
7
|
+
{ fields: ["organizationId", "status", "createdAt"] }
|
|
8
|
+
],
|
|
9
|
+
member: [{ fields: ["organizationId", "userId"], unique: true }],
|
|
10
|
+
oauthConsent: [{ fields: ["clientId", "userId"] }],
|
|
11
|
+
rateLimit: [{ fields: ["key"] }],
|
|
12
|
+
session: [{ fields: ["expiresAt"] }, { fields: ["userId", "expiresAt"] }],
|
|
13
|
+
teamMember: [{ fields: ["teamId", "userId"], unique: true }],
|
|
14
|
+
verification: [
|
|
15
|
+
{ fields: ["expiresAt"] },
|
|
16
|
+
{ fields: ["identifier"] },
|
|
17
|
+
{ fields: ["identifier", "createdAt"] }
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
function physicalFieldName(logicalName, field) {
|
|
21
|
+
return field.fieldName ?? logicalName;
|
|
22
|
+
}
|
|
23
|
+
function fieldKind(field) {
|
|
24
|
+
const kind = field.type;
|
|
25
|
+
if (kind !== "string" && kind !== "number" && kind !== "boolean" && kind !== "date" && kind !== "json" && kind !== "string[]" && kind !== "number[]") {
|
|
26
|
+
throw new Error(`AUTH_SCHEMA_UNSUPPORTED_FIELD_TYPE:${String(field.type)}`);
|
|
27
|
+
}
|
|
28
|
+
return kind;
|
|
29
|
+
}
|
|
30
|
+
function validatorForKind(kind) {
|
|
31
|
+
switch (kind) {
|
|
32
|
+
case "string":
|
|
33
|
+
case "json":
|
|
34
|
+
return "v.string()";
|
|
35
|
+
case "number":
|
|
36
|
+
case "date":
|
|
37
|
+
return "v.number()";
|
|
38
|
+
case "boolean":
|
|
39
|
+
return "v.boolean()";
|
|
40
|
+
case "string[]":
|
|
41
|
+
return "v.array(v.string())";
|
|
42
|
+
case "number[]":
|
|
43
|
+
return "v.array(v.number())";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function descriptorFor(fields) {
|
|
47
|
+
if (fields.length === 0) throw new Error("AUTH_SCHEMA_EMPTY_INDEX");
|
|
48
|
+
return fields.join("_");
|
|
49
|
+
}
|
|
50
|
+
function buildIndexes(logicalModelName, fields, tableIndexes) {
|
|
51
|
+
const indexes = [];
|
|
52
|
+
const seenDescriptors = /* @__PURE__ */ new Set();
|
|
53
|
+
const indexesByFields = /* @__PURE__ */ new Map();
|
|
54
|
+
const add = (logicalFields, unique = false, name) => {
|
|
55
|
+
const physicalFields = logicalFields.map((logicalField) => {
|
|
56
|
+
const field = Object.values(fields).find(
|
|
57
|
+
(candidate) => candidate.logicalName === logicalField
|
|
58
|
+
);
|
|
59
|
+
if (!field)
|
|
60
|
+
throw new Error(`AUTH_SCHEMA_INDEX_UNKNOWN_FIELD:${logicalModelName}.${logicalField}`);
|
|
61
|
+
return field.physicalName;
|
|
62
|
+
});
|
|
63
|
+
const fieldKey = JSON.stringify(physicalFields);
|
|
64
|
+
const existing = indexesByFields.get(fieldKey);
|
|
65
|
+
if (existing) {
|
|
66
|
+
if (unique) existing.unique = true;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const descriptor = name ?? descriptorFor(physicalFields);
|
|
70
|
+
if (seenDescriptors.has(descriptor)) {
|
|
71
|
+
throw new Error(`AUTH_SCHEMA_INDEX_NAME_COLLISION:${logicalModelName}.${descriptor}`);
|
|
72
|
+
}
|
|
73
|
+
seenDescriptors.add(descriptor);
|
|
74
|
+
const index = {
|
|
75
|
+
descriptor,
|
|
76
|
+
fields: physicalFields,
|
|
77
|
+
...unique ? { unique: true } : {}
|
|
78
|
+
};
|
|
79
|
+
indexesByFields.set(fieldKey, index);
|
|
80
|
+
indexes.push(index);
|
|
81
|
+
};
|
|
82
|
+
add(["id"], true);
|
|
83
|
+
for (const declared of tableIndexes) {
|
|
84
|
+
add(declared.fields, declared.unique === true, declared.name);
|
|
85
|
+
}
|
|
86
|
+
for (const declared of explicitIndexes[logicalModelName] ?? []) {
|
|
87
|
+
add(declared.fields, declared.unique === true, declared.name);
|
|
88
|
+
}
|
|
89
|
+
for (const field of Object.values(fields)) {
|
|
90
|
+
if (field.indexed || field.unique || field.reference || field.sortable || field.physicalName === "createdAt") {
|
|
91
|
+
add([field.logicalName], field.unique);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return indexes;
|
|
95
|
+
}
|
|
96
|
+
function buildMetadata(tables) {
|
|
97
|
+
const models = {};
|
|
98
|
+
const tableByPhysicalName = new Map(
|
|
99
|
+
Object.values(tables).map((table) => [table.modelName, table])
|
|
100
|
+
);
|
|
101
|
+
for (const [logicalModelName, table] of Object.entries(tables)) {
|
|
102
|
+
const physicalModelName = table.modelName;
|
|
103
|
+
if (models[physicalModelName]) {
|
|
104
|
+
throw new Error(`AUTH_SCHEMA_DUPLICATE_MODEL:${physicalModelName}`);
|
|
105
|
+
}
|
|
106
|
+
const fields = {
|
|
107
|
+
id: {
|
|
108
|
+
logicalName: "id",
|
|
109
|
+
physicalName: "id",
|
|
110
|
+
kind: "string",
|
|
111
|
+
nullable: false,
|
|
112
|
+
required: true,
|
|
113
|
+
indexed: true,
|
|
114
|
+
selectable: true,
|
|
115
|
+
sortable: false,
|
|
116
|
+
unique: true,
|
|
117
|
+
updatable: false
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
for (const [logicalFieldName, rawField] of Object.entries(table.fields)) {
|
|
121
|
+
if (logicalFieldName === "id") continue;
|
|
122
|
+
const field = rawField;
|
|
123
|
+
const physicalName = physicalFieldName(logicalFieldName, field);
|
|
124
|
+
if (fields[physicalName]) {
|
|
125
|
+
throw new Error(`AUTH_SCHEMA_DUPLICATE_FIELD:${physicalModelName}.${physicalName}`);
|
|
126
|
+
}
|
|
127
|
+
let reference;
|
|
128
|
+
if (field.references) {
|
|
129
|
+
const referencedTable = tableByPhysicalName.get(field.references.model);
|
|
130
|
+
if (!referencedTable) {
|
|
131
|
+
throw new Error(
|
|
132
|
+
`AUTH_SCHEMA_REFERENCE_MODEL_UNKNOWN:${physicalModelName}.${physicalName}`
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
const referencedRawField = field.references.field === "id" ? void 0 : referencedTable.fields[field.references.field];
|
|
136
|
+
if (field.references.field !== "id" && !referencedRawField) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
`AUTH_SCHEMA_REFERENCE_FIELD_UNKNOWN:${physicalModelName}.${physicalName}`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
const onDelete = field.references.onDelete ?? "cascade";
|
|
142
|
+
if (onDelete === "set default" || onDelete === "no action") {
|
|
143
|
+
throw new Error(
|
|
144
|
+
`AUTH_SCHEMA_REFERENCE_DELETE_UNSUPPORTED:${physicalModelName}.${physicalName}:${onDelete}`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
if (onDelete === "set null" && field.required === true) {
|
|
148
|
+
throw new Error(
|
|
149
|
+
`AUTH_SCHEMA_REFERENCE_SET_NULL_REQUIRED:${physicalModelName}.${physicalName}`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
reference = {
|
|
153
|
+
model: referencedTable.modelName,
|
|
154
|
+
field: field.references.field === "id" ? "id" : physicalFieldName(field.references.field, referencedRawField),
|
|
155
|
+
onDelete
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
fields[physicalName] = {
|
|
159
|
+
logicalName: logicalFieldName,
|
|
160
|
+
physicalName,
|
|
161
|
+
kind: fieldKind(field),
|
|
162
|
+
nullable: field.required !== true,
|
|
163
|
+
required: field.required === true,
|
|
164
|
+
indexed: field.index === true,
|
|
165
|
+
selectable: true,
|
|
166
|
+
sortable: field.sortable === true,
|
|
167
|
+
unique: field.unique === true,
|
|
168
|
+
updatable: true,
|
|
169
|
+
...reference ? { reference } : {}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
models[physicalModelName] = {
|
|
173
|
+
logicalName: logicalModelName,
|
|
174
|
+
physicalName: physicalModelName,
|
|
175
|
+
fields,
|
|
176
|
+
indexes: buildIndexes(logicalModelName, fields, table.indexes ?? [])
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
for (const model of Object.values(models)) {
|
|
180
|
+
for (const field of Object.values(model.fields)) {
|
|
181
|
+
if (!field.reference) continue;
|
|
182
|
+
const referencedModel = models[field.reference.model];
|
|
183
|
+
const referencedField = referencedModel?.fields[field.reference.field];
|
|
184
|
+
if (!referencedModel || !referencedField) {
|
|
185
|
+
throw new Error(
|
|
186
|
+
`AUTH_SCHEMA_REFERENCE_TARGET_UNKNOWN:${model.physicalName}.${field.physicalName}`
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
if (!referencedModel.indexes.some(
|
|
190
|
+
(index) => index.fields.length === 1 && index.fields[0] === referencedField.physicalName
|
|
191
|
+
)) {
|
|
192
|
+
throw new Error(
|
|
193
|
+
`AUTH_SCHEMA_REFERENCE_TARGET_UNINDEXED:${model.physicalName}.${field.physicalName}`
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return { fingerprint: fingerprintAuthSchemaModels(models), models };
|
|
199
|
+
}
|
|
200
|
+
function renderString(value) {
|
|
201
|
+
let escaped = "";
|
|
202
|
+
for (const character of value) {
|
|
203
|
+
switch (character) {
|
|
204
|
+
case "\\":
|
|
205
|
+
escaped += "\\\\";
|
|
206
|
+
break;
|
|
207
|
+
case "'":
|
|
208
|
+
escaped += "\\'";
|
|
209
|
+
break;
|
|
210
|
+
case "\b":
|
|
211
|
+
escaped += "\\b";
|
|
212
|
+
break;
|
|
213
|
+
case "\f":
|
|
214
|
+
escaped += "\\f";
|
|
215
|
+
break;
|
|
216
|
+
case "\n":
|
|
217
|
+
escaped += "\\n";
|
|
218
|
+
break;
|
|
219
|
+
case "\r":
|
|
220
|
+
escaped += "\\r";
|
|
221
|
+
break;
|
|
222
|
+
case " ":
|
|
223
|
+
escaped += "\\t";
|
|
224
|
+
break;
|
|
225
|
+
case "\u2028":
|
|
226
|
+
escaped += "\\u2028";
|
|
227
|
+
break;
|
|
228
|
+
case "\u2029":
|
|
229
|
+
escaped += "\\u2029";
|
|
230
|
+
break;
|
|
231
|
+
default: {
|
|
232
|
+
const codePoint = character.codePointAt(0);
|
|
233
|
+
escaped += codePoint <= 31 ? `\\u${codePoint.toString(16).padStart(4, "0")}` : character;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return `'${escaped}'`;
|
|
238
|
+
}
|
|
239
|
+
function renderPropertyName(value) {
|
|
240
|
+
return /^[A-Z_$][\w$]*$/iu.test(value) ? value : renderString(value);
|
|
241
|
+
}
|
|
242
|
+
function renderValue(value, depth = 0) {
|
|
243
|
+
if (typeof value === "string") return renderString(value);
|
|
244
|
+
if (typeof value === "boolean" || typeof value === "number") return String(value);
|
|
245
|
+
if (value === null) return "null";
|
|
246
|
+
if (Array.isArray(value)) {
|
|
247
|
+
if (value.length === 0) return "[]";
|
|
248
|
+
if (value.every((item) => item === null || typeof item !== "object")) {
|
|
249
|
+
return `[${value.map((item) => renderValue(item, depth)).join(", ")}]`;
|
|
250
|
+
}
|
|
251
|
+
const indentation = " ".repeat(depth);
|
|
252
|
+
const itemIndentation = " ".repeat(depth + 1);
|
|
253
|
+
return `[
|
|
254
|
+
${value.map((item) => `${itemIndentation}${renderValue(item, depth + 1)},`).join("\n")}
|
|
255
|
+
${indentation}]`;
|
|
256
|
+
}
|
|
257
|
+
if (typeof value === "object") {
|
|
258
|
+
const entries = Object.entries(value);
|
|
259
|
+
if (entries.length === 0) return "{}";
|
|
260
|
+
const indentation = " ".repeat(depth);
|
|
261
|
+
const propertyIndentation = " ".repeat(depth + 1);
|
|
262
|
+
return `{
|
|
263
|
+
${entries.map(
|
|
264
|
+
([key, item]) => `${propertyIndentation}${renderPropertyName(key)}: ${renderValue(item, depth + 1)},`
|
|
265
|
+
).join("\n")}
|
|
266
|
+
${indentation}}`;
|
|
267
|
+
}
|
|
268
|
+
throw new Error("AUTH_SCHEMA_UNSUPPORTED_METADATA_VALUE");
|
|
269
|
+
}
|
|
270
|
+
function renderMetadata(metadata) {
|
|
271
|
+
return [
|
|
272
|
+
"/** This file is generated by Better Convex Nuxt. Do not edit. */",
|
|
273
|
+
`const schemaMetadata = ${renderValue(metadata)} as const`,
|
|
274
|
+
"",
|
|
275
|
+
"export default schemaMetadata",
|
|
276
|
+
""
|
|
277
|
+
].join("\n");
|
|
278
|
+
}
|
|
279
|
+
function renderSchema(metadata) {
|
|
280
|
+
const models = Object.values(metadata.models);
|
|
281
|
+
const renderedModels = models.map((model) => {
|
|
282
|
+
const fields = Object.values(model.fields).map((field) => {
|
|
283
|
+
const validator = validatorForKind(field.kind);
|
|
284
|
+
return ` ${renderPropertyName(field.physicalName)}: ${field.nullable ? `v.union(v.null(), ${validator})` : validator},`;
|
|
285
|
+
}).join("\n");
|
|
286
|
+
const indexCalls = model.indexes.map(
|
|
287
|
+
(index) => `.index(${renderString(index.descriptor)}, ${renderValue(index.fields)})`
|
|
288
|
+
);
|
|
289
|
+
const indexes = indexCalls.length === 1 && ` })${indexCalls[0]},`.length <= 100 ? indexCalls[0] : indexCalls.map((call) => `
|
|
290
|
+
${call}`).join("");
|
|
291
|
+
return ` ${renderPropertyName(model.physicalName)}: defineTable({
|
|
292
|
+
${fields}
|
|
293
|
+
})${indexes},`;
|
|
294
|
+
});
|
|
295
|
+
return [
|
|
296
|
+
"/** This file is generated by Better Convex Nuxt. Do not edit. */",
|
|
297
|
+
"import { defineSchema, defineTable } from 'convex/server'",
|
|
298
|
+
"import { v } from 'convex/values'",
|
|
299
|
+
"",
|
|
300
|
+
"export const tables = {",
|
|
301
|
+
...renderedModels,
|
|
302
|
+
"} as const",
|
|
303
|
+
"",
|
|
304
|
+
"const schema = defineSchema(tables)",
|
|
305
|
+
`Object.defineProperty(schema, '__betterConvexNuxtAuthSchemaFingerprint', {`,
|
|
306
|
+
` value: ${renderString(metadata.fingerprint)},`,
|
|
307
|
+
"})",
|
|
308
|
+
"",
|
|
309
|
+
"export default schema",
|
|
310
|
+
""
|
|
311
|
+
].join("\n");
|
|
312
|
+
}
|
|
313
|
+
export function generateAuthSchemaArtifacts(tables) {
|
|
314
|
+
const metadata = buildMetadata(tables);
|
|
315
|
+
return {
|
|
316
|
+
metadata,
|
|
317
|
+
metadataCode: renderMetadata(metadata),
|
|
318
|
+
schemaCode: renderSchema(metadata)
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
export async function createAuthSchema({
|
|
322
|
+
file,
|
|
323
|
+
tables
|
|
324
|
+
}) {
|
|
325
|
+
const artifacts = generateAuthSchemaArtifacts(tables);
|
|
326
|
+
const target = file ?? "./schema.ts";
|
|
327
|
+
return {
|
|
328
|
+
code: artifacts.schemaCode,
|
|
329
|
+
path: target,
|
|
330
|
+
overwrite: true
|
|
331
|
+
};
|
|
332
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type AuthFieldKind = 'string' | 'number' | 'boolean' | 'date' | 'json' | 'string[]' | 'number[]';
|
|
2
|
+
export interface AuthReferenceMetadata {
|
|
3
|
+
model: string;
|
|
4
|
+
field: string;
|
|
5
|
+
onDelete: 'cascade' | 'restrict' | 'set null';
|
|
6
|
+
}
|
|
7
|
+
export interface AuthFieldMetadata {
|
|
8
|
+
logicalName: string;
|
|
9
|
+
physicalName: string;
|
|
10
|
+
kind: AuthFieldKind;
|
|
11
|
+
nullable: boolean;
|
|
12
|
+
required: boolean;
|
|
13
|
+
indexed: boolean;
|
|
14
|
+
selectable: boolean;
|
|
15
|
+
sortable: boolean;
|
|
16
|
+
unique: boolean;
|
|
17
|
+
updatable: boolean;
|
|
18
|
+
reference?: AuthReferenceMetadata;
|
|
19
|
+
}
|
|
20
|
+
export interface AuthIndexMetadata {
|
|
21
|
+
descriptor: string;
|
|
22
|
+
fields: readonly string[];
|
|
23
|
+
unique?: true;
|
|
24
|
+
}
|
|
25
|
+
export interface AuthModelMetadata {
|
|
26
|
+
logicalName: string;
|
|
27
|
+
physicalName: string;
|
|
28
|
+
fields: Readonly<Record<string, AuthFieldMetadata>>;
|
|
29
|
+
indexes: readonly AuthIndexMetadata[];
|
|
30
|
+
}
|
|
31
|
+
export interface AuthSchemaMetadata {
|
|
32
|
+
fingerprint: string;
|
|
33
|
+
models: Readonly<Record<string, AuthModelMetadata>>;
|
|
34
|
+
}
|
|
35
|
+
export declare const AUTH_SCHEMA_FINGERPRINT_PREFIX = "bcn-auth-schema-v2:";
|
|
36
|
+
/** Compute the canonical fingerprint for every runtime-significant metadata field. */
|
|
37
|
+
export declare function fingerprintAuthSchemaModels(models: AuthSchemaMetadata['models']): string;
|
|
38
|
+
/**
|
|
39
|
+
* Fail at component definition time when generated schema and metadata are not
|
|
40
|
+
* the exact pair produced by one generator run.
|
|
41
|
+
*/
|
|
42
|
+
export declare function assertAuthSchemaMatchesMetadata(schema: unknown, metadata: AuthSchemaMetadata): void;
|
|
43
|
+
export declare function getAuthModelMetadata(metadata: AuthSchemaMetadata, model: string): AuthModelMetadata;
|
|
44
|
+
export declare function getAuthFieldMetadata(metadata: AuthSchemaMetadata, model: string, field: string): AuthFieldMetadata;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export const AUTH_SCHEMA_FINGERPRINT_PREFIX = "bcn-auth-schema-v2:";
|
|
2
|
+
const FNV64_OFFSET_BASIS = 14695981039346656037n;
|
|
3
|
+
const FNV64_PRIME = 1099511628211n;
|
|
4
|
+
const AUTH_SCHEMA_FINGERPRINT_PROPERTY = "__betterConvexNuxtAuthSchemaFingerprint";
|
|
5
|
+
export function fingerprintAuthSchemaModels(models) {
|
|
6
|
+
let hash = FNV64_OFFSET_BASIS;
|
|
7
|
+
for (const codeUnit of JSON.stringify(models)) {
|
|
8
|
+
hash ^= BigInt(codeUnit.charCodeAt(0));
|
|
9
|
+
hash = BigInt.asUintN(64, hash * FNV64_PRIME);
|
|
10
|
+
}
|
|
11
|
+
return `${AUTH_SCHEMA_FINGERPRINT_PREFIX}${hash.toString(16).padStart(16, "0")}`;
|
|
12
|
+
}
|
|
13
|
+
function mismatch() {
|
|
14
|
+
throw new Error("AUTH_SCHEMA_METADATA_MISMATCH");
|
|
15
|
+
}
|
|
16
|
+
function sameStrings(left, right) {
|
|
17
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
18
|
+
}
|
|
19
|
+
function expectedBaseValidator(kind) {
|
|
20
|
+
switch (kind) {
|
|
21
|
+
case "string":
|
|
22
|
+
case "json":
|
|
23
|
+
return { type: "string" };
|
|
24
|
+
case "number":
|
|
25
|
+
case "date":
|
|
26
|
+
return { type: "number" };
|
|
27
|
+
case "boolean":
|
|
28
|
+
return { type: "boolean" };
|
|
29
|
+
case "string[]":
|
|
30
|
+
return { type: "array", value: { type: "string" } };
|
|
31
|
+
case "number[]":
|
|
32
|
+
return { type: "array", value: { type: "number" } };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function validatorMatches(field, actual) {
|
|
36
|
+
const base = expectedBaseValidator(field.kind);
|
|
37
|
+
const expected = field.nullable ? { type: "union", value: [{ type: "null" }, base] } : base;
|
|
38
|
+
return JSON.stringify(actual) === JSON.stringify(expected);
|
|
39
|
+
}
|
|
40
|
+
export function assertAuthSchemaMatchesMetadata(schema, metadata) {
|
|
41
|
+
try {
|
|
42
|
+
if (schema === null || typeof schema !== "object") mismatch();
|
|
43
|
+
const schemaRecord = schema;
|
|
44
|
+
const exportSchema = schemaRecord.export;
|
|
45
|
+
if (typeof exportSchema !== "function" || typeof metadata.fingerprint !== "string" || !metadata.fingerprint.startsWith(AUTH_SCHEMA_FINGERPRINT_PREFIX) || metadata.fingerprint.length !== AUTH_SCHEMA_FINGERPRINT_PREFIX.length + 16 || fingerprintAuthSchemaModels(metadata.models) !== metadata.fingerprint || schemaRecord[AUTH_SCHEMA_FINGERPRINT_PROPERTY] !== metadata.fingerprint) {
|
|
46
|
+
mismatch();
|
|
47
|
+
}
|
|
48
|
+
const exported = JSON.parse(exportSchema.call(schema));
|
|
49
|
+
if (!exported || !Array.isArray(exported.tables)) mismatch();
|
|
50
|
+
const models = Object.values(metadata.models);
|
|
51
|
+
if (models.length !== exported.tables.length) mismatch();
|
|
52
|
+
const tablesByName = new Map(exported.tables.map((table) => [table.tableName, table]));
|
|
53
|
+
for (const model of models) {
|
|
54
|
+
if (metadata.models[model.physicalName] !== model) mismatch();
|
|
55
|
+
const table = tablesByName.get(model.physicalName);
|
|
56
|
+
if (!table || table.documentType?.type !== "object") mismatch();
|
|
57
|
+
if (table.searchIndexes.length > 0 || table.stagedDbIndexes.length > 0 || table.stagedSearchIndexes.length > 0 || table.vectorIndexes.length > 0 || table.stagedVectorIndexes.length > 0) {
|
|
58
|
+
mismatch();
|
|
59
|
+
}
|
|
60
|
+
const fields = Object.values(model.fields);
|
|
61
|
+
const exportedFields = table.documentType.value;
|
|
62
|
+
if (fields.length !== Object.keys(exportedFields).length) mismatch();
|
|
63
|
+
for (const field of fields) {
|
|
64
|
+
if (model.fields[field.physicalName] !== field) mismatch();
|
|
65
|
+
const exportedField = exportedFields[field.physicalName];
|
|
66
|
+
if (!exportedField || exportedField.optional !== false || !validatorMatches(field, exportedField.fieldType)) {
|
|
67
|
+
mismatch();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (model.indexes.length !== table.indexes.length) mismatch();
|
|
71
|
+
for (const index of model.indexes) {
|
|
72
|
+
const exportedIndex = table.indexes.find(
|
|
73
|
+
(candidate) => candidate.indexDescriptor === index.descriptor
|
|
74
|
+
);
|
|
75
|
+
if (!exportedIndex || !sameStrings(index.fields, exportedIndex.fields)) mismatch();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} catch {
|
|
79
|
+
mismatch();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export function getAuthModelMetadata(metadata, model) {
|
|
83
|
+
const result = metadata.models[model];
|
|
84
|
+
if (!result) throw new Error(`AUTH_MODEL_UNKNOWN:${model}`);
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
export function getAuthFieldMetadata(metadata, model, field) {
|
|
88
|
+
const result = getAuthModelMetadata(metadata, model).fields[field];
|
|
89
|
+
if (!result) throw new Error(`AUTH_FIELD_UNKNOWN:${model}.${field}`);
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { GenericQueryCtx, PaginationOptions, SchemaDefinition } from 'convex/server';
|
|
2
|
+
import type { AuthSchemaMetadata } from './metadata.js';
|
|
3
|
+
export type AuthWhereOperator = 'lt' | 'lte' | 'gt' | 'gte' | 'eq' | 'in' | 'not_in' | 'ne' | 'contains' | 'starts_with' | 'ends_with';
|
|
4
|
+
export interface AuthWhere {
|
|
5
|
+
field: string;
|
|
6
|
+
operator?: AuthWhereOperator;
|
|
7
|
+
value: string | number | boolean | readonly string[] | readonly number[] | null;
|
|
8
|
+
connector?: 'AND' | 'OR';
|
|
9
|
+
mode?: 'sensitive' | 'insensitive';
|
|
10
|
+
}
|
|
11
|
+
export interface AuthReadArgs {
|
|
12
|
+
model: string;
|
|
13
|
+
where?: readonly AuthWhere[];
|
|
14
|
+
select?: readonly string[];
|
|
15
|
+
sortBy?: {
|
|
16
|
+
field: string;
|
|
17
|
+
direction: 'asc' | 'desc';
|
|
18
|
+
};
|
|
19
|
+
offset?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function matchesAuthWhere(doc: Record<string, unknown>, where?: readonly AuthWhere[]): boolean;
|
|
22
|
+
export declare function validateAuthReadArgs(metadata: AuthSchemaMetadata, args: AuthReadArgs): void;
|
|
23
|
+
export declare function toBetterAuthDocument(doc: Record<string, unknown> | null, select?: readonly string[]): Record<string, unknown> | null;
|
|
24
|
+
export declare function paginateAuthRows(ctx: GenericQueryCtx<any>, schema: SchemaDefinition<any, any>, metadata: AuthSchemaMetadata, args: AuthReadArgs, paginationOpts: PaginationOptions): Promise<any>;
|
|
25
|
+
export declare function collectAuthRows(ctx: GenericQueryCtx<any>, schema: SchemaDefinition<any, any>, metadata: AuthSchemaMetadata, args: AuthReadArgs, maximum?: number): Promise<Record<string, unknown>[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Count the complete result set in one component query with bounded page
|
|
28
|
+
* memory. It has no product-defined row ceiling and uses the same selector as
|
|
29
|
+
* fully paginated `findMany` and atomic bulk mutations.
|
|
30
|
+
*/
|
|
31
|
+
export declare function countAuthRows(ctx: GenericQueryCtx<any>, schema: SchemaDefinition<any, any>, metadata: AuthSchemaMetadata, args: AuthReadArgs): Promise<number>;
|
|
32
|
+
export declare function findAuthRows(ctx: GenericQueryCtx<any>, schema: SchemaDefinition<any, any>, metadata: AuthSchemaMetadata, args: AuthReadArgs, maximum?: number): Promise<Record<string, unknown>[]>;
|