@ejfdelgado/ejflab-back 1.17.3 → 1.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-back",
3
- "version": "1.17.3",
3
+ "version": "1.18.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ejfdelgado/ejflab-back.git"
@@ -45,6 +45,7 @@ export class SocketIOCall {
45
45
  static mapFlowChartExec = {};
46
46
  static socketIdToSocket = {};
47
47
  static socketRoomUUIDMap = {};
48
+ static socketToImage = {};
48
49
 
49
50
  static echoLog(message) {
50
51
  console.log(message);
@@ -274,6 +275,9 @@ export class SocketIOCall {
274
275
  SocketIOCall.echoLog(`${socket.id} sends disconnect with ${JSON.stringify(payload)}`);
275
276
  new DisconnectProcessor(SocketIOCall, SocketIOCall.io, socket).executeSave(payload);
276
277
  SocketIOCall.disconnect(socket);
278
+ if (socket.id in SocketIOCall.socketToImage) {
279
+ delete SocketIOCall.socketToImage[socket.id];
280
+ }
277
281
  });
278
282
  /*
279
283
  socket.on("reconnect", (payload) => {
@@ -520,4 +524,12 @@ export class SocketIOCall {
520
524
  };
521
525
  res.status(200).send(response);
522
526
  }
527
+
528
+ static putSocketImage(socketId, bytes) {
529
+ SocketIOCall.socketToImage[socketId] = bytes;
530
+ }
531
+
532
+ static getSocketImage(socketId) {
533
+ return SocketIOCall.socketToImage[socketId];
534
+ }
523
535
  }
@@ -43,6 +43,18 @@ export class LoadFlowChartProcessor extends GenericProcessor {
43
43
  }
44
44
  }
45
45
 
46
+ static getFilteredEnv() {
47
+ const envClone = JSON.parse(JSON.stringify(process.env));
48
+ const envCloneKeys = Object.keys(envClone);
49
+ for (let i = 0; i < envCloneKeys.length; i++) {
50
+ const key = envCloneKeys[i];
51
+ if (/pass|secret|key/i.test(key)) {
52
+ delete envClone[key];
53
+ }
54
+ }
55
+ return envClone;
56
+ }
57
+
46
58
  async execute(args) {
47
59
  let {
48
60
  names,
@@ -102,7 +114,7 @@ export class LoadFlowChartProcessor extends GenericProcessor {
102
114
  }
103
115
 
104
116
  data['scope'] = { room, progress: 0 };
105
- data['env'] = JSON.parse(JSON.stringify(process.env));
117
+ data['env'] = LoadFlowChartProcessor.getFilteredEnv();
106
118
 
107
119
  // Leer el archivo y su data
108
120
  instance = new FlowChartExec();