@ejfdelgado/ejflab-back 1.16.4 → 1.16.5
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.16.
|
3
|
+
"version": "1.16.5",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/ejfdelgado/ejflab-back.git"
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"license": "ISC",
|
19
19
|
"private": false,
|
20
20
|
"dependencies": {
|
21
|
-
"@ejfdelgado/ejflab-common": "1.10.
|
21
|
+
"@ejfdelgado/ejflab-common": "1.10.3",
|
22
22
|
"@google-cloud/compute": "^4.7.0",
|
23
23
|
"@google-cloud/firestore": "^7.9.0",
|
24
24
|
"@google-cloud/storage": "^7.11.3",
|
@@ -6,7 +6,7 @@ export class ProcessResponseProcessor extends GenericProcessor {
|
|
6
6
|
super(context, io, socket);
|
7
7
|
}
|
8
8
|
async execute(args) {
|
9
|
-
const { processorId, id, data } = args;
|
9
|
+
const { processorId, id, data, inputs } = args;
|
10
10
|
let room = "";
|
11
11
|
if (args.room) {
|
12
12
|
room = args.room;
|
@@ -67,6 +67,13 @@ export class ProcessResponseProcessor extends GenericProcessor {
|
|
67
67
|
//return;
|
68
68
|
}
|
69
69
|
|
70
|
+
let isIndexed = false;
|
71
|
+
let indexN = null;
|
72
|
+
if (inputs instanceof Array && inputs.length > 0 && typeof inputs[0] == "number") {
|
73
|
+
isIndexed = true;
|
74
|
+
indexN = inputs[0];
|
75
|
+
}
|
76
|
+
|
70
77
|
roomData.model.data = instance.getData();
|
71
78
|
let countLocalChanges = 0;
|
72
79
|
if (!!outputConnectionsConf) {
|
@@ -82,10 +89,15 @@ export class ProcessResponseProcessor extends GenericProcessor {
|
|
82
89
|
return;
|
83
90
|
}
|
84
91
|
if (!outputParts[4]) {
|
92
|
+
// Byte case
|
85
93
|
const processorIdLocal = outputParts[2];
|
86
94
|
const sourcePath = outputParts[3];
|
87
|
-
|
88
|
-
|
95
|
+
let sourcePathIndexed = sourcePath;
|
96
|
+
if (isIndexed) {
|
97
|
+
sourcePathIndexed = sourcePathIndexed + "." + indexN;
|
98
|
+
}
|
99
|
+
instance.saveBufferData(processorIdLocal, sourcePathIndexed, dataLocal);
|
100
|
+
// Publish to others the not indexed?
|
89
101
|
const destiny = `${room}.${output}`;
|
90
102
|
//console.log(`Publishing to ${destiny} ok?`);
|
91
103
|
this.io.to(destiny).emit("processResponse", {
|
@@ -94,11 +106,16 @@ export class ProcessResponseProcessor extends GenericProcessor {
|
|
94
106
|
data: dataLocal
|
95
107
|
});
|
96
108
|
} else {
|
109
|
+
// Json case
|
97
110
|
// Affect the model in the given point
|
98
111
|
const path = outputParts[4];
|
99
|
-
|
112
|
+
let pathIndexed = path;
|
113
|
+
if (isIndexed) {
|
114
|
+
pathIndexed = pathIndexed + "." + indexN;
|
115
|
+
}
|
116
|
+
SimpleObj.recreate(roomData.model.data, pathIndexed, dataLocal);
|
100
117
|
countLocalChanges++;
|
101
|
-
// Publish to others
|
118
|
+
// Publish to others the not indexed one?
|
102
119
|
const destiny = `${room}.d.${path}`;
|
103
120
|
//console.log(`Publishing to ${destiny} ok?`);
|
104
121
|
this.io.to(destiny).emit("processResponse", {
|