ismx-nexo-node-app 0.3.50 → 0.3.52
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/dist/js/business/BusinessServer.js +33 -6
- package/dist/js/index.js +1 -2
- package/dist/types/api/ServiceRestFormalTemplate.d.ts +1 -1
- package/dist/types/business/BusinessServer.d.ts +1 -0
- package/dist/types/index.d.ts +4 -7
- package/dist/types/repository/Repository.d.ts +4 -0
- package/dist/types/repository/RepositoryDatabase.d.ts +2 -7
- package/dist/types/repository/RepositoryDatabasePostgres.d.ts +2 -1
- package/dist/types/repository/RepositoryRestFormalTemplate.d.ts +1 -1
- package/package.json +1 -1
- package/src/main/node/api/ServiceRestFormalTemplate.ts +1 -1
- package/src/main/node/business/BusinessServer.ts +12 -9
- package/src/main/node/index.ts +5 -5
- package/src/main/node/repository/Repository.ts +5 -0
- package/src/main/node/repository/RepositoryDatabase.ts +2 -8
- package/src/main/node/repository/RepositoryDatabasePostgres.ts +2 -1
- package/src/main/node/repository/RepositoryRestFormalTemplate.ts +1 -1
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -13,18 +36,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
36
|
};
|
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
38
|
const Service_1 = require("../api/Service");
|
|
16
|
-
const express_1 = __importDefault(require("express"));
|
|
17
39
|
const Business_1 = __importDefault(require("./Business"));
|
|
18
|
-
const cors_1 = __importDefault(require("cors"));
|
|
19
40
|
class BusinessServer extends Business_1.default {
|
|
20
41
|
constructor() {
|
|
21
42
|
super();
|
|
22
|
-
this.app = (0, express_1.default)();
|
|
23
|
-
this.app.use(express_1.default.urlencoded({ extended: false }));
|
|
24
|
-
this.app.use(express_1.default.json());
|
|
25
|
-
this.app.use((0, cors_1.default)());
|
|
26
43
|
this.publish = this.publish.bind(this);
|
|
27
44
|
}
|
|
45
|
+
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
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
28
55
|
start(port) {
|
|
29
56
|
this.app.listen(port, this.onStarted);
|
|
30
57
|
}
|
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.
|
|
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;
|
|
30
30
|
const Service_1 = __importStar(require("./api/Service"));
|
|
31
31
|
class Service extends Service_1.default {
|
|
32
32
|
}
|
|
@@ -66,7 +66,6 @@ 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;
|
|
70
69
|
const BusinessThread_1 = __importDefault(require("./business/BusinessThread"));
|
|
71
70
|
class BusinessThread extends BusinessThread_1.default {
|
|
72
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpRequest, HttpResponse } from "./Service";
|
|
2
2
|
import ServiceRestFormal, { Wrapper } from "./ServiceRestFormal";
|
|
3
|
-
import { Pagination } from "../repository/
|
|
3
|
+
import { Pagination } from "../repository/Repository";
|
|
4
4
|
import RepositoryDatabase from "../repository/RepositoryDatabase";
|
|
5
5
|
export default class ServiceRestFormalTemplate<Model = any> {
|
|
6
6
|
readonly resource: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,9 +31,6 @@ export declare class BusinessProxy extends BaseBusinessProxy {
|
|
|
31
31
|
}
|
|
32
32
|
export interface Module extends BaseModule {
|
|
33
33
|
}
|
|
34
|
-
import BaseBusinessServer from "./business/BusinessServer";
|
|
35
|
-
export declare class BusinessServer extends BaseBusinessServer {
|
|
36
|
-
}
|
|
37
34
|
import BaseBusinessThread from "./business/BusinessThread";
|
|
38
35
|
export declare abstract class BusinessThread extends BaseBusinessThread {
|
|
39
36
|
}
|
|
@@ -55,14 +52,14 @@ import _StringUtils from "./business/utils/StringUtils";
|
|
|
55
52
|
export declare abstract class StringUtils extends _StringUtils {
|
|
56
53
|
}
|
|
57
54
|
/**************************************************************/
|
|
58
|
-
import BaseRepository from "./repository/Repository";
|
|
55
|
+
import BaseRepository, { Pagination as _Pagination } from "./repository/Repository";
|
|
59
56
|
export declare class Repository extends BaseRepository {
|
|
60
57
|
}
|
|
61
|
-
import _RepositoryDatabase, { Pagination as _Pagination } from "./repository/RepositoryDatabase";
|
|
62
|
-
export declare abstract class RepositoryDatabase extends _RepositoryDatabase {
|
|
63
|
-
}
|
|
64
58
|
export interface Pagination<T = any> extends _Pagination<T> {
|
|
65
59
|
}
|
|
60
|
+
import _RepositoryDatabase from "./repository/RepositoryDatabase";
|
|
61
|
+
export declare abstract class RepositoryDatabase extends _RepositoryDatabase {
|
|
62
|
+
}
|
|
66
63
|
import _RepositoryDatabasePostgres from "./repository/RepositoryDatabasePostgres";
|
|
67
64
|
export declare class RepositoryDatabasePostgres extends _RepositoryDatabasePostgres {
|
|
68
65
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import Repository from "./Repository";
|
|
2
|
-
import { QueryResult } from "pg";
|
|
1
|
+
import Repository, { Pagination } from "./Repository";
|
|
3
2
|
export interface QueryOptions {
|
|
4
3
|
schema?: string;
|
|
5
4
|
filters?: string;
|
|
@@ -11,10 +10,6 @@ export interface Chain {
|
|
|
11
10
|
password: string;
|
|
12
11
|
database: string;
|
|
13
12
|
}
|
|
14
|
-
export interface Pagination<T> {
|
|
15
|
-
total: number;
|
|
16
|
-
elements: T[];
|
|
17
|
-
}
|
|
18
13
|
export type Primitive = string | number | Date | null | undefined;
|
|
19
14
|
export default abstract class RepositoryDatabase extends Repository {
|
|
20
15
|
protected connected: boolean;
|
|
@@ -28,7 +23,7 @@ export default abstract class RepositoryDatabase extends Repository {
|
|
|
28
23
|
protected readonly onQueryDidExecuteListeners: ((query: string) => void)[];
|
|
29
24
|
addOnQueryDidExecuteListener(listener: (query: string) => void): void;
|
|
30
25
|
abstract connect(connection: Chain): Promise<void>;
|
|
31
|
-
abstract native(query: string, values: any[], options: QueryOptions): Promise<
|
|
26
|
+
abstract native(query: string, values: any[], options: QueryOptions): Promise<any>;
|
|
32
27
|
abstract query<E>(query: string, values: any[], options: QueryOptions): Promise<E[]>;
|
|
33
28
|
abstract one<E>(tableName: string, id: string): Promise<E>;
|
|
34
29
|
abstract any<E>(tableName: string, filters: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pg, { QueryResult } from "pg";
|
|
2
|
-
import RepositoryDatabase, { Chain,
|
|
2
|
+
import RepositoryDatabase, { Chain, Primitive, QueryOptions } from "./RepositoryDatabase";
|
|
3
|
+
import { Pagination } from "./Repository";
|
|
3
4
|
export interface Column {
|
|
4
5
|
name: string;
|
|
5
6
|
schema: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RestOptions } from "./RepositoryRest";
|
|
2
2
|
import { HttpRequest } from "../api/Service";
|
|
3
|
-
import { Pagination } from "
|
|
3
|
+
import { Pagination } from "../repository/Repository";
|
|
4
4
|
export default class RepositoryRestFormalTemplate<Model> {
|
|
5
5
|
private readonly repository;
|
|
6
6
|
constructor(baseUrl: string, options?: RestOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {HttpRequest, HttpResponse} from "./Service";
|
|
2
2
|
import ServiceRestFormal, {Wrapper} from "./ServiceRestFormal";
|
|
3
|
-
import {Pagination} from "../repository/
|
|
3
|
+
import {Pagination} from "../repository/Repository";
|
|
4
4
|
import RepositoryDatabase from "../repository/RepositoryDatabase";
|
|
5
5
|
|
|
6
6
|
export default class ServiceRestFormalTemplate<Model=any>
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import Service, {HttpRequest, HttpResponse} from "../api/Service";
|
|
2
|
-
import express from "express";
|
|
3
|
-
import core from "express"
|
|
4
2
|
import Business from "./Business";
|
|
5
|
-
import cors from 'cors';
|
|
6
3
|
|
|
7
4
|
export default class BusinessServer extends Business
|
|
8
5
|
{
|
|
9
|
-
private app:
|
|
6
|
+
private app: any;
|
|
10
7
|
|
|
11
8
|
constructor() {
|
|
12
9
|
super()
|
|
13
|
-
this.app = express();
|
|
14
|
-
this.app.use(express.urlencoded({ extended: false }));
|
|
15
|
-
this.app.use(express.json());
|
|
16
|
-
this.app.use(cors());
|
|
17
|
-
|
|
18
10
|
this.publish = this.publish.bind(this);
|
|
19
11
|
}
|
|
20
12
|
|
|
13
|
+
init() {
|
|
14
|
+
import("express").then(({ default: express }) => {
|
|
15
|
+
import("cors").then(({ default: cors }) => {
|
|
16
|
+
this.app = express();
|
|
17
|
+
this.app.use(express.urlencoded({ extended: false }));
|
|
18
|
+
this.app.use(express.json());
|
|
19
|
+
this.app.use(cors());
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
21
24
|
start(port: number) {
|
|
22
25
|
this.app.listen(port, this.onStarted)
|
|
23
26
|
}
|
package/src/main/node/index.ts
CHANGED
|
@@ -28,8 +28,8 @@ import BaseBusinessProxy, { Module as BaseModule } from "./business/BusinessProx
|
|
|
28
28
|
export class BusinessProxy extends BaseBusinessProxy {}
|
|
29
29
|
export interface Module extends BaseModule {}
|
|
30
30
|
|
|
31
|
-
import
|
|
32
|
-
|
|
31
|
+
import _BusinessServer from "./business/BusinessServer";
|
|
32
|
+
class BusinessServer extends _BusinessServer {}
|
|
33
33
|
|
|
34
34
|
import BaseBusinessThread from "./business/BusinessThread";
|
|
35
35
|
export abstract class BusinessThread extends BaseBusinessThread {}
|
|
@@ -52,12 +52,12 @@ export abstract class StringUtils extends _StringUtils {}
|
|
|
52
52
|
|
|
53
53
|
/**************************************************************/
|
|
54
54
|
|
|
55
|
-
import BaseRepository from "./repository/Repository";
|
|
55
|
+
import BaseRepository, { Pagination as _Pagination } from "./repository/Repository";
|
|
56
56
|
export class Repository extends BaseRepository {}
|
|
57
|
+
export interface Pagination<T=any> extends _Pagination<T> {}
|
|
57
58
|
|
|
58
|
-
import _RepositoryDatabase
|
|
59
|
+
import _RepositoryDatabase from "./repository/RepositoryDatabase";
|
|
59
60
|
export abstract class RepositoryDatabase extends _RepositoryDatabase {}
|
|
60
|
-
export interface Pagination<T=any> extends _Pagination<T> {}
|
|
61
61
|
|
|
62
62
|
import _RepositoryDatabasePostgres from "./repository/RepositoryDatabasePostgres";
|
|
63
63
|
export class RepositoryDatabasePostgres extends _RepositoryDatabasePostgres {}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import Repository from "./Repository";
|
|
2
|
-
import {QueryResult} from "pg";
|
|
1
|
+
import Repository, {Pagination} from "./Repository";
|
|
3
2
|
|
|
4
3
|
export interface QueryOptions {
|
|
5
4
|
schema?: string;
|
|
@@ -14,11 +13,6 @@ export interface Chain {
|
|
|
14
13
|
database: string;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
export interface Pagination<T> {
|
|
18
|
-
total: number;
|
|
19
|
-
elements: T[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
16
|
export type Primitive = string | number | Date | null | undefined;
|
|
23
17
|
|
|
24
18
|
export default abstract class RepositoryDatabase extends Repository
|
|
@@ -52,7 +46,7 @@ export default abstract class RepositoryDatabase extends Repository
|
|
|
52
46
|
|
|
53
47
|
abstract connect(connection: Chain): Promise<void>;
|
|
54
48
|
|
|
55
|
-
abstract native(query: string, values: any[], options: QueryOptions): Promise<
|
|
49
|
+
abstract native(query: string, values: any[], options: QueryOptions): Promise<any>;
|
|
56
50
|
|
|
57
51
|
abstract query<E>(query: string, values: any[], options: QueryOptions): Promise<E[]>;
|
|
58
52
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import pg, {ClientConfig, QueryResult, QueryResultRow} from "pg";
|
|
2
2
|
import PostgresUtils from "./utils/PostgresUtils";
|
|
3
|
-
import RepositoryDatabase, {Chain,
|
|
3
|
+
import RepositoryDatabase, {Chain, Primitive, QueryOptions} from "./RepositoryDatabase";
|
|
4
|
+
import {Pagination} from "./Repository";
|
|
4
5
|
|
|
5
6
|
export interface Column {
|
|
6
7
|
name: string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {RestOptions} from "./RepositoryRest";
|
|
2
2
|
import RepositoryRestFormal from "./RepositoryRestFormal";
|
|
3
3
|
import {HttpRequest} from "../api/Service";
|
|
4
|
-
import {Pagination} from "
|
|
4
|
+
import {Pagination} from "../repository/Repository";
|
|
5
5
|
|
|
6
6
|
export default class RepositoryRestFormalTemplate<Model> {
|
|
7
7
|
|