@protobase/server 0.47.1 → 0.48.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.
Files changed (51) hide show
  1. package/dist/auth-store.d.ts +3 -0
  2. package/dist/auth-store.js +3 -0
  3. package/dist/better-auth/auth-schema.d.ts +7 -8
  4. package/dist/better-auth/auth-schema.js +40 -42
  5. package/dist/better-auth/auth-tables.d.ts +1 -1
  6. package/dist/better-auth/auth-tables.js +11 -9
  7. package/dist/better-auth/authenticator.d.ts +1 -1
  8. package/dist/better-auth/create-auth.d.ts +20 -12
  9. package/dist/better-auth/create-auth.js +6 -1
  10. package/dist/better-auth/mcp/mcp-plugins.d.ts +1 -1
  11. package/dist/better-auth/store/adoption.js +87 -0
  12. package/dist/better-auth/store/ddl.js +18 -0
  13. package/dist/better-auth/store/drift.d.ts +9 -0
  14. package/dist/better-auth/store/drift.js +18 -0
  15. package/dist/better-auth/store/migration-sql.js +15 -0
  16. package/dist/better-auth/store/migrations/001-core.js +80 -0
  17. package/dist/better-auth/store/migrations/002-two-factor.js +25 -0
  18. package/dist/better-auth/store/migrations/003-passkeys.js +29 -0
  19. package/dist/better-auth/store/migrations/004-sign-in-policy.js +22 -0
  20. package/dist/better-auth/store/migrations/005-staff-sign-in.js +25 -0
  21. package/dist/better-auth/store/migrations/006-organizations.js +50 -0
  22. package/dist/better-auth/store/migrations/007-mcp.js +150 -0
  23. package/dist/better-auth/store/migrations/index.js +22 -0
  24. package/dist/better-auth/store/migrations/migration.d.ts +3 -0
  25. package/dist/better-auth/store/migrations/migration.js +14 -0
  26. package/dist/better-auth/store/migrations-table.d.ts +7 -0
  27. package/dist/better-auth/store/migrations-table.js +23 -0
  28. package/dist/better-auth/store/resources-outside.d.ts +7 -0
  29. package/dist/better-auth/store/resources-outside.js +20 -0
  30. package/dist/better-auth/store/store-db.js +13 -0
  31. package/dist/better-auth/store/store-names.d.ts +2 -0
  32. package/dist/better-auth/store/store-names.js +14 -0
  33. package/dist/better-auth/store/table-names.d.ts +7 -0
  34. package/dist/better-auth/store/table-names.js +10 -0
  35. package/dist/better-auth/users.d.ts +1 -1
  36. package/dist/comments/comment-users.d.ts +1 -1
  37. package/dist/config-exports.d.ts +2 -0
  38. package/dist/config-exports.js +2 -0
  39. package/dist/create-admin.d.ts +1 -1
  40. package/dist/index.d.ts +13 -11
  41. package/dist/index.js +4 -2
  42. package/dist/jobs/job-types.d.ts +1 -1
  43. package/dist/notifications/device-store-of.d.ts +1 -1
  44. package/dist/notifications/history-store-of.d.ts +1 -1
  45. package/dist/notifications/schema.d.ts +1 -1
  46. package/dist/notifications/schema.js +1 -1
  47. package/dist/package.js +1 -1
  48. package/dist/project-config.d.ts +1 -1
  49. package/package.json +6 -4
  50. package/dist/better-auth/mcp/mcp-tables.js +0 -32
  51. package/dist/better-auth/snake-case-migration.js +0 -122
