@authhero/kysely-adapter 11.21.0 → 12.0.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.
- package/LICENSE +661 -21
- package/dist/kysely-adapter.cjs +1 -27
- package/dist/kysely-adapter.mjs +63 -112
- package/dist/types/migrate/migrations/index.d.ts +0 -2
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/dist/types/migrate/migrations/2026-07-16T16:00:00_restore_unique_phone_provider.d.ts +0 -29
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/markusahlstrand/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "
|
|
14
|
+
"version": "12.0.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"nanoid": "^5.1.11",
|
|
43
|
-
"@authhero/adapter-interfaces": "4.
|
|
44
|
-
"@authhero/proxy": "0.
|
|
43
|
+
"@authhero/adapter-interfaces": "4.3.0",
|
|
44
|
+
"@authhero/proxy": "0.10.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@hono/zod-openapi": "^1.4.0",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"kysely": "^0.29.0",
|
|
50
50
|
"kysely-planetscale": "^1.5.0"
|
|
51
51
|
},
|
|
52
|
+
"license": "AGPL-3.0-only",
|
|
52
53
|
"scripts": {
|
|
53
54
|
"build": "vite build && tsc -p tsconfig.types.json && rollup -c rollup.dts.config.mjs",
|
|
54
55
|
"test": "vitest run",
|
package/dist/types/migrate/migrations/2026-07-16T16:00:00_restore_unique_phone_provider.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Kysely } from "kysely";
|
|
2
|
-
import { Database } from "../../src/db";
|
|
3
|
-
/**
|
|
4
|
-
* Restore uniqueness on (phone_number, provider, tenant_id).
|
|
5
|
-
*
|
|
6
|
-
* `unique_phone_provider` has been declared on `users` since the very first
|
|
7
|
-
* migration (2022-12-11T09:17:35_init), as a table constraint. Production does
|
|
8
|
-
* not have it, so the baseline — snapshotted from production — doesn't either,
|
|
9
|
-
* and squashing onto that baseline silently dropped it.
|
|
10
|
-
*
|
|
11
|
-
* It is load-bearing rather than decorative: the management API returns 409 on
|
|
12
|
-
* a duplicate user by catching the unique violation (ER_DUP_ENTRY /
|
|
13
|
-
* SQLITE_CONSTRAINT_UNIQUE) that this raises. Without it, POST /api/v2/users
|
|
14
|
-
* with an already-registered phone number returns 201 and creates a second
|
|
15
|
-
* user, which is neither what Auth0 does nor what the adapter expects.
|
|
16
|
-
*
|
|
17
|
-
* Declared here as a unique INDEX rather than the original table constraint
|
|
18
|
-
* because a constraint cannot be added to an existing table on SQLite, and the
|
|
19
|
-
* two are equivalent for enforcement — MySQL implements a unique constraint as
|
|
20
|
-
* a unique index anyway. The name is kept so both engines agree.
|
|
21
|
-
*
|
|
22
|
-
* The dedupe below mirrors 2026-02-25T12:00:00_unique_username_provider, which
|
|
23
|
-
* faced the same problem for usernames: production may hold duplicate rows that
|
|
24
|
-
* the index would reject, so they have to go first or the DDL fails. On a fresh
|
|
25
|
-
* database (baseline, then this) there is nothing to dedupe and step 1 is a
|
|
26
|
-
* no-op.
|
|
27
|
-
*/
|
|
28
|
-
export declare function up(db: Kysely<Database>): Promise<void>;
|
|
29
|
-
export declare function down(db: Kysely<Database>): Promise<void>;
|