pangea-server 1.0.63 → 1.0.64
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.
|
@@ -12,7 +12,8 @@ type FindOneOptions = {
|
|
|
12
12
|
order?: Order;
|
|
13
13
|
paranoid?: boolean;
|
|
14
14
|
};
|
|
15
|
-
type AggregateOneOptions = {
|
|
15
|
+
type AggregateOneOptions<BM extends BaseModel> = {
|
|
16
|
+
where?: Where<BM>;
|
|
16
17
|
paranoid?: boolean;
|
|
17
18
|
};
|
|
18
19
|
type FindManyOptions<BM extends BaseModel> = {
|
|
@@ -36,7 +37,7 @@ export declare class Db {
|
|
|
36
37
|
constructor(tx: Tx);
|
|
37
38
|
findOneOrNull<BM extends BaseModel>(model: BaseModelCtor<BM>, filters: Filters<BM>, options?: FindOneOptions): Promise<BM | null>;
|
|
38
39
|
findOne<BM extends BaseModel>(model: BaseModelCtor<BM>, filters: Filters<BM>, options?: FindOneOptions): Promise<BM>;
|
|
39
|
-
aggregateOne<BM extends BaseModel>(model: BaseModelCtor<BM>, attributes: Attributes, options?: AggregateOneOptions): Promise<BM | null>;
|
|
40
|
+
aggregateOne<BM extends BaseModel>(model: BaseModelCtor<BM>, attributes: Attributes, options?: AggregateOneOptions<BM>): Promise<BM | null>;
|
|
40
41
|
private __getFindOneBaseOptions;
|
|
41
42
|
findMany<BM extends BaseModel>(model: BaseModelCtor<BM>, options?: FindManyPagedOptions<BM>): Promise<BM[]>;
|
|
42
43
|
count<BM extends BaseModel>(model: BaseModelCtor<BM>, options?: FindManyOptions<BM>): Promise<number>;
|
|
@@ -37,7 +37,7 @@ class Db {
|
|
|
37
37
|
return model.findOne({
|
|
38
38
|
...baseOptions,
|
|
39
39
|
attributes: getFinalAttributes(model, attributes),
|
|
40
|
-
...getInclude(model, { attributes }),
|
|
40
|
+
...getInclude(model, { attributes, where: options.where }),
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
__getFindOneBaseOptions(paranoid) {
|