ts-game-decorators 1.0.3 → 1.0.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.
- package/dist/index.d.ts +13 -0
- package/dist/index.js +35 -0
- package/dist/middleware/auth.js +1 -2
- package/dist/utils/utils.js +1 -2
- package/package.json +6 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './decorators/autoRouter';
|
|
2
|
+
export * from './decorators/socketDecorators';
|
|
3
|
+
export * from './decorators/initServer';
|
|
4
|
+
export * from './middleware/auth';
|
|
5
|
+
export * from './db/couchbaseClient';
|
|
6
|
+
export * from './db/lowdbClient';
|
|
7
|
+
export * from './config/redis';
|
|
8
|
+
export * from './utils/collisionDetector';
|
|
9
|
+
export * from './utils/discordConnector';
|
|
10
|
+
export * from './utils/teleConnector';
|
|
11
|
+
export * from './utils/utils';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './types/map';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Decorators
|
|
18
|
+
__exportStar(require("./decorators/autoRouter"), exports);
|
|
19
|
+
__exportStar(require("./decorators/socketDecorators"), exports);
|
|
20
|
+
__exportStar(require("./decorators/initServer"), exports);
|
|
21
|
+
// Middleware
|
|
22
|
+
__exportStar(require("./middleware/auth"), exports);
|
|
23
|
+
// DB
|
|
24
|
+
__exportStar(require("./db/couchbaseClient"), exports);
|
|
25
|
+
__exportStar(require("./db/lowdbClient"), exports);
|
|
26
|
+
// Redis
|
|
27
|
+
__exportStar(require("./config/redis"), exports);
|
|
28
|
+
// Utils
|
|
29
|
+
__exportStar(require("./utils/collisionDetector"), exports);
|
|
30
|
+
__exportStar(require("./utils/discordConnector"), exports);
|
|
31
|
+
__exportStar(require("./utils/teleConnector"), exports);
|
|
32
|
+
__exportStar(require("./utils/utils"), exports);
|
|
33
|
+
// Types
|
|
34
|
+
__exportStar(require("./types"), exports);
|
|
35
|
+
__exportStar(require("./types/map"), exports);
|
package/dist/middleware/auth.js
CHANGED
|
@@ -38,7 +38,6 @@ const authSocketToken = (socket, next) => {
|
|
|
38
38
|
console.log('🔐 Socket authentication middleware triggered for socket:', socket.id);
|
|
39
39
|
try {
|
|
40
40
|
var token = socket.handshake.auth.token;
|
|
41
|
-
console.log(socket.handshake);
|
|
42
41
|
console.log(`🔑 Socket authentication token: ${token ? 'Present' : 'Missing'}`);
|
|
43
42
|
// Temporarily allow connections without token for debugging
|
|
44
43
|
if (!token) {
|
|
@@ -51,7 +50,7 @@ const authSocketToken = (socket, next) => {
|
|
|
51
50
|
next();
|
|
52
51
|
}
|
|
53
52
|
catch (error) {
|
|
54
|
-
console.error('❌ Socket authentication error
|
|
53
|
+
console.error('❌ Socket authentication error!');
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
exports.authSocketToken = authSocketToken;
|
package/dist/utils/utils.js
CHANGED
|
@@ -22,9 +22,8 @@ exports.utils = {
|
|
|
22
22
|
return decoded;
|
|
23
23
|
}
|
|
24
24
|
catch (error) {
|
|
25
|
-
console.error('❌ JWT verification failed
|
|
25
|
+
console.error('❌ JWT verification failed!');
|
|
26
26
|
console.error('🔍 Token preview:', token.substring(0, 50) + '...');
|
|
27
|
-
console.error('🔍 Secret being used:', secret.substring(0, 10) + '...');
|
|
28
27
|
throw error;
|
|
29
28
|
}
|
|
30
29
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-game-decorators",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Express & Socket.IO decorators for auto routing and event handling. using for backend game development.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,11 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"express": "^4.18.2",
|
|
26
26
|
"socket.io": "^4.7.4",
|
|
27
|
-
"reflect-metadata": "^0.1.13"
|
|
27
|
+
"reflect-metadata": "^0.1.13",
|
|
28
|
+
"redis": "^4.6.7",
|
|
29
|
+
"@socket.io/redis-adapter": "^8.2.0",
|
|
30
|
+
"lowdb": "^6.0.1",
|
|
31
|
+
"couchbase": "^4.2.5"
|
|
28
32
|
},
|
|
29
33
|
"devDependencies": {
|
|
30
34
|
"typescript": "^5.0.0"
|