@ticatec/common-express-server 0.3.0 → 0.3.1
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/lib/AppConf.d.ts +31 -0
- package/lib/AppConf.js +57 -0
- package/lib/AppConf.js.map +1 -0
- package/lib/BaseServer.d.ts +125 -0
- package/lib/BaseServer.js +155 -0
- package/lib/BaseServer.js.map +1 -0
- package/lib/CommonProcessor.d.ts +49 -0
- package/lib/CommonProcessor.js +99 -0
- package/lib/CommonProcessor.js.map +1 -0
- package/lib/CommonRouterHelper.d.ts +64 -0
- package/lib/CommonRouterHelper.js +134 -0
- package/lib/CommonRouterHelper.js.map +1 -0
- package/lib/CommonRoutes.d.ts +33 -0
- package/lib/CommonRoutes.js +57 -0
- package/lib/CommonRoutes.js.map +1 -0
- package/lib/LoggedUser.d.ts +33 -0
- package/lib/LoggedUser.js +3 -0
- package/lib/LoggedUser.js.map +1 -0
- package/lib/ProcessorManager.d.ts +14 -0
- package/lib/ProcessorManager.js +30 -0
- package/lib/ProcessorManager.js.map +1 -0
- package/lib/common/AdminBaseController.d.ts +30 -0
- package/lib/common/AdminBaseController.js +41 -0
- package/lib/common/AdminBaseController.js.map +1 -0
- package/lib/common/AdminSearchController.d.ts +13 -0
- package/lib/common/AdminSearchController.js +26 -0
- package/lib/common/AdminSearchController.js.map +1 -0
- package/lib/common/BaseController.d.ts +28 -0
- package/lib/common/BaseController.js +35 -0
- package/lib/common/BaseController.js.map +1 -0
- package/lib/common/CommonController.d.ts +96 -0
- package/lib/common/CommonController.js +129 -0
- package/lib/common/CommonController.js.map +1 -0
- package/lib/common/TenantBaseController.d.ts +30 -0
- package/lib/common/TenantBaseController.js +41 -0
- package/lib/common/TenantBaseController.js.map +1 -0
- package/lib/common/TenantSearchController.d.ts +13 -0
- package/lib/common/TenantSearchController.js +27 -0
- package/lib/common/TenantSearchController.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const express_exception_1 = require("@ticatec/express-exception");
|
|
7
|
+
const BaseController_1 = __importDefault(require("./BaseController"));
|
|
8
|
+
const bean_validator_1 = __importDefault(require("@ticatec/bean-validator"));
|
|
9
|
+
/**
|
|
10
|
+
* Controller class that implements Create/Read/Update/Delete operations
|
|
11
|
+
* @template T The service type this controller depends on
|
|
12
|
+
*/
|
|
13
|
+
class CommonController extends BaseController_1.default {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor for common controller
|
|
16
|
+
* @param service The service instance to inject
|
|
17
|
+
* @param rules Validation rules for entities (optional)
|
|
18
|
+
* @protected
|
|
19
|
+
*/
|
|
20
|
+
constructor(service, rules = null) {
|
|
21
|
+
super(service);
|
|
22
|
+
this.rules = rules;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Validates entity data
|
|
26
|
+
* @param data The data to validate
|
|
27
|
+
* @protected
|
|
28
|
+
*/
|
|
29
|
+
validateEntity(data) {
|
|
30
|
+
let result = bean_validator_1.default.validate(data, this.rules);
|
|
31
|
+
if (!result.valid) {
|
|
32
|
+
BaseController_1.default.debugEnabled && this.logger.debug(`Invalid data: ${result.errorMessage}`);
|
|
33
|
+
throw new express_exception_1.IllegalParameterError(result.errorMessage);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates new entity endpoint
|
|
38
|
+
* @returns RESTful function for creating new entities
|
|
39
|
+
*/
|
|
40
|
+
createNew() {
|
|
41
|
+
return async (req) => {
|
|
42
|
+
return this._createNew(req);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Updates entity endpoint
|
|
47
|
+
* @returns RESTful function for updating entities
|
|
48
|
+
*/
|
|
49
|
+
update() {
|
|
50
|
+
return async (req) => {
|
|
51
|
+
return this._update(req);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Deletes entity endpoint
|
|
56
|
+
* @returns RESTful function for deleting entities
|
|
57
|
+
*/
|
|
58
|
+
del() {
|
|
59
|
+
return async (req) => {
|
|
60
|
+
return this._del(req);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a service interface method exists
|
|
65
|
+
* @param name The method name to check
|
|
66
|
+
* @protected
|
|
67
|
+
*/
|
|
68
|
+
checkInterface(name) {
|
|
69
|
+
if (this.service[name] == null) {
|
|
70
|
+
this.logger.warn(`Current service does not have interface: ${name}`);
|
|
71
|
+
throw new express_exception_1.ActionNotFoundError(`Current service does not have interface: ${name}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Invokes service interface by name
|
|
76
|
+
* @param name The method name to invoke
|
|
77
|
+
* @param args Arguments to pass to the method
|
|
78
|
+
* @returns Promise resolving to the method result
|
|
79
|
+
* @protected
|
|
80
|
+
*/
|
|
81
|
+
async invokeServiceInterface(name, args = []) {
|
|
82
|
+
return await this.service[name](...args);
|
|
83
|
+
}
|
|
84
|
+
buildNewEntry(req) {
|
|
85
|
+
return req.body;
|
|
86
|
+
}
|
|
87
|
+
buildUpdatedEntry(req) {
|
|
88
|
+
return req.body;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a new entity
|
|
92
|
+
* @param req Express request object
|
|
93
|
+
* @returns Promise resolving to the created entity
|
|
94
|
+
* @protected
|
|
95
|
+
*/
|
|
96
|
+
_createNew(req) {
|
|
97
|
+
let data = this.buildNewEntry(req);
|
|
98
|
+
BaseController_1.default.debugEnabled && this.logger.debug(`${req.method} ${req.originalUrl} Request to create an entity`, data);
|
|
99
|
+
this.checkInterface('createNew');
|
|
100
|
+
this.validateEntity(data);
|
|
101
|
+
return this.invokeServiceInterface('createNew', this.getCreateNewArguments(req));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Updates an entity
|
|
105
|
+
* @param req Express request object
|
|
106
|
+
* @returns Promise resolving to the updated entity
|
|
107
|
+
* @protected
|
|
108
|
+
*/
|
|
109
|
+
_update(req) {
|
|
110
|
+
let data = this.buildUpdatedEntry(req);
|
|
111
|
+
BaseController_1.default.debugEnabled && this.logger.debug(`${req.method} ${req.originalUrl} Request to update an entity`, data);
|
|
112
|
+
this.checkInterface('update');
|
|
113
|
+
this.validateEntity(data);
|
|
114
|
+
return this.invokeServiceInterface('update', this.getUpdateArguments(req));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Deletes an entity
|
|
118
|
+
* @param req Express request object
|
|
119
|
+
* @returns Promise resolving when entity is deleted
|
|
120
|
+
* @protected
|
|
121
|
+
*/
|
|
122
|
+
_del(req) {
|
|
123
|
+
// Please implement delete interface in subclass, otherwise system exception will be thrown
|
|
124
|
+
this.logger.warn('Current service does not have delete interface');
|
|
125
|
+
throw new express_exception_1.ActionNotFoundError('Current service does not have delete interface');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.default = CommonController;
|
|
129
|
+
//# sourceMappingURL=CommonController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommonController.js","sourceRoot":"src/","sources":["common/CommonController.ts"],"names":[],"mappings":";;;;;AACA,kEAAsF;AACtF,sEAA8C;AAC9C,6EAAuE;AAIvE;;;GAGG;AACH,MAA8B,gBAAoB,SAAQ,wBAAiB;IAQvE;;;;;OAKG;IACH,YAAsB,OAAU,EAAE,QAAyB,IAAI;QAC3D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACO,cAAc,CAAC,IAAS;QAC9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gD,CAAC,CAAC;IACpF,CAAC;CAmBJ;AAtJD,mCAsJC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import CommonController from "./CommonController";
|
|
2
|
+
import { ValidationRules } from "@ticatec/bean-validator";
|
|
3
|
+
import { Request } from "express";
|
|
4
|
+
/**
|
|
5
|
+
* Base class for tenant-specific interfaces
|
|
6
|
+
* @template T The service type this controller depends on
|
|
7
|
+
*/
|
|
8
|
+
export default abstract class TenantBaseController<T> extends CommonController<T> {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor for tenant base controller
|
|
11
|
+
* @param service The service instance to inject
|
|
12
|
+
* @param rules Entity validation rules
|
|
13
|
+
* @protected
|
|
14
|
+
*/
|
|
15
|
+
protected constructor(service: any, rules: ValidationRules);
|
|
16
|
+
/**
|
|
17
|
+
* Gets arguments for creating new entity, first parameter is logged user, second is request data
|
|
18
|
+
* @param req Express request object
|
|
19
|
+
* @returns Array containing logged user and request body
|
|
20
|
+
* @protected
|
|
21
|
+
*/
|
|
22
|
+
protected getCreateNewArguments(req: Request): Array<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets arguments for updating entity, first parameter is logged user, second is request data
|
|
25
|
+
* @param req Express request object
|
|
26
|
+
* @returns Array containing logged user and request body
|
|
27
|
+
* @protected
|
|
28
|
+
*/
|
|
29
|
+
protected getUpdateArguments(req: Request): any[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const CommonController_1 = __importDefault(require("./CommonController"));
|
|
7
|
+
/**
|
|
8
|
+
* Base class for tenant-specific interfaces
|
|
9
|
+
* @template T The service type this controller depends on
|
|
10
|
+
*/
|
|
11
|
+
class TenantBaseController extends CommonController_1.default {
|
|
12
|
+
/**
|
|
13
|
+
* Constructor for tenant base controller
|
|
14
|
+
* @param service The service instance to inject
|
|
15
|
+
* @param rules Entity validation rules
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
18
|
+
constructor(service, rules) {
|
|
19
|
+
super(service, rules);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets arguments for creating new entity, first parameter is logged user, second is request data
|
|
23
|
+
* @param req Express request object
|
|
24
|
+
* @returns Array containing logged user and request body
|
|
25
|
+
* @protected
|
|
26
|
+
*/
|
|
27
|
+
getCreateNewArguments(req) {
|
|
28
|
+
return [this.getLoggedUser(req), req.body];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets arguments for updating entity, first parameter is logged user, second is request data
|
|
32
|
+
* @param req Express request object
|
|
33
|
+
* @returns Array containing logged user and request body
|
|
34
|
+
* @protected
|
|
35
|
+
*/
|
|
36
|
+
getUpdateArguments(req) {
|
|
37
|
+
return [this.getLoggedUser(req), req.body];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = TenantBaseController;
|
|
41
|
+
//# sourceMappingURL=TenantBaseController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantBaseController.js","sourceRoot":"src/","sources":["common/TenantBaseController.ts"],"names":[],"mappings":";;;;;AACA,0EAAkD;AAIlD;;;GAGG;AACH,MAA8B,oBAAwB,SAAQ,0BAAmB;IAE7E;;;;;OAKG;IACH,YAAsB,OAAY,EAAE,KAAsB;QACtD,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACO,qBAAqB,CAAC,GAAY;QACxC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED;;;;;OAKG;IACO,kBAAkB,CAAC,GAAY;QACrC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CAEJ;AAhCD,uCAgCC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Request } from "express";
|
|
2
|
+
import TenantBaseController from "./TenantBaseController";
|
|
3
|
+
/**
|
|
4
|
+
* Interface with search capabilities for tenant use
|
|
5
|
+
* @template T The service type this controller depends on
|
|
6
|
+
*/
|
|
7
|
+
export default abstract class TenantSearchController<T> extends TenantBaseController<T> {
|
|
8
|
+
/**
|
|
9
|
+
* Search method for querying entities with tenant context
|
|
10
|
+
* @returns Function that handles tenant-specific search requests
|
|
11
|
+
*/
|
|
12
|
+
search(): (req: Request) => Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const TenantBaseController_1 = __importDefault(require("./TenantBaseController"));
|
|
7
|
+
const BaseController_1 = __importDefault(require("./BaseController"));
|
|
8
|
+
/**
|
|
9
|
+
* Interface with search capabilities for tenant use
|
|
10
|
+
* @template T The service type this controller depends on
|
|
11
|
+
*/
|
|
12
|
+
class TenantSearchController extends TenantBaseController_1.default {
|
|
13
|
+
/**
|
|
14
|
+
* Search method for querying entities with tenant context
|
|
15
|
+
* @returns Function that handles tenant-specific search requests
|
|
16
|
+
*/
|
|
17
|
+
search() {
|
|
18
|
+
return async (req) => {
|
|
19
|
+
let query = req.query;
|
|
20
|
+
BaseController_1.default.debugEnabled && this.logger.debug(`Path: ${req.path}, query by criteria:`, query);
|
|
21
|
+
this.checkInterface('search');
|
|
22
|
+
return await this.invokeServiceInterface('search', [this.getLoggedUser(req), query]);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = TenantSearchController;
|
|
27
|
+
//# sourceMappingURL=TenantSearchController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantSearchController.js","sourceRoot":"src/","sources":["common/TenantSearchController.ts"],"names":[],"mappings":";;;;;AACA,kFAA0D;AAC1D,sEAA8C;AAE9C;;;GAGG;AACH,MAA8B,sBAA0B,SAAQ,8BAAuB;IAEnF;;;OAGG;IACH,MAAM;QACF,OAAO,KAAK,EAAE,GAAW,EAAe,EAAE;YACtC,IAAI,KAAK,GAAO,GAAG,CAAC,KAAK,CAAC;YAC1B,wBAAc,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,IAAI,sBAAsB,EAAE,KAAK,CAAC,CAAC;YACjG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACzF,CAAC,CAAA;IACL,CAAC;CAEJ;AAfD,yCAeC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import BaseServer from './BaseServer';
|
|
2
|
+
export { default as CommonRouterHelper } from './CommonRouterHelper';
|
|
3
|
+
export { default as CommonRoutes } from './CommonRoutes';
|
|
4
|
+
export { default as AppConf } from './AppConf';
|
|
5
|
+
export { default as LoggedUser, CommonUser } from './LoggedUser';
|
|
6
|
+
export { default as BaseController } from './common/BaseController';
|
|
7
|
+
export { default as CommonController } from './common/CommonController';
|
|
8
|
+
export { default as AdminBaseController } from './common/AdminBaseController';
|
|
9
|
+
export { default as TenantBaseController } from './common/TenantBaseController';
|
|
10
|
+
export { default as AdminSearchController } from './common/AdminSearchController';
|
|
11
|
+
export { default as TenantSearchController } from './common/TenantSearchController';
|
|
12
|
+
export type { RestfulFunction, ControlFunction } from './CommonRouterHelper';
|
|
13
|
+
export type { moduleLoader } from './BaseServer';
|
|
14
|
+
export default BaseServer;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Main entry point for @ticatec/common-express-server
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TenantSearchController = exports.AdminSearchController = exports.TenantBaseController = exports.AdminBaseController = exports.CommonController = exports.BaseController = exports.AppConf = exports.CommonRoutes = exports.CommonRouterHelper = void 0;
|
|
8
|
+
// Core classes
|
|
9
|
+
const BaseServer_1 = __importDefault(require("./BaseServer"));
|
|
10
|
+
var CommonRouterHelper_1 = require("./CommonRouterHelper");
|
|
11
|
+
Object.defineProperty(exports, "CommonRouterHelper", { enumerable: true, get: function () { return __importDefault(CommonRouterHelper_1).default; } });
|
|
12
|
+
var CommonRoutes_1 = require("./CommonRoutes");
|
|
13
|
+
Object.defineProperty(exports, "CommonRoutes", { enumerable: true, get: function () { return __importDefault(CommonRoutes_1).default; } });
|
|
14
|
+
var AppConf_1 = require("./AppConf");
|
|
15
|
+
Object.defineProperty(exports, "AppConf", { enumerable: true, get: function () { return __importDefault(AppConf_1).default; } });
|
|
16
|
+
// Controllers
|
|
17
|
+
var BaseController_1 = require("./common/BaseController");
|
|
18
|
+
Object.defineProperty(exports, "BaseController", { enumerable: true, get: function () { return __importDefault(BaseController_1).default; } });
|
|
19
|
+
var CommonController_1 = require("./common/CommonController");
|
|
20
|
+
Object.defineProperty(exports, "CommonController", { enumerable: true, get: function () { return __importDefault(CommonController_1).default; } });
|
|
21
|
+
var AdminBaseController_1 = require("./common/AdminBaseController");
|
|
22
|
+
Object.defineProperty(exports, "AdminBaseController", { enumerable: true, get: function () { return __importDefault(AdminBaseController_1).default; } });
|
|
23
|
+
var TenantBaseController_1 = require("./common/TenantBaseController");
|
|
24
|
+
Object.defineProperty(exports, "TenantBaseController", { enumerable: true, get: function () { return __importDefault(TenantBaseController_1).default; } });
|
|
25
|
+
var AdminSearchController_1 = require("./common/AdminSearchController");
|
|
26
|
+
Object.defineProperty(exports, "AdminSearchController", { enumerable: true, get: function () { return __importDefault(AdminSearchController_1).default; } });
|
|
27
|
+
var TenantSearchController_1 = require("./common/TenantSearchController");
|
|
28
|
+
Object.defineProperty(exports, "TenantSearchController", { enumerable: true, get: function () { return __importDefault(TenantSearchController_1).default; } });
|
|
29
|
+
exports.default = BaseServer_1.default;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":";AACA,sDAAsD;;;;;;AAEtD,eAAe;AACf,8DAAsC;AAEtC,2DAAmE;AAA3D,yIAAA,OAAO,OAAsB;AACrC,+CAAuD;AAA/C,6HAAA,OAAO,OAAgB;AAC/B,qCAA6C;AAArC,mHAAA,OAAO,OAAW;AAK1B,cAAc;AACd,0DAAoE;AAA3D,iIAAA,OAAO,OAAkB;AAClC,8DAAwE;AAA/D,qIAAA,OAAO,OAAoB;AACpC,oEAA8E;AAArE,2IAAA,OAAO,OAAuB;AACvC,sEAAgF;AAAvE,6IAAA,OAAO,OAAwB;AACxC,wEAAkF;AAAzE,+IAAA,OAAO,OAAyB;AACzC,0EAAoF;AAA3E,iJAAA,OAAO,OAA0B;AAM1C,kBAAe,oBAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ticatec/common-express-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A comprehensive TypeScript library providing common classes, controllers, and middleware for building scalable Express.js applications with multi-tenant support.",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"build": "npm run clean && tsc",
|
|
8
|
+
"build": "rm -rf ./lib && tsc",
|
|
10
9
|
"build:watch": "tsc --watch",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
10
|
+
"clean": "rm -rf ./lib",
|
|
11
|
+
"prepare": "npm run build",
|
|
12
|
+
"prepack": "npm run build",
|
|
14
13
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
14
|
"lint": "echo \"No linting configured\"",
|
|
16
15
|
"typecheck": "tsc --noEmit",
|
|
17
|
-
"dev": "tsc --watch"
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"publish-public": "npm run build && npm publish --access public"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"express",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/ticatec/common-express-server#readme",
|
|
48
48
|
"files": [
|
|
49
|
-
"
|
|
49
|
+
"lib/**/*",
|
|
50
50
|
"README.md",
|
|
51
51
|
"LICENSE",
|
|
52
52
|
"package.json"
|