@@ -0,0 +1,50 @@
1
+ import { ddl } from "../ddl.js";
2
+ //#region src/better-auth/store/migrations/006-organizations.ts
3
+ /** Organizations, their members and invitations, and the organization each user and session works in. */
4
+ const organizations = {
5
+ version: 6,
6
+ name: "organizations",
7
+ title: "Organizations, their members and their invitations",
8
+ tables: [
9
+ "organization",
10
+ "member",
11
+ "invitation"
12
+ ],
13
+ statements: ({ table, user, userColumn: column, id, idRef }) => [
14
+ ddl`alter table ${user} add column if not exists ${column("last_organization_id")} text`,
15
+ ddl`alter table ${table("session")} add column active_organization_id text`,
16
+ ddl`create table ${table("organization")} (
17
+ id ${id} primary key,
18
+ name text not null,
19
+ slug text not null unique,
20
+ logo text,
21
+ created_at timestamptz not null,
22
+ metadata text
23
+ )`,
24
+ ddl`create table ${table("member")} (
25
+ id ${id} primary key,
26
+ organization_id ${idRef} not null references ${table("organization")} (id) on delete cascade,
27
+ user_id ${idRef} not null references ${user} (id) on delete cascade,
28
+ role text not null,
29
+ created_at timestamptz not null,
30
+ app_roles jsonb
31
+ )`,
32
+ ddl`create index member_organization_id_idx on ${table("member")} (organization_id)`,
33
+ ddl`create index member_user_id_idx on ${table("member")} (user_id)`,
34
+ ddl`create table ${table("invitation")} (
35
+ id ${id} primary key,
36
+ organization_id ${idRef} not null references ${table("organization")} (id) on delete cascade,
37
+ email text not null,
38
+ role text,
39
+ status text not null,
40
+ expires_at timestamptz not null,
41
+ created_at timestamptz default current_timestamp not null,
42
+ inviter_id ${idRef} not null references ${user} (id) on delete cascade,
43
+ app_roles jsonb
44
+ )`,
45
+ ddl`create index invitation_organization_id_idx on ${table("invitation")} (organization_id)`,
46
+ ddl`create index invitation_email_idx on ${table("invitation")} (email)`
47
+ ]
48
+ };
49
+ //#endregion
50
+ export { organizations };
@@ -0,0 +1,150 @@
1
+ import { ddl } from "../ddl.js";
2
+ //#region src/better-auth/store/migrations/007-mcp.ts
3
+ /** The OAuth provider MCP clients sign in through: its clients, resources, tokens and consents. */
4
+ const mcp = {
5
+ version: 7,
6
+ name: "mcp",
7
+ title: "The clients, resources, tokens and consents of the OAuth provider for MCP",
8
+ tables: [
9
+ "oauth_client",
10
+ "oauth_resource",
11
+ "oauth_client_resource",
12
+ "oauth_refresh_token",
13
+ "oauth_access_token",
14
+ "oauth_consent",
15
+ "oauth_client_assertion"
16
+ ],
17
+ statements: ({ table, user, id, idRef }) => [
18
+ ddl`create table ${table("oauth_client")} (
19
+ id ${id} primary key,
20
+ client_id text not null unique,
21
+ client_secret text,
22
+ client_discovery_id text,
23
+ disabled boolean,
24
+ skip_consent boolean,
25
+ enable_end_session boolean,
26
+ subject_type text,
27
+ scopes jsonb,
28
+ client_credentials_scopes jsonb,
29
+ user_id ${idRef} references ${user} (id) on delete cascade,
30
+ created_at timestamptz,
31
+ updated_at timestamptz,
32
+ name text,
33
+ uri text,
34
+ icon text,
35
+ contacts jsonb,
36
+ tos text,
37
+ policy text,
38
+ software_id text,
39
+ software_version text,
40
+ software_statement text,
41
+ redirect_uris jsonb not null,
42
+ post_logout_redirect_uris jsonb,
43
+ backchannel_logout_uri text,
44
+ backchannel_logout_session_required boolean,
45
+ token_endpoint_auth_method text,
46
+ application_type text,
47
+ jwks text,
48
+ jwks_uri text,
49
+ grant_types jsonb,
50
+ response_types jsonb,
51
+ require_pkce boolean,
52
+ dpop_bound_access_tokens boolean,
53
+ reference_id text,
54
+ metadata jsonb
55
+ )`,
56
+ ddl`create index oauth_client_user_id_idx on ${table("oauth_client")} (user_id)`,
57
+ ddl`create table ${table("oauth_resource")} (
58
+ id ${id} primary key,
59
+ identifier text not null unique,
60
+ name text not null,
61
+ access_token_ttl integer,
62
+ refresh_token_ttl integer,
63
+ signing_algorithm text,
64
+ signing_key_id text,
65
+ allowed_scopes jsonb,
66
+ custom_claims jsonb,
67
+ dpop_bound_access_tokens_required boolean,
68
+ disabled boolean,
69
+ created_at timestamptz,
70
+ updated_at timestamptz,
71
+ policy_version integer,
72
+ metadata jsonb
73
+ )`,
74
+ ddl`create table ${table("oauth_client_resource")} (
75
+ id ${id} primary key,
76
+ client_id text not null references ${table("oauth_client")} (client_id) on delete cascade,
77
+ resource_id text not null references ${table("oauth_resource")} (identifier) on delete cascade,
78
+ metadata jsonb,
79
+ created_at timestamptz
80
+ )`,
81
+ ddl`create index oauth_client_resource_client_id_idx on ${table("oauth_client_resource")} (client_id)`,
82
+ ddl`create index oauth_client_resource_resource_id_idx on ${table("oauth_client_resource")} (resource_id)`,
83
+ ddl`create unique index oauth_client_resource_client_id_resource_id_uidx on ${table("oauth_client_resource")} (client_id, resource_id)`,
84
+ ddl`create table ${table("oauth_refresh_token")} (
85
+ id ${id} primary key,
86
+ token text not null unique,
87
+ client_id text not null references ${table("oauth_client")} (client_id) on delete cascade,
88
+ session_id ${idRef} references ${table("session")} (id) on delete set null,
89
+ user_id ${idRef} not null references ${user} (id) on delete cascade,
90
+ reference_id text,
91
+ authorization_code_id text,
92
+ resources jsonb,
93
+ requested_user_info_claims jsonb,
94
+ expires_at timestamptz not null,
95
+ created_at timestamptz not null,
96
+ revoked timestamptz,
97
+ rotated_at timestamptz,
98
+ rotation_replay_response text,
99
+ rotation_replay_expires_at timestamptz,
100
+ auth_time timestamptz,
101
+ confirmation jsonb,
102
+ scopes jsonb not null
103
+ )`,
104
+ ddl`create index oauth_refresh_token_client_id_idx on ${table("oauth_refresh_token")} (client_id)`,
105
+ ddl`create index oauth_refresh_token_session_id_idx on ${table("oauth_refresh_token")} (session_id)`,
106
+ ddl`create index oauth_refresh_token_user_id_idx on ${table("oauth_refresh_token")} (user_id)`,
107
+ ddl`create index oauth_refresh_token_authorization_code_id_idx on ${table("oauth_refresh_token")} (authorization_code_id)`,
108
+ ddl`create table ${table("oauth_access_token")} (
109
+ id ${id} primary key,
110
+ token text not null unique,
111
+ client_id text not null references ${table("oauth_client")} (client_id) on delete cascade,
112
+ session_id ${idRef} references ${table("session")} (id) on delete set null,
113
+ user_id ${idRef} references ${user} (id) on delete cascade,
114
+ reference_id text,
115
+ authorization_code_id text,
116
+ resources jsonb,
117
+ requested_user_info_claims jsonb,
118
+ refresh_id ${idRef} references ${table("oauth_refresh_token")} (id) on delete cascade,
119
+ expires_at timestamptz not null,
120
+ created_at timestamptz not null,
121
+ revoked timestamptz,
122
+ confirmation jsonb,
123
+ scopes jsonb not null
124
+ )`,
125
+ ddl`create index oauth_access_token_client_id_idx on ${table("oauth_access_token")} (client_id)`,
126
+ ddl`create index oauth_access_token_session_id_idx on ${table("oauth_access_token")} (session_id)`,
127
+ ddl`create index oauth_access_token_user_id_idx on ${table("oauth_access_token")} (user_id)`,
128
+ ddl`create index oauth_access_token_authorization_code_id_idx on ${table("oauth_access_token")} (authorization_code_id)`,
129
+ ddl`create index oauth_access_token_refresh_id_idx on ${table("oauth_access_token")} (refresh_id)`,
130
+ ddl`create table ${table("oauth_consent")} (
131
+ id ${id} primary key,
132
+ client_id text not null references ${table("oauth_client")} (client_id) on delete cascade,
133
+ user_id ${idRef} references ${user} (id) on delete cascade,
134
+ reference_id text,
135
+ resources jsonb,
136
+ requested_user_info_claims jsonb,
137
+ scopes jsonb not null,
138
+ created_at timestamptz not null,
139
+ updated_at timestamptz not null
140
+ )`,
141
+ ddl`create index oauth_consent_client_id_idx on ${table("oauth_consent")} (client_id)`,
142
+ ddl`create index oauth_consent_user_id_idx on ${table("oauth_consent")} (user_id)`,
143
+ ddl`create table ${table("oauth_client_assertion")} (
144
+ id ${id} primary key,
145
+ expires_at timestamptz not null
146
+ )`
147
+ ]
148
+ };
149
+ //#endregion
150
+ export { mcp };
@@ -0,0 +1,22 @@
1
+ import { core } from "./001-core.js";
2
+ import { twoFactor } from "./002-two-factor.js";
3
+ import { passkeys } from "./003-passkeys.js";
4
+ import { signInPolicy } from "./004-sign-in-policy.js";
5
+ import { staffSignIn } from "./005-staff-sign-in.js";
6
+ import { organizations } from "./006-organizations.js";
7
+ import { mcp } from "./007-mcp.js";
8
+ //#region src/better-auth/store/migrations/index.ts
9
+ /** The auth store's migrations, by version. A new one goes last, with the next version. */
10
+ const storeMigrations = [
11
+ core,
12
+ twoFactor,
13
+ passkeys,
14
+ signInPolicy,
15
+ staffSignIn,
16
+ organizations,
17
+ mcp
18
+ ];
19
+ /** The version the store is at once every migration is applied. */
20
+ const latestStoreVersion = storeMigrations.at(-1).version;
21
+ //#endregion
22
+ export { latestStoreVersion, storeMigrations };
@@ -0,0 +1,3 @@
1
+ import "../../user-table.js";
2
+ import "../store-names.js";
3
+ import "kysely";
@@ -0,0 +1,14 @@
1
+ import { storeTable } from "../store-names.js";
2
+ import { sql } from "kysely";
3
+ //#region src/better-auth/store/migrations/migration.ts
4
+ /** The `ddl` parts of the app's names. */
5
+ const migrationNames = (names) => ({
6
+ table: (name) => storeTable(names, name),
7
+ user: storeTable(names, names.users.modelName),
8
+ userColumn: names.users.column,
9
+ metadata: names.users.metadata,
10
+ id: sql.raw(names.uuidIds ? "uuid default pg_catalog.gen_random_uuid()" : "text"),
11
+ idRef: sql.raw(names.uuidIds ? "uuid" : "text")
12
+ });
13
+ //#endregion
14
+ export { migrationNames };
@@ -0,0 +1,7 @@
1
+ import "./store-names.js";
2
+ import "./migrations/migration.js";
3
+ import { Kysely } from "kysely";
4
+ //#region src/better-auth/store/migrations-table.d.ts
5
+ /** The table, in the store's schema. */
6
+ export declare const migrationsTableName = "auth_migrations";
7
+ //#endregion
@@ -0,0 +1,23 @@
1
+ import { ddl, ddlText } from "./ddl.js";
2
+ import { storeTable } from "./store-names.js";
3
+ import { sql } from "kysely";
4
+ //#region src/better-auth/store/migrations-table.ts
5
+ /** The table, in the store's schema. */
6
+ const migrationsTableName = "auth_migrations";
7
+ const migrationsTable = (names) => storeTable(names, migrationsTableName);
8
+ /** The statement that makes the table. */
9
+ const createMigrationsTable = (names) => ddl`create table ${migrationsTable(names)} (
10
+ version integer primary key,
11
+ name text not null,
12
+ applied_at timestamptz default current_timestamp not null
13
+ )`;
14
+ /** The statement that records `migrations` as applied. */
15
+ const recordMigrations = (names, migrations) => ddl`insert into ${migrationsTable(names)} (version, name) values ${sql.join(migrations.map(({ version, name }) => ddl`(${sql.lit(version)}, ${sql.lit(name)})`))}`;
16
+ /** The versions the store has applied, in order; `undefined` when it has no migrations table. */
17
+ const appliedVersions = async (db, names) => {
18
+ const [found] = (await sql`select to_regclass(${ddlText(migrationsTable(names))}) is not null as found`.execute(db)).rows;
19
+ if (!found?.found) return void 0;
20
+ return (await sql`select version from ${migrationsTable(names)} order by version`.execute(db)).rows.map((row) => row.version);
21
+ };
22
+ //#endregion
23
+ export { appliedVersions, createMigrationsTable, migrationsTableName, recordMigrations };
@@ -0,0 +1,7 @@
1
+ import { AdminAuth } from "../create-auth.js";
2
+ import { ResourceModel } from "@protobase/schema";
3
+ import { Kysely } from "kysely";
4
+ //#region src/better-auth/store/resources-outside.d.ts
5
+ /** Refuses a resource over a table of the admin store: the user table, a feature's table or the record of migrations. */
6
+ export declare const checkResourcesOutsideAuthStore: (db: Kysely<any>, models: readonly ResourceModel[], auth: AdminAuth) => Promise<void>;
7
+ //#endregion
@@ -0,0 +1,20 @@
1
+ import { storeDb } from "./store-db.js";
2
+ import { authStoreTables } from "../auth-tables.js";
3
+ import { sql } from "kysely";
4
+ //#region src/better-auth/store/resources-outside.ts
5
+ const quoted = (name) => `"${name.replaceAll("\"", "\"\"")}"`;
6
+ const resolve = async (db, tables) => (await sql`select t.n::int as n, ns.nspname as schema, c.relname as name, current_database() as database
7
+ from unnest(${tables.map(({ schema, name }) => schema ? `${quoted(schema)}.${quoted(name)}` : quoted(name))}::text[]) with ordinality as t(name, n)
8
+ join pg_class c on c.oid = to_regclass(t.name) join pg_namespace ns on ns.oid = c.relnamespace order by t.n`.execute(db)).rows;
9
+ /** Refuses a resource over a table of the admin store: the user table, a feature's table or the record of migrations. */
10
+ const checkResourcesOutsideAuthStore = async (db, models, auth) => {
11
+ if (models.length === 0) return;
12
+ const store = await resolve(storeDb(auth), authStoreTables(auth));
13
+ const same = (a, b) => a.database === b.database && a.schema === b.schema && a.name === b.name;
14
+ const over = (await resolve(db, models.map((model) => model.table))).filter((table) => store.some((own) => same(own, table)));
15
+ if (over.length === 0) return;
16
+ const named = over.map((table) => `${models[table.n - 1].name} (${table.schema}.${table.name})`).join(", ");
17
+ throw new Error(`Resources over the auth store's tables, which hold password hashes, sessions and tokens: ${named}. Remove them from the config; the auth store is read through Better Auth alone.`);
18
+ };
19
+ //#endregion
20
+ export { checkResourcesOutsideAuthStore };
@@ -0,0 +1,13 @@
1
+ import { Kysely, PostgresDialect } from "kysely";
2
+ //#region src/better-auth/store/store-db.ts
3
+ /**
4
+ * A Kysely on the admin store's connections: `createAuth`'s `database`, a `pg` Pool or `{ dialect, type: 'postgres' }`.
5
+ * The pool is the app's, so it is never destroyed here.
6
+ */
7
+ const storeDb = ({ options: { database } }) => {
8
+ if (database && typeof database === "object" && "dialect" in database) return new Kysely({ dialect: database.dialect });
9
+ if (database && typeof database === "object" && "connect" in database) return new Kysely({ dialect: new PostgresDialect({ pool: database }) });
10
+ throw new Error("The admin store's database is neither a pg Pool nor { dialect, type: 'postgres' }");
11
+ };
12
+ //#endregion
13
+ export { storeDb };
@@ -0,0 +1,2 @@
1
+ import "../user-table.js";
2
+ import "../create-auth.js";
@@ -0,0 +1,14 @@
1
+ import { sql } from "kysely";
2
+ //#region src/better-auth/store/store-names.ts
3
+ /** The schema the admin store lives in; the search path decides when its options name none. */
4
+ const storeSchema = ({ options: { database } }) => database && "schemaName" in database ? database.schemaName : void 0;
5
+ /** The store's configured names, from the app's auth. */
6
+ const storeNames = (auth) => ({
7
+ schema: storeSchema(auth),
8
+ users: auth.userTable,
9
+ uuidIds: auth.options.advanced?.database?.generateId === "uuid"
10
+ });
11
+ /** A table of the store, in its schema, as an identifier for `ddl`. */
12
+ const storeTable = ({ schema }, name) => schema === void 0 ? sql.id(name) : sql.id(schema, name);
13
+ //#endregion
14
+ export { storeNames, storeSchema, storeTable };
@@ -0,0 +1,7 @@
1
+ //#region src/better-auth/store/table-names.d.ts
2
+ /**
3
+ * The admin store's tables besides the user table, whose name the app may configure: every feature's, which the store
4
+ * has whether the app turns the feature on or not, and the record of its migrations.
5
+ */
6
+ export declare const storeTableNames: string[];
7
+ //#endregion
@@ -0,0 +1,10 @@
1
+ import { storeMigrations } from "./migrations/index.js";
2
+ import { migrationsTableName } from "./migrations-table.js";
3
+ //#region src/better-auth/store/table-names.ts
4
+ /**
5
+ * The admin store's tables besides the user table, whose name the app may configure: every feature's, which the store
6
+ * has whether the app turns the feature on or not, and the record of its migrations.
7
+ */
8
+ const storeTableNames = [...storeMigrations.flatMap((migration) => migration.tables), migrationsTableName];
9
+ //#endregion
10
+ export { storeTableNames };
@@ -1,5 +1,5 @@
1
- import { AdminAuth } from "./create-auth.js";
2
1
  import { parseRoles } from "./parse-roles.js";
