Skip to content

Commit b0ca780

Browse files
committed
Fix update metrix and api get nodes
1 parent 96b8aa6 commit b0ca780

6 files changed

Lines changed: 21 additions & 9 deletions

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2825,12 +2825,22 @@ export class Message {
28252825
msg.metadata = Config.db.ensureResource(msg.metadata);
28262826
if (!NoderedUtil.hasAuthorization(user, msg.metadata, Rights.create)) { throw new Error("Access denied, no authorization to save file"); }
28272827
msg.id = await this._SaveFile(readable, msg.filename, msg.mimeType, msg.metadata);
2828+
msg.result = await Config.db.getbyid(msg.id, "fs.files", msg.jwt, null);
2829+
if (NoderedUtil.IsNullUndefinded(msg.result)) {
2830+
await this.sleep(1000);
2831+
msg.result = await Config.db.getbyid(msg.id, "fs.files", msg.jwt, null);
2832+
}
2833+
if (NoderedUtil.IsNullUndefinded(msg.result)) {
2834+
await this.sleep(1000);
2835+
msg.result = await Config.db.getbyid(msg.id, "fs.files", msg.jwt, null);
2836+
}
28282837
} catch (error) {
28292838
if (NoderedUtil.IsNullUndefinded(msg)) { (msg as any) = {}; }
28302839
if (msg !== null && msg !== undefined) msg.error = error.message ? error.message : error;
28312840
await handleError(cli, error);
28322841
}
28332842
try {
2843+
delete msg.file;
28342844
this.data = JSON.stringify(msg);
28352845
} catch (error) {
28362846
this.data = "";

OpenFlowNodeRED/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.3.53",
3+
"version": "1.3.54",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@nodemailer/mailparser2": "^1.0.3",
28-
"@openiap/openflow-api": "^1.0.108",
28+
"@openiap/openflow-api": "^1.0.109",
2929
"@opentelemetry/api": "1.0.0-rc.3",
3030
"@opentelemetry/core": "0.19.0",
3131
"@opentelemetry/exporter-collector-grpc": "0.19.0",

OpenFlowNodeRED/src/nodered/nodes/api_nodes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ export interface Iuploadload_file {
11701170
mimeType: string;
11711171
name: string;
11721172
content: string;
1173+
entity: string;
11731174
}
11741175
export class upload_file {
11751176
public node: Red = null;
@@ -1196,9 +1197,8 @@ export class upload_file {
11961197
const file = await NoderedUtil.SaveFile(filename, mimeType, msg.metadata, filecontent, jwt, priority);
11971198
if (!NoderedUtil.IsNullEmpty(file.error)) { throw new Error(file.error); }
11981199

1199-
if (!NoderedUtil.IsNullEmpty(this.config.filename)) Util.SetMessageProperty(msg, this.config.filename, file.filename);
1200-
if (!NoderedUtil.IsNullEmpty(this.config.mimeType)) Util.SetMessageProperty(msg, this.config.mimeType, file.mimeType);
1201-
if (!NoderedUtil.IsNullEmpty(this.config.content)) Util.SetMessageProperty(msg, this.config.content, file);
1200+
Util.SetMessageProperty(msg, this.config.entity, file.result);
1201+
12021202
this.node.send(msg);
12031203
this.node.status({});
12041204
} catch (error) {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.53
1+
1.3.54

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.3.53",
3+
"version": "1.3.54",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {
@@ -32,7 +32,7 @@
3232
},
3333
"dependencies": {
3434
"@kubernetes/client-node": "0.14.3",
35-
"@openiap/openflow-api": "^1.0.108",
35+
"@openiap/openflow-api": "^1.0.109",
3636
"@opentelemetry/api": "1.0.0-rc.3",
3737
"@opentelemetry/core": "0.19.0",
3838
"@opentelemetry/exporter-collector-grpc": "0.19.0",

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ Test it in a single user installation [here](https://app.openiap.io/)
77
Join rocket chat [#openrpa](https://rocket.openiap.io/)
88
or check out the [community forum](https://nn.openiap.io/)
99

10-
Installation guides and light documentation at [openflow.openiap.io](https://openflow.openiap.io/) and [docs.openiap.io](https://docs.openiap.io)
10+
Installation guides and light documentation at [openflow.openiap.io](https://openflow.openiap.io/)
11+
12+
Example and documentation at [docs.openiap.io](https://docs.openiap.io)

0 commit comments

Comments
 (0)