@authhero/kysely-adapter 10.134.0 → 10.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +19 -9
- package/dist/kysely-adapter.mjs +20 -8
- package/package.json +2 -2
package/dist/kysely-adapter.cjs
CHANGED
|
@@ -163,4 +163,4 @@
|
|
|
163
163
|
user_id, created_at_ts, updated_at_ts, expires_at_ts,
|
|
164
164
|
auth_connection, auth_strategy_strategy, auth_strategy_strategy_type,
|
|
165
165
|
authenticated_at, auth_params
|
|
166
|
-
FROM login_sessions`.execute(t),await h.sql`DROP TABLE login_sessions`.execute(t),await h.sql`ALTER TABLE login_sessions_new RENAME TO login_sessions`.execute(t),await t.schema.createIndex("login_sessions_id_index").on("login_sessions").column("id").execute(),await t.schema.createIndex("idx_login_sessions_session_id").on("login_sessions").column("session_id").execute(),await t.schema.createIndex("login_sessions_tenant_user_idx").on("login_sessions").columns(["tenant_id","user_id"]).execute(),await t.schema.createIndex("login_sessions_state_idx").on("login_sessions").column("state").execute(),await t.schema.createIndex("idx_login_sessions_expires_at_ts").on("login_sessions").column("expires_at_ts").execute()}),w(" Recreated login_sessions without hoisted authParams_* columns")}async function Gm(e){}const Vm=Object.freeze(Object.defineProperty({__proto__:null,down:Gm,up:Wm},Symbol.toStringTag,{value:"Module"}));async function Xm(e){await e.schema.alterTable("refresh_tokens").addColumn("revoked_at_ts","bigint").execute()}async function Zm(e){await e.schema.alterTable("refresh_tokens").dropColumn("revoked_at_ts").execute()}const eh=Object.freeze(Object.defineProperty({__proto__:null,down:Zm,up:Xm},Symbol.toStringTag,{value:"Module"}));async function th(e){await e.schema.alterTable("clients").addColumn("owner_user_id","varchar(255)").execute(),await e.schema.alterTable("clients").addColumn("registration_type","varchar(32)").execute(),await e.schema.alterTable("clients").addColumn("registration_metadata","text").execute(),await e.schema.createIndex("idx_clients_owner_user_id").on("clients").columns(["tenant_id","owner_user_id"]).execute(),await e.schema.createTable("client_registration_tokens").addColumn("id","varchar(255)",t=>t.primaryKey()).addColumn("tenant_id","varchar(191)",t=>t.references("tenants.id").onDelete("cascade").notNull()).addColumn("token_hash","varchar(64)",t=>t.notNull()).addColumn("type","varchar(8)",t=>t.notNull()).addColumn("client_id","varchar(191)").addColumn("sub","varchar(255)").addColumn("constraints","text").addColumn("single_use","integer",t=>t.defaultTo(0).notNull()).addColumn("used_at_ts","bigint").addColumn("expires_at_ts","bigint").addColumn("created_at_ts","bigint",t=>t.notNull()).addColumn("revoked_at_ts","bigint").execute(),await e.schema.createIndex("idx_client_registration_tokens_hash").on("client_registration_tokens").columns(["tenant_id","token_hash"]).unique().execute(),await e.schema.createIndex("idx_client_registration_tokens_client").on("client_registration_tokens").columns(["tenant_id","client_id"]).execute()}async function ah(e){await e.schema.dropTable("client_registration_tokens").execute(),await e.schema.dropIndex("idx_clients_owner_user_id").execute(),await e.schema.alterTable("clients").dropColumn("registration_metadata").execute(),await e.schema.alterTable("clients").dropColumn("registration_type").execute(),await e.schema.alterTable("clients").dropColumn("owner_user_id").execute()}const nh=Object.freeze(Object.defineProperty({__proto__:null,down:ah,up:th},Symbol.toStringTag,{value:"Module"}));async function oh(e){try{return await h.sql`SELECT @@version_comment`.execute(e),"mysql"}catch{return"sqlite"}}const rh=[{index:"connections_tenant_id_idx",table:"connections",reason:"composite PK (tenant_id, id)"},{index:"idx_invites_tenant_id",table:"invites",reason:"idx_invites_tenant_created (tenant_id, created_at)"},{index:"idx_organizations_tenant_id",table:"organizations",reason:"idx_organizations_tenant_name_unique (tenant_id, name)"},{index:"role_permissions_role_fk",table:"role_permissions",reason:"role_permissions_pk (tenant_id, role_id, ...)"},{index:"themes_tenant_id_idx",table:"themes",reason:"themes_pkey (tenant_id, themeId)"},{index:"users_tenant_index",table:"users",reason:"stale on PlanetScale only; commented out locally in 2024"},{index:"idx_user_organizations_tenant_id",table:"user_organizations",reason:"already dropped locally; may linger on PlanetScale"}];async function sh(e,t,a,n){try{t==="mysql"?await h.sql.raw(`DROP INDEX IF EXISTS \`${a}\` ON \`${n}\``).execute(e):await h.sql.raw(`DROP INDEX IF EXISTS "${a}"`).execute(e)}catch(o){const r=o instanceof Error?o.message:String(o);z(` Warning: failed to drop index ${a} on ${n}: ${r}`)}}async function ih(e){const t=await oh(e);for(const{index:a,table:n}of rh)await sh(e,t,a,n);await e.schema.dropTable("members").ifExists().execute()}async function ch(e){await e.schema.createTable("members").addColumn("id","varchar(255)",t=>t.notNull().primaryKey()).addColumn("tenant_id","varchar(255)",t=>t.references("tenants.id").onDelete("cascade").notNull()).addColumn("sub","varchar(255)").addColumn("email","varchar(255)").addColumn("name","varchar(255)").addColumn("status","varchar(255)").addColumn("role","varchar(255)").addColumn("picture","varchar(2083)").addColumn("created_at","varchar(255)",t=>t.notNull()).addColumn("updated_at","varchar(255)",t=>t.notNull()).execute(),await e.schema.createIndex("idx_user_organizations_tenant_id").on("user_organizations").column("tenant_id").execute(),await e.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute(),await e.schema.createIndex("role_permissions_role_fk").on("role_permissions").columns(["tenant_id","role_id"]).execute(),await e.schema.createIndex("idx_organizations_tenant_id").on("organizations").column("tenant_id").execute(),await e.schema.createIndex("idx_invites_tenant_id").on("invites").column("tenant_id").execute(),await e.schema.createIndex("connections_tenant_id_idx").on("connections").column("tenant_id").execute()}const lh=Object.freeze(Object.defineProperty({__proto__:null,down:ch,up:ih},Symbol.toStringTag,{value:"Module"}));async function dh(e){await e.schema.alterTable("clients").addColumn("user_linking_mode","varchar(16)").execute()}async function uh(e){await e.schema.alterTable("clients").dropColumn("user_linking_mode").execute()}const _h=Object.freeze(Object.defineProperty({__proto__:null,down:uh,up:dh},Symbol.toStringTag,{value:"Module"}));async function mh(e){await e.schema.alterTable("hooks").addColumn("metadata","text").execute()}async function hh(e){await e.schema.alterTable("hooks").dropColumn("metadata").execute()}const ph=Object.freeze(Object.defineProperty({__proto__:null,down:hh,up:mh},Symbol.toStringTag,{value:"Module"}));async function fh(e){await e.schema.alterTable("refresh_tokens").addColumn("token_lookup","varchar(16)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("token_hash","varchar(64)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("family_id","varchar(26)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("rotated_to","varchar(26)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("rotated_at_ts","bigint").execute(),await e.schema.createIndex("idx_refresh_tokens_token_lookup").on("refresh_tokens").columns(["tenant_id","token_lookup"]).execute(),await e.schema.createIndex("idx_refresh_tokens_family_id").on("refresh_tokens").columns(["tenant_id","family_id"]).execute()}async function gh(e){await e.schema.dropIndex("idx_refresh_tokens_family_id").on("refresh_tokens").execute(),await e.schema.dropIndex("idx_refresh_tokens_token_lookup").on("refresh_tokens").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("rotated_at_ts").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("rotated_to").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("family_id").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("token_hash").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("token_lookup").execute()}const wh=Object.freeze(Object.defineProperty({__proto__:null,down:gh,up:fh},Symbol.toStringTag,{value:"Module"}));async function yh(e){await e.schema.createTable("organization_connections").addColumn("tenant_id","varchar(191)",t=>t.notNull()).addColumn("organization_id","varchar(21)",t=>t.notNull()).addColumn("connection_id","varchar(191)",t=>t.notNull()).addColumn("assign_membership_on_login","boolean",t=>t.notNull().defaultTo(0)).addColumn("show_as_button","boolean",t=>t.notNull().defaultTo(1)).addColumn("is_signup_enabled","boolean",t=>t.notNull().defaultTo(1)).addColumn("created_at","varchar(35)",t=>t.notNull()).addColumn("updated_at","varchar(35)",t=>t.notNull()).addUniqueConstraint("organization_connections_unique",["tenant_id","organization_id","connection_id"]).addForeignKeyConstraint("organization_connections_organization_fk",["organization_id"],"organizations",["id"],t=>t.onDelete("cascade")).addForeignKeyConstraint("organization_connections_connection_fk",["tenant_id","connection_id"],"connections",["tenant_id","id"],t=>t.onDelete("cascade")).execute(),await e.schema.createIndex("idx_organization_connections_tenant_org").on("organization_connections").columns(["tenant_id","organization_id"]).execute(),await e.schema.createIndex("idx_organization_connections_tenant_connection").on("organization_connections").columns(["tenant_id","connection_id"]).execute()}async function vh(e){await e.schema.dropTable("organization_connections").execute()}const Ch=Object.freeze(Object.defineProperty({__proto__:null,down:vh,up:yh},Symbol.toStringTag,{value:"Module"}));async function xh(e){await e.schema.createTable("log_streams").addColumn("id","varchar(64)",t=>t.primaryKey()).addColumn("tenant_id","varchar(191)",t=>t.notNull()).addColumn("name","varchar(255)",t=>t.notNull()).addColumn("type","varchar(64)",t=>t.notNull()).addColumn("status","varchar(32)",t=>t.notNull()).addColumn("sink","text",t=>t.notNull()).addColumn("filters","text").addColumn("is_priority","boolean").addColumn("created_at","varchar(35)",t=>t.notNull()).addColumn("updated_at","varchar(35)",t=>t.notNull()).execute(),await e.schema.createIndex("idx_log_streams_tenant_id").on("log_streams").columns(["tenant_id"]).execute()}async function Th(e){await e.schema.dropTable("log_streams").execute()}const Nh=Object.freeze(Object.defineProperty({__proto__:null,down:Th,up:xh},Symbol.toStringTag,{value:"Module"}));async function bh(e){await e.schema.alterTable("tenants").addColumn("attack_protection","text").execute()}async function Sh(e){await e.schema.alterTable("tenants").dropColumn("attack_protection").execute()}const kh=Object.freeze(Object.defineProperty({__proto__:null,down:Sh,up:bh},Symbol.toStringTag,{value:"Module"}));async function Oh(e){await e.schema.alterTable("tenants").addColumn("default_client_id","varchar(255)").execute()}async function $h(e){await e.schema.alterTable("tenants").dropColumn("default_client_id").execute()}const Eh=Object.freeze(Object.defineProperty({__proto__:null,down:$h,up:Oh},Symbol.toStringTag,{value:"Module"}));async function Ph(e){await e.schema.createTable("email_templates").addColumn("tenant_id","varchar(255)",t=>t.notNull()).addColumn("template","varchar(64)",t=>t.notNull()).addColumn("body","text",t=>t.notNull()).addColumn("from","varchar(255)",t=>t.notNull()).addColumn("subject","varchar(255)",t=>t.notNull()).addColumn("syntax","varchar(16)",t=>t.notNull().defaultTo("liquid")).addColumn("result_url","varchar(2048)").addColumn("url_lifetime_in_seconds","integer").addColumn("include_email_in_redirect","integer",t=>t.notNull().defaultTo(0).check(h.sql`include_email_in_redirect IN (0, 1)`)).addColumn("enabled","integer",t=>t.notNull().defaultTo(1).check(h.sql`enabled IN (0, 1)`)).addColumn("created_at","varchar(35)",t=>t.notNull()).addColumn("updated_at","varchar(35)",t=>t.notNull()).addPrimaryKeyConstraint("email_templates_pk",["tenant_id","template"]).addForeignKeyConstraint("email_templates_tenant_fk",["tenant_id"],"tenants",["id"],t=>t.onDelete("cascade")).execute()}async function Ih(e){await e.schema.dropTable("email_templates").execute()}const zh=Object.freeze(Object.defineProperty({__proto__:null,down:Ih,up:Ph},Symbol.toStringTag,{value:"Module"}));async function Dh(e){await e.schema.createTable("action_versions").addColumn("id","varchar(255)",t=>t.primaryKey()).addColumn("tenant_id","varchar(191)",t=>t.notNull()).addColumn("action_id","varchar(255)",t=>t.notNull()).addColumn("number","integer",t=>t.notNull()).addColumn("code","text",t=>t.notNull()).addColumn("runtime","varchar(50)").addColumn("secrets","text").addColumn("dependencies","text").addColumn("supported_triggers","text").addColumn("deployed","integer",t=>t.notNull().defaultTo(0)).addColumn("created_at_ts","bigint",t=>t.notNull()).addColumn("updated_at_ts","bigint",t=>t.notNull()).execute(),await e.schema.createIndex("idx_action_versions_action").on("action_versions").columns(["tenant_id","action_id"]).execute(),await e.schema.createIndex("uniq_action_versions_action_number").on("action_versions").columns(["tenant_id","action_id","number"]).unique().execute()}async function Ah(e){await e.schema.dropTable("action_versions").execute()}const Fh=Object.freeze(Object.defineProperty({__proto__:null,down:Ah,up:Dh},Symbol.toStringTag,{value:"Module"})),Me={m1_init:xr,m2_magicLink:br,m3_updateAt:Or,m4_logTable:Pr,m5_userProfile:Dr,m6_sessions:jr,m7_passwords:Jr,m8_logsTableNewFields:Kr,m9_passwordTableNewField:Qr,n01_codesTable:Hr,n11_universalLoginSession:Xr,n12_userFields:ts,n13_userEmailIndex:os,n14_profileDataField:is,n15_userEmailIndex:ds,n16_userLocale:ms,n17_signingKeys:fs,n18_logsFields:ys,n19_connectionsUserinfo:xs,n20_missingFields:bs,n21_sessionDeletedAt:Os,n22_dropLogsFields:Ps,n23_dropUsersFields:Ds,n24_logsIndexes:js,n25_logDescMaxLength:Js,n26_logsTableExtraFields:Ks,n27_usersTableNameIndex:Qs,n28_usersEmailConstrain:Hs,n29_increaseOtpStateLength:Xs,n30_increaseTicketStateLength:ti,n31_branding:oi,n32_indexesAndNotNull:ii,n33_vendorIdInUniversalLoginSession:di,n34_auth0ClientInUniversalLoginSession:mi,n35_increaseUniversalSessionStateLength:fi,n36_authenticationCodes:yi,n37_disableSignUps:xi,n38_otpIpAddress:bi,n39_increaseUserAgentLength:Oi,n40_userId:Pi,n41_hooks:Di,n42_userIdIndexes:ji,n43_userIdIndexes:Ji,n44_codes:Ki,n45_hookProperties:Qi,n46_loginAuth0Client:Hi,n47_loginAuth0Client:Xi,n48_saml:tc,n49_removeFields:oc,n50_authParamsNonce:ic,n51_connectionid:dc,n52_cert:mc,n53_codes_primary_key:fc,n54_cleanup_tables:yc,n55_logs_index:xc,n56_application_fields:bc,n57_prompt_settings:Oc,n58_connection_client_id:Pc,n59_connection_options:Dc,n60_users_metadata:jc,n61_userLocales:Jc,n62_prompt:Kc,n63_connection_cleanup:Qc,n64_act_as:Hc,n65_code_verifier:Xc,n66_email_providers:tl,n67_drop_tickets:ol,n68_login_useragents:il,n70_refresh_tokens:dl,n71_session_new_fields:ml,n72_session_primary_key:fl,n73_drop_sessions:yl,n74_custom_domains:xl,n75_organizations:bl,n76_authorization_url_length:Ol,n77_drop_sessions:Pl,n78_login_sessions:Dl,n79_drop_sessions_2:jl,n80_recreate_custom_domains:Jl,n81_phone:Kl,n82_forms:Ql,n83_addFormsIdToHooks:Hl,n84_login_completed:Xl,n85_add_login_session_id_to_sessions:td,n86_index_sessions_login_session_id:od,n87_code_challenge:id,n88_add_redirect_uri_to_codes:dd,n89_add_nonce_and_state_to_codes:md,n90_themes:fd,n91_resource_servers_rules_permissions:yd,n92_role_permissions:xd,n93_add_permissions_to_roles:bd,n94_keys_connection_and_extend_columns:Od,n95_create_organizations_table:Pd,n96_create_user_organizations_table:Dd,n97_add_organization_to_user_permissions_and_roles:jd,n98_clients:Jd,n99_update_client_foreign_keys:Wd,o001_client_grants:Gd,o002_drop_applications:Zd,o003_phone_number_index:au,o004_login_sessions_id_index:ru,o005_connections_tenant_index:cu,o006_remove_redundant_user_organizations_tenant_index:uu,o007_tenant_settings:hu,o008_merge_tenant_settings_into_tenants:gu,o009_create_invites_table:vu,o010_add_log_id_to_logs:Tu,o011_add_location_info_to_logs:Su,o012_add_password_history:$u,o013_connection_display_name:Iu,o014_client_connections:Au,o015_flows:Ru,o016_add_is_system_column:qu,o017_connections_composite_key:Bu,o018_login_session_state:Wu,o019_roles_resource_servers_metadata:Gu,o020_session_add_timestamp_columns:e_,o021_session_cleanup_and_ulid:n_,o022_oidc_profile_claims:s_,o023_preferred_username:l_,o024_user_address:__,o025_authparams_max_age:p_,o026_auth0_conformant:w_,o027_universal_login_templates:C_,o028_custom_text:N_,o029_guardian_mfa:k_,o030_add_template_id_to_hooks:P_,o031_hooks_cleanup:D_,o032_unique_username_provider:j_,o033_add_login_id_to_refresh_tokens:J_,o034_refresh_tokens_replace_session_id_with_login_id:K_,o035_idle_expires_at_ts_indexes:Q_,o036_add_connection_to_login_sessions:H_,o037_mfa_enrollments:X_,o038_add_otp_to_codes:tm,o039_rename_mfa_enrollments_to_authentication_methods:om,o040_create_outbox_events:im,o041_add_outbox_claim_columns:dm,o042_add_outbox_claim_index:mm,o043_add_code_hooks:fm,o044_create_actions:ym,o045_outbox_dead_letter:xm,o046_user_registration_completed_at:bm,o047_outbox_dead_lettered_tenant_index:Om,o048_add_auth_strategy_to_login_sessions:Pm,o049_login_sessions_auth_params:Dm,o050_login_sessions_auth_params_backfill:Rm,o051_relax_login_sessions_authparams:Bm,o052_drop_login_sessions_hoisted_authparams:Vm,o053_refresh_tokens_revoked_at:eh,o054_client_registration_tokens:nh,o055_planetscale_redundant_indexes_cleanup:lh,o056_client_user_linking_mode:_h,o057_hooks_metadata:ph,o058_refresh_tokens_rotation:wh,o059_organization_connections:Ch,o060_log_streams:Nh,o061_tenants_attack_protection:kh,o062_tenants_default_client_id:Eh,o063_email_templates:zh,o064_create_action_versions:Fh};async function jh(e,t=!1){ze(t),t&&console.log("migrating...");const a=new Pe(Me),n=new h.Migrator({db:e,provider:a}),{error:o,results:r}=await n.migrateToLatest();if(r==null||r.forEach(s=>{s.status==="Success"?t&&console.log(`migration "${s.migrationName}" was executed successfully`):s.status==="Error"&&console.error(`failed to execute migration "${s.migrationName}"`)}),o)throw console.error("failed to migrate"),console.error(o),o}async function Rh(e,t=!1){ze(t),t&&console.log("migrating...");const a=new Pe(Me),n=new h.Migrator({db:e,provider:a}),{error:o,results:r}=await n.migrateDown();if(r==null||r.forEach(s=>{s.status==="Success"?t&&console.log(`migration "${s.migrationName}" was reverted successfully`):s.status==="Error"&&console.error(`failed to execute migration "${s.migrationName}"`)}),o)throw console.error("failed to migrate"),console.error(o),o}function Je(e,t={useTransactions:!0}){const a={actions:lt(e),actionVersions:dt(e),branding:Za(e),clients:fa(e),clientConnections:xa(e),clientGrants:Oa(e),clientRegistrationTokens:Ma(e),codes:aa(e),connections:la(e),emailProviders:Fn(e),emailTemplates:Ln(e),customDomains:Ga(e),flows:St(e),forms:ro(e),hookCode:pn(e),hooks:dn(e),invites:Xo(e),keys:Ka(e),loginSessions:On(e),logs:Rt(e),logStreams:yr(e),authenticationMethods:ir(e),passwords:Ht(e),promptSettings:Pn(e),refreshTokens:Vn(e),resourceServers:_o(e),rolePermissions:xo(e),userPermissions:ko(e),userRoles:Io(e),roles:wo(e),sessions:Bt(e),sessionCleanup:Zn(e),tenants:zt(e),themes:vn(e),universalLoginTemplates:nn(e),customText:tr(e),users:vt(e),organizations:Ro(e),organizationConnections:Mo(e),userOrganizations:Qo(e),stats:er(e),outbox:wr(e),async transaction(n){return t.useTransactions===!1?n(a):e.transaction().execute(async o=>{const r=Je(o,{...t,useTransactions:!1});return n(r)})}};return a}exports.default=Je;exports.migrateDown=Rh;exports.migrateToLatest=jh;
|
|
166
|
+
FROM login_sessions`.execute(t),await h.sql`DROP TABLE login_sessions`.execute(t),await h.sql`ALTER TABLE login_sessions_new RENAME TO login_sessions`.execute(t),await t.schema.createIndex("login_sessions_id_index").on("login_sessions").column("id").execute(),await t.schema.createIndex("idx_login_sessions_session_id").on("login_sessions").column("session_id").execute(),await t.schema.createIndex("login_sessions_tenant_user_idx").on("login_sessions").columns(["tenant_id","user_id"]).execute(),await t.schema.createIndex("login_sessions_state_idx").on("login_sessions").column("state").execute(),await t.schema.createIndex("idx_login_sessions_expires_at_ts").on("login_sessions").column("expires_at_ts").execute()}),w(" Recreated login_sessions without hoisted authParams_* columns")}async function Gm(e){}const Vm=Object.freeze(Object.defineProperty({__proto__:null,down:Gm,up:Wm},Symbol.toStringTag,{value:"Module"}));async function Xm(e){await e.schema.alterTable("refresh_tokens").addColumn("revoked_at_ts","bigint").execute()}async function Zm(e){await e.schema.alterTable("refresh_tokens").dropColumn("revoked_at_ts").execute()}const eh=Object.freeze(Object.defineProperty({__proto__:null,down:Zm,up:Xm},Symbol.toStringTag,{value:"Module"}));async function th(e){await e.schema.alterTable("clients").addColumn("owner_user_id","varchar(255)").execute(),await e.schema.alterTable("clients").addColumn("registration_type","varchar(32)").execute(),await e.schema.alterTable("clients").addColumn("registration_metadata","text").execute(),await e.schema.createIndex("idx_clients_owner_user_id").on("clients").columns(["tenant_id","owner_user_id"]).execute(),await e.schema.createTable("client_registration_tokens").addColumn("id","varchar(255)",t=>t.primaryKey()).addColumn("tenant_id","varchar(191)",t=>t.references("tenants.id").onDelete("cascade").notNull()).addColumn("token_hash","varchar(64)",t=>t.notNull()).addColumn("type","varchar(8)",t=>t.notNull()).addColumn("client_id","varchar(191)").addColumn("sub","varchar(255)").addColumn("constraints","text").addColumn("single_use","integer",t=>t.defaultTo(0).notNull()).addColumn("used_at_ts","bigint").addColumn("expires_at_ts","bigint").addColumn("created_at_ts","bigint",t=>t.notNull()).addColumn("revoked_at_ts","bigint").execute(),await e.schema.createIndex("idx_client_registration_tokens_hash").on("client_registration_tokens").columns(["tenant_id","token_hash"]).unique().execute(),await e.schema.createIndex("idx_client_registration_tokens_client").on("client_registration_tokens").columns(["tenant_id","client_id"]).execute()}async function ah(e){await e.schema.dropTable("client_registration_tokens").execute(),await e.schema.dropIndex("idx_clients_owner_user_id").execute(),await e.schema.alterTable("clients").dropColumn("registration_metadata").execute(),await e.schema.alterTable("clients").dropColumn("registration_type").execute(),await e.schema.alterTable("clients").dropColumn("owner_user_id").execute()}const nh=Object.freeze(Object.defineProperty({__proto__:null,down:ah,up:th},Symbol.toStringTag,{value:"Module"}));async function oh(e){try{return await h.sql`SELECT @@version_comment`.execute(e),"mysql"}catch{return"sqlite"}}const rh=[{index:"connections_tenant_id_idx",table:"connections",reason:"composite PK (tenant_id, id)"},{index:"idx_invites_tenant_id",table:"invites",reason:"idx_invites_tenant_created (tenant_id, created_at)"},{index:"idx_organizations_tenant_id",table:"organizations",reason:"idx_organizations_tenant_name_unique (tenant_id, name)"},{index:"role_permissions_role_fk",table:"role_permissions",reason:"role_permissions_pk (tenant_id, role_id, ...)"},{index:"themes_tenant_id_idx",table:"themes",reason:"themes_pkey (tenant_id, themeId)"},{index:"users_tenant_index",table:"users",reason:"stale on PlanetScale only; commented out locally in 2024"},{index:"idx_user_organizations_tenant_id",table:"user_organizations",reason:"already dropped locally; may linger on PlanetScale"}];async function sh(e,t,a,n){try{t==="mysql"?await h.sql.raw(`DROP INDEX IF EXISTS \`${a}\` ON \`${n}\``).execute(e):await h.sql.raw(`DROP INDEX IF EXISTS "${a}"`).execute(e)}catch(o){const r=o instanceof Error?o.message:String(o);z(` Warning: failed to drop index ${a} on ${n}: ${r}`)}}async function ih(e){const t=await oh(e);for(const{index:a,table:n}of rh)await sh(e,t,a,n);await e.schema.dropTable("members").ifExists().execute()}async function ch(e){await e.schema.createTable("members").addColumn("id","varchar(255)",t=>t.notNull().primaryKey()).addColumn("tenant_id","varchar(255)",t=>t.references("tenants.id").onDelete("cascade").notNull()).addColumn("sub","varchar(255)").addColumn("email","varchar(255)").addColumn("name","varchar(255)").addColumn("status","varchar(255)").addColumn("role","varchar(255)").addColumn("picture","varchar(2083)").addColumn("created_at","varchar(255)",t=>t.notNull()).addColumn("updated_at","varchar(255)",t=>t.notNull()).execute(),await e.schema.createIndex("idx_user_organizations_tenant_id").on("user_organizations").column("tenant_id").execute(),await e.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute(),await e.schema.createIndex("role_permissions_role_fk").on("role_permissions").columns(["tenant_id","role_id"]).execute(),await e.schema.createIndex("idx_organizations_tenant_id").on("organizations").column("tenant_id").execute(),await e.schema.createIndex("idx_invites_tenant_id").on("invites").column("tenant_id").execute(),await e.schema.createIndex("connections_tenant_id_idx").on("connections").column("tenant_id").execute()}const lh=Object.freeze(Object.defineProperty({__proto__:null,down:ch,up:ih},Symbol.toStringTag,{value:"Module"}));async function dh(e){await e.schema.alterTable("clients").addColumn("user_linking_mode","varchar(16)").execute()}async function uh(e){await e.schema.alterTable("clients").dropColumn("user_linking_mode").execute()}const _h=Object.freeze(Object.defineProperty({__proto__:null,down:uh,up:dh},Symbol.toStringTag,{value:"Module"}));async function mh(e){await e.schema.alterTable("hooks").addColumn("metadata","text").execute()}async function hh(e){await e.schema.alterTable("hooks").dropColumn("metadata").execute()}const ph=Object.freeze(Object.defineProperty({__proto__:null,down:hh,up:mh},Symbol.toStringTag,{value:"Module"}));async function fh(e){await e.schema.alterTable("refresh_tokens").addColumn("token_lookup","varchar(16)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("token_hash","varchar(64)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("family_id","varchar(26)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("rotated_to","varchar(26)").execute(),await e.schema.alterTable("refresh_tokens").addColumn("rotated_at_ts","bigint").execute(),await e.schema.createIndex("idx_refresh_tokens_token_lookup").on("refresh_tokens").columns(["tenant_id","token_lookup"]).execute(),await e.schema.createIndex("idx_refresh_tokens_family_id").on("refresh_tokens").columns(["tenant_id","family_id"]).execute()}async function gh(e){await e.schema.dropIndex("idx_refresh_tokens_family_id").on("refresh_tokens").execute(),await e.schema.dropIndex("idx_refresh_tokens_token_lookup").on("refresh_tokens").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("rotated_at_ts").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("rotated_to").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("family_id").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("token_hash").execute(),await e.schema.alterTable("refresh_tokens").dropColumn("token_lookup").execute()}const wh=Object.freeze(Object.defineProperty({__proto__:null,down:gh,up:fh},Symbol.toStringTag,{value:"Module"}));async function yh(e){await e.schema.createTable("organization_connections").addColumn("tenant_id","varchar(191)",t=>t.notNull()).addColumn("organization_id","varchar(21)",t=>t.notNull()).addColumn("connection_id","varchar(191)",t=>t.notNull()).addColumn("assign_membership_on_login","boolean",t=>t.notNull().defaultTo(0)).addColumn("show_as_button","boolean",t=>t.notNull().defaultTo(1)).addColumn("is_signup_enabled","boolean",t=>t.notNull().defaultTo(1)).addColumn("created_at","varchar(35)",t=>t.notNull()).addColumn("updated_at","varchar(35)",t=>t.notNull()).addUniqueConstraint("organization_connections_unique",["tenant_id","organization_id","connection_id"]).addForeignKeyConstraint("organization_connections_organization_fk",["organization_id"],"organizations",["id"],t=>t.onDelete("cascade")).addForeignKeyConstraint("organization_connections_connection_fk",["tenant_id","connection_id"],"connections",["tenant_id","id"],t=>t.onDelete("cascade")).execute(),await e.schema.createIndex("idx_organization_connections_tenant_org").on("organization_connections").columns(["tenant_id","organization_id"]).execute(),await e.schema.createIndex("idx_organization_connections_tenant_connection").on("organization_connections").columns(["tenant_id","connection_id"]).execute()}async function vh(e){await e.schema.dropTable("organization_connections").execute()}const Ch=Object.freeze(Object.defineProperty({__proto__:null,down:vh,up:yh},Symbol.toStringTag,{value:"Module"}));async function xh(e){await e.schema.createTable("log_streams").addColumn("id","varchar(64)",t=>t.primaryKey()).addColumn("tenant_id","varchar(191)",t=>t.notNull()).addColumn("name","varchar(255)",t=>t.notNull()).addColumn("type","varchar(64)",t=>t.notNull()).addColumn("status","varchar(32)",t=>t.notNull()).addColumn("sink","text",t=>t.notNull()).addColumn("filters","text").addColumn("is_priority","boolean").addColumn("created_at","varchar(35)",t=>t.notNull()).addColumn("updated_at","varchar(35)",t=>t.notNull()).execute(),await e.schema.createIndex("idx_log_streams_tenant_id").on("log_streams").columns(["tenant_id"]).execute()}async function Th(e){await e.schema.dropTable("log_streams").execute()}const Nh=Object.freeze(Object.defineProperty({__proto__:null,down:Th,up:xh},Symbol.toStringTag,{value:"Module"}));async function bh(e){await e.schema.alterTable("tenants").addColumn("attack_protection","text").execute()}async function Sh(e){await e.schema.alterTable("tenants").dropColumn("attack_protection").execute()}const kh=Object.freeze(Object.defineProperty({__proto__:null,down:Sh,up:bh},Symbol.toStringTag,{value:"Module"}));async function Oh(e){await e.schema.alterTable("tenants").addColumn("default_client_id","varchar(255)").execute()}async function $h(e){await e.schema.alterTable("tenants").dropColumn("default_client_id").execute()}const Eh=Object.freeze(Object.defineProperty({__proto__:null,down:$h,up:Oh},Symbol.toStringTag,{value:"Module"}));async function Ph(e){await e.schema.createTable("email_templates").addColumn("tenant_id","varchar(255)",t=>t.notNull()).addColumn("template","varchar(64)",t=>t.notNull()).addColumn("body","text",t=>t.notNull()).addColumn("from","varchar(255)",t=>t.notNull()).addColumn("subject","varchar(255)",t=>t.notNull()).addColumn("syntax","varchar(16)",t=>t.notNull().defaultTo("liquid")).addColumn("result_url","varchar(2048)").addColumn("url_lifetime_in_seconds","integer").addColumn("include_email_in_redirect","integer",t=>t.notNull().defaultTo(0).check(h.sql`include_email_in_redirect IN (0, 1)`)).addColumn("enabled","integer",t=>t.notNull().defaultTo(1).check(h.sql`enabled IN (0, 1)`)).addColumn("created_at","varchar(35)",t=>t.notNull()).addColumn("updated_at","varchar(35)",t=>t.notNull()).addPrimaryKeyConstraint("email_templates_pk",["tenant_id","template"]).addForeignKeyConstraint("email_templates_tenant_fk",["tenant_id"],"tenants",["id"],t=>t.onDelete("cascade")).execute()}async function Ih(e){await e.schema.dropTable("email_templates").execute()}const zh=Object.freeze(Object.defineProperty({__proto__:null,down:Ih,up:Ph},Symbol.toStringTag,{value:"Module"}));async function Dh(e){await e.schema.createTable("action_versions").addColumn("id","varchar(255)",t=>t.primaryKey()).addColumn("tenant_id","varchar(191)",t=>t.notNull()).addColumn("action_id","varchar(255)",t=>t.notNull()).addColumn("number","integer",t=>t.notNull()).addColumn("code","text",t=>t.notNull()).addColumn("runtime","varchar(50)").addColumn("secrets","text").addColumn("dependencies","text").addColumn("supported_triggers","text").addColumn("deployed","integer",t=>t.notNull().defaultTo(0)).addColumn("created_at_ts","bigint",t=>t.notNull()).addColumn("updated_at_ts","bigint",t=>t.notNull()).execute(),await e.schema.createIndex("idx_action_versions_action").on("action_versions").columns(["tenant_id","action_id"]).execute(),await e.schema.createIndex("uniq_action_versions_action_number").on("action_versions").columns(["tenant_id","action_id","number"]).unique().execute()}async function Ah(e){await e.schema.dropTable("action_versions").execute()}const Fh=Object.freeze(Object.defineProperty({__proto__:null,down:Ah,up:Dh},Symbol.toStringTag,{value:"Module"}));async function jh(e){await e.schema.alterTable("branding").addColumn("dark_mode","varchar(8)").execute()}async function Rh(e){await e.schema.alterTable("branding").dropColumn("dark_mode").execute()}const Mh=Object.freeze(Object.defineProperty({__proto__:null,down:Rh,up:jh},Symbol.toStringTag,{value:"Module"})),Me={m1_init:xr,m2_magicLink:br,m3_updateAt:Or,m4_logTable:Pr,m5_userProfile:Dr,m6_sessions:jr,m7_passwords:Jr,m8_logsTableNewFields:Kr,m9_passwordTableNewField:Qr,n01_codesTable:Hr,n11_universalLoginSession:Xr,n12_userFields:ts,n13_userEmailIndex:os,n14_profileDataField:is,n15_userEmailIndex:ds,n16_userLocale:ms,n17_signingKeys:fs,n18_logsFields:ys,n19_connectionsUserinfo:xs,n20_missingFields:bs,n21_sessionDeletedAt:Os,n22_dropLogsFields:Ps,n23_dropUsersFields:Ds,n24_logsIndexes:js,n25_logDescMaxLength:Js,n26_logsTableExtraFields:Ks,n27_usersTableNameIndex:Qs,n28_usersEmailConstrain:Hs,n29_increaseOtpStateLength:Xs,n30_increaseTicketStateLength:ti,n31_branding:oi,n32_indexesAndNotNull:ii,n33_vendorIdInUniversalLoginSession:di,n34_auth0ClientInUniversalLoginSession:mi,n35_increaseUniversalSessionStateLength:fi,n36_authenticationCodes:yi,n37_disableSignUps:xi,n38_otpIpAddress:bi,n39_increaseUserAgentLength:Oi,n40_userId:Pi,n41_hooks:Di,n42_userIdIndexes:ji,n43_userIdIndexes:Ji,n44_codes:Ki,n45_hookProperties:Qi,n46_loginAuth0Client:Hi,n47_loginAuth0Client:Xi,n48_saml:tc,n49_removeFields:oc,n50_authParamsNonce:ic,n51_connectionid:dc,n52_cert:mc,n53_codes_primary_key:fc,n54_cleanup_tables:yc,n55_logs_index:xc,n56_application_fields:bc,n57_prompt_settings:Oc,n58_connection_client_id:Pc,n59_connection_options:Dc,n60_users_metadata:jc,n61_userLocales:Jc,n62_prompt:Kc,n63_connection_cleanup:Qc,n64_act_as:Hc,n65_code_verifier:Xc,n66_email_providers:tl,n67_drop_tickets:ol,n68_login_useragents:il,n70_refresh_tokens:dl,n71_session_new_fields:ml,n72_session_primary_key:fl,n73_drop_sessions:yl,n74_custom_domains:xl,n75_organizations:bl,n76_authorization_url_length:Ol,n77_drop_sessions:Pl,n78_login_sessions:Dl,n79_drop_sessions_2:jl,n80_recreate_custom_domains:Jl,n81_phone:Kl,n82_forms:Ql,n83_addFormsIdToHooks:Hl,n84_login_completed:Xl,n85_add_login_session_id_to_sessions:td,n86_index_sessions_login_session_id:od,n87_code_challenge:id,n88_add_redirect_uri_to_codes:dd,n89_add_nonce_and_state_to_codes:md,n90_themes:fd,n91_resource_servers_rules_permissions:yd,n92_role_permissions:xd,n93_add_permissions_to_roles:bd,n94_keys_connection_and_extend_columns:Od,n95_create_organizations_table:Pd,n96_create_user_organizations_table:Dd,n97_add_organization_to_user_permissions_and_roles:jd,n98_clients:Jd,n99_update_client_foreign_keys:Wd,o001_client_grants:Gd,o002_drop_applications:Zd,o003_phone_number_index:au,o004_login_sessions_id_index:ru,o005_connections_tenant_index:cu,o006_remove_redundant_user_organizations_tenant_index:uu,o007_tenant_settings:hu,o008_merge_tenant_settings_into_tenants:gu,o009_create_invites_table:vu,o010_add_log_id_to_logs:Tu,o011_add_location_info_to_logs:Su,o012_add_password_history:$u,o013_connection_display_name:Iu,o014_client_connections:Au,o015_flows:Ru,o016_add_is_system_column:qu,o017_connections_composite_key:Bu,o018_login_session_state:Wu,o019_roles_resource_servers_metadata:Gu,o020_session_add_timestamp_columns:e_,o021_session_cleanup_and_ulid:n_,o022_oidc_profile_claims:s_,o023_preferred_username:l_,o024_user_address:__,o025_authparams_max_age:p_,o026_auth0_conformant:w_,o027_universal_login_templates:C_,o028_custom_text:N_,o029_guardian_mfa:k_,o030_add_template_id_to_hooks:P_,o031_hooks_cleanup:D_,o032_unique_username_provider:j_,o033_add_login_id_to_refresh_tokens:J_,o034_refresh_tokens_replace_session_id_with_login_id:K_,o035_idle_expires_at_ts_indexes:Q_,o036_add_connection_to_login_sessions:H_,o037_mfa_enrollments:X_,o038_add_otp_to_codes:tm,o039_rename_mfa_enrollments_to_authentication_methods:om,o040_create_outbox_events:im,o041_add_outbox_claim_columns:dm,o042_add_outbox_claim_index:mm,o043_add_code_hooks:fm,o044_create_actions:ym,o045_outbox_dead_letter:xm,o046_user_registration_completed_at:bm,o047_outbox_dead_lettered_tenant_index:Om,o048_add_auth_strategy_to_login_sessions:Pm,o049_login_sessions_auth_params:Dm,o050_login_sessions_auth_params_backfill:Rm,o051_relax_login_sessions_authparams:Bm,o052_drop_login_sessions_hoisted_authparams:Vm,o053_refresh_tokens_revoked_at:eh,o054_client_registration_tokens:nh,o055_planetscale_redundant_indexes_cleanup:lh,o056_client_user_linking_mode:_h,o057_hooks_metadata:ph,o058_refresh_tokens_rotation:wh,o059_organization_connections:Ch,o060_log_streams:Nh,o061_tenants_attack_protection:kh,o062_tenants_default_client_id:Eh,o063_email_templates:zh,o064_create_action_versions:Fh,o065_branding_dark_mode:Mh};async function Jh(e,t=!1){ze(t),t&&console.log("migrating...");const a=new Pe(Me),n=new h.Migrator({db:e,provider:a}),{error:o,results:r}=await n.migrateToLatest();if(r==null||r.forEach(s=>{s.status==="Success"?t&&console.log(`migration "${s.migrationName}" was executed successfully`):s.status==="Error"&&console.error(`failed to execute migration "${s.migrationName}"`)}),o)throw console.error("failed to migrate"),console.error(o),o}async function qh(e,t=!1){ze(t),t&&console.log("migrating...");const a=new Pe(Me),n=new h.Migrator({db:e,provider:a}),{error:o,results:r}=await n.migrateDown();if(r==null||r.forEach(s=>{s.status==="Success"?t&&console.log(`migration "${s.migrationName}" was reverted successfully`):s.status==="Error"&&console.error(`failed to execute migration "${s.migrationName}"`)}),o)throw console.error("failed to migrate"),console.error(o),o}function Je(e,t={useTransactions:!0}){const a={actions:lt(e),actionVersions:dt(e),branding:Za(e),clients:fa(e),clientConnections:xa(e),clientGrants:Oa(e),clientRegistrationTokens:Ma(e),codes:aa(e),connections:la(e),emailProviders:Fn(e),emailTemplates:Ln(e),customDomains:Ga(e),flows:St(e),forms:ro(e),hookCode:pn(e),hooks:dn(e),invites:Xo(e),keys:Ka(e),loginSessions:On(e),logs:Rt(e),logStreams:yr(e),authenticationMethods:ir(e),passwords:Ht(e),promptSettings:Pn(e),refreshTokens:Vn(e),resourceServers:_o(e),rolePermissions:xo(e),userPermissions:ko(e),userRoles:Io(e),roles:wo(e),sessions:Bt(e),sessionCleanup:Zn(e),tenants:zt(e),themes:vn(e),universalLoginTemplates:nn(e),customText:tr(e),users:vt(e),organizations:Ro(e),organizationConnections:Mo(e),userOrganizations:Qo(e),stats:er(e),outbox:wr(e),async transaction(n){return t.useTransactions===!1?n(a):e.transaction().execute(async o=>{const r=Je(o,{...t,useTransactions:!1});return n(r)})}};return a}exports.default=Je;exports.migrateDown=qh;exports.migrateToLatest=Jh;
|
package/dist/kysely-adapter.d.ts
CHANGED
|
@@ -2623,7 +2623,10 @@ declare enum AuthorizationResponseType {
|
|
|
2623
2623
|
TOKEN = "token",
|
|
2624
2624
|
ID_TOKEN = "id_token",
|
|
2625
2625
|
TOKEN_ID_TOKEN = "id_token token",
|
|
2626
|
-
CODE = "code"
|
|
2626
|
+
CODE = "code",
|
|
2627
|
+
CODE_ID_TOKEN = "code id_token",
|
|
2628
|
+
CODE_TOKEN = "code token",
|
|
2629
|
+
CODE_ID_TOKEN_TOKEN = "code id_token token"
|
|
2627
2630
|
}
|
|
2628
2631
|
declare enum AuthorizationResponseMode {
|
|
2629
2632
|
QUERY = "query",
|
|
@@ -2685,6 +2688,11 @@ declare const brandingSchema: z.ZodObject<{
|
|
|
2685
2688
|
}, {
|
|
2686
2689
|
url: string;
|
|
2687
2690
|
}>>;
|
|
2691
|
+
dark_mode: z.ZodOptional<z.ZodEnum<[
|
|
2692
|
+
"dark",
|
|
2693
|
+
"light",
|
|
2694
|
+
"auto"
|
|
2695
|
+
]>>;
|
|
2688
2696
|
}, "strip", z.ZodTypeAny, {
|
|
2689
2697
|
colors?: {
|
|
2690
2698
|
primary: string;
|
|
@@ -2701,6 +2709,7 @@ declare const brandingSchema: z.ZodObject<{
|
|
|
2701
2709
|
font?: {
|
|
2702
2710
|
url: string;
|
|
2703
2711
|
} | undefined;
|
|
2712
|
+
dark_mode?: "dark" | "light" | "auto" | undefined;
|
|
2704
2713
|
}, {
|
|
2705
2714
|
colors?: {
|
|
2706
2715
|
primary: string;
|
|
@@ -2717,6 +2726,7 @@ declare const brandingSchema: z.ZodObject<{
|
|
|
2717
2726
|
font?: {
|
|
2718
2727
|
url: string;
|
|
2719
2728
|
} | undefined;
|
|
2729
|
+
dark_mode?: "dark" | "light" | "auto" | undefined;
|
|
2720
2730
|
}>;
|
|
2721
2731
|
export type Branding = z.infer<typeof brandingSchema>;
|
|
2722
2732
|
declare const codeTypeSchema: z.ZodEnum<[
|
|
@@ -18170,7 +18180,7 @@ declare const themeInsertSchema: z.ZodObject<{
|
|
|
18170
18180
|
base_focus_color: string;
|
|
18171
18181
|
base_hover_color: string;
|
|
18172
18182
|
body_text: string;
|
|
18173
|
-
captcha_widget_theme: "
|
|
18183
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18174
18184
|
header: string;
|
|
18175
18185
|
icons: string;
|
|
18176
18186
|
input_background: string;
|
|
@@ -18190,7 +18200,7 @@ declare const themeInsertSchema: z.ZodObject<{
|
|
|
18190
18200
|
base_focus_color: string;
|
|
18191
18201
|
base_hover_color: string;
|
|
18192
18202
|
body_text: string;
|
|
18193
|
-
captcha_widget_theme: "
|
|
18203
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18194
18204
|
header: string;
|
|
18195
18205
|
icons: string;
|
|
18196
18206
|
input_background: string;
|
|
@@ -18406,7 +18416,7 @@ declare const themeInsertSchema: z.ZodObject<{
|
|
|
18406
18416
|
base_focus_color: string;
|
|
18407
18417
|
base_hover_color: string;
|
|
18408
18418
|
body_text: string;
|
|
18409
|
-
captcha_widget_theme: "
|
|
18419
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18410
18420
|
header: string;
|
|
18411
18421
|
icons: string;
|
|
18412
18422
|
input_background: string;
|
|
@@ -18482,7 +18492,7 @@ declare const themeInsertSchema: z.ZodObject<{
|
|
|
18482
18492
|
base_focus_color: string;
|
|
18483
18493
|
base_hover_color: string;
|
|
18484
18494
|
body_text: string;
|
|
18485
|
-
captcha_widget_theme: "
|
|
18495
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18486
18496
|
header: string;
|
|
18487
18497
|
icons: string;
|
|
18488
18498
|
input_background: string;
|
|
@@ -18617,7 +18627,7 @@ declare const themeSchema: z.ZodObject<{
|
|
|
18617
18627
|
base_focus_color: string;
|
|
18618
18628
|
base_hover_color: string;
|
|
18619
18629
|
body_text: string;
|
|
18620
|
-
captcha_widget_theme: "
|
|
18630
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18621
18631
|
header: string;
|
|
18622
18632
|
icons: string;
|
|
18623
18633
|
input_background: string;
|
|
@@ -18637,7 +18647,7 @@ declare const themeSchema: z.ZodObject<{
|
|
|
18637
18647
|
base_focus_color: string;
|
|
18638
18648
|
base_hover_color: string;
|
|
18639
18649
|
body_text: string;
|
|
18640
|
-
captcha_widget_theme: "
|
|
18650
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18641
18651
|
header: string;
|
|
18642
18652
|
icons: string;
|
|
18643
18653
|
input_background: string;
|
|
@@ -18855,7 +18865,7 @@ declare const themeSchema: z.ZodObject<{
|
|
|
18855
18865
|
base_focus_color: string;
|
|
18856
18866
|
base_hover_color: string;
|
|
18857
18867
|
body_text: string;
|
|
18858
|
-
captcha_widget_theme: "
|
|
18868
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18859
18869
|
header: string;
|
|
18860
18870
|
icons: string;
|
|
18861
18871
|
input_background: string;
|
|
@@ -18932,7 +18942,7 @@ declare const themeSchema: z.ZodObject<{
|
|
|
18932
18942
|
base_focus_color: string;
|
|
18933
18943
|
base_hover_color: string;
|
|
18934
18944
|
body_text: string;
|
|
18935
|
-
captcha_widget_theme: "
|
|
18945
|
+
captcha_widget_theme: "dark" | "light" | "auto";
|
|
18936
18946
|
header: string;
|
|
18937
18947
|
icons: string;
|
|
18938
18948
|
input_background: string;
|
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -7875,6 +7875,17 @@ const Wh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7875
7875
|
__proto__: null,
|
|
7876
7876
|
down: Qh,
|
|
7877
7877
|
up: Uh
|
|
7878
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
7879
|
+
async function Yh(e) {
|
|
7880
|
+
await e.schema.alterTable("branding").addColumn("dark_mode", "varchar(8)").execute();
|
|
7881
|
+
}
|
|
7882
|
+
async function Hh(e) {
|
|
7883
|
+
await e.schema.alterTable("branding").dropColumn("dark_mode").execute();
|
|
7884
|
+
}
|
|
7885
|
+
const Gh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7886
|
+
__proto__: null,
|
|
7887
|
+
down: Hh,
|
|
7888
|
+
up: Yh
|
|
7878
7889
|
}, Symbol.toStringTag, { value: "Module" })), qe = {
|
|
7879
7890
|
m1_init: zr,
|
|
7880
7891
|
m2_magicLink: Fr,
|
|
@@ -8037,9 +8048,10 @@ const Wh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8037
8048
|
o061_tenants_attack_protection: Rh,
|
|
8038
8049
|
o062_tenants_default_client_id: Lh,
|
|
8039
8050
|
o063_email_templates: Bh,
|
|
8040
|
-
o064_create_action_versions: Wh
|
|
8051
|
+
o064_create_action_versions: Wh,
|
|
8052
|
+
o065_branding_dark_mode: Gh
|
|
8041
8053
|
};
|
|
8042
|
-
async function
|
|
8054
|
+
async function np(e, t = !1) {
|
|
8043
8055
|
je(t), t && console.log("migrating...");
|
|
8044
8056
|
const a = new Ae(qe), n = new Ne({
|
|
8045
8057
|
db: e,
|
|
@@ -8052,7 +8064,7 @@ async function ep(e, t = !1) {
|
|
|
8052
8064
|
}), o)
|
|
8053
8065
|
throw console.error("failed to migrate"), console.error(o), o;
|
|
8054
8066
|
}
|
|
8055
|
-
async function
|
|
8067
|
+
async function op(e, t = !1) {
|
|
8056
8068
|
je(t), t && console.log("migrating...");
|
|
8057
8069
|
const a = new Ae(qe), n = new Ne({
|
|
8058
8070
|
db: e,
|
|
@@ -8065,7 +8077,7 @@ async function tp(e, t = !1) {
|
|
|
8065
8077
|
}), o)
|
|
8066
8078
|
throw console.error("failed to migrate"), console.error(o), o;
|
|
8067
8079
|
}
|
|
8068
|
-
function
|
|
8080
|
+
function Vh(e, t = { useTransactions: !0 }) {
|
|
8069
8081
|
const a = {
|
|
8070
8082
|
actions: vt(e),
|
|
8071
8083
|
actionVersions: Ct(e),
|
|
@@ -8111,7 +8123,7 @@ function Yh(e, t = { useTransactions: !0 }) {
|
|
|
8111
8123
|
outbox: $r(e),
|
|
8112
8124
|
async transaction(n) {
|
|
8113
8125
|
return t.useTransactions === !1 ? n(a) : e.transaction().execute(async (o) => {
|
|
8114
|
-
const r =
|
|
8126
|
+
const r = Vh(o, {
|
|
8115
8127
|
...t,
|
|
8116
8128
|
useTransactions: !1
|
|
8117
8129
|
});
|
|
@@ -8122,7 +8134,7 @@ function Yh(e, t = { useTransactions: !0 }) {
|
|
|
8122
8134
|
return a;
|
|
8123
8135
|
}
|
|
8124
8136
|
export {
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8137
|
+
Vh as default,
|
|
8138
|
+
op as migrateDown,
|
|
8139
|
+
np as migrateToLatest
|
|
8128
8140
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/markusahlstrand/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "10.
|
|
14
|
+
"version": "10.135.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"kysely": "^0.27.4",
|
|
44
44
|
"nanoid": "^5.0.8",
|
|
45
|
-
"@authhero/adapter-interfaces": "1.
|
|
45
|
+
"@authhero/adapter-interfaces": "1.18.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@hono/zod-openapi": "^0.19.2",
|