@authhero/kysely-adapter 12.0.0 → 12.2.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.
@@ -0,0 +1,21 @@
1
+ import { Kysely } from "kysely";
2
+ import { Database } from "../../src/db";
3
+ /**
4
+ * SCIM 2.0 inbound provisioning (#1191). Three tenant-scoped tables:
5
+ *
6
+ * - scim_configurations: one config per connection.
7
+ * - scim_tokens: hashed long-lived bearer tokens for /scim/v2.
8
+ * - scim_external_ids: IdP externalId -> AuthHero user_id lookup.
9
+ *
10
+ * Every primary/unique key leads with `tenant_id`: connection ids, token ids
11
+ * and IdP external ids are only unique within a tenant, so a tenant-less key
12
+ * would let one tenant's row block another's.
13
+ *
14
+ * No foreign keys, mirroring `proxy_routes`: connections have a composite
15
+ * (tenant_id, id) primary key, so a real FK would be composite and awkward,
16
+ * and these tables are always queried tenant-scoped anyway. `mapping` and
17
+ * `scopes` are JSON text with no DB-level default (MySQL forbids defaults on
18
+ * TEXT); the adapter always writes a value.
19
+ */
20
+ export declare function up(db: Kysely<Database>): Promise<void>;
21
+ export declare function down(db: Kysely<Database>): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { Kysely } from "kysely";
2
+ import { Database } from "../../src/db";
3
+ export declare function up(db: Kysely<Database>): Promise<void>;
4
+ export declare function down(db: Kysely<Database>): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { Kysely } from "kysely";
2
+ import { Database } from "../../src/db";
3
+ export declare function up(db: Kysely<Database>): Promise<void>;
4
+ export declare function down(db: Kysely<Database>): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { Kysely } from "kysely";
2
+ import { Database } from "../../src/db";
3
+ export declare function up(db: Kysely<Database>): Promise<void>;
4
+ export declare function down(db: Kysely<Database>): Promise<void>;
@@ -1,5 +1,9 @@
1
1
  import * as baseline from "./2026-07-16T14:00:00_baseline";
2
2
  import * as codesExpiresAtTs from "./2026-07-16T15:00:00_codes_expires_at_ts";
3
+ import * as scimInboundProvisioning from "./2026-08-04T12:00:00_scim_inbound_provisioning";
4
+ import * as userBlocked from "./2026-08-05T12:00:00_user_blocked";
5
+ import * as promptSettingsLastUsed from "./2026-08-09T12:00:00_prompt_settings_last_used";
6
+ import * as actionExecutionsCreatedAtIndex from "./2026-08-10T12:00:00_action_executions_created_at_index";
3
7
  /**
4
8
  * Kysely runs these in key order and refuses to start if an already-executed
5
9
  * migration sorts after a pending one, so the keys must sort in execution
@@ -18,5 +22,9 @@ import * as codesExpiresAtTs from "./2026-07-16T15:00:00_codes_expires_at_ts";
18
22
  declare const _default: {
19
23
  "2026-07-16T14:00:00_baseline": typeof baseline;
20
24
  "2026-07-16T15:00:00_codes_expires_at_ts": typeof codesExpiresAtTs;
25
+ "2026-08-04T12:00:00_scim_inbound_provisioning": typeof scimInboundProvisioning;
26
+ "2026-08-05T12:00:00_user_blocked": typeof userBlocked;
27
+ "2026-08-09T12:00:00_prompt_settings_last_used": typeof promptSettingsLastUsed;
28
+ "2026-08-10T12:00:00_action_executions_created_at_index": typeof actionExecutionsCreatedAtIndex;
21
29
  };
22
30
  export default _default;
@@ -0,0 +1,3 @@
1
+ import { Kysely } from "kysely";
2
+ import { Database } from "../db";
3
+ export declare function cleanup(db: Kysely<Database>): (olderThan: string) => Promise<number>;
@@ -56,6 +56,7 @@ declare const sqlPromptSettingSchema: z.ZodObject<{
56
56
  identifier_first: z.ZodNumber;
57
57
  password_first: z.ZodNumber;
58
58
  webauthn_platform_first_factor: z.ZodNumber;
59
+ show_last_used_connection: z.ZodNullable<z.ZodNumber>;
59
60
  tenant_id: z.ZodString;
60
61
  }, z.core.$strip>;
61
62
  declare const sqlPasswordSchema: z.ZodObject<{
@@ -124,6 +125,7 @@ export declare const sqlUserSchema: z.ZodObject<{
124
125
  email_verified: z.ZodNumber;
125
126
  phone_verified: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
126
127
  is_social: z.ZodNumber;
128
+ blocked: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
127
129
  app_metadata: z.ZodString;
128
130
  user_metadata: z.ZodString;
129
131
  address: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -939,6 +941,31 @@ export interface Database {
939
941
  created_at: string;
940
942
  updated_at: string;
941
943
  };
944
+ scim_configurations: {
945
+ connection_id: string;
946
+ tenant_id: string;
947
+ user_id_attribute: string;
948
+ mapping: string;
949
+ created_at: string;
950
+ updated_at: string;
951
+ };
952
+ scim_tokens: {
953
+ token_id: string;
954
+ tenant_id: string;
955
+ connection_id: string;
956
+ token_hash: string;
957
+ scopes: string;
958
+ valid_until: string | null;
959
+ created_at: string;
960
+ last_used_at: string | null;
961
+ };
962
+ scim_external_ids: {
963
+ tenant_id: string;
964
+ connection_id: string;
965
+ external_id: string;
966
+ user_id: string;
967
+ created_at: string;
968
+ };
942
969
  tenant_operations: {
943
970
  id: string;
944
971
  tenant_id: string | null;
@@ -0,0 +1,6 @@
1
+ import { Kysely } from "kysely";
2
+ import { ScimConfigurationsAdapter, ScimTokensAdapter, ScimExternalIdsAdapter } from "@authhero/adapter-interfaces";
3
+ import { Database } from "../db";
4
+ export declare function createScimConfigurationsAdapter(db: Kysely<Database>): ScimConfigurationsAdapter;
5
+ export declare function createScimTokensAdapter(db: Kysely<Database>): ScimTokensAdapter;
6
+ export declare function createScimExternalIdsAdapter(db: Kysely<Database>): ScimExternalIdsAdapter;
@@ -0,0 +1 @@
1
+ export { createScimConfigurationsAdapter, createScimTokensAdapter, createScimExternalIdsAdapter, } from "./adapter";