@steedos/service-package-loader 2.7.8-beta.2 → 2.7.8-beta.21

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.
Files changed (3) hide show
  1. package/LICENSE.txt +14 -15
  2. package/index.js +43 -2
  3. package/package.json +6 -6
package/LICENSE.txt CHANGED
@@ -1,22 +1,21 @@
1
- Steedos Licensing
1
+ # Open Source License
2
2
 
3
- SOFTWARE LICENSING
3
+ Steedos is licensed under a modified version of the Apache License 2.0, with the following additional conditions:
4
4
 
5
- To determine under which license you may use a file from the Steedos source code,
6
- please resort to the header of that file.
5
+ 1. Steedos may be utilized commercially, including as a backend service for other applications or as an application development platform for enterprises. Should the conditions below be met, a commercial license must be obtained from the producer:
7
6
 
8
- If the file has no header, the following rules apply
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
7
+ a. Multi-tenant service: Unless explicitly authorized by Steedos in writing, you may not use the Steedos source code to operate a multi-tenant environment.
8
+ - Tenant Definition: Within the context of Steedos, one tenant corresponds to one space. The space provides a separated area for each tenant's data and configurations.
11
9
 
12
- On request, licenses under different terms are available.
10
+ b. LOGO and copyright information: In the process of using Steedos's frontend, you may not remove or modify the LOGO or copyright information in the Steedos console or applications. This restriction is inapplicable to uses of Steedos that do not involve its frontend.
13
11
 
14
- Source code of enterprise features are files that
15
- * are in folders named "ee" or start with "ee_", or in subfolders of such folders.
16
- * contain the strings "ee_" in its filename name.
17
- The files can be found by running the command `find . -iname ee -or -iname "*_ee*" -or -iname "*ee_*"`
12
+ 2. As a contributor, you should agree that:
18
13
 
19
- STEEDOS TRADEMARK GUIDELINES
14
+ a. The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary.
15
+ b. Your contributed code may be used for commercial purposes, including but not limited to its cloud business operations.
20
16
 
21
- Your use of the mark Steedos is subject to Steedos, Inc's prior written approval. For trademark approval or any questions
22
- you have about using these trademarks, please email zhuangjianguo@steedos.com
17
+ Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0.
18
+
19
+ The interactive design of this product is protected by appearance patent.
20
+
21
+ © 2025 Steedos, Inc.
package/index.js CHANGED
@@ -14,6 +14,9 @@ const metaDataCore = require('@steedos/metadata-core');
14
14
  const { registerMetadataConfigs, loadStandardMetadata, loadRouters } = require('@steedos/metadata-registrar');
15
15
  const moment = require('moment');
16
16
  const objectMixin = require('@steedos/service-object-mixin')
17
+ const {
18
+ compressFiles, deleteFolderRecursive, mkTempFolder
19
+ } = require('@steedos/metadata-core');
17
20
 
18
21
  const loadFlowFile = new metaDataCore.LoadFlowFile();
19
22
 
@@ -83,6 +86,16 @@ module.exports = {
83
86
  // 扫描main/default/data文件夹
84
87
  await this.importData(path.join(this.settings.packageInfo.path, 'main', 'default', 'data'), false, spaceId);
85
88
  await this.loadDataOnServiceStarted(spaceId);
89
+
90
+ let packageInfo = this.settings.packageInfo;
91
+ if (!packageInfo) {
92
+ return;
93
+ }
94
+ const { path: packagePath, isUnmanaged } = packageInfo;
95
+ if (isUnmanaged && packagePath) {
96
+ const userSession = { spaceId: spaceId, userId: spaceDoc.owner };
97
+ await this.deployPackage(packagePath, userSession);
98
+ }
86
99
  }
87
100
  }
88
101
  },
@@ -267,7 +280,7 @@ module.exports = {
267
280
  if (!packageInfo) {
268
281
  return;
269
282
  }
270
- const { path : _path, datasource, isPackage } = packageInfo;
283
+ const { path : _path, datasource, isPackage, isUnmanaged } = packageInfo;
271
284
  if (!_path) {
272
285
  this.logger.error(`Please config packageInfo in your settings.`);
273
286
  console.log(`service ${this.name} started`);
@@ -277,7 +290,10 @@ module.exports = {
277
290
  await this.loadDataOnServiceStarted()
278
291
  });
279
292
 
280
- await this.loadPackageMetadataFiles(_path, this.name, datasource);
293
+ if (true != isUnmanaged) {
294
+ // 受管软件包加载元数据文件,非受管软件包不加载
295
+ await this.loadPackageMetadataFiles(_path, this.name, datasource);
296
+ }
281
297
  if(isPackage !== false){
282
298
  try {
283
299
  let _packageInfo = {};
@@ -335,7 +351,32 @@ module.exports = {
335
351
  if(datasource){
336
352
  await datasource.init();
337
353
  }
354
+ },
355
+ async deployPackage(sourcePath, userSession){
356
+ try {
357
+ var tempDir = mkTempFolder('deploy-');
358
+ var option = { includeJs: false, tableTitle: 'Steedos Deploy', showLog: true, inDeploy: true };
359
+
360
+ compressFiles(sourcePath, sourcePath, tempDir, option, async (base64, zipDir) => {
361
+ const result = await this.broker.call('~packages-@steedos/metadata-api.deploy', {
362
+ fileBase64: base64,
363
+ }, {
364
+ timeout: 0,
365
+ meta: {
366
+ user: userSession
367
+ }
368
+ })
369
+ console.log(sourcePath, JSON.stringify(result))
370
+ deleteFolderRecursive(tempDir);
371
+ });
372
+
373
+ } catch (err) {
374
+ console.log(err);
375
+ throw err;
376
+ }
377
+
338
378
  }
379
+
339
380
  },
340
381
 
341
382
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-package-loader",
3
- "version": "2.7.8-beta.2",
3
+ "version": "2.7.8-beta.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,10 +10,10 @@
10
10
  "author": "",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@steedos/metadata-core": "2.7.8-beta.2",
14
- "@steedos/metadata-registrar": "2.7.8-beta.2",
15
- "@steedos/router": "2.7.8-beta.2",
16
- "@steedos/service-object-mixin": "2.7.8-beta.2",
13
+ "@steedos/metadata-core": "2.7.8-beta.21",
14
+ "@steedos/metadata-registrar": "2.7.8-beta.21",
15
+ "@steedos/router": "2.7.8-beta.21",
16
+ "@steedos/service-object-mixin": "2.7.8-beta.21",
17
17
  "clone": "^2.1.2",
18
18
  "csvtojson": "~2.0.10",
19
19
  "moleculer": "^0.14.25",
@@ -28,5 +28,5 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "d915768c87aaa7bc026623a4953d6f39c5ddace1"
31
+ "gitHead": "bde64f8e1f880f54583600a8bb0a6018f36061b7"
32
32
  }