@ccci/micro-server 0.0.30 → 0.0.32

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/index.d.ts CHANGED
@@ -4,5 +4,7 @@ export { default as RouterFactory } from './utils/RouterFactory';
4
4
  export { default as BaseRouter } from './utils/BaseRouter';
5
5
  export { default as BaseController } from './utils/BaseController';
6
6
  export { ConstructQuery, ResponseHelper, ErrorResponseHandler, } from './utils/BaseControllerHelper';
7
+ export { default as IBaseModel } from './utils/IBaseModel';
8
+ export { default as BaseModel } from './utils/BaseModel';
7
9
  export { default as DatabaseConnector } from './utils/DatabaseConnector';
8
10
  export { PublicAccess, PrivateAccess, endpoint } from './decorators/Endpoints';
package/dist/index.js CHANGED
@@ -88237,6 +88237,40 @@ class BaseController {
88237
88237
  async afterFind(req) {
88238
88238
  }
88239
88239
  }
88240
+ // src/utils/BaseModel.ts
88241
+ class BaseModel extends Model {
88242
+ constructor() {
88243
+ super(...arguments);
88244
+ }
88245
+ static getCommonAttributes() {
88246
+ return {
88247
+ createdById: {
88248
+ type: new DataTypes.INTEGER,
88249
+ comment: "UserId of the creator"
88250
+ },
88251
+ updatedById: {
88252
+ type: new DataTypes.INTEGER,
88253
+ comment: "UserId of the modifier"
88254
+ },
88255
+ isActive: {
88256
+ type: new DataTypes.BOOLEAN,
88257
+ comment: "Record active indicator"
88258
+ }
88259
+ };
88260
+ }
88261
+ static getCommonAssociations() {
88262
+ }
88263
+ static initialize(fields, name) {
88264
+ this.init({
88265
+ ...fields,
88266
+ ...this.getCommonAttributes()
88267
+ }, {
88268
+ sequelize: DatabaseConnector.getConnection(),
88269
+ tableName: name,
88270
+ paranoid: true
88271
+ });
88272
+ }
88273
+ }
88240
88274
  // src/decorators/Endpoints.ts
88241
88275
  var endpoint = (target, methodName, descriptor) => {
88242
88276
  };
@@ -88260,6 +88294,7 @@ export {
88260
88294
  DatabaseConnector,
88261
88295
  ConstructQuery,
88262
88296
  BaseRouter,
88297
+ BaseModel,
88263
88298
  BaseController,
88264
88299
  ApplicationServer
88265
88300
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",