@riffdb/better-auth 0.2.0 → 0.2.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/DESIGN.md +90 -14
- package/README.md +157 -25
- package/dist/adapter.d.ts +7 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +385 -47
- package/dist/adapter.js.map +1 -1
- package/dist/generated/client.d.ts +267 -26
- package/dist/generated/client.d.ts.map +1 -1
- package/dist/generated/client.js +479 -69
- package/dist/generated/client.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin-dispatch.d.ts +37 -0
- package/dist/plugin-dispatch.d.ts.map +1 -0
- package/dist/plugin-dispatch.js +293 -0
- package/dist/plugin-dispatch.js.map +1 -0
- package/dist/profile-contract.d.ts +3 -0
- package/dist/profile-contract.d.ts.map +1 -1
- package/dist/profile-contract.js +8 -0
- package/dist/profile-contract.js.map +1 -1
- package/dist/profile-plan.js +1 -1
- package/dist/profile-plan.js.map +1 -1
- package/dist/profile.d.ts +2 -1
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +2 -1
- package/dist/profile.js.map +1 -1
- package/dist/profiles/custom-fields/profile.d.ts +3 -0
- package/dist/profiles/custom-fields/profile.d.ts.map +1 -0
- package/dist/profiles/custom-fields/profile.js +475 -0
- package/dist/profiles/custom-fields/profile.js.map +1 -0
- package/dist/profiles/custom-fields/src/generated/client.d.ts +2710 -0
- package/dist/profiles/custom-fields/src/generated/client.d.ts.map +1 -0
- package/dist/profiles/custom-fields/src/generated/client.js +2663 -0
- package/dist/profiles/custom-fields/src/generated/client.js.map +1 -0
- package/dist/profiles/runtime/profile.d.ts +3 -0
- package/dist/profiles/runtime/profile.d.ts.map +1 -0
- package/dist/profiles/runtime/profile.js +1065 -0
- package/dist/profiles/runtime/profile.js.map +1 -0
- package/dist/profiles/runtime/src/generated/client.d.ts +4274 -0
- package/dist/profiles/runtime/src/generated/client.d.ts.map +1 -0
- package/dist/profiles/runtime/src/generated/client.js +4607 -0
- package/dist/profiles/runtime/src/generated/client.js.map +1 -0
- package/dist/runtime-materialize.d.ts +10 -0
- package/dist/runtime-materialize.d.ts.map +1 -0
- package/dist/runtime-materialize.js +344 -0
- package/dist/runtime-materialize.js.map +1 -0
- package/dist/runtime-profile.d.ts +34 -0
- package/dist/runtime-profile.d.ts.map +1 -0
- package/dist/runtime-profile.js +203 -0
- package/dist/runtime-profile.js.map +1 -0
- package/generated/go/client.go +350 -96
- package/generated/mcp/tools.json +3338 -1768
- package/generated/python/client.py +603 -26
- package/generated/riffdb.application.exact.json +1 -1
- package/generated/riffdb.contract.bundle +0 -0
- package/generated/rust/client.rs +522 -26
- package/package.json +34 -13
- package/profiles/custom-fields/generated/go/client.go +2578 -0
- package/profiles/custom-fields/generated/mcp/tools.json +15998 -0
- package/profiles/custom-fields/generated/python/client.py +5141 -0
- package/profiles/custom-fields/generated/riffdb.application.exact.json +1 -0
- package/profiles/custom-fields/generated/riffdb.contract.bundle +0 -0
- package/profiles/custom-fields/generated/rust/client.rs +7980 -0
- package/profiles/custom-fields/profile.ts +474 -0
- package/profiles/custom-fields/riffdb/contract.riff +568 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_contains_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_contains_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/find_account_by_id.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/find_account_by_provider.riffq +26 -0
- package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
- package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
- package/profiles/custom-fields/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
- package/profiles/custom-fields/riffdb/queries/find_credential_account.riffq +25 -0
- package/profiles/custom-fields/riffdb/queries/find_expired_verification_ids.riffq +17 -0
- package/profiles/custom-fields/riffdb/queries/find_latest_verification.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_session_by_id.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_session_by_token.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
- package/profiles/custom-fields/riffdb/queries/find_user_by_email.riffq +16 -0
- package/profiles/custom-fields/riffdb/queries/find_user_by_id.riffq +15 -0
- package/profiles/custom-fields/riffdb/queries/find_verification_by_id.riffq +19 -0
- package/profiles/custom-fields/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
- package/profiles/custom-fields/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
- package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
- package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
- package/profiles/custom-fields/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
- package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
- package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
- package/profiles/custom-fields/riffdb.application.json +217 -0
- package/profiles/custom-fields/riffdb.application.lock.json +1 -0
- package/profiles/custom-fields/riffdb.toml +3 -0
- package/profiles/custom-fields/src/generated/client.ts +3096 -0
- package/profiles/organization-security/materialization.json +3 -0
- package/profiles/organization-security/riffdb/contract.riff +12 -0
- package/profiles/organization-security/riffdb/queries/find_team_by_id.riffq +1 -1
- package/profiles/organization-security/riffdb/queries/find_team_member_by_id.riffq +1 -1
- package/profiles/organization-security/riffdb/queries/find_team_member_by_membership_key.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_team_member_by_team_id.riffq +1 -1
- package/profiles/organization-security/riffdb.application.json +5 -0
- package/profiles/organization-security.profile.json +27 -1
- package/profiles/runtime/generated/go/client.go +4511 -0
- package/profiles/runtime/generated/mcp/tools.json +30004 -0
- package/profiles/runtime/generated/python/client.py +9337 -0
- package/profiles/runtime/generated/riffdb.application.exact.json +1 -0
- package/profiles/runtime/generated/riffdb.contract.bundle +0 -0
- package/profiles/runtime/generated/rust/client.rs +13297 -0
- package/profiles/runtime/profile.ts +1064 -0
- package/profiles/runtime/riffdb/contract.riff +1053 -0
- package/profiles/runtime/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_contains_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_contains_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/find_account_by_id.riffq +24 -0
- package/profiles/runtime/riffdb/queries/find_account_by_provider.riffq +26 -0
- package/profiles/runtime/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
- package/profiles/runtime/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
- package/profiles/runtime/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
- package/profiles/runtime/riffdb/queries/find_credential_account.riffq +25 -0
- package/profiles/runtime/riffdb/queries/find_expired_verification_ids.riffq +17 -0
- package/profiles/runtime/riffdb/queries/find_latest_verification.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_session_by_id.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_session_by_token.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
- package/profiles/runtime/riffdb/queries/find_user_by_email.riffq +16 -0
- package/profiles/runtime/riffdb/queries/find_user_by_id.riffq +15 -0
- package/profiles/runtime/riffdb/queries/find_verification_by_id.riffq +19 -0
- package/profiles/runtime/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
- package/profiles/runtime/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_email.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_id.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_email_status.riffq +19 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_id.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_status.riffq +18 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_id.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_asc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_desc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_asc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_desc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_user.riffq +28 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_user.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_organization_by_id.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_organization_by_slug.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
- package/profiles/runtime/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
- package/profiles/runtime/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
- package/profiles/runtime/riffdb/queries/profile_two_factor_by_id.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_two_factor_by_user.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
- package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
- package/profiles/runtime/riffdb/queries/profile_users_by_id_set.riffq +8 -0
- package/profiles/runtime/riffdb.application.json +324 -0
- package/profiles/runtime/riffdb.application.lock.json +1 -0
- package/profiles/runtime/riffdb.toml +3 -0
- package/profiles/runtime/src/generated/client.ts +5186 -0
- package/riffdb/contract.riff +58 -0
- package/riffdb/queries/find_credential_account.riffq +25 -0
- package/riffdb.application.json +106 -26
- package/riffdb.application.lock.json +1 -1
- package/src/generated/client.ts +2746 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { BETTER_AUTH_PINNED_VERSION, BETTER_AUTH_CORE_FIELDS } from "./profile.js";
|
|
2
|
+
import { defineRiffDBBetterAuthProfilePlan } from "./profile-plan.js";
|
|
3
|
+
const boundProfile = Symbol.for("@riffdb/better-auth/compiled-profile/v1");
|
|
4
|
+
export function instantiateProfileClient(profile, transport, budget) {
|
|
5
|
+
const Client = profile.Client;
|
|
6
|
+
return new Client(transport, budget);
|
|
7
|
+
}
|
|
8
|
+
/** Used by generated profile modules after their sources have been reviewed and locked. */
|
|
9
|
+
export function defineRiffDBCompiledProfile(input) {
|
|
10
|
+
const bindings = input.bindings;
|
|
11
|
+
const contractBundleHash = bindings.CONTRACT_BUNDLE_HASH;
|
|
12
|
+
const Client = bindings[`${input.plan.contract.lineage.replace(/[^a-zA-Z0-9]/gu, "")}Client`];
|
|
13
|
+
if (input.plan.betterAuthVersion !== BETTER_AUTH_PINNED_VERSION ||
|
|
14
|
+
typeof contractBundleHash !== "string" || !/^[a-f0-9]{64}$/u.test(contractBundleHash) ||
|
|
15
|
+
bindings.CONTRACT_LINEAGE !== input.plan.contract.lineage || bindings.CONTRACT_VERSION !== 1 ||
|
|
16
|
+
input.plan.models.length > 32 || input.queries.length > 128 || typeof Client !== "function") {
|
|
17
|
+
throw new Error("invalid compiled Better Auth profile");
|
|
18
|
+
}
|
|
19
|
+
// Inspect compiler-owned request metadata locally. A freshly generated plan
|
|
20
|
+
// must not bind an old client that silently omits new optional fields.
|
|
21
|
+
for (const model of input.plan.models) {
|
|
22
|
+
if (model.fields.length > 64)
|
|
23
|
+
throw new Error("compiled profile field bound exceeded");
|
|
24
|
+
const method = bindings[`create${model.name[0].toUpperCase()}${model.name.slice(1)}`];
|
|
25
|
+
if (typeof method !== "function")
|
|
26
|
+
throw new Error("missing compiled profile command");
|
|
27
|
+
const request = method({ request_id: "" });
|
|
28
|
+
if (request.contractLineage !== input.plan.contract.lineage || request.contractVersion !== 1 || request.inputSchema.kind !== "record") {
|
|
29
|
+
throw new Error("compiled profile command identity mismatch");
|
|
30
|
+
}
|
|
31
|
+
for (const field of model.fields) {
|
|
32
|
+
const name = model.name === "organization" || model.name === "member" || model.name === "invitation" || model.name === "twoFactor"
|
|
33
|
+
? field.name === "organizationId" ? "org_id" : storageField(field.name) : storageField(field.name);
|
|
34
|
+
const actual = request.inputSchema.fields.find((entry) => entry.name === name)?.schema;
|
|
35
|
+
const kind = field.reference !== undefined ? "uuid" : { string: "string", boolean: "bool", number: "i64", date: "timestamp" }[String(field.type)];
|
|
36
|
+
const optional = !field.required && !(model.name === "twoFactor" && ["verified", "failedVerificationCount"].includes(field.name));
|
|
37
|
+
if (actual === undefined || kind === undefined ||
|
|
38
|
+
(optional ? actual.kind !== "optional" || actual.value?.kind !== kind : actual.kind !== kind)) {
|
|
39
|
+
throw new Error("compiled profile field schema mismatch");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const baseFields = BETTER_AUTH_CORE_FIELDS[model.name];
|
|
43
|
+
const extra = model.fields.filter((field) => baseFields === undefined || !baseFields.includes(field.name));
|
|
44
|
+
const commands = [[`update${model.name[0].toUpperCase()}${model.name.slice(1)}`, ""],
|
|
45
|
+
...(model.name === "user" || model.name === "account" ? [["createSignupGraph", `${model.name}_`], ["createOAuthUserGraph", `${model.name}_`]] :
|
|
46
|
+
model.name === "session" ? [["createSignupGraph", "session_"]] : [])];
|
|
47
|
+
for (const [name, prefix] of commands) {
|
|
48
|
+
const helper = bindings[name];
|
|
49
|
+
if (typeof helper !== "function")
|
|
50
|
+
throw new Error("missing compiled profile mutation");
|
|
51
|
+
const mutation = helper({ request_id: "" });
|
|
52
|
+
for (const field of extra) {
|
|
53
|
+
const column = baseFields === undefined && field.name === "organizationId" ? "org_id" : storageField(field.name);
|
|
54
|
+
if (!mutation.inputSchema.fields.some((entry) => entry.name === `${prefix}${column}`)) {
|
|
55
|
+
throw new Error("compiled profile mutation field missing");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const name of ["consumeVerification", "consumeVerificationSnapshot", "resetCredentialPassword", "updateCredentialPassword"]) {
|
|
61
|
+
if (typeof bindings[name] !== "function")
|
|
62
|
+
throw new Error("missing compiled credential operation");
|
|
63
|
+
}
|
|
64
|
+
const labels = { user: "user", users: "user", account: "account", accounts: "account",
|
|
65
|
+
session: "session", sessions: "session", verification: "verification", verifications: "verification",
|
|
66
|
+
organizations: "organization", members: "member", invitations: "invitation" };
|
|
67
|
+
const reads = Object.entries(bindings).filter(([name, method]) => /^(?:find|adminUsers|profile)/u.test(name) && typeof method === "function");
|
|
68
|
+
if (reads.length > 256)
|
|
69
|
+
throw new Error("compiled profile query bound exceeded");
|
|
70
|
+
for (const [name, method] of reads) {
|
|
71
|
+
const request = method({});
|
|
72
|
+
if (request.contractBundleHash !== contractBundleHash)
|
|
73
|
+
throw new Error("compiled profile query identity mismatch");
|
|
74
|
+
if (name === "findExpiredVerificationIds")
|
|
75
|
+
continue; // Deliberate identity-only cleanup projection.
|
|
76
|
+
for (const result of Object.values(request.resultSchemas))
|
|
77
|
+
for (const leaf of result.fields ?? []) {
|
|
78
|
+
const modelName = labels[leaf.name] ?? (["rows", "record"].includes(leaf.name) ? input.queries.find((query) => query.method === name)?.model : undefined);
|
|
79
|
+
if (modelName === undefined)
|
|
80
|
+
continue;
|
|
81
|
+
const model = input.plan.models.find((entry) => entry.name === modelName);
|
|
82
|
+
const row = leaf.schema.kind === "list" ? leaf.schema.value : leaf.schema;
|
|
83
|
+
if (model === undefined || row?.kind !== "record")
|
|
84
|
+
throw new Error("compiled profile result schema mismatch");
|
|
85
|
+
for (const field of model.fields) {
|
|
86
|
+
const column = !["user", "session", "account", "verification"].includes(modelName) && field.name === "organizationId" ? "org_id" : storageField(field.name);
|
|
87
|
+
if (!row.fields?.some((entry) => entry.name === column))
|
|
88
|
+
throw new Error("compiled profile result field missing");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const profile = Object.freeze({ [boundProfile]: true, ...input, plan: freezeCopy(input.plan),
|
|
93
|
+
Client: Client, contractBundleHash,
|
|
94
|
+
queries: freezeCopy(input.queries), schema: "riffdb.better-auth-runtime-profile/v1" });
|
|
95
|
+
return profile;
|
|
96
|
+
}
|
|
97
|
+
function freezeCopy(value) {
|
|
98
|
+
const copy = structuredClone(value);
|
|
99
|
+
const freeze = (entry) => {
|
|
100
|
+
if (entry !== null && typeof entry === "object") {
|
|
101
|
+
for (const child of Object.values(entry))
|
|
102
|
+
freeze(child);
|
|
103
|
+
Object.freeze(entry);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
freeze(copy);
|
|
107
|
+
return copy;
|
|
108
|
+
}
|
|
109
|
+
export function validateRuntimeProfile(profile, options, tables) {
|
|
110
|
+
if (profile[boundProfile] !== true)
|
|
111
|
+
throw new Error("unbound compiled Better Auth profile");
|
|
112
|
+
const plan = defineRiffDBBetterAuthProfilePlan({ ...options,
|
|
113
|
+
plugins: options.plugins?.filter((plugin) => plugin.id !== "next-cookies") ?? [],
|
|
114
|
+
}, tables, { name: profile.plan.name, contractLineage: profile.plan.contract.lineage,
|
|
115
|
+
applicationRole: profile.plan.contract.applicationRole });
|
|
116
|
+
if (JSON.stringify(plan) !== JSON.stringify(profile.plan))
|
|
117
|
+
throw new Error("compiled Better Auth schema mismatch");
|
|
118
|
+
if (new Set((options.plugins ?? []).map((plugin) => plugin.id)).size !== (options.plugins ?? []).length) {
|
|
119
|
+
throw new Error("duplicate Better Auth plugins");
|
|
120
|
+
}
|
|
121
|
+
for (const plugin of options.plugins ?? []) {
|
|
122
|
+
if (plugin.version !== BETTER_AUTH_PINNED_VERSION ||
|
|
123
|
+
![...profile.plan.plugins, "next-cookies"].includes(plugin.id)) {
|
|
124
|
+
throw new Error("unsupported Better Auth plugin");
|
|
125
|
+
}
|
|
126
|
+
if (plugin.id === "organization") {
|
|
127
|
+
const settings = plugin.options ?? {};
|
|
128
|
+
if (settings.teams?.enabled ||
|
|
129
|
+
settings.dynamicAccessControl?.enabled ||
|
|
130
|
+
settings.organizationHooks !== undefined || settings.organizationCreation !== undefined) {
|
|
131
|
+
throw new Error("unsupported organization plugin options");
|
|
132
|
+
}
|
|
133
|
+
for (const limit of ["membershipLimit", "invitationLimit", "organizationLimit"]) {
|
|
134
|
+
const value = settings[limit];
|
|
135
|
+
if (value !== undefined && (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1 || value > 100)) {
|
|
136
|
+
throw new Error("unsupported organization profile limit");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (profile.plan.plugins.includes("organization") && options.user?.deleteUser?.enabled) {
|
|
142
|
+
throw new Error("user deletion is unavailable in the organization profile");
|
|
143
|
+
}
|
|
144
|
+
if (options.databaseHooks !== undefined || options.emailAndPassword?.revokeSessionsOnPasswordReset) {
|
|
145
|
+
throw new Error("unsupported compiled Better Auth transaction configuration");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export function storageField(name) {
|
|
149
|
+
return name.replace(/([a-z0-9])([A-Z])/gu, "$1_$2").toLowerCase();
|
|
150
|
+
}
|
|
151
|
+
export function encodeProfileField(field, value) {
|
|
152
|
+
if (value === undefined || value === null) {
|
|
153
|
+
if (field.required)
|
|
154
|
+
throw new Error(`missing compiled profile field: ${field.name}`);
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
if (field.reference !== undefined && (typeof value !== "string" || !/^[a-f0-9-]{36}$/iu.test(value))) {
|
|
158
|
+
throw new Error(`invalid compiled profile reference: ${field.name}`);
|
|
159
|
+
}
|
|
160
|
+
switch (field.type) {
|
|
161
|
+
case "string":
|
|
162
|
+
if (typeof value !== "string" || Buffer.byteLength(value) >
|
|
163
|
+
({ email: 320, role: 256, status: 32, name: 256, slug: 256 }[field.name] ?? 2048))
|
|
164
|
+
break;
|
|
165
|
+
return value;
|
|
166
|
+
case "boolean":
|
|
167
|
+
if (typeof value === "boolean")
|
|
168
|
+
return value;
|
|
169
|
+
break;
|
|
170
|
+
case "number":
|
|
171
|
+
if (typeof value === "number" && Number.isSafeInteger(value))
|
|
172
|
+
return BigInt(value);
|
|
173
|
+
break;
|
|
174
|
+
case "date":
|
|
175
|
+
if (value instanceof Date && Number.isFinite(value.getTime())) {
|
|
176
|
+
const seconds = Math.floor(value.getTime() / 1000);
|
|
177
|
+
return { seconds: BigInt(seconds), nanos: (value.getTime() - seconds * 1000) * 1_000_000 };
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
default: break;
|
|
181
|
+
}
|
|
182
|
+
throw new Error(`invalid compiled profile field: ${field.name}`);
|
|
183
|
+
}
|
|
184
|
+
export function decodeProfileField(field, value) {
|
|
185
|
+
if (value === null || value === undefined)
|
|
186
|
+
return null;
|
|
187
|
+
if (field.type === "date") {
|
|
188
|
+
const stamp = value;
|
|
189
|
+
const milliseconds = Number(stamp.seconds) * 1000 + stamp.nanos / 1_000_000;
|
|
190
|
+
if (!Number.isSafeInteger(milliseconds) || !Number.isFinite(new Date(milliseconds).getTime())) {
|
|
191
|
+
throw new Error("invalid compiled profile timestamp");
|
|
192
|
+
}
|
|
193
|
+
return new Date(milliseconds);
|
|
194
|
+
}
|
|
195
|
+
if (field.type === "number") {
|
|
196
|
+
const number = Number(value);
|
|
197
|
+
if (!Number.isSafeInteger(number))
|
|
198
|
+
throw new Error("invalid compiled profile integer");
|
|
199
|
+
return number;
|
|
200
|
+
}
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=runtime-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-profile.js","sourceRoot":"","sources":["../src/runtime-profile.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,iCAAiC,EACD,MAAM,mBAAmB,CAAC;AAkBnE,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AAQ3E,MAAM,UAAU,wBAAwB,CAAC,OAA8B,EAAE,SAA+B,EAAE,MAAc;IACtH,MAAM,MAAM,GAAG,OAAO,CAAC,MAAuF,CAAC;IAC/G,OAAO,IAAI,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,2BAA2B,CAAC,KAAiC;IAC3E,MAAM,QAAQ,GAAG,KAAK,CAAC,QAA6C,CAAC;IACrE,MAAM,kBAAkB,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,QAA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