import { Querier, TransactionalDatabase } from "@platform-modules/db";
//#region src/oauth-provider/schema.d.ts
declare const oauthClients: import("drizzle-orm/pg-core").PgTableWithColumns<{
  name: "oauth_clients";
  schema: undefined;
  columns: {
    id: import("drizzle-orm/pg-core").PgColumn<{
      name: "id";
      tableName: "oauth_clients";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: true;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    name: import("drizzle-orm/pg-core").PgColumn<{
      name: "name";
      tableName: "oauth_clients";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    redirectUris: import("drizzle-orm/pg-core").PgColumn<{
      name: "redirect_uris";
      tableName: "oauth_clients";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    scopes: import("drizzle-orm/pg-core").PgColumn<{
      name: "scopes";
      tableName: "oauth_clients";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    confidential: import("drizzle-orm/pg-core").PgColumn<{
      name: "confidential";
      tableName: "oauth_clients";
      dataType: "boolean";
      columnType: "PgBoolean";
      data: boolean;
      driverParam: boolean;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    clientSecretHash: import("drizzle-orm/pg-core").PgColumn<{
      name: "client_secret_hash";
      tableName: "oauth_clients";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    createdAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at";
      tableName: "oauth_clients";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
  };
  dialect: "pg";
}>;
declare const oauthCodes: import("drizzle-orm/pg-core").PgTableWithColumns<{
  name: "oauth_codes";
  schema: undefined;
  columns: {
    id: import("drizzle-orm/pg-core").PgColumn<{
      name: "id";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: true;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    clientId: import("drizzle-orm/pg-core").PgColumn<{
      name: "client_id";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    redirectUri: import("drizzle-orm/pg-core").PgColumn<{
      name: "redirect_uri";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    scope: import("drizzle-orm/pg-core").PgColumn<{
      name: "scope";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    codeChallenge: import("drizzle-orm/pg-core").PgColumn<{
      name: "code_challenge";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    codeChallengeMethod: import("drizzle-orm/pg-core").PgColumn<{
      name: "code_challenge_method";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    codeHash: import("drizzle-orm/pg-core").PgColumn<{
      name: "code_hash";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    subjectId: import("drizzle-orm/pg-core").PgColumn<{
      name: "subject_id";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    tenantId: import("drizzle-orm/pg-core").PgColumn<{
      name: "tenant_id";
      tableName: "oauth_codes";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    createdAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at";
      tableName: "oauth_codes";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    expiresAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "expires_at";
      tableName: "oauth_codes";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    usedAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "used_at";
      tableName: "oauth_codes";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
  };
  dialect: "pg";
}>;
declare const oauthTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{
  name: "oauth_tokens";
  schema: undefined;
  columns: {
    id: import("drizzle-orm/pg-core").PgColumn<{
      name: "id";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: true;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    clientId: import("drizzle-orm/pg-core").PgColumn<{
      name: "client_id";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    codeId: import("drizzle-orm/pg-core").PgColumn<{
      name: "code_id";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    accessTokenPrefix: import("drizzle-orm/pg-core").PgColumn<{
      name: "access_token_prefix";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    accessTokenHash: import("drizzle-orm/pg-core").PgColumn<{
      name: "access_token_hash";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    scope: import("drizzle-orm/pg-core").PgColumn<{
      name: "scope";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    tokenType: import("drizzle-orm/pg-core").PgColumn<{
      name: "token_type";
      tableName: "oauth_tokens";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    createdAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at";
      tableName: "oauth_tokens";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    expiresAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "expires_at";
      tableName: "oauth_tokens";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
  };
  dialect: "pg";
}>;
declare const oauthProviderCreationSql: () => string;
declare const oauthProviderMigrationSql: () => string;
declare const oauthProviderSchema: {
  oauthClients: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "oauth_clients";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "oauth_clients";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      name: import("drizzle-orm/pg-core").PgColumn<{
        name: "name";
        tableName: "oauth_clients";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      redirectUris: import("drizzle-orm/pg-core").PgColumn<{
        name: "redirect_uris";
        tableName: "oauth_clients";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      scopes: import("drizzle-orm/pg-core").PgColumn<{
        name: "scopes";
        tableName: "oauth_clients";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      confidential: import("drizzle-orm/pg-core").PgColumn<{
        name: "confidential";
        tableName: "oauth_clients";
        dataType: "boolean";
        columnType: "PgBoolean";
        data: boolean;
        driverParam: boolean;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      clientSecretHash: import("drizzle-orm/pg-core").PgColumn<{
        name: "client_secret_hash";
        tableName: "oauth_clients";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "oauth_clients";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  oauthCodes: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "oauth_codes";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      clientId: import("drizzle-orm/pg-core").PgColumn<{
        name: "client_id";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      redirectUri: import("drizzle-orm/pg-core").PgColumn<{
        name: "redirect_uri";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      scope: import("drizzle-orm/pg-core").PgColumn<{
        name: "scope";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      codeChallenge: import("drizzle-orm/pg-core").PgColumn<{
        name: "code_challenge";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      codeChallengeMethod: import("drizzle-orm/pg-core").PgColumn<{
        name: "code_challenge_method";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      codeHash: import("drizzle-orm/pg-core").PgColumn<{
        name: "code_hash";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      subjectId: import("drizzle-orm/pg-core").PgColumn<{
        name: "subject_id";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      tenantId: import("drizzle-orm/pg-core").PgColumn<{
        name: "tenant_id";
        tableName: "oauth_codes";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "oauth_codes";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      expiresAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "expires_at";
        tableName: "oauth_codes";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      usedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "used_at";
        tableName: "oauth_codes";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  oauthTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "oauth_tokens";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      clientId: import("drizzle-orm/pg-core").PgColumn<{
        name: "client_id";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      codeId: import("drizzle-orm/pg-core").PgColumn<{
        name: "code_id";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      accessTokenPrefix: import("drizzle-orm/pg-core").PgColumn<{
        name: "access_token_prefix";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      accessTokenHash: import("drizzle-orm/pg-core").PgColumn<{
        name: "access_token_hash";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      scope: import("drizzle-orm/pg-core").PgColumn<{
        name: "scope";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      tokenType: import("drizzle-orm/pg-core").PgColumn<{
        name: "token_type";
        tableName: "oauth_tokens";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "oauth_tokens";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      expiresAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "expires_at";
        tableName: "oauth_tokens";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
};
type OAuthProviderSchema = typeof oauthProviderSchema;
//#endregion
//#region src/oauth-provider/types.d.ts
type OAuthClient = {
  id: string;
  name: string;
  redirectUris: string[];
  scopes: string[];
  confidential: boolean;
  createdAt: Date;
};
type RegisterOAuthClientResult = {
  clientId: string;
  clientSecret?: string;
};
type RegisterOAuthClientInput = {
  id?: string;
  name: string;
  redirectUris: string[];
  scopes: string[];
  confidential: boolean;
};
type AuthorizeInput = {
  clientId: string;
  redirectUri: string;
  codeChallenge: string;
  codeChallengeMethod: 'S256';
  scope: string;
};
type OAuthAuthorizationPrincipal = {
  subjectId: string;
  tenantId: string;
};
type ExchangeTokenInput = {
  code: string;
  codeVerifier: string;
  clientId: string;
  /** Must equal the `redirectUri` the code was issued against (RFC 6749 §4.1.3). */
  redirectUri: string;
  clientSecret?: string;
};
type OAuthTokenResult = {
  accessToken: string;
  tokenType: 'Bearer';
  expiresIn: number;
  scope: string;
};
/** `token` is the only OAuth wire payload; `authorizationPrincipal` is host-internal. */
type OAuthTokenExchangeResult = {
  token: OAuthTokenResult;
  authorizationPrincipal: OAuthAuthorizationPrincipal;
};
//#endregion
//#region src/oauth-provider/errors.d.ts
declare class InvalidOAuthClientNameError extends Error {
  readonly name = "InvalidOAuthClientNameError";
  readonly code: "OAUTH_CLIENT_NAME_INVALID";
  constructor();
}
declare class InvalidOAuthRedirectUrisError extends Error {
  readonly name = "InvalidOAuthRedirectUrisError";
  readonly code: "OAUTH_REDIRECT_URIS_INVALID";
  constructor();
}
declare class InvalidOAuthScopesError extends Error {
  readonly name = "InvalidOAuthScopesError";
  readonly code: "OAUTH_SCOPES_INVALID";
  constructor();
}
declare class OAuthClientNotFoundError extends Error {
  readonly clientId: string;
  readonly name = "OAuthClientNotFoundError";
  readonly code: "OAUTH_CLIENT_NOT_FOUND";
  constructor(clientId: string);
}
declare class OAuthRedirectUriMismatchError extends Error {
  readonly redirectUri: string;
  readonly name = "OAuthRedirectUriMismatchError";
  readonly code: "OAUTH_REDIRECT_URI_MISMATCH";
  constructor(redirectUri: string);
}
declare class InvalidOAuthScopeError extends Error {
  readonly scope: string;
  readonly name = "InvalidOAuthScopeError";
  readonly code: "OAUTH_SCOPE_INVALID";
  constructor(scope: string);
}
declare class UnsupportedCodeChallengeMethodError extends Error {
  readonly codeChallengeMethod: string;
  readonly name = "UnsupportedCodeChallengeMethodError";
  readonly code: "OAUTH_UNSUPPORTED_CODE_CHALLENGE_METHOD";
  constructor(codeChallengeMethod: string);
}
declare class InvalidOAuthCodeChallengeError extends Error {
  readonly name = "InvalidOAuthCodeChallengeError";
  readonly code: "OAUTH_CODE_CHALLENGE_INVALID";
  constructor();
}
declare class OAuthCodeNotFoundError extends Error {
  readonly name = "OAuthCodeNotFoundError";
  readonly code: "OAUTH_CODE_NOT_FOUND";
  constructor();
}
declare class OAuthCodeAlreadyUsedError extends Error {
  readonly name = "OAuthCodeAlreadyUsedError";
  readonly code: "OAUTH_CODE_ALREADY_USED";
  constructor();
}
declare class OAuthCodeExpiredError extends Error {
  readonly name = "OAuthCodeExpiredError";
  readonly code: "OAUTH_CODE_EXPIRED";
  constructor();
}
declare class OAuthCodePrincipalMissingError extends Error {
  readonly name = "OAuthCodePrincipalMissingError";
  readonly code: "OAUTH_CODE_PRINCIPAL_MISSING";
  constructor();
}
declare class OAuthCodeClientMismatchError extends Error {
  readonly clientId: string;
  readonly name = "OAuthCodeClientMismatchError";
  readonly code: "OAUTH_CODE_CLIENT_MISMATCH";
  constructor(clientId: string);
}
declare class InvalidOAuthCodeVerifierError extends Error {
  readonly name = "InvalidOAuthCodeVerifierError";
  readonly code: "OAUTH_CODE_VERIFIER_INVALID";
  constructor();
}
declare class MissingOAuthClientSecretError extends Error {
  readonly clientId: string;
  readonly name = "MissingOAuthClientSecretError";
  readonly code: "OAUTH_CLIENT_SECRET_MISSING";
  constructor(clientId: string);
}
declare class InvalidOAuthClientSecretError extends Error {
  readonly clientId: string;
  readonly name = "InvalidOAuthClientSecretError";
  readonly code: "OAUTH_CLIENT_SECRET_INVALID";
  constructor(clientId: string);
}
type OAuthProviderError = InvalidOAuthClientNameError | InvalidOAuthRedirectUrisError | InvalidOAuthScopesError | OAuthClientNotFoundError | OAuthRedirectUriMismatchError | InvalidOAuthScopeError | UnsupportedCodeChallengeMethodError | InvalidOAuthCodeChallengeError | OAuthCodeNotFoundError | OAuthCodeAlreadyUsedError | OAuthCodeExpiredError | OAuthCodePrincipalMissingError | OAuthCodeClientMismatchError | InvalidOAuthCodeVerifierError | MissingOAuthClientSecretError | InvalidOAuthClientSecretError;
declare function isOAuthProviderError(error: unknown): error is OAuthProviderError;
declare function isInvalidOAuthClientNameError(error: unknown): error is InvalidOAuthClientNameError;
declare function isInvalidOAuthRedirectUrisError(error: unknown): error is InvalidOAuthRedirectUrisError;
declare function isInvalidOAuthScopesError(error: unknown): error is InvalidOAuthScopesError;
declare function isOAuthClientNotFoundError(error: unknown): error is OAuthClientNotFoundError;
declare function isOAuthRedirectUriMismatchError(error: unknown): error is OAuthRedirectUriMismatchError;
declare function isInvalidOAuthScopeError(error: unknown): error is InvalidOAuthScopeError;
declare function isUnsupportedCodeChallengeMethodError(error: unknown): error is UnsupportedCodeChallengeMethodError;
declare function isInvalidOAuthCodeChallengeError(error: unknown): error is InvalidOAuthCodeChallengeError;
declare function isOAuthCodeNotFoundError(error: unknown): error is OAuthCodeNotFoundError;
declare function isOAuthCodeAlreadyUsedError(error: unknown): error is OAuthCodeAlreadyUsedError;
declare function isOAuthCodeExpiredError(error: unknown): error is OAuthCodeExpiredError;
declare function isOAuthCodePrincipalMissingError(error: unknown): error is OAuthCodePrincipalMissingError;
declare function isOAuthCodeClientMismatchError(error: unknown): error is OAuthCodeClientMismatchError;
declare function isInvalidOAuthCodeVerifierError(error: unknown): error is InvalidOAuthCodeVerifierError;
declare function isMissingOAuthClientSecretError(error: unknown): error is MissingOAuthClientSecretError;
declare function isInvalidOAuthClientSecretError(error: unknown): error is InvalidOAuthClientSecretError;
//#endregion
//#region src/oauth-provider/pkce.d.ts
declare function deriveCodeChallengeS256(codeVerifier: string): Promise<string>;
declare function verifyCodeVerifierS256(codeVerifier: string, codeChallenge: string): Promise<boolean>;
//#endregion
//#region src/oauth-provider/index.d.ts
declare function registerClient<S extends Record<string, unknown>>(db: Querier<S>, input: RegisterOAuthClientInput): Promise<RegisterOAuthClientResult>;
declare function getClient<S extends Record<string, unknown>>(db: Querier<S>, id: string): Promise<OAuthClient | null>;
declare function authorize<S extends Record<string, unknown>>(db: Querier<S>, input: AuthorizeInput, authorizationPrincipal: OAuthAuthorizationPrincipal): Promise<{
  code: string;
}>;
declare function exchangeToken<S extends Record<string, unknown>>(db: TransactionalDatabase<S>, input: ExchangeTokenInput): Promise<OAuthTokenExchangeResult>;
//#endregion
export { type AuthorizeInput, type ExchangeTokenInput, InvalidOAuthClientNameError, InvalidOAuthClientSecretError, InvalidOAuthCodeChallengeError, InvalidOAuthCodeVerifierError, InvalidOAuthRedirectUrisError, InvalidOAuthScopeError, InvalidOAuthScopesError, MissingOAuthClientSecretError, type OAuthAuthorizationPrincipal, type OAuthClient, OAuthClientNotFoundError, OAuthCodeAlreadyUsedError, OAuthCodeClientMismatchError, OAuthCodeExpiredError, OAuthCodeNotFoundError, OAuthCodePrincipalMissingError, type OAuthProviderError, type OAuthProviderSchema, OAuthRedirectUriMismatchError, type OAuthTokenExchangeResult, type OAuthTokenResult, type RegisterOAuthClientInput, type RegisterOAuthClientResult, UnsupportedCodeChallengeMethodError, authorize, deriveCodeChallengeS256, exchangeToken, getClient, isInvalidOAuthClientNameError, isInvalidOAuthClientSecretError, isInvalidOAuthCodeChallengeError, isInvalidOAuthCodeVerifierError, isInvalidOAuthRedirectUrisError, isInvalidOAuthScopeError, isInvalidOAuthScopesError, isMissingOAuthClientSecretError, isOAuthClientNotFoundError, isOAuthCodeAlreadyUsedError, isOAuthCodeClientMismatchError, isOAuthCodeExpiredError, isOAuthCodeNotFoundError, isOAuthCodePrincipalMissingError, isOAuthProviderError, isOAuthRedirectUriMismatchError, isUnsupportedCodeChallengeMethodError, oauthClients, oauthCodes, oauthProviderCreationSql, oauthProviderMigrationSql, oauthProviderSchema, oauthTokens, registerClient, verifyCodeVerifierS256 };