@teamvortexsoftware/vortex-fastify-5-sdk 0.2.0 → 0.3.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/README.md +6 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/handlers/jwt.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,6 +46,8 @@ configureVortex({
|
|
|
46
46
|
? {
|
|
47
47
|
userId: user.id,
|
|
48
48
|
userEmail: user.email,
|
|
49
|
+
userName: user.userName, // Optional: user's display name
|
|
50
|
+
userAvatarUrl: user.userAvatarUrl, // Optional: user's avatar URL
|
|
49
51
|
adminScopes: user.isAdmin ? ['autojoin'] : [], // Optional: grant admin capabilities
|
|
50
52
|
}
|
|
51
53
|
: null;
|
|
@@ -158,6 +160,8 @@ configureVortex({
|
|
|
158
160
|
? {
|
|
159
161
|
userId: user.id,
|
|
160
162
|
userEmail: user.email,
|
|
163
|
+
userName: user.userName, // Optional: user's display name
|
|
164
|
+
userAvatarUrl: user.userAvatarUrl, // Optional: user's avatar URL
|
|
161
165
|
adminScopes: user.isAdmin ? ['autojoin'] : [], // Optional: grant admin capabilities
|
|
162
166
|
}
|
|
163
167
|
: null;
|
|
@@ -209,6 +213,8 @@ configureVortexLazy(async () => ({
|
|
|
209
213
|
? {
|
|
210
214
|
userId: user.id,
|
|
211
215
|
userEmail: user.email,
|
|
216
|
+
userName: user.userName, // Optional: user's display name
|
|
217
|
+
userAvatarUrl: user.userAvatarUrl, // Optional: user's avatar URL
|
|
212
218
|
adminScopes: (await checkUserAdminStatus(user.id)) ? ['autojoin'] : [],
|
|
213
219
|
}
|
|
214
220
|
: null;
|
package/dist/config.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { FastifyRequest, FastifyReply } from 'fastify';
|
|
|
2
2
|
export interface AuthenticatedUser {
|
|
3
3
|
userId: string;
|
|
4
4
|
userEmail?: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
userName?: string;
|
|
6
|
+
userAvatarUrl?: string;
|
|
7
7
|
adminScopes?: string[];
|
|
8
8
|
identifiers?: {
|
|
9
9
|
type: 'email' | 'phone';
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAGvB,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3D,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAGD,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wB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ClD,2BAA2B,CAAC,EAAE,eAAe,CAAC;IAC9C,2BAA2B,CAAC,EAAE,eAAe,CAAC;IAC9C,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAQD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAY1D;AAED,wBAAgB,oBAAoB,CAAC,qBAAqB,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtH;AAED,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAKpF;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,CAwC7D;AAGD,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAczH;AAED;;;GAGG;AACH,wBAAgB,2BAA2B;;;;;;;;EAY1C"}
|
package/dist/handlers/jwt.js
CHANGED
|
@@ -79,7 +79,7 @@ function handleJwtGeneration(request, reply) {
|
|
|
79
79
|
return [2 /*return*/, (0, utils_1.createErrorResponse)(reply, 'Invalid user format: must provide userId and userEmail', 500)];
|
|
80
80
|
}
|
|
81
81
|
jwtParams = {
|
|
82
|
-
user: __assign(__assign(__assign({ id: authenticatedUser.userId, email: authenticatedUser.userEmail }, (authenticatedUser.
|
|
82
|
+
user: __assign(__assign(__assign({ id: authenticatedUser.userId, email: authenticatedUser.userEmail }, (authenticatedUser.userName && { userName: authenticatedUser.userName })), (authenticatedUser.userAvatarUrl && { userAvatarUrl: authenticatedUser.userAvatarUrl })), (authenticatedUser.adminScopes && authenticatedUser.adminScopes.length > 0 && {
|
|
83
83
|
adminScopes: authenticatedUser.adminScopes
|
|
84
84
|
})),
|
|
85
85
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@teamvortexsoftware/vortex-fastify-5-sdk",
|
|
3
3
|
"description": "Drop-in Fastify module for Vortex API integration",
|
|
4
4
|
"author": "@teamvortexsoftware",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript-eslint": "8.50.1"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@teamvortexsoftware/vortex-node-22-sdk": "^0.
|
|
41
|
+
"@teamvortexsoftware/vortex-node-22-sdk": "^0.6.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"fastify": ">=5.0.0"
|