@mesob/auth-hono 0.5.3 → 0.5.4

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.
@@ -8,7 +8,7 @@ import 'drizzle-orm';
8
8
  import 'drizzle-orm/pg-core';
9
9
  import 'pg';
10
10
 
11
- declare const normalizeAuthUser: (user: Pick<User, "id" | "tenantId" | "fullName" | "email" | "phone" | "image" | "emailVerified" | "phoneVerified">) => {
11
+ declare const normalizeAuthUser: (user: Pick<User, "id" | "tenantId" | "fullName" | "email" | "phone" | "image" | "emailVerified" | "phoneVerified"> & Pick<Partial<User>, "roles" | "roleCodes" | "permissions">) => {
12
12
  id: string;
13
13
  tenantId: string;
14
14
  fullName: string;
@@ -17,6 +17,9 @@ declare const normalizeAuthUser: (user: Pick<User, "id" | "tenantId" | "fullName
17
17
  image: string | null;
18
18
  emailVerified: boolean;
19
19
  phoneVerified: boolean;
20
+ roles: string[] | null;
21
+ roleCodes: string[] | null;
22
+ permissions: string[] | null;
20
23
  };
21
24
  declare const normalizeAuthSession: (session: Pick<Session, "id" | "expiresAt"> | null) => {
22
25
  id: string;
@@ -7,7 +7,10 @@ var normalizeAuthUser = (user) => ({
7
7
  phone: user.phone,
8
8
  image: user.image,
9
9
  emailVerified: user.emailVerified,
10
- phoneVerified: user.phoneVerified
10
+ phoneVerified: user.phoneVerified,
11
+ roles: user.roles ?? null,
12
+ roleCodes: user.roleCodes ?? null,
13
+ permissions: user.permissions ?? null
11
14
  });
12
15
  var normalizeAuthSession = (session) => session ? {
13
16
  id: session.id,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/normalize-auth-response.ts"],"sourcesContent":["import type { Session, User } from '../types';\n\nexport const normalizeAuthUser = (\n user: Pick<\n User,\n | 'id'\n | 'tenantId'\n | 'fullName'\n | 'email'\n | 'phone'\n | 'image'\n | 'emailVerified'\n | 'phoneVerified'\n >,\n) => ({\n id: user.id,\n tenantId: user.tenantId,\n fullName: user.fullName,\n email: user.email,\n phone: user.phone,\n image: user.image,\n emailVerified: user.emailVerified,\n phoneVerified: user.phoneVerified,\n});\n\nexport const normalizeAuthSession = (\n session: Pick<Session, 'id' | 'expiresAt'> | null,\n) =>\n session\n ? {\n id: session.id,\n expiresAt: session.expiresAt,\n }\n : null;\n"],"mappings":";AAEO,IAAM,oBAAoB,CAC/B,UAWI;AAAA,EACJ,IAAI,KAAK;AAAA,EACT,UAAU,KAAK;AAAA,EACf,UAAU,KAAK;AAAA,EACf,OAAO,KAAK;AAAA,EACZ,OAAO,KAAK;AAAA,EACZ,OAAO,KAAK;AAAA,EACZ,eAAe,KAAK;AAAA,EACpB,eAAe,KAAK;AACtB;AAEO,IAAM,uBAAuB,CAClC,YAEA,UACI;AAAA,EACE,IAAI,QAAQ;AAAA,EACZ,WAAW,QAAQ;AACrB,IACA;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/normalize-auth-response.ts"],"sourcesContent":["import type { Session, User } from '../types';\n\nexport const normalizeAuthUser = (\n user: Pick<\n User,\n | 'id'\n | 'tenantId'\n | 'fullName'\n | 'email'\n | 'phone'\n | 'image'\n | 'emailVerified'\n | 'phoneVerified'\n > &\n Pick<Partial<User>, 'roles' | 'roleCodes' | 'permissions'>,\n) => ({\n id: user.id,\n tenantId: user.tenantId,\n fullName: user.fullName,\n email: user.email,\n phone: user.phone,\n image: user.image,\n emailVerified: user.emailVerified,\n phoneVerified: user.phoneVerified,\n roles: user.roles ?? null,\n roleCodes: user.roleCodes ?? null,\n permissions: user.permissions ?? null,\n});\n\nexport const normalizeAuthSession = (\n session: Pick<Session, 'id' | 'expiresAt'> | null,\n) =>\n session\n ? {\n id: session.id,\n expiresAt: session.expiresAt,\n }\n : null;\n"],"mappings":";AAEO,IAAM,oBAAoB,CAC/B,UAYI;AAAA,EACJ,IAAI,KAAK;AAAA,EACT,UAAU,KAAK;AAAA,EACf,UAAU,KAAK;AAAA,EACf,OAAO,KAAK;AAAA,EACZ,OAAO,KAAK;AAAA,EACZ,OAAO,KAAK;AAAA,EACZ,eAAe,KAAK;AAAA,EACpB,eAAe,KAAK;AAAA,EACpB,OAAO,KAAK,SAAS;AAAA,EACrB,WAAW,KAAK,aAAa;AAAA,EAC7B,aAAa,KAAK,eAAe;AACnC;AAEO,IAAM,uBAAuB,CAClC,YAEA,UACI;AAAA,EACE,IAAI,QAAQ;AAAA,EACZ,WAAW,QAAQ;AACrB,IACA;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesob/auth-hono",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "@hono/zod-openapi": "^1.2.0",
23
- "@mesob/common": "^0.5.3",
23
+ "@mesob/common": "^0.5.4",
24
24
  "@noble/hashes": "^2.0.1",
25
25
  "@scalar/hono-api-reference": "^0.9.22",
26
26
  "argon2-wasm-edge": "^1.0.23",