2
+ import { AdminAuth } from "./create-auth.js";
3
3
  //#region src/better-auth/users.d.ts
4
4
  /** The roles this auth instance allows, `admin` first. */
5
5
  export declare const roleChoices: (auth: AdminAuth) => string[];
@@ -1,5 +1,5 @@
1
- import "../better-auth/create-auth.js";
2
1
  import { TenantValue } from "../types.js";
2
+ import "../better-auth/create-auth.js";
3
3
  //#region src/comments/comment-users.d.ts
4
4
  /** The users comments name, mention and mail: from the project's auth. */
5
5
  export type CommentUsers = {
@@ -0,0 +1,2 @@
1
+ import { configExports } from "./resource-source.js";
2
+ export { configExports };
@@ -0,0 +1,2 @@
1
+ import { configExports } from "./resource-source.js";
2
+ export { configExports };
@@ -1,7 +1,6 @@
1
1
  import { MobileConfig } from "./mobile-config.js";
2
2
  import { AppIdentity } from "./app-identity.js";
3
3
  import { AppIcons } from "./web-app/app-icons.js";
4
- import { AdminAuth } from "./better-auth/create-auth.js";
5
4
  import { EventsOptions } from "./changes/events-options.js";
6
5
  import { JobDefinition } from "./jobs/job-types.js";
7
6
  import { Admin, Authenticator, PageSource, ViewSource } from "./types.js";
@@ -15,6 +14,7 @@ import { Difficulty } from "./forms/challenge.js";
15
14
  import { ResourceSource } from "./resource-source.js";
16
15
  import { FunctionSource } from "./functions/define-function.js";
17
16
  import { AdminOptions } from "./admin-options.js";
17
+ import { AdminAuth } from "./better-auth/create-auth.js";
18
18
  import { BottomBarSource, UserMenuSource } from "@protobase/schema";
19
19
  import { Db } from "@protobase/query";
20
20
  import { JWTPayload } from "jose";
package/dist/index.d.ts CHANGED
@@ -1,18 +1,9 @@
1
1
  import { MobileConfig } from "./mobile-config.js";
2
2
  import { AppIdentity } from "./app-identity.js";
3
3
  import { AppIcons, PngIcon, pngIcons } from "./web-app/app-icons.js";
4
- import { StaffSignIn } from "./better-auth/staff-log.js";
5
- import { RoleDefinition, RolesInput } from "./better-auth/organizations/role-definitions.js";
6
- import { MailMessage, Mailer } from "./mail/smtp-mailer.js";
7
- import { OperatorProvider, readOperatorSettings } from "./better-auth/operator-provider.js";
8
- import { OrganizationRole, StoredMember, StoredOrganization } from "./better-auth/organizations/store.js";
9
- import { SignInPolicy, SignInRule, StaffAccessRule, defaultSignInPolicy, signInPolicyMethods } from "./better-auth/sign-in-policy.js";
10
- import { OrganizationsOptions } from "./better-auth/organizations/options.js";
11
- import { PlatformSignIn, readPlatformSignIn } from "./better-auth/platform-sign-in.js";
12
- import { EmailComponent, EmailOptions, EmailTemplate, RenderedEmail, defineEmail } from "./mail/define-email.js";
13
- import { AdminAuth, CreateAuthOptions, UserCreatedHook, createAuth, normalizeRoles } from "./better-auth/create-auth.js";
14
4
  import { EventsOptions } from "./changes/events-options.js";
15
5
  import { StandardSchema, readJson } from "./functions/read-json.js";
6
+ import { MailMessage, Mailer } from "./mail/smtp-mailer.js";
16
7
  import { JsonObject, JsonValue } from "./notifications/json-value.js";
17
8
  import { HistoryPosition, NewNotification, StoredNotification, historyIdPattern, historyLimits } from "./notifications/history.js";
18
9
  import { PushMessage, PushMessageError, Urgency, WebPushFields, maxTtlSeconds, pushMessage, urgencies } from "./notifications/message.js";
@@ -73,7 +64,9 @@ import { BetterAuthAuthenticator, BetterAuthAuthenticatorOptions, betterAuthAuth
73
64
  import { parseRoles } from "./better-auth/parse-roles.js";
74
65
  import { LinkedAccount, NewUser, StoredUser, createUser, deleteUser, hasUsers, listUsers, roleChoices, setUserBanned, setUserRole } from "./better-auth/users.js";
75
66
  import { IssueTokenOptions, issueToken, maxTokenTtlSeconds } from "./better-auth/tokens.js";
67
+ import { SignInPolicy, SignInRule, StaffAccessRule, defaultSignInPolicy, signInPolicyMethods } from "./better-auth/sign-in-policy.js";
76
68
  import { passwordLength } from "./better-auth/new-account-password.js";
69
+ import { OperatorProvider, readOperatorSettings } from "./better-auth/operator-provider.js";
77
70
  import { isOAuthWellKnownPath, oauthWellKnownPaths, webauthnPath } from "./better-auth/origins.js";
78
71
  import { goTruePath } from "./gotrue/keys.js";
79
72
  import { supabasePath } from "./supabase-paths.js";
@@ -81,7 +74,10 @@ import { realtimeLimits } from "./realtime/realtime-limits.js";
81
74
  import { capSocketMessages, honorSocketMessageCaps, socketMessageCapOf } from "./functions/socket-message-cap.js";
82
75
  import { defaultAppName, shownAppName } from "./app-name.js";
83
76
  import { webManifestPath } from "./web-app/web-manifest-route.js";
77
+ import { PlatformSignIn, readPlatformSignIn } from "./better-auth/platform-sign-in.js";
84
78
  import { authSchemaMigration, checkAuthSchema } from "./better-auth/auth-schema.js";
79
+ import { authSchemaDrift } from "./better-auth/store/drift.js";
80
+ import { checkResourcesOutsideAuthStore } from "./better-auth/store/resources-outside.js";
85
81
  import { changesMigration, checkChanges, migrationCommand } from "./changes/capture-schema.js";
86
82
  import { checkComputed, computedMigration } from "./computed/computed-schema.js";
87
83
  import { isCaptured } from "./changes/capture-sql.js";
@@ -109,7 +105,11 @@ import { sendNotification } from "./notifications/send-notification.js";
109
105
  import { VapidSettings, readVapidSettings, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable } from "./notifications/web-push/vapid-settings.js";
110
106
  import { WebPushOptions, webPushSender } from "./notifications/web-push/web-push-sender.js";
111
107
  import { generateVapidKeys } from "./notifications/web-push/keys.js";
108
+ import { RoleDefinition, RolesInput } from "./better-auth/organizations/role-definitions.js";
109
+ import { OrganizationRole, StoredMember, StoredOrganization } from "./better-auth/organizations/store.js";
110
+ import { OrganizationsOptions } from "./better-auth/organizations/options.js";
112
111
  import { MemberInput, NewOrganization, addAppRoleToOwners, addMember, createOrganization, listOrganizations, removeMember, setMemberRoles } from "./better-auth/organizations/host.js";
112
+ import { StaffSignIn } from "./better-auth/staff-log.js";
113
113
  import { AssistantBackend, assistantProtocolRoutes } from "./assistant/protocol-routes.js";
114
114
  import { fileConversationStore } from "./assistant/file-conversation-store.js";
115
115
  import { withCacheBreakpoints } from "./assistant/cache-breakpoints.js";
@@ -155,10 +155,12 @@ import { aspectRatio, fileSize, fileType, imageSize, processor } from "./files/p
155
155
  import { defineJob, isJobDefinition, jobDefinitions } from "./jobs/define-job.js";
156
156
  import { FatalJobError } from "./jobs/run-job.js";
157
157
  import { isSchedule } from "./jobs/schedule.js";
158
+ import { EmailComponent, EmailOptions, EmailTemplate, RenderedEmail, defineEmail } from "./mail/define-email.js";
158
159
  import { DrainResult, JobsRuntime, StartJobsOptions, startJobs } from "./jobs/runtime.js";
159
160
  import { jobsDrainApp } from "./jobs/drain-route.js";
160
161
  import { checkJobsSchema, jobsSchema, jobsSchemaMigration } from "./jobs/schema.js";
161
162
  import { MobileRelease, ReleaseFile, ServedReleaseFile, composeRelease, releaseManifest } from "./mobile-release/release.js";
162
163
  import { MobileReleaseAppInput, OfferedRelease, mobileReleaseApp } from "./mobile-release/release-app.js";
163
164
  import { mobileSigningKeyVariable, readSigningKey } from "./mobile-release/signing-key.js";
164
- export { type Admin, type AdminAuth, type AdminOptions, type ApiFunction, type ApiKeys, type ApiKeysOptions, type ApnsEnvironment, type AppIcons, type AppIdentity, type AppPoolConfig, type ApplyOptions, type ApplyResult, type ApprovalAnswer, type ApprovalRequest, type AssistantBackend, type AssistantOptions, type AssistantSettings, type AssistantTool, type AuditEvent, type AuditQueue, type Authenticator, type BatchOperation, type BatchResult, type BetterAuthAuthenticator, type BetterAuthAuthenticatorOptions, type Caller, type CallerOptions, type CapturedRow, type CascadingKey, type ChatMessage, type ChatTextPart, type CheckAiInput, type CleanupEntry, type CleanupReport, type CleanupSchedule, type CoalescedChange, type CommentItem, type CommentUsers, type Completion, type CompletionOptions, ConnectionsBusy, type Conversation, type ConversationRecord, type ConversationStore, type ConversationsOptions, type CorsOptions, type CorsOrigins, type CreateAdminInput, type CreateAuthOptions, type Device, type DeviceColumn, type DeviceKind, type DeviceStore, DeviceStoreError, type DrainResult, type EmailComponent, type EmailOptions, type EmailTemplate, type EncryptionStatus, type EncryptionTools, type EncryptionToolsInput, type EnqueueOptions, type ErrorReporter, type ErrorReportingOptions, type ErrorReportingSettings, type EventData, type EventsOptions, FatalJobError, type FieldApplied, type FieldStatus, type FileCleanupInput, type FileLimits, type FileObject, type FileProvider, type FileRef, type FileStore, type FileVariantObject, type FilesOptions, type FunctionApp, type FunctionCaller, type FunctionContext, type FunctionEnv, type FunctionHandler, type FunctionOptions, type FunctionRecords, type FunctionSocket, type FunctionSource, type HistoryColumn, type HistoryOptions, type HistoryPosition, type HistoryStore, HistoryStoreError, HttpProblem, type IssueTokenOptions, type JobContext, type JobDefinition, type JobOptions, type JobsRuntime, type JsonObject, type JsonValue, type JwtOptions, type JwtVerifyOptions, type KeyFunctionContext, type LinkedAccount, type ListParams, type LocalFilesOptions, type MailMessage, type Mailer, type MapLayer, type MapOptions, type MapSettings, type McpApprovals, type McpGateInput, type McpHandlerInput, type McpRoutesInput, type McpServerInput, type McpToolsInput, type McpWrites, type MemberInput, type Membership, MissingCredentials, type MobileConfig, type MobileRelease, type MobileReleaseAppInput, ModelError, type ModelSettings, type NewDevice, type NewNotification, type NewOrganization, type NewUser, type NotificationRecipients, NotificationSendError, type NotificationsOptions, type OfferedRelease, type OperatorProvider, type OrganizationRole, type OrganizationsOptions, type PgModule, type PipelineHook, type PlatformSignIn, type PluginOption, type PluginRef, type PngIcon, type ProjectConfig, type ProtectedFunctionOptions, type PublicFunctionContext, type PublicFunctionEnv, type PublicFunctionHandler, type PublicFunctionOptions, type PushAnswer, type PushMessage, PushMessageError, type PushSender, type QueryOptions, type QueryResult, type ReadableResources, type ReasoningDetail, type ReasoningEffort, type RebindOption, type RecordKeyInput, type RecordPage, type ReleaseFile, type RenderedEmail, type ResourceChange, type ResourceSource, type RoleDefinition, type RolesInput, type RunContext, type RuntimeOptions, type S3Bucket, type S3FilesOptions, type S3ListPage, type S3Object, type ScanGuardMode, type ScheduledDelete, type SendNotification, type ServedReleaseFile, type Session, type SessionOrganization, type Sharp, type SignInPolicy, type SignInRule, type SignatureOptions, type SocketEvents, type SourceOption, type SourceRef, type StaffAccessRule, type StaffSignIn, type StandardSchema, type StandardWebhookOptions, type StartJobsOptions, type StoreFileInput, type StoredMember, type StoredNotification, type StoredObject, type StoredOrganization, type StoredUser, type StrayValues, type SubscriptionDefinition, type SubscriptionEvent, type SubscriptionOptions, type TenantValue, type ToolAnnotations, type ToolCall, type ToolContext, type ToolRecord, type ToolRecords, type ToolSpec, type TrustedApp, type TurnOptions, type UnreadableEntry, type Urgency, type User, type UserCreatedHook, type VapidSettings, type ViewSource, type WebPushFields, type WebPushOptions, type WebhooksOptions, type WidgetOptions, type WriteEvent, type WriteOperation, type WriteRecordToolsInput, addAppRoleToOwners, addMember, apiKeyCaller, apiKeySettings, apiKeyVariables, appPool, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaMigration, authStoreTables, backgroundSettled, badRequest, batchWriteTool, beforeSignInPluginsVariable, betterAuthAuthenticator, betterAuthTokens, capSocketMessages, changesMigration, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkJobsSchema, checkNotificationsSchema, checkQueryRunner, checkSourceNames, checkViewQueries, checkWebhooksSchema, coalesce, commentsMigration, composeRelease, computedMigration, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createEncryptionTools, createFileCleanup, createOrganization, createRecordTool, createUser, defaultAppName, defaultHistoryPage, defaultSignInPolicy, defineConfig, defineEmail, defineFunction, defineJob, defineTool, deleteRecordTool, deleteUser, deviceIdParam, deviceStore, devicesPath, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, generateVapidKeys, getRecordTool, goTruePath, handleDroppedConnections, hasUsers, historyIdParam, historyIdPattern, historyLimits, historyPath, historyStore, honorSocketMessageCaps, imageSize, isBackgroundWork, isCaptured, isJobDefinition, isOAuthWellKnownPath, isSchedule, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, jwtVerifier, limitedFileStore, listOrganizations, listRecordsTool, listResourcesTool, listUsers, localFileStore, localFiles, longQueryPool, longQueryTimeoutMs, mapSettings, mapStyleUrl, mapStyleVariable, maxDevicesPerUser, maxHistoryPage, maxMessageBytes, maxRecipients, maxTokenTtlSeconds, maxTtlSeconds, maxUnreadCount, maxWidgetPropsBytes, mcpApprovals, mcpGate, mcpHandler, mcpRoutes, mcpServer, mcpToolContext, mcpTools, mergeConfig, migrationCommand, mobileReleaseApp, mobileSigningKeyVariable, newWebhookSecret, normalizeRoles, notFound, notificationSenders, notifications, notificationsMigration, oauthWellKnownPaths, objectKey, parseColumns, parseRoles, passwordLength, pluginOptions, pluginsBeforeSignIn, pluginsFor, pluginsVariable, pngIcons, poolWaitMs, postgresDeviceStore, postgresHistoryStore, processor, pushMessage, queryRunnerMigration, readDbConnections, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readRecordTools, readSigningKey, readVapidSettings, readWriteQueryTool, readableResources, realtimeLimits, recordOf, releaseManifest, removeDevicesWithUsers, removeHistoryWithUsers, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runInBackground, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, sendNotification, sessionOf, setMemberRoles, setUserBanned, setUserRole, shownAppName, signInPolicyMethods, socketMessageCapOf, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, storageProvider, storeFile, storeUsage, streamChatCompletion, subscription, supabasePath, thumbHash, unauthorized, updateRecordTool, urgencies, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable, variantPath, verifySignature, verifyStandardWebhook, waitUntil, wantsLongQueries, webManifestPath, webPushSender, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps, writeRecordTools };
165
+ import { AdminAuth, CreateAuthOptions, UserCreatedHook, createAuth, normalizeRoles } from "./better-auth/create-auth.js";
166
+ export { type Admin, type AdminAuth, type AdminOptions, type ApiFunction, type ApiKeys, type ApiKeysOptions, type ApnsEnvironment, type AppIcons, type AppIdentity, type AppPoolConfig, type ApplyOptions, type ApplyResult, type ApprovalAnswer, type ApprovalRequest, type AssistantBackend, type AssistantOptions, type AssistantSettings, type AssistantTool, type AuditEvent, type AuditQueue, type Authenticator, type BatchOperation, type BatchResult, type BetterAuthAuthenticator, type BetterAuthAuthenticatorOptions, type Caller, type CallerOptions, type CapturedRow, type CascadingKey, type ChatMessage, type ChatTextPart, type CheckAiInput, type CleanupEntry, type CleanupReport, type CleanupSchedule, type CoalescedChange, type CommentItem, type CommentUsers, type Completion, type CompletionOptions, ConnectionsBusy, type Conversation, type ConversationRecord, type ConversationStore, type ConversationsOptions, type CorsOptions, type CorsOrigins, type CreateAdminInput, type CreateAuthOptions, type Device, type DeviceColumn, type DeviceKind, type DeviceStore, DeviceStoreError, type DrainResult, type EmailComponent, type EmailOptions, type EmailTemplate, type EncryptionStatus, type EncryptionTools, type EncryptionToolsInput, type EnqueueOptions, type ErrorReporter, type ErrorReportingOptions, type ErrorReportingSettings, type EventData, type EventsOptions, FatalJobError, type FieldApplied, type FieldStatus, type FileCleanupInput, type FileLimits, type FileObject, type FileProvider, type FileRef, type FileStore, type FileVariantObject, type FilesOptions, type FunctionApp, type FunctionCaller, type FunctionContext, type FunctionEnv, type FunctionHandler, type FunctionOptions, type FunctionRecords, type FunctionSocket, type FunctionSource, type HistoryColumn, type HistoryOptions, type HistoryPosition, type HistoryStore, HistoryStoreError, HttpProblem, type IssueTokenOptions, type JobContext, type JobDefinition, type JobOptions, type JobsRuntime, type JsonObject, type JsonValue, type JwtOptions, type JwtVerifyOptions, type KeyFunctionContext, type LinkedAccount, type ListParams, type LocalFilesOptions, type MailMessage, type Mailer, type MapLayer, type MapOptions, type MapSettings, type McpApprovals, type McpGateInput, type McpHandlerInput, type McpRoutesInput, type McpServerInput, type McpToolsInput, type McpWrites, type MemberInput, type Membership, MissingCredentials, type MobileConfig, type MobileRelease, type MobileReleaseAppInput, ModelError, type ModelSettings, type NewDevice, type NewNotification, type NewOrganization, type NewUser, type NotificationRecipients, NotificationSendError, type NotificationsOptions, type OfferedRelease, type OperatorProvider, type OrganizationRole, type OrganizationsOptions, type PgModule, type PipelineHook, type PlatformSignIn, type PluginOption, type PluginRef, type PngIcon, type ProjectConfig, type ProtectedFunctionOptions, type PublicFunctionContext, type PublicFunctionEnv, type PublicFunctionHandler, type PublicFunctionOptions, type PushAnswer, type PushMessage, PushMessageError, type PushSender, type QueryOptions, type QueryResult, type ReadableResources, type ReasoningDetail, type ReasoningEffort, type RebindOption, type RecordKeyInput, type RecordPage, type ReleaseFile, type RenderedEmail, type ResourceChange, type ResourceSource, type RoleDefinition, type RolesInput, type RunContext, type RuntimeOptions, type S3Bucket, type S3FilesOptions, type S3ListPage, type S3Object, type ScanGuardMode, type ScheduledDelete, type SendNotification, type ServedReleaseFile, type Session, type SessionOrganization, type Sharp, type SignInPolicy, type SignInRule, type SignatureOptions, type SocketEvents, type SourceOption, type SourceRef, type StaffAccessRule, type StaffSignIn, type StandardSchema, type StandardWebhookOptions, type StartJobsOptions, type StoreFileInput, type StoredMember, type StoredNotification, type StoredObject, type StoredOrganization, type StoredUser, type StrayValues, type SubscriptionDefinition, type SubscriptionEvent, type SubscriptionOptions, type TenantValue, type ToolAnnotations, type ToolCall, type ToolContext, type ToolRecord, type ToolRecords, type ToolSpec, type TrustedApp, type TurnOptions, type UnreadableEntry, type Urgency, type User, type UserCreatedHook, type VapidSettings, type ViewSource, type WebPushFields, type WebPushOptions, type WebhooksOptions, type WidgetOptions, type WriteEvent, type WriteOperation, type WriteRecordToolsInput, addAppRoleToOwners, addMember, apiKeyCaller, apiKeySettings, apiKeyVariables, appPool, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaDrift, authSchemaMigration, authStoreTables, backgroundSettled, badRequest, batchWriteTool, beforeSignInPluginsVariable, betterAuthAuthenticator, betterAuthTokens, capSocketMessages, changesMigration, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkJobsSchema, checkNotificationsSchema, checkQueryRunner, checkResourcesOutsideAuthStore, checkSourceNames, checkViewQueries, checkWebhooksSchema, coalesce, commentsMigration, composeRelease, computedMigration, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createEncryptionTools, createFileCleanup, createOrganization, createRecordTool, createUser, defaultAppName, defaultHistoryPage, defaultSignInPolicy, defineConfig, defineEmail, defineFunction, defineJob, defineTool, deleteRecordTool, deleteUser, deviceIdParam, deviceStore, devicesPath, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, generateVapidKeys, getRecordTool, goTruePath, handleDroppedConnections, hasUsers, historyIdParam, historyIdPattern, historyLimits, historyPath, historyStore, honorSocketMessageCaps, imageSize, isBackgroundWork, isCaptured, isJobDefinition, isOAuthWellKnownPath, isSchedule, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, jwtVerifier, limitedFileStore, listOrganizations, listRecordsTool, listResourcesTool, listUsers, localFileStore, localFiles, longQueryPool, longQueryTimeoutMs, mapSettings, mapStyleUrl, mapStyleVariable, maxDevicesPerUser, maxHistoryPage, maxMessageBytes, maxRecipients, maxTokenTtlSeconds, maxTtlSeconds, maxUnreadCount, maxWidgetPropsBytes, mcpApprovals, mcpGate, mcpHandler, mcpRoutes, mcpServer, mcpToolContext, mcpTools, mergeConfig, migrationCommand, mobileReleaseApp, mobileSigningKeyVariable, newWebhookSecret, normalizeRoles, notFound, notificationSenders, notifications, notificationsMigration, oauthWellKnownPaths, objectKey, parseColumns, parseRoles, passwordLength, pluginOptions, pluginsBeforeSignIn, pluginsFor, pluginsVariable, pngIcons, poolWaitMs, postgresDeviceStore, postgresHistoryStore, processor, pushMessage, queryRunnerMigration, readDbConnections, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readRecordTools, readSigningKey, readVapidSettings, readWriteQueryTool, readableResources, realtimeLimits, recordOf, releaseManifest, removeDevicesWithUsers, removeHistoryWithUsers, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runInBackground, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, sendNotification, sessionOf, setMemberRoles, setUserBanned, setUserRole, shownAppName, signInPolicyMethods, socketMessageCapOf, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, storageProvider, storeFile, storeUsage, streamChatCompletion, subscription, supabasePath, thumbHash, unauthorized, updateRecordTool, urgencies, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable, variantPath, verifySignature, verifyStandardWebhook, waitUntil, wantsLongQueries, webManifestPath, webPushSender, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps, writeRecordTools };
package/dist/index.js CHANGED
@@ -96,8 +96,10 @@ import { defineConfig, mergeConfig } from "./project-config.js";
96
96
  import { withTrustedApps } from "./better-auth/app-tokens.js";
97
97
  import { betterAuthAuthenticator, betterAuthTokens } from "./better-auth/authenticator.js";
98
98
  import { issueToken, maxTokenTtlSeconds } from "./better-auth/tokens.js";
99
- import { authStoreTables } from "./better-auth/auth-tables.js";
100
99
  import { authSchemaMigration, checkAuthSchema } from "./better-auth/auth-schema.js";
100
+ import { authSchemaDrift } from "./better-auth/store/drift.js";
101
+ import { authStoreTables } from "./better-auth/auth-tables.js";
102
+ import { checkResourcesOutsideAuthStore } from "./better-auth/store/resources-outside.js";
101
103
  import { checkComputed, computedMigration } from "./computed/computed-schema.js";
102
104
  import { webhooks } from "./webhooks/table/plugin.js";
103
105
  import { checkWebhooksSchema, webhooksMigration } from "./webhooks/table/schema.js";
@@ -123,4 +125,4 @@ import { jobsDrainApp } from "./jobs/drain-route.js";
123
125
  import { composeRelease, releaseManifest } from "./mobile-release/release.js";
124
126
  import { mobileReleaseApp } from "./mobile-release/release-app.js";
125
127
  import { mobileSigningKeyVariable, readSigningKey } from "./mobile-release/signing-key.js";
126
- export { ConnectionsBusy, DeviceStoreError, FatalJobError, HistoryStoreError, HttpProblem, MissingCredentials, ModelError, NotificationSendError, PushMessageError, addAppRoleToOwners, addMember, apiKeyCaller, apiKeySettings, apiKeyVariables, appPool, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaMigration, authStoreTables, backgroundSettled, badRequest, batchWriteTool, beforeSignInPluginsVariable, betterAuthAuthenticator, betterAuthTokens, capSocketMessages, changesMigration, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkJobsSchema, checkNotificationsSchema, checkQueryRunner, checkSourceNames, checkViewQueries, checkWebhooksSchema, coalesce, commentsMigration, composeRelease, computedMigration, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createEncryptionTools, createFileCleanup, createOrganization, createRecordTool, createUser, defaultAppName, defaultHistoryPage, defaultSignInPolicy, defineConfig, defineEmail, defineFunction, defineJob, defineTool, deleteRecordTool, deleteUser, deviceIdParam, deviceStore, devicesPath, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, generateVapidKeys, getRecordTool, goTruePath, handleDroppedConnections, hasUsers, historyIdParam, historyIdPattern, historyLimits, historyPath, historyStore, honorSocketMessageCaps, imageSize, isBackgroundWork, isCaptured, isJobDefinition, isOAuthWellKnownPath, isSchedule, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, jwtVerifier, limitedFileStore, listOrganizations, listRecordsTool, listResourcesTool, listUsers, localFileStore, localFiles, longQueryPool, longQueryTimeoutMs, mapSettings, mapStyleUrl, mapStyleVariable, maxDevicesPerUser, maxHistoryPage, maxMessageBytes, maxRecipients, maxTokenTtlSeconds, maxTtlSeconds, maxUnreadCount, maxWidgetPropsBytes, mcpApprovals, mcpGate, mcpHandler, mcpRoutes, mcpServer, mcpToolContext, mcpTools, mergeConfig, migrationCommand, mobileReleaseApp, mobileSigningKeyVariable, newWebhookSecret, normalizeRoles, notFound, notificationSenders, notifications, notificationsMigration, oauthWellKnownPaths, objectKey, parseColumns, parseRoles, passwordLength, pluginOptions, pluginsBeforeSignIn, pluginsFor, pluginsVariable, pngIcons, poolWaitMs, postgresDeviceStore, postgresHistoryStore, processor, pushMessage, queryRunnerMigration, readDbConnections, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readRecordTools, readSigningKey, readVapidSettings, readWriteQueryTool, readableResources, realtimeLimits, recordOf, releaseManifest, removeDevicesWithUsers, removeHistoryWithUsers, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runInBackground, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, sendNotification, sessionOf, setMemberRoles, setUserBanned, setUserRole, shownAppName, signInPolicyMethods, socketMessageCapOf, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, storageProvider, storeFile, storeUsage, streamChatCompletion, subscription, supabasePath, thumbHash, unauthorized, updateRecordTool, urgencies, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable, variantPath, verifySignature, verifyStandardWebhook, waitUntil, wantsLongQueries, webManifestPath, webPushSender, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps, writeRecordTools };
128
+ export { ConnectionsBusy, DeviceStoreError, FatalJobError, HistoryStoreError, HttpProblem, MissingCredentials, ModelError, NotificationSendError, PushMessageError, addAppRoleToOwners, addMember, apiKeyCaller, apiKeySettings, apiKeyVariables, appPool, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaDrift, authSchemaMigration, authStoreTables, backgroundSettled, badRequest, batchWriteTool, beforeSignInPluginsVariable, betterAuthAuthenticator, betterAuthTokens, capSocketMessages, changesMigration, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkJobsSchema, checkNotificationsSchema, checkQueryRunner, checkResourcesOutsideAuthStore, checkSourceNames, checkViewQueries, checkWebhooksSchema, coalesce, commentsMigration, composeRelease, computedMigration, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createEncryptionTools, createFileCleanup, createOrganization, createRecordTool, createUser, defaultAppName, defaultHistoryPage, defaultSignInPolicy, defineConfig, defineEmail, defineFunction, defineJob, defineTool, deleteRecordTool, deleteUser, deviceIdParam, deviceStore, devicesPath, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, generateVapidKeys, getRecordTool, goTruePath, handleDroppedConnections, hasUsers, historyIdParam, historyIdPattern, historyLimits, historyPath, historyStore, honorSocketMessageCaps, imageSize, isBackgroundWork, isCaptured, isJobDefinition, isOAuthWellKnownPath, isSchedule, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, jwtVerifier, limitedFileStore, listOrganizations, listRecordsTool, listResourcesTool, listUsers, localFileStore, localFiles, longQueryPool, longQueryTimeoutMs, mapSettings, mapStyleUrl, mapStyleVariable, maxDevicesPerUser, maxHistoryPage, maxMessageBytes, maxRecipients, maxTokenTtlSeconds, maxTtlSeconds, maxUnreadCount, maxWidgetPropsBytes, mcpApprovals, mcpGate, mcpHandler, mcpRoutes, mcpServer, mcpToolContext, mcpTools, mergeConfig, migrationCommand, mobileReleaseApp, mobileSigningKeyVariable, newWebhookSecret, normalizeRoles, notFound, notificationSenders, notifications, notificationsMigration, oauthWellKnownPaths, objectKey, parseColumns, parseRoles, passwordLength, pluginOptions, pluginsBeforeSignIn, pluginsFor, pluginsVariable, pngIcons, poolWaitMs, postgresDeviceStore, postgresHistoryStore, processor, pushMessage, queryRunnerMigration, readDbConnections, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readRecordTools, readSigningKey, readVapidSettings, readWriteQueryTool, readableResources, realtimeLimits, recordOf, releaseManifest, removeDevicesWithUsers, removeHistoryWithUsers, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runInBackground, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, sendNotification, sessionOf, setMemberRoles, setUserBanned, setUserRole, shownAppName, signInPolicyMethods, socketMessageCapOf, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, storageProvider, storeFile, storeUsage, streamChatCompletion, subscription, supabasePath, thumbHash, unauthorized, updateRecordTool, urgencies, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable, variantPath, verifySignature, verifyStandardWebhook, waitUntil, wantsLongQueries, webManifestPath, webPushSender, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps, writeRecordTools };
@@ -1,5 +1,5 @@
1
- import { Mailer } from "../mail/smtp-mailer.js";
2
1
  import { StandardSchema } from "../functions/read-json.js";
2
+ import { Mailer } from "../mail/smtp-mailer.js";
3
3
  import { SendNotification } from "../notifications/send-input.js";
4
4
  import { Db } from "@protobase/query";
5
5
  //#region src/jobs/job-types.d.ts
@@ -1,6 +1,6 @@
1
- import { AdminAuth } from "../better-auth/create-auth.js";
2
1
  import { DeviceStore } from "./device-store.js";
3
2
  import { NotificationsOptions } from "./options.js";
3
+ import { AdminAuth } from "../better-auth/create-auth.js";
4
4
  import { Db } from "@protobase/query";
5
5
  //#region src/notifications/device-store-of.d.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { AdminAuth } from "../better-auth/create-auth.js";
2
1
  import { HistoryStore } from "./history-store.js";
3
2
  import { NotificationsOptions } from "./options.js";
3
+ import { AdminAuth } from "../better-auth/create-auth.js";
4
4
  import { Db } from "@protobase/query";
5
5
  //#region src/notifications/history-store-of.d.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { AdminAuth } from "../better-auth/create-auth.js";
2
1
  import { NotificationsOptions } from "./options.js";
2
+ import { AdminAuth } from "../better-auth/create-auth.js";
3
3
  import { Db } from "@protobase/query";
4
4
  //#region src/notifications/schema.d.ts
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { migrationCommand } from "../changes/capture-schema.js";
2
2
  import { historyNames, notificationsNames } from "./options.js";
3
- import { storeSchema } from "../better-auth/auth-tables.js";
3
+ import { storeSchema } from "../better-auth/store/store-names.js";
4
4
  import { deviceSessionColumnSql, devicesTableSql, qualified } from "./schema-sql.js";
5
5
  import { historyTableSql } from "./history-sql.js";
6
6
  import { sql } from "kysely";
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.47.1";
2
+ var version = "0.48.0";
3
3
  //#endregion
4
4
  export { version };
@@ -1,6 +1,5 @@
1
1
  import { MobileConfig } from "./mobile-config.js";
2
2
  import { AppIdentity } from "./app-identity.js";
3
- import { AdminAuth } from "./better-auth/create-auth.js";
4
3
  import { EventsOptions } from "./changes/events-options.js";
5
4
  import { Authenticator } from "./types.js";
6
5
  import { HistoryOptions } from "./history/options.js";
@@ -9,6 +8,7 @@ import { NotificationsOptions } from "./notifications/options.js";
9
8
  import { FilesOptions } from "./files/options.js";
10
9
  import { FunctionSource } from "./functions/define-function.js";
11
10
  import { AdminOptions } from "./admin-options.js";
11
+ import { AdminAuth } from "./better-auth/create-auth.js";
12
12
  import { Db } from "@protobase/query";
13
13
  //#region src/project-config.d.ts
14
14
  /** What `protobase.config.ts` may default-export. Everything is optional. */