@ccci/micro-server 1.0.91 → 1.0.92
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 +5 -5
- package/dist/utils/BaseModel.d.ts +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -119663,8 +119663,8 @@ class BaseController {
|
|
|
119663
119663
|
}
|
|
119664
119664
|
// src/utils/BaseModel.ts
|
|
119665
119665
|
class BaseModel extends Model {
|
|
119666
|
-
static getCommonAttributes() {
|
|
119667
|
-
return {
|
|
119666
|
+
static getCommonAttributes(defaultAttributes) {
|
|
119667
|
+
return defaultAttributes ? {
|
|
119668
119668
|
createdById: {
|
|
119669
119669
|
type: new DataTypes.INTEGER,
|
|
119670
119670
|
comment: "UserId of the creator"
|
|
@@ -119677,14 +119677,14 @@ class BaseModel extends Model {
|
|
|
119677
119677
|
type: new DataTypes.BOOLEAN,
|
|
119678
119678
|
comment: "Record active indicator"
|
|
119679
119679
|
}
|
|
119680
|
-
};
|
|
119680
|
+
} : null;
|
|
119681
119681
|
}
|
|
119682
119682
|
static getCommonAssociations() {
|
|
119683
119683
|
}
|
|
119684
|
-
static initialize(fields, tableName, schema, paranoid = true) {
|
|
119684
|
+
static initialize(fields, tableName, schema, paranoid = true, defaultAttributes = true) {
|
|
119685
119685
|
this.init({
|
|
119686
119686
|
...fields,
|
|
119687
|
-
...this.getCommonAttributes()
|
|
119687
|
+
...this.getCommonAttributes(defaultAttributes)
|
|
119688
119688
|
}, {
|
|
119689
119689
|
sequelize: DatabaseConnector.getConnection(),
|
|
119690
119690
|
tableName,
|
|
@@ -7,7 +7,7 @@ export default class BaseModel extends Model implements IBaseModel {
|
|
|
7
7
|
* Sets common model attributes
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
static getCommonAttributes(): {
|
|
10
|
+
static getCommonAttributes(defaultAttributes: boolean): {
|
|
11
11
|
createdById: {
|
|
12
12
|
type: DataTypes.IntegerDataType;
|
|
13
13
|
comment: string;
|
|
@@ -20,7 +20,7 @@ export default class BaseModel extends Model implements IBaseModel {
|
|
|
20
20
|
type: DataTypes.AbstractDataType;
|
|
21
21
|
comment: string;
|
|
22
22
|
};
|
|
23
|
-
};
|
|
23
|
+
} | null;
|
|
24
24
|
static getCommonAssociations(): void;
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
@@ -28,7 +28,8 @@ export default class BaseModel extends Model implements IBaseModel {
|
|
|
28
28
|
* @param {string} tableName name of the table
|
|
29
29
|
* @param {string} schema this will overwrite the default schema
|
|
30
30
|
* @param {boolean} paranoid paranoid option. defaults to true
|
|
31
|
+
* @param {boolean} defaultAttributes need to inherit default attributes. defaults to true
|
|
31
32
|
*/
|
|
32
|
-
static initialize(fields: ModelAttributes, tableName: string, schema?: string, paranoid?: boolean): void;
|
|
33
|
+
static initialize(fields: ModelAttributes, tableName: string, schema?: string, paranoid?: boolean, defaultAttributes?: boolean): void;
|
|
33
34
|
}
|
|
34
35
|
//# sourceMappingURL=BaseModel.d.ts.map
|