@mesob/auth-hono 0.2.5 → 0.3.1
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/dist/{index-ULpI-i0z.d.ts → index-Bh3bDnP5.d.ts} +539 -496
- package/dist/{index-DCxsFKQ2.d.ts → index-BvdbhtRX.d.ts} +8 -12
- package/dist/index.d.ts +5 -4
- package/dist/index.js +423 -268
- package/dist/index.js.map +1 -1
- package/dist/lib/cleanup.d.ts +1 -1
- package/dist/lib/cleanup.js +121 -103
- package/dist/lib/cleanup.js.map +1 -1
- package/dist/lib/cookie.d.ts +2 -2
- package/dist/lib/has-role-permission.d.ts +18 -0
- package/dist/lib/has-role-permission.js +40 -0
- package/dist/lib/has-role-permission.js.map +1 -0
- package/dist/lib/normalize-user.d.ts +5 -9
- package/dist/lib/normalize-user.js +5 -10
- package/dist/lib/normalize-user.js.map +1 -1
- package/dist/lib/openapi-config.d.ts +2 -2
- package/dist/lib/phone-validation.d.ts +2 -2
- package/dist/lib/session.d.ts +2 -2
- package/dist/lib/tenant.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { U as User } from '../index-
|
|
1
|
+
import { U as User } from '../index-BvdbhtRX.js';
|
|
2
2
|
import 'hono';
|
|
3
3
|
import '@hono/zod-openapi';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-Bh3bDnP5.js';
|
|
5
5
|
import 'drizzle-orm/node-postgres';
|
|
6
6
|
import 'drizzle-orm/pg-core';
|
|
7
7
|
import 'drizzle-orm';
|
|
8
8
|
import 'pg';
|
|
9
9
|
|
|
10
10
|
declare const normalizeUser: (user: User) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
description: string;
|
|
14
|
-
id: string;
|
|
15
|
-
roleId: string;
|
|
16
|
-
code: string;
|
|
17
|
-
}[] | null;
|
|
11
|
+
roles: string[] | null;
|
|
12
|
+
roleCodes: string[] | null;
|
|
18
13
|
id: string;
|
|
19
14
|
tenantId: string;
|
|
20
15
|
fullName: string;
|
|
@@ -27,6 +22,7 @@ declare const normalizeUser: (user: User) => {
|
|
|
27
22
|
lastSignInAt: string | null;
|
|
28
23
|
bannedUntil?: string | null;
|
|
29
24
|
loginAttempt?: number;
|
|
25
|
+
permissions?: string[] | null;
|
|
30
26
|
};
|
|
31
27
|
|
|
32
28
|
export { normalizeUser };
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
// src/lib/normalize-user.ts
|
|
2
|
-
var normalizeUser = (user) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
name: typeof role.name === "string" ? role.name : "",
|
|
8
|
-
description: typeof role.description === "string" ? role.description : ""
|
|
9
|
-
})) : null
|
|
10
|
-
};
|
|
11
|
-
};
|
|
2
|
+
var normalizeUser = (user) => ({
|
|
3
|
+
...user,
|
|
4
|
+
roles: user.roles ?? null,
|
|
5
|
+
roleCodes: user.roleCodes ?? null
|
|
6
|
+
});
|
|
12
7
|
export {
|
|
13
8
|
normalizeUser
|
|
14
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/normalize-user.ts"],"sourcesContent":["import type { User } from '../types';\n\nexport const normalizeUser = (user: User) => {\n
|
|
1
|
+
{"version":3,"sources":["../../src/lib/normalize-user.ts"],"sourcesContent":["import type { User } from '../types';\n\nexport const normalizeUser = (user: User) => ({\n ...user,\n roles: user.roles ?? null,\n roleCodes: user.roleCodes ?? null,\n});\n"],"mappings":";AAEO,IAAM,gBAAgB,CAAC,UAAgB;AAAA,EAC5C,GAAG;AAAA,EACH,OAAO,KAAK,SAAS;AAAA,EACrB,WAAW,KAAK,aAAa;AAC/B;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AuthConfig } from '../index-
|
|
1
|
+
import { A as AuthConfig } from '../index-BvdbhtRX.js';
|
|
2
2
|
import 'hono';
|
|
3
3
|
import '@hono/zod-openapi';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-Bh3bDnP5.js';
|
|
5
5
|
import 'drizzle-orm/node-postgres';
|
|
6
6
|
import 'drizzle-orm/pg-core';
|
|
7
7
|
import 'drizzle-orm';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AuthConfig } from '../index-
|
|
1
|
+
import { A as AuthConfig } from '../index-BvdbhtRX.js';
|
|
2
2
|
import 'hono';
|
|
3
3
|
import '@hono/zod-openapi';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-Bh3bDnP5.js';
|
|
5
5
|
import 'drizzle-orm/node-postgres';
|
|
6
6
|
import 'drizzle-orm/pg-core';
|
|
7
7
|
import 'drizzle-orm';
|
package/dist/lib/session.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as SessionConfig } from '../index-
|
|
1
|
+
import { c as SessionConfig } from '../index-BvdbhtRX.js';
|
|
2
2
|
import 'hono';
|
|
3
3
|
import '@hono/zod-openapi';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-Bh3bDnP5.js';
|
|
5
5
|
import 'drizzle-orm/node-postgres';
|
|
6
6
|
import 'drizzle-orm/pg-core';
|
|
7
7
|
import 'drizzle-orm';
|
package/dist/lib/tenant.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AuthConfig } from '../index-
|
|
1
|
+
import { A as AuthConfig } from '../index-BvdbhtRX.js';
|
|
2
2
|
import 'hono';
|
|
3
3
|
import '@hono/zod-openapi';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-Bh3bDnP5.js';
|
|
5
5
|
import 'drizzle-orm/node-postgres';
|
|
6
6
|
import 'drizzle-orm/pg-core';
|
|
7
7
|
import 'drizzle-orm';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesob/auth-hono",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"pg": "^8.16.3",
|
|
33
33
|
"resend": "^4.8.0",
|
|
34
34
|
"zod": "^4.1.12",
|
|
35
|
-
"@mesob/common": "0.
|
|
35
|
+
"@mesob/common": "0.3.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jsonwebtoken": "^9.0.10",
|