@wenlarge/communication 1.0.1 → 1.0.2

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.
@@ -3,5 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseUserFromMetadata = parseUserFromMetadata;
4
4
  function parseUserFromMetadata(metadata) {
5
5
  const raw = metadata.get('user')[0];
6
- return typeof raw === 'string' ? JSON.parse(raw) : null;
6
+ if (!raw || typeof raw !== 'string')
7
+ return null;
8
+ try {
9
+ const decoded = Buffer.from(raw, 'base64').toString('utf8');
10
+ return JSON.parse(decoded);
11
+ }
12
+ catch (_a) {
13
+ return null;
14
+ }
7
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenlarge/communication",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,7 +39,8 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@nestjs/microservices": "^11.1.0",
42
+ "@types/node": "^24.9.1",
42
43
  "ts-proto": "^1.152.2",
43
44
  "typescript": "^5.0.0"
44
45
  }
45
- }
46
+ }