namirasoft-node 1.0.14 → 1.0.16
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/BaseApplication.d.ts +1 -1
- package/dist/BaseApplication.js +8 -5
- package/dist/BaseApplication.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/BaseApplication.ts +7 -5
- package/src/index.ts +5 -2
|
@@ -17,7 +17,7 @@ export declare abstract class BaseApplication<D extends BaseDatabase> {
|
|
|
17
17
|
protected abstract getLogger(): ILogger;
|
|
18
18
|
protected abstract getRouter(): Router;
|
|
19
19
|
protected abstract getPort(): number;
|
|
20
|
-
constructor(
|
|
20
|
+
constructor(serverPath: string, swaggerPath?: string | null);
|
|
21
21
|
addLink(link: BaseApplicationLink): void;
|
|
22
22
|
addSwaggerLink(): void;
|
|
23
23
|
start(): void;
|
package/dist/BaseApplication.js
CHANGED
|
@@ -19,13 +19,16 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
19
19
|
const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
|
|
20
20
|
const swagger_jsdoc_1 = __importDefault(require("swagger-jsdoc"));
|
|
21
21
|
const path_1 = __importDefault(require("path"));
|
|
22
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
22
23
|
class BaseApplication {
|
|
23
|
-
constructor(
|
|
24
|
+
constructor(serverPath, swaggerPath = null) {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
24
26
|
this.links = [];
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
27
|
+
let json = namirasoft_core_1.PackageService.getMain();
|
|
28
|
+
this.title = (_a = json === null || json === void 0 ? void 0 : json.getTitle()) !== null && _a !== void 0 ? _a : "";
|
|
29
|
+
this.description = (_b = json === null || json === void 0 ? void 0 : json.getDescription()) !== null && _b !== void 0 ? _b : "";
|
|
30
|
+
this.logo = (_c = json === null || json === void 0 ? void 0 : json.getLogo()) !== null && _c !== void 0 ? _c : "";
|
|
31
|
+
this.version = (_d = json === null || json === void 0 ? void 0 : json.getVersion()) !== null && _d !== void 0 ? _d : "";
|
|
29
32
|
this.serverPath = serverPath;
|
|
30
33
|
this.swaggerPath = swaggerPath !== null && swaggerPath !== void 0 ? swaggerPath : (serverPath + "/swagger");
|
|
31
34
|
this.logger = this.getLogger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseApplication.js","sourceRoot":"","sources":["../src/BaseApplication.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAC1C,gDAAwB;AACxB,4CAAoB;AACpB,4EAA2C;AAC3C,kEAAyC;AAIzC,gDAAwB;
|
|
1
|
+
{"version":3,"file":"BaseApplication.js","sourceRoot":"","sources":["../src/BaseApplication.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAC1C,gDAAwB;AACxB,4CAAoB;AACpB,4EAA2C;AAC3C,kEAAyC;AAIzC,gDAAwB;AACxB,qDAAiD;AAEjD,MAAsB,eAAe;IAgBjC,YAAY,UAAkB,EAAE,cAA6B,IAAI;;QARzD,UAAK,GAA0B,EAAE,CAAC;QAUtC,IAAI,IAAI,GAAG,gCAAc,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,EAAE,mCAAI,EAAE,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,EAAE,mCAAI,EAAE,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,EAAE,mCAAI,EAAE,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE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ector";
|
|
2
2
|
export * from "./BaseApplication";
|
|
3
|
+
export * from "./BaseApplicationLink";
|
|
3
4
|
export * from "./BaseController";
|
|
4
5
|
export * from "./BaseDatabase";
|
|
5
|
-
export * from "./BaseSequelizeModel";
|
|
6
6
|
export * from "./BaseMySqlDatabase";
|
|
7
|
-
export * from "./BaseSequelizeTable";
|
|
8
7
|
export * from "./BaseSequelizeDatabase";
|
|
8
|
+
export * from "./BaseSequelizeModel";
|
|
9
|
+
export * from "./BaseSequelizeTable";
|
|
9
10
|
export * from "./BaseTable";
|
|
10
11
|
export * from "./EmailService";
|
|
11
12
|
export * from "./EnvService";
|
|
12
13
|
export * from "./IPOperation";
|
|
14
|
+
export * from "./Meta";
|
|
15
|
+
export * from "./OTPOperation";
|
|
13
16
|
export * from "./RequestHeaderService";
|
|
14
17
|
export * from "./ServerToServerOperation";
|
package/dist/index.js
CHANGED
|
@@ -16,16 +16,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AnomalyDetector"), exports);
|
|
18
18
|
__exportStar(require("./BaseApplication"), exports);
|
|
19
|
+
__exportStar(require("./BaseApplicationLink"), exports);
|
|
19
20
|
__exportStar(require("./BaseController"), exports);
|
|
20
21
|
__exportStar(require("./BaseDatabase"), exports);
|
|
21
|
-
__exportStar(require("./BaseSequelizeModel"), exports);
|
|
22
22
|
__exportStar(require("./BaseMySqlDatabase"), exports);
|
|
23
|
-
__exportStar(require("./BaseSequelizeTable"), exports);
|
|
24
23
|
__exportStar(require("./BaseSequelizeDatabase"), exports);
|
|
24
|
+
__exportStar(require("./BaseSequelizeModel"), exports);
|
|
25
|
+
__exportStar(require("./BaseSequelizeTable"), exports);
|
|
25
26
|
__exportStar(require("./BaseTable"), exports);
|
|
26
27
|
__exportStar(require("./EmailService"), exports);
|
|
27
28
|
__exportStar(require("./EnvService"), exports);
|
|
28
29
|
__exportStar(require("./IPOperation"), exports);
|
|
30
|
+
__exportStar(require("./Meta"), exports);
|
|
31
|
+
__exportStar(require("./OTPOperation"), exports);
|
|
29
32
|
__exportStar(require("./RequestHeaderService"), exports);
|
|
30
33
|
__exportStar(require("./ServerToServerOperation"), exports);
|
|
31
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,mDAAiC;AACjC,iDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,mDAAiC;AACjC,iDAA+B;AAC/B,sDAAoC;AACpC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,8CAA4B;AAC5B,iDAA+B;AAC/B,+CAA6B;AAC7B,gDAA8B;AAC9B,yCAAuB;AACvB,iDAA+B;AAC/B,yDAAuC;AACvC,4DAA0C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "namirasoft-node",
|
|
3
3
|
"description": "Namira Software Corporation Node NPM Package",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {},
|
|
@@ -9,25 +9,25 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@supercharge/request-ip": "^1.2.0",
|
|
12
|
-
"@types/cors": "^2.8.
|
|
13
|
-
"@types/express": "^4.17.
|
|
12
|
+
"@types/cors": "^2.8.16",
|
|
13
|
+
"@types/express": "^4.17.21",
|
|
14
14
|
"@types/nodemailer": "^6.4.13",
|
|
15
|
-
"@types/nodemailer-smtp-transport": "^2.7.
|
|
15
|
+
"@types/nodemailer-smtp-transport": "^2.7.8",
|
|
16
16
|
"@types/swagger-jsdoc": "^6.0.2",
|
|
17
17
|
"@types/swagger-ui-express": "^4.1.5",
|
|
18
18
|
"cors": "^2.8.5",
|
|
19
19
|
"express": "^4.18.2",
|
|
20
20
|
"joi": "^17.11.0",
|
|
21
|
-
"namirasoft-core": "^1.0.
|
|
22
|
-
"namirasoft-log": "^1.0.
|
|
21
|
+
"namirasoft-core": "^1.0.11",
|
|
22
|
+
"namirasoft-log": "^1.0.1",
|
|
23
23
|
"nodemailer": "^6.9.7",
|
|
24
|
-
"nodemailer-smtp-transport": "^2.4
|
|
24
|
+
"nodemailer-smtp-transport": "^2.7.4",
|
|
25
25
|
"request-ip": "^3.3.0",
|
|
26
|
-
"sequelize": "^6.
|
|
26
|
+
"sequelize": "^6.34.0",
|
|
27
27
|
"swagger-jsdoc": "^6.2.8",
|
|
28
28
|
"swagger-ui-express": "^5.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^20.
|
|
31
|
+
"@types/node": "^20.8.10"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/BaseApplication.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { BaseDatabase } from './BaseDatabase';
|
|
|
7
7
|
import { ILogger } from "namirasoft-log";
|
|
8
8
|
import { BaseApplicationLink } from './BaseApplicationLink';
|
|
9
9
|
import path from 'path';
|
|
10
|
+
import { PackageService } from 'namirasoft-core';
|
|
10
11
|
|
|
11
12
|
export abstract class BaseApplication<D extends BaseDatabase>
|
|
12
13
|
{
|
|
@@ -24,12 +25,13 @@ export abstract class BaseApplication<D extends BaseDatabase>
|
|
|
24
25
|
protected abstract getLogger(): ILogger;
|
|
25
26
|
protected abstract getRouter(): Router;
|
|
26
27
|
protected abstract getPort(): number;
|
|
27
|
-
constructor(
|
|
28
|
+
constructor(serverPath: string, swaggerPath: string | null = null)
|
|
28
29
|
{
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
30
|
+
let json = PackageService.getMain();
|
|
31
|
+
this.title = json?.getTitle() ?? "";
|
|
32
|
+
this.description = json?.getDescription() ?? "";
|
|
33
|
+
this.logo = json?.getLogo() ?? "";
|
|
34
|
+
this.version = json?.getVersion() ?? "";
|
|
33
35
|
this.serverPath = serverPath;
|
|
34
36
|
this.swaggerPath = swaggerPath ?? (serverPath + "/swagger");
|
|
35
37
|
this.logger = this.getLogger();
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
export * from "./AnomalyDetector";
|
|
2
2
|
export * from "./BaseApplication";
|
|
3
|
+
export * from "./BaseApplicationLink";
|
|
3
4
|
export * from "./BaseController";
|
|
4
5
|
export * from "./BaseDatabase";
|
|
5
|
-
export * from "./BaseSequelizeModel";
|
|
6
6
|
export * from "./BaseMySqlDatabase";
|
|
7
|
-
export * from "./BaseSequelizeTable";
|
|
8
7
|
export * from "./BaseSequelizeDatabase";
|
|
8
|
+
export * from "./BaseSequelizeModel";
|
|
9
|
+
export * from "./BaseSequelizeTable";
|
|
9
10
|
export * from "./BaseTable";
|
|
10
11
|
export * from "./EmailService";
|
|
11
12
|
export * from "./EnvService";
|
|
12
13
|
export * from "./IPOperation";
|
|
14
|
+
export * from "./Meta";
|
|
15
|
+
export * from "./OTPOperation";
|
|
13
16
|
export * from "./RequestHeaderService";
|
|
14
17
|
export * from "./ServerToServerOperation";
|