Skip to content

Commit

Permalink
Merge pull request #14 from markusahlstrand/ma/missing-dependencies
Browse files Browse the repository at this point in the history
added missing dependencies and moved migrations folder
  • Loading branch information
markusahlstrand authored Dec 18, 2024
2 parents 526a412 + f217f44 commit 2620293
Show file tree
Hide file tree
Showing 80 changed files with 110 additions and 135 deletions.
3 changes: 3 additions & 0 deletions packages/adapter-interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
},
"peerDependencies": {
"@hono/zod-openapi": "^0.16.4"
},
"dependencies": {
"nanoid": "^5.0.8"
}
}
2 changes: 2 additions & 0 deletions packages/authhero/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"better-sqlite3": "^11.5.0",
"dts-bundle-generator": "^9.5.1",
"hono": "^4.6.11",
"kysely": "^0.27.4",
"typescript": "^5.6.3",
"vite": "^5.4.11",
"vite-plugin-dts": "^4.3.0",
Expand All @@ -37,6 +38,7 @@
"@peculiar/x509": "^1.12.3",
"bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
"nanoid": "^5.0.8",
"oslo": "^1.2.1",
"zxcvbn": "^4.4.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/authhero/src/helpers/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTTPException } from "hono/http-exception";
import { Client, connectionSchema } from "authhero";
import { Client, connectionSchema } from "@authhero/adapter-interfaces";
import { Bindings } from "../types";

export async function getClient(
Expand Down
2 changes: 1 addition & 1 deletion packages/authhero/src/types/auth0/Totals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "@hono/zod-openapi";

export const totalsSchema = z.object({
start: z.number(),
Expand Down
2 changes: 1 addition & 1 deletion packages/authhero/src/types/auth0/UserResponse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseUser, baseUserSchema } from "@authhero/adapter-interfaces";
import { z } from "zod";
import { z } from "@hono/zod-openapi";

export interface PostUsersBody extends BaseUser {
password?: string;
Expand Down
6 changes: 3 additions & 3 deletions packages/authhero/test/routes/auth-api/dbconnections.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("dbconnections", () => {
{
json: {
email: "[email protected]",
password: "Password1!",
password: "fG%D0MV4bjb%xI",
connection: "Username-Password-Authentication",
client_id: "clientId",
},
Expand Down Expand Up @@ -160,7 +160,7 @@ describe("dbconnections", () => {

expect(response.status).toBe(400);
const message = await response.text();
expect(message).toBe("Invalid sign up");
expect(message).toBe("Password does not meet the requirements");
});
});

Expand Down Expand Up @@ -199,7 +199,7 @@ describe("dbconnections", () => {
{
json: {
email: "[email protected]",
password: "Password1!",
password: "fG%D0MV4bjb%xI",
connection: "Username-Password-Authentication",
client_id: "clientId",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Kysely, Migrator } from "kysely";

import ReferenceMigrationProvider from "./ReferenceMigrationProvider";
import migrations from "./migrations";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../src/db";

export async function migrateToLatest(db: Kysely<Database>, debug = false) {
if (debug) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";
import { Kysely } from "kysely";

export async function up(db: Kysely<Database>): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// This table is recreated in a later migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema.alterTable("users").dropColumn("linked_to").execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema.alterTable("logs").dropColumn("category").execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema.alterTable("users").dropColumn("tags").execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
// This does not work
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// Sqlite does not support altering tables to add unique constraints
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
// Uncomment this for planetscale migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
// Uncomment this for planetscale migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// Uncomment this for planetscale migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
// Uncomment this for planetscale migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// Run this is the console to update the user indexes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// So far we don't really care about the existing sessions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(db: Kysely<Database>): Promise<void> {
await db.schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kysely } from "kysely";
import { Database } from "@authhero/kysely-adapter";
import { Database } from "../../src/db";

export async function up(_: Kysely<Database>): Promise<void> {
// Sqlite does not like this
Expand Down
Loading

0 comments on commit 2620293

Please sign in to comment.