@gotillit/tillit-node-red 1.2.3 → 1.2.4
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/dist/nodes/node-routes.d.ts +1 -0
- package/dist/nodes/node-routes.js +72 -0
- package/dist/nodes/node-routes.js.map +1 -0
- package/dist/nodes/plugin.d.ts +1 -0
- package/dist/nodes/plugin.js +19 -0
- package/dist/nodes/plugin.js.map +1 -0
- package/dist/tillit-node.html +8 -0
- package/dist/tillit-node.js +2 -0
- package/dist/tillit-node.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildRoutes: (RED: any) => void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.buildRoutes = void 0;
|
|
43
|
+
var utils_1 = require("../shared/utils");
|
|
44
|
+
var got_1 = __importDefault(require("got"));
|
|
45
|
+
var buildRoutes = function (RED) {
|
|
46
|
+
var apiRoot = "/tillit";
|
|
47
|
+
RED.httpAdmin.get("".concat(apiRoot, "/:conn/:entity"), function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
+
var conn, entity, broker, environment, tenant, username, password, ops, url, response;
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
switch (_a.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
conn = req.params.conn;
|
|
53
|
+
entity = req.params.entity;
|
|
54
|
+
broker = RED.nodes.getNode(conn).broker;
|
|
55
|
+
environment = broker.environment, tenant = broker.tenant, username = broker.username, password = broker.password;
|
|
56
|
+
ops = {
|
|
57
|
+
method: 'GET',
|
|
58
|
+
username: username,
|
|
59
|
+
password: password
|
|
60
|
+
};
|
|
61
|
+
url = (0, utils_1.hostname)(environment, tenant) + "/api/core/".concat(entity, "?size=2000");
|
|
62
|
+
return [4 /*yield*/, (0, got_1.default)(url, ops)];
|
|
63
|
+
case 1:
|
|
64
|
+
response = _a.sent();
|
|
65
|
+
res.json(response.body);
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); });
|
|
70
|
+
};
|
|
71
|
+
exports.buildRoutes = buildRoutes;
|
|
72
|
+
//# sourceMappingURL=node-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-routes.js","sourceRoot":"","sources":["../../src/nodes/node-routes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAyC;AACzC,4CAAsB;AAEf,IAAM,WAAW,GAAG,UAAC,GAAQ;IAChC,IAAM,OAAO,GAAG,SAAS,CAAC;IAE1B,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,UAAG,OAAO,mBAAgB,EAAE,UAAO,GAAQ,EAAE,GAAQ;;;;;oBAC7D,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAA;oBACtB,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;oBAC3B,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;oBACvC,WAAW,GAAgC,MAAM,YAAtC,EAAE,MAAM,GAAwB,MAAM,OAA9B,EAAE,QAAQ,GAAc,MAAM,SAApB,EAAE,QAAQ,GAAI,MAAM,SAAV,CAAW;oBACrD,GAAG,GAAQ;wBACX,MAAM,EAAE,KAAK;wBACb,QAAQ,EAAE,QAAQ;wBAClB,QAAQ,EAAE,QAAQ;qBACrB,CAAA;oBACK,GAAG,GAAG,IAAA,gBAAQ,EAAC,WAAW,EAAE,MAAM,CAAC,GAAG,oBAAa,MAAM,eAAY,CAAC;oBAC3D,qBAAM,IAAA,aAAG,EAAC,GAAG,EAAE,GAAG,CAAC,EAAA;;oBAA9B,QAAQ,GAAG,SAAmB;oBACpC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;;;;SAC3B,CAAC,CAAC;AACP,CAAC,CAAA;AAjBY,QAAA,WAAW,eAiBvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildPlugin: (RED: any) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildPlugin = void 0;
|
|
4
|
+
var apiRoot = "/tillit";
|
|
5
|
+
var buildPlugin = function (RED) {
|
|
6
|
+
console.log('Registring plugin js');
|
|
7
|
+
RED.plugins.registerPlugin("node-red-tillit", {
|
|
8
|
+
settings: undefined,
|
|
9
|
+
type: '',
|
|
10
|
+
onadd: function () {
|
|
11
|
+
debugger;
|
|
12
|
+
RED.httpAdmin.get("".concat(apiRoot, "/event-types"), function (_, res) {
|
|
13
|
+
res.json([{ 'id': 1 }]);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.buildPlugin = buildPlugin;
|
|
19
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/nodes/plugin.ts"],"names":[],"mappings":";;;AAAA,IAAM,OAAO,GAAG,SAAS,CAAC;AAEnB,IAAM,WAAW,GAAG,UAAC,GAAQ;IAChC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;IACnC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE;QAC1C,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,EAAE;QACR,KAAK,EAAE;YACH,QAAQ,CAAA;YACR,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,UAAG,OAAO,iBAAc,EAAE,UAAC,CAAM,EAAE,GAAQ;gBACzD,GAAG,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAC;AAZW,QAAA,WAAW,eAYtB"}
|
package/dist/tillit-node.html
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
<script type="text/javascript">
|
|
3
|
+
console.log('Registring plugin html')
|
|
4
|
+
RED.plugins.registerPlugin("node-red-tillit", {
|
|
5
|
+
onadd: function() {
|
|
6
|
+
|
|
7
|
+
}})
|
|
8
|
+
</script>
|
|
9
|
+
|
|
2
10
|
<script type="text/x-red" data-template-name="tillit-node-connection">
|
|
3
11
|
<div class="form-row">
|
|
4
12
|
<label for="node-config-input-name"><i class="fa fa-globe"></i>Name</label>
|
package/dist/tillit-node.js
CHANGED
|
@@ -7,6 +7,7 @@ var node_broker_1 = require("./nodes/node-broker");
|
|
|
7
7
|
var node_pv_1 = require("./nodes/node-pv");
|
|
8
8
|
var node_event_1 = require("./nodes/node-event");
|
|
9
9
|
var node_progress_1 = require("./nodes/node-progress");
|
|
10
|
+
var node_routes_1 = require("./nodes/node-routes");
|
|
10
11
|
module.exports = function (RED) {
|
|
11
12
|
RED.nodes.registerType("tillit-node-connection", (0, node_broker_1.buildNodeBrokerFunction)(RED));
|
|
12
13
|
RED.nodes.registerType("tillit-api", (0, node_api_1.buildApiFunction)(RED));
|
|
@@ -15,5 +16,6 @@ module.exports = function (RED) {
|
|
|
15
16
|
RED.nodes.registerType("tillit-progress", (0, node_progress_1.buildNodeProgressFunction)(RED));
|
|
16
17
|
RED.nodes.registerType("tillit-in", (0, node_in_1.buildNodeInFunction)(RED));
|
|
17
18
|
RED.nodes.registerType("tillit-event", (0, node_event_1.buildEventFunction)(RED));
|
|
19
|
+
(0, node_routes_1.buildRoutes)(RED);
|
|
18
20
|
};
|
|
19
21
|
//# sourceMappingURL=tillit-node.js.map
|
package/dist/tillit-node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tillit-node.js","sourceRoot":"","sources":["../src/tillit-node.ts"],"names":[],"mappings":";;AAAA,6CAAkD;AAClD,6CAAsD;AACtD,2CAAoD;AACpD,mDAA4D;AAC5D,2CAAoD;AACpD,iDAAsD;AACtD,uDAAgE;
|
|
1
|
+
{"version":3,"file":"tillit-node.js","sourceRoot":"","sources":["../src/tillit-node.ts"],"names":[],"mappings":";;AAAA,6CAAkD;AAClD,6CAAsD;AACtD,2CAAoD;AACpD,mDAA4D;AAC5D,2CAAoD;AACpD,iDAAsD;AACtD,uDAAgE;AAChE,mDAAgD;AAEhD,MAAM,CAAC,OAAO,GAAG,UAAU,GAAQ;IAI/B,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,wBAAwB,EAAE,IAAA,qCAAuB,EAAC,GAAG,CAAC,CAAC,CAAC;IAC/E,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,IAAA,2BAAgB,EAAC,GAAG,CAAC,CAAC,CAAC;IAC5D,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,IAAA,+BAAoB,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,IAAA,6BAAmB,EAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,iBAAiB,EAAE,IAAA,yCAAyB,EAAC,GAAG,CAAC,CAAC,CAAC;IAC1E,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,IAAA,6BAAmB,EAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,IAAA,+BAAkB,EAAC,GAAG,CAAC,CAAC,CAAC;IAEhE,IAAA,yBAAW,EAAC,GAAG,CAAC,CAAC;AAErB,CAAC,CAAC"}
|