@steedos/service-package-loader 2.2.52-beta.3 → 2.2.52-beta.30
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 -3
- package/index.js +4 -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 +5 -5
package/LICENSE.txt
CHANGED
|
@@ -6,9 +6,8 @@ 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
|
|
package/index.js
CHANGED
|
@@ -198,7 +198,7 @@ module.exports = {
|
|
|
198
198
|
await this.loadPackageMetadataServices(_path);
|
|
199
199
|
|
|
200
200
|
await this.loadPackagePublicFiles(_path);
|
|
201
|
-
|
|
201
|
+
this.started = true;
|
|
202
202
|
console.timeEnd(`service ${this.name} started`)
|
|
203
203
|
// console.log(`service ${this.name} started`);
|
|
204
204
|
},
|
|
@@ -207,6 +207,9 @@ module.exports = {
|
|
|
207
207
|
* Service stopped lifecycle event handler
|
|
208
208
|
*/
|
|
209
209
|
async stopped() {
|
|
210
|
+
if(!this.started){
|
|
211
|
+
return ;
|
|
212
|
+
}
|
|
210
213
|
for await (const packageService of this.packageServices) {
|
|
211
214
|
try {
|
|
212
215
|
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.52-beta.
|
|
3
|
+
"version": "2.2.52-beta.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@steedos/core": "2.2.52-beta.
|
|
14
|
-
"@steedos/metadata-core": "2.2.52-beta.
|
|
15
|
-
"@steedos/objectql": "2.2.52-beta.
|
|
13
|
+
"@steedos/core": "2.2.52-beta.30",
|
|
14
|
+
"@steedos/metadata-core": "2.2.52-beta.30",
|
|
15
|
+
"@steedos/objectql": "2.2.52-beta.30",
|
|
16
16
|
"clone": "^2.1.2",
|
|
17
17
|
"globby": "^9.1.0",
|
|
18
18
|
"moleculer": "^0.14.12",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "bc2c2bc4fb5d851c5bdeb88a38e2e81369cbc566"
|
|
36
36
|
}
|