pangea-server 3.3.106 → 3.3.108
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.
|
@@ -14,10 +14,9 @@ declare global {
|
|
|
14
14
|
type ColComputed<T> = CreationOptional<T>;
|
|
15
15
|
type ModelInstance<BM extends BaseModel> = InferAttributes<BM> & {
|
|
16
16
|
id: ModelId;
|
|
17
|
-
init?: () => void;
|
|
18
17
|
};
|
|
19
18
|
type Where<BM extends BaseModel> = WhereOptions<BM> & Record<symbol, any>;
|
|
20
|
-
type InsertParams<BM extends BaseModel> = OptionalIfNullish<IncludeHidden<StripRelations<Omit<InferCreationAttributes<BM>, 'id'
|
|
19
|
+
type InsertParams<BM extends BaseModel> = OptionalIfNullish<IncludeHidden<StripRelations<Omit<InferCreationAttributes<BM>, 'id'>>>> & {
|
|
21
20
|
id?: ModelId;
|
|
22
21
|
};
|
|
23
22
|
type UpdateParams<BM extends BaseModel> = Partial<InsertParams<BM>>;
|
|
@@ -317,8 +317,9 @@ function processInstance(model, instance) {
|
|
|
317
317
|
processInstance(relModel, relInstance);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
instance.
|
|
321
|
-
|
|
320
|
+
const jsonInstance = instance.toJSON();
|
|
321
|
+
model.InitInstance(jsonInstance);
|
|
322
|
+
return jsonInstance;
|
|
322
323
|
}
|
|
323
324
|
function processInstances(model, instances) {
|
|
324
325
|
return instances.map((instance) => processInstance(model, instance));
|
|
@@ -21,7 +21,7 @@ export declare abstract class BaseModel extends Model {
|
|
|
21
21
|
private static __Relations?;
|
|
22
22
|
id: ModelId;
|
|
23
23
|
version: NonAttribute<number>;
|
|
24
|
-
|
|
24
|
+
static InitInstance(_instance: any): void;
|
|
25
25
|
static get HiddenAttributes(): string[];
|
|
26
26
|
static get Columns(): Columns;
|
|
27
27
|
static get ColumnIndexes(): Index[];
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BaseModel = void 0;
|
|
13
13
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
14
|
class BaseModel extends sequelize_typescript_1.Model {
|
|
15
|
+
static InitInstance(_instance) { }
|
|
15
16
|
static get HiddenAttributes() {
|
|
16
17
|
return this.__HiddenAttributes || [];
|
|
17
18
|
}
|