@voyantjs/auth 0.3.0 → 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/workspace.d.ts +46 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +130 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +7 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { getDb } from "@voyantjs/db";
|
|
2
|
+
type WorkspaceDb = ReturnType<typeof getDb>;
|
|
3
|
+
export type WorkspaceOrganization = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
logo?: string | null;
|
|
8
|
+
};
|
|
9
|
+
export type CurrentWorkspace = {
|
|
10
|
+
organizations: WorkspaceOrganization[];
|
|
11
|
+
activeOrganization: WorkspaceOrganization | null;
|
|
12
|
+
};
|
|
13
|
+
export type CurrentUser = {
|
|
14
|
+
id: string;
|
|
15
|
+
email: string;
|
|
16
|
+
firstName: string | null;
|
|
17
|
+
lastName: string | null;
|
|
18
|
+
isSuperAdmin: boolean;
|
|
19
|
+
isSupportUser: boolean;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
profilePictureUrl?: string | null;
|
|
22
|
+
activeOrganizationId?: string | null;
|
|
23
|
+
};
|
|
24
|
+
export type AuthStatus = {
|
|
25
|
+
userExists: boolean;
|
|
26
|
+
authenticated: boolean;
|
|
27
|
+
reason?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function listWorkspaceOrganizations(db: WorkspaceDb, userId: string): Promise<WorkspaceOrganization[]>;
|
|
30
|
+
export declare function getCurrentWorkspace(db: WorkspaceDb, input: {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
userId: string;
|
|
33
|
+
activeOrganizationId: string | null;
|
|
34
|
+
}): Promise<CurrentWorkspace>;
|
|
35
|
+
export declare function setActiveWorkspaceOrganization(db: WorkspaceDb, input: {
|
|
36
|
+
sessionId: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
organizationId: string;
|
|
39
|
+
}): Promise<CurrentWorkspace | null>;
|
|
40
|
+
export declare function getCurrentUser(db: WorkspaceDb, input: {
|
|
41
|
+
userId: string;
|
|
42
|
+
activeOrganizationId: string | null;
|
|
43
|
+
}): Promise<CurrentUser | null>;
|
|
44
|
+
export declare function ensureCurrentUserProfile(db: WorkspaceDb, userId: string): Promise<AuthStatus>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAUzC,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAA;AAE3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,qBAAqB,EAAE,CAAA;IACtC,kBAAkB,EAAE,qBAAqB,GAAG,IAAI,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,0BAA0B,CAC9C,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAYlC;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,WAAW,EACf,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC,GACA,OAAO,CAAC,gBAAgB,CAAC,CA6B3B;AAED,wBAAsB,8BAA8B,CAClD,EAAE,EAAE,WAAW,EACf,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACvB,GACA,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAwBlC;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,WAAW,EACf,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC,GACA,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgC7B;AAED,wBAAsB,wBAAwB,CAC5C,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,CA6CrB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { authMember, authOrganization, authSession, authUser, userProfilesTable, } from "@voyantjs/db/schema/iam";
|
|
2
|
+
import { and, asc, eq } from "drizzle-orm";
|
|
3
|
+
export async function listWorkspaceOrganizations(db, userId) {
|
|
4
|
+
return db
|
|
5
|
+
.select({
|
|
6
|
+
id: authOrganization.id,
|
|
7
|
+
name: authOrganization.name,
|
|
8
|
+
slug: authOrganization.slug,
|
|
9
|
+
logo: authOrganization.logo,
|
|
10
|
+
})
|
|
11
|
+
.from(authMember)
|
|
12
|
+
.innerJoin(authOrganization, eq(authOrganization.id, authMember.organizationId))
|
|
13
|
+
.where(eq(authMember.userId, userId))
|
|
14
|
+
.orderBy(asc(authOrganization.createdAt));
|
|
15
|
+
}
|
|
16
|
+
export async function getCurrentWorkspace(db, input) {
|
|
17
|
+
const organizations = await listWorkspaceOrganizations(db, input.userId);
|
|
18
|
+
if (organizations.length === 0) {
|
|
19
|
+
return {
|
|
20
|
+
organizations,
|
|
21
|
+
activeOrganization: null,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
let activeOrganizationId = organizations.find((organization) => organization.id === input.activeOrganizationId)?.id ?? null;
|
|
25
|
+
if (!activeOrganizationId) {
|
|
26
|
+
activeOrganizationId = organizations[0]?.id ?? null;
|
|
27
|
+
if (activeOrganizationId) {
|
|
28
|
+
await db
|
|
29
|
+
.update(authSession)
|
|
30
|
+
.set({ activeOrganizationId, updatedAt: new Date() })
|
|
31
|
+
.where(eq(authSession.id, input.sessionId));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
organizations,
|
|
36
|
+
activeOrganization: organizations.find((organization) => organization.id === activeOrganizationId) ?? null,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export async function setActiveWorkspaceOrganization(db, input) {
|
|
40
|
+
const [membership] = await db
|
|
41
|
+
.select({ id: authOrganization.id })
|
|
42
|
+
.from(authMember)
|
|
43
|
+
.innerJoin(authOrganization, eq(authOrganization.id, authMember.organizationId))
|
|
44
|
+
.where(and(eq(authMember.userId, input.userId), eq(authMember.organizationId, input.organizationId)))
|
|
45
|
+
.limit(1);
|
|
46
|
+
if (!membership) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
await db
|
|
50
|
+
.update(authSession)
|
|
51
|
+
.set({ activeOrganizationId: input.organizationId, updatedAt: new Date() })
|
|
52
|
+
.where(eq(authSession.id, input.sessionId));
|
|
53
|
+
return getCurrentWorkspace(db, {
|
|
54
|
+
sessionId: input.sessionId,
|
|
55
|
+
userId: input.userId,
|
|
56
|
+
activeOrganizationId: input.organizationId,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export async function getCurrentUser(db, input) {
|
|
60
|
+
const [row] = await db
|
|
61
|
+
.select({
|
|
62
|
+
id: authUser.id,
|
|
63
|
+
email: authUser.email,
|
|
64
|
+
createdAt: authUser.createdAt,
|
|
65
|
+
firstName: userProfilesTable.firstName,
|
|
66
|
+
lastName: userProfilesTable.lastName,
|
|
67
|
+
avatarUrl: userProfilesTable.avatarUrl,
|
|
68
|
+
isSuperAdmin: userProfilesTable.isSuperAdmin,
|
|
69
|
+
isSupportUser: userProfilesTable.isSupportUser,
|
|
70
|
+
})
|
|
71
|
+
.from(authUser)
|
|
72
|
+
.leftJoin(userProfilesTable, eq(userProfilesTable.id, authUser.id))
|
|
73
|
+
.where(eq(authUser.id, input.userId))
|
|
74
|
+
.limit(1);
|
|
75
|
+
if (!row) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
id: row.id,
|
|
80
|
+
email: row.email,
|
|
81
|
+
firstName: row.firstName ?? null,
|
|
82
|
+
lastName: row.lastName ?? null,
|
|
83
|
+
isSuperAdmin: row.isSuperAdmin ?? false,
|
|
84
|
+
isSupportUser: row.isSupportUser ?? false,
|
|
85
|
+
createdAt: row.createdAt?.toISOString() ?? new Date().toISOString(),
|
|
86
|
+
profilePictureUrl: row.avatarUrl ?? null,
|
|
87
|
+
activeOrganizationId: input.activeOrganizationId,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export async function ensureCurrentUserProfile(db, userId) {
|
|
91
|
+
try {
|
|
92
|
+
const [existingProfile] = await db
|
|
93
|
+
.select({ id: userProfilesTable.id })
|
|
94
|
+
.from(userProfilesTable)
|
|
95
|
+
.where(eq(userProfilesTable.id, userId))
|
|
96
|
+
.limit(1);
|
|
97
|
+
if (existingProfile) {
|
|
98
|
+
return { userExists: true, authenticated: true };
|
|
99
|
+
}
|
|
100
|
+
const [user] = await db
|
|
101
|
+
.select({ name: authUser.name, email: authUser.email, image: authUser.image })
|
|
102
|
+
.from(authUser)
|
|
103
|
+
.where(eq(authUser.id, userId))
|
|
104
|
+
.limit(1);
|
|
105
|
+
if (!user?.email) {
|
|
106
|
+
return {
|
|
107
|
+
userExists: false,
|
|
108
|
+
authenticated: true,
|
|
109
|
+
reason: `No email found for user ${userId}.`,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const nameParts = user.name?.split(" ") ?? [];
|
|
113
|
+
const firstName = nameParts[0] ?? null;
|
|
114
|
+
const lastName = nameParts.length > 1 ? nameParts.slice(1).join(" ") : null;
|
|
115
|
+
await db
|
|
116
|
+
.insert(userProfilesTable)
|
|
117
|
+
.values({ id: userId, firstName, lastName, avatarUrl: user.image ?? null })
|
|
118
|
+
.onConflictDoNothing();
|
|
119
|
+
return { userExists: true, authenticated: true };
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
123
|
+
return {
|
|
124
|
+
userExists: false,
|
|
125
|
+
authenticated: true,
|
|
126
|
+
reason: `Provisioning error: ${message}`,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAkC1C,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,EAAe,EACf,MAAc;IA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AC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAE3E,MAAM,EAAE;aACL,MAAM,CAAC,iBAAiB,CAAC;aACzB,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;aAC1E,mBAAmB,EAAE,CAAA;QAExB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAEtE,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,uBAAuB,OAAO,EAAE;SACzC,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/auth",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"types": "./dist/backend.d.ts",
|
|
29
29
|
"import": "./dist/backend.js"
|
|
30
30
|
},
|
|
31
|
+
"./workspace": {
|
|
32
|
+
"types": "./dist/workspace.d.ts",
|
|
33
|
+
"import": "./dist/workspace.js"
|
|
34
|
+
},
|
|
31
35
|
"./permissions": {
|
|
32
36
|
"types": "./dist/permissions.d.ts",
|
|
33
37
|
"import": "./dist/permissions.js"
|
|
@@ -43,8 +47,8 @@
|
|
|
43
47
|
"@better-auth/api-key": "^1.5.6",
|
|
44
48
|
"better-auth": "^1.5.6",
|
|
45
49
|
"drizzle-orm": "^0.45.2",
|
|
46
|
-
"@voyantjs/db": "0.3.
|
|
47
|
-
"@voyantjs/utils": "0.3.
|
|
50
|
+
"@voyantjs/db": "0.3.1",
|
|
51
|
+
"@voyantjs/utils": "0.3.1"
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@types/node": "25.5.2",
|