@loopback/example-rpc-server 3.0.1 → 3.0.2
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/CHANGELOG.md +8 -0
- package/dist/__tests__/unit/controllers/greet.controller.unit.js +4 -4
- package/dist/__tests__/unit/controllers/greet.controller.unit.js.map +1 -1
- package/dist/__tests__/unit/rpc.router.unit.js +11 -11
- package/dist/__tests__/unit/rpc.router.unit.js.map +1 -1
- package/dist/controllers/index.js +1 -1
- package/dist/controllers/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/rpc.router.js +1 -1
- package/dist/rpc.router.js.map +1 -1
- package/dist/rpc.server.js +9 -9
- package/dist/rpc.server.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.2](https://github.com/loopbackio/loopback-next/compare/@loopback/example-rpc-server@3.0.1...@loopback/example-rpc-server@3.0.2) (2021-10-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/example-rpc-server
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [3.0.1](https://github.com/loopbackio/loopback-next/compare/@loopback/example-rpc-server@3.0.0...@loopback/example-rpc-server@3.0.1) (2021-09-16)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @loopback/example-rpc-server
|
|
@@ -10,14 +10,14 @@ describe('greet.controller', () => {
|
|
|
10
10
|
const controller = new controllers_1.GreetController();
|
|
11
11
|
describe('basicHello', () => {
|
|
12
12
|
it('returns greetings for the world without valid input', () => {
|
|
13
|
-
testlab_1.expect(controller.basicHello({})).to.equal('Hello, World!');
|
|
13
|
+
(0, testlab_1.expect)(controller.basicHello({})).to.equal('Hello, World!');
|
|
14
14
|
});
|
|
15
15
|
it('returns greetings for a name', () => {
|
|
16
16
|
const input = {
|
|
17
17
|
name: 'Aaron',
|
|
18
18
|
};
|
|
19
19
|
const expected = `Hello, ${input.name}!`;
|
|
20
|
-
testlab_1.expect(controller.basicHello(input)).to.equal(expected);
|
|
20
|
+
(0, testlab_1.expect)(controller.basicHello(input)).to.equal(expected);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
describe('hobbyHello', () => {
|
|
@@ -25,14 +25,14 @@ describe('greet.controller', () => {
|
|
|
25
25
|
const input = {
|
|
26
26
|
name: 'Aaron',
|
|
27
27
|
};
|
|
28
|
-
testlab_1.expect(controller.hobbyHello(input)).to.match(/Hello, Aaron!(.*)underwater basket weaving/);
|
|
28
|
+
(0, testlab_1.expect)(controller.hobbyHello(input)).to.match(/Hello, Aaron!(.*)underwater basket weaving/);
|
|
29
29
|
});
|
|
30
30
|
it('returns greetings for a name and hobby', () => {
|
|
31
31
|
const input = {
|
|
32
32
|
name: 'Aaron',
|
|
33
33
|
hobby: 'sportsball',
|
|
34
34
|
};
|
|
35
|
-
testlab_1.expect(controller.hobbyHello(input)).to.match(/Hello, Aaron!(.*)sportsball/);
|
|
35
|
+
(0, testlab_1.expect)(controller.hobbyHello(input)).to.match(/Hello, Aaron!(.*)sportsball/);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"greet.controller.unit.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/controllers/greet.controller.unit.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;AAEhE,sDAAqD;AACrD,+CAAyC;AAEzC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,UAAU,GAAG,IAAI,6BAAe,EAAE,CAA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CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,KAAK,GAAG;gBACZ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,YAAY;aACpB,CAAC;YACF,IAAA,gBAAM,EAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAC3C,6BAA6B,CAC9B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -16,17 +16,17 @@ describe('rpcRouter', () => {
|
|
|
16
16
|
let responseStub;
|
|
17
17
|
beforeEach(testSetup);
|
|
18
18
|
it('routes correctly when controller and method exist', async () => {
|
|
19
|
-
await rpc_router_1.routeHandler(server, request, response);
|
|
19
|
+
await (0, rpc_router_1.routeHandler)(server, request, response);
|
|
20
20
|
testlab_1.sinon.assert.called(responseStub);
|
|
21
|
-
testlab_1.expect(responseStub.firstCall.args[0]).to.match(/Hello, Janet!/);
|
|
21
|
+
(0, testlab_1.expect)(responseStub.firstCall.args[0]).to.match(/Hello, Janet!/);
|
|
22
22
|
});
|
|
23
23
|
it('throws 400 when controller does not exist', async () => {
|
|
24
24
|
const getStub = server.get;
|
|
25
25
|
getStub.rejects(new Error('Does not exist!'));
|
|
26
|
-
await rpc_router_1.routeHandler(server, request, response);
|
|
27
|
-
testlab_1.expect(response.statusCode).to.equal(400);
|
|
26
|
+
await (0, rpc_router_1.routeHandler)(server, request, response);
|
|
27
|
+
(0, testlab_1.expect)(response.statusCode).to.equal(400);
|
|
28
28
|
testlab_1.sinon.assert.called(responseStub);
|
|
29
|
-
testlab_1.expect(responseStub.firstCall.args[0]).to.match(/Does not exist!/);
|
|
29
|
+
(0, testlab_1.expect)(responseStub.firstCall.args[0]).to.match(/Does not exist!/);
|
|
30
30
|
});
|
|
31
31
|
it('throws 400 when method does not exist', async () => {
|
|
32
32
|
request = getRequest({
|
|
@@ -38,10 +38,10 @@ describe('rpcRouter', () => {
|
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
|
-
await rpc_router_1.routeHandler(server, request, response);
|
|
42
|
-
testlab_1.expect(response.statusCode).to.equal(400);
|
|
41
|
+
await (0, rpc_router_1.routeHandler)(server, request, response);
|
|
42
|
+
(0, testlab_1.expect)(response.statusCode).to.equal(400);
|
|
43
43
|
testlab_1.sinon.assert.called(responseStub);
|
|
44
|
-
testlab_1.expect(responseStub.firstCall.args[0]).to.match(/No method was found on controller/);
|
|
44
|
+
(0, testlab_1.expect)(responseStub.firstCall.args[0]).to.match(/No method was found on controller/);
|
|
45
45
|
});
|
|
46
46
|
it('throws 500 on unhandled error', async () => {
|
|
47
47
|
class ControllerThrowingError extends FakeController {
|
|
@@ -51,10 +51,10 @@ describe('rpcRouter', () => {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
server.get.resolves(new ControllerThrowingError());
|
|
54
|
-
await rpc_router_1.routeHandler(server, request, response);
|
|
55
|
-
testlab_1.expect(response.statusCode).to.equal(500);
|
|
54
|
+
await (0, rpc_router_1.routeHandler)(server, request, response);
|
|
55
|
+
(0, testlab_1.expect)(response.statusCode).to.equal(500);
|
|
56
56
|
testlab_1.sinon.assert.called(responseStub);
|
|
57
|
-
testlab_1.expect(responseStub.firstCall.args[0].message).to.match('>:(');
|
|
57
|
+
(0, testlab_1.expect)(responseStub.firstCall.args[0].message).to.match('>:(');
|
|
58
58
|
});
|
|
59
59
|
function testSetup() {
|
|
60
60
|
server = getServer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.router.unit.js","sourceRoot":"","sources":["../../../src/__tests__/unit/rpc.router.unit.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;AAEhE,+CAAgD;AAEhD,iDAA8C;AAC9C,iDAA2C;AAE3C,QAAQ,CAAC,WAAW,EAAE,GAAG,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AC;IAED,MAAM,cAAc;QAClB,8DAA8D;QAC9D,MAAM,CAAC,KAAU;YACf,OAAO,UAAU,KAAK,CAAC,IAAI,GAAG,CAAC;QACjC,CAAC;KACF;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
tslib_1.__exportStar(require("./greet.controller"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./greet.controller"), exports);
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controllers/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;AAEhE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controllers/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;AAEhE,kEAAmC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.main = void 0;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const application_1 = require("./application");
|
|
10
|
-
tslib_1.__exportStar(require("./application"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./application"), exports);
|
|
11
11
|
async function main(options = {}) {
|
|
12
12
|
const app = new application_1.MyApplication(options);
|
|
13
13
|
await app.start();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAA+D;AAE/D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAA+D;AAE/D,6DAA8B;AAEvB,KAAK,UAAU,IAAI,CAAC,UAA6B,EAAE;IACxD,MAAM,GAAG,GAAG,IAAI,2BAAa,CAAC,OAAO,CAAC,CAAC;IAEvC,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,6BAA6B,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,OAAO,GAAG,CAAC;AACb,CAAC;AAND,oBAMC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAC3B,sBAAsB;IACtB,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;CACJ"}
|
package/dist/models/index.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
tslib_1.__exportStar(require("./person.model"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./person.model"), exports);
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;AAEhE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;AAEhE,8DAA+B"}
|
package/dist/rpc.router.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.routeHandler = exports.rpcRouter = void 0;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
|
-
const body_parser_1 = tslib_1.__importDefault(require("body-parser"));
|
|
9
|
+
const body_parser_1 = (0, tslib_1.__importDefault)(require("body-parser"));
|
|
10
10
|
function rpcRouter(server) {
|
|
11
11
|
const jsonParser = body_parser_1.default.json();
|
|
12
12
|
server.expressServer.post('*', jsonParser, async (request, response) => {
|
package/dist/rpc.router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.router.js","sourceRoot":"","sources":["../src/rpc.router.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,
|
|
1
|
+
{"version":3,"file":"rpc.router.js","sourceRoot":"","sources":["../src/rpc.router.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,2EAAiC;AAIjC,SAAgB,SAAS,CAAC,MAAiB;IACzC,MAAM,UAAU,GAAG,qBAAM,CAAC,IAAI,EAAE,CAAC;IACjC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;QACrE,MAAM,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC;AALD,8BAKC;AAEM,KAAK,UAAU,YAAY,CAChC,MAAiB,EACjB,OAAwB,EACxB,QAA0B;IAE1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IACrC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IACjC,IAAI,UAAsB,CAAC;IAC3B,IAAI;QACF,UAAU,GAAG,MAAM,MAAM,CAAC,GAAG,CAAa,eAAe,IAAI,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YACvB,MAAM,IAAI,KAAK,CACb,sCAAsC,IAAI,gBAAgB,MAAM,IAAI,CACrE,CAAC;SACH;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACpC,OAAO;KACR;IACD,IAAI;QACF,QAAQ,CAAC,IAAI,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;KAChD;IAAC,OAAO,GAAG,EAAE;QACZ,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;KACrC;AACH,CAAC;AAzBD,oCAyBC;AAMD,SAAS,eAAe,CACtB,IAAsB;AACtB,8DAA8D;AAC9D,IAAS,EACT,UAAkB;IAElB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC"}
|
package/dist/rpc.server.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.RPCServer = void 0;
|
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const core_1 = require("@loopback/core");
|
|
10
10
|
const events_1 = require("events");
|
|
11
|
-
const express_1 = tslib_1.__importDefault(require("express"));
|
|
11
|
+
const express_1 = (0, tslib_1.__importDefault)(require("express"));
|
|
12
12
|
const rpc_router_1 = require("./rpc.router");
|
|
13
13
|
let RPCServer = class RPCServer extends core_1.Context {
|
|
14
14
|
constructor(app, config) {
|
|
@@ -17,8 +17,8 @@ let RPCServer = class RPCServer extends core_1.Context {
|
|
|
17
17
|
this.config = config;
|
|
18
18
|
this._listening = false;
|
|
19
19
|
this.config = config !== null && config !== void 0 ? config : {};
|
|
20
|
-
this.expressServer = express_1.default();
|
|
21
|
-
rpc_router_1.rpcRouter(this);
|
|
20
|
+
this.expressServer = (0, express_1.default)();
|
|
21
|
+
(0, rpc_router_1.rpcRouter)(this);
|
|
22
22
|
}
|
|
23
23
|
get listening() {
|
|
24
24
|
return this._listening;
|
|
@@ -27,18 +27,18 @@ let RPCServer = class RPCServer extends core_1.Context {
|
|
|
27
27
|
var _a, _b;
|
|
28
28
|
this._server = this.expressServer.listen((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.port) !== null && _b !== void 0 ? _b : 3000);
|
|
29
29
|
this._listening = true;
|
|
30
|
-
await events_1.once(this._server, 'listening');
|
|
30
|
+
await (0, events_1.once)(this._server, 'listening');
|
|
31
31
|
}
|
|
32
32
|
async stop() {
|
|
33
33
|
this._server.close();
|
|
34
34
|
this._listening = false;
|
|
35
|
-
await events_1.once(this._server, 'close');
|
|
35
|
+
await (0, events_1.once)(this._server, 'close');
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
RPCServer = tslib_1.__decorate([
|
|
39
|
-
tslib_1.__param(0, core_1.inject(core_1.CoreBindings.APPLICATION_INSTANCE)),
|
|
40
|
-
tslib_1.__param(1, core_1.inject('rpcServer.config')),
|
|
41
|
-
tslib_1.__metadata("design:paramtypes", [core_1.Application, Object])
|
|
38
|
+
RPCServer = (0, tslib_1.__decorate)([
|
|
39
|
+
(0, tslib_1.__param)(0, (0, core_1.inject)(core_1.CoreBindings.APPLICATION_INSTANCE)),
|
|
40
|
+
(0, tslib_1.__param)(1, (0, core_1.inject)('rpcServer.config')),
|
|
41
|
+
(0, tslib_1.__metadata)("design:paramtypes", [core_1.Application, Object])
|
|
42
42
|
], RPCServer);
|
|
43
43
|
exports.RPCServer = RPCServer;
|
|
44
44
|
//# sourceMappingURL=rpc.server.js.map
|
package/dist/rpc.server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.server.js","sourceRoot":"","sources":["../src/rpc.server.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAMwB;AACxB,mCAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"rpc.server.js","sourceRoot":"","sources":["../src/rpc.server.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,4CAA4C;AAC5C,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAMwB;AACxB,mCAA4B;AAC5B,mEAA8B;AAE9B,6CAAuC;AAEvC,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,cAAO;IAKpC,YACoD,GAAiB,EAChC,MAAwB;QAE3D,KAAK,CAAC,GAAG,CAAC,CAAC;QAHuC,QAAG,GAAH,GAAG,CAAc;QAChC,WAAM,GAAN,MAAM,CAAkB;QANrD,eAAU,GAAG,KAAK,CAAC;QASzB,IAAI,CAAC,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,IAAA,iBAAO,GAAE,CAAC;QAC/B,IAAA,sBAAS,EAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,mCAAI,IAAI,CAAC,CAAC;QACpE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,MAAM,IAAA,aAAI,EAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,MAAM,IAAA,aAAI,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AA7BY,SAAS;IAMjB,wBAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,oBAAoB,CAAC,CAAA;IACzC,wBAAA,IAAA,aAAM,EAAC,kBAAkB,CAAC,CAAA;kDAD6B,kBAAW;GAN1D,SAAS,CA6BrB;AA7BY,8BAAS"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/example-rpc-server",
|
|
3
3
|
"description": "An example RPC server and application to demonstrate the creation of your own custom server",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loopback-application",
|
|
7
7
|
"loopback"
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@loopback/core": "^2.
|
|
45
|
+
"@loopback/core": "^2.18.0",
|
|
46
46
|
"express": "^4.17.1",
|
|
47
47
|
"tslib": "^2.3.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@loopback/build": "^7.0.
|
|
51
|
-
"@loopback/eslint-config": "^11.0.
|
|
52
|
-
"@loopback/testlab": "^3.4.
|
|
50
|
+
"@loopback/build": "^7.0.2",
|
|
51
|
+
"@loopback/eslint-config": "^11.0.2",
|
|
52
|
+
"@loopback/testlab": "^3.4.4",
|
|
53
53
|
"@types/express": "^4.17.13",
|
|
54
54
|
"@types/node": "^10.17.60",
|
|
55
55
|
"eslint": "^7.32.0",
|
|
56
|
-
"typescript": "~4.
|
|
56
|
+
"typescript": "~4.4.4"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "d9a29c85dbe38f12ba219d8c495cf6038bbc3590"
|
|
59
59
|
}
|