@authhero/kysely-adapter 12.6.1 → 12.7.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,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>;
@@ -7,6 +7,7 @@ import * as actionExecutionsCreatedAtIndex from "./2026-08-10T12:00:00_action_ex
7
7
  import * as pageHooks from "./2026-08-11T12:00:00_page_hooks";
8
8
  import * as refreshTokenSessionId from "./2026-08-20T12:00:00_refresh_token_session_id";
9
9
  import * as refreshTokenSessionIdBackfill from "./2026-08-21T12:00:00_refresh_token_session_id_backfill";
10
+ import * as tenantOperationRows from "./2026-09-01T12:00:00_tenant_operation_rows";
10
11
  /**
11
12
  * Kysely runs these in key order and refuses to start if an already-executed
12
13
  * migration sorts after a pending one, so the keys must sort in execution
@@ -32,5 +33,6 @@ declare const _default: {
32
33
  "2026-08-11T12:00:00_page_hooks": typeof pageHooks;
33
34
  "2026-08-20T12:00:00_refresh_token_session_id": typeof refreshTokenSessionId;
34
35
  "2026-08-21T12:00:00_refresh_token_session_id_backfill": typeof refreshTokenSessionIdBackfill;
36
+ "2026-09-01T12:00:00_tenant_operation_rows": typeof tenantOperationRows;
35
37
  };
36
38
  export default _default;
@@ -3,10 +3,10 @@ import { Kysely } from "kysely";
3
3
  import { Database } from "../db";
4
4
  export declare function create(db: Kysely<Database>): (tenant_id: string, code: CodeInsert) => Promise<{
5
5
  code_id: string;
6
- login_id: string;
7
- code_type: "otp" | "password_reset" | "email_verification" | "mfa_otp" | "authorization_code" | "oauth2_state" | "ticket";
6
+ code_type: "otp" | "password_reset" | "email_verification" | "mfa_otp" | "authorization_code" | "oauth2_state" | "ticket" | "client_assertion_jti";
8
7
  expires_at: string;
9
8
  created_at: string;
9
+ login_id?: string | undefined;
10
10
  connection_id?: string | undefined;
11
11
  code_verifier?: string | undefined;
12
12
  code_challenge?: string | undefined;
@@ -3,22 +3,12 @@ import { Database } from "../db";
3
3
  export declare function getByDomain(db: Kysely<Database>): (domain: string) => Promise<{
4
4
  primary: boolean;
5
5
  domain_metadata: undefined;
6
+ verification: undefined;
6
7
  tenant_id: string;
7
8
  created_at: string;
8
9
  updated_at: string;
9
10
  verification_method: "txt" | undefined;
10
11
  status: "pending" | "disabled" | "pending_verification" | "ready";
11
- verification: {
12
- methods: ({
13
- name: "txt";
14
- record: string;
15
- domain: string;
16
- } | {
17
- name: "http";
18
- http_body: string;
19
- http_url: string;
20
- })[];
21
- } | undefined;
22
12
  type: "auth0_managed_certs" | "self_managed_certs";
23
13
  domain: string;
24
14
  custom_client_ip_header: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
@@ -285,21 +285,11 @@ declare const sqlCustomDomainSchema: z.ZodObject<{
285
285
  ready: "ready";
286
286
  }>;
287
287
  origin_domain_name: z.ZodOptional<z.ZodString>;
288
- verification: z.ZodOptional<z.ZodObject<{
289
- methods: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
290
- name: z.ZodLiteral<"txt">;
291
- record: z.ZodString;
292
- domain: z.ZodString;
293
- }, z.core.$strip>, z.ZodObject<{
294
- name: z.ZodLiteral<"http">;
295
- http_body: z.ZodString;
296
- http_url: z.ZodString;
297
- }, z.core.$strip>], "name">>;
298
- }, z.core.$strip>>;
299
288
  tls_policy: z.ZodOptional<z.ZodString>;
300
289
  primary: z.ZodNumber;
301
290
  tenant_id: z.ZodString;
302
291
  domain_metadata: z.ZodOptional<z.ZodString>;
292
+ verification: z.ZodOptional<z.ZodString>;
303
293
  created_at: z.ZodString;
304
294
  updated_at: z.ZodString;
305
295
  }, z.core.$strip>;
@@ -986,10 +976,26 @@ export interface Database {
986
976
  target_database_version: string | null;
987
977
  error: string | null;
988
978
  initiated_by: string | null;
979
+ input: string | null;
980
+ result: string | null;
981
+ claimed_by: string | null;
982
+ claim_expires_at: string | null;
989
983
  created_at: string;
990
984
  updated_at: string;
991
985
  finished_at: string | null;
992
986
  };
987
+ tenant_operation_rows: {
988
+ operation_id: string;
989
+ seq: number;
990
+ payload: string;
991
+ status: string;
992
+ error_code: string | null;
993
+ error_message: string | null;
994
+ error_path: string | null;
995
+ entity_id: string | null;
996
+ created_at: string;
997
+ updated_at: string;
998
+ };
993
999
  tenant_operation_events: {
994
1000
  id: string;
995
1001
  operation_id: string;
@@ -6,6 +6,11 @@ import { Database } from "../db";
6
6
  * next_retry_at. Scoped to tenantId so management-API callers can't reach
7
7
  * into another tenant's dead-letter queue.
8
8
  *
9
+ * The claim is released too. `deadLetter` leaves `claimed_by` /
10
+ * `claim_expires_at` set from the relay pass that retired the event (unlike
11
+ * `markRetry`, which clears them), so a replay inside the 30s lease window
12
+ * would otherwise be skipped by `getUnprocessed` until the lease aged out.
13
+ *
9
14
  * Returns true if a row was updated (matched id + tenant + was dead-lettered),
10
15
  * false otherwise (so the route handler's 404 branch still works).
11
16
  */
@@ -0,0 +1,4 @@
1
+ import { Kysely } from "kysely";
2
+ import { TenantOperationRowsAdapter } from "@authhero/adapter-interfaces";
3
+ import { Database } from "../db";
4
+ export declare function createTenantOperationRowsAdapter(db: Kysely<Database>): TenantOperationRowsAdapter;