@ccci/micro-server 1.0.225 → 1.0.227

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -293256,15 +293256,10 @@ class RouterFactory {
293256
293256
  let bearerToken = req.headers.authorization;
293257
293257
  if (bearerToken && bearerToken != null && bearerToken != "null") {
293258
293258
  const token = bearerToken.split(" ")[1];
293259
- console.log("token :>> ", token);
293260
293259
  const payload = decode(token);
293261
- Logger.info("payload :>> ", payload);
293262
293260
  const clientSecret = payload.clientSecret;
293263
- Logger.info("clientSecret :>> ", clientSecret);
293264
293261
  const decoded = verify(token, clientSecret);
293265
- Logger.info("decoded :>> ", decoded);
293266
293262
  req.user = decoded;
293267
- console.log("req.user", req.user);
293268
293263
  } else if (!grantPublicAccess)
293269
293264
  return res.status(401).send({ success: false, error: 1004, errorMessage: "Unauthorized. No access token found on the request." });
293270
293265
  next();
@@ -299691,6 +299686,7 @@ class BaseModel extends Model {
299691
299686
  comment: "",
299692
299687
  timestamps: true
299693
299688
  };
299689
+ let enableDefaultFields = true;
299694
299690
  if (typeof tableOption === "string") {
299695
299691
  initOptions = {
299696
299692
  sequelize: DatabaseConnector.getConnection(),
@@ -299698,8 +299694,9 @@ class BaseModel extends Model {
299698
299694
  schema: schema || process.env.DB_SCHEMA,
299699
299695
  paranoid,
299700
299696
  comment: tableOption,
299701
- timestamps: true
299697
+ timestamps: defaultAttributes ? defaultAttributes : true
299702
299698
  };
299699
+ enableDefaultFields = defaultAttributes ? defaultAttributes : true;
299703
299700
  } else {
299704
299701
  initOptions = {
299705
299702
  sequelize: DatabaseConnector.getConnection(),
@@ -299707,12 +299704,15 @@ class BaseModel extends Model {
299707
299704
  schema: tableOption.schema || process.env.DB_SCHEMA,
299708
299705
  paranoid: tableOption.paranoid === undefined ? paranoid : tableOption.paranoid,
299709
299706
  comment: tableOption.comment ? tableOption.comment : tableOption.tableName,
299710
- timestamps: true
299707
+ timestamps: tableOption.defaultAttributes ? tableOption.defaultAttributes : true
299711
299708
  };
299709
+ enableDefaultFields = tableOption.defaultAttributes ? tableOption.defaultAttributes : true;
299712
299710
  }
299711
+ Logger.info("initOptions :>> ", initOptions);
299712
+ Logger.info("initOptions :>> ", enableDefaultFields);
299713
299713
  this.init({
299714
299714
  ...fields,
299715
- ...this.getCommonAttributes(defaultAttributes)
299715
+ ...this.getCommonAttributes(enableDefaultFields)
299716
299716
  }, initOptions);
299717
299717
  }
299718
299718
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.225",
3
+ "version": "1.0.227",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",