@wenlarge/communication 1.0.0 → 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.
@@ -0,0 +1,2 @@
1
+ import { Metadata } from '@grpc/grpc-js';
2
+ export declare function parseUserFromMetadata(metadata: Metadata): any;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseUserFromMetadata = parseUserFromMetadata;
4
+ function parseUserFromMetadata(metadata) {
5
+ const raw = metadata.get('user')[0];
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
+ }
15
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './helpers/helper';
1
2
  export * as Auth from './generated/auth';
2
3
  export * from './config/auth-config';
3
4
  export * as Project from './generated/project';
package/dist/index.js CHANGED
@@ -15,6 +15,9 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
18
21
  var __importStar = (this && this.__importStar) || (function () {
19
22
  var ownKeys = function(o) {
20
23
  ownKeys = Object.getOwnPropertyNames || function (o) {
@@ -32,11 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
32
35
  return result;
33
36
  };
34
37
  })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Project = exports.Auth = void 0;
40
+ __exportStar(require("./helpers/helper"), exports);
40
41
  exports.Auth = __importStar(require("./generated/auth"));
41
42
  __exportStar(require("./config/auth-config"), exports);
42
43
  exports.Project = __importStar(require("./generated/project"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenlarge/communication",
3
- "version": "1.0.0",
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
+ }