ismx-nexo-node-app 0.3.53 → 0.3.55

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.
@@ -40,23 +40,26 @@ const Business_1 = __importDefault(require("./Business"));
40
40
  class BusinessServer extends Business_1.default {
41
41
  constructor() {
42
42
  super();
43
+ this.services = [];
43
44
  this.publish = this.publish.bind(this);
44
45
  }
45
46
  init() {
46
- Promise.resolve().then(() => __importStar(require("express"))).then(({ default: express }) => {
47
- Promise.resolve().then(() => __importStar(require("cors"))).then(({ default: cors }) => {
48
- this.app = express();
49
- this.app.use(express.urlencoded({ extended: false }));
50
- this.app.use(express.json());
51
- this.app.use(cors());
52
- });
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ yield Promise.resolve().then(() => __importStar(require("express"))).then((_a) => __awaiter(this, [_a], void 0, function* ({ default: express }) {
49
+ yield Promise.resolve().then(() => __importStar(require("cors"))).then((_a) => __awaiter(this, [_a], void 0, function* ({ default: cors }) {
50
+ this.app = express();
51
+ this.app.use(express.urlencoded({ extended: false }));
52
+ this.app.use(express.json());
53
+ this.app.use(cors());
54
+ }));
55
+ }));
53
56
  });
54
57
  }
55
58
  start(port) {
56
59
  this.app.listen(port, this.onStarted);
57
60
  }
58
61
  setServices(services) {
59
- services.forEach(this.publish);
62
+ (this.services = services).forEach(this.publish);
60
63
  }
61
64
  setOnStarted(listener) {
62
65
  this.onStarted = listener;
package/dist/js/index.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RestUtils = exports.QueryUtils = exports.RepositoryRestFormalTemplate = exports.RepositoryRestFormal = exports.RepositoryRest = exports.RepositoryDatabasePostgres = exports.RepositoryDatabase = exports.Repository = exports.StringUtils = exports.NumberUtils = exports.CryptoUtils = exports.BusinessLogger = exports.BusinessErrors = exports.BusinessThread = exports.BusinessProxy = exports.BusinessState = exports.Business = exports.ColorUtils = exports.ServiceRestFormalTemplate = exports.ServiceRestFormal = exports.ServiceRest = exports.HttpResponse = exports.Service = void 0;
29
+ exports.RestUtils = exports.QueryUtils = exports.RepositoryRestFormalTemplate = exports.RepositoryRestFormal = exports.RepositoryRest = exports.RepositoryDatabasePostgres = exports.RepositoryDatabase = exports.Repository = exports.StringUtils = exports.NumberUtils = exports.CryptoUtils = exports.BusinessLogger = exports.BusinessErrors = exports.BusinessThread = exports.BusinessServer = exports.BusinessProxy = exports.BusinessState = exports.Business = exports.ColorUtils = exports.ServiceRestFormalTemplate = exports.ServiceRestFormal = exports.ServiceRest = exports.HttpResponse = exports.Service = void 0;
30
30
  const Service_1 = __importStar(require("./api/Service"));
31
31
  class Service extends Service_1.default {
32
32
  }
@@ -66,6 +66,7 @@ exports.BusinessProxy = BusinessProxy;
66
66
  const BusinessServer_1 = __importDefault(require("./business/BusinessServer"));
67
67
  class BusinessServer extends BusinessServer_1.default {
68
68
  }
69
+ exports.BusinessServer = BusinessServer;
69
70
  const BusinessThread_1 = __importDefault(require("./business/BusinessThread"));
70
71
  class BusinessThread extends BusinessThread_1.default {
71
72
  }
@@ -1,9 +1,10 @@
1
1
  import Service, { HttpRequest, HttpResponse } from "../api/Service";
2
2
  import Business from "./Business";
3
3
  export default class BusinessServer extends Business {
4
+ private services;
4
5
  private app;
5
6
  constructor();
6
- init(): void;
7
+ init(): Promise<void>;
7
8
  start(port: number): void;
8
9
  setServices(services: Service<any, any>[]): void;
9
10
  private onStarted?;
@@ -31,6 +31,9 @@ export declare class BusinessProxy extends BaseBusinessProxy {
31
31
  }
32
32
  export interface Module extends BaseModule {
33
33
  }
34
+ import _BusinessServer from "./business/BusinessServer";
35
+ export declare class BusinessServer extends _BusinessServer {
36
+ }
34
37
  import BaseBusinessThread from "./business/BusinessThread";
35
38
  export declare abstract class BusinessThread extends BaseBusinessThread {
36
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.3.53",
3
+ "version": "0.3.55",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -1,5 +1,3 @@
1
- import BusinessServer from "../business/BusinessServer";
2
-
3
1
  export interface HttpRequest<T = any> {
4
2
  id?: string,
5
3
  url?: string,
@@ -3,6 +3,8 @@ import Business from "./Business";
3
3
 
4
4
  export default class BusinessServer extends Business
5
5
  {
6
+ private services: Service<any, any>[] = []
7
+
6
8
  private app: any;
7
9
 
8
10
  constructor() {
@@ -10,9 +12,9 @@ export default class BusinessServer extends Business
10
12
  this.publish = this.publish.bind(this);
11
13
  }
12
14
 
13
- init() {
14
- import("express").then(({ default: express }) => {
15
- import("cors").then(({ default: cors }) => {
15
+ async init() {
16
+ await import("express").then(async ({ default: express }) => {
17
+ await import("cors").then(async ({ default: cors }) => {
16
18
  this.app = express();
17
19
  this.app.use(express.urlencoded({ extended: false }));
18
20
  this.app.use(express.json());
@@ -26,7 +28,7 @@ export default class BusinessServer extends Business
26
28
  }
27
29
 
28
30
  setServices(services: Service<any, any>[]) {
29
- services.forEach(this.publish);
31
+ (this.services = services).forEach(this.publish);
30
32
  }
31
33
 
32
34
  private onStarted?: ()=>any;
@@ -29,7 +29,7 @@ export class BusinessProxy extends BaseBusinessProxy {}
29
29
  export interface Module extends BaseModule {}
30
30
 
31
31
  import _BusinessServer from "./business/BusinessServer";
32
- class BusinessServer extends _BusinessServer {}
32
+ export class BusinessServer extends _BusinessServer {}
33
33
 
34
34
  import BaseBusinessThread from "./business/BusinessThread";
35
35
  export abstract class BusinessThread extends BaseBusinessThread {}