@gudhub/core 1.1.27 → 1.1.29

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.
@@ -1,11 +1,11 @@
1
1
  import generateModulesList from "./ModulesList.js";
2
2
 
3
3
  export class Storage {
4
- constructor(async_modules_path, file_server_url) {
4
+ constructor(async_modules_path, file_server_url, automation_modules_path) {
5
5
  this.apps_list = [];
6
6
  this.users_list = [];
7
7
  this.user = {};
8
- this.modulesList = generateModulesList(async_modules_path, file_server_url);
8
+ this.modulesList = generateModulesList(async_modules_path, file_server_url, automation_modules_path);
9
9
  this.ghComponentsPromises = [];
10
10
  }
11
11
 
@@ -25,8 +25,14 @@ export class Storage {
25
25
  return this.users_list;
26
26
  }
27
27
 
28
- getModulesList() {
29
- return this.modulesList
28
+ getModulesList(type) {
29
+ if(typeof type === 'undefined') {
30
+ return this.modulesList
31
+ } else {
32
+ return this.modulesList.filter(module => {
33
+ return module.type === type;
34
+ });
35
+ }
30
36
  }
31
37
 
32
38
  getModuleUrl(module_id) {
package/GUDHUB/config.js CHANGED
@@ -4,6 +4,7 @@ export const server_url = "https://gudhub.com/GudHub";
4
4
  //export const server_url = "http://localhost:9000";
5
5
  export const wss_url = "wss://gudhub.com/GudHub/ws/app/";
6
6
  export const async_modules_path = 'async_modules/';
7
+ export const automation_modules_path = 'automation_modules/'
7
8
  export const file_server_url = 'http://localhost:9000';
8
9
 
9
10
  // FOR TESTS
package/GUDHUB/gudhub.js CHANGED
@@ -2,7 +2,7 @@ import { GudHubHttpsService } from "./gudhub-https-service.js";
2
2
  import { PipeService } from "./PipeService/PipeService.js";
3
3
  import { Storage } from "./Storage/Storage.js";
4
4
  import { WebSocketApi } from "./WebSocket/WebSocket.js";
5
- import { wss_url, server_url, async_modules_path, file_server_url } from "./config.js";
5
+ import { wss_url, server_url, async_modules_path, file_server_url, automation_modules_path } from "./config.js";
6
6
  import { Utils } from "./Utils/Utils.js";
7
7
  import { Auth } from "./Auth/Auth.js";
8
8
  import { GHConstructor } from "./GHConstructor/ghconstructor.js";
@@ -28,13 +28,14 @@ export class GudHub {
28
28
  activateSW: false,
29
29
  swLink: "",
30
30
  async_modules_path,
31
- file_server_url
31
+ file_server_url,
32
+ automation_modules_path
32
33
  }
33
34
  ) {
34
35
  this.ghconstructor = new GHConstructor(this);
35
36
  this.interpritate = new Interpritate(this);
36
37
  this.pipeService = new PipeService();
37
- this.storage = new Storage(options.async_modules_path, options.file_server_url);
38
+ this.storage = new Storage(options.async_modules_path, options.file_server_url, options.automation_modules_path);
38
39
  this.util = new Utils(this);
39
40
  this.req = new GudHubHttpsService(options.server_url);
40
41
  this.auth = new Auth(this.req, this.storage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {