From f50d9d39be29a85f37204b2f94b0f4cd01753deb Mon Sep 17 00:00:00 2001 From: Markus Ahlstrand Date: Fri, 26 Jul 2024 15:49:29 +0200 Subject: [PATCH] fix: handle boolean values --- apps/demo/CHANGELOG.md | 6 ++++++ apps/demo/package.json | 2 +- packages/adapter-interfaces/CHANGELOG.md | 6 ++++++ packages/adapter-interfaces/package.json | 2 +- packages/authhero/CHANGELOG.md | 7 +++++++ packages/authhero/package.json | 2 +- packages/drizzle/CHANGELOG.md | 7 +++++++ packages/drizzle/package.json | 2 +- packages/kysely/CHANGELOG.md | 8 ++++++++ packages/kysely/package.json | 2 +- packages/kysely/src/hooks/create.ts | 9 ++++++--- packages/kysely/src/hooks/get.ts | 1 + packages/kysely/src/hooks/list.ts | 3 ++- 13 files changed, 48 insertions(+), 9 deletions(-) diff --git a/apps/demo/CHANGELOG.md b/apps/demo/CHANGELOG.md index e09dda7..51d816b 100644 --- a/apps/demo/CHANGELOG.md +++ b/apps/demo/CHANGELOG.md @@ -1,5 +1,11 @@ # @authhero/demo +## 0.0.5 + +### Patch Changes + +- authhero@0.2.7 + ## 0.0.4 ### Patch Changes diff --git a/apps/demo/package.json b/apps/demo/package.json index cdf37d6..d3e1935 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -1,7 +1,7 @@ { "name": "@authhero/demo", "private": true, - "version": "0.0.4", + "version": "0.0.5", "scripts": { "dev": "bun --watch src/bun.ts" }, diff --git a/packages/adapter-interfaces/CHANGELOG.md b/packages/adapter-interfaces/CHANGELOG.md index 2aaf2d6..1423125 100644 --- a/packages/adapter-interfaces/CHANGELOG.md +++ b/packages/adapter-interfaces/CHANGELOG.md @@ -1,5 +1,11 @@ # @authhero/adapter-interfaces +## 0.10.3 + +### Patch Changes + +- Handle boolean values + ## 0.10.2 ### Patch Changes diff --git a/packages/adapter-interfaces/package.json b/packages/adapter-interfaces/package.json index 1a6ad03..053985e 100644 --- a/packages/adapter-interfaces/package.json +++ b/packages/adapter-interfaces/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.10.2", + "version": "0.10.3", "files": [ "dist" ], diff --git a/packages/authhero/CHANGELOG.md b/packages/authhero/CHANGELOG.md index bcf5284..2acb124 100644 --- a/packages/authhero/CHANGELOG.md +++ b/packages/authhero/CHANGELOG.md @@ -1,5 +1,12 @@ # authhero +## 0.2.7 + +### Patch Changes + +- Updated dependencies + - @authhero/adapter-interfaces@0.10.3 + ## 0.2.6 ### Patch Changes diff --git a/packages/authhero/package.json b/packages/authhero/package.json index afd88f5..5bcac2e 100644 --- a/packages/authhero/package.json +++ b/packages/authhero/package.json @@ -1,6 +1,6 @@ { "name": "authhero", - "version": "0.2.6", + "version": "0.2.7", "files": [ "dist" ], diff --git a/packages/drizzle/CHANGELOG.md b/packages/drizzle/CHANGELOG.md index ed3b019..4ba2093 100644 --- a/packages/drizzle/CHANGELOG.md +++ b/packages/drizzle/CHANGELOG.md @@ -1,5 +1,12 @@ # @authhero/drizzle +## 0.1.23 + +### Patch Changes + +- Updated dependencies + - @authhero/adapter-interfaces@0.10.3 + ## 0.1.22 ### Patch Changes diff --git a/packages/drizzle/package.json b/packages/drizzle/package.json index 8672661..e180688 100644 --- a/packages/drizzle/package.json +++ b/packages/drizzle/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.1.22", + "version": "0.1.23", "files": [ "dist" ], diff --git a/packages/kysely/CHANGELOG.md b/packages/kysely/CHANGELOG.md index 4a9e443..5fcd42d 100644 --- a/packages/kysely/CHANGELOG.md +++ b/packages/kysely/CHANGELOG.md @@ -1,5 +1,13 @@ # @authhero/kysely-adapter +## 0.6.3 + +### Patch Changes + +- Handle boolean values +- Updated dependencies + - @authhero/adapter-interfaces@0.10.3 + ## 0.6.2 ### Patch Changes diff --git a/packages/kysely/package.json b/packages/kysely/package.json index 8ae242f..db416da 100644 --- a/packages/kysely/package.json +++ b/packages/kysely/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.6.2", + "version": "0.6.3", "files": [ "dist" ], diff --git a/packages/kysely/src/hooks/create.ts b/packages/kysely/src/hooks/create.ts index 2f4509d..5b3ffe9 100644 --- a/packages/kysely/src/hooks/create.ts +++ b/packages/kysely/src/hooks/create.ts @@ -5,7 +5,7 @@ import { Database } from "../db"; export function create(db: Kysely) { return async (tenant_id: string, hook: HookInsert): Promise => { - const sqlHook = { + const createdHook = { hook_id: nanoid(), ...hook, created_at: new Date().toISOString(), @@ -14,9 +14,12 @@ export function create(db: Kysely) { await db .insertInto("hooks") - .values({ ...sqlHook, tenant_id }) + .values({ + ...createdHook, + tenant_id, + }) .execute(); - return sqlHook; + return createdHook; }; } diff --git a/packages/kysely/src/hooks/get.ts b/packages/kysely/src/hooks/get.ts index 407c0a6..ef3c0dc 100644 --- a/packages/kysely/src/hooks/get.ts +++ b/packages/kysely/src/hooks/get.ts @@ -17,6 +17,7 @@ export function get(db: Kysely) { } hook.enabled = !!hook.enabled; + hook.synchronous = !!hook.synchronous; return removeNullProperties(hook); }; diff --git a/packages/kysely/src/hooks/list.ts b/packages/kysely/src/hooks/list.ts index 57f3a59..2ed144b 100644 --- a/packages/kysely/src/hooks/list.ts +++ b/packages/kysely/src/hooks/list.ts @@ -27,11 +27,12 @@ export function list(db: Kysely) { .executeTakeFirstOrThrow(); const hooks = results.map((hook) => { - const { tenant_id, enabled, ...rest } = hook; + const { tenant_id, enabled, synchronous, ...rest } = hook; return removeNullProperties({ ...rest, enabled: !!enabled, + synchronous: !!synchronous, }); });