@steedos/service-package-loader 2.2.19 → 2.2.22
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/index.js +6 -2
- package/lib/processLoader/index.js +1 -14
- package/lib/processLoader/index.js.map +1 -1
- package/package.json +5 -6
- package/src/processLoader/index.ts +1 -14
package/index.js
CHANGED
|
@@ -141,7 +141,7 @@ module.exports = {
|
|
|
141
141
|
}
|
|
142
142
|
const cacheTime = 86400000 * 1; // one day
|
|
143
143
|
router.use(routerPath, express.static(publicPath, { maxAge: cacheTime }));
|
|
144
|
-
WebApp.
|
|
144
|
+
WebApp.connectHandlers.use(router);
|
|
145
145
|
} catch (error) {
|
|
146
146
|
console.error(error)
|
|
147
147
|
this.settings.loadedPackagePublicFiles = false;
|
|
@@ -211,7 +211,11 @@ module.exports = {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
this.broker.call(`@steedos/service-packages.offline`, {serviceInfo: {name: this.name, nodeID: this.broker.nodeID, instanceID: this.broker.instanceID}})
|
|
214
|
-
await this.broker.call(`metadata.refreshServiceMetadatas`, { offlinePackageServices: [
|
|
214
|
+
await this.broker.call(`metadata.refreshServiceMetadatas`, { offlinePackageServices: [{
|
|
215
|
+
name: this.name,
|
|
216
|
+
nodeID: this.broker.nodeID,
|
|
217
|
+
instanceID: this.broker.instanceID
|
|
218
|
+
}] }); //${this.broker.nodeID}.${this.name}
|
|
215
219
|
console.log(`service ${this.name} stopped`);
|
|
216
220
|
}
|
|
217
221
|
};
|
|
@@ -6,13 +6,11 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
* @Author: sunhaolin@hotoa.com
|
|
7
7
|
* @Date: 2022-03-30 11:49:53
|
|
8
8
|
* @LastEditors: sunhaolin@hotoa.com
|
|
9
|
-
* @LastEditTime: 2022-
|
|
9
|
+
* @LastEditTime: 2022-04-10 10:00:31
|
|
10
10
|
* @Description:
|
|
11
11
|
*/
|
|
12
12
|
const _ = require("underscore");
|
|
13
13
|
const path = require("path");
|
|
14
|
-
const glob = require("glob");
|
|
15
|
-
const fs = require("fs");
|
|
16
14
|
const objectql_1 = require("@steedos/objectql");
|
|
17
15
|
const metadata_core_1 = require("@steedos/metadata-core");
|
|
18
16
|
const loadProcessFile = new metadata_core_1.LoadProcessFile();
|
|
@@ -26,17 +24,6 @@ function load(broker, packagePath, packageServiceName) {
|
|
|
26
24
|
const data = [];
|
|
27
25
|
for (const apiName in processes) {
|
|
28
26
|
const process = processes[apiName];
|
|
29
|
-
// 加载对应的引擎元数据
|
|
30
|
-
const engineFileName = `${apiName}.process.${process.engine}.${process.ext}`;
|
|
31
|
-
const matchedPaths = glob.sync(path.join(filePath, loadProcessFile.metadataInfo.defaultDirectory, engineFileName));
|
|
32
|
-
if (matchedPaths.length > 1) {
|
|
33
|
-
throw new Error(`路径${filePath}下检测到多份元数据文件${engineFileName},请检查。`);
|
|
34
|
-
}
|
|
35
|
-
const engineFilePath = matchedPaths[0];
|
|
36
|
-
if (engineFilePath) {
|
|
37
|
-
const engineFileContent = fs.readFileSync(engineFilePath);
|
|
38
|
-
process.schema = engineFileContent.toString();
|
|
39
|
-
}
|
|
40
27
|
data.push(Object.assign(process, {
|
|
41
28
|
is_system: true,
|
|
42
29
|
record_permissions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/processLoader/index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,gCAAgC;AAChC,6BAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/processLoader/index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,gCAAgC;AAChC,6BAA6B;AAC7B,gDAAoD;AAEpD,0DAAyD;AACzD,MAAM,eAAe,GAAG,IAAI,+BAAe,EAAE,CAAC;AAE9C,SAAsB,IAAI,CAAC,MAAW,EAAE,WAAmB,EAAE,kBAA0B;;QACnF,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACtB,OAAO;SACV;QAED,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE;YAC7B,MAAM,OAAO,GAAY,SAAS,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;gBAC7B,SAAS,EAAE,IAAI;gBACf,kBAAkB,EAAE;oBAChB,SAAS,EAAE,KAAK;oBAChB,WAAW,EAAE,KAAK;oBAClB,SAAS,EAAE,IAAI;iBAClB;aACJ,CAAC,CAAC,CAAC;SAEP;QACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACjB,MAAM,0BAAe,CAAC,SAAS,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAA;SACpE;IAEL,CAAC;CAAA;AAxBD,oBAwBC"}
|
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.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@steedos/core": "2.2.
|
|
15
|
-
"@steedos/metadata-core": "2.2.
|
|
16
|
-
"@steedos/objectql": "2.2.
|
|
14
|
+
"@steedos/core": "2.2.22",
|
|
15
|
+
"@steedos/metadata-core": "2.2.22",
|
|
16
|
+
"@steedos/objectql": "2.2.22",
|
|
17
17
|
"clone": "^2.1.2",
|
|
18
|
-
"glob": "^7.1.6",
|
|
19
18
|
"globby": "^9.1.0",
|
|
20
19
|
"moleculer": "^0.14.12",
|
|
21
20
|
"underscore": "^1.12.0"
|
|
@@ -34,5 +33,5 @@
|
|
|
34
33
|
"publishConfig": {
|
|
35
34
|
"access": "public"
|
|
36
35
|
},
|
|
37
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "af4ea8ed034854c8de1ff8b9d5db241183524417"
|
|
38
37
|
}
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
* @Author: sunhaolin@hotoa.com
|
|
3
3
|
* @Date: 2022-03-30 11:49:53
|
|
4
4
|
* @LastEditors: sunhaolin@hotoa.com
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-04-10 10:00:31
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
import * as _ from "underscore";
|
|
9
9
|
import * as path from "path";
|
|
10
|
-
import * as glob from 'glob';
|
|
11
|
-
import * as fs from 'fs';
|
|
12
10
|
import { registerProcess } from "@steedos/objectql";
|
|
13
11
|
import { Process } from "./types";
|
|
14
12
|
import { LoadProcessFile } from '@steedos/metadata-core';
|
|
@@ -24,17 +22,6 @@ export async function load(broker: any, packagePath: string, packageServiceName:
|
|
|
24
22
|
const data = [];
|
|
25
23
|
for (const apiName in processes) {
|
|
26
24
|
const process: Process = processes[apiName];
|
|
27
|
-
// 加载对应的引擎元数据
|
|
28
|
-
const engineFileName = `${apiName}.process.${process.engine}.${process.ext}`;
|
|
29
|
-
const matchedPaths = glob.sync(path.join(filePath, loadProcessFile.metadataInfo.defaultDirectory, engineFileName));
|
|
30
|
-
if (matchedPaths.length > 1) {
|
|
31
|
-
throw new Error(`路径${filePath}下检测到多份元数据文件${engineFileName},请检查。`);
|
|
32
|
-
}
|
|
33
|
-
const engineFilePath = matchedPaths[0];
|
|
34
|
-
if (engineFilePath) {
|
|
35
|
-
const engineFileContent = fs.readFileSync(engineFilePath);
|
|
36
|
-
process.schema = engineFileContent.toString();
|
|
37
|
-
}
|
|
38
25
|
data.push(Object.assign(process, {
|
|
39
26
|
is_system: true,
|
|
40
27
|
record_permissions: {
|