@routr/echo 2.0.5-alpha.2 → 2.0.5-alpha.3
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/runner.js +9 -5
- package/package.json +4 -3
- package/dist/processor.d.ts +0 -9
- package/dist/processor.js +0 -54
- package/dist/service.d.ts +0 -2
- package/dist/service.js +0 -27
- package/dist/types.d.ts +0 -3
- package/dist/types.js +0 -2
package/dist/runner.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/routr
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Routr
|
|
@@ -22,7 +22,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
* See the License for the specific language governing permissions and
|
|
23
23
|
* limitations under the License.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const logger_1 = __importDefault(require("@fonoster/logger"));
|
|
26
|
+
const processor_1 = __importDefault(require("@routr/processor"));
|
|
27
|
+
new processor_1.default({ bindAddr: "0.0.0.0:51904", name: "echo" })
|
|
28
|
+
.listen((request, response) => {
|
|
29
|
+
logger_1.default.verbose("got new request: ");
|
|
30
|
+
logger_1.default.verbose(JSON.stringify(request, null, ' '));
|
|
31
|
+
response.send(request);
|
|
32
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/echo",
|
|
3
|
-
"version": "2.0.5-alpha.
|
|
3
|
+
"version": "2.0.5-alpha.3",
|
|
4
4
|
"description": "Dummy implementation of a Processor service",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@fonoster/logger": "^0.3.3",
|
|
23
|
-
"@routr/common": "^2.0.5-alpha.
|
|
23
|
+
"@routr/common": "^2.0.5-alpha.3",
|
|
24
|
+
"@routr/processor": "^2.0.5-alpha.3"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
27
|
"dist"
|
|
@@ -35,5 +36,5 @@
|
|
|
35
36
|
"bugs": {
|
|
36
37
|
"url": "https://github.com/fonoster/routr/issues"
|
|
37
38
|
},
|
|
38
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "7d942466133a03f4bcfe0dc100f1a922b3ed14ad"
|
|
39
40
|
}
|
package/dist/processor.d.ts
DELETED
package/dist/processor.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.serviceInfo = exports.processMessage = void 0;
|
|
18
|
-
/*
|
|
19
|
-
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
20
|
-
* http://github.com/fonoster/routr
|
|
21
|
-
*
|
|
22
|
-
* This file is part of Routr
|
|
23
|
-
*
|
|
24
|
-
* Licensed under the MIT License (the "License")
|
|
25
|
-
* you may not use this file except in compliance with
|
|
26
|
-
* the License. You may obtain a copy of the License at
|
|
27
|
-
*
|
|
28
|
-
* https://opensource.org/licenses/MIT
|
|
29
|
-
*
|
|
30
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
31
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
32
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
-
* See the License for the specific language governing permissions and
|
|
34
|
-
* limitations under the License.
|
|
35
|
-
*/
|
|
36
|
-
var common_1 = require("@routr/common");
|
|
37
|
-
var logger_1 = __importDefault(require("@fonoster/logger"));
|
|
38
|
-
// This processor returns upstream the message received
|
|
39
|
-
function processMessage(call, callback) {
|
|
40
|
-
logger_1.default.verbose("got new request: ");
|
|
41
|
-
logger_1.default.verbose(JSON.stringify(call.request, null, ' '));
|
|
42
|
-
var response = {
|
|
43
|
-
request_type: call.request.request_type,
|
|
44
|
-
message: __assign({}, call.request.message)
|
|
45
|
-
};
|
|
46
|
-
callback(null, response);
|
|
47
|
-
}
|
|
48
|
-
exports.processMessage = processMessage;
|
|
49
|
-
exports.serviceInfo = {
|
|
50
|
-
name: "echo",
|
|
51
|
-
bindAddr: 'placeholder',
|
|
52
|
-
service: common_1.PROCESSOR_OBJECT_PROTO.Processor.service,
|
|
53
|
-
handlers: { processMessage: processMessage }
|
|
54
|
-
};
|
package/dist/service.d.ts
DELETED
package/dist/service.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
5
|
-
* http://github.com/fonoster/routr
|
|
6
|
-
*
|
|
7
|
-
* This file is part of Routr
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the MIT License (the "License")
|
|
10
|
-
* you may not use this file except in compliance with
|
|
11
|
-
* the License. You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* https://opensource.org/licenses/MIT
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
var common_1 = require("@routr/common");
|
|
22
|
-
var processor_1 = require("./processor");
|
|
23
|
-
function EchoProcessor(config) {
|
|
24
|
-
processor_1.serviceInfo.bindAddr = config.bindAddr;
|
|
25
|
-
common_1.createService(processor_1.serviceInfo);
|
|
26
|
-
}
|
|
27
|
-
exports.default = EchoProcessor;
|
package/dist/types.d.ts
DELETED
package/dist/types.js
DELETED