@steedos/service-package-loader 2.2.52-beta.7 → 2.2.53-beta.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/LICENSE.txt +2 -5
- package/index.js +5 -1
- package/lib/loadPackageFlow.js +1 -1
- package/lib/processLoader/index.js +2 -2
- package/lib/processLoader/types/index.js +1 -1
- package/lib/processLoader/types/index.js.map +1 -1
- package/lib/processTriggerLoader/index.js +1 -1
- package/lib/processTriggerLoader/types/index.js +1 -1
- package/lib/processTriggerLoader/types/index.js.map +1 -1
- package/lib/triggerLoader/index.js +3 -3
- package/lib/triggerLoader/types/index.js +4 -4
- package/lib/triggerLoader/types/index.js.map +1 -1
- package/package.json +8 -15
package/LICENSE.txt
CHANGED
|
@@ -6,14 +6,11 @@ To determine under which license you may use a file from the Steedos source code
|
|
|
6
6
|
please resort to the header of that file.
|
|
7
7
|
|
|
8
8
|
If the file has no header, the following rules apply
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3. source code that is neither (1) nor (2) is licensed under AGPL, see License.AGPL.txt
|
|
9
|
+
1. enterprise features are licensed under Steedos Enterprise Terms, see License.enterprise.txt
|
|
10
|
+
2. source code that is neither (1) is licensed under MIT, see https://opensource.org/licenses/MIT
|
|
12
11
|
|
|
13
12
|
On request, licenses under different terms are available.
|
|
14
13
|
|
|
15
|
-
Project templates can be found in the folders steedos-projects/
|
|
16
|
-
|
|
17
14
|
Source code of enterprise features are files that
|
|
18
15
|
* are in folders named "ee" or start with "ee_", or in subfolders of such folders.
|
|
19
16
|
* contain the strings "ee_" in its filename name.
|
package/index.js
CHANGED
|
@@ -70,6 +70,7 @@ module.exports = {
|
|
|
70
70
|
*/
|
|
71
71
|
methods: {
|
|
72
72
|
loadPackageMetadataFiles: async function (packagePath, name, datasourceName) {
|
|
73
|
+
this.broker.logger.debug(`Loading package from ${packagePath}`)
|
|
73
74
|
await Future.task(async () => {
|
|
74
75
|
if (!datasourceName) {
|
|
75
76
|
datasourceName = 'default';
|
|
@@ -198,7 +199,7 @@ module.exports = {
|
|
|
198
199
|
await this.loadPackageMetadataServices(_path);
|
|
199
200
|
|
|
200
201
|
await this.loadPackagePublicFiles(_path);
|
|
201
|
-
|
|
202
|
+
this.started = true;
|
|
202
203
|
console.timeEnd(`service ${this.name} started`)
|
|
203
204
|
// console.log(`service ${this.name} started`);
|
|
204
205
|
},
|
|
@@ -207,6 +208,9 @@ module.exports = {
|
|
|
207
208
|
* Service stopped lifecycle event handler
|
|
208
209
|
*/
|
|
209
210
|
async stopped() {
|
|
211
|
+
if(!this.started){
|
|
212
|
+
return ;
|
|
213
|
+
}
|
|
210
214
|
for await (const packageService of this.packageServices) {
|
|
211
215
|
try {
|
|
212
216
|
await this.broker.destroyService(packageService);
|
package/lib/loadPackageFlow.js
CHANGED
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const metadata_core_1 = require("@steedos/metadata-core");
|
|
6
6
|
const loadFlowFile = new metadata_core_1.LoadFlowFile();
|
|
7
7
|
const path = require('path');
|
|
8
|
-
const sendPackageFlowToDb = (broker, packagePath, name) =>
|
|
8
|
+
const sendPackageFlowToDb = (broker, packagePath, name) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
9
|
const flows = loadFlowFile.load(path.join(packagePath, '**'));
|
|
10
10
|
for (const apiName in flows) {
|
|
11
11
|
const flow = flows[apiName];
|
|
@@ -15,7 +15,7 @@ const objectql_1 = require("@steedos/objectql");
|
|
|
15
15
|
const metadata_core_1 = require("@steedos/metadata-core");
|
|
16
16
|
const loadProcessFile = new metadata_core_1.LoadProcessFile();
|
|
17
17
|
function load(broker, packagePath, packageServiceName) {
|
|
18
|
-
return
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
let filePath = path.join(packagePath, "**");
|
|
20
20
|
let processes = loadProcessFile.load(filePath);
|
|
21
21
|
if (_.isEmpty(processes)) {
|
|
@@ -41,7 +41,7 @@ function load(broker, packagePath, packageServiceName) {
|
|
|
41
41
|
exports.load = load;
|
|
42
42
|
// 软件包中的process元数据直接加载到库中
|
|
43
43
|
function sendPackageProcessToDb(packagePath) {
|
|
44
|
-
return
|
|
44
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
let filePath = path.join(packagePath, "**");
|
|
46
46
|
let processes = loadProcessFile.load(filePath);
|
|
47
47
|
if (_.isEmpty(processes)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/processLoader/types/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/processLoader/types/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B"}
|
|
@@ -9,7 +9,7 @@ const ENUM_WHEN = ['beforeDraftInsert', 'afterDraftInsert', 'beforeDraftSubmit',
|
|
|
9
9
|
'beforeCancel', 'afterCancel', 'beforeTerminate', 'afterTerminate', 'beforeEnd', 'afterEnd'];
|
|
10
10
|
const LISTENTO_ALL_FLOWS = 'LISTENTO_ALL_FLOWS';
|
|
11
11
|
function load(broker, packagePath, packageServiceName) {
|
|
12
|
-
return
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
13
|
let filePath = path.join(packagePath, "**");
|
|
14
14
|
let wTriggers = (0, objectql_1.loadProcessTriggers)(filePath);
|
|
15
15
|
if (_.isEmpty(wTriggers)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/processTriggerLoader/types/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/processTriggerLoader/types/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B"}
|
|
@@ -8,7 +8,7 @@ const objectql = require("@steedos/objectql");
|
|
|
8
8
|
const objectql_1 = require("@steedos/objectql");
|
|
9
9
|
const ENUM_WHEN = ['before.find', 'before.insert', 'before.update', 'before.delete', 'after.find', 'after.count', 'after.findOne', 'after.insert', 'after.delete', 'after.update', 'before.aggregate', 'after.aggregate'];
|
|
10
10
|
function load(broker, packagePath, packageServiceName) {
|
|
11
|
-
return
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
12
|
let actions = {};
|
|
13
13
|
let serviceName = `~triggers-${packageServiceName}`;
|
|
14
14
|
let filePath = path.join(packagePath, "**");
|
|
@@ -64,7 +64,7 @@ function generateAction(trigger) {
|
|
|
64
64
|
};
|
|
65
65
|
if (_.has(trigger, 'handler')) {
|
|
66
66
|
action.handler = function (ctx) {
|
|
67
|
-
return
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
68
|
return yield trigger.handler.call(ctx.params, ctx);
|
|
69
69
|
});
|
|
70
70
|
};
|
|
@@ -72,7 +72,7 @@ function generateAction(trigger) {
|
|
|
72
72
|
return action;
|
|
73
73
|
}
|
|
74
74
|
function register(broker, actions, serviceName, packageServiceName) {
|
|
75
|
-
return
|
|
75
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
76
|
for (const key in actions) {
|
|
77
77
|
if (Object.hasOwnProperty.call(actions, key)) {
|
|
78
78
|
let action = actions[key];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
tslib_1.__exportStar(require("./meta"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./triggerData"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./action"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./trigger"), exports);
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/triggerLoader/types/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/triggerLoader/types/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,wDAA8B;AAC9B,mDAAyB;AACzB,oDAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-package-loader",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.53-beta.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,27 +10,20 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@steedos/core": "2.2.
|
|
14
|
-
"@steedos/metadata-core": "2.2.
|
|
15
|
-
"@steedos/objectql": "2.2.
|
|
13
|
+
"@steedos/core": "2.2.53-beta.3",
|
|
14
|
+
"@steedos/metadata-core": "2.2.53-beta.3",
|
|
15
|
+
"@steedos/objectql": "2.2.53-beta.3",
|
|
16
16
|
"clone": "^2.1.2",
|
|
17
|
-
"globby": "^
|
|
18
|
-
"moleculer": "^0.14.
|
|
17
|
+
"globby": "^11.1.0",
|
|
18
|
+
"moleculer": "^0.14.21",
|
|
19
19
|
"underscore": "^1.12.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"
|
|
23
|
-
"@types/chai-as-promised": "7.1.0",
|
|
24
|
-
"@types/mocha": "^5.2.6",
|
|
25
|
-
"jslint": "^0.12.1",
|
|
26
|
-
"moleculer-repl": "^0.6.4",
|
|
27
|
-
"nodemon": "^1.18.10",
|
|
28
|
-
"ts-node": "^8.0.3",
|
|
29
|
-
"typescript": "^4.2.2"
|
|
22
|
+
"typescript": "4.6.3"
|
|
30
23
|
},
|
|
31
24
|
"private": false,
|
|
32
25
|
"publishConfig": {
|
|
33
26
|
"access": "public"
|
|
34
27
|
},
|
|
35
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "5782f1171133c05cce158adef71e527d970ef50e"
|
|
36
29
|
}
|