@betterportal/n8n-nodes-betterportal 0.0.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/BetterPortal.node.js +39 -0
- package/package.json +25 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { discover, actionChoices } = require("../shared/bp-client.js");
|
|
4
|
+
|
|
5
|
+
class BetterPortal {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: "BetterPortal",
|
|
9
|
+
name: "betterPortal",
|
|
10
|
+
group: ["transform"],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: "Discover BetterPortal services and actions",
|
|
13
|
+
defaults: { name: "BetterPortal" },
|
|
14
|
+
inputs: ["main"],
|
|
15
|
+
outputs: ["main"],
|
|
16
|
+
properties: [
|
|
17
|
+
{ displayName: "Tenant URL", name: "tenantUrl", type: "string", default: "", required: true },
|
|
18
|
+
{ displayName: "Config Manager URL", name: "configManagerUrl", type: "string", default: "" },
|
|
19
|
+
{ displayName: "API Key", name: "apiKey", type: "string", typeOptions: { password: true }, default: "" }
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async execute() {
|
|
25
|
+
const items = this.getInputData();
|
|
26
|
+
const output = [];
|
|
27
|
+
for (let i = 0; i < items.length; i++) {
|
|
28
|
+
const catalog = await discover({
|
|
29
|
+
tenantUrl: this.getNodeParameter("tenantUrl", i),
|
|
30
|
+
configManagerUrl: this.getNodeParameter("configManagerUrl", i),
|
|
31
|
+
apiKey: this.getNodeParameter("apiKey", i)
|
|
32
|
+
});
|
|
33
|
+
output.push({ json: { catalog, actions: actionChoices(catalog) } });
|
|
34
|
+
}
|
|
35
|
+
return [output];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = { BetterPortal };
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@betterportal/n8n-nodes-betterportal",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "n8n node for BetterPortal automation discovery.",
|
|
5
|
+
"main": "BetterPortal.node.js",
|
|
6
|
+
"n8n": {
|
|
7
|
+
"nodes": [
|
|
8
|
+
"BetterPortal.node.js"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"author": "BetterCorp",
|
|
12
|
+
"license": "(AGPL-3.0-only OR Commercial)",
|
|
13
|
+
"homepage": "https://github.com/BetterCorp/BetterPortal#readme",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/BetterCorp/BetterPortal.git",
|
|
17
|
+
"directory": "automations/n8n"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/BetterCorp/BetterPortal/issues"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
}
|
|
25
|
+
}
|