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